RTEMS 4.11Annotated Report
Sun Dec 23 02:09:53 2012
080037e0 <IMFS_dump_directory>:
*/
static void IMFS_dump_directory(
IMFS_jnode_t *the_directory,
int level
)
{
80037e0: 37 9c ff c0 addi sp,sp,-64
80037e4: 5b 8b 00 40 sw (sp+64),r11
80037e8: 5b 8c 00 3c sw (sp+60),r12
80037ec: 5b 8d 00 38 sw (sp+56),r13
80037f0: 5b 8e 00 34 sw (sp+52),r14
80037f4: 5b 8f 00 30 sw (sp+48),r15
80037f8: 5b 90 00 2c sw (sp+44),r16
80037fc: 5b 91 00 28 sw (sp+40),r17
8003800: 5b 92 00 24 sw (sp+36),r18
8003804: 5b 93 00 20 sw (sp+32),r19
8003808: 5b 94 00 1c sw (sp+28),r20
800380c: 5b 95 00 18 sw (sp+24),r21
8003810: 5b 96 00 14 sw (sp+20),r22
8003814: 5b 97 00 10 sw (sp+16),r23
8003818: 5b 98 00 0c sw (sp+12),r24
800381c: 5b 99 00 08 sw (sp+8),r25
8003820: 5b 9d 00 04 sw (sp+4),ra
8003824: 78 0b 08 02 mvhi r11,0x802
8003828: 39 6b 72 78 ori r11,r11,0x7278
the_node = the_node->next ) {
the_jnode = (IMFS_jnode_t *) the_node;
for ( i=0 ; i<=level ; i++ )
fprintf(stdout, "...." );
800382c: 78 15 08 02 mvhi r21,0x802
case IMFS_FIFO:
fprintf(stdout, " FIFO not printed\n" );
return;
default:
fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) );
8003830: 78 14 08 02 mvhi r20,0x802
)
{
IMFS_assert( the_jnode );
fprintf(stdout, "%s", the_jnode->name );
switch( IMFS_type( the_jnode ) ) {
8003834: 78 13 08 02 mvhi r19,0x802
default:
fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) );
return;
}
puts("");
8003838: 78 12 08 02 mvhi r18,0x802
case IMFS_SYM_LINK:
fprintf(stdout, " links not printed\n" );
return;
case IMFS_FIFO:
fprintf(stdout, " FIFO not printed\n" );
800383c: 78 11 08 02 mvhi r17,0x802
case IMFS_HARD_LINK:
fprintf(stdout, " links not printed\n" );
return;
case IMFS_SYM_LINK:
fprintf(stdout, " links not printed\n" );
8003840: 78 0d 08 02 mvhi r13,0x802
the_jnode->info.file.indirect,
the_jnode->info.file.doubly_indirect,
the_jnode->info.file.triply_indirect
);
#else
fprintf(stdout, " (file %" PRId32 ")",
8003844: 78 10 08 02 mvhi r16,0x802
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)",
8003848: 78 0f 08 02 mvhi r15,0x802
case IMFS_DIRECTORY:
fprintf(stdout, "/" );
break;
case IMFS_DEVICE:
fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")",
800384c: 78 0e 08 02 mvhi r14,0x802
*/
static void IMFS_dump_directory(
IMFS_jnode_t *the_directory,
int level
)
{
8003850: b8 40 c0 00 mv r24,r2
}
int IMFS_memfile_maximum_size( void )
{
return IMFS_MEMFILE_MAXIMUM_SIZE;
}
8003854: 28 2c 00 50 lw r12,(r1+80)
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 ));
8003858: 34 39 00 54 addi r25,r1,84
the_node = the_node->next ) {
the_jnode = (IMFS_jnode_t *) the_node;
for ( i=0 ; i<=level ; i++ )
fprintf(stdout, "...." );
800385c: 3a b5 42 9c ori r21,r21,0x429c
8003860: b9 60 b8 00 mv r23,r11
case IMFS_FIFO:
fprintf(stdout, " FIFO not printed\n" );
return;
default:
fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) );
8003864: 3a 94 42 fc ori r20,r20,0x42fc
)
{
IMFS_assert( the_jnode );
fprintf(stdout, "%s", the_jnode->name );
switch( IMFS_type( the_jnode ) ) {
8003868: 3a 73 43 80 ori r19,r19,0x4380
default:
fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) );
return;
}
puts("");
800386c: 3a 52 3e 6c ori r18,r18,0x3e6c
case IMFS_SYM_LINK:
fprintf(stdout, " links not printed\n" );
return;
case IMFS_FIFO:
fprintf(stdout, " FIFO not printed\n" );
8003870: 3a 31 42 e8 ori r17,r17,0x42e8
case IMFS_HARD_LINK:
fprintf(stdout, " links not printed\n" );
return;
case IMFS_SYM_LINK:
fprintf(stdout, " links not printed\n" );
8003874: 39 ad 42 d4 ori r13,r13,0x42d4
the_jnode->info.file.indirect,
the_jnode->info.file.doubly_indirect,
the_jnode->info.file.triply_indirect
);
#else
fprintf(stdout, " (file %" PRId32 ")",
8003878: 3a 10 42 c8 ori r16,r16,0x42c8
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)",
800387c: 39 ef 42 b8 ori r15,r15,0x42b8
case IMFS_DIRECTORY:
fprintf(stdout, "/" );
break;
case IMFS_DEVICE:
fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")",
8003880: 39 ce 42 a4 ori r14,r14,0x42a4
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 );
8003884: e0 00 00 43 bi 8003990 <IMFS_dump_directory+0x1b0>
!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++ )
8003888: 34 16 00 00 mvi r22,0
800388c: e0 00 00 06 bi 80038a4 <IMFS_dump_directory+0xc4>
fprintf(stdout, "...." );
8003890: 29 62 00 00 lw r2,(r11+0)
8003894: ba a0 08 00 mv r1,r21
!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++ )
8003898: 36 d6 00 01 addi r22,r22,1
fprintf(stdout, "...." );
800389c: 28 42 00 08 lw r2,(r2+8)
80038a0: f8 00 37 bd calli 8011794 <fputs>
!rtems_chain_is_tail( the_chain, the_node );
the_node = the_node->next ) {
the_jnode = (IMFS_jnode_t *) the_node;
for ( i=0 ; i<=level ; i++ )
80038a4: 4f 16 ff fb bge r24,r22,8003890 <IMFS_dump_directory+0xb0>
IMFS_jnode_t *the_jnode
)
{
IMFS_assert( the_jnode );
fprintf(stdout, "%s", the_jnode->name );
80038a8: 2a e2 00 00 lw r2,(r23+0)
80038ac: 35 81 00 0c addi r1,r12,12
80038b0: 28 42 00 08 lw r2,(r2+8)
80038b4: f8 00 37 b8 calli 8011794 <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;
80038b8: 29 81 00 4c lw r1,(r12+76)
80038bc: 28 23 00 00 lw r3,(r1+0)
switch( IMFS_type( the_jnode ) ) {
80038c0: 34 01 00 06 mvi r1,6
80038c4: 54 61 00 25 bgu r3,r1,8003958 <IMFS_dump_directory+0x178> <== NEVER TAKEN
80038c8: b8 60 08 00 mv r1,r3
80038cc: 34 02 00 02 mvi r2,2
80038d0: f8 00 79 f9 calli 80220b4 <__ashlsi3>
80038d4: b6 61 08 00 add r1,r19,r1
80038d8: 28 21 00 00 lw r1,(r1+0)
80038dc: c0 20 00 00 b r1
case IMFS_DIRECTORY:
fprintf(stdout, "/" );
80038e0: 29 62 00 00 lw r2,(r11+0)
80038e4: 34 01 00 2f mvi r1,47
80038e8: 28 42 00 08 lw r2,(r2+8)
80038ec: f8 00 37 66 calli 8011684 <fputc>
80038f0: e0 00 00 1f bi 800396c <IMFS_dump_directory+0x18c>
break;
case IMFS_DEVICE:
fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")",
80038f4: 29 61 00 00 lw r1,(r11+0)
80038f8: b9 c0 10 00 mv r2,r14
80038fc: 28 21 00 08 lw r1,(r1+8)
8003900: e0 00 00 04 bi 8003910 <IMFS_dump_directory+0x130>
the_jnode->info.device.major, the_jnode->info.device.minor );
break;
case IMFS_LINEAR_FILE:
fprintf(stdout, " (file %" PRId32 " %p)",
8003904: 29 61 00 00 lw r1,(r11+0)
8003908: b9 e0 10 00 mv r2,r15
800390c: 28 21 00 08 lw r1,(r1+8)
8003910: 29 83 00 50 lw r3,(r12+80)
8003914: 29 84 00 54 lw r4,(r12+84)
8003918: f8 00 37 34 calli 80115e8 <fprintf>
800391c: e0 00 00 14 bi 800396c <IMFS_dump_directory+0x18c>
the_jnode->info.file.indirect,
the_jnode->info.file.doubly_indirect,
the_jnode->info.file.triply_indirect
);
#else
fprintf(stdout, " (file %" PRId32 ")",
8003920: 29 61 00 00 lw r1,(r11+0)
8003924: 29 83 00 50 lw r3,(r12+80)
8003928: ba 00 10 00 mv r2,r16
800392c: 28 21 00 08 lw r1,(r1+8)
8003930: f8 00 37 2e calli 80115e8 <fprintf>
8003934: e0 00 00 0e bi 800396c <IMFS_dump_directory+0x18c>
case IMFS_HARD_LINK:
fprintf(stdout, " links not printed\n" );
return;
case IMFS_SYM_LINK:
fprintf(stdout, " links not printed\n" );
8003938: 29 62 00 00 lw r2,(r11+0)
800393c: b9 a0 08 00 mv r1,r13
8003940: e0 00 00 03 bi 800394c <IMFS_dump_directory+0x16c>
return;
case IMFS_FIFO:
fprintf(stdout, " FIFO not printed\n" );
8003944: 29 62 00 00 lw r2,(r11+0)
8003948: ba 20 08 00 mv r1,r17
800394c: 28 42 00 08 lw r2,(r2+8)
8003950: f8 00 37 91 calli 8011794 <fputs>
8003954: e0 00 00 08 bi 8003974 <IMFS_dump_directory+0x194>
return;
default:
fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) );
8003958: 2a e1 00 00 lw r1,(r23+0) <== NOT EXECUTED
800395c: ba 80 10 00 mv r2,r20 <== NOT EXECUTED
8003960: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED
8003964: f8 00 37 21 calli 80115e8 <fprintf> <== NOT EXECUTED
8003968: e0 00 00 03 bi 8003974 <IMFS_dump_directory+0x194> <== NOT EXECUTED
return;
}
puts("");
800396c: ba 40 08 00 mv r1,r18
8003970: f8 00 3f 18 calli 80135d0 <puts>
}
static inline bool IMFS_is_directory( const IMFS_jnode_t *node )
{
return node->control->imfs_type == IMFS_DIRECTORY;
8003974: 29 81 00 4c lw r1,(r12+76)
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 ) )
8003978: 28 21 00 00 lw r1,(r1+0)
800397c: 5c 20 00 04 bne r1,r0,800398c <IMFS_dump_directory+0x1ac>
IMFS_dump_directory( the_jnode, level + 1 );
8003980: b9 80 08 00 mv r1,r12
8003984: 37 02 00 01 addi r2,r24,1
8003988: fb ff ff 96 calli 80037e0 <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 ) {
800398c: 29 8c 00 00 lw r12,(r12+0)
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 );
8003990: 5d 99 ff be bne r12,r25,8003888 <IMFS_dump_directory+0xa8>
fprintf(stdout, "...." );
IMFS_print_jnode( the_jnode );
if ( IMFS_is_directory( the_jnode ) )
IMFS_dump_directory( the_jnode, level + 1 );
}
}
8003994: 2b 9d 00 04 lw ra,(sp+4)
8003998: 2b 8b 00 40 lw r11,(sp+64)
800399c: 2b 8c 00 3c lw r12,(sp+60)
80039a0: 2b 8d 00 38 lw r13,(sp+56)
80039a4: 2b 8e 00 34 lw r14,(sp+52)
80039a8: 2b 8f 00 30 lw r15,(sp+48)
80039ac: 2b 90 00 2c lw r16,(sp+44)
80039b0: 2b 91 00 28 lw r17,(sp+40)
80039b4: 2b 92 00 24 lw r18,(sp+36)
80039b8: 2b 93 00 20 lw r19,(sp+32)
80039bc: 2b 94 00 1c lw r20,(sp+28)
80039c0: 2b 95 00 18 lw r21,(sp+24)
80039c4: 2b 96 00 14 lw r22,(sp+20)
80039c8: 2b 97 00 10 lw r23,(sp+16)
80039cc: 2b 98 00 0c lw r24,(sp+12)
80039d0: 2b 99 00 08 lw r25,(sp+8)
80039d4: 37 9c 00 40 addi sp,sp,64
80039d8: c3 a0 00 00 ret
0800c8a8 <IMFS_eval_token>:
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
800c8a8: 37 9c ff e0 addi sp,sp,-32
800c8ac: 5b 8b 00 20 sw (sp+32),r11
800c8b0: 5b 8c 00 1c sw (sp+28),r12
800c8b4: 5b 8d 00 18 sw (sp+24),r13
800c8b8: 5b 8e 00 14 sw (sp+20),r14
800c8bc: 5b 8f 00 10 sw (sp+16),r15
800c8c0: 5b 90 00 0c sw (sp+12),r16
800c8c4: 5b 91 00 08 sw (sp+8),r17
800c8c8: 5b 9d 00 04 sw (sp+4),ra
rtems_filesystem_eval_path_generic_status status =
RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_get_currentloc( ctx );
IMFS_jnode_t *dir = currentloc->node_access;
800c8cc: 28 2d 00 20 lw r13,(r1+32)
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
800c8d0: b8 60 78 00 mv r15,r3
800c8d4: b8 80 80 00 mv r16,r4
rtems_filesystem_eval_path_generic_status status =
RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_get_currentloc( ctx );
IMFS_jnode_t *dir = currentloc->node_access;
bool access_ok = rtems_filesystem_eval_path_check_access(
800c8d8: 29 a3 00 30 lw r3,(r13+48)
800c8dc: 2d a4 00 3c lhu r4,(r13+60)
800c8e0: 2d a5 00 3e lhu r5,(r13+62)
800c8e4: 34 02 00 01 mvi r2,1
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
800c8e8: b8 20 60 00 mv r12,r1
rtems_filesystem_eval_path_generic_status status =
RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_get_currentloc( ctx );
IMFS_jnode_t *dir = currentloc->node_access;
bool access_ok = rtems_filesystem_eval_path_check_access(
800c8ec: f8 00 03 3e calli 800d5e4 <rtems_filesystem_eval_path_check_access>
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
800c8f0: 34 0e 00 01 mvi r14,1
dir->st_mode,
dir->st_uid,
dir->st_gid
);
if ( access_ok ) {
800c8f4: 44 20 00 46 be r1,r0,800ca0c <IMFS_eval_token+0x164>
static inline bool rtems_filesystem_is_current_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 1 && token [0] == '.';
800c8f8: 5e 0e 00 50 bne r16,r14,800ca38 <IMFS_eval_token+0x190>
800c8fc: 41 e2 00 00 lbu r2,(r15+0)
800c900: 34 01 00 2e mvi r1,46
800c904: 5c 41 00 4f bne r2,r1,800ca40 <IMFS_eval_token+0x198>
800c908: e0 00 00 15 bi 800c95c <IMFS_eval_token+0xb4>
static inline bool rtems_filesystem_is_parent_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 2 && token [0] == '.' && token [1] == '.';
800c90c: 41 e1 00 00 lbu r1,(r15+0)
800c910: 34 02 00 2e mvi r2,46
800c914: 5c 22 00 4b bne r1,r2,800ca40 <IMFS_eval_token+0x198>
800c918: 41 e2 00 01 lbu r2,(r15+1)
800c91c: 5c 41 00 49 bne r2,r1,800ca40 <IMFS_eval_token+0x198> <== NEVER TAKEN
{
if ( rtems_filesystem_is_current_directory( token, tokenlen ) ) {
return dir;
} else {
if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) {
return dir->Parent;
800c920: 29 ab 00 08 lw r11,(r13+8)
800c924: e0 00 00 0f bi 800c960 <IMFS_eval_token+0xb8>
rtems_chain_node *current = rtems_chain_first( entries );
rtems_chain_node *tail = rtems_chain_tail( entries );
while ( current != tail ) {
IMFS_jnode_t *entry = (IMFS_jnode_t *) current;
bool match = strncmp( entry->name, token, tokenlen ) == 0
800c928: 35 c1 00 0c addi r1,r14,12
800c92c: b9 e0 10 00 mv r2,r15
800c930: ba 00 18 00 mv r3,r16
rtems_chain_control *entries = &dir->info.directory.Entries;
rtems_chain_node *current = rtems_chain_first( entries );
rtems_chain_node *tail = rtems_chain_tail( entries );
while ( current != tail ) {
IMFS_jnode_t *entry = (IMFS_jnode_t *) current;
800c934: b9 c0 58 00 mv r11,r14
bool match = strncmp( entry->name, token, tokenlen ) == 0
800c938: f8 00 19 97 calli 8012f94 <strncmp>
&& entry->name [tokenlen] == '\0';
800c93c: 5c 20 00 44 bne r1,r0,800ca4c <IMFS_eval_token+0x1a4>
800c940: b5 d0 10 00 add r2,r14,r16
800c944: 40 42 00 0c lbu r2,(r2+12)
800c948: 44 41 00 06 be r2,r1,800c960 <IMFS_eval_token+0xb8>
800c94c: e0 00 00 40 bi 800ca4c <IMFS_eval_token+0x1a4>
} else {
rtems_chain_control *entries = &dir->info.directory.Entries;
rtems_chain_node *current = rtems_chain_first( entries );
rtems_chain_node *tail = rtems_chain_tail( entries );
while ( current != tail ) {
800c950: 5d d1 ff f6 bne r14,r17,800c928 <IMFS_eval_token+0x80>
rtems_filesystem_eval_path_restart( ctx, fs_root_ptr );
}
}
}
} else {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY;
800c954: 34 0e 00 02 mvi r14,2
800c958: e0 00 00 2d bi 800ca0c <IMFS_eval_token+0x164>
static inline bool rtems_filesystem_is_current_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 1 && token [0] == '.';
800c95c: b9 a0 58 00 mv r11,r13
800c960: 34 0e 00 02 mvi r14,2
);
if ( access_ok ) {
IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen );
if ( entry != NULL ) {
800c964: 45 60 00 2a be r11,r0,800ca0c <IMFS_eval_token+0x164>
rtems_chain_extract_unprotected( &node->Node );
}
static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node )
{
return node->control->imfs_type;
800c968: 29 61 00 4c lw r1,(r11+76)
bool terminal = !rtems_filesystem_eval_path_has_path( ctx );
800c96c: 29 83 00 04 lw r3,(r12+4)
};
void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx )
{
rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config );
}
800c970: 29 82 00 10 lw r2,(r12+16)
800c974: 28 21 00 00 lw r1,(r1+0)
static inline void rtems_filesystem_eval_path_clear_token(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->tokenlen = 0;
800c978: 59 80 00 0c sw (r12+12),r0
if ( access_ok ) {
IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen );
if ( entry != NULL ) {
bool terminal = !rtems_filesystem_eval_path_has_path( ctx );
800c97c: 64 63 00 00 cmpei r3,r3,0
bool follow_sym_link = (eval_flags & RTEMS_FS_FOLLOW_SYM_LINK) != 0;
IMFS_jnode_types_t type = IMFS_type( entry );
rtems_filesystem_eval_path_clear_token( ctx );
if ( type == IMFS_HARD_LINK && (follow_hard_link || !terminal)) {
800c980: 5c 2e 00 06 bne r1,r14,800c998 <IMFS_eval_token+0xf0>
IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen );
if ( entry != NULL ) {
bool terminal = !rtems_filesystem_eval_path_has_path( ctx );
int eval_flags = rtems_filesystem_eval_path_get_flags( ctx );
bool follow_hard_link = (eval_flags & RTEMS_FS_FOLLOW_HARD_LINK) != 0;
800c984: 20 42 00 08 andi r2,r2,0x8
bool follow_sym_link = (eval_flags & RTEMS_FS_FOLLOW_SYM_LINK) != 0;
IMFS_jnode_types_t type = IMFS_type( entry );
rtems_filesystem_eval_path_clear_token( ctx );
if ( type == IMFS_HARD_LINK && (follow_hard_link || !terminal)) {
800c988: 5c 40 00 02 bne r2,r0,800c990 <IMFS_eval_token+0xe8>
800c98c: 5c 62 00 32 bne r3,r2,800ca54 <IMFS_eval_token+0x1ac> <== ALWAYS TAKEN
entry = entry->info.hard_link.link_node;
800c990: 29 6b 00 50 lw r11,(r11+80)
800c994: e0 00 00 30 bi 800ca54 <IMFS_eval_token+0x1ac>
}
if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) {
800c998: 34 04 00 03 mvi r4,3
800c99c: 5c 24 00 0d bne r1,r4,800c9d0 <IMFS_eval_token+0x128>
if ( entry != NULL ) {
bool terminal = !rtems_filesystem_eval_path_has_path( ctx );
int eval_flags = rtems_filesystem_eval_path_get_flags( ctx );
bool follow_hard_link = (eval_flags & RTEMS_FS_FOLLOW_HARD_LINK) != 0;
bool follow_sym_link = (eval_flags & RTEMS_FS_FOLLOW_SYM_LINK) != 0;
800c9a0: 20 41 00 10 andi r1,r2,0x10
if ( type == IMFS_HARD_LINK && (follow_hard_link || !terminal)) {
entry = entry->info.hard_link.link_node;
}
if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) {
800c9a4: 5c 20 00 02 bne r1,r0,800c9ac <IMFS_eval_token+0x104>
800c9a8: 5c 61 00 2b bne r3,r1,800ca54 <IMFS_eval_token+0x1ac>
const char *target = entry->info.sym_link.name;
800c9ac: 29 6b 00 50 lw r11,(r11+80)
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
800c9b0: 34 0e 00 01 mvi r14,1
}
if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) {
const char *target = entry->info.sym_link.name;
rtems_filesystem_eval_path_recursive( ctx, target, strlen( target ) );
800c9b4: b9 60 08 00 mv r1,r11
800c9b8: f8 00 19 48 calli 8012ed8 <strlen>
800c9bc: b8 20 18 00 mv r3,r1
800c9c0: b9 60 10 00 mv r2,r11
800c9c4: b9 80 08 00 mv r1,r12
800c9c8: fb ff de 30 calli 8004288 <rtems_filesystem_eval_path_recursive>
if ( type == IMFS_HARD_LINK && (follow_hard_link || !terminal)) {
entry = entry->info.hard_link.link_node;
}
if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) {
800c9cc: e0 00 00 10 bi 800ca0c <IMFS_eval_token+0x164>
IMFS_jnode_types_t type
)
{
rtems_filesystem_global_location_t **fs_root_ptr = NULL;
if ( type == IMFS_DIRECTORY ) {
800c9d0: 5c 20 00 21 bne r1,r0,800ca54 <IMFS_eval_token+0x1ac>
if ( node->info.directory.mt_fs != NULL ) {
800c9d4: 29 62 00 5c lw r2,(r11+92)
800c9d8: 44 41 00 1f be r2,r1,800ca54 <IMFS_eval_token+0x1ac>
if ( !terminal ) {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
}
} else {
access_ok = rtems_filesystem_eval_path_check_access(
800c9dc: 29 63 00 30 lw r3,(r11+48)
800c9e0: 2d 64 00 3c lhu r4,(r11+60)
800c9e4: 2d 65 00 3e lhu r5,(r11+62)
{
rtems_filesystem_global_location_t **fs_root_ptr = NULL;
if ( type == IMFS_DIRECTORY ) {
if ( node->info.directory.mt_fs != NULL ) {
fs_root_ptr = &node->info.directory.mt_fs->mt_fs_root;
800c9e8: 34 4d 00 24 addi r13,r2,36
if ( !terminal ) {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
}
} else {
access_ok = rtems_filesystem_eval_path_check_access(
800c9ec: b9 80 08 00 mv r1,r12
800c9f0: 34 02 00 01 mvi r2,1
800c9f4: f8 00 02 fc calli 800d5e4 <rtems_filesystem_eval_path_check_access>
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
800c9f8: 34 0e 00 01 mvi r14,1
RTEMS_FS_PERMS_EXEC,
entry->st_mode,
entry->st_uid,
entry->st_gid
);
if ( access_ok ) {
800c9fc: 44 20 00 04 be r1,r0,800ca0c <IMFS_eval_token+0x164> <== NEVER TAKEN
rtems_filesystem_eval_path_restart( ctx, fs_root_ptr );
800ca00: b9 80 08 00 mv r1,r12
800ca04: b9 a0 10 00 mv r2,r13
800ca08: fb ff dd fc calli 80041f8 <rtems_filesystem_eval_path_restart>
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY;
}
}
return status;
}
800ca0c: b9 c0 08 00 mv r1,r14
800ca10: 2b 9d 00 04 lw ra,(sp+4)
800ca14: 2b 8b 00 20 lw r11,(sp+32)
800ca18: 2b 8c 00 1c lw r12,(sp+28)
800ca1c: 2b 8d 00 18 lw r13,(sp+24)
800ca20: 2b 8e 00 14 lw r14,(sp+20)
800ca24: 2b 8f 00 10 lw r15,(sp+16)
800ca28: 2b 90 00 0c lw r16,(sp+12)
800ca2c: 2b 91 00 08 lw r17,(sp+8)
800ca30: 37 9c 00 20 addi sp,sp,32
800ca34: c3 a0 00 00 ret
static inline bool rtems_filesystem_is_parent_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 2 && token [0] == '.' && token [1] == '.';
800ca38: 34 01 00 02 mvi r1,2
800ca3c: 46 01 ff b4 be r16,r1,800c90c <IMFS_eval_token+0x64>
};
void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx )
{
rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config );
}
800ca40: 29 ae 00 50 lw r14,(r13+80)
if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) {
return dir->Parent;
} else {
rtems_chain_control *entries = &dir->info.directory.Entries;
rtems_chain_node *current = rtems_chain_first( entries );
rtems_chain_node *tail = rtems_chain_tail( entries );
800ca44: 35 b1 00 54 addi r17,r13,84
800ca48: e3 ff ff c2 bi 800c950 <IMFS_eval_token+0xa8>
};
void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx )
{
rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config );
}
800ca4c: 29 ce 00 00 lw r14,(r14+0)
800ca50: e3 ff ff c0 bi 800c950 <IMFS_eval_token+0xa8>
} else {
rtems_filesystem_global_location_t **fs_root_ptr =
IMFS_is_mount_point( entry, type );
if ( fs_root_ptr == NULL ) {
--dir->reference_count;
800ca54: 2d a1 00 34 lhu r1,(r13+52)
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
800ca58: b8 60 70 00 mv r14,r3
} else {
rtems_filesystem_global_location_t **fs_root_ptr =
IMFS_is_mount_point( entry, type );
if ( fs_root_ptr == NULL ) {
--dir->reference_count;
800ca5c: 34 21 ff ff addi r1,r1,-1
800ca60: 0d a1 00 34 sh (r13+52),r1
++entry->reference_count;
800ca64: 2d 61 00 34 lhu r1,(r11+52)
800ca68: 34 21 00 01 addi r1,r1,1
800ca6c: 0d 61 00 34 sh (r11+52),r1
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;
800ca70: 29 61 00 4c lw r1,(r11+76)
currentloc->node_access = entry;
800ca74: 59 8b 00 20 sw (r12+32),r11
800ca78: 28 21 00 04 lw r1,(r1+4)
800ca7c: 59 81 00 28 sw (r12+40),r1
800ca80: e3 ff ff e3 bi 800ca0c <IMFS_eval_token+0x164>
080018ec <IMFS_fifo_write>:
static ssize_t IMFS_fifo_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
80018ec: 37 9c ff ec addi sp,sp,-20
80018f0: 5b 8b 00 0c sw (sp+12),r11
80018f4: 5b 8c 00 08 sw (sp+8),r12
80018f8: 5b 9d 00 04 sw (sp+4),ra
IMFS_jnode_t *jnode = iop->pathinfo.node_access;
80018fc: 28 2c 00 14 lw r12,(r1+20)
static ssize_t IMFS_fifo_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
8001900: b8 20 20 00 mv r4,r1
IMFS_jnode_t *jnode = iop->pathinfo.node_access;
int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop);
8001904: 29 81 00 50 lw r1,(r12+80)
8001908: f8 00 24 13 calli 800a954 <pipe_write>
800190c: b8 20 58 00 mv r11,r1
if (err > 0) {
8001910: 4c 01 00 08 bge r0,r1,8001930 <IMFS_fifo_write+0x44>
IMFS_mtime_ctime_update(jnode);
8001914: 37 81 00 10 addi r1,sp,16
8001918: 34 02 00 00 mvi r2,0
800191c: f8 00 03 db calli 8002888 <gettimeofday>
8001920: 2b 81 00 10 lw r1,(sp+16)
8001924: 59 81 00 44 sw (r12+68),r1
8001928: 59 81 00 48 sw (r12+72),r1
800192c: e0 00 00 06 bi 8001944 <IMFS_fifo_write+0x58>
}
IMFS_FIFO_RETURN(err);
8001930: 44 20 00 05 be r1,r0,8001944 <IMFS_fifo_write+0x58> <== NEVER TAKEN
8001934: c8 0b 58 00 sub r11,r0,r11
8001938: f8 00 34 92 calli 800eb80 <__errno>
800193c: 58 2b 00 00 sw (r1+0),r11
8001940: 34 0b ff ff mvi r11,-1
}
8001944: b9 60 08 00 mv r1,r11
8001948: 2b 9d 00 04 lw ra,(sp+4)
800194c: 2b 8b 00 0c lw r11,(sp+12)
8001950: 2b 8c 00 08 lw r12,(sp+8)
8001954: 37 9c 00 14 addi sp,sp,20
8001958: c3 a0 00 00 ret
0800cb30 <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
)
{
800cb30: 37 9c ff d8 addi sp,sp,-40
800cb34: 5b 8b 00 10 sw (sp+16),r11
800cb38: 5b 8c 00 0c sw (sp+12),r12
800cb3c: 5b 8d 00 08 sw (sp+8),r13
800cb40: 5b 9d 00 04 sw (sp+4),ra
/*
* Traverse tree that starts at the mt_fs_root and deallocate memory
* associated memory space
*/
loc = temp_mt_entry->mt_fs_root->location;
800cb44: 28 21 00 24 lw r1,(r1+36)
next = jnode->Parent;
loc.node_access = (void *)jnode;
IMFS_Set_handlers( &loc );
if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) {
result = IMFS_rmnod( NULL, &loc );
800cb48: 37 8c 00 14 addi r12,sp,20
/*
* Traverse tree that starts at the mt_fs_root and deallocate memory
* associated memory space
*/
loc = temp_mt_entry->mt_fs_root->location;
800cb4c: 28 2b 00 08 lw r11,(r1+8)
800cb50: 28 26 00 00 lw r6,(r1+0)
800cb54: 28 25 00 04 lw r5,(r1+4)
800cb58: 28 24 00 0c lw r4,(r1+12)
800cb5c: 28 23 00 10 lw r3,(r1+16)
800cb60: 28 22 00 14 lw r2,(r1+20)
800cb64: 5b 86 00 14 sw (sp+20),r6
800cb68: 5b 85 00 18 sw (sp+24),r5
800cb6c: 5b 8b 00 1c sw (sp+28),r11
800cb70: 5b 84 00 20 sw (sp+32),r4
800cb74: 5b 83 00 24 sw (sp+36),r3
800cb78: 5b 82 00 28 sw (sp+40),r2
/*
* Set this to null to indicate that it is being unmounted.
*/
temp_mt_entry->mt_fs_root->location.node_access = NULL;
800cb7c: 58 20 00 08 sw (r1+8),r0
800cb80: 29 61 00 4c lw r1,(r11+76)
do {
next = jnode->Parent;
800cb84: 29 6d 00 08 lw r13,(r11+8)
loc.node_access = (void *)jnode;
800cb88: 5b 8b 00 1c sw (sp+28),r11
800cb8c: 28 22 00 04 lw r2,(r1+4)
IMFS_Set_handlers( &loc );
if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) {
800cb90: 28 21 00 00 lw r1,(r1+0)
800cb94: 5b 82 00 24 sw (sp+36),r2
800cb98: 5c 20 00 04 bne r1,r0,800cba8 <IMFS_fsunmount+0x78>
800cb9c: 29 62 00 50 lw r2,(r11+80)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
800cba0: 35 61 00 54 addi r1,r11,84
800cba4: 5c 41 00 0c bne r2,r1,800cbd4 <IMFS_fsunmount+0xa4>
result = IMFS_rmnod( NULL, &loc );
800cba8: 34 01 00 00 mvi r1,0
800cbac: b9 80 10 00 mv r2,r12
800cbb0: fb ff d6 66 calli 8002548 <IMFS_rmnod>
if ( result != 0 )
800cbb4: 44 20 00 05 be r1,r0,800cbc8 <IMFS_fsunmount+0x98> <== ALWAYS TAKEN
rtems_fatal_error_occurred( 0xdeadbeef );
800cbb8: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED
800cbbc: 38 42 88 bc ori r2,r2,0x88bc <== NOT EXECUTED
800cbc0: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED
800cbc4: fb ff e2 27 calli 8005460 <rtems_fatal_error_occurred> <== NOT EXECUTED
IMFS_node_destroy( jnode );
800cbc8: b9 60 08 00 mv r1,r11
800cbcc: fb ff d5 7c calli 80021bc <IMFS_node_destroy>
jnode = next;
800cbd0: b9 a0 58 00 mv r11,r13
}
if ( jnode != NULL ) {
800cbd4: 45 60 00 09 be r11,r0,800cbf8 <IMFS_fsunmount+0xc8>
return node->control->imfs_type;
}
static inline bool IMFS_is_directory( const IMFS_jnode_t *node )
{
return node->control->imfs_type == IMFS_DIRECTORY;
800cbd8: 29 61 00 4c lw r1,(r11+76)
if ( IMFS_is_directory( jnode ) ) {
800cbdc: 28 21 00 00 lw r1,(r1+0)
800cbe0: 5c 20 ff e8 bne r1,r0,800cb80 <IMFS_fsunmount+0x50> <== NEVER TAKEN
if ( jnode_has_children( jnode ) )
jnode = jnode_get_first_child( jnode );
}
}
} while (jnode != NULL);
}
800cbe4: 29 61 00 50 lw r1,(r11+80)
800cbe8: 35 62 00 54 addi r2,r11,84
IMFS_node_destroy( jnode );
jnode = next;
}
if ( jnode != NULL ) {
if ( IMFS_is_directory( jnode ) ) {
if ( jnode_has_children( jnode ) )
800cbec: 44 22 ff e5 be r1,r2,800cb80 <IMFS_fsunmount+0x50>
jnode = jnode_get_first_child( jnode );
800cbf0: b8 20 58 00 mv r11,r1
}
}
} while (jnode != NULL);
800cbf4: 5c 20 ff e3 bne r1,r0,800cb80 <IMFS_fsunmount+0x50> <== ALWAYS TAKEN
}
800cbf8: 2b 9d 00 04 lw ra,(sp+4)
800cbfc: 2b 8b 00 10 lw r11,(sp+16)
800cc00: 2b 8c 00 0c lw r12,(sp+12)
800cc04: 2b 8d 00 08 lw r13,(sp+8)
800cc08: 37 9c 00 28 addi sp,sp,40
800cc0c: c3 a0 00 00 ret
08002060 <IMFS_initialize_support>:
int IMFS_initialize_support(
rtems_filesystem_mount_table_entry_t *mt_entry,
const rtems_filesystem_operations_table *op_table,
const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT]
)
{
8002060: 37 9c ff ec addi sp,sp,-20
8002064: 5b 8b 00 14 sw (sp+20),r11
8002068: 5b 8c 00 10 sw (sp+16),r12
800206c: 5b 8d 00 0c sw (sp+12),r13
8002070: 5b 8e 00 08 sw (sp+8),r14
8002074: 5b 9d 00 04 sw (sp+4),ra
8002078: b8 20 68 00 mv r13,r1
800207c: b8 40 70 00 mv r14,r2
static int imfs_instance;
int rv = 0;
IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) );
8002080: 34 01 00 01 mvi r1,1
8002084: 34 02 00 24 mvi r2,36
int IMFS_initialize_support(
rtems_filesystem_mount_table_entry_t *mt_entry,
const rtems_filesystem_operations_table *op_table,
const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT]
)
{
8002088: b8 60 58 00 mv r11,r3
static int imfs_instance;
int rv = 0;
IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) );
800208c: f8 00 01 d7 calli 80027e8 <calloc>
8002090: b8 20 60 00 mv r12,r1
if ( fs_info != NULL ) {
8002094: 44 20 00 2d be r1,r0,8002148 <IMFS_initialize_support+0xe8>
IMFS_jnode_t *root_node;
fs_info->instance = imfs_instance++;
8002098: 78 03 08 01 mvhi r3,0x801
800209c: 38 63 a7 64 ori r3,r3,0xa764
80020a0: 28 62 00 00 lw r2,(r3+0)
80020a4: 58 22 00 00 sw (r1+0),r2
80020a8: 34 42 00 01 addi r2,r2,1
80020ac: 58 62 00 00 sw (r3+0),r2
memcpy(
80020b0: 29 62 00 00 lw r2,(r11+0)
80020b4: 29 66 00 10 lw r6,(r11+16)
80020b8: 29 65 00 14 lw r5,(r11+20)
80020bc: 29 64 00 18 lw r4,(r11+24)
80020c0: 29 69 00 04 lw r9,(r11+4)
80020c4: 29 68 00 08 lw r8,(r11+8)
80020c8: 29 67 00 0c lw r7,(r11+12)
fs_info->node_controls,
80020cc: 34 23 00 08 addi r3,r1,8
if ( fs_info != NULL ) {
IMFS_jnode_t *root_node;
fs_info->instance = imfs_instance++;
memcpy(
80020d0: 58 22 00 08 sw (r1+8),r2
80020d4: 58 66 00 10 sw (r3+16),r6
80020d8: 58 65 00 14 sw (r3+20),r5
80020dc: 58 64 00 18 sw (r3+24),r4
80020e0: 58 69 00 04 sw (r3+4),r9
80020e4: 58 68 00 08 sw (r3+8),r8
80020e8: 58 67 00 0c sw (r3+12),r7
fs_info->node_controls,
node_controls,
sizeof( fs_info->node_controls )
);
root_node = IMFS_allocate_node(
80020ec: 78 03 08 01 mvhi r3,0x801
80020f0: 38 63 89 9c ori r3,r3,0x899c
80020f4: 34 04 00 00 mvi r4,0
80020f8: 34 05 41 ed mvi r5,16877
80020fc: 34 06 00 00 mvi r6,0
8002100: f8 00 29 8a calli 800c728 <IMFS_allocate_node>
"",
0,
(S_IFDIR | 0755),
NULL
);
if ( root_node != NULL ) {
8002104: 44 20 00 11 be r1,r0,8002148 <IMFS_initialize_support+0xe8><== NEVER TAKEN
mt_entry->fs_info = fs_info;
mt_entry->ops = op_table;
mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS;
8002108: 78 02 08 01 mvhi r2,0x801
800210c: 38 42 8d 90 ori r2,r2,0x8d90
8002110: 59 a2 00 2c sw (r13+44),r2
mt_entry->mt_fs_root->location.node_access = root_node;
8002114: 29 a2 00 24 lw r2,(r13+36)
0,
(S_IFDIR | 0755),
NULL
);
if ( root_node != NULL ) {
mt_entry->fs_info = fs_info;
8002118: 59 ac 00 08 sw (r13+8),r12
mt_entry->ops = op_table;
800211c: 59 ae 00 0c sw (r13+12),r14
mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS;
mt_entry->mt_fs_root->location.node_access = root_node;
8002120: 58 41 00 08 sw (r2+8),r1
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;
8002124: 28 21 00 4c lw r1,(r1+76)
errno = ENOMEM;
rv = -1;
}
if ( rv == 0 ) {
IMFS_determine_bytes_per_block(
8002128: 34 0c 00 06 mvi r12,6
800212c: 28 21 00 04 lw r1,(r1+4)
8002130: 58 41 00 10 sw (r2+16),r1
8002134: 78 01 08 01 mvhi r1,0x801
8002138: 38 21 a0 14 ori r1,r1,0xa014
800213c: 28 2b 00 00 lw r11,(r1+0)
int bit_mask;
/*
* check, whether requested bytes per block is valid
*/
for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) {
8002140: 34 01 00 10 mvi r1,16
8002144: e0 00 00 06 bi 800215c <IMFS_initialize_support+0xfc>
} else {
errno = ENOMEM;
rv = -1;
}
} else {
errno = ENOMEM;
8002148: f8 00 3e e1 calli 8011ccc <__errno>
800214c: 34 02 00 0c mvi r2,12
8002150: 58 22 00 00 sw (r1+0),r2
8002154: 34 01 ff ff mvi r1,-1
8002158: e0 00 00 0c bi 8002188 <IMFS_initialize_support+0x128>
/*
* check, whether requested bytes per block is valid
*/
for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) {
if (bit_mask == requested_bytes_per_block) {
800215c: 44 2b 00 07 be r1,r11,8002178 <IMFS_initialize_support+0x118>
is_valid = true;
break;
}
if(bit_mask > requested_bytes_per_block)
8002160: 48 2b 00 05 bg r1,r11,8002174 <IMFS_initialize_support+0x114>
int bit_mask;
/*
* check, whether requested bytes per block is valid
*/
for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) {
8002164: 34 02 00 01 mvi r2,1
8002168: 35 8c ff ff addi r12,r12,-1
800216c: f8 00 55 f5 calli 8017940 <__ashlsi3>
8002170: 5d 80 ff fb bne r12,r0,800215c <IMFS_initialize_support+0xfc><== ALWAYS TAKEN
if(bit_mask > requested_bytes_per_block)
break;
}
*dest_bytes_per_block = ((is_valid)
? requested_bytes_per_block
: default_bytes_per_block);
8002174: 34 0b 00 80 mvi r11,128
break;
}
if(bit_mask > requested_bytes_per_block)
break;
}
*dest_bytes_per_block = ((is_valid)
8002178: 78 01 08 01 mvhi r1,0x801
800217c: 38 21 a7 60 ori r1,r1,0xa760
8002180: 58 2b 00 00 sw (r1+0),r11
const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT]
)
{
static int imfs_instance;
int rv = 0;
8002184: 34 01 00 00 mvi r1,0
IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK
);
}
return rv;
}
8002188: 2b 9d 00 04 lw ra,(sp+4)
800218c: 2b 8b 00 14 lw r11,(sp+20)
8002190: 2b 8c 00 10 lw r12,(sp+16)
8002194: 2b 8d 00 0c lw r13,(sp+12)
8002198: 2b 8e 00 08 lw r14,(sp+8)
800219c: 37 9c 00 14 addi sp,sp,20
80021a0: c3 a0 00 00 ret
08002cf8 <IMFS_make_generic_node>:
const char *path,
mode_t mode,
const IMFS_node_control *node_control,
void *context
)
{
8002cf8: 37 9c ff 98 addi sp,sp,-104
8002cfc: 5b 8b 00 18 sw (sp+24),r11
8002d00: 5b 8c 00 14 sw (sp+20),r12
8002d04: 5b 8d 00 10 sw (sp+16),r13
8002d08: 5b 8e 00 0c sw (sp+12),r14
8002d0c: 5b 8f 00 08 sw (sp+8),r15
8002d10: 5b 9d 00 04 sw (sp+4),ra
int rv = 0;
mode &= ~rtems_filesystem_umask;
8002d14: 78 05 08 01 mvhi r5,0x801
8002d18: 38 a5 a1 7c ori r5,r5,0xa17c
const char *path,
mode_t mode,
const IMFS_node_control *node_control,
void *context
)
{
8002d1c: b8 20 38 00 mv r7,r1
int rv = 0;
mode &= ~rtems_filesystem_umask;
8002d20: 28 a1 00 00 lw r1,(r5+0)
const char *path,
mode_t mode,
const IMFS_node_control *node_control,
void *context
)
{
8002d24: b8 60 58 00 mv r11,r3
8002d28: b8 80 78 00 mv r15,r4
int rv = 0;
mode &= ~rtems_filesystem_umask;
8002d2c: 28 2e 00 08 lw r14,(r1+8)
switch (mode & S_IFMT) {
8002d30: 34 01 20 00 mvi r1,8192
void *context
)
{
int rv = 0;
mode &= ~rtems_filesystem_umask;
8002d34: a5 c0 70 00 not r14,r14
8002d38: a0 4e 70 00 and r14,r2,r14
switch (mode & S_IFMT) {
8002d3c: 21 c6 f0 00 andi r6,r14,0xf000
8002d40: 44 c1 00 08 be r6,r1,8002d60 <IMFS_make_generic_node+0x68>
8002d44: 54 c1 00 03 bgu r6,r1,8002d50 <IMFS_make_generic_node+0x58><== ALWAYS TAKEN
8002d48: 34 01 10 00 mvi r1,4096 <== NOT EXECUTED
8002d4c: e0 00 00 04 bi 8002d5c <IMFS_make_generic_node+0x64> <== NOT EXECUTED
8002d50: 34 01 60 00 mvi r1,24576
8002d54: 44 c1 00 03 be r6,r1,8002d60 <IMFS_make_generic_node+0x68>
8002d58: 34 21 20 00 addi r1,r1,8192
8002d5c: 5c c1 00 2b bne r6,r1,8002e08 <IMFS_make_generic_node+0x110><== ALWAYS TAKEN
rv = -1;
break;
}
if ( rv == 0 ) {
if ( node_control->imfs_type == IMFS_GENERIC ) {
8002d60: 29 62 00 00 lw r2,(r11+0)
8002d64: 34 01 00 07 mvi r1,7
8002d68: 5c 41 00 28 bne r2,r1,8002e08 <IMFS_make_generic_node+0x110>
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 =
rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
8002d6c: 37 8c 00 1c addi r12,sp,28
if ( node_control->imfs_type == IMFS_GENERIC ) {
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 =
8002d70: b9 80 08 00 mv r1,r12
8002d74: b8 e0 10 00 mv r2,r7
8002d78: 34 03 00 78 mvi r3,120
8002d7c: f8 00 08 71 calli 8004f40 <rtems_filesystem_eval_path_start>
8002d80: b8 20 68 00 mv r13,r1
rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
if ( IMFS_is_imfs_instance( currentloc ) ) {
8002d84: fb ff ff c8 calli 8002ca4 <IMFS_is_imfs_instance>
8002d88: 44 20 00 19 be r1,r0,8002dec <IMFS_make_generic_node+0xf4>
IMFS_types_union info;
IMFS_jnode_t *new_node;
info.generic.context = context;
new_node = IMFS_create_node_with_control(
8002d8c: 2b 83 00 24 lw r3,(sp+36)
8002d90: 2b 84 00 28 lw r4,(sp+40)
8002d94: b9 60 10 00 mv r2,r11
8002d98: b9 a0 08 00 mv r1,r13
8002d9c: b9 c0 28 00 mv r5,r14
8002da0: 37 86 00 54 addi r6,sp,84
if ( IMFS_is_imfs_instance( currentloc ) ) {
IMFS_types_union info;
IMFS_jnode_t *new_node;
info.generic.context = context;
8002da4: 5b 8f 00 54 sw (sp+84),r15
new_node = IMFS_create_node_with_control(
8002da8: f8 00 29 0d calli 800d1dc <IMFS_create_node_with_control>
IMFS_jnode_t *parent = currentloc->node_access;
IMFS_update_ctime( parent );
IMFS_update_mtime( parent );
} else {
rv = -1;
8002dac: 34 0b ff ff mvi r11,-1
rtems_filesystem_eval_path_get_tokenlen( &ctx ),
mode,
&info
);
if ( new_node != NULL ) {
8002db0: 44 20 00 13 be r1,r0,8002dfc <IMFS_make_generic_node+0x104>
IMFS_jnode_t *parent = currentloc->node_access;
IMFS_update_ctime( parent );
8002db4: 37 8c 00 64 addi r12,sp,100
8002db8: 34 02 00 00 mvi r2,0
8002dbc: b9 80 08 00 mv r1,r12
mode,
&info
);
if ( new_node != NULL ) {
IMFS_jnode_t *parent = currentloc->node_access;
8002dc0: 29 ab 00 08 lw r11,(r13+8)
IMFS_update_ctime( parent );
8002dc4: f8 00 02 2e calli 800367c <gettimeofday>
8002dc8: 2b 81 00 64 lw r1,(sp+100)
IMFS_update_mtime( parent );
8002dcc: 34 02 00 00 mvi r2,0
);
if ( new_node != NULL ) {
IMFS_jnode_t *parent = currentloc->node_access;
IMFS_update_ctime( parent );
8002dd0: 59 61 00 48 sw (r11+72),r1
IMFS_update_mtime( parent );
8002dd4: b9 80 08 00 mv r1,r12
8002dd8: f8 00 02 29 calli 800367c <gettimeofday>
8002ddc: 2b 81 00 64 lw r1,(sp+100)
8002de0: 59 61 00 44 sw (r11+68),r1
8002de4: 34 0b 00 00 mvi r11,0
8002de8: e0 00 00 05 bi 8002dfc <IMFS_make_generic_node+0x104>
} else {
rv = -1;
}
} else {
rtems_filesystem_eval_path_error( &ctx, ENOTSUP );
8002dec: b9 80 08 00 mv r1,r12
8002df0: 34 02 00 86 mvi r2,134
8002df4: f8 00 07 8b calli 8004c20 <rtems_filesystem_eval_path_error>
rv = -1;
8002df8: 34 0b ff ff mvi r11,-1
}
rtems_filesystem_eval_path_cleanup( &ctx );
8002dfc: 37 81 00 1c addi r1,sp,28
8002e00: f8 00 08 9d calli 8005074 <rtems_filesystem_eval_path_cleanup>
8002e04: e0 00 00 05 bi 8002e18 <IMFS_make_generic_node+0x120>
} else {
errno = EINVAL;
8002e08: f8 00 3d a4 calli 8012498 <__errno>
8002e0c: 34 02 00 16 mvi r2,22
8002e10: 58 22 00 00 sw (r1+0),r2
rv = -1;
8002e14: 34 0b ff ff mvi r11,-1
}
}
return rv;
}
8002e18: b9 60 08 00 mv r1,r11
8002e1c: 2b 9d 00 04 lw ra,(sp+4)
8002e20: 2b 8b 00 18 lw r11,(sp+24)
8002e24: 2b 8c 00 14 lw r12,(sp+20)
8002e28: 2b 8d 00 10 lw r13,(sp+16)
8002e2c: 2b 8e 00 0c lw r14,(sp+12)
8002e30: 2b 8f 00 08 lw r15,(sp+8)
8002e34: 37 9c 00 68 addi sp,sp,104
8002e38: c3 a0 00 00 ret
0801081c <IMFS_memfile_extend>:
MEMFILE_STATIC int IMFS_memfile_extend(
IMFS_jnode_t *the_jnode,
bool zero_fill,
off_t new_length
)
{
801081c: 37 9c ff d0 addi sp,sp,-48
8010820: 5b 8b 00 28 sw (sp+40),r11
8010824: 5b 8c 00 24 sw (sp+36),r12
8010828: 5b 8d 00 20 sw (sp+32),r13
801082c: 5b 8e 00 1c sw (sp+28),r14
8010830: 5b 8f 00 18 sw (sp+24),r15
8010834: 5b 90 00 14 sw (sp+20),r16
8010838: 5b 91 00 10 sw (sp+16),r17
801083c: 5b 92 00 0c sw (sp+12),r18
8010840: 5b 93 00 08 sw (sp+8),r19
8010844: 5b 9d 00 04 sw (sp+4),ra
IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE );
/*
* Verify new file size is supported
*/
if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE )
8010848: 78 0e 08 01 mvhi r14,0x801
801084c: 39 ce a7 60 ori r14,r14,0xa760
8010850: 29 cb 00 00 lw r11,(r14+0)
MEMFILE_STATIC int IMFS_memfile_extend(
IMFS_jnode_t *the_jnode,
bool zero_fill,
off_t new_length
)
{
8010854: b8 20 60 00 mv r12,r1
8010858: 20 52 00 ff andi r18,r2,0xff
IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE );
/*
* Verify new file size is supported
*/
if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE )
801085c: b9 60 08 00 mv r1,r11
8010860: 34 02 00 02 mvi r2,2
MEMFILE_STATIC int IMFS_memfile_extend(
IMFS_jnode_t *the_jnode,
bool zero_fill,
off_t new_length
)
{
8010864: b8 60 68 00 mv r13,r3
IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE );
/*
* Verify new file size is supported
*/
if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE )
8010868: f8 00 1c 84 calli 8017a78 <__lshrsi3>
801086c: b8 20 78 00 mv r15,r1
8010870: b9 e0 10 00 mv r2,r15
8010874: 34 21 00 01 addi r1,r1,1
8010878: f8 00 1c a7 calli 8017b14 <__mulsi3>
801087c: b9 e0 10 00 mv r2,r15
8010880: 34 21 00 01 addi r1,r1,1
8010884: f8 00 1c a4 calli 8017b14 <__mulsi3>
8010888: 34 21 ff ff addi r1,r1,-1
801088c: b9 60 10 00 mv r2,r11
8010890: f8 00 1c a1 calli 8017b14 <__mulsi3>
8010894: 54 2d 00 04 bgu r1,r13,80108a4 <IMFS_memfile_extend+0x88>
rtems_set_errno_and_return_minus_one( EFBIG );
8010898: f8 00 05 0d calli 8011ccc <__errno>
801089c: 34 02 00 1b mvi r2,27
80108a0: e0 00 00 2a bi 8010948 <IMFS_memfile_extend+0x12c>
/*
* Verify new file size is actually larger than current size
*/
if ( new_length <= the_jnode->info.file.size )
80108a4: 29 8f 00 50 lw r15,(r12+80)
return 0;
80108a8: 34 04 00 00 mvi r4,0
rtems_set_errno_and_return_minus_one( EFBIG );
/*
* Verify new file size is actually larger than current size
*/
if ( new_length <= the_jnode->info.file.size )
80108ac: 4d ed 00 39 bge r15,r13,8010990 <IMFS_memfile_extend+0x174><== NEVER TAKEN
return 0;
/*
* Calculate the number of range of blocks to allocate
*/
new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK;
80108b0: b9 60 10 00 mv r2,r11
80108b4: b9 a0 08 00 mv r1,r13
80108b8: f8 00 1c a3 calli 8017b44 <__divsi3>
old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK;
80108bc: b9 60 10 00 mv r2,r11
return 0;
/*
* Calculate the number of range of blocks to allocate
*/
new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK;
80108c0: b8 20 88 00 mv r17,r1
old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK;
80108c4: b9 e0 08 00 mv r1,r15
80108c8: f8 00 1c 9f calli 8017b44 <__divsi3>
offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK;
80108cc: b9 60 10 00 mv r2,r11
/*
* Calculate the number of range of blocks to allocate
*/
new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK;
old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK;
80108d0: b8 20 80 00 mv r16,r1
offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK;
80108d4: f8 00 1c 90 calli 8017b14 <__mulsi3>
80108d8: c9 e1 78 00 sub r15,r15,r1
/*
* Now allocate each of those blocks.
*/
for ( block=old_blocks ; block<=new_blocks ; block++ ) {
80108dc: ba 00 58 00 mv r11,r16
80108e0: e0 00 00 1e bi 8010958 <IMFS_memfile_extend+0x13c>
if ( !IMFS_memfile_addblock( the_jnode, block ) ) {
80108e4: b9 80 08 00 mv r1,r12
80108e8: b9 60 10 00 mv r2,r11
80108ec: fb ff ff 29 calli 8010590 <IMFS_memfile_addblock>
80108f0: b8 20 18 00 mv r3,r1
80108f4: 5c 20 00 12 bne r1,r0,801093c <IMFS_memfile_extend+0x120>
if ( zero_fill ) {
80108f8: 46 41 00 17 be r18,r1,8010954 <IMFS_memfile_extend+0x138>
size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset;
block_p *block_ptr =
80108fc: b9 60 10 00 mv r2,r11
8010900: b9 80 08 00 mv r1,r12
* Now allocate each of those blocks.
*/
for ( block=old_blocks ; block<=new_blocks ; block++ ) {
if ( !IMFS_memfile_addblock( the_jnode, block ) ) {
if ( zero_fill ) {
size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset;
8010904: 29 d3 00 00 lw r19,(r14+0)
block_p *block_ptr =
8010908: fb ff fd fa calli 80100f0 <IMFS_memfile_get_block_pointer>
IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
memset( &(*block_ptr) [offset], 0, count);
801090c: 28 24 00 00 lw r4,(r1+0)
* Now allocate each of those blocks.
*/
for ( block=old_blocks ; block<=new_blocks ; block++ ) {
if ( !IMFS_memfile_addblock( the_jnode, block ) ) {
if ( zero_fill ) {
size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset;
8010910: ca 6f 98 00 sub r19,r19,r15
block_p *block_ptr =
IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
memset( &(*block_ptr) [offset], 0, count);
8010914: 34 02 00 00 mvi r2,0
8010918: b4 8f 08 00 add r1,r4,r15
801091c: ba 60 18 00 mv r3,r19
8010920: f8 00 08 04 calli 8012930 <memset>
offset = 0;
8010924: 34 0f 00 00 mvi r15,0
8010928: e0 00 00 0b bi 8010954 <IMFS_memfile_extend+0x138>
}
} else {
for ( ; block>=old_blocks ; block-- ) {
IMFS_memfile_remove_block( the_jnode, block );
801092c: b9 60 10 00 mv r2,r11
8010930: b9 80 08 00 mv r1,r12
8010934: fb ff ff ae calli 80107ec <IMFS_memfile_remove_block>
memset( &(*block_ptr) [offset], 0, count);
offset = 0;
}
} else {
for ( ; block>=old_blocks ; block-- ) {
8010938: 35 6b ff ff addi r11,r11,-1
801093c: 51 70 ff fc bgeu r11,r16,801092c <IMFS_memfile_extend+0x110>
IMFS_memfile_remove_block( the_jnode, block );
}
rtems_set_errno_and_return_minus_one( ENOSPC );
8010940: f8 00 04 e3 calli 8011ccc <__errno>
8010944: 34 02 00 1c mvi r2,28
8010948: 58 22 00 00 sw (r1+0),r2
801094c: 34 04 ff ff mvi r4,-1
8010950: e0 00 00 10 bi 8010990 <IMFS_memfile_extend+0x174>
offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK;
/*
* Now allocate each of those blocks.
*/
for ( block=old_blocks ; block<=new_blocks ; block++ ) {
8010954: 35 6b 00 01 addi r11,r11,1
8010958: 52 2b ff e3 bgeu r17,r11,80108e4 <IMFS_memfile_extend+0xc8>
/*
* Set the new length of the file.
*/
the_jnode->info.file.size = new_length;
IMFS_update_ctime(the_jnode);
801095c: 37 8b 00 2c addi r11,sp,44
8010960: 34 02 00 00 mvi r2,0
}
/*
* Set the new length of the file.
*/
the_jnode->info.file.size = new_length;
8010964: 59 8d 00 50 sw (r12+80),r13
IMFS_update_ctime(the_jnode);
8010968: b9 60 08 00 mv r1,r11
801096c: fb ff c8 17 calli 80029c8 <gettimeofday>
8010970: 2b 81 00 2c lw r1,(sp+44)
IMFS_update_mtime(the_jnode);
8010974: 34 02 00 00 mvi r2,0
/*
* Set the new length of the file.
*/
the_jnode->info.file.size = new_length;
IMFS_update_ctime(the_jnode);
8010978: 59 81 00 48 sw (r12+72),r1
IMFS_update_mtime(the_jnode);
801097c: b9 60 08 00 mv r1,r11
8010980: fb ff c8 12 calli 80029c8 <gettimeofday>
8010984: 2b 81 00 2c lw r1,(sp+44)
return 0;
8010988: 34 04 00 00 mvi r4,0
* Set the new length of the file.
*/
the_jnode->info.file.size = new_length;
IMFS_update_ctime(the_jnode);
IMFS_update_mtime(the_jnode);
801098c: 59 81 00 44 sw (r12+68),r1
return 0;
}
8010990: b8 80 08 00 mv r1,r4
8010994: 2b 9d 00 04 lw ra,(sp+4)
8010998: 2b 8b 00 28 lw r11,(sp+40)
801099c: 2b 8c 00 24 lw r12,(sp+36)
80109a0: 2b 8d 00 20 lw r13,(sp+32)
80109a4: 2b 8e 00 1c lw r14,(sp+28)
80109a8: 2b 8f 00 18 lw r15,(sp+24)
80109ac: 2b 90 00 14 lw r16,(sp+20)
80109b0: 2b 91 00 10 lw r17,(sp+16)
80109b4: 2b 92 00 0c lw r18,(sp+12)
80109b8: 2b 93 00 08 lw r19,(sp+8)
80109bc: 37 9c 00 30 addi sp,sp,48
80109c0: c3 a0 00 00 ret
080100f0 <IMFS_memfile_get_block_pointer>:
#endif
IMFS_jnode_t *the_jnode,
unsigned int block,
int malloc_it
)
{
80100f0: 37 9c ff e0 addi sp,sp,-32
80100f4: 5b 8b 00 20 sw (sp+32),r11
80100f8: 5b 8c 00 1c sw (sp+28),r12
80100fc: 5b 8d 00 18 sw (sp+24),r13
8010100: 5b 8e 00 14 sw (sp+20),r14
8010104: 5b 8f 00 10 sw (sp+16),r15
8010108: 5b 90 00 0c sw (sp+12),r16
801010c: 5b 91 00 08 sw (sp+8),r17
8010110: 5b 9d 00 04 sw (sp+4),ra
8010114: b8 20 68 00 mv r13,r1
my_block = block;
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
8010118: 78 01 08 01 mvhi r1,0x801
801011c: 38 21 a7 60 ori r1,r1,0xa760
8010120: 28 21 00 00 lw r1,(r1+0)
#endif
IMFS_jnode_t *the_jnode,
unsigned int block,
int malloc_it
)
{
8010124: b8 40 70 00 mv r14,r2
my_block = block;
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
8010128: 34 02 00 02 mvi r2,2
#endif
IMFS_jnode_t *the_jnode,
unsigned int block,
int malloc_it
)
{
801012c: b8 60 78 00 mv r15,r3
my_block = block;
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
8010130: f8 00 1e 52 calli 8017a78 <__lshrsi3>
8010134: b8 20 60 00 mv r12,r1
8010138: 34 21 ff ff addi r1,r1,-1
801013c: 55 c1 00 12 bgu r14,r1,8010184 <IMFS_memfile_get_block_pointer+0x94>
p = info->indirect;
8010140: 29 ac 00 54 lw r12,(r13+84)
if ( malloc_it ) {
8010144: 45 e0 00 0c be r15,r0,8010174 <IMFS_memfile_get_block_pointer+0x84>
if ( !p ) {
8010148: 5d 80 00 05 bne r12,r0,801015c <IMFS_memfile_get_block_pointer+0x6c>
p = memfile_alloc_block();
801014c: fb ff ff d9 calli 80100b0 <memfile_alloc_block>
if ( !p )
return 0;
8010150: 34 0b 00 00 mvi r11,0
if ( malloc_it ) {
if ( !p ) {
p = memfile_alloc_block();
if ( !p )
8010154: 44 2c 00 81 be r1,r12,8010358 <IMFS_memfile_get_block_pointer+0x268><== NEVER TAKEN
return 0;
info->indirect = p;
8010158: 59 a1 00 54 sw (r13+84),r1
}
return &info->indirect[ my_block ];
801015c: b9 c0 08 00 mv r1,r14
8010160: 34 02 00 02 mvi r2,2
8010164: f8 00 1d f7 calli 8017940 <__ashlsi3>
8010168: 29 ab 00 54 lw r11,(r13+84)
801016c: b5 61 58 00 add r11,r11,r1
8010170: e0 00 00 7a bi 8010358 <IMFS_memfile_get_block_pointer+0x268>
}
if ( !p )
return 0;
8010174: 34 0b 00 00 mvi r11,0
return &info->indirect[ my_block ];
8010178: b9 c0 08 00 mv r1,r14
info->indirect = p;
}
return &info->indirect[ my_block ];
}
if ( !p )
801017c: 5d 8b 00 74 bne r12,r11,801034c <IMFS_memfile_get_block_pointer+0x25c><== ALWAYS TAKEN
8010180: e0 00 00 76 bi 8010358 <IMFS_memfile_get_block_pointer+0x268><== NOT EXECUTED
/*
* Is the block number in the doubly indirect portion?
*/
if ( my_block <= LAST_DOUBLY_INDIRECT ) {
8010184: 35 81 00 01 addi r1,r12,1
8010188: b9 80 10 00 mv r2,r12
801018c: f8 00 1e 62 calli 8017b14 <__mulsi3>
8010190: b8 20 80 00 mv r16,r1
8010194: 34 21 ff ff addi r1,r1,-1
8010198: 55 c1 00 2b bgu r14,r1,8010244 <IMFS_memfile_get_block_pointer+0x154>
my_block -= FIRST_DOUBLY_INDIRECT;
801019c: c9 cc 70 00 sub r14,r14,r12
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
80101a0: b9 80 10 00 mv r2,r12
80101a4: b9 c0 08 00 mv r1,r14
80101a8: f8 00 1e d0 calli 8017ce8 <__umodsi3>
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
80101ac: b9 80 10 00 mv r2,r12
*/
if ( my_block <= LAST_DOUBLY_INDIRECT ) {
my_block -= FIRST_DOUBLY_INDIRECT;
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
80101b0: b8 20 80 00 mv r16,r1
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
80101b4: b9 c0 08 00 mv r1,r14
80101b8: f8 00 1e bc calli 8017ca8 <__udivsi3>
80101bc: b8 20 70 00 mv r14,r1
p = info->doubly_indirect;
80101c0: 29 ac 00 58 lw r12,(r13+88)
if ( malloc_it ) {
80101c4: 45 e0 00 17 be r15,r0,8010220 <IMFS_memfile_get_block_pointer+0x130>
if ( !p ) {
80101c8: 5d 80 00 06 bne r12,r0,80101e0 <IMFS_memfile_get_block_pointer+0xf0>
p = memfile_alloc_block();
80101cc: fb ff ff b9 calli 80100b0 <memfile_alloc_block>
80101d0: b8 20 60 00 mv r12,r1
if ( !p )
return 0;
80101d4: 34 0b 00 00 mvi r11,0
p = info->doubly_indirect;
if ( malloc_it ) {
if ( !p ) {
p = memfile_alloc_block();
if ( !p )
80101d8: 44 20 00 60 be r1,r0,8010358 <IMFS_memfile_get_block_pointer+0x268><== NEVER TAKEN
return 0;
info->doubly_indirect = p;
80101dc: 59 a1 00 58 sw (r13+88),r1
}
p1 = (block_p *)p[ doubly ];
80101e0: b9 c0 08 00 mv r1,r14
80101e4: 34 02 00 02 mvi r2,2
80101e8: f8 00 1d d6 calli 8017940 <__ashlsi3>
80101ec: b5 81 60 00 add r12,r12,r1
80101f0: 29 8d 00 00 lw r13,(r12+0)
if ( !p1 ) {
80101f4: 5d a0 00 06 bne r13,r0,801020c <IMFS_memfile_get_block_pointer+0x11c>
p1 = memfile_alloc_block();
80101f8: fb ff ff ae calli 80100b0 <memfile_alloc_block>
80101fc: b8 20 68 00 mv r13,r1
if ( !p1 )
return 0;
8010200: 34 0b 00 00 mvi r11,0
}
p1 = (block_p *)p[ doubly ];
if ( !p1 ) {
p1 = memfile_alloc_block();
if ( !p1 )
8010204: 44 20 00 55 be r1,r0,8010358 <IMFS_memfile_get_block_pointer+0x268><== NEVER TAKEN
return 0;
p[ doubly ] = (block_p) p1;
8010208: 59 81 00 00 sw (r12+0),r1
}
return (block_p *)&p1[ singly ];
801020c: ba 00 08 00 mv r1,r16
8010210: 34 02 00 02 mvi r2,2
8010214: f8 00 1d cb calli 8017940 <__ashlsi3>
8010218: b5 a1 58 00 add r11,r13,r1
801021c: e0 00 00 4f bi 8010358 <IMFS_memfile_get_block_pointer+0x268>
}
if ( !p )
return 0;
8010220: 34 0b 00 00 mvi r11,0
}
return (block_p *)&p1[ singly ];
}
if ( !p )
8010224: 45 8b 00 4d be r12,r11,8010358 <IMFS_memfile_get_block_pointer+0x268><== NEVER TAKEN
return 0;
p = (block_p *)p[ doubly ];
8010228: 34 02 00 02 mvi r2,2
801022c: f8 00 1d c5 calli 8017940 <__ashlsi3>
8010230: b5 81 08 00 add r1,r12,r1
8010234: 28 2c 00 00 lw r12,(r1+0)
if ( !p )
return 0;
return (block_p *)&p[ singly ];
8010238: ba 00 08 00 mv r1,r16
if ( !p )
return 0;
p = (block_p *)p[ doubly ];
if ( !p )
801023c: 5d 80 00 44 bne r12,r0,801034c <IMFS_memfile_get_block_pointer+0x25c><== ALWAYS TAKEN
8010240: e0 00 00 46 bi 8010358 <IMFS_memfile_get_block_pointer+0x268><== NOT EXECUTED
}
/*
* Is the block number in the triply indirect portion?
*/
if ( my_block <= LAST_TRIPLY_INDIRECT ) {
8010244: 36 01 00 01 addi r1,r16,1
8010248: b9 80 10 00 mv r2,r12
801024c: f8 00 1e 32 calli 8017b14 <__mulsi3>
8010250: 34 21 ff ff addi r1,r1,-1
}
/*
* This means the requested block number is out of range.
*/
return 0;
8010254: 34 0b 00 00 mvi r11,0
}
/*
* Is the block number in the triply indirect portion?
*/
if ( my_block <= LAST_TRIPLY_INDIRECT ) {
8010258: 55 c1 00 40 bgu r14,r1,8010358 <IMFS_memfile_get_block_pointer+0x268><== NEVER TAKEN
my_block -= FIRST_TRIPLY_INDIRECT;
801025c: c9 d0 70 00 sub r14,r14,r16
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
8010260: b9 80 10 00 mv r2,r12
8010264: b9 c0 08 00 mv r1,r14
8010268: f8 00 1e a0 calli 8017ce8 <__umodsi3>
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
801026c: b9 80 10 00 mv r2,r12
* 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;
8010270: b8 20 88 00 mv r17,r1
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
8010274: b9 c0 08 00 mv r1,r14
8010278: f8 00 1e 8c calli 8017ca8 <__udivsi3>
triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS;
801027c: b9 80 10 00 mv r2,r12
*/
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;
8010280: b8 20 70 00 mv r14,r1
triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS;
8010284: f8 00 1e 89 calli 8017ca8 <__udivsi3>
doubly %= IMFS_MEMFILE_BLOCK_SLOTS;
8010288: b9 80 10 00 mv r2,r12
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;
801028c: b8 20 80 00 mv r16,r1
doubly %= IMFS_MEMFILE_BLOCK_SLOTS;
8010290: b9 c0 08 00 mv r1,r14
8010294: f8 00 1e 95 calli 8017ce8 <__umodsi3>
8010298: b8 20 70 00 mv r14,r1
p = info->triply_indirect;
801029c: 29 ac 00 5c lw r12,(r13+92)
if ( malloc_it ) {
80102a0: 45 e0 00 1d be r15,r0,8010314 <IMFS_memfile_get_block_pointer+0x224>
if ( !p ) {
80102a4: 5d 80 00 05 bne r12,r0,80102b8 <IMFS_memfile_get_block_pointer+0x1c8>
p = memfile_alloc_block();
80102a8: fb ff ff 82 calli 80100b0 <memfile_alloc_block>
80102ac: b8 20 60 00 mv r12,r1
if ( !p )
80102b0: 44 20 00 2a be r1,r0,8010358 <IMFS_memfile_get_block_pointer+0x268><== NEVER TAKEN
return 0;
info->triply_indirect = p;
80102b4: 59 a1 00 5c sw (r13+92),r1
}
p1 = (block_p *) p[ triply ];
80102b8: ba 00 08 00 mv r1,r16
80102bc: 34 02 00 02 mvi r2,2
80102c0: f8 00 1d a0 calli 8017940 <__ashlsi3>
80102c4: b5 81 60 00 add r12,r12,r1
80102c8: 29 8d 00 00 lw r13,(r12+0)
if ( !p1 ) {
80102cc: 5d a0 00 06 bne r13,r0,80102e4 <IMFS_memfile_get_block_pointer+0x1f4>
p1 = memfile_alloc_block();
80102d0: fb ff ff 78 calli 80100b0 <memfile_alloc_block>
80102d4: b8 20 68 00 mv r13,r1
if ( !p1 )
return 0;
80102d8: 34 0b 00 00 mvi r11,0
}
p1 = (block_p *) p[ triply ];
if ( !p1 ) {
p1 = memfile_alloc_block();
if ( !p1 )
80102dc: 44 20 00 1f be r1,r0,8010358 <IMFS_memfile_get_block_pointer+0x268><== NEVER TAKEN
return 0;
p[ triply ] = (block_p) p1;
80102e0: 59 81 00 00 sw (r12+0),r1
}
p2 = (block_p *)p1[ doubly ];
80102e4: b9 c0 08 00 mv r1,r14
80102e8: 34 02 00 02 mvi r2,2
80102ec: f8 00 1d 95 calli 8017940 <__ashlsi3>
80102f0: b5 a1 68 00 add r13,r13,r1
80102f4: 29 ac 00 00 lw r12,(r13+0)
if ( !p2 ) {
80102f8: 5d 80 00 14 bne r12,r0,8010348 <IMFS_memfile_get_block_pointer+0x258>
p2 = memfile_alloc_block();
80102fc: fb ff ff 6d calli 80100b0 <memfile_alloc_block>
8010300: b8 20 60 00 mv r12,r1
if ( !p2 )
return 0;
8010304: 34 0b 00 00 mvi r11,0
}
p2 = (block_p *)p1[ doubly ];
if ( !p2 ) {
p2 = memfile_alloc_block();
if ( !p2 )
8010308: 44 20 00 14 be r1,r0,8010358 <IMFS_memfile_get_block_pointer+0x268><== NEVER TAKEN
return 0;
p1[ doubly ] = (block_p) p2;
801030c: 59 a1 00 00 sw (r13+0),r1
8010310: e0 00 00 0e bi 8010348 <IMFS_memfile_get_block_pointer+0x258>
}
return (block_p *)&p2[ singly ];
}
if ( !p )
8010314: 45 8b 00 11 be r12,r11,8010358 <IMFS_memfile_get_block_pointer+0x268><== NEVER TAKEN
return 0;
p1 = (block_p *) p[ triply ];
8010318: ba 00 08 00 mv r1,r16
801031c: 34 02 00 02 mvi r2,2
8010320: f8 00 1d 88 calli 8017940 <__ashlsi3>
8010324: b5 81 08 00 add r1,r12,r1
8010328: 28 2c 00 00 lw r12,(r1+0)
if ( !p1 )
801032c: 45 80 00 0b be r12,r0,8010358 <IMFS_memfile_get_block_pointer+0x268><== NEVER TAKEN
return 0;
p2 = (block_p *)p1[ doubly ];
8010330: b9 c0 08 00 mv r1,r14
8010334: 34 02 00 02 mvi r2,2
8010338: f8 00 1d 82 calli 8017940 <__ashlsi3>
801033c: b5 81 08 00 add r1,r12,r1
8010340: 28 2c 00 00 lw r12,(r1+0)
if ( !p2 )
8010344: 45 80 00 05 be r12,r0,8010358 <IMFS_memfile_get_block_pointer+0x268><== NEVER TAKEN
return 0;
return (block_p *)&p2[ singly ];
8010348: ba 20 08 00 mv r1,r17
801034c: 34 02 00 02 mvi r2,2
8010350: f8 00 1d 7c calli 8017940 <__ashlsi3>
8010354: b5 81 58 00 add r11,r12,r1
/*
* This means the requested block number is out of range.
*/
return 0;
}
8010358: b9 60 08 00 mv r1,r11
801035c: 2b 9d 00 04 lw ra,(sp+4)
8010360: 2b 8b 00 20 lw r11,(sp+32)
8010364: 2b 8c 00 1c lw r12,(sp+28)
8010368: 2b 8d 00 18 lw r13,(sp+24)
801036c: 2b 8e 00 14 lw r14,(sp+20)
8010370: 2b 8f 00 10 lw r15,(sp+16)
8010374: 2b 90 00 0c lw r16,(sp+12)
8010378: 2b 91 00 08 lw r17,(sp+8)
801037c: 37 9c 00 20 addi sp,sp,32
8010380: c3 a0 00 00 ret
08010384 <IMFS_memfile_read>:
IMFS_jnode_t *the_jnode,
off_t start,
unsigned char *destination,
unsigned int length
)
{
8010384: 37 9c ff d4 addi sp,sp,-44
8010388: 5b 8b 00 24 sw (sp+36),r11
801038c: 5b 8c 00 20 sw (sp+32),r12
8010390: 5b 8d 00 1c sw (sp+28),r13
8010394: 5b 8e 00 18 sw (sp+24),r14
8010398: 5b 8f 00 14 sw (sp+20),r15
801039c: 5b 90 00 10 sw (sp+16),r16
80103a0: 5b 91 00 0c sw (sp+12),r17
80103a4: 5b 92 00 08 sw (sp+8),r18
80103a8: 5b 9d 00 04 sw (sp+4),ra
80103ac: b8 20 58 00 mv r11,r1
rtems_chain_extract_unprotected( &node->Node );
}
static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node )
{
return node->control->imfs_type;
80103b0: 28 21 00 4c lw r1,(r1+76)
80103b4: b8 40 70 00 mv r14,r2
80103b8: b8 60 80 00 mv r16,r3
* 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 ) {
80103bc: 28 22 00 00 lw r2,(r1+0)
80103c0: 34 01 00 05 mvi r1,5
80103c4: 5c 41 00 0b bne r2,r1,80103f0 <IMFS_memfile_read+0x6c>
unsigned char *file_ptr;
file_ptr = (unsigned char *)the_jnode->info.linearfile.direct;
if (my_length > (the_jnode->info.linearfile.size - start))
80103c8: 29 6d 00 50 lw r13,(r11+80)
80103cc: c9 ae 68 00 sub r13,r13,r14
* 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 ) {
80103d0: 50 8d 00 02 bgeu r4,r13,80103d8 <IMFS_memfile_read+0x54> <== ALWAYS TAKEN
80103d4: b8 80 68 00 mv r13,r4 <== NOT EXECUTED
file_ptr = (unsigned char *)the_jnode->info.linearfile.direct;
if (my_length > (the_jnode->info.linearfile.size - start))
my_length = the_jnode->info.linearfile.size - start;
memcpy(dest, &file_ptr[start], my_length);
80103d8: 29 62 00 54 lw r2,(r11+84)
80103dc: ba 00 08 00 mv r1,r16
80103e0: b9 a0 18 00 mv r3,r13
80103e4: b4 4e 10 00 add r2,r2,r14
80103e8: f8 00 09 11 calli 801282c <memcpy>
80103ec: e0 00 00 46 bi 8010504 <IMFS_memfile_read+0x180>
/*
* 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 )
80103f0: 29 61 00 50 lw r1,(r11+80)
/*
* 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;
80103f4: b4 8e 10 00 add r2,r4,r14
if ( last_byte > the_jnode->info.file.size )
80103f8: b8 80 60 00 mv r12,r4
80103fc: 50 22 00 02 bgeu r1,r2,8010404 <IMFS_memfile_read+0x80>
my_length = the_jnode->info.file.size - start;
8010400: c8 2e 60 00 sub r12,r1,r14
*/
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
8010404: 78 01 08 01 mvhi r1,0x801
8010408: 38 21 a7 60 ori r1,r1,0xa760
801040c: 28 32 00 00 lw r18,(r1+0)
8010410: b9 c0 08 00 mv r1,r14
unsigned int last_byte;
unsigned int copied;
unsigned int start_offset;
unsigned char *dest;
dest = destination;
8010414: ba 00 78 00 mv r15,r16
*/
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
8010418: ba 40 10 00 mv r2,r18
801041c: f8 00 1d fa calli 8017c04 <__modsi3>
8010420: b8 20 88 00 mv r17,r1
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
8010424: ba 40 10 00 mv r2,r18
8010428: b9 c0 08 00 mv r1,r14
801042c: f8 00 1d c6 calli 8017b44 <__divsi3>
8010430: b8 20 70 00 mv r14,r1
*/
last_byte = start + length;
if ( last_byte > the_jnode->info.file.size )
my_length = the_jnode->info.file.size - start;
copied = 0;
8010434: 34 0d 00 00 mvi r13,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;
if ( start_offset ) {
8010438: 46 20 00 12 be r17,r0,8010480 <IMFS_memfile_read+0xfc>
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 );
801043c: b9 60 08 00 mv r1,r11
8010440: b9 c0 10 00 mv r2,r14
8010444: 34 03 00 00 mvi r3,0
8010448: fb ff ff 2a calli 80100f0 <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
801044c: 44 20 00 33 be r1,r0,8010518 <IMFS_memfile_read+0x194> <== NEVER TAKEN
* 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;
8010450: ca 51 90 00 sub r18,r18,r17
8010454: b9 80 68 00 mv r13,r12
8010458: 52 4c 00 02 bgeu r18,r12,8010460 <IMFS_memfile_read+0xdc>
801045c: ba 40 68 00 mv r13,r18
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 );
8010460: 28 22 00 00 lw r2,(r1+0)
8010464: b9 a0 18 00 mv r3,r13
8010468: ba 00 08 00 mv r1,r16
801046c: b4 51 10 00 add r2,r2,r17
8010470: f8 00 08 ef calli 801282c <memcpy>
dest += to_copy;
8010474: b6 0d 78 00 add r15,r16,r13
block++;
8010478: 35 ce 00 01 addi r14,r14,1
my_length -= to_copy;
801047c: c9 8d 60 00 sub r12,r12,r13
}
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
8010480: 78 01 08 01 mvhi r1,0x801
8010484: 38 21 a7 60 ori r1,r1,0xa760
8010488: 28 30 00 00 lw r16,(r1+0)
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
801048c: b8 20 88 00 mv r17,r1
8010490: e0 00 00 0f bi 80104cc <IMFS_memfile_read+0x148>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
8010494: b9 c0 10 00 mv r2,r14
8010498: b9 60 08 00 mv r1,r11
801049c: 34 03 00 00 mvi r3,0
80104a0: fb ff ff 14 calli 80100f0 <IMFS_memfile_get_block_pointer>
80104a4: b8 20 10 00 mv r2,r1
if ( !block_ptr )
80104a8: 44 20 00 1c be r1,r0,8010518 <IMFS_memfile_read+0x194> <== NEVER TAKEN
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], to_copy );
80104ac: 28 42 00 00 lw r2,(r2+0)
80104b0: b9 e0 08 00 mv r1,r15
80104b4: ba 00 18 00 mv r3,r16
80104b8: f8 00 08 dd calli 801282c <memcpy>
dest += to_copy;
80104bc: b5 f0 78 00 add r15,r15,r16
block++;
80104c0: 35 ce 00 01 addi r14,r14,1
my_length -= to_copy;
80104c4: c9 90 60 00 sub r12,r12,r16
copied += to_copy;
80104c8: b5 b0 68 00 add r13,r13,r16
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
80104cc: 2a 21 00 00 lw r1,(r17+0)
80104d0: 51 81 ff f1 bgeu r12,r1,8010494 <IMFS_memfile_read+0x110>
/*
* Phase 3: possibly the first part of one block
*/
IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK );
if ( my_length ) {
80104d4: 45 80 00 0c be r12,r0,8010504 <IMFS_memfile_read+0x180>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
80104d8: b9 c0 10 00 mv r2,r14
80104dc: b9 60 08 00 mv r1,r11
80104e0: 34 03 00 00 mvi r3,0
80104e4: fb ff ff 03 calli 80100f0 <IMFS_memfile_get_block_pointer>
80104e8: b8 20 10 00 mv r2,r1
if ( !block_ptr )
80104ec: 44 20 00 0b be r1,r0,8010518 <IMFS_memfile_read+0x194> <== NEVER TAKEN
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], my_length );
80104f0: 28 42 00 00 lw r2,(r2+0)
80104f4: b9 e0 08 00 mv r1,r15
80104f8: b9 80 18 00 mv r3,r12
80104fc: f8 00 08 cc calli 801282c <memcpy>
copied += my_length;
8010500: b5 8d 68 00 add r13,r12,r13
}
IMFS_update_atime( the_jnode );
8010504: 37 81 00 28 addi r1,sp,40
8010508: 34 02 00 00 mvi r2,0
801050c: fb ff c9 2f calli 80029c8 <gettimeofday>
8010510: 2b 81 00 28 lw r1,(sp+40)
8010514: 59 61 00 40 sw (r11+64),r1
return copied;
}
8010518: b9 a0 08 00 mv r1,r13
801051c: 2b 9d 00 04 lw ra,(sp+4)
8010520: 2b 8b 00 24 lw r11,(sp+36)
8010524: 2b 8c 00 20 lw r12,(sp+32)
8010528: 2b 8d 00 1c lw r13,(sp+28)
801052c: 2b 8e 00 18 lw r14,(sp+24)
8010530: 2b 8f 00 14 lw r15,(sp+20)
8010534: 2b 90 00 10 lw r16,(sp+16)
8010538: 2b 91 00 0c lw r17,(sp+12)
801053c: 2b 92 00 08 lw r18,(sp+8)
8010540: 37 9c 00 2c addi sp,sp,44
8010544: c3 a0 00 00 ret
08010680 <IMFS_memfile_remove>:
* is better to stick to simple, easy to understand algorithms.
*/
IMFS_jnode_t *IMFS_memfile_remove(
IMFS_jnode_t *the_jnode
)
{
8010680: 37 9c ff e0 addi sp,sp,-32
8010684: 5b 8b 00 20 sw (sp+32),r11
8010688: 5b 8c 00 1c sw (sp+28),r12
801068c: 5b 8d 00 18 sw (sp+24),r13
8010690: 5b 8e 00 14 sw (sp+20),r14
8010694: 5b 8f 00 10 sw (sp+16),r15
8010698: 5b 90 00 0c sw (sp+12),r16
801069c: 5b 91 00 08 sw (sp+8),r17
80106a0: 5b 9d 00 04 sw (sp+4),ra
80106a4: b8 20 58 00 mv r11,r1
/*
* Eventually this could be set smarter at each call to
* memfile_free_blocks_in_table to greatly speed this up.
*/
to_free = IMFS_MEMFILE_BLOCK_SLOTS;
80106a8: 78 01 08 01 mvhi r1,0x801
80106ac: 38 21 a7 60 ori r1,r1,0xa760
80106b0: 28 21 00 00 lw r1,(r1+0)
80106b4: 34 02 00 02 mvi r2,2
80106b8: f8 00 1c f0 calli 8017a78 <__lshrsi3>
80106bc: b8 20 60 00 mv r12,r1
* + doubly indirect
* + triply indirect
*/
info = &the_jnode->info.file;
if ( info->indirect ) {
80106c0: 29 61 00 54 lw r1,(r11+84)
80106c4: 44 20 00 04 be r1,r0,80106d4 <IMFS_memfile_remove+0x54>
memfile_free_blocks_in_table( &info->indirect, to_free );
80106c8: 35 61 00 54 addi r1,r11,84
80106cc: b9 80 10 00 mv r2,r12
80106d0: fb ff ff d0 calli 8010610 <memfile_free_blocks_in_table>
}
if ( info->doubly_indirect ) {
80106d4: 29 61 00 58 lw r1,(r11+88)
80106d8: 44 20 00 15 be r1,r0,801072c <IMFS_memfile_remove+0xac>
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
80106dc: 78 0d 08 01 mvhi r13,0x801
if ( info->indirect ) {
memfile_free_blocks_in_table( &info->indirect, to_free );
}
if ( info->doubly_indirect ) {
80106e0: 34 0f 00 00 mvi r15,0
80106e4: 34 0e 00 00 mvi r14,0
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
80106e8: 39 ad a7 60 ori r13,r13,0xa760
80106ec: e0 00 00 09 bi 8010710 <IMFS_memfile_remove+0x90>
if ( info->doubly_indirect[i] ) {
80106f0: 29 61 00 58 lw r1,(r11+88)
80106f4: b4 2f 08 00 add r1,r1,r15
80106f8: 28 22 00 00 lw r2,(r1+0)
80106fc: 44 40 00 03 be r2,r0,8010708 <IMFS_memfile_remove+0x88> <== NEVER TAKEN
memfile_free_blocks_in_table(
8010700: b9 80 10 00 mv r2,r12
8010704: fb ff ff c3 calli 8010610 <memfile_free_blocks_in_table>
if ( info->indirect ) {
memfile_free_blocks_in_table( &info->indirect, to_free );
}
if ( info->doubly_indirect ) {
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
8010708: 35 ce 00 01 addi r14,r14,1
801070c: 35 ef 00 04 addi r15,r15,4
8010710: 29 a1 00 00 lw r1,(r13+0)
8010714: 34 02 00 02 mvi r2,2
8010718: f8 00 1c d8 calli 8017a78 <__lshrsi3>
801071c: 54 2e ff f5 bgu r1,r14,80106f0 <IMFS_memfile_remove+0x70>
if ( info->doubly_indirect[i] ) {
memfile_free_blocks_in_table(
(block_p **)&info->doubly_indirect[i], to_free );
}
}
memfile_free_blocks_in_table( &info->doubly_indirect, to_free );
8010720: 35 61 00 58 addi r1,r11,88
8010724: b9 80 10 00 mv r2,r12
8010728: fb ff ff ba calli 8010610 <memfile_free_blocks_in_table>
}
if ( info->triply_indirect ) {
801072c: 29 61 00 5c lw r1,(r11+92)
8010730: 44 20 00 24 be r1,r0,80107c0 <IMFS_memfile_remove+0x140>
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
8010734: 78 0e 08 01 mvhi r14,0x801
}
memfile_free_blocks_in_table( &info->doubly_indirect, to_free );
}
if ( info->triply_indirect ) {
8010738: 34 0f 00 00 mvi r15,0
801073c: 34 10 00 00 mvi r16,0
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
8010740: 39 ce a7 60 ori r14,r14,0xa760
8010744: e0 00 00 18 bi 80107a4 <IMFS_memfile_remove+0x124>
p = (block_p *) info->triply_indirect[i];
8010748: 29 61 00 5c lw r1,(r11+92)
801074c: b4 2f 08 00 add r1,r1,r15
8010750: 28 2d 00 00 lw r13,(r1+0)
if ( !p ) /* ensure we have a valid pointer */
8010754: 45 a0 00 18 be r13,r0,80107b4 <IMFS_memfile_remove+0x134> <== NEVER TAKEN
8010758: 34 11 00 00 mvi r17,0
801075c: e0 00 00 08 bi 801077c <IMFS_memfile_remove+0xfc>
break;
for ( j=0 ; j<IMFS_MEMFILE_BLOCK_SLOTS ; j++ ) {
if ( p[j] ) {
8010760: 29 a1 00 00 lw r1,(r13+0)
8010764: 44 20 00 04 be r1,r0,8010774 <IMFS_memfile_remove+0xf4> <== NEVER TAKEN
memfile_free_blocks_in_table( (block_p **)&p[j], to_free);
8010768: b9 a0 08 00 mv r1,r13
801076c: b9 80 10 00 mv r2,r12
8010770: fb ff ff a8 calli 8010610 <memfile_free_blocks_in_table>
if ( info->triply_indirect ) {
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
p = (block_p *) info->triply_indirect[i];
if ( !p ) /* ensure we have a valid pointer */
break;
for ( j=0 ; j<IMFS_MEMFILE_BLOCK_SLOTS ; j++ ) {
8010774: 36 31 00 01 addi r17,r17,1
8010778: 35 ad 00 04 addi r13,r13,4
801077c: 29 c1 00 00 lw r1,(r14+0)
8010780: 34 02 00 02 mvi r2,2
8010784: f8 00 1c bd calli 8017a78 <__lshrsi3>
8010788: 54 31 ff f6 bgu r1,r17,8010760 <IMFS_memfile_remove+0xe0>
if ( p[j] ) {
memfile_free_blocks_in_table( (block_p **)&p[j], to_free);
}
}
memfile_free_blocks_in_table(
801078c: 29 61 00 5c lw r1,(r11+92)
8010790: b9 80 10 00 mv r2,r12
memfile_free_blocks_in_table( &info->doubly_indirect, to_free );
}
if ( info->triply_indirect ) {
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
8010794: 36 10 00 01 addi r16,r16,1
for ( j=0 ; j<IMFS_MEMFILE_BLOCK_SLOTS ; j++ ) {
if ( p[j] ) {
memfile_free_blocks_in_table( (block_p **)&p[j], to_free);
}
}
memfile_free_blocks_in_table(
8010798: b4 2f 08 00 add r1,r1,r15
801079c: fb ff ff 9d calli 8010610 <memfile_free_blocks_in_table>
memfile_free_blocks_in_table( &info->doubly_indirect, to_free );
}
if ( info->triply_indirect ) {
for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
80107a0: 35 ef 00 04 addi r15,r15,4
80107a4: 29 c1 00 00 lw r1,(r14+0)
80107a8: 34 02 00 02 mvi r2,2
80107ac: f8 00 1c b3 calli 8017a78 <__lshrsi3>
80107b0: 54 30 ff e6 bgu r1,r16,8010748 <IMFS_memfile_remove+0xc8>
}
}
memfile_free_blocks_in_table(
(block_p **)&info->triply_indirect[i], to_free );
}
memfile_free_blocks_in_table(
80107b4: 35 61 00 5c addi r1,r11,92
80107b8: b9 80 10 00 mv r2,r12
80107bc: fb ff ff 95 calli 8010610 <memfile_free_blocks_in_table>
(block_p **)&info->triply_indirect, to_free );
}
return the_jnode;
}
80107c0: b9 60 08 00 mv r1,r11
80107c4: 2b 9d 00 04 lw ra,(sp+4)
80107c8: 2b 8b 00 20 lw r11,(sp+32)
80107cc: 2b 8c 00 1c lw r12,(sp+28)
80107d0: 2b 8d 00 18 lw r13,(sp+24)
80107d4: 2b 8e 00 14 lw r14,(sp+20)
80107d8: 2b 8f 00 10 lw r15,(sp+16)
80107dc: 2b 90 00 0c lw r16,(sp+12)
80107e0: 2b 91 00 08 lw r17,(sp+8)
80107e4: 37 9c 00 20 addi sp,sp,32
80107e8: c3 a0 00 00 ret
080109c4 <IMFS_memfile_write>:
IMFS_jnode_t *the_jnode,
off_t start,
const unsigned char *source,
unsigned int length
)
{
80109c4: 37 9c ff d0 addi sp,sp,-48
80109c8: 5b 8b 00 28 sw (sp+40),r11
80109cc: 5b 8c 00 24 sw (sp+36),r12
80109d0: 5b 8d 00 20 sw (sp+32),r13
80109d4: 5b 8e 00 1c sw (sp+28),r14
80109d8: 5b 8f 00 18 sw (sp+24),r15
80109dc: 5b 90 00 14 sw (sp+20),r16
80109e0: 5b 91 00 10 sw (sp+16),r17
80109e4: 5b 92 00 0c sw (sp+12),r18
80109e8: 5b 93 00 08 sw (sp+8),r19
80109ec: 5b 9d 00 04 sw (sp+4),ra
80109f0: b8 40 60 00 mv r12,r2
80109f4: b8 60 88 00 mv r17,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;
80109f8: b4 82 18 00 add r3,r4,r2
if ( last_byte > the_jnode->info.file.size ) {
80109fc: 28 22 00 50 lw r2,(r1+80)
IMFS_jnode_t *the_jnode,
off_t start,
const unsigned char *source,
unsigned int length
)
{
8010a00: b8 20 70 00 mv r14,r1
8010a04: b8 80 80 00 mv r16,r4
* 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 ) {
8010a08: 50 43 00 05 bgeu r2,r3,8010a1c <IMFS_memfile_write+0x58>
bool zero_fill = start > the_jnode->info.file.size;
status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte );
8010a0c: e9 82 10 00 cmpg r2,r12,r2
8010a10: fb ff ff 83 calli 801081c <IMFS_memfile_extend>
8010a14: b8 20 28 00 mv r5,r1
if ( status )
8010a18: 5c 20 00 48 bne r1,r0,8010b38 <IMFS_memfile_write+0x174>
*/
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
8010a1c: 78 01 08 01 mvhi r1,0x801
8010a20: 38 21 a7 60 ori r1,r1,0xa760
8010a24: 28 33 00 00 lw r19,(r1+0)
8010a28: b9 80 08 00 mv r1,r12
unsigned int last_byte;
unsigned int start_offset;
int copied;
const unsigned char *src;
src = source;
8010a2c: ba 20 78 00 mv r15,r17
*/
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
8010a30: ba 60 10 00 mv r2,r19
8010a34: f8 00 1c 74 calli 8017c04 <__modsi3>
8010a38: b8 20 90 00 mv r18,r1
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
8010a3c: ba 60 10 00 mv r2,r19
8010a40: b9 80 08 00 mv r1,r12
8010a44: f8 00 1c 40 calli 8017b44 <__divsi3>
8010a48: b8 20 68 00 mv r13,r1
if ( start_offset ) {
8010a4c: ba 00 60 00 mv r12,r16
status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte );
if ( status )
return status;
}
copied = 0;
8010a50: 34 0b 00 00 mvi r11,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;
if ( start_offset ) {
8010a54: 46 40 00 12 be r18,r0,8010a9c <IMFS_memfile_write+0xd8>
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 );
8010a58: b9 c0 08 00 mv r1,r14
8010a5c: b9 a0 10 00 mv r2,r13
8010a60: 34 03 00 00 mvi r3,0
8010a64: fb ff fd a3 calli 80100f0 <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
return copied;
8010a68: 34 05 00 00 mvi r5,0
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 );
if ( !block_ptr )
8010a6c: 44 20 00 33 be r1,r0,8010b38 <IMFS_memfile_write+0x174> <== NEVER TAKEN
* 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;
8010a70: ca 72 58 00 sub r11,r19,r18
8010a74: 52 0b 00 02 bgeu r16,r11,8010a7c <IMFS_memfile_write+0xb8>
8010a78: ba 00 58 00 mv r11,r16
block,
to_copy,
src
);
#endif
memcpy( &(*block_ptr)[ start_offset ], src, to_copy );
8010a7c: 28 21 00 00 lw r1,(r1+0)
8010a80: ba 20 10 00 mv r2,r17
8010a84: b9 60 18 00 mv r3,r11
8010a88: b4 32 08 00 add r1,r1,r18
8010a8c: f8 00 07 68 calli 801282c <memcpy>
src += to_copy;
8010a90: b6 2b 78 00 add r15,r17,r11
block++;
8010a94: 35 ad 00 01 addi r13,r13,1
my_length -= to_copy;
8010a98: ca 0b 60 00 sub r12,r16,r11
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
8010a9c: 78 01 08 01 mvhi r1,0x801
8010aa0: 38 21 a7 60 ori r1,r1,0xa760
8010aa4: 28 30 00 00 lw r16,(r1+0)
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
8010aa8: b8 20 88 00 mv r17,r1
8010aac: e0 00 00 0e bi 8010ae4 <IMFS_memfile_write+0x120>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
8010ab0: b9 c0 08 00 mv r1,r14
8010ab4: b9 a0 10 00 mv r2,r13
8010ab8: 34 03 00 00 mvi r3,0
8010abc: fb ff fd 8d calli 80100f0 <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
8010ac0: 44 20 00 1d be r1,r0,8010b34 <IMFS_memfile_write+0x170> <== NEVER TAKEN
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 );
8010ac4: 28 21 00 00 lw r1,(r1+0)
8010ac8: b9 e0 10 00 mv r2,r15
8010acc: ba 00 18 00 mv r3,r16
8010ad0: f8 00 07 57 calli 801282c <memcpy>
src += to_copy;
8010ad4: b5 f0 78 00 add r15,r15,r16
block++;
8010ad8: 35 ad 00 01 addi r13,r13,1
my_length -= to_copy;
8010adc: c9 90 60 00 sub r12,r12,r16
* 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(
8010ae0: b5 70 58 00 add r11,r11,r16
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
8010ae4: 2a 21 00 00 lw r1,(r17+0)
8010ae8: 51 81 ff f2 bgeu r12,r1,8010ab0 <IMFS_memfile_write+0xec>
* 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 ) {
8010aec: 45 80 00 0c be r12,r0,8010b1c <IMFS_memfile_write+0x158>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
8010af0: b9 c0 08 00 mv r1,r14
8010af4: b9 a0 10 00 mv r2,r13
8010af8: 34 03 00 00 mvi r3,0
8010afc: fb ff fd 7d calli 80100f0 <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
8010b00: b9 60 28 00 mv r5,r11
8010b04: 44 20 00 0d be r1,r0,8010b38 <IMFS_memfile_write+0x174> <== NEVER TAKEN
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 );
8010b08: 28 21 00 00 lw r1,(r1+0)
8010b0c: b9 e0 10 00 mv r2,r15
8010b10: b9 80 18 00 mv r3,r12
8010b14: f8 00 07 46 calli 801282c <memcpy>
my_length = 0;
copied += to_copy;
8010b18: b5 6c 58 00 add r11,r11,r12
}
IMFS_mtime_ctime_update( the_jnode );
8010b1c: 37 81 00 2c addi r1,sp,44
8010b20: 34 02 00 00 mvi r2,0
8010b24: fb ff c7 a9 calli 80029c8 <gettimeofday>
8010b28: 2b 81 00 2c lw r1,(sp+44)
8010b2c: 59 c1 00 44 sw (r14+68),r1
8010b30: 59 c1 00 48 sw (r14+72),r1
*/
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 )
8010b34: b9 60 28 00 mv r5,r11
}
IMFS_mtime_ctime_update( the_jnode );
return copied;
}
8010b38: b8 a0 08 00 mv r1,r5
8010b3c: 2b 9d 00 04 lw ra,(sp+4)
8010b40: 2b 8b 00 28 lw r11,(sp+40)
8010b44: 2b 8c 00 24 lw r12,(sp+36)
8010b48: 2b 8d 00 20 lw r13,(sp+32)
8010b4c: 2b 8e 00 1c lw r14,(sp+28)
8010b50: 2b 8f 00 18 lw r15,(sp+24)
8010b54: 2b 90 00 14 lw r16,(sp+20)
8010b58: 2b 91 00 10 lw r17,(sp+16)
8010b5c: 2b 92 00 0c lw r18,(sp+12)
8010b60: 2b 93 00 08 lw r19,(sp+8)
8010b64: 37 9c 00 30 addi sp,sp,48
8010b68: c3 a0 00 00 ret
080022b0 <IMFS_mknod>:
const char *name,
size_t namelen,
mode_t mode,
dev_t dev
)
{
80022b0: 37 9c ff d0 addi sp,sp,-48
80022b4: 5b 8b 00 18 sw (sp+24),r11
80022b8: 5b 8c 00 14 sw (sp+20),r12
80022bc: 5b 8d 00 10 sw (sp+16),r13
80022c0: 5b 8e 00 0c sw (sp+12),r14
80022c4: 5b 8f 00 08 sw (sp+8),r15
80022c8: 5b 9d 00 04 sw (sp+4),ra
80022cc: b8 20 58 00 mv r11,r1
dev_t dev,
IMFS_jnode_types_t *type,
IMFS_types_union *info
)
{
if ( S_ISDIR( mode ) ) {
80022d0: 20 87 f0 00 andi r7,r4,0xf000
80022d4: 34 01 40 00 mvi r1,16384
const char *name,
size_t namelen,
mode_t mode,
dev_t dev
)
{
80022d8: b8 40 70 00 mv r14,r2
80022dc: b8 60 68 00 mv r13,r3
80022e0: b8 80 60 00 mv r12,r4
IMFS_jnode_types_t *type,
IMFS_types_union *info
)
{
if ( S_ISDIR( mode ) ) {
*type = IMFS_DIRECTORY;
80022e4: 34 08 00 00 mvi r8,0
dev_t dev,
IMFS_jnode_types_t *type,
IMFS_types_union *info
)
{
if ( S_ISDIR( mode ) ) {
80022e8: 44 e1 00 11 be r7,r1,800232c <IMFS_mknod+0x7c>
*type = IMFS_DIRECTORY;
} else if ( S_ISREG( mode ) ) {
80022ec: 34 21 40 00 addi r1,r1,16384
80022f0: 44 e1 00 0c be r7,r1,8002320 <IMFS_mknod+0x70>
*type = IMFS_MEMORY_FILE;
} else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) {
80022f4: 64 e2 20 00 cmpei r2,r7,8192
80022f8: 64 e1 60 00 cmpei r1,r7,24576
80022fc: b8 41 08 00 or r1,r2,r1
8002300: 44 20 00 05 be r1,r0,8002314 <IMFS_mknod+0x64>
*type = IMFS_DEVICE;
rtems_filesystem_split_dev_t(
8002304: 5b 85 00 1c sw (sp+28),r5
8002308: 5b 86 00 20 sw (sp+32),r6
if ( S_ISDIR( mode ) ) {
*type = IMFS_DIRECTORY;
} else if ( S_ISREG( mode ) ) {
*type = IMFS_MEMORY_FILE;
} else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) {
*type = IMFS_DEVICE;
800230c: 34 08 00 01 mvi r8,1
8002310: e0 00 00 07 bi 800232c <IMFS_mknod+0x7c>
rtems_filesystem_split_dev_t(
dev,
info->device.major,
info->device.minor
);
} else if (S_ISFIFO( mode )) {
8002314: 34 01 10 00 mvi r1,4096
8002318: 5c e1 00 05 bne r7,r1,800232c <IMFS_mknod+0x7c> <== NEVER TAKEN
800231c: e0 00 00 03 bi 8002328 <IMFS_mknod+0x78>
)
{
if ( S_ISDIR( mode ) ) {
*type = IMFS_DIRECTORY;
} else if ( S_ISREG( mode ) ) {
*type = IMFS_MEMORY_FILE;
8002320: 34 08 00 04 mvi r8,4
8002324: e0 00 00 02 bi 800232c <IMFS_mknod+0x7c>
dev,
info->device.major,
info->device.minor
);
} else if (S_ISFIFO( mode )) {
*type = IMFS_FIFO;
8002328: 34 08 00 06 mvi r8,6
mode_t mode,
const IMFS_types_union *info
)
{
const IMFS_fs_info_t *fs_info =
(const IMFS_fs_info_t *) parentloc->mt_entry->fs_info;
800232c: 29 61 00 14 lw r1,(r11+20)
return IMFS_create_node_with_control(
8002330: 34 02 00 02 mvi r2,2
8002334: 28 2f 00 08 lw r15,(r1+8)
8002338: 35 01 00 02 addi r1,r8,2
800233c: f8 00 55 81 calli 8017940 <__ashlsi3>
8002340: b5 e1 28 00 add r5,r15,r1
8002344: 28 a2 00 00 lw r2,(r5+0)
8002348: b9 60 08 00 mv r1,r11
800234c: b9 c0 18 00 mv r3,r14
8002350: b9 a0 20 00 mv r4,r13
8002354: b9 80 28 00 mv r5,r12
8002358: 37 86 00 1c addi r6,sp,28
800235c: f8 00 29 3a calli 800c844 <IMFS_create_node_with_control>
IMFS_jnode_t *parent = parentloc->node_access;
IMFS_update_ctime( parent );
IMFS_update_mtime( parent );
} else {
rv = -1;
8002360: 34 02 ff ff mvi r2,-1
IMFS_jnode_t *new_node;
get_type_and_info_by_mode_and_dev( mode, dev, &type, &info );
new_node = IMFS_create_node( parentloc, type, name, namelen, mode, &info );
if ( new_node != NULL ) {
8002364: 44 20 00 0e be r1,r0,800239c <IMFS_mknod+0xec>
IMFS_jnode_t *parent = parentloc->node_access;
IMFS_update_ctime( parent );
8002368: 37 8c 00 2c addi r12,sp,44
800236c: 34 02 00 00 mvi r2,0
8002370: b9 80 08 00 mv r1,r12
get_type_and_info_by_mode_and_dev( mode, dev, &type, &info );
new_node = IMFS_create_node( parentloc, type, name, namelen, mode, &info );
if ( new_node != NULL ) {
IMFS_jnode_t *parent = parentloc->node_access;
8002374: 29 6b 00 08 lw r11,(r11+8)
IMFS_update_ctime( parent );
8002378: f8 00 01 94 calli 80029c8 <gettimeofday>
800237c: 2b 81 00 2c lw r1,(sp+44)
IMFS_update_mtime( parent );
8002380: 34 02 00 00 mvi r2,0
new_node = IMFS_create_node( parentloc, type, name, namelen, mode, &info );
if ( new_node != NULL ) {
IMFS_jnode_t *parent = parentloc->node_access;
IMFS_update_ctime( parent );
8002384: 59 61 00 48 sw (r11+72),r1
IMFS_update_mtime( parent );
8002388: b9 80 08 00 mv r1,r12
800238c: f8 00 01 8f calli 80029c8 <gettimeofday>
8002390: 2b 81 00 2c lw r1,(sp+44)
size_t namelen,
mode_t mode,
dev_t dev
)
{
int rv = 0;
8002394: 34 02 00 00 mvi r2,0
new_node = IMFS_create_node( parentloc, type, name, namelen, mode, &info );
if ( new_node != NULL ) {
IMFS_jnode_t *parent = parentloc->node_access;
IMFS_update_ctime( parent );
IMFS_update_mtime( parent );
8002398: 59 61 00 44 sw (r11+68),r1
} else {
rv = -1;
}
return rv;
}
800239c: b8 40 08 00 mv r1,r2
80023a0: 2b 9d 00 04 lw ra,(sp+4)
80023a4: 2b 8b 00 18 lw r11,(sp+24)
80023a8: 2b 8c 00 14 lw r12,(sp+20)
80023ac: 2b 8d 00 10 lw r13,(sp+16)
80023b0: 2b 8e 00 0c lw r14,(sp+12)
80023b4: 2b 8f 00 08 lw r15,(sp+8)
80023b8: 37 9c 00 30 addi sp,sp,48
80023bc: c3 a0 00 00 ret
080023c0 <IMFS_mount>:
#endif
#include "imfs.h"
int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry )
{
80023c0: 37 9c ff fc addi sp,sp,-4
80023c4: 5b 9d 00 04 sw (sp+4),ra
int rv = 0;
IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access;
80023c8: 28 22 00 20 lw r2,(r1+32)
80023cc: 28 42 00 08 lw r2,(r2+8)
return node->control->imfs_type;
}
static inline bool IMFS_is_directory( const IMFS_jnode_t *node )
{
return node->control->imfs_type == IMFS_DIRECTORY;
80023d0: 28 43 00 4c lw r3,(r2+76)
if ( IMFS_is_directory( node ) ) {
80023d4: 28 63 00 00 lw r3,(r3+0)
80023d8: 5c 60 00 09 bne r3,r0,80023fc <IMFS_mount+0x3c>
if ( node->info.directory.mt_fs == NULL ) {
80023dc: 28 44 00 5c lw r4,(r2+92)
80023e0: 5c 83 00 04 bne r4,r3,80023f0 <IMFS_mount+0x30> <== NEVER TAKEN
node->info.directory.mt_fs = mt_entry;
80023e4: 58 41 00 5c sw (r2+92),r1
#include "imfs.h"
int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry )
{
int rv = 0;
80023e8: 34 01 00 00 mvi r1,0
80023ec: e0 00 00 08 bi 800240c <IMFS_mount+0x4c>
if ( IMFS_is_directory( node ) ) {
if ( node->info.directory.mt_fs == NULL ) {
node->info.directory.mt_fs = mt_entry;
} else {
errno = EBUSY;
80023f0: f8 00 3e 37 calli 8011ccc <__errno> <== NOT EXECUTED
80023f4: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
80023f8: e0 00 00 03 bi 8002404 <IMFS_mount+0x44> <== NOT EXECUTED
rv = -1;
}
} else {
errno = ENOTDIR;
80023fc: f8 00 3e 34 calli 8011ccc <__errno>
8002400: 34 02 00 14 mvi r2,20
8002404: 58 22 00 00 sw (r1+0),r2
rv = -1;
8002408: 34 01 ff ff mvi r1,-1
}
return rv;
}
800240c: 2b 9d 00 04 lw ra,(sp+4)
8002410: 37 9c 00 04 addi sp,sp,4
8002414: c3 a0 00 00 ret
0800cca4 <IMFS_node_remove_directory>:
}
static IMFS_jnode_t *IMFS_node_remove_directory(
IMFS_jnode_t *node
)
{
800cca4: 37 9c ff fc addi sp,sp,-4
800cca8: 5b 9d 00 04 sw (sp+4),ra
if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) {
800ccac: 28 23 00 50 lw r3,(r1+80)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
800ccb0: 34 22 00 54 addi r2,r1,84
800ccb4: 44 62 00 04 be r3,r2,800ccc4 <IMFS_node_remove_directory+0x20>
errno = ENOTEMPTY;
800ccb8: f8 00 14 05 calli 8011ccc <__errno>
800ccbc: 34 02 00 5a mvi r2,90
800ccc0: e0 00 00 05 bi 800ccd4 <IMFS_node_remove_directory+0x30>
node = NULL;
} else if ( IMFS_is_mount_point( node ) ) {
800ccc4: 28 22 00 5c lw r2,(r1+92)
800ccc8: 44 40 00 05 be r2,r0,800ccdc <IMFS_node_remove_directory+0x38><== ALWAYS TAKEN
errno = EBUSY;
800cccc: f8 00 14 00 calli 8011ccc <__errno> <== NOT EXECUTED
800ccd0: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
800ccd4: 58 22 00 00 sw (r1+0),r2
node = NULL;
800ccd8: 34 01 00 00 mvi r1,0
}
return node;
}
800ccdc: 2b 9d 00 04 lw ra,(sp+4)
800cce0: 37 9c 00 04 addi sp,sp,4
800cce4: c3 a0 00 00 ret
08002418 <IMFS_node_type>:
rtems_filesystem_node_types_t IMFS_node_type(
const rtems_filesystem_location_info_t *loc
)
{
const IMFS_jnode_t *node = loc->node_access;
8002418: 28 21 00 08 lw r1,(r1+8)
IMFS_jnode_types_t imfs_type = IMFS_type( node );
rtems_filesystem_node_types_t type;
switch ( imfs_type ) {
800241c: 34 03 00 02 mvi r3,2
rtems_chain_extract_unprotected( &node->Node );
}
static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node )
{
return node->control->imfs_type;
8002420: 28 22 00 4c lw r2,(r1+76)
8002424: 28 42 00 00 lw r2,(r2+0)
8002428: 44 43 00 05 be r2,r3,800243c <IMFS_node_type+0x24>
800242c: 34 03 00 05 mvi r3,5
case IMFS_HARD_LINK:
type = IMFS_type( node->info.hard_link.link_node );
break;
case IMFS_LINEAR_FILE:
type = RTEMS_FILESYSTEM_MEMORY_FILE;
8002430: 34 01 00 04 mvi r1,4
{
const IMFS_jnode_t *node = loc->node_access;
IMFS_jnode_types_t imfs_type = IMFS_type( node );
rtems_filesystem_node_types_t type;
switch ( imfs_type ) {
8002434: 5c 43 00 06 bne r2,r3,800244c <IMFS_node_type+0x34> <== ALWAYS TAKEN
8002438: c3 a0 00 00 ret <== NOT EXECUTED
type = imfs_type;
break;
}
return type;
}
800243c: 28 21 00 50 lw r1,(r1+80)
8002440: 28 21 00 4c lw r1,(r1+76)
8002444: 28 21 00 00 lw r1,(r1+0)
rtems_filesystem_node_types_t type;
switch ( imfs_type ) {
case IMFS_HARD_LINK:
type = IMFS_type( node->info.hard_link.link_node );
break;
8002448: c3 a0 00 00 ret
800244c: b8 40 08 00 mv r1,r2
type = imfs_type;
break;
}
return type;
}
8002450: c3 a0 00 00 ret
08002484 <IMFS_rename>:
const rtems_filesystem_location_info_t *oldloc,
const rtems_filesystem_location_info_t *newparentloc,
const char *name,
size_t namelen
)
{
8002484: 37 9c ff e8 addi sp,sp,-24
8002488: 5b 8b 00 10 sw (sp+16),r11
800248c: 5b 8c 00 0c sw (sp+12),r12
8002490: 5b 8d 00 08 sw (sp+8),r13
8002494: 5b 9d 00 04 sw (sp+4),ra
int rv = 0;
IMFS_jnode_t *node = oldloc->node_access;
8002498: 28 4b 00 08 lw r11,(r2+8)
const rtems_filesystem_location_info_t *oldloc,
const rtems_filesystem_location_info_t *newparentloc,
const char *name,
size_t namelen
)
{
800249c: b8 a0 68 00 mv r13,r5
int rv = 0;
IMFS_jnode_t *node = oldloc->node_access;
IMFS_jnode_t *new_parent = newparentloc->node_access;
80024a0: 28 6c 00 08 lw r12,(r3+8)
/*
* FIXME: Due to insufficient checks we can create inaccessible nodes with
* this operation.
*/
if ( node->Parent != NULL ) {
80024a4: 29 61 00 08 lw r1,(r11+8)
80024a8: 44 20 00 1e be r1,r0,8002520 <IMFS_rename+0x9c> <== NEVER TAKEN
if ( namelen < IMFS_NAME_MAX ) {
80024ac: 34 01 00 1f mvi r1,31
80024b0: 54 a1 00 19 bgu r5,r1,8002514 <IMFS_rename+0x90> <== NEVER TAKEN
memcpy( node->name, name, namelen );
80024b4: b8 80 10 00 mv r2,r4
80024b8: b8 a0 18 00 mv r3,r5
80024bc: 35 61 00 0c addi r1,r11,12
80024c0: f8 00 40 db calli 801282c <memcpy>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
80024c4: 29 62 00 00 lw r2,(r11+0)
previous = the_node->previous;
80024c8: 29 61 00 04 lw r1,(r11+4)
node->name [namelen] = '\0';
80024cc: b5 6d 68 00 add r13,r11,r13
80024d0: 31 a0 00 0c sb (r13+12),r0
next->previous = previous;
80024d4: 58 41 00 04 sw (r2+4),r1
previous->next = next;
80024d8: 58 22 00 00 sw (r1+0),r2
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
80024dc: 29 81 00 58 lw r1,(r12+88)
RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
80024e0: 35 82 00 54 addi r2,r12,84
Chain_Node *old_last = tail->previous;
the_node->next = tail;
80024e4: 59 62 00 00 sw (r11+0),r2
static inline void IMFS_add_to_directory(
IMFS_jnode_t *dir,
IMFS_jnode_t *node
)
{
node->Parent = dir;
80024e8: 59 6c 00 08 sw (r11+8),r12
tail->previous = the_node;
old_last->next = the_node;
80024ec: 58 2b 00 00 sw (r1+0),r11
the_node->previous = old_last;
80024f0: 59 61 00 04 sw (r11+4),r1
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
80024f4: 59 8b 00 58 sw (r12+88),r11
IMFS_remove_from_directory( node );
IMFS_add_to_directory( new_parent, node );
IMFS_update_ctime( node );
80024f8: 37 81 00 14 addi r1,sp,20
80024fc: 34 02 00 00 mvi r2,0
8002500: f8 00 01 32 calli 80029c8 <gettimeofday>
8002504: 2b 81 00 14 lw r1,(sp+20)
8002508: 59 61 00 48 sw (r11+72),r1
const rtems_filesystem_location_info_t *newparentloc,
const char *name,
size_t namelen
)
{
int rv = 0;
800250c: 34 01 00 00 mvi r1,0
8002510: e0 00 00 08 bi 8002530 <IMFS_rename+0xac>
IMFS_remove_from_directory( node );
IMFS_add_to_directory( new_parent, node );
IMFS_update_ctime( node );
} else {
errno = ENAMETOOLONG;
8002514: f8 00 3d ee calli 8011ccc <__errno> <== NOT EXECUTED
8002518: 34 02 00 5b mvi r2,91 <== NOT EXECUTED
800251c: e0 00 00 03 bi 8002528 <IMFS_rename+0xa4> <== NOT EXECUTED
rv = -1;
}
} else {
errno = EINVAL;
8002520: f8 00 3d eb calli 8011ccc <__errno> <== NOT EXECUTED
8002524: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
8002528: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
rv = -1;
800252c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
}
return rv;
}
8002530: 2b 9d 00 04 lw ra,(sp+4)
8002534: 2b 8b 00 10 lw r11,(sp+16)
8002538: 2b 8c 00 0c lw r12,(sp+12)
800253c: 2b 8d 00 08 lw r13,(sp+8)
8002540: 37 9c 00 18 addi sp,sp,24
8002544: c3 a0 00 00 ret
08002640 <IMFS_unmount>:
#endif
#include "imfs.h"
int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry )
{
8002640: 37 9c ff fc addi sp,sp,-4
8002644: 5b 9d 00 04 sw (sp+4),ra
int rv = 0;
IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access;
8002648: 28 22 00 20 lw r2,(r1+32)
800264c: 28 42 00 08 lw r2,(r2+8)
return node->control->imfs_type;
}
static inline bool IMFS_is_directory( const IMFS_jnode_t *node )
{
return node->control->imfs_type == IMFS_DIRECTORY;
8002650: 28 43 00 4c lw r3,(r2+76)
if ( IMFS_is_directory( node ) ) {
8002654: 28 63 00 00 lw r3,(r3+0)
8002658: 5c 60 00 09 bne r3,r0,800267c <IMFS_unmount+0x3c> <== NEVER TAKEN
if ( node->info.directory.mt_fs == mt_entry ) {
800265c: 28 43 00 5c lw r3,(r2+92)
8002660: 5c 61 00 04 bne r3,r1,8002670 <IMFS_unmount+0x30> <== NEVER TAKEN
node->info.directory.mt_fs = NULL;
8002664: 58 40 00 5c sw (r2+92),r0
#include "imfs.h"
int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry )
{
int rv = 0;
8002668: 34 01 00 00 mvi r1,0
800266c: e0 00 00 08 bi 800268c <IMFS_unmount+0x4c>
if ( IMFS_is_directory( node ) ) {
if ( node->info.directory.mt_fs == mt_entry ) {
node->info.directory.mt_fs = NULL;
} else {
errno = EINVAL;
8002670: f8 00 3d 97 calli 8011ccc <__errno> <== NOT EXECUTED
8002674: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
8002678: e0 00 00 03 bi 8002684 <IMFS_unmount+0x44> <== NOT EXECUTED
rv = -1;
}
} else {
errno = ENOTDIR;
800267c: f8 00 3d 94 calli 8011ccc <__errno> <== NOT EXECUTED
8002680: 34 02 00 14 mvi r2,20 <== NOT EXECUTED
8002684: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
rv = -1;
8002688: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
}
return rv;
}
800268c: 2b 9d 00 04 lw ra,(sp+4)
8002690: 37 9c 00 04 addi sp,sp,4
8002694: c3 a0 00 00 ret
08002e54 <RTEMS_Malloc_Initialize>:
void RTEMS_Malloc_Initialize(
const Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
8002e54: 37 9c ff e4 addi sp,sp,-28
8002e58: 5b 8b 00 1c sw (sp+28),r11
8002e5c: 5b 8c 00 18 sw (sp+24),r12
8002e60: 5b 8d 00 14 sw (sp+20),r13
8002e64: 5b 8e 00 10 sw (sp+16),r14
8002e68: 5b 8f 00 0c sw (sp+12),r15
8002e6c: 5b 90 00 08 sw (sp+8),r16
8002e70: 5b 9d 00 04 sw (sp+4),ra
Heap_Control *heap = RTEMS_Malloc_Heap;
8002e74: 78 04 08 01 mvhi r4,0x801
8002e78: 38 84 a0 54 ori r4,r4,0xa054
8002e7c: 28 8e 00 00 lw r14,(r4+0)
if ( !rtems_configuration_get_unified_work_area() ) {
8002e80: 78 04 08 01 mvhi r4,0x801
8002e84: 38 84 87 ec ori r4,r4,0x87ec
void RTEMS_Malloc_Initialize(
const Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
8002e88: b8 40 78 00 mv r15,r2
Heap_Control *heap = RTEMS_Malloc_Heap;
if ( !rtems_configuration_get_unified_work_area() ) {
8002e8c: 40 82 00 31 lbu r2,(r4+49)
void RTEMS_Malloc_Initialize(
const Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
8002e90: b8 60 80 00 mv r16,r3
Heap_Control *heap = RTEMS_Malloc_Heap;
if ( !rtems_configuration_get_unified_work_area() ) {
8002e94: 5c 40 00 17 bne r2,r0,8002ef0 <RTEMS_Malloc_Initialize+0x9c>
8002e98: 78 0b 08 00 mvhi r11,0x800
8002e9c: b8 20 60 00 mv r12,r1
8002ea0: 34 0d 00 00 mvi r13,0
8002ea4: 39 6b 62 44 ori r11,r11,0x6244
8002ea8: e0 00 00 0a bi 8002ed0 <RTEMS_Malloc_Initialize+0x7c>
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
size_t i;
for (i = 0; i < area_count; ++i) {
const Heap_Area *area = &areas [i];
uintptr_t space_available = (*init_or_extend)(
8002eac: 29 82 00 00 lw r2,(r12+0)
8002eb0: 29 83 00 04 lw r3,(r12+4)
8002eb4: b9 c0 08 00 mv r1,r14
8002eb8: 34 04 00 04 mvi r4,4
8002ebc: d9 60 00 00 call r11
area->begin,
area->size,
page_size
);
if ( space_available > 0 ) {
8002ec0: 44 20 00 02 be r1,r0,8002ec8 <RTEMS_Malloc_Initialize+0x74><== NEVER TAKEN
init_or_extend = extend;
8002ec4: ba 00 58 00 mv r11,r16
if ( !rtems_configuration_get_unified_work_area() ) {
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
size_t i;
for (i = 0; i < area_count; ++i) {
8002ec8: 35 ad 00 01 addi r13,r13,1
8002ecc: 35 8c 00 08 addi r12,r12,8
8002ed0: 55 ed ff f7 bgu r15,r13,8002eac <RTEMS_Malloc_Initialize+0x58>
if ( space_available > 0 ) {
init_or_extend = extend;
}
}
if ( init_or_extend == _Heap_Initialize ) {
8002ed4: 78 02 08 00 mvhi r2,0x800
8002ed8: 38 42 62 44 ori r2,r2,0x6244
8002edc: 5d 62 00 05 bne r11,r2,8002ef0 <RTEMS_Malloc_Initialize+0x9c>
_Internal_error_Occurred(
8002ee0: 34 01 00 00 mvi r1,0
8002ee4: 34 02 00 01 mvi r2,1
8002ee8: 34 03 00 17 mvi r3,23
8002eec: f8 00 0d 86 calli 8006504 <_Internal_error_Occurred>
}
/*
* If configured, initialize the statistics support
*/
if ( rtems_malloc_statistics_helpers != NULL ) {
8002ef0: 78 02 08 01 mvhi r2,0x801
8002ef4: 38 42 a7 0c ori r2,r2,0xa70c
8002ef8: 28 41 00 00 lw r1,(r2+0)
8002efc: 44 20 00 03 be r1,r0,8002f08 <RTEMS_Malloc_Initialize+0xb4>
(*rtems_malloc_statistics_helpers->initialize)();
8002f00: 28 21 00 00 lw r1,(r1+0)
8002f04: d8 20 00 00 call r1
}
MSBUMP( space_available, _Protected_heap_Get_size( heap ) );
8002f08: 78 0b 08 01 mvhi r11,0x801
8002f0c: 39 6b a8 88 ori r11,r11,0xa888
8002f10: 29 6c 00 00 lw r12,(r11+0)
8002f14: b9 c0 08 00 mv r1,r14
8002f18: f8 00 10 26 calli 8006fb0 <_Protected_heap_Get_size>
8002f1c: b4 2c 08 00 add r1,r1,r12
8002f20: 59 61 00 00 sw (r11+0),r1
}
8002f24: 2b 9d 00 04 lw ra,(sp+4)
8002f28: 2b 8b 00 1c lw r11,(sp+28)
8002f2c: 2b 8c 00 18 lw r12,(sp+24)
8002f30: 2b 8d 00 14 lw r13,(sp+20)
8002f34: 2b 8e 00 10 lw r14,(sp+16)
8002f38: 2b 8f 00 0c lw r15,(sp+12)
8002f3c: 2b 90 00 08 lw r16,(sp+8)
8002f40: 37 9c 00 1c addi sp,sp,28
8002f44: c3 a0 00 00 ret
08020fec <Stack_check_Dump_threads_usage>:
static rtems_printk_plugin_t print_handler;
static void Stack_check_Dump_threads_usage(
Thread_Control *the_thread
)
{
8020fec: 37 9c ff d4 addi sp,sp,-44
8020ff0: 5b 8b 00 24 sw (sp+36),r11
8020ff4: 5b 8c 00 20 sw (sp+32),r12
8020ff8: 5b 8d 00 1c sw (sp+28),r13
8020ffc: 5b 8e 00 18 sw (sp+24),r14
8021000: 5b 8f 00 14 sw (sp+20),r15
8021004: 5b 90 00 10 sw (sp+16),r16
8021008: 5b 91 00 0c sw (sp+12),r17
802100c: 5b 92 00 08 sw (sp+8),r18
8021010: 5b 9d 00 04 sw (sp+4),ra
8021014: b8 20 68 00 mv r13,r1
/*
* Obtain interrupt stack information
*/
#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
if (the_thread == (Thread_Control *) -1) {
8021018: 34 01 ff ff mvi r1,-1
802101c: 5d a1 00 08 bne r13,r1,802103c <Stack_check_Dump_threads_usage+0x50>
if (!Stack_check_Interrupt_stack.area)
8021020: 78 0c 08 06 mvhi r12,0x806
8021024: 39 8c aa a4 ori r12,r12,0xaaa4
8021028: 29 81 00 04 lw r1,(r12+4)
return;
stack = &Stack_check_Interrupt_stack;
the_thread = 0;
current = 0;
802102c: 34 10 00 00 mvi r16,0
#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
if (the_thread == (Thread_Control *) -1) {
if (!Stack_check_Interrupt_stack.area)
return;
stack = &Stack_check_Interrupt_stack;
the_thread = 0;
8021030: 34 0d 00 00 mvi r13,0
/*
* Obtain interrupt stack information
*/
#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
if (the_thread == (Thread_Control *) -1) {
if (!Stack_check_Interrupt_stack.area)
8021034: 5c 20 00 04 bne r1,r0,8021044 <Stack_check_Dump_threads_usage+0x58><== ALWAYS TAKEN
8021038: e0 00 00 54 bi 8021188 <Stack_check_Dump_threads_usage+0x19c><== NOT EXECUTED
current = 0;
} else
#endif
{
stack = &the_thread->Start.Initial_stack;
current = (void *)_CPU_Context_Get_SP( &the_thread->Registers );
802103c: 29 b0 01 04 lw r16,(r13+260)
the_thread = 0;
current = 0;
} else
#endif
{
stack = &the_thread->Start.Initial_stack;
8021040: 35 ac 00 b4 addi r12,r13,180
current = (void *)_CPU_Context_Get_SP( &the_thread->Registers );
}
low = Stack_check_usable_stack_start(stack);
size = Stack_check_usable_stack_size(stack);
8021044: 29 8f 00 00 lw r15,(r12+0)
{
const uint32_t *base, *ebase;
uint32_t length;
base = s;
length = n/4;
8021048: 34 02 00 02 mvi r2,2
{
stack = &the_thread->Start.Initial_stack;
current = (void *)_CPU_Context_Get_SP( &the_thread->Registers );
}
low = Stack_check_usable_stack_start(stack);
802104c: 29 8b 00 04 lw r11,(r12+4)
size = Stack_check_usable_stack_size(stack);
8021050: 35 ef ff f0 addi r15,r15,-16
{
const uint32_t *base, *ebase;
uint32_t length;
base = s;
length = n/4;
8021054: b9 e0 08 00 mv r1,r15
8021058: f8 00 dd 6d calli 805860c <__lshrsi3>
* start at lower memory and find first word that does not
* match pattern
*/
base += PATTERN_SIZE_WORDS;
for (ebase = base + length; base < ebase; base++)
802105c: 34 02 00 02 mvi r2,2
8021060: fb ff 7c 66 calli 80001f8 <__ashlsi3>
if (*base != U32_PATTERN)
8021064: 78 03 08 05 mvhi r3,0x805
{
stack = &the_thread->Start.Initial_stack;
current = (void *)_CPU_Context_Get_SP( &the_thread->Registers );
}
low = Stack_check_usable_stack_start(stack);
8021068: 35 71 00 10 addi r17,r11,16
* match pattern
*/
base += PATTERN_SIZE_WORDS;
for (ebase = base + length; base < ebase; base++)
if (*base != U32_PATTERN)
802106c: 38 63 ee c8 ori r3,r3,0xeec8
/*
* start at lower memory and find first word that does not
* match pattern
*/
base += PATTERN_SIZE_WORDS;
8021070: 35 6b 00 20 addi r11,r11,32
for (ebase = base + length; base < ebase; base++)
8021074: b5 61 08 00 add r1,r11,r1
if (*base != U32_PATTERN)
8021078: 28 62 00 00 lw r2,(r3+0)
802107c: e0 00 00 04 bi 802108c <Stack_check_Dump_threads_usage+0xa0>
8021080: 29 63 00 00 lw r3,(r11+0)
8021084: 5c 62 00 05 bne r3,r2,8021098 <Stack_check_Dump_threads_usage+0xac>
* start at lower memory and find first word that does not
* match pattern
*/
base += PATTERN_SIZE_WORDS;
for (ebase = base + length; base < ebase; base++)
8021088: 35 6b 00 04 addi r11,r11,4
802108c: 54 2b ff fd bgu r1,r11,8021080 <Stack_check_Dump_threads_usage+0x94><== ALWAYS TAKEN
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;
8021090: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED
8021094: e0 00 00 05 bi 80210a8 <Stack_check_Dump_threads_usage+0xbc><== NOT EXECUTED
8021098: 34 0e 00 00 mvi r14,0
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 )
802109c: 45 60 00 03 be r11,r0,80210a8 <Stack_check_Dump_threads_usage+0xbc><== NEVER TAKEN
used = Stack_check_Calculate_used( low, size, high_water_mark );
80210a0: b6 2f 70 00 add r14,r17,r15
80210a4: c9 cb 70 00 sub r14,r14,r11
80210a8: 78 04 08 06 mvhi r4,0x806
80210ac: 78 02 08 06 mvhi r2,0x806
80210b0: 38 84 9a 74 ori r4,r4,0x9a74
80210b4: 38 42 9a 70 ori r2,r2,0x9a70
else
used = 0;
#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
if ( the_thread )
80210b8: 45 a0 00 0f be r13,r0,80210f4 <Stack_check_Dump_threads_usage+0x108>
#endif
{
(*print_handler)(
80210bc: 29 ab 00 08 lw r11,(r13+8)
80210c0: 28 52 00 00 lw r18,(r2+0)
80210c4: 37 83 00 28 addi r3,sp,40
80210c8: b9 60 08 00 mv r1,r11
80210cc: 34 02 00 05 mvi r2,5
80210d0: 28 91 00 00 lw r17,(r4+0)
80210d4: fb ff ac 69 calli 800c278 <rtems_object_get_name>
80210d8: 78 02 08 05 mvhi r2,0x805
80210dc: b8 20 20 00 mv r4,r1
80210e0: 38 42 ed 3c ori r2,r2,0xed3c
80210e4: ba 40 08 00 mv r1,r18
80210e8: b9 60 18 00 mv r3,r11
80210ec: da 20 00 00 call r17
80210f0: e0 00 00 07 bi 802110c <Stack_check_Dump_threads_usage+0x120>
rtems_object_get_name( the_thread->Object.id, sizeof(name), name )
);
}
#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
else {
(*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 );
80210f4: 28 41 00 00 lw r1,(r2+0)
80210f8: 28 84 00 00 lw r4,(r4+0)
80210fc: 78 02 08 05 mvhi r2,0x805
8021100: 38 42 ed 4c ori r2,r2,0xed4c
8021104: 34 03 ff ff mvi r3,-1
8021108: d8 80 00 00 call r4
(*print_handler)(
print_context,
" %010p - %010p %010p %8" PRId32 " ",
stack->area,
stack->area + stack->size - 1,
802110c: 29 84 00 00 lw r4,(r12+0)
else {
(*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 );
}
#endif
(*print_handler)(
8021110: 78 0b 08 06 mvhi r11,0x806
8021114: 78 0d 08 06 mvhi r13,0x806
print_context,
" %010p - %010p %010p %8" PRId32 " ",
stack->area,
stack->area + stack->size - 1,
8021118: 29 83 00 04 lw r3,(r12+4)
else {
(*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 );
}
#endif
(*print_handler)(
802111c: 39 6b 9a 74 ori r11,r11,0x9a74
8021120: 39 ad 9a 70 ori r13,r13,0x9a70
8021124: 29 67 00 00 lw r7,(r11+0)
8021128: 29 a1 00 00 lw r1,(r13+0)
print_context,
" %010p - %010p %010p %8" PRId32 " ",
stack->area,
stack->area + stack->size - 1,
802112c: 34 84 ff ff addi r4,r4,-1
else {
(*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 );
}
#endif
(*print_handler)(
8021130: 78 02 08 05 mvhi r2,0x805
8021134: 38 42 ed 5c ori r2,r2,0xed5c
8021138: b4 64 20 00 add r4,r3,r4
802113c: ba 00 28 00 mv r5,r16
8021140: b9 e0 30 00 mv r6,r15
8021144: d8 e0 00 00 call r7
stack->area + stack->size - 1,
current,
size
);
if (Stack_check_Initialized == 0) {
8021148: 78 01 08 06 mvhi r1,0x806
802114c: 38 21 9a 78 ori r1,r1,0x9a78
8021150: 28 21 00 00 lw r1,(r1+0)
8021154: 5c 20 00 07 bne r1,r0,8021170 <Stack_check_Dump_threads_usage+0x184><== ALWAYS TAKEN
(*print_handler)( print_context, "Unavailable\n" );
8021158: 29 63 00 00 lw r3,(r11+0) <== NOT EXECUTED
802115c: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED
8021160: 78 02 08 05 mvhi r2,0x805 <== NOT EXECUTED
8021164: 38 42 ed 7c ori r2,r2,0xed7c <== NOT EXECUTED
8021168: d8 60 00 00 call r3 <== NOT EXECUTED
802116c: e0 00 00 07 bi 8021188 <Stack_check_Dump_threads_usage+0x19c><== NOT EXECUTED
} else {
(*print_handler)( print_context, "%8" PRId32 "\n", used );
8021170: 29 64 00 00 lw r4,(r11+0)
8021174: 29 a1 00 00 lw r1,(r13+0)
8021178: 78 02 08 05 mvhi r2,0x805
802117c: 38 42 ed 8c ori r2,r2,0xed8c
8021180: b9 c0 18 00 mv r3,r14
8021184: d8 80 00 00 call r4
}
}
8021188: 2b 9d 00 04 lw ra,(sp+4)
802118c: 2b 8b 00 24 lw r11,(sp+36)
8021190: 2b 8c 00 20 lw r12,(sp+32)
8021194: 2b 8d 00 1c lw r13,(sp+28)
8021198: 2b 8e 00 18 lw r14,(sp+24)
802119c: 2b 8f 00 14 lw r15,(sp+20)
80211a0: 2b 90 00 10 lw r16,(sp+16)
80211a4: 2b 91 00 0c lw r17,(sp+12)
80211a8: 2b 92 00 08 lw r18,(sp+8)
80211ac: 37 9c 00 2c addi sp,sp,44
80211b0: c3 a0 00 00 ret
080212c0 <Stack_check_report_blown_task>:
Thread_Control *running,
bool pattern_ok
) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok)
{
80212c0: 37 9c ff d0 addi sp,sp,-48
80212c4: 5b 8b 00 10 sw (sp+16),r11
80212c8: 5b 8c 00 0c sw (sp+12),r12
80212cc: 5b 8d 00 08 sw (sp+8),r13
80212d0: 5b 9d 00 04 sw (sp+4),ra
80212d4: b8 20 58 00 mv r11,r1
Stack_Control *stack = &running->Start.Initial_stack;
void *pattern_area = Stack_check_Get_pattern(stack);
80212d8: 28 2c 00 b8 lw r12,(r1+184)
char name[32];
printk("BLOWN STACK!!!\n");
80212dc: 78 01 08 05 mvhi r1,0x805
80212e0: 38 21 ed 94 ori r1,r1,0xed94
Thread_Control *running,
bool pattern_ok
) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok)
{
80212e4: 20 4d 00 ff andi r13,r2,0xff
Stack_Control *stack = &running->Start.Initial_stack;
void *pattern_area = Stack_check_Get_pattern(stack);
char name[32];
printk("BLOWN STACK!!!\n");
80212e8: fb ff 83 49 calli 800200c <printk>
printk("task control block: 0x%08" PRIxPTR "\n", running);
80212ec: 78 01 08 05 mvhi r1,0x805
80212f0: 38 21 ed a4 ori r1,r1,0xeda4
80212f4: b9 60 10 00 mv r2,r11
80212f8: fb ff 83 45 calli 800200c <printk>
printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id);
80212fc: 29 62 00 08 lw r2,(r11+8)
8021300: 78 01 08 05 mvhi r1,0x805
8021304: 38 21 ed c0 ori r1,r1,0xedc0
8021308: fb ff 83 41 calli 800200c <printk>
printk(
802130c: 29 62 00 0c lw r2,(r11+12)
8021310: 78 01 08 05 mvhi r1,0x805
8021314: 38 21 ed d4 ori r1,r1,0xedd4
8021318: fb ff 83 3d calli 800200c <printk>
"task name: 0x%08" PRIx32 "\n",
running->Object.name.name_u32
);
printk(
802131c: 29 61 00 08 lw r1,(r11+8)
8021320: 37 83 00 14 addi r3,sp,20
8021324: 34 02 00 20 mvi r2,32
8021328: fb ff ab d4 calli 800c278 <rtems_object_get_name>
802132c: b8 20 10 00 mv r2,r1
8021330: 78 01 08 05 mvhi r1,0x805
8021334: 38 21 ed e8 ori r1,r1,0xede8
8021338: fb ff 83 35 calli 800200c <printk>
);
printk(
"task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n",
(unsigned long) stack->size,
stack->area,
((char *) stack->area + stack->size)
802133c: 29 63 00 b8 lw r3,(r11+184)
8021340: 29 62 00 b4 lw r2,(r11+180)
);
printk(
"task name string: %s\n",
rtems_object_get_name(running->Object.id, sizeof(name), name)
);
printk(
8021344: 78 01 08 05 mvhi r1,0x805
8021348: 38 21 ee 00 ori r1,r1,0xee00
802134c: b4 62 20 00 add r4,r3,r2
8021350: fb ff 83 2f calli 800200c <printk>
"task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n",
(unsigned long) stack->size,
stack->area,
((char *) stack->area + stack->size)
);
if (!pattern_ok) {
8021354: 5d a0 00 07 bne r13,r0,8021370 <Stack_check_report_blown_task+0xb0><== NEVER TAKEN
printk(
8021358: 78 01 08 05 mvhi r1,0x805
802135c: 38 21 ee 30 ori r1,r1,0xee30
8021360: 34 02 00 10 mvi r2,16
8021364: 35 83 00 08 addi r3,r12,8
8021368: 35 84 00 18 addi r4,r12,24
802136c: fb ff 83 28 calli 800200c <printk>
rtems_configuration_get_user_multiprocessing_table()->node
);
}
#endif
rtems_fatal(
8021370: 29 62 00 0c lw r2,(r11+12)
8021374: 34 01 00 09 mvi r1,9
8021378: fb ff 89 05 calli 800378c <rtems_fatal>
08005938 <_API_extensions_Add_post_switch>:
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
8005938: 28 22 00 00 lw r2,(r1+0)
800593c: 5c 40 00 0c bne r2,r0,800596c <_API_extensions_Add_post_switch+0x34>
8005940: 28 23 00 04 lw r3,(r1+4)
8005944: 5c 62 00 0a bne r3,r2,800596c <_API_extensions_Add_post_switch+0x34><== NEVER TAKEN
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
8005948: 78 02 08 01 mvhi r2,0x801
800594c: 38 42 a9 e8 ori r2,r2,0xa9e8
8005950: 28 44 00 08 lw r4,(r2+8)
the_node->next = tail;
8005954: 78 03 08 01 mvhi r3,0x801
8005958: 38 63 a9 ec ori r3,r3,0xa9ec
800595c: 58 23 00 00 sw (r1+0),r3
tail->previous = the_node;
8005960: 58 41 00 08 sw (r2+8),r1
old_last->next = the_node;
8005964: 58 81 00 00 sw (r4+0),r1
the_node->previous = old_last;
8005968: 58 24 00 04 sw (r1+4),r4
800596c: c3 a0 00 00 ret
0800699c <_CORE_RWLock_Release>:
#include <rtems/score/watchdog.h>
CORE_RWLock_Status _CORE_RWLock_Release(
CORE_RWLock_Control *the_rwlock
)
{
800699c: 37 9c ff f4 addi sp,sp,-12
80069a0: 5b 8b 00 0c sw (sp+12),r11
80069a4: 5b 8c 00 08 sw (sp+8),r12
80069a8: 5b 9d 00 04 sw (sp+4),ra
80069ac: b8 20 58 00 mv r11,r1
ISR_Level level;
Thread_Control *executing = _Thread_Executing;
80069b0: 78 01 08 01 mvhi r1,0x801
80069b4: 38 21 9d a0 ori r1,r1,0x9da0
80069b8: 28 22 00 10 lw r2,(r1+16)
* Otherwise, we have to block.
* If locked for reading and no waiters, then OK to read.
* If any thread is waiting, then we wait.
*/
_ISR_Disable( level );
80069bc: 90 00 08 00 rcsr r1,IE
80069c0: 34 03 ff fe mvi r3,-2
80069c4: a0 23 18 00 and r3,r1,r3
80069c8: d0 03 00 00 wcsr IE,r3
if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){
80069cc: 29 63 00 44 lw r3,(r11+68)
80069d0: 5c 60 00 05 bne r3,r0,80069e4 <_CORE_RWLock_Release+0x48>
_ISR_Enable( level );
80069d4: d0 01 00 00 wcsr IE,r1
executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE;
80069d8: 34 01 00 02 mvi r1,2
80069dc: 58 41 00 34 sw (r2+52),r1
return CORE_RWLOCK_SUCCESSFUL;
80069e0: e0 00 00 26 bi 8006a78 <_CORE_RWLock_Release+0xdc>
}
if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) {
80069e4: 34 04 00 01 mvi r4,1
80069e8: 5c 64 00 07 bne r3,r4,8006a04 <_CORE_RWLock_Release+0x68>
the_rwlock->number_of_readers -= 1;
80069ec: 29 63 00 48 lw r3,(r11+72)
80069f0: 34 63 ff ff addi r3,r3,-1
80069f4: 59 63 00 48 sw (r11+72),r3
if ( the_rwlock->number_of_readers != 0 ) {
80069f8: 44 60 00 03 be r3,r0,8006a04 <_CORE_RWLock_Release+0x68>
/* must be unlocked again */
_ISR_Enable( level );
80069fc: d0 01 00 00 wcsr IE,r1
return CORE_RWLOCK_SUCCESSFUL;
8006a00: e0 00 00 1e bi 8006a78 <_CORE_RWLock_Release+0xdc>
}
}
/* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */
executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
8006a04: 58 40 00 34 sw (r2+52),r0
/*
* Implicitly transition to "unlocked" and find another thread interested
* in obtaining this rwlock.
*/
the_rwlock->current_state = CORE_RWLOCK_UNLOCKED;
8006a08: 59 60 00 44 sw (r11+68),r0
_ISR_Enable( level );
8006a0c: d0 01 00 00 wcsr IE,r1
next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue );
8006a10: b9 60 08 00 mv r1,r11
8006a14: f8 00 08 86 calli 8008c2c <_Thread_queue_Dequeue>
if ( next ) {
8006a18: 44 20 00 18 be r1,r0,8006a78 <_CORE_RWLock_Release+0xdc>
if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) {
8006a1c: 28 22 00 30 lw r2,(r1+48)
8006a20: 34 01 00 01 mvi r1,1
8006a24: 5c 41 00 04 bne r2,r1,8006a34 <_CORE_RWLock_Release+0x98>
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING;
8006a28: 34 01 00 02 mvi r1,2
8006a2c: 59 61 00 44 sw (r11+68),r1
return CORE_RWLOCK_SUCCESSFUL;
8006a30: e0 00 00 12 bi 8006a78 <_CORE_RWLock_Release+0xdc>
}
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
8006a34: 29 62 00 48 lw r2,(r11+72)
the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING;
8006a38: 59 61 00 44 sw (r11+68),r1
/*
* Now see if more readers can be let go.
*/
while ( 1 ) {
next = _Thread_queue_First( &the_rwlock->Wait_queue );
if ( !next ||
8006a3c: 34 0c 00 01 mvi r12,1
}
/*
* Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING
*/
the_rwlock->number_of_readers += 1;
8006a40: 34 42 00 01 addi r2,r2,1
8006a44: 59 62 00 48 sw (r11+72),r2
/*
* Now see if more readers can be let go.
*/
while ( 1 ) {
next = _Thread_queue_First( &the_rwlock->Wait_queue );
8006a48: b9 60 08 00 mv r1,r11
8006a4c: f8 00 09 f9 calli 8009230 <_Thread_queue_First>
8006a50: b8 20 10 00 mv r2,r1
if ( !next ||
8006a54: 44 20 00 09 be r1,r0,8006a78 <_CORE_RWLock_Release+0xdc>
8006a58: 28 21 00 30 lw r1,(r1+48)
8006a5c: 44 2c 00 07 be r1,r12,8006a78 <_CORE_RWLock_Release+0xdc> <== NEVER TAKEN
next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE )
return CORE_RWLOCK_SUCCESSFUL;
the_rwlock->number_of_readers += 1;
8006a60: 29 61 00 48 lw r1,(r11+72)
8006a64: 34 21 00 01 addi r1,r1,1
8006a68: 59 61 00 48 sw (r11+72),r1
_Thread_queue_Extract( &the_rwlock->Wait_queue, next );
8006a6c: b9 60 08 00 mv r1,r11
8006a70: f8 00 09 a8 calli 8009110 <_Thread_queue_Extract>
}
8006a74: e3 ff ff f5 bi 8006a48 <_CORE_RWLock_Release+0xac>
}
/* indentation is to match _ISR_Disable at top */
return CORE_RWLOCK_SUCCESSFUL;
}
8006a78: 34 01 00 00 mvi r1,0
8006a7c: 2b 9d 00 04 lw ra,(sp+4)
8006a80: 2b 8b 00 0c lw r11,(sp+12)
8006a84: 2b 8c 00 08 lw r12,(sp+8)
8006a88: 37 9c 00 0c addi sp,sp,12
8006a8c: c3 a0 00 00 ret
08006a90 <_CORE_RWLock_Timeout>:
void _CORE_RWLock_Timeout(
Objects_Id id,
void *ignored
)
{
8006a90: 37 9c ff f8 addi sp,sp,-8
8006a94: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
8006a98: 37 82 00 08 addi r2,sp,8
8006a9c: f8 00 07 70 calli 800885c <_Thread_Get>
switch ( location ) {
8006aa0: 2b 82 00 08 lw r2,(sp+8)
8006aa4: 5c 40 00 07 bne r2,r0,8006ac0 <_CORE_RWLock_Timeout+0x30> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_queue_Process_timeout( the_thread );
8006aa8: f8 00 0a 3c calli 8009398 <_Thread_queue_Process_timeout>
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
8006aac: 78 01 08 01 mvhi r1,0x801
8006ab0: 38 21 99 08 ori r1,r1,0x9908
8006ab4: 28 22 00 00 lw r2,(r1+0)
--level;
8006ab8: 34 42 ff ff addi r2,r2,-1
_Thread_Dispatch_disable_level = level;
8006abc: 58 22 00 00 sw (r1+0),r2
_Thread_Unnest_dispatch();
break;
}
}
8006ac0: 2b 9d 00 04 lw ra,(sp+4)
8006ac4: 37 9c 00 08 addi sp,sp,8
8006ac8: c3 a0 00 00 ret
0800e320 <_CORE_message_queue_Seize>:
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800e320: 37 9c ff f0 addi sp,sp,-16
800e324: 5b 8b 00 10 sw (sp+16),r11
800e328: 5b 8c 00 0c sw (sp+12),r12
800e32c: 5b 8d 00 08 sw (sp+8),r13
800e330: 5b 9d 00 04 sw (sp+4),ra
ISR_Level level;
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
800e334: 78 07 08 02 mvhi r7,0x802
800e338: 38 e7 8f 20 ori r7,r7,0x8f20
800e33c: 28 e7 00 10 lw r7,(r7+16)
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800e340: b8 20 58 00 mv r11,r1
800e344: 20 a5 00 ff andi r5,r5,0xff
ISR_Level level;
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
800e348: 58 e0 00 34 sw (r7+52),r0
void *buffer,
size_t *size_p,
bool wait,
Watchdog_Interval timeout
)
{
800e34c: b8 60 08 00 mv r1,r3
CORE_message_queue_Buffer_control *the_message;
Thread_Control *executing;
executing = _Thread_Executing;
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
_ISR_Disable( level );
800e350: 90 00 40 00 rcsr r8,IE
800e354: 34 03 ff fe mvi r3,-2
800e358: a1 03 18 00 and r3,r8,r3
800e35c: d0 03 00 00 wcsr IE,r3
executing->Wait.return_argument = size_p;
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
}
800e360: 29 6c 00 50 lw r12,(r11+80)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
800e364: 35 63 00 54 addi r3,r11,84
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
800e368: 45 83 00 07 be r12,r3,800e384 <_CORE_message_queue_Seize+0x64>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
800e36c: 29 83 00 00 lw r3,(r12+0)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
800e370: 35 69 00 50 addi r9,r11,80
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
800e374: 59 63 00 50 sw (r11+80),r3
new_first->previous = head;
800e378: 58 69 00 04 sw (r3+4),r9
executing = _Thread_Executing;
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
_ISR_Disable( level );
the_message = _CORE_message_queue_Get_pending_message( the_message_queue );
if ( the_message != NULL ) {
800e37c: 5d 80 00 04 bne r12,r0,800e38c <_CORE_message_queue_Seize+0x6c><== ALWAYS TAKEN
800e380: e0 00 00 25 bi 800e414 <_CORE_message_queue_Seize+0xf4> <== NOT EXECUTED
)
{
if ( !_Chain_Is_empty(the_chain))
return _Chain_Get_first_unprotected(the_chain);
else
return NULL;
800e384: 34 0c 00 00 mvi r12,0
800e388: e0 00 00 23 bi 800e414 <_CORE_message_queue_Seize+0xf4>
the_message_queue->number_of_pending_messages -= 1;
800e38c: 29 62 00 48 lw r2,(r11+72)
800e390: 34 42 ff ff addi r2,r2,-1
800e394: 59 62 00 48 sw (r11+72),r2
_ISR_Enable( level );
800e398: d0 08 00 00 wcsr IE,r8
*size_p = the_message->Contents.size;
800e39c: 29 83 00 0c lw r3,(r12+12)
_Thread_Executing->Wait.count =
800e3a0: 78 02 08 02 mvhi r2,0x802
800e3a4: 38 42 8f 20 ori r2,r2,0x8f20
the_message = _CORE_message_queue_Get_pending_message( the_message_queue );
if ( the_message != NULL ) {
the_message_queue->number_of_pending_messages -= 1;
_ISR_Enable( level );
*size_p = the_message->Contents.size;
800e3a8: 58 83 00 00 sw (r4+0),r3
_Thread_Executing->Wait.count =
800e3ac: 29 84 00 08 lw r4,(r12+8)
800e3b0: 28 42 00 10 lw r2,(r2+16)
_CORE_message_queue_Get_message_priority( the_message );
_CORE_message_queue_Copy_buffer(
the_message->Contents.buffer,
800e3b4: 35 8d 00 10 addi r13,r12,16
if ( the_message != NULL ) {
the_message_queue->number_of_pending_messages -= 1;
_ISR_Enable( level );
*size_p = the_message->Contents.size;
_Thread_Executing->Wait.count =
800e3b8: 58 44 00 24 sw (r2+36),r4
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
800e3bc: b9 a0 10 00 mv r2,r13
800e3c0: f8 00 25 ac calli 8017a70 <memcpy>
* is not, then we can go ahead and free the buffer.
*
* NOTE: If we note that the queue was not full before this receive,
* then we can avoid this dequeue.
*/
the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue );
800e3c4: b9 60 08 00 mv r1,r11
800e3c8: f8 00 0a 97 calli 8010e24 <_Thread_queue_Dequeue>
800e3cc: b8 20 20 00 mv r4,r1
if ( !the_thread ) {
800e3d0: 5c 20 00 05 bne r1,r0,800e3e4 <_CORE_message_queue_Seize+0xc4>
RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer (
CORE_message_queue_Control *the_message_queue,
CORE_message_queue_Buffer_control *the_message
)
{
_Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node );
800e3d4: 35 61 00 68 addi r1,r11,104
800e3d8: b9 80 10 00 mv r2,r12
800e3dc: fb ff ff 6b calli 800e188 <_Chain_Append>
_CORE_message_queue_Free_message_buffer(
the_message_queue,
the_message
);
return;
800e3e0: e0 00 00 1e bi 800e458 <_CORE_message_queue_Seize+0x138>
CORE_message_queue_Buffer_control *the_message,
int priority
)
{
#if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
the_message->priority = priority;
800e3e4: 28 21 00 24 lw r1,(r1+36)
*/
_CORE_message_queue_Set_message_priority(
the_message,
the_thread->Wait.count
);
the_message->Contents.size = (size_t) the_thread->Wait.option;
800e3e8: 28 83 00 30 lw r3,(r4+48)
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
800e3ec: 28 82 00 2c lw r2,(r4+44)
CORE_message_queue_Buffer_control *the_message,
int priority
)
{
#if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
the_message->priority = priority;
800e3f0: 59 81 00 08 sw (r12+8),r1
800e3f4: 59 83 00 0c sw (r12+12),r3
const void *source,
void *destination,
size_t size
)
{
memcpy(destination, source, size);
800e3f8: b9 a0 08 00 mv r1,r13
800e3fc: f8 00 25 9d calli 8017a70 <memcpy>
the_thread->Wait.return_argument_second.immutable_object,
the_message->Contents.buffer,
the_message->Contents.size
);
_CORE_message_queue_Insert_message(
800e400: 29 83 00 08 lw r3,(r12+8)
800e404: b9 60 08 00 mv r1,r11
800e408: b9 80 10 00 mv r2,r12
800e40c: f8 00 18 8c calli 801463c <_CORE_message_queue_Insert_message>
the_message_queue,
the_message,
_CORE_message_queue_Get_message_priority( the_message )
);
return;
800e410: e0 00 00 12 bi 800e458 <_CORE_message_queue_Seize+0x138>
}
#endif
}
if ( !wait ) {
800e414: 5c ac 00 05 bne r5,r12,800e428 <_CORE_message_queue_Seize+0x108>
_ISR_Enable( level );
800e418: d0 08 00 00 wcsr IE,r8
executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT;
800e41c: 34 01 00 04 mvi r1,4
800e420: 58 e1 00 34 sw (r7+52),r1
return;
800e424: e0 00 00 0d bi 800e458 <_CORE_message_queue_Seize+0x138>
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
800e428: 34 03 00 01 mvi r3,1
800e42c: 59 63 00 30 sw (r11+48),r3
}
_Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue );
executing->Wait.queue = &the_message_queue->Wait_queue;
800e430: 58 eb 00 44 sw (r7+68),r11
executing->Wait.id = id;
800e434: 58 e2 00 20 sw (r7+32),r2
executing->Wait.return_argument_second.mutable_object = buffer;
800e438: 58 e1 00 2c sw (r7+44),r1
executing->Wait.return_argument = size_p;
800e43c: 58 e4 00 28 sw (r7+40),r4
/* Wait.count will be filled in with the message priority */
_ISR_Enable( level );
800e440: d0 08 00 00 wcsr IE,r8
_Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout );
800e444: 78 03 08 01 mvhi r3,0x801
800e448: b9 60 08 00 mv r1,r11
800e44c: b8 c0 10 00 mv r2,r6
800e450: 38 63 14 cc ori r3,r3,0x14cc
800e454: f8 00 0a e7 calli 8010ff0 <_Thread_queue_Enqueue_with_handler>
}
800e458: 2b 9d 00 04 lw ra,(sp+4)
800e45c: 2b 8b 00 10 lw r11,(sp+16)
800e460: 2b 8c 00 0c lw r12,(sp+12)
800e464: 2b 8d 00 08 lw r13,(sp+8)
800e468: 37 9c 00 10 addi sp,sp,16
800e46c: c3 a0 00 00 ret
08005b38 <_CORE_mutex_Initialize>:
CORE_mutex_Status _CORE_mutex_Initialize(
CORE_mutex_Control *the_mutex,
CORE_mutex_Attributes *the_mutex_attributes,
uint32_t initial_lock
)
{
8005b38: 37 9c ff fc addi sp,sp,-4
8005b3c: 5b 9d 00 04 sw (sp+4),ra
/* Add this to the RTEMS environment later ?????????
rtems_assert( initial_lock == CORE_MUTEX_LOCKED ||
initial_lock == CORE_MUTEX_UNLOCKED );
*/
the_mutex->Attributes = *the_mutex_attributes;
8005b40: 28 47 00 00 lw r7,(r2+0)
8005b44: 28 46 00 04 lw r6,(r2+4)
8005b48: 28 44 00 08 lw r4,(r2+8)
8005b4c: 28 45 00 0c lw r5,(r2+12)
8005b50: 58 27 00 40 sw (r1+64),r7
8005b54: 58 26 00 44 sw (r1+68),r6
8005b58: 58 24 00 48 sw (r1+72),r4
8005b5c: 58 25 00 4c sw (r1+76),r5
the_mutex->lock = initial_lock;
8005b60: 58 23 00 50 sw (r1+80),r3
the_mutex->blocked_count = 0;
8005b64: 58 20 00 58 sw (r1+88),r0
if ( initial_lock == CORE_MUTEX_LOCKED ) {
8005b68: 5c 60 00 15 bne r3,r0,8005bbc <_CORE_mutex_Initialize+0x84>
the_mutex->nest_count = 1;
8005b6c: 34 03 00 01 mvi r3,1
8005b70: 58 23 00 54 sw (r1+84),r3
the_mutex->holder = _Thread_Executing;
8005b74: 78 03 08 01 mvhi r3,0x801
8005b78: 38 63 ae 00 ori r3,r3,0xae00
8005b7c: 28 63 00 10 lw r3,(r3+16)
the_mutex->holder_id = _Thread_Executing->Object.id;
8005b80: 28 65 00 08 lw r5,(r3+8)
the_mutex->lock = initial_lock;
the_mutex->blocked_count = 0;
if ( initial_lock == CORE_MUTEX_LOCKED ) {
the_mutex->nest_count = 1;
the_mutex->holder = _Thread_Executing;
8005b84: 58 23 00 5c sw (r1+92),r3
the_mutex->holder_id = _Thread_Executing->Object.id;
8005b88: 58 25 00 60 sw (r1+96),r5
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
8005b8c: 34 05 00 02 mvi r5,2
8005b90: 44 85 00 03 be r4,r5,8005b9c <_CORE_mutex_Initialize+0x64>
8005b94: 34 05 00 03 mvi r5,3
8005b98: 5c 85 00 0c bne r4,r5,8005bc8 <_CORE_mutex_Initialize+0x90>
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
if ( _Thread_Executing->current_priority <
8005b9c: 28 65 00 14 lw r5,(r3+20)
8005ba0: 28 26 00 4c lw r6,(r1+76)
the_mutex->Attributes.priority_ceiling )
return CORE_MUTEX_STATUS_CEILING_VIOLATED;
8005ba4: 34 04 00 06 mvi r4,6
the_mutex->holder = _Thread_Executing;
the_mutex->holder_id = _Thread_Executing->Object.id;
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
if ( _Thread_Executing->current_priority <
8005ba8: 54 c5 00 0e bgu r6,r5,8005be0 <_CORE_mutex_Initialize+0xa8><== NEVER TAKEN
_Chain_Prepend_unprotected( &_Thread_Executing->lock_mutex,
&the_mutex->queue.lock_queue );
the_mutex->queue.priority_before = _Thread_Executing->current_priority;
#endif
_Thread_Executing->resource_count++;
8005bac: 28 64 00 1c lw r4,(r3+28)
8005bb0: 34 84 00 01 addi r4,r4,1
8005bb4: 58 64 00 1c sw (r3+28),r4
8005bb8: e0 00 00 04 bi 8005bc8 <_CORE_mutex_Initialize+0x90>
}
} else {
the_mutex->nest_count = 0;
8005bbc: 58 20 00 54 sw (r1+84),r0
the_mutex->holder = NULL;
8005bc0: 58 20 00 5c sw (r1+92),r0
the_mutex->holder_id = 0;
8005bc4: 58 20 00 60 sw (r1+96),r0
}
_Thread_queue_Initialize(
8005bc8: 28 42 00 08 lw r2,(r2+8)
8005bcc: 34 04 00 05 mvi r4,5
8005bd0: 34 03 04 00 mvi r3,1024
8005bd4: 7c 42 00 00 cmpnei r2,r2,0
8005bd8: f8 00 09 c4 calli 80082e8 <_Thread_queue_Initialize>
THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY,
STATES_WAITING_FOR_MUTEX,
CORE_MUTEX_TIMEOUT
);
return CORE_MUTEX_STATUS_SUCCESSFUL;
8005bdc: 34 04 00 00 mvi r4,0
}
8005be0: b8 80 08 00 mv r1,r4
8005be4: 2b 9d 00 04 lw ra,(sp+4)
8005be8: 37 9c 00 04 addi sp,sp,4
8005bec: c3 a0 00 00 ret
08005f04 <_CORE_semaphore_Surrender>:
CORE_semaphore_Status _CORE_semaphore_Surrender(
CORE_semaphore_Control *the_semaphore,
Objects_Id id,
CORE_semaphore_API_mp_support_callout api_semaphore_mp_support
)
{
8005f04: 37 9c ff f8 addi sp,sp,-8
8005f08: 5b 8b 00 08 sw (sp+8),r11
8005f0c: 5b 9d 00 04 sw (sp+4),ra
8005f10: b8 20 58 00 mv r11,r1
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) {
8005f14: f8 00 07 ab calli 8007dc0 <_Thread_queue_Dequeue>
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
8005f18: 34 02 00 00 mvi r2,0
if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) {
8005f1c: 5c 20 00 0d bne r1,r0,8005f50 <_CORE_semaphore_Surrender+0x4c>
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
(*api_semaphore_mp_support) ( the_thread, id );
#endif
} else {
_ISR_Disable( level );
8005f20: 90 00 08 00 rcsr r1,IE
8005f24: 34 02 ff fe mvi r2,-2
8005f28: a0 22 10 00 and r2,r1,r2
8005f2c: d0 02 00 00 wcsr IE,r2
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
8005f30: 29 63 00 48 lw r3,(r11+72)
8005f34: 29 64 00 40 lw r4,(r11+64)
the_semaphore->count += 1;
else
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
8005f38: 34 02 00 04 mvi r2,4
(*api_semaphore_mp_support) ( the_thread, id );
#endif
} else {
_ISR_Disable( level );
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
8005f3c: 50 64 00 04 bgeu r3,r4,8005f4c <_CORE_semaphore_Surrender+0x48><== NEVER TAKEN
the_semaphore->count += 1;
8005f40: 34 63 00 01 addi r3,r3,1
8005f44: 59 63 00 48 sw (r11+72),r3
{
Thread_Control *the_thread;
ISR_Level level;
CORE_semaphore_Status status;
status = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
8005f48: 34 02 00 00 mvi r2,0
_ISR_Disable( level );
if ( the_semaphore->count < the_semaphore->Attributes.maximum_count )
the_semaphore->count += 1;
else
status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED;
_ISR_Enable( level );
8005f4c: d0 01 00 00 wcsr IE,r1
}
return status;
}
8005f50: b8 40 08 00 mv r1,r2
8005f54: 2b 9d 00 04 lw ra,(sp+4)
8005f58: 2b 8b 00 08 lw r11,(sp+8)
8005f5c: 37 9c 00 08 addi sp,sp,8
8005f60: c3 a0 00 00 ret
0800e56c <_Event_Surrender>:
rtems_event_set event_in,
Event_Control *event,
Thread_blocking_operation_States *sync_state,
States_Control wait_state
)
{
800e56c: 37 9c ff f4 addi sp,sp,-12
800e570: 5b 8b 00 0c sw (sp+12),r11
800e574: 5b 8c 00 08 sw (sp+8),r12
800e578: 5b 9d 00 04 sw (sp+4),ra
rtems_event_set pending_events;
rtems_event_set event_condition;
rtems_event_set seized_events;
rtems_option option_set;
option_set = the_thread->Wait.option;
800e57c: 28 2a 00 30 lw r10,(r1+48)
rtems_event_set event_in,
Event_Control *event,
Thread_blocking_operation_States *sync_state,
States_Control wait_state
)
{
800e580: b8 20 58 00 mv r11,r1
rtems_event_set seized_events;
rtems_option option_set;
option_set = the_thread->Wait.option;
_ISR_Disable( level );
800e584: 90 00 08 00 rcsr r1,IE
800e588: 34 09 ff fe mvi r9,-2
800e58c: a0 29 48 00 and r9,r1,r9
800e590: d0 09 00 00 wcsr IE,r9
RTEMS_INLINE_ROUTINE void _Event_sets_Post(
rtems_event_set the_new_events,
rtems_event_set *the_event_set
)
{
*the_event_set |= the_new_events;
800e594: 28 66 00 00 lw r6,(r3+0)
_Event_sets_Post( event_in, &event->pending_events );
pending_events = event->pending_events;
event_condition = the_thread->Wait.count;
800e598: 29 68 00 24 lw r8,(r11+36)
800e59c: b8 46 10 00 or r2,r2,r6
800e5a0: 58 62 00 00 sw (r3+0),r2
RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get(
rtems_event_set the_event_set,
rtems_event_set the_event_condition
)
{
return ( the_event_set & the_event_condition );
800e5a4: a0 48 30 00 and r6,r2,r8
seized_events = _Event_sets_Get( pending_events, event_condition );
/*
* No events were seized in this operation
*/
if ( _Event_sets_Is_empty( seized_events ) ) {
800e5a8: 44 c0 00 35 be r6,r0,800e67c <_Event_Surrender+0x110>
/*
* If we are in an ISR and sending to the current thread, then
* we have a critical section issue to deal with.
*/
if ( _ISR_Is_in_progress() &&
800e5ac: 78 07 08 01 mvhi r7,0x801
800e5b0: 38 e7 ae 00 ori r7,r7,0xae00
800e5b4: 28 ec 00 08 lw r12,(r7+8)
800e5b8: 45 80 00 13 be r12,r0,800e604 <_Event_Surrender+0x98>
800e5bc: 28 e7 00 10 lw r7,(r7+16)
800e5c0: 5d 67 00 11 bne r11,r7,800e604 <_Event_Surrender+0x98>
_Thread_Is_executing( the_thread ) &&
((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
800e5c4: 28 8c 00 00 lw r12,(r4+0)
/*
* If we are in an ISR and sending to the current thread, then
* we have a critical section issue to deal with.
*/
if ( _ISR_Is_in_progress() &&
_Thread_Is_executing( the_thread ) &&
800e5c8: 34 07 00 01 mvi r7,1
((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
800e5cc: 35 8c ff ff addi r12,r12,-1
/*
* If we are in an ISR and sending to the current thread, then
* we have a critical section issue to deal with.
*/
if ( _ISR_Is_in_progress() &&
_Thread_Is_executing( the_thread ) &&
800e5d0: 55 87 00 0d bgu r12,r7,800e604 <_Event_Surrender+0x98>
((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) ||
(*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) {
if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
800e5d4: 44 c8 00 03 be r6,r8,800e5e0 <_Event_Surrender+0x74>
*/
RTEMS_INLINE_ROUTINE bool _Options_Is_any (
rtems_option option_set
)
{
return (option_set & RTEMS_EVENT_ANY) ? true : false;
800e5d8: 21 4a 00 02 andi r10,r10,0x2
800e5dc: 45 40 00 28 be r10,r0,800e67c <_Event_Surrender+0x110> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear(
rtems_event_set the_event_set,
rtems_event_set the_mask
)
{
return ( the_event_set & ~(the_mask) );
800e5e0: a4 c0 28 00 not r5,r6
800e5e4: a0 a2 10 00 and r2,r5,r2
event->pending_events = _Event_sets_Clear(
800e5e8: 58 62 00 00 sw (r3+0),r2
pending_events,
seized_events
);
the_thread->Wait.count = 0;
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800e5ec: 29 62 00 28 lw r2,(r11+40)
if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
event->pending_events = _Event_sets_Clear(
pending_events,
seized_events
);
the_thread->Wait.count = 0;
800e5f0: 59 60 00 24 sw (r11+36),r0
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800e5f4: 58 46 00 00 sw (r2+0),r6
*sync_state = THREAD_BLOCKING_OPERATION_SATISFIED;
800e5f8: 34 02 00 03 mvi r2,3
800e5fc: 58 82 00 00 sw (r4+0),r2
800e600: e0 00 00 1f bi 800e67c <_Event_Surrender+0x110>
RTEMS_INLINE_ROUTINE bool _States_Are_set (
States_Control the_states,
States_Control mask
)
{
return ( (the_states & mask) != STATES_READY);
800e604: 29 64 00 10 lw r4,(r11+16)
800e608: a0 a4 28 00 and r5,r5,r4
}
/*
* Otherwise, this is a normal send to another thread
*/
if ( _States_Are_set( the_thread->current_state, wait_state ) ) {
800e60c: 44 a0 00 1c be r5,r0,800e67c <_Event_Surrender+0x110>
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
800e610: 44 c8 00 03 be r6,r8,800e61c <_Event_Surrender+0xb0>
800e614: 21 4a 00 02 andi r10,r10,0x2
800e618: 45 40 00 19 be r10,r0,800e67c <_Event_Surrender+0x110> <== NEVER TAKEN
800e61c: a4 c0 20 00 not r4,r6
800e620: a0 82 10 00 and r2,r4,r2
event->pending_events = _Event_sets_Clear(
800e624: 58 62 00 00 sw (r3+0),r2
pending_events,
seized_events
);
the_thread->Wait.count = 0;
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800e628: 29 62 00 28 lw r2,(r11+40)
if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
event->pending_events = _Event_sets_Clear(
pending_events,
seized_events
);
the_thread->Wait.count = 0;
800e62c: 59 60 00 24 sw (r11+36),r0
*(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
800e630: 58 46 00 00 sw (r2+0),r6
_ISR_Flash( level );
800e634: d0 01 00 00 wcsr IE,r1
800e638: d0 09 00 00 wcsr IE,r9
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
800e63c: 29 63 00 50 lw r3,(r11+80)
800e640: 34 02 00 02 mvi r2,2
800e644: 44 62 00 03 be r3,r2,800e650 <_Event_Surrender+0xe4>
_ISR_Enable( level );
800e648: d0 01 00 00 wcsr IE,r1
800e64c: e0 00 00 06 bi 800e664 <_Event_Surrender+0xf8>
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate(
Watchdog_Control *the_watchdog
)
{
the_watchdog->state = WATCHDOG_REMOVE_IT;
800e650: 34 02 00 03 mvi r2,3
800e654: 59 62 00 50 sw (r11+80),r2
_Thread_Unblock( the_thread );
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
800e658: d0 01 00 00 wcsr IE,r1
(void) _Watchdog_Remove( &the_thread->Timer );
800e65c: 35 61 00 48 addi r1,r11,72
800e660: fb ff e8 fc calli 8008a50 <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800e664: 78 03 08 01 mvhi r3,0x801
800e668: 38 63 8c 94 ori r3,r3,0x8c94
800e66c: 28 62 00 00 lw r2,(r3+0)
800e670: b9 60 08 00 mv r1,r11
800e674: f8 00 04 c9 calli 800f998 <_Thread_Clear_state>
800e678: e0 00 00 02 bi 800e680 <_Event_Surrender+0x114>
_Thread_Unblock( the_thread );
}
return;
}
}
_ISR_Enable( level );
800e67c: d0 01 00 00 wcsr IE,r1
}
800e680: 2b 9d 00 04 lw ra,(sp+4)
800e684: 2b 8b 00 0c lw r11,(sp+12)
800e688: 2b 8c 00 08 lw r12,(sp+8)
800e68c: 37 9c 00 0c addi sp,sp,12
800e690: c3 a0 00 00 ret
0800e694 <_Event_Timeout>:
void _Event_Timeout(
Objects_Id id,
void *arg
)
{
800e694: 37 9c ff f4 addi sp,sp,-12
800e698: 5b 8b 00 08 sw (sp+8),r11
800e69c: 5b 9d 00 04 sw (sp+4),ra
800e6a0: b8 40 58 00 mv r11,r2
ISR_Level level;
Thread_blocking_operation_States *sync_state;
sync_state = arg;
the_thread = _Thread_Get( id, &location );
800e6a4: 37 82 00 0c addi r2,sp,12
800e6a8: fb ff e4 d2 calli 80079f0 <_Thread_Get>
switch ( location ) {
800e6ac: 2b 82 00 0c lw r2,(sp+12)
800e6b0: 5c 40 00 1b bne r2,r0,800e71c <_Event_Timeout+0x88> <== NEVER TAKEN
*
* If it is not satisfied, then it is "nothing happened" and
* this is the "timeout" transition. After a request is satisfied,
* a timeout is not allowed to occur.
*/
_ISR_Disable( level );
800e6b4: 90 00 10 00 rcsr r2,IE
800e6b8: 34 03 ff fe mvi r3,-2
800e6bc: a0 43 18 00 and r3,r2,r3
800e6c0: d0 03 00 00 wcsr IE,r3
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
800e6c4: 78 03 08 01 mvhi r3,0x801
800e6c8: 38 63 ae 00 ori r3,r3,0xae00
return;
}
#endif
the_thread->Wait.count = 0;
if ( _Thread_Is_executing( the_thread ) ) {
800e6cc: 28 63 00 10 lw r3,(r3+16)
_ISR_Enable( level );
return;
}
#endif
the_thread->Wait.count = 0;
800e6d0: 58 20 00 24 sw (r1+36),r0
if ( _Thread_Is_executing( the_thread ) ) {
800e6d4: 5c 23 00 06 bne r1,r3,800e6ec <_Event_Timeout+0x58>
if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
800e6d8: 29 64 00 00 lw r4,(r11+0)
800e6dc: 34 03 00 01 mvi r3,1
800e6e0: 5c 83 00 03 bne r4,r3,800e6ec <_Event_Timeout+0x58>
*sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
800e6e4: 34 03 00 02 mvi r3,2
800e6e8: 59 63 00 00 sw (r11+0),r3
}
the_thread->Wait.return_code = RTEMS_TIMEOUT;
800e6ec: 34 03 00 06 mvi r3,6
800e6f0: 58 23 00 34 sw (r1+52),r3
_ISR_Enable( level );
800e6f4: d0 02 00 00 wcsr IE,r2
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
800e6f8: 78 03 08 01 mvhi r3,0x801
800e6fc: 38 63 8c 94 ori r3,r3,0x8c94
800e700: 28 62 00 00 lw r2,(r3+0)
800e704: f8 00 04 a5 calli 800f998 <_Thread_Clear_state>
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
800e708: 78 01 08 01 mvhi r1,0x801
800e70c: 38 21 a9 78 ori r1,r1,0xa978
800e710: 28 22 00 00 lw r2,(r1+0)
--level;
800e714: 34 42 ff ff addi r2,r2,-1
_Thread_Dispatch_disable_level = level;
800e718: 58 22 00 00 sw (r1+0),r2
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
800e71c: 2b 9d 00 04 lw ra,(sp+4)
800e720: 2b 8b 00 08 lw r11,(sp+8)
800e724: 37 9c 00 0c addi sp,sp,12
800e728: c3 a0 00 00 ret
0800f440 <_Heap_Free>:
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
800f440: 37 9c ff f4 addi sp,sp,-12
800f444: 5b 8b 00 0c sw (sp+12),r11
800f448: 5b 8c 00 08 sw (sp+8),r12
800f44c: 5b 9d 00 04 sw (sp+4),ra
800f450: b8 20 58 00 mv r11,r1
* 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;
800f454: 34 01 00 01 mvi r1,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 ) {
800f458: 44 40 00 73 be r2,r0,800f624 <_Heap_Free+0x1e4>
800f45c: 34 4c ff f8 addi r12,r2,-8
800f460: b8 40 08 00 mv r1,r2
800f464: 29 62 00 10 lw r2,(r11+16)
800f468: f8 00 22 20 calli 8017ce8 <__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
800f46c: 29 67 00 20 lw r7,(r11+32)
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
800f470: c9 81 18 00 sub r3,r12,r1
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;
800f474: 34 01 00 00 mvi r1,0
800f478: 54 e3 00 03 bgu r7,r3,800f484 <_Heap_Free+0x44>
800f47c: 29 61 00 24 lw r1,(r11+36)
800f480: f0 23 08 00 cmpgeu r1,r1,r3
}
alloc_begin = (uintptr_t) alloc_begin_ptr;
block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size );
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
800f484: b8 20 10 00 mv r2,r1
return false;
800f488: 34 01 00 00 mvi r1,0
}
alloc_begin = (uintptr_t) alloc_begin_ptr;
block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size );
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
800f48c: 44 40 00 66 be r2,r0,800f624 <_Heap_Free+0x1e4>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
800f490: 28 66 00 04 lw r6,(r3+4)
- 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;
800f494: 34 04 ff fe mvi r4,-2
800f498: a0 c4 20 00 and r4,r6,r4
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
800f49c: b4 64 10 00 add r2,r3,r4
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;
800f4a0: 54 e2 00 03 bgu r7,r2,800f4ac <_Heap_Free+0x6c> <== NEVER TAKEN
800f4a4: 29 61 00 24 lw r1,(r11+36)
800f4a8: f0 22 08 00 cmpgeu r1,r1,r2
_Heap_Protection_block_check( heap, block );
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
800f4ac: b8 20 28 00 mv r5,r1
return false;
800f4b0: 34 01 00 00 mvi r1,0
_Heap_Protection_block_check( heap, block );
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
800f4b4: 44 a0 00 5c be r5,r0,800f624 <_Heap_Free+0x1e4> <== NEVER TAKEN
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
800f4b8: 28 45 00 04 lw r5,(r2+4)
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;
800f4bc: 20 a8 00 01 andi r8,r5,0x1
return false;
}
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_prev_used( next_block ) ) {
800f4c0: 45 00 00 59 be r8,r0,800f624 <_Heap_Free+0x1e4>
if ( !_Heap_Protection_determine_block_free( heap, block ) ) {
return true;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
800f4c4: 29 69 00 24 lw r9,(r11+36)
- 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;
800f4c8: 34 01 ff fe mvi r1,-2
800f4cc: a0 a1 28 00 and r5,r5,r1
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
800f4d0: 34 08 00 00 mvi r8,0
800f4d4: 45 22 00 05 be r9,r2,800f4e8 <_Heap_Free+0xa8>
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
800f4d8: b4 45 08 00 add r1,r2,r5
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;
800f4dc: 28 28 00 04 lw r8,(r1+4)
800f4e0: 21 08 00 01 andi r8,r8,0x1
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
800f4e4: 65 08 00 00 cmpei r8,r8,0
800f4e8: 20 c6 00 01 andi r6,r6,0x1
if ( !_Heap_Protection_determine_block_free( heap, block ) ) {
return true;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
800f4ec: 21 08 00 ff andi r8,r8,0xff
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
if ( !_Heap_Is_prev_used( block ) ) {
800f4f0: 5c c0 00 24 bne r6,r0,800f580 <_Heap_Free+0x140>
uintptr_t const prev_size = block->prev_size;
800f4f4: 28 66 00 00 lw r6,(r3+0)
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;
800f4f8: 34 01 00 00 mvi r1,0
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
800f4fc: c8 66 18 00 sub r3,r3,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;
800f500: 54 e3 00 02 bgu r7,r3,800f508 <_Heap_Free+0xc8> <== NEVER TAKEN
800f504: f1 23 08 00 cmpgeu r1,r9,r3
Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size );
if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) {
800f508: b8 20 38 00 mv r7,r1
_HAssert( false );
return( false );
800f50c: 34 01 00 00 mvi r1,0
if ( !_Heap_Is_prev_used( block ) ) {
uintptr_t const prev_size = block->prev_size;
Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size );
if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) {
800f510: 44 e0 00 45 be r7,r0,800f624 <_Heap_Free+0x1e4> <== NEVER TAKEN
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;
800f514: 28 67 00 04 lw r7,(r3+4)
800f518: 20 e7 00 01 andi r7,r7,0x1
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) ) {
800f51c: 44 e0 00 42 be r7,r0,800f624 <_Heap_Free+0x1e4> <== NEVER TAKEN
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
800f520: 45 00 00 0f be r8,r0,800f55c <_Heap_Free+0x11c>
return _Heap_Free_list_tail(heap)->prev;
}
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
800f524: 28 41 00 08 lw r1,(r2+8)
Heap_Block *prev = block->prev;
800f528: 28 42 00 0c lw r2,(r2+12)
uintptr_t const size = block_size + prev_size + next_block_size;
800f52c: b4 85 28 00 add r5,r4,r5
800f530: b4 a6 30 00 add r6,r5,r6
prev->next = next;
800f534: 58 41 00 08 sw (r2+8),r1
next->prev = prev;
800f538: 58 22 00 0c sw (r1+12),r2
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
800f53c: 29 61 00 38 lw r1,(r11+56)
800f540: 34 21 ff ff addi r1,r1,-1
800f544: 59 61 00 38 sw (r11+56),r1
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
800f548: 38 c1 00 01 ori r1,r6,0x1
800f54c: 58 61 00 04 sw (r3+4),r1
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
800f550: b4 66 18 00 add r3,r3,r6
800f554: 58 66 00 00 sw (r3+0),r6
800f558: e0 00 00 29 bi 800f5fc <_Heap_Free+0x1bc>
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
800f55c: b4 86 30 00 add r6,r4,r6
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
800f560: 38 c1 00 01 ori r1,r6,0x1
800f564: 58 61 00 04 sw (r3+4),r1
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
800f568: 28 43 00 04 lw r3,(r2+4)
800f56c: 34 01 ff fe mvi r1,-2
next_block->prev_size = size;
800f570: 58 46 00 00 sw (r2+0),r6
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
} else { /* coalesce prev */
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;
800f574: a0 61 08 00 and r1,r3,r1
800f578: 58 41 00 04 sw (r2+4),r1
800f57c: e0 00 00 20 bi 800f5fc <_Heap_Free+0x1bc>
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
800f580: 45 00 00 0d be r8,r0,800f5b4 <_Heap_Free+0x174>
uintptr_t const size = block_size + next_block_size;
800f584: b4 a4 08 00 add r1,r5,r4
RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace(
Heap_Block *old_block,
Heap_Block *new_block
)
{
Heap_Block *next = old_block->next;
800f588: 28 45 00 08 lw r5,(r2+8)
Heap_Block *prev = old_block->prev;
800f58c: 28 42 00 0c lw r2,(r2+12)
new_block->next = next;
800f590: 58 65 00 08 sw (r3+8),r5
new_block->prev = prev;
800f594: 58 62 00 0c sw (r3+12),r2
next->prev = new_block;
prev->next = new_block;
800f598: 58 43 00 08 sw (r2+8),r3
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
800f59c: 38 22 00 01 ori r2,r1,0x1
Heap_Block *prev = old_block->prev;
new_block->next = next;
new_block->prev = prev;
next->prev = new_block;
800f5a0: 58 a3 00 0c sw (r5+12),r3
800f5a4: 58 62 00 04 sw (r3+4),r2
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
800f5a8: b4 61 18 00 add r3,r3,r1
800f5ac: 58 61 00 00 sw (r3+0),r1
800f5b0: e0 00 00 13 bi 800f5fc <_Heap_Free+0x1bc>
RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
800f5b4: 29 61 00 08 lw r1,(r11+8)
new_block->next = next;
new_block->prev = block_before;
800f5b8: 58 6b 00 0c sw (r3+12),r11
/* 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;
next_block->prev_size = block_size;
800f5bc: 58 44 00 00 sw (r2+0),r4
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
new_block->next = next;
800f5c0: 58 61 00 08 sw (r3+8),r1
new_block->prev = block_before;
block_before->next = new_block;
next->prev = new_block;
800f5c4: 58 23 00 0c sw (r1+12),r3
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;
800f5c8: 38 81 00 01 ori r1,r4,0x1
800f5cc: 58 61 00 04 sw (r3+4),r1
{
Heap_Block *next = block_before->next;
new_block->next = next;
new_block->prev = block_before;
block_before->next = new_block;
800f5d0: 59 63 00 08 sw (r11+8),r3
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
800f5d4: 28 43 00 04 lw r3,(r2+4)
800f5d8: 34 01 ff fe mvi r1,-2
800f5dc: a0 61 08 00 and r1,r3,r1
800f5e0: 58 41 00 04 sw (r2+4),r1
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
800f5e4: 29 61 00 38 lw r1,(r11+56)
if ( stats->max_free_blocks < stats->free_blocks ) {
800f5e8: 29 62 00 3c lw r2,(r11+60)
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
800f5ec: 34 21 00 01 addi r1,r1,1
800f5f0: 59 61 00 38 sw (r11+56),r1
if ( stats->max_free_blocks < stats->free_blocks ) {
800f5f4: 50 41 00 02 bgeu r2,r1,800f5fc <_Heap_Free+0x1bc>
stats->max_free_blocks = stats->free_blocks;
800f5f8: 59 61 00 3c sw (r11+60),r1
}
}
/* Statistics */
--stats->used_blocks;
800f5fc: 29 61 00 40 lw r1,(r11+64)
800f600: 34 21 ff ff addi r1,r1,-1
800f604: 59 61 00 40 sw (r11+64),r1
++stats->frees;
800f608: 29 61 00 50 lw r1,(r11+80)
800f60c: 34 21 00 01 addi r1,r1,1
800f610: 59 61 00 50 sw (r11+80),r1
stats->free_size += block_size;
800f614: 29 61 00 30 lw r1,(r11+48)
800f618: b4 24 20 00 add r4,r1,r4
800f61c: 59 64 00 30 sw (r11+48),r4
return( true );
800f620: 34 01 00 01 mvi r1,1
}
800f624: 2b 9d 00 04 lw ra,(sp+4)
800f628: 2b 8b 00 0c lw r11,(sp+12)
800f62c: 2b 8c 00 08 lw r12,(sp+8)
800f630: 37 9c 00 0c addi sp,sp,12
800f634: c3 a0 00 00 ret
08006ddc <_Heap_Greedy_allocate>:
Heap_Block *_Heap_Greedy_allocate(
Heap_Control *heap,
const uintptr_t *block_sizes,
size_t block_count
)
{
8006ddc: 37 9c ff e4 addi sp,sp,-28
8006de0: 5b 8b 00 1c sw (sp+28),r11
8006de4: 5b 8c 00 18 sw (sp+24),r12
8006de8: 5b 8d 00 14 sw (sp+20),r13
8006dec: 5b 8e 00 10 sw (sp+16),r14
8006df0: 5b 8f 00 0c sw (sp+12),r15
8006df4: 5b 90 00 08 sw (sp+8),r16
8006df8: 5b 9d 00 04 sw (sp+4),ra
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
8006dfc: 34 0b 00 00 mvi r11,0
Heap_Block *_Heap_Greedy_allocate(
Heap_Control *heap,
const uintptr_t *block_sizes,
size_t block_count
)
{
8006e00: b8 20 68 00 mv r13,r1
8006e04: b8 60 78 00 mv r15,r3
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
8006e08: b8 40 70 00 mv r14,r2
Heap_Block *allocated_blocks = NULL;
8006e0c: 34 0c 00 00 mvi r12,0
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
8006e10: e0 00 00 0f bi 8006e4c <_Heap_Greedy_allocate+0x70>
* @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 );
8006e14: 29 c2 00 00 lw r2,(r14+0)
8006e18: b9 a0 08 00 mv r1,r13
8006e1c: 34 03 00 00 mvi r3,0
8006e20: 34 04 00 00 mvi r4,0
8006e24: f8 00 23 2f calli 800fae0 <_Heap_Allocate_aligned_with_boundary>
void *next = _Heap_Allocate( heap, block_sizes [i] );
if ( next != NULL ) {
8006e28: 44 20 00 07 be r1,r0,8006e44 <_Heap_Greedy_allocate+0x68> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
8006e2c: 29 a2 00 10 lw r2,(r13+16)
8006e30: 34 30 ff f8 addi r16,r1,-8
8006e34: f8 00 45 f5 calli 8018608 <__umodsi3>
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
8006e38: ca 01 08 00 sub r1,r16,r1
Heap_Block *next_block = _Heap_Block_of_alloc_area(
(uintptr_t) next,
heap->page_size
);
next_block->next = allocated_blocks;
8006e3c: 58 2c 00 08 sw (r1+8),r12
8006e40: b8 20 60 00 mv r12,r1
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
8006e44: 35 6b 00 01 addi r11,r11,1
8006e48: 35 ce 00 04 addi r14,r14,4
8006e4c: 55 eb ff f2 bgu r15,r11,8006e14 <_Heap_Greedy_allocate+0x38>
8006e50: 34 0e 00 00 mvi r14,0
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
8006e54: 34 0f ff fe mvi r15,-2
8006e58: e0 00 00 0a bi 8006e80 <_Heap_Greedy_allocate+0xa4>
8006e5c: 29 64 00 04 lw r4,(r11+4)
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
_Heap_Block_allocate(
8006e60: b9 a0 08 00 mv r1,r13
8006e64: b9 60 10 00 mv r2,r11
8006e68: a1 e4 20 00 and r4,r15,r4
8006e6c: 35 63 00 08 addi r3,r11,8
8006e70: 34 84 ff f8 addi r4,r4,-8
8006e74: f8 00 01 09 calli 8007298 <_Heap_Block_allocate>
current,
_Heap_Alloc_area_of_block( current ),
_Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE
);
current->next = blocks;
8006e78: 59 6e 00 08 sw (r11+8),r14
8006e7c: b9 60 70 00 mv r14,r11
Heap_Block *current = blocks;
blocks = blocks->next;
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
}
}
8006e80: 29 ab 00 08 lw r11,(r13+8)
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
8006e84: 5d 6d ff f6 bne r11,r13,8006e5c <_Heap_Greedy_allocate+0x80>
8006e88: e0 00 00 06 bi 8006ea0 <_Heap_Greedy_allocate+0xc4>
blocks = current;
}
while ( allocated_blocks != NULL ) {
current = allocated_blocks;
allocated_blocks = allocated_blocks->next;
8006e8c: 29 8b 00 08 lw r11,(r12+8)
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
8006e90: 35 82 00 08 addi r2,r12,8
8006e94: b9 a0 08 00 mv r1,r13
8006e98: f8 00 23 98 calli 800fcf8 <_Heap_Free>
blocks = current;
}
while ( allocated_blocks != NULL ) {
current = allocated_blocks;
allocated_blocks = allocated_blocks->next;
8006e9c: b9 60 60 00 mv r12,r11
current->next = blocks;
blocks = current;
}
while ( allocated_blocks != NULL ) {
8006ea0: 5d 80 ff fb bne r12,r0,8006e8c <_Heap_Greedy_allocate+0xb0>
allocated_blocks = allocated_blocks->next;
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
}
return blocks;
}
8006ea4: b9 c0 08 00 mv r1,r14
8006ea8: 2b 9d 00 04 lw ra,(sp+4)
8006eac: 2b 8b 00 1c lw r11,(sp+28)
8006eb0: 2b 8c 00 18 lw r12,(sp+24)
8006eb4: 2b 8d 00 14 lw r13,(sp+20)
8006eb8: 2b 8e 00 10 lw r14,(sp+16)
8006ebc: 2b 8f 00 0c lw r15,(sp+12)
8006ec0: 2b 90 00 08 lw r16,(sp+8)
8006ec4: 37 9c 00 1c addi sp,sp,28
8006ec8: c3 a0 00 00 ret
080104c4 <_Heap_Iterate>:
void _Heap_Iterate(
Heap_Control *heap,
Heap_Block_visitor visitor,
void *visitor_arg
)
{
80104c4: 37 9c ff e8 addi sp,sp,-24
80104c8: 5b 8b 00 18 sw (sp+24),r11
80104cc: 5b 8c 00 14 sw (sp+20),r12
80104d0: 5b 8d 00 10 sw (sp+16),r13
80104d4: 5b 8e 00 0c sw (sp+12),r14
80104d8: 5b 8f 00 08 sw (sp+8),r15
80104dc: 5b 9d 00 04 sw (sp+4),ra
80104e0: b8 20 28 00 mv r5,r1
80104e4: b8 40 78 00 mv r15,r2
80104e8: b8 60 70 00 mv r14,r3
Heap_Block *current = heap->first_block;
80104ec: 28 21 00 20 lw r1,(r1+32)
Heap_Block *end = heap->last_block;
80104f0: 28 ad 00 24 lw r13,(r5+36)
80104f4: 34 0c ff fe mvi r12,-2
80104f8: e0 00 00 0a bi 8010520 <_Heap_Iterate+0x5c>
80104fc: 28 22 00 04 lw r2,(r1+4)
while ( !stop && current != end ) {
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 );
8010500: b9 c0 20 00 mv r4,r14
8010504: a1 82 10 00 and r2,r12,r2
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
8010508: b4 22 58 00 add r11,r1,r2
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;
801050c: 29 63 00 04 lw r3,(r11+4)
8010510: 20 63 00 01 andi r3,r3,0x1
8010514: d9 e0 00 00 call r15
{
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
bool stop = false;
while ( !stop && current != end ) {
8010518: 5c 20 00 03 bne r1,r0,8010524 <_Heap_Iterate+0x60> <== NEVER TAKEN
801051c: b9 60 08 00 mv r1,r11
8010520: 5c 2d ff f7 bne r1,r13,80104fc <_Heap_Iterate+0x38>
stop = (*visitor)( current, size, used, visitor_arg );
current = next;
}
}
8010524: 2b 9d 00 04 lw ra,(sp+4)
8010528: 2b 8b 00 18 lw r11,(sp+24)
801052c: 2b 8c 00 14 lw r12,(sp+20)
8010530: 2b 8d 00 10 lw r13,(sp+16)
8010534: 2b 8e 00 0c lw r14,(sp+12)
8010538: 2b 8f 00 08 lw r15,(sp+8)
801053c: 37 9c 00 18 addi sp,sp,24
8010540: c3 a0 00 00 ret
0800f794 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
800f794: 37 9c ff ec addi sp,sp,-20
800f798: 5b 8b 00 14 sw (sp+20),r11
800f79c: 5b 8c 00 10 sw (sp+16),r12
800f7a0: 5b 8d 00 0c sw (sp+12),r13
800f7a4: 5b 8e 00 08 sw (sp+8),r14
800f7a8: 5b 9d 00 04 sw (sp+4),ra
800f7ac: b8 20 58 00 mv r11,r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
800f7b0: 34 4e ff f8 addi r14,r2,-8
800f7b4: b8 40 08 00 mv r1,r2
800f7b8: b8 40 60 00 mv r12,r2
800f7bc: 29 62 00 10 lw r2,(r11+16)
800f7c0: b8 60 68 00 mv r13,r3
800f7c4: f8 00 21 49 calli 8017ce8 <__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
800f7c8: 29 62 00 20 lw r2,(r11+32)
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
800f7cc: c9 c1 20 00 sub r4,r14,r1
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;
800f7d0: 34 01 00 00 mvi r1,0
800f7d4: 54 44 00 03 bgu r2,r4,800f7e0 <_Heap_Size_of_alloc_area+0x4c>
800f7d8: 29 61 00 24 lw r1,(r11+36)
800f7dc: f0 24 08 00 cmpgeu r1,r1,r4
uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr;
Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size );
Heap_Block *next_block = NULL;
uintptr_t block_size = 0;
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
800f7e0: b8 20 18 00 mv r3,r1
return false;
800f7e4: 34 01 00 00 mvi r1,0
uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr;
Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size );
Heap_Block *next_block = NULL;
uintptr_t block_size = 0;
if ( !_Heap_Is_block_in_heap( heap, block ) ) {
800f7e8: 44 60 00 13 be r3,r0,800f834 <_Heap_Size_of_alloc_area+0xa0>
- 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;
800f7ec: 28 83 00 04 lw r3,(r4+4)
800f7f0: 34 01 ff fe mvi r1,-2
800f7f4: a0 23 08 00 and r1,r1,r3
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
800f7f8: b4 81 20 00 add r4,r4,r1
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;
800f7fc: 34 01 00 00 mvi r1,0
800f800: 54 44 00 03 bgu r2,r4,800f80c <_Heap_Size_of_alloc_area+0x78><== NEVER TAKEN
800f804: 29 61 00 24 lw r1,(r11+36)
800f808: f0 24 08 00 cmpgeu r1,r1,r4
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
800f80c: b8 20 10 00 mv r2,r1
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
800f810: 34 01 00 00 mvi r1,0
}
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
800f814: 44 40 00 08 be r2,r0,800f834 <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN
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;
800f818: 28 82 00 04 lw r2,(r4+4)
800f81c: 20 42 00 01 andi r2,r2,0x1
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
800f820: 44 40 00 05 be r2,r0,800f834 <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
800f824: c8 8c 20 00 sub r4,r4,r12
800f828: 34 84 00 04 addi r4,r4,4
800f82c: 59 a4 00 00 sw (r13+0),r4
return true;
800f830: 34 01 00 01 mvi r1,1
}
800f834: 2b 9d 00 04 lw ra,(sp+4)
800f838: 2b 8b 00 14 lw r11,(sp+20)
800f83c: 2b 8c 00 10 lw r12,(sp+16)
800f840: 2b 8d 00 0c lw r13,(sp+12)
800f844: 2b 8e 00 08 lw r14,(sp+8)
800f848: 37 9c 00 14 addi sp,sp,20
800f84c: c3 a0 00 00 ret
080054dc <_Heap_Walk>:
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
80054dc: 37 9c ff a0 addi sp,sp,-96
80054e0: 5b 8b 00 50 sw (sp+80),r11
80054e4: 5b 8c 00 4c sw (sp+76),r12
80054e8: 5b 8d 00 48 sw (sp+72),r13
80054ec: 5b 8e 00 44 sw (sp+68),r14
80054f0: 5b 8f 00 40 sw (sp+64),r15
80054f4: 5b 90 00 3c sw (sp+60),r16
80054f8: 5b 91 00 38 sw (sp+56),r17
80054fc: 5b 92 00 34 sw (sp+52),r18
8005500: 5b 93 00 30 sw (sp+48),r19
8005504: 5b 94 00 2c sw (sp+44),r20
8005508: 5b 95 00 28 sw (sp+40),r21
800550c: 5b 96 00 24 sw (sp+36),r22
8005510: 5b 97 00 20 sw (sp+32),r23
8005514: 5b 98 00 1c sw (sp+28),r24
8005518: 5b 99 00 18 sw (sp+24),r25
800551c: 5b 9b 00 14 sw (sp+20),fp
8005520: 5b 9d 00 10 sw (sp+16),ra
uintptr_t const min_block_size = heap->min_block_size;
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
8005524: 78 0d 08 00 mvhi r13,0x800
bool _Heap_Walk(
Heap_Control *heap,
int source,
bool dump
)
{
8005528: 20 63 00 ff andi r3,r3,0xff
800552c: b8 20 60 00 mv r12,r1
8005530: b8 40 70 00 mv r14,r2
uintptr_t const page_size = heap->page_size;
8005534: 28 33 00 10 lw r19,(r1+16)
uintptr_t const min_block_size = heap->min_block_size;
8005538: 28 35 00 14 lw r21,(r1+20)
Heap_Block *const first_block = heap->first_block;
800553c: 28 34 00 20 lw r20,(r1+32)
Heap_Block *const last_block = heap->last_block;
8005540: 28 36 00 24 lw r22,(r1+36)
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
8005544: 39 ad 54 44 ori r13,r13,0x5444
8005548: 44 60 00 03 be r3,r0,8005554 <_Heap_Walk+0x78>
800554c: 78 0d 08 00 mvhi r13,0x800
8005550: 39 ad 54 68 ori r13,r13,0x5468
if ( !_System_state_Is_up( _System_state_Get() ) ) {
8005554: 78 03 08 01 mvhi r3,0x801
8005558: 38 63 7e 00 ori r3,r3,0x7e00
800555c: 28 67 00 00 lw r7,(r3+0)
8005560: 34 02 00 03 mvi r2,3
return true;
8005564: 34 03 00 01 mvi r3,1
Heap_Block *const last_block = heap->last_block;
Heap_Block *block = first_block;
Heap_Walk_printer printer = dump ?
_Heap_Walk_print : _Heap_Walk_print_nothing;
if ( !_System_state_Is_up( _System_state_Get() ) ) {
8005568: 5c e2 01 08 bne r7,r2,8005988 <_Heap_Walk+0x4ac>
Heap_Block *const first_free_block = _Heap_Free_list_first( heap );
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
Heap_Block *const first_block = heap->first_block;
Heap_Block *const last_block = heap->last_block;
(*printer)(
800556c: 29 81 00 08 lw r1,(r12+8)
8005570: 29 86 00 18 lw r6,(r12+24)
8005574: 29 87 00 1c lw r7,(r12+28)
8005578: 5b 81 00 08 sw (sp+8),r1
800557c: 29 81 00 0c lw r1,(r12+12)
8005580: 78 03 08 01 mvhi r3,0x801
8005584: 5b 96 00 04 sw (sp+4),r22
8005588: 5b 81 00 0c sw (sp+12),r1
800558c: 34 02 00 00 mvi r2,0
8005590: b9 c0 08 00 mv r1,r14
8005594: 38 63 48 4c ori r3,r3,0x484c
8005598: ba 60 20 00 mv r4,r19
800559c: ba a0 28 00 mv r5,r21
80055a0: ba 80 40 00 mv r8,r20
80055a4: d9 a0 00 00 call r13
heap->area_begin, heap->area_end,
first_block, last_block,
first_free_block, last_free_block
);
if ( page_size == 0 ) {
80055a8: 5e 60 00 06 bne r19,r0,80055c0 <_Heap_Walk+0xe4>
(*printer)( source, true, "page size is zero\n" );
80055ac: 78 03 08 01 mvhi r3,0x801
80055b0: b9 c0 08 00 mv r1,r14
80055b4: 34 02 00 01 mvi r2,1
80055b8: 38 63 48 e0 ori r3,r3,0x48e0
80055bc: e0 00 00 25 bi 8005650 <_Heap_Walk+0x174>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
80055c0: 22 6f 00 03 andi r15,r19,0x3
return false;
}
if ( !_Addresses_Is_aligned( (void *) page_size ) ) {
80055c4: 45 e0 00 07 be r15,r0,80055e0 <_Heap_Walk+0x104>
(*printer)(
80055c8: 78 03 08 01 mvhi r3,0x801
80055cc: b9 c0 08 00 mv r1,r14
80055d0: 34 02 00 01 mvi r2,1
80055d4: 38 63 48 f4 ori r3,r3,0x48f4
80055d8: ba 60 20 00 mv r4,r19
80055dc: e0 00 01 04 bi 80059ec <_Heap_Walk+0x510>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
80055e0: ba a0 08 00 mv r1,r21
80055e4: ba 60 10 00 mv r2,r19
80055e8: fb ff ed 70 calli 8000ba8 <__umodsi3>
80055ec: b8 20 58 00 mv r11,r1
);
return false;
}
if ( !_Heap_Is_aligned( min_block_size, page_size ) ) {
80055f0: 44 2f 00 07 be r1,r15,800560c <_Heap_Walk+0x130>
(*printer)(
80055f4: 78 03 08 01 mvhi r3,0x801
80055f8: b9 c0 08 00 mv r1,r14
80055fc: 34 02 00 01 mvi r2,1
8005600: 38 63 49 14 ori r3,r3,0x4914
8005604: ba a0 20 00 mv r4,r21
8005608: e0 00 00 f9 bi 80059ec <_Heap_Walk+0x510>
800560c: 36 81 00 08 addi r1,r20,8
8005610: ba 60 10 00 mv r2,r19
8005614: fb ff ed 65 calli 8000ba8 <__umodsi3>
);
return false;
}
if (
8005618: 44 2b 00 07 be r1,r11,8005634 <_Heap_Walk+0x158>
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size )
) {
(*printer)(
800561c: 78 03 08 01 mvhi r3,0x801
8005620: b9 c0 08 00 mv r1,r14
8005624: 34 02 00 01 mvi r2,1
8005628: 38 63 49 38 ori r3,r3,0x4938
800562c: ba 80 20 00 mv r4,r20
8005630: e0 00 00 ef bi 80059ec <_Heap_Walk+0x510>
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;
8005634: 2a 82 00 04 lw r2,(r20+4)
8005638: 20 42 00 01 andi r2,r2,0x1
);
return false;
}
if ( !_Heap_Is_prev_used( first_block ) ) {
800563c: 5c 41 00 07 bne r2,r1,8005658 <_Heap_Walk+0x17c>
(*printer)(
8005640: 78 03 08 01 mvhi r3,0x801
8005644: b9 c0 08 00 mv r1,r14
8005648: 34 02 00 01 mvi r2,1
800564c: 38 63 49 6c ori r3,r3,0x496c
8005650: d9 a0 00 00 call r13
8005654: e0 00 00 40 bi 8005754 <_Heap_Walk+0x278>
- 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;
8005658: 2a cf 00 04 lw r15,(r22+4)
800565c: 34 02 ff fe mvi r2,-2
8005660: a0 4f 78 00 and r15,r2,r15
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
8005664: b6 cf 78 00 add r15,r22,r15
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;
8005668: 29 e2 00 04 lw r2,(r15+4)
800566c: 20 42 00 01 andi r2,r2,0x1
);
return false;
}
if ( _Heap_Is_free( last_block ) ) {
8005670: 5c 41 00 06 bne r2,r1,8005688 <_Heap_Walk+0x1ac>
(*printer)(
8005674: 78 03 08 01 mvhi r3,0x801
8005678: b9 c0 08 00 mv r1,r14
800567c: 34 02 00 01 mvi r2,1
8005680: 38 63 49 9c ori r3,r3,0x499c
8005684: e3 ff ff f3 bi 8005650 <_Heap_Walk+0x174>
);
return false;
}
if (
8005688: 45 f4 00 06 be r15,r20,80056a0 <_Heap_Walk+0x1c4>
_Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block
) {
(*printer)(
800568c: 78 03 08 01 mvhi r3,0x801
8005690: b9 c0 08 00 mv r1,r14
8005694: 34 02 00 01 mvi r2,1
8005698: 38 63 49 b4 ori r3,r3,0x49b4
800569c: e3 ff ff ed bi 8005650 <_Heap_Walk+0x174>
int source,
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
80056a0: 29 92 00 10 lw r18,(r12+16)
block = next_block;
} while ( block != first_block );
return true;
}
80056a4: 29 8b 00 08 lw r11,(r12+8)
Heap_Walk_printer printer,
Heap_Control *heap
)
{
uintptr_t const page_size = heap->page_size;
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
80056a8: b9 80 80 00 mv r16,r12
- 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;
80056ac: 34 11 ff fe mvi r17,-2
80056b0: e0 00 00 2d bi 8005764 <_Heap_Walk+0x288>
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;
80056b4: 29 83 00 20 lw r3,(r12+32)
80056b8: 34 01 00 00 mvi r1,0
80056bc: 54 6b 00 03 bgu r3,r11,80056c8 <_Heap_Walk+0x1ec>
80056c0: 29 81 00 24 lw r1,(r12+36)
80056c4: f0 2b 08 00 cmpgeu r1,r1,r11
const Heap_Block *const first_free_block = _Heap_Free_list_first( heap );
const Heap_Block *prev_block = free_list_tail;
const Heap_Block *free_block = first_free_block;
while ( free_block != free_list_tail ) {
if ( !_Heap_Is_block_in_heap( heap, free_block ) ) {
80056c8: 5c 20 00 06 bne r1,r0,80056e0 <_Heap_Walk+0x204>
(*printer)(
80056cc: 78 03 08 01 mvhi r3,0x801
80056d0: b9 c0 08 00 mv r1,r14
80056d4: 34 02 00 01 mvi r2,1
80056d8: 38 63 49 e4 ori r3,r3,0x49e4
80056dc: e0 00 00 14 bi 800572c <_Heap_Walk+0x250>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
80056e0: 35 61 00 08 addi r1,r11,8
80056e4: ba 40 10 00 mv r2,r18
80056e8: fb ff ed 30 calli 8000ba8 <__umodsi3>
);
return false;
}
if (
80056ec: 44 20 00 06 be r1,r0,8005704 <_Heap_Walk+0x228>
!_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size )
) {
(*printer)(
80056f0: 78 03 08 01 mvhi r3,0x801
80056f4: b9 c0 08 00 mv r1,r14
80056f8: 34 02 00 01 mvi r2,1
80056fc: 38 63 4a 04 ori r3,r3,0x4a04
8005700: e0 00 00 0b bi 800572c <_Heap_Walk+0x250>
- 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;
8005704: 29 63 00 04 lw r3,(r11+4)
8005708: a2 23 18 00 and r3,r17,r3
block = next_block;
} while ( block != first_block );
return true;
}
800570c: b5 63 18 00 add r3,r11,r3
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;
8005710: 28 63 00 04 lw r3,(r3+4)
8005714: 20 63 00 01 andi r3,r3,0x1
);
return false;
}
if ( _Heap_Is_used( free_block ) ) {
8005718: 44 61 00 07 be r3,r1,8005734 <_Heap_Walk+0x258>
(*printer)(
800571c: 78 03 08 01 mvhi r3,0x801
8005720: b9 c0 08 00 mv r1,r14
8005724: 34 02 00 01 mvi r2,1
8005728: 38 63 4a 34 ori r3,r3,0x4a34
800572c: b9 60 20 00 mv r4,r11
8005730: e0 00 00 af bi 80059ec <_Heap_Walk+0x510>
);
return false;
}
if ( free_block->prev != prev_block ) {
8005734: 29 65 00 0c lw r5,(r11+12)
8005738: 44 b0 00 09 be r5,r16,800575c <_Heap_Walk+0x280>
(*printer)(
800573c: 78 03 08 01 mvhi r3,0x801
8005740: b9 c0 08 00 mv r1,r14
8005744: 34 02 00 01 mvi r2,1
8005748: 38 63 4a 50 ori r3,r3,0x4a50
800574c: b9 60 20 00 mv r4,r11
8005750: d9 a0 00 00 call r13
if ( !_System_state_Is_up( _System_state_Get() ) ) {
return true;
}
if ( !_Heap_Walk_check_control( source, printer, heap ) ) {
return false;
8005754: 34 03 00 00 mvi r3,0
8005758: e0 00 00 8c bi 8005988 <_Heap_Walk+0x4ac>
return false;
}
prev_block = free_block;
free_block = free_block->next;
800575c: b9 60 80 00 mv r16,r11
8005760: 29 6b 00 08 lw r11,(r11+8)
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
const Heap_Block *const first_free_block = _Heap_Free_list_first( heap );
const Heap_Block *prev_block = free_list_tail;
const Heap_Block *free_block = first_free_block;
while ( free_block != free_list_tail ) {
8005764: 5d 6c ff d4 bne r11,r12,80056b4 <_Heap_Walk+0x1d8>
8005768: e0 00 00 03 bi 8005774 <_Heap_Walk+0x298>
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
800576c: ba 20 78 00 mv r15,r17
8005770: e0 00 00 15 bi 80057c4 <_Heap_Walk+0x2e8>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
8005774: 78 01 08 01 mvhi r1,0x801
8005778: 38 21 4c 00 ori r1,r1,0x4c00
800577c: 5b 81 00 54 sw (sp+84),r1
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
}
} else if (prev_used) {
(*printer)(
8005780: 78 01 08 01 mvhi r1,0x801
8005784: 38 21 4b e8 ori r1,r1,0x4be8
8005788: 5b 81 00 58 sw (sp+88),r1
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
bool const prev_used = _Heap_Is_prev_used( block );
uintptr_t const block_size = _Heap_Block_size( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
(*printer)(
800578c: 78 01 08 01 mvhi r1,0x801
8005790: 38 21 48 14 ori r1,r1,0x4814
8005794: 5b 81 00 5c sw (sp+92),r1
8005798: 78 01 08 01 mvhi r1,0x801
800579c: 38 21 48 30 ori r1,r1,0x4830
80057a0: 78 1b 08 01 mvhi fp,0x801
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
80057a4: 78 17 08 01 mvhi r23,0x801
80057a8: 78 19 08 01 mvhi r25,0x801
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
80057ac: 78 18 08 01 mvhi r24,0x801
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
bool const prev_used = _Heap_Is_prev_used( block );
uintptr_t const block_size = _Heap_Block_size( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
(*printer)(
80057b0: 5b 81 00 60 sw (sp+96),r1
80057b4: 3b 7b 4b 44 ori fp,fp,0x4b44
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
80057b8: 3a f7 4b b4 ori r23,r23,0x4bb4
80057bc: 3b 39 48 40 ori r25,r25,0x4840
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
80057c0: 3b 18 48 24 ori r24,r24,0x4824
block = next_block;
} while ( block != first_block );
return true;
}
80057c4: 29 f2 00 04 lw r18,(r15+4)
- 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;
80057c8: 34 01 ff fe mvi r1,-2
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;
80057cc: 29 84 00 20 lw r4,(r12+32)
- 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;
80057d0: a2 41 80 00 and r16,r18,r1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
80057d4: b5 f0 88 00 add r17,r15,r16
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;
80057d8: 34 06 00 00 mvi r6,0
80057dc: 54 91 00 03 bgu r4,r17,80057e8 <_Heap_Walk+0x30c> <== NEVER TAKEN
80057e0: 29 86 00 24 lw r6,(r12+36)
80057e4: f0 d1 30 00 cmpgeu r6,r6,r17
bool const prev_used = _Heap_Is_prev_used( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
uintptr_t const next_block_begin = (uintptr_t) next_block;
bool const is_not_last_block = block != last_block;
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
80057e8: 5c c0 00 06 bne r6,r0,8005800 <_Heap_Walk+0x324>
(*printer)(
80057ec: 78 03 08 01 mvhi r3,0x801
80057f0: b9 c0 08 00 mv r1,r14
80057f4: 34 02 00 01 mvi r2,1
80057f8: 38 63 4a 84 ori r3,r3,0x4a84
80057fc: e0 00 00 1f bi 8005878 <_Heap_Walk+0x39c>
RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned(
uintptr_t value,
uintptr_t alignment
)
{
return (value % alignment) == 0;
8005800: ba 00 08 00 mv r1,r16
8005804: ba 60 10 00 mv r2,r19
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
bool const prev_used = _Heap_Is_prev_used( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
uintptr_t const next_block_begin = (uintptr_t) next_block;
bool const is_not_last_block = block != last_block;
8005808: fd f6 58 00 cmpne r11,r15,r22
800580c: fb ff ec e7 calli 8000ba8 <__umodsi3>
);
return false;
}
if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) {
8005810: 44 20 00 09 be r1,r0,8005834 <_Heap_Walk+0x358>
8005814: 45 60 00 08 be r11,r0,8005834 <_Heap_Walk+0x358>
(*printer)(
8005818: 78 03 08 01 mvhi r3,0x801
800581c: b9 c0 08 00 mv r1,r14
8005820: 34 02 00 01 mvi r2,1
8005824: 38 63 4a b4 ori r3,r3,0x4ab4
8005828: b9 e0 20 00 mv r4,r15
800582c: ba 00 28 00 mv r5,r16
8005830: e3 ff ff c8 bi 8005750 <_Heap_Walk+0x274>
);
return false;
}
if ( block_size < min_block_size && is_not_last_block ) {
8005834: 52 15 00 0b bgeu r16,r21,8005860 <_Heap_Walk+0x384>
8005838: 45 60 00 0a be r11,r0,8005860 <_Heap_Walk+0x384> <== NEVER TAKEN
(*printer)(
800583c: 78 03 08 01 mvhi r3,0x801
8005840: b9 c0 08 00 mv r1,r14
8005844: 34 02 00 01 mvi r2,1
8005848: 38 63 4a e4 ori r3,r3,0x4ae4
800584c: b9 e0 20 00 mv r4,r15
8005850: ba 00 28 00 mv r5,r16
8005854: ba a0 30 00 mv r6,r21
8005858: d9 a0 00 00 call r13
800585c: e3 ff ff be bi 8005754 <_Heap_Walk+0x278>
);
return false;
}
if ( next_block_begin <= block_begin && is_not_last_block ) {
8005860: 56 2f 00 09 bgu r17,r15,8005884 <_Heap_Walk+0x3a8>
8005864: 45 60 00 08 be r11,r0,8005884 <_Heap_Walk+0x3a8>
(*printer)(
8005868: 78 03 08 01 mvhi r3,0x801
800586c: b9 c0 08 00 mv r1,r14
8005870: 34 02 00 01 mvi r2,1
8005874: 38 63 4b 10 ori r3,r3,0x4b10
8005878: b9 e0 20 00 mv r4,r15
800587c: ba 20 28 00 mv r5,r17
8005880: e3 ff ff b4 bi 8005750 <_Heap_Walk+0x274>
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;
8005884: 2a 24 00 04 lw r4,(r17+4)
8005888: 22 52 00 01 andi r18,r18,0x1
800588c: 20 84 00 01 andi r4,r4,0x1
);
return false;
}
if ( !_Heap_Is_prev_used( next_block ) ) {
8005890: 5c 80 00 2d bne r4,r0,8005944 <_Heap_Walk+0x468>
false,
"block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n",
block,
block_size,
block->prev,
block->prev == first_free_block ?
8005894: 29 e6 00 0c lw r6,(r15+12)
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
bool const prev_used = _Heap_Is_prev_used( block );
uintptr_t const block_size = _Heap_Block_size( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
(*printer)(
8005898: 29 85 00 08 lw r5,(r12+8)
block = next_block;
} while ( block != first_block );
return true;
}
800589c: 29 84 00 0c lw r4,(r12+12)
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
bool const prev_used = _Heap_Is_prev_used( block );
uintptr_t const block_size = _Heap_Block_size( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
(*printer)(
80058a0: 2b 87 00 5c lw r7,(sp+92)
80058a4: 44 c5 00 04 be r6,r5,80058b4 <_Heap_Walk+0x3d8>
block,
block_size,
block->prev,
block->prev == first_free_block ?
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
80058a8: ba e0 38 00 mv r7,r23
80058ac: 5c cc 00 02 bne r6,r12,80058b4 <_Heap_Walk+0x3d8>
80058b0: bb 00 38 00 mv r7,r24
block->next,
block->next == last_free_block ?
80058b4: 29 e8 00 08 lw r8,(r15+8)
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
bool const prev_used = _Heap_Is_prev_used( block );
uintptr_t const block_size = _Heap_Block_size( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
(*printer)(
80058b8: 2b 89 00 60 lw r9,(sp+96)
80058bc: 45 04 00 04 be r8,r4,80058cc <_Heap_Walk+0x3f0>
" (= first free)"
: (block->prev == free_list_head ? " (= head)" : ""),
block->next,
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
80058c0: ba e0 48 00 mv r9,r23
80058c4: 5d 0c 00 02 bne r8,r12,80058cc <_Heap_Walk+0x3f0>
80058c8: bb 20 48 00 mv r9,r25
Heap_Block *const last_free_block = _Heap_Free_list_last( heap );
bool const prev_used = _Heap_Is_prev_used( block );
uintptr_t const block_size = _Heap_Block_size( block );
Heap_Block *const next_block = _Heap_Block_at( block, block_size );
(*printer)(
80058cc: 5b 89 00 04 sw (sp+4),r9
80058d0: b9 c0 08 00 mv r1,r14
80058d4: 34 02 00 00 mvi r2,0
80058d8: bb 60 18 00 mv r3,fp
80058dc: b9 e0 20 00 mv r4,r15
80058e0: ba 00 28 00 mv r5,r16
80058e4: d9 a0 00 00 call r13
block->next == last_free_block ?
" (= last free)"
: (block->next == free_list_tail ? " (= tail)" : "")
);
if ( block_size != next_block->prev_size ) {
80058e8: 2a 26 00 00 lw r6,(r17+0)
80058ec: 46 06 00 0a be r16,r6,8005914 <_Heap_Walk+0x438>
(*printer)(
80058f0: 78 03 08 01 mvhi r3,0x801
80058f4: b9 c0 08 00 mv r1,r14
80058f8: 34 02 00 01 mvi r2,1
80058fc: 38 63 4b 7c ori r3,r3,0x4b7c
8005900: b9 e0 20 00 mv r4,r15
8005904: ba 00 28 00 mv r5,r16
8005908: ba 20 38 00 mv r7,r17
800590c: d9 a0 00 00 call r13
8005910: e3 ff ff 91 bi 8005754 <_Heap_Walk+0x278>
);
return false;
}
if ( !prev_used ) {
8005914: 5e 40 00 06 bne r18,r0,800592c <_Heap_Walk+0x450>
(*printer)(
8005918: 78 03 08 01 mvhi r3,0x801
800591c: b9 c0 08 00 mv r1,r14
8005920: 34 02 00 01 mvi r2,1
8005924: 38 63 4b b8 ori r3,r3,0x4bb8
8005928: e0 00 00 30 bi 80059e8 <_Heap_Walk+0x50c>
block = next_block;
} while ( block != first_block );
return true;
}
800592c: 29 85 00 08 lw r5,(r12+8)
8005930: e0 00 00 03 bi 800593c <_Heap_Walk+0x460>
{
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
const Heap_Block *free_block = _Heap_Free_list_first( heap );
while ( free_block != free_list_tail ) {
if ( free_block == block ) {
8005934: 44 af 00 13 be r5,r15,8005980 <_Heap_Walk+0x4a4>
return true;
}
free_block = free_block->next;
8005938: 28 a5 00 08 lw r5,(r5+8)
)
{
const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
const Heap_Block *free_block = _Heap_Free_list_first( heap );
while ( free_block != free_list_tail ) {
800593c: 5c ac ff fe bne r5,r12,8005934 <_Heap_Walk+0x458>
8005940: e0 00 00 26 bi 80059d8 <_Heap_Walk+0x4fc>
if ( !_Heap_Is_prev_used( next_block ) ) {
if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) {
return false;
}
} else if (prev_used) {
8005944: 46 40 00 08 be r18,r0,8005964 <_Heap_Walk+0x488>
(*printer)(
8005948: 2b 83 00 58 lw r3,(sp+88)
800594c: b9 c0 08 00 mv r1,r14
8005950: 34 02 00 00 mvi r2,0
8005954: b9 e0 20 00 mv r4,r15
8005958: ba 00 28 00 mv r5,r16
800595c: d9 a0 00 00 call r13
8005960: e0 00 00 08 bi 8005980 <_Heap_Walk+0x4a4>
"block 0x%08x: size %u\n",
block,
block_size
);
} else {
(*printer)(
8005964: 2b 83 00 54 lw r3,(sp+84)
8005968: 29 e6 00 00 lw r6,(r15+0)
800596c: b9 c0 08 00 mv r1,r14
8005970: 34 02 00 00 mvi r2,0
8005974: b9 e0 20 00 mv r4,r15
8005978: ba 00 28 00 mv r5,r16
800597c: d9 a0 00 00 call r13
block->prev_size
);
}
block = next_block;
} while ( block != first_block );
8005980: 5e 91 ff 7b bne r20,r17,800576c <_Heap_Walk+0x290>
return true;
8005984: 34 03 00 01 mvi r3,1
}
8005988: b8 60 08 00 mv r1,r3
800598c: 2b 9d 00 10 lw ra,(sp+16)
8005990: 2b 8b 00 50 lw r11,(sp+80)
8005994: 2b 8c 00 4c lw r12,(sp+76)
8005998: 2b 8d 00 48 lw r13,(sp+72)
800599c: 2b 8e 00 44 lw r14,(sp+68)
80059a0: 2b 8f 00 40 lw r15,(sp+64)
80059a4: 2b 90 00 3c lw r16,(sp+60)
80059a8: 2b 91 00 38 lw r17,(sp+56)
80059ac: 2b 92 00 34 lw r18,(sp+52)
80059b0: 2b 93 00 30 lw r19,(sp+48)
80059b4: 2b 94 00 2c lw r20,(sp+44)
80059b8: 2b 95 00 28 lw r21,(sp+40)
80059bc: 2b 96 00 24 lw r22,(sp+36)
80059c0: 2b 97 00 20 lw r23,(sp+32)
80059c4: 2b 98 00 1c lw r24,(sp+28)
80059c8: 2b 99 00 18 lw r25,(sp+24)
80059cc: 2b 9b 00 14 lw fp,(sp+20)
80059d0: 37 9c 00 60 addi sp,sp,96
80059d4: c3 a0 00 00 ret
return false;
}
if ( !_Heap_Walk_is_in_free_list( heap, block ) ) {
(*printer)(
80059d8: 78 03 08 01 mvhi r3,0x801
80059dc: b9 c0 08 00 mv r1,r14
80059e0: 34 02 00 01 mvi r2,1
80059e4: 38 63 4c 28 ori r3,r3,0x4c28
80059e8: b9 e0 20 00 mv r4,r15
80059ec: d9 a0 00 00 call r13
80059f0: e3 ff ff 59 bi 8005754 <_Heap_Walk+0x278>
08005478 <_IO_Manager_initialization>:
#include <rtems/score/wkspace.h>
#include <string.h>
void _IO_Manager_initialization(void)
{
8005478: 37 9c ff e8 addi sp,sp,-24
800547c: 5b 8b 00 18 sw (sp+24),r11
8005480: 5b 8c 00 14 sw (sp+20),r12
8005484: 5b 8d 00 10 sw (sp+16),r13
8005488: 5b 8e 00 0c sw (sp+12),r14
800548c: 5b 8f 00 08 sw (sp+8),r15
8005490: 5b 9d 00 04 sw (sp+4),ra
uint32_t index;
rtems_driver_address_table *driver_table;
uint32_t drivers_in_table;
uint32_t number_of_drivers;
driver_table = rtems_configuration_get_device_driver_table();
8005494: 78 01 08 01 mvhi r1,0x801
8005498: 38 21 87 ec ori r1,r1,0x87ec
drivers_in_table = rtems_configuration_get_number_of_device_drivers();
800549c: 28 2d 00 38 lw r13,(r1+56)
number_of_drivers = rtems_configuration_get_maximum_drivers();
80054a0: 28 2b 00 34 lw r11,(r1+52)
uint32_t index;
rtems_driver_address_table *driver_table;
uint32_t drivers_in_table;
uint32_t number_of_drivers;
driver_table = rtems_configuration_get_device_driver_table();
80054a4: 28 2e 00 3c lw r14,(r1+60)
/*
* If the user claims there are less drivers than are actually in
* the table, then let's just go with the table's count.
*/
if ( number_of_drivers <= drivers_in_table )
80054a8: 51 ab 00 03 bgeu r13,r11,80054b4 <_IO_Manager_initialization+0x3c>
/*
* If the maximum number of driver is the same as the number in the
* table, then we do not have to copy the driver table. They can't
* register any dynamically.
*/
if ( number_of_drivers == drivers_in_table ) {
80054ac: 5d 6d 00 0a bne r11,r13,80054d4 <_IO_Manager_initialization+0x5c><== ALWAYS TAKEN
80054b0: e0 00 00 02 bi 80054b8 <_IO_Manager_initialization+0x40> <== NOT EXECUTED
/*
* If the user claims there are less drivers than are actually in
* the table, then let's just go with the table's count.
*/
if ( number_of_drivers <= drivers_in_table )
80054b4: b9 a0 58 00 mv r11,r13
* If the maximum number of driver is the same as the number in the
* table, then we do not have to copy the driver table. They can't
* register any dynamically.
*/
if ( number_of_drivers == drivers_in_table ) {
_IO_Driver_address_table = driver_table;
80054b8: 78 01 08 01 mvhi r1,0x801
80054bc: 38 21 b2 b4 ori r1,r1,0xb2b4
80054c0: 58 2e 00 00 sw (r1+0),r14
_IO_Number_of_drivers = number_of_drivers;
80054c4: 78 01 08 01 mvhi r1,0x801
80054c8: 38 21 b2 b0 ori r1,r1,0xb2b0
80054cc: 58 2b 00 00 sw (r1+0),r11
return;
80054d0: e0 00 00 27 bi 800556c <_IO_Manager_initialization+0xf4>
* have to allocate a new driver table and copy theirs to it.
*/
_IO_Driver_address_table = (rtems_driver_address_table *)
_Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
80054d4: 34 02 00 01 mvi r2,1
80054d8: b9 60 08 00 mv r1,r11
80054dc: f8 00 49 19 calli 8017940 <__ashlsi3>
80054e0: 34 02 00 03 mvi r2,3
80054e4: b4 2b 08 00 add r1,r1,r11
80054e8: f8 00 49 16 calli 8017940 <__ashlsi3>
80054ec: b8 20 78 00 mv r15,r1
* The application requested extra slots in the driver table, so we
* have to allocate a new driver table and copy theirs to it.
*/
_IO_Driver_address_table = (rtems_driver_address_table *)
_Workspace_Allocate_or_fatal_error(
80054f0: f8 00 0d ed calli 8008ca4 <_Workspace_Allocate_or_fatal_error>
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
80054f4: 78 02 08 01 mvhi r2,0x801
80054f8: 38 42 b2 b0 ori r2,r2,0xb2b0
/*
* The application requested extra slots in the driver table, so we
* have to allocate a new driver table and copy theirs to it.
*/
_IO_Driver_address_table = (rtems_driver_address_table *)
80054fc: 78 0c 08 01 mvhi r12,0x801
_Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
8005500: 58 4b 00 00 sw (r2+0),r11
memset(
8005504: b9 e0 18 00 mv r3,r15
/*
* The application requested extra slots in the driver table, so we
* have to allocate a new driver table and copy theirs to it.
*/
_IO_Driver_address_table = (rtems_driver_address_table *)
8005508: 39 8c b2 b4 ori r12,r12,0xb2b4
_Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
memset(
800550c: 34 02 00 00 mvi r2,0
/*
* The application requested extra slots in the driver table, so we
* have to allocate a new driver table and copy theirs to it.
*/
_IO_Driver_address_table = (rtems_driver_address_table *)
8005510: 59 81 00 00 sw (r12+0),r1
_Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
_IO_Number_of_drivers = number_of_drivers;
memset(
8005514: f8 00 35 07 calli 8012930 <memset>
_IO_Driver_address_table, 0,
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
for ( index = 0 ; index < drivers_in_table ; index++ )
8005518: 34 03 00 00 mvi r3,0
800551c: 34 04 00 00 mvi r4,0
8005520: e0 00 00 12 bi 8005568 <_IO_Manager_initialization+0xf0>
_IO_Driver_address_table[index] = driver_table[index];
8005524: 29 82 00 00 lw r2,(r12+0)
#include <rtems/score/thread.h>
#include <rtems/score/wkspace.h>
#include <string.h>
void _IO_Manager_initialization(void)
8005528: b5 c3 08 00 add r1,r14,r3
_IO_Driver_address_table, 0,
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
for ( index = 0 ; index < drivers_in_table ; index++ )
_IO_Driver_address_table[index] = driver_table[index];
800552c: 28 29 00 00 lw r9,(r1+0)
8005530: 28 28 00 04 lw r8,(r1+4)
8005534: 28 27 00 08 lw r7,(r1+8)
8005538: 28 26 00 0c lw r6,(r1+12)
800553c: 28 25 00 10 lw r5,(r1+16)
8005540: 28 21 00 14 lw r1,(r1+20)
8005544: b4 43 10 00 add r2,r2,r3
8005548: 58 49 00 00 sw (r2+0),r9
800554c: 58 48 00 04 sw (r2+4),r8
8005550: 58 47 00 08 sw (r2+8),r7
8005554: 58 46 00 0c sw (r2+12),r6
8005558: 58 45 00 10 sw (r2+16),r5
800555c: 58 41 00 14 sw (r2+20),r1
memset(
_IO_Driver_address_table, 0,
sizeof( rtems_driver_address_table ) * ( number_of_drivers )
);
for ( index = 0 ; index < drivers_in_table ; index++ )
8005560: 34 84 00 01 addi r4,r4,1
8005564: 34 63 00 18 addi r3,r3,24
8005568: 55 a4 ff ef bgu r13,r4,8005524 <_IO_Manager_initialization+0xac>
_IO_Driver_address_table[index] = driver_table[index];
}
800556c: 2b 9d 00 04 lw ra,(sp+4)
8005570: 2b 8b 00 18 lw r11,(sp+24)
8005574: 2b 8c 00 14 lw r12,(sp+20)
8005578: 2b 8d 00 10 lw r13,(sp+16)
800557c: 2b 8e 00 0c lw r14,(sp+12)
8005580: 2b 8f 00 08 lw r15,(sp+8)
8005584: 37 9c 00 18 addi sp,sp,24
8005588: c3 a0 00 00 ret
080065f4 <_Objects_Allocate>:
#endif
Objects_Control *_Objects_Allocate(
Objects_Information *information
)
{
80065f4: 37 9c ff ec addi sp,sp,-20
80065f8: 5b 8b 00 14 sw (sp+20),r11
80065fc: 5b 8c 00 10 sw (sp+16),r12
8006600: 5b 8d 00 0c sw (sp+12),r13
8006604: 5b 8e 00 08 sw (sp+8),r14
8006608: 5b 9d 00 04 sw (sp+4),ra
800660c: b8 20 58 00 mv r11,r1
* If the application is using the optional manager stubs and
* still attempts to create the object, the information block
* should be all zeroed out because it is in the BSS. So let's
* check that code for this manager is even present.
*/
if ( information->size == 0 )
8006610: 28 21 00 18 lw r1,(r1+24)
return NULL;
8006614: 34 0c 00 00 mvi r12,0
* If the application is using the optional manager stubs and
* still attempts to create the object, the information block
* should be all zeroed out because it is in the BSS. So let's
* check that code for this manager is even present.
*/
if ( information->size == 0 )
8006618: 44 20 00 1e be r1,r0,8006690 <_Objects_Allocate+0x9c> <== NEVER TAKEN
/*
* OK. The manager should be initialized and configured to have objects.
* With any luck, it is safe to attempt to allocate an object.
*/
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
800661c: 35 6d 00 20 addi r13,r11,32
8006620: b9 a0 08 00 mv r1,r13
8006624: fb ff fd 23 calli 8005ab0 <_Chain_Get>
8006628: b8 20 60 00 mv r12,r1
800662c: b8 20 70 00 mv r14,r1
if ( information->auto_extend ) {
8006630: 41 61 00 12 lbu r1,(r11+18)
8006634: 44 20 00 17 be r1,r0,8006690 <_Objects_Allocate+0x9c>
/*
* If the list is empty then we are out of objects and need to
* extend information base.
*/
if ( !the_object ) {
8006638: 5d 80 00 07 bne r12,r0,8006654 <_Objects_Allocate+0x60>
_Objects_Extend_information( information );
800663c: b9 60 08 00 mv r1,r11
8006640: f8 00 00 32 calli 8006708 <_Objects_Extend_information>
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
8006644: b9 a0 08 00 mv r1,r13
8006648: fb ff fd 1a calli 8005ab0 <_Chain_Get>
800664c: b8 20 60 00 mv r12,r1
}
if ( the_object ) {
8006650: 44 2e 00 10 be r1,r14,8006690 <_Objects_Allocate+0x9c>
uint32_t block;
block = (uint32_t) _Objects_Get_index( the_object->id ) -
8006654: 2d 82 00 0a lhu r2,(r12+10)
8006658: 2d 61 00 0a lhu r1,(r11+10)
_Objects_Get_index( information->minimum_id );
block /= information->allocation_size;
800665c: c8 41 08 00 sub r1,r2,r1
8006660: 2d 62 00 14 lhu r2,(r11+20)
8006664: f8 00 45 91 calli 8017ca8 <__udivsi3>
information->inactive_per_block[ block ]--;
8006668: 34 02 00 02 mvi r2,2
800666c: f8 00 44 b5 calli 8017940 <__ashlsi3>
8006670: 29 62 00 30 lw r2,(r11+48)
8006674: b4 41 08 00 add r1,r2,r1
8006678: 28 22 00 00 lw r2,(r1+0)
800667c: 34 42 ff ff addi r2,r2,-1
8006680: 58 22 00 00 sw (r1+0),r2
information->inactive--;
8006684: 2d 61 00 2c lhu r1,(r11+44)
8006688: 34 21 ff ff addi r1,r1,-1
800668c: 0d 61 00 2c sh (r11+44),r1
);
}
#endif
return the_object;
}
8006690: b9 80 08 00 mv r1,r12
8006694: 2b 9d 00 04 lw ra,(sp+4)
8006698: 2b 8b 00 14 lw r11,(sp+20)
800669c: 2b 8c 00 10 lw r12,(sp+16)
80066a0: 2b 8d 00 0c lw r13,(sp+12)
80066a4: 2b 8e 00 08 lw r14,(sp+8)
80066a8: 37 9c 00 14 addi sp,sp,20
80066ac: c3 a0 00 00 ret
0800f89c <_Objects_Get_information>:
Objects_Information *_Objects_Get_information(
Objects_APIs the_api,
uint16_t the_class
)
{
800f89c: 37 9c ff ec addi sp,sp,-20
800f8a0: 5b 8b 00 14 sw (sp+20),r11
800f8a4: 5b 8c 00 10 sw (sp+16),r12
800f8a8: 5b 8d 00 0c sw (sp+12),r13
800f8ac: 5b 8e 00 08 sw (sp+8),r14
800f8b0: 5b 9d 00 04 sw (sp+4),ra
800f8b4: 20 4c ff ff andi r12,r2,0xffff
800f8b8: b8 20 70 00 mv r14,r1
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
return NULL;
800f8bc: 34 0b 00 00 mvi r11,0
)
{
Objects_Information *info;
int the_class_api_maximum;
if ( !the_class )
800f8c0: 45 80 00 16 be r12,r0,800f918 <_Objects_Get_information+0x7c>
/*
* This call implicitly validates the_api so we do not call
* _Objects_Is_api_valid above here.
*/
the_class_api_maximum = _Objects_API_maximum_class( the_api );
800f8c4: f8 00 08 4b calli 80119f0 <_Objects_API_maximum_class>
if ( the_class_api_maximum == 0 )
800f8c8: 44 20 00 14 be r1,r0,800f918 <_Objects_Get_information+0x7c>
return NULL;
if ( the_class > (uint32_t) the_class_api_maximum )
800f8cc: 55 81 00 13 bgu r12,r1,800f918 <_Objects_Get_information+0x7c>
return NULL;
if ( !_Objects_Information_table[ the_api ] )
800f8d0: 78 0d 08 01 mvhi r13,0x801
800f8d4: b9 c0 08 00 mv r1,r14
800f8d8: 34 02 00 02 mvi r2,2
800f8dc: 39 ad a9 14 ori r13,r13,0xa914
800f8e0: f8 00 20 18 calli 8017940 <__ashlsi3>
800f8e4: b5 a1 08 00 add r1,r13,r1
800f8e8: 28 2d 00 00 lw r13,(r1+0)
800f8ec: 45 a0 00 0b be r13,r0,800f918 <_Objects_Get_information+0x7c><== NEVER TAKEN
return NULL;
info = _Objects_Information_table[ the_api ][ the_class ];
800f8f0: b9 80 08 00 mv r1,r12
800f8f4: 34 02 00 02 mvi r2,2
800f8f8: f8 00 20 12 calli 8017940 <__ashlsi3>
800f8fc: b5 a1 08 00 add r1,r13,r1
800f900: 28 2b 00 00 lw r11,(r1+0)
if ( !info )
800f904: 45 60 00 05 be r11,r0,800f918 <_Objects_Get_information+0x7c><== NEVER TAKEN
* In a multprocessing configuration, we may access remote objects.
* Thus we may have 0 local instances and still have a valid object
* pointer.
*/
#if !defined(RTEMS_MULTIPROCESSING)
if ( info->maximum == 0 )
800f908: 2d 61 00 10 lhu r1,(r11+16)
return NULL;
800f90c: 7c 21 00 00 cmpnei r1,r1,0
800f910: c8 01 08 00 sub r1,r0,r1
800f914: a1 61 58 00 and r11,r11,r1
#endif
return info;
}
800f918: b9 60 08 00 mv r1,r11
800f91c: 2b 9d 00 04 lw ra,(sp+4)
800f920: 2b 8b 00 14 lw r11,(sp+20)
800f924: 2b 8c 00 10 lw r12,(sp+16)
800f928: 2b 8d 00 0c lw r13,(sp+12)
800f92c: 2b 8e 00 08 lw r14,(sp+8)
800f930: 37 9c 00 14 addi sp,sp,20
800f934: c3 a0 00 00 ret
08018980 <_Objects_Get_no_protection>:
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
8018980: 37 9c ff f4 addi sp,sp,-12
8018984: 5b 8b 00 0c sw (sp+12),r11
8018988: 5b 8c 00 08 sw (sp+8),r12
801898c: 5b 9d 00 04 sw (sp+4),ra
8018990: b8 20 20 00 mv r4,r1
/*
* You can't just extract the index portion or you can get tricked
* by a value between 1 and maximum.
*/
index = id - information->minimum_id + 1;
8018994: 28 21 00 08 lw r1,(r1+8)
Objects_Control *_Objects_Get_no_protection(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location
)
{
8018998: b8 60 58 00 mv r11,r3
/*
* You can't just extract the index portion or you can get tricked
* by a value between 1 and maximum.
*/
index = id - information->minimum_id + 1;
801899c: c8 41 08 00 sub r1,r2,r1
if ( information->maximum >= index ) {
80189a0: 2c 82 00 10 lhu r2,(r4+16)
/*
* You can't just extract the index portion or you can get tricked
* by a value between 1 and maximum.
*/
index = id - information->minimum_id + 1;
80189a4: 34 21 00 01 addi r1,r1,1
if ( information->maximum >= index ) {
80189a8: 54 22 00 09 bgu r1,r2,80189cc <_Objects_Get_no_protection+0x4c>
if ( (the_object = information->local_table[ index ]) != NULL ) {
80189ac: 28 8c 00 1c lw r12,(r4+28)
80189b0: 34 02 00 02 mvi r2,2
80189b4: fb ff d5 e3 calli 800e140 <__ashlsi3>
80189b8: b5 81 08 00 add r1,r12,r1
80189bc: 28 21 00 00 lw r1,(r1+0)
80189c0: 44 20 00 03 be r1,r0,80189cc <_Objects_Get_no_protection+0x4c><== NEVER TAKEN
*location = OBJECTS_LOCAL;
80189c4: 59 60 00 00 sw (r11+0),r0
return the_object;
80189c8: e0 00 00 04 bi 80189d8 <_Objects_Get_no_protection+0x58>
/*
* This isn't supported or required yet for Global objects so
* if it isn't local, we don't find it.
*/
*location = OBJECTS_ERROR;
80189cc: 34 01 00 01 mvi r1,1
80189d0: 59 61 00 00 sw (r11+0),r1
return NULL;
80189d4: 34 01 00 00 mvi r1,0
}
80189d8: 2b 9d 00 04 lw ra,(sp+4)
80189dc: 2b 8b 00 0c lw r11,(sp+12)
80189e0: 2b 8c 00 08 lw r12,(sp+8)
80189e4: 37 9c 00 0c addi sp,sp,12
80189e8: c3 a0 00 00 ret
0800a45c <_Objects_Id_to_name>:
Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
Objects_Id id,
Objects_Name *name
)
{
800a45c: 37 9c ff e8 addi sp,sp,-24
800a460: 5b 8b 00 14 sw (sp+20),r11
800a464: 5b 8c 00 10 sw (sp+16),r12
800a468: 5b 8d 00 0c sw (sp+12),r13
800a46c: 5b 8e 00 08 sw (sp+8),r14
800a470: 5b 9d 00 04 sw (sp+4),ra
800a474: b8 40 70 00 mv r14,r2
/*
* Caller is trusted for name != NULL.
*/
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
800a478: b8 20 58 00 mv r11,r1
800a47c: 5c 20 00 05 bne r1,r0,800a490 <_Objects_Id_to_name+0x34>
800a480: 78 01 08 03 mvhi r1,0x803
800a484: 38 21 17 00 ori r1,r1,0x1700
800a488: 28 21 00 10 lw r1,(r1+16)
800a48c: 28 2b 00 08 lw r11,(r1+8)
*/
RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API(
Objects_Id id
)
{
return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS);
800a490: 34 02 00 18 mvi r2,24
800a494: b9 60 08 00 mv r1,r11
800a498: f8 00 80 d9 calli 802a7fc <__lshrsi3>
800a49c: 20 21 00 07 andi r1,r1,0x7
*/
RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid(
uint32_t the_api
)
{
if ( !the_api || the_api > OBJECTS_APIS_LAST )
800a4a0: 34 23 ff ff addi r3,r1,-1
800a4a4: 34 02 00 02 mvi r2,2
the_api = _Objects_Get_API( tmpId );
if ( !_Objects_Is_api_valid( the_api ) )
return OBJECTS_INVALID_ID;
800a4a8: 34 0d 00 03 mvi r13,3
800a4ac: 54 62 00 14 bgu r3,r2,800a4fc <_Objects_Id_to_name+0xa0>
800a4b0: e0 00 00 1b bi 800a51c <_Objects_Id_to_name+0xc0>
*/
RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class(
Objects_Id id
)
{
return (uint32_t)
800a4b4: 34 02 00 1b mvi r2,27
800a4b8: b9 60 08 00 mv r1,r11
800a4bc: f8 00 80 d0 calli 802a7fc <__lshrsi3>
if ( !_Objects_Information_table[ the_api ] )
return OBJECTS_INVALID_ID;
the_class = _Objects_Get_class( tmpId );
information = _Objects_Information_table[ the_api ][ the_class ];
800a4c0: 34 02 00 02 mvi r2,2
800a4c4: f8 00 80 80 calli 802a6c4 <__ashlsi3>
800a4c8: b5 81 08 00 add r1,r12,r1
800a4cc: 28 21 00 00 lw r1,(r1+0)
if ( !information )
800a4d0: 44 20 00 0b be r1,r0,800a4fc <_Objects_Id_to_name+0xa0> <== NEVER TAKEN
return OBJECTS_INVALID_ID;
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string )
800a4d4: 40 2c 00 38 lbu r12,(r1+56)
800a4d8: 5d 80 00 09 bne r12,r0,800a4fc <_Objects_Id_to_name+0xa0> <== NEVER TAKEN
return OBJECTS_INVALID_ID;
#endif
the_object = _Objects_Get( information, tmpId, &ignored_location );
800a4dc: b9 60 10 00 mv r2,r11
800a4e0: 37 83 00 18 addi r3,sp,24
800a4e4: fb ff ff b8 calli 800a3c4 <_Objects_Get>
if ( !the_object )
800a4e8: 44 2c 00 05 be r1,r12,800a4fc <_Objects_Id_to_name+0xa0>
return OBJECTS_INVALID_ID;
*name = the_object->name;
800a4ec: 28 21 00 0c lw r1,(r1+12)
_Thread_Enable_dispatch();
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
800a4f0: 34 0d 00 00 mvi r13,0
the_object = _Objects_Get( information, tmpId, &ignored_location );
if ( !the_object )
return OBJECTS_INVALID_ID;
*name = the_object->name;
800a4f4: 59 c1 00 00 sw (r14+0),r1
_Thread_Enable_dispatch();
800a4f8: f8 00 04 5b calli 800b664 <_Thread_Enable_dispatch>
return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
}
800a4fc: b9 a0 08 00 mv r1,r13
800a500: 2b 9d 00 04 lw ra,(sp+4)
800a504: 2b 8b 00 14 lw r11,(sp+20)
800a508: 2b 8c 00 10 lw r12,(sp+16)
800a50c: 2b 8d 00 0c lw r13,(sp+12)
800a510: 2b 8e 00 08 lw r14,(sp+8)
800a514: 37 9c 00 18 addi sp,sp,24
800a518: c3 a0 00 00 ret
the_api = _Objects_Get_API( tmpId );
if ( !_Objects_Is_api_valid( the_api ) )
return OBJECTS_INVALID_ID;
if ( !_Objects_Information_table[ the_api ] )
800a51c: 78 0c 08 03 mvhi r12,0x803
800a520: 34 02 00 02 mvi r2,2
800a524: 39 8c 11 d4 ori r12,r12,0x11d4
800a528: f8 00 80 67 calli 802a6c4 <__ashlsi3>
800a52c: b5 81 08 00 add r1,r12,r1
800a530: 28 2c 00 00 lw r12,(r1+0)
800a534: 5d 80 ff e0 bne r12,r0,800a4b4 <_Objects_Id_to_name+0x58>
800a538: e3 ff ff f1 bi 800a4fc <_Objects_Id_to_name+0xa0>
0801120c <_POSIX_Keys_Run_destructors>:
*/
void _POSIX_Keys_Run_destructors(
Thread_Control *thread
)
{
801120c: 37 9c ff dc addi sp,sp,-36
8011210: 5b 8b 00 24 sw (sp+36),r11
8011214: 5b 8c 00 20 sw (sp+32),r12
8011218: 5b 8d 00 1c sw (sp+28),r13
801121c: 5b 8e 00 18 sw (sp+24),r14
8011220: 5b 8f 00 14 sw (sp+20),r15
8011224: 5b 90 00 10 sw (sp+16),r16
8011228: 5b 91 00 0c sw (sp+12),r17
801122c: 5b 92 00 08 sw (sp+8),r18
8011230: 5b 9d 00 04 sw (sp+4),ra
Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id );
8011234: 28 2b 00 08 lw r11,(r1+8)
8011238: 34 02 00 18 mvi r2,24
801123c: b9 60 08 00 mv r1,r11
8011240: f8 00 1a 0e calli 8017a78 <__lshrsi3>
8011244: 20 30 00 07 andi r16,r1,0x7
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 ];
8011248: 34 02 00 02 mvi r2,2
801124c: 21 61 ff ff andi r1,r11,0xffff
8011250: f8 00 19 bc calli 8017940 <__ashlsi3>
*
* 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;
8011254: 78 0b 08 01 mvhi r11,0x801
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 ];
8011258: b8 20 88 00 mv r17,r1
*
* 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;
801125c: 39 6b ac cc ori r11,r11,0xaccc
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 ];
8011260: 36 10 00 04 addi r16,r16,4
*
* 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;
8011264: 2d 72 00 10 lhu r18,(r11+16)
done = true;
for ( index = 1 ; index <= max ; ++index ) {
8011268: 34 0c 00 01 mvi r12,1
*/
while ( !done ) {
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
801126c: 34 0e 00 01 mvi r14,1
for ( index = 1 ; index <= max ; ++index ) {
8011270: e0 00 00 18 bi 80112d0 <_POSIX_Keys_Run_destructors+0xc4>
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
_POSIX_Keys_Information.local_table [ index ];
8011274: 29 6d 00 1c lw r13,(r11+28)
8011278: 34 02 00 02 mvi r2,2
801127c: b9 80 08 00 mv r1,r12
8011280: f8 00 19 b0 calli 8017940 <__ashlsi3>
8011284: b5 a1 10 00 add r2,r13,r1
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
8011288: 28 4d 00 00 lw r13,(r2+0)
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
801128c: 45 a0 00 0f be r13,r0,80112c8 <_POSIX_Keys_Run_destructors+0xbc>
8011290: 29 af 00 10 lw r15,(r13+16)
8011294: 45 e0 00 0d be r15,r0,80112c8 <_POSIX_Keys_Run_destructors+0xbc>
void *value = key->Values [ thread_api ][ thread_index ];
8011298: 34 02 00 02 mvi r2,2
801129c: ba 00 08 00 mv r1,r16
80112a0: f8 00 19 a8 calli 8017940 <__ashlsi3>
80112a4: b5 a1 68 00 add r13,r13,r1
80112a8: 29 a3 00 04 lw r3,(r13+4)
80112ac: b4 71 18 00 add r3,r3,r17
80112b0: 28 62 00 00 lw r2,(r3+0)
if ( value != NULL ) {
80112b4: 44 40 00 05 be r2,r0,80112c8 <_POSIX_Keys_Run_destructors+0xbc><== ALWAYS TAKEN
key->Values [ thread_api ][ thread_index ] = NULL;
80112b8: 58 60 00 00 sw (r3+0),r0 <== NOT EXECUTED
(*key->destructor)( value );
80112bc: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
80112c0: d9 e0 00 00 call r15 <== NOT EXECUTED
done = false;
80112c4: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
80112c8: 35 8c 00 01 addi r12,r12,1
80112cc: 21 8c ff ff andi r12,r12,0xffff
80112d0: 52 4c ff e9 bgeu r18,r12,8011274 <_POSIX_Keys_Run_destructors+0x68>
* 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 ) {
80112d4: 45 c0 ff e4 be r14,r0,8011264 <_POSIX_Keys_Run_destructors+0x58><== NEVER TAKEN
done = false;
}
}
}
}
}
80112d8: 2b 9d 00 04 lw ra,(sp+4)
80112dc: 2b 8b 00 24 lw r11,(sp+36)
80112e0: 2b 8c 00 20 lw r12,(sp+32)
80112e4: 2b 8d 00 1c lw r13,(sp+28)
80112e8: 2b 8e 00 18 lw r14,(sp+24)
80112ec: 2b 8f 00 14 lw r15,(sp+20)
80112f0: 2b 90 00 10 lw r16,(sp+16)
80112f4: 2b 91 00 0c lw r17,(sp+12)
80112f8: 2b 92 00 08 lw r18,(sp+8)
80112fc: 37 9c 00 24 addi sp,sp,36
8011300: c3 a0 00 00 ret
08009320 <_POSIX_Message_queue_Receive_support>:
size_t msg_len,
unsigned int *msg_prio,
bool wait,
Watchdog_Interval timeout
)
{
8009320: 37 9c ff dc addi sp,sp,-36
8009324: 5b 8b 00 18 sw (sp+24),r11
8009328: 5b 8c 00 14 sw (sp+20),r12
800932c: 5b 8d 00 10 sw (sp+16),r13
8009330: 5b 8e 00 0c sw (sp+12),r14
8009334: 5b 8f 00 08 sw (sp+8),r15
8009338: 5b 9d 00 04 sw (sp+4),ra
800933c: b8 20 60 00 mv r12,r1
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd (
mqd_t id,
Objects_Locations *location
)
{
return (POSIX_Message_queue_Control_fd *) _Objects_Get(
8009340: 78 01 08 02 mvhi r1,0x802
8009344: b8 40 68 00 mv r13,r2
8009348: b8 60 78 00 mv r15,r3
800934c: b9 80 10 00 mv r2,r12
8009350: 38 21 a2 40 ori r1,r1,0xa240
8009354: 37 83 00 24 addi r3,sp,36
8009358: 5b 86 00 1c sw (sp+28),r6
800935c: b8 80 58 00 mv r11,r4
8009360: 20 ae 00 ff andi r14,r5,0xff
8009364: f8 00 0d 3e calli 800c85c <_Objects_Get>
Objects_Locations location;
size_t length_out;
bool do_wait;
the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
8009368: 2b 82 00 24 lw r2,(sp+36)
800936c: 2b 86 00 1c lw r6,(sp+28)
8009370: 5c 40 00 33 bne r2,r0,800943c <_POSIX_Message_queue_Receive_support+0x11c>
case OBJECTS_LOCAL:
if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) {
8009374: 28 24 00 14 lw r4,(r1+20)
8009378: 34 02 00 01 mvi r2,1
800937c: 20 83 00 03 andi r3,r4,0x3
8009380: 5c 62 00 03 bne r3,r2,800938c <_POSIX_Message_queue_Receive_support+0x6c>
_Thread_Enable_dispatch();
8009384: f8 00 11 76 calli 800d95c <_Thread_Enable_dispatch>
8009388: e0 00 00 2d bi 800943c <_POSIX_Message_queue_Receive_support+0x11c>
rtems_set_errno_and_return_minus_one( EBADF );
}
the_mq = the_mq_fd->Queue;
800938c: 28 27 00 10 lw r7,(r1+16)
if ( msg_len < the_mq->Message_queue.maximum_message_size ) {
8009390: 28 e1 00 68 lw r1,(r7+104)
8009394: 51 e1 00 05 bgeu r15,r1,80093a8 <_POSIX_Message_queue_Receive_support+0x88>
_Thread_Enable_dispatch();
8009398: f8 00 11 71 calli 800d95c <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EMSGSIZE );
800939c: f8 00 2c 04 calli 80143ac <__errno>
80093a0: 34 02 00 7a mvi r2,122
80093a4: e0 00 00 28 bi 8009444 <_POSIX_Message_queue_Receive_support+0x124>
/*
* Now if something goes wrong, we return a "length" of -1
* to indicate an error.
*/
length_out = -1;
80093a8: 34 01 ff ff mvi r1,-1
80093ac: 5b 81 00 20 sw (sp+32),r1
/*
* A timed receive with a bad time will do a poll regardless.
*/
if ( wait )
80093b0: 34 05 00 00 mvi r5,0
80093b4: 45 c0 00 03 be r14,r0,80093c0 <_POSIX_Message_queue_Receive_support+0xa0>
do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true;
80093b8: 20 85 40 00 andi r5,r4,0x4000
80093bc: 64 a5 00 00 cmpei r5,r5,0
do_wait = wait;
/*
* Now perform the actual message receive
*/
_CORE_message_queue_Seize(
80093c0: 34 e1 00 1c addi r1,r7,28
80093c4: b9 80 10 00 mv r2,r12
80093c8: b9 a0 18 00 mv r3,r13
80093cc: 37 84 00 20 addi r4,sp,32
80093d0: f8 00 07 dc calli 800b340 <_CORE_message_queue_Seize>
&length_out,
do_wait,
timeout
);
_Thread_Enable_dispatch();
80093d4: f8 00 11 62 calli 800d95c <_Thread_Enable_dispatch>
if (msg_prio) {
80093d8: 45 60 00 0b be r11,r0,8009404 <_POSIX_Message_queue_Receive_support+0xe4><== NEVER TAKEN
*msg_prio = _POSIX_Message_queue_Priority_from_core(
_Thread_Executing->Wait.count
80093dc: 78 01 08 02 mvhi r1,0x802
80093e0: 38 21 a2 c0 ori r1,r1,0xa2c0
80093e4: 28 2c 00 10 lw r12,(r1+16)
RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
CORE_message_queue_Submit_types priority
)
{
/* absolute value without a library dependency */
return (unsigned int) ((priority >= 0) ? priority : -priority);
80093e8: 34 02 00 1f mvi r2,31
80093ec: 29 81 00 24 lw r1,(r12+36)
80093f0: f8 00 6d d3 calli 8024b3c <__ashrsi3>
80093f4: 29 82 00 24 lw r2,(r12+36)
80093f8: 98 22 10 00 xor r2,r1,r2
80093fc: c8 41 08 00 sub r1,r2,r1
timeout
);
_Thread_Enable_dispatch();
if (msg_prio) {
*msg_prio = _POSIX_Message_queue_Priority_from_core(
8009400: 59 61 00 00 sw (r11+0),r1
_Thread_Executing->Wait.count
);
}
if ( !_Thread_Executing->Wait.return_code )
8009404: 78 0b 08 02 mvhi r11,0x802
8009408: 39 6b a2 c0 ori r11,r11,0xa2c0
800940c: 29 61 00 10 lw r1,(r11+16)
8009410: 28 21 00 34 lw r1,(r1+52)
8009414: 5c 20 00 03 bne r1,r0,8009420 <_POSIX_Message_queue_Receive_support+0x100>
return length_out;
8009418: 2b 81 00 20 lw r1,(sp+32)
800941c: e0 00 00 0c bi 800944c <_POSIX_Message_queue_Receive_support+0x12c>
rtems_set_errno_and_return_minus_one(
8009420: f8 00 2b e3 calli 80143ac <__errno>
8009424: b8 20 60 00 mv r12,r1
8009428: 29 61 00 10 lw r1,(r11+16)
800942c: 28 21 00 34 lw r1,(r1+52)
8009430: f8 00 00 b9 calli 8009714 <_POSIX_Message_queue_Translate_core_message_queue_return_code>
8009434: 59 81 00 00 sw (r12+0),r1
8009438: e0 00 00 04 bi 8009448 <_POSIX_Message_queue_Receive_support+0x128>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EBADF );
800943c: f8 00 2b dc calli 80143ac <__errno>
8009440: 34 02 00 09 mvi r2,9
8009444: 58 22 00 00 sw (r1+0),r2
8009448: 34 01 ff ff mvi r1,-1
}
800944c: 2b 9d 00 04 lw ra,(sp+4)
8009450: 2b 8b 00 18 lw r11,(sp+24)
8009454: 2b 8c 00 14 lw r12,(sp+20)
8009458: 2b 8d 00 10 lw r13,(sp+16)
800945c: 2b 8e 00 0c lw r14,(sp+12)
8009460: 2b 8f 00 08 lw r15,(sp+8)
8009464: 37 9c 00 24 addi sp,sp,36
8009468: c3 a0 00 00 ret
0800beec <_POSIX_Semaphore_Create_support>:
size_t name_len,
int pshared,
unsigned int value,
POSIX_Semaphore_Control **the_sem
)
{
800beec: 37 9c ff e0 addi sp,sp,-32
800bef0: 5b 8b 00 1c sw (sp+28),r11
800bef4: 5b 8c 00 18 sw (sp+24),r12
800bef8: 5b 8d 00 14 sw (sp+20),r13
800befc: 5b 8e 00 10 sw (sp+16),r14
800bf00: 5b 8f 00 0c sw (sp+12),r15
800bf04: 5b 90 00 08 sw (sp+8),r16
800bf08: 5b 9d 00 04 sw (sp+4),ra
800bf0c: b8 20 60 00 mv r12,r1
800bf10: b8 60 70 00 mv r14,r3
800bf14: b8 80 80 00 mv r16,r4
800bf18: b8 a0 78 00 mv r15,r5
POSIX_Semaphore_Control *the_semaphore;
CORE_semaphore_Attributes *the_sem_attr;
char *name;
/* Sharing semaphores among processes is not currently supported */
if (pshared != 0)
800bf1c: 44 60 00 04 be r3,r0,800bf2c <_POSIX_Semaphore_Create_support+0x40>
rtems_set_errno_and_return_minus_one( ENOSYS );
800bf20: f8 00 0b f0 calli 800eee0 <__errno>
800bf24: 34 02 00 58 mvi r2,88
800bf28: e0 00 00 11 bi 800bf6c <_POSIX_Semaphore_Create_support+0x80>
*
* 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;
800bf2c: 78 06 08 02 mvhi r6,0x802
800bf30: 38 c6 43 28 ori r6,r6,0x4328
800bf34: 28 c1 00 00 lw r1,(r6+0)
++level;
800bf38: 34 21 00 01 addi r1,r1,1
_Thread_Dispatch_disable_level = level;
800bf3c: 58 c1 00 00 sw (r6+0),r1
*/
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
{
return (POSIX_Semaphore_Control *)
_Objects_Allocate( &_POSIX_Semaphore_Information );
800bf40: 78 0d 08 02 mvhi r13,0x802
800bf44: 39 ad 45 64 ori r13,r13,0x4564
800bf48: b9 a0 08 00 mv r1,r13
800bf4c: 5b 82 00 20 sw (sp+32),r2
800bf50: fb ff ec 60 calli 80070d0 <_Objects_Allocate>
800bf54: b8 20 58 00 mv r11,r1
_Thread_Disable_dispatch();
the_semaphore = _POSIX_Semaphore_Allocate();
if ( !the_semaphore ) {
800bf58: 2b 82 00 20 lw r2,(sp+32)
800bf5c: 5c 2e 00 07 bne r1,r14,800bf78 <_POSIX_Semaphore_Create_support+0x8c>
_Thread_Enable_dispatch();
800bf60: fb ff f1 fd calli 8008754 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( ENOSPC );
800bf64: f8 00 0b df calli 800eee0 <__errno>
800bf68: 34 02 00 1c mvi r2,28
800bf6c: 58 22 00 00 sw (r1+0),r2
800bf70: 34 01 ff ff mvi r1,-1
800bf74: e0 00 00 2c bi 800c024 <_POSIX_Semaphore_Create_support+0x138>
/*
* Make a copy of the user's string for name just in case it was
* dynamically constructed.
*/
if ( name_arg != NULL ) {
800bf78: 45 80 00 0c be r12,r0,800bfa8 <_POSIX_Semaphore_Create_support+0xbc>
name = _Workspace_String_duplicate( name_arg, name_len );
800bf7c: b9 80 08 00 mv r1,r12
800bf80: f8 00 05 09 calli 800d3a4 <_Workspace_String_duplicate>
800bf84: b8 20 60 00 mv r12,r1
if ( !name ) {
800bf88: 5c 20 00 09 bne r1,r0,800bfac <_POSIX_Semaphore_Create_support+0xc0><== ALWAYS TAKEN
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
800bf8c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800bf90: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800bf94: fb ff ed 4f calli 80074d0 <_Objects_Free> <== NOT EXECUTED
_POSIX_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
800bf98: fb ff f1 ef calli 8008754 <_Thread_Enable_dispatch> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
800bf9c: f8 00 0b d1 calli 800eee0 <__errno> <== NOT EXECUTED
800bfa0: 34 02 00 0c mvi r2,12 <== NOT EXECUTED
800bfa4: e3 ff ff f2 bi 800bf6c <_POSIX_Semaphore_Create_support+0x80><== NOT EXECUTED
}
} else {
name = NULL;
800bfa8: 34 0c 00 00 mvi r12,0
}
the_semaphore->process_shared = pshared;
800bfac: 59 60 00 10 sw (r11+16),r0
if ( name ) {
800bfb0: 45 80 00 07 be r12,r0,800bfcc <_POSIX_Semaphore_Create_support+0xe0>
the_semaphore->named = true;
800bfb4: 34 01 00 01 mvi r1,1
800bfb8: 31 61 00 14 sb (r11+20),r1
the_semaphore->open_count = 1;
800bfbc: 34 01 00 01 mvi r1,1
800bfc0: 59 61 00 18 sw (r11+24),r1
the_semaphore->linked = true;
800bfc4: 31 61 00 15 sb (r11+21),r1
800bfc8: e0 00 00 04 bi 800bfd8 <_POSIX_Semaphore_Create_support+0xec>
} else {
the_semaphore->named = false;
800bfcc: 31 60 00 14 sb (r11+20),r0
the_semaphore->open_count = 0;
800bfd0: 59 60 00 18 sw (r11+24),r0
the_semaphore->linked = false;
800bfd4: 31 60 00 15 sb (r11+21),r0
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
800bfd8: 34 01 ff ff mvi r1,-1
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
800bfdc: ba 00 18 00 mv r3,r16
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
800bfe0: 59 61 00 5c sw (r11+92),r1
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
800bfe4: 35 62 00 5c addi r2,r11,92
800bfe8: 35 61 00 1c addi r1,r11,28
* 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;
800bfec: 59 60 00 60 sw (r11+96),r0
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
800bff0: fb ff ea 3b calli 80068dc <_CORE_semaphore_Initialize>
*the_sem = the_semaphore;
_Thread_Enable_dispatch();
return 0;
}
800bff4: 78 01 08 02 mvhi r1,0x802
800bff8: 38 21 45 64 ori r1,r1,0x4564
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
800bffc: 28 2d 00 1c lw r13,(r1+28)
800c000: 2d 61 00 0a lhu r1,(r11+10)
800c004: 34 02 00 02 mvi r2,2
800c008: fb ff d3 05 calli 8000c1c <__ashlsi3>
800c00c: b5 a1 08 00 add r1,r13,r1
800c010: 58 2b 00 00 sw (r1+0),r11
the_object
);
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
/* ASSERT: information->is_string */
the_object->name.name_p = name;
800c014: 59 6c 00 0c sw (r11+12),r12
&_POSIX_Semaphore_Information,
&the_semaphore->Object,
name
);
*the_sem = the_semaphore;
800c018: 59 eb 00 00 sw (r15+0),r11
_Thread_Enable_dispatch();
800c01c: fb ff f1 ce calli 8008754 <_Thread_Enable_dispatch>
return 0;
800c020: 34 01 00 00 mvi r1,0
}
800c024: 2b 9d 00 04 lw ra,(sp+4)
800c028: 2b 8b 00 1c lw r11,(sp+28)
800c02c: 2b 8c 00 18 lw r12,(sp+24)
800c030: 2b 8d 00 14 lw r13,(sp+20)
800c034: 2b 8e 00 10 lw r14,(sp+16)
800c038: 2b 8f 00 0c lw r15,(sp+12)
800c03c: 2b 90 00 08 lw r16,(sp+8)
800c040: 37 9c 00 20 addi sp,sp,32
800c044: c3 a0 00 00 ret
08008aa8 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>:
#include <rtems/posix/pthread.h>
void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(
Thread_Control *the_thread
)
{
8008aa8: 37 9c ff fc addi sp,sp,-4
8008aac: 5b 9d 00 04 sw (sp+4),ra
POSIX_API_Control *thread_support;
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
8008ab0: 28 22 01 1c lw r2,(r1+284)
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
8008ab4: 28 43 00 d8 lw r3,(r2+216)
8008ab8: 5c 60 00 0e bne r3,r0,8008af0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48><== NEVER TAKEN
8008abc: 28 44 00 dc lw r4,(r2+220)
8008ac0: 34 03 00 01 mvi r3,1
8008ac4: 5c 83 00 0b bne r4,r3,8008af0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48>
thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
8008ac8: 28 42 00 e0 lw r2,(r2+224)
8008acc: 44 40 00 09 be r2,r0,8008af0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48>
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
8008ad0: 78 02 08 01 mvhi r2,0x801
8008ad4: 38 42 68 e8 ori r2,r2,0x68e8
8008ad8: 28 43 00 00 lw r3,(r2+0)
--level;
8008adc: 34 63 ff ff addi r3,r3,-1
_Thread_Dispatch_disable_level = level;
8008ae0: 58 43 00 00 sw (r2+0),r3
thread_support->cancelation_requested ) {
_Thread_Unnest_dispatch();
_POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED );
8008ae4: 34 02 ff ff mvi r2,-1
8008ae8: f8 00 02 72 calli 80094b0 <_POSIX_Thread_Exit>
8008aec: e0 00 00 02 bi 8008af4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x4c>
} else
_Thread_Enable_dispatch();
8008af0: fb ff f5 42 calli 8005ff8 <_Thread_Enable_dispatch>
}
8008af4: 2b 9d 00 04 lw ra,(sp+4)
8008af8: 37 9c 00 04 addi sp,sp,4
8008afc: c3 a0 00 00 ret
0800a55c <_POSIX_Thread_Translate_sched_param>:
int policy,
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
800a55c: 37 9c ff e8 addi sp,sp,-24
800a560: 5b 8b 00 18 sw (sp+24),r11
800a564: 5b 8c 00 14 sw (sp+20),r12
800a568: 5b 8d 00 10 sw (sp+16),r13
800a56c: 5b 8e 00 0c sw (sp+12),r14
800a570: 5b 8f 00 08 sw (sp+8),r15
800a574: 5b 9d 00 04 sw (sp+4),ra
800a578: b8 20 68 00 mv r13,r1
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
800a57c: 28 41 00 00 lw r1,(r2+0)
int policy,
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
800a580: b8 40 58 00 mv r11,r2
800a584: b8 60 70 00 mv r14,r3
800a588: b8 80 78 00 mv r15,r4
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
800a58c: fb ff ff ec calli 800a53c <_POSIX_Priority_Is_valid>
return EINVAL;
800a590: 34 0c 00 16 mvi r12,22
struct sched_param *param,
Thread_CPU_budget_algorithms *budget_algorithm,
Thread_CPU_budget_algorithm_callout *budget_callout
)
{
if ( !_POSIX_Priority_Is_valid( param->sched_priority ) )
800a594: 44 20 00 2a be r1,r0,800a63c <_POSIX_Thread_Translate_sched_param+0xe0><== NEVER TAKEN
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
800a598: 59 c0 00 00 sw (r14+0),r0
*budget_callout = NULL;
800a59c: 59 e0 00 00 sw (r15+0),r0
if ( policy == SCHED_OTHER ) {
800a5a0: 5d a0 00 04 bne r13,r0,800a5b0 <_POSIX_Thread_Translate_sched_param+0x54>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
800a5a4: 34 01 00 01 mvi r1,1
800a5a8: 59 c1 00 00 sw (r14+0),r1
800a5ac: e0 00 00 23 bi 800a638 <_POSIX_Thread_Translate_sched_param+0xdc>
return 0;
}
if ( policy == SCHED_FIFO ) {
800a5b0: 34 01 00 01 mvi r1,1
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
800a5b4: 34 0c 00 00 mvi r12,0
if ( policy == SCHED_OTHER ) {
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
return 0;
}
if ( policy == SCHED_FIFO ) {
800a5b8: 45 a1 00 21 be r13,r1,800a63c <_POSIX_Thread_Translate_sched_param+0xe0>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
return 0;
}
if ( policy == SCHED_RR ) {
800a5bc: 34 01 00 02 mvi r1,2
800a5c0: 5d a1 00 03 bne r13,r1,800a5cc <_POSIX_Thread_Translate_sched_param+0x70>
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
800a5c4: 59 cd 00 00 sw (r14+0),r13
return 0;
800a5c8: e0 00 00 1d bi 800a63c <_POSIX_Thread_Translate_sched_param+0xe0>
}
if ( policy == SCHED_SPORADIC ) {
800a5cc: 34 01 00 04 mvi r1,4
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
return 0;
}
return EINVAL;
800a5d0: 34 0c 00 16 mvi r12,22
if ( policy == SCHED_RR ) {
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE;
return 0;
}
if ( policy == SCHED_SPORADIC ) {
800a5d4: 5d a1 00 1a bne r13,r1,800a63c <_POSIX_Thread_Translate_sched_param+0xe0>
if ( (param->sched_ss_repl_period.tv_sec == 0) &&
800a5d8: 29 61 00 08 lw r1,(r11+8)
800a5dc: 5c 20 00 03 bne r1,r0,800a5e8 <_POSIX_Thread_Translate_sched_param+0x8c>
800a5e0: 29 62 00 0c lw r2,(r11+12)
800a5e4: 44 41 00 16 be r2,r1,800a63c <_POSIX_Thread_Translate_sched_param+0xe0>
(param->sched_ss_repl_period.tv_nsec == 0) )
return EINVAL;
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
800a5e8: 29 61 00 10 lw r1,(r11+16)
800a5ec: 5c 20 00 04 bne r1,r0,800a5fc <_POSIX_Thread_Translate_sched_param+0xa0>
800a5f0: 29 62 00 14 lw r2,(r11+20)
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
800a5f4: 34 0c 00 16 mvi r12,22
if ( policy == SCHED_SPORADIC ) {
if ( (param->sched_ss_repl_period.tv_sec == 0) &&
(param->sched_ss_repl_period.tv_nsec == 0) )
return EINVAL;
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
800a5f8: 44 41 00 11 be r2,r1,800a63c <_POSIX_Thread_Translate_sched_param+0xe0>
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) <
800a5fc: 35 61 00 08 addi r1,r11,8
800a600: fb ff f6 39 calli 8007ee4 <_Timespec_To_ticks>
800a604: b8 20 68 00 mv r13,r1
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
800a608: 35 61 00 10 addi r1,r11,16
800a60c: fb ff f6 36 calli 8007ee4 <_Timespec_To_ticks>
return EINVAL;
800a610: 34 0c 00 16 mvi r12,22
if ( (param->sched_ss_init_budget.tv_sec == 0) &&
(param->sched_ss_init_budget.tv_nsec == 0) )
return EINVAL;
if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) <
800a614: 54 2d 00 0a bgu r1,r13,800a63c <_POSIX_Thread_Translate_sched_param+0xe0>
_Timespec_To_ticks( ¶m->sched_ss_init_budget ) )
return EINVAL;
if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) )
800a618: 29 61 00 04 lw r1,(r11+4)
800a61c: fb ff ff c8 calli 800a53c <_POSIX_Priority_Is_valid>
800a620: 44 20 00 07 be r1,r0,800a63c <_POSIX_Thread_Translate_sched_param+0xe0>
return EINVAL;
*budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT;
800a624: 34 01 00 03 mvi r1,3
800a628: 59 c1 00 00 sw (r14+0),r1
*budget_callout = _POSIX_Threads_Sporadic_budget_callout;
800a62c: 78 01 08 00 mvhi r1,0x800
800a630: 38 21 40 90 ori r1,r1,0x4090
800a634: 59 e1 00 00 sw (r15+0),r1
return 0;
800a638: 34 0c 00 00 mvi r12,0
}
return EINVAL;
}
800a63c: b9 80 08 00 mv r1,r12
800a640: 2b 9d 00 04 lw ra,(sp+4)
800a644: 2b 8b 00 18 lw r11,(sp+24)
800a648: 2b 8c 00 14 lw r12,(sp+20)
800a64c: 2b 8d 00 10 lw r13,(sp+16)
800a650: 2b 8e 00 0c lw r14,(sp+12)
800a654: 2b 8f 00 08 lw r15,(sp+8)
800a658: 37 9c 00 18 addi sp,sp,24
800a65c: c3 a0 00 00 ret
0800df24 <_POSIX_Threads_Delete_extension>:
*/
static void _POSIX_Threads_Delete_extension(
Thread_Control *executing __attribute__((unused)),
Thread_Control *deleted
)
{
800df24: 37 9c ff ec addi sp,sp,-20
800df28: 5b 8b 00 14 sw (sp+20),r11
800df2c: 5b 8c 00 10 sw (sp+16),r12
800df30: 5b 8d 00 0c sw (sp+12),r13
800df34: 5b 8e 00 08 sw (sp+8),r14
800df38: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
POSIX_API_Control *api;
void **value_ptr;
api = deleted->API_Extensions[ THREAD_API_POSIX ];
800df3c: 28 4b 01 1c lw r11,(r2+284)
/*
* Run the POSIX cancellation handlers
*/
_POSIX_Threads_cancel_run( deleted );
800df40: b8 40 08 00 mv r1,r2
*/
static void _POSIX_Threads_Delete_extension(
Thread_Control *executing __attribute__((unused)),
Thread_Control *deleted
)
{
800df44: b8 40 60 00 mv r12,r2
api = deleted->API_Extensions[ THREAD_API_POSIX ];
/*
* Run the POSIX cancellation handlers
*/
_POSIX_Threads_cancel_run( deleted );
800df48: f8 00 0c 8e calli 8011180 <_POSIX_Threads_cancel_run>
/*
* Run all the key destructors
*/
_POSIX_Keys_Run_destructors( deleted );
800df4c: b9 80 08 00 mv r1,r12
800df50: f8 00 0c af calli 801120c <_POSIX_Keys_Run_destructors>
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
800df54: 35 6d 00 44 addi r13,r11,68
_POSIX_Keys_Run_destructors( deleted );
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
800df58: 29 8e 00 28 lw r14,(r12+40)
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
800df5c: e0 00 00 03 bi 800df68 <_POSIX_Threads_Delete_extension+0x44>
*(void **)the_thread->Wait.return_argument = value_ptr;
800df60: 28 21 00 28 lw r1,(r1+40) <== NOT EXECUTED
800df64: 58 2e 00 00 sw (r1+0),r14 <== 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 )) )
800df68: b9 a0 08 00 mv r1,r13
800df6c: fb ff e7 95 calli 8007dc0 <_Thread_queue_Dequeue>
800df70: 5c 20 ff fc bne r1,r0,800df60 <_POSIX_Threads_Delete_extension+0x3c><== NEVER TAKEN
*(void **)the_thread->Wait.return_argument = value_ptr;
if ( api->schedpolicy == SCHED_SPORADIC )
800df74: 29 62 00 84 lw r2,(r11+132)
800df78: 34 01 00 04 mvi r1,4
800df7c: 5c 41 00 03 bne r2,r1,800df88 <_POSIX_Threads_Delete_extension+0x64>
(void) _Watchdog_Remove( &api->Sporadic_timer );
800df80: 35 61 00 a8 addi r1,r11,168
800df84: fb ff ea b3 calli 8008a50 <_Watchdog_Remove>
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
800df88: 59 80 01 1c sw (r12+284),r0
_Workspace_Free( api );
800df8c: b9 60 08 00 mv r1,r11
800df90: fb ff eb 3c calli 8008c80 <_Workspace_Free>
}
800df94: 2b 9d 00 04 lw ra,(sp+4)
800df98: 2b 8b 00 14 lw r11,(sp+20)
800df9c: 2b 8c 00 10 lw r12,(sp+16)
800dfa0: 2b 8d 00 0c lw r13,(sp+12)
800dfa4: 2b 8e 00 08 lw r14,(sp+8)
800dfa8: 37 9c 00 14 addi sp,sp,20
800dfac: c3 a0 00 00 ret
08003d14 <_POSIX_Threads_Initialize_user_threads_body>:
#include <rtems/posix/config.h>
#include <rtems/posix/key.h>
#include <rtems/posix/time.h>
void _POSIX_Threads_Initialize_user_threads_body(void)
{
8003d14: 37 9c ff a8 addi sp,sp,-88
8003d18: 5b 8b 00 14 sw (sp+20),r11
8003d1c: 5b 8c 00 10 sw (sp+16),r12
8003d20: 5b 8d 00 0c sw (sp+12),r13
8003d24: 5b 8e 00 08 sw (sp+8),r14
8003d28: 5b 9d 00 04 sw (sp+4),ra
uint32_t maximum;
posix_initialization_threads_table *user_threads;
pthread_t thread_id;
pthread_attr_t attr;
user_threads = Configuration_POSIX_API.User_initialization_threads_table;
8003d2c: 78 01 08 02 mvhi r1,0x802
8003d30: 38 21 00 c0 ori r1,r1,0xc0
maximum = Configuration_POSIX_API.number_of_initialization_threads;
8003d34: 28 2e 00 30 lw r14,(r1+48)
uint32_t maximum;
posix_initialization_threads_table *user_threads;
pthread_t thread_id;
pthread_attr_t attr;
user_threads = Configuration_POSIX_API.User_initialization_threads_table;
8003d38: 28 2c 00 34 lw r12,(r1+52)
maximum = Configuration_POSIX_API.number_of_initialization_threads;
if ( !user_threads || maximum == 0 )
8003d3c: 34 0d 00 00 mvi r13,0
8003d40: 65 c2 00 00 cmpei r2,r14,0
8003d44: 65 81 00 00 cmpei r1,r12,0
for ( index=0 ; index < maximum ; index++ ) {
/*
* There is no way for these calls to fail in this situation.
*/
(void) pthread_attr_init( &attr );
8003d48: 37 8b 00 18 addi r11,sp,24
pthread_attr_t attr;
user_threads = Configuration_POSIX_API.User_initialization_threads_table;
maximum = Configuration_POSIX_API.number_of_initialization_threads;
if ( !user_threads || maximum == 0 )
8003d4c: b8 41 08 00 or r1,r2,r1
8003d50: 44 20 00 16 be r1,r0,8003da8 <_POSIX_Threads_Initialize_user_threads_body+0x94><== ALWAYS TAKEN
8003d54: e0 00 00 16 bi 8003dac <_POSIX_Threads_Initialize_user_threads_body+0x98><== NOT EXECUTED
for ( index=0 ; index < maximum ; index++ ) {
/*
* There is no way for these calls to fail in this situation.
*/
(void) pthread_attr_init( &attr );
8003d58: b9 60 08 00 mv r1,r11
8003d5c: f8 00 1a 41 calli 800a660 <pthread_attr_init>
(void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
8003d60: 34 02 00 02 mvi r2,2
8003d64: b9 60 08 00 mv r1,r11
8003d68: f8 00 1a 4b calli 800a694 <pthread_attr_setinheritsched>
(void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
8003d6c: 29 82 00 04 lw r2,(r12+4)
8003d70: b9 60 08 00 mv r1,r11
8003d74: f8 00 1a 54 calli 800a6c4 <pthread_attr_setstacksize>
status = pthread_create(
8003d78: 29 83 00 00 lw r3,(r12+0)
8003d7c: 37 81 00 58 addi r1,sp,88
8003d80: b9 60 10 00 mv r2,r11
8003d84: 34 04 00 00 mvi r4,0
8003d88: fb ff fe cd calli 80038bc <pthread_create>
8003d8c: b8 20 18 00 mv r3,r1
8003d90: 35 8c 00 08 addi r12,r12,8
&thread_id,
&attr,
user_threads[ index ].thread_entry,
NULL
);
if ( status )
8003d94: 44 20 00 04 be r1,r0,8003da4 <_POSIX_Threads_Initialize_user_threads_body+0x90>
_Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
8003d98: 34 01 00 02 mvi r1,2
8003d9c: 34 02 00 01 mvi r2,1
8003da0: f8 00 07 3f calli 8005a9c <_Internal_error_Occurred>
*
* Setting the attributes explicitly is critical, since we don't want
* to inherit the idle tasks attributes.
*/
for ( index=0 ; index < maximum ; index++ ) {
8003da4: 35 ad 00 01 addi r13,r13,1
8003da8: 55 cd ff ec bgu r14,r13,8003d58 <_POSIX_Threads_Initialize_user_threads_body+0x44>
NULL
);
if ( status )
_Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status );
}
}
8003dac: 2b 9d 00 04 lw ra,(sp+4)
8003db0: 2b 8b 00 14 lw r11,(sp+20)
8003db4: 2b 8c 00 10 lw r12,(sp+16)
8003db8: 2b 8d 00 0c lw r13,(sp+12)
8003dbc: 2b 8e 00 08 lw r14,(sp+8)
8003dc0: 37 9c 00 58 addi sp,sp,88
8003dc4: c3 a0 00 00 ret
0800e0fc <_POSIX_Threads_Sporadic_budget_TSR>:
*/
void _POSIX_Threads_Sporadic_budget_TSR(
Objects_Id id __attribute__((unused)),
void *argument
)
{
800e0fc: 37 9c ff f4 addi sp,sp,-12
800e100: 5b 8b 00 0c sw (sp+12),r11
800e104: 5b 8c 00 08 sw (sp+8),r12
800e108: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
POSIX_API_Control *api;
the_thread = argument;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
800e10c: 28 4c 01 1c lw r12,(r2+284)
*/
void _POSIX_Threads_Sporadic_budget_TSR(
Objects_Id id __attribute__((unused)),
void *argument
)
{
800e110: b8 40 58 00 mv r11,r2
the_thread = argument;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget );
800e114: 35 81 00 98 addi r1,r12,152
800e118: f8 00 07 b0 calli 800ffd8 <_Timespec_To_ticks>
the_thread->cpu_time_budget = ticks;
800e11c: 59 61 00 74 sw (r11+116),r1
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
800e120: 78 01 08 01 mvhi r1,0x801
800e124: 38 21 a0 c0 ori r1,r1,0xa0c0
800e128: 40 21 00 00 lbu r1,(r1+0)
800e12c: 29 82 00 88 lw r2,(r12+136)
800e130: c8 22 10 00 sub r2,r1,r2
*/
#if 0
printk( "TSR %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
800e134: 29 61 00 1c lw r1,(r11+28)
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget );
the_thread->cpu_time_budget = ticks;
new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority );
the_thread->real_priority = new_priority;
800e138: 59 62 00 18 sw (r11+24),r2
*/
#if 0
printk( "TSR %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
800e13c: 5c 20 00 06 bne r1,r0,800e154 <_POSIX_Threads_Sporadic_budget_TSR+0x58><== NEVER TAKEN
/*
* If this would make them less important, then do not change it.
*/
if ( the_thread->current_priority > new_priority ) {
800e140: 29 61 00 14 lw r1,(r11+20)
800e144: 50 41 00 04 bgeu r2,r1,800e154 <_POSIX_Threads_Sporadic_budget_TSR+0x58>
_Thread_Change_priority( the_thread, new_priority, true );
800e148: b9 60 08 00 mv r1,r11
800e14c: 34 03 00 01 mvi r3,1
800e150: fb ff e5 98 calli 80077b0 <_Thread_Change_priority>
#endif
}
}
/* ticks is guaranteed to be at least one */
ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period );
800e154: 35 81 00 90 addi r1,r12,144
800e158: f8 00 07 a0 calli 800ffd8 <_Timespec_To_ticks>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
800e15c: 59 81 00 b4 sw (r12+180),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
800e160: 78 01 08 01 mvhi r1,0x801
800e164: 38 21 aa 10 ori r1,r1,0xaa10
800e168: 35 82 00 a8 addi r2,r12,168
800e16c: fb ff e9 dc calli 80088dc <_Watchdog_Insert>
_Watchdog_Insert_ticks( &api->Sporadic_timer, ticks );
}
800e170: 2b 9d 00 04 lw ra,(sp+4)
800e174: 2b 8b 00 0c lw r11,(sp+12)
800e178: 2b 8c 00 08 lw r12,(sp+8)
800e17c: 37 9c 00 0c addi sp,sp,12
800e180: c3 a0 00 00 ret
0800e184 <_POSIX_Threads_Sporadic_budget_callout>:
* _POSIX_Threads_Sporadic_budget_callout
*/
void _POSIX_Threads_Sporadic_budget_callout(
Thread_Control *the_thread
)
{
800e184: 37 9c ff fc addi sp,sp,-4
800e188: 5b 9d 00 04 sw (sp+4),ra
/*
* This will prevent the thread from consuming its entire "budget"
* while at low priority.
*/
the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */
800e18c: 34 02 ff ff mvi r2,-1
)
{
POSIX_API_Control *api;
uint32_t new_priority;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
800e190: 28 25 01 1c lw r5,(r1+284)
/*
* This will prevent the thread from consuming its entire "budget"
* while at low priority.
*/
the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */
800e194: 58 22 00 74 sw (r1+116),r2
800e198: 78 02 08 01 mvhi r2,0x801
800e19c: 38 42 a0 c0 ori r2,r2,0xa0c0
800e1a0: 40 44 00 00 lbu r4,(r2+0)
800e1a4: 28 a2 00 8c lw r2,(r5+140)
800e1a8: c8 82 10 00 sub r2,r4,r2
*/
#if 0
printk( "callout %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
800e1ac: 28 24 00 1c lw r4,(r1+28)
* while at low priority.
*/
the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */
new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority);
the_thread->real_priority = new_priority;
800e1b0: 58 22 00 18 sw (r1+24),r2
*/
#if 0
printk( "callout %d %d %d\n", the_thread->resource_count,
the_thread->current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
800e1b4: 5c 80 00 05 bne r4,r0,800e1c8 <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN
/*
* Make sure we are actually lowering it. If they have lowered it
* to logically lower than sched_ss_low_priority, then we do not want to
* change it.
*/
if ( the_thread->current_priority < new_priority ) {
800e1b8: 28 23 00 14 lw r3,(r1+20)
800e1bc: 50 62 00 03 bgeu r3,r2,800e1c8 <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN
_Thread_Change_priority( the_thread, new_priority, true );
800e1c0: 34 03 00 01 mvi r3,1
800e1c4: fb ff e5 7b calli 80077b0 <_Thread_Change_priority>
#if 0
printk( "lower priority\n" );
#endif
}
}
}
800e1c8: 2b 9d 00 04 lw ra,(sp+4)
800e1cc: 37 9c 00 04 addi sp,sp,4
800e1d0: c3 a0 00 00 ret
08003a24 <_POSIX_Timer_TSR>:
* This is the operation that is run when a timer expires
*/
void _POSIX_Timer_TSR(
Objects_Id timer __attribute__((unused)),
void *data)
{
8003a24: 37 9c ff e8 addi sp,sp,-24
8003a28: 5b 8b 00 10 sw (sp+16),r11
8003a2c: 5b 8c 00 0c sw (sp+12),r12
8003a30: 5b 8d 00 08 sw (sp+8),r13
8003a34: 5b 9d 00 04 sw (sp+4),ra
bool activated;
ptimer = (POSIX_Timer_Control *)data;
/* Increment the number of expirations. */
ptimer->overrun = ptimer->overrun + 1;
8003a38: 28 41 00 68 lw r1,(r2+104)
* This is the operation that is run when a timer expires
*/
void _POSIX_Timer_TSR(
Objects_Id timer __attribute__((unused)),
void *data)
{
8003a3c: b8 40 58 00 mv r11,r2
bool activated;
ptimer = (POSIX_Timer_Control *)data;
/* Increment the number of expirations. */
ptimer->overrun = ptimer->overrun + 1;
8003a40: 34 21 00 01 addi r1,r1,1
8003a44: 58 41 00 68 sw (r2+104),r1
/* The timer must be reprogrammed */
if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) ||
8003a48: 28 41 00 54 lw r1,(r2+84)
8003a4c: 5c 20 00 03 bne r1,r0,8003a58 <_POSIX_Timer_TSR+0x34>
8003a50: 28 42 00 58 lw r2,(r2+88)
8003a54: 44 41 00 21 be r2,r1,8003ad8 <_POSIX_Timer_TSR+0xb4> <== NEVER TAKEN
( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) {
activated = _POSIX_Timer_Insert_helper(
8003a58: 29 62 00 64 lw r2,(r11+100)
8003a5c: 29 63 00 08 lw r3,(r11+8)
8003a60: 78 04 08 00 mvhi r4,0x800
8003a64: 35 61 00 10 addi r1,r11,16
8003a68: 38 84 3a 24 ori r4,r4,0x3a24
8003a6c: b9 60 28 00 mv r5,r11
8003a70: f8 00 19 91 calli 800a0b4 <_POSIX_Timer_Insert_helper>
ptimer->ticks,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated )
8003a74: 44 20 00 1f be r1,r0,8003af0 <_POSIX_Timer_TSR+0xcc> <== NEVER TAKEN
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
tod_as_timestamp_ptr =
8003a78: 78 02 08 02 mvhi r2,0x802
8003a7c: 38 42 08 c8 ori r2,r2,0x8c8
8003a80: 37 81 00 14 addi r1,sp,20
8003a84: f8 00 04 c0 calli 8004d84 <_TOD_Get_with_nanoseconds>
static inline void _Timestamp64_implementation_To_timespec(
const Timestamp64_Control *_timestamp,
struct timespec *_timespec
)
{
_timespec->tv_sec = (time_t) (*_timestamp / 1000000000L);
8003a88: 78 05 08 01 mvhi r5,0x801
/* After the signal handler returns, the count of expirations of the
* timer must be set to 0.
*/
ptimer->overrun = 0;
}
8003a8c: 28 2c 00 04 lw r12,(r1+4)
8003a90: 28 2d 00 00 lw r13,(r1+0)
8003a94: 38 a5 dd 38 ori r5,r5,0xdd38
8003a98: 28 a4 00 00 lw r4,(r5+0)
8003a9c: 34 03 00 00 mvi r3,0
8003aa0: b9 a0 08 00 mv r1,r13
8003aa4: b9 80 10 00 mv r2,r12
8003aa8: f8 00 4d 3b calli 8016f94 <__divdi3>
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
8003aac: 78 05 08 01 mvhi r5,0x801
8003ab0: 38 a5 dd 38 ori r5,r5,0xdd38
8003ab4: 28 a4 00 00 lw r4,(r5+0)
static inline void _Timestamp64_implementation_To_timespec(
const Timestamp64_Control *_timestamp,
struct timespec *_timespec
)
{
_timespec->tv_sec = (time_t) (*_timestamp / 1000000000L);
8003ab8: 59 62 00 6c sw (r11+108),r2
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
8003abc: b9 a0 08 00 mv r1,r13
8003ac0: b9 80 10 00 mv r2,r12
8003ac4: 34 03 00 00 mvi r3,0
8003ac8: f8 00 4f 35 calli 801779c <__moddi3>
8003acc: 59 62 00 70 sw (r11+112),r2
/* Store the time when the timer was started again */
_TOD_Get( &ptimer->time );
/* The state really did not change but just to be safe */
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
8003ad0: 34 01 00 03 mvi r1,3
8003ad4: e0 00 00 02 bi 8003adc <_POSIX_Timer_TSR+0xb8>
} else {
/* Indicates that the timer is stopped */
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
8003ad8: 34 01 00 04 mvi r1,4 <== NOT EXECUTED
8003adc: 31 61 00 3c sb (r11+60),r1
/*
* The sending of the signal to the process running the handling function
* specified for that signal is simulated
*/
if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) {
8003ae0: 29 62 00 44 lw r2,(r11+68)
8003ae4: 29 61 00 38 lw r1,(r11+56)
8003ae8: f8 00 18 26 calli 8009b80 <pthread_kill>
}
/* After the signal handler returns, the count of expirations of the
* timer must be set to 0.
*/
ptimer->overrun = 0;
8003aec: 59 60 00 68 sw (r11+104),r0
}
8003af0: 2b 9d 00 04 lw ra,(sp+4)
8003af4: 2b 8b 00 10 lw r11,(sp+16)
8003af8: 2b 8c 00 0c lw r12,(sp+12)
8003afc: 2b 8d 00 08 lw r13,(sp+8)
8003b00: 37 9c 00 18 addi sp,sp,24
8003b04: c3 a0 00 00 ret
08011304 <_POSIX_signals_Check_signal>:
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
8011304: 37 9c ff b0 addi sp,sp,-80
8011308: 5b 8b 00 1c sw (sp+28),r11
801130c: 5b 8c 00 18 sw (sp+24),r12
8011310: 5b 8d 00 14 sw (sp+20),r13
8011314: 5b 8e 00 10 sw (sp+16),r14
8011318: 5b 8f 00 0c sw (sp+12),r15
801131c: 5b 90 00 08 sw (sp+8),r16
8011320: 5b 9d 00 04 sw (sp+4),ra
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
8011324: 37 90 00 48 addi r16,sp,72
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
8011328: 20 64 00 ff andi r4,r3,0xff
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
801132c: 34 05 00 01 mvi r5,1
8011330: ba 00 18 00 mv r3,r16
bool _POSIX_signals_Check_signal(
POSIX_API_Control *api,
int signo,
bool is_global
)
{
8011334: b8 20 68 00 mv r13,r1
8011338: b8 40 58 00 mv r11,r2
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
801133c: f8 00 00 37 calli 8011418 <_POSIX_signals_Clear_signals>
is_global, true ) )
return false;
8011340: 34 0f 00 00 mvi r15,0
{
siginfo_t siginfo_struct;
sigset_t saved_signals_blocked;
Thread_Wait_information stored_thread_wait_information;
if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct,
8011344: 44 20 00 2b be r1,r0,80113f0 <_POSIX_signals_Check_signal+0xec>
#endif
/*
* Just to prevent sending a signal which is currently being ignored.
*/
if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN )
8011348: 34 02 00 01 mvi r2,1
801134c: b9 60 08 00 mv r1,r11
8011350: f8 00 19 7c calli 8017940 <__ashlsi3>
8011354: 78 0c 08 01 mvhi r12,0x801
8011358: b4 2b 08 00 add r1,r1,r11
801135c: 34 02 00 02 mvi r2,2
8011360: f8 00 19 78 calli 8017940 <__ashlsi3>
8011364: 39 8c ae 88 ori r12,r12,0xae88
8011368: b5 81 60 00 add r12,r12,r1
801136c: 29 8e 00 08 lw r14,(r12+8)
8011370: 34 01 00 01 mvi r1,1
8011374: 45 c1 00 1f be r14,r1,80113f0 <_POSIX_signals_Check_signal+0xec><== NEVER TAKEN
return false;
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
8011378: 29 af 00 d0 lw r15,(r13+208)
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
801137c: 29 81 00 04 lw r1,(r12+4)
/*
* We have to save the blocking information of the current wait queue
* because the signal handler may subsequently go on and put the thread
* on a wait queue, for its own purposes.
*/
memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait,
8011380: 34 03 00 28 mvi r3,40
/*
* Block the signals requested in sa_mask
*/
saved_signals_blocked = api->signals_blocked;
api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask;
8011384: b8 2f 08 00 or r1,r1,r15
8011388: 59 a1 00 d0 sw (r13+208),r1
/*
* We have to save the blocking information of the current wait queue
* because the signal handler may subsequently go on and put the thread
* on a wait queue, for its own purposes.
*/
memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait,
801138c: 78 01 08 01 mvhi r1,0x801
8011390: 38 21 ae 00 ori r1,r1,0xae00
8011394: 28 22 00 10 lw r2,(r1+16)
8011398: 37 81 00 20 addi r1,sp,32
801139c: 34 42 00 20 addi r2,r2,32
80113a0: f8 00 05 23 calli 801282c <memcpy>
sizeof( Thread_Wait_information ));
/*
* Here, the signal handler function executes
*/
switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) {
80113a4: 29 82 00 00 lw r2,(r12+0)
80113a8: 34 01 00 02 mvi r1,2
80113ac: 5c 41 00 06 bne r2,r1,80113c4 <_POSIX_signals_Check_signal+0xc0>
case SA_SIGINFO:
(*_POSIX_signals_Vectors[ signo ].sa_sigaction)(
80113b0: b9 60 08 00 mv r1,r11
80113b4: ba 00 10 00 mv r2,r16
80113b8: 34 03 00 00 mvi r3,0
80113bc: d9 c0 00 00 call r14
signo,
&siginfo_struct,
NULL /* context is undefined per 1003.1b-1993, p. 66 */
);
break;
80113c0: e0 00 00 03 bi 80113cc <_POSIX_signals_Check_signal+0xc8>
default:
(*_POSIX_signals_Vectors[ signo ].sa_handler)( signo );
80113c4: b9 60 08 00 mv r1,r11
80113c8: d9 c0 00 00 call r14
}
/*
* Restore the blocking information
*/
memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information,
80113cc: 78 01 08 01 mvhi r1,0x801
80113d0: 38 21 ae 00 ori r1,r1,0xae00
80113d4: 28 21 00 10 lw r1,(r1+16)
80113d8: 37 82 00 20 addi r2,sp,32
80113dc: 34 03 00 28 mvi r3,40
80113e0: 34 21 00 20 addi r1,r1,32
80113e4: f8 00 05 12 calli 801282c <memcpy>
sizeof( Thread_Wait_information ));
/*
* Restore the previous set of blocked signals
*/
api->signals_blocked = saved_signals_blocked;
80113e8: 59 af 00 d0 sw (r13+208),r15
return true;
80113ec: 34 0f 00 01 mvi r15,1
}
80113f0: b9 e0 08 00 mv r1,r15
80113f4: 2b 9d 00 04 lw ra,(sp+4)
80113f8: 2b 8b 00 1c lw r11,(sp+28)
80113fc: 2b 8c 00 18 lw r12,(sp+24)
8011400: 2b 8d 00 14 lw r13,(sp+20)
8011404: 2b 8e 00 10 lw r14,(sp+16)
8011408: 2b 8f 00 0c lw r15,(sp+12)
801140c: 2b 90 00 08 lw r16,(sp+8)
8011410: 37 9c 00 50 addi sp,sp,80
8011414: c3 a0 00 00 ret
08011b64 <_POSIX_signals_Clear_process_signals>:
*/
void _POSIX_signals_Clear_process_signals(
int signo
)
{
8011b64: 37 9c ff ec addi sp,sp,-20
8011b68: 5b 8b 00 14 sw (sp+20),r11
8011b6c: 5b 8c 00 10 sw (sp+16),r12
8011b70: 5b 8d 00 0c sw (sp+12),r13
8011b74: 5b 8e 00 08 sw (sp+8),r14
8011b78: 5b 9d 00 04 sw (sp+4),ra
8011b7c: b8 20 60 00 mv r12,r1
clear_signal = true;
mask = signo_to_mask( signo );
ISR_Level level;
_ISR_Disable( level );
8011b80: 90 00 68 00 rcsr r13,IE
8011b84: 34 01 ff fe mvi r1,-2
8011b88: a1 a1 08 00 and r1,r13,r1
8011b8c: d0 01 00 00 wcsr IE,r1
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
8011b90: 34 02 00 01 mvi r2,1
8011b94: b9 80 08 00 mv r1,r12
8011b98: f8 00 17 6a calli 8017940 <__ashlsi3>
8011b9c: b4 2c 70 00 add r14,r1,r12
8011ba0: 34 02 00 02 mvi r2,2
8011ba4: 78 0b 08 01 mvhi r11,0x801
8011ba8: b9 c0 08 00 mv r1,r14
8011bac: f8 00 17 65 calli 8017940 <__ashlsi3>
8011bb0: 39 6b ae 88 ori r11,r11,0xae88
8011bb4: b5 61 08 00 add r1,r11,r1
8011bb8: 28 22 00 00 lw r2,(r1+0)
8011bbc: 34 01 00 02 mvi r1,2
8011bc0: 5c 41 00 0a bne r2,r1,8011be8 <_POSIX_signals_Clear_process_signals+0x84>
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
}
_ISR_Enable( level );
}
8011bc4: 34 02 00 02 mvi r2,2
8011bc8: 78 0b 08 01 mvhi r11,0x801
8011bcc: b9 c0 08 00 mv r1,r14
8011bd0: f8 00 17 5c calli 8017940 <__ashlsi3>
8011bd4: 39 6b b0 80 ori r11,r11,0xb080
8011bd8: b5 61 08 00 add r1,r11,r1
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
8011bdc: 34 22 00 04 addi r2,r1,4
ISR_Level level;
_ISR_Disable( level );
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
8011be0: 28 21 00 00 lw r1,(r1+0)
8011be4: 5c 22 00 0a bne r1,r2,8011c0c <_POSIX_signals_Clear_process_signals+0xa8><== NEVER TAKEN
8011be8: 35 82 ff ff addi r2,r12,-1
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
8011bec: 78 0b 08 01 mvhi r11,0x801
8011bf0: 34 01 00 01 mvi r1,1
8011bf4: f8 00 17 53 calli 8017940 <__ashlsi3>
8011bf8: 39 6b b0 7c ori r11,r11,0xb07c
8011bfc: 29 62 00 00 lw r2,(r11+0)
8011c00: a4 20 08 00 not r1,r1
8011c04: a0 22 08 00 and r1,r1,r2
8011c08: 59 61 00 00 sw (r11+0),r1
}
_ISR_Enable( level );
8011c0c: d0 0d 00 00 wcsr IE,r13
}
8011c10: 2b 9d 00 04 lw ra,(sp+4)
8011c14: 2b 8b 00 14 lw r11,(sp+20)
8011c18: 2b 8c 00 10 lw r12,(sp+16)
8011c1c: 2b 8d 00 0c lw r13,(sp+12)
8011c20: 2b 8e 00 08 lw r14,(sp+8)
8011c24: 37 9c 00 14 addi sp,sp,20
8011c28: c3 a0 00 00 ret
0800473c <_POSIX_signals_Get_lowest>:
#include <rtems/score/isr.h>
static int _POSIX_signals_Get_lowest(
sigset_t set
)
{
800473c: 37 9c ff f0 addi sp,sp,-16
8004740: 5b 8b 00 10 sw (sp+16),r11
8004744: 5b 8c 00 0c sw (sp+12),r12
8004748: 5b 8d 00 08 sw (sp+8),r13
800474c: 5b 9d 00 04 sw (sp+4),ra
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
8004750: 34 0b 00 1b mvi r11,27
#include <rtems/score/isr.h>
static int _POSIX_signals_Get_lowest(
sigset_t set
)
{
8004754: b8 20 60 00 mv r12,r1
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
8004758: 34 0d 00 20 mvi r13,32
800475c: 34 01 00 01 mvi r1,1
8004760: 35 62 ff ff addi r2,r11,-1
8004764: f8 00 46 45 calli 8016078 <__ashlsi3>
if ( set & signo_to_mask( signo ) ) {
8004768: a0 2c 08 00 and r1,r1,r12
800476c: 5c 20 00 0c bne r1,r0,800479c <_POSIX_signals_Get_lowest+0x60><== NEVER TAKEN
sigset_t set
)
{
int signo;
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
8004770: 35 6b 00 01 addi r11,r11,1
8004774: 5d 6d ff fa bne r11,r13,800475c <_POSIX_signals_Get_lowest+0x20>
8004778: 34 0b 00 01 mvi r11,1
*/
#if (SIGHUP != 1)
#error "Assumption that SIGHUP==1 violated!!"
#endif
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
800477c: 34 0d 00 1b mvi r13,27
8004780: 34 01 00 01 mvi r1,1
8004784: 35 62 ff ff addi r2,r11,-1
8004788: f8 00 46 3c calli 8016078 <__ashlsi3>
if ( set & signo_to_mask( signo ) ) {
800478c: a0 2c 08 00 and r1,r1,r12
8004790: 5c 20 00 03 bne r1,r0,800479c <_POSIX_signals_Get_lowest+0x60>
*/
#if (SIGHUP != 1)
#error "Assumption that SIGHUP==1 violated!!"
#endif
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
8004794: 35 6b 00 01 addi r11,r11,1
8004798: 5d 6d ff fa bne r11,r13,8004780 <_POSIX_signals_Get_lowest+0x44><== ALWAYS TAKEN
* a return 0. This routine will NOT be called unless a signal
* is pending in the set passed in.
*/
found_it:
return signo;
}
800479c: b9 60 08 00 mv r1,r11
80047a0: 2b 9d 00 04 lw ra,(sp+4)
80047a4: 2b 8b 00 10 lw r11,(sp+16)
80047a8: 2b 8c 00 0c lw r12,(sp+12)
80047ac: 2b 8d 00 08 lw r13,(sp+8)
80047b0: 37 9c 00 10 addi sp,sp,16
80047b4: c3 a0 00 00 ret
0800dae0 <_POSIX_signals_Post_switch_hook>:
*/
static void _POSIX_signals_Post_switch_hook(
Thread_Control *the_thread
)
{
800dae0: 37 9c ff e0 addi sp,sp,-32
800dae4: 5b 8b 00 20 sw (sp+32),r11
800dae8: 5b 8c 00 1c sw (sp+28),r12
800daec: 5b 8d 00 18 sw (sp+24),r13
800daf0: 5b 8e 00 14 sw (sp+20),r14
800daf4: 5b 8f 00 10 sw (sp+16),r15
800daf8: 5b 90 00 0c sw (sp+12),r16
800dafc: 5b 91 00 08 sw (sp+8),r17
800db00: 5b 9d 00 04 sw (sp+4),ra
POSIX_API_Control *api;
int signo;
ISR_Level level;
int hold_errno;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
800db04: 28 2b 01 1c lw r11,(r1+284)
/*
* We need to ensure that if the signal handler executes a call
* which overwrites the unblocking status, we restore it.
*/
hold_errno = _Thread_Executing->Wait.return_code;
800db08: 78 01 08 01 mvhi r1,0x801
800db0c: 38 21 ae 00 ori r1,r1,0xae00
800db10: 28 21 00 10 lw r1,(r1+16)
800db14: 28 2e 00 34 lw r14,(r1+52)
/*
* api may be NULL in case of a thread close in progress
*/
if ( !api )
800db18: 45 60 00 2e be r11,r0,800dbd0 <_POSIX_signals_Post_switch_hook+0xf0><== NEVER TAKEN
* processed at all. No point in doing this loop otherwise.
*/
while (1) {
_ISR_Disable( level );
if ( !(~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending)) ) {
800db1c: 78 0d 08 01 mvhi r13,0x801
*
* The first thing done is to check there are any signals to be
* processed at all. No point in doing this loop otherwise.
*/
while (1) {
_ISR_Disable( level );
800db20: 34 11 ff fe mvi r17,-2
if ( !(~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending)) ) {
800db24: 39 ad b0 7c ori r13,r13,0xb07c
_ISR_Enable( level );
break;
}
_ISR_Enable( level );
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
800db28: 34 10 00 1b mvi r16,27
800db2c: 34 0f 00 20 mvi r15,32
*
* The first thing done is to check there are any signals to be
* processed at all. No point in doing this loop otherwise.
*/
while (1) {
_ISR_Disable( level );
800db30: 90 00 08 00 rcsr r1,IE
800db34: a0 31 10 00 and r2,r1,r17
800db38: d0 02 00 00 wcsr IE,r2
if ( !(~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending)) ) {
800db3c: 29 a3 00 00 lw r3,(r13+0)
800db40: 29 62 00 d4 lw r2,(r11+212)
800db44: b8 62 10 00 or r2,r3,r2
* The first thing done is to check there are any signals to be
* processed at all. No point in doing this loop otherwise.
*/
while (1) {
_ISR_Disable( level );
if ( !(~api->signals_blocked &
800db48: 29 63 00 d0 lw r3,(r11+208)
800db4c: a4 60 18 00 not r3,r3
800db50: a0 43 10 00 and r2,r2,r3
800db54: 5c 40 00 07 bne r2,r0,800db70 <_POSIX_signals_Post_switch_hook+0x90>
(api->signals_pending | _POSIX_signals_Pending)) ) {
_ISR_Enable( level );
800db58: d0 01 00 00 wcsr IE,r1
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
}
}
_Thread_Executing->Wait.return_code = hold_errno;
800db5c: 78 01 08 01 mvhi r1,0x801
800db60: 38 21 ae 00 ori r1,r1,0xae00
800db64: 28 21 00 10 lw r1,(r1+16)
800db68: 58 2e 00 34 sw (r1+52),r14
800db6c: e0 00 00 19 bi 800dbd0 <_POSIX_signals_Post_switch_hook+0xf0>
if ( !(~api->signals_blocked &
(api->signals_pending | _POSIX_signals_Pending)) ) {
_ISR_Enable( level );
break;
}
_ISR_Enable( level );
800db70: d0 01 00 00 wcsr IE,r1
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
800db74: 34 0c 00 1b mvi r12,27
_POSIX_signals_Check_signal( api, signo, false );
800db78: b9 80 10 00 mv r2,r12
800db7c: 34 03 00 00 mvi r3,0
800db80: b9 60 08 00 mv r1,r11
800db84: f8 00 0d e0 calli 8011304 <_POSIX_signals_Check_signal>
_POSIX_signals_Check_signal( api, signo, true );
800db88: b9 80 10 00 mv r2,r12
800db8c: b9 60 08 00 mv r1,r11
800db90: 34 03 00 01 mvi r3,1
_ISR_Enable( level );
break;
}
_ISR_Enable( level );
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
800db94: 35 8c 00 01 addi r12,r12,1
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
800db98: f8 00 0d db calli 8011304 <_POSIX_signals_Check_signal>
_ISR_Enable( level );
break;
}
_ISR_Enable( level );
for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) {
800db9c: 5d 8f ff f7 bne r12,r15,800db78 <_POSIX_signals_Post_switch_hook+0x98>
800dba0: 34 0c 00 01 mvi r12,1
_POSIX_signals_Check_signal( api, signo, true );
}
/* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
_POSIX_signals_Check_signal( api, signo, false );
800dba4: b9 80 10 00 mv r2,r12
800dba8: 34 03 00 00 mvi r3,0
800dbac: b9 60 08 00 mv r1,r11
800dbb0: f8 00 0d d5 calli 8011304 <_POSIX_signals_Check_signal>
_POSIX_signals_Check_signal( api, signo, true );
800dbb4: b9 80 10 00 mv r2,r12
800dbb8: b9 60 08 00 mv r1,r11
800dbbc: 34 03 00 01 mvi r3,1
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
}
/* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
800dbc0: 35 8c 00 01 addi r12,r12,1
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
800dbc4: f8 00 0d d0 calli 8011304 <_POSIX_signals_Check_signal>
_POSIX_signals_Check_signal( api, signo, false );
_POSIX_signals_Check_signal( api, signo, true );
}
/* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */
for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) {
800dbc8: 5d 90 ff f7 bne r12,r16,800dba4 <_POSIX_signals_Post_switch_hook+0xc4>
800dbcc: e3 ff ff d9 bi 800db30 <_POSIX_signals_Post_switch_hook+0x50>
_POSIX_signals_Check_signal( api, signo, true );
}
}
_Thread_Executing->Wait.return_code = hold_errno;
}
800dbd0: 2b 9d 00 04 lw ra,(sp+4)
800dbd4: 2b 8b 00 20 lw r11,(sp+32)
800dbd8: 2b 8c 00 1c lw r12,(sp+28)
800dbdc: 2b 8d 00 18 lw r13,(sp+24)
800dbe0: 2b 8e 00 14 lw r14,(sp+20)
800dbe4: 2b 8f 00 10 lw r15,(sp+16)
800dbe8: 2b 90 00 0c lw r16,(sp+12)
800dbec: 2b 91 00 08 lw r17,(sp+8)
800dbf0: 37 9c 00 20 addi sp,sp,32
800dbf4: c3 a0 00 00 ret
0802615c <_POSIX_signals_Unblock_thread>:
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
802615c: 37 9c ff ec addi sp,sp,-20
8026160: 5b 8b 00 14 sw (sp+20),r11
8026164: 5b 8c 00 10 sw (sp+16),r12
8026168: 5b 8d 00 0c sw (sp+12),r13
802616c: 5b 8e 00 08 sw (sp+8),r14
8026170: 5b 9d 00 04 sw (sp+4),ra
8026174: b8 20 58 00 mv r11,r1
8026178: b8 40 70 00 mv r14,r2
POSIX_API_Control *api;
sigset_t mask;
siginfo_t *the_info = NULL;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
802617c: 28 2c 01 1c lw r12,(r1+284)
8026180: 34 42 ff ff addi r2,r2,-1
8026184: 34 01 00 01 mvi r1,1
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
8026188: b8 60 68 00 mv r13,r3
802618c: fb ff 6f 28 calli 8001e2c <__ashlsi3>
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
8026190: 78 03 08 02 mvhi r3,0x802
8026194: 38 63 7a 20 ori r3,r3,0x7a20
8026198: 29 64 00 10 lw r4,(r11+16)
802619c: 28 62 00 00 lw r2,(r3+0)
80261a0: a0 82 18 00 and r3,r4,r2
80261a4: 5c 62 00 1c bne r3,r2,8026214 <_POSIX_signals_Unblock_thread+0xb8>
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
80261a8: 29 62 00 30 lw r2,(r11+48)
80261ac: a0 22 10 00 and r2,r1,r2
80261b0: 5c 40 00 06 bne r2,r0,80261c8 <_POSIX_signals_Unblock_thread+0x6c>
80261b4: 29 82 00 d0 lw r2,(r12+208)
/*
* This should only be reached via pthread_kill().
*/
return false;
80261b8: 34 0c 00 00 mvi r12,0
* 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) ) {
80261bc: a4 40 10 00 not r2,r2
80261c0: a0 22 08 00 and r1,r1,r2
80261c4: 44 2c 00 39 be r1,r12,80262a8 <_POSIX_signals_Unblock_thread+0x14c>
the_thread->Wait.return_code = EINTR;
80261c8: 34 01 00 04 mvi r1,4
80261cc: 59 61 00 34 sw (r11+52),r1
the_info = (siginfo_t *) the_thread->Wait.return_argument;
80261d0: 29 61 00 28 lw r1,(r11+40)
if ( !info ) {
80261d4: 5d a0 00 06 bne r13,r0,80261ec <_POSIX_signals_Unblock_thread+0x90>
the_info->si_signo = signo;
the_info->si_code = SI_USER;
80261d8: 34 02 00 01 mvi r2,1
the_thread->Wait.return_code = EINTR;
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
the_info->si_signo = signo;
80261dc: 58 2e 00 00 sw (r1+0),r14
the_info->si_code = SI_USER;
80261e0: 58 22 00 04 sw (r1+4),r2
the_info->si_value.sival_int = 0;
80261e4: 58 20 00 08 sw (r1+8),r0
80261e8: e0 00 00 07 bi 8026204 <_POSIX_signals_Unblock_thread+0xa8>
} else {
*the_info = *info;
80261ec: 29 a3 00 00 lw r3,(r13+0)
80261f0: 29 a2 00 04 lw r2,(r13+4)
80261f4: 29 a4 00 08 lw r4,(r13+8)
80261f8: 58 23 00 00 sw (r1+0),r3
80261fc: 58 22 00 04 sw (r1+4),r2
8026200: 58 24 00 08 sw (r1+8),r4
}
_Thread_queue_Extract_with_proxy( the_thread );
8026204: b9 60 08 00 mv r1,r11
8026208: fb ff 9c 93 calli 800d454 <_Thread_queue_Extract_with_proxy>
return true;
802620c: 34 0c 00 01 mvi r12,1
8026210: e0 00 00 26 bi 80262a8 <_POSIX_signals_Unblock_thread+0x14c>
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
8026214: 29 82 00 d0 lw r2,(r12+208)
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
8026218: 34 0c 00 00 mvi r12,0
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
802621c: a4 40 10 00 not r2,r2
8026220: a0 22 08 00 and r1,r1,r2
8026224: 44 20 00 21 be r1,r0,80262a8 <_POSIX_signals_Unblock_thread+0x14c>
8026228: 78 01 10 00 mvhi r1,0x1000
802622c: a0 81 08 00 and r1,r4,r1
* 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 ) ) {
8026230: 44 20 00 15 be r1,r0,8026284 <_POSIX_signals_Unblock_thread+0x128>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
8026234: 78 02 08 02 mvhi r2,0x802
the_thread->Wait.return_code = EINTR;
8026238: 34 01 00 04 mvi r1,4
802623c: 38 42 77 dc ori r2,r2,0x77dc
8026240: 59 61 00 34 sw (r11+52),r1
8026244: 28 41 00 00 lw r1,(r2+0)
8026248: a0 81 08 00 and r1,r4,r1
/*
* 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) )
802624c: 44 20 00 04 be r1,r0,802625c <_POSIX_signals_Unblock_thread+0x100>
_Thread_queue_Extract_with_proxy( the_thread );
8026250: b9 60 08 00 mv r1,r11
8026254: fb ff 9c 80 calli 800d454 <_Thread_queue_Extract_with_proxy>
8026258: e0 00 00 14 bi 80262a8 <_POSIX_signals_Unblock_thread+0x14c>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_delaying (
States_Control the_states
)
{
return (the_states & STATES_DELAYING);
802625c: 20 84 00 08 andi r4,r4,0x8
else if ( _States_Is_delaying(the_thread->current_state) ) {
8026260: 44 8c 00 12 be r4,r12,80262a8 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN
(void) _Watchdog_Remove( &the_thread->Timer );
8026264: 35 61 00 48 addi r1,r11,72
8026268: fb ff 9e 76 calli 800dc40 <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
802626c: 78 03 08 02 mvhi r3,0x802
8026270: 38 63 76 50 ori r3,r3,0x7650
8026274: 28 62 00 00 lw r2,(r3+0)
8026278: b9 60 08 00 mv r1,r11
802627c: fb ff 99 23 calli 800c708 <_Thread_Clear_state>
8026280: e0 00 00 0a bi 80262a8 <_POSIX_signals_Unblock_thread+0x14c>
_Thread_Unblock( the_thread );
}
} else if ( the_thread->current_state == STATES_READY ) {
8026284: 5c 8c 00 09 bne r4,r12,80262a8 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
8026288: 78 01 08 02 mvhi r1,0x802
802628c: 38 21 9f 00 ori r1,r1,0x9f00
8026290: 28 22 00 08 lw r2,(r1+8)
8026294: 44 4c 00 05 be r2,r12,80262a8 <_POSIX_signals_Unblock_thread+0x14c>
8026298: 28 22 00 10 lw r2,(r1+16)
802629c: 5d 62 00 03 bne r11,r2,80262a8 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN
_Thread_Dispatch_necessary = true;
80262a0: 34 02 00 01 mvi r2,1
80262a4: 30 22 00 0c sb (r1+12),r2
}
}
return false;
}
80262a8: b9 80 08 00 mv r1,r12
80262ac: 2b 9d 00 04 lw ra,(sp+4)
80262b0: 2b 8b 00 14 lw r11,(sp+20)
80262b4: 2b 8c 00 10 lw r12,(sp+16)
80262b8: 2b 8d 00 0c lw r13,(sp+12)
80262bc: 2b 8e 00 08 lw r14,(sp+8)
80262c0: 37 9c 00 14 addi sp,sp,20
80262c4: c3 a0 00 00 ret
0800636c <_RBTree_Extract_unprotected>:
*/
void _RBTree_Extract_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
800636c: 37 9c ff e4 addi sp,sp,-28
8006370: 5b 8b 00 1c sw (sp+28),r11
8006374: 5b 8c 00 18 sw (sp+24),r12
8006378: 5b 8d 00 14 sw (sp+20),r13
800637c: 5b 8e 00 10 sw (sp+16),r14
8006380: 5b 8f 00 0c sw (sp+12),r15
8006384: 5b 90 00 08 sw (sp+8),r16
8006388: 5b 9d 00 04 sw (sp+4),ra
800638c: b8 20 70 00 mv r14,r1
8006390: b8 40 58 00 mv r11,r2
RBTree_Node *leaf, *target;
RBTree_Color victim_color;
RBTree_Direction dir;
if (!the_node) return;
8006394: 44 40 00 53 be r2,r0,80064e0 <_RBTree_Extract_unprotected+0x174>
/* check if min needs to be updated */
if (the_node == the_rbtree->first[RBT_LEFT]) {
8006398: 28 21 00 08 lw r1,(r1+8)
800639c: 5c 41 00 05 bne r2,r1,80063b0 <_RBTree_Extract_unprotected+0x44>
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected(
const RBTree_Node *node
)
{
return _RBTree_Next_unprotected( node, RBT_RIGHT );
80063a0: b8 40 08 00 mv r1,r2
80063a4: 34 02 00 01 mvi r2,1
80063a8: f8 00 01 36 calli 8006880 <_RBTree_Next_unprotected>
RBTree_Node *next;
next = _RBTree_Successor_unprotected(the_node);
the_rbtree->first[RBT_LEFT] = next;
80063ac: 59 c1 00 08 sw (r14+8),r1
}
/* Check if max needs to be updated. min=max for 1 element trees so
* do not use else if here. */
if (the_node == the_rbtree->first[RBT_RIGHT]) {
80063b0: 29 c1 00 0c lw r1,(r14+12)
80063b4: 5d 61 00 05 bne r11,r1,80063c8 <_RBTree_Extract_unprotected+0x5c>
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected(
const RBTree_Node *node
)
{
return _RBTree_Next_unprotected( node, RBT_LEFT );
80063b8: b9 60 08 00 mv r1,r11
80063bc: 34 02 00 00 mvi r2,0
80063c0: f8 00 01 30 calli 8006880 <_RBTree_Next_unprotected>
RBTree_Node *previous;
previous = _RBTree_Predecessor_unprotected(the_node);
the_rbtree->first[RBT_RIGHT] = previous;
80063c4: 59 c1 00 0c sw (r14+12),r1
* either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT],
* and replace the_node with the target node. This maintains the binary
* search tree property, but may violate the red-black properties.
*/
if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) {
80063c8: 29 6c 00 04 lw r12,(r11+4)
80063cc: 29 6d 00 08 lw r13,(r11+8)
80063d0: 45 80 00 2b be r12,r0,800647c <_RBTree_Extract_unprotected+0x110>
80063d4: 5d a0 00 03 bne r13,r0,80063e0 <_RBTree_Extract_unprotected+0x74>
80063d8: e0 00 00 2b bi 8006484 <_RBTree_Extract_unprotected+0x118>
target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */
while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT];
80063dc: b8 20 60 00 mv r12,r1
80063e0: 29 81 00 08 lw r1,(r12+8)
80063e4: 5c 20 ff fe bne r1,r0,80063dc <_RBTree_Extract_unprotected+0x70>
* target's position (target is the right child of target->parent)
* when target vacates it. if there is no child, then target->parent
* should become NULL. This may cause the coloring to be violated.
* For now we store the color of the node being deleted in victim_color.
*/
leaf = target->child[RBT_LEFT];
80063e8: 29 8d 00 04 lw r13,(r12+4)
if(leaf) {
80063ec: 45 a1 00 04 be r13,r1,80063fc <_RBTree_Extract_unprotected+0x90>
leaf->parent = target->parent;
80063f0: 29 81 00 00 lw r1,(r12+0)
80063f4: 59 a1 00 00 sw (r13+0),r1
80063f8: e0 00 00 03 bi 8006404 <_RBTree_Extract_unprotected+0x98>
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(target);
80063fc: b9 80 08 00 mv r1,r12
8006400: fb ff ff 70 calli 80061c0 <_RBTree_Extract_validate_unprotected>
}
victim_color = target->color;
dir = target != target->parent->child[0];
8006404: 29 90 00 00 lw r16,(r12+0)
target->parent->child[dir] = leaf;
8006408: 34 02 00 02 mvi r2,2
leaf->parent = target->parent;
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(target);
}
victim_color = target->color;
800640c: 29 8f 00 0c lw r15,(r12+12)
dir = target != target->parent->child[0];
8006410: 2a 01 00 04 lw r1,(r16+4)
target->parent->child[dir] = leaf;
8006414: fd 81 08 00 cmpne r1,r12,r1
8006418: fb ff ea 3b calli 8000d04 <__ashlsi3>
800641c: b6 01 08 00 add r1,r16,r1
/* now replace the_node with target */
dir = the_node != the_node->parent->child[0];
8006420: 29 70 00 00 lw r16,(r11+0)
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(target);
}
victim_color = target->color;
dir = target != target->parent->child[0];
target->parent->child[dir] = leaf;
8006424: 58 2d 00 04 sw (r1+4),r13
/* now replace the_node with target */
dir = the_node != the_node->parent->child[0];
the_node->parent->child[dir] = target;
8006428: 34 02 00 02 mvi r2,2
victim_color = target->color;
dir = target != target->parent->child[0];
target->parent->child[dir] = leaf;
/* now replace the_node with target */
dir = the_node != the_node->parent->child[0];
800642c: 2a 01 00 04 lw r1,(r16+4)
the_node->parent->child[dir] = target;
8006430: fd 61 08 00 cmpne r1,r11,r1
8006434: fb ff ea 34 calli 8000d04 <__ashlsi3>
8006438: b6 01 08 00 add r1,r16,r1
800643c: 58 2c 00 04 sw (r1+4),r12
/* set target's new children to the original node's children */
target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT];
8006440: 29 61 00 08 lw r1,(r11+8)
8006444: 59 81 00 08 sw (r12+8),r1
if (the_node->child[RBT_RIGHT])
8006448: 29 61 00 08 lw r1,(r11+8)
800644c: 44 20 00 02 be r1,r0,8006454 <_RBTree_Extract_unprotected+0xe8><== NEVER TAKEN
the_node->child[RBT_RIGHT]->parent = target;
8006450: 58 2c 00 00 sw (r1+0),r12
target->child[RBT_LEFT] = the_node->child[RBT_LEFT];
8006454: 29 61 00 04 lw r1,(r11+4)
8006458: 59 81 00 04 sw (r12+4),r1
if (the_node->child[RBT_LEFT])
800645c: 29 61 00 04 lw r1,(r11+4)
8006460: 44 20 00 02 be r1,r0,8006468 <_RBTree_Extract_unprotected+0xfc>
the_node->child[RBT_LEFT]->parent = target;
8006464: 58 2c 00 00 sw (r1+0),r12
/* finally, update the parent node and recolor. target has completely
* replaced the_node, and target's child has moved up the tree if needed.
* the_node is no longer part of the tree, although it has valid pointers
* still.
*/
target->parent = the_node->parent;
8006468: 29 61 00 00 lw r1,(r11+0)
800646c: 59 81 00 00 sw (r12+0),r1
target->color = the_node->color;
8006470: 29 61 00 0c lw r1,(r11+12)
8006474: 59 81 00 0c sw (r12+12),r1
8006478: e0 00 00 11 bi 80064bc <_RBTree_Extract_unprotected+0x150>
* violated. We will fix it later.
* For now we store the color of the node being deleted in victim_color.
*/
leaf = the_node->child[RBT_LEFT] ?
the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT];
if( leaf ) {
800647c: 5d ac 00 03 bne r13,r12,8006488 <_RBTree_Extract_unprotected+0x11c>
8006480: e0 00 00 05 bi 8006494 <_RBTree_Extract_unprotected+0x128>
* either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT],
* and replace the_node with the target node. This maintains the binary
* search tree property, but may violate the red-black properties.
*/
if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) {
8006484: b9 80 68 00 mv r13,r12
* For now we store the color of the node being deleted in victim_color.
*/
leaf = the_node->child[RBT_LEFT] ?
the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT];
if( leaf ) {
leaf->parent = the_node->parent;
8006488: 29 61 00 00 lw r1,(r11+0)
800648c: 59 a1 00 00 sw (r13+0),r1
8006490: e0 00 00 03 bi 800649c <_RBTree_Extract_unprotected+0x130>
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(the_node);
8006494: b9 60 08 00 mv r1,r11
8006498: fb ff ff 4a calli 80061c0 <_RBTree_Extract_validate_unprotected>
}
victim_color = the_node->color;
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
800649c: 29 6c 00 00 lw r12,(r11+0)
the_node->parent->child[dir] = leaf;
80064a0: 34 02 00 02 mvi r2,2
leaf->parent = the_node->parent;
} else {
/* fix the tree here if the child is a null leaf. */
_RBTree_Extract_validate_unprotected(the_node);
}
victim_color = the_node->color;
80064a4: 29 6f 00 0c lw r15,(r11+12)
/* remove the_node from the tree */
dir = the_node != the_node->parent->child[0];
80064a8: 29 81 00 04 lw r1,(r12+4)
the_node->parent->child[dir] = leaf;
80064ac: fd 61 08 00 cmpne r1,r11,r1
80064b0: fb ff ea 15 calli 8000d04 <__ashlsi3>
80064b4: b5 81 08 00 add r1,r12,r1
80064b8: 58 2d 00 04 sw (r1+4),r13
/* fix coloring. leaf has moved up the tree. The color of the deleted
* node is in victim_color. There are two cases:
* 1. Deleted a red node, its child must be black. Nothing must be done.
* 2. Deleted a black node, its child must be red. Paint child black.
*/
if (victim_color == RBT_BLACK) { /* eliminate case 1 */
80064bc: 5d e0 00 03 bne r15,r0,80064c8 <_RBTree_Extract_unprotected+0x15c>
if (leaf) {
80064c0: 45 af 00 02 be r13,r15,80064c8 <_RBTree_Extract_unprotected+0x15c>
leaf->color = RBT_BLACK; /* case 2 */
80064c4: 59 a0 00 0c sw (r13+12),r0
/* Wipe the_node */
_RBTree_Set_off_rbtree(the_node);
/* set root to black, if it exists */
if (the_rbtree->root) the_rbtree->root->color = RBT_BLACK;
80064c8: 29 c1 00 04 lw r1,(r14+4)
*/
RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree(
RBTree_Node *node
)
{
node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL;
80064cc: 59 60 00 08 sw (r11+8),r0
80064d0: 59 60 00 04 sw (r11+4),r0
80064d4: 59 60 00 00 sw (r11+0),r0
80064d8: 44 20 00 02 be r1,r0,80064e0 <_RBTree_Extract_unprotected+0x174>
80064dc: 58 20 00 0c sw (r1+12),r0
}
80064e0: 2b 9d 00 04 lw ra,(sp+4)
80064e4: 2b 8b 00 1c lw r11,(sp+28)
80064e8: 2b 8c 00 18 lw r12,(sp+24)
80064ec: 2b 8d 00 14 lw r13,(sp+20)
80064f0: 2b 8e 00 10 lw r14,(sp+16)
80064f4: 2b 8f 00 0c lw r15,(sp+12)
80064f8: 2b 90 00 08 lw r16,(sp+8)
80064fc: 37 9c 00 1c addi sp,sp,28
8006500: c3 a0 00 00 ret
08006fa0 <_RBTree_Initialize>:
void *starting_address,
size_t number_nodes,
size_t node_size,
bool is_unique
)
{
8006fa0: 37 9c ff ec addi sp,sp,-20
8006fa4: 5b 8b 00 14 sw (sp+20),r11
8006fa8: 5b 8c 00 10 sw (sp+16),r12
8006fac: 5b 8d 00 0c sw (sp+12),r13
8006fb0: 5b 8e 00 08 sw (sp+8),r14
8006fb4: 5b 9d 00 04 sw (sp+4),ra
8006fb8: b8 20 58 00 mv r11,r1
8006fbc: b8 80 68 00 mv r13,r4
8006fc0: b8 a0 70 00 mv r14,r5
8006fc4: 20 c6 00 ff andi r6,r6,0xff
size_t count;
RBTree_Node *next;
/* TODO: Error message? */
if (!the_rbtree) return;
8006fc8: 44 20 00 0f be r1,r0,8007004 <_RBTree_Initialize+0x64> <== NEVER TAKEN
RBTree_Control *the_rbtree,
RBTree_Compare_function compare_function,
bool is_unique
)
{
the_rbtree->permanent_null = NULL;
8006fcc: 58 20 00 00 sw (r1+0),r0
the_rbtree->root = NULL;
8006fd0: 58 20 00 04 sw (r1+4),r0
the_rbtree->first[0] = NULL;
8006fd4: 58 20 00 08 sw (r1+8),r0
the_rbtree->first[1] = NULL;
8006fd8: 58 20 00 0c sw (r1+12),r0
the_rbtree->compare_function = compare_function;
8006fdc: 58 22 00 10 sw (r1+16),r2
the_rbtree->is_unique = is_unique;
8006fe0: 30 26 00 14 sb (r1+20),r6
/* could do sanity checks here */
_RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);
count = number_nodes;
next = starting_address;
8006fe4: b8 60 60 00 mv r12,r3
while ( count-- ) {
8006fe8: e0 00 00 06 bi 8007000 <_RBTree_Initialize+0x60>
_RBTree_Insert_unprotected(the_rbtree, next);
8006fec: b9 80 10 00 mv r2,r12
8006ff0: b9 60 08 00 mv r1,r11
8006ff4: fb ff ff 22 calli 8006c7c <_RBTree_Insert_unprotected>
#include <rtems/system.h>
#include <rtems/score/address.h>
#include <rtems/score/rbtree.h>
#include <rtems/score/isr.h>
void _RBTree_Initialize(
8006ff8: b5 8e 60 00 add r12,r12,r14
8006ffc: 35 ad ff ff addi r13,r13,-1
/* could do sanity checks here */
_RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);
count = number_nodes;
next = starting_address;
while ( count-- ) {
8007000: 5d a0 ff fb bne r13,r0,8006fec <_RBTree_Initialize+0x4c> <== NEVER TAKEN
_RBTree_Insert_unprotected(the_rbtree, next);
next = (RBTree_Node *)
_Addresses_Add_offset( (void *) next, node_size );
}
}
8007004: 2b 9d 00 04 lw ra,(sp+4)
8007008: 2b 8b 00 14 lw r11,(sp+20)
800700c: 2b 8c 00 10 lw r12,(sp+16)
8007010: 2b 8d 00 0c lw r13,(sp+12)
8007014: 2b 8e 00 08 lw r14,(sp+8)
8007018: 37 9c 00 14 addi sp,sp,20
800701c: c3 a0 00 00 ret
080065ec <_RBTree_Insert_unprotected>:
*/
RBTree_Node *_RBTree_Insert_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
80065ec: 37 9c ff e8 addi sp,sp,-24
80065f0: 5b 8b 00 18 sw (sp+24),r11
80065f4: 5b 8c 00 14 sw (sp+20),r12
80065f8: 5b 8d 00 10 sw (sp+16),r13
80065fc: 5b 8e 00 0c sw (sp+12),r14
8006600: 5b 8f 00 08 sw (sp+8),r15
8006604: 5b 9d 00 04 sw (sp+4),ra
if(!the_node) return (RBTree_Node*)-1;
8006608: 34 0d ff ff mvi r13,-1
*/
RBTree_Node *_RBTree_Insert_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
800660c: b8 20 60 00 mv r12,r1
8006610: b8 40 58 00 mv r11,r2
if(!the_node) return (RBTree_Node*)-1;
8006614: 44 40 00 5a be r2,r0,800677c <_RBTree_Insert_unprotected+0x190>
RBTree_Node *iter_node = the_rbtree->root;
8006618: 28 2d 00 04 lw r13,(r1+4)
int compare_result;
if (!iter_node) { /* special case: first node inserted */
800661c: b9 a0 78 00 mv r15,r13
8006620: 5d a0 00 2d bne r13,r0,80066d4 <_RBTree_Insert_unprotected+0xe8>
the_node->color = RBT_BLACK;
8006624: 58 40 00 0c sw (r2+12),r0
the_rbtree->root = the_node;
8006628: 59 82 00 04 sw (r12+4),r2
the_rbtree->first[0] = the_rbtree->first[1] = the_node;
800662c: 59 82 00 0c sw (r12+12),r2
8006630: 59 82 00 08 sw (r12+8),r2
the_node->parent = (RBTree_Node *) the_rbtree;
8006634: 59 61 00 00 sw (r11+0),r1
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
8006638: 58 40 00 08 sw (r2+8),r0
800663c: 58 40 00 04 sw (r2+4),r0
8006640: e0 00 00 4f bi 800677c <_RBTree_Insert_unprotected+0x190>
} else {
/* typical binary search tree insert, descend tree to leaf and insert */
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
8006644: 44 20 00 4e be r1,r0,800677c <_RBTree_Insert_unprotected+0x190>
return iter_node;
RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
8006648: 34 02 00 1f mvi r2,31
800664c: a4 20 08 00 not r1,r1
8006650: fb ff e9 d4 calli 8000da0 <__lshrsi3>
if (!iter_node->child[dir]) {
8006654: 34 02 00 02 mvi r2,2
/* typical binary search tree insert, descend tree to leaf and insert */
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
return iter_node;
RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
8006658: b8 20 70 00 mv r14,r1
if (!iter_node->child[dir]) {
800665c: fb ff e9 aa calli 8000d04 <__ashlsi3>
8006660: b5 a1 08 00 add r1,r13,r1
8006664: 28 2d 00 04 lw r13,(r1+4)
8006668: 34 22 00 04 addi r2,r1,4
800666c: 5d a0 00 19 bne r13,r0,80066d0 <_RBTree_Insert_unprotected+0xe4>
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
8006670: 59 60 00 08 sw (r11+8),r0
8006674: 59 60 00 04 sw (r11+4),r0
the_node->color = RBT_RED;
8006678: 34 01 00 01 mvi r1,1
800667c: 59 61 00 0c sw (r11+12),r1
iter_node->child[dir] = the_node;
8006680: 58 4b 00 00 sw (r2+0),r11
the_node->parent = iter_node;
8006684: 59 6f 00 00 sw (r11+0),r15
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
const RBTree_Control *the_rbtree,
RBTree_Direction dir
)
{
return the_rbtree->first[dir];
8006688: 34 02 00 02 mvi r2,2
800668c: 35 c1 00 02 addi r1,r14,2
8006690: fb ff e9 9d calli 8000d04 <__ashlsi3>
8006694: b5 81 10 00 add r2,r12,r1
/* update min/max */
compare_result = the_rbtree->compare_function(
8006698: 29 83 00 10 lw r3,(r12+16)
800669c: 28 42 00 00 lw r2,(r2+0)
80066a0: b9 60 08 00 mv r1,r11
80066a4: d8 60 00 00 call r3
the_node,
_RBTree_First(the_rbtree, dir)
);
if ( (!dir && _RBTree_Is_lesser(compare_result)) ||
80066a8: 5d cd 00 03 bne r14,r13,80066b4 <_RBTree_Insert_unprotected+0xc8>
80066ac: 49 a1 00 03 bg r13,r1,80066b8 <_RBTree_Insert_unprotected+0xcc>
80066b0: e0 00 00 2b bi 800675c <_RBTree_Insert_unprotected+0x170>
(dir && _RBTree_Is_greater(compare_result)) ) {
80066b4: 4c 01 00 2a bge r0,r1,800675c <_RBTree_Insert_unprotected+0x170>
the_rbtree->first[dir] = the_node;
80066b8: 35 c1 00 02 addi r1,r14,2
80066bc: 34 02 00 02 mvi r2,2
80066c0: fb ff e9 91 calli 8000d04 <__ashlsi3>
80066c4: b5 81 08 00 add r1,r12,r1
80066c8: 58 2b 00 00 sw (r1+0),r11
80066cc: e0 00 00 24 bi 800675c <_RBTree_Insert_unprotected+0x170>
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
return iter_node;
RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
if (!iter_node->child[dir]) {
80066d0: b9 a0 78 00 mv r15,r13
the_node->parent = (RBTree_Node *) the_rbtree;
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
} else {
/* typical binary search tree insert, descend tree to leaf and insert */
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
80066d4: 29 83 00 10 lw r3,(r12+16)
80066d8: b9 a0 10 00 mv r2,r13
80066dc: b9 60 08 00 mv r1,r11
80066e0: d8 60 00 00 call r3
if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
80066e4: 41 82 00 14 lbu r2,(r12+20)
80066e8: 5c 40 ff d7 bne r2,r0,8006644 <_RBTree_Insert_unprotected+0x58>
80066ec: e3 ff ff d7 bi 8006648 <_RBTree_Insert_unprotected+0x5c>
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
if(!(the_node->parent->parent)) return NULL;
if(!(the_node->parent->parent->parent)) return NULL;
80066f0: 29 82 00 00 lw r2,(r12+0)
80066f4: 44 40 00 2b be r2,r0,80067a0 <_RBTree_Insert_unprotected+0x1b4><== NEVER TAKEN
{
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])
80066f8: 29 82 00 04 lw r2,(r12+4)
80066fc: 5c 22 00 02 bne r1,r2,8006704 <_RBTree_Insert_unprotected+0x118>
return the_node->parent->child[RBT_RIGHT];
8006700: 29 82 00 08 lw r2,(r12+8)
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
8006704: 44 40 00 27 be r2,r0,80067a0 <_RBTree_Insert_unprotected+0x1b4>
8006708: 28 43 00 0c lw r3,(r2+12)
800670c: 5c 6e 00 25 bne r3,r14,80067a0 <_RBTree_Insert_unprotected+0x1b4>
u = _RBTree_Parent_sibling(the_node);
g = the_node->parent->parent;
/* if uncle is red, repaint uncle/parent black and grandparent red */
if(_RBTree_Is_red(u)) {
the_node->parent->color = RBT_BLACK;
8006710: 58 20 00 0c sw (r1+12),r0
u->color = RBT_BLACK;
8006714: 58 40 00 0c sw (r2+12),r0
g->color = RBT_RED;
8006718: 59 8e 00 0c sw (r12+12),r14
800671c: b9 80 58 00 mv r11,r12
8006720: e0 00 00 10 bi 8006760 <_RBTree_Insert_unprotected+0x174>
RBTree_Direction dir = the_node != the_node->parent->child[0];
RBTree_Direction pdir = the_node->parent != g->child[0];
/* ensure node is on the same branch direction as parent */
if (dir != pdir) {
_RBTree_Rotate(the_node->parent, pdir);
8006724: b9 e0 10 00 mv r2,r15
8006728: fb ff ff 84 calli 8006538 <_RBTree_Rotate>
the_node = the_node->child[pdir];
800672c: b9 e0 08 00 mv r1,r15
8006730: 34 02 00 02 mvi r2,2
8006734: fb ff e9 74 calli 8000d04 <__ashlsi3>
8006738: b5 61 08 00 add r1,r11,r1
800673c: 28 2b 00 04 lw r11,(r1+4)
}
the_node->parent->color = RBT_BLACK;
8006740: 29 61 00 00 lw r1,(r11+0)
g->color = RBT_RED;
/* now rotate grandparent in the other branch direction (toward uncle) */
_RBTree_Rotate(g, (1-pdir));
8006744: c9 cf 10 00 sub r2,r14,r15
/* ensure node is on the same branch direction as parent */
if (dir != pdir) {
_RBTree_Rotate(the_node->parent, pdir);
the_node = the_node->child[pdir];
}
the_node->parent->color = RBT_BLACK;
8006748: 58 20 00 0c sw (r1+12),r0
g->color = RBT_RED;
800674c: 59 8e 00 0c sw (r12+12),r14
/* now rotate grandparent in the other branch direction (toward uncle) */
_RBTree_Rotate(g, (1-pdir));
8006750: b9 80 08 00 mv r1,r12
8006754: fb ff ff 79 calli 8006538 <_RBTree_Rotate>
8006758: e0 00 00 02 bi 8006760 <_RBTree_Insert_unprotected+0x174>
800675c: 34 0e 00 01 mvi r14,1
_ISR_Disable( level );
return_node = _RBTree_Insert_unprotected( tree, node );
_ISR_Enable( level );
return return_node;
}
8006760: 29 61 00 00 lw r1,(r11+0)
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent(
const RBTree_Node *the_node
)
{
if (!the_node->parent->parent) return NULL;
8006764: 28 2c 00 00 lw r12,(r1+0)
8006768: 45 80 00 04 be r12,r0,8006778 <_RBTree_Insert_unprotected+0x18c>
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
800676c: 28 22 00 0c lw r2,(r1+12)
8006770: 5c 4e 00 03 bne r2,r14,800677c <_RBTree_Insert_unprotected+0x190>
8006774: e3 ff ff df bi 80066f0 <_RBTree_Insert_unprotected+0x104>
/* now rotate grandparent in the other branch direction (toward uncle) */
_RBTree_Rotate(g, (1-pdir));
}
}
if(!the_node->parent->parent) the_node->color = RBT_BLACK;
8006778: 59 60 00 0c sw (r11+12),r0
/* verify red-black properties */
_RBTree_Validate_insert_unprotected(the_node);
}
return (RBTree_Node*)0;
}
800677c: b9 a0 08 00 mv r1,r13
8006780: 2b 9d 00 04 lw ra,(sp+4)
8006784: 2b 8b 00 18 lw r11,(sp+24)
8006788: 2b 8c 00 14 lw r12,(sp+20)
800678c: 2b 8d 00 10 lw r13,(sp+16)
8006790: 2b 8e 00 0c lw r14,(sp+12)
8006794: 2b 8f 00 08 lw r15,(sp+8)
8006798: 37 9c 00 18 addi sp,sp,24
800679c: c3 a0 00 00 ret
u->color = RBT_BLACK;
g->color = RBT_RED;
the_node = g;
} else { /* if uncle is black */
RBTree_Direction dir = the_node != the_node->parent->child[0];
RBTree_Direction pdir = the_node->parent != g->child[0];
80067a0: 29 8f 00 04 lw r15,(r12+4)
the_node->parent->color = RBT_BLACK;
u->color = RBT_BLACK;
g->color = RBT_RED;
the_node = g;
} else { /* if uncle is black */
RBTree_Direction dir = the_node != the_node->parent->child[0];
80067a4: 28 22 00 04 lw r2,(r1+4)
RBTree_Direction pdir = the_node->parent != g->child[0];
80067a8: fc 2f 78 00 cmpne r15,r1,r15
the_node->parent->color = RBT_BLACK;
u->color = RBT_BLACK;
g->color = RBT_RED;
the_node = g;
} else { /* if uncle is black */
RBTree_Direction dir = the_node != the_node->parent->child[0];
80067ac: fd 62 10 00 cmpne r2,r11,r2
RBTree_Direction pdir = the_node->parent != g->child[0];
/* ensure node is on the same branch direction as parent */
if (dir != pdir) {
80067b0: 5c 4f ff dd bne r2,r15,8006724 <_RBTree_Insert_unprotected+0x138>
80067b4: e3 ff ff e3 bi 8006740 <_RBTree_Insert_unprotected+0x154>
080067ec <_RBTree_Iterate_unprotected>:
const RBTree_Control *rbtree,
RBTree_Direction dir,
RBTree_Visitor visitor,
void *visitor_arg
)
{
80067ec: 37 9c ff e8 addi sp,sp,-24
80067f0: 5b 8b 00 18 sw (sp+24),r11
80067f4: 5b 8c 00 14 sw (sp+20),r12
80067f8: 5b 8d 00 10 sw (sp+16),r13
80067fc: 5b 8e 00 0c sw (sp+12),r14
8006800: 5b 8f 00 08 sw (sp+8),r15
8006804: 5b 9d 00 04 sw (sp+4),ra
8006808: b8 40 60 00 mv r12,r2
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
800680c: 64 42 00 00 cmpei r2,r2,0
8006810: b8 20 58 00 mv r11,r1
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First(
const RBTree_Control *the_rbtree,
RBTree_Direction dir
)
{
return the_rbtree->first[dir];
8006814: 34 41 00 02 addi r1,r2,2
8006818: 34 02 00 02 mvi r2,2
800681c: b8 60 70 00 mv r14,r3
8006820: b8 80 68 00 mv r13,r4
8006824: fb ff e9 38 calli 8000d04 <__ashlsi3>
8006828: b5 61 08 00 add r1,r11,r1
800682c: 28 2b 00 00 lw r11,(r1+0)
8006830: e0 00 00 0b bi 800685c <_RBTree_Iterate_unprotected+0x70>
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
const RBTree_Node *current = _RBTree_First( rbtree, opp_dir );
bool stop = false;
while ( !stop && current != NULL ) {
stop = (*visitor)( current, dir, visitor_arg );
8006834: b9 60 08 00 mv r1,r11
8006838: b9 80 10 00 mv r2,r12
800683c: b9 a0 18 00 mv r3,r13
8006840: d9 c0 00 00 call r14
8006844: b8 20 78 00 mv r15,r1
current = _RBTree_Next_unprotected( current, dir );
8006848: b9 80 10 00 mv r2,r12
800684c: b9 60 08 00 mv r1,r11
8006850: f8 00 00 0c calli 8006880 <_RBTree_Next_unprotected>
8006854: b8 20 58 00 mv r11,r1
{
RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir );
const RBTree_Node *current = _RBTree_First( rbtree, opp_dir );
bool stop = false;
while ( !stop && current != NULL ) {
8006858: 5d e0 00 02 bne r15,r0,8006860 <_RBTree_Iterate_unprotected+0x74><== NEVER TAKEN
800685c: 5d 60 ff f6 bne r11,r0,8006834 <_RBTree_Iterate_unprotected+0x48>
stop = (*visitor)( current, dir, visitor_arg );
current = _RBTree_Next_unprotected( current, dir );
}
}
8006860: 2b 9d 00 04 lw ra,(sp+4)
8006864: 2b 8b 00 18 lw r11,(sp+24)
8006868: 2b 8c 00 14 lw r12,(sp+20)
800686c: 2b 8d 00 10 lw r13,(sp+16)
8006870: 2b 8e 00 0c lw r14,(sp+12)
8006874: 2b 8f 00 08 lw r15,(sp+8)
8006878: 37 9c 00 18 addi sp,sp,24
800687c: c3 a0 00 00 ret
080060e0 <_RBTree_Sibling>:
* exists, and NULL if not.
*/
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
80060e0: b8 20 18 00 mv r3,r1
if(!the_node) return NULL;
80060e4: 34 01 00 00 mvi r1,0
80060e8: 44 60 00 08 be r3,r0,8006108 <_RBTree_Sibling+0x28>
if(!(the_node->parent)) return NULL;
80060ec: 28 62 00 00 lw r2,(r3+0)
80060f0: 44 40 00 06 be r2,r0,8006108 <_RBTree_Sibling+0x28> <== NEVER TAKEN
if(!(the_node->parent->parent)) return NULL;
80060f4: 28 44 00 00 lw r4,(r2+0)
80060f8: 44 80 00 04 be r4,r0,8006108 <_RBTree_Sibling+0x28>
if(the_node == the_node->parent->child[RBT_LEFT])
80060fc: 28 41 00 04 lw r1,(r2+4)
8006100: 5c 61 00 02 bne r3,r1,8006108 <_RBTree_Sibling+0x28>
return the_node->parent->child[RBT_RIGHT];
8006104: 28 41 00 08 lw r1,(r2+8)
else
return the_node->parent->child[RBT_LEFT];
}
8006108: c3 a0 00 00 ret
08004afc <_RTEMS_signal_Post_switch_hook>:
#include <rtems/score/thread.h>
#include <rtems/score/apiext.h>
#include <rtems/rtems/tasks.h>
static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing )
{
8004afc: 37 9c ff f0 addi sp,sp,-16
8004b00: 5b 8b 00 0c sw (sp+12),r11
8004b04: 5b 8c 00 08 sw (sp+8),r12
8004b08: 5b 9d 00 04 sw (sp+4),ra
RTEMS_API_Control *api;
ASR_Information *asr;
rtems_signal_set signal_set;
Modes_Control prev_mode;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
8004b0c: 28 2b 01 18 lw r11,(r1+280)
if ( !api )
8004b10: 45 60 00 1a be r11,r0,8004b78 <_RTEMS_signal_Post_switch_hook+0x7c><== NEVER TAKEN
* Signal Processing
*/
asr = &api->Signal;
_ISR_Disable( level );
8004b14: 90 00 08 00 rcsr r1,IE
8004b18: 34 02 ff fe mvi r2,-2
8004b1c: a0 22 10 00 and r2,r1,r2
8004b20: d0 02 00 00 wcsr IE,r2
signal_set = asr->signals_posted;
8004b24: 29 6c 00 14 lw r12,(r11+20)
asr->signals_posted = 0;
8004b28: 59 60 00 14 sw (r11+20),r0
_ISR_Enable( level );
8004b2c: d0 01 00 00 wcsr IE,r1
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
8004b30: 45 80 00 12 be r12,r0,8004b78 <_RTEMS_signal_Post_switch_hook+0x7c>
return;
asr->nest_level += 1;
8004b34: 29 61 00 1c lw r1,(r11+28)
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
8004b38: 37 83 00 10 addi r3,sp,16
8004b3c: 38 02 ff ff mvu r2,0xffff
if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */
return;
asr->nest_level += 1;
8004b40: 34 21 00 01 addi r1,r1,1
8004b44: 59 61 00 1c sw (r11+28),r1
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
8004b48: 29 61 00 10 lw r1,(r11+16)
8004b4c: f8 00 01 27 calli 8004fe8 <rtems_task_mode>
(*asr->handler)( signal_set );
8004b50: 29 62 00 0c lw r2,(r11+12)
8004b54: b9 80 08 00 mv r1,r12
8004b58: d8 40 00 00 call r2
asr->nest_level -= 1;
8004b5c: 29 61 00 1c lw r1,(r11+28)
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
8004b60: 38 02 ff ff mvu r2,0xffff
8004b64: 37 83 00 10 addi r3,sp,16
asr->nest_level += 1;
rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );
(*asr->handler)( signal_set );
asr->nest_level -= 1;
8004b68: 34 21 ff ff addi r1,r1,-1
8004b6c: 59 61 00 1c sw (r11+28),r1
rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );
8004b70: 2b 81 00 10 lw r1,(sp+16)
8004b74: f8 00 01 1d calli 8004fe8 <rtems_task_mode>
}
8004b78: 2b 9d 00 04 lw ra,(sp+4)
8004b7c: 2b 8b 00 0c lw r11,(sp+12)
8004b80: 2b 8c 00 08 lw r12,(sp+8)
8004b84: 37 9c 00 10 addi sp,sp,16
8004b88: c3 a0 00 00 ret
08034370 <_Rate_monotonic_Get_status>:
bool _Rate_monotonic_Get_status(
Rate_monotonic_Control *the_period,
Rate_monotonic_Period_time_t *wall_since_last_period,
Thread_CPU_usage_t *cpu_since_last_period
)
{
8034370: 37 9c ff e4 addi sp,sp,-28
8034374: 5b 8b 00 14 sw (sp+20),r11
8034378: 5b 8c 00 10 sw (sp+16),r12
803437c: 5b 8d 00 0c sw (sp+12),r13
8034380: 5b 8e 00 08 sw (sp+8),r14
8034384: 5b 9d 00 04 sw (sp+4),ra
8034388: b8 40 70 00 mv r14,r2
*/
static inline void _TOD_Get_uptime(
Timestamp_Control *time
)
{
_TOD_Get_with_nanoseconds( time, &_TOD.uptime );
803438c: 78 02 08 06 mvhi r2,0x806
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
Timestamp_Control uptime;
#endif
Thread_Control *owning_thread = the_period->owner;
8034390: 28 2c 00 40 lw r12,(r1+64)
bool _Rate_monotonic_Get_status(
Rate_monotonic_Control *the_period,
Rate_monotonic_Period_time_t *wall_since_last_period,
Thread_CPU_usage_t *cpu_since_last_period
)
{
8034394: b8 20 58 00 mv r11,r1
8034398: 38 42 9f e8 ori r2,r2,0x9fe8
803439c: 37 81 00 18 addi r1,sp,24
80343a0: b8 60 68 00 mv r13,r3
80343a4: fb ff 3f 1f calli 8004020 <_TOD_Get_with_nanoseconds>
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
80343a8: 29 61 00 54 lw r1,(r11+84)
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
80343ac: 2b 85 00 1c lw r5,(sp+28)
80343b0: 29 62 00 50 lw r2,(r11+80)
80343b4: 2b 83 00 18 lw r3,(sp+24)
80343b8: c8 a1 08 00 sub r1,r5,r1
80343bc: f4 25 20 00 cmpgu r4,r1,r5
80343c0: c8 62 10 00 sub r2,r3,r2
80343c4: c8 44 10 00 sub r2,r2,r4
80343c8: 59 c2 00 00 sw (r14+0),r2
* Determine cpu usage since period initiated.
*/
used = owning_thread->cpu_time_used;
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
if (owning_thread == _Thread_Executing) {
80343cc: 78 02 08 06 mvhi r2,0x806
80343d0: 38 42 a5 00 ori r2,r2,0xa500
80343d4: 28 47 00 10 lw r7,(r2+16)
80343d8: 59 c1 00 04 sw (r14+4),r1
#endif
/*
* Determine cpu usage since period initiated.
*/
used = owning_thread->cpu_time_used;
80343dc: 29 86 00 80 lw r6,(r12+128)
80343e0: 29 84 00 84 lw r4,(r12+132)
if (used < the_period->cpu_usage_period_initiated)
return false;
*cpu_since_last_period = used - the_period->cpu_usage_period_initiated;
#endif
return true;
80343e4: 34 01 00 01 mvi r1,1
* Determine cpu usage since period initiated.
*/
used = owning_thread->cpu_time_used;
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
if (owning_thread == _Thread_Executing) {
80343e8: 5d 87 00 19 bne r12,r7,803444c <_Rate_monotonic_Get_status+0xdc>
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
80343ec: 28 41 00 24 lw r1,(r2+36)
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
80343f0: b4 85 28 00 add r5,r4,r5
80343f4: b4 c3 18 00 add r3,r6,r3
80343f8: f4 85 20 00 cmpgu r4,r4,r5
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
80343fc: 28 46 00 20 lw r6,(r2+32)
8034400: c8 a1 08 00 sub r1,r5,r1
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
8034404: b4 83 20 00 add r4,r4,r3
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
8034408: f4 25 28 00 cmpgu r5,r1,r5
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
803440c: 29 62 00 48 lw r2,(r11+72)
8034410: c8 86 20 00 sub r4,r4,r6
8034414: c8 85 20 00 sub r4,r4,r5
8034418: 29 63 00 4c lw r3,(r11+76)
/*
* The cpu usage info was reset while executing. Can't
* determine a status.
*/
if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated))
803441c: 48 44 00 0b bg r2,r4,8034448 <_Rate_monotonic_Get_status+0xd8><== NEVER TAKEN
8034420: 5c 44 00 02 bne r2,r4,8034428 <_Rate_monotonic_Get_status+0xb8>
8034424: 54 61 00 09 bgu r3,r1,8034448 <_Rate_monotonic_Get_status+0xd8>
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
8034428: c8 23 18 00 sub r3,r1,r3
803442c: f4 61 08 00 cmpgu r1,r3,r1
8034430: c8 82 10 00 sub r2,r4,r2
8034434: c8 41 08 00 sub r1,r2,r1
8034438: 59 a1 00 00 sw (r13+0),r1
803443c: 59 a3 00 04 sw (r13+4),r3
if (used < the_period->cpu_usage_period_initiated)
return false;
*cpu_since_last_period = used - the_period->cpu_usage_period_initiated;
#endif
return true;
8034440: 34 01 00 01 mvi r1,1
8034444: e0 00 00 02 bi 803444c <_Rate_monotonic_Get_status+0xdc>
/*
* The cpu usage info was reset while executing. Can't
* determine a status.
*/
if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated))
return false;
8034448: 34 01 00 00 mvi r1,0
return false;
*cpu_since_last_period = used - the_period->cpu_usage_period_initiated;
#endif
return true;
}
803444c: 2b 9d 00 04 lw ra,(sp+4)
8034450: 2b 8b 00 14 lw r11,(sp+20)
8034454: 2b 8c 00 10 lw r12,(sp+16)
8034458: 2b 8d 00 0c lw r13,(sp+12)
803445c: 2b 8e 00 08 lw r14,(sp+8)
8034460: 37 9c 00 1c addi sp,sp,28
8034464: c3 a0 00 00 ret
08034838 <_Rate_monotonic_Timeout>:
void _Rate_monotonic_Timeout(
Objects_Id id,
void *ignored
)
{
8034838: 37 9c ff f4 addi sp,sp,-12
803483c: 5b 8b 00 08 sw (sp+8),r11
8034840: 5b 9d 00 04 sw (sp+4),ra
8034844: b8 20 10 00 mv r2,r1
8034848: 78 01 08 06 mvhi r1,0x806
803484c: 38 21 ab 30 ori r1,r1,0xab30
8034850: 37 83 00 0c addi r3,sp,12
8034854: fb ff 41 16 calli 8004cac <_Objects_Get>
/*
* When we get here, the Timer is already off the chain so we do not
* have to worry about that -- hence no _Watchdog_Remove().
*/
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
8034858: 2b 82 00 0c lw r2,(sp+12)
803485c: b8 20 58 00 mv r11,r1
8034860: 5c 40 00 22 bne r2,r0,80348e8 <_Rate_monotonic_Timeout+0xb0><== NEVER TAKEN
case OBJECTS_LOCAL:
the_thread = the_period->owner;
8034864: 28 21 00 40 lw r1,(r1+64)
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period (
States_Control the_states
)
{
return (the_states & STATES_WAITING_FOR_PERIOD);
8034868: 28 23 00 10 lw r3,(r1+16)
803486c: 20 63 40 00 andi r3,r3,0x4000
if ( _States_Is_waiting_for_period( the_thread->current_state ) &&
8034870: 44 62 00 09 be r3,r2,8034894 <_Rate_monotonic_Timeout+0x5c>
8034874: 28 23 00 20 lw r3,(r1+32)
8034878: 29 62 00 08 lw r2,(r11+8)
803487c: 5c 62 00 06 bne r3,r2,8034894 <_Rate_monotonic_Timeout+0x5c>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
8034880: 78 03 08 05 mvhi r3,0x805
8034884: 38 63 97 00 ori r3,r3,0x9700
8034888: 28 62 00 00 lw r2,(r3+0)
803488c: fb ff 62 0a calli 800d0b4 <_Thread_Clear_state>
8034890: e0 00 00 06 bi 80348a8 <_Rate_monotonic_Timeout+0x70>
_Thread_Unblock( the_thread );
_Rate_monotonic_Initiate_statistics( the_period );
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) {
8034894: 29 62 00 38 lw r2,(r11+56)
8034898: 34 01 00 01 mvi r1,1
803489c: 5c 41 00 0c bne r2,r1,80348cc <_Rate_monotonic_Timeout+0x94>
the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
80348a0: 34 01 00 03 mvi r1,3
80348a4: 59 61 00 38 sw (r11+56),r1
_Rate_monotonic_Initiate_statistics( the_period );
80348a8: b9 60 08 00 mv r1,r11
80348ac: fb ff ff 39 calli 8034590 <_Rate_monotonic_Initiate_statistics>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80348b0: 29 61 00 3c lw r1,(r11+60)
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80348b4: 35 62 00 10 addi r2,r11,16
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80348b8: 59 61 00 1c sw (r11+28),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80348bc: 78 01 08 06 mvhi r1,0x806
80348c0: 38 21 a0 f8 ori r1,r1,0xa0f8
80348c4: fb ff 48 79 calli 8006aa8 <_Watchdog_Insert>
80348c8: e0 00 00 03 bi 80348d4 <_Rate_monotonic_Timeout+0x9c>
_Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else
the_period->state = RATE_MONOTONIC_EXPIRED;
80348cc: 34 01 00 04 mvi r1,4
80348d0: 59 61 00 38 sw (r11+56),r1
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
80348d4: 78 01 08 06 mvhi r1,0x806
80348d8: 38 21 a0 60 ori r1,r1,0xa060
80348dc: 28 22 00 00 lw r2,(r1+0)
--level;
80348e0: 34 42 ff ff addi r2,r2,-1
_Thread_Dispatch_disable_level = level;
80348e4: 58 22 00 00 sw (r1+0),r2
case OBJECTS_REMOTE: /* impossible */
#endif
case OBJECTS_ERROR:
break;
}
}
80348e8: 2b 9d 00 04 lw ra,(sp+4)
80348ec: 2b 8b 00 08 lw r11,(sp+8)
80348f0: 37 9c 00 0c addi sp,sp,12
80348f4: c3 a0 00 00 ret
08034468 <_Rate_monotonic_Update_statistics>:
}
static void _Rate_monotonic_Update_statistics(
Rate_monotonic_Control *the_period
)
{
8034468: 37 9c ff e8 addi sp,sp,-24
803446c: 5b 8b 00 08 sw (sp+8),r11
8034470: 5b 9d 00 04 sw (sp+4),ra
8034474: b8 20 58 00 mv r11,r1
/*
* Update the counts.
*/
stats = &the_period->Statistics;
stats->count++;
8034478: 28 21 00 58 lw r1,(r1+88)
if ( the_period->state == RATE_MONOTONIC_EXPIRED )
803447c: 29 62 00 38 lw r2,(r11+56)
/*
* Update the counts.
*/
stats = &the_period->Statistics;
stats->count++;
8034480: 34 21 00 01 addi r1,r1,1
8034484: 59 61 00 58 sw (r11+88),r1
if ( the_period->state == RATE_MONOTONIC_EXPIRED )
8034488: 34 01 00 04 mvi r1,4
803448c: 5c 41 00 04 bne r2,r1,803449c <_Rate_monotonic_Update_statistics+0x34>
stats->missed_count++;
8034490: 29 61 00 5c lw r1,(r11+92)
8034494: 34 21 00 01 addi r1,r1,1
8034498: 59 61 00 5c sw (r11+92),r1
/*
* Grab status for time statistics.
*/
valid_status =
803449c: b9 60 08 00 mv r1,r11
80344a0: 37 82 00 0c addi r2,sp,12
80344a4: 37 83 00 14 addi r3,sp,20
80344a8: fb ff ff b2 calli 8034370 <_Rate_monotonic_Get_status>
_Rate_monotonic_Get_status( the_period, &since_last_period, &executed );
if (!valid_status)
80344ac: 44 20 00 35 be r1,r0,8034580 <_Rate_monotonic_Update_statistics+0x118><== NEVER TAKEN
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
80344b0: 2b 82 00 18 lw r2,(sp+24)
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
80344b4: 29 63 00 74 lw r3,(r11+116)
80344b8: 29 64 00 70 lw r4,(r11+112)
80344bc: 2b 81 00 14 lw r1,(sp+20)
80344c0: b4 43 18 00 add r3,r2,r3
80344c4: f4 43 28 00 cmpgu r5,r2,r3
80344c8: b4 24 20 00 add r4,r1,r4
80344cc: 59 63 00 74 sw (r11+116),r3
* Update CPU time
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Add_to( &stats->total_cpu_time, &executed );
if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) )
80344d0: 29 63 00 60 lw r3,(r11+96)
80344d4: b4 a4 20 00 add r4,r5,r4
80344d8: 59 64 00 70 sw (r11+112),r4
80344dc: 48 61 00 05 bg r3,r1,80344f0 <_Rate_monotonic_Update_statistics+0x88>
80344e0: 5c 61 00 06 bne r3,r1,80344f8 <_Rate_monotonic_Update_statistics+0x90><== NEVER TAKEN
80344e4: 29 63 00 64 lw r3,(r11+100)
80344e8: 54 62 00 02 bgu r3,r2,80344f0 <_Rate_monotonic_Update_statistics+0x88>
80344ec: e0 00 00 03 bi 80344f8 <_Rate_monotonic_Update_statistics+0x90>
stats->min_cpu_time = executed;
80344f0: 59 61 00 60 sw (r11+96),r1
80344f4: 59 62 00 64 sw (r11+100),r2
if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) )
80344f8: 29 63 00 68 lw r3,(r11+104)
80344fc: 48 23 00 05 bg r1,r3,8034510 <_Rate_monotonic_Update_statistics+0xa8><== NEVER TAKEN
8034500: 5c 61 00 06 bne r3,r1,8034518 <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN
8034504: 29 63 00 6c lw r3,(r11+108)
8034508: 54 43 00 02 bgu r2,r3,8034510 <_Rate_monotonic_Update_statistics+0xa8>
803450c: e0 00 00 03 bi 8034518 <_Rate_monotonic_Update_statistics+0xb0>
stats->max_cpu_time = executed;
8034510: 59 61 00 68 sw (r11+104),r1
8034514: 59 62 00 6c sw (r11+108),r2
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
8034518: 2b 82 00 10 lw r2,(sp+16)
803451c: 29 63 00 8c lw r3,(r11+140)
8034520: 29 64 00 88 lw r4,(r11+136)
8034524: 2b 81 00 0c lw r1,(sp+12)
8034528: b4 43 18 00 add r3,r2,r3
803452c: f4 43 28 00 cmpgu r5,r2,r3
8034530: b4 24 20 00 add r4,r1,r4
8034534: 59 63 00 8c sw (r11+140),r3
* Update Wall time
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Add_to( &stats->total_wall_time, &since_last_period );
if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) )
8034538: 29 63 00 78 lw r3,(r11+120)
803453c: b4 a4 20 00 add r4,r5,r4
8034540: 59 64 00 88 sw (r11+136),r4
8034544: 48 61 00 05 bg r3,r1,8034558 <_Rate_monotonic_Update_statistics+0xf0>
8034548: 5c 61 00 06 bne r3,r1,8034560 <_Rate_monotonic_Update_statistics+0xf8><== NEVER TAKEN
803454c: 29 63 00 7c lw r3,(r11+124)
8034550: 54 62 00 02 bgu r3,r2,8034558 <_Rate_monotonic_Update_statistics+0xf0>
8034554: e0 00 00 03 bi 8034560 <_Rate_monotonic_Update_statistics+0xf8>
stats->min_wall_time = since_last_period;
8034558: 59 61 00 78 sw (r11+120),r1
803455c: 59 62 00 7c sw (r11+124),r2
if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) )
8034560: 29 63 00 80 lw r3,(r11+128)
8034564: 48 23 00 05 bg r1,r3,8034578 <_Rate_monotonic_Update_statistics+0x110><== NEVER TAKEN
8034568: 5c 61 00 06 bne r3,r1,8034580 <_Rate_monotonic_Update_statistics+0x118><== NEVER TAKEN
803456c: 29 63 00 84 lw r3,(r11+132)
8034570: 54 43 00 02 bgu r2,r3,8034578 <_Rate_monotonic_Update_statistics+0x110>
8034574: e0 00 00 03 bi 8034580 <_Rate_monotonic_Update_statistics+0x118>
stats->max_wall_time = since_last_period;
8034578: 59 61 00 80 sw (r11+128),r1
803457c: 59 62 00 84 sw (r11+132),r2
stats->min_wall_time = since_last_period;
if ( since_last_period > stats->max_wall_time )
stats->max_wall_time = since_last_period;
#endif
}
8034580: 2b 9d 00 04 lw ra,(sp+4)
8034584: 2b 8b 00 08 lw r11,(sp+8)
8034588: 37 9c 00 18 addi sp,sp,24
803458c: c3 a0 00 00 ret
0800677c <_Scheduler_CBS_Allocate>:
#include <rtems/score/wkspace.h>
void *_Scheduler_CBS_Allocate(
Thread_Control *the_thread
)
{
800677c: 37 9c ff f8 addi sp,sp,-8
8006780: 5b 8b 00 08 sw (sp+8),r11
8006784: 5b 9d 00 04 sw (sp+4),ra
8006788: b8 20 58 00 mv r11,r1
void *sched;
Scheduler_CBS_Per_thread *schinfo;
sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread));
800678c: 34 01 00 1c mvi r1,28
8006790: f8 00 07 c0 calli 8008690 <_Workspace_Allocate>
if ( sched ) {
8006794: 44 20 00 06 be r1,r0,80067ac <_Scheduler_CBS_Allocate+0x30><== NEVER TAKEN
the_thread->scheduler_info = sched;
8006798: 59 61 00 88 sw (r11+136),r1
schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info);
schinfo->edf_per_thread.thread = the_thread;
schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
800679c: 34 02 00 02 mvi r2,2
sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread));
if ( sched ) {
the_thread->scheduler_info = sched;
schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info);
schinfo->edf_per_thread.thread = the_thread;
80067a0: 58 2b 00 00 sw (r1+0),r11
schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
80067a4: 58 22 00 14 sw (r1+20),r2
schinfo->cbs_server = NULL;
80067a8: 58 20 00 18 sw (r1+24),r0
}
return sched;
}
80067ac: 2b 9d 00 04 lw ra,(sp+4)
80067b0: 2b 8b 00 08 lw r11,(sp+8)
80067b4: 37 9c 00 08 addi sp,sp,8
80067b8: c3 a0 00 00 ret
08007f08 <_Scheduler_CBS_Budget_callout>:
Scheduler_CBS_Server **_Scheduler_CBS_Server_list;
void _Scheduler_CBS_Budget_callout(
Thread_Control *the_thread
)
{
8007f08: 37 9c ff f4 addi sp,sp,-12
8007f0c: 5b 8b 00 08 sw (sp+8),r11
8007f10: 5b 9d 00 04 sw (sp+4),ra
8007f14: b8 20 58 00 mv r11,r1
Priority_Control new_priority;
Scheduler_CBS_Per_thread *sched_info;
Scheduler_CBS_Server_id server_id;
/* Put violating task to background until the end of period. */
new_priority = the_thread->Start.initial_priority;
8007f18: 28 22 00 ac lw r2,(r1+172)
if ( the_thread->real_priority != new_priority )
8007f1c: 28 21 00 18 lw r1,(r1+24)
8007f20: 44 22 00 02 be r1,r2,8007f28 <_Scheduler_CBS_Budget_callout+0x20><== NEVER TAKEN
the_thread->real_priority = new_priority;
8007f24: 59 62 00 18 sw (r11+24),r2
if ( the_thread->current_priority != new_priority )
8007f28: 29 61 00 14 lw r1,(r11+20)
8007f2c: 44 22 00 04 be r1,r2,8007f3c <_Scheduler_CBS_Budget_callout+0x34><== NEVER TAKEN
_Thread_Change_priority(the_thread, new_priority, true);
8007f30: b9 60 08 00 mv r1,r11
8007f34: 34 03 00 01 mvi r3,1
8007f38: f8 00 01 a8 calli 80085d8 <_Thread_Change_priority>
/* Invoke callback function if any. */
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
8007f3c: 29 6b 00 88 lw r11,(r11+136)
if ( sched_info->cbs_server->cbs_budget_overrun ) {
8007f40: 29 61 00 18 lw r1,(r11+24)
8007f44: 28 22 00 0c lw r2,(r1+12)
8007f48: 44 40 00 08 be r2,r0,8007f68 <_Scheduler_CBS_Budget_callout+0x60><== NEVER TAKEN
_Scheduler_CBS_Get_server_id(
8007f4c: 28 21 00 00 lw r1,(r1+0)
8007f50: 37 82 00 0c addi r2,sp,12
8007f54: fb ff ff d9 calli 8007eb8 <_Scheduler_CBS_Get_server_id>
sched_info->cbs_server->task_id,
&server_id
);
sched_info->cbs_server->cbs_budget_overrun( server_id );
8007f58: 29 61 00 18 lw r1,(r11+24)
8007f5c: 28 22 00 0c lw r2,(r1+12)
8007f60: 2b 81 00 0c lw r1,(sp+12)
8007f64: d8 40 00 00 call r2
}
}
8007f68: 2b 9d 00 04 lw ra,(sp+4)
8007f6c: 2b 8b 00 08 lw r11,(sp+8)
8007f70: 37 9c 00 0c addi sp,sp,12
8007f74: c3 a0 00 00 ret
080079d8 <_Scheduler_CBS_Create_server>:
int _Scheduler_CBS_Create_server (
Scheduler_CBS_Parameters *params,
Scheduler_CBS_Budget_overrun budget_overrun_callback,
rtems_id *server_id
)
{
80079d8: 37 9c ff e8 addi sp,sp,-24
80079dc: 5b 8b 00 18 sw (sp+24),r11
80079e0: 5b 8c 00 14 sw (sp+20),r12
80079e4: 5b 8d 00 10 sw (sp+16),r13
80079e8: 5b 8e 00 0c sw (sp+12),r14
80079ec: 5b 8f 00 08 sw (sp+8),r15
80079f0: 5b 9d 00 04 sw (sp+4),ra
80079f4: b8 20 58 00 mv r11,r1
unsigned int i;
Scheduler_CBS_Server *the_server;
if ( params->budget <= 0 ||
80079f8: 28 21 00 04 lw r1,(r1+4)
int _Scheduler_CBS_Create_server (
Scheduler_CBS_Parameters *params,
Scheduler_CBS_Budget_overrun budget_overrun_callback,
rtems_id *server_id
)
{
80079fc: b8 40 70 00 mv r14,r2
8007a00: b8 60 68 00 mv r13,r3
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;
8007a04: 34 04 ff ee mvi r4,-18
)
{
unsigned int i;
Scheduler_CBS_Server *the_server;
if ( params->budget <= 0 ||
8007a08: 4c 01 00 2c bge r0,r1,8007ab8 <_Scheduler_CBS_Create_server+0xe0>
8007a0c: 29 61 00 00 lw r1,(r11+0)
8007a10: 4c 01 00 2a bge r0,r1,8007ab8 <_Scheduler_CBS_Create_server+0xe0>
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++ ) {
8007a14: 78 01 08 02 mvhi r1,0x802
8007a18: 38 21 30 18 ori r1,r1,0x3018
8007a1c: 28 23 00 00 lw r3,(r1+0)
8007a20: 78 01 08 02 mvhi r1,0x802
8007a24: 38 21 3e e8 ori r1,r1,0x3ee8
8007a28: 28 24 00 00 lw r4,(r1+0)
if ( !_Scheduler_CBS_Server_list[i] )
8007a2c: 34 01 00 00 mvi r1,0
8007a30: e0 00 00 05 bi 8007a44 <_Scheduler_CBS_Create_server+0x6c>
8007a34: 28 82 00 00 lw r2,(r4+0)
8007a38: 34 84 00 04 addi r4,r4,4
8007a3c: 44 40 00 03 be r2,r0,8007a48 <_Scheduler_CBS_Create_server+0x70>
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++ ) {
8007a40: 34 21 00 01 addi r1,r1,1
8007a44: 54 61 ff fc bgu r3,r1,8007a34 <_Scheduler_CBS_Create_server+0x5c>
if ( !_Scheduler_CBS_Server_list[i] )
break;
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
8007a48: 34 04 ff e6 mvi r4,-26
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
if ( !_Scheduler_CBS_Server_list[i] )
break;
}
if ( i == _Scheduler_CBS_Maximum_servers )
8007a4c: 44 23 00 1b be r1,r3,8007ab8 <_Scheduler_CBS_Create_server+0xe0>
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
8007a50: 78 0c 08 02 mvhi r12,0x802
8007a54: 34 02 00 02 mvi r2,2
8007a58: 39 8c 3e e8 ori r12,r12,0x3ee8
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
8007a5c: 59 a1 00 00 sw (r13+0),r1
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
8007a60: fb ff e7 4f calli 800179c <__ashlsi3>
8007a64: 29 8f 00 00 lw r15,(r12+0)
8007a68: b5 e1 78 00 add r15,r15,r1
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
8007a6c: 34 01 00 10 mvi r1,16
8007a70: f8 00 09 15 calli 8009ec4 <_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 *)
8007a74: 59 e1 00 00 sw (r15+0),r1
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
8007a78: 29 a1 00 00 lw r1,(r13+0)
8007a7c: 29 8c 00 00 lw r12,(r12+0)
8007a80: 34 02 00 02 mvi r2,2
8007a84: fb ff e7 46 calli 800179c <__ashlsi3>
8007a88: b5 81 08 00 add r1,r12,r1
8007a8c: 28 21 00 00 lw r1,(r1+0)
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
8007a90: 34 04 ff ef mvi r4,-17
*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 )
8007a94: 44 20 00 09 be r1,r0,8007ab8 <_Scheduler_CBS_Create_server+0xe0><== NEVER TAKEN
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
8007a98: 29 62 00 00 lw r2,(r11+0)
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
8007a9c: 34 04 00 00 mvi r4,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;
8007aa0: 58 22 00 04 sw (r1+4),r2
8007aa4: 29 62 00 04 lw r2,(r11+4)
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
8007aa8: 58 2e 00 0c sw (r1+12),r14
_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;
8007aac: 58 22 00 08 sw (r1+8),r2
the_server->task_id = -1;
8007ab0: 34 02 ff ff mvi r2,-1
8007ab4: 58 22 00 00 sw (r1+0),r2
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
}
8007ab8: b8 80 08 00 mv r1,r4
8007abc: 2b 9d 00 04 lw ra,(sp+4)
8007ac0: 2b 8b 00 18 lw r11,(sp+24)
8007ac4: 2b 8c 00 14 lw r12,(sp+20)
8007ac8: 2b 8d 00 10 lw r13,(sp+16)
8007acc: 2b 8e 00 0c lw r14,(sp+12)
8007ad0: 2b 8f 00 08 lw r15,(sp+8)
8007ad4: 37 9c 00 18 addi sp,sp,24
8007ad8: c3 a0 00 00 ret
08007b8c <_Scheduler_CBS_Detach_thread>:
int _Scheduler_CBS_Detach_thread (
Scheduler_CBS_Server_id server_id,
rtems_id task_id
)
{
8007b8c: 37 9c ff e8 addi sp,sp,-24
8007b90: 5b 8b 00 14 sw (sp+20),r11
8007b94: 5b 8c 00 10 sw (sp+16),r12
8007b98: 5b 8d 00 0c sw (sp+12),r13
8007b9c: 5b 8e 00 08 sw (sp+8),r14
8007ba0: 5b 9d 00 04 sw (sp+4),ra
8007ba4: b8 20 68 00 mv r13,r1
8007ba8: b8 40 60 00 mv r12,r2
Objects_Locations location;
Thread_Control *the_thread;
Scheduler_CBS_Per_thread *sched_info;
the_thread = _Thread_Get(task_id, &location);
8007bac: b8 40 08 00 mv r1,r2
8007bb0: 37 82 00 18 addi r2,sp,24
8007bb4: f8 00 03 f8 calli 8008b94 <_Thread_Get>
8007bb8: b8 20 58 00 mv r11,r1
/* The routine _Thread_Get may disable dispatch and not enable again. */
if ( the_thread ) {
8007bbc: 44 20 00 02 be r1,r0,8007bc4 <_Scheduler_CBS_Detach_thread+0x38>
_Thread_Enable_dispatch();
8007bc0: f8 00 03 e9 calli 8008b64 <_Thread_Enable_dispatch>
}
if ( server_id >= _Scheduler_CBS_Maximum_servers )
8007bc4: 78 03 08 02 mvhi r3,0x802
8007bc8: 38 63 30 18 ori r3,r3,0x3018
8007bcc: 28 61 00 00 lw r1,(r3+0)
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
8007bd0: 34 03 ff ee mvi r3,-18
/* The routine _Thread_Get may disable dispatch and not enable again. */
if ( the_thread ) {
_Thread_Enable_dispatch();
}
if ( server_id >= _Scheduler_CBS_Maximum_servers )
8007bd4: 51 a1 00 1a bgeu r13,r1,8007c3c <_Scheduler_CBS_Detach_thread+0xb0>
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
if ( !the_thread )
8007bd8: 45 60 00 19 be r11,r0,8007c3c <_Scheduler_CBS_Detach_thread+0xb0>
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
/* Server is not valid. */
if ( !_Scheduler_CBS_Server_list[server_id] )
8007bdc: 78 03 08 02 mvhi r3,0x802
8007be0: 38 63 3e e8 ori r3,r3,0x3ee8
8007be4: 28 6e 00 00 lw r14,(r3+0)
8007be8: b9 a0 08 00 mv r1,r13
8007bec: 34 02 00 02 mvi r2,2
8007bf0: fb ff e6 eb calli 800179c <__ashlsi3>
8007bf4: b5 c1 08 00 add r1,r14,r1
8007bf8: 28 24 00 00 lw r4,(r1+0)
return SCHEDULER_CBS_ERROR_NOSERVER;
8007bfc: 34 03 ff e7 mvi r3,-25
if ( server_id >= _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
if ( !the_thread )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
/* Server is not valid. */
if ( !_Scheduler_CBS_Server_list[server_id] )
8007c00: 44 80 00 0f be r4,r0,8007c3c <_Scheduler_CBS_Detach_thread+0xb0>
return SCHEDULER_CBS_ERROR_NOSERVER;
/* Thread and server are not attached. */
if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id )
8007c04: 28 81 00 00 lw r1,(r4+0)
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
8007c08: 34 03 ff ee mvi r3,-18
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
/* Server is not valid. */
if ( !_Scheduler_CBS_Server_list[server_id] )
return SCHEDULER_CBS_ERROR_NOSERVER;
/* Thread and server are not attached. */
if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id )
8007c0c: 5c 2c 00 0c bne r1,r12,8007c3c <_Scheduler_CBS_Detach_thread+0xb0><== NEVER TAKEN
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
_Scheduler_CBS_Server_list[server_id]->task_id = -1;
8007c10: 34 01 ff ff mvi r1,-1
8007c14: 58 81 00 00 sw (r4+0),r1
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
sched_info->cbs_server = NULL;
8007c18: 29 61 00 88 lw r1,(r11+136)
the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
the_thread->budget_callout = the_thread->Start.budget_callout;
the_thread->is_preemptible = the_thread->Start.is_preemptible;
return SCHEDULER_CBS_OK;
8007c1c: 34 03 00 00 mvi r3,0
if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
_Scheduler_CBS_Server_list[server_id]->task_id = -1;
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
sched_info->cbs_server = NULL;
8007c20: 58 20 00 18 sw (r1+24),r0
the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
8007c24: 29 61 00 a0 lw r1,(r11+160)
8007c28: 59 61 00 78 sw (r11+120),r1
the_thread->budget_callout = the_thread->Start.budget_callout;
8007c2c: 29 61 00 a4 lw r1,(r11+164)
8007c30: 59 61 00 7c sw (r11+124),r1
the_thread->is_preemptible = the_thread->Start.is_preemptible;
8007c34: 41 61 00 9c lbu r1,(r11+156)
8007c38: 31 61 00 70 sb (r11+112),r1
return SCHEDULER_CBS_OK;
}
8007c3c: b8 60 08 00 mv r1,r3
8007c40: 2b 9d 00 04 lw ra,(sp+4)
8007c44: 2b 8b 00 14 lw r11,(sp+20)
8007c48: 2b 8c 00 10 lw r12,(sp+16)
8007c4c: 2b 8d 00 0c lw r13,(sp+12)
8007c50: 2b 8e 00 08 lw r14,(sp+8)
8007c54: 37 9c 00 18 addi sp,sp,24
8007c58: c3 a0 00 00 ret
08007f78 <_Scheduler_CBS_Initialize>:
int _Scheduler_CBS_Initialize(void)
{
8007f78: 37 9c ff f8 addi sp,sp,-8
8007f7c: 5b 8b 00 08 sw (sp+8),r11
8007f80: 5b 9d 00 04 sw (sp+4),ra
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
8007f84: 78 0b 08 02 mvhi r11,0x802
8007f88: 39 6b 30 18 ori r11,r11,0x3018
8007f8c: 29 61 00 00 lw r1,(r11+0)
8007f90: 34 02 00 02 mvi r2,2
8007f94: fb ff e6 02 calli 800179c <__ashlsi3>
}
int _Scheduler_CBS_Initialize(void)
{
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
8007f98: f8 00 07 cb calli 8009ec4 <_Workspace_Allocate>
8007f9c: 78 02 08 02 mvhi r2,0x802
8007fa0: 38 42 3e e8 ori r2,r2,0x3ee8
8007fa4: 58 41 00 00 sw (r2+0),r1
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
8007fa8: 34 02 ff ef mvi r2,-17
int _Scheduler_CBS_Initialize(void)
{
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
8007fac: 44 20 00 09 be r1,r0,8007fd0 <_Scheduler_CBS_Initialize+0x58><== NEVER TAKEN
return SCHEDULER_CBS_ERROR_NO_MEMORY;
for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) {
8007fb0: 29 63 00 00 lw r3,(r11+0)
8007fb4: 34 02 00 00 mvi r2,0
8007fb8: e0 00 00 04 bi 8007fc8 <_Scheduler_CBS_Initialize+0x50>
_Scheduler_CBS_Server_list[i] = NULL;
8007fbc: 58 20 00 00 sw (r1+0),r0
unsigned int i;
_Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate(
_Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) );
if ( !_Scheduler_CBS_Server_list )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) {
8007fc0: 34 42 00 01 addi r2,r2,1
8007fc4: 34 21 00 04 addi r1,r1,4
8007fc8: 54 62 ff fd bgu r3,r2,8007fbc <_Scheduler_CBS_Initialize+0x44>
_Scheduler_CBS_Server_list[i] = NULL;
}
return SCHEDULER_CBS_OK;
8007fcc: 34 02 00 00 mvi r2,0
}
8007fd0: b8 40 08 00 mv r1,r2
8007fd4: 2b 9d 00 04 lw ra,(sp+4)
8007fd8: 2b 8b 00 08 lw r11,(sp+8)
8007fdc: 37 9c 00 08 addi sp,sp,8
8007fe0: c3 a0 00 00 ret
080067bc <_Scheduler_CBS_Release_job>:
void _Scheduler_CBS_Release_job(
Thread_Control *the_thread,
uint32_t deadline
)
{
80067bc: 37 9c ff fc addi sp,sp,-4
80067c0: 5b 9d 00 04 sw (sp+4),ra
80067c4: b8 40 20 00 mv r4,r2
Priority_Control new_priority;
Scheduler_CBS_Per_thread *sched_info =
(Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
Scheduler_CBS_Server *serv_info =
(Scheduler_CBS_Server *) sched_info->cbs_server;
80067c8: 28 22 00 88 lw r2,(r1+136)
)
{
Priority_Control new_priority;
Scheduler_CBS_Per_thread *sched_info =
(Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
Scheduler_CBS_Server *serv_info =
80067cc: 28 43 00 18 lw r3,(r2+24)
(Scheduler_CBS_Server *) sched_info->cbs_server;
if (deadline) {
80067d0: 44 80 00 13 be r4,r0,800681c <_Scheduler_CBS_Release_job+0x60>
80067d4: 78 02 08 02 mvhi r2,0x802
80067d8: 38 42 1a c8 ori r2,r2,0x1ac8
/* Initializing or shifting deadline. */
if (serv_info)
80067dc: 44 60 00 09 be r3,r0,8006800 <_Scheduler_CBS_Release_job+0x44>
new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline)
80067e0: 28 64 00 04 lw r4,(r3+4)
80067e4: 28 42 00 00 lw r2,(r2+0)
80067e8: 78 05 08 01 mvhi r5,0x801
80067ec: 38 a5 f1 a4 ori r5,r5,0xf1a4
80067f0: b4 44 10 00 add r2,r2,r4
80067f4: 28 a4 00 00 lw r4,(r5+0)
80067f8: a0 44 10 00 and r2,r2,r4
80067fc: e0 00 00 0a bi 8006824 <_Scheduler_CBS_Release_job+0x68>
& ~SCHEDULER_EDF_PRIO_MSB;
else
new_priority = (_Watchdog_Ticks_since_boot + deadline)
8006800: 28 42 00 00 lw r2,(r2+0)
8006804: b4 82 10 00 add r2,r4,r2
8006808: 78 04 08 01 mvhi r4,0x801
800680c: 38 84 f1 a4 ori r4,r4,0xf1a4
8006810: 28 83 00 00 lw r3,(r4+0)
8006814: a0 43 10 00 and r2,r2,r3
8006818: e0 00 00 05 bi 800682c <_Scheduler_CBS_Release_job+0x70>
& ~SCHEDULER_EDF_PRIO_MSB;
}
else {
/* Switch back to background priority. */
new_priority = the_thread->Start.initial_priority;
800681c: 28 22 00 ac lw r2,(r1+172)
}
/* Budget replenishment for the next job. */
if (serv_info)
8006820: 44 64 00 03 be r3,r4,800682c <_Scheduler_CBS_Release_job+0x70><== NEVER TAKEN
the_thread->cpu_time_budget = serv_info->parameters.budget;
8006824: 28 63 00 08 lw r3,(r3+8)
8006828: 58 23 00 74 sw (r1+116),r3
the_thread->real_priority = new_priority;
800682c: 58 22 00 18 sw (r1+24),r2
_Thread_Change_priority(the_thread, new_priority, true);
8006830: 34 03 00 01 mvi r3,1
8006834: f8 00 01 3c calli 8006d24 <_Thread_Change_priority>
}
8006838: 2b 9d 00 04 lw ra,(sp+4)
800683c: 37 9c 00 04 addi sp,sp,4
8006840: c3 a0 00 00 ret
08006844 <_Scheduler_CBS_Unblock>:
#include <rtems/score/schedulercbs.h>
void _Scheduler_CBS_Unblock(
Thread_Control *the_thread
)
{
8006844: 37 9c ff ec addi sp,sp,-20
8006848: 5b 8b 00 14 sw (sp+20),r11
800684c: 5b 8c 00 10 sw (sp+16),r12
8006850: 5b 8d 00 0c sw (sp+12),r13
8006854: 5b 8e 00 08 sw (sp+8),r14
8006858: 5b 9d 00 04 sw (sp+4),ra
800685c: b8 20 58 00 mv r11,r1
Scheduler_CBS_Per_thread *sched_info;
Scheduler_CBS_Server *serv_info;
Priority_Control new_priority;
_Scheduler_EDF_Enqueue(the_thread);
8006860: f8 00 00 4d calli 8006994 <_Scheduler_EDF_Enqueue>
/* TODO: flash critical section? */
sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server;
8006864: 29 61 00 88 lw r1,(r11+136)
8006868: 28 2c 00 18 lw r12,(r1+24)
* Late unblock rule for deadline-driven tasks. The remaining time to
* deadline must be sufficient to serve the remaining computation time
* without increased utilization of this task. It might cause a deadline
* miss of another task.
*/
if (serv_info) {
800686c: 45 80 00 15 be r12,r0,80068c0 <_Scheduler_CBS_Unblock+0x7c>
time_t deadline = serv_info->parameters.deadline;
time_t budget = serv_info->parameters.budget;
time_t deadline_left = the_thread->cpu_time_budget;
time_t budget_left = the_thread->real_priority -
8006870: 78 01 08 02 mvhi r1,0x802
8006874: 38 21 1a c8 ori r1,r1,0x1ac8
8006878: 28 21 00 00 lw r1,(r1+0)
800687c: 29 6d 00 18 lw r13,(r11+24)
_Watchdog_Ticks_since_boot;
if ( deadline*budget_left > budget*deadline_left ) {
8006880: 29 82 00 04 lw r2,(r12+4)
8006884: c9 a1 08 00 sub r1,r13,r1
8006888: fb ff e8 d2 calli 8000bd0 <__mulsi3>
800688c: b8 20 70 00 mv r14,r1
8006890: 29 82 00 08 lw r2,(r12+8)
8006894: 29 61 00 74 lw r1,(r11+116)
8006898: fb ff e8 ce calli 8000bd0 <__mulsi3>
800689c: 4c 2e 00 09 bge r1,r14,80068c0 <_Scheduler_CBS_Unblock+0x7c>
/* Put late unblocked task to background until the end of period. */
new_priority = the_thread->Start.initial_priority;
80068a0: 29 62 00 ac lw r2,(r11+172)
if ( the_thread->real_priority != new_priority )
80068a4: 45 a2 00 02 be r13,r2,80068ac <_Scheduler_CBS_Unblock+0x68>
the_thread->real_priority = new_priority;
80068a8: 59 62 00 18 sw (r11+24),r2
if ( the_thread->current_priority != new_priority )
80068ac: 29 61 00 14 lw r1,(r11+20)
80068b0: 44 22 00 04 be r1,r2,80068c0 <_Scheduler_CBS_Unblock+0x7c>
_Thread_Change_priority(the_thread, new_priority, true);
80068b4: b9 60 08 00 mv r1,r11
80068b8: 34 03 00 01 mvi r3,1
80068bc: f8 00 01 1a calli 8006d24 <_Thread_Change_priority>
* a context switch.
* Pseudo-ISR case:
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority,
80068c0: 78 0c 08 02 mvhi r12,0x802
80068c4: 39 8c 1e 80 ori r12,r12,0x1e80
80068c8: 29 82 00 14 lw r2,(r12+20)
80068cc: 78 01 08 02 mvhi r1,0x802
80068d0: 38 21 10 1c ori r1,r1,0x101c
80068d4: 28 23 00 30 lw r3,(r1+48)
80068d8: 28 42 00 14 lw r2,(r2+20)
80068dc: 29 61 00 14 lw r1,(r11+20)
80068e0: d8 60 00 00 call r3
80068e4: 4c 01 00 0b bge r0,r1,8006910 <_Scheduler_CBS_Unblock+0xcc>
_Thread_Heir->current_priority)) {
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
80068e8: 29 81 00 10 lw r1,(r12+16)
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority,
_Thread_Heir->current_priority)) {
_Thread_Heir = the_thread;
80068ec: 59 8b 00 14 sw (r12+20),r11
if ( _Thread_Executing->is_preemptible ||
80068f0: 40 21 00 70 lbu r1,(r1+112)
80068f4: 5c 20 00 03 bne r1,r0,8006900 <_Scheduler_CBS_Unblock+0xbc>
80068f8: 29 62 00 14 lw r2,(r11+20)
80068fc: 5c 41 00 05 bne r2,r1,8006910 <_Scheduler_CBS_Unblock+0xcc><== ALWAYS TAKEN
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
8006900: 78 01 08 02 mvhi r1,0x802
8006904: 38 21 1e 80 ori r1,r1,0x1e80
8006908: 34 02 00 01 mvi r2,1
800690c: 30 22 00 0c sb (r1+12),r2
}
}
8006910: 2b 9d 00 04 lw ra,(sp+4)
8006914: 2b 8b 00 14 lw r11,(sp+20)
8006918: 2b 8c 00 10 lw r12,(sp+16)
800691c: 2b 8d 00 0c lw r13,(sp+12)
8006920: 2b 8e 00 08 lw r14,(sp+8)
8006924: 37 9c 00 14 addi sp,sp,20
8006928: c3 a0 00 00 ret
0800677c <_Scheduler_EDF_Allocate>:
#include <rtems/score/wkspace.h>
void *_Scheduler_EDF_Allocate(
Thread_Control *the_thread
)
{
800677c: 37 9c ff f8 addi sp,sp,-8
8006780: 5b 8b 00 08 sw (sp+8),r11
8006784: 5b 9d 00 04 sw (sp+4),ra
8006788: b8 20 58 00 mv r11,r1
void *sched;
Scheduler_EDF_Per_thread *schinfo;
sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) );
800678c: 34 01 00 18 mvi r1,24
8006790: f8 00 07 95 calli 80085e4 <_Workspace_Allocate>
if ( sched ) {
8006794: 44 20 00 05 be r1,r0,80067a8 <_Scheduler_EDF_Allocate+0x2c><== NEVER TAKEN
the_thread->scheduler_info = sched;
8006798: 59 61 00 88 sw (r11+136),r1
schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info);
schinfo->thread = the_thread;
schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
800679c: 34 02 00 02 mvi r2,2
sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) );
if ( sched ) {
the_thread->scheduler_info = sched;
schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info);
schinfo->thread = the_thread;
80067a0: 58 2b 00 00 sw (r1+0),r11
schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
80067a4: 58 22 00 14 sw (r1+20),r2
}
return sched;
}
80067a8: 2b 9d 00 04 lw ra,(sp+4)
80067ac: 2b 8b 00 08 lw r11,(sp+8)
80067b0: 37 9c 00 08 addi sp,sp,8
80067b4: c3 a0 00 00 ret
080069c4 <_Scheduler_EDF_Unblock>:
#include <rtems/score/scheduleredf.h>
void _Scheduler_EDF_Unblock(
Thread_Control *the_thread
)
{
80069c4: 37 9c ff f4 addi sp,sp,-12
80069c8: 5b 8b 00 0c sw (sp+12),r11
80069cc: 5b 8c 00 08 sw (sp+8),r12
80069d0: 5b 9d 00 04 sw (sp+4),ra
* a context switch.
* Pseudo-ISR case:
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_lower_than(
80069d4: 78 0b 08 02 mvhi r11,0x802
#include <rtems/score/scheduleredf.h>
void _Scheduler_EDF_Unblock(
Thread_Control *the_thread
)
{
80069d8: b8 20 60 00 mv r12,r1
* a context switch.
* Pseudo-ISR case:
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_lower_than(
80069dc: 39 6b 1e 80 ori r11,r11,0x1e80
void _Scheduler_EDF_Unblock(
Thread_Control *the_thread
)
{
_Scheduler_EDF_Enqueue(the_thread);
80069e0: fb ff ff 90 calli 8006820 <_Scheduler_EDF_Enqueue>
* a context switch.
* Pseudo-ISR case:
* Even if the thread isn't preemptible, if the new heir is
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_lower_than(
80069e4: 29 62 00 14 lw r2,(r11+20)
80069e8: 78 01 08 02 mvhi r1,0x802
80069ec: 38 21 10 18 ori r1,r1,0x1018
80069f0: 28 23 00 30 lw r3,(r1+48)
80069f4: 28 41 00 14 lw r1,(r2+20)
80069f8: 29 82 00 14 lw r2,(r12+20)
80069fc: d8 60 00 00 call r3
8006a00: 4c 20 00 0b bge r1,r0,8006a2c <_Scheduler_EDF_Unblock+0x68>
_Thread_Heir->current_priority,
the_thread->current_priority )) {
_Thread_Heir = the_thread;
if ( _Thread_Executing->is_preemptible ||
8006a04: 29 61 00 10 lw r1,(r11+16)
* a pseudo-ISR system task, we need to do a context switch.
*/
if ( _Scheduler_Is_priority_lower_than(
_Thread_Heir->current_priority,
the_thread->current_priority )) {
_Thread_Heir = the_thread;
8006a08: 59 6c 00 14 sw (r11+20),r12
if ( _Thread_Executing->is_preemptible ||
8006a0c: 40 21 00 70 lbu r1,(r1+112)
8006a10: 5c 20 00 03 bne r1,r0,8006a1c <_Scheduler_EDF_Unblock+0x58>
8006a14: 29 82 00 14 lw r2,(r12+20)
8006a18: 5c 41 00 05 bne r2,r1,8006a2c <_Scheduler_EDF_Unblock+0x68><== ALWAYS TAKEN
the_thread->current_priority == 0 )
_Thread_Dispatch_necessary = true;
8006a1c: 78 01 08 02 mvhi r1,0x802
8006a20: 38 21 1e 80 ori r1,r1,0x1e80
8006a24: 34 02 00 01 mvi r2,1
8006a28: 30 22 00 0c sb (r1+12),r2
}
}
8006a2c: 2b 9d 00 04 lw ra,(sp+4)
8006a30: 2b 8b 00 0c lw r11,(sp+12)
8006a34: 2b 8c 00 08 lw r12,(sp+8)
8006a38: 37 9c 00 0c addi sp,sp,12
8006a3c: c3 a0 00 00 ret
08007070 <_Scheduler_priority_Block>:
#include <rtems/score/thread.h>
void _Scheduler_priority_Block(
Thread_Control *the_thread
)
{
8007070: 37 9c ff ec addi sp,sp,-20
8007074: 5b 8b 00 14 sw (sp+20),r11
8007078: 5b 8c 00 10 sw (sp+16),r12
800707c: 5b 8d 00 0c sw (sp+12),r13
8007080: 5b 8e 00 08 sw (sp+8),r14
8007084: 5b 9d 00 04 sw (sp+4),ra
8007088: b8 20 60 00 mv r12,r1
)
{
Scheduler_priority_Per_thread *sched_info;
Chain_Control *ready;
sched_info = (Scheduler_priority_Per_thread *) the_thread->scheduler_info;
800708c: 28 21 00 88 lw r1,(r1+136)
ready = sched_info->ready_chain;
8007090: 28 22 00 00 lw r2,(r1+0)
if ( _Chain_Has_only_one_node( ready ) ) {
8007094: 28 44 00 00 lw r4,(r2+0)
8007098: 28 43 00 08 lw r3,(r2+8)
800709c: 5c 83 00 12 bne r4,r3,80070e4 <_Scheduler_priority_Block+0x74>
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 );
80070a0: 34 43 00 04 addi r3,r2,4
head->next = tail;
80070a4: 58 43 00 00 sw (r2+0),r3
RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove (
Priority_bit_map_Information *the_priority_map
)
{
*the_priority_map->minor &= the_priority_map->block_minor;
80070a8: 28 23 00 04 lw r3,(r1+4)
head->previous = NULL;
80070ac: 58 40 00 04 sw (r2+4),r0
tail->previous = head;
80070b0: 58 42 00 08 sw (r2+8),r2
80070b4: 2c 24 00 0e lhu r4,(r1+14)
80070b8: 2c 62 00 00 lhu r2,(r3+0)
80070bc: a0 44 10 00 and r2,r2,r4
80070c0: 0c 62 00 00 sh (r3+0),r2
if ( *the_priority_map->minor == 0 )
80070c4: 5c 40 00 0c bne r2,r0,80070f4 <_Scheduler_priority_Block+0x84>
_Priority_Major_bit_map &= the_priority_map->block_major;
80070c8: 78 02 08 01 mvhi r2,0x801
80070cc: 38 42 ae 40 ori r2,r2,0xae40
80070d0: 2c 43 00 00 lhu r3,(r2+0)
80070d4: 2c 21 00 0c lhu r1,(r1+12)
80070d8: a0 23 08 00 and r1,r1,r3
80070dc: 0c 41 00 00 sh (r2+0),r1
80070e0: e0 00 00 05 bi 80070f4 <_Scheduler_priority_Block+0x84>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
80070e4: 29 82 00 00 lw r2,(r12+0)
previous = the_node->previous;
80070e8: 29 81 00 04 lw r1,(r12+4)
next->previous = previous;
80070ec: 58 41 00 04 sw (r2+4),r1
previous->next = next;
80070f0: 58 22 00 00 sw (r1+0),r2
RTEMS_INLINE_ROUTINE bool _Thread_Is_heir (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Heir );
80070f4: 78 01 08 01 mvhi r1,0x801
80070f8: 38 21 ae 00 ori r1,r1,0xae00
_Scheduler_priority_Ready_queue_extract( the_thread );
/* TODO: flash critical section? */
if ( _Thread_Is_heir( the_thread ) )
80070fc: 28 21 00 14 lw r1,(r1+20)
8007100: 5d 81 00 3b bne r12,r1,80071ec <_Scheduler_priority_Block+0x17c>
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
(Chain_Control *) _Scheduler.information
8007104: 78 01 08 01 mvhi r1,0x801
RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void )
{
Priority_bit_map_Control minor;
Priority_bit_map_Control major;
_Bitfield_Find_first_bit( _Priority_Major_bit_map, major );
8007108: 78 02 08 01 mvhi r2,0x801
800710c: 38 21 a0 18 ori r1,r1,0xa018
8007110: 38 42 ae 40 ori r2,r2,0xae40
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
8007114: 28 2e 00 00 lw r14,(r1+0)
8007118: 2c 41 00 00 lhu r1,(r2+0)
800711c: 78 0b 08 01 mvhi r11,0x801
8007120: 34 02 00 ff mvi r2,255
8007124: 20 21 ff ff andi r1,r1,0xffff
8007128: 39 6b 8b 3c ori r11,r11,0x8b3c
800712c: 54 22 00 05 bgu r1,r2,8007140 <_Scheduler_priority_Block+0xd0>
8007130: b5 61 58 00 add r11,r11,r1
8007134: 41 6d 00 00 lbu r13,(r11+0)
8007138: 35 ad 00 08 addi r13,r13,8
800713c: e0 00 00 05 bi 8007150 <_Scheduler_priority_Block+0xe0>
8007140: 34 02 00 08 mvi r2,8
8007144: f8 00 42 4d calli 8017a78 <__lshrsi3>
8007148: b5 61 58 00 add r11,r11,r1
800714c: 41 6d 00 00 lbu r13,(r11+0)
_Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
8007150: 34 02 00 01 mvi r2,1
8007154: 78 0b 08 01 mvhi r11,0x801
8007158: b9 a0 08 00 mv r1,r13
800715c: f8 00 41 f9 calli 8017940 <__ashlsi3>
8007160: 39 6b ae 60 ori r11,r11,0xae60
8007164: b5 61 58 00 add r11,r11,r1
8007168: 2d 62 00 00 lhu r2,(r11+0)
800716c: 34 01 00 ff mvi r1,255
8007170: 78 0b 08 01 mvhi r11,0x801
8007174: 39 6b 8b 3c ori r11,r11,0x8b3c
8007178: 54 41 00 05 bgu r2,r1,800718c <_Scheduler_priority_Block+0x11c>
800717c: b5 62 58 00 add r11,r11,r2
8007180: 41 6b 00 00 lbu r11,(r11+0)
8007184: 35 6b 00 08 addi r11,r11,8
8007188: e0 00 00 06 bi 80071a0 <_Scheduler_priority_Block+0x130>
800718c: b8 40 08 00 mv r1,r2
8007190: 34 02 00 08 mvi r2,8
8007194: f8 00 42 39 calli 8017a78 <__lshrsi3>
8007198: b5 61 58 00 add r11,r11,r1
800719c: 41 6b 00 00 lbu r11,(r11+0)
return (_Priority_Bits_index( major ) << 4) +
80071a0: 34 02 00 04 mvi r2,4
80071a4: b9 a0 08 00 mv r1,r13
80071a8: f8 00 41 e6 calli 8017940 <__ashlsi3>
80071ac: b5 61 58 00 add r11,r11,r1
Chain_Control *the_ready_queue
)
{
Priority_Control index = _Priority_bit_map_Get_highest();
if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) )
80071b0: 34 02 00 01 mvi r2,1
80071b4: b9 60 08 00 mv r1,r11
80071b8: f8 00 41 e2 calli 8017940 <__ashlsi3>
80071bc: 34 02 00 02 mvi r2,2
80071c0: b4 2b 08 00 add r1,r1,r11
80071c4: f8 00 41 df calli 8017940 <__ashlsi3>
80071c8: b5 c1 08 00 add r1,r14,r1
_Scheduler_priority_Schedule_body();
if ( _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
80071cc: 28 23 00 00 lw r3,(r1+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
80071d0: 34 21 00 04 addi r1,r1,4
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
return NULL;
80071d4: 34 02 00 00 mvi r2,0
Chain_Control *the_ready_queue
)
{
Priority_Control index = _Priority_bit_map_Get_highest();
if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) )
80071d8: 44 61 00 02 be r3,r1,80071e0 <_Scheduler_priority_Block+0x170><== NEVER TAKEN
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
80071dc: b8 60 10 00 mv r2,r3
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
80071e0: 78 01 08 01 mvhi r1,0x801
80071e4: 38 21 ae 00 ori r1,r1,0xae00
80071e8: 58 22 00 14 sw (r1+20),r2
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
80071ec: 78 01 08 01 mvhi r1,0x801
80071f0: 38 21 ae 00 ori r1,r1,0xae00
/* TODO: flash critical section? */
if ( _Thread_Is_heir( the_thread ) )
_Scheduler_priority_Schedule_body();
if ( _Thread_Is_executing( the_thread ) )
80071f4: 28 22 00 10 lw r2,(r1+16)
80071f8: 5d 82 00 03 bne r12,r2,8007204 <_Scheduler_priority_Block+0x194>
_Thread_Dispatch_necessary = true;
80071fc: 34 02 00 01 mvi r2,1
8007200: 30 22 00 0c sb (r1+12),r2
}
8007204: 2b 9d 00 04 lw ra,(sp+4)
8007208: 2b 8b 00 14 lw r11,(sp+20)
800720c: 2b 8c 00 10 lw r12,(sp+16)
8007210: 2b 8d 00 0c lw r13,(sp+12)
8007214: 2b 8e 00 08 lw r14,(sp+8)
8007218: 37 9c 00 14 addi sp,sp,20
800721c: c3 a0 00 00 ret
08007400 <_Scheduler_priority_Schedule>:
#include <rtems/system.h>
#include <rtems/score/scheduler.h>
#include <rtems/score/schedulerpriority.h>
void _Scheduler_priority_Schedule(void)
{
8007400: 37 9c ff f0 addi sp,sp,-16
8007404: 5b 8b 00 10 sw (sp+16),r11
8007408: 5b 8c 00 0c sw (sp+12),r12
800740c: 5b 8d 00 08 sw (sp+8),r13
8007410: 5b 9d 00 04 sw (sp+4),ra
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
(Chain_Control *) _Scheduler.information
8007414: 78 01 08 01 mvhi r1,0x801
RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void )
{
Priority_bit_map_Control minor;
Priority_bit_map_Control major;
_Bitfield_Find_first_bit( _Priority_Major_bit_map, major );
8007418: 78 02 08 01 mvhi r2,0x801
800741c: 38 21 a0 18 ori r1,r1,0xa018
8007420: 38 42 ae 40 ori r2,r2,0xae40
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
8007424: 28 2d 00 00 lw r13,(r1+0)
8007428: 2c 41 00 00 lhu r1,(r2+0)
800742c: 78 0b 08 01 mvhi r11,0x801
8007430: 34 02 00 ff mvi r2,255
8007434: 20 21 ff ff andi r1,r1,0xffff
8007438: 39 6b 8b 3c ori r11,r11,0x8b3c
800743c: 54 22 00 05 bgu r1,r2,8007450 <_Scheduler_priority_Schedule+0x50>
8007440: b5 61 58 00 add r11,r11,r1
8007444: 41 6c 00 00 lbu r12,(r11+0)
8007448: 35 8c 00 08 addi r12,r12,8
800744c: e0 00 00 05 bi 8007460 <_Scheduler_priority_Schedule+0x60>
8007450: 34 02 00 08 mvi r2,8
8007454: f8 00 41 89 calli 8017a78 <__lshrsi3>
8007458: b5 61 58 00 add r11,r11,r1
800745c: 41 6c 00 00 lbu r12,(r11+0)
_Bitfield_Find_first_bit( _Priority_Bit_map[major], minor );
8007460: 34 02 00 01 mvi r2,1
8007464: 78 0b 08 01 mvhi r11,0x801
8007468: b9 80 08 00 mv r1,r12
800746c: f8 00 41 35 calli 8017940 <__ashlsi3>
8007470: 39 6b ae 60 ori r11,r11,0xae60
8007474: b5 61 58 00 add r11,r11,r1
8007478: 2d 62 00 00 lhu r2,(r11+0)
800747c: 34 01 00 ff mvi r1,255
8007480: 78 0b 08 01 mvhi r11,0x801
8007484: 39 6b 8b 3c ori r11,r11,0x8b3c
8007488: 54 41 00 05 bgu r2,r1,800749c <_Scheduler_priority_Schedule+0x9c>
800748c: b5 62 58 00 add r11,r11,r2
8007490: 41 6b 00 00 lbu r11,(r11+0)
8007494: 35 6b 00 08 addi r11,r11,8
8007498: e0 00 00 06 bi 80074b0 <_Scheduler_priority_Schedule+0xb0>
800749c: b8 40 08 00 mv r1,r2
80074a0: 34 02 00 08 mvi r2,8
80074a4: f8 00 41 75 calli 8017a78 <__lshrsi3>
80074a8: b5 61 58 00 add r11,r11,r1
80074ac: 41 6b 00 00 lbu r11,(r11+0)
return (_Priority_Bits_index( major ) << 4) +
80074b0: 34 02 00 04 mvi r2,4
80074b4: b9 80 08 00 mv r1,r12
80074b8: f8 00 41 22 calli 8017940 <__ashlsi3>
80074bc: b5 61 58 00 add r11,r11,r1
Chain_Control *the_ready_queue
)
{
Priority_Control index = _Priority_bit_map_Get_highest();
if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) )
80074c0: 34 02 00 01 mvi r2,1
80074c4: b9 60 08 00 mv r1,r11
80074c8: f8 00 41 1e calli 8017940 <__ashlsi3>
80074cc: 34 02 00 02 mvi r2,2
80074d0: b4 2b 08 00 add r1,r1,r11
80074d4: f8 00 41 1b calli 8017940 <__ashlsi3>
80074d8: b5 a1 08 00 add r1,r13,r1
_Scheduler_priority_Schedule_body();
}
80074dc: 28 23 00 00 lw r3,(r1+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
80074e0: 34 21 00 04 addi r1,r1,4
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
return NULL;
80074e4: 34 02 00 00 mvi r2,0
Chain_Control *the_ready_queue
)
{
Priority_Control index = _Priority_bit_map_Get_highest();
if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) )
80074e8: 44 61 00 02 be r3,r1,80074f0 <_Scheduler_priority_Schedule+0xf0><== NEVER TAKEN
return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] );
80074ec: b8 60 10 00 mv r2,r3
*
* @param[in] the_thread - pointer to thread
*/
RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void)
{
_Thread_Heir = _Scheduler_priority_Ready_queue_first(
80074f0: 78 01 08 01 mvhi r1,0x801
80074f4: 38 21 ae 00 ori r1,r1,0xae00
80074f8: 58 22 00 14 sw (r1+20),r2
80074fc: 2b 9d 00 04 lw ra,(sp+4)
8007500: 2b 8b 00 10 lw r11,(sp+16)
8007504: 2b 8c 00 0c lw r12,(sp+12)
8007508: 2b 8d 00 08 lw r13,(sp+8)
800750c: 37 9c 00 10 addi sp,sp,16
8007510: c3 a0 00 00 ret
08007514 <_Scheduler_priority_Tick>:
#include <rtems/system.h>
#include <rtems/score/schedulerpriority.h>
void _Scheduler_priority_Tick( void )
{
8007514: 37 9c ff f8 addi sp,sp,-8
8007518: 5b 8b 00 08 sw (sp+8),r11
800751c: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *executing;
executing = _Thread_Executing;
8007520: 78 01 08 01 mvhi r1,0x801
8007524: 38 21 ae 00 ori r1,r1,0xae00
8007528: 28 2b 00 10 lw r11,(r1+16)
/*
* If the thread is not preemptible or is not ready, then
* just return.
*/
if ( !executing->is_preemptible )
800752c: 41 61 00 70 lbu r1,(r11+112)
8007530: 44 20 00 1e be r1,r0,80075a8 <_Scheduler_priority_Tick+0x94>
return;
if ( !_States_Is_ready( executing->current_state ) )
8007534: 29 61 00 10 lw r1,(r11+16)
8007538: 5c 20 00 1c bne r1,r0,80075a8 <_Scheduler_priority_Tick+0x94>
/*
* The cpu budget algorithm determines what happens next.
*/
switch ( executing->budget_algorithm ) {
800753c: 29 61 00 78 lw r1,(r11+120)
8007540: 44 20 00 1a be r1,r0,80075a8 <_Scheduler_priority_Tick+0x94>
8007544: 34 02 00 02 mvi r2,2
8007548: 50 41 00 04 bgeu r2,r1,8007558 <_Scheduler_priority_Tick+0x44>
800754c: 34 02 00 03 mvi r2,3
8007550: 5c 22 00 16 bne r1,r2,80075a8 <_Scheduler_priority_Tick+0x94><== NEVER TAKEN
8007554: e0 00 00 0e bi 800758c <_Scheduler_priority_Tick+0x78>
case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
#if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE)
case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
#endif
if ( (int)(--executing->cpu_time_budget) <= 0 ) {
8007558: 29 61 00 74 lw r1,(r11+116)
800755c: 34 21 ff ff addi r1,r1,-1
8007560: 59 61 00 74 sw (r11+116),r1
8007564: 48 20 00 11 bg r1,r0,80075a8 <_Scheduler_priority_Tick+0x94>
* always operates on the scheduler that 'owns' the currently executing
* thread.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void )
{
_Scheduler.Operations.yield();
8007568: 78 01 08 01 mvhi r1,0x801
800756c: 38 21 a0 18 ori r1,r1,0xa018
8007570: 28 21 00 0c lw r1,(r1+12)
8007574: d8 20 00 00 call r1
* executing thread's timeslice is reset. Otherwise, the
* currently executing thread is placed at the rear of the
* FIFO for this priority and a new heir is selected.
*/
_Scheduler_Yield();
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
8007578: 78 01 08 01 mvhi r1,0x801
800757c: 38 21 a9 10 ori r1,r1,0xa910
8007580: 28 21 00 00 lw r1,(r1+0)
8007584: 59 61 00 74 sw (r11+116),r1
8007588: e0 00 00 08 bi 80075a8 <_Scheduler_priority_Tick+0x94>
}
break;
#if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)
case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
if ( --executing->cpu_time_budget == 0 )
800758c: 29 61 00 74 lw r1,(r11+116)
8007590: 34 21 ff ff addi r1,r1,-1
8007594: 59 61 00 74 sw (r11+116),r1
8007598: 5c 20 00 04 bne r1,r0,80075a8 <_Scheduler_priority_Tick+0x94>
(*executing->budget_callout)( executing );
800759c: 29 62 00 7c lw r2,(r11+124)
80075a0: b9 60 08 00 mv r1,r11
80075a4: d8 40 00 00 call r2
break;
#endif
}
}
80075a8: 2b 9d 00 04 lw ra,(sp+4)
80075ac: 2b 8b 00 08 lw r11,(sp+8)
80075b0: 37 9c 00 08 addi sp,sp,8
80075b4: c3 a0 00 00 ret
08004c00 <_TOD_Validate>:
};
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
8004c00: 37 9c ff f0 addi sp,sp,-16
8004c04: 5b 8b 00 10 sw (sp+16),r11
8004c08: 5b 8c 00 0c sw (sp+12),r12
8004c0c: 5b 8d 00 08 sw (sp+8),r13
8004c10: 5b 9d 00 04 sw (sp+4),ra
8004c14: b8 20 58 00 mv r11,r1
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
8004c18: 78 01 08 01 mvhi r1,0x801
8004c1c: 38 21 f0 30 ori r1,r1,0xf030
8004c20: 28 22 00 0c lw r2,(r1+12)
(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;
8004c24: 34 0c 00 00 mvi r12,0
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) ||
8004c28: 45 60 00 22 be r11,r0,8004cb0 <_TOD_Validate+0xb0> <== NEVER TAKEN
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
8004c2c: 78 03 08 01 mvhi r3,0x801
8004c30: 38 63 f3 b0 ori r3,r3,0xf3b0
8004c34: 28 61 00 00 lw r1,(r3+0)
8004c38: f8 00 64 49 calli 801dd5c <__udivsi3>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
8004c3c: 29 62 00 18 lw r2,(r11+24)
8004c40: 50 41 00 1c bgeu r2,r1,8004cb0 <_TOD_Validate+0xb0>
(the_tod->ticks >= ticks_per_second) ||
8004c44: 29 62 00 14 lw r2,(r11+20)
8004c48: 34 01 00 3b mvi r1,59
8004c4c: 54 41 00 19 bgu r2,r1,8004cb0 <_TOD_Validate+0xb0>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
8004c50: 29 62 00 10 lw r2,(r11+16)
8004c54: 54 41 00 17 bgu r2,r1,8004cb0 <_TOD_Validate+0xb0>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
8004c58: 29 62 00 0c lw r2,(r11+12)
8004c5c: 34 01 00 17 mvi r1,23
8004c60: 54 41 00 14 bgu r2,r1,8004cb0 <_TOD_Validate+0xb0>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
8004c64: 29 61 00 04 lw r1,(r11+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) ||
8004c68: 44 20 00 12 be r1,r0,8004cb0 <_TOD_Validate+0xb0> <== NEVER TAKEN
(the_tod->month == 0) ||
8004c6c: 34 02 00 0c mvi r2,12
8004c70: 54 22 00 10 bgu r1,r2,8004cb0 <_TOD_Validate+0xb0>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
8004c74: 29 62 00 00 lw r2,(r11+0)
(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) ||
8004c78: 34 03 07 c3 mvi r3,1987
8004c7c: 50 62 00 0d bgeu r3,r2,8004cb0 <_TOD_Validate+0xb0>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
8004c80: 29 6d 00 08 lw r13,(r11+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) ||
8004c84: 45 a0 00 0b be r13,r0,8004cb0 <_TOD_Validate+0xb0> <== NEVER TAKEN
8004c88: 78 0b 08 01 mvhi r11,0x801
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
8004c8c: 20 42 00 03 andi r2,r2,0x3
8004c90: 39 6b fd 38 ori r11,r11,0xfd38
8004c94: 5c 40 00 02 bne r2,r0,8004c9c <_TOD_Validate+0x9c>
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
8004c98: 34 21 00 0d addi r1,r1,13
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
8004c9c: 34 02 00 02 mvi r2,2
8004ca0: fb ff f1 7c calli 8001290 <__ashlsi3>
8004ca4: b5 61 08 00 add r1,r11,r1
8004ca8: 28 2c 00 00 lw r12,(r1+0)
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(
8004cac: f1 8d 60 00 cmpgeu r12,r12,r13
if ( the_tod->day > days_in_month )
return false;
return true;
}
8004cb0: b9 80 08 00 mv r1,r12
8004cb4: 2b 9d 00 04 lw ra,(sp+4)
8004cb8: 2b 8b 00 10 lw r11,(sp+16)
8004cbc: 2b 8c 00 0c lw r12,(sp+12)
8004cc0: 2b 8d 00 08 lw r13,(sp+8)
8004cc4: 37 9c 00 10 addi sp,sp,16
8004cc8: c3 a0 00 00 ret
080077b0 <_Thread_Change_priority>:
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
80077b0: 37 9c ff e8 addi sp,sp,-24
80077b4: 5b 8b 00 18 sw (sp+24),r11
80077b8: 5b 8c 00 14 sw (sp+20),r12
80077bc: 5b 8d 00 10 sw (sp+16),r13
80077c0: 5b 8e 00 0c sw (sp+12),r14
80077c4: 5b 8f 00 08 sw (sp+8),r15
80077c8: 5b 9d 00 04 sw (sp+4),ra
80077cc: b8 20 58 00 mv r11,r1
States_Control state, original_state;
/*
* Save original state
*/
original_state = the_thread->current_state;
80077d0: 28 2f 00 10 lw r15,(r1+16)
void _Thread_Change_priority(
Thread_Control *the_thread,
Priority_Control new_priority,
bool prepend_it
)
{
80077d4: b8 40 60 00 mv r12,r2
80077d8: 20 6e 00 ff andi r14,r3,0xff
/*
* Set a transient state for the thread so it is pulled off the Ready chains.
* This will prevent it from being scheduled no matter what happens in an
* ISR.
*/
_Thread_Set_transient( the_thread );
80077dc: f8 00 03 42 calli 80084e4 <_Thread_Set_transient>
/*
* Do not bother recomputing all the priority related information if
* we are not REALLY changing priority.
*/
if ( the_thread->current_priority != new_priority )
80077e0: 29 61 00 14 lw r1,(r11+20)
80077e4: 44 2c 00 04 be r1,r12,80077f4 <_Thread_Change_priority+0x44>
_Thread_Set_priority( the_thread, new_priority );
80077e8: b9 60 08 00 mv r1,r11
80077ec: b9 80 10 00 mv r2,r12
80077f0: f8 00 03 1d calli 8008464 <_Thread_Set_priority>
_ISR_Disable( level );
80077f4: 90 00 60 00 rcsr r12,IE
80077f8: 34 0d ff fe mvi r13,-2
80077fc: a1 8d 68 00 and r13,r12,r13
8007800: d0 0d 00 00 wcsr IE,r13
/*
* If the thread has more than STATES_TRANSIENT set, then it is blocked,
* If it is blocked on a thread queue, then we need to requeue it.
*/
state = the_thread->current_state;
8007804: 29 61 00 10 lw r1,(r11+16)
if ( state != STATES_TRANSIENT ) {
8007808: 34 03 00 04 mvi r3,4
800780c: 21 e2 00 04 andi r2,r15,0x4
8007810: 44 23 00 0f be r1,r3,800784c <_Thread_Change_priority+0x9c>
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) )
8007814: 5c 40 00 04 bne r2,r0,8007824 <_Thread_Change_priority+0x74><== NEVER TAKEN
RTEMS_INLINE_ROUTINE States_Control _States_Clear (
States_Control states_to_clear,
States_Control current_state
)
{
return (current_state & ~states_to_clear);
8007818: 34 02 ff fb mvi r2,-5
800781c: a0 22 10 00 and r2,r1,r2
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
8007820: 59 62 00 10 sw (r11+16),r2
_ISR_Enable( level );
8007824: d0 0c 00 00 wcsr IE,r12
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
8007828: 78 03 08 01 mvhi r3,0x801
800782c: 38 63 8c 8c ori r3,r3,0x8c8c
8007830: 28 62 00 00 lw r2,(r3+0)
8007834: a0 22 08 00 and r1,r1,r2
if ( _States_Is_waiting_on_thread_queue( state ) ) {
8007838: 44 20 00 1f be r1,r0,80078b4 <_Thread_Change_priority+0x104>
_Thread_queue_Requeue( the_thread->Wait.queue, the_thread );
800783c: 29 61 00 44 lw r1,(r11+68)
8007840: b9 60 10 00 mv r2,r11
8007844: f8 00 02 d3 calli 8008390 <_Thread_queue_Requeue>
8007848: e0 00 00 1b bi 80078b4 <_Thread_Change_priority+0x104>
}
return;
}
/* Only clear the transient state if it wasn't set already */
if ( ! _States_Is_transient( original_state ) ) {
800784c: 5c 40 00 0a bne r2,r0,8007874 <_Thread_Change_priority+0xc4><== NEVER TAKEN
8007850: 78 01 08 01 mvhi r1,0x801
* Interrupts are STILL disabled.
* We now know the thread will be in the READY state when we remove
* the TRANSIENT state. So we have to place it on the appropriate
* Ready Queue with interrupts off.
*/
the_thread->current_state = _States_Clear( STATES_TRANSIENT, state );
8007854: 59 60 00 10 sw (r11+16),r0
8007858: 38 21 a0 18 ori r1,r1,0xa018
if ( prepend_it )
800785c: 45 c2 00 03 be r14,r2,8007868 <_Thread_Change_priority+0xb8>
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue_first( the_thread );
8007860: 28 22 00 28 lw r2,(r1+40)
8007864: e0 00 00 02 bi 800786c <_Thread_Change_priority+0xbc>
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue(
Thread_Control *the_thread
)
{
_Scheduler.Operations.enqueue( the_thread );
8007868: 28 22 00 24 lw r2,(r1+36)
800786c: b9 60 08 00 mv r1,r11
8007870: d8 40 00 00 call r2
_Scheduler_Enqueue_first( the_thread );
else
_Scheduler_Enqueue( the_thread );
}
_ISR_Flash( level );
8007874: d0 0c 00 00 wcsr IE,r12
8007878: d0 0d 00 00 wcsr IE,r13
* This kernel routine implements the scheduling decision logic for
* the scheduler. It does NOT dispatch.
*/
RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void )
{
_Scheduler.Operations.schedule();
800787c: 78 01 08 01 mvhi r1,0x801
8007880: 38 21 a0 18 ori r1,r1,0xa018
8007884: 28 21 00 08 lw r1,(r1+8)
8007888: d8 20 00 00 call r1
* is also the heir thread, and false otherwise.
*/
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void )
{
return ( _Thread_Executing == _Thread_Heir );
800788c: 78 01 08 01 mvhi r1,0x801
8007890: 38 21 ae 00 ori r1,r1,0xae00
8007894: 28 22 00 10 lw r2,(r1+16)
* We altered the set of thread priorities. So let's figure out
* who is the heir and if we need to switch to them.
*/
_Scheduler_Schedule();
if ( !_Thread_Is_executing_also_the_heir() &&
8007898: 28 23 00 14 lw r3,(r1+20)
800789c: 44 43 00 05 be r2,r3,80078b0 <_Thread_Change_priority+0x100>
80078a0: 40 42 00 70 lbu r2,(r2+112)
80078a4: 44 40 00 03 be r2,r0,80078b0 <_Thread_Change_priority+0x100>
_Thread_Executing->is_preemptible )
_Thread_Dispatch_necessary = true;
80078a8: 34 02 00 01 mvi r2,1
80078ac: 30 22 00 0c sb (r1+12),r2
_ISR_Enable( level );
80078b0: d0 0c 00 00 wcsr IE,r12
}
80078b4: 2b 9d 00 04 lw ra,(sp+4)
80078b8: 2b 8b 00 18 lw r11,(sp+24)
80078bc: 2b 8c 00 14 lw r12,(sp+20)
80078c0: 2b 8d 00 10 lw r13,(sp+16)
80078c4: 2b 8e 00 0c lw r14,(sp+12)
80078c8: 2b 8f 00 08 lw r15,(sp+8)
80078cc: 37 9c 00 18 addi sp,sp,24
80078d0: c3 a0 00 00 ret
0800c930 <_Thread_Delay_ended>:
void _Thread_Delay_ended(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
800c930: 37 9c ff f8 addi sp,sp,-8
800c934: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
800c938: 37 82 00 08 addi r2,sp,8
800c93c: f8 00 00 99 calli 800cba0 <_Thread_Get>
switch ( location ) {
800c940: 2b 82 00 08 lw r2,(sp+8)
800c944: 5c 40 00 0a bne r2,r0,800c96c <_Thread_Delay_ended+0x3c> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_Clear_state(
800c948: 78 03 08 02 mvhi r3,0x802
800c94c: 38 63 77 e4 ori r3,r3,0x77e4
800c950: 28 62 00 00 lw r2,(r3+0)
800c954: fb ff ff 6d calli 800c708 <_Thread_Clear_state>
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
800c958: 78 01 08 02 mvhi r1,0x802
800c95c: 38 21 9a 78 ori r1,r1,0x9a78
800c960: 28 22 00 00 lw r2,(r1+0)
--level;
800c964: 34 42 ff ff addi r2,r2,-1
_Thread_Dispatch_disable_level = level;
800c968: 58 22 00 00 sw (r1+0),r2
| STATES_INTERRUPTIBLE_BY_SIGNAL
);
_Thread_Unnest_dispatch();
break;
}
}
800c96c: 2b 9d 00 04 lw ra,(sp+4)
800c970: 37 9c 00 08 addi sp,sp,8
800c974: c3 a0 00 00 ret
0800fad4 <_Thread_Dispatch>:
#if defined(RTEMS_SMP)
#include <rtems/score/smp.h>
#endif
void _Thread_Dispatch( void )
{
800fad4: 37 9c ff c0 addi sp,sp,-64
800fad8: 5b 8b 00 38 sw (sp+56),r11
800fadc: 5b 8c 00 34 sw (sp+52),r12
800fae0: 5b 8d 00 30 sw (sp+48),r13
800fae4: 5b 8e 00 2c sw (sp+44),r14
800fae8: 5b 8f 00 28 sw (sp+40),r15
800faec: 5b 90 00 24 sw (sp+36),r16
800faf0: 5b 91 00 20 sw (sp+32),r17
800faf4: 5b 92 00 1c sw (sp+28),r18
800faf8: 5b 93 00 18 sw (sp+24),r19
800fafc: 5b 94 00 14 sw (sp+20),r20
800fb00: 5b 95 00 10 sw (sp+16),r21
800fb04: 5b 96 00 0c sw (sp+12),r22
800fb08: 5b 97 00 08 sw (sp+8),r23
800fb0c: 5b 9d 00 04 sw (sp+4),ra
#endif
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
800fb10: 78 01 08 01 mvhi r1,0x801
800fb14: 38 21 ae 00 ori r1,r1,0xae00
800fb18: 28 2c 00 10 lw r12,(r1+16)
_ISR_Disable( level );
800fb1c: 90 00 18 00 rcsr r3,IE
800fb20: 34 01 ff fe mvi r1,-2
800fb24: a0 61 08 00 and r1,r3,r1
800fb28: d0 01 00 00 wcsr IE,r1
while ( _Thread_Dispatch_necessary == true ) {
800fb2c: 78 0b 08 01 mvhi r11,0x801
* This routine sets thread dispatch level to the
* value passed in.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value)
{
_Thread_Dispatch_disable_level = value;
800fb30: 78 14 08 01 mvhi r20,0x801
#if __RTEMS_ADA__
executing->rtems_ada_self = rtems_ada_self;
rtems_ada_self = heir->rtems_ada_self;
#endif
if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE )
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
800fb34: 78 0f 08 01 mvhi r15,0x801
*/
static inline void _TOD_Get_uptime(
Timestamp_Control *time
)
{
_TOD_Get_with_nanoseconds( time, &_TOD.uptime );
800fb38: 78 13 08 01 mvhi r19,0x801
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
800fb3c: 78 12 08 01 mvhi r18,0x801
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
800fb40: 78 11 08 01 mvhi r17,0x801
{
const Chain_Control *chain = &_User_extensions_Switches_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
800fb44: 78 10 08 01 mvhi r16,0x801
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
800fb48: 39 6b ae 00 ori r11,r11,0xae00
800fb4c: 3a 94 a9 78 ori r20,r20,0xa978
800fb50: 34 15 00 01 mvi r21,1
#if __RTEMS_ADA__
executing->rtems_ada_self = rtems_ada_self;
rtems_ada_self = heir->rtems_ada_self;
#endif
if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE )
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
800fb54: 39 ef a9 10 ori r15,r15,0xa910
_ISR_Enable( level );
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
{
Timestamp_Control uptime, ran;
_TOD_Get_uptime( &uptime );
800fb58: 37 97 00 3c addi r23,sp,60
800fb5c: 3a 73 a9 00 ori r19,r19,0xa900
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
800fb60: 3a 52 a9 e4 ori r18,r18,0xa9e4
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
800fb64: 3a 31 a1 88 ori r17,r17,0xa188
800fb68: 3a 10 a1 8c ori r16,r16,0xa18c
#endif
#endif
executing = _Thread_Executing;
_ISR_Disable( level );
800fb6c: 34 16 ff fe mvi r22,-2
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
800fb70: e0 00 00 35 bi 800fc44 <_Thread_Dispatch+0x170>
heir = _Thread_Heir;
800fb74: 29 6d 00 14 lw r13,(r11+20)
800fb78: 5a 95 00 00 sw (r20+0),r21
#ifndef RTEMS_SMP
_Thread_Dispatch_set_disable_level( 1 );
#endif
_Thread_Dispatch_necessary = false;
800fb7c: 31 60 00 0c sb (r11+12),r0
_Thread_Executing = heir;
800fb80: 59 6d 00 10 sw (r11+16),r13
/*
* When the heir and executing are the same, then we are being
* requested to do the post switch dispatching. This is normally
* done to dispatch signals.
*/
if ( heir == executing )
800fb84: 45 ac 00 33 be r13,r12,800fc50 <_Thread_Dispatch+0x17c>
*/
#if __RTEMS_ADA__
executing->rtems_ada_self = rtems_ada_self;
rtems_ada_self = heir->rtems_ada_self;
#endif
if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE )
800fb88: 29 a1 00 78 lw r1,(r13+120)
800fb8c: 5c 35 00 03 bne r1,r21,800fb98 <_Thread_Dispatch+0xc4>
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
800fb90: 29 e1 00 00 lw r1,(r15+0)
800fb94: 59 a1 00 74 sw (r13+116),r1
_ISR_Enable( level );
800fb98: d0 03 00 00 wcsr IE,r3
800fb9c: ba 60 10 00 mv r2,r19
800fba0: ba e0 08 00 mv r1,r23
800fba4: fb ff d8 f0 calli 8005f64 <_TOD_Get_with_nanoseconds>
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
800fba8: 2b 83 00 40 lw r3,(sp+64)
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
800fbac: 29 82 00 84 lw r2,(r12+132)
800fbb0: 29 85 00 80 lw r5,(r12+128)
800fbb4: 2b 81 00 3c lw r1,(sp+60)
800fbb8: b4 62 10 00 add r2,r3,r2
800fbbc: f4 62 20 00 cmpgu r4,r3,r2
800fbc0: b4 25 28 00 add r5,r1,r5
800fbc4: b4 85 28 00 add r5,r4,r5
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
800fbc8: 29 64 00 24 lw r4,(r11+36)
800fbcc: 29 66 00 20 lw r6,(r11+32)
800fbd0: c8 44 20 00 sub r4,r2,r4
800fbd4: f4 82 10 00 cmpgu r2,r4,r2
800fbd8: c8 a6 28 00 sub r5,r5,r6
800fbdc: c8 a2 10 00 sub r2,r5,r2
800fbe0: 59 82 00 80 sw (r12+128),r2
800fbe4: 59 84 00 84 sw (r12+132),r4
&_Thread_Time_of_last_context_switch,
&uptime,
&ran
);
_Timestamp_Add_to( &executing->cpu_time_used, &ran );
_Thread_Time_of_last_context_switch = uptime;
800fbe8: 59 63 00 24 sw (r11+36),r3
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
800fbec: 2a 43 00 00 lw r3,(r18+0)
&_Thread_Time_of_last_context_switch,
&uptime,
&ran
);
_Timestamp_Add_to( &executing->cpu_time_used, &ran );
_Thread_Time_of_last_context_switch = uptime;
800fbf0: 59 61 00 20 sw (r11+32),r1
#endif
/*
* Switch libc's task specific data.
*/
if ( _Thread_libc_reent ) {
800fbf4: 44 60 00 05 be r3,r0,800fc08 <_Thread_Dispatch+0x134> <== NEVER TAKEN
executing->libc_reent = *_Thread_libc_reent;
800fbf8: 28 61 00 00 lw r1,(r3+0)
800fbfc: 59 81 01 14 sw (r12+276),r1
*_Thread_libc_reent = heir->libc_reent;
800fc00: 29 a1 01 14 lw r1,(r13+276)
800fc04: 58 61 00 00 sw (r3+0),r1
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
800fc08: 2a 2e 00 00 lw r14,(r17+0)
800fc0c: e0 00 00 06 bi 800fc24 <_Thread_Dispatch+0x150>
const User_extensions_Switch_control *extension =
(const User_extensions_Switch_control *) node;
(*extension->thread_switch)( executing, heir );
800fc10: 29 c3 00 08 lw r3,(r14+8)
800fc14: b9 80 08 00 mv r1,r12
800fc18: b9 a0 10 00 mv r2,r13
800fc1c: d8 60 00 00 call r3
800fc20: 29 ce 00 00 lw r14,(r14+0)
{
const Chain_Control *chain = &_User_extensions_Switches_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
800fc24: 5d d0 ff fb bne r14,r16,800fc10 <_Thread_Dispatch+0x13c>
if ( executing->fp_context != NULL )
_Context_Save_fp( &executing->fp_context );
#endif
#endif
_Context_Switch( &executing->Registers, &heir->Registers );
800fc28: 35 81 00 c0 addi r1,r12,192
800fc2c: 35 a2 00 c0 addi r2,r13,192
800fc30: fb ff e4 2c calli 8008ce0 <_CPU_Context_switch>
if ( executing->fp_context != NULL )
_Context_Restore_fp( &executing->fp_context );
#endif
#endif
executing = _Thread_Executing;
800fc34: 29 6c 00 10 lw r12,(r11+16)
_ISR_Disable( level );
800fc38: 90 00 18 00 rcsr r3,IE
800fc3c: a0 76 08 00 and r1,r3,r22
800fc40: d0 01 00 00 wcsr IE,r1
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
800fc44: 41 61 00 0c lbu r1,(r11+12)
800fc48: 20 21 00 ff andi r1,r1,0xff
800fc4c: 5c 20 ff ca bne r1,r0,800fb74 <_Thread_Dispatch+0xa0>
800fc50: 78 01 08 01 mvhi r1,0x801
800fc54: 38 21 a9 78 ori r1,r1,0xa978
800fc58: 58 20 00 00 sw (r1+0),r0
post_switch:
#ifndef RTEMS_SMP
_Thread_Dispatch_set_disable_level( 0 );
#endif
_ISR_Enable( level );
800fc5c: d0 03 00 00 wcsr IE,r3
#ifdef RTEMS_SMP
_Thread_Unnest_dispatch();
#endif
_API_extensions_Run_post_switch( executing );
}
800fc60: 78 01 08 01 mvhi r1,0x801
800fc64: 38 21 a9 e8 ori r1,r1,0xa9e8
{
const Chain_Control *chain = &_API_extensions_Post_switch_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
800fc68: 78 0d 08 01 mvhi r13,0x801
800fc6c: 28 2b 00 00 lw r11,(r1+0)
800fc70: 39 ad a9 ec ori r13,r13,0xa9ec
800fc74: e0 00 00 05 bi 800fc88 <_Thread_Dispatch+0x1b4>
const API_extensions_Post_switch_control *post_switch =
(const API_extensions_Post_switch_control *) node;
(*post_switch->hook)( executing );
800fc78: 29 62 00 08 lw r2,(r11+8)
800fc7c: b9 80 08 00 mv r1,r12
800fc80: d8 40 00 00 call r2
800fc84: 29 6b 00 00 lw r11,(r11+0)
{
const Chain_Control *chain = &_API_extensions_Post_switch_list;
const Chain_Node *tail = _Chain_Immutable_tail( chain );
const Chain_Node *node = _Chain_Immutable_first( chain );
while ( node != tail ) {
800fc88: 5d 6d ff fc bne r11,r13,800fc78 <_Thread_Dispatch+0x1a4>
800fc8c: 2b 9d 00 04 lw ra,(sp+4)
800fc90: 2b 8b 00 38 lw r11,(sp+56)
800fc94: 2b 8c 00 34 lw r12,(sp+52)
800fc98: 2b 8d 00 30 lw r13,(sp+48)
800fc9c: 2b 8e 00 2c lw r14,(sp+44)
800fca0: 2b 8f 00 28 lw r15,(sp+40)
800fca4: 2b 90 00 24 lw r16,(sp+36)
800fca8: 2b 91 00 20 lw r17,(sp+32)
800fcac: 2b 92 00 1c lw r18,(sp+28)
800fcb0: 2b 93 00 18 lw r19,(sp+24)
800fcb4: 2b 94 00 14 lw r20,(sp+20)
800fcb8: 2b 95 00 10 lw r21,(sp+16)
800fcbc: 2b 96 00 0c lw r22,(sp+12)
800fcc0: 2b 97 00 08 lw r23,(sp+8)
800fcc4: 37 9c 00 40 addi sp,sp,64
800fcc8: c3 a0 00 00 ret
08011a38 <_Thread_Handler>:
#define INIT_NAME __main
#define EXECUTE_GLOBAL_CONSTRUCTORS
#endif
void _Thread_Handler( void )
{
8011a38: 37 9c ff f4 addi sp,sp,-12
8011a3c: 5b 8b 00 0c sw (sp+12),r11
8011a40: 5b 8c 00 08 sw (sp+8),r12
8011a44: 5b 9d 00 04 sw (sp+4),ra
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
static bool doneConstructors;
bool doCons;
#endif
executing = _Thread_Executing;
8011a48: 78 01 08 01 mvhi r1,0x801
8011a4c: 38 21 ae 00 ori r1,r1,0xae00
8011a50: 28 2b 00 10 lw r11,(r1+16)
/*
* have to put level into a register for those cpu's that use
* inline asm here
*/
level = executing->Start.isr_level;
8011a54: 29 61 00 a8 lw r1,(r11+168)
_ISR_Set_level(level);
8011a58: 64 21 00 00 cmpei r1,r1,0
8011a5c: d0 01 00 00 wcsr IE,r1
doCons = !doneConstructors
&& _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API;
if (doCons)
doneConstructors = true;
#else
doCons = !doneConstructors;
8011a60: 78 01 08 01 mvhi r1,0x801
8011a64: 38 21 a8 10 ori r1,r1,0xa810
8011a68: 40 2c 00 00 lbu r12,(r1+0)
doneConstructors = true;
8011a6c: 34 02 00 01 mvi r2,1
8011a70: 30 22 00 00 sb (r1+0),r2
);
}
static inline void _User_extensions_Thread_begin( Thread_Control *executing )
{
_User_extensions_Iterate(
8011a74: 78 02 08 00 mvhi r2,0x800
8011a78: b9 60 08 00 mv r1,r11
8011a7c: 38 42 87 18 ori r2,r2,0x8718
8011a80: fb ff db 42 calli 8008788 <_User_extensions_Iterate>
_User_extensions_Thread_begin( executing );
/*
* At this point, the dispatch disable level BETTER be 1.
*/
_Thread_Enable_dispatch();
8011a84: fb ff d7 cf calli 80079c0 <_Thread_Enable_dispatch>
/*
* _init could be a weak symbol and we SHOULD test it but it isn't
* in any configuration I know of and it generates a warning on every
* RTEMS target configuration. --joel (12 May 2007)
*/
if (doCons) /* && (volatile void *)_init) */ {
8011a88: 5d 80 00 02 bne r12,r0,8011a90 <_Thread_Handler+0x58>
INIT_NAME ();
8011a8c: fb ff b9 5d calli 8000000 <RamBase>
_Thread_Enable_dispatch();
#endif
}
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
8011a90: 29 61 00 90 lw r1,(r11+144)
8011a94: 5c 20 00 04 bne r1,r0,8011aa4 <_Thread_Handler+0x6c>
executing->Wait.return_argument =
(*(Thread_Entry_numeric) executing->Start.entry_point)(
8011a98: 29 62 00 8c lw r2,(r11+140)
8011a9c: 29 61 00 98 lw r1,(r11+152)
8011aa0: e0 00 00 05 bi 8011ab4 <_Thread_Handler+0x7c>
executing->Start.numeric_argument
);
}
#if defined(RTEMS_POSIX_API)
else if ( executing->Start.prototype == THREAD_START_POINTER ) {
8011aa4: 34 02 00 01 mvi r2,1
8011aa8: 5c 22 00 05 bne r1,r2,8011abc <_Thread_Handler+0x84> <== NEVER TAKEN
executing->Wait.return_argument =
(*(Thread_Entry_pointer) executing->Start.entry_point)(
8011aac: 29 62 00 8c lw r2,(r11+140)
8011ab0: 29 61 00 94 lw r1,(r11+148)
8011ab4: d8 40 00 00 call r2
executing->Start.numeric_argument
);
}
#if defined(RTEMS_POSIX_API)
else if ( executing->Start.prototype == THREAD_START_POINTER ) {
executing->Wait.return_argument =
8011ab8: 59 61 00 28 sw (r11+40),r1
}
}
static inline void _User_extensions_Thread_exitted( Thread_Control *executing )
{
_User_extensions_Iterate(
8011abc: 78 02 08 00 mvhi r2,0x800
8011ac0: b9 60 08 00 mv r1,r11
8011ac4: 38 42 87 38 ori r2,r2,0x8738
8011ac8: fb ff db 30 calli 8008788 <_User_extensions_Iterate>
* able to fit in a (void *).
*/
_User_extensions_Thread_exitted( executing );
_Internal_error_Occurred(
8011acc: 34 01 00 00 mvi r1,0
8011ad0: 34 02 00 01 mvi r2,1
8011ad4: 34 03 00 05 mvi r3,5
8011ad8: fb ff d2 8b calli 8006504 <_Internal_error_Occurred>
08007d0c <_Thread_Handler_initialization>:
#if defined(RTEMS_SMP)
#include <rtems/bspsmp.h>
#endif
void _Thread_Handler_initialization(void)
{
8007d0c: 37 9c ff f4 addi sp,sp,-12
8007d10: 5b 8b 00 0c sw (sp+12),r11
8007d14: 5b 8c 00 08 sw (sp+8),r12
8007d18: 5b 9d 00 04 sw (sp+4),ra
uint32_t ticks_per_timeslice =
8007d1c: 78 01 08 01 mvhi r1,0x801
8007d20: 38 21 87 ec ori r1,r1,0x87ec
#if defined(RTEMS_MULTIPROCESSING)
uint32_t maximum_proxies =
_Configuration_MP_table->maximum_proxies;
#endif
if ( rtems_configuration_get_stack_allocate_hook() == NULL ||
8007d24: 28 23 00 28 lw r3,(r1+40)
#include <rtems/bspsmp.h>
#endif
void _Thread_Handler_initialization(void)
{
uint32_t ticks_per_timeslice =
8007d28: 28 2b 00 14 lw r11,(r1+20)
rtems_configuration_get_ticks_per_timeslice();
uint32_t maximum_extensions =
8007d2c: 28 2c 00 08 lw r12,(r1+8)
rtems_configuration_get_maximum_extensions();
rtems_stack_allocate_init_hook stack_allocate_init_hook =
8007d30: 28 22 00 24 lw r2,(r1+36)
#if defined(RTEMS_MULTIPROCESSING)
uint32_t maximum_proxies =
_Configuration_MP_table->maximum_proxies;
#endif
if ( rtems_configuration_get_stack_allocate_hook() == NULL ||
8007d34: 44 60 00 03 be r3,r0,8007d40 <_Thread_Handler_initialization+0x34><== NEVER TAKEN
8007d38: 28 23 00 2c lw r3,(r1+44)
8007d3c: 5c 60 00 05 bne r3,r0,8007d50 <_Thread_Handler_initialization+0x44>
rtems_configuration_get_stack_free_hook() == NULL)
_Internal_error_Occurred(
8007d40: 34 01 00 00 mvi r1,0
8007d44: 34 02 00 01 mvi r2,1
8007d48: 34 03 00 0e mvi r3,14
8007d4c: fb ff f9 ee calli 8006504 <_Internal_error_Occurred>
INTERNAL_ERROR_CORE,
true,
INTERNAL_ERROR_BAD_STACK_HOOK
);
if ( stack_allocate_init_hook != NULL )
8007d50: 44 40 00 03 be r2,r0,8007d5c <_Thread_Handler_initialization+0x50>
(*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() );
8007d54: 28 21 00 04 lw r1,(r1+4)
8007d58: d8 40 00 00 call r2
_Thread_Dispatch_necessary = false;
8007d5c: 78 01 08 01 mvhi r1,0x801
8007d60: 38 21 ae 00 ori r1,r1,0xae00
8007d64: 30 20 00 0c sb (r1+12),r0
_Thread_Executing = NULL;
8007d68: 58 20 00 10 sw (r1+16),r0
_Thread_Heir = NULL;
8007d6c: 58 20 00 14 sw (r1+20),r0
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
_Thread_Allocated_fp = NULL;
#endif
_Thread_Maximum_extensions = maximum_extensions;
8007d70: 78 01 08 01 mvhi r1,0x801
8007d74: 38 21 a9 f4 ori r1,r1,0xa9f4
8007d78: 58 2c 00 00 sw (r1+0),r12
_Thread_Ticks_per_timeslice = ticks_per_timeslice;
8007d7c: 78 01 08 01 mvhi r1,0x801
8007d80: 38 21 a9 10 ori r1,r1,0xa910
8007d84: 58 2b 00 00 sw (r1+0),r11
#if defined(RTEMS_MULTIPROCESSING)
if ( _System_state_Is_multiprocessing )
maximum_internal_threads += 1;
#endif
_Objects_Initialize_information(
8007d88: 78 01 08 01 mvhi r1,0x801
8007d8c: 38 21 aa 68 ori r1,r1,0xaa68
8007d90: 34 02 00 01 mvi r2,1
8007d94: 34 03 00 01 mvi r3,1
8007d98: 34 04 00 01 mvi r4,1
8007d9c: 34 05 01 28 mvi r5,296
8007da0: 34 06 00 00 mvi r6,0
8007da4: 34 07 00 08 mvi r7,8
8007da8: fb ff fb a2 calli 8006c30 <_Objects_Initialize_information>
false, /* true if this is a global object class */
NULL /* Proxy extraction support callout */
#endif
);
}
8007dac: 2b 9d 00 04 lw ra,(sp+4)
8007db0: 2b 8b 00 0c lw r11,(sp+12)
8007db4: 2b 8c 00 08 lw r12,(sp+8)
8007db8: 37 9c 00 0c addi sp,sp,12
8007dbc: c3 a0 00 00 ret
08008598 <_Thread_Stack_Free>:
#include <rtems/config.h>
void _Thread_Stack_Free(
Thread_Control *the_thread
)
{
8008598: 37 9c ff fc addi sp,sp,-4
800859c: 5b 9d 00 04 sw (sp+4),ra
#if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
/*
* If the API provided the stack space, then don't free it.
*/
if ( !the_thread->Start.core_allocated_stack )
80085a0: 40 23 00 b0 lbu r3,(r1+176)
void _Thread_Stack_Free(
Thread_Control *the_thread
)
{
rtems_stack_free_hook stack_free_hook =
80085a4: 78 02 08 01 mvhi r2,0x801
80085a8: 38 42 87 ec ori r2,r2,0x87ec
80085ac: 28 42 00 2c lw r2,(r2+44)
#if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API)
/*
* If the API provided the stack space, then don't free it.
*/
if ( !the_thread->Start.core_allocated_stack )
80085b0: 44 60 00 03 be r3,r0,80085bc <_Thread_Stack_Free+0x24> <== NEVER TAKEN
* Call ONLY the CPU table stack free hook, or the
* the RTEMS workspace free. This is so the free
* routine properly matches the allocation of the stack.
*/
(*stack_free_hook)( the_thread->Start.Initial_stack.area );
80085b4: 28 21 00 b8 lw r1,(r1+184)
80085b8: d8 40 00 00 call r2
}
80085bc: 2b 9d 00 04 lw ra,(sp+4)
80085c0: 37 9c 00 04 addi sp,sp,4
80085c4: c3 a0 00 00 ret
08008050 <_Thread_queue_Enqueue_priority>:
Thread_blocking_operation_States _Thread_queue_Enqueue_priority (
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread,
ISR_Level *level_p
)
{
8008050: 37 9c ff cc addi sp,sp,-52
8008054: 5b 8b 00 34 sw (sp+52),r11
8008058: 5b 8c 00 30 sw (sp+48),r12
800805c: 5b 8d 00 2c sw (sp+44),r13
8008060: 5b 8e 00 28 sw (sp+40),r14
8008064: 5b 8f 00 24 sw (sp+36),r15
8008068: 5b 90 00 20 sw (sp+32),r16
800806c: 5b 91 00 1c sw (sp+28),r17
8008070: 5b 92 00 18 sw (sp+24),r18
8008074: 5b 93 00 14 sw (sp+20),r19
8008078: 5b 94 00 10 sw (sp+16),r20
800807c: 5b 95 00 0c sw (sp+12),r21
8008080: 5b 96 00 08 sw (sp+8),r22
8008084: 5b 9d 00 04 sw (sp+4),ra
Priority_Control priority;
States_Control block_state;
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
8008088: 28 50 00 14 lw r16,(r2+20)
Thread_blocking_operation_States _Thread_queue_Enqueue_priority (
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread,
ISR_Level *level_p
)
{
800808c: b8 20 68 00 mv r13,r1
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 );
8008090: 34 41 00 3c addi r1,r2,60
head->next = tail;
8008094: 58 41 00 38 sw (r2+56),r1
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
8008098: 34 41 00 38 addi r1,r2,56
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
800809c: 58 41 00 40 sw (r2+64),r1
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
80080a0: 58 40 00 3c sw (r2+60),r0
80080a4: b8 40 60 00 mv r12,r2
RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number (
Priority_Control the_priority
)
{
return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER);
80080a8: ba 00 08 00 mv r1,r16
80080ac: 34 02 00 06 mvi r2,6
80080b0: b8 60 a8 00 mv r21,r3
80080b4: f8 00 3e 71 calli 8017a78 <__lshrsi3>
80080b8: b8 20 70 00 mv r14,r1
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
80080bc: 78 12 08 01 mvhi r18,0x801
RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_reverse_search (
Priority_Control the_priority
)
{
return ( the_priority & TASK_QUEUE_DATA_REVERSE_SEARCH_MASK );
80080c0: 22 01 00 20 andi r1,r16,0x20
_Chain_Initialize_empty( &the_thread->Wait.Block2n );
priority = the_thread->current_priority;
header_index = _Thread_queue_Header_number( priority );
header = &the_thread_queue->Queues.Priority[ header_index ];
block_state = the_thread_queue->state;
80080c4: 29 b3 00 38 lw r19,(r13+56)
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
80080c8: 3a 52 a0 c0 ori r18,r18,0xa0c0
_ISR_Disable( level );
80080cc: 34 16 ff fe mvi r22,-2
priority = the_thread->current_priority;
header_index = _Thread_queue_Header_number( priority );
header = &the_thread_queue->Queues.Priority[ header_index ];
block_state = the_thread_queue->state;
if ( _Thread_queue_Is_reverse_search( priority ) )
80080d0: 5c 20 00 2e bne r1,r0,8008188 <_Thread_queue_Enqueue_priority+0x138>
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
80080d4: 34 14 ff fe mvi r20,-2
80080d8: 90 00 78 00 rcsr r15,IE
80080dc: a1 f4 90 00 and r18,r15,r20
80080e0: d0 12 00 00 wcsr IE,r18
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
80080e4: 34 02 00 01 mvi r2,1
80080e8: b9 c0 08 00 mv r1,r14
80080ec: f8 00 3e 15 calli 8017940 <__ashlsi3>
80080f0: b4 2e 08 00 add r1,r1,r14
80080f4: 34 02 00 02 mvi r2,2
80080f8: f8 00 3e 12 calli 8017940 <__ashlsi3>
80080fc: b5 a1 08 00 add r1,r13,r1
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_First( header );
8008100: 28 2b 00 00 lw r11,(r1+0)
if ( _Thread_queue_Is_reverse_search( priority ) )
goto restart_reverse_search;
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
8008104: 34 11 ff ff mvi r17,-1
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_First( header );
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
8008108: e0 00 00 0b bi 8008134 <_Thread_queue_Enqueue_priority+0xe4>
search_priority = search_thread->current_priority;
800810c: 29 71 00 14 lw r17,(r11+20)
if ( priority <= search_priority )
8008110: 52 30 00 12 bgeu r17,r16,8008158 <_Thread_queue_Enqueue_priority+0x108>
break;
search_priority = search_thread->current_priority;
if ( priority <= search_priority )
break;
#endif
_ISR_Flash( level );
8008114: d0 0f 00 00 wcsr IE,r15
8008118: d0 12 00 00 wcsr IE,r18
RTEMS_INLINE_ROUTINE bool _States_Are_set (
States_Control the_states,
States_Control mask
)
{
return ( (the_states & mask) != STATES_READY);
800811c: 29 61 00 10 lw r1,(r11+16)
8008120: a2 61 08 00 and r1,r19,r1
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
8008124: 5c 20 00 03 bne r1,r0,8008130 <_Thread_queue_Enqueue_priority+0xe0><== ALWAYS TAKEN
_ISR_Enable( level );
8008128: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED
goto restart_forward_search;
800812c: e3 ff ff eb bi 80080d8 <_Thread_queue_Enqueue_priority+0x88><== NOT EXECUTED
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
8008130: 29 6b 00 00 lw r11,(r11+0)
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 ));
8008134: 34 02 00 01 mvi r2,1
8008138: b9 c0 08 00 mv r1,r14
800813c: f8 00 3e 01 calli 8017940 <__ashlsi3>
8008140: b4 2e 08 00 add r1,r1,r14
8008144: 34 02 00 02 mvi r2,2
8008148: f8 00 3d fe calli 8017940 <__ashlsi3>
800814c: b5 a1 08 00 add r1,r13,r1
8008150: 34 21 00 04 addi r1,r1,4
restart_forward_search:
search_priority = PRIORITY_MINIMUM - 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_First( header );
while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) {
8008154: 5d 61 ff ee bne r11,r1,800810c <_Thread_queue_Enqueue_priority+0xbc>
}
search_thread =
(Thread_Control *)search_thread->Object.Node.next;
}
if ( the_thread_queue->sync_state !=
8008158: 29 a3 00 30 lw r3,(r13+48)
800815c: 34 02 00 01 mvi r2,1
8008160: b9 e0 08 00 mv r1,r15
8008164: 5c 62 00 3f bne r3,r2,8008260 <_Thread_queue_Enqueue_priority+0x210><== NEVER TAKEN
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8008168: 59 a0 00 30 sw (r13+48),r0
if ( priority == search_priority )
800816c: 46 11 00 36 be r16,r17,8008244 <_Thread_queue_Enqueue_priority+0x1f4>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
previous_node = search_node->previous;
8008170: 29 61 00 04 lw r1,(r11+4)
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
8008174: 59 8b 00 00 sw (r12+0),r11
the_node->previous = previous_node;
8008178: 59 81 00 04 sw (r12+4),r1
previous_node->next = the_node;
800817c: 58 2c 00 00 sw (r1+0),r12
search_node->previous = the_node;
8008180: 59 6c 00 04 sw (r11+4),r12
8008184: e0 00 00 2c bi 8008234 <_Thread_queue_Enqueue_priority+0x1e4>
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
8008188: 42 51 00 00 lbu r17,(r18+0)
800818c: 36 31 00 01 addi r17,r17,1
_ISR_Disable( level );
8008190: 90 00 78 00 rcsr r15,IE
8008194: a1 f6 a0 00 and r20,r15,r22
8008198: d0 14 00 00 wcsr IE,r20
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
return the_thread_queue->sync_state;
}
800819c: 34 02 00 01 mvi r2,1
80081a0: b9 c0 08 00 mv r1,r14
80081a4: f8 00 3d e7 calli 8017940 <__ashlsi3>
80081a8: b4 2e 08 00 add r1,r1,r14
80081ac: 34 02 00 02 mvi r2,2
80081b0: f8 00 3d e4 calli 8017940 <__ashlsi3>
80081b4: b5 a1 08 00 add r1,r13,r1
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_Last( header );
80081b8: 28 2b 00 08 lw r11,(r1+8)
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
80081bc: e0 00 00 0b bi 80081e8 <_Thread_queue_Enqueue_priority+0x198>
search_priority = search_thread->current_priority;
80081c0: 29 71 00 14 lw r17,(r11+20)
if ( priority >= search_priority )
80081c4: 52 11 00 11 bgeu r16,r17,8008208 <_Thread_queue_Enqueue_priority+0x1b8>
break;
search_priority = search_thread->current_priority;
if ( priority >= search_priority )
break;
#endif
_ISR_Flash( level );
80081c8: d0 0f 00 00 wcsr IE,r15
80081cc: d0 14 00 00 wcsr IE,r20
80081d0: 29 61 00 10 lw r1,(r11+16)
80081d4: a2 61 08 00 and r1,r19,r1
if ( !_States_Are_set( search_thread->current_state, block_state) ) {
80081d8: 5c 20 00 03 bne r1,r0,80081e4 <_Thread_queue_Enqueue_priority+0x194><== ALWAYS TAKEN
_ISR_Enable( level );
80081dc: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED
goto restart_reverse_search;
80081e0: e3 ff ff ea bi 8008188 <_Thread_queue_Enqueue_priority+0x138><== NOT EXECUTED
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
80081e4: 29 6b 00 04 lw r11,(r11+4)
RTEMS_INLINE_ROUTINE bool _Chain_Is_head(
const Chain_Control *the_chain,
const Chain_Node *the_node
)
{
return (the_node == _Chain_Immutable_head( the_chain ));
80081e8: 34 02 00 01 mvi r2,1
80081ec: b9 c0 08 00 mv r1,r14
80081f0: f8 00 3d d4 calli 8017940 <__ashlsi3>
80081f4: b4 2e 08 00 add r1,r1,r14
80081f8: 34 02 00 02 mvi r2,2
80081fc: f8 00 3d d1 calli 8017940 <__ashlsi3>
8008200: b5 a1 08 00 add r1,r13,r1
restart_reverse_search:
search_priority = PRIORITY_MAXIMUM + 1;
_ISR_Disable( level );
search_thread = (Thread_Control *) _Chain_Last( header );
while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) {
8008204: 5d 61 ff ef bne r11,r1,80081c0 <_Thread_queue_Enqueue_priority+0x170>
}
search_thread = (Thread_Control *)
search_thread->Object.Node.previous;
}
if ( the_thread_queue->sync_state !=
8008208: 29 a3 00 30 lw r3,(r13+48)
800820c: 34 02 00 01 mvi r2,1
8008210: b9 e0 08 00 mv r1,r15
8008214: 5c 62 00 13 bne r3,r2,8008260 <_Thread_queue_Enqueue_priority+0x210><== NEVER TAKEN
THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED )
goto synchronize;
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED;
8008218: 59 a0 00 30 sw (r13+48),r0
if ( priority == search_priority )
800821c: 46 11 00 0a be r16,r17,8008244 <_Thread_queue_Enqueue_priority+0x1f4>
goto equal_priority;
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
8008220: 29 61 00 00 lw r1,(r11+0)
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
the_node->previous = search_node;
8008224: 59 8b 00 04 sw (r12+4),r11
search_node = (Chain_Node *) search_thread;
next_node = search_node->next;
the_node = (Chain_Node *) the_thread;
the_node->next = next_node;
8008228: 59 81 00 00 sw (r12+0),r1
the_node->previous = search_node;
search_node->next = the_node;
800822c: 59 6c 00 00 sw (r11+0),r12
next_node->previous = the_node;
8008230: 58 2c 00 04 sw (r1+4),r12
the_thread->Wait.queue = the_thread_queue;
8008234: 59 8d 00 44 sw (r12+68),r13
_ISR_Enable( level );
8008238: d0 0f 00 00 wcsr IE,r15
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
800823c: 34 01 00 01 mvi r1,1
8008240: e0 00 00 0a bi 8008268 <_Thread_queue_Enqueue_priority+0x218>
equal_priority: /* add at end of priority group */
search_node = _Chain_Tail( &search_thread->Wait.Block2n );
previous_node = search_node->previous;
8008244: 29 61 00 40 lw r1,(r11+64)
the_thread->Wait.queue = the_thread_queue;
_ISR_Enable( level );
return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
equal_priority: /* add at end of priority group */
search_node = _Chain_Tail( &search_thread->Wait.Block2n );
8008248: 35 62 00 3c addi r2,r11,60
previous_node = search_node->previous;
the_node = (Chain_Node *) the_thread;
the_node->next = search_node;
800824c: 59 82 00 00 sw (r12+0),r2
the_node->previous = previous_node;
8008250: 59 81 00 04 sw (r12+4),r1
previous_node->next = the_node;
8008254: 58 2c 00 00 sw (r1+0),r12
search_node->previous = the_node;
8008258: 59 6c 00 40 sw (r11+64),r12
800825c: e3 ff ff f6 bi 8008234 <_Thread_queue_Enqueue_priority+0x1e4>
* For example, the blocking thread could have been given
* the mutex by an ISR or timed out.
*
* WARNING! Returning with interrupts disabled!
*/
*level_p = level;
8008260: 5a a1 00 00 sw (r21+0),r1 <== NOT EXECUTED
return the_thread_queue->sync_state;
8008264: 29 a1 00 30 lw r1,(r13+48) <== NOT EXECUTED
}
8008268: 2b 9d 00 04 lw ra,(sp+4)
800826c: 2b 8b 00 34 lw r11,(sp+52)
8008270: 2b 8c 00 30 lw r12,(sp+48)
8008274: 2b 8d 00 2c lw r13,(sp+44)
8008278: 2b 8e 00 28 lw r14,(sp+40)
800827c: 2b 8f 00 24 lw r15,(sp+36)
8008280: 2b 90 00 20 lw r16,(sp+32)
8008284: 2b 91 00 1c lw r17,(sp+28)
8008288: 2b 92 00 18 lw r18,(sp+24)
800828c: 2b 93 00 14 lw r19,(sp+20)
8008290: 2b 94 00 10 lw r20,(sp+16)
8008294: 2b 95 00 0c lw r21,(sp+12)
8008298: 2b 96 00 08 lw r22,(sp+8)
800829c: 37 9c 00 34 addi sp,sp,52
80082a0: c3 a0 00 00 ret
0800fe08 <_Thread_queue_Extract_priority_helper>:
void _Thread_queue_Extract_priority_helper(
Thread_queue_Control *the_thread_queue __attribute__((unused)),
Thread_Control *the_thread,
bool requeuing
)
{
800fe08: 37 9c ff f8 addi sp,sp,-8
800fe0c: 5b 8b 00 08 sw (sp+8),r11
800fe10: 5b 9d 00 04 sw (sp+4),ra
800fe14: b8 40 58 00 mv r11,r2
800fe18: 20 63 00 ff andi r3,r3,0xff
Chain_Node *new_first_node;
Chain_Node *new_second_node;
Chain_Node *last_node;
the_node = (Chain_Node *) the_thread;
_ISR_Disable( level );
800fe1c: 90 00 10 00 rcsr r2,IE
800fe20: 34 01 ff fe mvi r1,-2
800fe24: a0 41 08 00 and r1,r2,r1
800fe28: d0 01 00 00 wcsr IE,r1
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
800fe2c: 78 05 08 01 mvhi r5,0x801
800fe30: 38 a5 8c 8c ori r5,r5,0x8c8c
800fe34: 29 64 00 10 lw r4,(r11+16)
800fe38: 28 a1 00 00 lw r1,(r5+0)
800fe3c: a0 81 08 00 and r1,r4,r1
if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
800fe40: 44 20 00 19 be r1,r0,800fea4 <_Thread_queue_Extract_priority_helper+0x9c><== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
}
800fe44: 29 61 00 38 lw r1,(r11+56)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
800fe48: 35 66 00 3c addi r6,r11,60
/*
* The thread was actually waiting on a thread queue so let's remove it.
*/
next_node = the_node->next;
800fe4c: 29 64 00 00 lw r4,(r11+0)
previous_node = the_node->previous;
800fe50: 29 65 00 04 lw r5,(r11+4)
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
800fe54: 44 26 00 11 be r1,r6,800fe98 <_Thread_queue_Extract_priority_helper+0x90>
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
}
800fe58: 29 66 00 40 lw r6,(r11+64)
if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) {
new_first_node = _Chain_First( &the_thread->Wait.Block2n );
new_first_thread = (Thread_Control *) new_first_node;
last_node = _Chain_Last( &the_thread->Wait.Block2n );
new_second_node = new_first_node->next;
800fe5c: 28 27 00 00 lw r7,(r1+0)
previous_node->next = new_first_node;
next_node->previous = new_first_node;
800fe60: 58 81 00 04 sw (r4+4),r1
new_first_node = _Chain_First( &the_thread->Wait.Block2n );
new_first_thread = (Thread_Control *) new_first_node;
last_node = _Chain_Last( &the_thread->Wait.Block2n );
new_second_node = new_first_node->next;
previous_node->next = new_first_node;
800fe64: 58 a1 00 00 sw (r5+0),r1
next_node->previous = new_first_node;
new_first_node->next = next_node;
800fe68: 58 24 00 00 sw (r1+0),r4
new_first_node->previous = previous_node;
800fe6c: 58 25 00 04 sw (r1+4),r5
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
800fe70: 29 64 00 40 lw r4,(r11+64)
800fe74: 29 65 00 38 lw r5,(r11+56)
800fe78: 44 a4 00 0a be r5,r4,800fea0 <_Thread_queue_Extract_priority_helper+0x98>
/* > two threads on 2-n */
head = _Chain_Head( &new_first_thread->Wait.Block2n );
800fe7c: 34 24 00 38 addi r4,r1,56
tail = _Chain_Tail( &new_first_thread->Wait.Block2n );
new_second_node->previous = head;
800fe80: 58 e4 00 04 sw (r7+4),r4
head->next = new_second_node;
800fe84: 58 27 00 38 sw (r1+56),r7
tail->previous = last_node;
800fe88: 58 26 00 40 sw (r1+64),r6
new_first_node->previous = previous_node;
if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) {
/* > two threads on 2-n */
head = _Chain_Head( &new_first_thread->Wait.Block2n );
tail = _Chain_Tail( &new_first_thread->Wait.Block2n );
800fe8c: 34 21 00 3c addi r1,r1,60
new_second_node->previous = head;
head->next = new_second_node;
tail->previous = last_node;
last_node->next = tail;
800fe90: 58 c1 00 00 sw (r6+0),r1
800fe94: e0 00 00 03 bi 800fea0 <_Thread_queue_Extract_priority_helper+0x98>
}
} else {
previous_node->next = next_node;
800fe98: 58 a4 00 00 sw (r5+0),r4
next_node->previous = previous_node;
800fe9c: 58 85 00 04 sw (r4+4),r5
/*
* If we are not supposed to touch timers or the thread's state, return.
*/
if ( requeuing ) {
800fea0: 44 60 00 03 be r3,r0,800feac <_Thread_queue_Extract_priority_helper+0xa4>
_ISR_Enable( level );
800fea4: d0 02 00 00 wcsr IE,r2
return;
800fea8: e0 00 00 10 bi 800fee8 <_Thread_queue_Extract_priority_helper+0xe0>
}
if ( !_Watchdog_Is_active( &the_thread->Timer ) ) {
800feac: 29 63 00 50 lw r3,(r11+80)
800feb0: 34 01 00 02 mvi r1,2
800feb4: 44 61 00 03 be r3,r1,800fec0 <_Thread_queue_Extract_priority_helper+0xb8>
_ISR_Enable( level );
800feb8: d0 02 00 00 wcsr IE,r2
800febc: e0 00 00 06 bi 800fed4 <_Thread_queue_Extract_priority_helper+0xcc>
800fec0: 34 01 00 03 mvi r1,3
800fec4: 59 61 00 50 sw (r11+80),r1
} else {
_Watchdog_Deactivate( &the_thread->Timer );
_ISR_Enable( level );
800fec8: d0 02 00 00 wcsr IE,r2
(void) _Watchdog_Remove( &the_thread->Timer );
800fecc: 35 61 00 48 addi r1,r11,72
800fed0: fb ff e2 e0 calli 8008a50 <_Watchdog_Remove>
800fed4: 78 03 08 01 mvhi r3,0x801
800fed8: 38 63 8c 94 ori r3,r3,0x8c94
800fedc: 28 62 00 00 lw r2,(r3+0)
800fee0: b9 60 08 00 mv r1,r11
800fee4: fb ff fe ad calli 800f998 <_Thread_Clear_state>
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
_Thread_MP_Free_proxy( the_thread );
#endif
}
800fee8: 2b 9d 00 04 lw ra,(sp+4)
800feec: 2b 8b 00 08 lw r11,(sp+8)
800fef0: 37 9c 00 08 addi sp,sp,8
800fef4: c3 a0 00 00 ret
0800ff38 <_Thread_queue_Process_timeout>:
#include <rtems/score/tqdata.h>
void _Thread_queue_Process_timeout(
Thread_Control *the_thread
)
{
800ff38: 37 9c ff fc addi sp,sp,-4
800ff3c: 5b 9d 00 04 sw (sp+4),ra
800ff40: b8 20 10 00 mv r2,r1
Thread_queue_Control *the_thread_queue = the_thread->Wait.queue;
800ff44: 28 21 00 44 lw r1,(r1+68)
* If it is not satisfied, then it is "nothing happened" and
* this is the "timeout" transition. After a request is satisfied,
* a timeout is not allowed to occur.
*/
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED &&
800ff48: 28 24 00 30 lw r4,(r1+48)
800ff4c: 44 80 00 0c be r4,r0,800ff7c <_Thread_queue_Process_timeout+0x44>
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
800ff50: 78 03 08 01 mvhi r3,0x801
800ff54: 38 63 ae 00 ori r3,r3,0xae00
800ff58: 28 63 00 10 lw r3,(r3+16)
800ff5c: 5c 43 00 08 bne r2,r3,800ff7c <_Thread_queue_Process_timeout+0x44><== NEVER TAKEN
_Thread_Is_executing( the_thread ) ) {
if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) {
800ff60: 34 03 00 03 mvi r3,3
800ff64: 44 83 00 09 be r4,r3,800ff88 <_Thread_queue_Process_timeout+0x50><== ALWAYS TAKEN
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
800ff68: 28 23 00 3c lw r3,(r1+60) <== NOT EXECUTED
800ff6c: 58 43 00 34 sw (r2+52),r3 <== NOT EXECUTED
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT;
800ff70: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
800ff74: 58 22 00 30 sw (r1+48),r2 <== NOT EXECUTED
800ff78: e0 00 00 04 bi 800ff88 <_Thread_queue_Process_timeout+0x50><== NOT EXECUTED
}
} else {
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
800ff7c: 28 23 00 3c lw r3,(r1+60)
800ff80: 58 43 00 34 sw (r2+52),r3
_Thread_queue_Extract( the_thread->Wait.queue, the_thread );
800ff84: f8 00 06 d6 calli 8011adc <_Thread_queue_Extract>
}
}
800ff88: 2b 9d 00 04 lw ra,(sp+4)
800ff8c: 37 9c 00 04 addi sp,sp,4
800ff90: c3 a0 00 00 ret
08008390 <_Thread_queue_Requeue>:
void _Thread_queue_Requeue(
Thread_queue_Control *the_thread_queue,
Thread_Control *the_thread
)
{
8008390: 37 9c ff ec addi sp,sp,-20
8008394: 5b 8b 00 10 sw (sp+16),r11
8008398: 5b 8c 00 0c sw (sp+12),r12
800839c: 5b 8d 00 08 sw (sp+8),r13
80083a0: 5b 9d 00 04 sw (sp+4),ra
80083a4: b8 20 58 00 mv r11,r1
80083a8: b8 40 60 00 mv r12,r2
/*
* Just in case the thread really wasn't blocked on a thread queue
* when we get here.
*/
if ( !the_thread_queue )
80083ac: 44 20 00 19 be r1,r0,8008410 <_Thread_queue_Requeue+0x80> <== NEVER TAKEN
/*
* If queueing by FIFO, there is nothing to do. This only applies to
* priority blocking discipline.
*/
if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) {
80083b0: 28 22 00 34 lw r2,(r1+52)
80083b4: 34 01 00 01 mvi r1,1
80083b8: 5c 41 00 16 bne r2,r1,8008410 <_Thread_queue_Requeue+0x80> <== NEVER TAKEN
Thread_queue_Control *tq = the_thread_queue;
ISR_Level level;
ISR_Level level_ignored;
_ISR_Disable( level );
80083bc: 90 00 68 00 rcsr r13,IE
80083c0: 34 01 ff fe mvi r1,-2
80083c4: a1 a1 08 00 and r1,r13,r1
80083c8: d0 01 00 00 wcsr IE,r1
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
80083cc: 78 03 08 01 mvhi r3,0x801
80083d0: 38 63 8c 8c ori r3,r3,0x8c8c
80083d4: 29 82 00 10 lw r2,(r12+16)
80083d8: 28 61 00 00 lw r1,(r3+0)
80083dc: a0 41 08 00 and r1,r2,r1
if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) {
80083e0: 44 20 00 0b be r1,r0,800840c <_Thread_queue_Requeue+0x7c> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
80083e4: 34 01 00 01 mvi r1,1
80083e8: 59 61 00 30 sw (r11+48),r1
_Thread_queue_Enter_critical_section( tq );
_Thread_queue_Extract_priority_helper( tq, the_thread, true );
80083ec: b9 80 10 00 mv r2,r12
80083f0: b9 60 08 00 mv r1,r11
80083f4: 34 03 00 01 mvi r3,1
80083f8: f8 00 1e 84 calli 800fe08 <_Thread_queue_Extract_priority_helper>
(void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored );
80083fc: b9 60 08 00 mv r1,r11
8008400: b9 80 10 00 mv r2,r12
8008404: 37 83 00 14 addi r3,sp,20
8008408: fb ff ff 12 calli 8008050 <_Thread_queue_Enqueue_priority>
}
_ISR_Enable( level );
800840c: d0 0d 00 00 wcsr IE,r13
}
}
8008410: 2b 9d 00 04 lw ra,(sp+4)
8008414: 2b 8b 00 10 lw r11,(sp+16)
8008418: 2b 8c 00 0c lw r12,(sp+12)
800841c: 2b 8d 00 08 lw r13,(sp+8)
8008420: 37 9c 00 14 addi sp,sp,20
8008424: c3 a0 00 00 ret
08008428 <_Thread_queue_Timeout>:
void _Thread_queue_Timeout(
Objects_Id id,
void *ignored __attribute__((unused))
)
{
8008428: 37 9c ff f8 addi sp,sp,-8
800842c: 5b 9d 00 04 sw (sp+4),ra
Thread_Control *the_thread;
Objects_Locations location;
the_thread = _Thread_Get( id, &location );
8008430: 37 82 00 08 addi r2,sp,8
8008434: fb ff fd 6f calli 80079f0 <_Thread_Get>
switch ( location ) {
8008438: 2b 82 00 08 lw r2,(sp+8)
800843c: 5c 40 00 07 bne r2,r0,8008458 <_Thread_queue_Timeout+0x30> <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: /* impossible */
#endif
break;
case OBJECTS_LOCAL:
_Thread_queue_Process_timeout( the_thread );
8008440: f8 00 1e be calli 800ff38 <_Thread_queue_Process_timeout>
*
* This routine decrements the thread dispatch level.
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
8008444: 78 01 08 01 mvhi r1,0x801
8008448: 38 21 a9 78 ori r1,r1,0xa978
800844c: 28 22 00 00 lw r2,(r1+0)
--level;
8008450: 34 42 ff ff addi r2,r2,-1
_Thread_Dispatch_disable_level = level;
8008454: 58 22 00 00 sw (r1+0),r2
_Thread_Unnest_dispatch();
break;
}
}
8008458: 2b 9d 00 04 lw ra,(sp+4)
800845c: 37 9c 00 08 addi sp,sp,8
8008460: c3 a0 00 00 ret
08015648 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
8015648: 37 9c ff a8 addi sp,sp,-88
801564c: 5b 8b 00 40 sw (sp+64),r11
8015650: 5b 8c 00 3c sw (sp+60),r12
8015654: 5b 8d 00 38 sw (sp+56),r13
8015658: 5b 8e 00 34 sw (sp+52),r14
801565c: 5b 8f 00 30 sw (sp+48),r15
8015660: 5b 90 00 2c sw (sp+44),r16
8015664: 5b 91 00 28 sw (sp+40),r17
8015668: 5b 92 00 24 sw (sp+36),r18
801566c: 5b 93 00 20 sw (sp+32),r19
8015670: 5b 94 00 1c sw (sp+28),r20
8015674: 5b 95 00 18 sw (sp+24),r21
8015678: 5b 96 00 14 sw (sp+20),r22
801567c: 5b 97 00 10 sw (sp+16),r23
8015680: 5b 98 00 0c sw (sp+12),r24
8015684: 5b 99 00 08 sw (sp+8),r25
8015688: 5b 9d 00 04 sw (sp+4),ra
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
801568c: 78 10 08 03 mvhi r16,0x803
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
8015690: b8 20 58 00 mv r11,r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
8015694: 37 82 00 54 addi r2,sp,84
8015698: 37 81 00 50 addi r1,sp,80
801569c: 37 8f 00 44 addi r15,sp,68
80156a0: 37 91 00 48 addi r17,sp,72
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
80156a4: 78 0d 08 03 mvhi r13,0x803
80156a8: 5b 82 00 50 sw (sp+80),r2
head->previous = NULL;
80156ac: 5b 80 00 54 sw (sp+84),r0
tail->previous = head;
80156b0: 5b 81 00 58 sw (sp+88),r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
80156b4: 5b 91 00 44 sw (sp+68),r17
head->previous = NULL;
80156b8: 5b 80 00 48 sw (sp+72),r0
tail->previous = head;
80156bc: 5b 8f 00 4c sw (sp+76),r15
{
/*
* 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;
80156c0: b8 20 c8 00 mv r25,r1
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
80156c4: 3a 10 fe 38 ori r16,r16,0xfe38
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
80156c8: 35 73 00 30 addi r19,r11,48
static void _Timer_server_Process_tod_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
80156cc: 39 ad fc d0 ori r13,r13,0xfcd0
/*
* 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 );
80156d0: 35 6e 00 68 addi r14,r11,104
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
80156d4: 34 18 00 03 mvi r24,3
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
80156d8: 34 12 ff fe mvi r18,-2
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail(
const Chain_Control *the_chain
)
{
return &the_chain->Tail.Node;
80156dc: b8 40 b8 00 mv r23,r2
_Thread_Set_state( ts->thread, STATES_DELAYING );
_Timer_server_Reset_interval_system_watchdog( ts );
_Timer_server_Reset_tod_system_watchdog( ts );
_Thread_Enable_dispatch();
ts->active = true;
80156e0: 34 16 00 01 mvi r22,1
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
80156e4: 35 75 00 08 addi r21,r11,8
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
80156e8: 35 74 00 40 addi r20,r11,64
{
/*
* 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;
80156ec: 59 79 00 78 sw (r11+120),r25
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
80156f0: 2a 02 00 00 lw r2,(r16+0)
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
80156f4: 29 63 00 3c lw r3,(r11+60)
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
80156f8: ba 60 08 00 mv r1,r19
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
80156fc: 59 62 00 3c sw (r11+60),r2
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
8015700: c8 43 10 00 sub r2,r2,r3
8015704: b9 e0 18 00 mv r3,r15
8015708: f8 00 15 5a calli 801ac70 <_Watchdog_Adjust_to_chain>
801570c: 78 05 08 03 mvhi r5,0x803
8015710: 38 a5 88 cc ori r5,r5,0x88cc
8015714: 28 a4 00 00 lw r4,(r5+0)
8015718: 29 a1 00 00 lw r1,(r13+0)
801571c: 29 a2 00 04 lw r2,(r13+4)
8015720: 34 03 00 00 mvi r3,0
8015724: f8 00 56 04 calli 802af34 <__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;
8015728: 29 64 00 74 lw r4,(r11+116)
801572c: b8 40 60 00 mv r12,r2
/*
* 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 ) {
8015730: 50 82 00 06 bgeu r4,r2,8015748 <_Timer_server_Body+0x100>
/*
* 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 );
8015734: b9 c0 08 00 mv r1,r14
8015738: c8 44 10 00 sub r2,r2,r4
801573c: b9 e0 18 00 mv r3,r15
8015740: f8 00 15 4c calli 801ac70 <_Watchdog_Adjust_to_chain>
8015744: e0 00 00 06 bi 801575c <_Timer_server_Body+0x114>
} else if ( snapshot < last_snapshot ) {
8015748: 50 44 00 05 bgeu r2,r4,801575c <_Timer_server_Body+0x114>
/*
* 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 );
801574c: b9 c0 08 00 mv r1,r14
8015750: 34 02 00 01 mvi r2,1
8015754: c8 8c 18 00 sub r3,r4,r12
8015758: f8 00 15 0f calli 801ab94 <_Watchdog_Adjust>
}
watchdogs->last_snapshot = snapshot;
801575c: 59 6c 00 74 sw (r11+116),r12
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
8015760: 34 0c 00 01 mvi r12,1
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
8015764: 29 63 00 78 lw r3,(r11+120)
8015768: b8 60 08 00 mv r1,r3
801576c: f8 00 03 8a calli 8016594 <_Chain_Get>
8015770: b8 20 10 00 mv r2,r1
if ( timer == NULL ) {
8015774: 44 20 00 09 be r1,r0,8015798 <_Timer_server_Body+0x150>
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
8015778: 28 23 00 38 lw r3,(r1+56)
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
801577c: ba 60 08 00 mv r1,r19
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
8015780: 44 6c 00 03 be r3,r12,801578c <_Timer_server_Body+0x144>
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
8015784: 5c 78 ff f8 bne r3,r24,8015764 <_Timer_server_Body+0x11c> <== NEVER TAKEN
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
8015788: b9 c0 08 00 mv r1,r14
801578c: 34 42 00 10 addi r2,r2,16
8015790: f8 00 15 5a calli 801acf8 <_Watchdog_Insert>
8015794: e3 ff ff f4 bi 8015764 <_Timer_server_Body+0x11c>
* of zero it will be processed in the next iteration of the timer server
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
8015798: 90 00 10 00 rcsr r2,IE
801579c: a0 52 08 00 and r1,r2,r18
80157a0: d0 01 00 00 wcsr IE,r1
if ( _Chain_Is_empty( insert_chain ) ) {
80157a4: 2b 81 00 50 lw r1,(sp+80)
80157a8: 5c 37 00 06 bne r1,r23,80157c0 <_Timer_server_Body+0x178> <== NEVER TAKEN
ts->insert_chain = NULL;
80157ac: 59 60 00 78 sw (r11+120),r0
_ISR_Enable( level );
80157b0: d0 02 00 00 wcsr IE,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 ) ) {
80157b4: 2b 81 00 44 lw r1,(sp+68)
80157b8: 5c 31 00 04 bne r1,r17,80157c8 <_Timer_server_Body+0x180>
80157bc: e0 00 00 15 bi 8015810 <_Timer_server_Body+0x1c8>
ts->insert_chain = NULL;
_ISR_Enable( level );
break;
} else {
_ISR_Enable( level );
80157c0: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED
80157c4: e3 ff ff cb bi 80156f0 <_Timer_server_Body+0xa8> <== NOT EXECUTED
/*
* It is essential that interrupts are disable here since an interrupt
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
80157c8: 90 00 18 00 rcsr r3,IE
80157cc: a0 72 08 00 and r1,r3,r18
80157d0: d0 01 00 00 wcsr IE,r1
initialized = false;
}
#endif
return status;
}
80157d4: 2b 82 00 44 lw r2,(sp+68)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
80157d8: 44 51 00 0c be r2,r17,8015808 <_Timer_server_Body+0x1c0>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
80157dc: 28 44 00 00 lw r4,(r2+0)
head->next = new_first;
80157e0: 5b 84 00 44 sw (sp+68),r4
new_first->previous = head;
80157e4: 58 8f 00 04 sw (r4+4),r15
* It is essential that interrupts are disable here since an interrupt
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
80157e8: 44 40 00 08 be r2,r0,8015808 <_Timer_server_Body+0x1c0> <== NEVER TAKEN
watchdog->state = WATCHDOG_INACTIVE;
80157ec: 58 40 00 08 sw (r2+8),r0
_ISR_Enable( level );
80157f0: d0 03 00 00 wcsr IE,r3
/*
* 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 );
80157f4: 28 43 00 1c lw r3,(r2+28)
80157f8: 28 41 00 20 lw r1,(r2+32)
80157fc: 28 42 00 24 lw r2,(r2+36)
8015800: d8 60 00 00 call r3
}
8015804: e3 ff ff f1 bi 80157c8 <_Timer_server_Body+0x180>
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
_ISR_Enable( level );
} else {
_ISR_Enable( level );
8015808: d0 03 00 00 wcsr IE,r3
801580c: e3 ff ff b8 bi 80156ec <_Timer_server_Body+0xa4>
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
}
} else {
ts->active = false;
8015810: 31 60 00 7c sb (r11+124),r0
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
8015814: fb ff ff 4d calli 8015548 <_Thread_Disable_dispatch>
_Thread_Set_state( ts->thread, STATES_DELAYING );
8015818: 29 61 00 00 lw r1,(r11+0)
801581c: 34 02 00 08 mvi r2,8
8015820: f8 00 13 c9 calli 801a744 <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
8015824: b9 60 08 00 mv r1,r11
8015828: fb ff ff 4e calli 8015560 <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
801582c: b9 60 08 00 mv r1,r11
8015830: fb ff ff 69 calli 80155d4 <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
8015834: f8 00 10 de calli 8019bac <_Thread_Enable_dispatch>
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
8015838: ba a0 08 00 mv r1,r21
_Thread_Set_state( ts->thread, STATES_DELAYING );
_Timer_server_Reset_interval_system_watchdog( ts );
_Timer_server_Reset_tod_system_watchdog( ts );
_Thread_Enable_dispatch();
ts->active = true;
801583c: 31 76 00 7c sb (r11+124),r22
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
8015840: f8 00 15 8b calli 801ae6c <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
8015844: ba 80 08 00 mv r1,r20
8015848: f8 00 15 89 calli 801ae6c <_Watchdog_Remove>
801584c: e3 ff ff a8 bi 80156ec <_Timer_server_Body+0xa4>
08015850 <_Timer_server_Schedule_operation_method>:
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
8015850: 37 9c ff f0 addi sp,sp,-16
8015854: 5b 8b 00 10 sw (sp+16),r11
8015858: 5b 8c 00 0c sw (sp+12),r12
801585c: 5b 8d 00 08 sw (sp+8),r13
8015860: 5b 9d 00 04 sw (sp+4),ra
8015864: b8 20 58 00 mv r11,r1
if ( ts->insert_chain == NULL ) {
8015868: 28 21 00 78 lw r1,(r1+120)
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
)
{
801586c: b8 40 60 00 mv r12,r2
if ( ts->insert_chain == NULL ) {
8015870: 5c 20 00 49 bne r1,r0,8015994 <_Timer_server_Schedule_operation_method+0x144>
* is the reference point for the delta chain. Thus if we do not update the
* reference point we have to add DT to the initial delta of the watchdog
* being inserted. This could result in an integer overflow.
*/
_Thread_Disable_dispatch();
8015874: fb ff ff 35 calli 8015548 <_Thread_Disable_dispatch>
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
8015878: 29 81 00 38 lw r1,(r12+56)
801587c: 34 02 00 01 mvi r2,1
8015880: 5c 22 00 1d bne r1,r2,80158f4 <_Timer_server_Schedule_operation_method+0xa4>
/*
* We have to advance the last known ticks value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
8015884: 90 00 10 00 rcsr r2,IE
8015888: 34 01 ff fe mvi r1,-2
801588c: a0 41 08 00 and r1,r2,r1
8015890: d0 01 00 00 wcsr IE,r1
snapshot = _Watchdog_Ticks_since_boot;
8015894: 78 01 08 03 mvhi r1,0x803
8015898: 38 21 fe 38 ori r1,r1,0xfe38
801589c: 28 23 00 00 lw r3,(r1+0)
initialized = false;
}
#endif
return status;
}
80158a0: 29 61 00 30 lw r1,(r11+48)
* We have to advance the last known ticks value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
snapshot = _Watchdog_Ticks_since_boot;
last_snapshot = ts->Interval_watchdogs.last_snapshot;
80158a4: 29 65 00 3c lw r5,(r11+60)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
80158a8: 35 64 00 34 addi r4,r11,52
if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) {
80158ac: 44 24 00 07 be r1,r4,80158c8 <_Timer_server_Schedule_operation_method+0x78>
/*
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
delta_interval = first_watchdog->delta_interval;
80158b0: 28 26 00 10 lw r6,(r1+16)
first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain );
/*
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
80158b4: c8 65 28 00 sub r5,r3,r5
delta_interval = first_watchdog->delta_interval;
if (delta_interval > delta) {
delta_interval -= delta;
} else {
delta_interval = 0;
80158b8: 34 04 00 00 mvi r4,0
* We assume adequate unsigned arithmetic here.
*/
delta = snapshot - last_snapshot;
delta_interval = first_watchdog->delta_interval;
if (delta_interval > delta) {
80158bc: 50 a6 00 02 bgeu r5,r6,80158c4 <_Timer_server_Schedule_operation_method+0x74>
delta_interval -= delta;
80158c0: c8 c5 20 00 sub r4,r6,r5
} else {
delta_interval = 0;
}
first_watchdog->delta_interval = delta_interval;
80158c4: 58 24 00 10 sw (r1+16),r4
}
ts->Interval_watchdogs.last_snapshot = snapshot;
80158c8: 59 63 00 3c sw (r11+60),r3
_ISR_Enable( level );
80158cc: d0 02 00 00 wcsr IE,r2
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
80158d0: 35 61 00 30 addi r1,r11,48
80158d4: 35 82 00 10 addi r2,r12,16
80158d8: f8 00 15 08 calli 801acf8 <_Watchdog_Insert>
if ( !ts->active ) {
80158dc: 41 61 00 7c lbu r1,(r11+124)
80158e0: 20 21 00 ff andi r1,r1,0xff
80158e4: 5c 20 00 2a bne r1,r0,801598c <_Timer_server_Schedule_operation_method+0x13c>
_Timer_server_Reset_interval_system_watchdog( ts );
80158e8: b9 60 08 00 mv r1,r11
80158ec: fb ff ff 1d calli 8015560 <_Timer_server_Reset_interval_system_watchdog>
80158f0: e0 00 00 27 bi 801598c <_Timer_server_Schedule_operation_method+0x13c>
}
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
80158f4: 34 02 00 03 mvi r2,3
80158f8: 5c 22 00 25 bne r1,r2,801598c <_Timer_server_Schedule_operation_method+0x13c>
/*
* We have to advance the last known seconds value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
80158fc: 90 00 68 00 rcsr r13,IE
8015900: 34 01 ff fe mvi r1,-2
8015904: a1 a1 08 00 and r1,r13,r1
8015908: d0 01 00 00 wcsr IE,r1
snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
801590c: 78 03 08 03 mvhi r3,0x803
8015910: 78 05 08 03 mvhi r5,0x803
8015914: 38 63 fc d0 ori r3,r3,0xfcd0
8015918: 38 a5 88 cc ori r5,r5,0x88cc
801591c: 28 61 00 00 lw r1,(r3+0)
8015920: 28 62 00 04 lw r2,(r3+4)
8015924: 28 a4 00 00 lw r4,(r5+0)
8015928: 34 03 00 00 mvi r3,0
801592c: f8 00 55 82 calli 802af34 <__divdi3>
initialized = false;
}
#endif
return status;
}
8015930: 29 61 00 68 lw r1,(r11+104)
* We have to advance the last known seconds value of the server and update
* the watchdog chain accordingly.
*/
_ISR_Disable( level );
snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
last_snapshot = ts->TOD_watchdogs.last_snapshot;
8015934: 29 65 00 74 lw r5,(r11+116)
8015938: 35 63 00 6c addi r3,r11,108
if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) {
801593c: 44 23 00 0a be r1,r3,8015964 <_Timer_server_Schedule_operation_method+0x114>
first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain );
delta_interval = first_watchdog->delta_interval;
8015940: 28 24 00 10 lw r4,(r1+16)
}
} else {
/*
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
8015944: b4 85 18 00 add r3,r4,r5
delta_interval += delta;
8015948: c8 62 18 00 sub r3,r3,r2
snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
last_snapshot = ts->TOD_watchdogs.last_snapshot;
if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) {
first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain );
delta_interval = first_watchdog->delta_interval;
if ( snapshot > last_snapshot ) {
801594c: 50 a2 00 05 bgeu r5,r2,8015960 <_Timer_server_Schedule_operation_method+0x110>
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
8015950: c8 45 28 00 sub r5,r2,r5
if (delta_interval > delta) {
delta_interval -= delta;
} else {
delta_interval = 0;
8015954: 34 03 00 00 mvi r3,0
if ( snapshot > last_snapshot ) {
/*
* We advanced in time.
*/
delta = snapshot - last_snapshot;
if (delta_interval > delta) {
8015958: 50 a4 00 02 bgeu r5,r4,8015960 <_Timer_server_Schedule_operation_method+0x110><== NEVER TAKEN
delta_interval -= delta;
801595c: c8 85 18 00 sub r3,r4,r5
* Someone put us in the past.
*/
delta = last_snapshot - snapshot;
delta_interval += delta;
}
first_watchdog->delta_interval = delta_interval;
8015960: 58 23 00 10 sw (r1+16),r3
}
ts->TOD_watchdogs.last_snapshot = snapshot;
8015964: 59 62 00 74 sw (r11+116),r2
_ISR_Enable( level );
8015968: d0 0d 00 00 wcsr IE,r13
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
801596c: 35 61 00 68 addi r1,r11,104
8015970: 35 82 00 10 addi r2,r12,16
8015974: f8 00 14 e1 calli 801acf8 <_Watchdog_Insert>
if ( !ts->active ) {
8015978: 41 61 00 7c lbu r1,(r11+124)
801597c: 20 21 00 ff andi r1,r1,0xff
8015980: 5c 20 00 03 bne r1,r0,801598c <_Timer_server_Schedule_operation_method+0x13c>
_Timer_server_Reset_tod_system_watchdog( ts );
8015984: b9 60 08 00 mv r1,r11
8015988: fb ff ff 13 calli 80155d4 <_Timer_server_Reset_tod_system_watchdog>
}
}
_Thread_Enable_dispatch();
801598c: f8 00 10 88 calli 8019bac <_Thread_Enable_dispatch>
8015990: e0 00 00 03 bi 801599c <_Timer_server_Schedule_operation_method+0x14c>
* server is not preemptible, so we must be in interrupt context here. No
* thread dispatch will happen until the timer server finishes its
* critical section. We have to use the protected chain methods because
* we may be interrupted by a higher priority interrupt.
*/
_Chain_Append( ts->insert_chain, &timer->Object.Node );
8015994: 29 61 00 78 lw r1,(r11+120)
8015998: f8 00 02 f3 calli 8016564 <_Chain_Append>
}
}
801599c: 2b 9d 00 04 lw ra,(sp+4)
80159a0: 2b 8b 00 10 lw r11,(sp+16)
80159a4: 2b 8c 00 0c lw r12,(sp+12)
80159a8: 2b 8d 00 08 lw r13,(sp+8)
80159ac: 37 9c 00 10 addi sp,sp,16
80159b0: c3 a0 00 00 ret
08008880 <_User_extensions_Handler_initialization>:
}
}
void _User_extensions_Handler_initialization(void)
{
8008880: 37 9c ff f4 addi sp,sp,-12
8008884: 5b 8b 00 08 sw (sp+8),r11
8008888: 5b 9d 00 04 sw (sp+4),ra
uint32_t number_of_initial_extensions =
800888c: 78 01 08 01 mvhi r1,0x801
8008890: 38 21 87 ec ori r1,r1,0x87ec
8008894: 28 2b 00 40 lw r11,(r1+64)
rtems_configuration_get_number_of_initial_extensions();
if ( number_of_initial_extensions > 0 ) {
8008898: 45 60 00 0d be r11,r0,80088cc <_User_extensions_Handler_initialization+0x4c><== NEVER TAKEN
User_extensions_Switch_control *initial_extension_switch_controls =
_Workspace_Allocate_or_fatal_error(
number_of_initial_extensions
* sizeof( *initial_extension_switch_controls )
800889c: 34 02 00 01 mvi r2,1
80088a0: b9 60 08 00 mv r1,r11
80088a4: f8 00 3c 27 calli 8017940 <__ashlsi3>
80088a8: 34 02 00 02 mvi r2,2
80088ac: b4 2b 08 00 add r1,r1,r11
80088b0: f8 00 3c 24 calli 8017940 <__ashlsi3>
uint32_t number_of_initial_extensions =
rtems_configuration_get_number_of_initial_extensions();
if ( number_of_initial_extensions > 0 ) {
User_extensions_Switch_control *initial_extension_switch_controls =
_Workspace_Allocate_or_fatal_error(
80088b4: f8 00 00 fc calli 8008ca4 <_Workspace_Allocate_or_fatal_error>
number_of_initial_extensions
* sizeof( *initial_extension_switch_controls )
);
User_extensions_Switch_context ctx = { initial_extension_switch_controls };
_User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor );
80088b8: 78 02 08 00 mvhi r2,0x800
User_extensions_Switch_control *initial_extension_switch_controls =
_Workspace_Allocate_or_fatal_error(
number_of_initial_extensions
* sizeof( *initial_extension_switch_controls )
);
User_extensions_Switch_context ctx = { initial_extension_switch_controls };
80088bc: 5b 81 00 0c sw (sp+12),r1
_User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor );
80088c0: 38 42 88 40 ori r2,r2,0x8840
80088c4: 37 81 00 0c addi r1,sp,12
80088c8: fb ff ff b0 calli 8008788 <_User_extensions_Iterate>
}
}
80088cc: 2b 9d 00 04 lw ra,(sp+4)
80088d0: 2b 8b 00 08 lw r11,(sp+8)
80088d4: 37 9c 00 0c addi sp,sp,12
80088d8: c3 a0 00 00 ret
080091f8 <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
80091f8: 37 9c ff e4 addi sp,sp,-28
80091fc: 5b 8b 00 1c sw (sp+28),r11
8009200: 5b 8c 00 18 sw (sp+24),r12
8009204: 5b 8d 00 14 sw (sp+20),r13
8009208: 5b 8e 00 10 sw (sp+16),r14
800920c: 5b 8f 00 0c sw (sp+12),r15
8009210: 5b 90 00 08 sw (sp+8),r16
8009214: 5b 9d 00 04 sw (sp+4),ra
8009218: b8 20 60 00 mv r12,r1
800921c: b8 60 58 00 mv r11,r3
ISR_Level level;
_ISR_Disable( level );
8009220: 90 00 08 00 rcsr r1,IE
8009224: 34 03 ff fe mvi r3,-2
8009228: a0 23 18 00 and r3,r1,r3
800922c: d0 03 00 00 wcsr IE,r3
}
}
_ISR_Enable( level );
}
8009230: 29 83 00 00 lw r3,(r12+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
8009234: 35 8e 00 04 addi r14,r12,4
* hence the compiler must not assume *header to remain
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
8009238: 44 6e 00 1d be r3,r14,80092ac <_Watchdog_Adjust+0xb4>
switch ( direction ) {
800923c: 44 40 00 04 be r2,r0,800924c <_Watchdog_Adjust+0x54>
8009240: 34 04 00 01 mvi r4,1
8009244: 5c 44 00 1a bne r2,r4,80092ac <_Watchdog_Adjust+0xb4> <== NEVER TAKEN
8009248: e0 00 00 04 bi 8009258 <_Watchdog_Adjust+0x60>
if ( units < _Watchdog_First( header )->delta_interval ) {
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
800924c: 34 10 00 01 mvi r16,1
_ISR_Enable( level );
_Watchdog_Tickle( header );
_ISR_Disable( level );
8009250: 34 0f ff fe mvi r15,-2
8009254: e0 00 00 15 bi 80092a8 <_Watchdog_Adjust+0xb0>
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
8009258: 28 62 00 10 lw r2,(r3+16)
800925c: b4 4b 58 00 add r11,r2,r11
8009260: 58 6b 00 10 sw (r3+16),r11
break;
8009264: e0 00 00 12 bi 80092ac <_Watchdog_Adjust+0xb4>
RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First(
Chain_Control *header
)
{
return ( (Watchdog_Control *) _Chain_First( header ) );
8009268: 29 82 00 00 lw r2,(r12+0)
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
800926c: 28 4d 00 10 lw r13,(r2+16)
8009270: 51 6d 00 04 bgeu r11,r13,8009280 <_Watchdog_Adjust+0x88>
_Watchdog_First( header )->delta_interval -= units;
8009274: c9 ab 58 00 sub r11,r13,r11
8009278: 58 4b 00 10 sw (r2+16),r11
break;
800927c: e0 00 00 0c bi 80092ac <_Watchdog_Adjust+0xb4>
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
8009280: 58 50 00 10 sw (r2+16),r16
_ISR_Enable( level );
8009284: d0 01 00 00 wcsr IE,r1
_Watchdog_Tickle( header );
8009288: b9 80 08 00 mv r1,r12
800928c: f8 00 00 98 calli 80094ec <_Watchdog_Tickle>
_ISR_Disable( level );
8009290: 90 00 08 00 rcsr r1,IE
8009294: a0 2f 10 00 and r2,r1,r15
8009298: d0 02 00 00 wcsr IE,r2
if ( _Chain_Is_empty( header ) )
800929c: 29 82 00 00 lw r2,(r12+0)
80092a0: 44 4e 00 03 be r2,r14,80092ac <_Watchdog_Adjust+0xb4>
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
80092a4: c9 6d 58 00 sub r11,r11,r13
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
80092a8: 5d 60 ff f0 bne r11,r0,8009268 <_Watchdog_Adjust+0x70> <== ALWAYS TAKEN
}
break;
}
}
_ISR_Enable( level );
80092ac: d0 01 00 00 wcsr IE,r1
}
80092b0: 2b 9d 00 04 lw ra,(sp+4)
80092b4: 2b 8b 00 1c lw r11,(sp+28)
80092b8: 2b 8c 00 18 lw r12,(sp+24)
80092bc: 2b 8d 00 14 lw r13,(sp+20)
80092c0: 2b 8e 00 10 lw r14,(sp+16)
80092c4: 2b 8f 00 0c lw r15,(sp+12)
80092c8: 2b 90 00 08 lw r16,(sp+8)
80092cc: 37 9c 00 1c addi sp,sp,28
80092d0: c3 a0 00 00 ret
08008a50 <_Watchdog_Remove>:
{
ISR_Level level;
Watchdog_States previous_state;
Watchdog_Control *next_watchdog;
_ISR_Disable( level );
8008a50: 90 00 28 00 rcsr r5,IE
8008a54: 34 02 ff fe mvi r2,-2
8008a58: a0 a2 10 00 and r2,r5,r2
8008a5c: d0 02 00 00 wcsr IE,r2
previous_state = the_watchdog->state;
8008a60: 28 23 00 08 lw r3,(r1+8)
switch ( previous_state ) {
8008a64: 34 02 00 01 mvi r2,1
8008a68: 44 62 00 05 be r3,r2,8008a7c <_Watchdog_Remove+0x2c>
8008a6c: 44 60 00 1b be r3,r0,8008ad8 <_Watchdog_Remove+0x88>
8008a70: 34 02 00 03 mvi r2,3
8008a74: 54 62 00 19 bgu r3,r2,8008ad8 <_Watchdog_Remove+0x88> <== NEVER TAKEN
8008a78: e0 00 00 03 bi 8008a84 <_Watchdog_Remove+0x34>
/*
* It is not actually on the chain so just change the state and
* the Insert operation we interrupted will be aborted.
*/
the_watchdog->state = WATCHDOG_INACTIVE;
8008a7c: 58 20 00 08 sw (r1+8),r0
break;
8008a80: e0 00 00 16 bi 8008ad8 <_Watchdog_Remove+0x88>
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
_ISR_Enable( level );
return( previous_state );
}
8008a84: 28 22 00 00 lw r2,(r1+0)
break;
case WATCHDOG_ACTIVE:
case WATCHDOG_REMOVE_IT:
the_watchdog->state = WATCHDOG_INACTIVE;
8008a88: 58 20 00 08 sw (r1+8),r0
next_watchdog = _Watchdog_Next( the_watchdog );
if ( _Watchdog_Next(next_watchdog) )
8008a8c: 28 44 00 00 lw r4,(r2+0)
8008a90: 44 80 00 05 be r4,r0,8008aa4 <_Watchdog_Remove+0x54>
next_watchdog->delta_interval += the_watchdog->delta_interval;
8008a94: 28 46 00 10 lw r6,(r2+16)
8008a98: 28 24 00 10 lw r4,(r1+16)
8008a9c: b4 c4 20 00 add r4,r6,r4
8008aa0: 58 44 00 10 sw (r2+16),r4
if ( _Watchdog_Sync_count )
8008aa4: 78 04 08 01 mvhi r4,0x801
8008aa8: 38 84 aa 5c ori r4,r4,0xaa5c
8008aac: 28 84 00 00 lw r4,(r4+0)
8008ab0: 44 80 00 07 be r4,r0,8008acc <_Watchdog_Remove+0x7c>
_Watchdog_Sync_level = _ISR_Nest_level;
8008ab4: 78 04 08 01 mvhi r4,0x801
8008ab8: 38 84 ae 00 ori r4,r4,0xae00
8008abc: 28 86 00 08 lw r6,(r4+8)
8008ac0: 78 04 08 01 mvhi r4,0x801
8008ac4: 38 84 a9 fc ori r4,r4,0xa9fc
8008ac8: 58 86 00 00 sw (r4+0),r6
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
8008acc: 28 24 00 04 lw r4,(r1+4)
next->previous = previous;
8008ad0: 58 44 00 04 sw (r2+4),r4
previous->next = next;
8008ad4: 58 82 00 00 sw (r4+0),r2
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
}
the_watchdog->stop_time = _Watchdog_Ticks_since_boot;
8008ad8: 78 02 08 01 mvhi r2,0x801
8008adc: 38 42 aa 60 ori r2,r2,0xaa60
8008ae0: 28 42 00 00 lw r2,(r2+0)
8008ae4: 58 22 00 18 sw (r1+24),r2
_ISR_Enable( level );
8008ae8: d0 05 00 00 wcsr IE,r5
return( previous_state );
}
8008aec: b8 60 08 00 mv r1,r3
8008af0: c3 a0 00 00 ret
08008e0c <_Watchdog_Report_chain>:
void _Watchdog_Report_chain(
const char *name,
Chain_Control *header
)
{
8008e0c: 37 9c ff ec addi sp,sp,-20
8008e10: 5b 8b 00 14 sw (sp+20),r11
8008e14: 5b 8c 00 10 sw (sp+16),r12
8008e18: 5b 8d 00 0c sw (sp+12),r13
8008e1c: 5b 8e 00 08 sw (sp+8),r14
8008e20: 5b 9d 00 04 sw (sp+4),ra
8008e24: b8 20 70 00 mv r14,r1
8008e28: b8 40 60 00 mv r12,r2
ISR_Level level;
Chain_Node *node;
_ISR_Disable( level );
8008e2c: 90 00 68 00 rcsr r13,IE
8008e30: 34 01 ff fe mvi r1,-2
8008e34: a1 a1 08 00 and r1,r13,r1
8008e38: d0 01 00 00 wcsr IE,r1
printk( "Watchdog Chain: %s %p\n", name, header );
8008e3c: 78 01 08 01 mvhi r1,0x801
8008e40: b9 80 18 00 mv r3,r12
8008e44: 38 21 f6 64 ori r1,r1,0xf664
8008e48: b9 c0 10 00 mv r2,r14
8008e4c: fb ff e8 93 calli 8003098 <printk>
printk( "== end of %s \n", name );
} else {
printk( "Chain is empty\n" );
}
_ISR_Enable( level );
}
8008e50: 29 8b 00 00 lw r11,(r12+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
8008e54: 35 8c 00 04 addi r12,r12,4
ISR_Level level;
Chain_Node *node;
_ISR_Disable( level );
printk( "Watchdog Chain: %s %p\n", name, header );
if ( !_Chain_Is_empty( header ) ) {
8008e58: 45 6c 00 0b be r11,r12,8008e84 <_Watchdog_Report_chain+0x78>
node != _Chain_Tail(header) ;
node = node->next )
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
8008e5c: b9 60 10 00 mv r2,r11
8008e60: 34 01 00 00 mvi r1,0
8008e64: f8 00 00 13 calli 8008eb0 <_Watchdog_Report>
_ISR_Disable( level );
printk( "Watchdog Chain: %s %p\n", name, header );
if ( !_Chain_Is_empty( header ) ) {
for ( node = _Chain_First( header ) ;
node != _Chain_Tail(header) ;
node = node->next )
8008e68: 29 6b 00 00 lw r11,(r11+0)
Chain_Node *node;
_ISR_Disable( level );
printk( "Watchdog Chain: %s %p\n", name, header );
if ( !_Chain_Is_empty( header ) ) {
for ( node = _Chain_First( header ) ;
8008e6c: 5d 6c ff fc bne r11,r12,8008e5c <_Watchdog_Report_chain+0x50><== NEVER TAKEN
{
Watchdog_Control *watch = (Watchdog_Control *) node;
_Watchdog_Report( NULL, watch );
}
printk( "== end of %s \n", name );
8008e70: 78 01 08 01 mvhi r1,0x801
8008e74: 38 21 f6 7c ori r1,r1,0xf67c
8008e78: b9 c0 10 00 mv r2,r14
8008e7c: fb ff e8 87 calli 8003098 <printk>
8008e80: e0 00 00 04 bi 8008e90 <_Watchdog_Report_chain+0x84>
} else {
printk( "Chain is empty\n" );
8008e84: 78 01 08 01 mvhi r1,0x801
8008e88: 38 21 f6 8c ori r1,r1,0xf68c
8008e8c: fb ff e8 83 calli 8003098 <printk>
}
_ISR_Enable( level );
8008e90: d0 0d 00 00 wcsr IE,r13
}
8008e94: 2b 9d 00 04 lw ra,(sp+4)
8008e98: 2b 8b 00 14 lw r11,(sp+20)
8008e9c: 2b 8c 00 10 lw r12,(sp+16)
8008ea0: 2b 8d 00 0c lw r13,(sp+12)
8008ea4: 2b 8e 00 08 lw r14,(sp+8)
8008ea8: 37 9c 00 14 addi sp,sp,20
8008eac: c3 a0 00 00 ret
0800cce8 <_Watchdog_Tickle>:
#include <rtems/score/watchdog.h>
void _Watchdog_Tickle(
Chain_Control *header
)
{
800cce8: 37 9c ff e4 addi sp,sp,-28
800ccec: 5b 8b 00 1c sw (sp+28),r11
800ccf0: 5b 8c 00 18 sw (sp+24),r12
800ccf4: 5b 8d 00 14 sw (sp+20),r13
800ccf8: 5b 8e 00 10 sw (sp+16),r14
800ccfc: 5b 8f 00 0c sw (sp+12),r15
800cd00: 5b 90 00 08 sw (sp+8),r16
800cd04: 5b 9d 00 04 sw (sp+4),ra
800cd08: b8 20 60 00 mv r12,r1
* See the comment in watchdoginsert.c and watchdogadjust.c
* about why it's safe not to declare header a pointer to
* volatile data - till, 2003/7
*/
_ISR_Disable( level );
800cd0c: 90 00 18 00 rcsr r3,IE
800cd10: 34 01 ff fe mvi r1,-2
800cd14: a0 61 08 00 and r1,r3,r1
800cd18: d0 01 00 00 wcsr IE,r1
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
}
800cd1c: 29 8b 00 00 lw r11,(r12+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
800cd20: 35 8e 00 04 addi r14,r12,4
* See the comment in watchdoginsert.c and watchdogadjust.c
* about why it's safe not to declare header a pointer to
* volatile data - till, 2003/7
*/
_ISR_Disable( level );
800cd24: b8 60 10 00 mv r2,r3
if ( _Chain_Is_empty( header ) )
800cd28: 45 6e 00 1a be r11,r14,800cd90 <_Watchdog_Tickle+0xa8>
* to be inserted has already had its delta_interval adjusted to 0, and
* so is added to the head of the chain with a delta_interval of 0.
*
* Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc)
*/
if (the_watchdog->delta_interval != 0) {
800cd2c: 29 61 00 10 lw r1,(r11+16)
800cd30: 44 20 00 04 be r1,r0,800cd40 <_Watchdog_Tickle+0x58> <== NEVER TAKEN
the_watchdog->delta_interval--;
800cd34: 34 21 ff ff addi r1,r1,-1
800cd38: 59 61 00 10 sw (r11+16),r1
if ( the_watchdog->delta_interval != 0 )
800cd3c: 5c 20 00 15 bne r1,r0,800cd90 <_Watchdog_Tickle+0xa8>
#include <rtems/score/watchdog.h>
void _Watchdog_Tickle(
Chain_Control *header
)
{
800cd40: b8 60 68 00 mv r13,r3
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
_ISR_Enable( level );
switch( watchdog_state ) {
800cd44: 34 10 00 02 mvi r16,2
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
800cd48: 34 0f ff fe mvi r15,-2
800cd4c: e0 00 00 02 bi 800cd54 <_Watchdog_Tickle+0x6c>
800cd50: b8 40 68 00 mv r13,r2
if ( the_watchdog->delta_interval != 0 )
goto leave;
}
do {
watchdog_state = _Watchdog_Remove( the_watchdog );
800cd54: b9 60 08 00 mv r1,r11
800cd58: fb ff ff bb calli 800cc44 <_Watchdog_Remove>
_ISR_Enable( level );
800cd5c: d0 0d 00 00 wcsr IE,r13
switch( watchdog_state ) {
800cd60: 5c 30 00 05 bne r1,r16,800cd74 <_Watchdog_Tickle+0x8c> <== NEVER TAKEN
case WATCHDOG_ACTIVE:
(*the_watchdog->routine)(
800cd64: 29 63 00 1c lw r3,(r11+28)
800cd68: 29 61 00 20 lw r1,(r11+32)
800cd6c: 29 62 00 24 lw r2,(r11+36)
800cd70: d8 60 00 00 call r3
case WATCHDOG_REMOVE_IT:
break;
}
_ISR_Disable( level );
800cd74: 90 00 10 00 rcsr r2,IE
800cd78: a0 4f 08 00 and r1,r2,r15
800cd7c: d0 01 00 00 wcsr IE,r1
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
}
800cd80: 29 8b 00 00 lw r11,(r12+0)
_ISR_Disable( level );
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
(the_watchdog->delta_interval == 0) );
800cd84: 45 6e 00 03 be r11,r14,800cd90 <_Watchdog_Tickle+0xa8>
}
_ISR_Disable( level );
the_watchdog = _Watchdog_First( header );
} while ( !_Chain_Is_empty( header ) &&
800cd88: 29 61 00 10 lw r1,(r11+16)
800cd8c: 44 20 ff f1 be r1,r0,800cd50 <_Watchdog_Tickle+0x68>
(the_watchdog->delta_interval == 0) );
leave:
_ISR_Enable(level);
800cd90: d0 02 00 00 wcsr IE,r2
}
800cd94: 2b 9d 00 04 lw ra,(sp+4)
800cd98: 2b 8b 00 1c lw r11,(sp+28)
800cd9c: 2b 8c 00 18 lw r12,(sp+24)
800cda0: 2b 8d 00 14 lw r13,(sp+20)
800cda4: 2b 8e 00 10 lw r14,(sp+16)
800cda8: 2b 8f 00 0c lw r15,(sp+12)
800cdac: 2b 90 00 08 lw r16,(sp+8)
800cdb0: 37 9c 00 1c addi sp,sp,28
800cdb4: c3 a0 00 00 ret
08008af4 <_Workspace_Handler_initialization>:
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
8008af4: 37 9c ff d0 addi sp,sp,-48
8008af8: 5b 8b 00 30 sw (sp+48),r11
8008afc: 5b 8c 00 2c sw (sp+44),r12
8008b00: 5b 8d 00 28 sw (sp+40),r13
8008b04: 5b 8e 00 24 sw (sp+36),r14
8008b08: 5b 8f 00 20 sw (sp+32),r15
8008b0c: 5b 90 00 1c sw (sp+28),r16
8008b10: 5b 91 00 18 sw (sp+24),r17
8008b14: 5b 92 00 14 sw (sp+20),r18
8008b18: 5b 93 00 10 sw (sp+16),r19
8008b1c: 5b 94 00 0c sw (sp+12),r20
8008b20: 5b 95 00 08 sw (sp+8),r21
8008b24: 5b 9d 00 04 sw (sp+4),ra
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
8008b28: 78 04 08 01 mvhi r4,0x801
8008b2c: 38 84 87 ec ori r4,r4,0x87ec
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
8008b30: b8 40 a8 00 mv r21,r2
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
8008b34: 40 82 00 32 lbu r2,(r4+50)
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
8008b38: b8 60 90 00 mv r18,r3
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
8008b3c: 28 8c 00 00 lw r12,(r4+0)
8008b40: 34 05 00 00 mvi r5,0
8008b44: 5c 40 00 02 bne r2,r0,8008b4c <_Workspace_Handler_initialization+0x58>
8008b48: 28 85 00 04 lw r5,(r4+4)
bool do_zero = rtems_configuration_get_do_zero_of_workspace();
8008b4c: 78 04 08 01 mvhi r4,0x801
8008b50: 38 84 87 ec ori r4,r4,0x87ec
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
8008b54: 78 0e 08 00 mvhi r14,0x800
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
8008b58: 78 0f 08 01 mvhi r15,0x801
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
8008b5c: b4 ac 60 00 add r12,r5,r12
bool do_zero = rtems_configuration_get_do_zero_of_workspace();
8008b60: 40 94 00 30 lbu r20,(r4+48)
bool unified = rtems_configuration_get_unified_work_area();
8008b64: 40 91 00 31 lbu r17,(r4+49)
8008b68: b8 20 58 00 mv r11,r1
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) {
8008b6c: 34 10 00 00 mvi r16,0
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
8008b70: 39 ce 62 44 ori r14,r14,0x6244
if ( do_zero ) {
memset( area->begin, 0, area->size );
}
if ( area->size > overhead ) {
8008b74: 34 13 00 0e mvi r19,14
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
8008b78: 39 ef a9 88 ori r15,r15,0xa988
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) {
8008b7c: e0 00 00 22 bi 8008c04 <_Workspace_Handler_initialization+0x110>
Heap_Area *area = &areas [i];
if ( do_zero ) {
8008b80: 46 80 00 05 be r20,r0,8008b94 <_Workspace_Handler_initialization+0xa0>
memset( area->begin, 0, area->size );
8008b84: 29 61 00 00 lw r1,(r11+0)
8008b88: 29 63 00 04 lw r3,(r11+4)
8008b8c: 34 02 00 00 mvi r2,0
8008b90: f8 00 27 68 calli 8012930 <memset>
}
if ( area->size > overhead ) {
8008b94: 29 6d 00 04 lw r13,(r11+4)
8008b98: 52 6d 00 19 bgeu r19,r13,8008bfc <_Workspace_Handler_initialization+0x108><== NEVER TAKEN
uintptr_t space_available;
uintptr_t size;
if ( unified ) {
8008b9c: 5e 20 00 07 bne r17,r0,8008bb8 <_Workspace_Handler_initialization+0xc4>
size = area->size;
} else {
if ( remaining > 0 ) {
8008ba0: 45 91 00 05 be r12,r17,8008bb4 <_Workspace_Handler_initialization+0xc0><== NEVER TAKEN
size = remaining < area->size - overhead ?
8008ba4: 35 a1 ff f2 addi r1,r13,-14
remaining + overhead : area->size;
8008ba8: 51 81 00 04 bgeu r12,r1,8008bb8 <_Workspace_Handler_initialization+0xc4><== NEVER TAKEN
8008bac: 35 8d 00 0e addi r13,r12,14
8008bb0: e0 00 00 02 bi 8008bb8 <_Workspace_Handler_initialization+0xc4>
} else {
size = 0;
8008bb4: 34 0d 00 00 mvi r13,0 <== NOT EXECUTED
}
}
space_available = (*init_or_extend)(
8008bb8: 29 62 00 00 lw r2,(r11+0)
8008bbc: b9 a0 18 00 mv r3,r13
8008bc0: b9 e0 08 00 mv r1,r15
8008bc4: 34 04 00 04 mvi r4,4
8008bc8: d9 c0 00 00 call r14
area->begin,
size,
page_size
);
area->begin = (char *) area->begin + size;
8008bcc: 29 62 00 00 lw r2,(r11+0)
8008bd0: b4 4d 10 00 add r2,r2,r13
8008bd4: 59 62 00 00 sw (r11+0),r2
area->size -= size;
8008bd8: 29 62 00 04 lw r2,(r11+4)
8008bdc: c8 4d 68 00 sub r13,r2,r13
8008be0: 59 6d 00 04 sw (r11+4),r13
if ( space_available < remaining ) {
8008be4: 50 2c 00 04 bgeu r1,r12,8008bf4 <_Workspace_Handler_initialization+0x100><== ALWAYS TAKEN
remaining -= space_available;
8008be8: c9 81 60 00 sub r12,r12,r1 <== NOT EXECUTED
} else {
remaining = 0;
}
init_or_extend = extend;
8008bec: ba 40 70 00 mv r14,r18 <== NOT EXECUTED
8008bf0: e0 00 00 03 bi 8008bfc <_Workspace_Handler_initialization+0x108><== NOT EXECUTED
8008bf4: ba 40 70 00 mv r14,r18
area->size -= size;
if ( space_available < remaining ) {
remaining -= space_available;
} else {
remaining = 0;
8008bf8: 34 0c 00 00 mvi r12,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) {
8008bfc: 36 10 00 01 addi r16,r16,1
8008c00: 35 6b 00 08 addi r11,r11,8
8008c04: 56 b0 ff df bgu r21,r16,8008b80 <_Workspace_Handler_initialization+0x8c>
init_or_extend = extend;
}
}
if ( remaining > 0 ) {
8008c08: 45 80 00 05 be r12,r0,8008c1c <_Workspace_Handler_initialization+0x128>
_Internal_error_Occurred(
8008c0c: 34 01 00 00 mvi r1,0
8008c10: 34 02 00 01 mvi r2,1
8008c14: 34 03 00 02 mvi r3,2
8008c18: fb ff f6 3b calli 8006504 <_Internal_error_Occurred>
INTERNAL_ERROR_CORE,
true,
INTERNAL_ERROR_TOO_LITTLE_WORKSPACE
);
}
}
8008c1c: 2b 9d 00 04 lw ra,(sp+4)
8008c20: 2b 8b 00 30 lw r11,(sp+48)
8008c24: 2b 8c 00 2c lw r12,(sp+44)
8008c28: 2b 8d 00 28 lw r13,(sp+40)
8008c2c: 2b 8e 00 24 lw r14,(sp+36)
8008c30: 2b 8f 00 20 lw r15,(sp+32)
8008c34: 2b 90 00 1c lw r16,(sp+28)
8008c38: 2b 91 00 18 lw r17,(sp+24)
8008c3c: 2b 92 00 14 lw r18,(sp+20)
8008c40: 2b 93 00 10 lw r19,(sp+16)
8008c44: 2b 94 00 0c lw r20,(sp+12)
8008c48: 2b 95 00 08 lw r21,(sp+8)
8008c4c: 37 9c 00 30 addi sp,sp,48
8008c50: c3 a0 00 00 ret
08010184 <_fat_block_read>:
uint32_t start,
uint32_t offset,
uint32_t count,
void *buff
)
{
8010184: 37 9c ff dc addi sp,sp,-36
8010188: 5b 8b 00 20 sw (sp+32),r11
801018c: 5b 8c 00 1c sw (sp+28),r12
8010190: 5b 8d 00 18 sw (sp+24),r13
8010194: 5b 8e 00 14 sw (sp+20),r14
8010198: 5b 8f 00 10 sw (sp+16),r15
801019c: 5b 90 00 0c sw (sp+12),r16
80101a0: 5b 91 00 08 sw (sp+8),r17
80101a4: 5b 9d 00 04 sw (sp+4),ra
int rc = RC_OK;
ssize_t cmpltd = 0;
80101a8: 34 0b 00 00 mvi r11,0
uint32_t start,
uint32_t offset,
uint32_t count,
void *buff
)
{
80101ac: b8 20 80 00 mv r16,r1
80101b0: b8 80 60 00 mv r12,r4
80101b4: b8 a0 88 00 mv r17,r5
int rc = RC_OK;
ssize_t cmpltd = 0;
uint32_t sec_num = start;
uint32_t ofs = offset;
80101b8: b8 60 78 00 mv r15,r3
void *buff
)
{
int rc = RC_OK;
ssize_t cmpltd = 0;
uint32_t sec_num = start;
80101bc: b8 40 70 00 mv r14,r2
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while (count > 0)
80101c0: e0 00 00 14 bi 8010210 <_fat_block_read+0x8c>
{
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
80101c4: ba 00 08 00 mv r1,r16
80101c8: b9 c0 10 00 mv r2,r14
80101cc: 34 03 00 01 mvi r3,1
80101d0: 37 84 00 24 addi r4,sp,36
80101d4: fb ff ff aa calli 801007c <fat_buf_access>
if (rc != RC_OK)
80101d8: 5c 20 00 10 bne r1,r0,8010218 <_fat_block_read+0x94> <== NEVER TAKEN
return -1;
c = MIN(count, (fs_info->vol.bps - ofs));
80101dc: 2e 0d 00 00 lhu r13,(r16+0)
80101e0: c9 af 68 00 sub r13,r13,r15
80101e4: 51 8d 00 02 bgeu r12,r13,80101ec <_fat_block_read+0x68>
80101e8: b9 80 68 00 mv r13,r12
memcpy((buff + cmpltd), (sec_buf + ofs), c);
80101ec: 2b 82 00 24 lw r2,(sp+36)
80101f0: b6 2b 08 00 add r1,r17,r11
80101f4: b9 a0 18 00 mv r3,r13
80101f8: b4 4f 10 00 add r2,r2,r15
80101fc: f8 00 2d e4 calli 801b98c <memcpy>
count -= c;
8010200: c9 8d 60 00 sub r12,r12,r13
cmpltd += c;
8010204: b5 ab 58 00 add r11,r13,r11
sec_num++;
8010208: 35 ce 00 01 addi r14,r14,1
ofs = 0;
801020c: 34 0f 00 00 mvi r15,0
uint32_t sec_num = start;
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while (count > 0)
8010210: 5d 80 ff ed bne r12,r0,80101c4 <_fat_block_read+0x40>
8010214: e0 00 00 02 bi 801021c <_fat_block_read+0x98>
{
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
if (rc != RC_OK)
return -1;
8010218: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED
cmpltd += c;
sec_num++;
ofs = 0;
}
return cmpltd;
}
801021c: b9 60 08 00 mv r1,r11
8010220: 2b 9d 00 04 lw ra,(sp+4)
8010224: 2b 8b 00 20 lw r11,(sp+32)
8010228: 2b 8c 00 1c lw r12,(sp+28)
801022c: 2b 8d 00 18 lw r13,(sp+24)
8010230: 2b 8e 00 14 lw r14,(sp+20)
8010234: 2b 8f 00 10 lw r15,(sp+16)
8010238: 2b 90 00 0c lw r16,(sp+12)
801023c: 2b 91 00 08 lw r17,(sp+8)
8010240: 37 9c 00 24 addi sp,sp,36
8010244: c3 a0 00 00 ret
0800eff0 <_hash_search>:
rtems_chain_control *hash,
uint32_t key1,
uint32_t key2,
fat_file_fd_t **ret
)
{
800eff0: 37 9c ff e4 addi sp,sp,-28
800eff4: 5b 8b 00 1c sw (sp+28),r11
800eff8: 5b 8c 00 18 sw (sp+24),r12
800effc: 5b 8d 00 14 sw (sp+20),r13
800f000: 5b 8e 00 10 sw (sp+16),r14
800f004: 5b 8f 00 0c sw (sp+12),r15
800f008: 5b 90 00 08 sw (sp+8),r16
800f00c: 5b 9d 00 04 sw (sp+4),ra
uint32_t mod = (key1) % FAT_HASH_MODULE;
800f010: 20 6b 00 01 andi r11,r3,0x1
rtems_chain_control *hash,
uint32_t key1,
uint32_t key2,
fat_file_fd_t **ret
)
{
800f014: b8 40 78 00 mv r15,r2
800f018: b8 20 80 00 mv r16,r1
uint32_t mod = (key1) % FAT_HASH_MODULE;
rtems_chain_node *the_node = rtems_chain_first(hash + mod);
800f01c: 34 02 00 01 mvi r2,1
800f020: b9 60 08 00 mv r1,r11
rtems_chain_control *hash,
uint32_t key1,
uint32_t key2,
fat_file_fd_t **ret
)
{
800f024: b8 60 60 00 mv r12,r3
800f028: b8 80 68 00 mv r13,r4
800f02c: b8 a0 70 00 mv r14,r5
uint32_t mod = (key1) % FAT_HASH_MODULE;
rtems_chain_node *the_node = rtems_chain_first(hash + mod);
800f030: fb ff c8 6e calli 80011e8 <__ashlsi3>
800f034: b4 2b 08 00 add r1,r1,r11
800f038: 34 02 00 02 mvi r2,2
800f03c: fb ff c8 6b calli 80011e8 <__ashlsi3>
800f040: b5 e1 10 00 add r2,r15,r1
fat_fd->map.disk_cln = cur_cln;
*disk_cln = cur_cln;
}
return RC_OK;
}
800f044: 28 4b 00 00 lw r11,(r2+0)
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 ));
800f048: 34 4f 00 04 addi r15,r2,4
)
{
uint32_t mod = (key1) % FAT_HASH_MODULE;
rtems_chain_node *the_node = rtems_chain_first(hash + mod);
for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; )
800f04c: e0 00 00 0c bi 800f07c <_hash_search+0x8c>
{
fat_file_fd_t *ffd = (fat_file_fd_t *)the_node;
uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname);
800f050: ba 00 08 00 mv r1,r16
800f054: 35 62 00 20 addi r2,r11,32
800f058: fb ff ff ba calli 800ef40 <fat_construct_key>
if ( (key1) == ck)
800f05c: 5d 81 00 07 bne r12,r1,800f078 <_hash_search+0x88>
{
if ( ((key2) == 0) || ((key2) == ffd->ino) )
800f060: 45 a0 00 03 be r13,r0,800f06c <_hash_search+0x7c> <== ALWAYS TAKEN
800f064: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED
800f068: 5d a1 00 04 bne r13,r1,800f078 <_hash_search+0x88> <== NOT EXECUTED
{
*ret = (void *)the_node;
800f06c: 59 cb 00 00 sw (r14+0),r11
return 0;
800f070: 34 01 00 00 mvi r1,0
800f074: e0 00 00 04 bi 800f084 <_hash_search+0x94>
}
}
the_node = the_node->next;
800f078: 29 6b 00 00 lw r11,(r11+0)
)
{
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) ; )
800f07c: 5d 6f ff f5 bne r11,r15,800f050 <_hash_search+0x60>
return 0;
}
}
the_node = the_node->next;
}
return -1;
800f080: 34 01 ff ff mvi r1,-1
}
800f084: 2b 9d 00 04 lw ra,(sp+4)
800f088: 2b 8b 00 1c lw r11,(sp+28)
800f08c: 2b 8c 00 18 lw r12,(sp+24)
800f090: 2b 8d 00 14 lw r13,(sp+20)
800f094: 2b 8e 00 10 lw r14,(sp+16)
800f098: 2b 8f 00 0c lw r15,(sp+12)
800f09c: 2b 90 00 08 lw r16,(sp+8)
800f0a0: 37 9c 00 1c addi sp,sp,28
800f0a4: c3 a0 00 00 ret
080022d0 <_lstat_r>:
int _STAT_R_NAME(
struct _reent *ptr __attribute__((unused)),
const char *path,
struct stat *buf
)
{
80022d0: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
80022d4: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
return _STAT_NAME( path, buf );
80022d8: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
80022dc: b8 60 10 00 mv r2,r3 <== NOT EXECUTED
80022e0: fb ff ff dc calli 8002250 <lstat> <== NOT EXECUTED
}
80022e4: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
80022e8: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
80022ec: c3 a0 00 00 ret <== NOT EXECUTED
08003cb4 <_stat_r>:
int _STAT_R_NAME(
struct _reent *ptr __attribute__((unused)),
const char *path,
struct stat *buf
)
{
8003cb4: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
8003cb8: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
return _STAT_NAME( path, buf );
8003cbc: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
8003cc0: b8 60 10 00 mv r2,r3 <== NOT EXECUTED
8003cc4: fb ff ff dc calli 8003c34 <stat> <== NOT EXECUTED
}
8003cc8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8003ccc: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
8003cd0: c3 a0 00 00 ret <== NOT EXECUTED
08003a8c <aio_cancel>:
#include <stdlib.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
8003a8c: 37 9c ff e8 addi sp,sp,-24
8003a90: 5b 8b 00 18 sw (sp+24),r11
8003a94: 5b 8c 00 14 sw (sp+20),r12
8003a98: 5b 8d 00 10 sw (sp+16),r13
8003a9c: 5b 8e 00 0c sw (sp+12),r14
8003aa0: 5b 8f 00 08 sw (sp+8),r15
8003aa4: 5b 9d 00 04 sw (sp+4),ra
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
8003aa8: 78 0b 08 01 mvhi r11,0x801
8003aac: 39 6b 78 40 ori r11,r11,0x7840
#include <stdlib.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
8003ab0: b8 20 70 00 mv r14,r1
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
8003ab4: b9 60 08 00 mv r1,r11
#include <stdlib.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_cancel(int fildes, struct aiocb *aiocbp)
{
8003ab8: b8 40 60 00 mv r12,r2
rtems_aio_request_chain *r_chain;
int result;
pthread_mutex_lock (&aio_request_queue.mutex);
8003abc: f8 00 04 dc calli 8004e2c <pthread_mutex_lock>
if (fcntl (fildes, F_GETFD) < 0) {
8003ac0: b9 c0 08 00 mv r1,r14
8003ac4: 34 02 00 01 mvi r2,1
8003ac8: f8 00 1c 56 calli 800ac20 <fcntl>
8003acc: 4c 20 00 06 bge r1,r0,8003ae4 <aio_cancel+0x58>
pthread_mutex_unlock(&aio_request_queue.mutex);
8003ad0: b9 60 08 00 mv r1,r11
8003ad4: f8 00 05 09 calli 8004ef8 <pthread_mutex_unlock>
rtems_set_errno_and_return_minus_one (EBADF);
8003ad8: f8 00 2c 97 calli 800ed34 <__errno>
8003adc: 34 02 00 09 mvi r2,9
8003ae0: e0 00 00 32 bi 8003ba8 <aio_cancel+0x11c>
}
/* if aiocbp is NULL remove all request for given file descriptor */
if (aiocbp == NULL) {
8003ae4: 5d 80 00 2b bne r12,r0,8003b90 <aio_cancel+0x104>
AIO_printf ("Cancel all requests\n");
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0);
8003ae8: 78 01 08 01 mvhi r1,0x801
8003aec: 38 21 78 88 ori r1,r1,0x7888
8003af0: b9 c0 10 00 mv r2,r14
8003af4: 34 03 00 00 mvi r3,0
8003af8: f8 00 01 86 calli 8004110 <rtems_aio_search_fd>
8003afc: b8 20 68 00 mv r13,r1
if (r_chain == NULL) {
8003b00: 5c 2c 00 17 bne r1,r12,8003b5c <aio_cancel+0xd0>
AIO_printf ("Request chain not on [WQ]\n");
if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) {
8003b04: 29 62 00 54 lw r2,(r11+84)
8003b08: 78 01 08 01 mvhi r1,0x801
8003b0c: 38 21 78 98 ori r1,r1,0x7898
8003b10: 44 41 00 3f be r2,r1,8003c0c <aio_cancel+0x180> <== NEVER TAKEN
r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0);
8003b14: 78 01 08 01 mvhi r1,0x801
8003b18: 38 21 78 94 ori r1,r1,0x7894
8003b1c: b9 c0 10 00 mv r2,r14
8003b20: 34 03 00 00 mvi r3,0
8003b24: f8 00 01 7b calli 8004110 <rtems_aio_search_fd>
8003b28: b8 20 60 00 mv r12,r1
if (r_chain == NULL) {
8003b2c: 44 2d 00 38 be r1,r13,8003c0c <aio_cancel+0x180>
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
8003b30: f8 00 0a 89 calli 8006554 <_Chain_Extract>
}
AIO_printf ("Request chain on [IQ]\n");
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
8003b34: b9 80 08 00 mv r1,r12
8003b38: f8 00 01 ac calli 80041e8 <rtems_aio_remove_fd>
pthread_mutex_destroy (&r_chain->mutex);
8003b3c: 35 8d 00 1c addi r13,r12,28
8003b40: b9 a0 08 00 mv r1,r13
8003b44: f8 00 04 00 calli 8004b44 <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->mutex);
8003b48: b9 a0 08 00 mv r1,r13
8003b4c: f8 00 02 ff calli 8004748 <pthread_cond_destroy>
free (r_chain);
8003b50: b9 80 08 00 mv r1,r12
8003b54: fb ff f7 62 calli 80018dc <free>
8003b58: e0 00 00 0a bi 8003b80 <aio_cancel+0xf4>
return AIO_ALLDONE;
}
AIO_printf ("Request chain on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
8003b5c: 34 2c 00 1c addi r12,r1,28
8003b60: b9 80 08 00 mv r1,r12
8003b64: f8 00 04 b2 calli 8004e2c <pthread_mutex_lock>
8003b68: b9 a0 08 00 mv r1,r13
8003b6c: f8 00 0a 7a calli 8006554 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
rtems_aio_remove_fd (r_chain);
8003b70: b9 a0 08 00 mv r1,r13
8003b74: f8 00 01 9d calli 80041e8 <rtems_aio_remove_fd>
pthread_mutex_unlock (&r_chain->mutex);
8003b78: b9 80 08 00 mv r1,r12
8003b7c: f8 00 04 df calli 8004ef8 <pthread_mutex_unlock>
pthread_mutex_unlock (&aio_request_queue.mutex);
8003b80: b9 60 08 00 mv r1,r11
8003b84: f8 00 04 dd calli 8004ef8 <pthread_mutex_unlock>
return AIO_CANCELED;
8003b88: 34 0c 00 00 mvi r12,0
8003b8c: e0 00 00 2f bi 8003c48 <aio_cancel+0x1bc>
} else {
AIO_printf ("Cancel request\n");
if (aiocbp->aio_fildes != fildes) {
8003b90: 29 8f 00 00 lw r15,(r12+0)
8003b94: 45 ee 00 08 be r15,r14,8003bb4 <aio_cancel+0x128>
pthread_mutex_unlock (&aio_request_queue.mutex);
8003b98: b9 60 08 00 mv r1,r11
8003b9c: f8 00 04 d7 calli 8004ef8 <pthread_mutex_unlock>
rtems_set_errno_and_return_minus_one (EINVAL);
8003ba0: f8 00 2c 65 calli 800ed34 <__errno>
8003ba4: 34 02 00 16 mvi r2,22
8003ba8: 58 22 00 00 sw (r1+0),r2
8003bac: 34 0c ff ff mvi r12,-1
8003bb0: e0 00 00 26 bi 8003c48 <aio_cancel+0x1bc>
}
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0);
8003bb4: 78 01 08 01 mvhi r1,0x801
8003bb8: 38 21 78 88 ori r1,r1,0x7888
8003bbc: b9 e0 10 00 mv r2,r15
8003bc0: 34 03 00 00 mvi r3,0
8003bc4: f8 00 01 53 calli 8004110 <rtems_aio_search_fd>
8003bc8: b8 20 68 00 mv r13,r1
if (r_chain == NULL) {
8003bcc: 5c 20 00 14 bne r1,r0,8003c1c <aio_cancel+0x190>
if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) {
8003bd0: 29 62 00 54 lw r2,(r11+84)
8003bd4: 78 01 08 01 mvhi r1,0x801
8003bd8: 38 21 78 98 ori r1,r1,0x7898
8003bdc: 44 41 00 0c be r2,r1,8003c0c <aio_cancel+0x180> <== NEVER TAKEN
r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0);
8003be0: 78 01 08 01 mvhi r1,0x801
8003be4: 38 21 78 94 ori r1,r1,0x7894
8003be8: b9 e0 10 00 mv r2,r15
8003bec: 34 03 00 00 mvi r3,0
8003bf0: f8 00 01 48 calli 8004110 <rtems_aio_search_fd>
if (r_chain == NULL) {
8003bf4: 44 20 ff e9 be r1,r0,8003b98 <aio_cancel+0x10c>
rtems_set_errno_and_return_minus_one (EINVAL);
}
AIO_printf ("Request on [IQ]\n");
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
8003bf8: b9 80 10 00 mv r2,r12
8003bfc: 34 21 00 08 addi r1,r1,8
8003c00: f8 00 01 95 calli 8004254 <rtems_aio_remove_req>
8003c04: b8 20 60 00 mv r12,r1
8003c08: e0 00 00 0e bi 8003c40 <aio_cancel+0x1b4>
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
} else {
pthread_mutex_unlock (&aio_request_queue.mutex);
8003c0c: b9 60 08 00 mv r1,r11
8003c10: f8 00 04 ba calli 8004ef8 <pthread_mutex_unlock>
return AIO_ALLDONE;
8003c14: 34 0c 00 02 mvi r12,2
8003c18: e0 00 00 0c bi 8003c48 <aio_cancel+0x1bc>
}
}
AIO_printf ("Request on [WQ]\n");
pthread_mutex_lock (&r_chain->mutex);
8003c1c: 34 2e 00 1c addi r14,r1,28
8003c20: b9 c0 08 00 mv r1,r14
8003c24: f8 00 04 82 calli 8004e2c <pthread_mutex_lock>
result = rtems_aio_remove_req (&r_chain->perfd, aiocbp);
8003c28: b9 80 10 00 mv r2,r12
8003c2c: 35 a1 00 08 addi r1,r13,8
8003c30: f8 00 01 89 calli 8004254 <rtems_aio_remove_req>
8003c34: b8 20 60 00 mv r12,r1
pthread_mutex_unlock (&r_chain->mutex);
8003c38: b9 c0 08 00 mv r1,r14
8003c3c: f8 00 04 af calli 8004ef8 <pthread_mutex_unlock>
pthread_mutex_unlock (&aio_request_queue.mutex);
8003c40: b9 60 08 00 mv r1,r11
8003c44: f8 00 04 ad calli 8004ef8 <pthread_mutex_unlock>
return result;
}
return AIO_ALLDONE;
}
8003c48: b9 80 08 00 mv r1,r12
8003c4c: 2b 9d 00 04 lw ra,(sp+4)
8003c50: 2b 8b 00 18 lw r11,(sp+24)
8003c54: 2b 8c 00 14 lw r12,(sp+20)
8003c58: 2b 8d 00 10 lw r13,(sp+16)
8003c5c: 2b 8e 00 0c lw r14,(sp+12)
8003c60: 2b 8f 00 08 lw r15,(sp+8)
8003c64: 37 9c 00 18 addi sp,sp,24
8003c68: c3 a0 00 00 ret
08003c74 <aio_fsync>:
int aio_fsync(
int op,
struct aiocb *aiocbp
)
{
8003c74: 37 9c ff f4 addi sp,sp,-12
8003c78: 5b 8b 00 0c sw (sp+12),r11
8003c7c: 5b 8c 00 08 sw (sp+8),r12
8003c80: 5b 9d 00 04 sw (sp+4),ra
8003c84: b8 40 58 00 mv r11,r2
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
8003c88: 34 02 20 00 mvi r2,8192
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
8003c8c: 34 0c 00 16 mvi r12,22
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
8003c90: 5c 22 00 09 bne r1,r2,8003cb4 <aio_fsync+0x40>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
8003c94: 29 61 00 00 lw r1,(r11+0)
8003c98: 34 02 00 03 mvi r2,3
8003c9c: f8 00 1b e1 calli 800ac20 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
8003ca0: 20 21 00 03 andi r1,r1,0x3
8003ca4: 34 21 ff ff addi r1,r1,-1
8003ca8: 34 02 00 01 mvi r2,1
8003cac: 50 41 00 09 bgeu r2,r1,8003cd0 <aio_fsync+0x5c>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
8003cb0: 34 0c 00 09 mvi r12,9
8003cb4: 34 01 ff ff mvi r1,-1
8003cb8: 59 6c 00 2c sw (r11+44),r12
8003cbc: 59 61 00 30 sw (r11+48),r1
8003cc0: f8 00 2c 1d calli 800ed34 <__errno>
8003cc4: 58 2c 00 00 sw (r1+0),r12
8003cc8: 34 01 ff ff mvi r1,-1
8003ccc: e0 00 00 09 bi 8003cf0 <aio_fsync+0x7c>
req = malloc (sizeof (rtems_aio_request));
8003cd0: 34 01 00 18 mvi r1,24
8003cd4: fb ff f8 67 calli 8001e70 <malloc>
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
8003cd8: 34 0c 00 0b mvi r12,11
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
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)
8003cdc: 44 20 ff f6 be r1,r0,8003cb4 <aio_fsync+0x40> <== NEVER TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
8003ce0: 58 2b 00 14 sw (r1+20),r11
req->aiocbp->aio_lio_opcode = LIO_SYNC;
8003ce4: 34 02 00 03 mvi r2,3
8003ce8: 59 62 00 28 sw (r11+40),r2
return rtems_aio_enqueue (req);
8003cec: f8 00 01 76 calli 80042c4 <rtems_aio_enqueue>
}
8003cf0: 2b 9d 00 04 lw ra,(sp+4)
8003cf4: 2b 8b 00 0c lw r11,(sp+12)
8003cf8: 2b 8c 00 08 lw r12,(sp+8)
8003cfc: 37 9c 00 0c addi sp,sp,12
8003d00: c3 a0 00 00 ret
0800451c <aio_read>:
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
800451c: 37 9c ff f4 addi sp,sp,-12
8004520: 5b 8b 00 0c sw (sp+12),r11
8004524: 5b 8c 00 08 sw (sp+8),r12
8004528: 5b 9d 00 04 sw (sp+4),ra
800452c: b8 20 58 00 mv r11,r1
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
8004530: 28 21 00 00 lw r1,(r1+0)
8004534: 34 02 00 03 mvi r2,3
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
8004538: 34 0c 00 09 mvi r12,9
aio_read (struct aiocb *aiocbp)
{
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
800453c: f8 00 19 b9 calli 800ac20 <fcntl>
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
8004540: 20 21 00 03 andi r1,r1,0x3
8004544: 7c 22 00 02 cmpnei r2,r1,2
8004548: 7c 21 00 00 cmpnei r1,r1,0
800454c: a0 41 08 00 and r1,r2,r1
8004550: 5c 20 00 04 bne r1,r0,8004560 <aio_read+0x44>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
8004554: 29 6c 00 10 lw r12,(r11+16)
8004558: 45 81 00 09 be r12,r1,800457c <aio_read+0x60>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
800455c: 34 0c 00 16 mvi r12,22
8004560: 34 01 ff ff mvi r1,-1
8004564: 59 6c 00 2c sw (r11+44),r12
8004568: 59 61 00 30 sw (r11+48),r1
800456c: f8 00 29 f2 calli 800ed34 <__errno>
8004570: 58 2c 00 00 sw (r1+0),r12
8004574: 34 01 ff ff mvi r1,-1
8004578: e0 00 00 0d bi 80045ac <aio_read+0x90>
if (aiocbp->aio_offset < 0)
800457c: 29 61 00 04 lw r1,(r11+4)
8004580: 4c 2c 00 02 bge r1,r12,8004588 <aio_read+0x6c>
8004584: e3 ff ff f6 bi 800455c <aio_read+0x40>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
8004588: 34 01 00 18 mvi r1,24
800458c: fb ff f6 39 calli 8001e70 <malloc>
if (req == NULL)
8004590: 5c 2c 00 03 bne r1,r12,800459c <aio_read+0x80> <== ALWAYS TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
8004594: 34 0c 00 0b mvi r12,11 <== NOT EXECUTED
8004598: e3 ff ff f2 bi 8004560 <aio_read+0x44> <== NOT EXECUTED
req->aiocbp = aiocbp;
800459c: 58 2b 00 14 sw (r1+20),r11
req->aiocbp->aio_lio_opcode = LIO_READ;
80045a0: 34 02 00 01 mvi r2,1
80045a4: 59 62 00 28 sw (r11+40),r2
return rtems_aio_enqueue (req);
80045a8: fb ff ff 47 calli 80042c4 <rtems_aio_enqueue>
}
80045ac: 2b 9d 00 04 lw ra,(sp+4)
80045b0: 2b 8b 00 0c lw r11,(sp+12)
80045b4: 2b 8c 00 08 lw r12,(sp+8)
80045b8: 37 9c 00 0c addi sp,sp,12
80045bc: c3 a0 00 00 ret
080045c8 <aio_write>:
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
80045c8: 37 9c ff f4 addi sp,sp,-12
80045cc: 5b 8b 00 0c sw (sp+12),r11
80045d0: 5b 8c 00 08 sw (sp+8),r12
80045d4: 5b 9d 00 04 sw (sp+4),ra
80045d8: b8 20 58 00 mv r11,r1
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
80045dc: 28 21 00 00 lw r1,(r1+0)
80045e0: 34 02 00 03 mvi r2,3
80045e4: f8 00 19 8f calli 800ac20 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
80045e8: 20 21 00 03 andi r1,r1,0x3
80045ec: 34 21 ff ff addi r1,r1,-1
80045f0: 34 02 00 01 mvi r2,1
80045f4: 50 41 00 03 bgeu r2,r1,8004600 <aio_write+0x38>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
80045f8: 34 0c 00 09 mvi r12,9
80045fc: e0 00 00 04 bi 800460c <aio_write+0x44>
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
8004600: 29 61 00 10 lw r1,(r11+16)
8004604: 44 20 00 09 be r1,r0,8004628 <aio_write+0x60>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
8004608: 34 0c 00 16 mvi r12,22
800460c: 34 01 ff ff mvi r1,-1
8004610: 59 6c 00 2c sw (r11+44),r12
8004614: 59 61 00 30 sw (r11+48),r1
8004618: f8 00 29 c7 calli 800ed34 <__errno>
800461c: 58 2c 00 00 sw (r1+0),r12
8004620: 34 01 ff ff mvi r1,-1
8004624: e0 00 00 0c bi 8004654 <aio_write+0x8c>
if (aiocbp->aio_offset < 0)
8004628: 29 62 00 04 lw r2,(r11+4)
800462c: 4c 41 00 02 bge r2,r1,8004634 <aio_write+0x6c>
8004630: e3 ff ff f6 bi 8004608 <aio_write+0x40>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
8004634: 34 01 00 18 mvi r1,24
8004638: fb ff f6 0e calli 8001e70 <malloc>
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
800463c: 34 0c 00 0b mvi r12,11
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
8004640: 44 20 ff f3 be r1,r0,800460c <aio_write+0x44> <== NEVER TAKEN
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
8004644: 58 2b 00 14 sw (r1+20),r11
req->aiocbp->aio_lio_opcode = LIO_WRITE;
8004648: 34 02 00 02 mvi r2,2
800464c: 59 62 00 28 sw (r11+40),r2
return rtems_aio_enqueue (req);
8004650: fb ff ff 1d calli 80042c4 <rtems_aio_enqueue>
}
8004654: 2b 9d 00 04 lw ra,(sp+4)
8004658: 2b 8b 00 0c lw r11,(sp+12)
800465c: 2b 8c 00 08 lw r12,(sp+8)
8004660: 37 9c 00 0c addi sp,sp,12
8004664: c3 a0 00 00 ret
08001f10 <chroot>:
#include <unistd.h>
#include <rtems/libio_.h>
int chroot( const char *path )
{
8001f10: 37 9c ff 9c addi sp,sp,-100
8001f14: 5b 8b 00 10 sw (sp+16),r11
8001f18: 5b 8c 00 0c sw (sp+12),r12
8001f1c: 5b 8d 00 08 sw (sp+8),r13
8001f20: 5b 9d 00 04 sw (sp+4),ra
/*
* We use the global environment for path evaluation. This makes it possible
* to escape from a chroot environment referencing an unmounted file system.
*/
rtems_filesystem_eval_path_start_with_root_and_current(
8001f24: 78 04 08 01 mvhi r4,0x801
8001f28: 78 05 08 01 mvhi r5,0x801
#include <unistd.h>
#include <rtems/libio_.h>
int chroot( const char *path )
{
8001f2c: b8 20 10 00 mv r2,r1
/*
* We use the global environment for path evaluation. This makes it possible
* to escape from a chroot environment referencing an unmounted file system.
*/
rtems_filesystem_eval_path_start_with_root_and_current(
8001f30: 34 03 00 19 mvi r3,25
8001f34: 38 84 41 20 ori r4,r4,0x4120
8001f38: 38 a5 41 1c ori r5,r5,0x411c
8001f3c: 37 81 00 14 addi r1,sp,20
8001f40: f8 00 05 11 calli 8003384 <rtems_filesystem_eval_path_start_with_root_and_current>
eval_flags,
&rtems_global_user_env.root_directory,
&rtems_global_user_env.current_directory
);
rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc );
8001f44: 37 8b 00 4c addi r11,sp,76
8001f48: b9 60 08 00 mv r1,r11
8001f4c: 37 82 00 2c addi r2,sp,44
8001f50: f8 00 06 6d calli 8003904 <rtems_filesystem_location_copy_and_detach>
new_current_loc = rtems_filesystem_location_transform_to_global( &loc );
8001f54: b9 60 08 00 mv r1,r11
8001f58: f8 00 07 09 calli 8003b7c <rtems_filesystem_location_transform_to_global>
8001f5c: 5b 81 00 64 sw (sp+100),r1
if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) {
8001f60: 28 21 00 10 lw r1,(r1+16)
8001f64: 78 0c 08 01 mvhi r12,0x801
8001f68: 39 8c 2a 94 ori r12,r12,0x2a94
if ( rv != 0 ) {
rtems_filesystem_global_location_release( new_root_loc );
}
} else {
rv = -1;
8001f6c: 34 0b ff ff mvi r11,-1
&rtems_global_user_env.current_directory
);
rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc );
new_current_loc = rtems_filesystem_location_transform_to_global( &loc );
if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) {
8001f70: 44 2c 00 24 be r1,r12,8002000 <chroot+0xf0>
rtems_filesystem_global_location_t *new_root_loc =
8001f74: 37 81 00 64 addi r1,sp,100
8001f78: f8 00 06 c7 calli 8003a94 <rtems_filesystem_global_location_obtain>
rtems_filesystem_global_location_obtain( &new_current_loc );
rtems_filesystem_node_types_t type =
(*new_root_loc->location.mt_entry->ops->node_type_h)(
8001f7c: 28 22 00 14 lw r2,(r1+20)
);
rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc );
new_current_loc = rtems_filesystem_location_transform_to_global( &loc );
if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) {
rtems_filesystem_global_location_t *new_root_loc =
8001f80: b8 20 58 00 mv r11,r1
rtems_filesystem_global_location_obtain( &new_current_loc );
rtems_filesystem_node_types_t type =
(*new_root_loc->location.mt_entry->ops->node_type_h)(
8001f84: 28 42 00 0c lw r2,(r2+12)
rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc );
new_current_loc = rtems_filesystem_location_transform_to_global( &loc );
if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) {
rtems_filesystem_global_location_t *new_root_loc =
rtems_filesystem_global_location_obtain( &new_current_loc );
rtems_filesystem_node_types_t type =
8001f88: 28 42 00 14 lw r2,(r2+20)
8001f8c: d8 40 00 00 call r2
8001f90: b8 20 68 00 mv r13,r1
(*new_root_loc->location.mt_entry->ops->node_type_h)(
&new_root_loc->location
);
if ( type == RTEMS_FILESYSTEM_DIRECTORY ) {
8001f94: 5c 20 00 13 bne r1,r0,8001fe0 <chroot+0xd0>
sc = rtems_libio_set_private_env();
8001f98: f8 00 02 fd calli 8002b8c <rtems_libio_set_private_env>
if (sc == RTEMS_SUCCESSFUL) {
8001f9c: 5c 2d 00 0c bne r1,r13,8001fcc <chroot+0xbc>
rtems_filesystem_global_location_assign(
8001fa0: 78 0c 08 01 mvhi r12,0x801
8001fa4: 39 8c 41 48 ori r12,r12,0x4148
8001fa8: 29 81 00 00 lw r1,(r12+0)
8001fac: b9 60 10 00 mv r2,r11
&rtems_filesystem_root,
new_root_loc
);
rtems_filesystem_global_location_assign(
8001fb0: 34 0b 00 00 mvi r11,0
);
if ( type == RTEMS_FILESYSTEM_DIRECTORY ) {
sc = rtems_libio_set_private_env();
if (sc == RTEMS_SUCCESSFUL) {
rtems_filesystem_global_location_assign(
8001fb4: 34 21 00 04 addi r1,r1,4
8001fb8: f8 00 06 a9 calli 8003a5c <rtems_filesystem_global_location_assign>
&rtems_filesystem_root,
new_root_loc
);
rtems_filesystem_global_location_assign(
8001fbc: 29 81 00 00 lw r1,(r12+0)
8001fc0: 2b 82 00 64 lw r2,(sp+100)
8001fc4: f8 00 06 a6 calli 8003a5c <rtems_filesystem_global_location_assign>
8001fc8: e0 00 00 0e bi 8002000 <chroot+0xf0>
&rtems_filesystem_current,
new_current_loc
);
} else {
if (sc != RTEMS_UNSATISFIED) {
8001fcc: 34 02 00 0d mvi r2,13
8001fd0: 44 22 00 09 be r1,r2,8001ff4 <chroot+0xe4> <== NEVER TAKEN
errno = ENOMEM;
8001fd4: f8 00 26 11 calli 800b818 <__errno>
8001fd8: 34 02 00 0c mvi r2,12
8001fdc: e0 00 00 05 bi 8001ff0 <chroot+0xe0>
static inline void rtems_filesystem_location_error(
const rtems_filesystem_location_info_t *loc,
int eno
)
{
if ( !rtems_filesystem_location_is_null( loc ) ) {
8001fe0: 29 61 00 10 lw r1,(r11+16)
8001fe4: 44 2c 00 04 be r1,r12,8001ff4 <chroot+0xe4> <== NEVER TAKEN
errno = eno;
8001fe8: f8 00 26 0c calli 800b818 <__errno>
8001fec: 34 02 00 14 mvi r2,20
8001ff0: 58 22 00 00 sw (r1+0),r2
rtems_filesystem_location_error( &new_root_loc->location, ENOTDIR );
rv = -1;
}
if ( rv != 0 ) {
rtems_filesystem_global_location_release( new_root_loc );
8001ff4: b9 60 08 00 mv r1,r11
8001ff8: f8 00 06 7e calli 80039f0 <rtems_filesystem_global_location_release>
8001ffc: 34 0b ff ff mvi r11,-1
}
} else {
rv = -1;
}
rtems_filesystem_eval_path_cleanup( &ctx );
8002000: 37 81 00 14 addi r1,sp,20
8002004: f8 00 05 48 calli 8003524 <rtems_filesystem_eval_path_cleanup>
if ( rv != 0 ) {
8002008: 45 60 00 03 be r11,r0,8002014 <chroot+0x104>
rtems_filesystem_global_location_release( new_current_loc );
800200c: 2b 81 00 64 lw r1,(sp+100)
8002010: f8 00 06 78 calli 80039f0 <rtems_filesystem_global_location_release>
}
return rv;
}
8002014: b9 60 08 00 mv r1,r11
8002018: 2b 9d 00 04 lw ra,(sp+4)
800201c: 2b 8b 00 10 lw r11,(sp+16)
8002020: 2b 8c 00 0c lw r12,(sp+12)
8002024: 2b 8d 00 08 lw r13,(sp+8)
8002028: 37 9c 00 64 addi sp,sp,100
800202c: c3 a0 00 00 ret
080035c8 <clock_gettime>:
int clock_gettime(
clockid_t clock_id,
struct timespec *tp
)
{
80035c8: 37 9c ff e8 addi sp,sp,-24
80035cc: 5b 8b 00 10 sw (sp+16),r11
80035d0: 5b 8c 00 0c sw (sp+12),r12
80035d4: 5b 8d 00 08 sw (sp+8),r13
80035d8: 5b 9d 00 04 sw (sp+4),ra
80035dc: b8 20 18 00 mv r3,r1
80035e0: b8 40 58 00 mv r11,r2
if ( !tp )
80035e4: 44 40 00 27 be r2,r0,8003680 <clock_gettime+0xb8>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
80035e8: 34 01 00 01 mvi r1,1
80035ec: 5c 61 00 18 bne r3,r1,800364c <clock_gettime+0x84>
)
{
Timestamp_Control tod_as_timestamp;
Timestamp_Control *tod_as_timestamp_ptr;
tod_as_timestamp_ptr =
80035f0: 78 02 08 01 mvhi r2,0x801
80035f4: 38 42 88 b8 ori r2,r2,0x88b8
80035f8: 37 81 00 14 addi r1,sp,20
80035fc: f8 00 07 52 calli 8005344 <_TOD_Get_with_nanoseconds>
static inline void _Timestamp64_implementation_To_timespec(
const Timestamp64_Control *_timestamp,
struct timespec *_timespec
)
{
_timespec->tv_sec = (time_t) (*_timestamp / 1000000000L);
8003600: 78 05 08 01 mvhi r5,0x801
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
}
8003604: 28 2c 00 04 lw r12,(r1+4)
8003608: 28 2d 00 00 lw r13,(r1+0)
800360c: 38 a5 6e 60 ori r5,r5,0x6e60
8003610: 28 a4 00 00 lw r4,(r5+0)
8003614: 34 03 00 00 mvi r3,0
8003618: b9 a0 08 00 mv r1,r13
800361c: b9 80 10 00 mv r2,r12
8003620: f8 00 41 18 calli 8013a80 <__divdi3>
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
8003624: 78 05 08 01 mvhi r5,0x801
8003628: 38 a5 6e 60 ori r5,r5,0x6e60
800362c: 28 a4 00 00 lw r4,(r5+0)
static inline void _Timestamp64_implementation_To_timespec(
const Timestamp64_Control *_timestamp,
struct timespec *_timespec
)
{
_timespec->tv_sec = (time_t) (*_timestamp / 1000000000L);
8003630: 59 62 00 00 sw (r11+0),r2
_timespec->tv_nsec = (long) (*_timestamp % 1000000000L);
8003634: b9 a0 08 00 mv r1,r13
8003638: b9 80 10 00 mv r2,r12
800363c: 34 03 00 00 mvi r3,0
8003640: f8 00 43 12 calli 8014288 <__moddi3>
8003644: 59 62 00 04 sw (r11+4),r2
8003648: e0 00 00 07 bi 8003664 <clock_gettime+0x9c>
if ( clock_id == CLOCK_REALTIME ) {
_TOD_Get(tp);
return 0;
}
#ifdef CLOCK_MONOTONIC
if ( clock_id == CLOCK_MONOTONIC ) {
800364c: 34 01 00 04 mvi r1,4
8003650: 44 61 00 03 be r3,r1,800365c <clock_gettime+0x94> <== NEVER TAKEN
return 0;
}
#endif
#ifdef _POSIX_CPUTIME
if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) {
8003654: 34 01 00 02 mvi r1,2
8003658: 5c 61 00 05 bne r3,r1,800366c <clock_gettime+0xa4>
_TOD_Get_uptime_as_timespec( tp );
800365c: b9 60 08 00 mv r1,r11
8003660: f8 00 07 57 calli 80053bc <_TOD_Get_uptime_as_timespec>
return 0;
8003664: 34 01 00 00 mvi r1,0
8003668: e0 00 00 0a bi 8003690 <clock_gettime+0xc8>
}
#endif
#ifdef _POSIX_THREAD_CPUTIME
if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
800366c: 34 01 00 03 mvi r1,3
8003670: 5c 61 00 04 bne r3,r1,8003680 <clock_gettime+0xb8>
rtems_set_errno_and_return_minus_one( ENOSYS );
8003674: f8 00 28 52 calli 800d7bc <__errno>
8003678: 34 02 00 58 mvi r2,88
800367c: e0 00 00 03 bi 8003688 <clock_gettime+0xc0>
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
8003680: f8 00 28 4f calli 800d7bc <__errno>
8003684: 34 02 00 16 mvi r2,22
8003688: 58 22 00 00 sw (r1+0),r2
800368c: 34 01 ff ff mvi r1,-1
return 0;
}
8003690: 2b 9d 00 04 lw ra,(sp+4)
8003694: 2b 8b 00 10 lw r11,(sp+16)
8003698: 2b 8c 00 0c lw r12,(sp+12)
800369c: 2b 8d 00 08 lw r13,(sp+8)
80036a0: 37 9c 00 18 addi sp,sp,24
80036a4: c3 a0 00 00 ret
08025394 <clock_settime>:
int clock_settime(
clockid_t clock_id,
const struct timespec *tp
)
{
8025394: 37 9c ff e8 addi sp,sp,-24
8025398: 5b 8b 00 10 sw (sp+16),r11
802539c: 5b 8c 00 0c sw (sp+12),r12
80253a0: 5b 8d 00 08 sw (sp+8),r13
80253a4: 5b 9d 00 04 sw (sp+4),ra
80253a8: b8 40 58 00 mv r11,r2
if ( !tp )
80253ac: 44 40 00 30 be r2,r0,802546c <clock_settime+0xd8> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
80253b0: 34 02 00 01 mvi r2,1
80253b4: 5c 22 00 27 bne r1,r2,8025450 <clock_settime+0xbc>
if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 )
80253b8: 78 03 08 05 mvhi r3,0x805
80253bc: 38 63 f7 8c ori r3,r3,0xf78c
80253c0: 29 62 00 00 lw r2,(r11+0)
80253c4: 28 61 00 00 lw r1,(r3+0)
80253c8: 54 41 00 02 bgu r2,r1,80253d0 <clock_settime+0x3c>
80253cc: e0 00 00 28 bi 802546c <clock_settime+0xd8>
*
* 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;
80253d0: 78 01 08 06 mvhi r1,0x806
80253d4: 38 21 a0 60 ori r1,r1,0xa060
80253d8: 28 22 00 00 lw r2,(r1+0)
++level;
80253dc: 34 42 00 01 addi r2,r2,1
_Thread_Dispatch_disable_level = level;
80253e0: 58 22 00 00 sw (r1+0),r2
const struct timespec *tod_as_timespec
)
{
Timestamp_Control tod_as_timestamp;
_Timestamp_Set(
80253e4: 29 6c 00 00 lw r12,(r11+0)
80253e8: 34 02 00 1f mvi r2,31
80253ec: b9 80 08 00 mv r1,r12
80253f0: f8 00 cc 60 calli 8058570 <__ashrsi3>
Timestamp64_Control *_time,
Timestamp64_Control _seconds,
Timestamp64_Control _nanoseconds
)
{
*_time = _seconds * 1000000000L + _nanoseconds;
80253f4: 78 05 08 05 mvhi r5,0x805
80253f8: 38 a5 94 90 ori r5,r5,0x9490
80253fc: 28 a4 00 00 lw r4,(r5+0)
8025400: 34 03 00 00 mvi r3,0
8025404: b9 80 10 00 mv r2,r12
8025408: f8 00 b4 d1 calli 805274c <__muldi3>
802540c: 29 6b 00 04 lw r11,(r11+4)
8025410: b8 40 60 00 mv r12,r2
8025414: b8 20 68 00 mv r13,r1
8025418: 34 02 00 1f mvi r2,31
802541c: b9 60 08 00 mv r1,r11
8025420: f8 00 cc 54 calli 8058570 <__ashrsi3>
8025424: b5 8b 18 00 add r3,r12,r11
8025428: f5 83 60 00 cmpgu r12,r12,r3
802542c: b5 a1 08 00 add r1,r13,r1
8025430: b5 81 08 00 add r1,r12,r1
8025434: 5b 81 00 14 sw (sp+20),r1
&tod_as_timestamp,
tod_as_timespec->tv_sec,
tod_as_timespec->tv_nsec
);
_TOD_Set_with_timestamp( &tod_as_timestamp );
8025438: 37 81 00 14 addi r1,sp,20
802543c: 5b 83 00 18 sw (sp+24),r3
8025440: f8 00 05 9b calli 8026aac <_TOD_Set_with_timestamp>
rtems_set_errno_and_return_minus_one( EINVAL );
_Thread_Disable_dispatch();
_TOD_Set( tp );
_Thread_Enable_dispatch();
8025444: fb ff 81 e3 calli 8005bd0 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
return 0;
8025448: 34 01 00 00 mvi r1,0
802544c: e0 00 00 0c bi 802547c <clock_settime+0xe8>
_Thread_Disable_dispatch();
_TOD_Set( tp );
_Thread_Enable_dispatch();
}
#ifdef _POSIX_CPUTIME
else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID )
8025450: 34 02 00 02 mvi r2,2
8025454: 44 22 00 03 be r1,r2,8025460 <clock_settime+0xcc>
rtems_set_errno_and_return_minus_one( ENOSYS );
#endif
#ifdef _POSIX_THREAD_CPUTIME
else if ( clock_id == CLOCK_THREAD_CPUTIME_ID )
8025458: 34 02 00 03 mvi r2,3
802545c: 5c 22 00 04 bne r1,r2,802546c <clock_settime+0xd8>
rtems_set_errno_and_return_minus_one( ENOSYS );
8025460: f8 00 4e 4b calli 8038d8c <__errno>
8025464: 34 02 00 58 mvi r2,88
8025468: e0 00 00 03 bi 8025474 <clock_settime+0xe0>
#endif
else
rtems_set_errno_and_return_minus_one( EINVAL );
802546c: f8 00 4e 48 calli 8038d8c <__errno>
8025470: 34 02 00 16 mvi r2,22
8025474: 58 22 00 00 sw (r1+0),r2
8025478: 34 01 ff ff mvi r1,-1
return 0;
}
802547c: 2b 9d 00 04 lw ra,(sp+4)
8025480: 2b 8b 00 10 lw r11,(sp+16)
8025484: 2b 8c 00 0c lw r12,(sp+12)
8025488: 2b 8d 00 08 lw r13,(sp+8)
802548c: 37 9c 00 18 addi sp,sp,24
8025490: c3 a0 00 00 ret
0800155c <create_disk>:
dev_t dev,
const char *name,
rtems_disk_device **dd_ptr,
char **alloc_name_ptr
)
{
800155c: 37 9c ff d4 addi sp,sp,-44
8001560: 5b 8b 00 2c sw (sp+44),r11
8001564: 5b 8c 00 28 sw (sp+40),r12
8001568: 5b 8d 00 24 sw (sp+36),r13
800156c: 5b 8e 00 20 sw (sp+32),r14
8001570: 5b 8f 00 1c sw (sp+28),r15
8001574: 5b 90 00 18 sw (sp+24),r16
8001578: 5b 91 00 14 sw (sp+20),r17
800157c: 5b 92 00 10 sw (sp+16),r18
8001580: 5b 93 00 0c sw (sp+12),r19
8001584: 5b 94 00 08 sw (sp+8),r20
8001588: 5b 9d 00 04 sw (sp+4),ra
800158c: b8 40 68 00 mv r13,r2
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
rtems_filesystem_split_dev_t(dev, major, minor);
if (major >= disktab_size) {
8001590: 78 02 08 01 mvhi r2,0x801
8001594: 38 42 a7 54 ori r2,r2,0xa754
8001598: 28 4f 00 00 lw r15,(r2+0)
dev_t dev,
const char *name,
rtems_disk_device **dd_ptr,
char **alloc_name_ptr
)
{
800159c: b8 20 70 00 mv r14,r1
80015a0: b8 60 90 00 mv r18,r3
80015a4: b8 80 98 00 mv r19,r4
80015a8: b8 a0 a0 00 mv r20,r5
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
rtems_filesystem_split_dev_t(dev, major, minor);
if (major >= disktab_size) {
80015ac: 55 e1 00 24 bgu r15,r1,800163c <create_disk+0xe0>
rtems_disk_device_table *table = disktab;
80015b0: 78 02 08 01 mvhi r2,0x801
80015b4: 38 42 a7 50 ori r2,r2,0xa750
80015b8: 28 4b 00 00 lw r11,(r2+0)
rtems_device_major_number old_size = disktab_size;
rtems_device_major_number new_size = 2 * old_size;
80015bc: b9 e0 08 00 mv r1,r15
80015c0: 34 02 00 01 mvi r2,1
80015c4: f8 00 58 df calli 8017940 <__ashlsi3>
80015c8: b8 20 60 00 mv r12,r1
if (major >= new_size) {
80015cc: 54 2e 00 02 bgu r1,r14,80015d4 <create_disk+0x78> <== NEVER TAKEN
new_size = major + 1;
80015d0: 35 cc 00 01 addi r12,r14,1
}
table = realloc(table, new_size * sizeof(*table));
80015d4: 34 02 00 03 mvi r2,3
80015d8: b9 80 08 00 mv r1,r12
80015dc: f8 00 58 d9 calli 8017940 <__ashlsi3>
80015e0: b8 20 10 00 mv r2,r1
80015e4: b9 60 08 00 mv r1,r11
80015e8: f8 00 09 40 calli 8003ae8 <realloc>
80015ec: b8 20 80 00 mv r16,r1
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;
80015f0: 34 0b 00 1a mvi r11,26
if (major >= new_size) {
new_size = major + 1;
}
table = realloc(table, new_size * sizeof(*table));
if (table == NULL) {
80015f4: 44 20 00 68 be r1,r0,8001794 <create_disk+0x238> <== ALWAYS TAKEN
return NULL;
}
memset(table + old_size, 0, (new_size - old_size) * sizeof(*table));
80015f8: 34 02 00 03 mvi r2,3 <== NOT EXECUTED
80015fc: c9 8f 08 00 sub r1,r12,r15 <== NOT EXECUTED
8001600: f8 00 58 d0 calli 8017940 <__ashlsi3> <== NOT EXECUTED
8001604: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
8001608: 34 02 00 03 mvi r2,3 <== NOT EXECUTED
800160c: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
8001610: f8 00 58 cc calli 8017940 <__ashlsi3> <== NOT EXECUTED
8001614: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
8001618: b6 01 08 00 add r1,r16,r1 <== NOT EXECUTED
800161c: b9 60 18 00 mv r3,r11 <== NOT EXECUTED
8001620: f8 00 44 c4 calli 8012930 <memset> <== NOT EXECUTED
disktab = table;
8001624: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED
8001628: 38 42 a7 50 ori r2,r2,0xa750 <== NOT EXECUTED
800162c: 58 50 00 00 sw (r2+0),r16 <== NOT EXECUTED
disktab_size = new_size;
8001630: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED
8001634: 38 42 a7 54 ori r2,r2,0xa754 <== NOT EXECUTED
8001638: 58 4c 00 00 sw (r2+0),r12 <== NOT EXECUTED
}
if (disktab [major].minor == NULL || minor >= disktab[major].size) {
800163c: 34 02 00 03 mvi r2,3
8001640: b9 c0 08 00 mv r1,r14
8001644: f8 00 58 bf calli 8017940 <__ashlsi3>
8001648: 78 02 08 01 mvhi r2,0x801
800164c: 38 42 a7 50 ori r2,r2,0xa750
8001650: 28 42 00 00 lw r2,(r2+0)
8001654: b8 20 80 00 mv r16,r1
8001658: b4 41 10 00 add r2,r2,r1
800165c: 28 4b 00 00 lw r11,(r2+0)
8001660: 45 60 00 03 be r11,r0,800166c <create_disk+0x110>
8001664: 28 41 00 04 lw r1,(r2+4)
8001668: 54 2d 00 24 bgu r1,r13,80016f8 <create_disk+0x19c>
rtems_disk_device **table = disktab [major].minor;
rtems_device_minor_number old_size = disktab [major].size;
800166c: 28 4f 00 04 lw r15,(r2+4)
rtems_device_minor_number new_size = 0;
if (old_size == 0) {
new_size = DISKTAB_INITIAL_SIZE;
8001670: 34 0c 00 08 mvi r12,8
if (disktab [major].minor == NULL || minor >= disktab[major].size) {
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) {
8001674: 45 e0 00 05 be r15,r0,8001688 <create_disk+0x12c>
new_size = DISKTAB_INITIAL_SIZE;
} else {
new_size = 2 * old_size;
8001678: b9 e0 08 00 mv r1,r15
800167c: 34 02 00 01 mvi r2,1
8001680: f8 00 58 b0 calli 8017940 <__ashlsi3>
8001684: b8 20 60 00 mv r12,r1
}
if (minor >= new_size) {
8001688: 55 8d 00 02 bgu r12,r13,8001690 <create_disk+0x134>
new_size = minor + 1;
800168c: 35 ac 00 01 addi r12,r13,1
}
table = realloc(table, new_size * sizeof(*table));
8001690: 34 02 00 02 mvi r2,2
8001694: b9 80 08 00 mv r1,r12
8001698: f8 00 58 aa calli 8017940 <__ashlsi3>
800169c: b8 20 10 00 mv r2,r1
80016a0: b9 60 08 00 mv r1,r11
80016a4: f8 00 09 11 calli 8003ae8 <realloc>
80016a8: b8 20 88 00 mv r17,r1
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;
80016ac: 34 0b 00 1a mvi r11,26
if (minor >= new_size) {
new_size = minor + 1;
}
table = realloc(table, new_size * sizeof(*table));
if (table == NULL) {
80016b0: 44 20 00 39 be r1,r0,8001794 <create_disk+0x238>
return NULL;
}
memset(table + old_size, 0, (new_size - old_size) * sizeof(*table));
80016b4: 34 02 00 02 mvi r2,2
80016b8: c9 8f 08 00 sub r1,r12,r15
80016bc: f8 00 58 a1 calli 8017940 <__ashlsi3>
80016c0: b8 20 58 00 mv r11,r1
80016c4: 34 02 00 02 mvi r2,2
80016c8: b9 e0 08 00 mv r1,r15
80016cc: f8 00 58 9d calli 8017940 <__ashlsi3>
80016d0: 34 02 00 00 mvi r2,0
80016d4: b6 21 08 00 add r1,r17,r1
80016d8: b9 60 18 00 mv r3,r11
80016dc: f8 00 44 95 calli 8012930 <memset>
disktab [major].minor = table;
80016e0: 78 02 08 01 mvhi r2,0x801
80016e4: 38 42 a7 50 ori r2,r2,0xa750
80016e8: 28 41 00 00 lw r1,(r2+0)
80016ec: b4 30 08 00 add r1,r1,r16
80016f0: 58 31 00 00 sw (r1+0),r17
disktab [major].size = new_size;
80016f4: 58 2c 00 04 sw (r1+4),r12
}
return disktab [major].minor + minor;
80016f8: 78 02 08 01 mvhi r2,0x801
80016fc: 38 42 a7 50 ori r2,r2,0xa750
8001700: 28 41 00 00 lw r1,(r2+0)
8001704: 34 02 00 02 mvi r2,2
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;
8001708: 34 0b 00 1a mvi r11,26
memset(table + old_size, 0, (new_size - old_size) * sizeof(*table));
disktab [major].minor = table;
disktab [major].size = new_size;
}
return disktab [major].minor + minor;
800170c: b4 30 80 00 add r16,r1,r16
8001710: b9 a0 08 00 mv r1,r13
8001714: f8 00 58 8b calli 8017940 <__ashlsi3>
8001718: 2a 0f 00 00 lw r15,(r16+0)
800171c: b5 e1 78 00 add r15,r15,r1
{
rtems_disk_device **dd_entry = create_disk_table_entry(dev);
rtems_disk_device *dd = NULL;
char *alloc_name = NULL;
if (dd_entry == NULL) {
8001720: 45 e0 00 1d be r15,r0,8001794 <create_disk+0x238> <== NEVER TAKEN
return RTEMS_NO_MEMORY;
}
if (*dd_entry != NULL) {
8001724: 29 f0 00 00 lw r16,(r15+0)
return RTEMS_RESOURCE_IN_USE;
8001728: 34 0b 00 0c mvi r11,12
if (dd_entry == NULL) {
return RTEMS_NO_MEMORY;
}
if (*dd_entry != NULL) {
800172c: 5e 00 00 1a bne r16,r0,8001794 <create_disk+0x238>
return RTEMS_RESOURCE_IN_USE;
}
dd = malloc(sizeof(*dd));
8001730: 34 01 00 78 mvi r1,120
8001734: f8 00 06 05 calli 8002f48 <malloc>
8001738: b8 20 60 00 mv r12,r1
if (dd == NULL) {
return RTEMS_NO_MEMORY;
800173c: 34 0b 00 1a mvi r11,26
if (*dd_entry != NULL) {
return RTEMS_RESOURCE_IN_USE;
}
dd = malloc(sizeof(*dd));
if (dd == NULL) {
8001740: 44 30 00 15 be r1,r16,8001794 <create_disk+0x238> <== NEVER TAKEN
return RTEMS_NO_MEMORY;
}
if (name != NULL) {
8001744: 46 40 00 0f be r18,r0,8001780 <create_disk+0x224>
alloc_name = strdup(name);
8001748: ba 40 08 00 mv r1,r18
800174c: f8 00 45 c0 calli 8012e4c <strdup>
8001750: b8 20 80 00 mv r16,r1
8001754: b8 20 88 00 mv r17,r1
if (alloc_name == NULL) {
8001758: 5c 20 00 1d bne r1,r0,80017cc <create_disk+0x270> <== ALWAYS TAKEN
free(dd);
800175c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8001760: f8 00 04 6c calli 8002910 <free> <== NOT EXECUTED
return RTEMS_NO_MEMORY;
8001764: e0 00 00 0c bi 8001794 <create_disk+0x238> <== NOT EXECUTED
}
}
if (name != NULL) {
if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) {
free(alloc_name);
8001768: ba 00 08 00 mv r1,r16 <== NOT EXECUTED
800176c: f8 00 04 69 calli 8002910 <free> <== NOT EXECUTED
free(dd);
8001770: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8001774: f8 00 04 67 calli 8002910 <free> <== NOT EXECUTED
return RTEMS_UNSATISFIED;
8001778: 34 0b 00 0d mvi r11,13 <== NOT EXECUTED
800177c: e0 00 00 06 bi 8001794 <create_disk+0x238> <== NOT EXECUTED
char **alloc_name_ptr
)
{
rtems_disk_device **dd_entry = create_disk_table_entry(dev);
rtems_disk_device *dd = NULL;
char *alloc_name = NULL;
8001780: 34 11 00 00 mvi r17,0
free(dd);
return RTEMS_UNSATISFIED;
}
}
*dd_entry = dd;
8001784: 59 ec 00 00 sw (r15+0),r12
*dd_ptr = dd;
8001788: 5a 6c 00 00 sw (r19+0),r12
*alloc_name_ptr = alloc_name;
800178c: 5a 91 00 00 sw (r20+0),r17
return RTEMS_SUCCESSFUL;
8001790: 34 0b 00 00 mvi r11,0
}
8001794: b9 60 08 00 mv r1,r11
8001798: 2b 9d 00 04 lw ra,(sp+4)
800179c: 2b 8b 00 2c lw r11,(sp+44)
80017a0: 2b 8c 00 28 lw r12,(sp+40)
80017a4: 2b 8d 00 24 lw r13,(sp+36)
80017a8: 2b 8e 00 20 lw r14,(sp+32)
80017ac: 2b 8f 00 1c lw r15,(sp+28)
80017b0: 2b 90 00 18 lw r16,(sp+24)
80017b4: 2b 91 00 14 lw r17,(sp+20)
80017b8: 2b 92 00 10 lw r18,(sp+16)
80017bc: 2b 93 00 0c lw r19,(sp+12)
80017c0: 2b 94 00 08 lw r20,(sp+8)
80017c4: 37 9c 00 2c addi sp,sp,44
80017c8: c3 a0 00 00 ret
return RTEMS_NO_MEMORY;
}
}
if (name != NULL) {
if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) {
80017cc: 34 02 61 ff mvi r2,25087
80017d0: b9 c0 18 00 mv r3,r14
80017d4: b9 a0 20 00 mv r4,r13
80017d8: f8 00 06 44 calli 80030e8 <mknod>
80017dc: 48 01 ff e3 bg r0,r1,8001768 <create_disk+0x20c> <== NEVER TAKEN
80017e0: e3 ff ff e9 bi 8001784 <create_disk+0x228>
08001114 <ctermid>:
* ctermid() - POSIX 1003.1b 4.7.1 - Generate Terminal Pathname
*/
char *ctermid(
char *s
)
{
8001114: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED
8001118: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED
800111c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
8001120: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED
8001124: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
8001128: 38 42 08 78 ori r2,r2,0x878 <== NOT EXECUTED
if ( !s )
800112c: 44 20 00 03 be r1,r0,8001138 <ctermid+0x24> <== NOT EXECUTED
/*
* We have no way of knowing the length of the user provided buffer.
* It may not be large enough but there is no way to know that. :(
* So this is a potential buffer owerrun that we can do nothing about.
*/
strcpy( s, ctermid_name );
8001130: f8 00 2a c5 calli 800bc44 <strcpy> <== NOT EXECUTED
return s;
8001134: e0 00 00 02 bi 800113c <ctermid+0x28> <== NOT EXECUTED
char *ctermid(
char *s
)
{
if ( !s )
return ctermid_name;
8001138: b8 40 58 00 mv r11,r2 <== NOT EXECUTED
* It may not be large enough but there is no way to know that. :(
* So this is a potential buffer owerrun that we can do nothing about.
*/
strcpy( s, ctermid_name );
return s;
}
800113c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8001140: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8001144: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED
8001148: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED
800114c: c3 a0 00 00 ret <== NOT EXECUTED
08003078 <data_to_part_desc>:
* RTEMS_NO_MEMOTY, if cannot allocate memory for part_desc_t strucure;
* RTEMS_INTERNAL_ERROR, if other error occurs.
*/
static rtems_status_code
data_to_part_desc(uint8_t *data, rtems_part_desc_t **new_part_desc)
{
8003078: 37 9c ff e4 addi sp,sp,-28
800307c: 5b 8b 00 18 sw (sp+24),r11
8003080: 5b 8c 00 14 sw (sp+20),r12
8003084: 5b 8d 00 10 sw (sp+16),r13
8003088: 5b 8e 00 0c sw (sp+12),r14
800308c: 5b 8f 00 08 sw (sp+8),r15
8003090: 5b 9d 00 04 sw (sp+4),ra
8003094: b8 20 60 00 mv r12,r1
8003098: b8 40 70 00 mv r14,r2
rtems_part_desc_t *part_desc;
uint32_t temp;
if (new_part_desc == NULL)
{
return RTEMS_INTERNAL_ERROR;
800309c: 34 01 00 19 mvi r1,25
data_to_part_desc(uint8_t *data, rtems_part_desc_t **new_part_desc)
{
rtems_part_desc_t *part_desc;
uint32_t temp;
if (new_part_desc == NULL)
80030a0: 44 40 00 35 be r2,r0,8003174 <data_to_part_desc+0xfc> <== NEVER TAKEN
{
return RTEMS_INTERNAL_ERROR;
}
*new_part_desc = NULL;
80030a4: 58 40 00 00 sw (r2+0),r0
if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL)
80030a8: 34 01 00 01 mvi r1,1
80030ac: 34 02 00 28 mvi r2,40
80030b0: f8 00 03 70 calli 8003e70 <calloc>
80030b4: b8 20 58 00 mv r11,r1
{
return RTEMS_NO_MEMORY;
80030b8: 34 01 00 1a mvi r1,26
return RTEMS_INTERNAL_ERROR;
}
*new_part_desc = NULL;
if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL)
80030bc: 45 60 00 2e be r11,r0,8003174 <data_to_part_desc+0xfc> <== NEVER TAKEN
{
return RTEMS_NO_MEMORY;
}
part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET);
80030c0: 41 81 00 00 lbu r1,(r12+0)
80030c4: 31 61 00 00 sb (r11+0),r1
part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET);
80030c8: 41 8d 00 04 lbu r13,(r12+4)
/* read the offset start position and partition size in sectors */
/* due to incorrect data alignment one have to align data first */
memcpy(&temp, data + RTEMS_IDE_PARTITION_START_OFFSET, sizeof(uint32_t));
80030cc: 35 81 00 08 addi r1,r12,8
{
return RTEMS_NO_MEMORY;
}
part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET);
part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET);
80030d0: 31 6d 00 01 sb (r11+1),r13
/* read the offset start position and partition size in sectors */
/* due to incorrect data alignment one have to align data first */
memcpy(&temp, data + RTEMS_IDE_PARTITION_START_OFFSET, sizeof(uint32_t));
80030d4: 41 84 00 08 lbu r4,(r12+8)
80030d8: 40 23 00 01 lbu r3,(r1+1)
80030dc: 40 22 00 02 lbu r2,(r1+2)
80030e0: 40 21 00 03 lbu r1,(r1+3)
80030e4: 33 84 00 1c sb (sp+28),r4
80030e8: 33 83 00 1d sb (sp+29),r3
80030ec: 33 82 00 1e sb (sp+30),r2
80030f0: 33 81 00 1f sb (sp+31),r1
part_desc->start = LE_TO_CPU_U32(temp);
80030f4: 2b 81 00 1c lw r1,(sp+28)
* true if partition type is extended, false otherwise
*/
static bool
is_extended(uint8_t type)
{
return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED));
80030f8: 65 af 00 85 cmpei r15,r13,133
/* read the offset start position and partition size in sectors */
/* due to incorrect data alignment one have to align data first */
memcpy(&temp, data + RTEMS_IDE_PARTITION_START_OFFSET, sizeof(uint32_t));
part_desc->start = LE_TO_CPU_U32(temp);
80030fc: fb ff ff 60 calli 8002e7c <CPU_swap_u32>
8003100: 59 61 00 04 sw (r11+4),r1
memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t));
8003104: 35 81 00 0c addi r1,r12,12
8003108: 41 84 00 0c lbu r4,(r12+12)
800310c: 40 23 00 01 lbu r3,(r1+1)
8003110: 40 22 00 02 lbu r2,(r1+2)
8003114: 40 21 00 03 lbu r1,(r1+3)
8003118: 33 84 00 1c sb (sp+28),r4
800311c: 33 83 00 1d sb (sp+29),r3
8003120: 33 82 00 1e sb (sp+30),r2
8003124: 33 81 00 1f sb (sp+31),r1
part_desc->size = LE_TO_CPU_U32(temp);
8003128: 2b 81 00 1c lw r1,(sp+28)
800312c: fb ff ff 54 calli 8002e7c <CPU_swap_u32>
8003130: b8 20 60 00 mv r12,r1
8003134: 59 61 00 08 sw (r11+8),r1
* true if partition type is extended, false otherwise
*/
static bool
is_extended(uint8_t type)
{
return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED));
8003138: 65 a1 00 05 cmpei r1,r13,5
800313c: b9 e1 78 00 or r15,r15,r1
* use partitions that are
* - extended
* or
* - FAT type and non-zero
*/
if (is_extended(part_desc->sys_type) ||
8003140: 5d e0 00 08 bne r15,r0,8003160 <data_to_part_desc+0xe8>
DOS_P32MB_PARTITION,
FAT32_PARTITION ,FAT32_LBA_PARTITION,
FAT16_LBA_PARTITION
};
return (NULL != memchr(fat_part_types,type,sizeof(fat_part_types)));
8003144: 78 01 08 02 mvhi r1,0x802
8003148: 38 21 64 dc ori r1,r1,0x64dc
800314c: b9 a0 10 00 mv r2,r13
8003150: 34 03 00 06 mvi r3,6
8003154: f8 00 43 f5 calli 8014128 <memchr>
* use partitions that are
* - extended
* or
* - FAT type and non-zero
*/
if (is_extended(part_desc->sys_type) ||
8003158: 44 2f 00 04 be r1,r15,8003168 <data_to_part_desc+0xf0>
((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) {
800315c: 45 80 00 03 be r12,r0,8003168 <data_to_part_desc+0xf0> <== NEVER TAKEN
*new_part_desc = part_desc;
8003160: 59 cb 00 00 sw (r14+0),r11
8003164: e0 00 00 03 bi 8003170 <data_to_part_desc+0xf8>
}
else {
/* empty partition */
free(part_desc);
8003168: b9 60 08 00 mv r1,r11
800316c: f8 00 03 8b calli 8003f98 <free>
}
return RTEMS_SUCCESSFUL;
8003170: 34 01 00 00 mvi r1,0
}
8003174: 2b 9d 00 04 lw ra,(sp+4)
8003178: 2b 8b 00 18 lw r11,(sp+24)
800317c: 2b 8c 00 14 lw r12,(sp+20)
8003180: 2b 8d 00 10 lw r13,(sp+16)
8003184: 2b 8e 00 0c lw r14,(sp+12)
8003188: 2b 8f 00 08 lw r15,(sp+8)
800318c: 37 9c 00 1c addi sp,sp,28
8003190: c3 a0 00 00 ret
080008c0 <devFS_Show>:
#endif
#include "devfs.h"
void devFS_Show(void)
{
80008c0: 37 9c ff dc addi sp,sp,-36
80008c4: 5b 8b 00 24 sw (sp+36),r11
80008c8: 5b 8c 00 20 sw (sp+32),r12
80008cc: 5b 8d 00 1c sw (sp+28),r13
80008d0: 5b 8e 00 18 sw (sp+24),r14
80008d4: 5b 8f 00 14 sw (sp+20),r15
80008d8: 5b 90 00 10 sw (sp+16),r16
80008dc: 5b 91 00 0c sw (sp+12),r17
80008e0: 5b 92 00 08 sw (sp+8),r18
80008e4: 5b 9d 00 04 sw (sp+4),ra
rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location;
80008e8: 78 01 08 01 mvhi r1,0x801
80008ec: 38 21 11 80 ori r1,r1,0x1180
80008f0: 28 21 00 00 lw r1,(r1+0)
80008f4: 28 21 00 04 lw r1,(r1+4)
if (rootloc->mt_entry->ops == &devFS_ops) {
80008f8: 28 22 00 14 lw r2,(r1+20)
80008fc: 78 01 08 01 mvhi r1,0x801
8000900: 38 21 01 d8 ori r1,r1,0x1d8
8000904: 28 43 00 0c lw r3,(r2+12)
8000908: 5c 61 00 21 bne r3,r1,800098c <devFS_Show+0xcc> <== NEVER TAKEN
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;
800090c: 28 41 00 10 lw r1,(r2+16)
if (current->name != NULL) {
size_t j = 0;
size_t m = current->namelen;
printk("/");
8000910: 78 0f 08 01 mvhi r15,0x801
for (j = 0; j < m; ++j) {
printk("%c", current->name [j]);
8000914: 78 0e 08 01 mvhi r14,0x801
}
printk(
8000918: 78 0d 08 01 mvhi r13,0x801
rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location;
if (rootloc->mt_entry->ops == &devFS_ops) {
const devFS_data *data = devFS_get_data(rootloc);
size_t i = 0;
size_t n = data->count;
800091c: 28 31 00 04 lw r17,(r1+4)
8000920: 28 2b 00 00 lw r11,(r1+0)
devFS_node *nodes = data->nodes;
for (i = 0; i < n; ++i) {
8000924: 34 10 00 00 mvi r16,0
if (current->name != NULL) {
size_t j = 0;
size_t m = current->namelen;
printk("/");
8000928: 39 ef 02 58 ori r15,r15,0x258
for (j = 0; j < m; ++j) {
printk("%c", current->name [j]);
800092c: 39 ce 02 5c ori r14,r14,0x25c
}
printk(
8000930: 39 ad 02 60 ori r13,r13,0x260
const devFS_data *data = devFS_get_data(rootloc);
size_t i = 0;
size_t n = data->count;
devFS_node *nodes = data->nodes;
for (i = 0; i < n; ++i) {
8000934: e0 00 00 15 bi 8000988 <devFS_Show+0xc8>
devFS_node *current = nodes + i;
if (current->name != NULL) {
8000938: 29 61 00 00 lw r1,(r11+0)
800093c: 44 20 00 11 be r1,r0,8000980 <devFS_Show+0xc0>
size_t j = 0;
size_t m = current->namelen;
printk("/");
8000940: b9 e0 08 00 mv r1,r15
for (i = 0; i < n; ++i) {
devFS_node *current = nodes + i;
if (current->name != NULL) {
size_t j = 0;
size_t m = current->namelen;
8000944: 29 72 00 04 lw r18,(r11+4)
printk("/");
for (j = 0; j < m; ++j) {
8000948: 34 0c 00 00 mvi r12,0
if (current->name != NULL) {
size_t j = 0;
size_t m = current->namelen;
printk("/");
800094c: f8 00 03 e2 calli 80018d4 <printk>
for (j = 0; j < m; ++j) {
8000950: e0 00 00 07 bi 800096c <devFS_Show+0xac>
printk("%c", current->name [j]);
8000954: 29 62 00 00 lw r2,(r11+0)
8000958: b9 c0 08 00 mv r1,r14
800095c: b4 4c 10 00 add r2,r2,r12
8000960: 40 42 00 00 lbu r2,(r2+0)
if (current->name != NULL) {
size_t j = 0;
size_t m = current->namelen;
printk("/");
for (j = 0; j < m; ++j) {
8000964: 35 8c 00 01 addi r12,r12,1
printk("%c", current->name [j]);
8000968: f8 00 03 db calli 80018d4 <printk>
if (current->name != NULL) {
size_t j = 0;
size_t m = current->namelen;
printk("/");
for (j = 0; j < m; ++j) {
800096c: 56 4c ff fa bgu r18,r12,8000954 <devFS_Show+0x94>
printk("%c", current->name [j]);
}
printk(
8000970: 29 62 00 08 lw r2,(r11+8)
8000974: 29 63 00 0c lw r3,(r11+12)
8000978: b9 a0 08 00 mv r1,r13
800097c: f8 00 03 d6 calli 80018d4 <printk>
const devFS_data *data = devFS_get_data(rootloc);
size_t i = 0;
size_t n = data->count;
devFS_node *nodes = data->nodes;
for (i = 0; i < n; ++i) {
8000980: 36 10 00 01 addi r16,r16,1
8000984: 35 6b 00 14 addi r11,r11,20
8000988: 56 30 ff ec bgu r17,r16,8000938 <devFS_Show+0x78>
(unsigned long) current->minor
);
}
}
}
}
800098c: 2b 9d 00 04 lw ra,(sp+4)
8000990: 2b 8b 00 24 lw r11,(sp+36)
8000994: 2b 8c 00 20 lw r12,(sp+32)
8000998: 2b 8d 00 1c lw r13,(sp+28)
800099c: 2b 8e 00 18 lw r14,(sp+24)
80009a0: 2b 8f 00 14 lw r15,(sp+20)
80009a4: 2b 90 00 10 lw r16,(sp+16)
80009a8: 2b 91 00 0c lw r17,(sp+12)
80009ac: 2b 92 00 08 lw r18,(sp+8)
80009b0: 37 9c 00 24 addi sp,sp,36
80009b4: c3 a0 00 00 ret
08009c84 <devFS_eval_path>:
}
void devFS_eval_path(
rtems_filesystem_eval_path_context_t *ctx
)
{
8009c84: 37 9c ff dc addi sp,sp,-36
8009c88: 5b 8b 00 24 sw (sp+36),r11
8009c8c: 5b 8c 00 20 sw (sp+32),r12
8009c90: 5b 8d 00 1c sw (sp+28),r13
8009c94: 5b 8e 00 18 sw (sp+24),r14
8009c98: 5b 8f 00 14 sw (sp+20),r15
8009c9c: 5b 90 00 10 sw (sp+16),r16
8009ca0: 5b 91 00 0c sw (sp+12),r17
8009ca4: 5b 92 00 08 sw (sp+8),r18
8009ca8: 5b 9d 00 04 sw (sp+4),ra
8009cac: b8 20 58 00 mv r11,r1
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;
8009cb0: 28 21 00 2c lw r1,(r1+44)
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
}
}
}
8009cb4: 29 71 00 00 lw r17,(r11+0)
8009cb8: 29 6f 00 04 lw r15,(r11+4)
8009cbc: 28 21 00 10 lw r1,(r1+16)
{
size_t i = 0;
size_t n = data->count;
devFS_node *nodes = data->nodes;
devFS_node *node = NULL;
devFS_node *free_node = NULL;
8009cc0: 34 0d 00 00 mvi r13,0
)
{
size_t i = 0;
size_t n = data->count;
devFS_node *nodes = data->nodes;
devFS_node *node = NULL;
8009cc4: 34 0e 00 00 mvi r14,0
size_t pathlen,
devFS_node **free_node_ptr
)
{
size_t i = 0;
size_t n = data->count;
8009cc8: 28 32 00 04 lw r18,(r1+4)
8009ccc: 28 2c 00 00 lw r12,(r1+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) {
8009cd0: 34 10 00 00 mvi r16,0
8009cd4: e0 00 00 0f bi 8009d10 <devFS_eval_path+0x8c>
devFS_node *current = nodes + i;
if (current->name != NULL) {
8009cd8: 29 81 00 00 lw r1,(r12+0)
8009cdc: 44 20 00 08 be r1,r0,8009cfc <devFS_eval_path+0x78>
if (
8009ce0: 29 82 00 04 lw r2,(r12+4)
8009ce4: 5c 4f 00 09 bne r2,r15,8009d08 <devFS_eval_path+0x84>
current->namelen == pathlen
&& memcmp(current->name, path, pathlen) == 0
8009ce8: ba 20 10 00 mv r2,r17
8009cec: b9 e0 18 00 mv r3,r15
8009cf0: f8 00 11 d5 calli 800e444 <memcmp>
8009cf4: 44 20 00 04 be r1,r0,8009d04 <devFS_eval_path+0x80>
8009cf8: e0 00 00 04 bi 8009d08 <devFS_eval_path+0x84>
devFS_node *free_node = NULL;
for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) {
devFS_node *current = nodes + i;
if (current->name != NULL) {
8009cfc: b9 80 68 00 mv r13,r12
8009d00: e0 00 00 02 bi 8009d08 <devFS_eval_path+0x84>
if (
current->namelen == pathlen
&& memcmp(current->name, path, pathlen) == 0
8009d04: b9 80 70 00 mv r14,r12
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) {
8009d08: 36 10 00 01 addi r16,r16,1
8009d0c: 35 8c 00 14 addi r12,r12,20
8009d10: 65 c2 00 00 cmpei r2,r14,0
8009d14: 65 a1 00 00 cmpei r1,r13,0
8009d18: b8 41 08 00 or r1,r2,r1
8009d1c: 44 20 00 02 be r1,r0,8009d24 <devFS_eval_path+0xa0>
8009d20: 56 50 ff ee bgu r18,r16,8009cd8 <devFS_eval_path+0x54>
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
}
}
}
8009d24: 29 61 00 10 lw r1,(r11+16)
rtems_filesystem_eval_path_get_pathlen(ctx),
&free_node
);
int eval_flags = rtems_filesystem_eval_path_get_flags(ctx);
if (node != NULL) {
8009d28: 45 c0 00 08 be r14,r0,8009d48 <devFS_eval_path+0xc4>
if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) {
8009d2c: 20 21 00 40 andi r1,r1,0x40
8009d30: 5c 20 00 03 bne r1,r0,8009d3c <devFS_eval_path+0xb8>
currentloc->node_access = node;
8009d34: 59 6e 00 20 sw (r11+32),r14
8009d38: e0 00 00 0c bi 8009d68 <devFS_eval_path+0xe4>
rtems_filesystem_eval_path_clear_path(ctx);
} else {
rtems_filesystem_eval_path_error(ctx, EEXIST);
8009d3c: b9 60 08 00 mv r1,r11
8009d40: 34 02 00 11 mvi r2,17
8009d44: e0 00 00 10 bi 8009d84 <devFS_eval_path+0x100>
}
} else {
if ((eval_flags & RTEMS_FS_MAKE) != 0) {
8009d48: 20 21 00 20 andi r1,r1,0x20
8009d4c: 44 2e 00 0c be r1,r14,8009d7c <devFS_eval_path+0xf8> <== NEVER TAKEN
if (free_node != NULL) {
8009d50: 45 a0 00 08 be r13,r0,8009d70 <devFS_eval_path+0xec>
free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO;
8009d54: 34 01 01 ff mvi r1,511
8009d58: 59 a1 00 10 sw (r13+16),r1
currentloc->node_access = free_node;
8009d5c: 59 6d 00 20 sw (r11+32),r13
rtems_filesystem_eval_path_context_t *ctx,
const char *token,
size_t tokenlen
)
{
ctx->token = token;
8009d60: 59 71 00 08 sw (r11+8),r17
ctx->tokenlen = tokenlen;
8009d64: 59 6f 00 0c sw (r11+12),r15
static inline void rtems_filesystem_eval_path_clear_path(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->pathlen = 0;
8009d68: 59 60 00 04 sw (r11+4),r0
8009d6c: e0 00 00 07 bi 8009d88 <devFS_eval_path+0x104>
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);
8009d70: b9 60 08 00 mv r1,r11
8009d74: 34 02 00 1c mvi r2,28
8009d78: e0 00 00 03 bi 8009d84 <devFS_eval_path+0x100>
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
8009d7c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8009d80: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
8009d84: fb ff ea f7 calli 8004960 <rtems_filesystem_eval_path_error>
}
}
}
8009d88: 2b 9d 00 04 lw ra,(sp+4)
8009d8c: 2b 8b 00 24 lw r11,(sp+36)
8009d90: 2b 8c 00 20 lw r12,(sp+32)
8009d94: 2b 8d 00 1c lw r13,(sp+28)
8009d98: 2b 8e 00 18 lw r14,(sp+24)
8009d9c: 2b 8f 00 14 lw r15,(sp+20)
8009da0: 2b 90 00 10 lw r16,(sp+16)
8009da4: 2b 91 00 0c lw r17,(sp+12)
8009da8: 2b 92 00 08 lw r18,(sp+8)
8009dac: 37 9c 00 24 addi sp,sp,36
8009db0: c3 a0 00 00 ret
08003690 <devFS_mknod>:
const char *name,
size_t namelen,
mode_t mode,
dev_t dev
)
{
8003690: 37 9c ff e4 addi sp,sp,-28
8003694: 5b 8b 00 14 sw (sp+20),r11
8003698: 5b 8c 00 10 sw (sp+16),r12
800369c: 5b 8d 00 0c sw (sp+12),r13
80036a0: 5b 8e 00 08 sw (sp+8),r14
80036a4: 5b 9d 00 04 sw (sp+4),ra
80036a8: b8 20 70 00 mv r14,r1
int rv = 0;
if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') {
80036ac: 34 01 00 03 mvi r1,3
const char *name,
size_t namelen,
mode_t mode,
dev_t dev
)
{
80036b0: b8 80 58 00 mv r11,r4
80036b4: b8 a0 68 00 mv r13,r5
80036b8: b8 c0 60 00 mv r12,r6
int rv = 0;
if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') {
80036bc: 5c 61 00 0a bne r3,r1,80036e4 <devFS_mknod+0x54>
80036c0: 40 44 00 00 lbu r4,(r2+0)
80036c4: 34 01 00 64 mvi r1,100
80036c8: 5c 81 00 07 bne r4,r1,80036e4 <devFS_mknod+0x54> <== NEVER TAKEN
80036cc: 40 44 00 01 lbu r4,(r2+1)
80036d0: 34 01 00 65 mvi r1,101
80036d4: 5c 81 00 04 bne r4,r1,80036e4 <devFS_mknod+0x54> <== NEVER TAKEN
80036d8: 40 44 00 02 lbu r4,(r2+2)
80036dc: 34 01 00 76 mvi r1,118
80036e0: 44 81 00 19 be r4,r1,8003744 <devFS_mknod+0xb4> <== ALWAYS TAKEN
if (S_ISBLK(mode) || S_ISCHR(mode)) {
80036e4: 21 64 f0 00 andi r4,r11,0xf000
80036e8: 64 81 20 00 cmpei r1,r4,8192
80036ec: 64 84 60 00 cmpei r4,r4,24576
80036f0: b8 24 20 00 or r4,r1,r4
80036f4: 44 80 00 18 be r4,r0,8003754 <devFS_mknod+0xc4>
char *dupname = malloc(namelen);
80036f8: b8 60 08 00 mv r1,r3
80036fc: 5b 82 00 1c sw (sp+28),r2
8003700: 5b 83 00 18 sw (sp+24),r3
8003704: f8 00 01 0f calli 8003b40 <malloc>
if (dupname != NULL) {
8003708: 2b 82 00 1c lw r2,(sp+28)
800370c: 2b 83 00 18 lw r3,(sp+24)
8003710: 44 20 00 0a be r1,r0,8003738 <devFS_mknod+0xa8>
devFS_node *node = parentloc->node_access;
8003714: 29 c7 00 08 lw r7,(r14+8)
node->name = dupname;
8003718: 58 e1 00 00 sw (r7+0),r1
node->namelen = namelen;
800371c: 58 e3 00 04 sw (r7+4),r3
node->major = rtems_filesystem_dev_major_t(dev);
8003720: 58 ed 00 08 sw (r7+8),r13
node->minor = rtems_filesystem_dev_minor_t(dev);
8003724: 58 ec 00 0c sw (r7+12),r12
node->mode = mode;
8003728: 58 eb 00 10 sw (r7+16),r11
memcpy(dupname, name, namelen);
800372c: f8 00 2b 67 calli 800e4c8 <memcpy>
size_t namelen,
mode_t mode,
dev_t dev
)
{
int rv = 0;
8003730: 34 01 00 00 mvi r1,0
8003734: e0 00 00 0c bi 8003764 <devFS_mknod+0xd4>
node->major = rtems_filesystem_dev_major_t(dev);
node->minor = rtems_filesystem_dev_minor_t(dev);
node->mode = mode;
memcpy(dupname, name, namelen);
} else {
errno = ENOMEM;
8003738: f8 00 26 99 calli 800d19c <__errno>
800373c: 34 02 00 0c mvi r2,12
8003740: e0 00 00 07 bi 800375c <devFS_mknod+0xcc>
} else {
errno = ENOTSUP;
rv = -1;
}
} else {
if (!S_ISDIR(mode)) {
8003744: 21 6b f0 00 andi r11,r11,0xf000
8003748: 34 02 40 00 mvi r2,16384
size_t namelen,
mode_t mode,
dev_t dev
)
{
int rv = 0;
800374c: 34 01 00 00 mvi r1,0
} else {
errno = ENOTSUP;
rv = -1;
}
} else {
if (!S_ISDIR(mode)) {
8003750: 45 62 00 05 be r11,r2,8003764 <devFS_mknod+0xd4> <== ALWAYS TAKEN
errno = ENOTSUP;
8003754: f8 00 26 92 calli 800d19c <__errno>
8003758: 34 02 00 86 mvi r2,134
800375c: 58 22 00 00 sw (r1+0),r2
rv = -1;
8003760: 34 01 ff ff mvi r1,-1
}
}
return rv;
}
8003764: 2b 9d 00 04 lw ra,(sp+4)
8003768: 2b 8b 00 14 lw r11,(sp+20)
800376c: 2b 8c 00 10 lw r12,(sp+16)
8003770: 2b 8d 00 0c lw r13,(sp+12)
8003774: 2b 8e 00 08 lw r14,(sp+8)
8003778: 37 9c 00 1c addi sp,sp,28
800377c: c3 a0 00 00 ret
080014cc <disk_lock>:
*/
static volatile bool diskdevs_protected;
static rtems_status_code
disk_lock(void)
{
80014cc: 37 9c ff fc addi sp,sp,-4
80014d0: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
80014d4: 78 01 08 01 mvhi r1,0x801
80014d8: 38 21 a7 58 ori r1,r1,0xa758
80014dc: 28 21 00 00 lw r1,(r1+0)
80014e0: 34 02 00 00 mvi r2,0
80014e4: 34 03 00 00 mvi r3,0
80014e8: f8 00 0e 91 calli 8004f2c <rtems_semaphore_obtain>
if (sc == RTEMS_SUCCESSFUL) {
diskdevs_protected = true;
return RTEMS_SUCCESSFUL;
} else {
return RTEMS_NOT_CONFIGURED;
80014ec: 34 02 00 16 mvi r2,22
disk_lock(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc == RTEMS_SUCCESSFUL) {
80014f0: 5c 20 00 06 bne r1,r0,8001508 <disk_lock+0x3c> <== NEVER TAKEN
diskdevs_protected = true;
80014f4: 78 01 08 01 mvhi r1,0x801
80014f8: 34 02 00 01 mvi r2,1
80014fc: 38 21 a7 5c ori r1,r1,0xa75c
8001500: 30 22 00 00 sb (r1+0),r2
return RTEMS_SUCCESSFUL;
8001504: 34 02 00 00 mvi r2,0
} else {
return RTEMS_NOT_CONFIGURED;
}
}
8001508: b8 40 08 00 mv r1,r2
800150c: 2b 9d 00 04 lw ra,(sp+4)
8001510: 37 9c 00 04 addi sp,sp,4
8001514: c3 a0 00 00 ret
08001518 <disk_unlock>:
static void
disk_unlock(void)
{
8001518: 37 9c ff fc addi sp,sp,-4
800151c: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc = RTEMS_SUCCESSFUL;
diskdevs_protected = false;
8001520: 78 01 08 01 mvhi r1,0x801
8001524: 38 21 a7 5c ori r1,r1,0xa75c
8001528: 30 20 00 00 sb (r1+0),r0
sc = rtems_semaphore_release(diskdevs_mutex);
800152c: 78 01 08 01 mvhi r1,0x801
8001530: 38 21 a7 58 ori r1,r1,0xa758
8001534: 28 21 00 00 lw r1,(r1+0)
8001538: f8 00 0e cd calli 800506c <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL) {
800153c: 44 20 00 05 be r1,r0,8001550 <disk_unlock+0x38> <== ALWAYS TAKEN
/* FIXME: Error number */
rtems_fatal_error_occurred(0xdeadbeef);
8001540: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED
8001544: 38 42 88 bc ori r2,r2,0x88bc <== NOT EXECUTED
8001548: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED
800154c: f8 00 0f c5 calli 8005460 <rtems_fatal_error_occurred> <== NOT EXECUTED
}
}
8001550: 2b 9d 00 04 lw ra,(sp+4)
8001554: 37 9c 00 04 addi sp,sp,4
8001558: c3 a0 00 00 ret
08003e40 <drainOutput>:
/*
* Drain output queue
*/
static void
drainOutput (struct rtems_termios_tty *tty)
{
8003e40: 37 9c ff f0 addi sp,sp,-16
8003e44: 5b 8b 00 10 sw (sp+16),r11
8003e48: 5b 8c 00 0c sw (sp+12),r12
8003e4c: 5b 8d 00 08 sw (sp+8),r13
8003e50: 5b 9d 00 04 sw (sp+4),ra
8003e54: b8 20 58 00 mv r11,r1
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) {
8003e58: 28 21 00 b4 lw r1,(r1+180)
8003e5c: 44 20 00 17 be r1,r0,8003eb8 <drainOutput+0x78>
rtems_interrupt_disable (level);
8003e60: 90 00 08 00 rcsr r1,IE
8003e64: 34 02 ff fe mvi r2,-2
8003e68: a0 22 10 00 and r2,r1,r2
8003e6c: d0 02 00 00 wcsr IE,r2
while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) {
tty->rawOutBufState = rob_wait;
8003e70: 34 0d 00 02 mvi r13,2
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);
rtems_interrupt_disable (level);
8003e74: 34 0c ff fe mvi r12,-2
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) {
8003e78: e0 00 00 0c bi 8003ea8 <drainOutput+0x68>
tty->rawOutBufState = rob_wait;
8003e7c: 59 6d 00 94 sw (r11+148),r13 <== NOT EXECUTED
rtems_interrupt_enable (level);
8003e80: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED
sc = rtems_semaphore_obtain(
8003e84: 29 61 00 8c lw r1,(r11+140) <== NOT EXECUTED
8003e88: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
8003e8c: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
8003e90: f8 00 09 ab calli 800653c <rtems_semaphore_obtain> <== NOT EXECUTED
tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
8003e94: 44 20 00 02 be r1,r0,8003e9c <drainOutput+0x5c> <== NOT EXECUTED
rtems_fatal_error_occurred (sc);
8003e98: f8 00 0c 1d calli 8006f0c <rtems_fatal_error_occurred> <== NOT EXECUTED
rtems_interrupt_disable (level);
8003e9c: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED
8003ea0: a0 2c 10 00 and r2,r1,r12 <== NOT EXECUTED
8003ea4: d0 02 00 00 wcsr IE,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) {
8003ea8: 29 63 00 84 lw r3,(r11+132)
8003eac: 29 62 00 80 lw r2,(r11+128)
8003eb0: 5c 62 ff f3 bne r3,r2,8003e7c <drainOutput+0x3c> <== NEVER TAKEN
tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
rtems_interrupt_disable (level);
}
rtems_interrupt_enable (level);
8003eb4: d0 01 00 00 wcsr IE,r1
}
}
8003eb8: 2b 9d 00 04 lw ra,(sp+4)
8003ebc: 2b 8b 00 10 lw r11,(sp+16)
8003ec0: 2b 8c 00 0c lw r12,(sp+12)
8003ec4: 2b 8d 00 08 lw r13,(sp+8)
8003ec8: 37 9c 00 10 addi sp,sp,16
8003ecc: c3 a0 00 00 ret
08001ab0 <dup2>:
*/
int dup2(
int fildes,
int fildes2
)
{
8001ab0: 37 9c ff a4 addi sp,sp,-92
8001ab4: 5b 8b 00 14 sw (sp+20),r11
8001ab8: 5b 8c 00 10 sw (sp+16),r12
8001abc: 5b 8d 00 0c sw (sp+12),r13
8001ac0: 5b 8e 00 08 sw (sp+8),r14
8001ac4: 5b 9d 00 04 sw (sp+4),ra
/*
* If fildes is not valid, then fildes2 should not be closed.
*/
status = fstat( fildes, &buf );
8001ac8: 37 8d 00 18 addi r13,sp,24
*/
int dup2(
int fildes,
int fildes2
)
{
8001acc: b8 40 60 00 mv r12,r2
/*
* If fildes is not valid, then fildes2 should not be closed.
*/
status = fstat( fildes, &buf );
8001ad0: b9 a0 10 00 mv r2,r13
*/
int dup2(
int fildes,
int fildes2
)
{
8001ad4: b8 20 70 00 mv r14,r1
* If fildes is not valid, then fildes2 should not be closed.
*/
status = fstat( fildes, &buf );
if ( status == -1 )
return -1;
8001ad8: 34 0b ff ff mvi r11,-1
/*
* If fildes is not valid, then fildes2 should not be closed.
*/
status = fstat( fildes, &buf );
8001adc: f8 00 01 43 calli 8001fe8 <fstat>
if ( status == -1 )
8001ae0: 44 2b 00 0a be r1,r11,8001b08 <dup2+0x58>
/*
* If fildes2 is not valid, then we should not do anything either.
*/
status = fstat( fildes2, &buf );
8001ae4: b9 80 08 00 mv r1,r12
8001ae8: b9 a0 10 00 mv r2,r13
8001aec: f8 00 01 3f calli 8001fe8 <fstat>
if ( status == -1 )
8001af0: 44 2b 00 06 be r1,r11,8001b08 <dup2+0x58> <== NEVER TAKEN
/*
* This fcntl handles everything else.
*/
return fcntl( fildes, F_DUPFD, fildes2 );
8001af4: b9 c0 08 00 mv r1,r14
8001af8: 34 02 00 00 mvi r2,0
8001afc: b9 80 18 00 mv r3,r12
8001b00: f8 00 00 12 calli 8001b48 <fcntl>
8001b04: b8 20 58 00 mv r11,r1
}
8001b08: b9 60 08 00 mv r1,r11
8001b0c: 2b 9d 00 04 lw ra,(sp+4)
8001b10: 2b 8b 00 14 lw r11,(sp+20)
8001b14: 2b 8c 00 10 lw r12,(sp+16)
8001b18: 2b 8d 00 0c lw r13,(sp+12)
8001b1c: 2b 8e 00 08 lw r14,(sp+8)
8001b20: 37 9c 00 5c addi sp,sp,92
8001b24: c3 a0 00 00 ret
08004d04 <echo>:
/*
* Echo a typed character
*/
static void
echo (unsigned char c, struct rtems_termios_tty *tty)
{
8004d04: 37 9c ff f4 addi sp,sp,-12
8004d08: 5b 8b 00 08 sw (sp+8),r11
8004d0c: 5b 9d 00 04 sw (sp+4),ra
8004d10: b8 40 58 00 mv r11,r2
if ((tty->termios.c_lflag & ECHOCTL) &&
8004d14: 28 42 00 3c lw r2,(r2+60)
8004d18: 20 42 02 00 andi r2,r2,0x200
8004d1c: 44 40 00 19 be r2,r0,8004d80 <echo+0x7c> <== NEVER TAKEN
iscntrl(c) && (c != '\t') && (c != '\n')) {
8004d20: 78 02 08 02 mvhi r2,0x802
8004d24: 38 42 82 e0 ori r2,r2,0x82e0
8004d28: 28 42 00 00 lw r2,(r2+0)
8004d2c: 7c 23 00 09 cmpnei r3,r1,9
8004d30: b4 41 10 00 add r2,r2,r1
8004d34: 40 42 00 01 lbu r2,(r2+1)
8004d38: 20 42 00 20 andi r2,r2,0x20
* Echo a typed character
*/
static void
echo (unsigned char c, struct rtems_termios_tty *tty)
{
if ((tty->termios.c_lflag & ECHOCTL) &&
8004d3c: 7c 42 00 00 cmpnei r2,r2,0
iscntrl(c) && (c != '\t') && (c != '\n')) {
8004d40: a0 43 10 00 and r2,r2,r3
8004d44: 44 40 00 0f be r2,r0,8004d80 <echo+0x7c>
8004d48: 34 02 00 0a mvi r2,10
8004d4c: 44 22 00 0d be r1,r2,8004d80 <echo+0x7c>
char echobuf[2];
echobuf[0] = '^';
8004d50: 34 02 00 5e mvi r2,94
echobuf[1] = c ^ 0x40;
8004d54: 18 21 00 40 xori r1,r1,0x40
{
if ((tty->termios.c_lflag & ECHOCTL) &&
iscntrl(c) && (c != '\t') && (c != '\n')) {
char echobuf[2];
echobuf[0] = '^';
8004d58: 33 82 00 0c sb (sp+12),r2
echobuf[1] = c ^ 0x40;
8004d5c: 33 81 00 0d sb (sp+13),r1
rtems_termios_puts (echobuf, 2, tty);
8004d60: 34 02 00 02 mvi r2,2
8004d64: 37 81 00 0c addi r1,sp,12
8004d68: b9 60 18 00 mv r3,r11
8004d6c: fb ff ff 37 calli 8004a48 <rtems_termios_puts>
tty->column += 2;
8004d70: 29 61 00 28 lw r1,(r11+40)
8004d74: 34 21 00 02 addi r1,r1,2
8004d78: 59 61 00 28 sw (r11+40),r1
*/
static void
echo (unsigned char c, struct rtems_termios_tty *tty)
{
if ((tty->termios.c_lflag & ECHOCTL) &&
iscntrl(c) && (c != '\t') && (c != '\n')) {
8004d7c: e0 00 00 03 bi 8004d88 <echo+0x84>
echobuf[0] = '^';
echobuf[1] = c ^ 0x40;
rtems_termios_puts (echobuf, 2, tty);
tty->column += 2;
} else {
oproc (c, tty);
8004d80: b9 60 10 00 mv r2,r11
8004d84: fb ff ff 84 calli 8004b94 <oproc>
}
}
8004d88: 2b 9d 00 04 lw ra,(sp+4)
8004d8c: 2b 8b 00 08 lw r11,(sp+8)
8004d90: 37 9c 00 0c addi sp,sp,12
8004d94: c3 a0 00 00 ret
08023ecc <endgrent>:
void endgrent(void)
{
8023ecc: 37 9c ff fc addi sp,sp,-4
8023ed0: 5b 9d 00 04 sw (sp+4),ra
if (group_fp != NULL)
8023ed4: 78 01 08 06 mvhi r1,0x806
8023ed8: 38 21 9a 8c ori r1,r1,0x9a8c
8023edc: 28 21 00 00 lw r1,(r1+0)
8023ee0: 44 20 00 02 be r1,r0,8023ee8 <endgrent+0x1c> <== NEVER TAKEN
fclose(group_fp);
8023ee4: f8 00 54 02 calli 8038eec <fclose>
}
8023ee8: 2b 9d 00 04 lw ra,(sp+4)
8023eec: 37 9c 00 04 addi sp,sp,4
8023ef0: c3 a0 00 00 ret
08023d04 <endpwent>:
void endpwent(void)
{
8023d04: 37 9c ff fc addi sp,sp,-4
8023d08: 5b 9d 00 04 sw (sp+4),ra
if (passwd_fp != NULL)
8023d0c: 78 01 08 06 mvhi r1,0x806
8023d10: 38 21 9b 68 ori r1,r1,0x9b68
8023d14: 28 21 00 00 lw r1,(r1+0)
8023d18: 44 20 00 02 be r1,r0,8023d20 <endpwent+0x1c> <== NEVER TAKEN
fclose(passwd_fp);
8023d1c: f8 00 54 74 calli 8038eec <fclose>
}
8023d20: 2b 9d 00 04 lw ra,(sp+4)
8023d24: 37 9c 00 04 addi sp,sp,4
8023d28: c3 a0 00 00 ret
08004d98 <erase>:
* 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)
{
8004d98: 37 9c ff e0 addi sp,sp,-32
8004d9c: 5b 8b 00 20 sw (sp+32),r11
8004da0: 5b 8c 00 1c sw (sp+28),r12
8004da4: 5b 8d 00 18 sw (sp+24),r13
8004da8: 5b 8e 00 14 sw (sp+20),r14
8004dac: 5b 8f 00 10 sw (sp+16),r15
8004db0: 5b 90 00 0c sw (sp+12),r16
8004db4: 5b 91 00 08 sw (sp+8),r17
8004db8: 5b 9d 00 04 sw (sp+4),ra
8004dbc: b8 20 58 00 mv r11,r1
if (tty->ccount == 0)
8004dc0: 28 21 00 20 lw r1,(r1+32)
* 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)
{
8004dc4: b8 40 78 00 mv r15,r2
if (tty->ccount == 0)
8004dc8: 44 20 00 6c be r1,r0,8004f78 <erase+0x1e0>
return;
if (lineFlag) {
8004dcc: 44 40 00 62 be r2,r0,8004f54 <erase+0x1bc>
if (!(tty->termios.c_lflag & ECHO)) {
8004dd0: 29 6c 00 3c lw r12,(r11+60)
8004dd4: 21 81 00 08 andi r1,r12,0x8
8004dd8: 5c 20 00 03 bne r1,r0,8004de4 <erase+0x4c> <== ALWAYS TAKEN
tty->ccount = 0;
8004ddc: 59 60 00 20 sw (r11+32),r0 <== NOT EXECUTED
return;
8004de0: e0 00 00 66 bi 8004f78 <erase+0x1e0> <== NOT EXECUTED
}
if (!(tty->termios.c_lflag & ECHOE)) {
8004de4: 21 8c 00 10 andi r12,r12,0x10
8004de8: 5d 80 00 5b bne r12,r0,8004f54 <erase+0x1bc> <== ALWAYS TAKEN
tty->ccount = 0;
echo (tty->termios.c_cc[VKILL], tty);
8004dec: 41 61 00 44 lbu r1,(r11+68) <== NOT EXECUTED
if (!(tty->termios.c_lflag & ECHO)) {
tty->ccount = 0;
return;
}
if (!(tty->termios.c_lflag & ECHOE)) {
tty->ccount = 0;
8004df0: 59 60 00 20 sw (r11+32),r0 <== NOT EXECUTED
echo (tty->termios.c_cc[VKILL], tty);
8004df4: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
8004df8: fb ff ff c3 calli 8004d04 <echo> <== NOT EXECUTED
if (tty->termios.c_lflag & ECHOK)
8004dfc: 29 61 00 3c lw r1,(r11+60) <== NOT EXECUTED
8004e00: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED
8004e04: 44 2c 00 5d be r1,r12,8004f78 <erase+0x1e0> <== NOT EXECUTED
echo ('\n', tty);
8004e08: 34 01 00 0a mvi r1,10 <== NOT EXECUTED
8004e0c: e0 00 00 0d bi 8004e40 <erase+0xa8> <== NOT EXECUTED
return;
}
}
while (tty->ccount) {
unsigned char c = tty->cbuf[--tty->ccount];
8004e10: 29 64 00 1c lw r4,(r11+28)
8004e14: 34 21 ff ff addi r1,r1,-1
8004e18: 59 61 00 20 sw (r11+32),r1
8004e1c: b4 81 10 00 add r2,r4,r1
8004e20: 40 4c 00 00 lbu r12,(r2+0)
if (tty->termios.c_lflag & ECHO) {
8004e24: 29 62 00 3c lw r2,(r11+60)
8004e28: 20 43 00 08 andi r3,r2,0x8
8004e2c: 44 60 00 48 be r3,r0,8004f4c <erase+0x1b4> <== NEVER TAKEN
if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
8004e30: 5d e0 00 07 bne r15,r0,8004e4c <erase+0xb4>
8004e34: 20 43 00 10 andi r3,r2,0x10
8004e38: 5c 6f 00 05 bne r3,r15,8004e4c <erase+0xb4> <== ALWAYS TAKEN
echo (tty->termios.c_cc[VERASE], tty);
8004e3c: 41 61 00 43 lbu r1,(r11+67) <== NOT EXECUTED
8004e40: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
8004e44: fb ff ff b0 calli 8004d04 <echo> <== NOT EXECUTED
8004e48: e0 00 00 4c bi 8004f78 <erase+0x1e0> <== NOT EXECUTED
} else if (c == '\t') {
8004e4c: 5d 91 00 20 bne r12,r17,8004ecc <erase+0x134>
int col = tty->read_start_column;
8004e50: 29 6c 00 2c lw r12,(r11+44)
*/
while (i != tty->ccount) {
c = tty->cbuf[i++];
if (c == '\t') {
col = (col | 7) + 1;
} else if (iscntrl (c)) {
8004e54: 29 a6 00 00 lw r6,(r13+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;
int i = 0;
8004e58: 34 03 00 00 mvi r3,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)
8004e5c: 20 42 02 00 andi r2,r2,0x200
int i = 0;
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
8004e60: e0 00 00 0f bi 8004e9c <erase+0x104>
* Erase a character or line
* 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)
8004e64: b4 83 28 00 add r5,r4,r3
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
c = tty->cbuf[i++];
8004e68: 40 a5 00 00 lbu r5,(r5+0)
8004e6c: 34 63 00 01 addi r3,r3,1
if (c == '\t') {
8004e70: 5c b1 00 03 bne r5,r17,8004e7c <erase+0xe4>
col = (col | 7) + 1;
8004e74: 39 8c 00 07 ori r12,r12,0x7
8004e78: e0 00 00 08 bi 8004e98 <erase+0x100>
} else if (iscntrl (c)) {
8004e7c: b4 c5 28 00 add r5,r6,r5
8004e80: 40 a5 00 01 lbu r5,(r5+1)
8004e84: 20 a5 00 20 andi r5,r5,0x20
8004e88: 44 a0 00 04 be r5,r0,8004e98 <erase+0x100> <== ALWAYS TAKEN
if (tty->termios.c_lflag & ECHOCTL)
8004e8c: 44 40 00 04 be r2,r0,8004e9c <erase+0x104> <== NOT EXECUTED
col += 2;
8004e90: 35 8c 00 02 addi r12,r12,2 <== NOT EXECUTED
8004e94: e0 00 00 02 bi 8004e9c <erase+0x104> <== NOT EXECUTED
} else {
col++;
8004e98: 35 8c 00 01 addi r12,r12,1
int i = 0;
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
8004e9c: 5c 61 ff f2 bne r3,r1,8004e64 <erase+0xcc>
8004ea0: e0 00 00 08 bi 8004ec0 <erase+0x128>
/*
* Back up over the tab
*/
while (tty->column > col) {
rtems_termios_puts ("\b", 1, tty);
8004ea4: ba 00 08 00 mv r1,r16
8004ea8: 34 02 00 01 mvi r2,1
8004eac: b9 60 18 00 mv r3,r11
8004eb0: fb ff fe e6 calli 8004a48 <rtems_termios_puts>
tty->column--;
8004eb4: 29 61 00 28 lw r1,(r11+40)
8004eb8: 34 21 ff ff addi r1,r1,-1
8004ebc: 59 61 00 28 sw (r11+40),r1
}
/*
* Back up over the tab
*/
while (tty->column > col) {
8004ec0: 29 61 00 28 lw r1,(r11+40)
8004ec4: 48 2c ff f8 bg r1,r12,8004ea4 <erase+0x10c>
8004ec8: e0 00 00 21 bi 8004f4c <erase+0x1b4>
rtems_termios_puts ("\b", 1, tty);
tty->column--;
}
}
else {
if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) {
8004ecc: 29 a1 00 00 lw r1,(r13+0)
8004ed0: 35 8c 00 01 addi r12,r12,1
8004ed4: b4 2c 08 00 add r1,r1,r12
8004ed8: 40 21 00 00 lbu r1,(r1+0)
8004edc: 20 21 00 20 andi r1,r1,0x20
8004ee0: 44 20 00 0b be r1,r0,8004f0c <erase+0x174> <== ALWAYS TAKEN
8004ee4: 20 42 02 00 andi r2,r2,0x200 <== NOT EXECUTED
8004ee8: 44 40 00 09 be r2,r0,8004f0c <erase+0x174> <== NOT EXECUTED
rtems_termios_puts ("\b \b", 3, tty);
8004eec: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
8004ef0: 34 02 00 03 mvi r2,3 <== NOT EXECUTED
8004ef4: b9 60 18 00 mv r3,r11 <== NOT EXECUTED
8004ef8: fb ff fe d4 calli 8004a48 <rtems_termios_puts> <== NOT EXECUTED
if (tty->column)
8004efc: 29 61 00 28 lw r1,(r11+40) <== NOT EXECUTED
8004f00: 44 20 00 03 be r1,r0,8004f0c <erase+0x174> <== NOT EXECUTED
tty->column--;
8004f04: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED
8004f08: 59 61 00 28 sw (r11+40),r1 <== NOT EXECUTED
}
if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) {
8004f0c: 29 a1 00 00 lw r1,(r13+0)
8004f10: b4 2c 60 00 add r12,r1,r12
8004f14: 41 81 00 00 lbu r1,(r12+0)
8004f18: 20 21 00 20 andi r1,r1,0x20
8004f1c: 44 20 00 04 be r1,r0,8004f2c <erase+0x194> <== ALWAYS TAKEN
8004f20: 29 61 00 3c lw r1,(r11+60) <== NOT EXECUTED
8004f24: 20 21 02 00 andi r1,r1,0x200 <== NOT EXECUTED
8004f28: 44 20 00 09 be r1,r0,8004f4c <erase+0x1b4> <== NOT EXECUTED
rtems_termios_puts ("\b \b", 3, tty);
8004f2c: b9 c0 08 00 mv r1,r14
8004f30: 34 02 00 03 mvi r2,3
8004f34: b9 60 18 00 mv r3,r11
8004f38: fb ff fe c4 calli 8004a48 <rtems_termios_puts>
if (tty->column)
8004f3c: 29 61 00 28 lw r1,(r11+40)
8004f40: 44 20 00 03 be r1,r0,8004f4c <erase+0x1b4> <== NEVER TAKEN
tty->column--;
8004f44: 34 21 ff ff addi r1,r1,-1
8004f48: 59 61 00 28 sw (r11+40),r1
}
}
}
if (!lineFlag)
8004f4c: 5d e0 00 09 bne r15,r0,8004f70 <erase+0x1d8>
8004f50: e0 00 00 0a bi 8004f78 <erase+0x1e0>
8004f54: 78 0d 08 02 mvhi r13,0x802
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);
8004f58: 78 0e 08 02 mvhi r14,0x802
/*
* Back up over the tab
*/
while (tty->column > col) {
rtems_termios_puts ("\b", 1, tty);
8004f5c: 78 10 08 02 mvhi r16,0x802
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);
} else if (c == '\t') {
8004f60: 34 11 00 09 mvi r17,9
8004f64: 39 ad 82 e0 ori r13,r13,0x82e0
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);
8004f68: 39 ce 54 7c ori r14,r14,0x547c
/*
* Back up over the tab
*/
while (tty->column > col) {
rtems_termios_puts ("\b", 1, tty);
8004f6c: 3a 10 54 78 ori r16,r16,0x5478
echo ('\n', tty);
return;
}
}
while (tty->ccount) {
8004f70: 29 61 00 20 lw r1,(r11+32)
8004f74: 5c 20 ff a7 bne r1,r0,8004e10 <erase+0x78>
}
}
if (!lineFlag)
break;
}
}
8004f78: 2b 9d 00 04 lw ra,(sp+4)
8004f7c: 2b 8b 00 20 lw r11,(sp+32)
8004f80: 2b 8c 00 1c lw r12,(sp+28)
8004f84: 2b 8d 00 18 lw r13,(sp+24)
8004f88: 2b 8e 00 14 lw r14,(sp+20)
8004f8c: 2b 8f 00 10 lw r15,(sp+16)
8004f90: 2b 90 00 0c lw r16,(sp+12)
8004f94: 2b 91 00 08 lw r17,(sp+8)
8004f98: 37 9c 00 20 addi sp,sp,32
8004f9c: c3 a0 00 00 ret
0801007c <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)
{
801007c: 37 9c ff e0 addi sp,sp,-32
8010080: 5b 8b 00 20 sw (sp+32),r11
8010084: 5b 8c 00 1c sw (sp+28),r12
8010088: 5b 8d 00 18 sw (sp+24),r13
801008c: 5b 8e 00 14 sw (sp+20),r14
8010090: 5b 8f 00 10 sw (sp+16),r15
8010094: 5b 90 00 0c sw (sp+12),r16
8010098: 5b 91 00 08 sw (sp+8),r17
801009c: 5b 9d 00 04 sw (sp+4),ra
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);
80100a0: 40 2e 00 02 lbu r14,(r1+2)
80100a4: 40 2f 00 0c lbu r15,(r1+12)
80100a8: b8 20 58 00 mv r11,r1
80100ac: b8 40 60 00 mv r12,r2
80100b0: c9 ee 78 00 sub r15,r15,r14
80100b4: b8 40 08 00 mv r1,r2
80100b8: b9 e0 10 00 mv r2,r15
80100bc: b8 60 88 00 mv r17,r3
80100c0: b8 80 80 00 mv r16,r4
80100c4: f8 00 74 e5 calli 802d458 <__lshrsi3>
80100c8: b8 20 68 00 mv r13,r1
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)
80100cc: 41 61 00 89 lbu r1,(r11+137)
80100d0: 44 20 00 03 be r1,r0,80100dc <fat_buf_access+0x60>
80100d4: 29 61 00 84 lw r1,(r11+132)
80100d8: 44 2c 00 16 be r1,r12,8010130 <fat_buf_access+0xb4>
{
fat_buf_release(fs_info);
80100dc: b9 60 08 00 mv r1,r11
80100e0: fb ff ff 69 calli 800fe84 <fat_buf_release>
if (op_type == FAT_OP_TYPE_READ)
80100e4: 34 02 00 01 mvi r2,1
80100e8: 29 61 00 64 lw r1,(r11+100)
80100ec: 35 63 00 8c addi r3,r11,140
80100f0: 5e 22 00 04 bne r17,r2,8010100 <fat_buf_access+0x84>
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf);
80100f4: b9 a0 10 00 mv r2,r13
80100f8: fb ff f6 65 calli 800da8c <rtems_bdbuf_read>
80100fc: e0 00 00 03 bi 8010108 <fat_buf_access+0x8c>
else
sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf);
8010100: b9 a0 10 00 mv r2,r13
8010104: fb ff f6 23 calli 800d990 <rtems_bdbuf_get>
if (sc != RTEMS_SUCCESSFUL)
8010108: 44 20 00 06 be r1,r0,8010120 <fat_buf_access+0xa4> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EIO);
801010c: f8 00 2a d2 calli 801ac54 <__errno> <== NOT EXECUTED
8010110: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
8010114: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
8010118: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
801011c: e0 00 00 10 bi 801015c <fat_buf_access+0xe0> <== NOT EXECUTED
fs_info->c.blk_num = sec_num;
fs_info->c.modified = 0;
fs_info->c.state = FAT_CACHE_ACTUAL;
8010120: 34 01 00 01 mvi r1,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;
8010124: 59 6c 00 84 sw (r11+132),r12
fs_info->c.modified = 0;
8010128: 31 60 00 88 sb (r11+136),r0
fs_info->c.state = FAT_CACHE_ACTUAL;
801012c: 31 61 00 89 sb (r11+137),r1
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);
8010130: b9 e0 10 00 mv r2,r15
8010134: b9 a0 08 00 mv r1,r13
8010138: fb ff c4 2c calli 80011e8 <__ashlsi3>
}
*sec_buf = &fs_info->c.buf->buffer[blk_ofs];
801013c: 29 6b 00 8c lw r11,(r11+140)
{
return sector_offset +
((sector -
fat_block_num_to_sector_num (fs_info,
fat_sector_num_to_block_num (fs_info, sector)))
<< fs_info->vol.sec_log2);
8010140: b9 c0 10 00 mv r2,r14
8010144: c9 81 08 00 sub r1,r12,r1
8010148: fb ff c4 28 calli 80011e8 <__ashlsi3>
801014c: 29 62 00 1c lw r2,(r11+28)
8010150: b4 41 08 00 add r1,r2,r1
8010154: 5a 01 00 00 sw (r16+0),r1
return RC_OK;
8010158: 34 01 00 00 mvi r1,0
}
801015c: 2b 9d 00 04 lw ra,(sp+4)
8010160: 2b 8b 00 20 lw r11,(sp+32)
8010164: 2b 8c 00 1c lw r12,(sp+28)
8010168: 2b 8d 00 18 lw r13,(sp+24)
801016c: 2b 8e 00 14 lw r14,(sp+20)
8010170: 2b 8f 00 10 lw r15,(sp+16)
8010174: 2b 90 00 0c lw r16,(sp+12)
8010178: 2b 91 00 08 lw r17,(sp+8)
801017c: 37 9c 00 20 addi sp,sp,32
8010180: c3 a0 00 00 ret
0800fe84 <fat_buf_release>:
return RC_OK;
}
int
fat_buf_release(fat_fs_info_t *fs_info)
{
800fe84: 37 9c ff d8 addi sp,sp,-40
800fe88: 5b 8b 00 24 sw (sp+36),r11
800fe8c: 5b 8c 00 20 sw (sp+32),r12
800fe90: 5b 8d 00 1c sw (sp+28),r13
800fe94: 5b 8e 00 18 sw (sp+24),r14
800fe98: 5b 8f 00 14 sw (sp+20),r15
800fe9c: 5b 90 00 10 sw (sp+16),r16
800fea0: 5b 91 00 0c sw (sp+12),r17
800fea4: 5b 92 00 08 sw (sp+8),r18
800fea8: 5b 9d 00 04 sw (sp+4),ra
800feac: b8 20 58 00 mv r11,r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (fs_info->c.state == FAT_CACHE_EMPTY)
800feb0: 40 21 00 89 lbu r1,(r1+137)
return RC_OK;
800feb4: 34 0c 00 00 mvi r12,0
int
fat_buf_release(fat_fs_info_t *fs_info)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (fs_info->c.state == FAT_CACHE_EMPTY)
800feb8: 44 20 00 65 be r1,r0,801004c <fat_buf_release+0x1c8>
return RC_OK;
if (fs_info->c.modified)
800febc: 41 61 00 88 lbu r1,(r11+136)
800fec0: 44 20 00 5b be r1,r0,801002c <fat_buf_release+0x1a8>
{
uint32_t sec_num = fs_info->c.blk_num;
800fec4: 29 6c 00 84 lw r12,(r11+132)
bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) &&
800fec8: 2d 61 00 18 lhu r1,(r11+24)
800fecc: 34 0d 00 00 mvi r13,0
800fed0: 54 2c 00 03 bgu r1,r12,800fedc <fat_buf_release+0x58>
800fed4: 29 6d 00 20 lw r13,(r11+32)
800fed8: f5 ac 68 00 cmpgu r13,r13,r12
800fedc: 21 ad 00 ff andi r13,r13,0xff
uint32_t ino
)
{
return (ino >= fs_info->uino_base);
}
800fee0: 41 6e 00 02 lbu r14,(r11+2)
800fee4: 41 6f 00 0c lbu r15,(r11+12)
uint32_t blk = fat_sector_num_to_block_num(fs_info, sec_num);
uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info,
sec_num,
0);
if (sec_of_fat && !fs_info->vol.mirror)
800fee8: 45 a0 00 14 be r13,r0,800ff38 <fat_buf_release+0xb4>
800feec: 41 61 00 54 lbu r1,(r11+84)
800fef0: 5c 20 00 12 bne r1,r0,800ff38 <fat_buf_release+0xb4> <== NEVER TAKEN
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);
800fef4: c9 ee 78 00 sub r15,r15,r14
800fef8: b9 e0 10 00 mv r2,r15
800fefc: b9 80 08 00 mv r1,r12
800ff00: f8 00 75 56 calli 802d458 <__lshrsi3>
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);
800ff04: b9 e0 10 00 mv r2,r15
800ff08: fb ff c4 b8 calli 80011e8 <__ashlsi3>
memcpy(fs_info->sec_buf,
fs_info->c.buf->buffer + blk_ofs,
800ff0c: 29 72 00 8c lw r18,(r11+140)
{
return sector_offset +
((sector -
fat_block_num_to_sector_num (fs_info,
fat_sector_num_to_block_num (fs_info, sector)))
<< fs_info->vol.sec_log2);
800ff10: b9 c0 10 00 mv r2,r14
800ff14: c9 81 08 00 sub r1,r12,r1
800ff18: fb ff c4 b4 calli 80011e8 <__ashlsi3>
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,
800ff1c: 29 71 00 90 lw r17,(r11+144)
800ff20: 2d 70 00 00 lhu r16,(r11+0)
800ff24: 2a 42 00 1c lw r2,(r18+28)
800ff28: ba 00 18 00 mv r3,r16
800ff2c: b4 41 10 00 add r2,r2,r1
800ff30: ba 20 08 00 mv r1,r17
800ff34: f8 00 2e 96 calli 801b98c <memcpy>
fs_info->c.buf->buffer + blk_ofs,
fs_info->vol.bps);
sc = rtems_bdbuf_release_modified(fs_info->c.buf);
800ff38: 29 61 00 8c lw r1,(r11+140)
800ff3c: fb ff f7 93 calli 800dd88 <rtems_bdbuf_release_modified>
if (sc != RTEMS_SUCCESSFUL)
800ff40: 5c 20 00 3e bne r1,r0,8010038 <fat_buf_release+0x1b4> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one(EIO);
fs_info->c.modified = 0;
800ff44: 31 60 00 88 sb (r11+136),r0
if (sec_of_fat && !fs_info->vol.mirror)
800ff48: 45 a1 00 3f be r13,r1,8010044 <fat_buf_release+0x1c0>
800ff4c: 41 61 00 54 lbu r1,(r11+84)
800ff50: 34 0c 00 01 mvi r12,1
800ff54: 44 20 00 33 be r1,r0,8010020 <fat_buf_release+0x19c> <== ALWAYS TAKEN
800ff58: e0 00 00 3b bi 8010044 <fat_buf_release+0x1c0> <== NOT EXECUTED
for (i = 1; i < fs_info->vol.fats; i++)
{
rtems_bdbuf_buffer *bd;
sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i,
800ff5c: 29 62 00 1c lw r2,(r11+28)
800ff60: b9 80 08 00 mv r1,r12
800ff64: fb ff c4 ef calli 8001320 <__mulsi3>
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);
800ff68: 41 6e 00 02 lbu r14,(r11+2)
800ff6c: 29 6f 00 84 lw r15,(r11+132)
800ff70: 41 70 00 0c lbu r16,(r11+12)
800ff74: b4 2f 78 00 add r15,r1,r15
800ff78: ca 0e 80 00 sub r16,r16,r14
800ff7c: ba 00 10 00 mv r2,r16
800ff80: b9 e0 08 00 mv r1,r15
800ff84: f8 00 75 35 calli 802d458 <__lshrsi3>
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);
800ff88: ba 00 10 00 mv r2,r16
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);
800ff8c: b8 20 68 00 mv r13,r1
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);
800ff90: fb ff c4 96 calli 80011e8 <__ashlsi3>
{
return sector_offset +
((sector -
fat_block_num_to_sector_num (fs_info,
fat_sector_num_to_block_num (fs_info, sector)))
<< fs_info->vol.sec_log2);
800ff94: b9 c0 10 00 mv r2,r14
800ff98: c9 e1 08 00 sub r1,r15,r1
800ff9c: fb ff c4 93 calli 80011e8 <__ashlsi3>
800ffa0: b8 20 70 00 mv r14,r1
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
800ffa4: 5c 20 00 09 bne r1,r0,800ffc8 <fat_buf_release+0x144>
&& fs_info->vol.bps == fs_info->vol.bytes_per_block)
800ffa8: 2d 62 00 00 lhu r2,(r11+0)
800ffac: 2d 61 00 0a lhu r1,(r11+10)
800ffb0: 5c 41 00 06 bne r2,r1,800ffc8 <fat_buf_release+0x144>
{
sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd);
800ffb4: 29 61 00 64 lw r1,(r11+100)
800ffb8: b9 a0 10 00 mv r2,r13
800ffbc: 37 83 00 28 addi r3,sp,40
800ffc0: fb ff f6 74 calli 800d990 <rtems_bdbuf_get>
800ffc4: e0 00 00 05 bi 800ffd8 <fat_buf_release+0x154>
}
else
{
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd);
800ffc8: 29 61 00 64 lw r1,(r11+100)
800ffcc: b9 a0 10 00 mv r2,r13
800ffd0: 37 83 00 28 addi r3,sp,40
800ffd4: fb ff f6 ae calli 800da8c <rtems_bdbuf_read>
800ffd8: b8 20 68 00 mv r13,r1
}
if ( sc != RTEMS_SUCCESSFUL)
800ffdc: 44 20 00 06 be r1,r0,800fff4 <fat_buf_release+0x170> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(ENOMEM);
800ffe0: f8 00 2b 1d calli 801ac54 <__errno> <== NOT EXECUTED
800ffe4: 34 02 00 0c mvi r2,12 <== NOT EXECUTED
800ffe8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
800ffec: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
800fff0: e0 00 00 17 bi 801004c <fat_buf_release+0x1c8> <== NOT EXECUTED
memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps);
800fff4: 2b 81 00 28 lw r1,(sp+40)
800fff8: 29 62 00 90 lw r2,(r11+144)
800fffc: 2d 63 00 00 lhu r3,(r11+0)
8010000: 28 21 00 1c lw r1,(r1+28)
8010004: b4 2e 08 00 add r1,r1,r14
8010008: f8 00 2e 61 calli 801b98c <memcpy>
sc = rtems_bdbuf_release_modified(bd);
801000c: 2b 81 00 28 lw r1,(sp+40)
8010010: fb ff f7 5e calli 800dd88 <rtems_bdbuf_release_modified>
if ( sc != RTEMS_SUCCESSFUL)
8010014: 5c 2d ff f3 bne r1,r13,800ffe0 <fat_buf_release+0x15c> <== NEVER TAKEN
if (sec_of_fat && !fs_info->vol.mirror)
{
uint8_t i;
for (i = 1; i < fs_info->vol.fats; i++)
8010018: 35 8c 00 01 addi r12,r12,1
801001c: 21 8c 00 ff andi r12,r12,0xff
8010020: 41 61 00 0d lbu r1,(r11+13)
8010024: 54 2c ff ce bgu r1,r12,800ff5c <fat_buf_release+0xd8>
8010028: e0 00 00 07 bi 8010044 <fat_buf_release+0x1c0>
}
}
}
else
{
sc = rtems_bdbuf_release(fs_info->c.buf);
801002c: 29 61 00 8c lw r1,(r11+140)
8010030: fb ff f7 21 calli 800dcb4 <rtems_bdbuf_release>
if (sc != RTEMS_SUCCESSFUL)
8010034: 44 2c 00 04 be r1,r12,8010044 <fat_buf_release+0x1c0> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EIO);
8010038: f8 00 2b 07 calli 801ac54 <__errno> <== NOT EXECUTED
801003c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
8010040: e3 ff ff ea bi 800ffe8 <fat_buf_release+0x164> <== NOT EXECUTED
}
fs_info->c.state = FAT_CACHE_EMPTY;
8010044: 31 60 00 89 sb (r11+137),r0
return RC_OK;
8010048: 34 0c 00 00 mvi r12,0
}
801004c: b9 80 08 00 mv r1,r12
8010050: 2b 9d 00 04 lw ra,(sp+4)
8010054: 2b 8b 00 24 lw r11,(sp+36)
8010058: 2b 8c 00 20 lw r12,(sp+32)
801005c: 2b 8d 00 1c lw r13,(sp+28)
8010060: 2b 8e 00 18 lw r14,(sp+24)
8010064: 2b 8f 00 14 lw r15,(sp+20)
8010068: 2b 90 00 10 lw r16,(sp+16)
801006c: 2b 91 00 0c lw r17,(sp+12)
8010070: 2b 92 00 08 lw r18,(sp+8)
8010074: 37 9c 00 28 addi sp,sp,40
8010078: c3 a0 00 00 ret
08016444 <fat_cluster_num_to_sector_num>:
static inline uint32_t
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
8016444: 37 9c ff f8 addi sp,sp,-8
8016448: 5b 8b 00 08 sw (sp+8),r11
801644c: 5b 9d 00 04 sw (sp+4),ra
8016450: b8 20 58 00 mv r11,r1
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
8016454: 5c 40 00 06 bne r2,r0,801646c <fat_cluster_num_to_sector_num+0x28>
8016458: 40 21 00 0e lbu r1,(r1+14)
801645c: 20 21 00 03 andi r1,r1,0x3
8016460: 44 22 00 03 be r1,r2,801646c <fat_cluster_num_to_sector_num+0x28><== NEVER TAKEN
return fs_info->vol.rdir_loc;
8016464: 29 61 00 20 lw r1,(r11+32)
8016468: e0 00 00 06 bi 8016480 <fat_cluster_num_to_sector_num+0x3c>
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
801646c: 34 41 ff fe addi r1,r2,-2
8016470: 41 62 00 05 lbu r2,(r11+5)
8016474: fb ff ab 5d calli 80011e8 <__ashlsi3>
8016478: 29 62 00 34 lw r2,(r11+52)
801647c: b4 22 08 00 add r1,r1,r2
fs_info->vol.data_fsec);
}
8016480: 2b 9d 00 04 lw ra,(sp+4)
8016484: 2b 8b 00 08 lw r11,(sp+8)
8016488: 37 9c 00 08 addi sp,sp,8
801648c: c3 a0 00 00 ret
08010334 <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)
{
8010334: 37 9c ff d0 addi sp,sp,-48
8010338: 5b 8b 00 2c sw (sp+44),r11
801033c: 5b 8c 00 28 sw (sp+40),r12
8010340: 5b 8d 00 24 sw (sp+36),r13
8010344: 5b 8e 00 20 sw (sp+32),r14
8010348: 5b 8f 00 1c sw (sp+28),r15
801034c: 5b 90 00 18 sw (sp+24),r16
8010350: 5b 91 00 14 sw (sp+20),r17
8010354: 5b 92 00 10 sw (sp+16),r18
8010358: 5b 93 00 0c sw (sp+12),r19
801035c: 5b 94 00 08 sw (sp+8),r20
8010360: 5b 9d 00 04 sw (sp+4),ra
8010364: b8 20 58 00 mv r11,r1
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
8010368: 2c 21 00 06 lhu r1,(r1+6)
fat_fs_info_t *fs_info,
const uint32_t start_cln,
const uint32_t offset,
const uint32_t count,
const uint8_t pattern)
{
801036c: b8 60 88 00 mv r17,r3
8010370: 20 b4 00 ff andi r20,r5,0xff
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
8010374: c8 23 08 00 sub r1,r1,r3
8010378: b8 80 60 00 mv r12,r4
801037c: 50 24 00 02 bgeu r1,r4,8010384 <fat_cluster_set+0x50> <== ALWAYS TAKEN
8010380: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
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)) )
8010384: 5c 40 00 0b bne r2,r0,80103b0 <fat_cluster_set+0x7c> <== ALWAYS TAKEN
8010388: 41 61 00 0e lbu r1,(r11+14) <== NOT EXECUTED
801038c: 20 21 00 03 andi r1,r1,0x3 <== NOT EXECUTED
8010390: 44 22 00 08 be r1,r2,80103b0 <fat_cluster_set+0x7c> <== NOT EXECUTED
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);
8010394: 41 64 00 0c lbu r4,(r11+12) <== NOT EXECUTED
8010398: 41 63 00 02 lbu r3,(r11+2) <== NOT EXECUTED
801039c: 29 61 00 20 lw r1,(r11+32) <== NOT EXECUTED
80103a0: c8 83 10 00 sub r2,r4,r3 <== NOT EXECUTED
80103a4: f8 00 74 2d calli 802d458 <__lshrsi3> <== NOT EXECUTED
80103a8: b8 20 80 00 mv r16,r1 <== NOT EXECUTED
80103ac: e0 00 00 0c bi 80103dc <fat_cluster_set+0xa8> <== 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);
80103b0: 41 63 00 08 lbu r3,(r11+8)
80103b4: 41 6d 00 0c lbu r13,(r11+12)
80103b8: 34 41 ff fe addi r1,r2,-2
80103bc: c8 6d 10 00 sub r2,r3,r13
80103c0: fb ff c3 8a calli 80011e8 <__ashlsi3>
80103c4: 41 63 00 02 lbu r3,(r11+2)
80103c8: b8 20 80 00 mv r16,r1
80103cc: 29 61 00 34 lw r1,(r11+52)
80103d0: c9 a3 10 00 sub r2,r13,r3
80103d4: f8 00 74 21 calli 802d458 <__lshrsi3>
blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec);
80103d8: b6 01 80 00 add r16,r16,r1
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;
80103dc: 41 6d 00 0c lbu r13,(r11+12)
80103e0: ba 20 08 00 mv r1,r17
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
ssize_t bytes_written = 0;
80103e4: 34 0f 00 00 mvi r15,0
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;
80103e8: b9 a0 10 00 mv r2,r13
80103ec: f8 00 74 1b calli 802d458 <__lshrsi3>
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
80103f0: b9 a0 10 00 mv r2,r13
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;
80103f4: b8 20 70 00 mv r14,r1
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
80103f8: fb ff c3 7c calli 80011e8 <__ashlsi3>
80103fc: ca 21 88 00 sub r17,r17,r1
ssize_t bytes_written = 0;
ssize_t ret;
cur_blk += blocks_in_offset;
8010400: b6 0e 80 00 add r16,r16,r14
const uint32_t start_cln,
const uint32_t offset,
const uint32_t count,
const uint8_t pattern)
{
ssize_t rc = RC_OK;
8010404: 34 04 00 00 mvi r4,0
}
static inline void
fat_buf_mark_modified(fat_fs_info_t *fs_info)
{
fs_info->c.modified = true;
8010408: 34 13 00 01 mvi r19,1
ssize_t bytes_written = 0;
ssize_t ret;
cur_blk += blocks_in_offset;
while ( (RC_OK == rc)
801040c: e0 00 00 26 bi 80104a4 <fat_cluster_set+0x170>
&& (0 < bytes_to_write))
{
uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk));
8010410: 2d 72 00 0a lhu r18,(r11+10)
8010414: ca 51 20 00 sub r4,r18,r17
8010418: b8 80 68 00 mv r13,r4
801041c: 51 84 00 02 bgeu r12,r4,8010424 <fat_cluster_set+0xf0> <== ALWAYS TAKEN
8010420: b9 80 68 00 mv r13,r12 <== NOT EXECUTED
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));
8010424: b9 a0 70 00 mv r14,r13
8010428: 50 8d 00 02 bgeu r4,r13,8010430 <fat_cluster_set+0xfc> <== ALWAYS TAKEN
801042c: b8 80 70 00 mv r14,r4 <== NOT EXECUTED
uint32_t ino
)
{
return (ino >= fs_info->uino_base);
}
8010430: 41 63 00 02 lbu r3,(r11+2)
8010434: 41 64 00 0c lbu r4,(r11+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)
8010438: 45 c0 00 13 be r14,r0,8010484 <fat_cluster_set+0x150> <== NEVER TAKEN
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);
801043c: c8 83 10 00 sub r2,r4,r3
8010440: ba 00 08 00 mv r1,r16
8010444: fb ff c3 69 calli 80011e8 <__ashlsi3>
8010448: b8 20 10 00 mv r2,r1
{
if (bytes_to_write == fs_info->vol.bytes_per_block)
{
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf);
801044c: 34 03 00 02 mvi r3,2
8010450: b9 60 08 00 mv r1,r11
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)
8010454: 45 d2 00 03 be r14,r18,8010460 <fat_cluster_set+0x12c>
{
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);
8010458: b9 60 08 00 mv r1,r11
801045c: 34 03 00 01 mvi r3,1
8010460: 37 84 00 30 addi r4,sp,48
8010464: fb ff ff 06 calli 801007c <fat_buf_access>
if (RC_OK == rc)
8010468: 5c 20 00 08 bne r1,r0,8010488 <fat_cluster_set+0x154> <== NEVER TAKEN
{
memset(blk_buf + offset, pattern, bytes_to_write);
801046c: 2b 81 00 30 lw r1,(sp+48)
8010470: ba 80 10 00 mv r2,r20
8010474: b9 c0 18 00 mv r3,r14
8010478: b4 31 08 00 add r1,r1,r17
801047c: f8 00 2d 85 calli 801ba90 <memset>
}
static inline void
fat_buf_mark_modified(fat_fs_info_t *fs_info)
{
fs_info->c.modified = true;
8010480: 31 73 00 88 sb (r11+136),r19
}
}
if (RC_OK != rc)
return rc;
else
return bytes_to_write;
8010484: b9 c0 08 00 mv r1,r14
cur_blk,
ofs_blk,
c,
pattern);
if (c != ret)
rc = -1;
8010488: 34 04 ff ff mvi r4,-1
fs_info,
cur_blk,
ofs_blk,
c,
pattern);
if (c != ret)
801048c: 5d a1 00 05 bne r13,r1,80104a0 <fat_cluster_set+0x16c> <== NEVER TAKEN
rc = -1;
else
{
bytes_to_write -= ret;
8010490: c9 8d 60 00 sub r12,r12,r13
bytes_written += ret;
8010494: b5 ed 78 00 add r15,r15,r13
++cur_blk;
8010498: 36 10 00 01 addi r16,r16,1
801049c: 34 04 00 00 mvi r4,0
80104a0: 34 11 00 00 mvi r17,0
ssize_t ret;
cur_blk += blocks_in_offset;
while ( (RC_OK == rc)
&& (0 < bytes_to_write))
80104a4: 7d 82 00 00 cmpnei r2,r12,0
ssize_t bytes_written = 0;
ssize_t ret;
cur_blk += blocks_in_offset;
while ( (RC_OK == rc)
80104a8: 64 81 00 00 cmpei r1,r4,0
80104ac: a0 41 08 00 and r1,r2,r1
80104b0: 5c 20 ff d8 bne r1,r0,8010410 <fat_cluster_set+0xdc>
bytes_written += ret;
++cur_blk;
}
ofs_blk = 0;
}
if (RC_OK != rc)
80104b4: 5c 81 00 02 bne r4,r1,80104bc <fat_cluster_set+0x188> <== NEVER TAKEN
80104b8: b9 e0 20 00 mv r4,r15
return rc;
else
return bytes_written;
}
80104bc: b8 80 08 00 mv r1,r4
80104c0: 2b 9d 00 04 lw ra,(sp+4)
80104c4: 2b 8b 00 2c lw r11,(sp+44)
80104c8: 2b 8c 00 28 lw r12,(sp+40)
80104cc: 2b 8d 00 24 lw r13,(sp+36)
80104d0: 2b 8e 00 20 lw r14,(sp+32)
80104d4: 2b 8f 00 1c lw r15,(sp+28)
80104d8: 2b 90 00 18 lw r16,(sp+24)
80104dc: 2b 91 00 14 lw r17,(sp+20)
80104e0: 2b 92 00 10 lw r18,(sp+16)
80104e4: 2b 93 00 0c lw r19,(sp+12)
80104e8: 2b 94 00 08 lw r20,(sp+8)
80104ec: 37 9c 00 30 addi sp,sp,48
80104f0: c3 a0 00 00 ret
080104f4 <fat_cluster_write>:
const uint32_t start_cln,
const uint32_t offset,
const uint32_t count,
const void *buff,
const bool overwrite_cluster)
{
80104f4: 37 9c ff cc addi sp,sp,-52
80104f8: 5b 8b 00 30 sw (sp+48),r11
80104fc: 5b 8c 00 2c sw (sp+44),r12
8010500: 5b 8d 00 28 sw (sp+40),r13
8010504: 5b 8e 00 24 sw (sp+36),r14
8010508: 5b 8f 00 20 sw (sp+32),r15
801050c: 5b 90 00 1c sw (sp+28),r16
8010510: 5b 91 00 18 sw (sp+24),r17
8010514: 5b 92 00 14 sw (sp+20),r18
8010518: 5b 93 00 10 sw (sp+16),r19
801051c: 5b 94 00 0c sw (sp+12),r20
8010520: 5b 95 00 08 sw (sp+8),r21
8010524: 5b 9d 00 04 sw (sp+4),ra
8010528: b8 20 58 00 mv r11,r1
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
801052c: 2c 21 00 06 lhu r1,(r1+6)
const uint32_t start_cln,
const uint32_t offset,
const uint32_t count,
const void *buff,
const bool overwrite_cluster)
{
8010530: b8 60 88 00 mv r17,r3
8010534: b8 a0 a0 00 mv r20,r5
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
8010538: c8 23 08 00 sub r1,r1,r3
const uint32_t start_cln,
const uint32_t offset,
const uint32_t count,
const void *buff,
const bool overwrite_cluster)
{
801053c: 20 d5 00 ff andi r21,r6,0xff
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
8010540: b8 80 60 00 mv r12,r4
8010544: 50 24 00 02 bgeu r1,r4,801054c <fat_cluster_write+0x58> <== ALWAYS TAKEN
8010548: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
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)) )
801054c: 5c 40 00 0b bne r2,r0,8010578 <fat_cluster_write+0x84>
8010550: 41 61 00 0e lbu r1,(r11+14)
8010554: 20 21 00 03 andi r1,r1,0x3
8010558: 44 22 00 08 be r1,r2,8010578 <fat_cluster_write+0x84> <== NEVER TAKEN
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);
801055c: 41 63 00 0c lbu r3,(r11+12)
8010560: 41 62 00 02 lbu r2,(r11+2)
8010564: 29 61 00 20 lw r1,(r11+32)
8010568: c8 62 10 00 sub r2,r3,r2
801056c: f8 00 73 bb calli 802d458 <__lshrsi3>
8010570: b8 20 80 00 mv r16,r1
8010574: e0 00 00 0c bi 80105a4 <fat_cluster_write+0xb0>
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);
8010578: 41 63 00 08 lbu r3,(r11+8)
801057c: 41 6d 00 0c lbu r13,(r11+12)
8010580: 34 41 ff fe addi r1,r2,-2
8010584: c8 6d 10 00 sub r2,r3,r13
8010588: fb ff c3 18 calli 80011e8 <__ashlsi3>
801058c: 41 62 00 02 lbu r2,(r11+2)
8010590: b8 20 80 00 mv r16,r1
8010594: 29 61 00 34 lw r1,(r11+52)
8010598: c9 a2 10 00 sub r2,r13,r2
801059c: f8 00 73 af calli 802d458 <__lshrsi3>
blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec);
80105a0: b6 01 80 00 add r16,r16,r1
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);
80105a4: 41 6d 00 0c lbu r13,(r11+12)
80105a8: ba 20 08 00 mv r1,r17
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
ssize_t bytes_written = 0;
80105ac: 34 0f 00 00 mvi r15,0
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);
80105b0: b9 a0 10 00 mv r2,r13
80105b4: f8 00 73 a9 calli 802d458 <__lshrsi3>
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
80105b8: b9 a0 10 00 mv r2,r13
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);
80105bc: b8 20 70 00 mv r14,r1
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
80105c0: fb ff c3 0a calli 80011e8 <__ashlsi3>
80105c4: ca 21 88 00 sub r17,r17,r1
ssize_t bytes_written = 0;
uint8_t *buffer = (uint8_t*)buff;
ssize_t ret;
uint32_t c;
cur_blk += blocks_in_offset;
80105c8: b6 0e 80 00 add r16,r16,r14
const uint32_t offset,
const uint32_t count,
const void *buff,
const bool overwrite_cluster)
{
ssize_t rc = RC_OK;
80105cc: 34 02 00 00 mvi r2,0
}
static inline void
fat_buf_mark_modified(fat_fs_info_t *fs_info)
{
fs_info->c.modified = true;
80105d0: 34 13 00 01 mvi r19,1
ssize_t ret;
uint32_t c;
cur_blk += blocks_in_offset;
while ( (RC_OK == rc)
80105d4: e0 00 00 27 bi 8010670 <fat_cluster_write+0x17c>
&& (0 < bytes_to_write))
{
c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk));
80105d8: 2d 72 00 0a lhu r18,(r11+10)
80105dc: ca 51 10 00 sub r2,r18,r17
80105e0: b8 40 68 00 mv r13,r2
80105e4: 51 82 00 02 bgeu r12,r2,80105ec <fat_cluster_write+0xf8>
80105e8: b9 80 68 00 mv r13,r12
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));
80105ec: b9 a0 70 00 mv r14,r13
80105f0: 50 4d 00 02 bgeu r2,r13,80105f8 <fat_cluster_write+0x104> <== ALWAYS TAKEN
80105f4: b8 40 70 00 mv r14,r2 <== NOT EXECUTED
uint32_t ino
)
{
return (ino >= fs_info->uino_base);
}
80105f8: 41 62 00 02 lbu r2,(r11+2)
80105fc: 41 63 00 0c lbu r3,(r11+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)
8010600: 45 c0 00 14 be r14,r0,8010650 <fat_cluster_write+0x15c> <== NEVER TAKEN
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);
8010604: c8 62 10 00 sub r2,r3,r2
8010608: ba 00 08 00 mv r1,r16
801060c: fb ff c2 f7 calli 80011e8 <__ashlsi3>
8010610: b8 20 10 00 mv r2,r1
{
if ( overwrite_block
8010614: 5e a0 00 04 bne r21,r0,8010624 <fat_cluster_write+0x130>
|| (bytes_to_write == fs_info->vol.bytes_per_block))
{
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);
8010618: b9 60 08 00 mv r1,r11
801061c: 34 03 00 01 mvi r3,1
uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk);
if (0 < bytes_to_write)
{
if ( overwrite_block
|| (bytes_to_write == fs_info->vol.bytes_per_block))
8010620: 5d d2 00 03 bne r14,r18,801062c <fat_cluster_write+0x138>
{
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf);
8010624: b9 60 08 00 mv r1,r11
8010628: 34 03 00 02 mvi r3,2
}
else
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf);
801062c: 37 84 00 34 addi r4,sp,52
8010630: fb ff fe 93 calli 801007c <fat_buf_access>
if (RC_OK == rc)
8010634: 5c 20 00 08 bne r1,r0,8010654 <fat_cluster_write+0x160> <== NEVER TAKEN
{
memcpy(blk_buf + offset, buf, bytes_to_write);
8010638: 2b 81 00 34 lw r1,(sp+52)
801063c: b6 8f 10 00 add r2,r20,r15
8010640: b9 c0 18 00 mv r3,r14
8010644: b4 31 08 00 add r1,r1,r17
8010648: f8 00 2c d1 calli 801b98c <memcpy>
}
static inline void
fat_buf_mark_modified(fat_fs_info_t *fs_info)
{
fs_info->c.modified = true;
801064c: 31 73 00 88 sb (r11+136),r19
}
}
if (RC_OK != rc)
return rc;
else
return bytes_to_write;
8010650: b9 c0 08 00 mv r1,r14
ofs_blk,
c,
&buffer[bytes_written],
overwrite_cluster);
if (c != ret)
rc = -1;
8010654: 34 02 ff ff mvi r2,-1
cur_blk,
ofs_blk,
c,
&buffer[bytes_written],
overwrite_cluster);
if (c != ret)
8010658: 5d a1 00 05 bne r13,r1,801066c <fat_cluster_write+0x178> <== NEVER TAKEN
rc = -1;
else
{
bytes_to_write -= ret;
801065c: c9 8d 60 00 sub r12,r12,r13
bytes_written += ret;
8010660: b5 ed 78 00 add r15,r15,r13
++cur_blk;
8010664: 36 10 00 01 addi r16,r16,1
8010668: 34 02 00 00 mvi r2,0
801066c: 34 11 00 00 mvi r17,0
uint32_t c;
cur_blk += blocks_in_offset;
while ( (RC_OK == rc)
&& (0 < bytes_to_write))
8010670: 7d 83 00 00 cmpnei r3,r12,0
ssize_t ret;
uint32_t c;
cur_blk += blocks_in_offset;
while ( (RC_OK == rc)
8010674: 64 41 00 00 cmpei r1,r2,0
8010678: a0 61 08 00 and r1,r3,r1
801067c: 5c 20 ff d7 bne r1,r0,80105d8 <fat_cluster_write+0xe4>
bytes_written += ret;
++cur_blk;
}
ofs_blk = 0;
}
if (RC_OK != rc)
8010680: 5c 41 00 02 bne r2,r1,8010688 <fat_cluster_write+0x194> <== NEVER TAKEN
8010684: b9 e0 10 00 mv r2,r15
return rc;
else
return bytes_written;
}
8010688: b8 40 08 00 mv r1,r2
801068c: 2b 9d 00 04 lw ra,(sp+4)
8010690: 2b 8b 00 30 lw r11,(sp+48)
8010694: 2b 8c 00 2c lw r12,(sp+44)
8010698: 2b 8d 00 28 lw r13,(sp+40)
801069c: 2b 8e 00 24 lw r14,(sp+36)
80106a0: 2b 8f 00 20 lw r15,(sp+32)
80106a4: 2b 90 00 1c lw r16,(sp+28)
80106a8: 2b 91 00 18 lw r17,(sp+24)
80106ac: 2b 92 00 14 lw r18,(sp+20)
80106b0: 2b 93 00 10 lw r19,(sp+16)
80106b4: 2b 94 00 0c lw r20,(sp+12)
80106b8: 2b 95 00 08 lw r21,(sp+8)
80106bc: 37 9c 00 34 addi sp,sp,52
80106c0: c3 a0 00 00 ret
0800ef40 <fat_construct_key>:
*/
static inline uint32_t
fat_construct_key(
const fat_fs_info_t *fs_info,
fat_pos_t *pos)
{
800ef40: 37 9c ff f0 addi sp,sp,-16
800ef44: 5b 8b 00 10 sw (sp+16),r11
800ef48: 5b 8c 00 0c sw (sp+12),r12
800ef4c: 5b 8d 00 08 sw (sp+8),r13
800ef50: 5b 9d 00 04 sw (sp+4),ra
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
800ef54: 28 43 00 00 lw r3,(r2+0)
*/
static inline uint32_t
fat_construct_key(
const fat_fs_info_t *fs_info,
fat_pos_t *pos)
{
800ef58: b8 20 58 00 mv r11,r1
fat_cluster_num_to_sector512_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if (cln == 1)
800ef5c: 34 01 00 01 mvi r1,1
800ef60: b8 40 68 00 mv r13,r2
return 1;
800ef64: 34 0c 00 01 mvi r12,1
fat_cluster_num_to_sector512_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if (cln == 1)
800ef68: 44 61 00 0f be r3,r1,800efa4 <fat_construct_key+0x64>
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)) )
800ef6c: 5c 60 00 06 bne r3,r0,800ef84 <fat_construct_key+0x44>
800ef70: 41 61 00 0e lbu r1,(r11+14)
800ef74: 20 21 00 03 andi r1,r1,0x3
800ef78: 44 23 00 03 be r1,r3,800ef84 <fat_construct_key+0x44> <== NEVER TAKEN
return fs_info->vol.rdir_loc;
800ef7c: 29 61 00 20 lw r1,(r11+32)
800ef80: e0 00 00 06 bi 800ef98 <fat_construct_key+0x58>
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
800ef84: 41 62 00 05 lbu r2,(r11+5)
800ef88: 34 61 ff fe addi r1,r3,-2
800ef8c: fb ff c8 97 calli 80011e8 <__ashlsi3>
800ef90: 29 62 00 34 lw r2,(r11+52)
800ef94: b4 22 08 00 add r1,r1,r2
)
{
if (cln == 1)
return 1;
return (fat_cluster_num_to_sector_num(fs_info, cln) <<
800ef98: 41 62 00 03 lbu r2,(r11+3)
800ef9c: fb ff c8 93 calli 80011e8 <__ashlsi3>
800efa0: b8 20 60 00 mv r12,r1
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
800efa4: 29 ab 00 04 lw r11,(r13+4)
800efa8: 34 02 00 09 mvi r2,9
800efac: b9 60 08 00 mv r1,r11
800efb0: f8 00 79 2a calli 802d458 <__lshrsi3>
800efb4: b5 81 08 00 add r1,r12,r1
800efb8: 34 02 00 04 mvi r2,4
800efbc: fb ff c8 8b calli 80011e8 <__ashlsi3>
800efc0: b8 20 60 00 mv r12,r1
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
800efc4: 34 02 00 05 mvi r2,5
800efc8: b9 60 08 00 mv r1,r11
800efcc: f8 00 79 23 calli 802d458 <__lshrsi3>
800efd0: 20 22 00 0f andi r2,r1,0xf
}
800efd4: b5 82 08 00 add r1,r12,r2
800efd8: 2b 9d 00 04 lw ra,(sp+4)
800efdc: 2b 8b 00 10 lw r11,(sp+16)
800efe0: 2b 8c 00 0c lw r12,(sp+12)
800efe4: 2b 8d 00 08 lw r13,(sp+8)
800efe8: 37 9c 00 10 addi sp,sp,16
800efec: c3 a0 00 00 ret
0800f648 <fat_file_close>:
int
fat_file_close(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd
)
{
800f648: 37 9c ff f0 addi sp,sp,-16
800f64c: 5b 8b 00 10 sw (sp+16),r11
800f650: 5b 8c 00 0c sw (sp+12),r12
800f654: 5b 8d 00 08 sw (sp+8),r13
800f658: 5b 9d 00 04 sw (sp+4),ra
/*
* 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)
800f65c: 28 43 00 08 lw r3,(r2+8)
800f660: 34 04 00 01 mvi r4,1
int
fat_file_close(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd
)
{
800f664: b8 20 68 00 mv r13,r1
800f668: b8 40 58 00 mv r11,r2
/*
* 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)
800f66c: 50 83 00 05 bgeu r4,r3,800f680 <fat_file_close+0x38>
{
fat_fd->links_num--;
800f670: 34 63 ff ff addi r3,r3,-1
800f674: 58 43 00 08 sw (r2+8),r3
return rc;
800f678: 34 0c 00 00 mvi r12,0
800f67c: e0 00 00 1e bi 800f6f4 <fat_file_close+0xac>
}
key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname);
if (fat_fd->flags & FAT_FILE_REMOVED)
800f680: 40 4c 00 30 lbu r12,(r2+48)
800f684: 21 8c 00 01 andi r12,r12,0x1
800f688: 45 80 00 0f be r12,r0,800f6c4 <fat_file_close+0x7c>
{
rc = fat_file_truncate(fs_info, fat_fd, 0);
800f68c: 34 03 00 00 mvi r3,0
800f690: fb ff ff a1 calli 800f514 <fat_file_truncate>
800f694: b8 20 60 00 mv r12,r1
if ( rc != RC_OK )
800f698: 5c 20 00 17 bne r1,r0,800f6f4 <fat_file_close+0xac> <== NEVER TAKEN
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
800f69c: b9 60 08 00 mv r1,r11
800f6a0: f8 00 12 c9 calli 80141c4 <_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) )
800f6a4: 29 62 00 0c lw r2,(r11+12)
800f6a8: b9 a0 08 00 mv r1,r13
800f6ac: f8 00 07 21 calli 8011330 <fat_ino_is_unique>
800f6b0: 44 2c 00 0c be r1,r12,800f6e0 <fat_file_close+0x98> <== ALWAYS TAKEN
fat_free_unique_ino(fs_info, fat_fd->ino);
800f6b4: 29 62 00 0c lw r2,(r11+12) <== NOT EXECUTED
800f6b8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800f6bc: f8 00 07 05 calli 80112d0 <fat_free_unique_ino> <== NOT EXECUTED
800f6c0: e0 00 00 08 bi 800f6e0 <fat_file_close+0x98> <== NOT EXECUTED
free(fat_fd);
}
else
{
if (fat_ino_is_unique(fs_info, fat_fd->ino))
800f6c4: 28 42 00 0c lw r2,(r2+12)
800f6c8: f8 00 07 1a calli 8011330 <fat_ino_is_unique>
800f6cc: 44 2c 00 03 be r1,r12,800f6d8 <fat_file_close+0x90>
{
fat_fd->links_num = 0;
800f6d0: 59 60 00 08 sw (r11+8),r0
800f6d4: e0 00 00 05 bi 800f6e8 <fat_file_close+0xa0>
800f6d8: b9 60 08 00 mv r1,r11
800f6dc: f8 00 12 ba calli 80141c4 <_Chain_Extract>
}
else
{
_hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd);
free(fat_fd);
800f6e0: b9 60 08 00 mv r1,r11
800f6e4: fb ff ce 3a calli 8002fcc <free>
}
}
/*
* flush any modified "cached" buffer back to disk
*/
rc = fat_buf_release(fs_info);
800f6e8: b9 a0 08 00 mv r1,r13
800f6ec: f8 00 01 e6 calli 800fe84 <fat_buf_release>
800f6f0: b8 20 60 00 mv r12,r1
return rc;
}
800f6f4: b9 80 08 00 mv r1,r12
800f6f8: 2b 9d 00 04 lw ra,(sp+4)
800f6fc: 2b 8b 00 10 lw r11,(sp+16)
800f700: 2b 8c 00 0c lw r12,(sp+12)
800f704: 2b 8d 00 08 lw r13,(sp+8)
800f708: 37 9c 00 10 addi sp,sp,16
800f70c: c3 a0 00 00 ret
0800f7e8 <fat_file_extend>:
fat_file_fd_t *fat_fd,
bool zero_fill,
uint32_t new_length,
uint32_t *a_length
)
{
800f7e8: 37 9c ff c4 addi sp,sp,-60
800f7ec: 5b 8b 00 28 sw (sp+40),r11
800f7f0: 5b 8c 00 24 sw (sp+36),r12
800f7f4: 5b 8d 00 20 sw (sp+32),r13
800f7f8: 5b 8e 00 1c sw (sp+28),r14
800f7fc: 5b 8f 00 18 sw (sp+24),r15
800f800: 5b 90 00 14 sw (sp+20),r16
800f804: 5b 91 00 10 sw (sp+16),r17
800f808: 5b 92 00 0c sw (sp+12),r18
800f80c: 5b 93 00 08 sw (sp+8),r19
800f810: 5b 9d 00 04 sw (sp+4),ra
800f814: b8 a0 90 00 mv r18,r5
uint32_t last_cl = 0;
uint32_t bytes_remain = 0;
uint32_t cls_added;
ssize_t bytes_written;
*a_length = new_length;
800f818: 5a 44 00 00 sw (r18+0),r4
fat_file_fd_t *fat_fd,
bool zero_fill,
uint32_t new_length,
uint32_t *a_length
)
{
800f81c: b8 20 58 00 mv r11,r1
uint32_t cls_added;
ssize_t bytes_written;
*a_length = new_length;
if (new_length <= fat_fd->fat_file_size)
800f820: 28 41 00 18 lw r1,(r2+24)
uint32_t new_length,
uint32_t *a_length
)
{
int rc = RC_OK;
uint32_t chain = 0;
800f824: 5b 80 00 3c sw (sp+60),r0
uint32_t bytes2add = 0;
uint32_t cls2add = 0;
uint32_t old_last_cl;
uint32_t last_cl = 0;
800f828: 5b 80 00 34 sw (sp+52),r0
fat_file_fd_t *fat_fd,
bool zero_fill,
uint32_t new_length,
uint32_t *a_length
)
{
800f82c: b8 40 60 00 mv r12,r2
800f830: b8 80 70 00 mv r14,r4
800f834: 20 73 00 ff andi r19,r3,0xff
ssize_t bytes_written;
*a_length = new_length;
if (new_length <= fat_fd->fat_file_size)
return RC_OK;
800f838: 34 0d 00 00 mvi r13,0
uint32_t cls_added;
ssize_t bytes_written;
*a_length = new_length;
if (new_length <= fat_fd->fat_file_size)
800f83c: 50 24 00 73 bgeu r1,r4,800fa08 <fat_file_extend+0x220>
return RC_OK;
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
800f840: 28 43 00 20 lw r3,(r2+32)
800f844: 34 02 00 01 mvi r2,1
800f848: 5c 62 00 06 bne r3,r2,800f860 <fat_file_extend+0x78>
800f84c: 29 82 00 24 lw r2,(r12+36)
800f850: 5c 40 00 04 bne r2,r0,800f860 <fat_file_extend+0x78> <== NEVER TAKEN
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
800f854: 41 62 00 0e lbu r2,(r11+14)
800f858: 20 42 00 03 andi r2,r2,0x3
*a_length = new_length;
if (new_length <= fat_fd->fat_file_size)
return RC_OK;
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
800f85c: 5c 4d 00 2f bne r2,r13,800f918 <fat_file_extend+0x130> <== ALWAYS TAKEN
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
rtems_set_errno_and_return_minus_one( ENOSPC );
bytes_remain = (fs_info->vol.bpc -
800f860: 2d 6f 00 06 lhu r15,(r11+6)
bytes2add = new_length - fat_fd->fat_file_size;
if (bytes2add > bytes_remain)
bytes2add -= bytes_remain;
else
bytes2add = 0;
800f864: 34 10 00 00 mvi r16,0
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 -
(fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) &
800f868: 35 e2 ff ff addi r2,r15,-1
800f86c: a0 41 88 00 and r17,r2,r1
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 -
800f870: c9 f1 78 00 sub r15,r15,r17
800f874: a1 e2 78 00 and r15,r15,r2
(fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) &
(fs_info->vol.bpc - 1);
bytes2add = new_length - fat_fd->fat_file_size;
800f878: c9 c1 10 00 sub r2,r14,r1
if (bytes2add > bytes_remain)
800f87c: 51 e2 00 02 bgeu r15,r2,800f884 <fat_file_extend+0x9c>
bytes2add -= bytes_remain;
800f880: c8 4f 80 00 sub r16,r2,r15
else
bytes2add = 0;
if (zero_fill && bytes_remain > 0) {
800f884: 46 60 00 13 be r19,r0,800f8d0 <fat_file_extend+0xe8>
800f888: 45 e0 00 12 be r15,r0,800f8d0 <fat_file_extend+0xe8>
uint32_t start = fat_fd->fat_file_size;
uint32_t cl_start = start >> fs_info->vol.bpc_log2;
800f88c: 41 62 00 08 lbu r2,(r11+8)
800f890: f8 00 76 f2 calli 802d458 <__lshrsi3>
800f894: b8 20 18 00 mv r3,r1
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);
800f898: b9 80 10 00 mv r2,r12
800f89c: b9 60 08 00 mv r1,r11
800f8a0: 37 84 00 2c addi r4,sp,44
800f8a4: fb ff fe 01 calli 800f0a8 <fat_file_lseek>
800f8a8: b8 20 68 00 mv r13,r1
if (rc != RC_OK)
800f8ac: 5c 20 00 57 bne r1,r0,800fa08 <fat_file_extend+0x220> <== NEVER TAKEN
return rc;
bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0);
800f8b0: 2b 82 00 2c lw r2,(sp+44)
800f8b4: b9 60 08 00 mv r1,r11
800f8b8: ba 20 18 00 mv r3,r17
800f8bc: b9 e0 20 00 mv r4,r15
800f8c0: 34 05 00 00 mvi r5,0
800f8c4: f8 00 02 9c calli 8010334 <fat_cluster_set>
if (bytes_remain != bytes_written)
return -1;
800f8c8: 34 0d ff ff mvi r13,-1
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)
800f8cc: 5d e1 00 4f bne r15,r1,800fa08 <fat_file_extend+0x220> <== NEVER TAKEN
* 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)
return RC_OK;
800f8d0: 34 0d 00 00 mvi r13,0
/*
* 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)
800f8d4: 46 00 00 4d be r16,r0,800fa08 <fat_file_extend+0x220> <== NEVER TAKEN
return RC_OK;
cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1;
800f8d8: 41 62 00 08 lbu r2,(r11+8)
800f8dc: 36 01 ff ff addi r1,r16,-1
800f8e0: f8 00 76 de calli 802d458 <__lshrsi3>
800f8e4: 34 31 00 01 addi r17,r1,1
rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add,
800f8e8: 37 82 00 3c addi r2,sp,60
800f8ec: b9 60 08 00 mv r1,r11
800f8f0: ba 20 18 00 mv r3,r17
800f8f4: 37 84 00 30 addi r4,sp,48
800f8f8: 37 85 00 34 addi r5,sp,52
800f8fc: ba 60 30 00 mv r6,r19
800f900: f8 00 24 b7 calli 8018bdc <fat_scan_fat_for_free_clusters>
800f904: b8 20 68 00 mv r13,r1
&cls_added, &last_cl, zero_fill);
/* this means that low level I/O error occured */
if (rc != RC_OK)
800f908: 5c 20 00 40 bne r1,r0,800fa08 <fat_file_extend+0x220> <== NEVER TAKEN
return rc;
/* this means that no space left on device */
if ((cls_added == 0) && (bytes_remain == 0))
800f90c: 2b 82 00 30 lw r2,(sp+48)
800f910: b9 e2 78 00 or r15,r15,r2
800f914: 5d e1 00 06 bne r15,r1,800f92c <fat_file_extend+0x144> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(ENOSPC);
800f918: f8 00 2c cf calli 801ac54 <__errno>
800f91c: 34 02 00 1c mvi r2,28
800f920: 58 22 00 00 sw (r1+0),r2
800f924: 34 0d ff ff mvi r13,-1
800f928: e0 00 00 38 bi 800fa08 <fat_file_extend+0x220>
/* check wether we satisfied request for 'cls2add' clusters */
if (cls2add != cls_added)
800f92c: 46 22 00 09 be r17,r2,800f950 <fat_file_extend+0x168> <== ALWAYS TAKEN
{
new_length -= bytes2add & (fs_info->vol.bpc - 1);
800f930: 2d 61 00 06 lhu r1,(r11+6) <== NOT EXECUTED
800f934: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED
800f938: a2 01 80 00 and r16,r16,r1 <== NOT EXECUTED
new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2;
800f93c: ca 22 08 00 sub r1,r17,r2 <== NOT EXECUTED
800f940: 41 62 00 08 lbu r2,(r11+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);
800f944: c9 d0 70 00 sub r14,r14,r16 <== NOT EXECUTED
new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2;
800f948: fb ff c6 28 calli 80011e8 <__ashlsi3> <== NOT EXECUTED
800f94c: c9 c1 70 00 sub r14,r14,r1 <== NOT EXECUTED
}
/* add new chain to the end of existed */
if ( fat_fd->fat_file_size == 0 )
800f950: 29 84 00 18 lw r4,(r12+24)
800f954: 5c 80 00 06 bne r4,r0,800f96c <fat_file_extend+0x184>
{
fat_fd->map.disk_cln = fat_fd->cln = chain;
800f958: 2b 81 00 3c lw r1,(sp+60)
fat_fd->map.file_cln = 0;
800f95c: 59 80 00 34 sw (r12+52),r0
}
/* add new chain to the end of existed */
if ( fat_fd->fat_file_size == 0 )
{
fat_fd->map.disk_cln = fat_fd->cln = chain;
800f960: 59 81 00 1c sw (r12+28),r1
800f964: 59 81 00 38 sw (r12+56),r1
800f968: e0 00 00 16 bi 800f9c0 <fat_file_extend+0x1d8>
fat_fd->map.file_cln = 0;
}
else
{
if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE)
800f96c: 29 81 00 3c lw r1,(r12+60)
800f970: 34 02 ff ff mvi r2,-1
800f974: 44 22 00 03 be r1,r2,800f980 <fat_file_extend+0x198> <== NEVER TAKEN
{
old_last_cl = fat_fd->map.last_cln;
800f978: 5b 81 00 38 sw (sp+56),r1
800f97c: e0 00 00 09 bi 800f9a0 <fat_file_extend+0x1b8>
}
else
{
rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM,
800f980: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800f984: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
800f988: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
800f98c: 34 84 ff ff addi r4,r4,-1 <== NOT EXECUTED
800f990: 37 85 00 38 addi r5,sp,56 <== NOT EXECUTED
800f994: fb ff ff 5f calli 800f710 <fat_file_ioctl> <== NOT EXECUTED
800f998: b8 20 78 00 mv r15,r1 <== NOT EXECUTED
(fat_fd->fat_file_size - 1), &old_last_cl);
if ( rc != RC_OK )
800f99c: 5c 20 00 14 bne r1,r0,800f9ec <fat_file_extend+0x204> <== NOT EXECUTED
fat_free_fat_clusters_chain(fs_info, chain);
return rc;
}
}
rc = fat_set_fat_cluster(fs_info, old_last_cl, chain);
800f9a0: 2b 82 00 38 lw r2,(sp+56)
800f9a4: 2b 83 00 3c lw r3,(sp+60)
800f9a8: b9 60 08 00 mv r1,r11
800f9ac: f8 00 23 7e calli 80187a4 <fat_set_fat_cluster>
800f9b0: b8 20 78 00 mv r15,r1
if ( rc != RC_OK )
800f9b4: 5c 20 00 0e bne r1,r0,800f9ec <fat_file_extend+0x204> <== NEVER TAKEN
{
fat_free_fat_clusters_chain(fs_info, chain);
return rc;
}
fat_buf_release(fs_info);
800f9b8: b9 60 08 00 mv r1,r11
800f9bc: f8 00 01 32 calli 800fe84 <fat_buf_release>
}
/* update number of the last cluster of the file if it changed */
if (cls_added != 0)
800f9c0: 2b 81 00 30 lw r1,(sp+48)
800f9c4: 44 20 00 0f be r1,r0,800fa00 <fat_file_extend+0x218> <== NEVER TAKEN
{
fat_fd->map.last_cln = last_cl;
800f9c8: 2b 81 00 34 lw r1,(sp+52)
if (fat_fd->fat_file_type == FAT_DIRECTORY)
800f9cc: 29 90 00 10 lw r16,(r12+16)
}
/* update number of the last cluster of the file if it changed */
if (cls_added != 0)
{
fat_fd->map.last_cln = last_cl;
800f9d0: 59 81 00 3c sw (r12+60),r1
if (fat_fd->fat_file_type == FAT_DIRECTORY)
800f9d4: 5e 00 00 0b bne r16,r0,800fa00 <fat_file_extend+0x218>
{
rc = fat_init_clusters_chain(fs_info, chain);
800f9d8: 2b 82 00 3c lw r2,(sp+60)
800f9dc: b9 60 08 00 mv r1,r11
800f9e0: f8 00 05 d6 calli 8011138 <fat_init_clusters_chain>
800f9e4: b8 20 78 00 mv r15,r1
if ( rc != RC_OK )
800f9e8: 44 30 00 06 be r1,r16,800fa00 <fat_file_extend+0x218> <== ALWAYS TAKEN
{
fat_free_fat_clusters_chain(fs_info, chain);
800f9ec: 2b 82 00 3c lw r2,(sp+60) <== NOT EXECUTED
800f9f0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
return rc;
800f9f4: b9 e0 68 00 mv r13,r15 <== 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);
800f9f8: f8 00 24 3d calli 8018aec <fat_free_fat_clusters_chain> <== NOT EXECUTED
return rc;
800f9fc: e0 00 00 03 bi 800fa08 <fat_file_extend+0x220> <== NOT EXECUTED
}
}
}
*a_length = new_length;
800fa00: 5a 4e 00 00 sw (r18+0),r14
fat_fd->fat_file_size = new_length;
800fa04: 59 8e 00 18 sw (r12+24),r14
return RC_OK;
}
800fa08: b9 a0 08 00 mv r1,r13
800fa0c: 2b 9d 00 04 lw ra,(sp+4)
800fa10: 2b 8b 00 28 lw r11,(sp+40)
800fa14: 2b 8c 00 24 lw r12,(sp+36)
800fa18: 2b 8d 00 20 lw r13,(sp+32)
800fa1c: 2b 8e 00 1c lw r14,(sp+28)
800fa20: 2b 8f 00 18 lw r15,(sp+24)
800fa24: 2b 90 00 14 lw r16,(sp+20)
800fa28: 2b 91 00 10 lw r17,(sp+16)
800fa2c: 2b 92 00 0c lw r18,(sp+12)
800fa30: 2b 93 00 08 lw r19,(sp+8)
800fa34: 37 9c 00 3c addi sp,sp,60
800fa38: c3 a0 00 00 ret
0800f710 <fat_file_ioctl>:
fat_file_ioctl(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd,
int cmd,
...)
{
800f710: 37 9c ff d4 addi sp,sp,-44
800f714: 5b 8b 00 10 sw (sp+16),r11
800f718: 5b 8c 00 0c sw (sp+12),r12
800f71c: 5b 8d 00 08 sw (sp+8),r13
800f720: 5b 9d 00 04 sw (sp+4),ra
800f724: b8 20 60 00 mv r12,r1
800f728: 5b 83 00 18 sw (sp+24),r3
800f72c: 5b 84 00 1c sw (sp+28),r4
800f730: 5b 85 00 20 sw (sp+32),r5
800f734: 5b 86 00 24 sw (sp+36),r6
800f738: 5b 87 00 28 sw (sp+40),r7
800f73c: 5b 88 00 2c sw (sp+44),r8
int rc = RC_OK;
uint32_t cur_cln = 0;
800f740: 5b 80 00 14 sw (sp+20),r0
uint32_t *ret;
va_list ap;
va_start(ap, cmd);
switch (cmd)
800f744: 34 01 00 01 mvi r1,1
fat_file_ioctl(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd,
int cmd,
...)
{
800f748: b8 40 58 00 mv r11,r2
uint32_t *ret;
va_list ap;
va_start(ap, cmd);
switch (cmd)
800f74c: 5c 61 00 1d bne r3,r1,800f7c0 <fat_file_ioctl+0xb0> <== NEVER TAKEN
case F_CLU_NUM:
pos = va_arg(ap, uint32_t);
ret = va_arg(ap, uint32_t *);
/* sanity check */
if ( pos >= fat_fd->fat_file_size ) {
800f750: 28 42 00 18 lw r2,(r2+24)
va_start(ap, cmd);
switch (cmd)
{
case F_CLU_NUM:
pos = va_arg(ap, uint32_t);
800f754: b8 80 08 00 mv r1,r4
ret = va_arg(ap, uint32_t *);
800f758: b8 a0 68 00 mv r13,r5
/* sanity check */
if ( pos >= fat_fd->fat_file_size ) {
800f75c: 54 44 00 04 bgu r2,r4,800f76c <fat_file_ioctl+0x5c> <== ALWAYS TAKEN
va_end(ap);
rtems_set_errno_and_return_minus_one( EIO );
800f760: f8 00 2d 3d calli 801ac54 <__errno> <== NOT EXECUTED
800f764: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
800f768: e0 00 00 18 bi 800f7c8 <fat_file_ioctl+0xb8> <== NOT EXECUTED
}
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
800f76c: 29 62 00 20 lw r2,(r11+32)
800f770: 5c 43 00 09 bne r2,r3,800f794 <fat_file_ioctl+0x84>
800f774: 29 62 00 24 lw r2,(r11+36)
800f778: 5c 40 00 07 bne r2,r0,800f794 <fat_file_ioctl+0x84> <== NEVER TAKEN
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
800f77c: 41 83 00 0e lbu r3,(r12+14)
800f780: 20 63 00 03 andi r3,r3,0x3
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)) &&
800f784: 44 62 00 04 be r3,r2,800f794 <fat_file_ioctl+0x84>
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
{
/* cluster 0 (zero) reserved for root dir */
*ret = 0;
800f788: 58 a0 00 00 sw (r5+0),r0
rc = RC_OK;
800f78c: 34 01 00 00 mvi r1,0
break;
800f790: e0 00 00 10 bi 800f7d0 <fat_file_ioctl+0xc0>
}
cl_start = pos >> fs_info->vol.bpc_log2;
800f794: 41 82 00 08 lbu r2,(r12+8)
800f798: f8 00 77 30 calli 802d458 <__lshrsi3>
800f79c: b8 20 18 00 mv r3,r1
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
800f7a0: b9 60 10 00 mv r2,r11
800f7a4: b9 80 08 00 mv r1,r12
800f7a8: 37 84 00 14 addi r4,sp,20
800f7ac: fb ff fe 3f calli 800f0a8 <fat_file_lseek>
if ( rc != RC_OK )
800f7b0: 5c 20 00 08 bne r1,r0,800f7d0 <fat_file_ioctl+0xc0> <== NEVER TAKEN
break;
*ret = cur_cln;
800f7b4: 2b 82 00 14 lw r2,(sp+20)
800f7b8: 59 a2 00 00 sw (r13+0),r2
break;
800f7bc: e0 00 00 05 bi 800f7d0 <fat_file_ioctl+0xc0>
default:
errno = EINVAL;
800f7c0: f8 00 2d 25 calli 801ac54 <__errno> <== NOT EXECUTED
800f7c4: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
800f7c8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
rc = -1;
800f7cc: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
break;
}
va_end(ap);
return rc;
}
800f7d0: 2b 9d 00 04 lw ra,(sp+4)
800f7d4: 2b 8b 00 10 lw r11,(sp+16)
800f7d8: 2b 8c 00 0c lw r12,(sp+12)
800f7dc: 2b 8d 00 08 lw r13,(sp+8)
800f7e0: 37 9c 00 2c addi sp,sp,44
800f7e4: c3 a0 00 00 ret
0800f0a8 <fat_file_lseek>:
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd,
uint32_t file_cln,
uint32_t *disk_cln
)
{
800f0a8: 37 9c ff e0 addi sp,sp,-32
800f0ac: 5b 8b 00 1c sw (sp+28),r11
800f0b0: 5b 8c 00 18 sw (sp+24),r12
800f0b4: 5b 8d 00 14 sw (sp+20),r13
800f0b8: 5b 8e 00 10 sw (sp+16),r14
800f0bc: 5b 8f 00 0c sw (sp+12),r15
800f0c0: 5b 90 00 08 sw (sp+8),r16
800f0c4: 5b 9d 00 04 sw (sp+4),ra
800f0c8: b8 40 58 00 mv r11,r2
int rc = RC_OK;
if (file_cln == fat_fd->map.file_cln)
800f0cc: 28 42 00 34 lw r2,(r2+52)
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd,
uint32_t file_cln,
uint32_t *disk_cln
)
{
800f0d0: b8 20 80 00 mv r16,r1
800f0d4: b8 60 60 00 mv r12,r3
800f0d8: b8 80 70 00 mv r14,r4
int rc = RC_OK;
if (file_cln == fat_fd->map.file_cln)
800f0dc: 5c 62 00 04 bne r3,r2,800f0ec <fat_file_lseek+0x44>
*disk_cln = fat_fd->map.disk_cln;
800f0e0: 29 61 00 38 lw r1,(r11+56)
800f0e4: 58 81 00 00 sw (r4+0),r1
800f0e8: e0 00 00 15 bi 800f13c <fat_file_lseek+0x94>
{
uint32_t cur_cln;
uint32_t count;
uint32_t i;
if (file_cln > fat_fd->map.file_cln)
800f0ec: 50 43 00 05 bgeu r2,r3,800f100 <fat_file_lseek+0x58>
{
cur_cln = fat_fd->map.disk_cln;
800f0f0: 29 61 00 38 lw r1,(r11+56)
count = file_cln - fat_fd->map.file_cln;
800f0f4: c8 62 78 00 sub r15,r3,r2
uint32_t count;
uint32_t i;
if (file_cln > fat_fd->map.file_cln)
{
cur_cln = fat_fd->map.disk_cln;
800f0f8: 5b 81 00 20 sw (sp+32),r1
800f0fc: e0 00 00 04 bi 800f10c <fat_file_lseek+0x64>
count = file_cln - fat_fd->map.file_cln;
}
else
{
cur_cln = fat_fd->cln;
800f100: 29 61 00 1c lw r1,(r11+28)
800f104: b8 60 78 00 mv r15,r3
800f108: 5b 81 00 20 sw (sp+32),r1
count = file_cln;
}
/* skip over the clusters */
for (i = 0; i < count; i++)
800f10c: 34 0d 00 00 mvi r13,0
800f110: e0 00 00 06 bi 800f128 <fat_file_lseek+0x80>
{
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
800f114: ba 00 08 00 mv r1,r16
800f118: 37 83 00 20 addi r3,sp,32
800f11c: f8 00 25 17 calli 8018578 <fat_get_fat_cluster>
if ( rc != RC_OK )
800f120: 5c 20 00 08 bne r1,r0,800f140 <fat_file_lseek+0x98> <== NEVER TAKEN
cur_cln = fat_fd->cln;
count = file_cln;
}
/* skip over the clusters */
for (i = 0; i < count; i++)
800f124: 35 ad 00 01 addi r13,r13,1
800f128: 2b 82 00 20 lw r2,(sp+32)
800f12c: 55 ed ff fa bgu r15,r13,800f114 <fat_file_lseek+0x6c>
if ( rc != RC_OK )
return rc;
}
/* update cache */
fat_fd->map.file_cln = file_cln;
800f130: 59 6c 00 34 sw (r11+52),r12
fat_fd->map.disk_cln = cur_cln;
800f134: 59 62 00 38 sw (r11+56),r2
*disk_cln = cur_cln;
800f138: 59 c2 00 00 sw (r14+0),r2
}
return RC_OK;
800f13c: 34 01 00 00 mvi r1,0
}
800f140: 2b 9d 00 04 lw ra,(sp+4)
800f144: 2b 8b 00 1c lw r11,(sp+28)
800f148: 2b 8c 00 18 lw r12,(sp+24)
800f14c: 2b 8d 00 14 lw r13,(sp+20)
800f150: 2b 8e 00 10 lw r14,(sp+16)
800f154: 2b 8f 00 0c lw r15,(sp+12)
800f158: 2b 90 00 08 lw r16,(sp+8)
800f15c: 37 9c 00 20 addi sp,sp,32
800f160: c3 a0 00 00 ret
0800f164 <fat_file_open>:
fat_file_open(
fat_fs_info_t *fs_info,
fat_dir_pos_t *dir_pos,
fat_file_fd_t **fat_fd
)
{
800f164: 37 9c ff e0 addi sp,sp,-32
800f168: 5b 8b 00 1c sw (sp+28),r11
800f16c: 5b 8c 00 18 sw (sp+24),r12
800f170: 5b 8d 00 14 sw (sp+20),r13
800f174: 5b 8e 00 10 sw (sp+16),r14
800f178: 5b 8f 00 0c sw (sp+12),r15
800f17c: 5b 90 00 08 sw (sp+8),r16
800f180: 5b 9d 00 04 sw (sp+4),ra
800f184: b8 20 68 00 mv r13,r1
800f188: b8 40 60 00 mv r12,r2
800f18c: b8 60 78 00 mv r15,r3
int rc = RC_OK;
fat_file_fd_t *lfat_fd = NULL;
800f190: 5b 80 00 20 sw (sp+32),r0
uint32_t key = 0;
/* construct key */
key = fat_construct_key(fs_info, &dir_pos->sname);
800f194: fb ff ff 6b calli 800ef40 <fat_construct_key>
/* access "valid" hash table */
rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd);
800f198: 29 a2 00 6c lw r2,(r13+108)
int rc = RC_OK;
fat_file_fd_t *lfat_fd = NULL;
uint32_t key = 0;
/* construct key */
key = fat_construct_key(fs_info, &dir_pos->sname);
800f19c: b8 20 70 00 mv r14,r1
/* access "valid" hash table */
rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd);
800f1a0: b9 c0 18 00 mv r3,r14
800f1a4: b9 a0 08 00 mv r1,r13
800f1a8: 34 04 00 00 mvi r4,0
800f1ac: 37 85 00 20 addi r5,sp,32
800f1b0: fb ff ff 90 calli 800eff0 <_hash_search>
800f1b4: b8 20 10 00 mv r2,r1
if ( rc == RC_OK )
800f1b8: 5c 20 00 07 bne r1,r0,800f1d4 <fat_file_open+0x70>
{
/* return pointer to fat_file_descriptor allocated before */
(*fat_fd) = lfat_fd;
800f1bc: 2b 81 00 20 lw r1,(sp+32)
lfat_fd->links_num++;
800f1c0: 28 23 00 08 lw r3,(r1+8)
/* 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;
800f1c4: 59 e1 00 00 sw (r15+0),r1
lfat_fd->links_num++;
800f1c8: 34 63 00 01 addi r3,r3,1
800f1cc: 58 23 00 08 sw (r1+8),r3
return rc;
800f1d0: e0 00 00 3c bi 800f2c0 <fat_file_open+0x15c>
}
/* access "removed-but-still-open" hash table */
rc = _hash_search(fs_info, fs_info->rhash, key, key, &lfat_fd);
800f1d4: 29 a2 00 70 lw r2,(r13+112)
800f1d8: b9 c0 18 00 mv r3,r14
800f1dc: b9 c0 20 00 mv r4,r14
800f1e0: 37 85 00 20 addi r5,sp,32
800f1e4: b9 a0 08 00 mv r1,r13
800f1e8: fb ff ff 82 calli 800eff0 <_hash_search>
800f1ec: b8 20 80 00 mv r16,r1
lfat_fd = (*fat_fd) = (fat_file_fd_t*)malloc(sizeof(fat_file_fd_t));
800f1f0: 34 01 00 44 mvi r1,68
800f1f4: fb ff d1 0c calli 8003624 <malloc>
800f1f8: 59 e1 00 00 sw (r15+0),r1
800f1fc: 5b 81 00 20 sw (sp+32),r1
800f200: b8 20 58 00 mv r11,r1
if ( lfat_fd == NULL )
800f204: 44 20 00 1e be r1,r0,800f27c <fat_file_open+0x118> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( ENOMEM );
memset(lfat_fd, 0, sizeof(fat_file_fd_t));
800f208: 34 02 00 00 mvi r2,0
800f20c: 34 03 00 44 mvi r3,68
800f210: f8 00 32 20 calli 801ba90 <memset>
lfat_fd->links_num = 1;
800f214: 34 01 00 01 mvi r1,1
800f218: 59 61 00 08 sw (r11+8),r1
lfat_fd->flags &= ~FAT_FILE_REMOVED;
800f21c: 41 61 00 30 lbu r1,(r11+48)
lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
lfat_fd->dir_pos = *dir_pos;
800f220: 29 84 00 00 lw r4,(r12+0)
800f224: 29 83 00 04 lw r3,(r12+4)
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;
800f228: 20 21 00 fe andi r1,r1,0xfe
800f22c: 31 61 00 30 sb (r11+48),r1
lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
800f230: 34 01 ff ff mvi r1,-1
800f234: 59 61 00 3c sw (r11+60),r1
lfat_fd->dir_pos = *dir_pos;
800f238: 29 82 00 08 lw r2,(r12+8)
800f23c: 29 81 00 0c lw r1,(r12+12)
800f240: 59 64 00 20 sw (r11+32),r4
800f244: 59 63 00 24 sw (r11+36),r3
800f248: 59 62 00 28 sw (r11+40),r2
800f24c: 59 61 00 2c sw (r11+44),r1
if ( rc != RC_OK )
800f250: 46 00 00 03 be r16,r0,800f25c <fat_file_open+0xf8> <== NEVER TAKEN
lfat_fd->ino = key;
800f254: 59 6e 00 0c sw (r11+12),r14
800f258: e0 00 00 0e bi 800f290 <fat_file_open+0x12c>
else
{
lfat_fd->ino = fat_get_unique_ino(fs_info);
800f25c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800f260: f8 00 07 d4 calli 80111b0 <fat_get_unique_ino> <== NOT EXECUTED
800f264: 59 61 00 0c sw (r11+12),r1 <== NOT EXECUTED
if ( lfat_fd->ino == 0 )
800f268: 2b 81 00 20 lw r1,(sp+32) <== NOT EXECUTED
800f26c: 28 21 00 0c lw r1,(r1+12) <== NOT EXECUTED
800f270: 5c 30 00 08 bne r1,r16,800f290 <fat_file_open+0x12c> <== NOT EXECUTED
{
free((*fat_fd));
800f274: 29 e1 00 00 lw r1,(r15+0) <== NOT EXECUTED
800f278: fb ff cf 55 calli 8002fcc <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 );
800f27c: f8 00 2e 76 calli 801ac54 <__errno> <== NOT EXECUTED
800f280: 34 02 00 0c mvi r2,12 <== NOT EXECUTED
800f284: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
800f288: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED
800f28c: e0 00 00 0d bi 800f2c0 <fat_file_open+0x15c> <== NOT EXECUTED
*/
static inline void
_hash_insert(rtems_chain_control *hash, uint32_t key1, uint32_t key2,
fat_file_fd_t *el)
{
rtems_chain_append((hash) + ((key1) % FAT_HASH_MODULE), &(el)->link);
800f290: 21 ce 00 01 andi r14,r14,0x1
800f294: 34 02 00 01 mvi r2,1
800f298: b9 c0 08 00 mv r1,r14
800f29c: fb ff c7 d3 calli 80011e8 <__ashlsi3>
800f2a0: 34 02 00 02 mvi r2,2
800f2a4: b4 2e 08 00 add r1,r1,r14
800f2a8: fb ff c7 d0 calli 80011e8 <__ashlsi3>
800f2ac: 29 a2 00 6c lw r2,(r13+108)
RTEMS_INLINE_ROUTINE void rtems_chain_append(
rtems_chain_control *the_chain,
rtems_chain_node *the_node
)
{
_Chain_Append( the_chain, the_node );
800f2b0: b4 41 08 00 add r1,r2,r1
800f2b4: 2b 82 00 20 lw r2,(sp+32)
800f2b8: fb ff db d4 calli 8006208 <_Chain_Append>
/*
* other fields of fat-file descriptor will be initialized on upper
* level
*/
return RC_OK;
800f2bc: 34 02 00 00 mvi r2,0
}
800f2c0: b8 40 08 00 mv r1,r2
800f2c4: 2b 9d 00 04 lw ra,(sp+4)
800f2c8: 2b 8b 00 1c lw r11,(sp+28)
800f2cc: 2b 8c 00 18 lw r12,(sp+24)
800f2d0: 2b 8d 00 14 lw r13,(sp+20)
800f2d4: 2b 8e 00 10 lw r14,(sp+16)
800f2d8: 2b 8f 00 0c lw r15,(sp+12)
800f2dc: 2b 90 00 08 lw r16,(sp+8)
800f2e0: 37 9c 00 20 addi sp,sp,32
800f2e4: c3 a0 00 00 ret
0800f2fc <fat_file_read>:
fat_file_fd_t *fat_fd,
uint32_t start,
uint32_t count,
uint8_t *buf
)
{
800f2fc: 37 9c ff d0 addi sp,sp,-48
800f300: 5b 8b 00 2c sw (sp+44),r11
800f304: 5b 8c 00 28 sw (sp+40),r12
800f308: 5b 8d 00 24 sw (sp+36),r13
800f30c: 5b 8e 00 20 sw (sp+32),r14
800f310: 5b 8f 00 1c sw (sp+28),r15
800f314: 5b 90 00 18 sw (sp+24),r16
800f318: 5b 91 00 14 sw (sp+20),r17
800f31c: 5b 92 00 10 sw (sp+16),r18
800f320: 5b 93 00 0c sw (sp+12),r19
800f324: 5b 94 00 08 sw (sp+8),r20
800f328: 5b 9d 00 04 sw (sp+4),ra
int rc = RC_OK;
ssize_t ret = 0;
uint32_t cmpltd = 0;
uint32_t cur_cln = 0;
800f32c: 5b 80 00 30 sw (sp+48),r0
fat_file_fd_t *fat_fd,
uint32_t start,
uint32_t count,
uint8_t *buf
)
{
800f330: b8 20 58 00 mv r11,r1
800f334: b8 40 68 00 mv r13,r2
800f338: b8 60 70 00 mv r14,r3
800f33c: b8 80 60 00 mv r12,r4
800f340: b8 a0 a0 00 mv r20,r5
uint32_t byte = 0;
uint32_t c = 0;
/* it couldn't be removed - otherwise cache update will be broken */
if (count == 0)
return cmpltd;
800f344: 34 01 00 00 mvi r1,0
uint32_t sec = 0;
uint32_t byte = 0;
uint32_t c = 0;
/* it couldn't be removed - otherwise cache update will be broken */
if (count == 0)
800f348: 44 80 00 66 be r4,r0,800f4e0 <fat_file_read+0x1e4> <== NEVER TAKEN
/*
* >= because start is offset and computed from 0 and file_size
* computed from 1
*/
if ( start >= fat_fd->fat_file_size )
800f34c: 28 42 00 18 lw r2,(r2+24)
800f350: 50 62 00 64 bgeu r3,r2,800f4e0 <fat_file_read+0x1e4>
return FAT_EOF;
if ((count > fat_fd->fat_file_size) ||
800f354: 54 82 00 03 bgu r4,r2,800f360 <fat_file_read+0x64> <== NEVER TAKEN
(start > fat_fd->fat_file_size - count))
800f358: c8 44 08 00 sub r1,r2,r4
* computed from 1
*/
if ( start >= fat_fd->fat_file_size )
return FAT_EOF;
if ((count > fat_fd->fat_file_size) ||
800f35c: 50 23 00 02 bgeu r1,r3,800f364 <fat_file_read+0x68>
(start > fat_fd->fat_file_size - count))
count = fat_fd->fat_file_size - start;
800f360: c8 4e 60 00 sub r12,r2,r14
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
800f364: 29 a2 00 20 lw r2,(r13+32)
800f368: 34 01 00 01 mvi r1,1
800f36c: 5c 41 00 1c bne r2,r1,800f3dc <fat_file_read+0xe0>
800f370: 29 a1 00 24 lw r1,(r13+36)
800f374: 5c 20 00 1a bne r1,r0,800f3dc <fat_file_read+0xe0> <== NEVER TAKEN
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
800f378: 41 62 00 0e lbu r2,(r11+14)
800f37c: 20 42 00 03 andi r2,r2,0x3
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)) &&
800f380: 44 41 00 17 be r2,r1,800f3dc <fat_file_read+0xe0>
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
{
sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln);
800f384: 29 a1 00 1c lw r1,(r13+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)) )
800f388: 5c 20 00 03 bne r1,r0,800f394 <fat_file_read+0x98> <== NEVER TAKEN
return fs_info->vol.rdir_loc;
800f38c: 29 6d 00 20 lw r13,(r11+32)
800f390: e0 00 00 06 bi 800f3a8 <fat_file_read+0xac>
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
800f394: 41 62 00 05 lbu r2,(r11+5) <== NOT EXECUTED
800f398: 34 21 ff fe addi r1,r1,-2 <== NOT EXECUTED
800f39c: fb ff c7 93 calli 80011e8 <__ashlsi3> <== NOT EXECUTED
800f3a0: 29 6d 00 34 lw r13,(r11+52) <== NOT EXECUTED
800f3a4: b4 2d 68 00 add r13,r1,r13 <== NOT EXECUTED
sec += (start >> fs_info->vol.sec_log2);
800f3a8: 41 62 00 02 lbu r2,(r11+2)
800f3ac: b9 c0 08 00 mv r1,r14
800f3b0: f8 00 78 2a calli 802d458 <__lshrsi3>
byte = start & (fs_info->vol.bps - 1);
800f3b4: 2d 63 00 00 lhu r3,(r11+0)
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);
800f3b8: b5 a1 10 00 add r2,r13,r1
byte = start & (fs_info->vol.bps - 1);
ret = _fat_block_read(fs_info, sec, byte, count, buf);
800f3bc: b9 80 20 00 mv r4,r12
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
{
sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln);
sec += (start >> fs_info->vol.sec_log2);
byte = start & (fs_info->vol.bps - 1);
800f3c0: 34 63 ff ff addi r3,r3,-1
ret = _fat_block_read(fs_info, sec, byte, count, buf);
800f3c4: b9 60 08 00 mv r1,r11
800f3c8: a1 c3 18 00 and r3,r14,r3
800f3cc: ba 80 28 00 mv r5,r20
800f3d0: f8 00 03 6d calli 8010184 <_fat_block_read>
if ( ret < 0 )
800f3d4: 4c 20 00 43 bge r1,r0,800f4e0 <fat_file_read+0x1e4> <== ALWAYS TAKEN
800f3d8: e0 00 00 41 bi 800f4dc <fat_file_read+0x1e0> <== NOT EXECUTED
return -1;
return ret;
}
cl_start = start >> fs_info->vol.bpc_log2;
800f3dc: 41 62 00 08 lbu r2,(r11+8)
800f3e0: b9 c0 08 00 mv r1,r14
800f3e4: f8 00 78 1d calli 802d458 <__lshrsi3>
800f3e8: b8 20 98 00 mv r19,r1
save_ofs = ofs = start & (fs_info->vol.bpc - 1);
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
800f3ec: b9 a0 10 00 mv r2,r13
800f3f0: b9 60 08 00 mv r1,r11
800f3f4: ba 60 18 00 mv r3,r19
800f3f8: 37 84 00 30 addi r4,sp,48
return ret;
}
cl_start = start >> fs_info->vol.bpc_log2;
save_ofs = ofs = start & (fs_info->vol.bpc - 1);
800f3fc: 2d 6f 00 06 lhu r15,(r11+6)
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
800f400: fb ff ff 2a calli 800f0a8 <fat_file_lseek>
if (rc != RC_OK)
800f404: 5c 20 00 37 bne r1,r0,800f4e0 <fat_file_read+0x1e4> <== NEVER TAKEN
return ret;
}
cl_start = start >> fs_info->vol.bpc_log2;
save_ofs = ofs = start & (fs_info->vol.bpc - 1);
800f408: 35 e1 ff ff addi r1,r15,-1
800f40c: a1 c1 70 00 and r14,r14,r1
800f410: b9 c0 88 00 mv r17,r14
800f414: 34 12 00 00 mvi r18,0
800f418: 34 0f 00 00 mvi r15,0
800f41c: e0 00 00 26 bi 800f4b4 <fat_file_read+0x1b8>
if (rc != RC_OK)
return rc;
while (count > 0)
{
c = MIN(count, (fs_info->vol.bpc - ofs));
800f420: 2d 70 00 06 lhu r16,(r11+6)
800f424: ca 11 80 00 sub r16,r16,r17
800f428: 51 90 00 02 bgeu r12,r16,800f430 <fat_file_read+0x134>
800f42c: b9 80 80 00 mv r16,r12
sec = fat_cluster_num_to_sector_num(fs_info, cur_cln);
800f430: 2b 82 00 30 lw r2,(sp+48)
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)) )
800f434: 5c 40 00 06 bne r2,r0,800f44c <fat_file_read+0x150> <== ALWAYS TAKEN
800f438: 41 61 00 0e lbu r1,(r11+14) <== NOT EXECUTED
800f43c: 20 21 00 03 andi r1,r1,0x3 <== NOT EXECUTED
800f440: 44 22 00 03 be r1,r2,800f44c <fat_file_read+0x150> <== NOT EXECUTED
return fs_info->vol.rdir_loc;
800f444: 29 72 00 20 lw r18,(r11+32) <== NOT EXECUTED
800f448: e0 00 00 06 bi 800f460 <fat_file_read+0x164> <== NOT EXECUTED
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
800f44c: 34 41 ff fe addi r1,r2,-2
800f450: 41 62 00 05 lbu r2,(r11+5)
800f454: fb ff c7 65 calli 80011e8 <__ashlsi3>
800f458: 29 72 00 34 lw r18,(r11+52)
800f45c: b4 32 90 00 add r18,r1,r18
sec += (ofs >> fs_info->vol.sec_log2);
800f460: 41 62 00 02 lbu r2,(r11+2)
800f464: ba 20 08 00 mv r1,r17
800f468: f8 00 77 fc calli 802d458 <__lshrsi3>
byte = ofs & (fs_info->vol.bps - 1);
800f46c: 2d 63 00 00 lhu r3,(r11+0)
while (count > 0)
{
c = MIN(count, (fs_info->vol.bpc - ofs));
sec = fat_cluster_num_to_sector_num(fs_info, cur_cln);
sec += (ofs >> fs_info->vol.sec_log2);
800f470: b6 41 10 00 add r2,r18,r1
byte = ofs & (fs_info->vol.bps - 1);
ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd);
800f474: ba 00 20 00 mv r4,r16
{
c = MIN(count, (fs_info->vol.bpc - ofs));
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);
800f478: 34 63 ff ff addi r3,r3,-1
ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd);
800f47c: b9 60 08 00 mv r1,r11
800f480: a2 23 18 00 and r3,r17,r3
800f484: b6 8f 28 00 add r5,r20,r15
800f488: f8 00 03 3f calli 8010184 <_fat_block_read>
if ( ret < 0 )
800f48c: 48 01 00 14 bg r0,r1,800f4dc <fat_file_read+0x1e0> <== NEVER TAKEN
return -1;
count -= c;
cmpltd += c;
save_cln = cur_cln;
800f490: 2b 92 00 30 lw r18,(sp+48)
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
800f494: b9 60 08 00 mv r1,r11
800f498: 37 83 00 30 addi r3,sp,48
800f49c: ba 40 10 00 mv r2,r18
800f4a0: f8 00 24 36 calli 8018578 <fat_get_fat_cluster>
if ( rc != RC_OK )
800f4a4: 5c 20 00 0f bne r1,r0,800f4e0 <fat_file_read+0x1e4> <== NEVER TAKEN
ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd);
if ( ret < 0 )
return -1;
count -= c;
800f4a8: c9 90 60 00 sub r12,r12,r16
cmpltd += c;
800f4ac: b5 f0 78 00 add r15,r15,r16
save_cln = cur_cln;
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
if ( rc != RC_OK )
return rc;
ofs = 0;
800f4b0: 34 11 00 00 mvi r17,0
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
if (rc != RC_OK)
return rc;
while (count > 0)
800f4b4: 5d 80 ff db bne r12,r0,800f420 <fat_file_read+0x124>
}
/* 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);
800f4b8: 41 62 00 08 lbu r2,(r11+8)
800f4bc: 35 ce ff ff addi r14,r14,-1
800f4c0: b5 cf 08 00 add r1,r14,r15
800f4c4: f8 00 77 e5 calli 802d458 <__lshrsi3>
ofs = 0;
}
/* update cache */
/* XXX: check this - I'm not sure :( */
fat_fd->map.file_cln = cl_start +
800f4c8: b4 33 08 00 add r1,r1,r19
800f4cc: 59 a1 00 34 sw (r13+52),r1
((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2);
fat_fd->map.disk_cln = save_cln;
800f4d0: 59 b2 00 38 sw (r13+56),r18
return cmpltd;
800f4d4: b9 e0 08 00 mv r1,r15
800f4d8: e0 00 00 02 bi 800f4e0 <fat_file_read+0x1e4>
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;
800f4dc: 34 01 ff ff mvi r1,-1 <== 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;
}
800f4e0: 2b 9d 00 04 lw ra,(sp+4)
800f4e4: 2b 8b 00 2c lw r11,(sp+44)
800f4e8: 2b 8c 00 28 lw r12,(sp+40)
800f4ec: 2b 8d 00 24 lw r13,(sp+36)
800f4f0: 2b 8e 00 20 lw r14,(sp+32)
800f4f4: 2b 8f 00 1c lw r15,(sp+28)
800f4f8: 2b 90 00 18 lw r16,(sp+24)
800f4fc: 2b 91 00 14 lw r17,(sp+20)
800f500: 2b 92 00 10 lw r18,(sp+16)
800f504: 2b 93 00 0c lw r19,(sp+12)
800f508: 2b 94 00 08 lw r20,(sp+8)
800f50c: 37 9c 00 30 addi sp,sp,48
800f510: c3 a0 00 00 ret
0800fd4c <fat_file_size>:
int
fat_file_size(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd
)
{
800fd4c: 37 9c ff ec addi sp,sp,-20
800fd50: 5b 8b 00 10 sw (sp+16),r11
800fd54: 5b 8c 00 0c sw (sp+12),r12
800fd58: 5b 8d 00 08 sw (sp+8),r13
800fd5c: 5b 9d 00 04 sw (sp+4),ra
800fd60: b8 20 60 00 mv r12,r1
int rc = RC_OK;
uint32_t cur_cln = fat_fd->cln;
800fd64: 28 41 00 1c lw r1,(r2+28)
int
fat_file_size(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd
)
{
800fd68: b8 40 58 00 mv r11,r2
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)) &&
800fd6c: 28 42 00 20 lw r2,(r2+32)
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd
)
{
int rc = RC_OK;
uint32_t cur_cln = fat_fd->cln;
800fd70: 5b 81 00 14 sw (sp+20),r1
uint32_t save_cln = 0;
/* Have we requested root dir size for FAT12/16? */
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
800fd74: 34 01 00 01 mvi r1,1
800fd78: 5c 41 00 09 bne r2,r1,800fd9c <fat_file_size+0x50>
800fd7c: 29 61 00 24 lw r1,(r11+36)
800fd80: 5c 20 00 07 bne r1,r0,800fd9c <fat_file_size+0x50> <== NEVER TAKEN
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
800fd84: 41 82 00 0e lbu r2,(r12+14)
800fd88: 20 42 00 03 andi r2,r2,0x3
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)) &&
800fd8c: 44 41 00 04 be r2,r1,800fd9c <fat_file_size+0x50> <== ALWAYS TAKEN
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
{
fat_fd->fat_file_size = fs_info->vol.rdir_size;
800fd90: 29 81 00 2c lw r1,(r12+44) <== NOT EXECUTED
800fd94: 59 61 00 18 sw (r11+24),r1 <== NOT EXECUTED
800fd98: e0 00 00 14 bi 800fde8 <fat_file_size+0x9c> <== NOT EXECUTED
return rc;
}
fat_fd->fat_file_size = 0;
800fd9c: 59 60 00 18 sw (r11+24),r0
fat_file_fd_t *fat_fd
)
{
int rc = RC_OK;
uint32_t cur_cln = fat_fd->cln;
uint32_t save_cln = 0;
800fda0: 34 01 00 00 mvi r1,0
return rc;
}
fat_fd->fat_file_size = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
800fda4: e0 00 00 0b bi 800fdd0 <fat_file_size+0x84>
{
save_cln = cur_cln;
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
800fda8: b9 80 08 00 mv r1,r12
800fdac: b9 a0 10 00 mv r2,r13
800fdb0: 37 83 00 14 addi r3,sp,20
800fdb4: f8 00 21 f1 calli 8018578 <fat_get_fat_cluster>
if ( rc != RC_OK )
800fdb8: 5c 20 00 0d bne r1,r0,800fdec <fat_file_size+0xa0> <== NEVER TAKEN
return rc;
fat_fd->fat_file_size += fs_info->vol.bpc;
800fdbc: 2d 81 00 06 lhu r1,(r12+6)
800fdc0: 29 62 00 18 lw r2,(r11+24)
800fdc4: b4 41 08 00 add r1,r2,r1
800fdc8: 59 61 00 18 sw (r11+24),r1
fat_fd->fat_file_size = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
{
save_cln = cur_cln;
800fdcc: b9 a0 08 00 mv r1,r13
return rc;
}
fat_fd->fat_file_size = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
800fdd0: 2b 8d 00 14 lw r13,(sp+20)
800fdd4: 29 82 00 10 lw r2,(r12+16)
800fdd8: 29 83 00 14 lw r3,(r12+20)
800fddc: a1 a2 10 00 and r2,r13,r2
800fde0: 54 62 ff f2 bgu r3,r2,800fda8 <fat_file_size+0x5c>
if ( rc != RC_OK )
return rc;
fat_fd->fat_file_size += fs_info->vol.bpc;
}
fat_fd->map.last_cln = save_cln;
800fde4: 59 61 00 3c sw (r11+60),r1
return rc;
800fde8: 34 01 00 00 mvi r1,0
}
800fdec: 2b 9d 00 04 lw ra,(sp+4)
800fdf0: 2b 8b 00 10 lw r11,(sp+16)
800fdf4: 2b 8c 00 0c lw r12,(sp+12)
800fdf8: 2b 8d 00 08 lw r13,(sp+8)
800fdfc: 37 9c 00 14 addi sp,sp,20
800fe00: c3 a0 00 00 ret
0800f514 <fat_file_truncate>:
fat_file_truncate(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd,
uint32_t new_length
)
{
800f514: 37 9c ff e0 addi sp,sp,-32
800f518: 5b 8b 00 18 sw (sp+24),r11
800f51c: 5b 8c 00 14 sw (sp+20),r12
800f520: 5b 8d 00 10 sw (sp+16),r13
800f524: 5b 8e 00 0c sw (sp+12),r14
800f528: 5b 8f 00 08 sw (sp+8),r15
800f52c: 5b 9d 00 04 sw (sp+4),ra
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 )
800f530: 28 4e 00 18 lw r14,(r2+24)
fat_file_truncate(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd,
uint32_t new_length
)
{
800f534: b8 20 60 00 mv r12,r1
int rc = RC_OK;
uint32_t cur_cln = 0;
uint32_t cl_start = 0;
uint32_t new_last_cln = FAT_UNDEFINED_VALUE;
800f538: 34 01 ff ff mvi r1,-1
fat_file_fd_t *fat_fd,
uint32_t new_length
)
{
int rc = RC_OK;
uint32_t cur_cln = 0;
800f53c: 5b 80 00 20 sw (sp+32),r0
uint32_t cl_start = 0;
uint32_t new_last_cln = FAT_UNDEFINED_VALUE;
800f540: 5b 81 00 1c sw (sp+28),r1
fat_file_truncate(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd,
uint32_t new_length
)
{
800f544: b8 40 58 00 mv r11,r2
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 )
800f548: 50 6e 00 36 bgeu r3,r14,800f620 <fat_file_truncate+0x10c>
return rc;
assert(fat_fd->fat_file_size);
800f54c: 5d c0 00 09 bne r14,r0,800f570 <fat_file_truncate+0x5c> <== ALWAYS TAKEN
800f550: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED
800f554: 78 03 08 02 mvhi r3,0x802 <== NOT EXECUTED
800f558: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED
800f55c: 38 21 e6 fc ori r1,r1,0xe6fc <== NOT EXECUTED
800f560: 34 02 02 d1 mvi r2,721 <== NOT EXECUTED
800f564: 38 63 e7 5c ori r3,r3,0xe75c <== NOT EXECUTED
800f568: 38 84 e7 44 ori r4,r4,0xe744 <== NOT EXECUTED
800f56c: f8 00 09 ea calli 8011d14 <__assert_func> <== NOT EXECUTED
cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2;
800f570: 2d 81 00 06 lhu r1,(r12+6)
800f574: 41 8f 00 08 lbu r15,(r12+8)
800f578: 34 21 ff ff addi r1,r1,-1
800f57c: b4 23 08 00 add r1,r1,r3
800f580: b9 e0 10 00 mv r2,r15
800f584: f8 00 77 b5 calli 802d458 <__lshrsi3>
if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size)
800f588: b9 e0 10 00 mv r2,r15
if ( new_length >= fat_fd->fat_file_size )
return rc;
assert(fat_fd->fat_file_size);
cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2;
800f58c: b8 20 68 00 mv r13,r1
if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size)
800f590: fb ff c7 16 calli 80011e8 <__ashlsi3>
return RC_OK;
800f594: 34 04 00 00 mvi r4,0
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)
800f598: 50 2e 00 23 bgeu r1,r14,800f624 <fat_file_truncate+0x110>
return RC_OK;
if (cl_start != 0)
800f59c: 45 a0 00 08 be r13,r0,800f5bc <fat_file_truncate+0xa8>
{
rc = fat_file_lseek(fs_info, fat_fd, cl_start - 1, &new_last_cln);
800f5a0: 37 84 00 1c addi r4,sp,28
800f5a4: b9 80 08 00 mv r1,r12
800f5a8: b9 60 10 00 mv r2,r11
800f5ac: 35 a3 ff ff addi r3,r13,-1
800f5b0: fb ff fe be calli 800f0a8 <fat_file_lseek>
800f5b4: b8 20 20 00 mv r4,r1
if (rc != RC_OK)
800f5b8: 5c 20 00 1b bne r1,r0,800f624 <fat_file_truncate+0x110> <== NEVER TAKEN
return rc;
}
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
800f5bc: 37 84 00 20 addi r4,sp,32
800f5c0: b9 80 08 00 mv r1,r12
800f5c4: b9 60 10 00 mv r2,r11
800f5c8: b9 a0 18 00 mv r3,r13
800f5cc: fb ff fe b7 calli 800f0a8 <fat_file_lseek>
800f5d0: b8 20 20 00 mv r4,r1
if (rc != RC_OK)
800f5d4: 5c 20 00 14 bne r1,r0,800f624 <fat_file_truncate+0x110> <== NEVER TAKEN
return rc;
rc = fat_free_fat_clusters_chain(fs_info, cur_cln);
800f5d8: 2b 82 00 20 lw r2,(sp+32)
800f5dc: b9 80 08 00 mv r1,r12
800f5e0: f8 00 25 43 calli 8018aec <fat_free_fat_clusters_chain>
800f5e4: b8 20 20 00 mv r4,r1
if (rc != RC_OK)
800f5e8: 5c 20 00 0f bne r1,r0,800f624 <fat_file_truncate+0x110> <== NEVER TAKEN
return rc;
if (cl_start != 0)
800f5ec: 45 a1 00 0e be r13,r1,800f624 <fat_file_truncate+0x110>
{
rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC);
800f5f0: 2b 82 00 1c lw r2,(sp+28)
800f5f4: b9 80 08 00 mv r1,r12
800f5f8: 34 03 ff ff mvi r3,-1
800f5fc: f8 00 24 6a calli 80187a4 <fat_set_fat_cluster>
800f600: b8 20 20 00 mv r4,r1
if ( rc != RC_OK )
800f604: 5c 20 00 08 bne r1,r0,800f624 <fat_file_truncate+0x110> <== NEVER TAKEN
return rc;
fat_fd->map.file_cln = cl_start - 1;
fat_fd->map.disk_cln = new_last_cln;
800f608: 2b 81 00 1c lw r1,(sp+28)
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;
800f60c: 35 ad ff ff addi r13,r13,-1
800f610: 59 6d 00 34 sw (r11+52),r13
fat_fd->map.disk_cln = new_last_cln;
800f614: 59 61 00 38 sw (r11+56),r1
fat_fd->map.last_cln = new_last_cln;
800f618: 59 61 00 3c sw (r11+60),r1
800f61c: e0 00 00 02 bi 800f624 <fat_file_truncate+0x110>
uint32_t cl_start = 0;
uint32_t new_last_cln = FAT_UNDEFINED_VALUE;
if ( new_length >= fat_fd->fat_file_size )
return rc;
800f620: 34 04 00 00 mvi r4,0
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;
}
800f624: b8 80 08 00 mv r1,r4
800f628: 2b 9d 00 04 lw ra,(sp+4)
800f62c: 2b 8b 00 18 lw r11,(sp+24)
800f630: 2b 8c 00 14 lw r12,(sp+20)
800f634: 2b 8d 00 10 lw r13,(sp+16)
800f638: 2b 8e 00 0c lw r14,(sp+12)
800f63c: 2b 8f 00 08 lw r15,(sp+8)
800f640: 37 9c 00 20 addi sp,sp,32
800f644: c3 a0 00 00 ret
0800fa3c <fat_file_write>:
fat_file_fd_t *fat_fd,
uint32_t start,
uint32_t count,
const uint8_t *buf
)
{
800fa3c: 37 9c ff b8 addi sp,sp,-72
800fa40: 5b 8b 00 40 sw (sp+64),r11
800fa44: 5b 8c 00 3c sw (sp+60),r12
800fa48: 5b 8d 00 38 sw (sp+56),r13
800fa4c: 5b 8e 00 34 sw (sp+52),r14
800fa50: 5b 8f 00 30 sw (sp+48),r15
800fa54: 5b 90 00 2c sw (sp+44),r16
800fa58: 5b 91 00 28 sw (sp+40),r17
800fa5c: 5b 92 00 24 sw (sp+36),r18
800fa60: 5b 93 00 20 sw (sp+32),r19
800fa64: 5b 94 00 1c sw (sp+28),r20
800fa68: 5b 95 00 18 sw (sp+24),r21
800fa6c: 5b 96 00 14 sw (sp+20),r22
800fa70: 5b 97 00 10 sw (sp+16),r23
800fa74: 5b 98 00 0c sw (sp+12),r24
800fa78: 5b 99 00 08 sw (sp+8),r25
800fa7c: 5b 9d 00 04 sw (sp+4),ra
int rc = RC_OK;
ssize_t ret;
uint32_t cmpltd = 0;
uint32_t byte;
uint32_t c = 0;
800fa80: 5b 80 00 48 sw (sp+72),r0
fat_file_fd_t *fat_fd,
uint32_t start,
uint32_t count,
const uint8_t *buf
)
{
800fa84: b8 40 58 00 mv r11,r2
800fa88: b8 60 70 00 mv r14,r3
ssize_t ret;
uint32_t cmpltd = 0;
uint32_t byte;
uint32_t c = 0;
bool zero_fill = start > fat_fd->fat_file_size;
uint32_t file_cln_initial = fat_fd->map.file_cln;
800fa8c: 28 59 00 34 lw r25,(r2+52)
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;
800fa90: 28 43 00 18 lw r3,(r2+24)
fat_file_fd_t *fat_fd,
uint32_t start,
uint32_t count,
const uint8_t *buf
)
{
800fa94: b8 20 60 00 mv r12,r1
800fa98: b8 a0 b0 00 mv r22,r5
uint32_t file_cln_initial = fat_fd->map.file_cln;
uint32_t cln;
if ( count == 0 )
return cmpltd;
800fa9c: 34 02 00 00 mvi r2,0
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 )
800faa0: 44 80 00 69 be r4,r0,800fc44 <fat_file_write+0x208> <== NEVER TAKEN
return cmpltd;
if (start >= fat_fd->size_limit)
800faa4: 29 6d 00 14 lw r13,(r11+20)
800faa8: 55 ae 00 06 bgu r13,r14,800fac0 <fat_file_write+0x84> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EFBIG);
800faac: f8 00 2c 6a calli 801ac54 <__errno> <== NOT EXECUTED
800fab0: 34 02 00 1b mvi r2,27 <== NOT EXECUTED
800fab4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
800fab8: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED
800fabc: e0 00 00 62 bi 800fc44 <fat_file_write+0x208> <== NOT EXECUTED
if (count > fat_fd->size_limit - start)
800fac0: c9 ae 68 00 sub r13,r13,r14
if ( count == 0 )
return cmpltd;
if (start >= fat_fd->size_limit)
rtems_set_errno_and_return_minus_one(EFBIG);
800fac4: 50 8d 00 02 bgeu r4,r13,800facc <fat_file_write+0x90> <== NEVER TAKEN
800fac8: b8 80 68 00 mv r13,r4
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);
800facc: b5 ae 78 00 add r15,r13,r14
800fad0: f5 c3 18 00 cmpgu r3,r14,r3
800fad4: b9 60 10 00 mv r2,r11
800fad8: b9 80 08 00 mv r1,r12
800fadc: b9 e0 20 00 mv r4,r15
800fae0: 37 85 00 48 addi r5,sp,72
800fae4: fb ff ff 41 calli 800f7e8 <fat_file_extend>
800fae8: b8 20 10 00 mv r2,r1
if (RC_OK == rc)
800faec: 5c 20 00 56 bne r1,r0,800fc44 <fat_file_write+0x208>
{
/*
* check whether there was enough room on device to locate
* file of 'start + count' bytes
*/
if (c != (start + count))
800faf0: 2b 81 00 48 lw r1,(sp+72)
800faf4: 44 2f 00 02 be r1,r15,800fafc <fat_file_write+0xc0> <== ALWAYS TAKEN
count = c - start;
800faf8: c8 2e 68 00 sub r13,r1,r14 <== 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));
800fafc: 29 63 00 20 lw r3,(r11+32)
800fb00: 34 01 00 01 mvi r1,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))
800fb04: 41 82 00 0e lbu r2,(r12+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));
800fb08: 5c 61 00 62 bne r3,r1,800fc90 <fat_file_write+0x254>
800fb0c: 29 61 00 24 lw r1,(r11+36)
800fb10: 5c 20 00 60 bne r1,r0,800fc90 <fat_file_write+0x254> <== NEVER TAKEN
800fb14: 20 42 00 03 andi r2,r2,0x3
800fb18: 44 41 00 5e be r2,r1,800fc90 <fat_file_write+0x254>
/* 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);
800fb1c: 41 82 00 08 lbu r2,(r12+8)
800fb20: b9 c0 08 00 mv r1,r14
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;
800fb24: 29 6b 00 1c lw r11,(r11+28)
cln += (start >> fs_info->vol.bpc_log2);
800fb28: f8 00 76 4c calli 802d458 <__lshrsi3>
byte = start & (fs_info->vol.bpc -1);
800fb2c: 2d 83 00 06 lhu r3,(r12+6)
/* 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);
800fb30: b4 2b 10 00 add r2,r1,r11
byte = start & (fs_info->vol.bpc -1);
ret = fat_cluster_write(fs_info,
800fb34: b9 a0 20 00 mv r4,r13
/* 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);
800fb38: 34 63 ff ff addi r3,r3,-1
ret = fat_cluster_write(fs_info,
800fb3c: b9 80 08 00 mv r1,r12
800fb40: a1 c3 18 00 and r3,r14,r3
800fb44: ba c0 28 00 mv r5,r22
800fb48: 34 06 00 00 mvi r6,0
800fb4c: f8 00 02 6a calli 80104f4 <fat_cluster_write>
byte,
count,
buf,
false);
if (0 > ret)
rc = -1;
800fb50: 34 02 ff ff mvi r2,-1
cln,
byte,
count,
buf,
false);
if (0 > ret)
800fb54: 48 01 00 3c bg r0,r1,800fc44 <fat_file_write+0x208> <== NEVER TAKEN
rc = -1;
else
cmpltd = ret;
800fb58: b8 20 10 00 mv r2,r1
800fb5c: e0 00 00 3a bi 800fc44 <fat_file_write+0x208>
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);
800fb60: b9 e0 10 00 mv r2,r15
800fb64: ba 20 08 00 mv r1,r17
800fb68: fb ff c5 a0 calli 80011e8 <__ashlsi3>
800fb6c: c9 c1 70 00 sub r14,r14,r1
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;
800fb70: 2b 94 00 44 lw r20,(sp+68)
800fb74: 29 61 00 1c lw r1,(r11+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);
800fb78: b9 c0 98 00 mv r19,r14
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;
800fb7c: 34 10 00 00 mvi r16,0
800fb80: ca 81 a0 00 sub r20,r20,r1
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;
800fb84: 34 18 00 00 mvi r24,0
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 */
800fb88: 34 12 00 00 mvi r18,0
const uint32_t count,
const uint8_t *buf,
const uint32_t file_cln_initial)
{
int rc = RC_OK;
uint32_t cmpltd = 0;
800fb8c: 34 0f 00 00 mvi r15,0
800fb90: e0 00 00 1c bi 800fc00 <fat_file_write+0x1c4>
{
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));
800fb94: 2d 84 00 06 lhu r4,(r12+6)
800fb98: c8 93 20 00 sub r4,r4,r19
800fb9c: 51 a4 00 02 bgeu r13,r4,800fba4 <fat_file_write+0x168>
800fba0: b9 a0 20 00 mv r4,r13
if (file_cln_initial < file_cln_cnt)
800fba4: 56 99 00 02 bgu r20,r25,800fbac <fat_file_write+0x170>
800fba8: e0 00 00 02 bi 800fbb0 <fat_file_write+0x174>
overwrite_cluster = true;
800fbac: 34 18 00 01 mvi r24,1
ret = fat_cluster_write(fs_info,
800fbb0: 2b 82 00 44 lw r2,(sp+68)
800fbb4: b9 80 08 00 mv r1,r12
800fbb8: ba 60 18 00 mv r3,r19
800fbbc: b6 cf 28 00 add r5,r22,r15
800fbc0: bb 00 30 00 mv r6,r24
800fbc4: f8 00 02 4c calli 80104f4 <fat_cluster_write>
cur_cln,
ofs_cln,
c,
&buf[cmpltd],
overwrite_cluster);
if (0 > ret)
800fbc8: 34 10 ff ff mvi r16,-1
800fbcc: 48 01 00 0d bg r0,r1,800fc00 <fat_file_write+0x1c4> <== NEVER TAKEN
rc = -1;
if (RC_OK == rc)
{
++file_cln_cnt;
bytes_to_write -= ret;
800fbd0: c9 a1 68 00 sub r13,r13,r1
if (0 > ret)
rc = -1;
if (RC_OK == rc)
{
++file_cln_cnt;
800fbd4: 36 94 00 01 addi r20,r20,1
bytes_to_write -= ret;
cmpltd += ret;
800fbd8: b5 e1 78 00 add r15,r15,r1
save_cln = cur_cln;
800fbdc: 2b 92 00 44 lw r18,(sp+68)
if (0 < bytes_to_write)
800fbe0: 34 10 00 00 mvi r16,0
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
ofs_cln = 0;
800fbe4: 34 13 00 00 mvi r19,0
{
++file_cln_cnt;
bytes_to_write -= ret;
cmpltd += ret;
save_cln = cur_cln;
if (0 < bytes_to_write)
800fbe8: 45 a0 00 06 be r13,r0,800fc00 <fat_file_write+0x1c4>
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
800fbec: b9 80 08 00 mv r1,r12
800fbf0: ba 40 10 00 mv r2,r18
800fbf4: ba a0 18 00 mv r3,r21
800fbf8: f8 00 22 60 calli 8018578 <fat_get_fat_cluster>
800fbfc: b8 20 80 00 mv r16,r1
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)
&& (bytes_to_write > 0))
800fc00: 7d b7 00 00 cmpnei r23,r13,0
rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln);
if (RC_OK == rc)
{
file_cln_cnt = cur_cln - fat_fd->cln;
while ( (RC_OK == rc)
800fc04: 66 01 00 00 cmpei r1,r16,0
800fc08: a2 e1 b8 00 and r23,r23,r1
800fc0c: 5e e0 ff e2 bne r23,r0,800fb94 <fat_file_write+0x158>
}
/* 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);
800fc10: 41 82 00 08 lbu r2,(r12+8)
800fc14: 35 ce ff ff addi r14,r14,-1
800fc18: b5 cf 08 00 add r1,r14,r15
800fc1c: f8 00 76 0f calli 802d458 <__lshrsi3>
}
}
/* update cache */
/* XXX: check this - I'm not sure :( */
fat_fd->map.file_cln = start_cln +
800fc20: b4 31 08 00 add r1,r1,r17
800fc24: 59 61 00 34 sw (r11+52),r1
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
fat_fd->map.disk_cln = save_cln;
800fc28: 59 72 00 38 sw (r11+56),r18
}
if (RC_OK != rc)
800fc2c: ba 00 30 00 mv r6,r16
800fc30: 5e 17 00 02 bne r16,r23,800fc38 <fat_file_write+0x1fc> <== NEVER TAKEN
return rc;
else
return cmpltd;
800fc34: b9 e0 30 00 mv r6,r15
start,
count,
buf,
file_cln_initial);
if (0 > ret)
rc = -1;
800fc38: 34 02 ff ff mvi r2,-1
fat_fd,
start,
count,
buf,
file_cln_initial);
if (0 > ret)
800fc3c: 48 06 00 02 bg r0,r6,800fc44 <fat_file_write+0x208> <== NEVER TAKEN
rc = -1;
else
cmpltd = ret;
800fc40: b8 c0 10 00 mv r2,r6
}
if (RC_OK != rc)
return rc;
else
return cmpltd;
}
800fc44: b8 40 08 00 mv r1,r2
800fc48: 2b 9d 00 04 lw ra,(sp+4)
800fc4c: 2b 8b 00 40 lw r11,(sp+64)
800fc50: 2b 8c 00 3c lw r12,(sp+60)
800fc54: 2b 8d 00 38 lw r13,(sp+56)
800fc58: 2b 8e 00 34 lw r14,(sp+52)
800fc5c: 2b 8f 00 30 lw r15,(sp+48)
800fc60: 2b 90 00 2c lw r16,(sp+44)
800fc64: 2b 91 00 28 lw r17,(sp+40)
800fc68: 2b 92 00 24 lw r18,(sp+36)
800fc6c: 2b 93 00 20 lw r19,(sp+32)
800fc70: 2b 94 00 1c lw r20,(sp+28)
800fc74: 2b 95 00 18 lw r21,(sp+24)
800fc78: 2b 96 00 14 lw r22,(sp+20)
800fc7c: 2b 97 00 10 lw r23,(sp+16)
800fc80: 2b 98 00 0c lw r24,(sp+12)
800fc84: 2b 99 00 08 lw r25,(sp+8)
800fc88: 37 9c 00 48 addi sp,sp,72
800fc8c: c3 a0 00 00 ret
{
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;
800fc90: 41 8f 00 08 lbu r15,(r12+8)
800fc94: b9 c0 08 00 mv r1,r14
const uint8_t *buf,
const uint32_t file_cln_initial)
{
int rc = RC_OK;
uint32_t cmpltd = 0;
uint32_t cur_cln = 0;
800fc98: 5b 80 00 44 sw (sp+68),r0
uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */
uint32_t start_cln = start >> fs_info->vol.bpc_log2;
800fc9c: b9 e0 10 00 mv r2,r15
800fca0: f8 00 75 ee calli 802d458 <__lshrsi3>
800fca4: b8 20 88 00 mv r17,r1
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);
800fca8: 37 95 00 44 addi r21,sp,68
800fcac: b9 80 08 00 mv r1,r12
800fcb0: b9 60 10 00 mv r2,r11
800fcb4: ba 20 18 00 mv r3,r17
800fcb8: ba a0 20 00 mv r4,r21
800fcbc: fb ff fc fb calli 800f0a8 <fat_file_lseek>
800fcc0: b8 20 30 00 mv r6,r1
if (RC_OK == rc)
800fcc4: 44 20 ff a7 be r1,r0,800fb60 <fat_file_write+0x124> <== ALWAYS TAKEN
800fcc8: e3 ff ff dc bi 800fc38 <fat_file_write+0x1fc> <== NOT EXECUTED
08018aec <fat_free_fat_clusters_chain>:
int
fat_free_fat_clusters_chain(
fat_fs_info_t *fs_info,
uint32_t chain
)
{
8018aec: 37 9c ff e0 addi sp,sp,-32
8018af0: 5b 8b 00 1c sw (sp+28),r11
8018af4: 5b 8c 00 18 sw (sp+24),r12
8018af8: 5b 8d 00 14 sw (sp+20),r13
8018afc: 5b 8e 00 10 sw (sp+16),r14
8018b00: 5b 8f 00 0c sw (sp+12),r15
8018b04: 5b 90 00 08 sw (sp+8),r16
8018b08: 5b 9d 00 04 sw (sp+4),ra
int rc = RC_OK, rc1 = RC_OK;
uint32_t cur_cln = chain;
uint32_t next_cln = 0;
uint32_t freed_cls_cnt = 0;
8018b0c: 34 0d 00 00 mvi r13,0
int
fat_free_fat_clusters_chain(
fat_fs_info_t *fs_info,
uint32_t chain
)
{
8018b10: b8 20 58 00 mv r11,r1
8018b14: b8 40 80 00 mv r16,r2
int rc = RC_OK, rc1 = RC_OK;
uint32_t cur_cln = chain;
uint32_t next_cln = 0;
8018b18: 5b 80 00 20 sw (sp+32),r0
fat_fs_info_t *fs_info,
uint32_t chain
)
{
int rc = RC_OK, rc1 = RC_OK;
uint32_t cur_cln = chain;
8018b1c: b8 40 70 00 mv r14,r2
fat_free_fat_clusters_chain(
fat_fs_info_t *fs_info,
uint32_t chain
)
{
int rc = RC_OK, rc1 = RC_OK;
8018b20: 34 0f 00 00 mvi r15,0
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)
8018b24: e0 00 00 17 bi 8018b80 <fat_free_fat_clusters_chain+0x94>
{
rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln);
8018b28: b9 60 08 00 mv r1,r11
8018b2c: b9 c0 10 00 mv r2,r14
8018b30: 37 83 00 20 addi r3,sp,32
8018b34: fb ff fe 91 calli 8018578 <fat_get_fat_cluster>
8018b38: b8 20 60 00 mv r12,r1
if ( rc != RC_OK )
8018b3c: 44 20 00 09 be r1,r0,8018b60 <fat_free_fat_clusters_chain+0x74><== ALWAYS TAKEN
{
if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
8018b40: 29 61 00 44 lw r1,(r11+68) <== NOT EXECUTED
8018b44: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED
8018b48: 44 22 00 03 be r1,r2,8018b54 <fat_free_fat_clusters_chain+0x68><== NOT EXECUTED
fs_info->vol.free_cls += freed_cls_cnt;
8018b4c: b5 a1 68 00 add r13,r13,r1 <== NOT EXECUTED
8018b50: 59 6d 00 44 sw (r11+68),r13 <== NOT EXECUTED
fat_buf_release(fs_info);
8018b54: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8018b58: fb ff dc cb calli 800fe84 <fat_buf_release> <== NOT EXECUTED
return rc;
8018b5c: e0 00 00 16 bi 8018bb4 <fat_free_fat_clusters_chain+0xc8> <== NOT EXECUTED
}
rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE);
8018b60: b9 60 08 00 mv r1,r11
8018b64: b9 c0 10 00 mv r2,r14
8018b68: 34 03 00 00 mvi r3,0
8018b6c: fb ff ff 0e calli 80187a4 <fat_set_fat_cluster>
if ( rc != RC_OK )
8018b70: 44 2c 00 02 be r1,r12,8018b78 <fat_free_fat_clusters_chain+0x8c><== ALWAYS TAKEN
8018b74: b8 20 78 00 mv r15,r1 <== NOT EXECUTED
rc1 = rc;
freed_cls_cnt++;
cur_cln = next_cln;
8018b78: 2b 8e 00 20 lw r14,(sp+32)
rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE);
if ( rc != RC_OK )
rc1 = rc;
freed_cls_cnt++;
8018b7c: 35 ad 00 01 addi r13,r13,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)
8018b80: 29 61 00 10 lw r1,(r11+16)
8018b84: 29 62 00 14 lw r2,(r11+20)
8018b88: a1 c1 08 00 and r1,r14,r1
8018b8c: 54 41 ff e7 bgu r2,r1,8018b28 <fat_free_fat_clusters_chain+0x3c>
freed_cls_cnt++;
cur_cln = next_cln;
}
fs_info->vol.next_cl = chain;
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
8018b90: 29 61 00 44 lw r1,(r11+68)
freed_cls_cnt++;
cur_cln = next_cln;
}
fs_info->vol.next_cl = chain;
8018b94: 59 70 00 4c sw (r11+76),r16
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
8018b98: 34 02 ff ff mvi r2,-1
8018b9c: 44 22 00 03 be r1,r2,8018ba8 <fat_free_fat_clusters_chain+0xbc><== ALWAYS TAKEN
fs_info->vol.free_cls += freed_cls_cnt;
8018ba0: b5 a1 68 00 add r13,r13,r1 <== NOT EXECUTED
8018ba4: 59 6d 00 44 sw (r11+68),r13 <== NOT EXECUTED
fat_buf_release(fs_info);
8018ba8: b9 60 08 00 mv r1,r11
8018bac: fb ff dc b6 calli 800fe84 <fat_buf_release>
8018bb0: b9 e0 60 00 mv r12,r15
if (rc1 != RC_OK)
return rc1;
return RC_OK;
}
8018bb4: b9 80 08 00 mv r1,r12
8018bb8: 2b 9d 00 04 lw ra,(sp+4)
8018bbc: 2b 8b 00 1c lw r11,(sp+28)
8018bc0: 2b 8c 00 18 lw r12,(sp+24)
8018bc4: 2b 8d 00 14 lw r13,(sp+20)
8018bc8: 2b 8e 00 10 lw r14,(sp+16)
8018bcc: 2b 8f 00 0c lw r15,(sp+12)
8018bd0: 2b 90 00 08 lw r16,(sp+8)
8018bd4: 37 9c 00 20 addi sp,sp,32
8018bd8: c3 a0 00 00 ret
080112d0 <fat_free_unique_ino>:
void
fat_free_unique_ino(
fat_fs_info_t *fs_info,
uint32_t ino
)
{
80112d0: 37 9c ff f4 addi sp,sp,-12 <== NOT EXECUTED
80112d4: 5b 8b 00 0c sw (sp+12),r11 <== NOT EXECUTED
80112d8: 5b 8c 00 08 sw (sp+8),r12 <== NOT EXECUTED
80112dc: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
FAT_SET_UNIQ_INO_FREE((ino - fs_info->uino_base), fs_info->uino);
80112e0: 28 2c 00 80 lw r12,(r1+128) <== NOT EXECUTED
void
fat_free_unique_ino(
fat_fs_info_t *fs_info,
uint32_t ino
)
{
80112e4: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
FAT_SET_UNIQ_INO_FREE((ino - fs_info->uino_base), fs_info->uino);
80112e8: c8 4c 60 00 sub r12,r2,r12 <== NOT EXECUTED
80112ec: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
80112f0: 34 02 00 03 mvi r2,3 <== NOT EXECUTED
80112f4: f8 00 70 59 calli 802d458 <__lshrsi3> <== NOT EXECUTED
80112f8: 29 6b 00 74 lw r11,(r11+116) <== NOT EXECUTED
80112fc: 21 82 00 07 andi r2,r12,0x7 <== NOT EXECUTED
8011300: b5 61 58 00 add r11,r11,r1 <== NOT EXECUTED
8011304: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
8011308: fb ff bf b8 calli 80011e8 <__ashlsi3> <== NOT EXECUTED
801130c: 41 62 00 00 lbu r2,(r11+0) <== NOT EXECUTED
8011310: a4 20 08 00 not r1,r1 <== NOT EXECUTED
8011314: a0 22 08 00 and r1,r1,r2 <== NOT EXECUTED
8011318: 31 61 00 00 sb (r11+0),r1 <== NOT EXECUTED
}
801131c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8011320: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED
8011324: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED
8011328: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED
801132c: c3 a0 00 00 ret <== NOT EXECUTED
08018578 <fat_get_fat_cluster>:
fat_get_fat_cluster(
fat_fs_info_t *fs_info,
uint32_t cln,
uint32_t *ret_val
)
{
8018578: 37 9c ff dc addi sp,sp,-36
801857c: 5b 8b 00 20 sw (sp+32),r11
8018580: 5b 8c 00 1c sw (sp+28),r12
8018584: 5b 8d 00 18 sw (sp+24),r13
8018588: 5b 8e 00 14 sw (sp+20),r14
801858c: 5b 8f 00 10 sw (sp+16),r15
8018590: 5b 90 00 0c sw (sp+12),r16
8018594: 5b 91 00 08 sw (sp+8),r17
8018598: 5b 9d 00 04 sw (sp+4),ra
801859c: b8 20 68 00 mv r13,r1
uint8_t *sec_buf;
uint32_t sec = 0;
uint32_t ofs = 0;
/* sanity check */
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
80185a0: 34 01 00 01 mvi r1,1
fat_get_fat_cluster(
fat_fs_info_t *fs_info,
uint32_t cln,
uint32_t *ret_val
)
{
80185a4: b8 40 60 00 mv r12,r2
80185a8: b8 60 58 00 mv r11,r3
uint8_t *sec_buf;
uint32_t sec = 0;
uint32_t ofs = 0;
/* sanity check */
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
80185ac: 50 22 00 6d bgeu r1,r2,8018760 <fat_get_fat_cluster+0x1e8> <== NEVER TAKEN
80185b0: 29 a1 00 38 lw r1,(r13+56)
80185b4: 34 21 00 01 addi r1,r1,1
80185b8: 50 22 00 02 bgeu r1,r2,80185c0 <fat_get_fat_cluster+0x48> <== ALWAYS TAKEN
80185bc: e0 00 00 69 bi 8018760 <fat_get_fat_cluster+0x1e8> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
80185c0: 41 af 00 0e lbu r15,(r13+14)
80185c4: 21 ee 00 01 andi r14,r15,0x1
80185c8: 45 c0 00 06 be r14,r0,80185e0 <fat_get_fat_cluster+0x68>
80185cc: b8 40 08 00 mv r1,r2
80185d0: 34 02 00 01 mvi r2,1
80185d4: f8 00 53 a1 calli 802d458 <__lshrsi3>
80185d8: b4 2c 08 00 add r1,r1,r12
80185dc: e0 00 00 09 bi 8018600 <fat_get_fat_cluster+0x88>
80185e0: 21 e1 00 02 andi r1,r15,0x2
80185e4: 44 2e 00 04 be r1,r14,80185f4 <fat_get_fat_cluster+0x7c>
80185e8: b8 40 08 00 mv r1,r2
80185ec: 34 02 00 01 mvi r2,1
80185f0: e0 00 00 03 bi 80185fc <fat_get_fat_cluster+0x84>
80185f4: b8 40 08 00 mv r1,r2
80185f8: 34 02 00 02 mvi r2,2
80185fc: fb ff a2 fb calli 80011e8 <__ashlsi3>
8018600: 41 a2 00 02 lbu r2,(r13+2)
8018604: f8 00 53 95 calli 802d458 <__lshrsi3>
8018608: 29 b0 00 58 lw r16,(r13+88)
801860c: b4 30 80 00 add r16,r1,r16
fs_info->vol.afat_loc;
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
8018610: 45 c0 00 06 be r14,r0,8018628 <fat_get_fat_cluster+0xb0>
8018614: b9 80 08 00 mv r1,r12
8018618: 34 02 00 01 mvi r2,1
801861c: f8 00 53 8f calli 802d458 <__lshrsi3>
8018620: b4 2c 78 00 add r15,r1,r12
8018624: e0 00 00 09 bi 8018648 <fat_get_fat_cluster+0xd0>
8018628: 21 ef 00 02 andi r15,r15,0x2
801862c: b9 80 08 00 mv r1,r12
8018630: 34 02 00 01 mvi r2,1
8018634: 5d ee 00 03 bne r15,r14,8018640 <fat_get_fat_cluster+0xc8>
8018638: b9 80 08 00 mv r1,r12
801863c: 34 02 00 02 mvi r2,2
8018640: fb ff a2 ea calli 80011e8 <__ashlsi3>
8018644: b8 20 78 00 mv r15,r1
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
8018648: b9 a0 08 00 mv r1,r13
801864c: ba 00 10 00 mv r2,r16
8018650: 34 03 00 01 mvi r3,1
8018654: 37 84 00 24 addi r4,sp,36
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);
8018658: 2d b1 00 00 lhu r17,(r13+0)
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
801865c: fb ff de 88 calli 801007c <fat_buf_access>
8018660: b8 20 70 00 mv r14,r1
if (rc != RC_OK)
8018664: 5c 20 00 45 bne r1,r0,8018778 <fat_get_fat_cluster+0x200> <== NEVER TAKEN
return rc;
switch ( fs_info->vol.type )
8018668: 41 a4 00 0e lbu r4,(r13+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);
801866c: 36 23 ff ff addi r3,r17,-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 )
8018670: 34 01 00 02 mvi r1,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);
8018674: a1 e3 18 00 and r3,r15,r3
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
if (rc != RC_OK)
return rc;
switch ( fs_info->vol.type )
8018678: 44 81 00 27 be r4,r1,8018714 <fat_get_fat_cluster+0x19c>
801867c: 34 01 00 04 mvi r1,4
8018680: 44 81 00 32 be r4,r1,8018748 <fat_get_fat_cluster+0x1d0>
8018684: 34 01 00 01 mvi r1,1
8018688: 5c 81 00 36 bne r4,r1,8018760 <fat_get_fat_cluster+0x1e8> <== NEVER TAKEN
case FAT_FAT12:
/*
* we are enforced in complex computations for FAT12 to escape CPU
* align problems for some architectures
*/
*ret_val = (*(sec_buf + ofs));
801868c: 2b 84 00 24 lw r4,(sp+36)
if ( ofs == (fs_info->vol.bps - 1) )
8018690: 2d a1 00 00 lhu r1,(r13+0)
case FAT_FAT12:
/*
* we are enforced in complex computations for FAT12 to escape CPU
* align problems for some architectures
*/
*ret_val = (*(sec_buf + ofs));
8018694: b4 83 20 00 add r4,r4,r3
8018698: 40 8f 00 00 lbu r15,(r4+0)
if ( ofs == (fs_info->vol.bps - 1) )
801869c: 34 21 ff ff addi r1,r1,-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));
80186a0: 59 6f 00 00 sw (r11+0),r15
if ( ofs == (fs_info->vol.bps - 1) )
80186a4: 5c 61 00 0e bne r3,r1,80186dc <fat_get_fat_cluster+0x164> <== ALWAYS TAKEN
{
rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ,
80186a8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
80186ac: 36 02 00 01 addi r2,r16,1 <== NOT EXECUTED
80186b0: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
80186b4: 37 84 00 24 addi r4,sp,36 <== NOT EXECUTED
80186b8: fb ff de 71 calli 801007c <fat_buf_access> <== NOT EXECUTED
&sec_buf);
if (rc != RC_OK)
80186bc: 5c 20 00 2e bne r1,r0,8018774 <fat_get_fat_cluster+0x1fc> <== NOT EXECUTED
return rc;
*ret_val |= *sec_buf << 8;
80186c0: 2b 81 00 24 lw r1,(sp+36) <== NOT EXECUTED
80186c4: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
80186c8: 40 21 00 00 lbu r1,(r1+0) <== NOT EXECUTED
80186cc: fb ff a2 c7 calli 80011e8 <__ashlsi3> <== NOT EXECUTED
80186d0: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED
80186d4: b8 41 08 00 or r1,r2,r1 <== NOT EXECUTED
80186d8: e0 00 00 05 bi 80186ec <fat_get_fat_cluster+0x174> <== NOT EXECUTED
}
else
{
*ret_val |= *(sec_buf + ofs + 1) << 8;
80186dc: 40 81 00 01 lbu r1,(r4+1)
80186e0: 34 02 00 08 mvi r2,8
80186e4: fb ff a2 c1 calli 80011e8 <__ashlsi3>
80186e8: b8 2f 08 00 or r1,r1,r15
80186ec: 59 61 00 00 sw (r11+0),r1
}
if ( FAT_CLUSTER_IS_ODD(cln) )
80186f0: 21 8c 00 01 andi r12,r12,0x1
80186f4: 45 80 00 05 be r12,r0,8018708 <fat_get_fat_cluster+0x190>
*ret_val = (*ret_val) >> FAT12_SHIFT;
80186f8: 29 61 00 00 lw r1,(r11+0)
80186fc: 34 02 00 04 mvi r2,4
8018700: f8 00 53 56 calli 802d458 <__lshrsi3>
8018704: e0 00 00 15 bi 8018758 <fat_get_fat_cluster+0x1e0>
else
*ret_val = (*ret_val) & FAT_FAT12_MASK;
8018708: 29 61 00 00 lw r1,(r11+0)
801870c: 20 21 0f ff andi r1,r1,0xfff
8018710: e0 00 00 12 bi 8018758 <fat_get_fat_cluster+0x1e0>
break;
case FAT_FAT16:
*ret_val = *((uint16_t *)(sec_buf + ofs));
8018714: 2b 81 00 24 lw r1,(sp+36)
* @param[in] value is the value to be swapped
* @return the value after being endian swapped
*/
static inline uint16_t CPU_swap_u16(uint16_t v)
{
return v << 8 | v >> 8;
8018718: 34 02 00 08 mvi r2,8
801871c: b4 23 18 00 add r3,r1,r3
8018720: 2c 6c 00 00 lhu r12,(r3+0)
8018724: b9 80 08 00 mv r1,r12
8018728: fb ff a2 b0 calli 80011e8 <__ashlsi3>
801872c: b8 20 68 00 mv r13,r1
8018730: 34 02 00 08 mvi r2,8
8018734: b9 80 08 00 mv r1,r12
8018738: f8 00 53 48 calli 802d458 <__lshrsi3>
801873c: b9 a1 08 00 or r1,r13,r1
*ret_val = CF_LE_W(*ret_val);
8018740: 20 21 ff ff andi r1,r1,0xffff
8018744: e0 00 00 05 bi 8018758 <fat_get_fat_cluster+0x1e0>
break;
case FAT_FAT32:
*ret_val = *((uint32_t *)(sec_buf + ofs));
8018748: 2b 81 00 24 lw r1,(sp+36)
801874c: b4 23 18 00 add r3,r1,r3
*ret_val = CF_LE_L(*ret_val);
8018750: 28 61 00 00 lw r1,(r3+0)
8018754: fb ff ff 69 calli 80184f8 <CPU_swap_u32>
8018758: 59 61 00 00 sw (r11+0),r1
break;
801875c: e0 00 00 07 bi 8018778 <fat_get_fat_cluster+0x200>
default:
rtems_set_errno_and_return_minus_one(EIO);
8018760: f8 00 09 3d calli 801ac54 <__errno> <== NOT EXECUTED
8018764: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
8018768: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
801876c: 34 0e ff ff mvi r14,-1 <== NOT EXECUTED
8018770: e0 00 00 02 bi 8018778 <fat_get_fat_cluster+0x200> <== NOT EXECUTED
*ret_val = (*(sec_buf + ofs));
if ( ofs == (fs_info->vol.bps - 1) )
{
rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ,
&sec_buf);
if (rc != RC_OK)
8018774: b8 20 70 00 mv r14,r1 <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
break;
}
return RC_OK;
}
8018778: b9 c0 08 00 mv r1,r14
801877c: 2b 9d 00 04 lw ra,(sp+4)
8018780: 2b 8b 00 20 lw r11,(sp+32)
8018784: 2b 8c 00 1c lw r12,(sp+28)
8018788: 2b 8d 00 18 lw r13,(sp+24)
801878c: 2b 8e 00 14 lw r14,(sp+20)
8018790: 2b 8f 00 10 lw r15,(sp+16)
8018794: 2b 90 00 0c lw r16,(sp+12)
8018798: 2b 91 00 08 lw r17,(sp+8)
801879c: 37 9c 00 24 addi sp,sp,36
80187a0: c3 a0 00 00 ret
080111b0 <fat_get_unique_ino>:
* 0 means FAILED !!!
*
*/
uint32_t
fat_get_unique_ino(fat_fs_info_t *fs_info)
{
80111b0: 37 9c ff dc addi sp,sp,-36 <== NOT EXECUTED
80111b4: 5b 8b 00 24 sw (sp+36),r11 <== NOT EXECUTED
80111b8: 5b 8c 00 20 sw (sp+32),r12 <== NOT EXECUTED
80111bc: 5b 8d 00 1c sw (sp+28),r13 <== NOT EXECUTED
80111c0: 5b 8e 00 18 sw (sp+24),r14 <== NOT EXECUTED
80111c4: 5b 8f 00 14 sw (sp+20),r15 <== NOT EXECUTED
80111c8: 5b 90 00 10 sw (sp+16),r16 <== NOT EXECUTED
80111cc: 5b 91 00 0c sw (sp+12),r17 <== NOT EXECUTED
80111d0: 5b 92 00 08 sw (sp+8),r18 <== NOT EXECUTED
80111d4: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
80111d8: b8 20 58 00 mv r11,r1 <== 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))
80111dc: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED
80111e0: 38 21 e7 70 ori r1,r1,0xe770 <== NOT EXECUTED
80111e4: 28 32 00 00 lw r18,(r1+0) <== NOT EXECUTED
fat_get_unique_ino(fat_fs_info_t *fs_info)
{
uint32_t j = 0;
bool resrc_unsuff = false;
while (!resrc_unsuff)
80111e8: e0 00 00 2b bi 8011294 <fat_get_unique_ino+0xe4> <== NOT EXECUTED
{
for (j = 0; j < fs_info->uino_pool_size; j++)
{
if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino))
80111ec: 29 6e 00 78 lw r14,(r11+120) <== NOT EXECUTED
80111f0: 34 02 00 03 mvi r2,3 <== NOT EXECUTED
80111f4: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
80111f8: f8 00 70 98 calli 802d458 <__lshrsi3> <== NOT EXECUTED
80111fc: 29 6f 00 74 lw r15,(r11+116) <== NOT EXECUTED
8011200: 21 d1 00 07 andi r17,r14,0x7 <== NOT EXECUTED
8011204: ba 20 10 00 mv r2,r17 <== NOT EXECUTED
8011208: b5 e1 78 00 add r15,r15,r1 <== NOT EXECUTED
801120c: 41 f0 00 00 lbu r16,(r15+0) <== NOT EXECUTED
8011210: ba 00 08 00 mv r1,r16 <== NOT EXECUTED
8011214: fb ff c0 1c calli 8001284 <__ashrsi3> <== NOT EXECUTED
8011218: 20 21 00 01 andi r1,r1,0x1 <== NOT EXECUTED
801121c: 5c 20 00 0a bne r1,r0,8011244 <fat_get_unique_ino+0x94> <== NOT EXECUTED
{
FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino);
8011220: ba 20 10 00 mv r2,r17 <== NOT EXECUTED
8011224: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
8011228: fb ff bf f0 calli 80011e8 <__ashlsi3> <== NOT EXECUTED
801122c: b8 30 08 00 or r1,r1,r16 <== NOT EXECUTED
8011230: 31 e1 00 00 sb (r15+0),r1 <== NOT EXECUTED
return (fs_info->uino_base + fs_info->index);
8011234: 29 62 00 78 lw r2,(r11+120) <== NOT EXECUTED
8011238: 29 61 00 80 lw r1,(r11+128) <== NOT EXECUTED
801123c: b4 41 08 00 add r1,r2,r1 <== NOT EXECUTED
8011240: e0 00 00 19 bi 80112a4 <fat_get_unique_ino+0xf4> <== NOT EXECUTED
}
fs_info->index++;
8011244: 35 ce 00 01 addi r14,r14,1 <== NOT EXECUTED
8011248: 59 6e 00 78 sw (r11+120),r14 <== NOT EXECUTED
if (fs_info->index >= fs_info->uino_pool_size)
801124c: 55 ae 00 02 bgu r13,r14,8011254 <fat_get_unique_ino+0xa4> <== NOT EXECUTED
fs_info->index = 0;
8011250: 59 60 00 78 sw (r11+120),r0 <== NOT EXECUTED
uint32_t j = 0;
bool resrc_unsuff = false;
while (!resrc_unsuff)
{
for (j = 0; j < fs_info->uino_pool_size; j++)
8011254: 35 8c 00 01 addi r12,r12,1 <== NOT EXECUTED
8011258: 55 ac ff e5 bgu r13,r12,80111ec <fat_get_unique_ino+0x3c> <== 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))
801125c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8011260: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
8011264: fb ff bf e1 calli 80011e8 <__ashlsi3> <== NOT EXECUTED
8011268: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
801126c: 29 61 00 80 lw r1,(r11+128) <== NOT EXECUTED
8011270: ca 41 08 00 sub r1,r18,r1 <== NOT EXECUTED
8011274: 50 41 00 0b bgeu r2,r1,80112a0 <fat_get_unique_ino+0xf0> <== NOT EXECUTED
{
fs_info->uino_pool_size <<= 1;
fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size);
8011278: 29 61 00 74 lw r1,(r11+116) <== NOT EXECUTED
fs_info->index = 0;
}
if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base))
{
fs_info->uino_pool_size <<= 1;
801127c: 59 62 00 7c sw (r11+124),r2 <== NOT EXECUTED
fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size);
8011280: fb ff cb d1 calli 80041c4 <realloc> <== NOT EXECUTED
8011284: 59 61 00 74 sw (r11+116),r1 <== NOT EXECUTED
if (fs_info->uino != NULL)
8011288: 44 20 00 06 be r1,r0,80112a0 <fat_get_unique_ino+0xf0> <== NOT EXECUTED
fs_info->index = fs_info->uino_pool_size;
801128c: 29 61 00 7c lw r1,(r11+124) <== NOT EXECUTED
8011290: 59 61 00 78 sw (r11+120),r1 <== NOT EXECUTED
uint32_t j = 0;
bool resrc_unsuff = false;
while (!resrc_unsuff)
{
for (j = 0; j < fs_info->uino_pool_size; j++)
8011294: 29 6d 00 7c lw r13,(r11+124) <== NOT EXECUTED
8011298: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
801129c: e3 ff ff ef bi 8011258 <fat_get_unique_ino+0xa8> <== NOT EXECUTED
resrc_unsuff = true;
}
else
resrc_unsuff = true;
}
return 0;
80112a0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
}
80112a4: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
80112a8: 2b 8b 00 24 lw r11,(sp+36) <== NOT EXECUTED
80112ac: 2b 8c 00 20 lw r12,(sp+32) <== NOT EXECUTED
80112b0: 2b 8d 00 1c lw r13,(sp+28) <== NOT EXECUTED
80112b4: 2b 8e 00 18 lw r14,(sp+24) <== NOT EXECUTED
80112b8: 2b 8f 00 14 lw r15,(sp+20) <== NOT EXECUTED
80112bc: 2b 90 00 10 lw r16,(sp+16) <== NOT EXECUTED
80112c0: 2b 91 00 0c lw r17,(sp+12) <== NOT EXECUTED
80112c4: 2b 92 00 08 lw r18,(sp+8) <== NOT EXECUTED
80112c8: 37 9c 00 24 addi sp,sp,36 <== NOT EXECUTED
80112cc: c3 a0 00 00 ret <== NOT EXECUTED
08011138 <fat_init_clusters_chain>:
int
fat_init_clusters_chain(
fat_fs_info_t *fs_info,
uint32_t start_cln
)
{
8011138: 37 9c ff f4 addi sp,sp,-12
801113c: 5b 8b 00 08 sw (sp+8),r11
8011140: 5b 9d 00 04 sw (sp+4),ra
8011144: b8 20 58 00 mv r11,r1
int rc = RC_OK;
ssize_t ret = 0;
uint32_t cur_cln = start_cln;
8011148: 5b 82 00 0c sw (sp+12),r2
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
801114c: e0 00 00 0d bi 8011180 <fat_init_clusters_chain+0x48>
{
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
8011150: 2d 64 00 06 lhu r4,(r11+6)
8011154: b9 60 08 00 mv r1,r11
8011158: 34 03 00 00 mvi r3,0
801115c: 34 05 00 00 mvi r5,0
8011160: fb ff fc 75 calli 8010334 <fat_cluster_set>
if ( ret != fs_info->vol.bpc )
8011164: 2d 62 00 06 lhu r2,(r11+6)
8011168: 5c 22 00 0d bne r1,r2,801119c <fat_init_clusters_chain+0x64><== NEVER TAKEN
{
return -1;
}
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
801116c: 2b 82 00 0c lw r2,(sp+12)
8011170: b9 60 08 00 mv r1,r11
8011174: 37 83 00 0c addi r3,sp,12
8011178: f8 00 1d 00 calli 8018578 <fat_get_fat_cluster>
if ( rc != RC_OK )
801117c: 5c 20 00 09 bne r1,r0,80111a0 <fat_init_clusters_chain+0x68><== NEVER TAKEN
{
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)
8011180: 2b 82 00 0c lw r2,(sp+12)
8011184: 29 61 00 10 lw r1,(r11+16)
8011188: 29 63 00 14 lw r3,(r11+20)
801118c: a0 41 08 00 and r1,r2,r1
8011190: 54 61 ff f0 bgu r3,r1,8011150 <fat_init_clusters_chain+0x18>
return rc;
}
}
return rc;
8011194: 34 01 00 00 mvi r1,0
8011198: e0 00 00 02 bi 80111a0 <fat_init_clusters_chain+0x68>
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;
801119c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
}
}
return rc;
}
80111a0: 2b 9d 00 04 lw ra,(sp+4)
80111a4: 2b 8b 00 08 lw r11,(sp+8)
80111a8: 37 9c 00 0c addi sp,sp,12
80111ac: c3 a0 00 00 ret
080106c4 <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)
{
80106c4: 37 9c ff 24 addi sp,sp,-220
80106c8: 5b 8b 00 44 sw (sp+68),r11
80106cc: 5b 8c 00 40 sw (sp+64),r12
80106d0: 5b 8d 00 3c sw (sp+60),r13
80106d4: 5b 8e 00 38 sw (sp+56),r14
80106d8: 5b 8f 00 34 sw (sp+52),r15
80106dc: 5b 90 00 30 sw (sp+48),r16
80106e0: 5b 91 00 2c sw (sp+44),r17
80106e4: 5b 92 00 28 sw (sp+40),r18
80106e8: 5b 93 00 24 sw (sp+36),r19
80106ec: 5b 94 00 20 sw (sp+32),r20
80106f0: 5b 95 00 1c sw (sp+28),r21
80106f4: 5b 96 00 18 sw (sp+24),r22
80106f8: 5b 97 00 14 sw (sp+20),r23
80106fc: 5b 98 00 10 sw (sp+16),r24
8010700: 5b 99 00 0c sw (sp+12),r25
8010704: 5b 9b 00 08 sw (sp+8),fp
8010708: 5b 9d 00 04 sw (sp+4),ra
801070c: b8 20 78 00 mv r15,r1
ssize_t ret = 0;
struct stat stat_buf;
int i = 0;
rtems_bdbuf_buffer *block = NULL;
vol->fd = open(device, O_RDWR);
8010710: b8 40 08 00 mv r1,r2
8010714: 34 02 00 02 mvi r2,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;
8010718: 5b 80 00 dc sw (sp+220),r0
vol->fd = open(device, O_RDWR);
801071c: fb ff ce 02 calli 8003f24 <open>
8010720: 59 e1 00 60 sw (r15+96),r1
if (vol->fd < 0)
8010724: 4c 20 00 02 bge r1,r0,801072c <fat_init_volume_info+0x68> <== ALWAYS TAKEN
8010728: e0 00 00 06 bi 8010740 <fat_init_volume_info+0x7c> <== NOT EXECUTED
{
rtems_set_errno_and_return_minus_one(ENXIO);
}
rc = fstat(vol->fd, &stat_buf);
801072c: 37 82 00 88 addi r2,sp,136
8010730: fb ff ca 55 calli 8003084 <fstat>
if (rc != 0)
8010734: 44 20 00 08 be r1,r0,8010754 <fat_init_volume_info+0x90> <== ALWAYS TAKEN
{
close(vol->fd);
8010738: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED
801073c: fb ff c9 f9 calli 8002f20 <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENXIO);
8010740: f8 00 29 45 calli 801ac54 <__errno> <== NOT EXECUTED
8010744: 34 02 00 06 mvi r2,6 <== NOT EXECUTED
8010748: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
801074c: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED
8010750: e0 00 01 eb bi 8010efc <fat_init_volume_info+0x838> <== NOT EXECUTED
}
/* Must be a block device. */
if (!S_ISBLK(stat_buf.st_mode))
8010754: 2b 84 00 94 lw r4,(sp+148)
8010758: 29 e2 00 60 lw r2,(r15+96)
801075c: 34 03 60 00 mvi r3,24576
8010760: 20 84 f0 00 andi r4,r4,0xf000
{
close(vol->fd);
8010764: b8 40 08 00 mv r1,r2
close(vol->fd);
rtems_set_errno_and_return_minus_one(ENXIO);
}
/* Must be a block device. */
if (!S_ISBLK(stat_buf.st_mode))
8010768: 5c 83 ff f5 bne r4,r3,801073c <fat_init_volume_info+0x78> <== NEVER TAKEN
static inline int rtems_disk_fd_get_disk_device(
int fd,
rtems_disk_device **dd_ptr
)
{
return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr);
801076c: 78 03 08 02 mvhi r3,0x802
8010770: 38 63 e6 74 ori r3,r3,0xe674
8010774: b8 40 08 00 mv r1,r2
8010778: 28 62 00 00 lw r2,(r3+0)
801077c: 35 e3 00 64 addi r3,r15,100
8010780: f8 00 06 20 calli 8012000 <ioctl>
8010784: b8 20 58 00 mv r11,r1
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) {
8010788: 5c 20 ff ec bne r1,r0,8010738 <fat_init_volume_info+0x74> <== NEVER TAKEN
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);
801078c: 29 e1 00 64 lw r1,(r15+100)
8010790: 34 02 00 00 mvi r2,0
8010794: 37 83 00 dc addi r3,sp,220
8010798: fb ff f4 bd calli 800da8c <rtems_bdbuf_read>
801079c: b8 20 70 00 mv r14,r1
if (sc != RTEMS_SUCCESSFUL)
80107a0: 5c 2b 00 33 bne r1,r11,801086c <fat_init_volume_info+0x1a8><== NEVER TAKEN
{
close(vol->fd);
rtems_set_errno_and_return_minus_one( EIO);
}
memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE);
80107a4: 2b 8a 00 dc lw r10,(sp+220)
80107a8: 29 43 00 1c lw r3,(r10+28)
80107ac: 40 61 00 13 lbu r1,(r3+19)
80107b0: 40 72 00 0b lbu r18,(r3+11)
80107b4: 40 71 00 0c lbu r17,(r3+12)
80107b8: 40 73 00 0d lbu r19,(r3+13)
80107bc: 40 76 00 0e lbu r22,(r3+14)
80107c0: 40 75 00 0f lbu r21,(r3+15)
80107c4: 40 74 00 10 lbu r20,(r3+16)
80107c8: 40 78 00 11 lbu r24,(r3+17)
80107cc: 40 77 00 12 lbu r23,(r3+18)
80107d0: 5b 81 00 6c sw (sp+108),r1
80107d4: 40 62 00 14 lbu r2,(r3+20)
80107d8: 5b 82 00 70 sw (sp+112),r2
80107dc: 40 61 00 16 lbu r1,(r3+22)
80107e0: 5b 81 00 74 sw (sp+116),r1
80107e4: 40 62 00 17 lbu r2,(r3+23)
80107e8: 5b 82 00 78 sw (sp+120),r2
80107ec: 40 61 00 21 lbu r1,(r3+33)
80107f0: 40 6c 00 20 lbu r12,(r3+32)
80107f4: 5b 81 00 7c sw (sp+124),r1
80107f8: 40 62 00 22 lbu r2,(r3+34)
80107fc: 5b 82 00 80 sw (sp+128),r2
8010800: 40 61 00 23 lbu r1,(r3+35)
8010804: 5b 81 00 84 sw (sp+132),r1
8010808: 40 62 00 25 lbu r2,(r3+37)
801080c: 40 6d 00 24 lbu r13,(r3+36)
8010810: 5b 82 00 5c sw (sp+92),r2
8010814: 40 61 00 26 lbu r1,(r3+38)
8010818: 5b 81 00 60 sw (sp+96),r1
801081c: 40 62 00 27 lbu r2,(r3+39)
8010820: 5b 82 00 64 sw (sp+100),r2
8010824: 40 61 00 28 lbu r1,(r3+40)
8010828: 5b 81 00 68 sw (sp+104),r1
801082c: 40 62 00 29 lbu r2,(r3+41)
8010830: 5b 82 00 54 sw (sp+84),r2
8010834: 40 61 00 2c lbu r1,(r3+44)
8010838: 5b 81 00 58 sw (sp+88),r1
801083c: 40 62 00 2d lbu r2,(r3+45)
8010840: 5b 82 00 4c sw (sp+76),r2
8010844: 40 61 00 2e lbu r1,(r3+46)
8010848: 5b 81 00 50 sw (sp+80),r1
801084c: 40 62 00 2f lbu r2,(r3+47)
sc = rtems_bdbuf_release( block);
8010850: b9 40 08 00 mv r1,r10
{
close(vol->fd);
rtems_set_errno_and_return_minus_one( EIO);
}
memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE);
8010854: 5b 82 00 48 sw (sp+72),r2
8010858: 40 7b 00 30 lbu fp,(r3+48)
801085c: 40 79 00 31 lbu r25,(r3+49)
sc = rtems_bdbuf_release( block);
8010860: fb ff f5 15 calli 800dcb4 <rtems_bdbuf_release>
8010864: b8 20 80 00 mv r16,r1
if (sc != RTEMS_SUCCESSFUL)
8010868: 44 2e 00 06 be r1,r14,8010880 <fat_init_volume_info+0x1bc> <== ALWAYS TAKEN
{
close(vol->fd);
801086c: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED
8010870: fb ff c9 ac calli 8002f20 <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EIO );
8010874: f8 00 28 f8 calli 801ac54 <__errno> <== NOT EXECUTED
8010878: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
801087c: e3 ff ff b3 bi 8010748 <fat_init_volume_info+0x84> <== NOT EXECUTED
}
/* Evaluate boot record */
vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec);
8010880: ba 20 08 00 mv r1,r17
8010884: 34 02 00 08 mvi r2,8
8010888: fb ff c2 58 calli 80011e8 <__ashlsi3>
801088c: b8 32 48 00 or r9,r1,r18
8010890: 21 31 ff ff andi r17,r9,0xffff
if ( (vol->bps != 512) &&
8010894: 7e 2e 04 00 cmpnei r14,r17,1024
8010898: 7e 2a 02 00 cmpnei r10,r17,512
close(vol->fd);
rtems_set_errno_and_return_minus_one( EIO );
}
/* Evaluate boot record */
vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec);
801089c: 0d f1 00 00 sh (r15+0),r17
if ( (vol->bps != 512) &&
80108a0: a1 ca 50 00 and r10,r14,r10
80108a4: 45 50 00 05 be r10,r16,80108b8 <fat_init_volume_info+0x1f4><== ALWAYS TAKEN
(vol->bps != 1024) &&
80108a8: 34 0a 08 00 mvi r10,2048 <== NOT EXECUTED
80108ac: 46 2a 00 03 be r17,r10,80108b8 <fat_init_volume_info+0x1f4><== NOT EXECUTED
(vol->bps != 2048) &&
80108b0: 34 0a 10 00 mvi r10,4096 <== NOT EXECUTED
80108b4: 5e 2a 00 f0 bne r17,r10,8010c74 <fat_init_volume_info+0x5b0><== 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;
80108b8: 31 e0 00 03 sb (r15+3),r0
80108bc: ba 20 08 00 mv r1,r17
80108c0: 34 02 00 09 mvi r2,9
80108c4: f8 00 72 e5 calli 802d458 <__lshrsi3>
80108c8: 20 2a ff ff andi r10,r1,0xffff
80108cc: b9 40 08 00 mv r1,r10
80108d0: e0 00 00 06 bi 80108e8 <fat_init_volume_info+0x224>
i >>= 1, vol->sec_mul++);
80108d4: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
80108d8: fb ff c2 6b calli 8001284 <__ashrsi3> <== NOT EXECUTED
80108dc: 41 e2 00 03 lbu r2,(r15+3) <== NOT EXECUTED
80108e0: 34 42 00 01 addi r2,r2,1 <== NOT EXECUTED
80108e4: 31 e2 00 03 sb (r15+3),r2 <== 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;
80108e8: 20 22 00 01 andi r2,r1,0x1
80108ec: 44 40 ff fa be r2,r0,80108d4 <fat_init_volume_info+0x210> <== NEVER TAKEN
i >>= 1, vol->sec_mul++);
for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0;
80108f0: 31 e0 00 02 sb (r15+2),r0
80108f4: ba 20 08 00 mv r1,r17
80108f8: e0 00 00 06 bi 8010910 <fat_init_volume_info+0x24c>
i >>= 1, vol->sec_log2++);
80108fc: 34 02 00 01 mvi r2,1
8010900: fb ff c2 61 calli 8001284 <__ashrsi3>
8010904: 41 e2 00 02 lbu r2,(r15+2)
8010908: 34 42 00 01 addi r2,r2,1
801090c: 31 e2 00 02 sb (r15+2),r2
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;
8010910: 20 22 00 01 andi r2,r1,0x1
8010914: 44 40 ff fa be r2,r0,80108fc <fat_init_volume_info+0x238>
i >>= 1, vol->sec_log2++);
vol->bytes_per_block = vol->bps;
vol->bytes_per_block_log2 = vol->sec_log2;
8010918: 41 f2 00 02 lbu r18,(r15+2)
vol->sectors_per_block = 1;
801091c: 34 0a 00 01 mvi r10,1
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;
8010920: 0d f1 00 0a sh (r15+10),r17
vol->bytes_per_block_log2 = vol->sec_log2;
8010924: 31 f2 00 0c sb (r15+12),r18
vol->sectors_per_block = 1;
8010928: 31 ea 00 09 sb (r15+9),r10
vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec);
801092c: 31 f3 00 04 sb (r15+4),r19
/*
* "sectors per cluster" of zero is invalid
* (and would hang the following loop)
*/
if (vol->spc == 0)
8010930: 46 60 00 d1 be r19,r0,8010c74 <fat_init_volume_info+0x5b0> <== NEVER TAKEN
{
close(vol->fd);
rtems_set_errno_and_return_minus_one(EINVAL);
}
for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0;
8010934: 31 e0 00 05 sb (r15+5),r0
8010938: ba 60 08 00 mv r1,r19
801093c: e0 00 00 06 bi 8010954 <fat_init_volume_info+0x290>
i >>= 1, vol->spc_log2++);
8010940: 34 02 00 01 mvi r2,1
8010944: fb ff c2 50 calli 8001284 <__ashrsi3>
8010948: 41 e2 00 05 lbu r2,(r15+5)
801094c: 34 42 00 01 addi r2,r2,1
8010950: 31 e2 00 05 sb (r15+5),r2
{
close(vol->fd);
rtems_set_errno_and_return_minus_one(EINVAL);
}
for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0;
8010954: 20 22 00 01 andi r2,r1,0x1
8010958: 44 40 ff fa be r2,r0,8010940 <fat_init_volume_info+0x27c>
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)
801095c: 41 e2 00 05 lbu r2,(r15+5)
8010960: ba 20 08 00 mv r1,r17
8010964: fb ff c2 21 calli 80011e8 <__ashlsi3>
8010968: 20 2e ff ff andi r14,r1,0xffff
801096c: 0d ee 00 06 sh (r15+6),r14
8010970: 38 0a 80 00 mvu r10,0x8000
8010974: 51 4e 00 02 bgeu r10,r14,801097c <fat_init_volume_info+0x2b8><== ALWAYS TAKEN
8010978: e0 00 00 bf bi 8010c74 <fat_init_volume_info+0x5b0> <== NOT EXECUTED
{
close(vol->fd);
rtems_set_errno_and_return_minus_one(EINVAL);
}
for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
801097c: 31 e0 00 08 sb (r15+8),r0
8010980: b9 c0 08 00 mv r1,r14
8010984: e0 00 00 06 bi 801099c <fat_init_volume_info+0x2d8>
i >>= 1, vol->bpc_log2++);
8010988: 34 02 00 01 mvi r2,1
801098c: fb ff c2 3e calli 8001284 <__ashrsi3>
8010990: 41 e2 00 08 lbu r2,(r15+8)
8010994: 34 42 00 01 addi r2,r2,1
8010998: 31 e2 00 08 sb (r15+8),r2
{
close(vol->fd);
rtems_set_errno_and_return_minus_one(EINVAL);
}
for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
801099c: 20 22 00 01 andi r2,r1,0x1
80109a0: 44 40 ff fa be r2,r0,8010988 <fat_init_volume_info+0x2c4>
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);
80109a4: 34 02 00 08 mvi r2,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);
80109a8: 31 f4 00 0d sb (r15+13),r20
vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec);
80109ac: ba a0 08 00 mv r1,r21
80109b0: fb ff c2 0e calli 80011e8 <__ashlsi3>
80109b4: b8 36 40 00 or r8,r1,r22
80109b8: 21 10 ff ff andi r16,r8,0xffff
vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec);
80109bc: 34 02 00 08 mvi r2,8
for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
i >>= 1, vol->bpc_log2++);
vol->fats = FAT_GET_BR_FAT_NUM(boot_rec);
vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec);
80109c0: 0d f0 00 18 sh (r15+24),r16
vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec);
80109c4: ba e0 08 00 mv r1,r23
80109c8: fb ff c2 08 calli 80011e8 <__ashlsi3>
80109cc: b8 38 38 00 or r7,r1,r24
80109d0: 20 e7 ff ff andi r7,r7,0xffff
80109d4: 0d e7 00 24 sh (r15+36),r7
/* calculate the count of sectors occupied by the root directory */
vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) /
80109d8: b8 e0 08 00 mv r1,r7
80109dc: 34 02 00 05 mvi r2,5
80109e0: fb ff c2 02 calli 80011e8 <__ashlsi3>
80109e4: 36 2e ff ff addi r14,r17,-1
80109e8: ba 20 10 00 mv r2,r17
80109ec: b5 c1 08 00 add r1,r14,r1
80109f0: fb ff c2 58 calli 8001350 <__divsi3>
vol->bps;
vol->rdir_size = vol->rdir_secs << vol->sec_log2;
80109f4: ba 40 10 00 mv r2,r18
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)) /
80109f8: 59 e1 00 28 sw (r15+40),r1
80109fc: b8 20 58 00 mv r11,r1
vol->bps;
vol->rdir_size = vol->rdir_secs << vol->sec_log2;
8010a00: fb ff c1 fa calli 80011e8 <__ashlsi3>
8010a04: 59 e1 00 2c sw (r15+44),r1
if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0)
8010a08: 2b 81 00 78 lw r1,(sp+120)
8010a0c: 34 02 00 08 mvi r2,8
8010a10: fb ff c1 f6 calli 80011e8 <__ashlsi3>
8010a14: 2b 83 00 74 lw r3,(sp+116)
8010a18: 34 02 00 10 mvi r2,16
8010a1c: b8 23 08 00 or r1,r1,r3
8010a20: fb ff c1 f2 calli 80011e8 <__ashlsi3>
8010a24: 34 02 00 10 mvi r2,16
8010a28: fb ff c2 17 calli 8001284 <__ashrsi3>
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec);
8010a2c: 20 26 ff ff andi r6,r1,0xffff
vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) /
vol->bps;
vol->rdir_size = vol->rdir_secs << vol->sec_log2;
if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0)
8010a30: 5c 20 00 0e bne r1,r0,8010a68 <fat_init_volume_info+0x3a4>
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec);
else
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec);
8010a34: 2b 81 00 5c lw r1,(sp+92)
8010a38: 34 02 00 08 mvi r2,8
8010a3c: fb ff c1 eb calli 80011e8 <__ashlsi3>
8010a40: b8 20 70 00 mv r14,r1
8010a44: 2b 81 00 60 lw r1,(sp+96)
8010a48: 34 02 00 10 mvi r2,16
8010a4c: fb ff c1 e7 calli 80011e8 <__ashlsi3>
8010a50: b9 c1 30 00 or r6,r14,r1
8010a54: 2b 81 00 64 lw r1,(sp+100)
8010a58: 34 02 00 18 mvi r2,24
8010a5c: b8 cd 68 00 or r13,r6,r13
8010a60: fb ff c1 e2 calli 80011e8 <__ashlsi3>
8010a64: b9 a1 30 00 or r6,r13,r1
8010a68: 59 e6 00 1c sw (r15+28),r6
vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length +
8010a6c: 29 e2 00 1c lw r2,(r15+28)
8010a70: ba 80 08 00 mv r1,r20
8010a74: fb ff c2 2b calli 8001320 <__mulsi3>
8010a78: b6 01 18 00 add r3,r16,r1
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)
8010a7c: 2b 81 00 70 lw r1,(sp+112)
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 +
8010a80: b5 63 58 00 add r11,r11,r3
vol->rdir_secs;
/* for FAT12/16 root dir starts at(sector) */
vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length;
8010a84: 59 e3 00 20 sw (r15+32),r3
if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0)
8010a88: 34 02 00 08 mvi r2,8
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 +
8010a8c: 59 eb 00 34 sw (r15+52),r11
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)
8010a90: fb ff c1 d6 calli 80011e8 <__ashlsi3>
8010a94: 2b 82 00 6c lw r2,(sp+108)
8010a98: b8 22 08 00 or r1,r1,r2
8010a9c: 34 02 00 10 mvi r2,16
8010aa0: fb ff c1 d2 calli 80011e8 <__ashlsi3>
8010aa4: 34 02 00 10 mvi r2,16
8010aa8: fb ff c1 f7 calli 8001284 <__ashrsi3>
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec);
8010aac: 20 25 ff ff andi r5,r1,0xffff
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)
8010ab0: 5c 20 00 0e bne r1,r0,8010ae8 <fat_init_volume_info+0x424>
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec);
else
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec);
8010ab4: 2b 81 00 7c lw r1,(sp+124)
8010ab8: 34 02 00 08 mvi r2,8
8010abc: fb ff c1 cb calli 80011e8 <__ashlsi3>
8010ac0: b8 20 68 00 mv r13,r1
8010ac4: 2b 81 00 80 lw r1,(sp+128)
8010ac8: 34 02 00 10 mvi r2,16
8010acc: fb ff c1 c7 calli 80011e8 <__ashlsi3>
8010ad0: b9 a1 28 00 or r5,r13,r1
8010ad4: 2b 81 00 84 lw r1,(sp+132)
8010ad8: 34 02 00 18 mvi r2,24
8010adc: b8 ac 60 00 or r12,r5,r12
8010ae0: fb ff c1 c2 calli 80011e8 <__ashlsi3>
8010ae4: b9 81 28 00 or r5,r12,r1
8010ae8: 59 e5 00 30 sw (r15+48),r5
data_secs = vol->tot_secs - vol->data_fsec;
8010aec: 29 e5 00 30 lw r5,(r15+48)
vol->data_cls = data_secs / vol->spc;
8010af0: ba 60 10 00 mv r2,r19
8010af4: c8 ab 08 00 sub r1,r5,r11
8010af8: f8 00 72 a8 calli 802d598 <__udivsi3>
8010afc: 59 e1 00 38 sw (r15+56),r1
/* determine FAT type at least */
if ( vol->data_cls < FAT_FAT12_MAX_CLN)
8010b00: 34 05 0f f4 mvi r5,4084
8010b04: 54 25 00 07 bgu r1,r5,8010b20 <fat_init_volume_info+0x45c>
{
vol->type = FAT_FAT12;
8010b08: 34 05 00 01 mvi r5,1
8010b0c: 31 e5 00 0e sb (r15+14),r5
vol->mask = FAT_FAT12_MASK;
8010b10: 34 05 0f ff mvi r5,4095
8010b14: 59 e5 00 10 sw (r15+16),r5
vol->eoc_val = FAT_FAT12_EOC;
8010b18: 34 05 0f f8 mvi r5,4088
8010b1c: e0 00 00 12 bi 8010b64 <fat_init_volume_info+0x4a0>
}
else
{
if ( vol->data_cls < FAT_FAT16_MAX_CLN)
8010b20: 38 05 ff f4 mvu r5,0xfff4
8010b24: 54 25 00 07 bgu r1,r5,8010b40 <fat_init_volume_info+0x47c>
{
vol->type = FAT_FAT16;
8010b28: 34 05 00 02 mvi r5,2
8010b2c: 31 e5 00 0e sb (r15+14),r5
vol->mask = FAT_FAT16_MASK;
8010b30: 38 05 ff ff mvu r5,0xffff
8010b34: 59 e5 00 10 sw (r15+16),r5
vol->eoc_val = FAT_FAT16_EOC;
8010b38: 34 a5 ff f9 addi r5,r5,-7
8010b3c: e0 00 00 0a bi 8010b64 <fat_init_volume_info+0x4a0>
}
else
{
vol->type = FAT_FAT32;
vol->mask = FAT_FAT32_MASK;
8010b40: 78 03 08 02 mvhi r3,0x802
vol->mask = FAT_FAT16_MASK;
vol->eoc_val = FAT_FAT16_EOC;
}
else
{
vol->type = FAT_FAT32;
8010b44: 34 05 00 04 mvi r5,4
vol->mask = FAT_FAT32_MASK;
8010b48: 38 63 e7 70 ori r3,r3,0xe770
vol->mask = FAT_FAT16_MASK;
vol->eoc_val = FAT_FAT16_EOC;
}
else
{
vol->type = FAT_FAT32;
8010b4c: 31 e5 00 0e sb (r15+14),r5
vol->mask = FAT_FAT32_MASK;
8010b50: 28 65 00 00 lw r5,(r3+0)
vol->eoc_val = FAT_FAT32_EOC;
8010b54: 78 01 08 02 mvhi r1,0x802
8010b58: 38 21 e7 74 ori r1,r1,0xe774
vol->eoc_val = FAT_FAT16_EOC;
}
else
{
vol->type = FAT_FAT32;
vol->mask = FAT_FAT32_MASK;
8010b5c: 59 e5 00 10 sw (r15+16),r5
vol->eoc_val = FAT_FAT32_EOC;
8010b60: 28 25 00 00 lw r5,(r1+0)
}
}
if (vol->type == FAT_FAT32)
8010b64: 41 e6 00 0e lbu r6,(r15+14)
}
else
{
vol->type = FAT_FAT32;
vol->mask = FAT_FAT32_MASK;
vol->eoc_val = FAT_FAT32_EOC;
8010b68: 59 e5 00 14 sw (r15+20),r5
}
}
if (vol->type == FAT_FAT32)
8010b6c: 34 05 00 04 mvi r5,4
8010b70: 5c c5 00 72 bne r6,r5,8010d38 <fat_init_volume_info+0x674>
{
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
8010b74: 2b 81 00 4c lw r1,(sp+76)
8010b78: 34 02 00 08 mvi r2,8
8010b7c: fb ff c1 9b calli 80011e8 <__ashlsi3>
8010b80: b8 20 60 00 mv r12,r1
8010b84: 2b 81 00 50 lw r1,(sp+80)
8010b88: 34 02 00 10 mvi r2,16
8010b8c: fb ff c1 97 calli 80011e8 <__ashlsi3>
8010b90: 2b 82 00 58 lw r2,(sp+88)
8010b94: b9 81 20 00 or r4,r12,r1
8010b98: 2b 81 00 48 lw r1,(sp+72)
8010b9c: b8 82 58 00 or r11,r4,r2
8010ba0: 34 02 00 18 mvi r2,24
8010ba4: fb ff c1 91 calli 80011e8 <__ashlsi3>
8010ba8: b9 61 20 00 or r4,r11,r1
vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR;
8010bac: 2b 81 00 54 lw r1,(sp+84)
}
}
if (vol->type == FAT_FAT32)
{
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
8010bb0: 59 e4 00 3c sw (r15+60),r4
vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR;
8010bb4: 34 02 00 08 mvi r2,8
8010bb8: fb ff c1 8c calli 80011e8 <__ashlsi3>
8010bbc: 2b 82 00 68 lw r2,(sp+104)
8010bc0: b8 22 18 00 or r3,r1,r2
8010bc4: 20 63 00 ff andi r3,r3,0xff
8010bc8: 20 64 00 80 andi r4,r3,0x80
8010bcc: 20 84 00 ff andi r4,r4,0xff
8010bd0: 31 e4 00 54 sb (r15+84),r4
if (vol->mirror)
8010bd4: 44 80 00 04 be r4,r0,8010be4 <fat_init_volume_info+0x520> <== ALWAYS TAKEN
vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM;
8010bd8: 20 63 00 0f andi r3,r3,0xf <== NOT EXECUTED
8010bdc: 31 e3 00 5c sb (r15+92),r3 <== NOT EXECUTED
8010be0: e0 00 00 02 bi 8010be8 <fat_init_volume_info+0x524> <== NOT EXECUTED
else
vol->afat = 0;
8010be4: 31 e0 00 5c sb (r15+92),r0
vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec);
8010be8: 34 02 00 08 mvi r2,8
8010bec: bb 20 08 00 mv r1,r25
8010bf0: fb ff c1 7e calli 80011e8 <__ashlsi3>
8010bf4: b8 3b 10 00 or r2,r1,fp
8010bf8: 20 42 ff ff andi r2,r2,0xffff
8010bfc: 0d e2 00 40 sh (r15+64),r2
if( vol->info_sec == 0 )
8010c00: 44 40 00 1d be r2,r0,8010c74 <fat_init_volume_info+0x5b0> <== NEVER TAKEN
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);
8010c04: 37 8b 00 d0 addi r11,sp,208
close(vol->fd);
rtems_set_errno_and_return_minus_one( EINVAL );
}
else
{
ret = _fat_block_read(fs_info, vol->info_sec , 0,
8010c08: b9 e0 08 00 mv r1,r15
8010c0c: 34 03 00 00 mvi r3,0
8010c10: 34 04 00 04 mvi r4,4
8010c14: b9 60 28 00 mv r5,r11
8010c18: fb ff fd 5b calli 8010184 <_fat_block_read>
FAT_FSI_LEADSIG_SIZE, fs_info_sector);
if ( ret < 0 )
8010c1c: 4c 20 00 02 bge r1,r0,8010c24 <fat_init_volume_info+0x560> <== ALWAYS TAKEN
8010c20: e0 00 00 23 bi 8010cac <fat_init_volume_info+0x5e8> <== NOT EXECUTED
{
close(vol->fd);
return -1;
}
if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) !=
8010c24: 43 81 00 d1 lbu r1,(sp+209)
8010c28: 34 02 00 08 mvi r2,8
8010c2c: fb ff c1 6f calli 80011e8 <__ashlsi3>
8010c30: b8 20 60 00 mv r12,r1
8010c34: 43 81 00 d2 lbu r1,(sp+210)
8010c38: 34 02 00 10 mvi r2,16
8010c3c: fb ff c1 6b calli 80011e8 <__ashlsi3>
8010c40: b9 81 10 00 or r2,r12,r1
8010c44: 43 8c 00 d0 lbu r12,(sp+208)
8010c48: 43 81 00 d3 lbu r1,(sp+211)
8010c4c: b8 4c 60 00 or r12,r2,r12
8010c50: 34 02 00 18 mvi r2,24
8010c54: fb ff c1 65 calli 80011e8 <__ashlsi3>
8010c58: b9 81 10 00 or r2,r12,r1
8010c5c: 78 01 08 02 mvhi r1,0x802
8010c60: 38 21 e7 78 ori r1,r1,0xe778
8010c64: 28 23 00 00 lw r3,(r1+0)
8010c68: 44 43 00 08 be r2,r3,8010c88 <fat_init_volume_info+0x5c4> <== ALWAYS TAKEN
* 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);
8010c6c: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
8010c70: fb ff fc 85 calli 800fe84 <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);
8010c74: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED
8010c78: fb ff c8 aa calli 8002f20 <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EINVAL );
8010c7c: f8 00 27 f6 calli 801ac54 <__errno> <== NOT EXECUTED
8010c80: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
8010c84: e3 ff fe b1 bi 8010748 <fat_init_volume_info+0x84> <== NOT EXECUTED
}
else
{
ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO,
8010c88: 2d e2 00 40 lhu r2,(r15+64)
8010c8c: b9 e0 08 00 mv r1,r15
8010c90: 34 03 01 e4 mvi r3,484
8010c94: 34 04 00 0c mvi r4,12
8010c98: b9 60 28 00 mv r5,r11
8010c9c: fb ff fd 3a calli 8010184 <_fat_block_read>
FAT_USEFUL_INFO_SIZE, fs_info_sector);
if ( ret < 0 )
8010ca0: 4c 20 00 06 bge r1,r0,8010cb8 <fat_init_volume_info+0x5f4> <== ALWAYS TAKEN
* 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);
8010ca4: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
8010ca8: fb ff fc 77 calli 800fe84 <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);
8010cac: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED
8010cb0: fb ff c8 9c calli 8002f20 <close> <== NOT EXECUTED
8010cb4: e3 ff fe a6 bi 801074c <fat_init_volume_info+0x88> <== NOT EXECUTED
return -1;
}
vol->free_cls_in_fs_info =
FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector);
8010cb8: 43 81 00 d5 lbu r1,(sp+213)
8010cbc: 34 02 00 08 mvi r2,8
8010cc0: fb ff c1 4a calli 80011e8 <__ashlsi3>
8010cc4: b8 20 58 00 mv r11,r1
8010cc8: 43 81 00 d6 lbu r1,(sp+214)
8010ccc: 34 02 00 10 mvi r2,16
8010cd0: fb ff c1 46 calli 80011e8 <__ashlsi3>
8010cd4: b9 61 10 00 or r2,r11,r1
8010cd8: 43 8b 00 d4 lbu r11,(sp+212)
8010cdc: 43 81 00 d7 lbu r1,(sp+215)
8010ce0: b8 4b 58 00 or r11,r2,r11
8010ce4: 34 02 00 18 mvi r2,24
8010ce8: fb ff c1 40 calli 80011e8 <__ashlsi3>
8010cec: b9 61 10 00 or r2,r11,r1
vol->free_cls = vol->free_cls_in_fs_info;
vol->next_cl_in_fs_info =
FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector);
8010cf0: 43 81 00 d9 lbu r1,(sp+217)
_fat_block_release(fs_info);
close(vol->fd);
return -1;
}
vol->free_cls_in_fs_info =
8010cf4: 59 e2 00 48 sw (r15+72),r2
FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector);
vol->free_cls = vol->free_cls_in_fs_info;
8010cf8: 59 e2 00 44 sw (r15+68),r2
vol->next_cl_in_fs_info =
FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector);
8010cfc: 34 02 00 08 mvi r2,8
8010d00: fb ff c1 3a calli 80011e8 <__ashlsi3>
8010d04: b8 20 58 00 mv r11,r1
8010d08: 43 81 00 da lbu r1,(sp+218)
8010d0c: 34 02 00 10 mvi r2,16
8010d10: fb ff c1 36 calli 80011e8 <__ashlsi3>
8010d14: b9 61 10 00 or r2,r11,r1
8010d18: 43 8b 00 d8 lbu r11,(sp+216)
8010d1c: 43 81 00 db lbu r1,(sp+219)
8010d20: b8 4b 58 00 or r11,r2,r11
8010d24: 34 02 00 18 mvi r2,24
8010d28: fb ff c1 30 calli 80011e8 <__ashlsi3>
8010d2c: b9 61 10 00 or r2,r11,r1
}
vol->free_cls_in_fs_info =
FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector);
vol->free_cls = vol->free_cls_in_fs_info;
vol->next_cl_in_fs_info =
8010d30: 59 e2 00 50 sw (r15+80),r2
8010d34: e0 00 00 06 bi 8010d4c <fat_init_volume_info+0x688>
else
{
vol->rdir_cl = 0;
vol->mirror = 0;
vol->afat = 0;
vol->free_cls = FAT_UNDEFINED_VALUE;
8010d38: 34 02 ff ff mvi r2,-1
}
}
}
else
{
vol->rdir_cl = 0;
8010d3c: 59 e0 00 3c sw (r15+60),r0
vol->mirror = 0;
8010d40: 31 e0 00 54 sb (r15+84),r0
vol->afat = 0;
8010d44: 31 e0 00 5c sb (r15+92),r0
vol->free_cls = FAT_UNDEFINED_VALUE;
8010d48: 59 e2 00 44 sw (r15+68),r2
vol->next_cl = FAT_UNDEFINED_VALUE;
8010d4c: 59 e2 00 4c sw (r15+76),r2
* 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);
8010d50: b9 e0 08 00 mv r1,r15
8010d54: fb ff fc 4c calli 800fe84 <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;
8010d58: 29 e2 00 1c lw r2,(r15+28)
8010d5c: 41 e1 00 5c lbu r1,(r15+92)
8010d60: fb ff c1 70 calli 8001320 <__mulsi3>
8010d64: 2d e2 00 18 lhu r2,(r15+24)
8010d68: b4 22 10 00 add r2,r1,r2
8010d6c: 59 e2 00 58 sw (r15+88),r2
/* set up collection of fat-files fd */
fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
8010d70: 34 01 00 02 mvi r1,2
8010d74: 34 02 00 0c mvi r2,12
8010d78: fb ff c8 4b calli 8002ea4 <calloc>
8010d7c: 59 e1 00 6c sw (r15+108),r1
8010d80: b8 20 10 00 mv r2,r1
if ( fs_info->vhash == NULL )
8010d84: 44 20 00 11 be r1,r0,8010dc8 <fat_init_volume_info+0x704> <== NEVER TAKEN
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 );
8010d88: 34 23 00 04 addi r3,r1,4
head->next = tail;
head->previous = NULL;
tail->previous = head;
8010d8c: 58 41 00 08 sw (r2+8),r1
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
8010d90: 58 20 00 04 sw (r1+4),r0
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
8010d94: 58 23 00 00 sw (r1+0),r3
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 );
8010d98: 34 24 00 10 addi r4,r1,16
close(vol->fd);
rtems_set_errno_and_return_minus_one( ENOMEM );
}
for (i = 0; i < FAT_HASH_SIZE; i++)
rtems_chain_initialize_empty(fs_info->vhash + i);
8010d9c: 34 23 00 0c addi r3,r1,12
head->next = tail;
8010da0: 58 24 00 0c sw (r1+12),r4
fs_info->rhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
8010da4: 34 02 00 0c mvi r2,12
head->previous = NULL;
8010da8: 58 60 00 04 sw (r3+4),r0
tail->previous = head;
8010dac: 58 63 00 08 sw (r3+8),r3
8010db0: 34 01 00 02 mvi r1,2
8010db4: fb ff c8 3c calli 8002ea4 <calloc>
8010db8: 59 e1 00 70 sw (r15+112),r1
8010dbc: b8 20 10 00 mv r2,r1
if ( fs_info->rhash == NULL )
8010dc0: 5c 20 00 05 bne r1,r0,8010dd4 <fat_init_volume_info+0x710> <== ALWAYS TAKEN
8010dc4: e0 00 00 1c bi 8010e34 <fat_init_volume_info+0x770> <== 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);
8010dc8: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED
8010dcc: fb ff c8 55 calli 8002f20 <close> <== NOT EXECUTED
8010dd0: e0 00 00 30 bi 8010e90 <fat_init_volume_info+0x7cc> <== 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 );
8010dd4: 34 23 00 04 addi r3,r1,4
head->next = tail;
head->previous = NULL;
tail->previous = head;
8010dd8: 58 41 00 08 sw (r2+8),r1
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
8010ddc: 58 20 00 04 sw (r1+4),r0
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
8010de0: 58 23 00 00 sw (r1+0),r3
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 );
8010de4: 34 24 00 10 addi r4,r1,16
close(vol->fd);
free(fs_info->vhash);
rtems_set_errno_and_return_minus_one( ENOMEM );
}
for (i = 0; i < FAT_HASH_SIZE; i++)
rtems_chain_initialize_empty(fs_info->rhash + i);
8010de8: 34 23 00 0c addi r3,r1,12
head->next = tail;
8010dec: 58 24 00 0c sw (r1+12),r4
head->previous = NULL;
8010df0: 58 60 00 04 sw (r3+4),r0
tail->previous = head;
8010df4: 58 63 00 08 sw (r3+8),r3
fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE;
8010df8: 34 02 01 00 mvi r2,256
8010dfc: 59 e2 00 7c sw (r15+124),r2
fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4;
8010e00: 29 e1 00 30 lw r1,(r15+48)
8010e04: 41 e2 00 03 lbu r2,(r15+3)
8010e08: fb ff c0 f8 calli 80011e8 <__ashlsi3>
8010e0c: 34 02 00 04 mvi r2,4
8010e10: fb ff c0 f6 calli 80011e8 <__ashlsi3>
8010e14: 59 e1 00 80 sw (r15+128),r1
fs_info->index = 0;
8010e18: 59 e0 00 78 sw (r15+120),r0
fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char));
8010e1c: 34 01 01 00 mvi r1,256
8010e20: 34 02 00 01 mvi r2,1
8010e24: fb ff c8 20 calli 8002ea4 <calloc>
8010e28: 59 e1 00 74 sw (r15+116),r1
if ( fs_info->uino == NULL )
8010e2c: 5c 20 00 0c bne r1,r0,8010e5c <fat_init_volume_info+0x798> <== ALWAYS TAKEN
8010e30: e0 00 00 05 bi 8010e44 <fat_init_volume_info+0x780> <== 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);
8010e34: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED
8010e38: fb ff c8 3a calli 8002f20 <close> <== NOT EXECUTED
free(fs_info->vhash);
8010e3c: 29 e1 00 6c lw r1,(r15+108) <== NOT EXECUTED
8010e40: e0 00 00 13 bi 8010e8c <fat_init_volume_info+0x7c8> <== 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);
8010e44: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED
8010e48: fb ff c8 36 calli 8002f20 <close> <== NOT EXECUTED
free(fs_info->vhash);
8010e4c: 29 e1 00 6c lw r1,(r15+108) <== NOT EXECUTED
8010e50: fb ff c8 5f calli 8002fcc <free> <== NOT EXECUTED
free(fs_info->rhash);
8010e54: 29 e1 00 70 lw r1,(r15+112) <== NOT EXECUTED
8010e58: e0 00 00 0d bi 8010e8c <fat_init_volume_info+0x7c8> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
}
fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t));
8010e5c: 2d e1 00 00 lhu r1,(r15+0)
8010e60: 34 02 00 01 mvi r2,1
8010e64: fb ff c8 10 calli 8002ea4 <calloc>
8010e68: 59 e1 00 90 sw (r15+144),r1
if (fs_info->sec_buf == NULL)
8010e6c: 5c 20 00 0c bne r1,r0,8010e9c <fat_init_volume_info+0x7d8> <== ALWAYS TAKEN
{
close(vol->fd);
8010e70: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED
8010e74: fb ff c8 2b calli 8002f20 <close> <== NOT EXECUTED
free(fs_info->vhash);
8010e78: 29 e1 00 6c lw r1,(r15+108) <== NOT EXECUTED
8010e7c: fb ff c8 54 calli 8002fcc <free> <== NOT EXECUTED
free(fs_info->rhash);
8010e80: 29 e1 00 70 lw r1,(r15+112) <== NOT EXECUTED
8010e84: fb ff c8 52 calli 8002fcc <free> <== NOT EXECUTED
free(fs_info->uino);
8010e88: 29 e1 00 74 lw r1,(r15+116) <== NOT EXECUTED
8010e8c: fb ff c8 50 calli 8002fcc <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
8010e90: f8 00 27 71 calli 801ac54 <__errno> <== NOT EXECUTED
8010e94: 34 02 00 0c mvi r2,12 <== NOT EXECUTED
8010e98: e3 ff fe 2c bi 8010748 <fat_init_volume_info+0x84> <== NOT EXECUTED
return bytes_written;
}
static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num)
{
return (sec_num & (vol->spc - 1)) == 0;
8010e9c: 41 e3 00 04 lbu r3,(r15+4)
8010ea0: 29 e4 00 34 lw r4,(r15+52)
vol->bytes_per_block_log2 = vol->bpc_log2;
vol->sectors_per_block = vol->spc;
}
}
return RC_OK;
8010ea4: 34 02 00 00 mvi r2,0
return bytes_written;
}
static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num)
{
return (sec_num & (vol->spc - 1)) == 0;
8010ea8: 34 63 ff ff addi r3,r3,-1
8010eac: a0 64 20 00 and r4,r3,r4
/*
* 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)
8010eb0: 5c 80 00 13 bne r4,r0,8010efc <fat_init_volume_info+0x838> <== NEVER TAKEN
&& (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc)))
8010eb4: 41 e5 00 0e lbu r5,(r15+14)
8010eb8: 34 04 00 04 mvi r4,4
8010ebc: 44 a4 00 04 be r5,r4,8010ecc <fat_init_volume_info+0x808>
return bytes_written;
}
static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num)
{
return (sec_num & (vol->spc - 1)) == 0;
8010ec0: 29 e1 00 20 lw r1,(r15+32)
8010ec4: a0 61 18 00 and r3,r3,r1
* 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)))
8010ec8: 5c 60 00 0d bne r3,r0,8010efc <fat_init_volume_info+0x838> <== NEVER TAKEN
{
sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true);
8010ecc: 2d e2 00 06 lhu r2,(r15+6)
8010ed0: 29 e1 00 64 lw r1,(r15+100)
8010ed4: 34 03 00 01 mvi r3,1
8010ed8: fb ff f4 b2 calli 800e1a0 <rtems_bdbuf_set_block_size>
vol->bytes_per_block_log2 = vol->bpc_log2;
vol->sectors_per_block = vol->spc;
}
}
return RC_OK;
8010edc: 34 02 00 00 mvi r2,0
*/
if (is_cluster_aligned(vol, vol->data_fsec)
&& (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)
8010ee0: 5c 20 00 07 bne r1,r0,8010efc <fat_init_volume_info+0x838> <== NEVER TAKEN
{
vol->bytes_per_block = vol->bpc;
8010ee4: 2d e1 00 06 lhu r1,(r15+6)
8010ee8: 0d e1 00 0a sh (r15+10),r1
vol->bytes_per_block_log2 = vol->bpc_log2;
8010eec: 41 e1 00 08 lbu r1,(r15+8)
8010ef0: 31 e1 00 0c sb (r15+12),r1
vol->sectors_per_block = vol->spc;
8010ef4: 41 e1 00 04 lbu r1,(r15+4)
8010ef8: 31 e1 00 09 sb (r15+9),r1
}
}
return RC_OK;
}
8010efc: b8 40 08 00 mv r1,r2
8010f00: 2b 9d 00 04 lw ra,(sp+4)
8010f04: 2b 8b 00 44 lw r11,(sp+68)
8010f08: 2b 8c 00 40 lw r12,(sp+64)
8010f0c: 2b 8d 00 3c lw r13,(sp+60)
8010f10: 2b 8e 00 38 lw r14,(sp+56)
8010f14: 2b 8f 00 34 lw r15,(sp+52)
8010f18: 2b 90 00 30 lw r16,(sp+48)
8010f1c: 2b 91 00 2c lw r17,(sp+44)
8010f20: 2b 92 00 28 lw r18,(sp+40)
8010f24: 2b 93 00 24 lw r19,(sp+36)
8010f28: 2b 94 00 20 lw r20,(sp+32)
8010f2c: 2b 95 00 1c lw r21,(sp+28)
8010f30: 2b 96 00 18 lw r22,(sp+24)
8010f34: 2b 97 00 14 lw r23,(sp+20)
8010f38: 2b 98 00 10 lw r24,(sp+16)
8010f3c: 2b 99 00 0c lw r25,(sp+12)
8010f40: 2b 9b 00 08 lw fp,(sp+8)
8010f44: 37 9c 00 dc addi sp,sp,220
8010f48: c3 a0 00 00 ret
08018bdc <fat_scan_fat_for_free_clusters>:
uint32_t count,
uint32_t *cls_added,
uint32_t *last_cl,
bool zero_fill
)
{
8018bdc: 37 9c ff c8 addi sp,sp,-56
8018be0: 5b 8b 00 34 sw (sp+52),r11
8018be4: 5b 8c 00 30 sw (sp+48),r12
8018be8: 5b 8d 00 2c sw (sp+44),r13
8018bec: 5b 8e 00 28 sw (sp+40),r14
8018bf0: 5b 8f 00 24 sw (sp+36),r15
8018bf4: 5b 90 00 20 sw (sp+32),r16
8018bf8: 5b 91 00 1c sw (sp+28),r17
8018bfc: 5b 92 00 18 sw (sp+24),r18
8018c00: 5b 93 00 14 sw (sp+20),r19
8018c04: 5b 94 00 10 sw (sp+16),r20
8018c08: 5b 95 00 0c sw (sp+12),r21
8018c0c: 5b 96 00 08 sw (sp+8),r22
8018c10: 5b 9d 00 04 sw (sp+4),ra
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;
8018c14: 28 34 00 38 lw r20,(r1+56)
bool zero_fill
)
{
int rc = RC_OK;
uint32_t cl4find = 2;
uint32_t next_cln = 0;
8018c18: 5b 80 00 38 sw (sp+56),r0
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;
8018c1c: 58 80 00 00 sw (r4+0),r0
uint32_t count,
uint32_t *cls_added,
uint32_t *last_cl,
bool zero_fill
)
{
8018c20: b8 20 58 00 mv r11,r1
8018c24: b8 40 78 00 mv r15,r2
8018c28: b8 60 a8 00 mv r21,r3
8018c2c: b8 80 68 00 mv r13,r4
8018c30: b8 a0 90 00 mv r18,r5
8018c34: 20 d6 00 ff andi r22,r6,0xff
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;
8018c38: 36 94 00 02 addi r20,r20,2
ssize_t bytes_written;
*cls_added = 0;
if (count == 0)
return rc;
8018c3c: 34 0e 00 00 mvi r14,0
uint32_t i = 2;
ssize_t bytes_written;
*cls_added = 0;
if (count == 0)
8018c40: 44 60 00 68 be r3,r0,8018de0 <fat_scan_fat_for_free_clusters+0x204><== NEVER TAKEN
return rc;
if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE)
8018c44: 28 2c 00 4c lw r12,(r1+76)
8018c48: 34 01 ff ff mvi r1,-1
8018c4c: 5d 81 00 02 bne r12,r1,8018c54 <fat_scan_fat_for_free_clusters+0x78>
uint32_t *last_cl,
bool zero_fill
)
{
int rc = RC_OK;
uint32_t cl4find = 2;
8018c50: 34 0c 00 02 mvi r12,2
}
}
i++;
cl4find++;
if (cl4find >= data_cls_val)
cl4find = 2;
8018c54: 34 11 00 02 mvi r17,2
8018c58: 34 10 00 00 mvi r16,0
8018c5c: e0 00 00 47 bi 8018d78 <fat_scan_fat_for_free_clusters+0x19c>
* starting at cluster 2, so the maximum valid cluster number is
* (fs_info->vol.data_cls + 1)
*/
while (i < data_cls_val)
{
rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln);
8018c60: b9 60 08 00 mv r1,r11
8018c64: b9 80 10 00 mv r2,r12
8018c68: 37 83 00 38 addi r3,sp,56
8018c6c: fb ff fe 43 calli 8018578 <fat_get_fat_cluster>
8018c70: b8 20 70 00 mv r14,r1
if ( rc != RC_OK )
8018c74: 44 20 00 07 be r1,r0,8018c90 <fat_scan_fat_for_free_clusters+0xb4><== ALWAYS TAKEN
{
if (*cls_added != 0)
8018c78: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED
8018c7c: 44 20 00 59 be r1,r0,8018de0 <fat_scan_fat_for_free_clusters+0x204><== NOT EXECUTED
fat_free_fat_clusters_chain(fs_info, (*chain));
8018c80: 29 e2 00 00 lw r2,(r15+0) <== NOT EXECUTED
8018c84: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8018c88: fb ff ff 99 calli 8018aec <fat_free_fat_clusters_chain> <== NOT EXECUTED
8018c8c: e0 00 00 55 bi 8018de0 <fat_scan_fat_for_free_clusters+0x204><== NOT EXECUTED
return rc;
}
if (next_cln == FAT_GENFAT_FREE)
8018c90: 2b 81 00 38 lw r1,(sp+56)
8018c94: 5c 2e 00 34 bne r1,r14,8018d64 <fat_scan_fat_for_free_clusters+0x188>
/*
* 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)
8018c98: 29 a1 00 00 lw r1,(r13+0)
8018c9c: 5c 20 00 08 bne r1,r0,8018cbc <fat_scan_fat_for_free_clusters+0xe0>
{
*chain = cl4find;
8018ca0: 59 ec 00 00 sw (r15+0),r12
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
8018ca4: b9 60 08 00 mv r1,r11
8018ca8: b9 80 10 00 mv r2,r12
8018cac: 34 03 ff ff mvi r3,-1
8018cb0: fb ff fe bd calli 80187a4 <fat_set_fat_cluster>
if ( rc != RC_OK )
8018cb4: 44 20 00 13 be r1,r0,8018d00 <fat_scan_fat_for_free_clusters+0x124><== ALWAYS TAKEN
8018cb8: e0 00 00 49 bi 8018ddc <fat_scan_fat_for_free_clusters+0x200><== NOT EXECUTED
}
}
else
{
/* set EOC value to new allocated cluster */
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
8018cbc: b9 60 08 00 mv r1,r11
8018cc0: b9 80 10 00 mv r2,r12
8018cc4: 34 03 ff ff mvi r3,-1
8018cc8: fb ff fe b7 calli 80187a4 <fat_set_fat_cluster>
8018ccc: b8 20 98 00 mv r19,r1
if ( rc != RC_OK )
8018cd0: 44 20 00 06 be r1,r0,8018ce8 <fat_scan_fat_for_free_clusters+0x10c><== ALWAYS TAKEN
{
/* cleanup activity */
fat_free_fat_clusters_chain(fs_info, (*chain));
8018cd4: 29 e2 00 00 lw r2,(r15+0) <== NOT EXECUTED
8018cd8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
}
}
else
{
/* set EOC value to new allocated cluster */
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
8018cdc: ba 60 70 00 mv r14,r19 <== NOT EXECUTED
if ( rc != RC_OK )
{
/* cleanup activity */
fat_free_fat_clusters_chain(fs_info, (*chain));
8018ce0: fb ff ff 83 calli 8018aec <fat_free_fat_clusters_chain> <== NOT EXECUTED
return rc;
8018ce4: e0 00 00 3f bi 8018de0 <fat_scan_fat_for_free_clusters+0x204><== NOT EXECUTED
}
rc = fat_set_fat_cluster(fs_info, save_cln, cl4find);
8018ce8: ba 00 10 00 mv r2,r16
8018cec: b9 60 08 00 mv r1,r11
8018cf0: b9 80 18 00 mv r3,r12
8018cf4: fb ff fe ac calli 80187a4 <fat_set_fat_cluster>
8018cf8: b8 20 80 00 mv r16,r1
if ( rc != RC_OK )
8018cfc: 5c 20 00 2d bne r1,r0,8018db0 <fat_scan_fat_for_free_clusters+0x1d4><== NEVER TAKEN
goto cleanup;
}
if (zero_fill)
8018d00: 46 c0 00 09 be r22,r0,8018d24 <fat_scan_fat_for_free_clusters+0x148>
{
bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0);
8018d04: 2d 64 00 06 lhu r4,(r11+6)
8018d08: b9 80 10 00 mv r2,r12
8018d0c: b9 60 08 00 mv r1,r11
8018d10: 34 03 00 00 mvi r3,0
8018d14: 34 05 00 00 mvi r5,0
8018d18: fb ff dd 87 calli 8010334 <fat_cluster_set>
if (fs_info->vol.bpc != bytes_written)
8018d1c: 2d 62 00 06 lhu r2,(r11+6)
8018d20: 5c 41 00 23 bne r2,r1,8018dac <fat_scan_fat_for_free_clusters+0x1d0><== NEVER TAKEN
goto cleanup;
}
}
save_cln = cl4find;
(*cls_added)++;
8018d24: 29 a1 00 00 lw r1,(r13+0)
8018d28: 34 21 00 01 addi r1,r1,1
8018d2c: 59 a1 00 00 sw (r13+0),r1
/* have we satisfied request ? */
if (*cls_added == count)
8018d30: 5c 35 00 0c bne r1,r21,8018d60 <fat_scan_fat_for_free_clusters+0x184>
{
fs_info->vol.next_cl = save_cln;
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
8018d34: 29 61 00 44 lw r1,(r11+68)
(*cls_added)++;
/* have we satisfied request ? */
if (*cls_added == count)
{
fs_info->vol.next_cl = save_cln;
8018d38: 59 6c 00 4c sw (r11+76),r12
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
8018d3c: 34 02 ff ff mvi r2,-1
8018d40: 44 22 00 04 be r1,r2,8018d50 <fat_scan_fat_for_free_clusters+0x174><== ALWAYS TAKEN
fs_info->vol.free_cls -= (*cls_added);
8018d44: 29 a2 00 00 lw r2,(r13+0) <== NOT EXECUTED
8018d48: c8 22 08 00 sub r1,r1,r2 <== NOT EXECUTED
8018d4c: 59 61 00 44 sw (r11+68),r1 <== NOT EXECUTED
*last_cl = save_cln;
8018d50: 5a 4c 00 00 sw (r18+0),r12
fat_buf_release(fs_info);
8018d54: b9 60 08 00 mv r1,r11
8018d58: fb ff dc 4b calli 800fe84 <fat_buf_release>
return rc;
8018d5c: e0 00 00 21 bi 8018de0 <fat_scan_fat_for_free_clusters+0x204>
save_cln = cl4find;
(*cls_added)++;
/* have we satisfied request ? */
if (*cls_added == count)
8018d60: b9 80 80 00 mv r16,r12
fat_buf_release(fs_info);
return rc;
}
}
i++;
cl4find++;
8018d64: 35 8c 00 01 addi r12,r12,1
*last_cl = save_cln;
fat_buf_release(fs_info);
return rc;
}
}
i++;
8018d68: 36 31 00 01 addi r17,r17,1
cl4find++;
if (cl4find >= data_cls_val)
8018d6c: 51 94 00 02 bgeu r12,r20,8018d74 <fat_scan_fat_for_free_clusters+0x198><== NEVER TAKEN
8018d70: e0 00 00 02 bi 8018d78 <fat_scan_fat_for_free_clusters+0x19c>
cl4find = 2;
8018d74: 34 0c 00 02 mvi r12,2 <== NOT EXECUTED
/*
* 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)
8018d78: 56 91 ff ba bgu r20,r17,8018c60 <fat_scan_fat_for_free_clusters+0x84><== ALWAYS TAKEN
if (cl4find >= data_cls_val)
cl4find = 2;
}
fs_info->vol.next_cl = save_cln;
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
8018d7c: 29 61 00 44 lw r1,(r11+68) <== NOT EXECUTED
cl4find++;
if (cl4find >= data_cls_val)
cl4find = 2;
}
fs_info->vol.next_cl = save_cln;
8018d80: 59 70 00 4c sw (r11+76),r16 <== NOT EXECUTED
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
8018d84: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED
8018d88: 44 22 00 04 be r1,r2,8018d98 <fat_scan_fat_for_free_clusters+0x1bc><== NOT EXECUTED
fs_info->vol.free_cls -= (*cls_added);
8018d8c: 29 a2 00 00 lw r2,(r13+0) <== NOT EXECUTED
8018d90: c8 22 08 00 sub r1,r1,r2 <== NOT EXECUTED
8018d94: 59 61 00 44 sw (r11+68),r1 <== NOT EXECUTED
*last_cl = save_cln;
8018d98: 5a 50 00 00 sw (r18+0),r16 <== NOT EXECUTED
fat_buf_release(fs_info);
8018d9c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8018da0: fb ff dc 39 calli 800fe84 <fat_buf_release> <== NOT EXECUTED
return RC_OK;
8018da4: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED
8018da8: e0 00 00 0e bi 8018de0 <fat_scan_fat_for_free_clusters+0x204><== NOT EXECUTED
if (zero_fill)
{
bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0);
if (fs_info->vol.bpc != bytes_written)
{
rc = -1;
8018dac: 34 10 ff ff mvi r16,-1 <== NOT EXECUTED
return RC_OK;
cleanup:
/* cleanup activity */
fat_free_fat_clusters_chain(fs_info, (*chain));
8018db0: 29 e2 00 00 lw r2,(r15+0) <== NOT EXECUTED
8018db4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
/* trying to save last allocated cluster for future use */
fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE);
fat_buf_release(fs_info);
return rc;
8018db8: ba 00 70 00 mv r14,r16 <== NOT EXECUTED
return RC_OK;
cleanup:
/* cleanup activity */
fat_free_fat_clusters_chain(fs_info, (*chain));
8018dbc: fb ff ff 4c calli 8018aec <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);
8018dc0: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
8018dc4: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
8018dc8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8018dcc: fb ff fe 76 calli 80187a4 <fat_set_fat_cluster> <== NOT EXECUTED
fat_buf_release(fs_info);
8018dd0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8018dd4: fb ff dc 2c calli 800fe84 <fat_buf_release> <== NOT EXECUTED
return rc;
8018dd8: e0 00 00 02 bi 8018de0 <fat_scan_fat_for_free_clusters+0x204><== NOT EXECUTED
* wouldn't work properly
*/
if (*cls_added == 0)
{
*chain = cl4find;
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
8018ddc: b8 20 70 00 mv r14,r1 <== NOT EXECUTED
fat_free_fat_clusters_chain(fs_info, (*chain));
/* trying to save last allocated cluster for future use */
fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE);
fat_buf_release(fs_info);
return rc;
}
8018de0: b9 c0 08 00 mv r1,r14
8018de4: 2b 9d 00 04 lw ra,(sp+4)
8018de8: 2b 8b 00 34 lw r11,(sp+52)
8018dec: 2b 8c 00 30 lw r12,(sp+48)
8018df0: 2b 8d 00 2c lw r13,(sp+44)
8018df4: 2b 8e 00 28 lw r14,(sp+40)
8018df8: 2b 8f 00 24 lw r15,(sp+36)
8018dfc: 2b 90 00 20 lw r16,(sp+32)
8018e00: 2b 91 00 1c lw r17,(sp+28)
8018e04: 2b 92 00 18 lw r18,(sp+24)
8018e08: 2b 93 00 14 lw r19,(sp+20)
8018e0c: 2b 94 00 10 lw r20,(sp+16)
8018e10: 2b 95 00 0c lw r21,(sp+12)
8018e14: 2b 96 00 08 lw r22,(sp+8)
8018e18: 37 9c 00 38 addi sp,sp,56
8018e1c: c3 a0 00 00 ret
08010248 <fat_sector_write>:
fat_fs_info_t *fs_info,
uint32_t start,
uint32_t offset,
uint32_t count,
const void *buff)
{
8010248: 37 9c ff d8 addi sp,sp,-40
801024c: 5b 8b 00 24 sw (sp+36),r11
8010250: 5b 8c 00 20 sw (sp+32),r12
8010254: 5b 8d 00 1c sw (sp+28),r13
8010258: 5b 8e 00 18 sw (sp+24),r14
801025c: 5b 8f 00 14 sw (sp+20),r15
8010260: 5b 90 00 10 sw (sp+16),r16
8010264: 5b 91 00 0c sw (sp+12),r17
8010268: 5b 92 00 08 sw (sp+8),r18
801026c: 5b 9d 00 04 sw (sp+4),ra
int rc = RC_OK;
ssize_t cmpltd = 0;
8010270: 34 0c 00 00 mvi r12,0
fat_fs_info_t *fs_info,
uint32_t start,
uint32_t offset,
uint32_t count,
const void *buff)
{
8010274: b8 20 70 00 mv r14,r1
8010278: b8 80 68 00 mv r13,r4
801027c: b8 a0 90 00 mv r18,r5
int rc = RC_OK;
ssize_t cmpltd = 0;
uint32_t sec_num = start;
uint32_t ofs = offset;
8010280: b8 60 80 00 mv r16,r3
uint32_t count,
const void *buff)
{
int rc = RC_OK;
ssize_t cmpltd = 0;
uint32_t sec_num = start;
8010284: b8 40 78 00 mv r15,r2
}
static inline void
fat_buf_mark_modified(fat_fs_info_t *fs_info)
{
fs_info->c.modified = true;
8010288: 34 11 00 01 mvi r17,1
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while(count > 0)
801028c: e0 00 00 1b bi 80102f8 <fat_sector_write+0xb0>
{
c = MIN(count, (fs_info->vol.bps - ofs));
8010290: 2d cb 00 00 lhu r11,(r14+0)
8010294: c9 70 58 00 sub r11,r11,r16
8010298: 51 ab 00 02 bgeu r13,r11,80102a0 <fat_sector_write+0x58>
801029c: b9 a0 58 00 mv r11,r13
if (c == fs_info->vol.bytes_per_block)
80102a0: 2d c1 00 0a lhu r1,(r14+10)
80102a4: 5d 61 00 05 bne r11,r1,80102b8 <fat_sector_write+0x70> <== ALWAYS TAKEN
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf);
80102a8: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
80102ac: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
80102b0: 34 03 00 02 mvi r3,2 <== NOT EXECUTED
80102b4: e0 00 00 04 bi 80102c4 <fat_sector_write+0x7c> <== NOT EXECUTED
else
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
80102b8: b9 c0 08 00 mv r1,r14
80102bc: b9 e0 10 00 mv r2,r15
80102c0: 34 03 00 01 mvi r3,1
80102c4: 37 84 00 28 addi r4,sp,40
80102c8: fb ff ff 6d calli 801007c <fat_buf_access>
if (rc != RC_OK)
80102cc: 5c 20 00 0d bne r1,r0,8010300 <fat_sector_write+0xb8> <== NEVER TAKEN
return -1;
memcpy((sec_buf + ofs), (buff + cmpltd), c);
80102d0: 2b 81 00 28 lw r1,(sp+40)
80102d4: b6 4c 10 00 add r2,r18,r12
80102d8: b9 60 18 00 mv r3,r11
80102dc: b4 30 08 00 add r1,r1,r16
80102e0: f8 00 2d ab calli 801b98c <memcpy>
fat_buf_mark_modified(fs_info);
count -= c;
80102e4: c9 ab 68 00 sub r13,r13,r11
80102e8: 31 d1 00 88 sb (r14+136),r17
cmpltd +=c;
80102ec: b5 6c 60 00 add r12,r11,r12
sec_num++;
80102f0: 35 ef 00 01 addi r15,r15,1
ofs = 0;
80102f4: 34 10 00 00 mvi r16,0
uint32_t sec_num = start;
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while(count > 0)
80102f8: 5d a0 ff e6 bne r13,r0,8010290 <fat_sector_write+0x48>
80102fc: e0 00 00 02 bi 8010304 <fat_sector_write+0xbc>
if (c == fs_info->vol.bytes_per_block)
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf);
else
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
if (rc != RC_OK)
return -1;
8010300: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
cmpltd +=c;
sec_num++;
ofs = 0;
}
return cmpltd;
}
8010304: b9 80 08 00 mv r1,r12
8010308: 2b 9d 00 04 lw ra,(sp+4)
801030c: 2b 8b 00 24 lw r11,(sp+36)
8010310: 2b 8c 00 20 lw r12,(sp+32)
8010314: 2b 8d 00 1c lw r13,(sp+28)
8010318: 2b 8e 00 18 lw r14,(sp+24)
801031c: 2b 8f 00 14 lw r15,(sp+20)
8010320: 2b 90 00 10 lw r16,(sp+16)
8010324: 2b 91 00 0c lw r17,(sp+12)
8010328: 2b 92 00 08 lw r18,(sp+8)
801032c: 37 9c 00 28 addi sp,sp,40
8010330: c3 a0 00 00 ret
080187a4 <fat_set_fat_cluster>:
fat_set_fat_cluster(
fat_fs_info_t *fs_info,
uint32_t cln,
uint32_t in_val
)
{
80187a4: 37 9c ff d8 addi sp,sp,-40
80187a8: 5b 8b 00 24 sw (sp+36),r11
80187ac: 5b 8c 00 20 sw (sp+32),r12
80187b0: 5b 8d 00 1c sw (sp+28),r13
80187b4: 5b 8e 00 18 sw (sp+24),r14
80187b8: 5b 8f 00 14 sw (sp+20),r15
80187bc: 5b 90 00 10 sw (sp+16),r16
80187c0: 5b 91 00 0c sw (sp+12),r17
80187c4: 5b 92 00 08 sw (sp+8),r18
80187c8: 5b 9d 00 04 sw (sp+4),ra
80187cc: b8 20 58 00 mv r11,r1
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;
80187d0: 5b 80 00 28 sw (sp+40),r0
/* sanity check */
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
80187d4: 34 01 00 01 mvi r1,1
fat_set_fat_cluster(
fat_fs_info_t *fs_info,
uint32_t cln,
uint32_t in_val
)
{
80187d8: b8 40 60 00 mv r12,r2
80187dc: b8 60 80 00 mv r16,r3
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)) )
80187e0: 50 22 00 b3 bgeu r1,r2,8018aac <fat_set_fat_cluster+0x308> <== NEVER TAKEN
80187e4: 29 61 00 38 lw r1,(r11+56)
80187e8: 34 21 00 01 addi r1,r1,1
80187ec: 50 22 00 02 bgeu r1,r2,80187f4 <fat_set_fat_cluster+0x50> <== ALWAYS TAKEN
80187f0: e0 00 00 af bi 8018aac <fat_set_fat_cluster+0x308> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
80187f4: 41 6e 00 0e lbu r14,(r11+14)
80187f8: 21 cd 00 01 andi r13,r14,0x1
80187fc: 45 a0 00 06 be r13,r0,8018814 <fat_set_fat_cluster+0x70>
8018800: b8 40 08 00 mv r1,r2
8018804: 34 02 00 01 mvi r2,1
8018808: f8 00 53 14 calli 802d458 <__lshrsi3>
801880c: b4 2c 08 00 add r1,r1,r12
8018810: e0 00 00 09 bi 8018834 <fat_set_fat_cluster+0x90>
8018814: 21 c1 00 02 andi r1,r14,0x2
8018818: 44 2d 00 04 be r1,r13,8018828 <fat_set_fat_cluster+0x84>
801881c: b8 40 08 00 mv r1,r2
8018820: 34 02 00 01 mvi r2,1
8018824: e0 00 00 03 bi 8018830 <fat_set_fat_cluster+0x8c>
8018828: b8 40 08 00 mv r1,r2
801882c: 34 02 00 02 mvi r2,2
8018830: fb ff a2 6e calli 80011e8 <__ashlsi3>
8018834: 41 62 00 02 lbu r2,(r11+2)
8018838: f8 00 53 08 calli 802d458 <__lshrsi3>
801883c: 29 71 00 58 lw r17,(r11+88)
8018840: b4 31 88 00 add r17,r1,r17
fs_info->vol.afat_loc;
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
8018844: 45 a0 00 06 be r13,r0,801885c <fat_set_fat_cluster+0xb8>
8018848: b9 80 08 00 mv r1,r12
801884c: 34 02 00 01 mvi r2,1
8018850: f8 00 53 02 calli 802d458 <__lshrsi3>
8018854: b4 2c 78 00 add r15,r1,r12
8018858: e0 00 00 09 bi 801887c <fat_set_fat_cluster+0xd8>
801885c: 21 ce 00 02 andi r14,r14,0x2
8018860: b9 80 08 00 mv r1,r12
8018864: 34 02 00 01 mvi r2,1
8018868: 5d cd 00 03 bne r14,r13,8018874 <fat_set_fat_cluster+0xd0>
801886c: b9 80 08 00 mv r1,r12
8018870: 34 02 00 02 mvi r2,2
8018874: fb ff a2 5d calli 80011e8 <__ashlsi3>
8018878: b8 20 78 00 mv r15,r1
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
801887c: b9 60 08 00 mv r1,r11
8018880: ba 20 10 00 mv r2,r17
8018884: 34 03 00 01 mvi r3,1
8018888: 37 84 00 28 addi r4,sp,40
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);
801888c: 2d 6d 00 00 lhu r13,(r11+0)
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
8018890: fb ff dd fb calli 801007c <fat_buf_access>
8018894: b8 20 70 00 mv r14,r1
if (rc != RC_OK)
8018898: 5c 20 00 89 bne r1,r0,8018abc <fat_set_fat_cluster+0x318> <== NEVER TAKEN
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);
801889c: 35 ad ff ff addi r13,r13,-1
80188a0: a1 ed 68 00 and r13,r15,r13
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
if (rc != RC_OK)
return rc;
switch ( fs_info->vol.type )
80188a4: 41 6f 00 0e lbu r15,(r11+14)
80188a8: 34 01 00 02 mvi r1,2
80188ac: 45 e1 00 62 be r15,r1,8018a34 <fat_set_fat_cluster+0x290>
80188b0: 34 01 00 04 mvi r1,4
80188b4: 45 e1 00 6d be r15,r1,8018a68 <fat_set_fat_cluster+0x2c4>
80188b8: 34 01 00 01 mvi r1,1
80188bc: 5d e1 00 7c bne r15,r1,8018aac <fat_set_fat_cluster+0x308> <== NEVER TAKEN
{
case FAT_FAT12:
if ( FAT_CLUSTER_IS_ODD(cln) )
80188c0: 21 8c 00 01 andi r12,r12,0x1
80188c4: 2b 92 00 28 lw r18,(sp+40)
80188c8: 45 80 00 2c be r12,r0,8018978 <fat_set_fat_cluster+0x1d4>
{
fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT;
80188cc: 34 02 00 04 mvi r2,4
80188d0: ba 00 08 00 mv r1,r16
80188d4: fb ff a2 45 calli 80011e8 <__ashlsi3>
80188d8: 20 2c ff ff andi r12,r1,0xffff
*(sec_buf + ofs) &= 0x0F;
80188dc: b6 4d 08 00 add r1,r18,r13
80188e0: 40 22 00 00 lbu r2,(r1+0)
80188e4: 20 42 00 0f andi r2,r2,0xf
80188e8: 30 22 00 00 sb (r1+0),r2
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0);
80188ec: 2b 81 00 28 lw r1,(sp+40)
80188f0: 21 82 ff f0 andi r2,r12,0xfff0
80188f4: b4 2d 08 00 add r1,r1,r13
80188f8: 40 23 00 00 lbu r3,(r1+0)
80188fc: b8 62 10 00 or r2,r3,r2
8018900: 30 22 00 00 sb (r1+0),r2
fat_buf_mark_modified(fs_info);
if ( ofs == (fs_info->vol.bps - 1) )
8018904: 2d 61 00 00 lhu r1,(r11+0)
}
static inline void
fat_buf_mark_modified(fat_fs_info_t *fs_info)
{
fs_info->c.modified = true;
8018908: 31 6f 00 88 sb (r11+136),r15
801890c: 34 21 ff ff addi r1,r1,-1
8018910: 5d a1 00 12 bne r13,r1,8018958 <fat_set_fat_cluster+0x1b4> <== ALWAYS TAKEN
{
rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ,
8018914: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8018918: 36 22 00 01 addi r2,r17,1 <== NOT EXECUTED
801891c: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
8018920: 37 84 00 28 addi r4,sp,40 <== NOT EXECUTED
8018924: fb ff dd d6 calli 801007c <fat_buf_access> <== NOT EXECUTED
8018928: b8 20 70 00 mv r14,r1 <== NOT EXECUTED
&sec_buf);
if (rc != RC_OK)
801892c: 5c 20 00 64 bne r1,r0,8018abc <fat_set_fat_cluster+0x318> <== NOT EXECUTED
return rc;
*sec_buf &= 0x00;
8018930: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED
*sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8);
8018934: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ,
&sec_buf);
if (rc != RC_OK)
return rc;
*sec_buf &= 0x00;
8018938: 30 20 00 00 sb (r1+0),r0 <== NOT EXECUTED
*sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8);
801893c: 2b 8d 00 28 lw r13,(sp+40) <== NOT EXECUTED
8018940: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8018944: f8 00 52 c5 calli 802d458 <__lshrsi3> <== NOT EXECUTED
8018948: 41 a2 00 00 lbu r2,(r13+0) <== NOT EXECUTED
801894c: b8 22 08 00 or r1,r1,r2 <== NOT EXECUTED
8018950: 31 a1 00 00 sb (r13+0),r1 <== NOT EXECUTED
8018954: e0 00 00 27 bi 80189f0 <fat_set_fat_cluster+0x24c> <== NOT EXECUTED
fat_buf_mark_modified(fs_info);
}
else
{
*(sec_buf + ofs + 1) &= 0x00;
8018958: 2b 81 00 28 lw r1,(sp+40)
801895c: 35 ad 00 01 addi r13,r13,1
8018960: b4 2d 08 00 add r1,r1,r13
8018964: 30 20 00 00 sb (r1+0),r0
*(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8);
8018968: 2b 81 00 28 lw r1,(sp+40)
801896c: b4 2d 68 00 add r13,r1,r13
8018970: b9 80 08 00 mv r1,r12
8018974: e0 00 00 2a bi 8018a1c <fat_set_fat_cluster+0x278>
}
}
else
{
fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK;
*(sec_buf + ofs) &= 0x00;
8018978: b6 4d 90 00 add r18,r18,r13
801897c: 32 40 00 00 sb (r18+0),r0
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF);
8018980: 2b 81 00 28 lw r1,(sp+40)
*(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8);
}
}
else
{
fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK;
8018984: 22 10 0f ff andi r16,r16,0xfff
*(sec_buf + ofs) &= 0x00;
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF);
8018988: b4 2d 08 00 add r1,r1,r13
801898c: 40 22 00 00 lbu r2,(r1+0)
8018990: b8 50 10 00 or r2,r2,r16
8018994: 30 22 00 00 sb (r1+0),r2
fat_buf_mark_modified(fs_info);
if ( ofs == (fs_info->vol.bps - 1) )
8018998: 2d 61 00 00 lhu r1,(r11+0)
801899c: 31 6f 00 88 sb (r11+136),r15
80189a0: 34 21 ff ff addi r1,r1,-1
80189a4: 5d a1 00 15 bne r13,r1,80189f8 <fat_set_fat_cluster+0x254> <== ALWAYS TAKEN
{
rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ,
80189a8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
80189ac: 36 22 00 01 addi r2,r17,1 <== NOT EXECUTED
80189b0: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
80189b4: 37 84 00 28 addi r4,sp,40 <== NOT EXECUTED
80189b8: fb ff dd b1 calli 801007c <fat_buf_access> <== NOT EXECUTED
80189bc: b8 20 70 00 mv r14,r1 <== NOT EXECUTED
&sec_buf);
if (rc != RC_OK)
80189c0: 5c 20 00 3f bne r1,r0,8018abc <fat_set_fat_cluster+0x318> <== NOT EXECUTED
return rc;
*sec_buf &= 0xF0;
80189c4: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED
80189c8: 40 22 00 00 lbu r2,(r1+0) <== NOT EXECUTED
80189cc: 20 42 00 f0 andi r2,r2,0xf0 <== NOT EXECUTED
80189d0: 30 22 00 00 sb (r1+0),r2 <== NOT EXECUTED
*sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8);
80189d4: 2b 8c 00 28 lw r12,(sp+40) <== NOT EXECUTED
80189d8: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
80189dc: ba 00 08 00 mv r1,r16 <== NOT EXECUTED
80189e0: f8 00 52 9e calli 802d458 <__lshrsi3> <== NOT EXECUTED
80189e4: 41 82 00 00 lbu r2,(r12+0) <== NOT EXECUTED
80189e8: b8 22 08 00 or r1,r1,r2 <== NOT EXECUTED
80189ec: 31 81 00 00 sb (r12+0),r1 <== NOT EXECUTED
80189f0: 31 6f 00 88 sb (r11+136),r15 <== NOT EXECUTED
80189f4: e0 00 00 32 bi 8018abc <fat_set_fat_cluster+0x318> <== NOT EXECUTED
fat_buf_mark_modified(fs_info);
}
else
{
*(sec_buf + ofs + 1) &= 0xF0;
80189f8: 2b 81 00 28 lw r1,(sp+40)
80189fc: 35 ad 00 01 addi r13,r13,1
8018a00: b4 2d 08 00 add r1,r1,r13
8018a04: 40 22 00 00 lbu r2,(r1+0)
8018a08: 20 42 00 f0 andi r2,r2,0xf0
8018a0c: 30 22 00 00 sb (r1+0),r2
*(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8);
8018a10: 2b 81 00 28 lw r1,(sp+40)
8018a14: b4 2d 68 00 add r13,r1,r13
8018a18: ba 00 08 00 mv r1,r16
8018a1c: 34 02 00 08 mvi r2,8
8018a20: f8 00 52 8e calli 802d458 <__lshrsi3>
8018a24: 41 a2 00 00 lbu r2,(r13+0)
8018a28: b8 22 08 00 or r1,r1,r2
8018a2c: 31 a1 00 00 sb (r13+0),r1
8018a30: e0 00 00 23 bi 8018abc <fat_set_fat_cluster+0x318>
}
}
break;
case FAT_FAT16:
*((uint16_t *)(sec_buf + ofs)) =
8018a34: 2b 81 00 28 lw r1,(sp+40)
(uint16_t )(CT_LE_W(in_val));
8018a38: 22 10 ff ff andi r16,r16,0xffff
8018a3c: 34 02 00 08 mvi r2,8
}
}
break;
case FAT_FAT16:
*((uint16_t *)(sec_buf + ofs)) =
8018a40: b4 2d 68 00 add r13,r1,r13
8018a44: ba 00 08 00 mv r1,r16
8018a48: fb ff a1 e8 calli 80011e8 <__ashlsi3>
8018a4c: b8 20 60 00 mv r12,r1
8018a50: 34 02 00 08 mvi r2,8
8018a54: ba 00 08 00 mv r1,r16
8018a58: f8 00 52 80 calli 802d458 <__lshrsi3>
8018a5c: b9 81 08 00 or r1,r12,r1
8018a60: 0d a1 00 00 sh (r13+0),r1
8018a64: e0 00 00 0f bi 8018aa0 <fat_set_fat_cluster+0x2fc>
(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));
8018a68: 78 02 08 02 mvhi r2,0x802
8018a6c: 38 42 e7 70 ori r2,r2,0xe770
8018a70: 28 41 00 00 lw r1,(r2+0)
8018a74: a2 01 08 00 and r1,r16,r1
8018a78: fb ff fe a0 calli 80184f8 <CPU_swap_u32>
8018a7c: b8 20 60 00 mv r12,r1
*((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000);
8018a80: 2b 81 00 28 lw r1,(sp+40)
8018a84: b4 2d 68 00 add r13,r1,r13
8018a88: 78 01 f0 00 mvhi r1,0xf000
8018a8c: fb ff fe 9b calli 80184f8 <CPU_swap_u32>
8018a90: 29 a2 00 00 lw r2,(r13+0)
8018a94: a0 22 10 00 and r2,r1,r2
*((uint32_t *)(sec_buf + ofs)) |= fat32_clv;
8018a98: b8 4c 10 00 or r2,r2,r12
8018a9c: 59 a2 00 00 sw (r13+0),r2
8018aa0: 34 01 00 01 mvi r1,1
8018aa4: 31 61 00 88 sb (r11+136),r1
fat_buf_mark_modified(fs_info);
break;
8018aa8: e0 00 00 05 bi 8018abc <fat_set_fat_cluster+0x318>
default:
rtems_set_errno_and_return_minus_one(EIO);
8018aac: f8 00 08 6a calli 801ac54 <__errno> <== NOT EXECUTED
8018ab0: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
8018ab4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
8018ab8: 34 0e ff ff mvi r14,-1 <== NOT EXECUTED
break;
}
return RC_OK;
}
8018abc: b9 c0 08 00 mv r1,r14
8018ac0: 2b 9d 00 04 lw ra,(sp+4)
8018ac4: 2b 8b 00 24 lw r11,(sp+36)
8018ac8: 2b 8c 00 20 lw r12,(sp+32)
8018acc: 2b 8d 00 1c lw r13,(sp+28)
8018ad0: 2b 8e 00 18 lw r14,(sp+24)
8018ad4: 2b 8f 00 14 lw r15,(sp+20)
8018ad8: 2b 90 00 10 lw r16,(sp+16)
8018adc: 2b 91 00 0c lw r17,(sp+12)
8018ae0: 2b 92 00 08 lw r18,(sp+8)
8018ae4: 37 9c 00 28 addi sp,sp,40
8018ae8: c3 a0 00 00 ret
08011054 <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)
{
8011054: 37 9c ff e8 addi sp,sp,-24
8011058: 5b 8b 00 18 sw (sp+24),r11
801105c: 5b 8c 00 14 sw (sp+20),r12
8011060: 5b 8d 00 10 sw (sp+16),r13
8011064: 5b 8e 00 0c sw (sp+12),r14
8011068: 5b 8f 00 08 sw (sp+8),r15
801106c: 5b 9d 00 04 sw (sp+4),ra
8011070: b8 20 58 00 mv r11,r1
int rc = RC_OK;
int i = 0;
rc = fat_sync(fs_info);
8011074: fb ff ff b6 calli 8010f4c <fat_sync>
8011078: b8 20 60 00 mv r12,r1
if ( rc != RC_OK )
801107c: 44 20 00 02 be r1,r0,8011084 <fat_shutdown_drive+0x30> <== ALWAYS TAKEN
rc = -1;
8011080: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
8011084: 34 0d 00 00 mvi r13,0
for (i = 0; i < FAT_HASH_SIZE; i++)
8011088: 34 0e 00 18 mvi r14,24
{
rtems_chain_node *node = NULL;
rtems_chain_control *the_chain = fs_info->vhash + i;
801108c: 29 6f 00 6c lw r15,(r11+108)
8011090: b5 ed 78 00 add r15,r15,r13
while ( (node = rtems_chain_get(the_chain)) != NULL )
8011094: e0 00 00 02 bi 801109c <fat_shutdown_drive+0x48>
free(node);
8011098: fb ff c7 cd calli 8002fcc <free>
*/
RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get(
rtems_chain_control *the_chain
)
{
return _Chain_Get( the_chain );
801109c: b9 e0 08 00 mv r1,r15
80110a0: fb ff d4 66 calli 8006238 <_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 )
80110a4: 5c 20 ff fd bne r1,r0,8011098 <fat_shutdown_drive+0x44>
80110a8: 35 ad 00 0c addi r13,r13,12
rc = fat_sync(fs_info);
if ( rc != RC_OK )
rc = -1;
for (i = 0; i < FAT_HASH_SIZE; i++)
80110ac: 5d ae ff f8 bne r13,r14,801108c <fat_shutdown_drive+0x38>
80110b0: 34 0d 00 00 mvi r13,0
while ( (node = rtems_chain_get(the_chain)) != NULL )
free(node);
}
for (i = 0; i < FAT_HASH_SIZE; i++)
80110b4: 34 0e 00 18 mvi r14,24
{
rtems_chain_node *node = NULL;
rtems_chain_control *the_chain = fs_info->rhash + i;
80110b8: 29 6f 00 70 lw r15,(r11+112)
80110bc: b5 ed 78 00 add r15,r15,r13
while ( (node = rtems_chain_get(the_chain)) != NULL )
80110c0: e0 00 00 02 bi 80110c8 <fat_shutdown_drive+0x74>
free(node);
80110c4: fb ff c7 c2 calli 8002fcc <free> <== NOT EXECUTED
80110c8: b9 e0 08 00 mv r1,r15
80110cc: fb ff d4 5b calli 8006238 <_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 )
80110d0: 5c 20 ff fd bne r1,r0,80110c4 <fat_shutdown_drive+0x70> <== NEVER TAKEN
80110d4: 35 ad 00 0c addi r13,r13,12
while ( (node = rtems_chain_get(the_chain)) != NULL )
free(node);
}
for (i = 0; i < FAT_HASH_SIZE; i++)
80110d8: 5d ae ff f8 bne r13,r14,80110b8 <fat_shutdown_drive+0x64>
while ( (node = rtems_chain_get(the_chain)) != NULL )
free(node);
}
free(fs_info->vhash);
80110dc: 29 61 00 6c lw r1,(r11+108)
80110e0: fb ff c7 bb calli 8002fcc <free>
free(fs_info->rhash);
80110e4: 29 61 00 70 lw r1,(r11+112)
80110e8: fb ff c7 b9 calli 8002fcc <free>
free(fs_info->uino);
80110ec: 29 61 00 74 lw r1,(r11+116)
80110f0: fb ff c7 b7 calli 8002fcc <free>
free(fs_info->sec_buf);
80110f4: 29 61 00 90 lw r1,(r11+144)
80110f8: fb ff c7 b5 calli 8002fcc <free>
close(fs_info->vol.fd);
80110fc: 29 61 00 60 lw r1,(r11+96)
8011100: fb ff c7 88 calli 8002f20 <close>
if (rc)
8011104: 45 80 00 04 be r12,r0,8011114 <fat_shutdown_drive+0xc0> <== ALWAYS TAKEN
errno = EIO;
8011108: f8 00 26 d3 calli 801ac54 <__errno> <== NOT EXECUTED
801110c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
8011110: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
return rc;
}
8011114: b9 80 08 00 mv r1,r12
8011118: 2b 9d 00 04 lw ra,(sp+4)
801111c: 2b 8b 00 18 lw r11,(sp+24)
8011120: 2b 8c 00 14 lw r12,(sp+20)
8011124: 2b 8d 00 10 lw r13,(sp+16)
8011128: 2b 8e 00 0c lw r14,(sp+12)
801112c: 2b 8f 00 08 lw r15,(sp+8)
8011130: 37 9c 00 18 addi sp,sp,24
8011134: c3 a0 00 00 ret
08010f4c <fat_sync>:
return RC_OK;
}
int
fat_sync(fat_fs_info_t *fs_info)
{
8010f4c: 37 9c ff e8 addi sp,sp,-24
8010f50: 5b 8b 00 14 sw (sp+20),r11
8010f54: 5b 8c 00 10 sw (sp+16),r12
8010f58: 5b 8d 00 0c sw (sp+12),r13
8010f5c: 5b 8e 00 08 sw (sp+8),r14
8010f60: 5b 9d 00 04 sw (sp+4),ra
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)
8010f64: 40 23 00 0e lbu r3,(r1+14)
return RC_OK;
}
int
fat_sync(fat_fs_info_t *fs_info)
{
8010f68: b8 20 58 00 mv r11,r1
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)
8010f6c: 34 01 00 04 mvi r1,4
* RC_OK on success, or -1 if error occured (errno set appropriately)
*/
static int
fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info)
{
ssize_t ret1 = 0, ret2 = 0;
8010f70: 34 02 00 00 mvi r2,0
8010f74: 34 0e 00 00 mvi r14,0
if (fs_info->vol.type == FAT_FAT32)
8010f78: 5c 61 00 1e bne r3,r1,8010ff0 <fat_sync+0xa4>
{
uint32_t free_count = fs_info->vol.free_cls;
8010f7c: 29 6d 00 44 lw r13,(r11+68)
uint32_t next_free = fs_info->vol.next_cl;
if (free_count != fs_info->vol.free_cls_in_fs_info)
8010f80: 29 61 00 48 lw r1,(r11+72)
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;
8010f84: 29 6c 00 4c lw r12,(r11+76)
if (free_count != fs_info->vol.free_cls_in_fs_info)
8010f88: 45 a1 00 0c be r13,r1,8010fb8 <fat_sync+0x6c> <== ALWAYS TAKEN
{
uint32_t le_free_count = CT_LE_L(free_count);
8010f8c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
8010f90: fb ff fb 9d calli 800fe04 <CPU_swap_u32> <== NOT EXECUTED
fs_info->vol.free_cls_in_fs_info = free_count;
ret1 = fat_sector_write(fs_info,
8010f94: 2d 62 00 40 lhu r2,(r11+64) <== NOT EXECUTED
uint32_t free_count = fs_info->vol.free_cls;
uint32_t next_free = fs_info->vol.next_cl;
if (free_count != fs_info->vol.free_cls_in_fs_info)
{
uint32_t le_free_count = CT_LE_L(free_count);
8010f98: 5b 81 00 18 sw (sp+24),r1 <== NOT EXECUTED
fs_info->vol.free_cls_in_fs_info = free_count;
8010f9c: 59 6d 00 48 sw (r11+72),r13 <== NOT EXECUTED
ret1 = fat_sector_write(fs_info,
8010fa0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8010fa4: 34 03 01 e8 mvi r3,488 <== NOT EXECUTED
8010fa8: 34 04 00 04 mvi r4,4 <== NOT EXECUTED
8010fac: 37 85 00 18 addi r5,sp,24 <== NOT EXECUTED
8010fb0: fb ff fc a6 calli 8010248 <fat_sector_write> <== NOT EXECUTED
8010fb4: b8 20 70 00 mv r14,r1 <== 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)
8010fb8: 29 61 00 50 lw r1,(r11+80)
* RC_OK on success, or -1 if error occured (errno set appropriately)
*/
static int
fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info)
{
ssize_t ret1 = 0, ret2 = 0;
8010fbc: 34 02 00 00 mvi r2,0
FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET,
sizeof(le_free_count),
&le_free_count);
}
if (next_free != fs_info->vol.next_cl_in_fs_info)
8010fc0: 45 81 00 0c be r12,r1,8010ff0 <fat_sync+0xa4> <== NEVER TAKEN
{
uint32_t le_next_free = CT_LE_L(next_free);
8010fc4: b9 80 08 00 mv r1,r12
8010fc8: fb ff fb 8f calli 800fe04 <CPU_swap_u32>
fs_info->vol.next_cl_in_fs_info = next_free;
ret2 = fat_sector_write(fs_info,
8010fcc: 2d 62 00 40 lhu r2,(r11+64)
&le_free_count);
}
if (next_free != fs_info->vol.next_cl_in_fs_info)
{
uint32_t le_next_free = CT_LE_L(next_free);
8010fd0: 5b 81 00 18 sw (sp+24),r1
fs_info->vol.next_cl_in_fs_info = next_free;
8010fd4: 59 6c 00 50 sw (r11+80),r12
ret2 = fat_sector_write(fs_info,
8010fd8: b9 60 08 00 mv r1,r11
8010fdc: 34 03 01 ec mvi r3,492
8010fe0: 34 04 00 04 mvi r4,4
8010fe4: 37 85 00 18 addi r5,sp,24
8010fe8: fb ff fc 98 calli 8010248 <fat_sector_write>
8010fec: b8 20 10 00 mv r2,r1
sizeof(le_next_free),
&le_next_free);
}
}
if ( (ret1 < 0) || (ret2 < 0) )
8010ff0: b8 40 08 00 mv r1,r2
8010ff4: 34 02 00 1f mvi r2,31
8010ff8: f8 00 71 18 calli 802d458 <__lshrsi3>
8010ffc: b8 20 60 00 mv r12,r1
8011000: 34 02 00 1f mvi r2,31
8011004: b9 c0 08 00 mv r1,r14
8011008: f8 00 71 14 calli 802d458 <__lshrsi3>
801100c: b9 81 08 00 or r1,r12,r1
8011010: 20 2c 00 ff andi r12,r1,0xff
rc = fat_fat32_update_fsinfo_sector(fs_info);
if ( rc != RC_OK )
rc = -1;
fat_buf_release(fs_info);
8011014: b9 60 08 00 mv r1,r11
8011018: fb ff fb 9b calli 800fe84 <fat_buf_release>
if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL)
801101c: 29 61 00 64 lw r1,(r11+100)
{
int rc = RC_OK;
rc = fat_fat32_update_fsinfo_sector(fs_info);
if ( rc != RC_OK )
rc = -1;
8011020: 65 8c 00 00 cmpei r12,r12,0
8011024: 35 8c ff ff addi r12,r12,-1
fat_buf_release(fs_info);
if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL)
8011028: fb ff f3 ca calli 800df50 <rtems_bdbuf_syncdev>
801102c: 44 20 00 02 be r1,r0,8011034 <fat_sync+0xe8> <== ALWAYS TAKEN
rc = -1;
8011030: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
return rc;
}
8011034: b9 80 08 00 mv r1,r12
8011038: 2b 9d 00 04 lw ra,(sp+4)
801103c: 2b 8b 00 14 lw r11,(sp+20)
8011040: 2b 8c 00 10 lw r12,(sp+16)
8011044: 2b 8d 00 0c lw r13,(sp+12)
8011048: 2b 8e 00 08 lw r14,(sp+8)
801104c: 37 9c 00 18 addi sp,sp,24
8011050: c3 a0 00 00 ret
08033ab8 <fchdir>:
/**
* compatible with SVr4, 4.4BSD and X/OPEN - Change Directory
*/
int fchdir( int fd )
{
8033ab8: 37 9c ff 90 addi sp,sp,-112
8033abc: 5b 8b 00 10 sw (sp+16),r11
8033ac0: 5b 8c 00 0c sw (sp+12),r12
8033ac4: 5b 8d 00 08 sw (sp+8),r13
8033ac8: 5b 9d 00 04 sw (sp+4),ra
st.st_mode = 0;
st.st_uid = 0;
st.st_gid = 0;
rtems_libio_check_fd( fd );
8033acc: 78 02 08 06 mvhi r2,0x806
8033ad0: 38 42 60 10 ori r2,r2,0x6010
8033ad4: 28 42 00 00 lw r2,(r2+0)
int rv = 0;
rtems_libio_t *iop;
struct stat st;
rtems_filesystem_location_info_t loc;
st.st_mode = 0;
8033ad8: 5b 80 00 20 sw (sp+32),r0
st.st_uid = 0;
8033adc: 0f 80 00 26 sh (sp+38),r0
st.st_gid = 0;
8033ae0: 0f 80 00 28 sh (sp+40),r0
rtems_libio_check_fd( fd );
8033ae4: 54 41 00 02 bgu r2,r1,8033aec <fchdir+0x34>
8033ae8: e0 00 00 0a bi 8033b10 <fchdir+0x58>
iop = rtems_libio_iop( fd );
8033aec: 78 0b 08 06 mvhi r11,0x806
8033af0: 39 6b 9f 60 ori r11,r11,0x9f60
8033af4: 34 02 00 2c mvi r2,44
8033af8: f8 00 92 ec calli 80586a8 <__mulsi3>
8033afc: 29 6c 00 00 lw r12,(r11+0)
8033b00: b5 81 60 00 add r12,r12,r1
rtems_libio_check_is_open( iop );
8033b04: 29 81 00 08 lw r1,(r12+8)
8033b08: 20 21 01 00 andi r1,r1,0x100
8033b0c: 5c 20 00 06 bne r1,r0,8033b24 <fchdir+0x6c>
8033b10: f8 00 14 9f calli 8038d8c <__errno>
8033b14: 34 02 00 09 mvi r2,9
8033b18: 58 22 00 00 sw (r1+0),r2
8033b1c: 34 0b ff ff mvi r11,-1
8033b20: e0 00 00 23 bi 8033bac <fchdir+0xf4>
if ( rv == 0 ) {
rv = rtems_filesystem_chdir( &loc );
}
return rv;
}
8033b24: 29 81 00 20 lw r1,(r12+32)
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open( iop );
rtems_filesystem_instance_lock( &iop->pathinfo );
rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, &st );
8033b28: 35 8d 00 0c addi r13,r12,12
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 );
8033b2c: 28 22 00 0c lw r2,(r1+12)
8033b30: 28 42 00 00 lw r2,(r2+0)
8033b34: d8 40 00 00 call r2
8033b38: 29 81 00 1c lw r1,(r12+28)
8033b3c: 37 82 00 14 addi r2,sp,20
8033b40: 28 23 00 18 lw r3,(r1+24)
8033b44: b9 a0 08 00 mv r1,r13
8033b48: d8 60 00 00 call r3
8033b4c: b8 20 58 00 mv r11,r1
if ( rv == 0 ) {
8033b50: 5c 20 00 0f bne r1,r0,8033b8c <fchdir+0xd4> <== NEVER TAKEN
bool access_ok = rtems_filesystem_check_access(
8033b54: 2b 82 00 20 lw r2,(sp+32)
8033b58: 2f 83 00 26 lhu r3,(sp+38)
8033b5c: 2f 84 00 28 lhu r4,(sp+40)
8033b60: 34 01 00 01 mvi r1,1
8033b64: fb ff 5d 10 calli 800afa4 <rtems_filesystem_check_access>
st.st_mode,
st.st_uid,
st.st_gid
);
if ( access_ok ) {
8033b68: 44 2b 00 05 be r1,r11,8033b7c <fchdir+0xc4>
rtems_filesystem_location_clone( &loc, &iop->pathinfo );
8033b6c: 37 81 00 5c addi r1,sp,92
8033b70: b9 a0 10 00 mv r2,r13
8033b74: fb ff 5b 2a calli 800a81c <rtems_filesystem_location_clone>
8033b78: e0 00 00 05 bi 8033b8c <fchdir+0xd4>
} else {
errno = EACCES;
8033b7c: f8 00 14 84 calli 8038d8c <__errno>
8033b80: 34 02 00 0d mvi r2,13
8033b84: 58 22 00 00 sw (r1+0),r2
rv = -1;
8033b88: 34 0b ff ff mvi r11,-1
if ( rv == 0 ) {
rv = rtems_filesystem_chdir( &loc );
}
return rv;
}
8033b8c: 29 81 00 20 lw r1,(r12+32)
const rtems_filesystem_location_info_t *loc
)
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
(*mt_entry->ops->unlock_h)( mt_entry );
8033b90: 28 22 00 0c lw r2,(r1+12)
8033b94: 28 42 00 04 lw r2,(r2+4)
8033b98: d8 40 00 00 call r2
rv = -1;
}
}
rtems_filesystem_instance_unlock( &iop->pathinfo );
if ( rv == 0 ) {
8033b9c: 5d 60 00 04 bne r11,r0,8033bac <fchdir+0xf4>
rv = rtems_filesystem_chdir( &loc );
8033ba0: 37 81 00 5c addi r1,sp,92
8033ba4: fb ff bb 95 calli 80229f8 <rtems_filesystem_chdir>
8033ba8: b8 20 58 00 mv r11,r1
}
return rv;
}
8033bac: b9 60 08 00 mv r1,r11
8033bb0: 2b 9d 00 04 lw ra,(sp+4)
8033bb4: 2b 8b 00 10 lw r11,(sp+16)
8033bb8: 2b 8c 00 0c lw r12,(sp+12)
8033bbc: 2b 8d 00 08 lw r13,(sp+8)
8033bc0: 37 9c 00 70 addi sp,sp,112
8033bc4: c3 a0 00 00 ret
08023054 <fchmod>:
/**
* POSIX 1003.1b 5.6.4 - Change File Modes
*/
int fchmod( int fd, mode_t mode )
{
8023054: 37 9c ff f4 addi sp,sp,-12
8023058: 5b 8b 00 0c sw (sp+12),r11
802305c: 5b 8c 00 08 sw (sp+8),r12
8023060: 5b 9d 00 04 sw (sp+4),ra
int rv;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
8023064: 78 03 08 06 mvhi r3,0x806
8023068: 38 63 60 10 ori r3,r3,0x6010
/**
* POSIX 1003.1b 5.6.4 - Change File Modes
*/
int fchmod( int fd, mode_t mode )
{
802306c: b8 40 60 00 mv r12,r2
int rv;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
8023070: 28 62 00 00 lw r2,(r3+0)
8023074: 54 41 00 02 bgu r2,r1,802307c <fchmod+0x28>
8023078: e0 00 00 0a bi 80230a0 <fchmod+0x4c>
iop = rtems_libio_iop( fd );
802307c: 78 0b 08 06 mvhi r11,0x806
8023080: 39 6b 9f 60 ori r11,r11,0x9f60
8023084: 34 02 00 2c mvi r2,44
8023088: f8 00 d5 88 calli 80586a8 <__mulsi3>
802308c: 29 6b 00 00 lw r11,(r11+0)
8023090: b5 61 58 00 add r11,r11,r1
rtems_libio_check_is_open(iop);
8023094: 29 61 00 08 lw r1,(r11+8)
8023098: 20 21 01 00 andi r1,r1,0x100
802309c: 5c 20 00 04 bne r1,r0,80230ac <fchmod+0x58>
80230a0: f8 00 57 3b calli 8038d8c <__errno>
80230a4: 34 02 00 09 mvi r2,9
80230a8: e0 00 00 15 bi 80230fc <fchmod+0xa8>
if (iop->pathinfo.mt_entry->writeable) {
80230ac: 29 61 00 20 lw r1,(r11+32)
80230b0: 40 22 00 29 lbu r2,(r1+41)
80230b4: 44 40 00 10 be r2,r0,80230f4 <fchmod+0xa0> <== NEVER TAKEN
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 );
80230b8: 28 22 00 0c lw r2,(r1+12)
80230bc: 28 42 00 00 lw r2,(r2+0)
80230c0: d8 40 00 00 call r2
rtems_filesystem_instance_lock( &iop->pathinfo );
rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode );
80230c4: 29 61 00 20 lw r1,(r11+32)
80230c8: b9 80 10 00 mv r2,r12
80230cc: 28 21 00 0c lw r1,(r1+12)
80230d0: 28 23 00 20 lw r3,(r1+32)
80230d4: 35 61 00 0c addi r1,r11,12
80230d8: d8 60 00 00 call r3
80230dc: b8 20 60 00 mv r12,r1
errno = EROFS;
rv = -1;
}
return rv;
}
80230e0: 29 61 00 20 lw r1,(r11+32)
const rtems_filesystem_location_info_t *loc
)
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
(*mt_entry->ops->unlock_h)( mt_entry );
80230e4: 28 22 00 0c lw r2,(r1+12)
80230e8: 28 42 00 04 lw r2,(r2+4)
80230ec: d8 40 00 00 call r2
80230f0: e0 00 00 05 bi 8023104 <fchmod+0xb0>
if (iop->pathinfo.mt_entry->writeable) {
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;
80230f4: f8 00 57 26 calli 8038d8c <__errno> <== NOT EXECUTED
80230f8: 34 02 00 1e mvi r2,30 <== NOT EXECUTED
80230fc: 58 22 00 00 sw (r1+0),r2
rv = -1;
8023100: 34 0c ff ff mvi r12,-1
}
return rv;
}
8023104: b9 80 08 00 mv r1,r12
8023108: 2b 9d 00 04 lw ra,(sp+4)
802310c: 2b 8b 00 0c lw r11,(sp+12)
8023110: 2b 8c 00 08 lw r12,(sp+8)
8023114: 37 9c 00 0c addi sp,sp,12
8023118: c3 a0 00 00 ret
0802311c <fchown>:
/**
* POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
*/
int fchown( int fd, uid_t owner, gid_t group )
{
802311c: 37 9c ff f0 addi sp,sp,-16
8023120: 5b 8b 00 10 sw (sp+16),r11
8023124: 5b 8c 00 0c sw (sp+12),r12
8023128: 5b 8d 00 08 sw (sp+8),r13
802312c: 5b 9d 00 04 sw (sp+4),ra
int rv = 0;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
8023130: 78 04 08 06 mvhi r4,0x806
8023134: 38 84 60 10 ori r4,r4,0x6010
/**
* POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
*/
int fchown( int fd, uid_t owner, gid_t group )
{
8023138: 20 4d ff ff andi r13,r2,0xffff
int rv = 0;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
802313c: 28 82 00 00 lw r2,(r4+0)
/**
* POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
*/
int fchown( int fd, uid_t owner, gid_t group )
{
8023140: 20 6c ff ff andi r12,r3,0xffff
int rv = 0;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
8023144: 54 41 00 02 bgu r2,r1,802314c <fchown+0x30>
8023148: e0 00 00 0a bi 8023170 <fchown+0x54>
iop = rtems_libio_iop( fd );
802314c: 78 0b 08 06 mvhi r11,0x806
8023150: 39 6b 9f 60 ori r11,r11,0x9f60
8023154: 34 02 00 2c mvi r2,44
8023158: f8 00 d5 54 calli 80586a8 <__mulsi3>
802315c: 29 6b 00 00 lw r11,(r11+0)
8023160: b5 61 58 00 add r11,r11,r1
rtems_libio_check_is_open(iop);
8023164: 29 61 00 08 lw r1,(r11+8)
8023168: 20 21 01 00 andi r1,r1,0x100
802316c: 5c 20 00 04 bne r1,r0,802317c <fchown+0x60>
8023170: f8 00 57 07 calli 8038d8c <__errno>
8023174: 34 02 00 09 mvi r2,9
8023178: e0 00 00 16 bi 80231d0 <fchown+0xb4>
if (iop->pathinfo.mt_entry->writeable) {
802317c: 29 61 00 20 lw r1,(r11+32)
8023180: 40 22 00 29 lbu r2,(r1+41)
8023184: 44 40 00 11 be r2,r0,80231c8 <fchown+0xac> <== NEVER TAKEN
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 );
8023188: 28 22 00 0c lw r2,(r1+12)
802318c: 28 42 00 00 lw r2,(r2+0)
8023190: d8 40 00 00 call r2
rtems_filesystem_instance_lock( &iop->pathinfo );
rv = (*iop->pathinfo.mt_entry->ops->chown_h)(
8023194: 29 61 00 20 lw r1,(r11+32)
8023198: b9 a0 10 00 mv r2,r13
802319c: b9 80 18 00 mv r3,r12
80231a0: 28 21 00 0c lw r1,(r1+12)
80231a4: 28 24 00 24 lw r4,(r1+36)
80231a8: 35 61 00 0c addi r1,r11,12
80231ac: d8 80 00 00 call r4
80231b0: b8 20 60 00 mv r12,r1
errno = EROFS;
rv = -1;
}
return rv;
}
80231b4: 29 61 00 20 lw r1,(r11+32)
const rtems_filesystem_location_info_t *loc
)
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
(*mt_entry->ops->unlock_h)( mt_entry );
80231b8: 28 22 00 0c lw r2,(r1+12)
80231bc: 28 42 00 04 lw r2,(r2+4)
80231c0: d8 40 00 00 call r2
80231c4: e0 00 00 05 bi 80231d8 <fchown+0xbc>
owner,
group
);
rtems_filesystem_instance_unlock( &iop->pathinfo );
} else {
errno = EROFS;
80231c8: f8 00 56 f1 calli 8038d8c <__errno> <== NOT EXECUTED
80231cc: 34 02 00 1e mvi r2,30 <== NOT EXECUTED
80231d0: 58 22 00 00 sw (r1+0),r2
rv = -1;
80231d4: 34 0c ff ff mvi r12,-1
}
return rv;
}
80231d8: b9 80 08 00 mv r1,r12
80231dc: 2b 9d 00 04 lw ra,(sp+4)
80231e0: 2b 8b 00 10 lw r11,(sp+16)
80231e4: 2b 8c 00 0c lw r12,(sp+12)
80231e8: 2b 8d 00 08 lw r13,(sp+8)
80231ec: 37 9c 00 10 addi sp,sp,16
80231f0: c3 a0 00 00 ret
080343e4 <fcntl>:
int fcntl(
int fd,
int cmd,
...
)
{
80343e4: 37 9c ff cc addi sp,sp,-52
80343e8: 5b 8b 00 18 sw (sp+24),r11
80343ec: 5b 8c 00 14 sw (sp+20),r12
80343f0: 5b 8d 00 10 sw (sp+16),r13
80343f4: 5b 8e 00 0c sw (sp+12),r14
80343f8: 5b 8f 00 08 sw (sp+8),r15
80343fc: 5b 9d 00 04 sw (sp+4),ra
8034400: 5b 82 00 1c sw (sp+28),r2
8034404: b8 40 70 00 mv r14,r2
int fd2;
int flags;
int mask;
int ret = 0;
rtems_libio_check_fd( fd );
8034408: 78 02 08 03 mvhi r2,0x803
int fcntl(
int fd,
int cmd,
...
)
{
803440c: 5b 83 00 20 sw (sp+32),r3
8034410: 5b 84 00 24 sw (sp+36),r4
8034414: 5b 85 00 28 sw (sp+40),r5
8034418: 5b 86 00 2c sw (sp+44),r6
803441c: 5b 87 00 30 sw (sp+48),r7
8034420: 5b 88 00 34 sw (sp+52),r8
int fd2;
int flags;
int mask;
int ret = 0;
rtems_libio_check_fd( fd );
8034424: 38 42 b0 14 ori r2,r2,0xb014
8034428: 28 42 00 00 lw r2,(r2+0)
...
)
{
int ret;
va_list ap;
va_start( ap, cmd );
803442c: 37 8f 00 20 addi r15,sp,32
int fd2;
int flags;
int mask;
int ret = 0;
rtems_libio_check_fd( fd );
8034430: 54 41 00 02 bgu r2,r1,8034438 <fcntl+0x54>
8034434: e0 00 00 0a bi 803445c <fcntl+0x78>
iop = rtems_libio_iop( fd );
8034438: 78 0b 08 04 mvhi r11,0x804
803443c: 39 6b b9 8c ori r11,r11,0xb98c
8034440: 34 02 00 2c mvi r2,44
8034444: fb ff 34 75 calli 8001618 <__mulsi3>
8034448: 29 6b 00 00 lw r11,(r11+0)
803444c: b5 61 58 00 add r11,r11,r1
rtems_libio_check_is_open(iop);
8034450: 29 6c 00 08 lw r12,(r11+8)
8034454: 21 81 01 00 andi r1,r12,0x100
8034458: 5c 20 00 04 bne r1,r0,8034468 <fcntl+0x84>
803445c: fb ff b2 2b calli 8020d08 <__errno>
8034460: 34 02 00 09 mvi r2,9
8034464: e0 00 00 57 bi 80345c0 <fcntl+0x1dc>
/*
* This switch should contain all the cases from POSIX.
*/
switch ( cmd ) {
8034468: 34 01 00 09 mvi r1,9
803446c: 55 c1 00 53 bgu r14,r1,80345b8 <fcntl+0x1d4>
8034470: 78 0d 08 03 mvhi r13,0x803
8034474: b9 c0 08 00 mv r1,r14
8034478: 34 02 00 02 mvi r2,2
803447c: fb ff 34 19 calli 80014e0 <__ashlsi3>
8034480: 39 ad a7 c0 ori r13,r13,0xa7c0
8034484: b5 a1 08 00 add r1,r13,r1
8034488: 28 21 00 00 lw r1,(r1+0)
803448c: c0 20 00 00 b r1
/*
* FIXME: We ignore the start value fd2 for the file descriptor search. This
* is not POSIX conform.
*/
rtems_libio_t *diop = rtems_libio_allocate();
8034490: fb ff 49 35 calli 8006964 <rtems_libio_allocate>
8034494: b8 20 68 00 mv r13,r1
if (diop != NULL) {
8034498: 44 20 00 56 be r1,r0,80345f0 <fcntl+0x20c>
int oflag = rtems_libio_to_fcntl_flags( iop->flags );
803449c: 29 61 00 08 lw r1,(r11+8)
oflag &= ~O_CREAT;
80344a0: 34 0c fd ff mvi r12,-513
* is not POSIX conform.
*/
rtems_libio_t *diop = rtems_libio_allocate();
if (diop != NULL) {
int oflag = rtems_libio_to_fcntl_flags( iop->flags );
80344a4: fb ff 49 1c calli 8006914 <rtems_libio_to_fcntl_flags>
oflag &= ~O_CREAT;
80344a8: a0 2c 60 00 and r12,r1,r12
diop->flags |= rtems_libio_fcntl_flags( oflag );
80344ac: 29 af 00 08 lw r15,(r13+8)
80344b0: b9 80 08 00 mv r1,r12
80344b4: fb ff 49 02 calli 80068bc <rtems_libio_fcntl_flags>
80344b8: b8 2f 08 00 or r1,r1,r15
80344bc: 59 a1 00 08 sw (r13+8),r1
int cmd,
int arg
)
{
return fcntl( fd, cmd, arg );
}
80344c0: 29 61 00 20 lw r1,(r11+32)
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 );
80344c4: 28 22 00 0c lw r2,(r1+12)
80344c8: 28 42 00 00 lw r2,(r2+0)
80344cc: d8 40 00 00 call r2
oflag &= ~O_CREAT;
diop->flags |= rtems_libio_fcntl_flags( oflag );
rtems_filesystem_instance_lock( &iop->pathinfo );
rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo );
80344d0: 35 a1 00 0c addi r1,r13,12
80344d4: 35 62 00 0c addi r2,r11,12
80344d8: fb ff 81 4a calli 8014a00 <rtems_filesystem_location_clone>
int cmd,
int arg
)
{
return fcntl( fd, cmd, arg );
}
80344dc: 29 61 00 20 lw r1,(r11+32)
const rtems_filesystem_location_info_t *loc
)
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
(*mt_entry->ops->unlock_h)( mt_entry );
80344e0: 28 22 00 0c lw r2,(r1+12)
80344e4: 28 42 00 04 lw r2,(r2+4)
80344e8: d8 40 00 00 call r2
/*
* 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 );
80344ec: 29 a1 00 1c lw r1,(r13+28)
80344f0: b9 80 18 00 mv r3,r12
80344f4: 34 02 00 00 mvi r2,0
80344f8: 28 25 00 00 lw r5,(r1+0)
80344fc: 34 04 00 00 mvi r4,0
8034500: b9 a0 08 00 mv r1,r13
8034504: d8 a0 00 00 call r5
8034508: b8 20 60 00 mv r12,r1
if ( rv == 0 ) {
803450c: 5c 20 00 0c bne r1,r0,803453c <fcntl+0x158> <== NEVER TAKEN
rv = diop - rtems_libio_iops;
8034510: 78 01 08 04 mvhi r1,0x804
8034514: 38 21 b9 8c ori r1,r1,0xb98c
8034518: 28 21 00 00 lw r1,(r1+0)
803451c: 34 02 00 02 mvi r2,2
8034520: c9 a1 08 00 sub r1,r13,r1
8034524: fb ff fe f8 calli 8034104 <__ashrsi3>
8034528: 78 03 08 03 mvhi r3,0x803
803452c: 38 63 61 a4 ori r3,r3,0x61a4
8034530: 28 62 00 00 lw r2,(r3+0)
8034534: fb ff 34 39 calli 8001618 <__mulsi3>
8034538: e0 00 00 11 bi 803457c <fcntl+0x198>
} else {
rtems_libio_free( diop );
803453c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
8034540: fb ff 49 1f calli 80069bc <rtems_libio_free> <== NOT EXECUTED
8034544: e0 00 00 21 bi 80345c8 <fcntl+0x1e4> <== 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);
8034548: 21 8c 08 00 andi r12,r12,0x800
803454c: 7d 8c 00 00 cmpnei r12,r12,0
8034550: e0 00 00 1f bi 80345cc <fcntl+0x1e8>
* 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 ) )
8034554: 29 e1 00 00 lw r1,(r15+0)
8034558: 44 20 00 03 be r1,r0,8034564 <fcntl+0x180>
iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC;
803455c: 39 8c 08 00 ori r12,r12,0x800
8034560: e0 00 00 03 bi 803456c <fcntl+0x188>
else
iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC;
8034564: 34 01 f7 ff mvi r1,-2049
8034568: a1 81 60 00 and r12,r12,r1
803456c: 59 6c 00 08 sw (r11+8),r12
8034570: e0 00 00 0d bi 80345a4 <fcntl+0x1c0>
break;
case F_GETFL: /* more flags (cloexec) */
ret = rtems_libio_to_fcntl_flags( iop->flags );
8034574: b9 80 08 00 mv r1,r12
8034578: fb ff 48 e7 calli 8006914 <rtems_libio_to_fcntl_flags>
803457c: b8 20 60 00 mv r12,r1
8034580: e0 00 00 12 bi 80345c8 <fcntl+0x1e4>
break;
case F_SETFL:
flags = rtems_libio_fcntl_flags( va_arg( ap, int ) );
8034584: 29 e1 00 00 lw r1,(r15+0)
8034588: fb ff 48 cd calli 80068bc <rtems_libio_fcntl_flags>
/*
* XXX If we are turning on append, should we seek to the end?
*/
iop->flags = (iop->flags & ~mask) | (flags & mask);
803458c: 29 63 00 08 lw r3,(r11+8)
8034590: 34 02 fd fe mvi r2,-514
8034594: 20 21 02 01 andi r1,r1,0x201
8034598: a0 43 10 00 and r2,r2,r3
803459c: b8 22 08 00 or r1,r1,r2
80345a0: 59 61 00 08 sw (r11+8),r1
{
rtems_libio_t *iop;
int fd2;
int flags;
int mask;
int ret = 0;
80345a4: 34 0c 00 00 mvi r12,0
80345a8: e0 00 00 09 bi 80345cc <fcntl+0x1e8>
errno = ENOTSUP;
ret = -1;
break;
case F_GETOWN: /* for sockets. */
errno = ENOTSUP;
80345ac: fb ff b1 d7 calli 8020d08 <__errno>
80345b0: 34 02 00 86 mvi r2,134
80345b4: e0 00 00 03 bi 80345c0 <fcntl+0x1dc>
ret = -1;
break;
default:
errno = EINVAL;
80345b8: fb ff b1 d4 calli 8020d08 <__errno>
80345bc: 34 02 00 16 mvi r2,22
80345c0: 58 22 00 00 sw (r1+0),r2
80345c4: e0 00 00 0b bi 80345f0 <fcntl+0x20c>
/*
* If we got this far successfully, then we give the optional
* filesystem specific handler a chance to process this.
*/
if (ret >= 0) {
80345c8: 48 0c 00 0b bg r0,r12,80345f4 <fcntl+0x210> <== NEVER TAKEN
int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd );
80345cc: 29 61 00 1c lw r1,(r11+28)
80345d0: b9 c0 10 00 mv r2,r14
80345d4: 28 23 00 28 lw r3,(r1+40)
80345d8: b9 60 08 00 mv r1,r11
80345dc: d8 60 00 00 call r3
80345e0: b8 20 58 00 mv r11,r1
if (err) {
80345e4: 44 20 00 04 be r1,r0,80345f4 <fcntl+0x210> <== ALWAYS TAKEN
errno = err;
80345e8: fb ff b1 c8 calli 8020d08 <__errno> <== NOT EXECUTED
80345ec: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
ret = -1;
80345f0: 34 0c ff ff mvi r12,-1
va_list ap;
va_start( ap, cmd );
ret = vfcntl(fd,cmd,ap);
va_end(ap);
return ret;
}
80345f4: b9 80 08 00 mv r1,r12
80345f8: 2b 9d 00 04 lw ra,(sp+4)
80345fc: 2b 8b 00 18 lw r11,(sp+24)
8034600: 2b 8c 00 14 lw r12,(sp+20)
8034604: 2b 8d 00 10 lw r13,(sp+16)
8034608: 2b 8e 00 0c lw r14,(sp+12)
803460c: 2b 8f 00 08 lw r15,(sp+8)
8034610: 37 9c 00 34 addi sp,sp,52
8034614: c3 a0 00 00 ret
0800a380 <fifo_open>:
int fifo_open(
pipe_control_t **pipep,
rtems_libio_t *iop
)
{
800a380: 37 9c ff d8 addi sp,sp,-40
800a384: 5b 8b 00 20 sw (sp+32),r11
800a388: 5b 8c 00 1c sw (sp+28),r12
800a38c: 5b 8d 00 18 sw (sp+24),r13
800a390: 5b 8e 00 14 sw (sp+20),r14
800a394: 5b 8f 00 10 sw (sp+16),r15
800a398: 5b 90 00 0c sw (sp+12),r16
800a39c: 5b 91 00 08 sw (sp+8),r17
800a3a0: 5b 9d 00 04 sw (sp+4),ra
static int pipe_lock(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (pipe_semaphore == RTEMS_ID_NONE) {
800a3a4: 78 0b 08 02 mvhi r11,0x802
800a3a8: 39 6b 47 a8 ori r11,r11,0x47a8
int fifo_open(
pipe_control_t **pipep,
rtems_libio_t *iop
)
{
800a3ac: b8 20 70 00 mv r14,r1
static int pipe_lock(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (pipe_semaphore == RTEMS_ID_NONE) {
800a3b0: 29 61 00 00 lw r1,(r11+0)
int fifo_open(
pipe_control_t **pipep,
rtems_libio_t *iop
)
{
800a3b4: b8 40 68 00 mv r13,r2
static int pipe_lock(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (pipe_semaphore == RTEMS_ID_NONE) {
800a3b8: 5c 20 00 19 bne r1,r0,800a41c <fifo_open+0x9c>
*/
#include <rtems/userenv.h>
static inline void rtems_libio_lock( void )
{
rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
800a3bc: 78 01 08 02 mvhi r1,0x802
800a3c0: 38 21 48 24 ori r1,r1,0x4824
800a3c4: 28 21 00 00 lw r1,(r1+0)
800a3c8: 34 02 00 00 mvi r2,0
800a3cc: 34 03 00 00 mvi r3,0
800a3d0: fb ff eb 38 calli 80050b0 <rtems_semaphore_obtain>
rtems_libio_lock();
if (pipe_semaphore == RTEMS_ID_NONE) {
800a3d4: 29 61 00 00 lw r1,(r11+0)
free(pipe);
}
static int pipe_lock(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
800a3d8: 34 0f 00 00 mvi r15,0
if (pipe_semaphore == RTEMS_ID_NONE) {
rtems_libio_lock();
if (pipe_semaphore == RTEMS_ID_NONE) {
800a3dc: 5c 2f 00 0a bne r1,r15,800a404 <fifo_open+0x84> <== NEVER TAKEN
sc = rtems_semaphore_create(
800a3e0: 78 02 08 02 mvhi r2,0x802
800a3e4: 38 42 28 e4 ori r2,r2,0x28e4
800a3e8: 28 41 00 00 lw r1,(r2+0)
800a3ec: 34 03 00 54 mvi r3,84
800a3f0: 34 02 00 01 mvi r2,1
800a3f4: 34 04 00 00 mvi r4,0
800a3f8: b9 60 28 00 mv r5,r11
800a3fc: fb ff ea b0 calli 8004ebc <rtems_semaphore_create>
800a400: b8 20 78 00 mv r15,r1
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
800a404: 78 01 08 02 mvhi r1,0x802
800a408: 38 21 48 24 ori r1,r1,0x4824
800a40c: 28 21 00 00 lw r1,(r1+0)
}
rtems_libio_unlock();
}
if (sc == RTEMS_SUCCESSFUL) {
800a410: 34 0c ff f4 mvi r12,-12
800a414: fb ff eb 77 calli 80051f0 <rtems_semaphore_release>
800a418: 5d e0 00 d8 bne r15,r0,800a778 <fifo_open+0x3f8>
sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
800a41c: 78 01 08 02 mvhi r1,0x802
800a420: 38 21 47 a8 ori r1,r1,0x47a8
800a424: 28 21 00 00 lw r1,(r1+0)
800a428: 34 02 00 00 mvi r2,0
800a42c: 34 03 00 00 mvi r3,0
800a430: fb ff eb 20 calli 80050b0 <rtems_semaphore_obtain>
}
if (sc == RTEMS_SUCCESSFUL) {
800a434: 34 0c ff f4 mvi r12,-12
800a438: 5c 20 00 d0 bne r1,r0,800a778 <fifo_open+0x3f8> <== NEVER TAKEN
err = pipe_lock();
if (err)
return err;
pipe = *pipep;
800a43c: 29 cb 00 00 lw r11,(r14+0)
if (pipe == NULL) {
800a440: 5d 61 00 57 bne r11,r1,800a59c <fifo_open+0x21c>
{
static char c = 'a';
pipe_control_t *pipe;
int err = -ENOMEM;
pipe = malloc(sizeof(pipe_control_t));
800a444: 34 01 00 34 mvi r1,52
800a448: fb ff e2 38 calli 8002d28 <malloc>
800a44c: b8 20 58 00 mv r11,r1
800a450: b8 20 78 00 mv r15,r1
if (pipe == NULL)
800a454: 44 20 00 50 be r1,r0,800a594 <fifo_open+0x214>
return err;
memset(pipe, 0, sizeof(pipe_control_t));
800a458: 34 02 00 00 mvi r2,0
800a45c: 34 03 00 34 mvi r3,52
800a460: f8 00 17 4d calli 8010194 <memset>
pipe->Size = PIPE_BUF;
800a464: 34 01 02 00 mvi r1,512
800a468: 59 61 00 04 sw (r11+4),r1
pipe->Buffer = malloc(pipe->Size);
800a46c: fb ff e2 2f calli 8002d28 <malloc>
800a470: 59 61 00 00 sw (r11+0),r1
if (! pipe->Buffer)
800a474: 44 20 00 46 be r1,r0,800a58c <fifo_open+0x20c> <== NEVER TAKEN
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
rtems_build_name ('P', 'I', 'r', c),
800a478: 78 0c 08 02 mvhi r12,0x802
if (! pipe->Buffer)
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
800a47c: 78 03 08 02 mvhi r3,0x802
800a480: 38 63 28 e8 ori r3,r3,0x28e8
rtems_build_name ('P', 'I', 'r', c),
800a484: 39 8c 41 b0 ori r12,r12,0x41b0
800a488: 41 82 00 00 lbu r2,(r12+0)
if (! pipe->Buffer)
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
800a48c: 28 61 00 00 lw r1,(r3+0)
800a490: 35 64 00 2c addi r4,r11,44
800a494: 34 03 00 00 mvi r3,0
800a498: b8 41 08 00 or r1,r2,r1
800a49c: 34 02 00 00 mvi r2,0
800a4a0: f8 00 06 e6 calli 800c038 <rtems_barrier_create>
800a4a4: b8 20 88 00 mv r17,r1
800a4a8: 5c 20 00 37 bne r1,r0,800a584 <fifo_open+0x204>
rtems_build_name ('P', 'I', 'r', c),
RTEMS_BARRIER_MANUAL_RELEASE, 0,
&pipe->readBarrier) != RTEMS_SUCCESSFUL)
goto err_rbar;
if (rtems_barrier_create(
800a4ac: 78 03 08 02 mvhi r3,0x802
800a4b0: 38 63 28 ec ori r3,r3,0x28ec
rtems_build_name ('P', 'I', 'w', c),
800a4b4: 41 82 00 00 lbu r2,(r12+0)
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(
800a4b8: 28 61 00 00 lw r1,(r3+0)
800a4bc: 35 64 00 30 addi r4,r11,48
800a4c0: 34 03 00 00 mvi r3,0
800a4c4: b8 41 08 00 or r1,r2,r1
800a4c8: 34 02 00 00 mvi r2,0
800a4cc: f8 00 06 db calli 800c038 <rtems_barrier_create>
800a4d0: b8 20 80 00 mv r16,r1
800a4d4: 5c 31 00 2a bne r1,r17,800a57c <fifo_open+0x1fc>
rtems_build_name ('P', 'I', 'w', c),
RTEMS_BARRIER_MANUAL_RELEASE, 0,
&pipe->writeBarrier) != RTEMS_SUCCESSFUL)
goto err_wbar;
if (rtems_semaphore_create(
800a4d8: 78 03 08 02 mvhi r3,0x802
800a4dc: 38 63 28 f0 ori r3,r3,0x28f0
rtems_build_name ('P', 'I', 's', c), 1,
800a4e0: 41 82 00 00 lbu r2,(r12+0)
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(
800a4e4: 28 61 00 00 lw r1,(r3+0)
800a4e8: 34 04 00 00 mvi r4,0
800a4ec: 34 03 00 10 mvi r3,16
800a4f0: b8 41 08 00 or r1,r2,r1
800a4f4: 35 65 00 28 addi r5,r11,40
800a4f8: 34 02 00 01 mvi r2,1
800a4fc: fb ff ea 70 calli 8004ebc <rtems_semaphore_create>
800a500: 5c 30 00 1d bne r1,r16,800a574 <fifo_open+0x1f4>
Objects_Id id,
Objects_Locations *location
)
{
return (Barrier_Control *)
_Objects_Get( &_Barrier_Information, id, location );
800a504: 29 62 00 2c lw r2,(r11+44)
800a508: 78 0f 08 02 mvhi r15,0x802
800a50c: 39 ef 51 c8 ori r15,r15,0x51c8
/* Set barriers to be interruptible by signals. */
static void pipe_interruptible(pipe_control_t *pipe)
{
Objects_Locations location;
_Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state
800a510: 37 91 00 24 addi r17,sp,36
800a514: ba 20 18 00 mv r3,r17
800a518: b9 e0 08 00 mv r1,r15
800a51c: fb ff f1 e1 calli 8006ca0 <_Objects_Get>
|= STATES_INTERRUPTIBLE_BY_SIGNAL;
800a520: 28 22 00 4c lw r2,(r1+76)
800a524: 78 10 10 00 mvhi r16,0x1000
800a528: b8 50 10 00 or r2,r2,r16
800a52c: 58 22 00 4c sw (r1+76),r2
_Thread_Enable_dispatch();
800a530: fb ff f5 a5 calli 8007bc4 <_Thread_Enable_dispatch>
800a534: 29 62 00 30 lw r2,(r11+48)
800a538: ba 20 18 00 mv r3,r17
800a53c: b9 e0 08 00 mv r1,r15
800a540: fb ff f1 d8 calli 8006ca0 <_Objects_Get>
_Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state
|= STATES_INTERRUPTIBLE_BY_SIGNAL;
800a544: 28 22 00 4c lw r2,(r1+76)
800a548: b8 50 80 00 or r16,r2,r16
800a54c: 58 30 00 4c sw (r1+76),r16
_Thread_Enable_dispatch();
800a550: fb ff f5 9d calli 8007bc4 <_Thread_Enable_dispatch>
#ifdef RTEMS_POSIX_API
pipe_interruptible(pipe);
#endif
*pipep = pipe;
if (c ++ == 'z')
800a554: 41 81 00 00 lbu r1,(r12+0)
800a558: 34 22 00 01 addi r2,r1,1
800a55c: 31 82 00 00 sb (r12+0),r2
800a560: 34 02 00 7a mvi r2,122
800a564: 5c 22 00 0e bne r1,r2,800a59c <fifo_open+0x21c>
c = 'a';
800a568: 34 01 00 61 mvi r1,97
800a56c: 31 81 00 00 sb (r12+0),r1
800a570: e0 00 00 0b bi 800a59c <fifo_open+0x21c>
return 0;
err_sem:
rtems_barrier_delete(pipe->writeBarrier);
800a574: 29 61 00 30 lw r1,(r11+48)
800a578: f8 00 06 ec calli 800c128 <rtems_barrier_delete>
err_wbar:
rtems_barrier_delete(pipe->readBarrier);
800a57c: 29 e1 00 2c lw r1,(r15+44)
800a580: f8 00 06 ea calli 800c128 <rtems_barrier_delete>
err_rbar:
free(pipe->Buffer);
800a584: 29 e1 00 00 lw r1,(r15+0)
800a588: fb ff e0 8d calli 80027bc <free>
err_buf:
free(pipe);
800a58c: b9 e0 08 00 mv r1,r15
800a590: fb ff e0 8b calli 80027bc <free>
if (err)
goto out;
}
if (! PIPE_LOCK(pipe))
err = -EINTR;
800a594: 34 0c ff f4 mvi r12,-12
800a598: e0 00 00 10 bi 800a5d8 <fifo_open+0x258>
err = pipe_alloc(&pipe);
if (err)
goto out;
}
if (! PIPE_LOCK(pipe))
800a59c: 29 61 00 28 lw r1,(r11+40)
800a5a0: 34 02 00 00 mvi r2,0
800a5a4: 34 03 00 00 mvi r3,0
800a5a8: fb ff ea c2 calli 80050b0 <rtems_semaphore_obtain>
800a5ac: 7c 21 00 00 cmpnei r1,r1,0
800a5b0: 34 02 ff fc mvi r2,-4
800a5b4: c8 01 60 00 sub r12,r0,r1
err = -EINTR;
if (*pipep == NULL) {
800a5b8: 29 c1 00 00 lw r1,(r14+0)
err = pipe_alloc(&pipe);
if (err)
goto out;
}
if (! PIPE_LOCK(pipe))
800a5bc: a1 82 60 00 and r12,r12,r2
err = -EINTR;
if (*pipep == NULL) {
800a5c0: 5c 20 00 06 bne r1,r0,800a5d8 <fifo_open+0x258>
if (err)
800a5c4: 45 81 00 04 be r12,r1,800a5d4 <fifo_open+0x254> <== ALWAYS TAKEN
pipe_free(pipe);
800a5c8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800a5cc: fb ff ff 29 calli 800a270 <pipe_free> <== NOT EXECUTED
800a5d0: e0 00 00 02 bi 800a5d8 <fifo_open+0x258> <== NOT EXECUTED
else
*pipep = pipe;
800a5d4: 59 cb 00 00 sw (r14+0),r11
}
out:
pipe_unlock();
800a5d8: fb ff ff 1d calli 800a24c <pipe_unlock>
pipe_control_t *pipe;
unsigned int prevCounter;
int err;
err = pipe_new(pipep);
if (err)
800a5dc: 5d 80 00 67 bne r12,r0,800a778 <fifo_open+0x3f8>
return err;
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
800a5e0: 29 a1 00 08 lw r1,(r13+8)
800a5e4: 34 02 00 04 mvi r2,4
int err;
err = pipe_new(pipep);
if (err)
return err;
pipe = *pipep;
800a5e8: 29 cb 00 00 lw r11,(r14+0)
switch (LIBIO_ACCMODE(iop)) {
800a5ec: 20 21 00 06 andi r1,r1,0x6
800a5f0: 44 22 00 24 be r1,r2,800a680 <fifo_open+0x300>
800a5f4: 34 02 00 06 mvi r2,6
800a5f8: 44 22 00 45 be r1,r2,800a70c <fifo_open+0x38c>
800a5fc: 34 02 00 02 mvi r2,2
800a600: 5c 22 00 57 bne r1,r2,800a75c <fifo_open+0x3dc> <== NEVER TAKEN
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
800a604: 29 61 00 20 lw r1,(r11+32)
800a608: 34 21 00 01 addi r1,r1,1
800a60c: 59 61 00 20 sw (r11+32),r1
if (pipe->Readers ++ == 0)
800a610: 29 61 00 10 lw r1,(r11+16)
800a614: 34 22 00 01 addi r2,r1,1
800a618: 59 62 00 10 sw (r11+16),r2
800a61c: 5c 20 00 04 bne r1,r0,800a62c <fifo_open+0x2ac> <== NEVER TAKEN
PIPE_WAKEUPWRITERS(pipe);
800a620: 29 61 00 30 lw r1,(r11+48)
800a624: 37 82 00 28 addi r2,sp,40
800a628: f8 00 06 f0 calli 800c1e8 <rtems_barrier_release>
if (pipe->Writers == 0) {
800a62c: 29 61 00 14 lw r1,(r11+20)
800a630: 5c 20 00 4b bne r1,r0,800a75c <fifo_open+0x3dc>
/* Not an error */
if (LIBIO_NODELAY(iop))
800a634: 29 a2 00 08 lw r2,(r13+8)
800a638: 20 42 00 01 andi r2,r2,0x1
800a63c: 5c 41 00 48 bne r2,r1,800a75c <fifo_open+0x3dc>
break;
prevCounter = pipe->writerCounter;
800a640: 29 70 00 24 lw r16,(r11+36)
err = -EINTR;
/* Wait until a writer opens the pipe */
do {
PIPE_UNLOCK(pipe);
800a644: 29 61 00 28 lw r1,(r11+40)
800a648: fb ff ea ea calli 80051f0 <rtems_semaphore_release>
if (! PIPE_READWAIT(pipe))
800a64c: 29 61 00 2c lw r1,(r11+44)
800a650: 34 02 00 00 mvi r2,0
800a654: f8 00 07 02 calli 800c25c <rtems_barrier_wait>
800a658: b8 20 78 00 mv r15,r1
800a65c: 5c 20 00 43 bne r1,r0,800a768 <fifo_open+0x3e8> <== NEVER TAKEN
goto out_error;
if (! PIPE_LOCK(pipe))
800a660: 29 61 00 28 lw r1,(r11+40)
800a664: 34 02 00 00 mvi r2,0
800a668: 34 03 00 00 mvi r3,0
800a66c: fb ff ea 91 calli 80050b0 <rtems_semaphore_obtain>
800a670: 5c 2f 00 3e bne r1,r15,800a768 <fifo_open+0x3e8> <== NEVER TAKEN
goto out_error;
} while (prevCounter == pipe->writerCounter);
800a674: 29 61 00 24 lw r1,(r11+36)
800a678: 46 01 ff f3 be r16,r1,800a644 <fifo_open+0x2c4> <== NEVER TAKEN
800a67c: e0 00 00 38 bi 800a75c <fifo_open+0x3dc>
}
break;
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
800a680: 29 61 00 24 lw r1,(r11+36)
800a684: 34 21 00 01 addi r1,r1,1
800a688: 59 61 00 24 sw (r11+36),r1
if (pipe->Writers ++ == 0)
800a68c: 29 61 00 14 lw r1,(r11+20)
800a690: 34 22 00 01 addi r2,r1,1
800a694: 59 62 00 14 sw (r11+20),r2
800a698: 5c 20 00 04 bne r1,r0,800a6a8 <fifo_open+0x328> <== NEVER TAKEN
PIPE_WAKEUPREADERS(pipe);
800a69c: 29 61 00 2c lw r1,(r11+44)
800a6a0: 37 82 00 28 addi r2,sp,40
800a6a4: f8 00 06 d1 calli 800c1e8 <rtems_barrier_release>
if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) {
800a6a8: 29 61 00 10 lw r1,(r11+16)
800a6ac: 5c 20 00 2c bne r1,r0,800a75c <fifo_open+0x3dc>
800a6b0: 29 a2 00 08 lw r2,(r13+8)
800a6b4: 20 42 00 01 andi r2,r2,0x1
800a6b8: 44 41 00 05 be r2,r1,800a6cc <fifo_open+0x34c>
PIPE_UNLOCK(pipe);
800a6bc: 29 61 00 28 lw r1,(r11+40)
err = -ENXIO;
800a6c0: 34 0c ff fa mvi r12,-6
if (pipe->Writers ++ == 0)
PIPE_WAKEUPREADERS(pipe);
if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) {
PIPE_UNLOCK(pipe);
800a6c4: fb ff ea cb calli 80051f0 <rtems_semaphore_release>
err = -ENXIO;
goto out_error;
800a6c8: e0 00 00 29 bi 800a76c <fifo_open+0x3ec>
}
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
800a6cc: 29 70 00 20 lw r16,(r11+32)
err = -EINTR;
do {
PIPE_UNLOCK(pipe);
800a6d0: 29 61 00 28 lw r1,(r11+40)
800a6d4: fb ff ea c7 calli 80051f0 <rtems_semaphore_release>
if (! PIPE_WRITEWAIT(pipe))
800a6d8: 29 61 00 30 lw r1,(r11+48)
800a6dc: 34 02 00 00 mvi r2,0
800a6e0: f8 00 06 df calli 800c25c <rtems_barrier_wait>
800a6e4: b8 20 78 00 mv r15,r1
800a6e8: 5c 20 00 20 bne r1,r0,800a768 <fifo_open+0x3e8> <== NEVER TAKEN
goto out_error;
if (! PIPE_LOCK(pipe))
800a6ec: 29 61 00 28 lw r1,(r11+40)
800a6f0: 34 02 00 00 mvi r2,0
800a6f4: 34 03 00 00 mvi r3,0
800a6f8: fb ff ea 6e calli 80050b0 <rtems_semaphore_obtain>
800a6fc: 5c 2f 00 1b bne r1,r15,800a768 <fifo_open+0x3e8> <== NEVER TAKEN
goto out_error;
} while (prevCounter == pipe->readerCounter);
800a700: 29 61 00 20 lw r1,(r11+32)
800a704: 46 01 ff f3 be r16,r1,800a6d0 <fifo_open+0x350> <== NEVER TAKEN
800a708: e0 00 00 15 bi 800a75c <fifo_open+0x3dc>
}
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
800a70c: 29 61 00 20 lw r1,(r11+32)
800a710: 34 21 00 01 addi r1,r1,1
800a714: 59 61 00 20 sw (r11+32),r1
if (pipe->Readers ++ == 0)
800a718: 29 61 00 10 lw r1,(r11+16)
800a71c: 34 22 00 01 addi r2,r1,1
800a720: 59 62 00 10 sw (r11+16),r2
800a724: 5c 20 00 04 bne r1,r0,800a734 <fifo_open+0x3b4> <== NEVER TAKEN
PIPE_WAKEUPWRITERS(pipe);
800a728: 29 61 00 30 lw r1,(r11+48)
800a72c: 37 82 00 28 addi r2,sp,40
800a730: f8 00 06 ae calli 800c1e8 <rtems_barrier_release>
pipe->writerCounter ++;
800a734: 29 61 00 24 lw r1,(r11+36)
800a738: 34 21 00 01 addi r1,r1,1
800a73c: 59 61 00 24 sw (r11+36),r1
if (pipe->Writers ++ == 0)
800a740: 29 61 00 14 lw r1,(r11+20)
800a744: 34 22 00 01 addi r2,r1,1
800a748: 59 62 00 14 sw (r11+20),r2
800a74c: 5c 20 00 04 bne r1,r0,800a75c <fifo_open+0x3dc> <== NEVER TAKEN
PIPE_WAKEUPREADERS(pipe);
800a750: 29 61 00 2c lw r1,(r11+44)
800a754: 37 82 00 28 addi r2,sp,40
800a758: f8 00 06 a4 calli 800c1e8 <rtems_barrier_release>
break;
}
PIPE_UNLOCK(pipe);
800a75c: 29 61 00 28 lw r1,(r11+40)
800a760: fb ff ea a4 calli 80051f0 <rtems_semaphore_release>
return 0;
800a764: e0 00 00 05 bi 800a778 <fifo_open+0x3f8>
goto out_error;
}
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
err = -EINTR;
800a768: 34 0c ff fc mvi r12,-4 <== NOT EXECUTED
PIPE_UNLOCK(pipe);
return 0;
out_error:
pipe_release(pipep, iop);
800a76c: b9 c0 08 00 mv r1,r14
800a770: b9 a0 10 00 mv r2,r13
800a774: fb ff fe d1 calli 800a2b8 <pipe_release>
return err;
}
800a778: b9 80 08 00 mv r1,r12
800a77c: 2b 9d 00 04 lw ra,(sp+4)
800a780: 2b 8b 00 20 lw r11,(sp+32)
800a784: 2b 8c 00 1c lw r12,(sp+28)
800a788: 2b 8d 00 18 lw r13,(sp+24)
800a78c: 2b 8e 00 14 lw r14,(sp+20)
800a790: 2b 8f 00 10 lw r15,(sp+16)
800a794: 2b 90 00 0c lw r16,(sp+12)
800a798: 2b 91 00 08 lw r17,(sp+8)
800a79c: 37 9c 00 28 addi sp,sp,40
800a7a0: c3 a0 00 00 ret
08008838 <fpathconf>:
*/
long fpathconf(
int fd,
int name
)
{
8008838: 37 9c ff f0 addi sp,sp,-16
800883c: 5b 8b 00 10 sw (sp+16),r11
8008840: 5b 8c 00 0c sw (sp+12),r12
8008844: 5b 8d 00 08 sw (sp+8),r13
8008848: 5b 9d 00 04 sw (sp+4),ra
long return_value;
rtems_libio_t *iop;
const rtems_filesystem_limits_and_options_t *the_limits;
rtems_libio_check_fd(fd);
800884c: 78 03 08 01 mvhi r3,0x801
8008850: 38 63 40 04 ori r3,r3,0x4004
*/
long fpathconf(
int fd,
int name
)
{
8008854: b8 40 68 00 mv r13,r2
long return_value;
rtems_libio_t *iop;
const rtems_filesystem_limits_and_options_t *the_limits;
rtems_libio_check_fd(fd);
8008858: 28 62 00 00 lw r2,(r3+0)
800885c: 54 41 00 02 bgu r2,r1,8008864 <fpathconf+0x2c>
8008860: e0 00 00 0a bi 8008888 <fpathconf+0x50>
iop = rtems_libio_iop(fd);
8008864: 78 0b 08 01 mvhi r11,0x801
8008868: 34 02 00 2c mvi r2,44
800886c: f8 00 1e f9 calli 8010450 <__mulsi3>
8008870: 39 6b 47 b8 ori r11,r11,0x47b8
8008874: 29 63 00 00 lw r3,(r11+0)
8008878: b4 61 18 00 add r3,r3,r1
rtems_libio_check_is_open(iop);
800887c: 28 61 00 08 lw r1,(r3+8)
8008880: 20 21 01 00 andi r1,r1,0x100
8008884: 5c 20 00 04 bne r1,r0,8008894 <fpathconf+0x5c> <== ALWAYS TAKEN
8008888: f8 00 0b e4 calli 800b818 <__errno>
800888c: 34 02 00 09 mvi r2,9
8008890: e0 00 00 27 bi 800892c <fpathconf+0xf4>
/*
* Now process the information request.
*/
the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options;
8008894: 28 61 00 20 lw r1,(r3+32)
8008898: 28 2b 00 2c lw r11,(r1+44)
switch ( name ) {
800889c: 34 01 00 0b mvi r1,11
80088a0: 55 a1 00 21 bgu r13,r1,8008924 <fpathconf+0xec>
80088a4: 78 0c 08 01 mvhi r12,0x801
80088a8: b9 a0 08 00 mv r1,r13
80088ac: 34 02 00 02 mvi r2,2
80088b0: f8 00 1e 73 calli 801027c <__ashlsi3>
80088b4: 39 8c 2c bc ori r12,r12,0x2cbc
80088b8: b5 81 08 00 add r1,r12,r1
80088bc: 28 21 00 00 lw r1,(r1+0)
80088c0: c0 20 00 00 b r1
case _PC_LINK_MAX:
return_value = the_limits->link_max;
80088c4: 29 61 00 00 lw r1,(r11+0)
break;
80088c8: e0 00 00 1b bi 8008934 <fpathconf+0xfc>
case _PC_MAX_CANON:
return_value = the_limits->max_canon;
80088cc: 29 61 00 04 lw r1,(r11+4)
break;
80088d0: e0 00 00 19 bi 8008934 <fpathconf+0xfc>
case _PC_MAX_INPUT:
return_value = the_limits->max_input;
80088d4: 29 61 00 08 lw r1,(r11+8)
break;
80088d8: e0 00 00 17 bi 8008934 <fpathconf+0xfc>
case _PC_NAME_MAX:
return_value = the_limits->name_max;
80088dc: 29 61 00 0c lw r1,(r11+12)
break;
80088e0: e0 00 00 15 bi 8008934 <fpathconf+0xfc>
case _PC_PATH_MAX:
return_value = the_limits->path_max;
80088e4: 29 61 00 10 lw r1,(r11+16)
break;
80088e8: e0 00 00 13 bi 8008934 <fpathconf+0xfc>
case _PC_PIPE_BUF:
return_value = the_limits->pipe_buf;
80088ec: 29 61 00 14 lw r1,(r11+20)
break;
80088f0: e0 00 00 11 bi 8008934 <fpathconf+0xfc>
case _PC_CHOWN_RESTRICTED:
return_value = the_limits->posix_chown_restrictions;
80088f4: 29 61 00 1c lw r1,(r11+28)
break;
80088f8: e0 00 00 0f bi 8008934 <fpathconf+0xfc>
case _PC_NO_TRUNC:
return_value = the_limits->posix_no_trunc;
80088fc: 29 61 00 20 lw r1,(r11+32)
break;
8008900: e0 00 00 0d bi 8008934 <fpathconf+0xfc>
case _PC_VDISABLE:
return_value = the_limits->posix_vdisable;
8008904: 29 61 00 2c lw r1,(r11+44)
break;
8008908: e0 00 00 0b bi 8008934 <fpathconf+0xfc>
case _PC_ASYNC_IO:
return_value = the_limits->posix_async_io;
800890c: 29 61 00 18 lw r1,(r11+24)
break;
8008910: e0 00 00 09 bi 8008934 <fpathconf+0xfc>
case _PC_PRIO_IO:
return_value = the_limits->posix_prio_io;
8008914: 29 61 00 24 lw r1,(r11+36)
break;
8008918: e0 00 00 07 bi 8008934 <fpathconf+0xfc>
case _PC_SYNC_IO:
return_value = the_limits->posix_sync_io;
800891c: 29 61 00 28 lw r1,(r11+40)
break;
8008920: e0 00 00 05 bi 8008934 <fpathconf+0xfc>
default:
rtems_set_errno_and_return_minus_one( EINVAL );
8008924: f8 00 0b bd calli 800b818 <__errno>
8008928: 34 02 00 16 mvi r2,22
800892c: 58 22 00 00 sw (r1+0),r2
8008930: 34 01 ff ff mvi r1,-1
break;
}
return return_value;
}
8008934: 2b 9d 00 04 lw ra,(sp+4)
8008938: 2b 8b 00 10 lw r11,(sp+16)
800893c: 2b 8c 00 0c lw r12,(sp+12)
8008940: 2b 8d 00 08 lw r13,(sp+8)
8008944: 37 9c 00 10 addi sp,sp,16
8008948: c3 a0 00 00 ret
08002910 <free>:
#include <stdlib.h>
void free(
void *ptr
)
{
8002910: 37 9c ff f4 addi sp,sp,-12
8002914: 5b 8b 00 0c sw (sp+12),r11
8002918: 5b 8c 00 08 sw (sp+8),r12
800291c: 5b 9d 00 04 sw (sp+4),ra
8002920: b8 20 58 00 mv r11,r1
MSBUMP(free_calls, 1);
8002924: 78 01 08 01 mvhi r1,0x801
8002928: 38 21 a8 88 ori r1,r1,0xa888
800292c: 28 22 00 0c lw r2,(r1+12)
8002930: 34 42 00 01 addi r2,r2,1
8002934: 58 22 00 0c sw (r1+12),r2
if ( !ptr )
8002938: 45 60 00 1f be r11,r0,80029b4 <free+0xa4>
return;
/*
* Do not attempt to free memory if in a critical section or ISR.
*/
if ( _System_state_Is_up(_System_state_Get()) &&
800293c: 78 01 08 01 mvhi r1,0x801
8002940: 38 21 ad f8 ori r1,r1,0xadf8
8002944: 28 22 00 00 lw r2,(r1+0)
8002948: 34 01 00 03 mvi r1,3
800294c: 5c 41 00 06 bne r2,r1,8002964 <free+0x54> <== NEVER TAKEN
!malloc_is_system_state_OK() ) {
8002950: f8 00 01 20 calli 8002dd0 <malloc_is_system_state_OK>
return;
/*
* Do not attempt to free memory if in a critical section or ISR.
*/
if ( _System_state_Is_up(_System_state_Get()) &&
8002954: 5c 20 00 04 bne r1,r0,8002964 <free+0x54>
!malloc_is_system_state_OK() ) {
malloc_deferred_free(ptr);
8002958: b9 60 08 00 mv r1,r11
800295c: f8 00 01 35 calli 8002e30 <malloc_deferred_free>
return;
8002960: e0 00 00 15 bi 80029b4 <free+0xa4>
}
/*
* If configured, update the statistics
*/
if ( rtems_malloc_statistics_helpers )
8002964: 78 01 08 01 mvhi r1,0x801
8002968: 38 21 a7 0c ori r1,r1,0xa70c
800296c: 28 21 00 00 lw r1,(r1+0)
8002970: 44 20 00 04 be r1,r0,8002980 <free+0x70>
(*rtems_malloc_statistics_helpers->at_free)(ptr);
8002974: 28 22 00 08 lw r2,(r1+8)
8002978: b9 60 08 00 mv r1,r11
800297c: d8 40 00 00 call r2
if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) {
8002980: 78 0c 08 01 mvhi r12,0x801
8002984: 39 8c a0 54 ori r12,r12,0xa054
8002988: 29 81 00 00 lw r1,(r12+0)
800298c: b9 60 10 00 mv r2,r11
8002990: f8 00 11 5a calli 8006ef8 <_Protected_heap_Free>
8002994: 5c 20 00 08 bne r1,r0,80029b4 <free+0xa4>
printk( "Program heap: free of bad pointer %p -- range %p - %p \n",
ptr,
RTEMS_Malloc_Heap->area_begin,
8002998: 29 84 00 00 lw r4,(r12+0)
*/
if ( rtems_malloc_statistics_helpers )
(*rtems_malloc_statistics_helpers->at_free)(ptr);
if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) {
printk( "Program heap: free of bad pointer %p -- range %p - %p \n",
800299c: 78 01 08 01 mvhi r1,0x801
80029a0: 38 21 89 58 ori r1,r1,0x8958
80029a4: 28 83 00 18 lw r3,(r4+24)
80029a8: 28 84 00 1c lw r4,(r4+28)
80029ac: b9 60 10 00 mv r2,r11
80029b0: f8 00 04 3f calli 8003aac <printk>
RTEMS_Malloc_Heap->area_begin,
RTEMS_Malloc_Heap->area_end
);
}
}
80029b4: 2b 9d 00 04 lw ra,(sp+4)
80029b8: 2b 8b 00 0c lw r11,(sp+12)
80029bc: 2b 8c 00 08 lw r12,(sp+8)
80029c0: 37 9c 00 0c addi sp,sp,12
80029c4: c3 a0 00 00 ret
08017db4 <fstat>:
int fstat(
int fd,
struct stat *sbuf
)
{
8017db4: 37 9c ff f4 addi sp,sp,-12
8017db8: 5b 8b 00 0c sw (sp+12),r11
8017dbc: 5b 8c 00 08 sw (sp+8),r12
8017dc0: 5b 9d 00 04 sw (sp+4),ra
8017dc4: b8 40 60 00 mv r12,r2
rtems_libio_t *iop;
/*
* Check to see if we were passed a valid pointer.
*/
if ( !sbuf )
8017dc8: 5c 40 00 04 bne r2,r0,8017dd8 <fstat+0x24> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( EFAULT );
8017dcc: fb ff e7 c0 calli 8011ccc <__errno> <== NOT EXECUTED
8017dd0: 34 02 00 0e mvi r2,14 <== NOT EXECUTED
8017dd4: e0 00 00 10 bi 8017e14 <fstat+0x60> <== NOT EXECUTED
/*
* Now process the stat() request.
*/
iop = rtems_libio_iop( fd );
8017dd8: 78 02 08 01 mvhi r2,0x801
8017ddc: 38 42 a0 10 ori r2,r2,0xa010
8017de0: 28 42 00 00 lw r2,(r2+0)
8017de4: 50 22 00 0a bgeu r1,r2,8017e0c <fstat+0x58>
8017de8: 78 0b 08 01 mvhi r11,0x801
8017dec: 39 6b a8 7c ori r11,r11,0xa87c
8017df0: 34 02 00 2c mvi r2,44
8017df4: fb ff ff 48 calli 8017b14 <__mulsi3>
8017df8: 29 6b 00 00 lw r11,(r11+0)
8017dfc: b5 61 58 00 add r11,r11,r1
rtems_libio_check_fd( fd );
rtems_libio_check_is_open(iop);
8017e00: 29 61 00 08 lw r1,(r11+8)
8017e04: 20 21 01 00 andi r1,r1,0x100
8017e08: 5c 20 00 06 bne r1,r0,8017e20 <fstat+0x6c>
/*
* Now process the stat() request.
*/
iop = rtems_libio_iop( fd );
rtems_libio_check_fd( fd );
8017e0c: fb ff e7 b0 calli 8011ccc <__errno>
8017e10: 34 02 00 09 mvi r2,9
8017e14: 58 22 00 00 sw (r1+0),r2
8017e18: 34 01 ff ff mvi r1,-1
8017e1c: e0 00 00 0a bi 8017e44 <fstat+0x90>
/*
* Zero out the stat structure so the various support
* versions of stat don't have to.
*/
memset( sbuf, 0, sizeof(struct stat) );
8017e20: 34 02 00 00 mvi r2,0
8017e24: 34 03 00 48 mvi r3,72
8017e28: b9 80 08 00 mv r1,r12
8017e2c: fb ff ea c1 calli 8012930 <memset>
return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf );
8017e30: 29 61 00 1c lw r1,(r11+28)
8017e34: b9 80 10 00 mv r2,r12
8017e38: 28 23 00 18 lw r3,(r1+24)
8017e3c: 35 61 00 0c addi r1,r11,12
8017e40: d8 60 00 00 call r3
}
8017e44: 2b 9d 00 04 lw ra,(sp+4)
8017e48: 2b 8b 00 0c lw r11,(sp+12)
8017e4c: 2b 8c 00 08 lw r12,(sp+8)
8017e50: 37 9c 00 0c addi sp,sp,12
8017e54: c3 a0 00 00 ret
080013b0 <get_disk_entry>:
}
}
static rtems_disk_device *
get_disk_entry(dev_t dev, bool lookup_only)
{
80013b0: 37 9c ff ec addi sp,sp,-20
80013b4: 5b 8b 00 14 sw (sp+20),r11
80013b8: 5b 8c 00 10 sw (sp+16),r12
80013bc: 5b 8d 00 0c sw (sp+12),r13
80013c0: 5b 8e 00 08 sw (sp+8),r14
80013c4: 5b 9d 00 04 sw (sp+4),ra
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) {
80013c8: 78 04 08 01 mvhi r4,0x801
80013cc: 38 84 a7 54 ori r4,r4,0xa754
}
}
static rtems_disk_device *
get_disk_entry(dev_t dev, bool lookup_only)
{
80013d0: b8 40 70 00 mv r14,r2
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
rtems_filesystem_split_dev_t(dev, major, minor);
if (major < disktab_size && disktab != NULL) {
80013d4: 28 82 00 00 lw r2,(r4+0)
}
}
static rtems_disk_device *
get_disk_entry(dev_t dev, bool lookup_only)
{
80013d8: b8 60 60 00 mv r12,r3
return dd;
}
}
return NULL;
80013dc: 34 0b 00 00 mvi r11,0
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) {
80013e0: 50 22 00 1a bgeu r1,r2,8001448 <get_disk_entry+0x98> <== NEVER TAKEN
80013e4: 78 04 08 01 mvhi r4,0x801
80013e8: 38 84 a7 50 ori r4,r4,0xa750
80013ec: 28 8d 00 00 lw r13,(r4+0)
80013f0: 45 a0 00 16 be r13,r0,8001448 <get_disk_entry+0x98> <== NEVER TAKEN
rtems_disk_device_table *dtab = disktab + major;
80013f4: 34 02 00 03 mvi r2,3
80013f8: f8 00 59 52 calli 8017940 <__ashlsi3>
80013fc: b5 a1 20 00 add r4,r13,r1
if (minor < dtab->size && dtab->minor != NULL) {
8001400: 28 81 00 04 lw r1,(r4+4)
8001404: 51 c1 00 11 bgeu r14,r1,8001448 <get_disk_entry+0x98> <== NEVER TAKEN
8001408: 28 8d 00 00 lw r13,(r4+0)
800140c: 45 a0 00 0f be r13,r0,8001448 <get_disk_entry+0x98> <== NEVER TAKEN
rtems_disk_device *dd = dtab->minor [minor];
8001410: b9 c0 08 00 mv r1,r14
8001414: 34 02 00 02 mvi r2,2
8001418: f8 00 59 4a calli 8017940 <__ashlsi3>
800141c: b5 a1 08 00 add r1,r13,r1
8001420: 28 2b 00 00 lw r11,(r1+0)
if (dd != NULL && !lookup_only) {
8001424: 45 60 00 09 be r11,r0,8001448 <get_disk_entry+0x98>
8001428: 5d 80 00 08 bne r12,r0,8001448 <get_disk_entry+0x98>
if (!dd->deleted) {
800142c: 41 61 00 40 lbu r1,(r11+64)
8001430: 5c 2c 00 05 bne r1,r12,8001444 <get_disk_entry+0x94>
++dd->uses;
8001434: 29 61 00 14 lw r1,(r11+20)
8001438: 34 21 00 01 addi r1,r1,1
800143c: 59 61 00 14 sw (r11+20),r1
8001440: e0 00 00 02 bi 8001448 <get_disk_entry+0x98>
} else {
dd = NULL;
8001444: 34 0b 00 00 mvi r11,0
return dd;
}
}
return NULL;
}
8001448: b9 60 08 00 mv r1,r11
800144c: 2b 9d 00 04 lw ra,(sp+4)
8001450: 2b 8b 00 14 lw r11,(sp+20)
8001454: 2b 8c 00 10 lw r12,(sp+16)
8001458: 2b 8d 00 0c lw r13,(sp+12)
800145c: 2b 8e 00 08 lw r14,(sp+8)
8001460: 37 9c 00 14 addi sp,sp,20
8001464: c3 a0 00 00 ret
08002fbc <get_sector>:
*/
static rtems_status_code
get_sector(int fd,
uint32_t sector_num,
rtems_sector_data_t **sector)
{
8002fbc: 37 9c ff ec addi sp,sp,-20
8002fc0: 5b 8b 00 14 sw (sp+20),r11
8002fc4: 5b 8c 00 10 sw (sp+16),r12
8002fc8: 5b 8d 00 0c sw (sp+12),r13
8002fcc: 5b 8e 00 08 sw (sp+8),r14
8002fd0: 5b 9d 00 04 sw (sp+4),ra
off_t off;
off_t new_off;
if (sector == NULL)
{
return RTEMS_INTERNAL_ERROR;
8002fd4: 34 04 00 19 mvi r4,25
*/
static rtems_status_code
get_sector(int fd,
uint32_t sector_num,
rtems_sector_data_t **sector)
{
8002fd8: b8 20 70 00 mv r14,r1
8002fdc: b8 40 68 00 mv r13,r2
8002fe0: b8 60 60 00 mv r12,r3
rtems_sector_data_t *s;
ssize_t n;
off_t off;
off_t new_off;
if (sector == NULL)
8002fe4: 44 60 00 1d be r3,r0,8003058 <get_sector+0x9c> <== NEVER TAKEN
{
return RTEMS_INTERNAL_ERROR;
}
off = sector_num * RTEMS_IDE_SECTOR_SIZE;
8002fe8: b8 40 08 00 mv r1,r2
8002fec: 34 02 00 09 mvi r2,9
8002ff0: fb ff f5 cd calli 8000724 <__ashlsi3>
8002ff4: b8 20 58 00 mv r11,r1
new_off = lseek(fd, off, SEEK_SET);
8002ff8: b9 60 10 00 mv r2,r11
8002ffc: b9 c0 08 00 mv r1,r14
8003000: 34 03 00 00 mvi r3,0
8003004: f8 00 05 46 calli 800451c <lseek>
if (new_off != off) {
return RTEMS_IO_ERROR;
8003008: 34 04 00 1b mvi r4,27
return RTEMS_INTERNAL_ERROR;
}
off = sector_num * RTEMS_IDE_SECTOR_SIZE;
new_off = lseek(fd, off, SEEK_SET);
if (new_off != off) {
800300c: 5c 2b 00 13 bne r1,r11,8003058 <get_sector+0x9c> <== NEVER TAKEN
return RTEMS_IO_ERROR;
}
s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE);
8003010: 34 01 02 04 mvi r1,516
8003014: f8 00 05 cc calli 8004744 <malloc>
8003018: b8 20 58 00 mv r11,r1
if (s == NULL)
{
return RTEMS_NO_MEMORY;
800301c: 34 04 00 1a mvi r4,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)
8003020: 44 20 00 0e be r1,r0,8003058 <get_sector+0x9c> <== NEVER TAKEN
{
return RTEMS_NO_MEMORY;
}
n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE);
8003024: 35 62 00 04 addi r2,r11,4
8003028: b9 c0 08 00 mv r1,r14
800302c: 34 03 02 00 mvi r3,512
8003030: f8 00 08 ad calli 80052e4 <read>
if (n != RTEMS_IDE_SECTOR_SIZE)
8003034: 34 02 02 00 mvi r2,512
8003038: 44 22 00 05 be r1,r2,800304c <get_sector+0x90> <== ALWAYS TAKEN
{
free(s);
800303c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8003040: f8 00 03 d6 calli 8003f98 <free> <== NOT EXECUTED
return RTEMS_IO_ERROR;
8003044: 34 04 00 1b mvi r4,27 <== NOT EXECUTED
8003048: e0 00 00 04 bi 8003058 <get_sector+0x9c> <== NOT EXECUTED
}
s->sector_num = sector_num;
800304c: 59 6d 00 00 sw (r11+0),r13
*sector = s;
8003050: 59 8b 00 00 sw (r12+0),r11
return RTEMS_SUCCESSFUL;
8003054: 34 04 00 00 mvi r4,0
}
8003058: b8 80 08 00 mv r1,r4
800305c: 2b 9d 00 04 lw ra,(sp+4)
8003060: 2b 8b 00 14 lw r11,(sp+20)
8003064: 2b 8c 00 10 lw r12,(sp+16)
8003068: 2b 8d 00 0c lw r13,(sp+12)
800306c: 2b 8e 00 08 lw r14,(sp+8)
8003070: 37 9c 00 14 addi sp,sp,20
8003074: c3 a0 00 00 ret
08034658 <getdents>:
int getdents(
int dd_fd,
char *dd_buf,
int dd_len
)
{
8034658: 37 9c ff f0 addi sp,sp,-16
803465c: 5b 8b 00 10 sw (sp+16),r11
8034660: 5b 8c 00 0c sw (sp+12),r12
8034664: 5b 8d 00 08 sw (sp+8),r13
8034668: 5b 9d 00 04 sw (sp+4),ra
rtems_filesystem_node_types_t type;
/*
* Get the file control block structure associated with the file descriptor
*/
iop = rtems_libio_iop( dd_fd );
803466c: 78 04 08 03 mvhi r4,0x803
8034670: 38 84 b0 14 ori r4,r4,0xb014
int getdents(
int dd_fd,
char *dd_buf,
int dd_len
)
{
8034674: b8 40 68 00 mv r13,r2
rtems_filesystem_node_types_t type;
/*
* Get the file control block structure associated with the file descriptor
*/
iop = rtems_libio_iop( dd_fd );
8034678: 28 82 00 00 lw r2,(r4+0)
int getdents(
int dd_fd,
char *dd_buf,
int dd_len
)
{
803467c: b8 60 60 00 mv r12,r3
rtems_filesystem_node_types_t type;
/*
* Get the file control block structure associated with the file descriptor
*/
iop = rtems_libio_iop( dd_fd );
8034680: 34 0b 00 00 mvi r11,0
8034684: 50 22 00 07 bgeu r1,r2,80346a0 <getdents+0x48> <== NEVER TAKEN
8034688: 78 0b 08 04 mvhi r11,0x804
803468c: 39 6b b9 8c ori r11,r11,0xb98c
8034690: 34 02 00 2c mvi r2,44
8034694: fb ff 33 e1 calli 8001618 <__mulsi3>
8034698: 29 6b 00 00 lw r11,(r11+0)
803469c: b5 61 58 00 add r11,r11,r1
/*
* Make sure we are working on a directory
*/
type = rtems_filesystem_node_type( &iop->pathinfo );
80346a0: 35 61 00 0c addi r1,r11,12
80346a4: fb ff 50 8f calli 80088e0 <rtems_filesystem_node_type>
if ( type != RTEMS_FILESYSTEM_DIRECTORY )
80346a8: 44 20 00 06 be r1,r0,80346c0 <getdents+0x68>
rtems_set_errno_and_return_minus_one( ENOTDIR );
80346ac: fb ff b1 97 calli 8020d08 <__errno>
80346b0: 34 02 00 14 mvi r2,20
80346b4: 58 22 00 00 sw (r1+0),r2
80346b8: 34 01 ff ff mvi r1,-1
80346bc: e0 00 00 07 bi 80346d8 <getdents+0x80>
/*
* Return the number of bytes that were actually transfered as a result
* of the read attempt.
*/
return (*iop->pathinfo.handlers->read_h)( iop, dd_buf, dd_len );
80346c0: 29 61 00 1c lw r1,(r11+28)
80346c4: b9 a0 10 00 mv r2,r13
80346c8: b9 80 18 00 mv r3,r12
80346cc: 28 24 00 08 lw r4,(r1+8)
80346d0: b9 60 08 00 mv r1,r11
80346d4: d8 80 00 00 call r4
}
80346d8: 2b 9d 00 04 lw ra,(sp+4)
80346dc: 2b 8b 00 10 lw r11,(sp+16)
80346e0: 2b 8c 00 0c lw r12,(sp+12)
80346e4: 2b 8d 00 08 lw r13,(sp+8)
80346e8: 37 9c 00 10 addi sp,sp,16
80346ec: c3 a0 00 00 ret
08023890 <init_etc_passwd_group>:
/**
* Initialize useable but dummy databases
*/
void init_etc_passwd_group(void)
{
8023890: 37 9c ff f0 addi sp,sp,-16
8023894: 5b 8b 00 10 sw (sp+16),r11
8023898: 5b 8c 00 0c sw (sp+12),r12
802389c: 5b 8d 00 08 sw (sp+8),r13
80238a0: 5b 9d 00 04 sw (sp+4),ra
FILE *fp;
static char etc_passwd_initted = 0;
if (etc_passwd_initted)
80238a4: 78 01 08 06 mvhi r1,0x806
80238a8: 38 21 9c 50 ori r1,r1,0x9c50
80238ac: 40 2d 00 00 lbu r13,(r1+0)
80238b0: 5d a0 00 2f bne r13,r0,802396c <init_etc_passwd_group+0xdc>
return;
etc_passwd_initted = 1;
80238b4: 34 02 00 01 mvi r2,1
80238b8: 30 22 00 00 sb (r1+0),r2
mkdir("/etc", 0777);
80238bc: 78 01 08 05 mvhi r1,0x805
80238c0: 34 02 01 ff mvi r2,511
80238c4: 38 21 f6 20 ori r1,r1,0xf620
80238c8: fb ff 77 37 calli 80015a4 <mkdir>
/*
* Initialize /etc/passwd
*/
if ((fp = fopen("/etc/passwd", "r")) != NULL) {
80238cc: 78 0b 08 05 mvhi r11,0x805
80238d0: 39 6b f6 28 ori r11,r11,0xf628
80238d4: 78 02 08 05 mvhi r2,0x805
80238d8: b9 60 08 00 mv r1,r11
80238dc: 38 42 e6 20 ori r2,r2,0xe620
80238e0: f8 00 58 70 calli 8039aa0 <fopen>
80238e4: b8 20 60 00 mv r12,r1
80238e8: 5c 2d 00 0c bne r1,r13,8023918 <init_etc_passwd_group+0x88>
fclose(fp);
}
else if ((fp = fopen("/etc/passwd", "w")) != NULL) {
80238ec: 78 02 08 05 mvhi r2,0x805
80238f0: b9 60 08 00 mv r1,r11
80238f4: 38 42 b3 34 ori r2,r2,0xb334
80238f8: f8 00 58 6a calli 8039aa0 <fopen>
80238fc: b8 20 58 00 mv r11,r1
8023900: 44 2c 00 07 be r1,r12,802391c <init_etc_passwd_group+0x8c> <== NEVER TAKEN
fprintf(fp, "root:*:0:0:root::/:/bin/sh\n"
8023904: 78 01 08 05 mvhi r1,0x805
8023908: 38 21 f6 34 ori r1,r1,0xf634
802390c: b9 60 10 00 mv r2,r11
8023910: f8 00 58 e8 calli 8039cb0 <fputs>
"rtems:*:1:1:RTEMS Application::/:/bin/sh\n"
"tty:!:2:2:tty owner::/:/bin/false\n" );
fclose(fp);
8023914: b9 60 08 00 mv r1,r11
8023918: f8 00 55 75 calli 8038eec <fclose>
}
/*
* Initialize /etc/group
*/
if ((fp = fopen("/etc/group", "r")) != NULL) {
802391c: 78 0b 08 05 mvhi r11,0x805
8023920: 39 6b f6 9c ori r11,r11,0xf69c
8023924: 78 02 08 05 mvhi r2,0x805
8023928: b9 60 08 00 mv r1,r11
802392c: 38 42 e6 20 ori r2,r2,0xe620
8023930: f8 00 58 5c calli 8039aa0 <fopen>
8023934: b8 20 60 00 mv r12,r1
8023938: 5c 20 00 0c bne r1,r0,8023968 <init_etc_passwd_group+0xd8>
fclose(fp);
}
else if ((fp = fopen("/etc/group", "w")) != NULL) {
802393c: 78 02 08 05 mvhi r2,0x805
8023940: b9 60 08 00 mv r1,r11
8023944: 38 42 b3 34 ori r2,r2,0xb334
8023948: f8 00 58 56 calli 8039aa0 <fopen>
802394c: b8 20 58 00 mv r11,r1
8023950: 44 2c 00 07 be r1,r12,802396c <init_etc_passwd_group+0xdc> <== NEVER TAKEN
fprintf( fp, "root:x:0:root\n"
8023954: 78 01 08 05 mvhi r1,0x805
8023958: 38 21 f6 a8 ori r1,r1,0xf6a8
802395c: b9 60 10 00 mv r2,r11
8023960: f8 00 58 d4 calli 8039cb0 <fputs>
"rtems:x:1:rtems\n"
"tty:x:2:tty\n" );
fclose(fp);
8023964: b9 60 08 00 mv r1,r11
8023968: f8 00 55 61 calli 8038eec <fclose>
}
}
802396c: 2b 9d 00 04 lw ra,(sp+4)
8023970: 2b 8b 00 10 lw r11,(sp+16)
8023974: 2b 8c 00 0c lw r12,(sp+12)
8023978: 2b 8d 00 08 lw r13,(sp+8)
802397c: 37 9c 00 10 addi sp,sp,16
8023980: c3 a0 00 00 ret
08002ab0 <ioctl>:
int ioctl(
int fd,
ioctl_command_t command,
...
)
{
8002ab0: 37 9c ff d8 addi sp,sp,-40
8002ab4: 5b 8b 00 0c sw (sp+12),r11
8002ab8: 5b 8c 00 08 sw (sp+8),r12
8002abc: 5b 9d 00 04 sw (sp+4),ra
8002ac0: 5b 83 00 14 sw (sp+20),r3
va_list ap;
int rc;
rtems_libio_t *iop;
void *buffer;
rtems_libio_check_fd( fd );
8002ac4: 78 03 08 01 mvhi r3,0x801
int ioctl(
int fd,
ioctl_command_t command,
...
)
{
8002ac8: 5b 82 00 10 sw (sp+16),r2
8002acc: 5b 84 00 18 sw (sp+24),r4
8002ad0: 5b 85 00 1c sw (sp+28),r5
8002ad4: 5b 86 00 20 sw (sp+32),r6
8002ad8: 5b 87 00 24 sw (sp+36),r7
8002adc: 5b 88 00 28 sw (sp+40),r8
va_list ap;
int rc;
rtems_libio_t *iop;
void *buffer;
rtems_libio_check_fd( fd );
8002ae0: 38 63 a0 10 ori r3,r3,0xa010
int ioctl(
int fd,
ioctl_command_t command,
...
)
{
8002ae4: b8 40 60 00 mv r12,r2
va_list ap;
int rc;
rtems_libio_t *iop;
void *buffer;
rtems_libio_check_fd( fd );
8002ae8: 28 62 00 00 lw r2,(r3+0)
8002aec: 54 41 00 02 bgu r2,r1,8002af4 <ioctl+0x44>
8002af0: e0 00 00 0a bi 8002b18 <ioctl+0x68>
iop = rtems_libio_iop( fd );
8002af4: 34 02 00 2c mvi r2,44
8002af8: 78 0b 08 01 mvhi r11,0x801
8002afc: f8 00 54 06 calli 8017b14 <__mulsi3>
8002b00: 39 6b a8 7c ori r11,r11,0xa87c
8002b04: 29 62 00 00 lw r2,(r11+0)
8002b08: b4 41 08 00 add r1,r2,r1
rtems_libio_check_is_open(iop);
8002b0c: 28 22 00 08 lw r2,(r1+8)
8002b10: 20 42 01 00 andi r2,r2,0x100
8002b14: 5c 40 00 06 bne r2,r0,8002b2c <ioctl+0x7c> <== ALWAYS TAKEN
8002b18: f8 00 3c 6d calli 8011ccc <__errno>
8002b1c: 34 02 00 09 mvi r2,9
8002b20: 58 22 00 00 sw (r1+0),r2
8002b24: 34 01 ff ff mvi r1,-1
8002b28: e0 00 00 06 bi 8002b40 <ioctl+0x90>
buffer = va_arg(ap, void *);
/*
* Now process the ioctl().
*/
rc = (*iop->pathinfo.handlers->ioctl_h)( iop, command, buffer );
8002b2c: 28 22 00 1c lw r2,(r1+28)
8002b30: 2b 83 00 14 lw r3,(sp+20)
8002b34: 28 44 00 10 lw r4,(r2+16)
8002b38: b9 80 10 00 mv r2,r12
8002b3c: d8 80 00 00 call r4
va_end( ap );
return rc;
}
8002b40: 2b 9d 00 04 lw ra,(sp+4)
8002b44: 2b 8b 00 0c lw r11,(sp+12)
8002b48: 2b 8c 00 08 lw r12,(sp+8)
8002b4c: 37 9c 00 28 addi sp,sp,40
8002b50: c3 a0 00 00 ret
08004fa0 <iproc>:
/*
* Process a single input character
*/
static int
iproc (unsigned char c, struct rtems_termios_tty *tty)
{
8004fa0: 37 9c ff f4 addi sp,sp,-12
8004fa4: 5b 8b 00 0c sw (sp+12),r11
8004fa8: 5b 8c 00 08 sw (sp+8),r12
8004fac: 5b 9d 00 04 sw (sp+4),ra
8004fb0: b8 40 58 00 mv r11,r2
if (tty->termios.c_iflag & ISTRIP)
8004fb4: 28 42 00 30 lw r2,(r2+48)
/*
* Process a single input character
*/
static int
iproc (unsigned char c, struct rtems_termios_tty *tty)
{
8004fb8: b8 20 60 00 mv r12,r1
if (tty->termios.c_iflag & ISTRIP)
8004fbc: 20 41 00 20 andi r1,r2,0x20
8004fc0: 44 20 00 02 be r1,r0,8004fc8 <iproc+0x28> <== ALWAYS TAKEN
c &= 0x7f;
8004fc4: 21 8c 00 7f andi r12,r12,0x7f <== NOT EXECUTED
if (tty->termios.c_iflag & IUCLC)
8004fc8: 20 41 02 00 andi r1,r2,0x200
8004fcc: 44 20 00 0b be r1,r0,8004ff8 <iproc+0x58>
c = tolower (c);
8004fd0: 78 01 08 02 mvhi r1,0x802
8004fd4: 38 21 82 e0 ori r1,r1,0x82e0
8004fd8: 28 21 00 00 lw r1,(r1+0)
8004fdc: b4 2c 08 00 add r1,r1,r12
8004fe0: 40 23 00 01 lbu r3,(r1+1)
8004fe4: 34 01 00 01 mvi r1,1
8004fe8: 20 63 00 03 andi r3,r3,0x3
8004fec: 5c 61 00 02 bne r3,r1,8004ff4 <iproc+0x54>
8004ff0: 35 8c 00 20 addi r12,r12,32
8004ff4: 21 8c 00 ff andi r12,r12,0xff
if (c == '\r') {
8004ff8: 34 01 00 0d mvi r1,13
8004ffc: 5d 81 00 08 bne r12,r1,800501c <iproc+0x7c>
if (tty->termios.c_iflag & IGNCR)
8005000: 20 43 00 80 andi r3,r2,0x80
return 0;
8005004: 34 01 00 00 mvi r1,0
if (tty->termios.c_iflag & IUCLC)
c = tolower (c);
if (c == '\r') {
if (tty->termios.c_iflag & IGNCR)
8005008: 5c 60 00 4e bne r3,r0,8005140 <iproc+0x1a0> <== NEVER TAKEN
return 0;
if (tty->termios.c_iflag & ICRNL)
800500c: 20 42 01 00 andi r2,r2,0x100
8005010: 44 43 00 0a be r2,r3,8005038 <iproc+0x98> <== NEVER TAKEN
c = '\n';
8005014: 34 0c 00 0a mvi r12,10
8005018: e0 00 00 08 bi 8005038 <iproc+0x98>
} else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
800501c: 34 01 00 0a mvi r1,10
8005020: 5d 81 00 05 bne r12,r1,8005034 <iproc+0x94>
8005024: 20 42 00 40 andi r2,r2,0x40
8005028: 44 40 00 04 be r2,r0,8005038 <iproc+0x98> <== ALWAYS TAKEN
c = '\r';
800502c: 34 0c 00 0d mvi r12,13 <== NOT EXECUTED
8005030: e0 00 00 02 bi 8005038 <iproc+0x98> <== NOT EXECUTED
}
if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
8005034: 45 80 00 2f be r12,r0,80050f0 <iproc+0x150> <== NEVER TAKEN
8005038: 29 62 00 3c lw r2,(r11+60)
800503c: 20 41 00 02 andi r1,r2,0x2
8005040: 44 20 00 2c be r1,r0,80050f0 <iproc+0x150>
if (c == tty->termios.c_cc[VERASE]) {
8005044: 41 61 00 43 lbu r1,(r11+67)
8005048: 5c 2c 00 04 bne r1,r12,8005058 <iproc+0xb8>
erase (tty, 0);
800504c: b9 60 08 00 mv r1,r11
8005050: 34 02 00 00 mvi r2,0
8005054: e0 00 00 05 bi 8005068 <iproc+0xc8>
return 0;
}
else if (c == tty->termios.c_cc[VKILL]) {
8005058: 41 61 00 44 lbu r1,(r11+68)
800505c: 5c 2c 00 05 bne r1,r12,8005070 <iproc+0xd0>
erase (tty, 1);
8005060: b9 60 08 00 mv r1,r11
8005064: 34 02 00 01 mvi r2,1
8005068: fb ff ff 4c calli 8004d98 <erase>
800506c: e0 00 00 34 bi 800513c <iproc+0x19c>
return 0;
}
else if (c == tty->termios.c_cc[VEOF]) {
8005070: 41 63 00 45 lbu r3,(r11+69)
return 1;
8005074: 34 01 00 01 mvi r1,1
}
else if (c == tty->termios.c_cc[VKILL]) {
erase (tty, 1);
return 0;
}
else if (c == tty->termios.c_cc[VEOF]) {
8005078: 44 6c 00 32 be r3,r12,8005140 <iproc+0x1a0> <== NEVER TAKEN
return 1;
} else if (c == '\n') {
800507c: 34 01 00 0a mvi r1,10
8005080: 5d 81 00 0b bne r12,r1,80050ac <iproc+0x10c>
if (tty->termios.c_lflag & (ECHO | ECHONL))
8005084: 20 42 00 48 andi r2,r2,0x48
8005088: 44 40 00 03 be r2,r0,8005094 <iproc+0xf4> <== NEVER TAKEN
echo (c, tty);
800508c: b9 60 10 00 mv r2,r11
8005090: fb ff ff 1d calli 8004d04 <echo>
tty->cbuf[tty->ccount++] = c;
8005094: 29 61 00 20 lw r1,(r11+32)
8005098: 29 62 00 1c lw r2,(r11+28)
800509c: 34 03 00 0a mvi r3,10
80050a0: b4 41 10 00 add r2,r2,r1
80050a4: 30 43 00 00 sb (r2+0),r3
80050a8: e0 00 00 0e bi 80050e0 <iproc+0x140>
return 1;
} else if ((c == tty->termios.c_cc[VEOL]) ||
80050ac: 41 61 00 4c lbu r1,(r11+76)
80050b0: 44 2c 00 03 be r1,r12,80050bc <iproc+0x11c> <== NEVER TAKEN
80050b4: 41 61 00 51 lbu r1,(r11+81)
80050b8: 5c 2c 00 0e bne r1,r12,80050f0 <iproc+0x150> <== ALWAYS TAKEN
(c == tty->termios.c_cc[VEOL2])) {
if (tty->termios.c_lflag & ECHO)
80050bc: 20 42 00 08 andi r2,r2,0x8 <== NOT EXECUTED
80050c0: 44 40 00 04 be r2,r0,80050d0 <iproc+0x130> <== NOT EXECUTED
echo (c, tty);
80050c4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
80050c8: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
80050cc: fb ff ff 0e calli 8004d04 <echo> <== NOT EXECUTED
tty->cbuf[tty->ccount++] = c;
80050d0: 29 61 00 20 lw r1,(r11+32) <== NOT EXECUTED
80050d4: 29 62 00 1c lw r2,(r11+28) <== NOT EXECUTED
80050d8: b4 41 10 00 add r2,r2,r1 <== NOT EXECUTED
80050dc: 30 4c 00 00 sb (r2+0),r12 <== NOT EXECUTED
80050e0: 34 21 00 01 addi r1,r1,1
80050e4: 59 61 00 20 sw (r11+32),r1
return 1;
80050e8: 34 01 00 01 mvi r1,1
80050ec: e0 00 00 15 bi 8005140 <iproc+0x1a0>
}
/*
* FIXME: Should do IMAXBEL handling somehow
*/
if (tty->ccount < (CBUFSIZE-1)) {
80050f0: 78 01 08 02 mvhi r1,0x802
80050f4: 38 21 81 40 ori r1,r1,0x8140
80050f8: 28 22 00 00 lw r2,(r1+0)
80050fc: 29 63 00 20 lw r3,(r11+32)
if (tty->termios.c_lflag & ECHO)
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
}
return 0;
8005100: 34 01 00 00 mvi r1,0
}
/*
* FIXME: Should do IMAXBEL handling somehow
*/
if (tty->ccount < (CBUFSIZE-1)) {
8005104: 34 42 ff ff addi r2,r2,-1
8005108: 50 62 00 0e bgeu r3,r2,8005140 <iproc+0x1a0> <== NEVER TAKEN
if (tty->termios.c_lflag & ECHO)
800510c: 29 61 00 3c lw r1,(r11+60)
8005110: 20 21 00 08 andi r1,r1,0x8
8005114: 44 20 00 04 be r1,r0,8005124 <iproc+0x184> <== NEVER TAKEN
echo (c, tty);
8005118: b9 80 08 00 mv r1,r12
800511c: b9 60 10 00 mv r2,r11
8005120: fb ff fe f9 calli 8004d04 <echo>
tty->cbuf[tty->ccount++] = c;
8005124: 29 61 00 20 lw r1,(r11+32)
8005128: 29 62 00 1c lw r2,(r11+28)
800512c: b4 41 10 00 add r2,r2,r1
8005130: 30 4c 00 00 sb (r2+0),r12
8005134: 34 21 00 01 addi r1,r1,1
8005138: 59 61 00 20 sw (r11+32),r1
}
return 0;
800513c: 34 01 00 00 mvi r1,0
}
8005140: 2b 9d 00 04 lw ra,(sp+4)
8005144: 2b 8b 00 0c lw r11,(sp+12)
8005148: 2b 8c 00 08 lw r12,(sp+8)
800514c: 37 9c 00 0c addi sp,sp,12
8005150: c3 a0 00 00 ret
08025e38 <killinfo>:
int killinfo(
pid_t pid,
int sig,
const union sigval *value
)
{
8025e38: 37 9c ff dc addi sp,sp,-36
8025e3c: 5b 8b 00 18 sw (sp+24),r11
8025e40: 5b 8c 00 14 sw (sp+20),r12
8025e44: 5b 8d 00 10 sw (sp+16),r13
8025e48: 5b 8e 00 0c sw (sp+12),r14
8025e4c: 5b 8f 00 08 sw (sp+8),r15
8025e50: 5b 9d 00 04 sw (sp+4),ra
8025e54: b8 20 60 00 mv r12,r1
8025e58: b8 40 58 00 mv r11,r2
8025e5c: b8 60 68 00 mv r13,r3
POSIX_signals_Siginfo_node *psiginfo;
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
8025e60: fb ff ff 3d calli 8025b54 <getpid>
8025e64: 45 81 00 04 be r12,r1,8025e74 <killinfo+0x3c>
rtems_set_errno_and_return_minus_one( ESRCH );
8025e68: fb ff b4 7c calli 8013058 <__errno>
8025e6c: 34 02 00 03 mvi r2,3
8025e70: e0 00 00 04 bi 8025e80 <killinfo+0x48>
/*
* Validate the signal passed.
*/
if ( !sig )
8025e74: 5d 60 00 06 bne r11,r0,8025e8c <killinfo+0x54>
rtems_set_errno_and_return_minus_one( EINVAL );
8025e78: fb ff b4 78 calli 8013058 <__errno>
8025e7c: 34 02 00 16 mvi r2,22
8025e80: 58 22 00 00 sw (r1+0),r2
8025e84: 34 01 ff ff mvi r1,-1
8025e88: e0 00 00 a2 bi 8026110 <killinfo+0x2d8>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
8025e8c: 35 6f ff ff addi r15,r11,-1
if ( !is_valid_signo(sig) )
8025e90: 34 01 00 1f mvi r1,31
8025e94: 50 2f 00 02 bgeu r1,r15,8025e9c <killinfo+0x64>
8025e98: e3 ff ff f8 bi 8025e78 <killinfo+0x40>
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 )
8025e9c: 34 02 00 01 mvi r2,1
8025ea0: b9 60 08 00 mv r1,r11
8025ea4: fb ff 6f e2 calli 8001e2c <__ashlsi3>
8025ea8: 34 02 00 02 mvi r2,2
8025eac: 78 0c 08 02 mvhi r12,0x802
8025eb0: b4 2b 08 00 add r1,r1,r11
8025eb4: fb ff 6f de calli 8001e2c <__ashlsi3>
8025eb8: 39 8c 9f 88 ori r12,r12,0x9f88
8025ebc: b5 81 08 00 add r1,r12,r1
8025ec0: 28 22 00 08 lw r2,(r1+8)
8025ec4: 34 0e 00 01 mvi r14,1
return 0;
8025ec8: 34 01 00 00 mvi r1,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 )
8025ecc: 44 4e 00 91 be r2,r14,8026110 <killinfo+0x2d8> <== NEVER TAKEN
/*
* 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 ) )
8025ed0: 65 62 00 04 cmpei r2,r11,4
8025ed4: 65 61 00 08 cmpei r1,r11,8
8025ed8: b8 41 08 00 or r1,r2,r1
8025edc: 5c 20 00 03 bne r1,r0,8025ee8 <killinfo+0xb0>
8025ee0: 34 01 00 0b mvi r1,11
8025ee4: 5d 61 00 05 bne r11,r1,8025ef8 <killinfo+0xc0>
return pthread_kill( pthread_self(), sig );
8025ee8: f8 00 01 3c calli 80263d8 <pthread_self>
8025eec: b9 60 10 00 mv r2,r11
8025ef0: f8 00 00 f6 calli 80262c8 <pthread_kill>
8025ef4: e0 00 00 87 bi 8026110 <killinfo+0x2d8>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
8025ef8: 34 01 00 01 mvi r1,1
8025efc: b9 e0 10 00 mv r2,r15
8025f00: fb ff 6f cb calli 8001e2c <__ashlsi3>
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
8025f04: 5b 8b 00 1c sw (sp+28),r11
siginfo->si_code = SI_USER;
8025f08: 5b 8e 00 20 sw (sp+32),r14
8025f0c: b8 20 60 00 mv r12,r1
if ( !value ) {
8025f10: 5d a0 00 03 bne r13,r0,8025f1c <killinfo+0xe4>
siginfo->si_value.sival_int = 0;
8025f14: 5b 80 00 24 sw (sp+36),r0
8025f18: e0 00 00 03 bi 8025f24 <killinfo+0xec>
} else {
siginfo->si_value = *value;
8025f1c: 29 a1 00 00 lw r1,(r13+0)
8025f20: 5b 81 00 24 sw (sp+36),r1
*
* 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;
8025f24: 78 01 08 02 mvhi r1,0x802
8025f28: 38 21 9a 78 ori r1,r1,0x9a78
8025f2c: 28 22 00 00 lw r2,(r1+0)
++level;
8025f30: 34 42 00 01 addi r2,r2,1
_Thread_Dispatch_disable_level = level;
8025f34: 58 22 00 00 sw (r1+0),r2
*/
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 );
8025f38: 78 01 08 02 mvhi r1,0x802
8025f3c: 38 21 91 d4 ori r1,r1,0x91d4
8025f40: fb ff 91 4d calli 800a474 <_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;
8025f44: 78 01 08 02 mvhi r1,0x802
8025f48: 38 21 9f 00 ori r1,r1,0x9f00
8025f4c: 28 23 00 10 lw r3,(r1+16)
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( _POSIX_signals_Is_interested( api, mask ) ) {
8025f50: 28 61 01 1c lw r1,(r3+284)
8025f54: 28 21 00 d0 lw r1,(r1+208)
8025f58: a4 20 08 00 not r1,r1
8025f5c: a1 81 08 00 and r1,r12,r1
8025f60: 5c 20 00 3f bne r1,r0,802605c <killinfo+0x224>
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
return 0;
}
8025f64: 78 01 08 02 mvhi r1,0x802
8025f68: 38 21 a1 14 ori r1,r1,0xa114
8025f6c: 28 22 00 00 lw r2,(r1+0)
/* 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 );
8025f70: 78 01 08 02 mvhi r1,0x802
8025f74: 38 21 a1 18 ori r1,r1,0xa118
8025f78: e0 00 00 0b bi 8025fa4 <killinfo+0x16c>
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
8025f7c: 28 44 00 30 lw r4,(r2+48)
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;
8025f80: b8 40 18 00 mv r3,r2
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8025f84: 28 45 01 1c lw r5,(r2+284)
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
8025f88: a1 84 20 00 and r4,r12,r4
8025f8c: 5c 80 00 34 bne r4,r0,802605c <killinfo+0x224>
/*
* Is this thread is blocked waiting for another signal but has
* not blocked this one?
*/
if (~api->signals_blocked & mask)
8025f90: 28 a5 00 d0 lw r5,(r5+208)
8025f94: a4 a0 28 00 not r5,r5
8025f98: a1 85 28 00 and r5,r12,r5
8025f9c: 5c a4 00 30 bne r5,r4,802605c <killinfo+0x224>
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 ) {
8025fa0: 28 42 00 00 lw r2,(r2+0)
/* 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 );
8025fa4: 5c 41 ff f6 bne r2,r1,8025f7c <killinfo+0x144>
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
8025fa8: 78 01 08 02 mvhi r1,0x802
8025fac: 38 21 90 d8 ori r1,r1,0x90d8
8025fb0: 40 21 00 00 lbu r1,(r1+0)
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
8025fb4: 78 02 08 02 mvhi r2,0x802
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
8025fb8: 78 04 08 02 mvhi r4,0x802
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
8025fbc: 38 42 9a 14 ori r2,r2,0x9a14
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
8025fc0: 34 21 00 01 addi r1,r1,1
8025fc4: 38 84 9a 1c ori r4,r4,0x9a1c
*/
#define _POSIX_signals_Is_interested( _api, _mask ) \
( ~(_api)->signals_blocked & (_mask) )
int killinfo(
8025fc8: 34 4d 00 10 addi r13,r2,16
*
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
8025fcc: 34 03 00 00 mvi r3,0
*/
RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal (
States_Control the_states
)
{
return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL);
8025fd0: 78 08 10 00 mvhi r8,0x1000
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 ] )
8025fd4: 28 85 00 00 lw r5,(r4+0)
8025fd8: 44 a0 00 1e be r5,r0,8026050 <killinfo+0x218> <== NEVER TAKEN
continue;
the_info = _Objects_Information_table[ the_api ][ 1 ];
8025fdc: 28 a5 00 04 lw r5,(r5+4)
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
8025fe0: 34 06 00 01 mvi r6,1
*/
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
8025fe4: 2c ae 00 10 lhu r14,(r5+16)
8025fe8: 28 a7 00 1c lw r7,(r5+28)
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
8025fec: e0 00 00 18 bi 802604c <killinfo+0x214>
the_thread = (Thread_Control *) object_table[ index ];
8025ff0: 28 e2 00 04 lw r2,(r7+4)
if ( !the_thread )
8025ff4: 44 40 00 14 be r2,r0,8026044 <killinfo+0x20c>
/*
* If this thread is of lower priority than the interested thread,
* go on to the next thread.
*/
if ( the_thread->current_priority > interested_priority )
8025ff8: 28 45 00 14 lw r5,(r2+20)
8025ffc: 54 a1 00 12 bgu r5,r1,8026044 <killinfo+0x20c>
#if defined(RTEMS_DEBUG)
if ( !api )
continue;
#endif
if ( !_POSIX_signals_Is_interested( api, mask ) )
8026000: 28 49 01 1c lw r9,(r2+284)
8026004: 29 29 00 d0 lw r9,(r9+208)
8026008: a5 20 48 00 not r9,r9
802600c: a1 89 48 00 and r9,r12,r9
8026010: 45 20 00 0d be r9,r0,8026044 <killinfo+0x20c>
*
* 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 ) {
8026014: 54 25 00 0a bgu r1,r5,802603c <killinfo+0x204>
* and blocking interruptibutable by signal.
*
* If the interested thread is ready, don't think about changing.
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
8026018: 44 60 00 0b be r3,r0,8026044 <killinfo+0x20c> <== NEVER TAKEN
802601c: 28 69 00 10 lw r9,(r3+16)
8026020: 45 20 00 09 be r9,r0,8026044 <killinfo+0x20c> <== NEVER TAKEN
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
8026024: 28 4a 00 10 lw r10,(r2+16)
8026028: 45 40 00 05 be r10,r0,802603c <killinfo+0x204>
802602c: a1 28 48 00 and r9,r9,r8
continue;
}
DEBUG_STEP("6");
/* prefer blocked/interruptible over blocked/not interruptible */
if ( !_States_Is_interruptible_by_signal(interested->current_state) ) {
8026030: 5d 20 00 05 bne r9,r0,8026044 <killinfo+0x20c>
8026034: a1 48 50 00 and r10,r10,r8
DEBUG_STEP("7");
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
8026038: 45 49 00 03 be r10,r9,8026044 <killinfo+0x20c>
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
802603c: b8 a0 08 00 mv r1,r5
8026040: b8 40 18 00 mv r3,r2
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
8026044: 34 c6 00 01 addi r6,r6,1
8026048: 34 e7 00 04 addi r7,r7,4
802604c: 51 c6 ff e9 bgeu r14,r6,8025ff0 <killinfo+0x1b8>
8026050: 34 84 00 04 addi r4,r4,4
* + 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++) {
8026054: 5c 8d ff e0 bne r4,r13,8025fd4 <killinfo+0x19c>
}
}
}
}
if ( interested ) {
8026058: 44 60 00 06 be r3,r0,8026070 <killinfo+0x238>
/*
* 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 ) ) {
802605c: b8 60 08 00 mv r1,r3
8026060: b9 60 10 00 mv r2,r11
8026064: 37 83 00 1c addi r3,sp,28
8026068: f8 00 00 3d calli 802615c <_POSIX_signals_Unblock_thread>
802606c: 5c 20 00 27 bne r1,r0,8026108 <killinfo+0x2d0>
/*
* 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 );
8026070: b9 80 08 00 mv r1,r12
8026074: f8 00 00 2f calli 8026130 <_POSIX_signals_Set_process_signals>
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
8026078: b9 60 08 00 mv r1,r11
802607c: 34 02 00 01 mvi r2,1
8026080: fb ff 6f 6b calli 8001e2c <__ashlsi3>
8026084: b4 2b 58 00 add r11,r1,r11
8026088: 34 02 00 02 mvi r2,2
802608c: 78 0c 08 02 mvhi r12,0x802
8026090: b9 60 08 00 mv r1,r11
8026094: fb ff 6f 66 calli 8001e2c <__ashlsi3>
8026098: 39 8c 9f 88 ori r12,r12,0x9f88
802609c: b5 81 08 00 add r1,r12,r1
80260a0: 28 22 00 00 lw r2,(r1+0)
80260a4: 34 01 00 02 mvi r1,2
80260a8: 5c 41 00 18 bne r2,r1,8026108 <killinfo+0x2d0>
psiginfo = (POSIX_signals_Siginfo_node *)
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
80260ac: 78 01 08 02 mvhi r1,0x802
80260b0: 38 21 a1 08 ori r1,r1,0xa108
80260b4: fb ff 91 77 calli 800a690 <_Chain_Get>
80260b8: b8 20 60 00 mv r12,r1
if ( !psiginfo ) {
80260bc: 5c 20 00 05 bne r1,r0,80260d0 <killinfo+0x298>
_Thread_Enable_dispatch();
80260c0: fb ff 9a ac calli 800cb70 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
80260c4: fb ff b3 e5 calli 8013058 <__errno>
80260c8: 34 02 00 0b mvi r2,11
80260cc: e3 ff ff 6d bi 8025e80 <killinfo+0x48>
}
psiginfo->Info = *siginfo;
80260d0: 2b 81 00 1c lw r1,(sp+28)
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
80260d4: 34 02 00 02 mvi r2,2
if ( !psiginfo ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EAGAIN );
}
psiginfo->Info = *siginfo;
80260d8: 59 81 00 08 sw (r12+8),r1
80260dc: 2b 81 00 20 lw r1,(sp+32)
80260e0: 59 81 00 0c sw (r12+12),r1
80260e4: 2b 81 00 24 lw r1,(sp+36)
80260e8: 59 81 00 10 sw (r12+16),r1
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
80260ec: b9 60 08 00 mv r1,r11
80260f0: fb ff 6f 4f calli 8001e2c <__ashlsi3>
80260f4: 78 02 08 02 mvhi r2,0x802
80260f8: 38 42 a1 80 ori r2,r2,0xa180
80260fc: b4 22 08 00 add r1,r1,r2
8026100: b9 80 10 00 mv r2,r12
8026104: fb ff 91 4d calli 800a638 <_Chain_Append>
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
8026108: fb ff 9a 9a calli 800cb70 <_Thread_Enable_dispatch>
return 0;
802610c: 34 01 00 00 mvi r1,0
}
8026110: 2b 9d 00 04 lw ra,(sp+4)
8026114: 2b 8b 00 18 lw r11,(sp+24)
8026118: 2b 8c 00 14 lw r12,(sp+20)
802611c: 2b 8d 00 10 lw r13,(sp+16)
8026120: 2b 8e 00 0c lw r14,(sp+12)
8026124: 2b 8f 00 08 lw r15,(sp+8)
8026128: 37 9c 00 24 addi sp,sp,36
802612c: c3 a0 00 00 ret
08017f60 <libc_wrapup>:
extern void _wrapup_reent(struct _reent *);
extern void _reclaim_reent(struct _reent *);
void libc_wrapup(void)
{
8017f60: 37 9c ff f4 addi sp,sp,-12
8017f64: 5b 8b 00 0c sw (sp+12),r11
8017f68: 5b 8c 00 08 sw (sp+8),r12
8017f6c: 5b 9d 00 04 sw (sp+4),ra
/*
* In case RTEMS is already down, don't do this. It could be
* dangerous.
*/
if (!_System_state_Is_up(_System_state_Get()))
8017f70: 78 01 08 01 mvhi r1,0x801
8017f74: 38 21 ad f8 ori r1,r1,0xadf8
8017f78: 28 22 00 00 lw r2,(r1+0)
8017f7c: 34 01 00 03 mvi r1,3
8017f80: 5c 41 00 16 bne r2,r1,8017fd8 <libc_wrapup+0x78> <== NEVER TAKEN
/*
* This was already done if the user called exit() directly .
_wrapup_reent(0);
*/
if (_REENT != _global_impure_ptr) {
8017f84: 78 01 08 01 mvhi r1,0x801
8017f88: 78 0b 08 01 mvhi r11,0x801
8017f8c: 38 21 91 4c ori r1,r1,0x914c
8017f90: 39 6b a2 30 ori r11,r11,0xa230
8017f94: 28 2c 00 00 lw r12,(r1+0)
8017f98: 29 61 00 00 lw r1,(r11+0)
8017f9c: 44 2c 00 04 be r1,r12,8017fac <libc_wrapup+0x4c>
_wrapup_reent(_global_impure_ptr);
8017fa0: b9 80 08 00 mv r1,r12
8017fa4: f8 00 01 02 calli 80183ac <_wrapup_reent>
/* Don't reclaim this one, just in case we do printfs
* on the way out to ROM.
*/
_reclaim_reent(&libc_global_reent);
#endif
_REENT = _global_impure_ptr;
8017fa8: 59 6c 00 00 sw (r11+0),r12
*
* Should this be changed to do *all* file streams?
* _fwalk (_REENT, fclose);
*/
fclose (stdin);
8017fac: 78 0b 08 01 mvhi r11,0x801
8017fb0: 39 6b a2 30 ori r11,r11,0xa230
8017fb4: 29 61 00 00 lw r1,(r11+0)
8017fb8: 28 21 00 04 lw r1,(r1+4)
8017fbc: fb ff e7 9c calli 8011e2c <fclose>
fclose (stdout);
8017fc0: 29 61 00 00 lw r1,(r11+0)
8017fc4: 28 21 00 08 lw r1,(r1+8)
8017fc8: fb ff e7 99 calli 8011e2c <fclose>
fclose (stderr);
8017fcc: 29 61 00 00 lw r1,(r11+0)
8017fd0: 28 21 00 0c lw r1,(r1+12)
8017fd4: fb ff e7 96 calli 8011e2c <fclose>
}
8017fd8: 2b 9d 00 04 lw ra,(sp+4)
8017fdc: 2b 8b 00 0c lw r11,(sp+12)
8017fe0: 2b 8c 00 08 lw r12,(sp+8)
8017fe4: 37 9c 00 0c addi sp,sp,12
8017fe8: c3 a0 00 00 ret
08002f48 <malloc>:
#include "malloc_p.h"
void *malloc(
size_t size
)
{
8002f48: 37 9c ff f0 addi sp,sp,-16
8002f4c: 5b 8b 00 10 sw (sp+16),r11
8002f50: 5b 8c 00 0c sw (sp+12),r12
8002f54: 5b 8d 00 08 sw (sp+8),r13
8002f58: 5b 9d 00 04 sw (sp+4),ra
void *return_this;
MSBUMP(malloc_calls, 1);
8002f5c: 78 03 08 01 mvhi r3,0x801
8002f60: 38 63 a8 88 ori r3,r3,0xa888
#include "malloc_p.h"
void *malloc(
size_t size
)
{
8002f64: b8 20 60 00 mv r12,r1
void *return_this;
MSBUMP(malloc_calls, 1);
8002f68: 28 61 00 04 lw r1,(r3+4)
/*
* Validate the parameters
*/
if ( !size )
return (void *) 0;
8002f6c: 34 0b 00 00 mvi r11,0
size_t size
)
{
void *return_this;
MSBUMP(malloc_calls, 1);
8002f70: 34 21 00 01 addi r1,r1,1
8002f74: 58 61 00 04 sw (r3+4),r1
/*
* If some free's have been deferred, then do them now.
*/
malloc_deferred_frees_process();
8002f78: fb ff ff a0 calli 8002df8 <malloc_deferred_frees_process>
/*
* Validate the parameters
*/
if ( !size )
8002f7c: 45 80 00 2b be r12,r0,8003028 <malloc+0xe0>
return (void *) 0;
/*
* Do not attempt to allocate memory if not in correct system state.
*/
if ( _System_state_Is_up(_System_state_Get()) &&
8002f80: 78 01 08 01 mvhi r1,0x801
8002f84: 38 21 ad f8 ori r1,r1,0xadf8
8002f88: 28 22 00 00 lw r2,(r1+0)
8002f8c: 34 01 00 03 mvi r1,3
8002f90: 5c 41 00 03 bne r2,r1,8002f9c <malloc+0x54>
!malloc_is_system_state_OK() )
8002f94: fb ff ff 8f calli 8002dd0 <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()) &&
8002f98: 44 20 00 24 be r1,r0,8003028 <malloc+0xe0> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate(
Heap_Control *heap,
uintptr_t size
)
{
return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 );
8002f9c: 78 0d 08 01 mvhi r13,0x801
8002fa0: 39 ad a0 54 ori r13,r13,0xa054
8002fa4: 29 a1 00 00 lw r1,(r13+0)
8002fa8: b9 80 10 00 mv r2,r12
8002fac: 34 03 00 00 mvi r3,0
8002fb0: 34 04 00 00 mvi r4,0
8002fb4: f8 00 0f b7 calli 8006e90 <_Protected_heap_Allocate_aligned_with_boundary>
8002fb8: b8 20 58 00 mv r11,r1
* If this fails then return a NULL pointer.
*/
return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size );
if ( !return_this ) {
8002fbc: 5c 20 00 0d bne r1,r0,8002ff0 <malloc+0xa8>
return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size );
8002fc0: 78 01 08 01 mvhi r1,0x801
8002fc4: 38 21 87 b8 ori r1,r1,0x87b8
8002fc8: 28 23 00 00 lw r3,(r1+0)
8002fcc: 29 a1 00 00 lw r1,(r13+0)
8002fd0: b9 80 10 00 mv r2,r12
8002fd4: d8 60 00 00 call r3
8002fd8: b8 20 58 00 mv r11,r1
if ( !return_this ) {
8002fdc: 5c 20 00 05 bne r1,r0,8002ff0 <malloc+0xa8> <== NEVER TAKEN
errno = ENOMEM;
8002fe0: f8 00 3b 3b calli 8011ccc <__errno>
8002fe4: 34 02 00 0c mvi r2,12
8002fe8: 58 22 00 00 sw (r1+0),r2
return (void *) 0;
8002fec: e0 00 00 0f bi 8003028 <malloc+0xe0>
}
/*
* If the user wants us to dirty the allocated memory, then do it.
*/
if ( rtems_malloc_dirty_helper )
8002ff0: 78 01 08 01 mvhi r1,0x801
8002ff4: 38 21 a7 10 ori r1,r1,0xa710
8002ff8: 28 23 00 00 lw r3,(r1+0)
8002ffc: 44 60 00 04 be r3,r0,800300c <malloc+0xc4>
(*rtems_malloc_dirty_helper)( return_this, size );
8003000: b9 60 08 00 mv r1,r11
8003004: b9 80 10 00 mv r2,r12
8003008: d8 60 00 00 call r3
/*
* If configured, update the statistics
*/
if ( rtems_malloc_statistics_helpers )
800300c: 78 01 08 01 mvhi r1,0x801
8003010: 38 21 a7 0c ori r1,r1,0xa70c
8003014: 28 21 00 00 lw r1,(r1+0)
8003018: 44 20 00 04 be r1,r0,8003028 <malloc+0xe0>
(*rtems_malloc_statistics_helpers->at_malloc)(return_this);
800301c: 28 22 00 04 lw r2,(r1+4)
8003020: b9 60 08 00 mv r1,r11
8003024: d8 40 00 00 call r2
return return_this;
}
8003028: b9 60 08 00 mv r1,r11
800302c: 2b 9d 00 04 lw ra,(sp+4)
8003030: 2b 8b 00 10 lw r11,(sp+16)
8003034: 2b 8c 00 0c lw r12,(sp+12)
8003038: 2b 8d 00 08 lw r13,(sp+8)
800303c: 37 9c 00 10 addi sp,sp,16
8003040: c3 a0 00 00 ret
08010bc8 <memfile_open>:
rtems_libio_t *iop,
const char *pathname,
int oflag,
mode_t mode
)
{
8010bc8: 37 9c ff fc addi sp,sp,-4
8010bcc: 5b 9d 00 04 sw (sp+4),ra
the_jnode = iop->pathinfo.node_access;
/*
* Perform 'copy on write' for linear files
*/
if ((iop->flags & LIBIO_FLAGS_WRITE)
8010bd0: 28 23 00 08 lw r3,(r1+8)
mode_t mode
)
{
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
8010bd4: 28 22 00 14 lw r2,(r1+20)
if ((count != 0)
&& (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1))
return -1;
}
return 0;
8010bd8: 34 01 00 00 mvi r1,0
the_jnode = iop->pathinfo.node_access;
/*
* Perform 'copy on write' for linear files
*/
if ((iop->flags & LIBIO_FLAGS_WRITE)
8010bdc: 20 63 00 04 andi r3,r3,0x4
8010be0: 44 60 00 14 be r3,r0,8010c30 <memfile_open+0x68>
8010be4: 28 43 00 4c lw r3,(r2+76)
&& (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) {
8010be8: 28 64 00 00 lw r4,(r3+0)
8010bec: 34 03 00 05 mvi r3,5
8010bf0: 5c 83 00 10 bne r4,r3,8010c30 <memfile_open+0x68> <== ALWAYS TAKEN
uint32_t count = the_jnode->info.linearfile.size;
8010bf4: 28 44 00 50 lw r4,(r2+80) <== NOT EXECUTED
const unsigned char *buffer = the_jnode->info.linearfile.direct;
the_jnode->control = &IMFS_node_control_memfile;
8010bf8: 78 05 08 01 mvhi r5,0x801 <== NOT EXECUTED
8010bfc: 38 a5 8e 9c ori r5,r5,0x8e9c <== 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;
8010c00: 28 43 00 54 lw r3,(r2+84) <== NOT EXECUTED
the_jnode->control = &IMFS_node_control_memfile;
8010c04: 58 45 00 4c sw (r2+76),r5 <== NOT EXECUTED
the_jnode->info.file.size = 0;
8010c08: 58 40 00 50 sw (r2+80),r0 <== NOT EXECUTED
the_jnode->info.file.indirect = 0;
8010c0c: 58 40 00 54 sw (r2+84),r0 <== NOT EXECUTED
the_jnode->info.file.doubly_indirect = 0;
8010c10: 58 40 00 58 sw (r2+88),r0 <== NOT EXECUTED
the_jnode->info.file.triply_indirect = 0;
8010c14: 58 40 00 5c sw (r2+92),r0 <== NOT EXECUTED
if ((count != 0)
8010c18: 44 80 00 06 be r4,r0,8010c30 <memfile_open+0x68> <== NOT EXECUTED
&& (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1))
8010c1c: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
8010c20: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
8010c24: fb ff ff 68 calli 80109c4 <IMFS_memfile_write> <== NOT EXECUTED
return -1;
}
return 0;
8010c28: 64 21 ff ff cmpei r1,r1,-1 <== NOT EXECUTED
8010c2c: c8 01 08 00 sub r1,r0,r1 <== NOT EXECUTED
}
8010c30: 2b 9d 00 04 lw ra,(sp+4)
8010c34: 37 9c 00 04 addi sp,sp,4
8010c38: c3 a0 00 00 ret
080031cc <mount>:
const char *target,
const char *filesystemtype,
rtems_filesystem_options_t options,
const void *data
)
{
80031cc: 37 9c ff 78 addi sp,sp,-136
80031d0: 5b 8b 00 38 sw (sp+56),r11
80031d4: 5b 8c 00 34 sw (sp+52),r12
80031d8: 5b 8d 00 30 sw (sp+48),r13
80031dc: 5b 8e 00 2c sw (sp+44),r14
80031e0: 5b 8f 00 28 sw (sp+40),r15
80031e4: 5b 90 00 24 sw (sp+36),r16
80031e8: 5b 91 00 20 sw (sp+32),r17
80031ec: 5b 92 00 1c sw (sp+28),r18
80031f0: 5b 93 00 18 sw (sp+24),r19
80031f4: 5b 94 00 14 sw (sp+20),r20
80031f8: 5b 95 00 10 sw (sp+16),r21
80031fc: 5b 96 00 0c sw (sp+12),r22
8003200: 5b 97 00 08 sw (sp+8),r23
8003204: 5b 9d 00 04 sw (sp+4),ra
8003208: b8 20 88 00 mv r17,r1
int rv = 0;
if (
800320c: 34 01 00 01 mvi r1,1
const char *target,
const char *filesystemtype,
rtems_filesystem_options_t options,
const void *data
)
{
8003210: b8 40 70 00 mv r14,r2
8003214: b8 60 98 00 mv r19,r3
8003218: b8 80 a8 00 mv r21,r4
800321c: b8 a0 b8 00 mv r23,r5
int rv = 0;
if (
8003220: 54 81 00 a7 bgu r4,r1,80034bc <mount+0x2f0>
options == RTEMS_FILESYSTEM_READ_ONLY
|| options == RTEMS_FILESYSTEM_READ_WRITE
) {
rtems_filesystem_fsmount_me_t fsmount_me_h =
8003224: b8 60 08 00 mv r1,r3
8003228: f8 00 28 2a calli 800d2d0 <rtems_filesystem_get_mount_handler>
800322c: b8 20 a0 00 mv r20,r1
rtems_filesystem_get_mount_handler( filesystemtype );
if ( fsmount_me_h != NULL ) {
8003230: 44 20 00 a3 be r1,r0,80034bc <mount+0x2f0>
const char *target_or_null,
const char *filesystemtype,
size_t *target_length_ptr
)
{
const char *target = target_or_null != NULL ? target_or_null : "/";
8003234: b9 c0 68 00 mv r13,r14
8003238: 5d c0 00 03 bne r14,r0,8003244 <mount+0x78>
800323c: 78 0d 08 01 mvhi r13,0x801
8003240: 39 ad 8a 30 ori r13,r13,0x8a30
size_t filesystemtype_size = strlen( filesystemtype ) + 1;
8003244: ba 60 08 00 mv r1,r19
8003248: f8 00 3f 24 calli 8012ed8 <strlen>
800324c: 34 2c 00 01 addi r12,r1,1
size_t source_size = source_or_null != NULL ?
strlen( source_or_null ) + 1 : 0;
8003250: 34 10 00 00 mvi r16,0
8003254: 46 20 00 04 be r17,r0,8003264 <mount+0x98>
8003258: ba 20 08 00 mv r1,r17
800325c: f8 00 3f 1f calli 8012ed8 <strlen>
8003260: 34 30 00 01 addi r16,r1,1
size_t target_size = strlen( target ) + 1;
8003264: b9 a0 08 00 mv r1,r13
8003268: f8 00 3f 1c calli 8012ed8 <strlen>
size_t size = sizeof( rtems_filesystem_mount_table_entry_t )
+ filesystemtype_size + source_size + target_size
800326c: 35 83 00 64 addi r3,r12,100
{
const char *target = target_or_null != NULL ? target_or_null : "/";
size_t filesystemtype_size = strlen( filesystemtype ) + 1;
size_t source_size = source_or_null != NULL ?
strlen( source_or_null ) + 1 : 0;
size_t target_size = strlen( target ) + 1;
8003270: 34 36 00 01 addi r22,r1,1
size_t size = sizeof( rtems_filesystem_mount_table_entry_t )
+ filesystemtype_size + source_size + target_size
8003274: b4 70 18 00 add r3,r3,r16
+ sizeof( rtems_filesystem_global_location_t );
rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size );
8003278: 34 01 00 01 mvi r1,1
800327c: b4 76 10 00 add r2,r3,r22
8003280: fb ff fd 5a calli 80027e8 <calloc>
8003284: b8 20 58 00 mv r11,r1
if ( mt_entry != NULL ) {
8003288: 44 20 00 2a be r1,r0,8003330 <mount+0x164> <== NEVER TAKEN
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 );
800328c: 34 32 00 64 addi r18,r1,100
memcpy( str, filesystemtype, filesystemtype_size );
8003290: b9 80 18 00 mv r3,r12
+ 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 =
8003294: 34 2f 00 40 addi r15,r1,64
(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 );
8003298: ba 60 10 00 mv r2,r19
800329c: ba 40 08 00 mv r1,r18
80032a0: f8 00 3d 63 calli 801282c <memcpy>
mt_entry->type = str;
80032a4: 59 72 00 34 sw (r11+52),r18
str += filesystemtype_size;
80032a8: b6 4c 60 00 add r12,r18,r12
if ( source_or_null != NULL ) {
80032ac: 46 20 00 07 be r17,r0,80032c8 <mount+0xfc>
memcpy( str, source_or_null, source_size );
80032b0: b9 80 08 00 mv r1,r12
80032b4: ba 20 10 00 mv r2,r17
80032b8: ba 00 18 00 mv r3,r16
80032bc: f8 00 3d 5c calli 801282c <memcpy>
mt_entry->dev = str;
80032c0: 59 6c 00 38 sw (r11+56),r12
str += source_size;
80032c4: b5 90 60 00 add r12,r12,r16
}
memcpy( str, target, target_size );
80032c8: b9 80 08 00 mv r1,r12
80032cc: b9 a0 10 00 mv r2,r13
80032d0: ba c0 18 00 mv r3,r22
80032d4: f8 00 3d 56 calli 801282c <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;
80032d8: 78 03 08 01 mvhi r3,0x801
memcpy( str, target, target_size );
mt_entry->target = str;
str += target_size;
mt_entry->mounted = true;
80032dc: 34 01 00 01 mvi r1,1
mt_entry->mt_fs_root = mt_fs_root;
mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf;
80032e0: 38 63 8a 34 ori r3,r3,0x8a34
mt_entry->dev = str;
str += source_size;
}
memcpy( str, target, target_size );
mt_entry->target = str;
80032e4: 59 6c 00 30 sw (r11+48),r12
str += target_size;
mt_entry->mounted = true;
80032e8: 31 61 00 28 sb (r11+40),r1
mt_entry->mt_fs_root = mt_fs_root;
mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf;
80032ec: 59 63 00 2c sw (r11+44),r3
memcpy( str, target, target_size );
mt_entry->target = str;
str += target_size;
mt_entry->mounted = true;
mt_entry->mt_fs_root = mt_fs_root;
80032f0: 59 6f 00 24 sw (r11+36),r15
mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf;
mt_fs_root->location.mt_entry = mt_entry;
mt_fs_root->reference_count = 1;
80032f4: 34 01 00 01 mvi r1,1
80032f8: 59 e1 00 18 sw (r15+24),r1
void *starting_address,
size_t number_nodes,
size_t node_size
)
{
_Chain_Initialize( the_chain, starting_address, number_nodes, node_size );
80032fc: b9 e0 10 00 mv r2,r15
8003300: 35 61 00 14 addi r1,r11,20
8003304: 34 03 00 01 mvi r3,1
8003308: 34 04 00 24 mvi r4,36
mt_entry->mounted = true;
mt_entry->mt_fs_root = mt_fs_root;
mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf;
mt_fs_root->location.mt_entry = mt_entry;
800330c: 59 eb 00 14 sw (r15+20),r11
8003310: f8 00 09 f7 calli 8005aec <_Chain_Initialize>
);
if ( mt_entry != NULL ) {
mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE;
rv = (*fsmount_me_h)( mt_entry, data );
8003314: b9 60 08 00 mv r1,r11
filesystemtype,
&target_length
);
if ( mt_entry != NULL ) {
mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE;
8003318: 31 75 00 29 sb (r11+41),r21
rv = (*fsmount_me_h)( mt_entry, data );
800331c: ba e0 10 00 mv r2,r23
8003320: da 80 00 00 call r20
8003324: b8 20 60 00 mv r12,r1
if ( rv == 0 ) {
8003328: 44 20 00 06 be r1,r0,8003340 <mount+0x174>
800332c: e0 00 00 61 bi 80034b0 <mount+0x2e4>
mt_fs_root,
1,
sizeof(*mt_fs_root)
);
} else {
free( mt_entry );
8003330: fb ff fd 78 calli 8002910 <free> <== NOT EXECUTED
if ( rv != 0 ) {
free( mt_entry );
}
} else {
errno = ENOMEM;
8003334: f8 00 3a 66 calli 8011ccc <__errno> <== NOT EXECUTED
8003338: 34 02 00 0c mvi r2,12 <== NOT EXECUTED
800333c: e0 00 00 62 bi 80034c4 <mount+0x2f8> <== NOT EXECUTED
if ( mt_entry != NULL ) {
mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE;
rv = (*fsmount_me_h)( mt_entry, data );
if ( rv == 0 ) {
if ( target != NULL ) {
8003340: 45 c1 00 33 be r14,r1,800340c <mount+0x240>
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 =
rtems_filesystem_eval_path_start( &ctx, target, eval_flags );
8003344: 37 8c 00 3c addi r12,sp,60
{
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 =
8003348: b9 c0 10 00 mv r2,r14
800334c: 34 03 00 1f mvi r3,31
8003350: b9 80 08 00 mv r1,r12
8003354: f8 00 03 3d calli 8004048 <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;
8003358: 28 22 00 14 lw r2,(r1+20)
return (*mt_entry->ops->are_nodes_equal_h)(
800335c: 28 43 00 0c lw r3,(r2+12)
8003360: 28 42 00 24 lw r2,(r2+36)
8003364: 28 63 00 10 lw r3,(r3+16)
8003368: d8 60 00 00 call r3
800336c: b8 20 70 00 mv r14,r1
rtems_filesystem_eval_path_start( &ctx, target, eval_flags );
if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) {
8003370: 5c 20 00 1f bne r1,r0,80033ec <mount+0x220>
rtems_filesystem_location_info_t targetloc;
rtems_filesystem_global_location_t *mt_point_node;
rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc );
8003374: 37 8c 00 74 addi r12,sp,116
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(
8003378: b9 80 08 00 mv r1,r12
800337c: 37 82 00 54 addi r2,sp,84
8003380: f8 00 04 62 calli 8004508 <rtems_filesystem_location_copy_and_detach>
mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc );
8003384: b9 80 08 00 mv r1,r12
8003388: f8 00 04 fe calli 8004780 <rtems_filesystem_location_transform_to_global>
mt_entry->mt_point_node = mt_point_node;
800338c: 59 61 00 20 sw (r11+32),r1
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 );
8003390: b8 20 68 00 mv r13,r1
mt_entry->mt_point_node = mt_point_node;
rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry );
8003394: 28 21 00 14 lw r1,(r1+20)
8003398: 28 21 00 0c lw r1,(r1+12)
800339c: 28 22 00 30 lw r2,(r1+48)
80033a0: b9 60 08 00 mv r1,r11
80033a4: d8 40 00 00 call r2
80033a8: b8 20 60 00 mv r12,r1
if ( rv == 0 ) {
80033ac: 5c 2e 00 0d bne r1,r14,80033e0 <mount+0x214>
rtems_filesystem_mt_lock();
80033b0: fb ff ff 73 calli 800317c <rtems_filesystem_mt_lock>
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
80033b4: 78 01 08 01 mvhi r1,0x801
80033b8: 38 21 a0 dc ori r1,r1,0xa0dc
80033bc: 28 23 00 08 lw r3,(r1+8)
the_node->next = tail;
80033c0: 78 02 08 01 mvhi r2,0x801
80033c4: 38 42 a0 e0 ori r2,r2,0xa0e0
80033c8: 59 62 00 00 sw (r11+0),r2
tail->previous = the_node;
80033cc: 58 2b 00 08 sw (r1+8),r11
old_last->next = the_node;
80033d0: 58 6b 00 00 sw (r3+0),r11
the_node->previous = old_last;
80033d4: 59 63 00 04 sw (r11+4),r3
rtems_chain_append_unprotected(
&rtems_filesystem_mount_table,
&mt_entry->mt_node
);
rtems_filesystem_mt_unlock();
80033d8: fb ff ff 74 calli 80031a8 <rtems_filesystem_mt_unlock>
80033dc: e0 00 00 08 bi 80033fc <mount+0x230>
} else {
rtems_filesystem_global_location_release( mt_point_node );
80033e0: b9 a0 08 00 mv r1,r13
80033e4: f8 00 04 84 calli 80045f4 <rtems_filesystem_global_location_release>
80033e8: e0 00 00 05 bi 80033fc <mount+0x230>
}
} else {
rtems_filesystem_eval_path_error( &ctx, EBUSY );
80033ec: b9 80 08 00 mv r1,r12
80033f0: 34 02 00 10 mvi r2,16
80033f4: f8 00 02 4d calli 8003d28 <rtems_filesystem_eval_path_error>
rv = -1;
80033f8: 34 0c ff ff mvi r12,-1
}
rtems_filesystem_eval_path_cleanup( &ctx );
80033fc: 37 81 00 3c addi r1,sp,60
8003400: f8 00 03 5f calli 800417c <rtems_filesystem_eval_path_cleanup>
rv = register_subordinate_file_system( mt_entry, target );
} else {
rv = register_root_file_system( mt_entry );
}
if ( rv != 0 ) {
8003404: 45 80 00 32 be r12,r0,80034cc <mount+0x300>
8003408: e0 00 00 26 bi 80034a0 <mount+0x2d4>
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
int rv = 0;
rtems_filesystem_mt_lock();
800340c: fb ff ff 5c calli 800317c <rtems_filesystem_mt_lock>
errno = EINVAL;
rv = -1;
}
return rv;
}
8003410: 78 01 08 01 mvhi r1,0x801
8003414: 38 21 a0 dc ori r1,r1,0xa0dc
)
{
int rv = 0;
rtems_filesystem_mt_lock();
if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) {
8003418: 28 23 00 00 lw r3,(r1+0)
800341c: 78 02 08 01 mvhi r2,0x801
8003420: 38 42 a0 e0 ori r2,r2,0xa0e0
8003424: 5c 62 00 07 bne r3,r2,8003440 <mount+0x274> <== NEVER TAKEN
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
8003428: 28 22 00 08 lw r2,(r1+8)
the_node->next = tail;
800342c: 59 63 00 00 sw (r11+0),r3
tail->previous = the_node;
8003430: 58 2b 00 08 sw (r1+8),r11
old_last->next = the_node;
8003434: 58 4b 00 00 sw (r2+0),r11
the_node->previous = old_last;
8003438: 59 62 00 04 sw (r11+4),r2
800343c: e0 00 00 05 bi 8003450 <mount+0x284>
rtems_chain_append_unprotected(
&rtems_filesystem_mount_table,
&mt_entry->mt_node
);
} else {
errno = EINVAL;
8003440: f8 00 3a 23 calli 8011ccc <__errno> <== NOT EXECUTED
8003444: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
8003448: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
rv = -1;
800344c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
}
rtems_filesystem_mt_unlock();
8003450: fb ff ff 56 calli 80031a8 <rtems_filesystem_mt_unlock>
if ( rv == 0 ) {
8003454: 5d 80 00 12 bne r12,r0,800349c <mount+0x2d0> <== NEVER TAKEN
rtems_filesystem_global_location_t *new_fs_root =
rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
8003458: 35 6b 00 24 addi r11,r11,36
rv = -1;
}
rtems_filesystem_mt_unlock();
if ( rv == 0 ) {
rtems_filesystem_global_location_t *new_fs_root =
800345c: b9 60 08 00 mv r1,r11
8003460: f8 00 04 8e calli 8004698 <rtems_filesystem_global_location_obtain>
8003464: b8 20 70 00 mv r14,r1
rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
rtems_filesystem_global_location_t *new_fs_current =
8003468: b9 60 08 00 mv r1,r11
rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
rtems_filesystem_global_location_assign(
800346c: 78 0b 08 01 mvhi r11,0x801
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 =
8003470: f8 00 04 8a calli 8004698 <rtems_filesystem_global_location_obtain>
rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
rtems_filesystem_global_location_assign(
8003474: 39 6b a1 78 ori r11,r11,0xa178
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 =
8003478: b8 20 68 00 mv r13,r1
rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
rtems_filesystem_global_location_assign(
800347c: 29 61 00 00 lw r1,(r11+0)
8003480: b9 c0 10 00 mv r2,r14
8003484: 34 21 00 04 addi r1,r1,4
8003488: f8 00 04 76 calli 8004660 <rtems_filesystem_global_location_assign>
&rtems_filesystem_root,
new_fs_root
);
rtems_filesystem_global_location_assign(
800348c: 29 61 00 00 lw r1,(r11+0)
8003490: b9 a0 10 00 mv r2,r13
8003494: f8 00 04 73 calli 8004660 <rtems_filesystem_global_location_assign>
8003498: e0 00 00 0d bi 80034cc <mount+0x300>
errno = EINVAL;
rv = -1;
}
rtems_filesystem_mt_unlock();
if ( rv == 0 ) {
800349c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
} else {
rv = register_root_file_system( mt_entry );
}
if ( rv != 0 ) {
(*mt_entry->ops->fsunmount_me_h)( mt_entry );
80034a0: 29 61 00 0c lw r1,(r11+12)
80034a4: 28 22 00 3c lw r2,(r1+60)
80034a8: b9 60 08 00 mv r1,r11
80034ac: d8 40 00 00 call r2
}
}
if ( rv != 0 ) {
free( mt_entry );
80034b0: b9 60 08 00 mv r1,r11
80034b4: fb ff fd 17 calli 8002910 <free>
80034b8: e0 00 00 05 bi 80034cc <mount+0x300>
} else {
errno = EINVAL;
rv = -1;
}
} else {
errno = EINVAL;
80034bc: f8 00 3a 04 calli 8011ccc <__errno>
80034c0: 34 02 00 16 mvi r2,22
80034c4: 58 22 00 00 sw (r1+0),r2
rv = -1;
80034c8: 34 0c ff ff mvi r12,-1
}
return rv;
}
80034cc: b9 80 08 00 mv r1,r12
80034d0: 2b 9d 00 04 lw ra,(sp+4)
80034d4: 2b 8b 00 38 lw r11,(sp+56)
80034d8: 2b 8c 00 34 lw r12,(sp+52)
80034dc: 2b 8d 00 30 lw r13,(sp+48)
80034e0: 2b 8e 00 2c lw r14,(sp+44)
80034e4: 2b 8f 00 28 lw r15,(sp+40)
80034e8: 2b 90 00 24 lw r16,(sp+36)
80034ec: 2b 91 00 20 lw r17,(sp+32)
80034f0: 2b 92 00 1c lw r18,(sp+28)
80034f4: 2b 93 00 18 lw r19,(sp+24)
80034f8: 2b 94 00 14 lw r20,(sp+20)
80034fc: 2b 95 00 10 lw r21,(sp+16)
8003500: 2b 96 00 0c lw r22,(sp+12)
8003504: 2b 97 00 08 lw r23,(sp+8)
8003508: 37 9c 00 88 addi sp,sp,136
800350c: c3 a0 00 00 ret
08006e6c <mount_and_make_target_path>:
const char *target,
const char *filesystemtype,
rtems_filesystem_options_t options,
const void *data
)
{
8006e6c: 37 9c ff e8 addi sp,sp,-24
8006e70: 5b 8b 00 0c sw (sp+12),r11
8006e74: 5b 8c 00 08 sw (sp+8),r12
8006e78: 5b 9d 00 04 sw (sp+4),ra
8006e7c: b8 20 60 00 mv r12,r1
8006e80: b8 40 58 00 mv r11,r2
int rv = -1;
if (target != NULL) {
8006e84: 44 40 00 0f be r2,r0,8006ec0 <mount_and_make_target_path+0x54>
rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO);
8006e88: b8 40 08 00 mv r1,r2
8006e8c: 34 02 01 ff mvi r2,511
8006e90: 5b 83 00 18 sw (sp+24),r3
8006e94: 5b 84 00 14 sw (sp+20),r4
8006e98: 5b 85 00 10 sw (sp+16),r5
8006e9c: f8 00 03 2b calli 8007b48 <rtems_mkdir>
if (rv == 0) {
8006ea0: 2b 83 00 18 lw r3,(sp+24)
8006ea4: 2b 84 00 14 lw r4,(sp+20)
8006ea8: 2b 85 00 10 lw r5,(sp+16)
8006eac: 5c 20 00 09 bne r1,r0,8006ed0 <mount_and_make_target_path+0x64><== NEVER TAKEN
rv = mount(
8006eb0: b9 80 08 00 mv r1,r12
8006eb4: b9 60 10 00 mv r2,r11
8006eb8: f8 00 00 1f calli 8006f34 <mount>
8006ebc: e0 00 00 05 bi 8006ed0 <mount_and_make_target_path+0x64>
options,
data
);
}
} else {
errno = EINVAL;
8006ec0: f8 00 67 92 calli 8020d08 <__errno>
8006ec4: 34 02 00 16 mvi r2,22
8006ec8: 58 22 00 00 sw (r1+0),r2
const char *filesystemtype,
rtems_filesystem_options_t options,
const void *data
)
{
int rv = -1;
8006ecc: 34 01 ff ff mvi r1,-1
} else {
errno = EINVAL;
}
return rv;
}
8006ed0: 2b 9d 00 04 lw ra,(sp+4)
8006ed4: 2b 8b 00 0c lw r11,(sp+12)
8006ed8: 2b 8c 00 08 lw r12,(sp+8)
8006edc: 37 9c 00 18 addi sp,sp,24
8006ee0: c3 a0 00 00 ret
08015b70 <msdos_creat_node>:
msdos_node_type_t type,
const char *name,
int name_len,
mode_t mode,
const fat_file_fd_t *link_fd)
{
8015b70: 37 9c ff 24 addi sp,sp,-220
8015b74: 5b 8b 00 44 sw (sp+68),r11
8015b78: 5b 8c 00 40 sw (sp+64),r12
8015b7c: 5b 8d 00 3c sw (sp+60),r13
8015b80: 5b 8e 00 38 sw (sp+56),r14
8015b84: 5b 8f 00 34 sw (sp+52),r15
8015b88: 5b 90 00 30 sw (sp+48),r16
8015b8c: 5b 91 00 2c sw (sp+44),r17
8015b90: 5b 92 00 28 sw (sp+40),r18
8015b94: 5b 93 00 24 sw (sp+36),r19
8015b98: 5b 94 00 20 sw (sp+32),r20
8015b9c: 5b 95 00 1c sw (sp+28),r21
8015ba0: 5b 96 00 18 sw (sp+24),r22
8015ba4: 5b 97 00 14 sw (sp+20),r23
8015ba8: 5b 98 00 10 sw (sp+16),r24
8015bac: 5b 99 00 0c sw (sp+12),r25
8015bb0: 5b 9b 00 08 sw (sp+8),fp
8015bb4: 5b 9d 00 04 sw (sp+4),ra
8015bb8: b8 60 80 00 mv r16,r3
int rc = RC_OK;
ssize_t ret = 0;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
8015bbc: 28 23 00 14 lw r3,(r1+20)
uint32_t sec = 0;
uint32_t byte = 0;
fat_dir_pos_init(&dir_pos);
memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
8015bc0: 37 8d 00 a8 addi r13,sp,168
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;
8015bc4: 28 36 00 08 lw r22,(r1+8)
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;
8015bc8: 28 73 00 08 lw r19,(r3+8)
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
8015bcc: 34 0c ff ff mvi r12,-1
uint32_t sec = 0;
uint32_t byte = 0;
fat_dir_pos_init(&dir_pos);
memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
8015bd0: 34 03 00 20 mvi r3,32
msdos_node_type_t type,
const char *name,
int name_len,
mode_t mode,
const fat_file_fd_t *link_fd)
{
8015bd4: b8 20 a0 00 mv r20,r1
8015bd8: b8 40 a8 00 mv r21,r2
uint32_t sec = 0;
uint32_t byte = 0;
fat_dir_pos_init(&dir_pos);
memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
8015bdc: b9 a0 08 00 mv r1,r13
8015be0: 34 02 00 00 mvi r2,0
msdos_node_type_t type,
const char *name,
int name_len,
mode_t mode,
const fat_file_fd_t *link_fd)
{
8015be4: b8 80 70 00 mv r14,r4
8015be8: b8 c0 88 00 mv r17,r6
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;
8015bec: 5b 80 00 d8 sw (sp+216),r0
time_t time_ret = 0;
uint16_t time_val = 0;
8015bf0: 0f 80 00 de sh (sp+222),r0
uint16_t date = 0;
8015bf4: 0f 80 00 dc sh (sp+220),r0
static inline void
fat_dir_pos_init(
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
8015bf8: 5b 80 00 c8 sw (sp+200),r0
dir_pos->sname.ofs = 0;
8015bfc: 5b 80 00 cc sw (sp+204),r0
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
8015c00: 5b 8c 00 d0 sw (sp+208),r12
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
8015c04: 5b 8c 00 d4 sw (sp+212),r12
uint32_t sec = 0;
uint32_t byte = 0;
fat_dir_pos_init(&dir_pos);
memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
8015c08: f8 00 17 a2 calli 801ba90 <memset>
memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2);
8015c0c: 34 03 00 40 mvi r3,64
8015c10: 37 81 00 48 addi r1,sp,72
8015c14: 34 02 00 00 mvi r2,0
8015c18: f8 00 17 9e calli 801ba90 <memset>
if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) {
8015c1c: 34 03 01 04 mvi r3,260
8015c20: 4c 6e 00 04 bge r3,r14,8015c30 <msdos_creat_node+0xc0> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(ENAMETOOLONG);
8015c24: f8 00 14 0c calli 801ac54 <__errno> <== NOT EXECUTED
8015c28: 34 02 00 5b mvi r2,91 <== NOT EXECUTED
8015c2c: e0 00 00 0a bi 8015c54 <msdos_creat_node+0xe4> <== NOT EXECUTED
}
name_type = msdos_long_to_short (name, name_len,
8015c30: ba 00 08 00 mv r1,r16
8015c34: b9 c0 10 00 mv r2,r14
8015c38: b9 a0 18 00 mv r3,r13
8015c3c: 34 04 00 0b mvi r4,11
8015c40: f8 00 02 14 calli 8016490 <msdos_long_to_short>
8015c44: b8 20 78 00 mv r15,r1
MSDOS_DIR_NAME(short_node),
MSDOS_NAME_MAX);
if (name_type == MSDOS_NAME_INVALID) {
8015c48: 5c 20 00 06 bne r1,r0,8015c60 <msdos_creat_node+0xf0> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EINVAL);
8015c4c: f8 00 14 02 calli 801ac54 <__errno> <== NOT EXECUTED
8015c50: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
8015c54: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
8015c58: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED
8015c5c: e0 00 01 6d bi 8016210 <msdos_creat_node+0x6a0> <== NOT EXECUTED
/* fill reserved field */
*MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE;
/* set up last write date and time */
time_ret = time(NULL);
8015c60: 34 01 00 00 mvi r1,0
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;
8015c64: 33 80 00 b4 sb (sp+180),r0
/* set up last write date and time */
time_ret = time(NULL);
8015c68: f8 00 25 ae calli 801f320 <time>
if ( time_ret == -1 )
return -1;
8015c6c: 34 0b ff ff mvi r11,-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);
if ( time_ret == -1 )
8015c70: 44 2c 01 68 be r1,r12,8016210 <msdos_creat_node+0x6a0> <== NEVER TAKEN
return -1;
msdos_date_unix2dos(time_ret, &date, &time_val);
8015c74: 37 83 00 de addi r3,sp,222
8015c78: 37 82 00 dc addi r2,sp,220
8015c7c: f8 00 0f 7e calli 8019a74 <msdos_date_unix2dos>
*MSDOS_DIR_CRT_TIME(short_node) = CT_LE_W(time_val);
8015c80: 2f 8c 00 de lhu r12,(sp+222)
* @param[in] value is the value to be swapped
* @return the value after being endian swapped
*/
static inline uint16_t CPU_swap_u16(uint16_t v)
{
return v << 8 | v >> 8;
8015c84: 34 02 00 08 mvi r2,8
8015c88: b9 80 08 00 mv r1,r12
8015c8c: fb ff ad 57 calli 80011e8 <__ashlsi3>
8015c90: b8 20 58 00 mv r11,r1
8015c94: 34 02 00 08 mvi r2,8
8015c98: b9 80 08 00 mv r1,r12
8015c9c: f8 00 5d ef calli 802d458 <__lshrsi3>
*MSDOS_DIR_CRT_DATE(short_node) = CT_LE_W(date);
8015ca0: 2f 8c 00 dc lhu r12,(sp+220)
8015ca4: b9 61 58 00 or r11,r11,r1
8015ca8: 21 6b ff ff andi r11,r11,0xffff
8015cac: 34 02 00 08 mvi r2,8
8015cb0: b9 80 08 00 mv r1,r12
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);
8015cb4: 0f 8b 00 b6 sh (sp+182),r11
8015cb8: fb ff ad 4c calli 80011e8 <__ashlsi3>
8015cbc: b8 20 90 00 mv r18,r1
8015cc0: 34 02 00 08 mvi r2,8
8015cc4: b9 80 08 00 mv r1,r12
8015cc8: f8 00 5d e4 calli 802d458 <__lshrsi3>
8015ccc: ba 41 20 00 or r4,r18,r1
8015cd0: 20 84 ff ff andi r4,r4,0xffff
*MSDOS_DIR_CRT_DATE(short_node) = CT_LE_W(date);
8015cd4: 0f 84 00 b8 sh (sp+184),r4
*MSDOS_DIR_WRITE_TIME(short_node) = CT_LE_W(time_val);
8015cd8: 0d ab 00 16 sh (r13+22),r11
*MSDOS_DIR_WRITE_DATE(short_node) = CT_LE_W(date);
8015cdc: 0d a4 00 18 sh (r13+24),r4
*MSDOS_DIR_LAST_ACCESS_DATE(short_node) = CT_LE_W(date);
8015ce0: 0d a4 00 12 sh (r13+18),r4
/* initialize directory/file size */
*MSDOS_DIR_FILE_SIZE(short_node) = MSDOS_INIT_DIR_SIZE;
8015ce4: 5b 80 00 c4 sw (sp+196),r0
if (type == MSDOS_DIRECTORY) {
8015ce8: 5e a0 00 04 bne r21,r0,8015cf8 <msdos_creat_node+0x188>
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
8015cec: 43 83 00 b3 lbu r3,(sp+179)
8015cf0: 38 63 00 10 ori r3,r3,0x10
8015cf4: e0 00 00 2e bi 8015dac <msdos_creat_node+0x23c>
}
else if (type == MSDOS_HARD_LINK) {
8015cf8: 34 03 00 02 mvi r3,2
8015cfc: 5e a3 00 2a bne r21,r3,8015da4 <msdos_creat_node+0x234> <== ALWAYS TAKEN
* node to the newly created
*/
/*
* read the original directory entry
*/
sec = fat_cluster_num_to_sector_num(&fs_info->fat,
8015d00: 2a 27 00 20 lw r7,(r17+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)) )
8015d04: 5c e0 00 06 bne r7,r0,8015d1c <msdos_creat_node+0x1ac> <== NOT EXECUTED
8015d08: 42 63 00 0e lbu r3,(r19+14) <== NOT EXECUTED
8015d0c: 20 63 00 03 andi r3,r3,0x3 <== NOT EXECUTED
8015d10: 44 67 00 03 be r3,r7,8015d1c <msdos_creat_node+0x1ac> <== NOT EXECUTED
return fs_info->vol.rdir_loc;
8015d14: 2a 6c 00 20 lw r12,(r19+32) <== NOT EXECUTED
8015d18: e0 00 00 06 bi 8015d30 <msdos_creat_node+0x1c0> <== NOT EXECUTED
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
8015d1c: 42 62 00 05 lbu r2,(r19+5) <== NOT EXECUTED
8015d20: 34 e1 ff fe addi r1,r7,-2 <== NOT EXECUTED
8015d24: fb ff ad 31 calli 80011e8 <__ashlsi3> <== NOT EXECUTED
8015d28: 2a 6c 00 34 lw r12,(r19+52) <== NOT EXECUTED
8015d2c: b4 2c 60 00 add r12,r1,r12 <== NOT EXECUTED
link_fd->dir_pos.sname.cln);
sec += (link_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
8015d30: 2a 2b 00 24 lw r11,(r17+36) <== NOT EXECUTED
8015d34: 42 62 00 02 lbu r2,(r19+2) <== NOT EXECUTED
8015d38: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8015d3c: f8 00 5d c7 calli 802d458 <__lshrsi3> <== NOT EXECUTED
byte = (link_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1));
8015d40: 2e 63 00 00 lhu r3,(r19+0) <== 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);
8015d44: b5 81 10 00 add r2,r12,r1 <== 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);
8015d48: 37 8c 00 88 addi r12,sp,136 <== NOT EXECUTED
* read the original directory entry
*/
sec = fat_cluster_num_to_sector_num(&fs_info->fat,
link_fd->dir_pos.sname.cln);
sec += (link_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
byte = (link_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1));
8015d4c: 34 63 ff ff addi r3,r3,-1 <== NOT EXECUTED
ret = _fat_block_read(&fs_info->fat,
8015d50: a0 6b 18 00 and r3,r3,r11 <== NOT EXECUTED
8015d54: ba 60 08 00 mv r1,r19 <== NOT EXECUTED
8015d58: 34 04 00 20 mvi r4,32 <== NOT EXECUTED
8015d5c: b9 80 28 00 mv r5,r12 <== NOT EXECUTED
8015d60: fb ff e9 09 calli 8010184 <_fat_block_read> <== NOT EXECUTED
sec, byte, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
link_node);
if (ret < 0) {
return -1;
8015d64: 34 0b ff ff mvi r11,-1 <== 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) {
8015d68: 48 01 01 2a bg r0,r1,8016210 <msdos_creat_node+0x6a0> <== 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);
8015d6c: 43 83 00 95 lbu r3,(sp+149) <== NOT EXECUTED
8015d70: 33 83 00 b5 sb (sp+181),r3 <== NOT EXECUTED
*MSDOS_DIR_CRT_TIME(short_node) =*MSDOS_DIR_CRT_TIME(link_node);
8015d74: 2d 83 00 0e lhu r3,(r12+14) <== NOT EXECUTED
8015d78: 0f 83 00 b6 sh (sp+182),r3 <== NOT EXECUTED
*MSDOS_DIR_CRT_DATE(short_node) =*MSDOS_DIR_CRT_DATE(link_node);
8015d7c: 2d 83 00 10 lhu r3,(r12+16) <== NOT EXECUTED
8015d80: 0f 83 00 b8 sh (sp+184),r3 <== NOT EXECUTED
/*
* copy/set "file size", "first cluster"
*/
*MSDOS_DIR_FILE_SIZE(short_node) =*MSDOS_DIR_FILE_SIZE(link_node);
8015d84: 29 83 00 1c lw r3,(r12+28) <== NOT EXECUTED
8015d88: 5b 83 00 c4 sw (sp+196),r3 <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_LOW(short_node) =
8015d8c: 2d 83 00 1a lhu r3,(r12+26) <== NOT EXECUTED
8015d90: 0d a3 00 1a sh (r13+26),r3 <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_LOW(link_node);
*MSDOS_DIR_FIRST_CLUSTER_HI(short_node) =
8015d94: 2d 83 00 14 lhu r3,(r12+20) <== NOT EXECUTED
8015d98: 0d a3 00 14 sh (r13+20),r3 <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_HI(link_node);
/*
* set "archive bit" due to changes
*/
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_ARCHIVE;
8015d9c: 43 83 00 93 lbu r3,(sp+147) <== NOT EXECUTED
8015da0: e0 00 00 02 bi 8015da8 <msdos_creat_node+0x238> <== NOT EXECUTED
}
else { /* regular file... */
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_ARCHIVE;
8015da4: 43 83 00 b3 lbu r3,(sp+179)
8015da8: 38 63 00 20 ori r3,r3,0x20
/*
* 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,
8015dac: 37 8c 00 c8 addi r12,sp,200
* 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;
8015db0: 33 83 00 b3 sb (sp+179),r3
/*
* 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,
8015db4: ba 80 08 00 mv r1,r20
8015db8: 34 02 00 01 mvi r2,1
8015dbc: ba 00 18 00 mv r3,r16
8015dc0: b9 c0 20 00 mv r4,r14
8015dc4: b9 e0 28 00 mv r5,r15
8015dc8: b9 80 30 00 mv r6,r12
8015dcc: 37 87 00 a8 addi r7,sp,168
8015dd0: f8 00 08 61 calli 8017f54 <msdos_get_name_node>
8015dd4: b8 20 58 00 mv r11,r1
name_type, &dir_pos, short_node);
if ( rc != RC_OK )
8015dd8: 5c 20 01 0e bne r1,r0,8016210 <msdos_creat_node+0x6a0> <== NEVER TAKEN
/*
* if we create a new file we are done, if directory there are more steps
* to do
*/
if (type == MSDOS_DIRECTORY)
8015ddc: 5e a1 01 0d bne r21,r1,8016210 <msdos_creat_node+0x6a0>
{
/* open new directory as fat-file */
rc = fat_file_open(&fs_info->fat, &dir_pos, &fat_fd);
8015de0: ba 60 08 00 mv r1,r19
8015de4: b9 80 10 00 mv r2,r12
8015de8: 37 83 00 d8 addi r3,sp,216
8015dec: fb ff e4 de calli 800f164 <fat_file_open>
8015df0: b8 20 58 00 mv r11,r1
if (rc != RC_OK)
8015df4: 5c 35 01 03 bne r1,r21,8016200 <msdos_creat_node+0x690> <== NEVER TAKEN
/*
* we opened fat-file for node we just created, so initialize fat-file
* descritor
*/
fat_fd->fat_file_size = 0;
8015df8: 2b 90 00 d8 lw r16,(sp+216)
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
8015dfc: 78 03 00 20 mvhi r3,0x20
/*
* dot and dotdot entries are identical to new node except the
* names
*/
memcpy(DOT_NODE_P(dot_dotdot), short_node,
8015e00: 37 85 00 48 addi r5,sp,72
/*
* we opened fat-file for node we just created, so initialize fat-file
* descritor
*/
fat_fd->fat_file_size = 0;
8015e04: 5a 00 00 18 sw (r16+24),r0
fat_fd->fat_file_type = FAT_DIRECTORY;
8015e08: 5a 00 00 10 sw (r16+16),r0
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
8015e0c: 5a 03 00 14 sw (r16+20),r3
/*
* dot and dotdot entries are identical to new node except the
* names
*/
memcpy(DOT_NODE_P(dot_dotdot), short_node,
8015e10: 43 82 00 a8 lbu r2,(sp+168)
8015e14: 43 84 00 a9 lbu r4,(sp+169)
8015e18: 43 87 00 aa lbu r7,(sp+170)
8015e1c: 43 89 00 ab lbu r9,(sp+171)
8015e20: 43 8b 00 ac lbu r11,(sp+172)
8015e24: 43 8d 00 ad lbu r13,(sp+173)
8015e28: 43 8f 00 ae lbu r15,(sp+174)
8015e2c: 43 92 00 af lbu r18,(sp+175)
8015e30: 43 98 00 b0 lbu r24,(sp+176)
8015e34: 43 9b 00 b1 lbu fp,(sp+177)
8015e38: 33 82 00 48 sb (sp+72),r2
8015e3c: 43 8e 00 c1 lbu r14,(sp+193)
8015e40: 43 8c 00 c2 lbu r12,(sp+194)
8015e44: 43 8a 00 c3 lbu r10,(sp+195)
8015e48: 43 88 00 c4 lbu r8,(sp+196)
8015e4c: 43 86 00 c5 lbu r6,(sp+197)
8015e50: 43 83 00 c6 lbu r3,(sp+198)
8015e54: 43 99 00 be lbu r25,(sp+190)
8015e58: 43 97 00 bf lbu r23,(sp+191)
8015e5c: 43 91 00 c0 lbu r17,(sp+192)
8015e60: 43 81 00 c7 lbu r1,(sp+199)
8015e64: 30 a4 00 01 sb (r5+1),r4
8015e68: 30 a7 00 02 sb (r5+2),r7
8015e6c: 30 a9 00 03 sb (r5+3),r9
8015e70: 30 ab 00 04 sb (r5+4),r11
8015e74: 30 ad 00 05 sb (r5+5),r13
8015e78: 30 af 00 06 sb (r5+6),r15
8015e7c: 30 b2 00 07 sb (r5+7),r18
8015e80: 30 b8 00 08 sb (r5+8),r24
8015e84: 30 bb 00 09 sb (r5+9),fp
8015e88: 43 9d 00 b2 lbu ra,(sp+178)
8015e8c: 30 bd 00 0a sb (r5+10),ra
8015e90: 43 9d 00 b3 lbu ra,(sp+179)
8015e94: 30 bd 00 0b sb (r5+11),ra
8015e98: 43 9d 00 b4 lbu ra,(sp+180)
8015e9c: 30 bd 00 0c sb (r5+12),ra
8015ea0: 43 9d 00 b5 lbu ra,(sp+181)
8015ea4: 30 bd 00 0d sb (r5+13),ra
8015ea8: 43 9d 00 b6 lbu ra,(sp+182)
8015eac: 30 bd 00 0e sb (r5+14),ra
8015eb0: 43 9d 00 b7 lbu ra,(sp+183)
8015eb4: 30 bd 00 0f sb (r5+15),ra
8015eb8: 43 9d 00 b8 lbu ra,(sp+184)
8015ebc: 30 bd 00 10 sb (r5+16),ra
8015ec0: 43 9d 00 b9 lbu ra,(sp+185)
8015ec4: 30 bd 00 11 sb (r5+17),ra
8015ec8: 43 9d 00 ba lbu ra,(sp+186)
8015ecc: 30 bd 00 12 sb (r5+18),ra
8015ed0: 43 9d 00 bb lbu ra,(sp+187)
8015ed4: 30 bd 00 13 sb (r5+19),ra
8015ed8: 43 9d 00 bc lbu ra,(sp+188)
8015edc: 30 bd 00 14 sb (r5+20),ra
8015ee0: 43 9d 00 bd lbu ra,(sp+189)
8015ee4: 30 ae 00 19 sb (r5+25),r14
8015ee8: 30 ac 00 1a sb (r5+26),r12
8015eec: 30 bd 00 15 sb (r5+21),ra
8015ef0: 30 aa 00 1b sb (r5+27),r10
8015ef4: 30 a8 00 1c sb (r5+28),r8
8015ef8: 30 a6 00 1d sb (r5+29),r6
8015efc: 30 a3 00 1e sb (r5+30),r3
8015f00: 30 b9 00 16 sb (r5+22),r25
8015f04: 30 b7 00 17 sb (r5+23),r23
8015f08: 30 b1 00 18 sb (r5+24),r17
8015f0c: 30 a1 00 1f sb (r5+31),r1
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
memcpy(DOTDOT_NODE_P(dot_dotdot), short_node,
8015f10: 30 a4 00 21 sb (r5+33),r4
8015f14: 30 a7 00 22 sb (r5+34),r7
8015f18: 30 a9 00 23 sb (r5+35),r9
8015f1c: 30 ab 00 24 sb (r5+36),r11
8015f20: 30 ad 00 25 sb (r5+37),r13
8015f24: 30 af 00 26 sb (r5+38),r15
8015f28: 30 a2 00 20 sb (r5+32),r2
8015f2c: 30 b2 00 27 sb (r5+39),r18
8015f30: 30 b8 00 28 sb (r5+40),r24
8015f34: 30 bb 00 29 sb (r5+41),fp
8015f38: 43 82 00 b2 lbu r2,(sp+178)
8015f3c: 30 a2 00 2a sb (r5+42),r2
8015f40: 43 9d 00 b3 lbu ra,(sp+179)
8015f44: 30 bd 00 2b sb (r5+43),ra
8015f48: 43 82 00 b4 lbu r2,(sp+180)
8015f4c: 30 a2 00 2c sb (r5+44),r2
8015f50: 43 9d 00 b5 lbu ra,(sp+181)
8015f54: 30 bd 00 2d sb (r5+45),ra
8015f58: 43 82 00 b6 lbu r2,(sp+182)
8015f5c: 30 a2 00 2e sb (r5+46),r2
8015f60: 43 9d 00 b7 lbu ra,(sp+183)
8015f64: 30 bd 00 2f sb (r5+47),ra
8015f68: 43 82 00 b8 lbu r2,(sp+184)
8015f6c: 30 a2 00 30 sb (r5+48),r2
8015f70: 43 9d 00 b9 lbu ra,(sp+185)
8015f74: 30 bd 00 31 sb (r5+49),ra
8015f78: 43 82 00 ba lbu r2,(sp+186)
8015f7c: 30 a2 00 32 sb (r5+50),r2
8015f80: 43 9d 00 bb lbu ra,(sp+187)
8015f84: 30 bd 00 33 sb (r5+51),ra
8015f88: 43 82 00 bc lbu r2,(sp+188)
8015f8c: 30 a2 00 34 sb (r5+52),r2
8015f90: 43 9d 00 bd lbu ra,(sp+189)
8015f94: 30 bd 00 35 sb (r5+53),ra
8015f98: 30 a3 00 3e sb (r5+62),r3
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
memcpy(MSDOS_DIR_NAME(DOT_NODE_P(dot_dotdot)), MSDOS_DOT_NAME,
8015f9c: 78 03 08 02 mvhi r3,0x802
8015fa0: 38 63 ec 18 ori r3,r3,0xec18
8015fa4: 28 63 00 00 lw r3,(r3+0)
* dot and dotdot entries are identical to new node except the
* names
*/
memcpy(DOT_NODE_P(dot_dotdot), short_node,
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
memcpy(DOTDOT_NODE_P(dot_dotdot), short_node,
8015fa8: 30 b9 00 36 sb (r5+54),r25
8015fac: 30 b7 00 37 sb (r5+55),r23
8015fb0: 30 b1 00 38 sb (r5+56),r17
8015fb4: 30 ae 00 39 sb (r5+57),r14
8015fb8: 30 ac 00 3a sb (r5+58),r12
8015fbc: 30 aa 00 3b sb (r5+59),r10
8015fc0: 30 a8 00 3c sb (r5+60),r8
8015fc4: 30 a6 00 3d sb (r5+61),r6
8015fc8: 30 a1 00 3f sb (r5+63),r1
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
memcpy(MSDOS_DIR_NAME(DOT_NODE_P(dot_dotdot)), MSDOS_DOT_NAME,
8015fcc: 40 6e 00 00 lbu r14,(r3+0)
8015fd0: 40 6d 00 01 lbu r13,(r3+1)
8015fd4: 40 6c 00 02 lbu r12,(r3+2)
8015fd8: 40 6b 00 03 lbu r11,(r3+3)
8015fdc: 40 6a 00 04 lbu r10,(r3+4)
8015fe0: 40 69 00 05 lbu r9,(r3+5)
8015fe4: 40 68 00 06 lbu r8,(r3+6)
8015fe8: 40 67 00 07 lbu r7,(r3+7)
8015fec: 40 66 00 08 lbu r6,(r3+8)
8015ff0: 40 64 00 09 lbu r4,(r3+9)
8015ff4: 40 63 00 0a lbu r3,(r3+10)
8015ff8: 33 8e 00 48 sb (sp+72),r14
8015ffc: 30 a4 00 09 sb (r5+9),r4
8016000: 30 a3 00 0a sb (r5+10),r3
MSDOS_NAME_MAX);
memcpy(MSDOS_DIR_NAME(DOTDOT_NODE_P(dot_dotdot)), MSDOS_DOTDOT_NAME,
8016004: 78 03 08 02 mvhi r3,0x802
8016008: 38 63 ec 1c ori r3,r3,0xec1c
801600c: 28 63 00 00 lw r3,(r3+0)
*/
memcpy(DOT_NODE_P(dot_dotdot), short_node,
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
memcpy(DOTDOT_NODE_P(dot_dotdot), short_node,
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
memcpy(MSDOS_DIR_NAME(DOT_NODE_P(dot_dotdot)), MSDOS_DOT_NAME,
8016010: 30 ad 00 01 sb (r5+1),r13
8016014: 30 ac 00 02 sb (r5+2),r12
8016018: 30 ab 00 03 sb (r5+3),r11
801601c: 30 aa 00 04 sb (r5+4),r10
8016020: 30 a9 00 05 sb (r5+5),r9
8016024: 30 a8 00 06 sb (r5+6),r8
8016028: 30 a7 00 07 sb (r5+7),r7
801602c: 30 a6 00 08 sb (r5+8),r6
MSDOS_NAME_MAX);
memcpy(MSDOS_DIR_NAME(DOTDOT_NODE_P(dot_dotdot)), MSDOS_DOTDOT_NAME,
8016030: 40 6e 00 01 lbu r14,(r3+1)
8016034: 40 6d 00 02 lbu r13,(r3+2)
8016038: 40 6c 00 03 lbu r12,(r3+3)
801603c: 40 6b 00 04 lbu r11,(r3+4)
8016040: 40 6a 00 05 lbu r10,(r3+5)
8016044: 40 69 00 06 lbu r9,(r3+6)
8016048: 40 68 00 07 lbu r8,(r3+7)
801604c: 40 67 00 08 lbu r7,(r3+8)
8016050: 40 66 00 09 lbu r6,(r3+9)
8016054: 40 6f 00 00 lbu r15,(r3+0)
8016058: 40 63 00 0a lbu r3,(r3+10)
801605c: 37 84 00 68 addi r4,sp,104
8016060: 33 8f 00 68 sb (sp+104),r15
8016064: 30 83 00 0a sb (r4+10),r3
8016068: 30 8e 00 01 sb (r4+1),r14
801606c: 30 8d 00 02 sb (r4+2),r13
8016070: 30 8c 00 03 sb (r4+3),r12
8016074: 30 8b 00 04 sb (r4+4),r11
8016078: 30 8a 00 05 sb (r4+5),r10
801607c: 30 89 00 06 sb (r4+6),r9
8016080: 30 88 00 07 sb (r4+7),r8
8016084: 30 87 00 08 sb (r4+8),r7
8016088: 30 86 00 09 sb (r4+9),r6
/*
* 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)) &&
801608c: 2a c4 00 20 lw r4,(r22+32)
8016090: 34 03 00 01 mvi r3,1
8016094: 5c 83 00 09 bne r4,r3,80160b8 <msdos_creat_node+0x548>
8016098: 2a c3 00 24 lw r3,(r22+36)
801609c: 5c 75 00 07 bne r3,r21,80160b8 <msdos_creat_node+0x548> <== NEVER TAKEN
(fs_info->fat.vol.type & FAT_FAT32))
80160a0: 42 63 00 0e lbu r3,(r19+14)
80160a4: 20 63 00 04 andi r3,r3,0x4
/*
* 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)) &&
80160a8: 44 75 00 04 be r3,r21,80160b8 <msdos_creat_node+0x548> <== ALWAYS TAKEN
(fs_info->fat.vol.type & FAT_FAT32))
{
*MSDOS_DIR_FIRST_CLUSTER_LOW(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
80160ac: 0c a0 00 3a sh (r5+58),r0 <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_HI(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
80160b0: 0c a0 00 34 sh (r5+52),r0 <== NOT EXECUTED
80160b4: e0 00 00 1a bi 801611c <msdos_creat_node+0x5ac> <== NOT EXECUTED
}
else
{
*MSDOS_DIR_FIRST_CLUSTER_LOW(DOTDOT_NODE_P(dot_dotdot)) =
CT_LE_W((uint16_t )((parent_fat_fd->cln) & 0x0000FFFF));
80160b8: 2a cc 00 1c lw r12,(r22+28)
80160bc: 34 02 00 08 mvi r2,8
*MSDOS_DIR_FIRST_CLUSTER_LOW(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
*MSDOS_DIR_FIRST_CLUSTER_HI(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
}
else
{
*MSDOS_DIR_FIRST_CLUSTER_LOW(DOTDOT_NODE_P(dot_dotdot)) =
80160c0: 37 8b 00 48 addi r11,sp,72
CT_LE_W((uint16_t )((parent_fat_fd->cln) & 0x0000FFFF));
80160c4: 21 8d ff ff andi r13,r12,0xffff
80160c8: b9 a0 08 00 mv r1,r13
80160cc: fb ff ac 47 calli 80011e8 <__ashlsi3>
80160d0: b8 20 70 00 mv r14,r1
80160d4: 34 02 00 08 mvi r2,8
80160d8: b9 a0 08 00 mv r1,r13
80160dc: f8 00 5c df calli 802d458 <__lshrsi3>
80160e0: b9 c1 18 00 or r3,r14,r1
*MSDOS_DIR_FIRST_CLUSTER_LOW(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
*MSDOS_DIR_FIRST_CLUSTER_HI(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
}
else
{
*MSDOS_DIR_FIRST_CLUSTER_LOW(DOTDOT_NODE_P(dot_dotdot)) =
80160e4: 0d 63 00 3a sh (r11+58),r3
CT_LE_W((uint16_t )((parent_fat_fd->cln) & 0x0000FFFF));
*MSDOS_DIR_FIRST_CLUSTER_HI(DOTDOT_NODE_P(dot_dotdot)) =
CT_LE_W((uint16_t )(((parent_fat_fd->cln) & 0xFFFF0000)>>16));
80160e8: b9 80 08 00 mv r1,r12
80160ec: 34 02 00 10 mvi r2,16
80160f0: f8 00 5c da calli 802d458 <__lshrsi3>
80160f4: 20 2c ff ff andi r12,r1,0xffff
80160f8: 34 02 00 08 mvi r2,8
80160fc: b9 80 08 00 mv r1,r12
8016100: fb ff ac 3a calli 80011e8 <__ashlsi3>
8016104: b8 20 68 00 mv r13,r1
8016108: 34 02 00 08 mvi r2,8
801610c: b9 80 08 00 mv r1,r12
8016110: f8 00 5c d2 calli 802d458 <__lshrsi3>
8016114: b9 a1 18 00 or r3,r13,r1
}
else
{
*MSDOS_DIR_FIRST_CLUSTER_LOW(DOTDOT_NODE_P(dot_dotdot)) =
CT_LE_W((uint16_t )((parent_fat_fd->cln) & 0x0000FFFF));
*MSDOS_DIR_FIRST_CLUSTER_HI(DOTDOT_NODE_P(dot_dotdot)) =
8016118: 0d 63 00 34 sh (r11+52),r3
/*
* 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,
801611c: 37 8c 00 48 addi r12,sp,72
8016120: ba 60 08 00 mv r1,r19
8016124: ba 00 10 00 mv r2,r16
8016128: 34 03 00 00 mvi r3,0
801612c: 34 04 00 40 mvi r4,64
8016130: b9 80 28 00 mv r5,r12
8016134: fb ff e6 42 calli 800fa3c <fat_file_write>
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2,
(uint8_t *)dot_dotdot);
if (ret < 0)
8016138: 48 01 00 2e bg r0,r1,80161f0 <msdos_creat_node+0x680> <== NEVER TAKEN
rc = -1;
goto error;
}
/* increment fat-file size by cluster size */
fat_fd->fat_file_size += fs_info->fat.vol.bpc;
801613c: 2b 8b 00 d8 lw r11,(sp+216)
8016140: 2e 62 00 06 lhu r2,(r19+6)
8016144: 29 63 00 18 lw r3,(r11+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));
8016148: 29 6e 00 1c lw r14,(r11+28)
rc = -1;
goto error;
}
/* increment fat-file size by cluster size */
fat_fd->fat_file_size += fs_info->fat.vol.bpc;
801614c: b4 62 10 00 add r2,r3,r2
/* 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));
8016150: 21 cd ff ff andi r13,r14,0xffff
rc = -1;
goto error;
}
/* increment fat-file size by cluster size */
fat_fd->fat_file_size += fs_info->fat.vol.bpc;
8016154: 59 62 00 18 sw (r11+24),r2
8016158: b9 a0 08 00 mv r1,r13
801615c: 34 02 00 08 mvi r2,8
8016160: fb ff ac 22 calli 80011e8 <__ashlsi3>
8016164: b8 20 78 00 mv r15,r1
8016168: 34 02 00 08 mvi r2,8
801616c: b9 a0 08 00 mv r1,r13
8016170: f8 00 5c ba calli 802d458 <__lshrsi3>
8016174: b9 e1 10 00 or r2,r15,r1
/* set up cluster num for dot entry */
*MSDOS_DIR_FIRST_CLUSTER_LOW(DOT_NODE_P(dot_dotdot)) =
8016178: 0d 82 00 1a sh (r12+26),r2
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));
801617c: b9 c0 08 00 mv r1,r14
8016180: 34 02 00 10 mvi r2,16
8016184: f8 00 5c b5 calli 802d458 <__lshrsi3>
8016188: 20 2d ff ff andi r13,r1,0xffff
801618c: 34 02 00 08 mvi r2,8
8016190: b9 a0 08 00 mv r1,r13
8016194: fb ff ac 15 calli 80011e8 <__ashlsi3>
8016198: b8 20 70 00 mv r14,r1
801619c: 34 02 00 08 mvi r2,8
80161a0: b9 a0 08 00 mv r1,r13
80161a4: f8 00 5c ad calli 802d458 <__lshrsi3>
80161a8: b9 c1 10 00 or r2,r14,r1
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));
*MSDOS_DIR_FIRST_CLUSTER_HI(DOT_NODE_P(dot_dotdot)) =
80161ac: 0d 82 00 14 sh (r12+20),r2
CT_LE_W((uint16_t )(((fat_fd->cln) & 0xFFFF0000) >> 16));
/* rewrite dot entry */
ret = fat_file_write(&fs_info->fat, fat_fd, 0,
80161b0: ba 60 08 00 mv r1,r19
80161b4: b9 60 10 00 mv r2,r11
80161b8: 34 03 00 00 mvi r3,0
80161bc: 34 04 00 20 mvi r4,32
80161c0: b9 80 28 00 mv r5,r12
80161c4: fb ff e6 1e calli 800fa3c <fat_file_write>
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
(uint8_t *)DOT_NODE_P(dot_dotdot));
if (ret < 0)
80161c8: 48 01 00 0a bg r0,r1,80161f0 <msdos_creat_node+0x680> <== NEVER TAKEN
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);
80161cc: 2a 81 00 14 lw r1,(r20+20)
80161d0: 2b 82 00 d8 lw r2,(sp+216)
80161d4: f8 00 01 a4 calli 8016864 <msdos_set_first_cluster_num>
80161d8: b8 20 58 00 mv r11,r1
if (rc != RC_OK)
80161dc: 5c 20 00 06 bne r1,r0,80161f4 <msdos_creat_node+0x684> <== NEVER TAKEN
goto error;
fat_file_close(&fs_info->fat, fat_fd);
80161e0: 2b 82 00 d8 lw r2,(sp+216)
80161e4: ba 60 08 00 mv r1,r19
80161e8: fb ff e5 18 calli 800f648 <fat_file_close>
80161ec: e0 00 00 09 bi 8016210 <msdos_creat_node+0x6a0>
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;
80161f0: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED
fat_file_close(&fs_info->fat, fat_fd);
}
return RC_OK;
error:
fat_file_close(&fs_info->fat, fat_fd);
80161f4: 2b 82 00 d8 lw r2,(sp+216) <== NOT EXECUTED
80161f8: ba 60 08 00 mv r1,r19 <== NOT EXECUTED
80161fc: fb ff e5 13 calli 800f648 <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);
8016200: 2a 81 00 14 lw r1,(r20+20) <== NOT EXECUTED
8016204: 37 82 00 c8 addi r2,sp,200 <== NOT EXECUTED
8016208: 34 03 00 e5 mvi r3,229 <== NOT EXECUTED
801620c: f8 00 02 0f calli 8016a48 <msdos_set_first_char4file_name> <== NOT EXECUTED
return rc;
}
8016210: b9 60 08 00 mv r1,r11
8016214: 2b 9d 00 04 lw ra,(sp+4)
8016218: 2b 8b 00 44 lw r11,(sp+68)
801621c: 2b 8c 00 40 lw r12,(sp+64)
8016220: 2b 8d 00 3c lw r13,(sp+60)
8016224: 2b 8e 00 38 lw r14,(sp+56)
8016228: 2b 8f 00 34 lw r15,(sp+52)
801622c: 2b 90 00 30 lw r16,(sp+48)
8016230: 2b 91 00 2c lw r17,(sp+44)
8016234: 2b 92 00 28 lw r18,(sp+40)
8016238: 2b 93 00 24 lw r19,(sp+36)
801623c: 2b 94 00 20 lw r20,(sp+32)
8016240: 2b 95 00 1c lw r21,(sp+28)
8016244: 2b 96 00 18 lw r22,(sp+24)
8016248: 2b 97 00 14 lw r23,(sp+20)
801624c: 2b 98 00 10 lw r24,(sp+16)
8016250: 2b 99 00 0c lw r25,(sp+12)
8016254: 2b 9b 00 08 lw fp,(sp+8)
8016258: 37 9c 00 dc addi sp,sp,220
801625c: c3 a0 00 00 ret
08019c0c <msdos_date_dos2unix>:
* 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)
{
8019c0c: 37 9c ff ec addi sp,sp,-20
8019c10: 5b 8b 00 14 sw (sp+20),r11
8019c14: 5b 8c 00 10 sw (sp+16),r12
8019c18: 5b 8d 00 0c sw (sp+12),r13
8019c1c: 5b 8e 00 08 sw (sp+8),r14
8019c20: 5b 9d 00 04 sw (sp+4),ra
8019c24: b8 40 58 00 mv r11,r2
8019c28: b8 20 68 00 mv r13,r1
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;
8019c2c: 20 41 f8 00 andi r1,r2,0xf800
8019c30: 34 02 00 0b mvi r2,11
8019c34: f8 00 4e 09 calli 802d458 <__lshrsi3>
8019c38: 34 02 07 08 mvi r2,1800
8019c3c: fb ff 9d b9 calli 8001320 <__mulsi3>
8019c40: b8 20 70 00 mv r14,r1
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
8019c44: 34 02 00 05 mvi r2,5
8019c48: 21 61 07 e0 andi r1,r11,0x7e0
8019c4c: f8 00 4e 03 calli 802d458 <__lshrsi3>
8019c50: 34 02 00 01 mvi r2,1
8019c54: b8 20 60 00 mv r12,r1
8019c58: fb ff 9d 64 calli 80011e8 <__ashlsi3>
8019c5c: b4 2c 60 00 add r12,r1,r12
8019c60: 34 02 00 02 mvi r2,2
8019c64: b9 80 08 00 mv r1,r12
8019c68: fb ff 9d 60 calli 80011e8 <__ashlsi3>
8019c6c: 34 02 00 01 mvi r2,1
8019c70: b5 81 08 00 add r1,r12,r1
8019c74: fb ff 9d 5d calli 80011e8 <__ashlsi3>
+ ((dt & MSDOS_DT_HOURS_MASK) >> MSDOS_DT_HOURS_SHIFT) * 3600;
8019c78: b5 c1 08 00 add r1,r14,r1
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)
8019c7c: 21 6b 00 1f andi r11,r11,0x1f
8019c80: 34 02 00 01 mvi r2,1
8019c84: b4 2b 08 00 add r1,r1,r11
8019c88: fb ff 9d 58 calli 80011e8 <__ashlsi3>
+ ((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) {
8019c8c: 78 02 08 03 mvhi r2,0x803
8019c90: 38 42 08 74 ori r2,r2,0x874
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)
8019c94: b8 20 70 00 mv r14,r1
+ ((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) {
8019c98: 2c 41 00 00 lhu r1,(r2+0)
8019c9c: 44 2d 00 31 be r1,r13,8019d60 <msdos_date_dos2unix+0x154>
lastdosdate = dd;
8019ca0: 0c 4d 00 00 sh (r2+0),r13
days = 0;
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
8019ca4: 21 a1 fe 00 andi r1,r13,0xfe00
8019ca8: 34 02 00 09 mvi r2,9
8019cac: f8 00 4d eb calli 802d458 <__lshrsi3>
8019cb0: b8 20 20 00 mv r4,r1
* 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;
8019cb4: 34 0c 00 00 mvi r12,0
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
for (y = 0; y < year; y++)
8019cb8: 34 02 00 00 mvi r2,0
8019cbc: e0 00 00 06 bi 8019cd4 <msdos_date_dos2unix+0xc8>
days += y & 0x03 ? 365 : 366;
8019cc0: 20 43 00 03 andi r3,r2,0x3
8019cc4: 64 63 00 00 cmpei r3,r3,0
*/
if (lastdosdate != dd) {
lastdosdate = dd;
days = 0;
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
for (y = 0; y < year; y++)
8019cc8: 34 42 00 01 addi r2,r2,1
days += y & 0x03 ? 365 : 366;
8019ccc: 34 63 01 6d addi r3,r3,365
8019cd0: b5 83 60 00 add r12,r12,r3
*/
if (lastdosdate != dd) {
lastdosdate = dd;
days = 0;
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
for (y = 0; y < year; y++)
8019cd4: 54 82 ff fb bgu r4,r2,8019cc0 <msdos_date_dos2unix+0xb4>
days += y & 0x03 ? 365 : 366;
months = year & 0x03 ? regyear : leapyear;
8019cd8: 78 0b 08 03 mvhi r11,0x803
8019cdc: 20 84 00 03 andi r4,r4,0x3
8019ce0: 39 6b 02 60 ori r11,r11,0x260
8019ce4: 44 80 00 03 be r4,r0,8019cf0 <msdos_date_dos2unix+0xe4> <== ALWAYS TAKEN
8019ce8: 78 0b 08 03 mvhi r11,0x803 <== NOT EXECUTED
8019cec: 39 6b 02 48 ori r11,r11,0x248 <== NOT EXECUTED
/*
* Prevent going from 0 to 0xffffffff in the following
* loop.
*/
month = (dd & MSDOS_DD_MONTH_MASK) >> MSDOS_DD_MONTH_SHIFT;
8019cf0: 34 02 00 05 mvi r2,5
8019cf4: 21 a1 01 e0 andi r1,r13,0x1e0
8019cf8: f8 00 4d d8 calli 802d458 <__lshrsi3>
8019cfc: b8 20 10 00 mv r2,r1
if (month == 0) {
8019d00: 5c 20 00 02 bne r1,r0,8019d08 <msdos_date_dos2unix+0xfc> <== ALWAYS TAKEN
month = 1;
8019d04: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
}
for (m = 0; m < month - 1; m++)
8019d08: 34 03 00 00 mvi r3,0
8019d0c: 34 42 ff ff addi r2,r2,-1
8019d10: e0 00 00 05 bi 8019d24 <msdos_date_dos2unix+0x118>
days += months[m];
8019d14: 2d 61 00 00 lhu r1,(r11+0) <== NOT EXECUTED
*/
month = (dd & MSDOS_DD_MONTH_MASK) >> MSDOS_DD_MONTH_SHIFT;
if (month == 0) {
month = 1;
}
for (m = 0; m < month - 1; m++)
8019d18: 34 63 00 01 addi r3,r3,1 <== NOT EXECUTED
8019d1c: 35 6b 00 02 addi r11,r11,2 <== NOT EXECUTED
days += months[m];
8019d20: b5 81 60 00 add r12,r12,r1 <== NOT EXECUTED
*/
month = (dd & MSDOS_DD_MONTH_MASK) >> MSDOS_DD_MONTH_SHIFT;
if (month == 0) {
month = 1;
}
for (m = 0; m < month - 1; m++)
8019d24: 54 43 ff fc bgu r2,r3,8019d14 <msdos_date_dos2unix+0x108> <== NEVER TAKEN
days += months[m];
days += ((dd & MSDOS_DD_DAY_MASK) >> MSDOS_DD_DAY_SHIFT) - 1;
lastseconds = (days + DAYSTO1980) * SECONDSPERDAY;
8019d28: 78 03 08 02 mvhi r3,0x802
8019d2c: 38 63 ec 88 ori r3,r3,0xec88
8019d30: 28 62 00 00 lw r2,(r3+0)
if (month == 0) {
month = 1;
}
for (m = 0; m < month - 1; m++)
days += months[m];
days += ((dd & MSDOS_DD_DAY_MASK) >> MSDOS_DD_DAY_SHIFT) - 1;
8019d34: 21 ad 00 1f andi r13,r13,0x1f
8019d38: 35 ad ff ff addi r13,r13,-1
lastseconds = (days + DAYSTO1980) * SECONDSPERDAY;
8019d3c: b5 ac 08 00 add r1,r13,r12
8019d40: fb ff 9d 78 calli 8001320 <__mulsi3>
8019d44: 78 03 08 02 mvhi r3,0x802
8019d48: 38 63 ec 8c ori r3,r3,0xec8c
8019d4c: 28 62 00 00 lw r2,(r3+0)
8019d50: 78 0b 08 03 mvhi r11,0x803
8019d54: 39 6b 08 78 ori r11,r11,0x878
8019d58: b4 22 10 00 add r2,r1,r2
8019d5c: 59 62 00 00 sw (r11+0),r2
}
return seconds + lastseconds;
8019d60: 78 02 08 03 mvhi r2,0x803
8019d64: 38 42 08 78 ori r2,r2,0x878
8019d68: 28 42 00 00 lw r2,(r2+0)
}
8019d6c: b5 c2 08 00 add r1,r14,r2
8019d70: 2b 9d 00 04 lw ra,(sp+4)
8019d74: 2b 8b 00 14 lw r11,(sp+20)
8019d78: 2b 8c 00 10 lw r12,(sp+16)
8019d7c: 2b 8d 00 0c lw r13,(sp+12)
8019d80: 2b 8e 00 08 lw r14,(sp+8)
8019d84: 37 9c 00 14 addi sp,sp,20
8019d88: c3 a0 00 00 ret
08019a74 <msdos_date_unix2dos>:
* file timestamps. The passed in unix time is assumed to be in GMT.
*/
void
msdos_date_unix2dos(unsigned int t, uint16_t *ddp,
uint16_t *dtp)
{
8019a74: 37 9c ff e8 addi sp,sp,-24
8019a78: 5b 8b 00 18 sw (sp+24),r11
8019a7c: 5b 8c 00 14 sw (sp+20),r12
8019a80: 5b 8d 00 10 sw (sp+16),r13
8019a84: 5b 8e 00 0c sw (sp+12),r14
8019a88: 5b 8f 00 08 sw (sp+8),r15
8019a8c: 5b 9d 00 04 sw (sp+4),ra
/*
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
8019a90: 78 04 08 03 mvhi r4,0x803
8019a94: 38 84 08 7c ori r4,r4,0x87c
* 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)
{
8019a98: b8 40 70 00 mv r14,r2
/*
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
8019a9c: 28 82 00 00 lw r2,(r4+0)
* 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)
{
8019aa0: b8 20 58 00 mv r11,r1
8019aa4: b8 60 78 00 mv r15,r3
/*
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
8019aa8: 44 41 00 49 be r2,r1,8019bcc <msdos_date_unix2dos+0x158>
lasttime = t;
8019aac: 58 81 00 00 sw (r4+0),r1
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
8019ab0: 34 02 00 3c mvi r2,60
8019ab4: f8 00 4e b9 calli 802d598 <__udivsi3>
8019ab8: 34 02 00 3c mvi r2,60
8019abc: f8 00 4e c7 calli 802d5d8 <__umodsi3>
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
lasttime = t;
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
8019ac0: 34 02 00 05 mvi r2,5
8019ac4: fb ff 9d c9 calli 80011e8 <__ashlsi3>
8019ac8: b8 20 68 00 mv r13,r1
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
8019acc: 34 02 0e 10 mvi r2,3600
8019ad0: b9 60 08 00 mv r1,r11
8019ad4: f8 00 4e b1 calli 802d598 <__udivsi3>
8019ad8: 34 02 00 18 mvi r2,24
8019adc: f8 00 4e bf calli 802d5d8 <__umodsi3>
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
lasttime = t;
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
8019ae0: 34 02 00 0b mvi r2,11
8019ae4: fb ff 9d c1 calli 80011e8 <__ashlsi3>
8019ae8: b5 a1 68 00 add r13,r13,r1
8019aec: 34 02 00 3c mvi r2,60
8019af0: b9 60 08 00 mv r1,r11
8019af4: f8 00 4e b9 calli 802d5d8 <__umodsi3>
8019af8: 34 02 00 01 mvi r2,1
8019afc: f8 00 4e 57 calli 802d458 <__lshrsi3>
/*
* 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);
8019b00: 78 03 08 02 mvhi r3,0x802
8019b04: 38 63 ec 88 ori r3,r3,0xec88
8019b08: 28 62 00 00 lw r2,(r3+0)
* 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)
8019b0c: 78 0c 08 03 mvhi r12,0x803
8019b10: b5 a1 08 00 add r1,r13,r1
8019b14: 39 8c 08 80 ori r12,r12,0x880
8019b18: 0d 81 00 00 sh (r12+0),r1
/*
* 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);
8019b1c: b9 60 08 00 mv r1,r11
8019b20: f8 00 4e 9e calli 802d598 <__udivsi3>
if (days != lastday) {
8019b24: 78 04 08 03 mvhi r4,0x803
8019b28: 38 84 08 84 ori r4,r4,0x884
8019b2c: 28 82 00 00 lw r2,(r4+0)
8019b30: 44 22 00 27 be r1,r2,8019bcc <msdos_date_unix2dos+0x158>
lastday = days;
8019b34: 58 81 00 00 sw (r4+0),r1
for (year = 1970;; year++) {
8019b38: 34 0b 07 b2 mvi r11,1970
inc = year & 0x03 ? 365 : 366;
8019b3c: 21 65 00 03 andi r5,r11,0x3
8019b40: 64 a4 00 00 cmpei r4,r5,0
8019b44: 34 84 01 6d addi r4,r4,365
if (days < inc)
8019b48: 54 81 00 04 bgu r4,r1,8019b58 <msdos_date_unix2dos+0xe4>
break;
days -= inc;
8019b4c: c8 24 08 00 sub r1,r1,r4
* and month stuff.
*/
days = t / (SECONDSPERDAY);
if (days != lastday) {
lastday = days;
for (year = 1970;; year++) {
8019b50: 35 6b 00 01 addi r11,r11,1
inc = year & 0x03 ? 365 : 366;
if (days < inc)
break;
days -= inc;
}
8019b54: e3 ff ff fa bi 8019b3c <msdos_date_unix2dos+0xc8>
months = year & 0x03 ? regyear : leapyear;
8019b58: 78 04 08 03 mvhi r4,0x803
8019b5c: 38 84 02 60 ori r4,r4,0x260
8019b60: 44 a0 00 03 be r5,r0,8019b6c <msdos_date_unix2dos+0xf8> <== ALWAYS TAKEN
8019b64: 78 04 08 03 mvhi r4,0x803 <== NOT EXECUTED
8019b68: 38 84 02 48 ori r4,r4,0x248 <== NOT EXECUTED
for (month = 0; month < 12; month++) {
8019b6c: 34 05 00 00 mvi r5,0
8019b70: 34 02 00 0c mvi r2,12
if (days < months[month])
8019b74: 2c 86 00 00 lhu r6,(r4+0)
8019b78: 54 c1 00 05 bgu r6,r1,8019b8c <msdos_date_unix2dos+0x118> <== ALWAYS TAKEN
if (days < inc)
break;
days -= inc;
}
months = year & 0x03 ? regyear : leapyear;
for (month = 0; month < 12; month++) {
8019b7c: 34 a5 00 01 addi r5,r5,1 <== NOT EXECUTED
if (days < months[month])
break;
days -= months[month];
8019b80: c8 26 08 00 sub r1,r1,r6 <== NOT EXECUTED
if (days < inc)
break;
days -= inc;
}
months = year & 0x03 ? regyear : leapyear;
for (month = 0; month < 12; month++) {
8019b84: 34 84 00 02 addi r4,r4,2 <== NOT EXECUTED
8019b88: 5c a2 ff fb bne r5,r2,8019b74 <msdos_date_unix2dos+0x100> <== NOT EXECUTED
if (days < months[month])
break;
days -= months[month];
}
lastddate = ((days + 1) << MSDOS_DD_DAY_SHIFT)
8019b8c: 34 2d 00 01 addi r13,r1,1
8019b90: 34 02 00 05 mvi r2,5
8019b94: 34 a1 00 01 addi r1,r5,1
8019b98: fb ff 9d 94 calli 80011e8 <__ashlsi3>
8019b9c: b5 a1 08 00 add r1,r13,r1
8019ba0: 78 0c 08 03 mvhi r12,0x803
8019ba4: 20 2d ff ff andi r13,r1,0xffff
8019ba8: 39 8c 08 88 ori r12,r12,0x888
8019bac: 0d 8d 00 00 sh (r12+0),r13
* 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)
8019bb0: 34 01 07 bc mvi r1,1980
8019bb4: 50 2b 00 06 bgeu r1,r11,8019bcc <msdos_date_unix2dos+0x158><== NEVER TAKEN
lastddate += (year - 1980) <<
8019bb8: 35 61 f8 44 addi r1,r11,-1980
8019bbc: 34 02 00 09 mvi r2,9
8019bc0: fb ff 9d 8a calli 80011e8 <__ashlsi3>
8019bc4: b5 a1 08 00 add r1,r13,r1
8019bc8: 0d 81 00 00 sh (r12+0),r1
MSDOS_DD_YEAR_SHIFT;
}
}
*dtp = lastdtime;
8019bcc: 78 01 08 03 mvhi r1,0x803
8019bd0: 38 21 08 80 ori r1,r1,0x880
8019bd4: 2c 21 00 00 lhu r1,(r1+0)
8019bd8: 0d e1 00 00 sh (r15+0),r1
*ddp = lastddate;
8019bdc: 78 01 08 03 mvhi r1,0x803
8019be0: 38 21 08 88 ori r1,r1,0x888
8019be4: 2c 21 00 00 lhu r1,(r1+0)
8019be8: 0d c1 00 00 sh (r14+0),r1
}
8019bec: 2b 9d 00 04 lw ra,(sp+4)
8019bf0: 2b 8b 00 18 lw r11,(sp+24)
8019bf4: 2b 8c 00 14 lw r12,(sp+20)
8019bf8: 2b 8d 00 10 lw r13,(sp+16)
8019bfc: 2b 8e 00 0c lw r14,(sp+12)
8019c00: 2b 8f 00 08 lw r15,(sp+8)
8019c04: 37 9c 00 18 addi sp,sp,24
8019c08: c3 a0 00 00 ret
08016b9c <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
)
{
8016b9c: 37 9c ff c8 addi sp,sp,-56
8016ba0: 5b 8b 00 38 sw (sp+56),r11
8016ba4: 5b 8c 00 34 sw (sp+52),r12
8016ba8: 5b 8d 00 30 sw (sp+48),r13
8016bac: 5b 8e 00 2c sw (sp+44),r14
8016bb0: 5b 8f 00 28 sw (sp+40),r15
8016bb4: 5b 90 00 24 sw (sp+36),r16
8016bb8: 5b 91 00 20 sw (sp+32),r17
8016bbc: 5b 92 00 1c sw (sp+28),r18
8016bc0: 5b 93 00 18 sw (sp+24),r19
8016bc4: 5b 94 00 14 sw (sp+20),r20
8016bc8: 5b 95 00 10 sw (sp+16),r21
8016bcc: 5b 96 00 0c sw (sp+12),r22
8016bd0: 5b 97 00 08 sw (sp+8),r23
8016bd4: 5b 9d 00 04 sw (sp+4),ra
*/
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,
8016bd8: 78 10 08 02 mvhi r16,0x802
MSDOS_SHORT_NAME_LEN) == 0) ||
(strncmp(MSDOS_DIR_NAME((entry)),
8016bdc: 78 0f 08 02 mvhi r15,0x802
fat_file_fd_t *fat_fd,
bool *ret_val
)
{
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
8016be0: 28 2b 00 08 lw r11,(r1+8)
msdos_dir_is_empty(
rtems_filesystem_mount_table_entry_t *mt_entry,
fat_file_fd_t *fat_fd,
bool *ret_val
)
{
8016be4: b8 40 b8 00 mv r23,r2
8016be8: b8 60 70 00 mv r14,r3
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;
8016bec: 30 60 00 00 sb (r3+0),r0
bool *ret_val
)
{
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
uint32_t j = 0, i = 0;
8016bf0: 34 11 00 00 mvi r17,0
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)
8016bf4: 34 16 00 1f mvi r22,31
* 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)) ==
8016bf8: 34 15 00 e5 mvi r21,229
MSDOS_THIS_DIR_ENTRY_EMPTY) ||
8016bfc: 34 14 00 0f mvi r20,15
((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
MSDOS_ATTR_LFN) ||
(strncmp(MSDOS_DIR_NAME((entry)), MSDOS_DOT_NAME,
8016c00: 3a 10 eb e0 ori r16,r16,0xebe0
MSDOS_SHORT_NAME_LEN) == 0) ||
(strncmp(MSDOS_DIR_NAME((entry)),
8016c04: 39 ef eb ec ori r15,r15,0xebec
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,
8016c08: e0 00 00 28 bi 8016ca8 <msdos_dir_is_empty+0x10c>
fs_info->fat.vol.bps,
fs_info->cl_buf)) != FAT_EOF)
{
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
8016c0c: 4e c1 00 36 bge r22,r1,8016ce4 <msdos_dir_is_empty+0x148> <== NEVER TAKEN
return -1;
assert(ret == fs_info->fat.vol.bps);
8016c10: 2d 73 00 00 lhu r19,(r11+0)
8016c14: 5c 33 00 03 bne r1,r19,8016c20 <msdos_dir_is_empty+0x84> <== NEVER TAKEN
8016c18: 34 0c 00 00 mvi r12,0
8016c1c: e0 00 00 21 bi 8016ca0 <msdos_dir_is_empty+0x104>
8016c20: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED
8016c24: 78 03 08 02 mvhi r3,0x802 <== NOT EXECUTED
8016c28: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED
8016c2c: 38 21 eb 78 ori r1,r1,0xeb78 <== NOT EXECUTED
8016c30: 34 02 03 65 mvi r2,869 <== NOT EXECUTED
8016c34: 38 63 ec 68 ori r3,r3,0xec68 <== NOT EXECUTED
8016c38: 38 84 eb c4 ori r4,r4,0xebc4 <== NOT EXECUTED
8016c3c: fb ff ec 36 calli 8011d14 <__assert_func> <== NOT EXECUTED
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (i = 0;
i < fs_info->fat.vol.bps;
i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + i;
8016c40: 29 6d 00 a0 lw r13,(r11+160)
8016c44: b5 ac 68 00 add r13,r13,r12
* 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)) ==
8016c48: 41 b2 00 00 lbu r18,(r13+0)
8016c4c: 46 55 00 0e be r18,r21,8016c84 <msdos_dir_is_empty+0xe8> <== NEVER TAKEN
MSDOS_THIS_DIR_ENTRY_EMPTY) ||
((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
8016c50: 41 a1 00 0b lbu r1,(r13+11)
8016c54: 20 21 00 3f andi r1,r1,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) ||
8016c58: 44 34 00 0b be r1,r20,8016c84 <msdos_dir_is_empty+0xe8> <== NEVER TAKEN
((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
MSDOS_ATTR_LFN) ||
(strncmp(MSDOS_DIR_NAME((entry)), MSDOS_DOT_NAME,
8016c5c: b9 a0 08 00 mv r1,r13
8016c60: ba 00 10 00 mv r2,r16
8016c64: 34 03 00 0b mvi r3,11
8016c68: f8 00 18 2e calli 801cd20 <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) ||
8016c6c: 44 20 00 06 be r1,r0,8016c84 <msdos_dir_is_empty+0xe8>
(strncmp(MSDOS_DIR_NAME((entry)), MSDOS_DOT_NAME,
MSDOS_SHORT_NAME_LEN) == 0) ||
(strncmp(MSDOS_DIR_NAME((entry)),
8016c70: b9 a0 08 00 mv r1,r13
8016c74: b9 e0 10 00 mv r2,r15
8016c78: 34 03 00 0b mvi r3,11
8016c7c: f8 00 18 29 calli 801cd20 <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) ||
8016c80: 5c 20 00 03 bne r1,r0,8016c8c <msdos_dir_is_empty+0xf0>
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)
8016c84: 35 8c 00 20 addi r12,r12,32
8016c88: e0 00 00 06 bi 8016ca0 <msdos_dir_is_empty+0x104>
}
/*
* Short file name entries mean not empty.
*/
return RC_OK;
8016c8c: 34 01 00 00 mvi r1,0
continue;
/*
* Nothing more to look at.
*/
if ((*MSDOS_DIR_NAME(entry)) ==
8016c90: 5e 40 00 16 bne r18,r0,8016ce8 <msdos_dir_is_empty+0x14c>
MSDOS_THIS_DIR_ENTRY_AND_REST_EMPTY)
{
*ret_val = true;
8016c94: 34 02 00 01 mvi r2,1
8016c98: 31 c2 00 00 sb (r14+0),r2
return RC_OK;
8016c9c: e0 00 00 13 bi 8016ce8 <msdos_dir_is_empty+0x14c>
return -1;
assert(ret == fs_info->fat.vol.bps);
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (i = 0;
8016ca0: 56 6c ff e8 bgu r19,r12,8016c40 <msdos_dir_is_empty+0xa4> <== ALWAYS TAKEN
/*
* Short file name entries mean not empty.
*/
return RC_OK;
}
j++;
8016ca4: 36 31 00 01 addi r17,r17,1 <== NOT EXECUTED
uint32_t j = 0, i = 0;
/* dir is not empty */
*ret_val = false;
while ((ret = fat_file_read(&fs_info->fat, fat_fd, j * fs_info->fat.vol.bps,
8016ca8: 2d 6c 00 00 lhu r12,(r11+0)
8016cac: ba 20 08 00 mv r1,r17
8016cb0: b9 80 10 00 mv r2,r12
8016cb4: fb ff a9 9b calli 8001320 <__mulsi3>
8016cb8: 29 65 00 a0 lw r5,(r11+160)
8016cbc: b8 20 18 00 mv r3,r1
8016cc0: ba e0 10 00 mv r2,r23
8016cc4: b9 60 08 00 mv r1,r11
8016cc8: b9 80 20 00 mv r4,r12
8016ccc: fb ff e1 8c calli 800f2fc <fat_file_read>
8016cd0: 5c 20 ff cf bne r1,r0,8016c0c <msdos_dir_is_empty+0x70> <== ALWAYS TAKEN
*/
return RC_OK;
}
j++;
}
*ret_val = true;
8016cd4: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
8016cd8: 31 c1 00 00 sb (r14+0),r1 <== NOT EXECUTED
return RC_OK;
8016cdc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
8016ce0: e0 00 00 02 bi 8016ce8 <msdos_dir_is_empty+0x14c> <== 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;
8016ce4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
}
j++;
}
*ret_val = true;
return RC_OK;
}
8016ce8: 2b 9d 00 04 lw ra,(sp+4)
8016cec: 2b 8b 00 38 lw r11,(sp+56)
8016cf0: 2b 8c 00 34 lw r12,(sp+52)
8016cf4: 2b 8d 00 30 lw r13,(sp+48)
8016cf8: 2b 8e 00 2c lw r14,(sp+44)
8016cfc: 2b 8f 00 28 lw r15,(sp+40)
8016d00: 2b 90 00 24 lw r16,(sp+36)
8016d04: 2b 91 00 20 lw r17,(sp+32)
8016d08: 2b 92 00 1c lw r18,(sp+28)
8016d0c: 2b 93 00 18 lw r19,(sp+24)
8016d10: 2b 94 00 14 lw r20,(sp+20)
8016d14: 2b 95 00 10 lw r21,(sp+16)
8016d18: 2b 96 00 0c lw r22,(sp+12)
8016d1c: 2b 97 00 08 lw r23,(sp+8)
8016d20: 37 9c 00 38 addi sp,sp,56
8016d24: c3 a0 00 00 ret
08019edc <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)
{
8019edc: 37 9c fe 84 addi sp,sp,-380 <== NOT EXECUTED
8019ee0: 5b 8b 00 44 sw (sp+68),r11 <== NOT EXECUTED
8019ee4: 5b 8c 00 40 sw (sp+64),r12 <== NOT EXECUTED
8019ee8: 5b 8d 00 3c sw (sp+60),r13 <== NOT EXECUTED
8019eec: 5b 8e 00 38 sw (sp+56),r14 <== NOT EXECUTED
8019ef0: 5b 8f 00 34 sw (sp+52),r15 <== NOT EXECUTED
8019ef4: 5b 90 00 30 sw (sp+48),r16 <== NOT EXECUTED
8019ef8: 5b 91 00 2c sw (sp+44),r17 <== NOT EXECUTED
8019efc: 5b 92 00 28 sw (sp+40),r18 <== NOT EXECUTED
8019f00: 5b 93 00 24 sw (sp+36),r19 <== NOT EXECUTED
8019f04: 5b 94 00 20 sw (sp+32),r20 <== NOT EXECUTED
8019f08: 5b 95 00 1c sw (sp+28),r21 <== NOT EXECUTED
8019f0c: 5b 96 00 18 sw (sp+24),r22 <== NOT EXECUTED
8019f10: 5b 97 00 14 sw (sp+20),r23 <== NOT EXECUTED
8019f14: 5b 98 00 10 sw (sp+16),r24 <== NOT EXECUTED
8019f18: 5b 99 00 0c sw (sp+12),r25 <== NOT EXECUTED
8019f1c: 5b 9b 00 08 sw (sp+8),fp <== NOT EXECUTED
8019f20: 5b 9d 00 04 sw (sp+4),ra <== 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;
8019f24: 28 34 00 14 lw r20,(r1+20) <== 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)
{
8019f28: b8 60 58 00 mv r11,r3 <== NOT EXECUTED
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
8019f2c: 28 23 00 20 lw r3,(r1+32) <== 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 :
8019f30: 2a 84 00 20 lw r4,(r20+32) <== 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)
{
8019f34: 5b 82 00 54 sw (sp+84),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;
8019f38: 28 71 00 08 lw r17,(r3+8) <== NOT EXECUTED
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
fat_file_fd_t *tmp_fat_fd = NULL;
8019f3c: 5b 80 01 7c sw (sp+380),r0 <== 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;
8019f40: 5b 80 01 78 sw (sp+376),r0 <== 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 :
8019f44: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
* the number of bytes read on success, or -1 if error occured (errno
* set apropriately).
*/
ssize_t
msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count)
{
8019f48: b8 20 98 00 mv r19,r1 <== 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);
8019f4c: 28 2c 00 04 lw r12,(r1+4) <== 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 :
8019f50: 5c 83 00 09 bne r4,r3,8019f74 <msdos_dir_read+0x98> <== 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) &&
8019f54: 2a 84 00 24 lw r4,(r20+36) <== NOT EXECUTED
8019f58: 5c 80 00 07 bne r4,r0,8019f74 <msdos_dir_read+0x98> <== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16))) ?
8019f5c: 42 23 00 0e lbu r3,(r17+14) <== NOT EXECUTED
8019f60: 20 63 00 03 andi r3,r3,0x3 <== 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) &&
8019f64: 44 64 00 04 be r3,r4,8019f74 <msdos_dir_read+0x98> <== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16))) ?
fat_fd->fat_file_size :
8019f68: 2a 81 00 18 lw r1,(r20+24) <== NOT EXECUTED
8019f6c: 5b 81 00 48 sw (sp+72),r1 <== NOT EXECUTED
8019f70: e0 00 00 03 bi 8019f7c <msdos_dir_read+0xa0> <== NOT EXECUTED
8019f74: 2e 22 00 06 lhu r2,(r17+6) <== NOT EXECUTED
8019f78: 5b 82 00 48 sw (sp+72),r2 <== NOT EXECUTED
fs_info->fat.vol.bpc;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
8019f7c: 2a 21 00 9c lw r1,(r17+156) <== NOT EXECUTED
8019f80: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
8019f84: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
8019f88: fb ff ae 3b calli 8005874 <rtems_semaphore_obtain> <== NOT EXECUTED
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
8019f8c: 5c 20 00 29 bne r1,r0,801a030 <msdos_dir_read+0x154> <== 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);
8019f90: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8019f94: 34 02 01 0c mvi r2,268 <== NOT EXECUTED
8019f98: f8 00 4d 80 calli 802d598 <__udivsi3> <== NOT EXECUTED
count = (count / sizeof(struct dirent)) * sizeof(struct dirent);
8019f9c: 34 02 01 0c mvi r2,268 <== 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);
8019fa0: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
count = (count / sizeof(struct dirent)) * sizeof(struct dirent);
8019fa4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8019fa8: f8 00 4d 7c calli 802d598 <__udivsi3> <== NOT EXECUTED
8019fac: 34 02 01 0c mvi r2,268 <== NOT EXECUTED
8019fb0: fb ff 9c dc calli 8001320 <__mulsi3> <== NOT EXECUTED
* copy base name to destination
*/
src_tmp = src;
len = i;
while (i-- > 0) {
*dst++ = tolower((unsigned char)(*src_tmp++));
8019fb4: 78 17 08 03 mvhi r23,0x803 <== NOT EXECUTED
8019fb8: 3a f7 02 78 ori r23,r23,0x278 <== 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);
8019fbc: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
8019fc0: 5b 94 00 4c sw (sp+76),r20 <== NOT EXECUTED
8019fc4: 5b 97 00 50 sw (sp+80),r23 <== NOT EXECUTED
8019fc8: b8 20 d8 00 mv fp,r1 <== NOT EXECUTED
8019fcc: 34 16 00 00 mvi r22,0 <== NOT EXECUTED
8019fd0: 34 12 00 00 mvi r18,0 <== NOT EXECUTED
8019fd4: 34 10 ff ff mvi r16,-1 <== NOT EXECUTED
8019fd8: 34 15 00 00 mvi r21,0 <== 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;
8019fdc: 34 19 ff ff mvi r25,-1 <== 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) &&
8019fe0: 34 18 00 20 mvi r24,32 <== NOT EXECUTED
8019fe4: b8 60 a0 00 mv r20,r3 <== NOT EXECUTED
8019fe8: ba 60 b8 00 mv r23,r19 <== NOT EXECUTED
8019fec: e0 00 00 da bi 801a354 <msdos_dir_read+0x478> <== 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),
8019ff0: 2b 82 00 4c lw r2,(sp+76) <== NOT EXECUTED
8019ff4: 2b 84 00 48 lw r4,(sp+72) <== NOT EXECUTED
8019ff8: 2a 25 00 a0 lw r5,(r17+160) <== NOT EXECUTED
8019ffc: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
801a000: ba c0 18 00 mv r3,r22 <== NOT EXECUTED
801a004: fb ff d4 be calli 800f2fc <fat_file_read> <== NOT EXECUTED
801a008: b8 20 98 00 mv r19,r1 <== NOT EXECUTED
bts2rd, fs_info->cl_buf);
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
801a00c: 34 01 00 1f mvi r1,31 <== NOT EXECUTED
801a010: 4c 33 00 06 bge r1,r19,801a028 <msdos_dir_read+0x14c> <== NOT EXECUTED
801a014: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED
801a018: 5b 93 00 58 sw (sp+88),r19 <== NOT EXECUTED
801a01c: b9 c0 78 00 mv r15,r14 <== NOT EXECUTED
801a020: b9 80 98 00 mv r19,r12 <== NOT EXECUTED
801a024: e0 00 00 c7 bi 801a340 <msdos_dir_read+0x464> <== NOT EXECUTED
{
rtems_semaphore_release(fs_info->vol_sema);
801a028: 2a 21 00 9c lw r1,(r17+156) <== NOT EXECUTED
801a02c: fb ff ae 62 calli 80059b4 <rtems_semaphore_release> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
801a030: f8 00 03 09 calli 801ac54 <__errno> <== NOT EXECUTED
801a034: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
801a038: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
801a03c: 34 0d ff ff mvi r13,-1 <== NOT EXECUTED
801a040: e0 00 00 c9 bi 801a364 <msdos_dir_read+0x488> <== NOT EXECUTED
}
for (i = 0; i < ret; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + i;
801a044: 2a 23 00 a0 lw r3,(r17+160) <== NOT EXECUTED
801a048: b4 6f 70 00 add r14,r3,r15 <== NOT EXECUTED
/*
* Is this directory from here on empty ?
*/
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
801a04c: 41 cc 00 00 lbu r12,(r14+0) <== NOT EXECUTED
801a050: 45 80 00 c2 be r12,r0,801a358 <msdos_dir_read+0x47c> <== 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)
801a054: 34 02 00 e5 mvi r2,229 <== NOT EXECUTED
801a058: 45 82 00 b9 be r12,r2,801a33c <msdos_dir_read+0x460> <== NOT EXECUTED
continue;
/* Is the directory entry empty a volume label */
if (((*MSDOS_DIR_ATTR(entry)) & MSDOS_ATTR_VOLUME_ID) &&
801a05c: 41 c3 00 0b lbu r3,(r14+11) <== NOT EXECUTED
801a060: 20 65 00 08 andi r5,r3,0x8 <== NOT EXECUTED
801a064: 44 a0 00 04 be r5,r0,801a074 <msdos_dir_read+0x198> <== NOT EXECUTED
((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) != MSDOS_ATTR_LFN))
801a068: 20 65 00 3f andi r5,r3,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) &&
801a06c: 34 01 00 0f mvi r1,15 <== NOT EXECUTED
801a070: 5c a1 00 b3 bne r5,r1,801a33c <msdos_dir_read+0x460> <== 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) ==
801a074: 20 63 00 3f andi r3,r3,0x3f <== NOT EXECUTED
801a078: 34 02 00 0f mvi r2,15 <== NOT EXECUTED
801a07c: 5c 62 00 36 bne r3,r2,801a154 <msdos_dir_read+0x278> <== NOT EXECUTED
int q;
/*
* Is this is the first entry of a LFN ?
*/
if (lfn_start == FAT_FILE_SHORT_NAME)
801a080: 5e 19 00 0d bne r16,r25,801a0b4 <msdos_dir_read+0x1d8> <== NOT EXECUTED
{
/*
* The first entry must have the last long entry flag set.
*/
if ((*MSDOS_DIR_ENTRY_TYPE(entry) &
801a084: 21 83 00 40 andi r3,r12,0x40 <== NOT EXECUTED
801a088: 44 60 00 ad be r3,r0,801a33c <msdos_dir_read+0x460> <== NOT EXECUTED
continue;
/*
* Remember the start location of the long file name.
*/
lfn_start =
801a08c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
801a090: b5 f6 08 00 add r1,r15,r22 <== NOT EXECUTED
801a094: f8 00 4c f1 calli 802d458 <__lshrsi3> <== NOT EXECUTED
801a098: b8 20 80 00 mv r16,r1 <== 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));
801a09c: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801a0a0: 37 81 00 68 addi r1,sp,104 <== NOT EXECUTED
801a0a4: 34 03 01 00 mvi r3,256 <== 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) &
801a0a8: 21 92 00 3f andi r18,r12,0x3f <== NOT EXECUTED
MSDOS_LAST_LONG_ENTRY_MASK);
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
801a0ac: 41 d4 00 0d lbu r20,(r14+13) <== NOT EXECUTED
memset (tmp_dirent.d_name, 0, sizeof(tmp_dirent.d_name));
801a0b0: f8 00 06 78 calli 801ba90 <memset> <== NOT EXECUTED
* If the entry number or the check sum do not match
* forget this series of long directory entries. These could
* be orphaned entries depending on the history of the
* disk.
*/
if ((lfn_entries != (*MSDOS_DIR_ENTRY_TYPE(entry) &
801a0b4: 41 c3 00 00 lbu r3,(r14+0) <== NOT EXECUTED
801a0b8: 20 63 00 3f andi r3,r3,0x3f <== NOT EXECUTED
801a0bc: 5e 43 00 9f bne r18,r3,801a338 <msdos_dir_read+0x45c> <== NOT EXECUTED
MSDOS_LAST_LONG_ENTRY_MASK)) ||
801a0c0: 41 c3 00 0d lbu r3,(r14+13) <== NOT EXECUTED
801a0c4: 5c 74 00 9d bne r3,r20,801a338 <msdos_dir_read+0x45c> <== 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--;
801a0c8: 36 52 ff ff addi r18,r18,-1 <== NOT EXECUTED
p = entry + 1;
o = lfn_entries * MSDOS_LFN_LEN_PER_ENTRY;
801a0cc: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
801a0d0: ba 40 08 00 mv r1,r18 <== NOT EXECUTED
801a0d4: fb ff 9c 45 calli 80011e8 <__ashlsi3> <== NOT EXECUTED
801a0d8: b4 32 08 00 add r1,r1,r18 <== NOT EXECUTED
801a0dc: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801a0e0: fb ff 9c 42 calli 80011e8 <__ashlsi3> <== NOT EXECUTED
801a0e4: b4 32 38 00 add r7,r1,r18 <== 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)
801a0e8: 37 81 00 5c addi r1,sp,92 <== NOT EXECUTED
801a0ec: b4 27 18 00 add r3,r1,r7 <== NOT EXECUTED
* trailing nul character. We need to range check the length to
* fit in the directory entry name field.
*/
lfn_entries--;
p = entry + 1;
801a0f0: 35 cb 00 01 addi r11,r14,1 <== 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)
801a0f4: 34 68 00 0c addi r8,r3,12 <== 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++)
801a0f8: 34 06 00 00 mvi r6,0 <== NOT EXECUTED
{
if (o >= (sizeof(tmp_dirent.d_name) - 1))
801a0fc: 34 02 00 fe mvi r2,254 <== NOT EXECUTED
801a100: 54 e2 00 8f bgu r7,r2,801a33c <msdos_dir_read+0x460> <== NOT EXECUTED
break;
tmp_dirent.d_name[o++] = *p;
801a104: 41 61 00 00 lbu r1,(r11+0) <== NOT EXECUTED
801a108: 31 01 00 00 sb (r8+0),r1 <== NOT EXECUTED
if (*p == '\0')
801a10c: 41 61 00 00 lbu r1,(r11+0) <== NOT EXECUTED
801a110: 44 20 00 8b be r1,r0,801a33c <msdos_dir_read+0x460> <== NOT EXECUTED
break;
switch (q)
801a114: 34 01 00 04 mvi r1,4 <== NOT EXECUTED
801a118: 44 c1 00 04 be r6,r1,801a128 <msdos_dir_read+0x24c> <== NOT EXECUTED
801a11c: 34 02 00 0a mvi r2,10 <== NOT EXECUTED
801a120: 5c c2 00 06 bne r6,r2,801a138 <msdos_dir_read+0x25c> <== NOT EXECUTED
801a124: e0 00 00 03 bi 801a130 <msdos_dir_read+0x254> <== NOT EXECUTED
{
case 4:
p += 5;
801a128: 35 6b 00 05 addi r11,r11,5 <== NOT EXECUTED
break;
801a12c: e0 00 00 04 bi 801a13c <msdos_dir_read+0x260> <== NOT EXECUTED
case 10:
p += 4;
801a130: 35 6b 00 04 addi r11,r11,4 <== NOT EXECUTED
break;
801a134: e0 00 00 02 bi 801a13c <msdos_dir_read+0x260> <== NOT EXECUTED
default:
p += 2;
801a138: 35 6b 00 02 addi r11,r11,2 <== 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++)
801a13c: 34 c6 00 01 addi r6,r6,1 <== NOT EXECUTED
801a140: 34 01 00 0d mvi r1,13 <== NOT EXECUTED
801a144: 35 08 00 01 addi r8,r8,1 <== NOT EXECUTED
801a148: 44 c1 00 7d be r6,r1,801a33c <msdos_dir_read+0x460> <== NOT EXECUTED
{
if (o >= (sizeof(tmp_dirent.d_name) - 1))
break;
tmp_dirent.d_name[o++] = *p;
801a14c: 34 e7 00 01 addi r7,r7,1 <== NOT EXECUTED
801a150: e3 ff ff eb bi 801a0fc <msdos_dir_read+0x220> <== NOT EXECUTED
fat_dir_pos_t dir_pos;
/*
* Skip active entries until get the entry to start from.
*/
if (start)
801a154: 46 60 00 03 be r19,r0,801a160 <msdos_dir_read+0x284> <== NOT EXECUTED
{
lfn_start = FAT_FILE_SHORT_NAME;
start--;
801a158: 36 73 ff ff addi r19,r19,-1 <== NOT EXECUTED
801a15c: e0 00 00 77 bi 801a338 <msdos_dir_read+0x45c> <== 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,
801a160: 2b 82 00 4c lw r2,(sp+76) <== NOT EXECUTED
801a164: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
801a168: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
801a16c: ba c0 20 00 mv r4,r22 <== NOT EXECUTED
801a170: 37 85 01 78 addi r5,sp,376 <== NOT EXECUTED
801a174: fb ff d5 67 calli 800f710 <fat_file_ioctl> <== NOT EXECUTED
801a178: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
j * bts2rd, &cur_cln);
if (rc != RC_OK)
801a17c: 5c 33 00 68 bne r1,r19,801a31c <msdos_dir_read+0x440> <== NOT EXECUTED
rtems_semaphore_release(fs_info->vol_sema);
return rc;
}
fat_dir_pos_init(&dir_pos);
dir_pos.sname.cln = cur_cln;
801a180: 2b 83 01 78 lw r3,(sp+376) <== NOT EXECUTED
dir_pos.sname.ofs = i;
rc = fat_file_open(&fs_info->fat, &dir_pos, &tmp_fat_fd);
801a184: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
801a188: 37 82 01 68 addi r2,sp,360 <== NOT EXECUTED
rtems_semaphore_release(fs_info->vol_sema);
return rc;
}
fat_dir_pos_init(&dir_pos);
dir_pos.sname.cln = cur_cln;
801a18c: 5b 83 01 68 sw (sp+360),r3 <== NOT EXECUTED
dir_pos.sname.ofs = i;
rc = fat_file_open(&fs_info->fat, &dir_pos, &tmp_fat_fd);
801a190: 37 83 01 7c addi r3,sp,380 <== NOT EXECUTED
801a194: 5b 99 01 70 sw (sp+368),r25 <== NOT EXECUTED
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
801a198: 5b 99 01 74 sw (sp+372),r25 <== NOT EXECUTED
return rc;
}
fat_dir_pos_init(&dir_pos);
dir_pos.sname.cln = cur_cln;
dir_pos.sname.ofs = i;
801a19c: 5b 8f 01 6c sw (sp+364),r15 <== NOT EXECUTED
rc = fat_file_open(&fs_info->fat, &dir_pos, &tmp_fat_fd);
801a1a0: fb ff d3 f1 calli 800f164 <fat_file_open> <== NOT EXECUTED
801a1a4: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
if (rc != RC_OK)
801a1a8: 5c 20 00 5d bne r1,r0,801a31c <msdos_dir_read+0x440> <== 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;
801a1ac: 2b 83 01 7c lw r3,(sp+380) <== 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);
801a1b0: 34 02 01 0c mvi r2,268 <== 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;
801a1b4: 5b 95 00 60 sw (sp+96),r21 <== NOT EXECUTED
tmp_dirent.d_reclen = sizeof(struct dirent);
tmp_dirent.d_ino = tmp_fat_fd->ino;
801a1b8: 28 63 00 0c lw 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);
801a1bc: 0f 82 00 64 sh (sp+100),r2 <== NOT EXECUTED
tmp_dirent.d_ino = tmp_fat_fd->ino;
801a1c0: 5b 83 00 5c sw (sp+92),r3 <== 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)
801a1c4: 46 19 00 16 be r16,r25,801a21c <msdos_dir_read+0x340> <== NOT EXECUTED
801a1c8: 34 06 00 00 mvi r6,0 <== NOT EXECUTED
801a1cc: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
801a1d0: b8 c0 08 00 mv r1,r6 <== 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;
801a1d4: 20 22 00 01 andi r2,r1,0x1 <== NOT EXECUTED
801a1d8: 34 0b 00 00 mvi r11,0 <== NOT EXECUTED
801a1dc: 44 40 00 02 be r2,r0,801a1e4 <msdos_dir_read+0x308> <== NOT EXECUTED
801a1e0: 34 0b 00 80 mvi r11,128 <== NOT EXECUTED
801a1e4: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
801a1e8: f8 00 4c 9c calli 802d458 <__lshrsi3> <== 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)
801a1ec: b5 cc 10 00 add r2,r14,r12 <== 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;
801a1f0: 40 42 00 00 lbu r2,(r2+0) <== NOT EXECUTED
{
uint8_t cs = 0;
uint8_t* p = (uint8_t*) entry;
int i;
for (i = 0; i < 11; i++, p++)
801a1f4: 35 8c 00 01 addi r12,r12,1 <== NOT EXECUTED
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
801a1f8: b4 22 08 00 add r1,r1,r2 <== NOT EXECUTED
801a1fc: b4 2b 08 00 add r1,r1,r11 <== NOT EXECUTED
{
uint8_t cs = 0;
uint8_t* p = (uint8_t*) entry;
int i;
for (i = 0; i < 11; i++, p++)
801a200: 34 02 00 0b mvi r2,11 <== NOT EXECUTED
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
801a204: 20 21 00 ff andi r1,r1,0xff <== NOT EXECUTED
{
uint8_t cs = 0;
uint8_t* p = (uint8_t*) entry;
int i;
for (i = 0; i < 11; i++, p++)
801a208: 5d 82 ff f3 bne r12,r2,801a1d4 <msdos_dir_read+0x2f8> <== NOT EXECUTED
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
if (lfn_entries || (lfn_checksum != cs))
801a20c: fe 81 58 00 cmpne r11,r20,r1 <== NOT EXECUTED
801a210: 7e 45 00 00 cmpnei r5,r18,0 <== NOT EXECUTED
801a214: b9 65 58 00 or r11,r11,r5 <== NOT EXECUTED
801a218: 45 60 00 67 be r11,r0,801a3b4 <msdos_dir_read+0x4d8> <== NOT EXECUTED
/*
* find last non-blank character of base name
*/
for ((i = MSDOS_SHORT_BASE_LEN ,
src_tmp = src + MSDOS_SHORT_BASE_LEN-1);
801a21c: 35 c5 00 07 addi r5,r14,7 <== NOT EXECUTED
const char *src_tmp;
/*
* find last non-blank character of base name
*/
for ((i = MSDOS_SHORT_BASE_LEN ,
801a220: 34 08 00 08 mvi r8,8 <== NOT EXECUTED
801a224: e0 00 00 04 bi 801a234 <msdos_dir_read+0x358> <== NOT EXECUTED
src_tmp = src + MSDOS_SHORT_BASE_LEN-1);
((i > 0) &&
(*src_tmp == ' '));
i--,src_tmp--)
801a228: 35 08 ff ff addi r8,r8,-1 <== NOT EXECUTED
const char *src_tmp;
/*
* find last non-blank character of base name
*/
for ((i = MSDOS_SHORT_BASE_LEN ,
801a22c: 45 00 00 04 be r8,r0,801a23c <msdos_dir_read+0x360> <== NOT EXECUTED
src_tmp = src + MSDOS_SHORT_BASE_LEN-1);
((i > 0) &&
(*src_tmp == ' '));
i--,src_tmp--)
801a230: 34 a5 ff ff addi r5,r5,-1 <== 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) &&
801a234: 40 a1 00 00 lbu r1,(r5+0) <== NOT EXECUTED
801a238: 44 38 ff fc be r1,r24,801a228 <msdos_dir_read+0x34c> <== NOT EXECUTED
* copy base name to destination
*/
src_tmp = src;
len = i;
while (i-- > 0) {
*dst++ = tolower((unsigned char)(*src_tmp++));
801a23c: 2b 81 00 50 lw r1,(sp+80) <== NOT EXECUTED
801a240: b9 00 30 00 mv r6,r8 <== NOT EXECUTED
801a244: b9 c0 48 00 mv r9,r14 <== NOT EXECUTED
801a248: 28 2b 00 00 lw r11,(r1+0) <== NOT EXECUTED
{
/*
* convert dir entry from fixed 8+3 format (without dot)
* to 0..8 + 1dot + 0..3 format
*/
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
801a24c: 37 87 00 68 addi r7,sp,104 <== NOT EXECUTED
* copy base name to destination
*/
src_tmp = src;
len = i;
while (i-- > 0) {
*dst++ = tolower((unsigned char)(*src_tmp++));
801a250: 34 0a 00 01 mvi r10,1 <== NOT EXECUTED
801a254: e0 00 00 0b bi 801a280 <msdos_dir_read+0x3a4> <== NOT EXECUTED
801a258: 41 22 00 00 lbu r2,(r9+0) <== NOT EXECUTED
801a25c: 35 29 00 01 addi r9,r9,1 <== NOT EXECUTED
801a260: b5 62 08 00 add r1,r11,r2 <== NOT EXECUTED
801a264: 40 21 00 01 lbu r1,(r1+1) <== NOT EXECUTED
801a268: 20 21 00 03 andi r1,r1,0x3 <== NOT EXECUTED
801a26c: 5c 2a 00 02 bne r1,r10,801a274 <msdos_dir_read+0x398> <== NOT EXECUTED
801a270: 34 42 00 20 addi r2,r2,32 <== NOT EXECUTED
801a274: 30 e2 00 00 sb (r7+0),r2 <== NOT EXECUTED
801a278: 34 c6 ff ff addi r6,r6,-1 <== NOT EXECUTED
801a27c: 34 e7 00 01 addi r7,r7,1 <== NOT EXECUTED
/*
* copy base name to destination
*/
src_tmp = src;
len = i;
while (i-- > 0) {
801a280: 48 c0 ff f6 bg r6,r0,801a258 <msdos_dir_read+0x37c> <== 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) &&
801a284: 41 c5 00 0a lbu r5,(r14+10) <== NOT EXECUTED
801a288: 5c b8 00 4f bne r5,r24,801a3c4 <msdos_dir_read+0x4e8> <== NOT EXECUTED
801a28c: 41 c5 00 09 lbu r5,(r14+9) <== NOT EXECUTED
(*src_tmp == ' '));
i--,src_tmp--)
801a290: 35 c6 00 09 addi r6,r14,9 <== 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) &&
801a294: 5c b8 00 4e bne r5,r24,801a3cc <msdos_dir_read+0x4f0> <== NOT EXECUTED
801a298: 40 c5 ff ff lbu r5,(r6+-1) <== NOT EXECUTED
801a29c: 34 09 00 01 mvi r9,1 <== NOT EXECUTED
801a2a0: 44 b8 00 0f be r5,r24,801a2dc <msdos_dir_read+0x400> <== NOT EXECUTED
801a2a4: e0 00 00 4b bi 801a3d0 <msdos_dir_read+0x4f4> <== 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++));
801a2a8: 41 62 00 00 lbu r2,(r11+0) <== NOT EXECUTED
801a2ac: 35 6b 00 01 addi r11,r11,1 <== NOT EXECUTED
801a2b0: b5 82 08 00 add r1,r12,r2 <== NOT EXECUTED
801a2b4: 40 21 00 01 lbu r1,(r1+1) <== NOT EXECUTED
801a2b8: 20 21 00 03 andi r1,r1,0x3 <== NOT EXECUTED
801a2bc: 5c 2a 00 02 bne r1,r10,801a2c4 <msdos_dir_read+0x3e8> <== NOT EXECUTED
801a2c0: 34 42 00 20 addi r2,r2,32 <== NOT EXECUTED
801a2c4: 30 e2 00 00 sb (r7+0),r2 <== NOT EXECUTED
801a2c8: 34 c6 00 01 addi r6,r6,1 <== NOT EXECUTED
801a2cc: 34 e7 00 01 addi r7,r7,1 <== 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)
801a2d0: c9 26 08 00 sub r1,r9,r6 <== NOT EXECUTED
801a2d4: b4 cd 40 00 add r8,r6,r13 <== NOT EXECUTED
*/
if (i > 0) {
*dst++ = '.'; /* append dot */
len += i + 1; /* extension + dot */
src_tmp = src + MSDOS_SHORT_BASE_LEN;
while (i-- > 0) {
801a2d8: 48 20 ff f4 bg r1,r0,801a2a8 <msdos_dir_read+0x3cc> <== NOT EXECUTED
*dst++ = tolower((unsigned char)(*src_tmp++));
len++;
}
}
*dst = '\0'; /* terminate string */
801a2dc: 30 e0 00 00 sb (r7+0),r0 <== NOT EXECUTED
{
/*
* convert dir entry from fixed 8+3 format (without dot)
* to 0..8 + 1dot + 0..3 format
*/
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
801a2e0: 0f 88 00 66 sh (sp+102),r8 <== NOT EXECUTED
801a2e4: 34 10 ff ff mvi r16,-1 <== NOT EXECUTED
else
{
tmp_dirent.d_namlen = strlen(tmp_dirent.d_name);
}
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
801a2e8: 2b 82 00 54 lw r2,(sp+84) <== NOT EXECUTED
801a2ec: 34 03 01 0c mvi r3,268 <== NOT EXECUTED
801a2f0: b4 55 08 00 add r1,r2,r21 <== NOT EXECUTED
801a2f4: 37 82 00 5c addi r2,sp,92 <== NOT EXECUTED
801a2f8: f8 00 05 a5 calli 801b98c <memcpy> <== NOT EXECUTED
iop->offset = iop->offset + sizeof(struct dirent);
801a2fc: 2a e3 00 04 lw r3,(r23+4) <== 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);
801a300: 2b 82 01 7c lw r2,(sp+380) <== NOT EXECUTED
801a304: ba 20 08 00 mv r1,r17 <== 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);
801a308: 34 63 01 0c addi r3,r3,268 <== NOT EXECUTED
801a30c: 5a e3 00 04 sw (r23+4),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);
801a310: fb ff d4 ce calli 800f648 <fat_file_close> <== NOT EXECUTED
801a314: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
if (rc != RC_OK)
801a318: 44 20 00 04 be r1,r0,801a328 <msdos_dir_read+0x44c> <== NOT EXECUTED
{
rtems_semaphore_release(fs_info->vol_sema);
801a31c: 2a 21 00 9c lw r1,(r17+156) <== NOT EXECUTED
801a320: fb ff ad a5 calli 80059b4 <rtems_semaphore_release> <== NOT EXECUTED
return rc;
801a324: e0 00 00 10 bi 801a364 <msdos_dir_read+0x488> <== NOT EXECUTED
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
iop->offset = iop->offset + sizeof(struct dirent);
cmpltd += (sizeof(struct dirent));
count -= (sizeof(struct dirent));
801a328: 37 7b fe f4 addi fp,fp,-268 <== NOT EXECUTED
}
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
iop->offset = iop->offset + sizeof(struct dirent);
cmpltd += (sizeof(struct dirent));
801a32c: 36 b5 01 0c addi r21,r21,268 <== NOT EXECUTED
rtems_semaphore_release(fs_info->vol_sema);
return rc;
}
}
if (count <= 0)
801a330: 5f 61 00 03 bne fp,r1,801a33c <msdos_dir_read+0x460> <== NOT EXECUTED
801a334: e0 00 00 05 bi 801a348 <msdos_dir_read+0x46c> <== 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;
801a338: 34 10 ff ff mvi r16,-1 <== 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)
801a33c: 35 ef 00 20 addi r15,r15,32 <== NOT EXECUTED
801a340: 2b 81 00 58 lw r1,(sp+88) <== NOT EXECUTED
801a344: 54 2f ff 40 bgu r1,r15,801a044 <msdos_dir_read+0x168> <== NOT EXECUTED
801a348: 2b 82 00 48 lw r2,(sp+72) <== NOT EXECUTED
801a34c: ba 60 60 00 mv r12,r19 <== NOT EXECUTED
801a350: b6 c2 b0 00 add r22,r22,r2 <== 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)
801a354: 5f 60 ff 27 bne fp,r0,8019ff0 <msdos_dir_read+0x114> <== NOT EXECUTED
break;
}
j++;
}
rtems_semaphore_release(fs_info->vol_sema);
801a358: 2a 21 00 9c lw r1,(r17+156) <== NOT EXECUTED
return cmpltd;
801a35c: ba a0 68 00 mv r13,r21 <== NOT EXECUTED
break;
}
j++;
}
rtems_semaphore_release(fs_info->vol_sema);
801a360: fb ff ad 95 calli 80059b4 <rtems_semaphore_release> <== NOT EXECUTED
return cmpltd;
}
801a364: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
801a368: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
801a36c: 2b 8b 00 44 lw r11,(sp+68) <== NOT EXECUTED
801a370: 2b 8c 00 40 lw r12,(sp+64) <== NOT EXECUTED
801a374: 2b 8d 00 3c lw r13,(sp+60) <== NOT EXECUTED
801a378: 2b 8e 00 38 lw r14,(sp+56) <== NOT EXECUTED
801a37c: 2b 8f 00 34 lw r15,(sp+52) <== NOT EXECUTED
801a380: 2b 90 00 30 lw r16,(sp+48) <== NOT EXECUTED
801a384: 2b 91 00 2c lw r17,(sp+44) <== NOT EXECUTED
801a388: 2b 92 00 28 lw r18,(sp+40) <== NOT EXECUTED
801a38c: 2b 93 00 24 lw r19,(sp+36) <== NOT EXECUTED
801a390: 2b 94 00 20 lw r20,(sp+32) <== NOT EXECUTED
801a394: 2b 95 00 1c lw r21,(sp+28) <== NOT EXECUTED
801a398: 2b 96 00 18 lw r22,(sp+24) <== NOT EXECUTED
801a39c: 2b 97 00 14 lw r23,(sp+20) <== NOT EXECUTED
801a3a0: 2b 98 00 10 lw r24,(sp+16) <== NOT EXECUTED
801a3a4: 2b 99 00 0c lw r25,(sp+12) <== NOT EXECUTED
801a3a8: 2b 9b 00 08 lw fp,(sp+8) <== NOT EXECUTED
801a3ac: 37 9c 01 7c addi sp,sp,380 <== NOT EXECUTED
801a3b0: c3 a0 00 00 ret <== 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);
801a3b4: 37 81 00 68 addi r1,sp,104 <== NOT EXECUTED
801a3b8: f8 00 0a 2b calli 801cc64 <strlen> <== NOT EXECUTED
801a3bc: 0f 81 00 66 sh (sp+102),r1 <== NOT EXECUTED
801a3c0: e3 ff ff ca bi 801a2e8 <msdos_dir_read+0x40c> <== NOT EXECUTED
*dst++ = tolower((unsigned char)(*src_tmp++));
}
/*
* find last non-blank character of extension
*/
for ((i = MSDOS_SHORT_EXT_LEN ,
801a3c4: 34 09 00 03 mvi r9,3 <== NOT EXECUTED
801a3c8: e0 00 00 02 bi 801a3d0 <msdos_dir_read+0x4f4> <== NOT EXECUTED
src_tmp = src + MSDOS_SHORT_BASE_LEN+MSDOS_SHORT_EXT_LEN-1);
((i > 0) &&
(*src_tmp == ' '));
i--,src_tmp--)
801a3cc: 34 09 00 02 mvi r9,2 <== NOT EXECUTED
{};
/*
* extension is not empty
*/
if (i > 0) {
*dst++ = '.'; /* append dot */
801a3d0: 34 01 00 2e mvi r1,46 <== NOT EXECUTED
801a3d4: 30 e1 00 00 sb (r7+0),r1 <== NOT EXECUTED
len += i + 1; /* extension + dot */
src_tmp = src + MSDOS_SHORT_BASE_LEN;
while (i-- > 0) {
*dst++ = tolower((unsigned char)(*src_tmp++));
801a3d8: 2b 82 00 50 lw r2,(sp+80) <== NOT EXECUTED
/*
* extension is not empty
*/
if (i > 0) {
*dst++ = '.'; /* append dot */
len += i + 1; /* extension + dot */
801a3dc: 35 03 00 01 addi r3,r8,1 <== NOT EXECUTED
{};
/*
* extension is not empty
*/
if (i > 0) {
*dst++ = '.'; /* append dot */
801a3e0: 34 e7 00 01 addi r7,r7,1 <== NOT EXECUTED
len += i + 1; /* extension + dot */
801a3e4: b4 69 68 00 add r13,r3,r9 <== NOT EXECUTED
src_tmp = src + MSDOS_SHORT_BASE_LEN;
801a3e8: 35 cb 00 08 addi r11,r14,8 <== NOT EXECUTED
while (i-- > 0) {
*dst++ = tolower((unsigned char)(*src_tmp++));
801a3ec: 28 4c 00 00 lw r12,(r2+0) <== NOT EXECUTED
801a3f0: 34 06 00 00 mvi r6,0 <== NOT EXECUTED
801a3f4: 34 0a 00 01 mvi r10,1 <== NOT EXECUTED
801a3f8: e3 ff ff b6 bi 801a2d0 <msdos_dir_read+0x3f4> <== NOT EXECUTED
0801a3fc <msdos_dir_stat>:
int
msdos_dir_stat(
const rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
801a3fc: 37 9c ff f0 addi sp,sp,-16
801a400: 5b 8b 00 10 sw (sp+16),r11
801a404: 5b 8c 00 0c sw (sp+12),r12
801a408: 5b 8d 00 08 sw (sp+8),r13
801a40c: 5b 9d 00 04 sw (sp+4),ra
801a410: b8 40 58 00 mv r11,r2
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
801a414: 28 22 00 14 lw r2,(r1+20)
fat_file_fd_t *fat_fd = loc->node_access;
801a418: 28 2c 00 08 lw r12,(r1+8)
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
801a41c: 34 03 00 00 mvi r3,0
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;
801a420: 28 4d 00 08 lw r13,(r2+8)
fat_file_fd_t *fat_fd = loc->node_access;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
801a424: 34 02 00 00 mvi r2,0
801a428: 29 a1 00 9c lw r1,(r13+156)
801a42c: fb ff ad 12 calli 8005874 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
801a430: 44 20 00 06 be r1,r0,801a448 <msdos_dir_stat+0x4c> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EIO);
801a434: f8 00 02 08 calli 801ac54 <__errno> <== NOT EXECUTED
801a438: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
801a43c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
801a440: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
801a444: e0 00 00 18 bi 801a4a4 <msdos_dir_stat+0xa8> <== NOT EXECUTED
static inline dev_t rtems_disk_get_device_identifier(
const rtems_disk_device *dd
)
{
return dd->dev;
801a448: 29 a1 00 64 lw r1,(r13+100)
buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
801a44c: 28 22 00 00 lw r2,(r1+0)
801a450: 59 62 00 00 sw (r11+0),r2
801a454: 28 21 00 04 lw r1,(r1+4)
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;
buf->st_blocks = fat_fd->fat_file_size >> FAT_SECTOR512_BITS;
801a458: 34 02 00 09 mvi r2,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);
801a45c: 59 61 00 04 sw (r11+4),r1
buf->st_ino = fat_fd->ino;
801a460: 29 81 00 0c lw r1,(r12+12)
buf->st_mode = S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO;
buf->st_rdev = 0ll;
801a464: 59 60 00 18 sw (r11+24),r0
801a468: 59 60 00 1c sw (r11+28),r0
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;
801a46c: 59 61 00 08 sw (r11+8),r1
buf->st_mode = S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO;
801a470: 34 01 41 ff mvi r1,16895
801a474: 59 61 00 0c sw (r11+12),r1
buf->st_rdev = 0ll;
buf->st_size = fat_fd->fat_file_size;
801a478: 29 81 00 18 lw r1,(r12+24)
801a47c: 59 61 00 20 sw (r11+32),r1
buf->st_blocks = fat_fd->fat_file_size >> FAT_SECTOR512_BITS;
801a480: f8 00 4b f6 calli 802d458 <__lshrsi3>
801a484: 59 61 00 40 sw (r11+64),r1
buf->st_blksize = fs_info->fat.vol.bps;
801a488: 2d a1 00 00 lhu r1,(r13+0)
801a48c: 59 61 00 3c sw (r11+60),r1
buf->st_mtime = fat_fd->mtime;
801a490: 29 81 00 40 lw r1,(r12+64)
801a494: 59 61 00 2c sw (r11+44),r1
rtems_semaphore_release(fs_info->vol_sema);
801a498: 29 a1 00 9c lw r1,(r13+156)
801a49c: fb ff ad 46 calli 80059b4 <rtems_semaphore_release>
return RC_OK;
801a4a0: 34 01 00 00 mvi r1,0
}
801a4a4: 2b 9d 00 04 lw ra,(sp+4)
801a4a8: 2b 8b 00 10 lw r11,(sp+16)
801a4ac: 2b 8c 00 0c lw r12,(sp+12)
801a4b0: 2b 8d 00 08 lw r13,(sp+8)
801a4b4: 37 9c 00 10 addi sp,sp,16
801a4b8: c3 a0 00 00 ret
08016270 <msdos_eval_token>:
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
8016270: 37 9c ff f8 addi sp,sp,-8
8016274: 5b 8b 00 08 sw (sp+8),r11
8016278: 5b 9d 00 04 sw (sp+4),ra
801627c: b8 20 58 00 mv r11,r1
static inline bool rtems_filesystem_is_current_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 1 && token [0] == '.';
8016280: 34 01 00 01 mvi r1,1
8016284: b8 60 10 00 mv r2,r3
8016288: 5c 81 00 1f bne r4,r1,8016304 <msdos_eval_token+0x94>
801628c: 40 63 00 00 lbu r3,(r3+0)
8016290: 34 01 00 2e mvi r1,46
8016294: 5c 61 00 1c bne r3,r1,8016304 <msdos_eval_token+0x94>
static inline void rtems_filesystem_eval_path_clear_token(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->tokenlen = 0;
8016298: 59 60 00 0c sw (r11+12),r0
rtems_filesystem_eval_path_generic_status status =
RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
if (rtems_filesystem_is_current_directory(token, tokenlen)) {
rtems_filesystem_eval_path_clear_token(ctx);
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
801629c: 34 01 00 00 mvi r1,0
80162a0: e0 00 00 15 bi 80162f4 <msdos_eval_token+0x84>
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)
80162a4: 29 63 00 20 lw r3,(r11+32)
* None
*/
static void
msdos_set_handlers(rtems_filesystem_location_info_t *loc)
{
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
80162a8: 29 61 00 2c lw r1,(r11+44)
80162ac: 59 60 00 0c sw (r11+12),r0
fat_file_fd_t *fat_fd = loc->node_access;
if (fat_fd->fat_file_type == FAT_DIRECTORY)
80162b0: 28 63 00 10 lw r3,(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;
80162b4: 28 21 00 08 lw r1,(r1+8)
fat_file_fd_t *fat_fd = loc->node_access;
if (fat_fd->fat_file_type == FAT_DIRECTORY)
80162b8: 5c 62 00 03 bne r3,r2,80162c4 <msdos_eval_token+0x54>
loc->handlers = fs_info->directory_handlers;
80162bc: 28 21 00 94 lw r1,(r1+148)
80162c0: e0 00 00 02 bi 80162c8 <msdos_eval_token+0x58>
else
loc->handlers = fs_info->file_handlers;
80162c4: 28 21 00 98 lw r1,(r1+152)
80162c8: 59 61 00 28 sw (r11+40),r1
rtems_filesystem_eval_path_generic_status status =
RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
if (rtems_filesystem_is_current_directory(token, tokenlen)) {
rtems_filesystem_eval_path_clear_token(ctx);
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
80162cc: 29 61 00 04 lw r1,(r11+4)
80162d0: 64 21 00 00 cmpei r1,r1,0
80162d4: e0 00 00 08 bi 80162f4 <msdos_eval_token+0x84>
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) {
80162d8: 34 03 7d 01 mvi r3,32001
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY;
80162dc: 34 01 00 02 mvi r1,2
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) {
80162e0: 44 43 00 05 be r2,r3,80162f4 <msdos_eval_token+0x84> <== ALWAYS TAKEN
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY;
} else {
rtems_filesystem_eval_path_error(ctx, 0);
80162e4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
80162e8: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
80162ec: fb ff b8 46 calli 8004404 <rtems_filesystem_eval_path_error><== NOT EXECUTED
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
80162f0: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
rtems_filesystem_eval_path_error(ctx, 0);
}
}
return status;
}
80162f4: 2b 9d 00 04 lw ra,(sp+4)
80162f8: 2b 8b 00 08 lw r11,(sp+8)
80162fc: 37 9c 00 08 addi sp,sp,8
8016300: c3 a0 00 00 ret
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);
8016304: 35 61 00 18 addi r1,r11,24
8016308: b8 80 18 00 mv r3,r4
801630c: f8 00 07 6a calli 80180b4 <msdos_find_name>
8016310: b8 20 10 00 mv r2,r1
if (rc == RC_OK) {
8016314: 5c 20 ff f1 bne r1,r0,80162d8 <msdos_eval_token+0x68>
8016318: e3 ff ff e3 bi 80162a4 <msdos_eval_token+0x34>
0801a534 <msdos_file_close>:
* RC_OK, if file closed successfully, or -1 if error occured (errno set
* appropriately)
*/
int
msdos_file_close(rtems_libio_t *iop)
{
801a534: 37 9c ff f4 addi sp,sp,-12
801a538: 5b 8b 00 0c sw (sp+12),r11
801a53c: 5b 8c 00 08 sw (sp+8),r12
801a540: 5b 9d 00 04 sw (sp+4),ra
801a544: b8 20 58 00 mv r11,r1
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
801a548: 28 21 00 20 lw r1,(r1+32)
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
801a54c: 34 02 00 00 mvi r2,0
801a550: 34 03 00 00 mvi r3,0
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;
801a554: 28 2c 00 08 lw r12,(r1+8)
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
801a558: 29 81 00 9c lw r1,(r12+156)
801a55c: fb ff ac c6 calli 8005874 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
801a560: 44 20 00 06 be r1,r0,801a578 <msdos_file_close+0x44> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EIO);
801a564: f8 00 01 bc calli 801ac54 <__errno> <== NOT EXECUTED
801a568: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
801a56c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
801a570: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED
801a574: e0 00 00 06 bi 801a58c <msdos_file_close+0x58> <== NOT EXECUTED
rc = msdos_file_update(iop);
801a578: b9 60 08 00 mv r1,r11
801a57c: fb ff ff d0 calli 801a4bc <msdos_file_update>
801a580: b8 20 58 00 mv r11,r1
rtems_semaphore_release(fs_info->vol_sema);
801a584: 29 81 00 9c lw r1,(r12+156)
801a588: fb ff ad 0b calli 80059b4 <rtems_semaphore_release>
return rc;
}
801a58c: b9 60 08 00 mv r1,r11
801a590: 2b 9d 00 04 lw ra,(sp+4)
801a594: 2b 8b 00 0c lw r11,(sp+12)
801a598: 2b 8c 00 08 lw r12,(sp+8)
801a59c: 37 9c 00 0c addi sp,sp,12
801a5a0: c3 a0 00 00 ret
0801a820 <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)
{
801a820: 37 9c ff e4 addi sp,sp,-28
801a824: 5b 8b 00 18 sw (sp+24),r11
801a828: 5b 8c 00 14 sw (sp+20),r12
801a82c: 5b 8d 00 10 sw (sp+16),r13
801a830: 5b 8e 00 0c sw (sp+12),r14
801a834: 5b 8f 00 08 sw (sp+8),r15
801a838: 5b 9d 00 04 sw (sp+4),ra
801a83c: b8 40 70 00 mv r14,r2
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
801a840: 28 22 00 20 lw r2,(r1+32)
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
801a844: 28 2d 00 14 lw r13,(r1+20)
uint32_t old_length;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
801a848: 34 03 00 00 mvi r3,0
int
msdos_file_ftruncate(rtems_libio_t *iop, off_t length)
{
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
801a84c: 28 4c 00 08 lw r12,(r2+8)
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
uint32_t old_length;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
801a850: 34 02 00 00 mvi r2,0
801a854: 29 81 00 9c lw r1,(r12+156)
801a858: fb ff ac 07 calli 8005874 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
801a85c: 44 20 00 06 be r1,r0,801a874 <msdos_file_ftruncate+0x54> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EIO);
801a860: f8 00 00 fd calli 801ac54 <__errno> <== NOT EXECUTED
801a864: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
801a868: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
801a86c: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED
801a870: e0 00 00 21 bi 801a8f4 <msdos_file_ftruncate+0xd4> <== NOT EXECUTED
old_length = fat_fd->fat_file_size;
801a874: 29 af 00 18 lw r15,(r13+24)
if (length < old_length) {
801a878: 51 cf 00 08 bgeu r14,r15,801a898 <msdos_file_ftruncate+0x78>
rc = fat_file_truncate(&fs_info->fat, fat_fd, length);
801a87c: b9 80 08 00 mv r1,r12
801a880: b9 a0 10 00 mv r2,r13
801a884: b9 c0 18 00 mv r3,r14
801a888: fb ff d3 23 calli 800f514 <fat_file_truncate>
801a88c: b8 20 58 00 mv r11,r1
errno = ENOSPC;
rc = -1;
}
}
if (rc == RC_OK) {
801a890: 44 20 00 15 be r1,r0,801a8e4 <msdos_file_ftruncate+0xc4> <== ALWAYS TAKEN
801a894: e0 00 00 16 bi 801a8ec <msdos_file_ftruncate+0xcc> <== NOT EXECUTED
if (length < old_length) {
rc = fat_file_truncate(&fs_info->fat, fat_fd, length);
} else {
uint32_t new_length;
rc = fat_file_extend(&fs_info->fat,
801a898: b9 80 08 00 mv r1,r12
801a89c: b9 a0 10 00 mv r2,r13
801a8a0: 34 03 00 01 mvi r3,1
801a8a4: b9 c0 20 00 mv r4,r14
801a8a8: 37 85 00 1c addi r5,sp,28
801a8ac: fb ff d3 cf calli 800f7e8 <fat_file_extend>
801a8b0: b8 20 58 00 mv r11,r1
fat_fd,
true,
length,
&new_length);
if (rc == RC_OK && length != new_length) {
801a8b4: 5c 20 00 0e bne r1,r0,801a8ec <msdos_file_ftruncate+0xcc> <== NEVER TAKEN
801a8b8: 2b 81 00 1c lw r1,(sp+28)
801a8bc: 45 c1 00 0a be r14,r1,801a8e4 <msdos_file_ftruncate+0xc4> <== ALWAYS TAKEN
fat_file_truncate(&fs_info->fat, fat_fd, old_length);
801a8c0: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801a8c4: b9 e0 18 00 mv r3,r15 <== NOT EXECUTED
801a8c8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801a8cc: fb ff d3 12 calli 800f514 <fat_file_truncate> <== NOT EXECUTED
errno = ENOSPC;
801a8d0: f8 00 00 e1 calli 801ac54 <__errno> <== NOT EXECUTED
801a8d4: 34 02 00 1c mvi r2,28 <== NOT EXECUTED
801a8d8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
rc = -1;
801a8dc: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED
801a8e0: e0 00 00 03 bi 801a8ec <msdos_file_ftruncate+0xcc> <== NOT EXECUTED
}
}
if (rc == RC_OK) {
fat_fd->fat_file_size = length;
801a8e4: 59 ae 00 18 sw (r13+24),r14
801a8e8: 34 0b 00 00 mvi r11,0
}
rtems_semaphore_release(fs_info->vol_sema);
801a8ec: 29 81 00 9c lw r1,(r12+156)
801a8f0: fb ff ac 31 calli 80059b4 <rtems_semaphore_release>
return rc;
}
801a8f4: b9 60 08 00 mv r1,r11
801a8f8: 2b 9d 00 04 lw ra,(sp+4)
801a8fc: 2b 8b 00 18 lw r11,(sp+24)
801a900: 2b 8c 00 14 lw r12,(sp+20)
801a904: 2b 8d 00 10 lw r13,(sp+16)
801a908: 2b 8e 00 0c lw r14,(sp+12)
801a90c: 2b 8f 00 08 lw r15,(sp+8)
801a910: 37 9c 00 1c addi sp,sp,28
801a914: c3 a0 00 00 ret
0801a5a4 <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)
{
801a5a4: 37 9c ff e4 addi sp,sp,-28
801a5a8: 5b 8b 00 1c sw (sp+28),r11
801a5ac: 5b 8c 00 18 sw (sp+24),r12
801a5b0: 5b 8d 00 14 sw (sp+20),r13
801a5b4: 5b 8e 00 10 sw (sp+16),r14
801a5b8: 5b 8f 00 0c sw (sp+12),r15
801a5bc: 5b 90 00 08 sw (sp+8),r16
801a5c0: 5b 9d 00 04 sw (sp+4),ra
801a5c4: b8 20 58 00 mv r11,r1
ssize_t ret = 0;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
801a5c8: 28 21 00 20 lw r1,(r1+32)
* 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)
{
801a5cc: b8 40 60 00 mv r12,r2
801a5d0: b8 60 78 00 mv r15,r3
ssize_t ret = 0;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
801a5d4: 28 2d 00 08 lw r13,(r1+8)
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
801a5d8: 34 02 00 00 mvi r2,0
801a5dc: 34 03 00 00 mvi r3,0
801a5e0: 29 a1 00 9c lw r1,(r13+156)
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;
801a5e4: 29 70 00 14 lw r16,(r11+20)
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
801a5e8: fb ff ac a3 calli 8005874 <rtems_semaphore_obtain>
801a5ec: b8 20 70 00 mv r14,r1
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
801a5f0: 44 20 00 06 be r1,r0,801a608 <msdos_file_read+0x64> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EIO);
801a5f4: f8 00 01 98 calli 801ac54 <__errno> <== NOT EXECUTED
801a5f8: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
801a5fc: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
801a600: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
801a604: e0 00 00 0e bi 801a63c <msdos_file_read+0x98> <== NOT EXECUTED
ret = fat_file_read(&fs_info->fat, fat_fd, iop->offset, count,
801a608: 29 63 00 04 lw r3,(r11+4)
801a60c: b9 80 28 00 mv r5,r12
801a610: b9 a0 08 00 mv r1,r13
801a614: ba 00 10 00 mv r2,r16
801a618: b9 e0 20 00 mv r4,r15
801a61c: fb ff d3 38 calli 800f2fc <fat_file_read>
801a620: b8 20 60 00 mv r12,r1
buffer);
if (ret > 0)
801a624: 4d c1 00 04 bge r14,r1,801a634 <msdos_file_read+0x90>
iop->offset += ret;
801a628: 29 61 00 04 lw r1,(r11+4)
801a62c: b4 2c 08 00 add r1,r1,r12
801a630: 59 61 00 04 sw (r11+4),r1
rtems_semaphore_release(fs_info->vol_sema);
801a634: 29 a1 00 9c lw r1,(r13+156)
801a638: fb ff ac df calli 80059b4 <rtems_semaphore_release>
return ret;
}
801a63c: b9 80 08 00 mv r1,r12
801a640: 2b 9d 00 04 lw ra,(sp+4)
801a644: 2b 8b 00 1c lw r11,(sp+28)
801a648: 2b 8c 00 18 lw r12,(sp+24)
801a64c: 2b 8d 00 14 lw r13,(sp+20)
801a650: 2b 8e 00 10 lw r14,(sp+16)
801a654: 2b 8f 00 0c lw r15,(sp+12)
801a658: 2b 90 00 08 lw r16,(sp+8)
801a65c: 37 9c 00 1c addi sp,sp,28
801a660: c3 a0 00 00 ret
0801a744 <msdos_file_stat>:
int
msdos_file_stat(
const rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
801a744: 37 9c ff ec addi sp,sp,-20
801a748: 5b 8b 00 14 sw (sp+20),r11
801a74c: 5b 8c 00 10 sw (sp+16),r12
801a750: 5b 8d 00 0c sw (sp+12),r13
801a754: 5b 8e 00 08 sw (sp+8),r14
801a758: 5b 9d 00 04 sw (sp+4),ra
801a75c: b8 40 58 00 mv r11,r2
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
801a760: 28 22 00 14 lw r2,(r1+20)
fat_file_fd_t *fat_fd = loc->node_access;
801a764: 28 2d 00 08 lw r13,(r1+8)
uint32_t cl_mask = fs_info->fat.vol.bpc - 1;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
801a768: 34 03 00 00 mvi r3,0
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;
801a76c: 28 4c 00 08 lw r12,(r2+8)
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,
801a770: 34 02 00 00 mvi r2,0
801a774: 29 81 00 9c lw r1,(r12+156)
)
{
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;
801a778: 2d 8e 00 06 lhu r14,(r12+6)
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
801a77c: fb ff ac 3e calli 8005874 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
801a780: 44 20 00 06 be r1,r0,801a798 <msdos_file_stat+0x54> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EIO);
801a784: f8 00 01 34 calli 801ac54 <__errno> <== NOT EXECUTED
801a788: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
801a78c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
801a790: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
801a794: e0 00 00 1c bi 801a804 <msdos_file_stat+0xc0> <== NOT EXECUTED
801a798: 29 82 00 64 lw r2,(r12+100)
)
{
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;
801a79c: 35 c3 ff ff addi r3,r14,-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);
buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
801a7a0: 28 41 00 00 lw r1,(r2+0)
801a7a4: 59 61 00 00 sw (r11+0),r1
801a7a8: 28 41 00 04 lw r1,(r2+4)
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;
801a7ac: 29 a2 00 18 lw r2,(r13+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);
buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
801a7b0: 59 61 00 04 sw (r11+4),r1
buf->st_ino = fat_fd->ino;
801a7b4: 29 a1 00 0c lw r1,(r13+12)
buf->st_mode = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
buf->st_rdev = 0ll;
buf->st_size = fat_fd->fat_file_size;
801a7b8: 59 62 00 20 sw (r11+32),r2
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;
801a7bc: 59 60 00 18 sw (r11+24),r0
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;
801a7c0: 59 61 00 08 sw (r11+8),r1
buf->st_mode = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
801a7c4: 38 01 81 ff mvu r1,0x81ff
801a7c8: 59 61 00 0c sw (r11+12),r1
buf->st_rdev = 0ll;
buf->st_size = fat_fd->fat_file_size;
buf->st_blocks = ((fat_fd->fat_file_size + cl_mask) & ~cl_mask)
801a7cc: a4 60 08 00 not r1,r3
801a7d0: b4 62 18 00 add r3,r3,r2
>> FAT_SECTOR512_BITS;
801a7d4: a0 23 08 00 and r1,r1,r3
801a7d8: 34 02 00 09 mvi r2,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;
801a7dc: 59 60 00 1c sw (r11+28),r0
buf->st_size = fat_fd->fat_file_size;
buf->st_blocks = ((fat_fd->fat_file_size + cl_mask) & ~cl_mask)
>> FAT_SECTOR512_BITS;
801a7e0: f8 00 4b 1e calli 802d458 <__lshrsi3>
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)
801a7e4: 59 61 00 40 sw (r11+64),r1
>> FAT_SECTOR512_BITS;
buf->st_blksize = fs_info->fat.vol.bpc;
801a7e8: 2d 81 00 06 lhu r1,(r12+6)
801a7ec: 59 61 00 3c sw (r11+60),r1
buf->st_mtime = fat_fd->mtime;
801a7f0: 29 a1 00 40 lw r1,(r13+64)
801a7f4: 59 61 00 2c sw (r11+44),r1
rtems_semaphore_release(fs_info->vol_sema);
801a7f8: 29 81 00 9c lw r1,(r12+156)
801a7fc: fb ff ac 6e calli 80059b4 <rtems_semaphore_release>
return RC_OK;
801a800: 34 01 00 00 mvi r1,0
}
801a804: 2b 9d 00 04 lw ra,(sp+4)
801a808: 2b 8b 00 14 lw r11,(sp+20)
801a80c: 2b 8c 00 10 lw r12,(sp+16)
801a810: 2b 8d 00 0c lw r13,(sp+12)
801a814: 2b 8e 00 08 lw r14,(sp+8)
801a818: 37 9c 00 14 addi sp,sp,20
801a81c: c3 a0 00 00 ret
0801a918 <msdos_file_sync>:
* RETURNS:
* RC_OK on success, or -1 if error occured (errno set appropriately)
*/
int
msdos_file_sync(rtems_libio_t *iop)
{
801a918: 37 9c ff f0 addi sp,sp,-16
801a91c: 5b 8b 00 10 sw (sp+16),r11
801a920: 5b 8c 00 0c sw (sp+12),r12
801a924: 5b 8d 00 08 sw (sp+8),r13
801a928: 5b 9d 00 04 sw (sp+4),ra
801a92c: b8 20 60 00 mv r12,r1
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
801a930: 28 21 00 20 lw r1,(r1+32)
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
801a934: 34 02 00 00 mvi r2,0
801a938: 34 03 00 00 mvi r3,0
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;
801a93c: 28 2b 00 08 lw r11,(r1+8)
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
801a940: 29 61 00 9c lw r1,(r11+156)
801a944: fb ff ab cc calli 8005874 <rtems_semaphore_obtain>
801a948: b8 20 68 00 mv r13,r1
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
801a94c: 44 20 00 06 be r1,r0,801a964 <msdos_file_sync+0x4c> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EIO);
801a950: f8 00 00 c1 calli 801ac54 <__errno> <== NOT EXECUTED
801a954: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
801a958: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
801a95c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
801a960: e0 00 00 09 bi 801a984 <msdos_file_sync+0x6c> <== NOT EXECUTED
rc = msdos_file_update(iop);
801a964: b9 80 08 00 mv r1,r12
801a968: fb ff fe d5 calli 801a4bc <msdos_file_update>
801a96c: b8 20 60 00 mv r12,r1
if (rc != RC_OK)
801a970: 5c 2d 00 03 bne r1,r13,801a97c <msdos_file_sync+0x64> <== NEVER TAKEN
{
rtems_semaphore_release(fs_info->vol_sema);
return rc;
}
rc = fat_sync(&fs_info->fat);
801a974: b9 60 08 00 mv r1,r11
801a978: fb ff d9 75 calli 8010f4c <fat_sync>
rtems_semaphore_release(fs_info->vol_sema);
801a97c: 29 61 00 9c lw r1,(r11+156)
801a980: fb ff ac 0d calli 80059b4 <rtems_semaphore_release>
return RC_OK;
}
801a984: b9 80 08 00 mv r1,r12
801a988: 2b 9d 00 04 lw ra,(sp+4)
801a98c: 2b 8b 00 10 lw r11,(sp+16)
801a990: 2b 8c 00 0c lw r12,(sp+12)
801a994: 2b 8d 00 08 lw r13,(sp+8)
801a998: 37 9c 00 10 addi sp,sp,16
801a99c: c3 a0 00 00 ret
0801a4bc <msdos_file_update>:
#include "msdos.h"
static int
msdos_file_update(rtems_libio_t *iop)
{
801a4bc: 37 9c ff f0 addi sp,sp,-16
801a4c0: 5b 8b 00 10 sw (sp+16),r11
801a4c4: 5b 8c 00 0c sw (sp+12),r12
801a4c8: 5b 8d 00 08 sw (sp+8),r13
801a4cc: 5b 9d 00 04 sw (sp+4),ra
int rc = RC_OK;
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
801a4d0: 28 2b 00 14 lw r11,(r1+20)
#include "msdos.h"
static int
msdos_file_update(rtems_libio_t *iop)
{
801a4d4: b8 20 60 00 mv r12,r1
int rc = RC_OK;
801a4d8: 34 01 00 00 mvi r1,0
/*
* 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))
801a4dc: 41 6d 00 30 lbu r13,(r11+48)
801a4e0: 21 ad 00 01 andi r13,r13,0x1
801a4e4: 5d a0 00 09 bne r13,r0,801a508 <msdos_file_update+0x4c> <== NEVER TAKEN
801a4e8: e0 00 00 0e bi 801a520 <msdos_file_update+0x64>
if (rc != RC_OK)
{
return rc;
}
rc = msdos_set_file_size(iop->pathinfo.mt_entry, fat_fd);
801a4ec: 29 81 00 20 lw r1,(r12+32)
801a4f0: b9 60 10 00 mv r2,r11
801a4f4: fb ff f1 2c calli 80169a4 <msdos_set_file_size>
if (rc != RC_OK)
801a4f8: 5c 20 00 04 bne r1,r0,801a508 <msdos_file_update+0x4c> <== NEVER TAKEN
{
return rc;
}
rc = msdos_set_dir_wrt_time_and_date(iop->pathinfo.mt_entry, fat_fd);
801a4fc: 29 81 00 20 lw r1,(r12+32)
801a500: b9 60 10 00 mv r2,r11
801a504: fb ff f0 7d calli 80166f8 <msdos_set_dir_wrt_time_and_date>
return rc;
}
}
return rc;
}
801a508: 2b 9d 00 04 lw ra,(sp+4)
801a50c: 2b 8b 00 10 lw r11,(sp+16)
801a510: 2b 8c 00 0c lw r12,(sp+12)
801a514: 2b 8d 00 08 lw r13,(sp+8)
801a518: 37 9c 00 10 addi sp,sp,16
801a51c: c3 a0 00 00 ret
* 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);
801a520: 29 81 00 20 lw r1,(r12+32)
801a524: b9 60 10 00 mv r2,r11
801a528: fb ff f0 cf calli 8016864 <msdos_set_first_cluster_num>
if (rc != RC_OK)
801a52c: 5c 2d ff f7 bne r1,r13,801a508 <msdos_file_update+0x4c> <== NEVER TAKEN
801a530: e3 ff ff ef bi 801a4ec <msdos_file_update+0x30>
0801a664 <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)
{
801a664: 37 9c ff e8 addi sp,sp,-24
801a668: 5b 8b 00 18 sw (sp+24),r11
801a66c: 5b 8c 00 14 sw (sp+20),r12
801a670: 5b 8d 00 10 sw (sp+16),r13
801a674: 5b 8e 00 0c sw (sp+12),r14
801a678: 5b 8f 00 08 sw (sp+8),r15
801a67c: 5b 9d 00 04 sw (sp+4),ra
801a680: b8 20 58 00 mv r11,r1
ssize_t ret = 0;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
801a684: 28 21 00 20 lw r1,(r1+32)
* 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)
{
801a688: b8 40 68 00 mv r13,r2
801a68c: b8 60 78 00 mv r15,r3
ssize_t ret = 0;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
801a690: 28 2e 00 08 lw r14,(r1+8)
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
801a694: 34 02 00 00 mvi r2,0
801a698: 34 03 00 00 mvi r3,0
801a69c: 29 c1 00 9c lw r1,(r14+156)
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;
801a6a0: 29 6c 00 14 lw r12,(r11+20)
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
801a6a4: fb ff ac 74 calli 8005874 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
801a6a8: 44 20 00 05 be r1,r0,801a6bc <msdos_file_write+0x58> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EIO);
801a6ac: f8 00 01 6a calli 801ac54 <__errno> <== NOT EXECUTED
801a6b0: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
801a6b4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
801a6b8: e0 00 00 10 bi 801a6f8 <msdos_file_write+0x94> <== NOT EXECUTED
if ((iop->flags & LIBIO_FLAGS_APPEND) != 0)
801a6bc: 29 62 00 08 lw r2,(r11+8)
801a6c0: 20 42 02 00 andi r2,r2,0x200
801a6c4: 44 41 00 03 be r2,r1,801a6d0 <msdos_file_write+0x6c>
iop->offset = fat_fd->fat_file_size;
801a6c8: 29 81 00 18 lw r1,(r12+24)
801a6cc: 59 61 00 04 sw (r11+4),r1
ret = fat_file_write(&fs_info->fat, fat_fd, iop->offset, count,
801a6d0: 29 63 00 04 lw r3,(r11+4)
801a6d4: b9 a0 28 00 mv r5,r13
801a6d8: b9 c0 08 00 mv r1,r14
801a6dc: b9 80 10 00 mv r2,r12
801a6e0: b9 e0 20 00 mv r4,r15
801a6e4: fb ff d4 d6 calli 800fa3c <fat_file_write>
801a6e8: b8 20 68 00 mv r13,r1
buffer);
if (ret < 0)
801a6ec: 4c 20 00 05 bge r1,r0,801a700 <msdos_file_write+0x9c> <== ALWAYS TAKEN
{
rtems_semaphore_release(fs_info->vol_sema);
801a6f0: 29 c1 00 9c lw r1,(r14+156) <== NOT EXECUTED
801a6f4: fb ff ac b0 calli 80059b4 <rtems_semaphore_release> <== NOT EXECUTED
return -1;
801a6f8: 34 0d ff ff mvi r13,-1 <== NOT EXECUTED
801a6fc: e0 00 00 09 bi 801a720 <msdos_file_write+0xbc> <== NOT EXECUTED
/*
* update file size in both fat-file descriptor and file control block if
* file was extended
*/
iop->offset += ret;
801a700: 29 61 00 04 lw r1,(r11+4)
if (iop->offset > fat_fd->fat_file_size)
801a704: 29 82 00 18 lw r2,(r12+24)
/*
* update file size in both fat-file descriptor and file control block if
* file was extended
*/
iop->offset += ret;
801a708: b5 a1 08 00 add r1,r13,r1
801a70c: 59 61 00 04 sw (r11+4),r1
if (iop->offset > fat_fd->fat_file_size)
801a710: 50 41 00 02 bgeu r2,r1,801a718 <msdos_file_write+0xb4>
fat_fd->fat_file_size = iop->offset;
801a714: 59 81 00 18 sw (r12+24),r1
rtems_semaphore_release(fs_info->vol_sema);
801a718: 29 c1 00 9c lw r1,(r14+156)
801a71c: fb ff ac a6 calli 80059b4 <rtems_semaphore_release>
return ret;
}
801a720: b9 a0 08 00 mv r1,r13
801a724: 2b 9d 00 04 lw ra,(sp+4)
801a728: 2b 8b 00 18 lw r11,(sp+24)
801a72c: 2b 8c 00 14 lw r12,(sp+20)
801a730: 2b 8d 00 10 lw r13,(sp+16)
801a734: 2b 8e 00 0c lw r14,(sp+12)
801a738: 2b 8f 00 08 lw r15,(sp+8)
801a73c: 37 9c 00 18 addi sp,sp,24
801a740: c3 a0 00 00 ret
08019d8c <msdos_filename_unix2dos>:
/*
* Fill the dos filename string with blanks. These are DOS's pad
* characters.
*/
for (i = 0; i <= 10; i++)
8019d8c: 34 04 00 00 mvi r4,0
dn[i] = ' ';
8019d90: 34 06 00 20 mvi r6,32
/*
* Fill the dos filename string with blanks. These are DOS's pad
* characters.
*/
for (i = 0; i <= 10; i++)
8019d94: 34 05 00 0b mvi r5,11
/*
* 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)
8019d98: b4 64 38 00 add r7,r3,r4
/*
* Fill the dos filename string with blanks. These are DOS's pad
* characters.
*/
for (i = 0; i <= 10; i++)
dn[i] = ' ';
8019d9c: 30 e6 00 00 sb (r7+0),r6
/*
* Fill the dos filename string with blanks. These are DOS's pad
* characters.
*/
for (i = 0; i <= 10; i++)
8019da0: 34 84 00 01 addi r4,r4,1
8019da4: 5c 85 ff fd bne r4,r5,8019d98 <msdos_filename_unix2dos+0xc>
/*
* The filenames "." and ".." are handled specially, since they
* don't follow dos filename rules.
*/
if (un[0] == '.' && unlen == 1) {
8019da8: 40 25 00 00 lbu r5,(r1+0)
8019dac: 64 44 00 01 cmpei r4,r2,1
8019db0: 64 a5 00 2e cmpei r5,r5,46
8019db4: a0 a4 20 00 and r4,r5,r4
8019db8: 44 80 00 04 be r4,r0,8019dc8 <msdos_filename_unix2dos+0x3c><== ALWAYS TAKEN
dn[0] = '.';
8019dbc: 34 01 00 2e mvi r1,46 <== NOT EXECUTED
8019dc0: 30 61 00 00 sb (r3+0),r1 <== NOT EXECUTED
return 0;
8019dc4: e0 00 00 44 bi 8019ed4 <msdos_filename_unix2dos+0x148> <== NOT EXECUTED
}
if (un[0] == '.' && un[1] == '.' && unlen == 2) {
8019dc8: 44 a4 00 0d be r5,r4,8019dfc <msdos_filename_unix2dos+0x70><== ALWAYS TAKEN
8019dcc: 40 24 00 01 lbu r4,(r1+1) <== NOT EXECUTED
8019dd0: 64 45 00 02 cmpei r5,r2,2 <== NOT EXECUTED
8019dd4: 64 84 00 2e cmpei r4,r4,46 <== NOT EXECUTED
8019dd8: a0 85 20 00 and r4,r4,r5 <== NOT EXECUTED
8019ddc: 44 80 00 08 be r4,r0,8019dfc <msdos_filename_unix2dos+0x70><== NOT EXECUTED
dn[0] = '.';
8019de0: 34 01 00 2e mvi r1,46 <== NOT EXECUTED
8019de4: 30 61 00 00 sb (r3+0),r1 <== NOT EXECUTED
dn[1] = '.';
8019de8: 30 61 00 01 sb (r3+1),r1 <== NOT EXECUTED
return 0;
8019dec: e0 00 00 3a bi 8019ed4 <msdos_filename_unix2dos+0x148> <== NOT EXECUTED
/*
* Remove any dots from the start of a file name.
*/
while (unlen && (*un == '.')) {
un++;
8019df0: 34 21 00 01 addi r1,r1,1 <== NOT EXECUTED
unlen--;
8019df4: 34 42 ff ff addi r2,r2,-1 <== NOT EXECUTED
8019df8: e0 00 00 02 bi 8019e00 <msdos_filename_unix2dos+0x74> <== NOT EXECUTED
}
/*
* Remove any dots from the start of a file name.
*/
while (unlen && (*un == '.')) {
8019dfc: 34 04 00 2e mvi r4,46
8019e00: 5c 40 00 07 bne r2,r0,8019e1c <msdos_filename_unix2dos+0x90><== ALWAYS TAKEN
* 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)
8019e04: 78 05 08 02 mvhi r5,0x802
/*
* Fill the dos filename string with blanks. These are DOS's pad
* characters.
*/
for (i = 0; i <= 10; i++)
8019e08: 34 04 00 00 mvi r4,0
* 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++) {
8019e0c: 34 08 00 07 mvi r8,7
8019e10: 34 07 00 2e mvi r7,46
if (msdos_map[c] == 0)
8019e14: 38 a5 ec 90 ori r5,r5,0xec90
8019e18: e0 00 00 0c bi 8019e48 <msdos_filename_unix2dos+0xbc>
}
/*
* Remove any dots from the start of a file name.
*/
while (unlen && (*un == '.')) {
8019e1c: 40 25 00 00 lbu r5,(r1+0)
8019e20: 44 a4 ff f4 be r5,r4,8019df0 <msdos_filename_unix2dos+0x64><== NEVER TAKEN
8019e24: e3 ff ff f8 bi 8019e04 <msdos_filename_unix2dos+0x78>
* of string, a '.', or 8 characters. Whichever happens first stops
* us. This forms the name portion of the dos filename. Fold to
* upper case.
*/
for (i = 0; i <= 7 && unlen && (c = *un) && c != '.'; i++) {
if (msdos_map[c] == 0)
8019e28: b4 a6 30 00 add r6,r5,r6
8019e2c: 40 c6 00 00 lbu r6,(r6+0)
8019e30: 44 c0 00 12 be r6,r0,8019e78 <msdos_filename_unix2dos+0xec>
/*
* 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)
8019e34: b4 64 48 00 add r9,r3,r4
* upper case.
*/
for (i = 0; i <= 7 && unlen && (c = *un) && c != '.'; i++) {
if (msdos_map[c] == 0)
break;
dn[i] = msdos_map[c];
8019e38: 31 26 00 00 sb (r9+0),r6
un++;
8019e3c: 34 21 00 01 addi r1,r1,1
unlen--;
8019e40: 34 42 ff ff addi r2,r2,-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++) {
8019e44: 34 84 00 01 addi r4,r4,1
8019e48: 7c 49 00 00 cmpnei r9,r2,0
8019e4c: ed 04 30 00 cmpge r6,r8,r4
8019e50: a1 26 30 00 and r6,r9,r6
8019e54: 44 c0 00 09 be r6,r0,8019e78 <msdos_filename_unix2dos+0xec>
8019e58: 40 26 00 00 lbu r6,(r1+0)
8019e5c: 44 c0 00 07 be r6,r0,8019e78 <msdos_filename_unix2dos+0xec><== NEVER TAKEN
8019e60: 5c c7 ff f2 bne r6,r7,8019e28 <msdos_filename_unix2dos+0x9c>
8019e64: e0 00 00 05 bi 8019e78 <msdos_filename_unix2dos+0xec>
/*
* Strip any further characters up to a '.' or the end of the
* string.
*/
while (unlen && (c = *un)) {
un++;
8019e68: 34 21 00 01 addi r1,r1,1
unlen--;
8019e6c: 34 42 ff ff addi r2,r2,-1
/* Make sure we've skipped over the dot before stopping. */
if (c == '.')
8019e70: 5c 85 00 03 bne r4,r5,8019e7c <msdos_filename_unix2dos+0xf0>
8019e74: e0 00 00 05 bi 8019e88 <msdos_filename_unix2dos+0xfc>
8019e78: 34 05 00 2e mvi r5,46
/*
* Strip any further characters up to a '.' or the end of the
* string.
*/
while (unlen && (c = *un)) {
8019e7c: 44 40 00 03 be r2,r0,8019e88 <msdos_filename_unix2dos+0xfc>
8019e80: 40 24 00 00 lbu r4,(r1+0)
8019e84: 5c 80 ff f9 bne r4,r0,8019e68 <msdos_filename_unix2dos+0xdc><== ALWAYS TAKEN
* 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)
8019e88: 78 05 08 02 mvhi r5,0x802
/*
* Fill the dos filename string with blanks. These are DOS's pad
* characters.
*/
for (i = 0; i <= 10; i++)
8019e8c: 34 04 00 08 mvi r4,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++) {
8019e90: 34 07 00 0a mvi r7,10
if (msdos_map[c] == 0)
8019e94: 38 a5 ec 90 ori r5,r5,0xec90
8019e98: e0 00 00 09 bi 8019ebc <msdos_filename_unix2dos+0x130>
8019e9c: b4 a6 30 00 add r6,r5,r6
8019ea0: 40 c6 00 00 lbu r6,(r6+0)
8019ea4: 44 c0 00 0c be r6,r0,8019ed4 <msdos_filename_unix2dos+0x148>
/*
* 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)
8019ea8: b4 64 40 00 add r8,r3,r4
* Filenames in this form are probably inaccessable under dos.
*/
for (i = 8; i <= 10 && unlen && (c = *un); i++) {
if (msdos_map[c] == 0)
break;
dn[i] = msdos_map[c];
8019eac: 31 06 00 00 sb (r8+0),r6
un++;
8019eb0: 34 21 00 01 addi r1,r1,1
unlen--;
8019eb4: 34 42 ff ff addi r2,r2,-1
/*
* 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++) {
8019eb8: 34 84 00 01 addi r4,r4,1
8019ebc: 7c 48 00 00 cmpnei r8,r2,0
8019ec0: ec e4 30 00 cmpge r6,r7,r4
8019ec4: a1 06 30 00 and r6,r8,r6
8019ec8: 44 c0 00 03 be r6,r0,8019ed4 <msdos_filename_unix2dos+0x148>
8019ecc: 40 26 00 00 lbu r6,(r1+0)
8019ed0: 5c c0 ff f3 bne r6,r0,8019e9c <msdos_filename_unix2dos+0x110><== ALWAYS TAKEN
dn[i] = msdos_map[c];
un++;
unlen--;
}
return 0;
}
8019ed4: 34 01 00 00 mvi r1,0
8019ed8: c3 a0 00 00 ret
080180b4 <msdos_find_name>:
msdos_find_name(
rtems_filesystem_location_info_t *parent_loc,
const char *name,
int name_len
)
{
80180b4: 37 9c ff a4 addi sp,sp,-92
80180b8: 5b 8b 00 24 sw (sp+36),r11
80180bc: 5b 8c 00 20 sw (sp+32),r12
80180c0: 5b 8d 00 1c sw (sp+28),r13
80180c4: 5b 8e 00 18 sw (sp+24),r14
80180c8: 5b 8f 00 14 sw (sp+20),r15
80180cc: 5b 90 00 10 sw (sp+16),r16
80180d0: 5b 91 00 0c sw (sp+12),r17
80180d4: 5b 92 00 08 sw (sp+8),r18
80180d8: 5b 9d 00 04 sw (sp+4),ra
80180dc: b8 20 78 00 mv r15,r1
int rc = RC_OK;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
80180e0: 28 21 00 14 lw r1,(r1+20)
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);
80180e4: 37 8c 00 2c addi r12,sp,44
msdos_find_name(
rtems_filesystem_location_info_t *parent_loc,
const char *name,
int name_len
)
{
80180e8: b8 60 58 00 mv r11,r3
80180ec: b8 40 68 00 mv r13,r2
int rc = RC_OK;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
80180f0: 28 2e 00 08 lw r14,(r1+8)
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);
80180f4: 34 02 00 00 mvi r2,0
80180f8: 34 03 00 20 mvi r3,32
80180fc: b9 80 08 00 mv r1,r12
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;
8018100: 5b 80 00 5c sw (sp+92),r0
fat_dir_pos_t dir_pos;
unsigned short time_val = 0;
unsigned short date = 0;
char node_entry[MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE];
memset(node_entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
8018104: f8 00 0e 63 calli 801ba90 <memset>
name_type = msdos_long_to_short (name,
8018108: b9 60 10 00 mv r2,r11
801810c: b9 80 18 00 mv r3,r12
8018110: 34 04 00 0b mvi r4,11
8018114: b9 a0 08 00 mv r1,r13
8018118: fb ff f8 de calli 8016490 <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,
801811c: 37 90 00 4c addi r16,sp,76
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,
8018120: b8 20 28 00 mv r5,r1
/*
* 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,
8018124: b9 60 20 00 mv r4,r11
8018128: b9 e0 08 00 mv r1,r15
801812c: 34 02 00 00 mvi r2,0
8018130: b9 a0 18 00 mv r3,r13
8018134: ba 00 30 00 mv r6,r16
8018138: b9 80 38 00 mv r7,r12
801813c: fb ff ff 86 calli 8017f54 <msdos_get_name_node>
8018140: b8 20 58 00 mv r11,r1
&dir_pos, node_entry);
if (rc != RC_OK)
8018144: 5c 20 00 78 bne r1,r0,8018324 <msdos_find_name+0x270>
return rc;
if (((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_VOLUME_ID) ||
8018148: 43 81 00 37 lbu r1,(sp+55)
801814c: 20 2d 00 08 andi r13,r1,0x8
8018150: 5d ab 00 74 bne r13,r11,8018320 <msdos_find_name+0x26c> <== NEVER TAKEN
((*MSDOS_DIR_ATTR(node_entry) & MSDOS_ATTR_LFN_MASK) == MSDOS_ATTR_LFN))
8018154: 20 21 00 3f andi r1,r1,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) ||
8018158: 34 02 00 0f mvi r2,15
((*MSDOS_DIR_ATTR(node_entry) & MSDOS_ATTR_LFN_MASK) == MSDOS_ATTR_LFN))
return MSDOS_NAME_NOT_FOUND_ERR;
801815c: 34 0b 7d 01 mvi r11,32001
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) ||
8018160: 44 22 00 71 be r1,r2,8018324 <msdos_find_name+0x270> <== NEVER TAKEN
((*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);
8018164: b9 c0 08 00 mv r1,r14
8018168: ba 00 10 00 mv r2,r16
801816c: 37 83 00 5c addi r3,sp,92
8018170: fb ff db fd calli 800f164 <fat_file_open>
8018174: b8 20 58 00 mv r11,r1
if (rc != RC_OK)
8018178: 5c 2d 00 6b bne r1,r13,8018324 <msdos_find_name+0x270> <== NEVER TAKEN
return rc;
fat_fd->dir_pos = dir_pos;
801817c: 2b 8d 00 5c lw r13,(sp+92)
8018180: 2b 81 00 4c lw r1,(sp+76)
* 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)
8018184: 29 a2 00 08 lw r2,(r13+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;
8018188: 59 a1 00 20 sw (r13+32),r1
801818c: 2b 81 00 50 lw r1,(sp+80)
8018190: 59 a1 00 24 sw (r13+36),r1
8018194: 2b 81 00 54 lw r1,(sp+84)
8018198: 59 a1 00 28 sw (r13+40),r1
801819c: 2b 81 00 58 lw r1,(sp+88)
80181a0: 59 a1 00 2c sw (r13+44),r1
* 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)
80181a4: 34 01 00 01 mvi r1,1
80181a8: 5c 41 00 53 bne r2,r1,80182f4 <msdos_find_name+0x240>
{
fat_fd->cln = MSDOS_EXTRACT_CLUSTER_NUM(node_entry);
80181ac: 2d 91 00 14 lhu r17,(r12+20)
80181b0: 34 02 00 08 mvi r2,8
80181b4: 2d 90 00 1a lhu r16,(r12+26)
80181b8: ba 20 08 00 mv r1,r17
80181bc: fb ff a4 0b calli 80011e8 <__ashlsi3>
80181c0: b8 20 90 00 mv r18,r1
80181c4: 34 02 00 08 mvi r2,8
80181c8: ba 20 08 00 mv r1,r17
80181cc: f8 00 54 a3 calli 802d458 <__lshrsi3>
80181d0: ba 41 08 00 or r1,r18,r1
80181d4: 34 02 00 10 mvi r2,16
80181d8: 20 21 ff ff andi r1,r1,0xffff
80181dc: fb ff a4 03 calli 80011e8 <__ashlsi3>
80181e0: b8 20 88 00 mv r17,r1
80181e4: 34 02 00 08 mvi r2,8
80181e8: ba 00 08 00 mv r1,r16
80181ec: fb ff a3 ff calli 80011e8 <__ashlsi3>
80181f0: b8 20 90 00 mv r18,r1
80181f4: 34 02 00 08 mvi r2,8
80181f8: ba 00 08 00 mv r1,r16
80181fc: f8 00 54 97 calli 802d458 <__lshrsi3>
8018200: ba 41 10 00 or r2,r18,r1
8018204: 20 42 ff ff andi r2,r2,0xffff
8018208: ba 22 10 00 or r2,r17,r2
time_val = *MSDOS_DIR_WRITE_TIME(node_entry);
date = *MSDOS_DIR_WRITE_DATE(node_entry);
801820c: 2d 91 00 18 lhu r17,(r12+24)
* 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);
8018210: 59 a2 00 1c sw (r13+28),r2
8018214: 34 02 00 08 mvi r2,8
8018218: ba 20 08 00 mv r1,r17
801821c: fb ff a3 f3 calli 80011e8 <__ashlsi3>
time_val = *MSDOS_DIR_WRITE_TIME(node_entry);
8018220: 2d 90 00 16 lhu r16,(r12+22)
8018224: b8 20 90 00 mv r18,r1
8018228: 34 02 00 08 mvi r2,8
801822c: ba 20 08 00 mv r1,r17
8018230: f8 00 54 8a calli 802d458 <__lshrsi3>
8018234: ba 41 08 00 or r1,r18,r1
date = *MSDOS_DIR_WRITE_DATE(node_entry);
fat_fd->mtime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
8018238: 20 31 ff ff andi r17,r1,0xffff
801823c: 34 02 00 08 mvi r2,8
8018240: ba 00 08 00 mv r1,r16
8018244: fb ff a3 e9 calli 80011e8 <__ashlsi3>
8018248: b8 20 90 00 mv r18,r1
801824c: 34 02 00 08 mvi r2,8
8018250: ba 00 08 00 mv r1,r16
8018254: f8 00 54 81 calli 802d458 <__lshrsi3>
8018258: ba 41 10 00 or r2,r18,r1
801825c: 20 42 ff ff andi r2,r2,0xffff
8018260: ba 20 08 00 mv r1,r17
8018264: f8 00 06 6a calli 8019c0c <msdos_date_dos2unix>
8018268: 59 a1 00 40 sw (r13+64),r1
if ((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_DIRECTORY)
801826c: 43 81 00 37 lbu r1,(sp+55)
8018270: 2b 82 00 5c lw r2,(sp+92)
8018274: 20 21 00 10 andi r1,r1,0x10
8018278: 44 2b 00 0b be r1,r11,80182a4 <msdos_find_name+0x1f0>
{
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
801827c: 78 01 00 20 mvhi r1,0x20
8018280: 58 41 00 14 sw (r2+20),r1
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;
8018284: 58 40 00 10 sw (r2+16),r0
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
rc = fat_file_size(&fs_info->fat, fat_fd);
8018288: b9 c0 08 00 mv r1,r14
801828c: fb ff de b0 calli 800fd4c <fat_file_size>
8018290: b8 20 58 00 mv r11,r1
if (rc != RC_OK)
8018294: 44 20 00 0d be r1,r0,80182c8 <msdos_find_name+0x214> <== ALWAYS TAKEN
{
fat_file_close(&fs_info->fat, fat_fd);
8018298: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
801829c: 2b 82 00 5c lw r2,(sp+92) <== NOT EXECUTED
80182a0: e0 00 00 1c bi 8018310 <msdos_find_name+0x25c> <== NOT EXECUTED
return rc;
}
}
else
{
fat_fd->fat_file_size = CF_LE_L(*MSDOS_DIR_FILE_SIZE(node_entry));
80182a4: 29 81 00 1c lw r1,(r12+28)
80182a8: 5b 82 00 28 sw (sp+40),r2
80182ac: fb ff f8 46 calli 80163c4 <CPU_swap_u32>
80182b0: 2b 82 00 28 lw r2,(sp+40)
80182b4: 58 41 00 18 sw (r2+24),r1
fat_fd->fat_file_type = FAT_FILE;
80182b8: 34 01 00 04 mvi r1,4
80182bc: 58 41 00 10 sw (r2+16),r1
fat_fd->size_limit = MSDOS_MAX_FILE_SIZE;
80182c0: 34 01 ff ff mvi r1,-1
80182c4: 58 41 00 14 sw (r2+20),r1
}
/* these data is not actual for zero-length fat-file */
fat_fd->map.file_cln = 0;
80182c8: 2b 82 00 5c lw r2,(sp+92)
fat_fd->map.disk_cln = fat_fd->cln;
80182cc: 28 41 00 1c lw r1,(r2+28)
if ((fat_fd->fat_file_size != 0) &&
80182d0: 28 43 00 18 lw r3,(r2+24)
fat_fd->fat_file_type = FAT_FILE;
fat_fd->size_limit = MSDOS_MAX_FILE_SIZE;
}
/* these data is not actual for zero-length fat-file */
fat_fd->map.file_cln = 0;
80182d4: 58 40 00 34 sw (r2+52),r0
fat_fd->map.disk_cln = fat_fd->cln;
80182d8: 58 41 00 38 sw (r2+56),r1
if ((fat_fd->fat_file_size != 0) &&
80182dc: 44 60 00 04 be r3,r0,80182ec <msdos_find_name+0x238>
(fat_fd->fat_file_size <= fs_info->fat.vol.bpc))
80182e0: 2d c4 00 06 lhu r4,(r14+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) &&
80182e4: 54 64 00 02 bgu r3,r4,80182ec <msdos_find_name+0x238>
80182e8: e0 00 00 02 bi 80182f0 <msdos_find_name+0x23c>
{
fat_fd->map.last_cln = fat_fd->cln;
}
else
{
fat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
80182ec: 34 01 ff ff mvi r1,-1
80182f0: 58 41 00 3c sw (r2+60),r1
}
}
/* close fat-file corresponded to the node we searched in */
rc = fat_file_close(&fs_info->fat, parent_loc->node_access);
80182f4: 29 e2 00 08 lw r2,(r15+8)
80182f8: b9 c0 08 00 mv r1,r14
80182fc: fb ff dc d3 calli 800f648 <fat_file_close>
8018300: b8 20 58 00 mv r11,r1
8018304: 2b 82 00 5c lw r2,(sp+92)
if (rc != RC_OK)
8018308: 44 20 00 04 be r1,r0,8018318 <msdos_find_name+0x264> <== ALWAYS TAKEN
{
fat_file_close(&fs_info->fat, fat_fd);
801830c: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
8018310: fb ff dc ce calli 800f648 <fat_file_close> <== NOT EXECUTED
return rc;
8018314: e0 00 00 04 bi 8018324 <msdos_find_name+0x270> <== NOT EXECUTED
}
/* update node_info_ptr field */
parent_loc->node_access = fat_fd;
8018318: 59 e2 00 08 sw (r15+8),r2
return rc;
801831c: e0 00 00 02 bi 8018324 <msdos_find_name+0x270>
if (rc != RC_OK)
return rc;
if (((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_VOLUME_ID) ||
((*MSDOS_DIR_ATTR(node_entry) & MSDOS_ATTR_LFN_MASK) == MSDOS_ATTR_LFN))
return MSDOS_NAME_NOT_FOUND_ERR;
8018320: 34 0b 7d 01 mvi r11,32001 <== NOT EXECUTED
/* update node_info_ptr field */
parent_loc->node_access = fat_fd;
return rc;
}
8018324: b9 60 08 00 mv r1,r11
8018328: 2b 9d 00 04 lw ra,(sp+4)
801832c: 2b 8b 00 24 lw r11,(sp+36)
8018330: 2b 8c 00 20 lw r12,(sp+32)
8018334: 2b 8d 00 1c lw r13,(sp+28)
8018338: 2b 8e 00 18 lw r14,(sp+24)
801833c: 2b 8f 00 14 lw r15,(sp+20)
8018340: 2b 90 00 10 lw r16,(sp+16)
8018344: 2b 91 00 0c lw r17,(sp+12)
8018348: 2b 92 00 08 lw r18,(sp+8)
801834c: 37 9c 00 5c addi sp,sp,92
8018350: c3 a0 00 00 ret
08016d28 <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
)
{
8016d28: 37 9c ff 74 addi sp,sp,-140
8016d2c: 5b 8b 00 44 sw (sp+68),r11
8016d30: 5b 8c 00 40 sw (sp+64),r12
8016d34: 5b 8d 00 3c sw (sp+60),r13
8016d38: 5b 8e 00 38 sw (sp+56),r14
8016d3c: 5b 8f 00 34 sw (sp+52),r15
8016d40: 5b 90 00 30 sw (sp+48),r16
8016d44: 5b 91 00 2c sw (sp+44),r17
8016d48: 5b 92 00 28 sw (sp+40),r18
8016d4c: 5b 93 00 24 sw (sp+36),r19
8016d50: 5b 94 00 20 sw (sp+32),r20
8016d54: 5b 95 00 1c sw (sp+28),r21
8016d58: 5b 96 00 18 sw (sp+24),r22
8016d5c: 5b 97 00 14 sw (sp+20),r23
8016d60: 5b 98 00 10 sw (sp+16),r24
8016d64: 5b 99 00 0c sw (sp+12),r25
8016d68: 5b 9b 00 08 sw (sp+8),fp
8016d6c: 5b 9d 00 04 sw (sp+4),ra
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
8016d70: 28 21 00 08 lw r1,(r1+8)
int name_len,
msdos_name_type_t name_type,
fat_dir_pos_t *dir_pos,
char *name_dir_entry
)
{
8016d74: 5b 82 00 50 sw (sp+80),r2
8016d78: 5b 84 00 74 sw (sp+116),r4
8016d7c: 5b 87 00 4c sw (sp+76),r7
8016d80: 5b 88 00 48 sw (sp+72),r8
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
8016d84: 5b 81 00 64 sw (sp+100),r1
int name_len,
msdos_name_type_t name_type,
fat_dir_pos_t *dir_pos,
char *name_dir_entry
)
{
8016d88: b8 a0 b8 00 mv r23,r5
8016d8c: b8 c0 d8 00 mv fp,r6
8016d90: 20 75 00 ff andi r21,r3,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);
8016d94: 48 a0 00 09 bg r5,r0,8016db8 <msdos_find_name_in_fat_file+0x90><== ALWAYS TAKEN
8016d98: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED
8016d9c: 78 03 08 02 mvhi r3,0x802 <== NOT EXECUTED
8016da0: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED
8016da4: 38 21 eb 78 ori r1,r1,0xeb78 <== NOT EXECUTED
8016da8: 34 02 03 c9 mvi r2,969 <== NOT EXECUTED
8016dac: 38 63 ec 4c ori r3,r3,0xec4c <== NOT EXECUTED
8016db0: 38 84 eb f8 ori r4,r4,0xebf8 <== NOT EXECUTED
8016db4: e0 00 00 41 bi 8016eb8 <msdos_find_name_in_fat_file+0x190> <== NOT EXECUTED
static inline void
fat_dir_pos_init(
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
8016db8: 2b 81 00 4c lw r1,(sp+76)
dir_pos->sname.ofs = 0;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
8016dbc: 34 09 ff ff mvi r9,-1
fat_dir_pos_init(dir_pos);
lfn_start.cln = lfn_start.ofs = FAT_FILE_SHORT_NAME;
8016dc0: 5b 89 00 88 sw (sp+136),r9
static inline void
fat_dir_pos_init(
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
8016dc4: 58 20 00 00 sw (r1+0),r0
dir_pos->sname.ofs = 0;
8016dc8: 58 20 00 04 sw (r1+4),r0
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
8016dcc: 58 29 00 08 sw (r1+8),r9
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
8016dd0: 58 29 00 0c sw (r1+12),r9
8016dd4: 5b 89 00 84 sw (sp+132),r9
* 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))
8016dd8: 46 a0 00 04 be r21,r0,8016de8 <msdos_find_name_in_fat_file+0xc0>
lfn_entries = 0;
8016ddc: 5b 80 00 54 sw (sp+84),r0
* 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))
8016de0: 34 09 00 01 mvi r9,1
8016de4: 44 c9 00 05 be r6,r9,8016df8 <msdos_find_name_in_fat_file+0xd0>
lfn_entries = 0;
else
lfn_entries =
8016de8: 36 e1 00 0c addi r1,r23,12
8016dec: 34 02 00 0d mvi r2,13
8016df0: fb ff a9 58 calli 8001350 <__divsi3>
8016df4: 5b 81 00 54 sw (sp+84),r1
((name_len - 1) + MSDOS_LFN_LEN_PER_ENTRY) / MSDOS_LFN_LEN_PER_ENTRY;
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
8016df8: 2b 82 00 50 lw r2,(sp+80)
8016dfc: 34 09 00 01 mvi r9,1
8016e00: 28 4a 00 20 lw r10,(r2+32)
8016e04: 5d 49 00 0a bne r10,r9,8016e2c <msdos_find_name_in_fat_file+0x104>
8016e08: 28 49 00 24 lw r9,(r2+36)
8016e0c: 5d 20 00 08 bne r9,r0,8016e2c <msdos_find_name_in_fat_file+0x104><== NEVER TAKEN
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
8016e10: 2b 83 00 64 lw r3,(sp+100)
8016e14: 40 6a 00 0e lbu r10,(r3+14)
8016e18: 21 4a 00 03 andi r10,r10,0x3
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) &&
8016e1c: 45 49 00 04 be r10,r9,8016e2c <msdos_find_name_in_fat_file+0x104>
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
8016e20: 28 44 00 18 lw r4,(r2+24)
8016e24: 5b 84 00 5c sw (sp+92),r4
8016e28: e0 00 00 04 bi 8016e38 <msdos_find_name_in_fat_file+0x110>
else
bts2rd = fs_info->fat.vol.bpc;
8016e2c: 2b 8f 00 64 lw r15,(sp+100)
8016e30: 2d ef 00 06 lhu r15,(r15+6)
8016e34: 5b 8f 00 5c sw (sp+92),r15
/*
* Remainder is not empty so is this entry empty ?
*/
empty_space_count++;
if (empty_space_count == (lfn_entries + 1))
8016e38: 2b 81 00 54 lw r1,(sp+84)
/*
* 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),
8016e3c: 34 16 00 00 mvi r22,0
8016e40: 5b 97 00 6c sw (sp+108),r23
/*
* Remainder is not empty so is this entry empty ?
*/
empty_space_count++;
if (empty_space_count == (lfn_entries + 1))
8016e44: 34 21 00 01 addi r1,r1,1
8016e48: ba c0 b8 00 mv r23,r22
8016e4c: 5b 9b 00 68 sw (sp+104),fp
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;
8016e50: 34 19 00 00 mvi r25,0
8016e54: ba a0 d8 00 mv fp,r21
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;
8016e58: 34 11 00 00 mvi r17,0
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;
8016e5c: 5b 80 00 60 sw (sp+96),r0
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;
8016e60: 5b 80 00 58 sw (sp+88),r0
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;
8016e64: 34 12 00 00 mvi r18,0
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;
8016e68: 34 18 00 00 mvi r24,0
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;
8016e6c: 34 0c 00 00 mvi r12,0
char *name_dir_entry
)
{
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
uint32_t dir_offset = 0;
8016e70: 34 13 00 00 mvi r19,0
memcpy(name_dir_entry, entry,
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
return RC_OK;
}
lfn_start.cln = FAT_FILE_SHORT_NAME;
8016e74: 34 14 ff ff mvi r20,-1
/*
* Remainder is not empty so is this entry empty ?
*/
empty_space_count++;
if (empty_space_count == (lfn_entries + 1))
8016e78: 5b 81 00 70 sw (sp+112),r1
8016e7c: 2b 8e 00 5c lw r14,(sp+92)
8016e80: 2b 96 00 54 lw r22,(sp+84)
8016e84: 2b 95 00 64 lw r21,(sp+100)
/*
* 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),
8016e88: e0 00 01 06 bi 80172a0 <msdos_find_name_in_fat_file+0x578>
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)
8016e8c: 34 02 00 1f mvi r2,31
8016e90: 49 42 00 02 bg r10,r2,8016e98 <msdos_find_name_in_fat_file+0x170><== ALWAYS TAKEN
8016e94: e0 00 02 61 bi 8017818 <msdos_find_name_in_fat_file+0xaf0> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
assert(ret == bts2rd);
8016e98: 45 4e 00 09 be r10,r14,8016ebc <msdos_find_name_in_fat_file+0x194><== ALWAYS TAKEN
8016e9c: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED
8016ea0: 78 03 08 02 mvhi r3,0x802 <== NOT EXECUTED
8016ea4: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED
8016ea8: 38 21 eb 78 ori r1,r1,0xeb78 <== NOT EXECUTED
8016eac: 34 02 03 f9 mvi r2,1017 <== NOT EXECUTED
8016eb0: 38 63 ec 4c ori r3,r3,0xec4c <== NOT EXECUTED
8016eb4: 38 84 ec 08 ori r4,r4,0xec08 <== NOT EXECUTED
8016eb8: fb ff eb 97 calli 8011d14 <__assert_func> <== NOT EXECUTED
8016ebc: 34 10 00 00 mvi r16,0
/* 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;
8016ec0: 2a af 00 a0 lw r15,(r21+160)
8016ec4: b5 f0 78 00 add r15,r15,r16
/*
* 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) ==
8016ec8: 41 ea 00 00 lbu r10,(r15+0)
* to here and write the long file name if this is the start of
* a series of empty entries. If empty_space_count is 0 then
* we are currently not inside an empty series of entries. It
* is a count of empty entries.
*/
if (empty_space_count == 0)
8016ecc: 5e 20 00 03 bne r17,r0,8016ed8 <msdos_find_name_in_fat_file+0x1b0>
8016ed0: 5b 90 00 60 sw (sp+96),r16
8016ed4: 5b 93 00 58 sw (sp+88),r19
{
empty_space_entry = dir_entry;
empty_space_offset = dir_offset;
}
if (remainder_empty)
8016ed8: 5d 40 00 0f bne r10,r0,8016f14 <msdos_find_name_in_fat_file+0x1ec>
8016edc: bb 60 a8 00 mv r21,fp
/*
* If just looking and there is no more entries in the
* directory - return name-not-found
*/
if (!create_node)
return MSDOS_NAME_NOT_FOUND_ERR;
8016ee0: 34 0d 7d 01 mvi r13,32001
8016ee4: 2b 9b 00 68 lw fp,(sp+104)
#endif
/*
* If just looking and there is no more entries in the
* directory - return name-not-found
*/
if (!create_node)
8016ee8: 46 aa 02 5e be r21,r10,8017860 <msdos_find_name_in_fat_file+0xb38>
* 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)
8016eec: 5f 20 00 f9 bne r25,r0,80172d0 <msdos_find_name_in_fat_file+0x5a8>
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
else
bts2rd = fs_info->fat.vol.bpc;
entries_per_block = bts2rd / MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
8016ef0: 2b 81 00 5c lw r1,(sp+92)
8016ef4: 34 02 00 05 mvi r2,5
8016ef8: f8 00 59 58 calli 802d458 <__lshrsi3>
* are needed FAT_EOF is returned by the read and we extend the file.
*/
if (!empty_space_found)
{
empty_space_count +=
entries_per_block - (dir_entry / MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
8016efc: b6 21 60 00 add r12,r17,r1
8016f00: 34 02 00 05 mvi r2,5
8016f04: ba 00 08 00 mv r1,r16
8016f08: f8 00 59 54 calli 802d458 <__lshrsi3>
* 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 +=
8016f0c: c9 81 88 00 sub r17,r12,r1
8016f10: e0 00 00 f0 bi 80172d0 <msdos_find_name_in_fat_file+0x5a8>
printf ("MSFS:[3.2] esf:%i esc%i\n", empty_space_found, empty_space_count);
#endif
}
break;
}
else if (entry_empty)
8016f14: 34 03 00 e5 mvi r3,229
8016f18: 5d 43 00 06 bne r10,r3,8016f30 <msdos_find_name_in_fat_file+0x208>
{
if (create_node)
8016f1c: 47 60 00 dd be fp,r0,8017290 <msdos_find_name_in_fat_file+0x568>
/*
* Remainder is not empty so is this entry empty ?
*/
empty_space_count++;
if (empty_space_count == (lfn_entries + 1))
8016f20: 2b 84 00 70 lw r4,(sp+112)
if (create_node)
{
/*
* Remainder is not empty so is this entry empty ?
*/
empty_space_count++;
8016f24: 36 31 00 01 addi r17,r17,1
if (empty_space_count == (lfn_entries + 1))
8016f28: 5e 24 00 da bne r17,r4,8017290 <msdos_find_name_in_fat_file+0x568>
8016f2c: e0 00 00 d8 bi 801728c <msdos_find_name_in_fat_file+0x564>
* 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)
8016f30: 47 60 00 04 be fp,r0,8016f40 <msdos_find_name_in_fat_file+0x218>
8016f34: 5f 20 00 03 bne r25,r0,8016f40 <msdos_find_name_in_fat_file+0x218><== NEVER TAKEN
{
empty_space_entry = 0;
empty_space_count = 0;
8016f38: 34 11 00 00 mvi r17,0
* If empty space has not been found we need to start the
* count again.
*/
if (create_node && !empty_space_found)
{
empty_space_entry = 0;
8016f3c: 5b 80 00 60 sw (sp+96),r0
/*
* Check the attribute to see if the entry is for a long
* file name.
*/
if ((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
8016f40: 41 e3 00 0b lbu r3,(r15+11)
8016f44: 34 01 00 0f mvi r1,15
8016f48: 20 63 00 3f andi r3,r3,0x3f
8016f4c: 5c 61 00 42 bne r3,r1,8017054 <msdos_find_name_in_fat_file+0x32c>
#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)
8016f50: 2b 83 00 84 lw r3,(sp+132)
8016f54: 5c 74 00 0a bne r3,r20,8016f7c <msdos_find_name_in_fat_file+0x254>
/*
* The first entry must have the last long entry
* flag set.
*/
if ((*MSDOS_DIR_ENTRY_TYPE(entry) &
8016f58: 21 43 00 40 andi r3,r10,0x40
* If we are not already processing a LFN see if this is
* the first entry of a LFN ?
*/
if (lfn_start.cln == FAT_FILE_SHORT_NAME)
{
lfn_matched = false;
8016f5c: 34 0c 00 00 mvi r12,0
/*
* The first entry must have the last long entry
* flag set.
*/
if ((*MSDOS_DIR_ENTRY_TYPE(entry) &
8016f60: 44 60 00 cc be r3,r0,8017290 <msdos_find_name_in_fat_file+0x568>
* 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) &
8016f64: 21 4a 00 3f andi r10,r10,0x3f
8016f68: 5e ca 00 ca bne r22,r10,8017290 <msdos_find_name_in_fat_file+0x568>
continue;
/*
* Get the checksum of the short entry.
*/
lfn_start.cln = dir_offset;
8016f6c: 5b 93 00 84 sw (sp+132),r19
lfn_start.ofs = dir_entry;
8016f70: 5b 90 00 88 sw (sp+136),r16
lfn_entry = lfn_entries;
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
8016f74: 41 f8 00 0d lbu r24,(r15+13)
8016f78: ba c0 90 00 mv r18,r22
* 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) &
8016f7c: 41 e3 00 00 lbu r3,(r15+0)
8016f80: 20 63 00 3f andi r3,r3,0x3f
8016f84: 5e 43 00 03 bne r18,r3,8016f90 <msdos_find_name_in_fat_file+0x268><== NEVER TAKEN
MSDOS_LAST_LONG_ENTRY_MASK)) ||
8016f88: 41 e3 00 0d lbu r3,(r15+13)
8016f8c: 44 78 00 03 be r3,r24,8016f98 <msdos_find_name_in_fat_file+0x270><== ALWAYS TAKEN
(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;
8016f90: 5b 94 00 84 sw (sp+132),r20 <== NOT EXECUTED
continue;
8016f94: e0 00 00 bf bi 8017290 <msdos_find_name_in_fat_file+0x568> <== NOT EXECUTED
}
lfn_entry--;
8016f98: 36 4b ff ff addi r11,r18,-1
o = lfn_entry * MSDOS_LFN_LEN_PER_ENTRY;
8016f9c: 34 02 00 01 mvi r2,1
8016fa0: b9 60 08 00 mv r1,r11
8016fa4: fb ff a8 91 calli 80011e8 <__ashlsi3>
8016fa8: b4 2b 08 00 add r1,r1,r11
8016fac: 34 02 00 02 mvi r2,2
8016fb0: fb ff a8 8e calli 80011e8 <__ashlsi3>
8016fb4: b4 2b 08 00 add r1,r1,r11
p = entry + 1;
8016fb8: 35 ef 00 01 addi r15,r15,1
8016fbc: b8 20 30 00 mv r6,r1
#if MSDOS_FIND_PRINT
printf ("MSFS:[5] lfne:%i\n", lfn_entry);
#endif
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; i++)
8016fc0: 34 05 00 00 mvi r5,0
{
#if MSDOS_FIND_PRINT > 1
printf ("MSFS:[6] o:%i i:%i *p:%c(%02x) name[o + i]:%c(%02x)\n",
o, i, *p, *p, name[o + i], name[o + i]);
#endif
if (*p == '\0')
8016fc4: 41 e3 00 00 lbu r3,(r15+0)
8016fc8: 5c 60 00 06 bne r3,r0,8016fe0 <msdos_find_name_in_fat_file+0x2b8>
/*
* 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) &&
8016fcc: 5e 56 00 1b bne r18,r22,8017038 <msdos_find_name_in_fat_file+0x310><== NEVER TAKEN
8016fd0: 2b 82 00 6c lw r2,(sp+108)
((o + i) != name_len))
8016fd4: b4 a1 18 00 add r3,r5,r1
/*
* 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) &&
8016fd8: 5c 62 00 08 bne r3,r2,8016ff8 <msdos_find_name_in_fat_file+0x2d0><== NEVER TAKEN
8016fdc: e0 00 00 17 bi 8017038 <msdos_find_name_in_fat_file+0x310>
((o + i) != name_len))
lfn_start.cln = FAT_FILE_SHORT_NAME;
break;
}
if (((o + i) >= name_len) || (*p != name[o + i]))
8016fe0: 2b 84 00 6c lw r4,(sp+108)
8016fe4: 4c c4 00 05 bge r6,r4,8016ff8 <msdos_find_name_in_fat_file+0x2d0>
* 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(
8016fe8: 2b 84 00 74 lw r4,(sp+116)
8016fec: b4 86 10 00 add r2,r4,r6
((o + i) != name_len))
lfn_start.cln = FAT_FILE_SHORT_NAME;
break;
}
if (((o + i) >= name_len) || (*p != name[o + i]))
8016ff0: 40 42 00 00 lbu r2,(r2+0)
8016ff4: 44 43 00 03 be r2,r3,8017000 <msdos_find_name_in_fat_file+0x2d8>
{
lfn_start.cln = FAT_FILE_SHORT_NAME;
8016ff8: 5b 94 00 84 sw (sp+132),r20
break;
8016ffc: e0 00 00 0f bi 8017038 <msdos_find_name_in_fat_file+0x310>
}
switch (i)
8017000: 34 02 00 04 mvi r2,4
8017004: 44 a2 00 04 be r5,r2,8017014 <msdos_find_name_in_fat_file+0x2ec>
8017008: 34 03 00 0a mvi r3,10
801700c: 5c a3 00 06 bne r5,r3,8017024 <msdos_find_name_in_fat_file+0x2fc>
8017010: e0 00 00 03 bi 801701c <msdos_find_name_in_fat_file+0x2f4>
{
case 4:
p += 5;
8017014: 35 ef 00 05 addi r15,r15,5
break;
8017018: e0 00 00 04 bi 8017028 <msdos_find_name_in_fat_file+0x300>
case 10:
p += 4;
801701c: 35 ef 00 04 addi r15,r15,4
break;
8017020: e0 00 00 02 bi 8017028 <msdos_find_name_in_fat_file+0x300>
default:
p += 2;
8017024: 35 ef 00 02 addi r15,r15,2
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++)
8017028: 34 a5 00 01 addi r5,r5,1
801702c: 34 04 00 0d mvi r4,13
8017030: 34 c6 00 01 addi r6,r6,1
8017034: 5c a4 ff e4 bne r5,r4,8016fc4 <msdos_find_name_in_fat_file+0x29c>
p += 2;
break;
}
}
lfn_matched = ((lfn_entry == 0) &&
8017038: 34 0c 00 00 mvi r12,0
801703c: 5d 60 00 03 bne r11,r0,8017048 <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(
8017040: 2b 8c 00 84 lw r12,(sp+132)
8017044: 7d 8c ff ff cmpnei r12,r12,-1
p += 2;
break;
}
}
lfn_matched = ((lfn_entry == 0) &&
8017048: 21 8c 00 ff andi r12,r12,0xff
#endif
lfn_start.cln = FAT_FILE_SHORT_NAME;
continue;
}
lfn_entry--;
801704c: b9 60 90 00 mv r18,r11
8017050: e0 00 00 90 bi 8017290 <msdos_find_name_in_fat_file+0x568>
* 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)
8017054: 45 80 00 15 be r12,r0,80170a8 <msdos_find_name_in_fat_file+0x380>
8017058: 34 0c 00 00 mvi r12,0
801705c: 34 01 00 00 mvi r1,0
{
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++)
8017060: 34 0d 00 0b mvi r13,11
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
8017064: 20 22 00 01 andi r2,r1,0x1
8017068: 34 0b 00 00 mvi r11,0
801706c: 44 40 00 02 be r2,r0,8017074 <msdos_find_name_in_fat_file+0x34c>
8017070: 34 0b 00 80 mvi r11,128
8017074: 34 02 00 01 mvi r2,1
8017078: f8 00 58 f8 calli 802d458 <__lshrsi3>
* 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(
801707c: b5 ec 10 00 add r2,r15,r12
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;
8017080: 40 42 00 00 lbu r2,(r2+0)
{
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++)
8017084: 35 8c 00 01 addi r12,r12,1
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
8017088: b4 22 08 00 add r1,r1,r2
801708c: b4 2b 08 00 add r1,r1,r11
8017090: 20 21 00 ff andi r1,r1,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++)
8017094: 5d 8d ff f4 bne r12,r13,8017064 <msdos_find_name_in_fat_file+0x33c>
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
if (lfn_entry || (lfn_checksum != cs))
8017098: ff 01 58 00 cmpne r11,r24,r1
801709c: 7e 44 00 00 cmpnei r4,r18,0
80170a0: b9 64 58 00 or r11,r11,r4
80170a4: 45 60 00 0b be r11,r0,80170d0 <msdos_find_name_in_fat_file+0x3a8><== ALWAYS TAKEN
* 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 ||
80170a8: 2b 81 00 68 lw r1,(sp+104)
80170ac: 34 02 00 01 mvi r2,1
80170b0: 5c 22 00 74 bne r1,r2,8017280 <msdos_find_name_in_fat_file+0x558>
((name_type == MSDOS_NAME_SHORT) &&
80170b4: 2b 83 00 84 lw r3,(sp+132)
80170b8: 5c 74 00 72 bne r3,r20,8017280 <msdos_find_name_in_fat_file+0x558><== NEVER TAKEN
(lfn_start.cln == FAT_FILE_SHORT_NAME) &&
(memcmp(MSDOS_DIR_NAME(entry),
80170bc: 2b 82 00 48 lw r2,(sp+72)
80170c0: b9 e0 08 00 mv r1,r15
80170c4: 34 03 00 0b mvi r3,11
80170c8: f8 00 12 10 calli 801b908 <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) &&
80170cc: 5c 20 00 6d bne r1,r0,8017280 <msdos_find_name_in_fat_file+0x558>
#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,
80170d0: 2b 81 00 64 lw r1,(sp+100)
80170d4: 2b 82 00 50 lw r2,(sp+80)
80170d8: 2b 85 00 4c lw r5,(sp+76)
80170dc: 34 03 00 01 mvi r3,1
80170e0: ba e0 20 00 mv r4,r23
80170e4: fb ff e1 8b calli 800f710 <fat_file_ioctl>
80170e8: b8 20 68 00 mv r13,r1
dir_offset * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
80170ec: 5c 20 01 dd bne r1,r0,8017860 <msdos_find_name_in_fat_file+0xb38><== NEVER TAKEN
return rc;
dir_pos->sname.ofs = dir_entry;
80170f0: 2b 83 00 4c lw r3,(sp+76)
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
80170f4: 2b 8a 00 84 lw r10,(sp+132)
80170f8: 34 0b ff ff mvi r11,-1
dir_offset * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
return rc;
dir_pos->sname.ofs = dir_entry;
80170fc: 58 70 00 04 sw (r3+4),r16
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
8017100: 45 4b 00 0b be r10,r11,801712c <msdos_find_name_in_fat_file+0x404>
{
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
8017104: 2b 81 00 5c lw r1,(sp+92)
8017108: b9 40 10 00 mv r2,r10
801710c: fb ff a8 85 calli 8001320 <__mulsi3>
8017110: b8 20 20 00 mv r4,r1
8017114: 2b 82 00 50 lw r2,(sp+80)
8017118: 2b 81 00 64 lw r1,(sp+100)
801711c: 34 03 00 01 mvi r3,1
8017120: 37 85 00 84 addi r5,sp,132
8017124: fb ff e1 7b calli 800f710 <fat_file_ioctl>
lfn_start.cln * bts2rd,
&lfn_start.cln);
if (rc != RC_OK)
8017128: 5c 20 01 c9 bne r1,r0,801784c <msdos_find_name_in_fat_file+0xb24><== NEVER TAKEN
return rc;
}
dir_pos->lname.cln = lfn_start.cln;
801712c: 2b 84 00 4c lw r4,(sp+76)
8017130: 2b 83 00 84 lw r3,(sp+132)
8017134: 58 83 00 08 sw (r4+8),r3
dir_pos->lname.ofs = lfn_start.ofs;
8017138: 2b 83 00 88 lw r3,(sp+136)
801713c: 58 83 00 0c sw (r4+12),r3
memcpy(name_dir_entry, entry,
8017140: 41 f6 00 06 lbu r22,(r15+6)
8017144: 41 e4 00 01 lbu r4,(r15+1)
8017148: 41 e2 00 00 lbu r2,(r15+0)
801714c: 41 e6 00 02 lbu r6,(r15+2)
8017150: 41 e8 00 03 lbu r8,(r15+3)
8017154: 41 ea 00 04 lbu r10,(r15+4)
8017158: 41 ec 00 05 lbu r12,(r15+5)
801715c: 33 96 00 4c sb (sp+76),r22
8017160: 41 e1 00 07 lbu r1,(r15+7)
8017164: 33 81 00 54 sb (sp+84),r1
8017168: 41 e3 00 08 lbu r3,(r15+8)
801716c: 33 83 00 58 sb (sp+88),r3
8017170: 41 f6 00 09 lbu r22,(r15+9)
8017174: 33 96 00 5c sb (sp+92),r22
8017178: 41 e1 00 0a lbu r1,(r15+10)
801717c: 33 81 00 50 sb (sp+80),r1
8017180: 41 e3 00 0b lbu r3,(r15+11)
8017184: 33 83 00 64 sb (sp+100),r3
8017188: 41 f6 00 0c lbu r22,(r15+12)
801718c: 33 96 00 60 sb (sp+96),r22
8017190: 41 fd 00 0d lbu ra,(r15+13)
8017194: 41 fb 00 0e lbu fp,(r15+14)
8017198: 41 f9 00 0f lbu r25,(r15+15)
801719c: 41 f8 00 10 lbu r24,(r15+16)
80171a0: 41 f7 00 11 lbu r23,(r15+17)
80171a4: 41 f6 00 12 lbu r22,(r15+18)
80171a8: 41 f5 00 13 lbu r21,(r15+19)
80171ac: 41 f4 00 14 lbu r20,(r15+20)
80171b0: 41 f3 00 15 lbu r19,(r15+21)
80171b4: 41 f2 00 16 lbu r18,(r15+22)
80171b8: 41 f1 00 17 lbu r17,(r15+23)
80171bc: 41 f0 00 18 lbu r16,(r15+24)
80171c0: 41 eb 00 19 lbu r11,(r15+25)
80171c4: 41 e9 00 1a lbu r9,(r15+26)
80171c8: 41 e7 00 1b lbu r7,(r15+27)
80171cc: 41 e5 00 1c lbu r5,(r15+28)
80171d0: 41 e3 00 1d lbu r3,(r15+29)
80171d4: 41 e1 00 1e lbu r1,(r15+30)
80171d8: 41 ee 00 1f lbu r14,(r15+31)
80171dc: 2b 8f 00 48 lw r15,(sp+72)
80171e0: 31 e2 00 00 sb (r15+0),r2
80171e4: 31 e4 00 01 sb (r15+1),r4
80171e8: 31 e6 00 02 sb (r15+2),r6
80171ec: 31 e8 00 03 sb (r15+3),r8
80171f0: 31 ea 00 04 sb (r15+4),r10
80171f4: 31 ec 00 05 sb (r15+5),r12
80171f8: 43 82 00 4c lbu r2,(sp+76)
80171fc: 31 e2 00 06 sb (r15+6),r2
8017200: 43 84 00 54 lbu r4,(sp+84)
8017204: 31 e4 00 07 sb (r15+7),r4
8017208: 43 82 00 58 lbu r2,(sp+88)
801720c: 31 e2 00 08 sb (r15+8),r2
8017210: 43 84 00 5c lbu r4,(sp+92)
8017214: 31 e4 00 09 sb (r15+9),r4
8017218: 43 82 00 50 lbu r2,(sp+80)
801721c: 31 e2 00 0a sb (r15+10),r2
8017220: 43 84 00 64 lbu r4,(sp+100)
8017224: 31 e4 00 0b sb (r15+11),r4
8017228: 43 82 00 60 lbu r2,(sp+96)
801722c: 31 fd 00 0d sb (r15+13),ra
8017230: 31 fb 00 0e sb (r15+14),fp
8017234: 31 e2 00 0c sb (r15+12),r2
8017238: 31 f9 00 0f sb (r15+15),r25
801723c: 31 f8 00 10 sb (r15+16),r24
8017240: 31 f7 00 11 sb (r15+17),r23
8017244: 31 f6 00 12 sb (r15+18),r22
8017248: 31 f5 00 13 sb (r15+19),r21
801724c: 31 f4 00 14 sb (r15+20),r20
8017250: 31 f3 00 15 sb (r15+21),r19
8017254: 31 f2 00 16 sb (r15+22),r18
8017258: 31 f1 00 17 sb (r15+23),r17
801725c: 31 f0 00 18 sb (r15+24),r16
8017260: 31 eb 00 19 sb (r15+25),r11
8017264: 31 e9 00 1a sb (r15+26),r9
8017268: 31 e7 00 1b sb (r15+27),r7
801726c: 31 e5 00 1c sb (r15+28),r5
8017270: 31 e3 00 1d sb (r15+29),r3
8017274: 31 e1 00 1e sb (r15+30),r1
8017278: 31 ee 00 1f sb (r15+31),r14
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
return RC_OK;
801727c: e0 00 01 79 bi 8017860 <msdos_find_name_in_fat_file+0xb38>
}
lfn_start.cln = FAT_FILE_SHORT_NAME;
8017280: 5b 94 00 84 sw (sp+132),r20
lfn_matched = false;
8017284: 34 0c 00 00 mvi r12,0
8017288: e0 00 00 02 bi 8017290 <msdos_find_name_in_fat_file+0x568>
* Remainder is not empty so is this entry empty ?
*/
empty_space_count++;
if (empty_space_count == (lfn_entries + 1))
empty_space_found = true;
801728c: 34 19 00 01 mvi r25,1
assert(ret == bts2rd);
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (dir_entry = 0;
dir_entry < bts2rd;
dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
8017290: 36 10 00 20 addi r16,r16,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;
8017294: 55 d0 ff 0b bgu r14,r16,8016ec0 <msdos_find_name_in_fat_file+0x198>
8017298: b6 ee b8 00 add r23,r23,r14
}
if (remainder_empty)
break;
dir_offset++;
801729c: 36 73 00 01 addi r19,r19,1
/*
* 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),
80172a0: 2b 82 00 50 lw r2,(sp+80)
80172a4: 2a a5 00 a0 lw r5,(r21+160)
80172a8: ba a0 08 00 mv r1,r21
80172ac: ba e0 18 00 mv r3,r23
80172b0: b9 c0 20 00 mv r4,r14
80172b4: fb ff e0 12 calli 800f2fc <fat_file_read>
80172b8: b8 20 50 00 mv r10,r1
80172bc: 5c 20 fe f4 bne r1,r0,8016e8c <msdos_find_name_in_fat_file+0x164>
80172c0: bb 60 a8 00 mv r21,fp
/*
* If we are not to create the entry return a not found error.
*/
if (!create_node)
return MSDOS_NAME_NOT_FOUND_ERR;
80172c4: 34 0d 7d 01 mvi r13,32001
80172c8: 2b 9b 00 68 lw fp,(sp+104)
}
/*
* If we are not to create the entry return a not found error.
*/
if (!create_node)
80172cc: 46 a1 01 65 be r21,r1,8017860 <msdos_find_name_in_fat_file+0xb38>
* 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)
80172d0: 34 09 00 02 mvi r9,2
80172d4: 5f 69 00 30 bne fp,r9,8017394 <msdos_find_name_in_fat_file+0x66c>
{
int slot = (((empty_space_offset * bts2rd) + empty_space_entry) /
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE) + lfn_entries + 1;
80172d8: 2b 83 00 54 lw r3,(sp+84)
* in this directory.
*/
lfn_checksum = 0;
if (name_type == MSDOS_NAME_LONG)
{
int slot = (((empty_space_offset * bts2rd) + empty_space_entry) /
80172dc: 2b 82 00 5c lw r2,(sp+92)
80172e0: 2b 81 00 58 lw r1,(sp+88)
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE) + lfn_entries + 1;
80172e4: 34 70 00 01 addi r16,r3,1
* in this directory.
*/
lfn_checksum = 0;
if (name_type == MSDOS_NAME_LONG)
{
int slot = (((empty_space_offset * bts2rd) + empty_space_entry) /
80172e8: fb ff a8 0e calli 8001320 <__mulsi3>
80172ec: 2b 84 00 60 lw r4,(sp+96)
80172f0: 34 02 00 05 mvi r2,5
80172f4: b4 24 08 00 add r1,r1,r4
80172f8: f8 00 58 58 calli 802d458 <__lshrsi3>
{
static const char* hex = "0123456789ABCDEF";
char* c = MSDOS_DIR_NAME(sfn);
int i;
for (i = 0; i < 2; i++, c++)
if ((*c == ' ') || (*c == '.'))
80172fc: 2b 8f 00 48 lw r15,(sp+72)
*/
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;
8017300: b6 01 80 00 add r16,r16,r1
{
static const char* hex = "0123456789ABCDEF";
char* c = MSDOS_DIR_NAME(sfn);
int i;
for (i = 0; i < 2; i++, c++)
if ((*c == ' ') || (*c == '.'))
8017304: 41 e6 00 00 lbu r6,(r15+0)
8017308: 64 c9 00 2e cmpei r9,r6,46
801730c: 64 c6 00 20 cmpei r6,r6,32
8017310: b9 26 30 00 or r6,r9,r6
8017314: 44 c0 00 03 be r6,r0,8017320 <msdos_find_name_in_fat_file+0x5f8>
*c = '_';
8017318: 34 06 00 5f mvi r6,95
801731c: 31 e6 00 00 sb (r15+0),r6
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++)
8017320: 2b 96 00 48 lw r22,(sp+72)
if ((*c == ' ') || (*c == '.'))
8017324: 42 c6 00 01 lbu r6,(r22+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++)
8017328: 36 cc 00 01 addi r12,r22,1
if ((*c == ' ') || (*c == '.'))
801732c: 64 c9 00 2e cmpei r9,r6,46
8017330: 64 c6 00 20 cmpei r6,r6,32
8017334: b9 26 30 00 or r6,r9,r6
8017338: 44 c0 00 03 be r6,r0,8017344 <msdos_find_name_in_fat_file+0x61c>
*c = '_';
801733c: 34 06 00 5f mvi r6,95
8017340: 32 c6 00 01 sb (r22+1),r6
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++)
8017344: 35 8c 00 01 addi r12,r12,1
if ((*c == ' ') || (*c == '.'))
*c = '_';
for (i = 0; i < 4; i++, c++)
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
8017348: 78 0d 08 02 mvhi r13,0x802
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++)
801734c: b9 80 70 00 mv r14,r12
8017350: 34 0b 00 0c mvi r11,12
if ((*c == ' ') || (*c == '.'))
*c = '_';
for (i = 0; i < 4; i++, c++)
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
8017354: 39 ad e2 68 ori r13,r13,0xe268
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++)
8017358: 34 0f ff fc mvi r15,-4
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
801735c: b9 60 10 00 mv r2,r11
8017360: ba 00 08 00 mv r1,r16
8017364: fb ff a7 c8 calli 8001284 <__ashrsi3>
8017368: 20 22 00 0f andi r2,r1,0xf
801736c: b5 a2 10 00 add r2,r13,r2
8017370: 40 42 00 00 lbu r2,(r2+0)
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++)
8017374: 35 6b ff fc addi r11,r11,-4
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
8017378: 31 c2 00 00 sb (r14+0),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++)
801737c: 35 ce 00 01 addi r14,r14,1
8017380: 5d 6f ff f7 bne r11,r15,801735c <msdos_find_name_in_fat_file+0x634>
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
*c++ = '~';
8017384: 34 06 00 7e mvi r6,126
8017388: 31 86 00 04 sb (r12+4),r6
*c++ = '1';
801738c: 34 06 00 31 mvi r6,49
8017390: 31 86 00 05 sb (r12+5),r6
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)
8017394: 2b 81 00 54 lw r1,(sp+84)
* 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;
8017398: 5b 80 00 68 sw (sp+104),r0
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)
801739c: 44 20 00 13 be r1,r0,80173e8 <msdos_find_name_in_fat_file+0x6c0>
80173a0: 34 0b 00 00 mvi r11,0
{
uint8_t* p = (uint8_t*) MSDOS_DIR_NAME(name_dir_entry);
int i;
for (i = 0; i < 11; i++, p++)
80173a4: 34 0d 00 0b mvi r13,11
80173a8: 34 01 00 00 mvi r1,0
lfn_checksum =
((lfn_checksum & 1) ? 0x80 : 0) + (lfn_checksum >> 1) + *p;
80173ac: 20 22 00 01 andi r2,r1,0x1
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 =
80173b0: 34 0c 00 00 mvi r12,0
80173b4: 44 40 00 02 be r2,r0,80173bc <msdos_find_name_in_fat_file+0x694>
80173b8: 34 0c 00 80 mvi r12,128
80173bc: 34 02 00 01 mvi r2,1
80173c0: f8 00 58 26 calli 802d458 <__lshrsi3>
* 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(
80173c4: 2b 83 00 48 lw r3,(sp+72)
80173c8: b4 6b 10 00 add r2,r3,r11
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 =
80173cc: 40 42 00 00 lbu r2,(r2+0)
if (lfn_entries)
{
uint8_t* p = (uint8_t*) MSDOS_DIR_NAME(name_dir_entry);
int i;
for (i = 0; i < 11; i++, p++)
80173d0: 35 6b 00 01 addi r11,r11,1
lfn_checksum =
80173d4: b4 22 08 00 add r1,r1,r2
80173d8: b4 2c 08 00 add r1,r1,r12
80173dc: 20 21 00 ff andi r1,r1,0xff
if (lfn_entries)
{
uint8_t* p = (uint8_t*) MSDOS_DIR_NAME(name_dir_entry);
int i;
for (i = 0; i < 11; i++, p++)
80173e0: 5d 6d ff f3 bne r11,r13,80173ac <msdos_find_name_in_fat_file+0x684>
80173e4: 5b 81 00 68 sw (sp+104),r1
* 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)
80173e8: 46 20 00 04 be r17,r0,80173f8 <msdos_find_name_in_fat_file+0x6d0>
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;
80173ec: 2b 84 00 58 lw r4,(sp+88)
80173f0: fe 64 58 00 cmpne r11,r19,r4
80173f4: e0 00 00 04 bi 8017404 <msdos_find_name_in_fat_file+0x6dc>
* 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)
80173f8: 5b 93 00 58 sw (sp+88),r19
{
read_cluster = true;
80173fc: 34 0b 00 01 mvi r11,1
empty_space_offset = dir_offset;
empty_space_entry = 0;
8017400: 5b 80 00 60 sw (sp+96),r0
read_cluster = true;
/*
* Handle the entry writes.
*/
lfn_start.cln = lfn_start.ofs = FAT_FILE_SHORT_NAME;
8017404: 2b 81 00 58 lw r1,(sp+88)
8017408: 2b 82 00 5c lw r2,(sp+92)
801740c: 34 06 ff ff mvi r6,-1
8017410: 5b 86 00 88 sw (sp+136),r6
8017414: 5b 86 00 84 sw (sp+132),r6
8017418: fb ff a7 c2 calli 8001320 <__mulsi3>
* 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(
801741c: 2b 8f 00 54 lw r15,(sp+84)
read_cluster = true;
/*
* Handle the entry writes.
*/
lfn_start.cln = lfn_start.ofs = FAT_FILE_SHORT_NAME;
8017420: b8 20 90 00 mv r18,r1
lfn_entry = 0;
8017424: 34 13 00 00 mvi r19,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(
8017428: 35 ef 00 01 addi r15,r15,1
801742c: 5b 8f 00 6c sw (sp+108),r15
8017430: 2b 91 00 5c lw r17,(sp+92)
8017434: 2b 97 00 60 lw r23,(sp+96)
8017438: 2b 8f 00 64 lw r15,(sp+100)
801743c: 2b 94 00 50 lw r20,(sp+80)
8017440: 2b 98 00 4c lw r24,(sp+76)
8017444: 2b 8d 00 48 lw r13,(sp+72)
#endif
/*
* The one more is the short entry.
*/
while (lfn_entry < (lfn_entries + 1))
8017448: e0 00 00 fd bi 801783c <msdos_find_name_in_fat_file+0xb14>
{
int length = 0;
if (read_cluster)
801744c: 45 60 00 09 be r11,r0,8017470 <msdos_find_name_in_fat_file+0x748>
{
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,
8017450: 29 e5 00 a0 lw r5,(r15+160)
8017454: b9 e0 08 00 mv r1,r15
8017458: ba 80 10 00 mv r2,r20
801745c: ba 40 18 00 mv r3,r18
8017460: ba 20 20 00 mv r4,r17
8017464: fb ff df a6 calli 800f2fc <fat_file_read>
8017468: b8 20 58 00 mv r11,r1
(empty_space_offset * bts2rd), bts2rd,
fs_info->cl_buf);
if (ret != bts2rd)
801746c: 5c 31 00 15 bne r1,r17,80174c0 <msdos_find_name_in_fat_file+0x798><== ALWAYS TAKEN
* 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(
8017470: 2b 81 00 54 lw r1,(sp+84)
#endif
ret = fat_file_read(&fs_info->fat, fat_fd,
(empty_space_offset * bts2rd), bts2rd,
fs_info->cl_buf);
if (ret != bts2rd)
8017474: 2b 96 00 6c lw r22,(sp+108)
* 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(
8017478: a6 60 58 00 not r11,r19
801747c: b5 61 58 00 add r11,r11,r1
8017480: 36 66 00 01 addi r6,r19,1
#endif
ret = fat_file_read(&fs_info->fat, fat_fd,
(empty_space_offset * bts2rd), bts2rd,
fs_info->cl_buf);
if (ret != bts2rd)
8017484: ca c6 30 00 sub r6,r22,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(
8017488: b9 60 08 00 mv r1,r11
801748c: 34 02 00 01 mvi r2,1
#endif
ret = fat_file_read(&fs_info->fat, fat_fd,
(empty_space_offset * bts2rd), bts2rd,
fs_info->cl_buf);
if (ret != bts2rd)
8017490: 20 d0 00 ff andi r16,r6,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(
8017494: fb ff a7 55 calli 80011e8 <__ashlsi3>
8017498: b4 2b 08 00 add r1,r1,r11
801749c: 34 02 00 02 mvi r2,2
80174a0: fb ff a7 52 calli 80011e8 <__ashlsi3>
80174a4: 2b 82 00 74 lw r2,(sp+116)
80174a8: b4 2b 58 00 add r11,r1,r11
80174ac: ba e0 70 00 mv r14,r23
80174b0: b4 4b 58 00 add r11,r2,r11
80174b4: 34 15 00 00 mvi r21,0
break;
}
}
*MSDOS_DIR_ENTRY_TYPE(entry) = (lfn_entries - lfn_entry) + 1;
if (lfn_entry == 1)
80174b8: 34 16 00 01 mvi r22,1
80174bc: e0 00 00 cb bi 80177e8 <msdos_find_name_in_fat_file+0xac0>
(empty_space_offset * bts2rd), bts2rd,
fs_info->cl_buf);
if (ret != bts2rd)
{
if (ret != FAT_EOF)
80174c0: 5c 20 00 d6 bne r1,r0,8017818 <msdos_find_name_in_fat_file+0xaf0><== NEVER TAKEN
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,
80174c4: b9 e0 08 00 mv r1,r15
80174c8: ba 80 10 00 mv r2,r20
80174cc: 34 03 00 00 mvi r3,0
80174d0: ba 40 20 00 mv r4,r18
80174d4: 37 85 00 8c addi r5,sp,140
80174d8: fb ff e0 c4 calli 800f7e8 <fat_file_extend>
80174dc: b8 20 30 00 mv r6,r1
empty_space_offset * bts2rd, &new_length);
if (ret != RC_OK)
80174e0: 5c 2b 00 dd bne r1,r11,8017854 <msdos_find_name_in_fat_file+0xb2c><== NEVER TAKEN
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))
80174e4: 2b 86 00 8c lw r6,(sp+140)
80174e8: 5c d2 00 cc bne r6,r18,8017818 <msdos_find_name_in_fat_file+0xaf0><== NEVER TAKEN
rtems_set_errno_and_return_minus_one(EIO);
memset(fs_info->cl_buf, 0, bts2rd);
80174ec: 29 e1 00 a0 lw r1,(r15+160)
80174f0: 34 02 00 00 mvi r2,0
80174f4: ba 20 18 00 mv r3,r17
80174f8: f8 00 11 66 calli 801ba90 <memset>
ret = fat_file_write(&fs_info->fat, fat_fd,
80174fc: 29 e5 00 a0 lw r5,(r15+160)
8017500: ba 40 18 00 mv r3,r18
8017504: b9 e0 08 00 mv r1,r15
8017508: ba 80 10 00 mv r2,r20
801750c: ba 20 20 00 mv r4,r17
8017510: fb ff e1 4b calli 800fa3c <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)
8017514: 34 03 ff ff mvi r3,-1
8017518: 44 23 00 d1 be r1,r3,801785c <msdos_find_name_in_fat_file+0xb34><== ALWAYS TAKEN
return ret;
else if (ret != bts2rd)
801751c: 44 31 ff d5 be r1,r17,8017470 <msdos_find_name_in_fat_file+0x748><== NOT EXECUTED
8017520: e0 00 00 be bi 8017818 <msdos_find_name_in_fat_file+0xaf0> <== NOT EXECUTED
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;
8017524: 29 ec 00 a0 lw r12,(r15+160)
length, lfn_entry);
#endif
/*
* Time to write the short file name entry.
*/
if (lfn_entry == (lfn_entries + 1))
8017528: 2b 84 00 6c lw r4,(sp+108)
const char* n;
int i;
char fill = 0;
length += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
lfn_entry++;
801752c: 36 73 00 01 addi r19,r19,1
for (dir_entry = empty_space_entry;
dir_entry < bts2rd;
dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + dir_entry;
8017530: b5 8e 60 00 add r12,r12,r14
char* p;
const char* n;
int i;
char fill = 0;
length += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
8017534: 36 b5 00 20 addi r21,r21,32
length, lfn_entry);
#endif
/*
* Time to write the short file name entry.
*/
if (lfn_entry == (lfn_entries + 1))
8017538: 5e 64 00 7c bne r19,r4,8017728 <msdos_find_name_in_fat_file+0xa00>
{
/* get current cluster number */
int rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
801753c: b9 e0 08 00 mv r1,r15
8017540: ba 80 10 00 mv r2,r20
8017544: 34 03 00 01 mvi r3,1
8017548: ba 40 20 00 mv r4,r18
801754c: bb 00 28 00 mv r5,r24
8017550: fb ff e0 70 calli 800f710 <fat_file_ioctl>
8017554: b8 20 30 00 mv r6,r1
empty_space_offset * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
8017558: 5c 20 00 bf bne r1,r0,8017854 <msdos_find_name_in_fat_file+0xb2c><== NEVER TAKEN
return rc;
dir_pos->sname.ofs = dir_entry;
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
801755c: 2b 86 00 84 lw r6,(sp+132)
empty_space_offset * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
return rc;
dir_pos->sname.ofs = dir_entry;
8017560: 5b 0e 00 04 sw (r24+4),r14
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
8017564: 34 16 ff ff mvi r22,-1
8017568: 44 d6 00 0d be r6,r22,801759c <msdos_find_name_in_fat_file+0x874>
{
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
801756c: b8 c0 10 00 mv r2,r6
8017570: ba 20 08 00 mv r1,r17
8017574: fb ff a7 6b calli 8001320 <__mulsi3>
8017578: b8 20 30 00 mv r6,r1
801757c: b8 c0 20 00 mv r4,r6
8017580: b9 e0 08 00 mv r1,r15
8017584: ba 80 10 00 mv r2,r20
8017588: 34 03 00 01 mvi r3,1
801758c: 37 85 00 84 addi r5,sp,132
8017590: fb ff e0 60 calli 800f710 <fat_file_ioctl>
8017594: b8 20 30 00 mv r6,r1
lfn_start.cln * bts2rd,
&lfn_start.cln);
if (rc != RC_OK)
8017598: 5c 20 00 af bne r1,r0,8017854 <msdos_find_name_in_fat_file+0xb2c><== NEVER TAKEN
return rc;
}
dir_pos->lname.cln = lfn_start.cln;
801759c: 2b 86 00 84 lw r6,(sp+132)
80175a0: 5b 06 00 08 sw (r24+8),r6
dir_pos->lname.ofs = lfn_start.ofs;
80175a4: 2b 86 00 88 lw r6,(sp+136)
80175a8: 5b 06 00 0c sw (r24+12),r6
/* write new node entry */
memcpy (entry, (uint8_t *) name_dir_entry,
80175ac: 41 a1 00 07 lbu r1,(r13+7)
80175b0: 41 a3 00 01 lbu r3,(r13+1)
80175b4: 41 a5 00 02 lbu r5,(r13+2)
80175b8: 41 a7 00 03 lbu r7,(r13+3)
80175bc: 41 a9 00 04 lbu r9,(r13+4)
80175c0: 41 ab 00 05 lbu r11,(r13+5)
80175c4: 41 b0 00 06 lbu r16,(r13+6)
80175c8: 33 81 00 4c sb (sp+76),r1
80175cc: 41 a2 00 08 lbu r2,(r13+8)
80175d0: 33 82 00 50 sb (sp+80),r2
80175d4: 41 a4 00 09 lbu r4,(r13+9)
80175d8: 33 84 00 60 sb (sp+96),r4
80175dc: 41 b6 00 0a lbu r22,(r13+10)
80175e0: 33 96 00 70 sb (sp+112),r22
80175e4: 41 a1 00 0b lbu r1,(r13+11)
80175e8: 33 81 00 7a sb (sp+122),r1
80175ec: 41 a2 00 0c lbu r2,(r13+12)
80175f0: 33 82 00 7b sb (sp+123),r2
80175f4: 41 a4 00 0d lbu r4,(r13+13)
80175f8: 33 84 00 7c sb (sp+124),r4
80175fc: 41 b6 00 0e lbu r22,(r13+14)
8017600: 33 96 00 7d sb (sp+125),r22
8017604: 41 a1 00 0f lbu r1,(r13+15)
8017608: 33 81 00 7e sb (sp+126),r1
801760c: 41 a2 00 10 lbu r2,(r13+16)
8017610: 33 82 00 7f sb (sp+127),r2
8017614: 41 a4 00 11 lbu r4,(r13+17)
8017618: 33 84 00 80 sb (sp+128),r4
801761c: 41 b6 00 12 lbu r22,(r13+18)
8017620: 33 96 00 81 sb (sp+129),r22
8017624: 41 a1 00 13 lbu r1,(r13+19)
8017628: 33 81 00 82 sb (sp+130),r1
801762c: 41 a2 00 14 lbu r2,(r13+20)
8017630: 33 82 00 83 sb (sp+131),r2
8017634: 41 a4 00 18 lbu r4,(r13+24)
8017638: 41 bd 00 15 lbu ra,(r13+21)
801763c: 41 bb 00 16 lbu fp,(r13+22)
8017640: 41 b9 00 17 lbu r25,(r13+23)
8017644: 33 84 00 48 sb (sp+72),r4
8017648: 41 b6 00 00 lbu r22,(r13+0)
801764c: 41 ae 00 19 lbu r14,(r13+25)
8017650: 41 aa 00 1a lbu r10,(r13+26)
8017654: 41 a8 00 1b lbu r8,(r13+27)
8017658: 41 a6 00 1c lbu r6,(r13+28)
801765c: 41 a4 00 1d lbu r4,(r13+29)
8017660: 41 a2 00 1e lbu r2,(r13+30)
8017664: 41 a1 00 1f lbu r1,(r13+31)
8017668: 31 96 00 00 sb (r12+0),r22
801766c: 31 83 00 01 sb (r12+1),r3
8017670: 31 85 00 02 sb (r12+2),r5
8017674: 31 87 00 03 sb (r12+3),r7
8017678: 31 89 00 04 sb (r12+4),r9
801767c: 31 8b 00 05 sb (r12+5),r11
8017680: 31 90 00 06 sb (r12+6),r16
8017684: 43 83 00 4c lbu r3,(sp+76)
8017688: 31 83 00 07 sb (r12+7),r3
801768c: 43 96 00 50 lbu r22,(sp+80)
8017690: 31 96 00 08 sb (r12+8),r22
8017694: 43 83 00 60 lbu r3,(sp+96)
8017698: 31 83 00 09 sb (r12+9),r3
801769c: 43 96 00 70 lbu r22,(sp+112)
80176a0: 31 96 00 0a sb (r12+10),r22
80176a4: 43 83 00 7a lbu r3,(sp+122)
80176a8: 31 83 00 0b sb (r12+11),r3
80176ac: 43 96 00 7b lbu r22,(sp+123)
80176b0: 31 96 00 0c sb (r12+12),r22
80176b4: 43 83 00 7c lbu r3,(sp+124)
80176b8: 31 83 00 0d sb (r12+13),r3
80176bc: 43 96 00 7d lbu r22,(sp+125)
80176c0: 31 96 00 0e sb (r12+14),r22
80176c4: 43 83 00 7e lbu r3,(sp+126)
80176c8: 31 83 00 0f sb (r12+15),r3
80176cc: 43 96 00 7f lbu r22,(sp+127)
80176d0: 31 96 00 10 sb (r12+16),r22
80176d4: 43 83 00 80 lbu r3,(sp+128)
80176d8: 31 83 00 11 sb (r12+17),r3
80176dc: 43 96 00 81 lbu r22,(sp+129)
80176e0: 31 96 00 12 sb (r12+18),r22
80176e4: 43 83 00 82 lbu r3,(sp+130)
80176e8: 31 83 00 13 sb (r12+19),r3
80176ec: 43 96 00 83 lbu r22,(sp+131)
80176f0: 31 9d 00 15 sb (r12+21),ra
80176f4: 31 9b 00 16 sb (r12+22),fp
80176f8: 31 96 00 14 sb (r12+20),r22
80176fc: 31 99 00 17 sb (r12+23),r25
8017700: 43 83 00 48 lbu r3,(sp+72)
8017704: 31 8e 00 19 sb (r12+25),r14
8017708: 31 8a 00 1a sb (r12+26),r10
801770c: 31 83 00 18 sb (r12+24),r3
8017710: 31 88 00 1b sb (r12+27),r8
8017714: 31 86 00 1c sb (r12+28),r6
8017718: 31 84 00 1d sb (r12+29),r4
801771c: 31 82 00 1e sb (r12+30),r2
8017720: 31 81 00 1f sb (r12+31),r1
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
break;
8017724: e0 00 00 32 bi 80177ec <msdos_find_name_in_fat_file+0xac4>
* 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)
8017728: 2b 82 00 84 lw r2,(sp+132)
801772c: 34 04 ff ff mvi r4,-1
8017730: 5c 44 00 04 bne r2,r4,8017740 <msdos_find_name_in_fat_file+0xa18>
{
lfn_start.cln = empty_space_offset;
8017734: 2b 81 00 58 lw r1,(sp+88)
lfn_start.ofs = dir_entry;
8017738: 5b 8e 00 88 sw (sp+136),r14
* 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;
801773c: 5b 81 00 84 sw (sp+132),r1
}
/*
* Clear the entry before loading the data.
*/
memset (entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
8017740: 34 02 00 00 mvi r2,0
8017744: 34 03 00 20 mvi r3,32
8017748: b9 80 08 00 mv r1,r12
801774c: f8 00 10 d1 calli 801ba90 <memset>
*MSDOS_DIR_LFN_CHECKSUM(entry) = lfn_checksum;
8017750: 2b 82 00 68 lw r2,(sp+104)
p = entry + 1;
8017754: 35 83 00 01 addi r3,r12,1
8017758: b9 60 28 00 mv r5,r11
/*
* Clear the entry before loading the data.
*/
memset (entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
*MSDOS_DIR_LFN_CHECKSUM(entry) = lfn_checksum;
801775c: 31 82 00 0d sb (r12+13),r2
{
char* entry = (char*) fs_info->cl_buf + dir_entry;
char* p;
const char* n;
int i;
char fill = 0;
8017760: 34 04 00 00 mvi r4,0
*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++)
8017764: 34 01 00 00 mvi r1,0
{
if (*n != 0)
8017768: 40 a2 00 00 lbu r2,(r5+0)
801776c: 44 40 00 04 be r2,r0,801777c <msdos_find_name_in_fat_file+0xa54>
{
*p = *n;
8017770: 30 62 00 00 sb (r3+0),r2
n++;
8017774: 34 a5 00 01 addi r5,r5,1
8017778: e0 00 00 04 bi 8017788 <msdos_find_name_in_fat_file+0xa60>
}
else
{
p [0] = fill;
801777c: 30 64 00 00 sb (r3+0),r4
p [1] = fill;
8017780: 30 64 00 01 sb (r3+1),r4
fill = 0xff;
8017784: 34 04 00 ff mvi r4,255
}
switch (i)
8017788: 34 02 00 04 mvi r2,4
801778c: 44 22 00 04 be r1,r2,801779c <msdos_find_name_in_fat_file+0xa74>
8017790: 34 02 00 0a mvi r2,10
8017794: 5c 22 00 06 bne r1,r2,80177ac <msdos_find_name_in_fat_file+0xa84>
8017798: e0 00 00 03 bi 80177a4 <msdos_find_name_in_fat_file+0xa7c>
{
case 4:
p += 5;
801779c: 34 63 00 05 addi r3,r3,5
break;
80177a0: e0 00 00 04 bi 80177b0 <msdos_find_name_in_fat_file+0xa88>
case 10:
p += 4;
80177a4: 34 63 00 04 addi r3,r3,4
break;
80177a8: e0 00 00 02 bi 80177b0 <msdos_find_name_in_fat_file+0xa88>
default:
p += 2;
80177ac: 34 63 00 02 addi r3,r3,2
*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++)
80177b0: 34 21 00 01 addi r1,r1,1
80177b4: 34 02 00 0d mvi r2,13
80177b8: 5c 22 ff ec bne r1,r2,8017768 <msdos_find_name_in_fat_file+0xa40>
p += 2;
break;
}
}
*MSDOS_DIR_ENTRY_TYPE(entry) = (lfn_entries - lfn_entry) + 1;
80177bc: 31 90 00 00 sb (r12+0),r16
if (lfn_entry == 1)
80177c0: 5e 76 00 03 bne r19,r22,80177cc <msdos_find_name_in_fat_file+0xaa4>
*MSDOS_DIR_ENTRY_TYPE(entry) |= MSDOS_LAST_LONG_ENTRY;
80177c4: 3a 02 00 40 ori r2,r16,0x40
80177c8: 31 82 00 00 sb (r12+0),r2
*MSDOS_DIR_ATTR(entry) |= MSDOS_ATTR_LFN;
80177cc: 41 82 00 0b lbu r2,(r12+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)
80177d0: 36 10 ff ff addi r16,r16,-1
80177d4: 35 ce 00 20 addi r14,r14,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;
80177d8: 38 42 00 0f ori r2,r2,0xf
80177dc: 31 82 00 0b sb (r12+11),r2
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)
80177e0: 22 10 00 ff andi r16,r16,0xff
80177e4: 35 6b ff f3 addi r11,r11,-13
#if MSDOS_FIND_PRINT
printf ("MSFS:[10] eso:%li\n", empty_space_offset);
#endif
for (dir_entry = empty_space_entry;
80177e8: 56 2e ff 4f bgu r17,r14,8017524 <msdos_find_name_in_fat_file+0x7fc><== ALWAYS TAKEN
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,
80177ec: 29 e6 00 a0 lw r6,(r15+160)
80177f0: b6 57 18 00 add r3,r18,r23
80177f4: b9 e0 08 00 mv r1,r15
80177f8: ba 80 10 00 mv r2,r20
80177fc: ba a0 20 00 mv r4,r21
8017800: b4 d7 28 00 add r5,r6,r23
8017804: fb ff e0 8e calli 800fa3c <fat_file_write>
(empty_space_offset * bts2rd) + empty_space_entry,
length, fs_info->cl_buf + empty_space_entry);
if (ret == -1)
8017808: 34 03 ff ff mvi r3,-1
801780c: 44 23 00 14 be r1,r3,801785c <msdos_find_name_in_fat_file+0xb34><== NEVER TAKEN
8017810: b6 51 90 00 add r18,r18,r17
return ret;
else if (ret != length)
8017814: 44 35 00 05 be r1,r21,8017828 <msdos_find_name_in_fat_file+0xb00><== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EIO);
8017818: f8 00 0d 0f calli 801ac54 <__errno> <== NOT EXECUTED
801781c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
8017820: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
8017824: e0 00 00 0e bi 801785c <msdos_find_name_in_fat_file+0xb34> <== NOT EXECUTED
empty_space_offset++;
8017828: 2b 84 00 58 lw r4,(sp+88)
empty_space_entry = 0;
801782c: 34 17 00 00 mvi r23,0
read_cluster = true;
8017830: 34 0b 00 01 mvi r11,1
if (ret == -1)
return ret;
else if (ret != length)
rtems_set_errno_and_return_minus_one(EIO);
empty_space_offset++;
8017834: 34 84 00 01 addi r4,r4,1
8017838: 5b 84 00 58 sw (sp+88),r4
#endif
/*
* The one more is the short entry.
*/
while (lfn_entry < (lfn_entries + 1))
801783c: 2b 96 00 54 lw r22,(sp+84)
8017840: 4e d3 ff 03 bge r22,r19,801744c <msdos_find_name_in_fat_file+0x724>
empty_space_offset++;
empty_space_entry = 0;
read_cluster = true;
}
return 0;
8017844: 34 0d 00 00 mvi r13,0
8017848: e0 00 00 06 bi 8017860 <msdos_find_name_in_fat_file+0xb38>
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
{
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
lfn_start.cln * bts2rd,
&lfn_start.cln);
if (rc != RC_OK)
801784c: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
8017850: e0 00 00 04 bi 8017860 <msdos_find_name_in_fat_file+0xb38> <== NOT EXECUTED
dir_pos->sname.ofs = dir_entry;
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
{
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
8017854: b8 c0 68 00 mv r13,r6 <== NOT EXECUTED
8017858: e0 00 00 02 bi 8017860 <msdos_find_name_in_fat_file+0xb38> <== NOT EXECUTED
}
ret = fat_file_write(&fs_info->fat, fat_fd,
(empty_space_offset * bts2rd) + empty_space_entry,
length, fs_info->cl_buf + empty_space_entry);
if (ret == -1)
801785c: 34 0d ff ff mvi r13,-1
empty_space_entry = 0;
read_cluster = true;
}
return 0;
}
8017860: b9 a0 08 00 mv r1,r13
8017864: 2b 9d 00 04 lw ra,(sp+4)
8017868: 2b 8b 00 44 lw r11,(sp+68)
801786c: 2b 8c 00 40 lw r12,(sp+64)
8017870: 2b 8d 00 3c lw r13,(sp+60)
8017874: 2b 8e 00 38 lw r14,(sp+56)
8017878: 2b 8f 00 34 lw r15,(sp+52)
801787c: 2b 90 00 30 lw r16,(sp+48)
8017880: 2b 91 00 2c lw r17,(sp+44)
8017884: 2b 92 00 28 lw r18,(sp+40)
8017888: 2b 93 00 24 lw r19,(sp+36)
801788c: 2b 94 00 20 lw r20,(sp+32)
8017890: 2b 95 00 1c lw r21,(sp+28)
8017894: 2b 96 00 18 lw r22,(sp+24)
8017898: 2b 97 00 14 lw r23,(sp+20)
801789c: 2b 98 00 10 lw r24,(sp+16)
80178a0: 2b 99 00 0c lw r25,(sp+12)
80178a4: 2b 9b 00 08 lw fp,(sp+8)
80178a8: 37 9c 00 8c addi sp,sp,140
80178ac: c3 a0 00 00 ret
080178b0 <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
)
{
80178b0: 37 9c ff b4 addi sp,sp,-76
80178b4: 5b 8b 00 44 sw (sp+68),r11
80178b8: 5b 8c 00 40 sw (sp+64),r12
80178bc: 5b 8d 00 3c sw (sp+60),r13
80178c0: 5b 8e 00 38 sw (sp+56),r14
80178c4: 5b 8f 00 34 sw (sp+52),r15
80178c8: 5b 90 00 30 sw (sp+48),r16
80178cc: 5b 91 00 2c sw (sp+44),r17
80178d0: 5b 92 00 28 sw (sp+40),r18
80178d4: 5b 93 00 24 sw (sp+36),r19
80178d8: 5b 94 00 20 sw (sp+32),r20
80178dc: 5b 95 00 1c sw (sp+28),r21
80178e0: 5b 96 00 18 sw (sp+24),r22
80178e4: 5b 97 00 14 sw (sp+20),r23
80178e8: 5b 98 00 10 sw (sp+16),r24
80178ec: 5b 99 00 0c sw (sp+12),r25
80178f0: 5b 9b 00 08 sw (sp+8),fp
80178f4: 5b 9d 00 04 sw (sp+4),ra
80178f8: b8 40 58 00 mv r11,r2
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) &&
80178fc: 28 42 00 20 lw r2,(r2+32)
char *dir_entry
)
{
int rc = RC_OK;
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
8017900: 28 2c 00 08 lw r12,(r1+8)
uint32_t bts2rd = 0;
uint32_t i = 0, j = 0;
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
8017904: 34 01 00 01 mvi r1,1
fat_file_fd_t *fat_fd,
uint32_t cl4find,
fat_dir_pos_t *dir_pos,
char *dir_entry
)
{
8017908: b8 60 a8 00 mv r21,r3
801790c: b8 80 78 00 mv r15,r4
8017910: b8 a0 90 00 mv r18,r5
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) &&
8017914: 5c 41 00 0b bne r2,r1,8017940 <msdos_find_node_by_cluster_num_in_fat_file+0x90><== ALWAYS TAKEN
8017918: 29 61 00 24 lw r1,(r11+36) <== NOT EXECUTED
801791c: 5c 20 00 09 bne r1,r0,8017940 <msdos_find_node_by_cluster_num_in_fat_file+0x90><== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
8017920: 41 82 00 0e lbu r2,(r12+14) <== NOT EXECUTED
8017924: 20 42 00 03 andi r2,r2,0x3 <== 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) &&
8017928: 44 41 00 06 be r2,r1,8017940 <msdos_find_node_by_cluster_num_in_fat_file+0x90><== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
801792c: 29 6d 00 18 lw r13,(r11+24) <== NOT EXECUTED
assert(ret == bts2rd);
for (i = 0; i < bts2rd; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + i;
8017930: 34 11 00 00 mvi r17,0
bts2rd = fs_info->fat.vol.bpc;
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 )
8017934: 34 17 00 1f mvi r23,31
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
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)) ==
8017938: 34 16 00 e5 mvi r22,229
801793c: e0 00 00 8e bi 8017b74 <msdos_find_node_by_cluster_num_in_fat_file+0x2c4>
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
else
bts2rd = fs_info->fat.vol.bpc;
8017940: 2d 8d 00 06 lhu r13,(r12+6)
8017944: e3 ff ff fb bi 8017930 <msdos_find_node_by_cluster_num_in_fat_file+0x80>
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 )
8017948: 48 37 00 06 bg r1,r23,8017960 <msdos_find_node_by_cluster_num_in_fat_file+0xb0><== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( EIO );
801794c: f8 00 0c c2 calli 801ac54 <__errno> <== NOT EXECUTED
8017950: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
8017954: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
8017958: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
801795c: e0 00 00 8e bi 8017b94 <msdos_find_node_by_cluster_num_in_fat_file+0x2e4><== NOT EXECUTED
assert(ret == bts2rd);
8017960: 44 2d 00 09 be r1,r13,8017984 <msdos_find_node_by_cluster_num_in_fat_file+0xd4>
8017964: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED
8017968: 78 03 08 02 mvhi r3,0x802 <== NOT EXECUTED
801796c: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED
8017970: 38 21 eb 78 ori r1,r1,0xeb78 <== NOT EXECUTED
8017974: 34 02 06 4e mvi r2,1614 <== NOT EXECUTED
8017978: 38 63 ec 20 ori r3,r3,0xec20 <== NOT EXECUTED
801797c: 38 84 ec 08 ori r4,r4,0xec08 <== NOT EXECUTED
8017980: fb ff e8 e5 calli 8011d14 <__assert_func> <== NOT EXECUTED
8017984: 29 8e 00 a0 lw r14,(r12+160)
for (i = 0; i < bts2rd; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + i;
8017988: 34 10 00 00 mvi r16,0
/* if this and all rest entries are empty - return not-found */
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
801798c: 41 c1 00 00 lbu r1,(r14+0)
8017990: 44 20 00 80 be r1,r0,8017b90 <msdos_find_node_by_cluster_num_in_fat_file+0x2e0><== NEVER TAKEN
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)) ==
8017994: 44 36 00 74 be r1,r22,8017b64 <msdos_find_node_by_cluster_num_in_fat_file+0x2b4><== NEVER TAKEN
MSDOS_THIS_DIR_ENTRY_EMPTY)
continue;
/* if get a non-empty entry - compare clusters num */
if (MSDOS_EXTRACT_CLUSTER_NUM(entry) == cl4find)
8017998: 2d d4 00 14 lhu r20,(r14+20)
801799c: 34 02 00 08 mvi r2,8
80179a0: 2d d3 00 1a lhu r19,(r14+26)
80179a4: ba 80 08 00 mv r1,r20
80179a8: fb ff a6 10 calli 80011e8 <__ashlsi3>
80179ac: b8 20 c0 00 mv r24,r1
80179b0: 34 02 00 08 mvi r2,8
80179b4: ba 80 08 00 mv r1,r20
80179b8: f8 00 56 a8 calli 802d458 <__lshrsi3>
80179bc: bb 01 08 00 or r1,r24,r1
80179c0: 34 02 00 10 mvi r2,16
80179c4: 20 21 ff ff andi r1,r1,0xffff
80179c8: fb ff a6 08 calli 80011e8 <__ashlsi3>
80179cc: b8 20 a0 00 mv r20,r1
80179d0: 34 02 00 08 mvi r2,8
80179d4: ba 60 08 00 mv r1,r19
80179d8: fb ff a6 04 calli 80011e8 <__ashlsi3>
80179dc: b8 20 c0 00 mv r24,r1
80179e0: 34 02 00 08 mvi r2,8
80179e4: ba 60 08 00 mv r1,r19
80179e8: f8 00 56 9c calli 802d458 <__lshrsi3>
80179ec: bb 01 18 00 or r3,r24,r1
80179f0: 20 63 ff ff andi r3,r3,0xffff
80179f4: ba 83 18 00 or r3,r20,r3
80179f8: 5c 75 00 5b bne r3,r21,8017b64 <msdos_find_node_by_cluster_num_in_fat_file+0x2b4>
{
/* on success fill aux structure and copy all 32 bytes */
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM, j * bts2rd,
80179fc: b9 80 08 00 mv r1,r12
8017a00: b9 60 10 00 mv r2,r11
8017a04: 34 03 00 01 mvi r3,1
8017a08: ba 20 20 00 mv r4,r17
8017a0c: b9 e0 28 00 mv r5,r15
8017a10: fb ff df 40 calli 800f710 <fat_file_ioctl>
&dir_pos->sname.cln);
if (rc != RC_OK)
8017a14: 5c 20 00 60 bne r1,r0,8017b94 <msdos_find_node_by_cluster_num_in_fat_file+0x2e4><== NEVER TAKEN
return rc;
dir_pos->sname.ofs = i;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
8017a18: 34 02 ff ff mvi r2,-1
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;
8017a1c: 59 f0 00 04 sw (r15+4),r16
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
8017a20: 59 e2 00 08 sw (r15+8),r2
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
8017a24: 59 e2 00 0c sw (r15+12),r2
memcpy(dir_entry, entry,
8017a28: 41 c2 00 06 lbu r2,(r14+6)
8017a2c: 41 c3 00 00 lbu r3,(r14+0)
8017a30: 41 c5 00 01 lbu r5,(r14+1)
8017a34: 41 c7 00 02 lbu r7,(r14+2)
8017a38: 41 c9 00 03 lbu r9,(r14+3)
8017a3c: 41 cb 00 04 lbu r11,(r14+4)
8017a40: 41 cd 00 05 lbu r13,(r14+5)
8017a44: 33 82 00 49 sb (sp+73),r2
8017a48: 41 c2 00 07 lbu r2,(r14+7)
8017a4c: 33 82 00 4a sb (sp+74),r2
8017a50: 41 c2 00 08 lbu r2,(r14+8)
8017a54: 33 82 00 4b sb (sp+75),r2
8017a58: 41 c2 00 09 lbu r2,(r14+9)
8017a5c: 33 82 00 4c sb (sp+76),r2
8017a60: 41 c2 00 0a lbu r2,(r14+10)
8017a64: 33 82 00 4d sb (sp+77),r2
8017a68: 41 c2 00 0b lbu r2,(r14+11)
8017a6c: 33 82 00 4e sb (sp+78),r2
8017a70: 41 c2 00 0c lbu r2,(r14+12)
8017a74: 33 82 00 4f sb (sp+79),r2
8017a78: 41 dd 00 0d lbu ra,(r14+13)
8017a7c: 41 db 00 0e lbu fp,(r14+14)
8017a80: 41 d9 00 0f lbu r25,(r14+15)
8017a84: 41 d8 00 10 lbu r24,(r14+16)
8017a88: 41 d7 00 11 lbu r23,(r14+17)
8017a8c: 41 d6 00 12 lbu r22,(r14+18)
8017a90: 41 d5 00 13 lbu r21,(r14+19)
8017a94: 41 d4 00 14 lbu r20,(r14+20)
8017a98: 41 d3 00 15 lbu r19,(r14+21)
8017a9c: 41 d1 00 16 lbu r17,(r14+22)
8017aa0: 41 d0 00 17 lbu r16,(r14+23)
8017aa4: 41 cf 00 18 lbu r15,(r14+24)
8017aa8: 41 cc 00 19 lbu r12,(r14+25)
8017aac: 41 ca 00 1a lbu r10,(r14+26)
8017ab0: 41 c8 00 1b lbu r8,(r14+27)
8017ab4: 41 c6 00 1c lbu r6,(r14+28)
8017ab8: 41 c4 00 1d lbu r4,(r14+29)
8017abc: 41 c2 00 1e lbu r2,(r14+30)
8017ac0: 41 ce 00 1f lbu r14,(r14+31)
8017ac4: 32 43 00 00 sb (r18+0),r3
8017ac8: 43 83 00 49 lbu r3,(sp+73)
8017acc: 32 45 00 01 sb (r18+1),r5
8017ad0: 32 47 00 02 sb (r18+2),r7
8017ad4: 32 43 00 06 sb (r18+6),r3
8017ad8: 43 83 00 4a lbu r3,(sp+74)
8017adc: 32 49 00 03 sb (r18+3),r9
8017ae0: 32 4b 00 04 sb (r18+4),r11
8017ae4: 32 43 00 07 sb (r18+7),r3
8017ae8: 43 83 00 4b lbu r3,(sp+75)
8017aec: 32 4d 00 05 sb (r18+5),r13
8017af0: 32 5d 00 0d sb (r18+13),ra
8017af4: 32 43 00 08 sb (r18+8),r3
8017af8: 43 83 00 4c lbu r3,(sp+76)
8017afc: 32 5b 00 0e sb (r18+14),fp
8017b00: 32 59 00 0f sb (r18+15),r25
8017b04: 32 43 00 09 sb (r18+9),r3
8017b08: 43 83 00 4d lbu r3,(sp+77)
8017b0c: 32 58 00 10 sb (r18+16),r24
8017b10: 32 57 00 11 sb (r18+17),r23
8017b14: 32 43 00 0a sb (r18+10),r3
8017b18: 43 83 00 4e lbu r3,(sp+78)
8017b1c: 32 56 00 12 sb (r18+18),r22
8017b20: 32 55 00 13 sb (r18+19),r21
8017b24: 32 43 00 0b sb (r18+11),r3
8017b28: 43 83 00 4f lbu r3,(sp+79)
8017b2c: 32 54 00 14 sb (r18+20),r20
8017b30: 32 53 00 15 sb (r18+21),r19
8017b34: 32 43 00 0c sb (r18+12),r3
8017b38: 32 51 00 16 sb (r18+22),r17
8017b3c: 32 50 00 17 sb (r18+23),r16
8017b40: 32 4f 00 18 sb (r18+24),r15
8017b44: 32 4c 00 19 sb (r18+25),r12
8017b48: 32 4a 00 1a sb (r18+26),r10
8017b4c: 32 48 00 1b sb (r18+27),r8
8017b50: 32 46 00 1c sb (r18+28),r6
8017b54: 32 44 00 1d sb (r18+29),r4
8017b58: 32 42 00 1e sb (r18+30),r2
8017b5c: 32 4e 00 1f sb (r18+31),r14
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
return RC_OK;
8017b60: e0 00 00 0d bi 8017b94 <msdos_find_node_by_cluster_num_in_fat_file+0x2e4>
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)
8017b64: 36 10 00 20 addi r16,r16,32
8017b68: 35 ce 00 20 addi r14,r14,32
8017b6c: 55 b0 ff 88 bgu r13,r16,801798c <msdos_find_node_by_cluster_num_in_fat_file+0xdc><== ALWAYS TAKEN
8017b70: b6 2d 88 00 add r17,r17,r13 <== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
else
bts2rd = fs_info->fat.vol.bpc;
while ((ret = fat_file_read(&fs_info->fat, fat_fd, j * bts2rd, bts2rd,
8017b74: 29 85 00 a0 lw r5,(r12+160)
8017b78: b9 80 08 00 mv r1,r12
8017b7c: b9 60 10 00 mv r2,r11
8017b80: ba 20 18 00 mv r3,r17
8017b84: b9 a0 20 00 mv r4,r13
8017b88: fb ff dd dd calli 800f2fc <fat_file_read>
8017b8c: 5c 20 ff 6f bne r1,r0,8017948 <msdos_find_node_by_cluster_num_in_fat_file+0x98>
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;
8017b90: 34 01 7d 01 mvi r1,32001 <== NOT EXECUTED
}
}
j++;
}
return MSDOS_NAME_NOT_FOUND_ERR;
}
8017b94: 2b 9d 00 04 lw ra,(sp+4)
8017b98: 2b 8b 00 44 lw r11,(sp+68)
8017b9c: 2b 8c 00 40 lw r12,(sp+64)
8017ba0: 2b 8d 00 3c lw r13,(sp+60)
8017ba4: 2b 8e 00 38 lw r14,(sp+56)
8017ba8: 2b 8f 00 34 lw r15,(sp+52)
8017bac: 2b 90 00 30 lw r16,(sp+48)
8017bb0: 2b 91 00 2c lw r17,(sp+44)
8017bb4: 2b 92 00 28 lw r18,(sp+40)
8017bb8: 2b 93 00 24 lw r19,(sp+36)
8017bbc: 2b 94 00 20 lw r20,(sp+32)
8017bc0: 2b 95 00 1c lw r21,(sp+28)
8017bc4: 2b 96 00 18 lw r22,(sp+24)
8017bc8: 2b 97 00 14 lw r23,(sp+20)
8017bcc: 2b 98 00 10 lw r24,(sp+16)
8017bd0: 2b 99 00 0c lw r25,(sp+12)
8017bd4: 2b 9b 00 08 lw fp,(sp+8)
8017bd8: 37 9c 00 4c addi sp,sp,76
8017bdc: c3 a0 00 00 ret
08009e50 <msdos_format>:
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
8009e50: 37 9c fd 00 addi sp,sp,-768
8009e54: 5b 8b 00 44 sw (sp+68),r11
8009e58: 5b 8c 00 40 sw (sp+64),r12
8009e5c: 5b 8d 00 3c sw (sp+60),r13
8009e60: 5b 8e 00 38 sw (sp+56),r14
8009e64: 5b 8f 00 34 sw (sp+52),r15
8009e68: 5b 90 00 30 sw (sp+48),r16
8009e6c: 5b 91 00 2c sw (sp+44),r17
8009e70: 5b 92 00 28 sw (sp+40),r18
8009e74: 5b 93 00 24 sw (sp+36),r19
8009e78: 5b 94 00 20 sw (sp+32),r20
8009e7c: 5b 95 00 1c sw (sp+28),r21
8009e80: 5b 96 00 18 sw (sp+24),r22
8009e84: 5b 97 00 14 sw (sp+20),r23
8009e88: 5b 98 00 10 sw (sp+16),r24
8009e8c: 5b 99 00 0c sw (sp+12),r25
8009e90: 5b 9b 00 08 sw (sp+8),fp
8009e94: 5b 9d 00 04 sw (sp+4),ra
msdos_format_param_t fmt_params;
/*
* open device for writing
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "open device\n");
8009e98: 78 03 08 02 mvhi r3,0x802
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
8009e9c: b8 20 58 00 mv r11,r1
msdos_format_param_t fmt_params;
/*
* open device for writing
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "open device\n");
8009ea0: 38 63 e4 5c ori r3,r3,0xe45c
8009ea4: b8 40 08 00 mv r1,r2
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
8009ea8: b8 40 c0 00 mv r24,r2
msdos_format_param_t fmt_params;
/*
* open device for writing
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "open device\n");
8009eac: 34 02 00 02 mvi r2,2
8009eb0: fb ff ff 49 calli 8009bd4 <msdos_format_printf>
fd = open(devname, O_RDWR);
8009eb4: 34 02 00 02 mvi r2,2
8009eb8: b9 60 08 00 mv r1,r11
8009ebc: fb ff e8 1a calli 8003f24 <open>
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
char tmp_sec[FAT_TOTAL_MBR_SIZE];
struct stat stat_buf;
int ret_val = 0;
8009ec0: 64 2c ff ff cmpei r12,r1,-1
}
/*
* sanity check on device
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
8009ec4: 78 03 08 02 mvhi r3,0x802
/*
* open device for writing
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "open device\n");
fd = open(devname, O_RDWR);
8009ec8: b8 20 c8 00 mv r25,r1
}
/*
* sanity check on device
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
8009ecc: 34 02 00 02 mvi r2,2
8009ed0: bb 00 08 00 mv r1,r24
8009ed4: 38 63 e4 6c ori r3,r3,0xe46c
8009ed8: b9 60 20 00 mv r4,r11
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
char tmp_sec[FAT_TOTAL_MBR_SIZE];
struct stat stat_buf;
int ret_val = 0;
8009edc: c8 0c 60 00 sub r12,r0,r12
}
/*
* sanity check on device
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
8009ee0: fb ff ff 3d calli 8009bd4 <msdos_format_printf>
"stat check: %s\n", devname);
if (ret_val == 0) {
8009ee4: 34 17 ff ff mvi r23,-1
8009ee8: 5d 80 00 05 bne r12,r0,8009efc <msdos_format+0xac> <== NEVER TAKEN
ret_val = fstat(fd, &stat_buf);
8009eec: bb 20 08 00 mv r1,r25
8009ef0: 37 82 02 b0 addi r2,sp,688
8009ef4: fb ff e4 64 calli 8003084 <fstat>
8009ef8: b8 20 b8 00 mv r23,r1
}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
8009efc: 78 03 08 02 mvhi r3,0x802
8009f00: bb 00 08 00 mv r1,r24
8009f04: 34 02 00 01 mvi r2,1
8009f08: 38 63 e4 7c ori r3,r3,0xe47c
8009f0c: b9 60 20 00 mv r4,r11
8009f10: fb ff ff 31 calli 8009bd4 <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))) {
8009f14: 5e e0 01 da bne r23,r0,800a67c <msdos_format+0x82c> <== NEVER TAKEN
8009f18: 2b 84 02 bc lw r4,(sp+700)
8009f1c: 34 03 60 00 mvi r3,24576
8009f20: 20 84 f0 00 andi r4,r4,0xf000
8009f24: 44 83 03 a2 be r4,r3,800adac <msdos_format+0xf5c>
errno = ENOTTY;
8009f28: f8 00 43 4b calli 801ac54 <__errno> <== NOT EXECUTED
8009f2c: 34 03 00 19 mvi r3,25 <== NOT EXECUTED
8009f30: 58 23 00 00 sw (r1+0),r3 <== NOT EXECUTED
ret_val = -1;
8009f34: 34 17 ff ff mvi r23,-1 <== NOT EXECUTED
8009f38: e0 00 01 d1 bi 800a67c <msdos_format+0x82c> <== 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);
8009f3c: 78 03 08 02 mvhi r3,0x802
8009f40: 38 63 e5 60 ori r3,r3,0xe560
8009f44: 28 62 00 00 lw r2,(r3+0)
8009f48: bb 20 08 00 mv r1,r25
8009f4c: 37 83 02 60 addi r3,sp,608
8009f50: f8 00 20 2c calli 8012000 <ioctl>
8009f54: b8 20 b8 00 mv r23,r1
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) {
8009f58: 5c 20 01 48 bne r1,r0,800a478 <msdos_format+0x628> <== NEVER TAKEN
total_size = fmt_params->bytes_per_sector * fmt_params->totl_sector_cnt;
8009f5c: 2b 8d 02 5c lw r13,(sp+604)
8009f60: 2b 8c 02 60 lw r12,(sp+608)
8009f64: b9 a0 10 00 mv r2,r13
8009f68: b9 80 08 00 mv r1,r12
8009f6c: fb ff dc ed calli 8001320 <__mulsi3>
8009f70: b8 20 58 00 mv r11,r1
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
8009f74: 78 03 08 02 mvhi r3,0x802
8009f78: bb 00 08 00 mv r1,r24
8009f7c: 34 02 00 02 mvi r2,2
8009f80: 38 63 e4 8c ori r3,r3,0xe48c
8009f84: b9 a0 20 00 mv r4,r13
8009f88: b9 80 28 00 mv r5,r12
8009f8c: 34 06 00 00 mvi r6,0
8009f90: b9 60 38 00 mv r7,r11
8009f94: fb ff ff 10 calli 8009bd4 <msdos_format_printf>
/*
* determine number of FATs
*/
if (ret_val == 0) {
if ((rqdata == NULL) ||
8009f98: 47 00 00 03 be r24,r0,8009fa4 <msdos_format+0x154>
(rqdata->fat_num == 0)) {
8009f9c: 2b 03 00 0c lw r3,(r24+12)
/*
* determine number of FATs
*/
if (ret_val == 0) {
if ((rqdata == NULL) ||
8009fa0: 5c 60 00 03 bne r3,r0,8009fac <msdos_format+0x15c>
(rqdata->fat_num == 0)) {
fmt_params->fat_num = 2;
8009fa4: 34 03 00 02 mvi r3,2
8009fa8: e0 00 00 03 bi 8009fb4 <msdos_format+0x164>
}
else if (rqdata->fat_num <= 6) {
8009fac: 34 04 00 06 mvi r4,6
8009fb0: 54 64 00 0a bgu r3,r4,8009fd8 <msdos_format+0x188>
fmt_params->fat_num = rqdata->fat_num;
8009fb4: 33 83 02 8c sb (sp+652),r3
ret_val = -1;
}
}
if (ret_val == 0)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
8009fb8: 43 84 02 8c lbu r4,(sp+652)
8009fbc: 78 03 08 02 mvhi r3,0x802
8009fc0: bb 00 08 00 mv r1,r24
8009fc4: 34 02 00 02 mvi r2,2
8009fc8: 38 63 e5 34 ori r3,r3,0xe534
8009fcc: fb ff ff 02 calli 8009bd4 <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) {
8009fd0: 5f 00 00 07 bne r24,r0,8009fec <msdos_format+0x19c>
8009fd4: e0 00 00 09 bi 8009ff8 <msdos_format+0x1a8>
}
else if (rqdata->fat_num <= 6) {
fmt_params->fat_num = rqdata->fat_num;
}
else {
errno = EINVAL;
8009fd8: f8 00 43 1f calli 801ac54 <__errno>
8009fdc: 34 03 00 16 mvi r3,22
8009fe0: 58 23 00 00 sw (r1+0),r3
ret_val = -1;
8009fe4: 34 17 ff ff mvi r23,-1
8009fe8: e0 00 01 24 bi 800a478 <msdos_format+0x628>
* 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) {
8009fec: 2b 03 00 08 lw r3,(r24+8)
8009ff0: b8 60 60 00 mv r12,r3
8009ff4: 5c 60 00 03 bne r3,r0,800a000 <msdos_format+0x1b0>
* 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;
8009ff8: 34 0c 00 20 mvi r12,32
/*
* limiting values for disk size, fat type, sectors per cluster
* NOTE: maximum sect_per_clust is arbitrarily choosen with values that
* are a compromise concerning capacity and efficency
*/
uint32_t fat12_sect_per_clust = 8;
8009ffc: 34 03 00 08 mvi r3,8
if (rqdata != NULL && rqdata->sectors_per_cluster != 0) {
fat12_sect_per_clust = rqdata->sectors_per_cluster;
fat16_sect_per_clust = rqdata->sectors_per_cluster;
}
if (fmt_params->totl_sector_cnt < FAT_FAT12_MAX_CLN * fat12_sect_per_clust) {
800a000: 2b 8d 02 60 lw r13,(sp+608)
800a004: b8 60 08 00 mv r1,r3
800a008: 34 02 0f f5 mvi r2,4085
800a00c: fb ff dc c5 calli 8001320 <__mulsi3>
800a010: 51 a1 00 03 bgeu r13,r1,800a01c <msdos_format+0x1cc>
fmt_params->fattype = FAT_FAT12;
800a014: 34 03 00 01 mvi r3,1
800a018: e0 00 00 06 bi 800a030 <msdos_format+0x1e0>
/* 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) {
800a01c: b9 80 08 00 mv r1,r12
800a020: 38 02 ff f5 mvu r2,0xfff5
800a024: fb ff dc bf calli 8001320 <__mulsi3>
800a028: 51 a1 00 06 bgeu r13,r1,800a040 <msdos_format+0x1f0>
fmt_params->fattype = FAT_FAT16;
800a02c: 34 03 00 02 mvi r3,2
800a030: 33 83 02 8e sb (sp+654),r3
/* start trying with small clusters */
fmt_params->sectors_per_cluster = 2;
800a034: 34 03 00 02 mvi r3,2
800a038: 5b 83 02 68 sw (sp+616),r3
800a03c: e0 00 00 16 bi 800a094 <msdos_format+0x244>
}
else {
#define ONE_GB (1024L * 1024L * 1024L)
uint32_t gigs = (total_size + ONE_GB) / ONE_GB;
800a040: 78 03 40 00 mvhi r3,0x4000
800a044: b5 63 18 00 add r3,r11,r3
800a048: f5 63 08 00 cmpgu r1,r11,r3
800a04c: b8 60 10 00 mv r2,r3
800a050: 34 03 00 1e mvi r3,30
800a054: f8 00 78 25 calli 80280e8 <__lshrdi3>
int b;
fmt_params->fattype = FAT_FAT32;
800a058: 34 03 00 04 mvi r3,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;
800a05c: b8 40 68 00 mv r13,r2
int b;
fmt_params->fattype = FAT_FAT32;
800a060: 33 83 02 8e sb (sp+654),r3
/* scale with the size of disk... */
for (b = 31; b > 0; b--)
800a064: 34 0c 00 1f mvi r12,31
if ((gigs & (1 << b)) != 0)
800a068: 34 01 00 01 mvi r1,1
800a06c: b9 80 10 00 mv r2,r12
800a070: fb ff dc 5e calli 80011e8 <__ashlsi3>
800a074: a0 2d 08 00 and r1,r1,r13
800a078: 5c 20 00 03 bne r1,r0,800a084 <msdos_format+0x234>
#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--)
800a07c: 35 8c ff ff addi r12,r12,-1
800a080: 5d 81 ff fa bne r12,r1,800a068 <msdos_format+0x218>
if ((gigs & (1 << b)) != 0)
break;
fmt_params->sectors_per_cluster = 1 << b;
800a084: 34 01 00 01 mvi r1,1
800a088: b9 80 10 00 mv r2,r12
800a08c: fb ff dc 57 calli 80011e8 <__ashlsi3>
800a090: 5b 81 02 68 sw (sp+616),r1
/*
* compute formatting parameters
*/
if (ret_val == 0) {
ret_val = msdos_format_determine_fmt_params(fd,rqdata,&fmt_params);
800a094: 37 8c 02 5c addi r12,sp,604
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 );
800a098: b9 80 10 00 mv r2,r12
800a09c: bb 00 08 00 mv r1,r24
800a0a0: fb ff fe a7 calli 8009b3c <msdos_set_sectors_per_cluster_from_request>
/* start trying with small clusters */
fmt_params->sectors_per_cluster = 2;
}
else {
#define ONE_GB ( 1024L * 1024L * 1024L )
uint32_t gigs = ( total_size + ONE_GB ) / ONE_GB;
800a0a4: 78 03 40 00 mvhi r3,0x4000
800a0a8: b5 63 18 00 add r3,r11,r3
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 );
800a0ac: b8 20 b8 00 mv r23,r1
/* 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;
800a0b0: f5 63 08 00 cmpgu r1,r11,r3
800a0b4: b8 60 10 00 mv r2,r3
800a0b8: 34 03 00 1e mvi r3,30
800a0bc: f8 00 78 0b calli 80280e8 <__lshrdi3>
&& fmt_params->fattype != fat_type
&& fmt_params->totl_sector_cnt > 0 ) {
/*
* Skip aligning structures or d align them
*/
if (ret_val == 0 && rqdata != NULL)
800a0c0: 7f 01 00 00 cmpnei r1,r24,0
/* 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;
800a0c4: 5b 82 00 54 sw (sp+84),r2
*/
if (ret_val == 0 && rqdata != NULL)
fmt_params->skip_alignment = rqdata->skip_alignment;
if (ret_val == 0) {
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
800a0c8: 78 02 08 02 mvhi r2,0x802
800a0cc: 38 42 e4 c8 ori r2,r2,0xe4c8
800a0d0: 5b 99 00 4c sw (sp+76),r25
/* 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;
800a0d4: 34 1b 00 ff mvi fp,255
800a0d8: 34 15 00 00 mvi r21,0
&& fmt_params->fattype != fat_type
&& fmt_params->totl_sector_cnt > 0 ) {
/*
* Skip aligning structures or d align them
*/
if (ret_val == 0 && rqdata != NULL)
800a0dc: 5b 81 00 50 sw (sp+80),r1
800a0e0: 5b 81 00 58 sw (sp+88),r1
fmt_params->skip_alignment = rqdata->skip_alignment;
if (ret_val == 0) {
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
800a0e4: 5b 82 00 48 sw (sp+72),r2
800a0e8: ba e0 c8 00 mv r25,r23
800a0ec: e0 00 00 dc bi 800a45c <msdos_format+0x60c>
&& fmt_params->fattype != fat_type
&& fmt_params->totl_sector_cnt > 0 ) {
/*
* Skip aligning structures or d align them
*/
if (ret_val == 0 && rqdata != NULL)
800a0f0: 2b 83 00 58 lw r3,(sp+88)
800a0f4: 44 60 00 03 be r3,r0,800a100 <msdos_format+0x2b0>
fmt_params->skip_alignment = rqdata->skip_alignment;
800a0f8: 43 04 00 16 lbu r4,(r24+22)
800a0fc: 33 84 02 ac sb (sp+684),r4
if (ret_val == 0) {
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
800a100: 2b 83 00 48 lw r3,(sp+72)
800a104: 2b 84 02 68 lw r4,(sp+616)
800a108: bb 00 08 00 mv r1,r24
800a10c: 34 02 00 02 mvi r2,2
800a110: fb ff fe b1 calli 8009bd4 <msdos_format_printf>
"sectors per cluster: %d\n", fmt_params->sectors_per_cluster);
if (fmt_params->fattype == FAT_FAT32) {
800a114: 43 82 02 8e lbu r2,(sp+654)
800a118: 34 01 00 04 mvi r1,4
800a11c: 5c 41 00 09 bne r2,r1,800a140 <msdos_format+0x2f0>
/* recommended: for FAT32, always set reserved sector count to 32 */
fmt_params->rsvd_sector_cnt = 32;
800a120: 34 02 00 20 mvi r2,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;
800a124: 34 03 00 06 mvi r3,6
/* location of fsinfo sector */
fmt_params->fsinfo_sec = 1;
800a128: 34 01 00 01 mvi r1,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;
800a12c: 5b 82 02 64 sw (sp+612),r2
/* for FAT32, always set files per root directory 0 */
fmt_params->files_per_root_dir = 0;
800a130: 5b 80 02 74 sw (sp+628),r0
/* location of copy of MBR */
fmt_params->mbr_copy_sec = 6;
800a134: 5b 83 02 84 sw (sp+644),r3
/* location of fsinfo sector */
fmt_params->fsinfo_sec = 1;
800a138: 5b 81 02 88 sw (sp+648),r1
800a13c: e0 00 00 1d bi 800a1b0 <msdos_format+0x360>
/* 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) &&
800a140: 2b 81 00 50 lw r1,(sp+80)
fmt_params->fsinfo_sec = 1;
}
else {
/* recommended: for FAT12/FAT16, always set reserved sector count to 1 */
fmt_params->rsvd_sector_cnt = 1;
800a144: 34 03 00 01 mvi r3,1
800a148: 5b 83 02 64 sw (sp+612),r3
/* 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) &&
800a14c: 44 20 00 05 be r1,r0,800a160 <msdos_format+0x310>
(rqdata->files_per_root_dir > 0)) {
800a150: 2b 04 00 10 lw r4,(r24+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) &&
800a154: 44 80 00 03 be r4,r0,800a160 <msdos_format+0x310>
(rqdata->files_per_root_dir > 0)) {
fmt_params->files_per_root_dir = rqdata->files_per_root_dir;
800a158: 5b 84 02 74 sw (sp+628),r4
800a15c: e0 00 00 08 bi 800a17c <msdos_format+0x32c>
}
else {
if (fmt_params->fattype == FAT_FAT16) {
800a160: 34 04 00 02 mvi r4,2
800a164: 5c 44 00 04 bne r2,r4,800a174 <msdos_format+0x324>
fmt_params->files_per_root_dir = 512;
800a168: 34 02 02 00 mvi r2,512
800a16c: 5b 82 02 74 sw (sp+628),r2
800a170: e0 00 00 03 bi 800a17c <msdos_format+0x32c>
}
else {
fmt_params->files_per_root_dir = 64;
800a174: 34 03 00 40 mvi r3,64
800a178: 5b 83 02 74 sw (sp+628),r3
}
}
fmt_params->files_per_root_dir = (fmt_params->files_per_root_dir +
(2*fmt_params->bytes_per_sector/
800a17c: 2b 81 02 5c lw r1,(sp+604)
800a180: 34 02 00 01 mvi r2,1
800a184: fb ff dc 19 calli 80011e8 <__ashlsi3>
800a188: 34 02 00 05 mvi r2,5
800a18c: f8 00 8c b3 calli 802d458 <__lshrsi3>
}
else {
fmt_params->files_per_root_dir = 64;
}
}
fmt_params->files_per_root_dir = (fmt_params->files_per_root_dir +
800a190: 2b 8b 02 74 lw r11,(sp+628)
(2*fmt_params->bytes_per_sector/
800a194: b8 20 10 00 mv r2,r1
}
else {
fmt_params->files_per_root_dir = 64;
}
}
fmt_params->files_per_root_dir = (fmt_params->files_per_root_dir +
800a198: 35 6b ff ff addi r11,r11,-1
800a19c: b5 61 58 00 add r11,r11,r1
(2*fmt_params->bytes_per_sector/
FAT_DIRENTRY_SIZE-1));
fmt_params->files_per_root_dir -= (fmt_params->files_per_root_dir %
800a1a0: b9 60 08 00 mv r1,r11
800a1a4: f8 00 8d 0d calli 802d5d8 <__umodsi3>
800a1a8: c9 61 58 00 sub r11,r11,r1
800a1ac: 5b 8b 02 74 sw (sp+628),r11
/FAT_DIRENTRY_SIZE));
}
fmt_params->root_dir_sectors =
(((fmt_params->files_per_root_dir * FAT_DIRENTRY_SIZE)
+ fmt_params->bytes_per_sector - 1)
800a1b0: 2b 8f 02 5c lw r15,(sp+604)
(2*fmt_params->bytes_per_sector
/FAT_DIRENTRY_SIZE));
}
fmt_params->root_dir_sectors =
(((fmt_params->files_per_root_dir * FAT_DIRENTRY_SIZE)
800a1b4: 2b 81 02 74 lw r1,(sp+628)
800a1b8: 34 02 00 05 mvi r2,5
+ fmt_params->bytes_per_sector - 1)
800a1bc: 35 f4 ff ff addi r20,r15,-1
(2*fmt_params->bytes_per_sector
/FAT_DIRENTRY_SIZE));
}
fmt_params->root_dir_sectors =
(((fmt_params->files_per_root_dir * FAT_DIRENTRY_SIZE)
800a1c0: fb ff dc 0a calli 80011e8 <__ashlsi3>
+ fmt_params->bytes_per_sector - 1)
/ fmt_params->bytes_per_sector);
800a1c4: b9 e0 10 00 mv r2,r15
800a1c8: b6 81 08 00 add r1,r20,r1
800a1cc: f8 00 8c f3 calli 802d598 <__udivsi3>
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,
800a1d0: 43 9b 02 8e lbu fp,(sp+654)
800a1d4: 2b 8d 02 68 lw r13,(sp+616)
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 =
800a1d8: 5b 81 02 78 sw (sp+632),r1
(((fmt_params->files_per_root_dir * FAT_DIRENTRY_SIZE)
+ fmt_params->bytes_per_sector - 1)
/ fmt_params->bytes_per_sector);
800a1dc: b8 20 88 00 mv r17,r1
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) {
800a1e0: b9 e0 10 00 mv r2,r15
800a1e4: 38 01 80 00 mvu r1,0x8000
800a1e8: f8 00 8c ec calli 802d598 <__udivsi3>
800a1ec: b8 20 58 00 mv r11,r1
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,
800a1f0: 2b 96 02 60 lw r22,(sp+608)
800a1f4: 2b 97 02 64 lw r23,(sp+612)
fmt_params->bytes_per_sector,
fmt_params->totl_sector_cnt,
fmt_params->rsvd_sector_cnt,
fmt_params->root_dir_sectors,
fmt_params->fat_num,
800a1f8: 43 93 02 8c lbu r19,(sp+652)
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,
800a1fc: 43 90 02 ac lbu r16,(sp+684)
800a200: b9 a0 08 00 mv r1,r13
800a204: e0 00 00 03 bi 800a210 <msdos_format+0x3c0>
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) {
sectors_per_cluster /= 2;
800a208: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
800a20c: f8 00 8c 93 calli 802d458 <__lshrsi3> <== 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) {
800a210: 54 2b ff fe bgu r1,r11,800a208 <msdos_format+0x3b8> <== NEVER TAKEN
800a214: b8 20 68 00 mv r13,r1
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) {
800a218: 34 12 00 02 mvi r18,2
* - compute cluster count for data AND fat
* - 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);
800a21c: ba e0 08 00 mv r1,r23
800a220: b9 a0 10 00 mv r2,r13
800a224: ba 00 18 00 mv r3,r16
800a228: fb ff fe 3f calli 8009b24 <loc_align_object>
* 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
800a22c: ca c1 58 00 sub r11,r22,r1
- loc_align_object (rsvd_sector_cnt, sectors_per_cluster, skip_alignment);
if (fattype == FAT_FAT12) {
800a230: 34 01 00 01 mvi r1,1
800a234: 5f 61 00 0f bne fp,r1,800a270 <msdos_format+0x420>
fatdata_sect_cnt = fatdata_sect_cnt
- loc_align_object (root_dir_sector_cnt, sectors_per_cluster, skip_alignment);
800a238: ba 00 18 00 mv r3,r16
800a23c: b9 a0 10 00 mv r2,r13
800a240: ba 20 08 00 mv r1,r17
800a244: fb ff fe 38 calli 8009b24 <loc_align_object>
fatdata_cluster_cnt = fatdata_sect_cnt/sectors_per_cluster;
800a248: b9 a0 10 00 mv r2,r13
800a24c: c9 61 08 00 sub r1,r11,r1
800a250: f8 00 8c d2 calli 802d598 <__udivsi3>
fat_capacity = fatdata_cluster_cnt * 3 / 2;
800a254: 34 02 00 01 mvi r2,1
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;
800a258: b8 20 70 00 mv r14,r1
fat_capacity = fatdata_cluster_cnt * 3 / 2;
800a25c: fb ff db e3 calli 80011e8 <__ashlsi3>
800a260: b4 2e 08 00 add r1,r1,r14
800a264: 34 02 00 01 mvi r2,1
800a268: f8 00 8c 7c calli 802d458 <__lshrsi3>
800a26c: e0 00 00 12 bi 800a2b4 <msdos_format+0x464>
}
else if (fattype == FAT_FAT16) {
800a270: 5f 72 00 0b bne fp,r18,800a29c <msdos_format+0x44c>
fatdata_sect_cnt = fatdata_sect_cnt
- loc_align_object (root_dir_sector_cnt, sectors_per_cluster, skip_alignment);
800a274: b9 a0 10 00 mv r2,r13
800a278: ba 00 18 00 mv r3,r16
800a27c: ba 20 08 00 mv r1,r17
800a280: fb ff fe 29 calli 8009b24 <loc_align_object>
fatdata_cluster_cnt = fatdata_sect_cnt/sectors_per_cluster;
800a284: b9 a0 10 00 mv r2,r13
800a288: c9 61 08 00 sub r1,r11,r1
800a28c: f8 00 8c c3 calli 802d598 <__udivsi3>
800a290: b8 20 70 00 mv r14,r1
fat_capacity = fatdata_cluster_cnt * 2;
800a294: 34 02 00 01 mvi r2,1
800a298: e0 00 00 06 bi 800a2b0 <msdos_format+0x460>
}
else { /* FAT32 */
fatdata_cluster_cnt = fatdata_sect_cnt/sectors_per_cluster;
800a29c: b9 a0 10 00 mv r2,r13
800a2a0: b9 60 08 00 mv r1,r11
800a2a4: f8 00 8c bd calli 802d598 <__udivsi3>
800a2a8: b8 20 70 00 mv r14,r1
fat_capacity = fatdata_cluster_cnt * 4;
800a2ac: 34 02 00 02 mvi r2,2
800a2b0: fb ff db ce calli 80011e8 <__ashlsi3>
}
sectors_per_fat = ((fat_capacity
800a2b4: b9 e0 10 00 mv r2,r15
800a2b8: b4 34 08 00 add r1,r1,r20
800a2bc: f8 00 8c b7 calli 802d598 <__udivsi3>
+ (bytes_per_sector - 1))
/ bytes_per_sector);
fat_sectors_cnt = loc_align_object (sectors_per_fat * fat_num,
800a2c0: ba 60 10 00 mv r2,r19
800a2c4: fb ff dc 17 calli 8001320 <__mulsi3>
800a2c8: b9 a0 10 00 mv r2,r13
800a2cc: ba 00 18 00 mv r3,r16
800a2d0: fb ff fe 15 calli 8009b24 <loc_align_object>
sectors_per_cluster,
skip_alignment);
*data_cluster_cnt = (fatdata_cluster_cnt -
((fat_sectors_cnt
+ (sectors_per_cluster - 1))
800a2d4: 35 a4 ff ff addi r4,r13,-1
/ sectors_per_cluster));
800a2d8: b9 a0 10 00 mv r2,r13
sectors_per_fat = ((fat_capacity
+ (bytes_per_sector - 1))
/ bytes_per_sector);
fat_sectors_cnt = loc_align_object (sectors_per_fat * fat_num,
800a2dc: b8 20 60 00 mv r12,r1
skip_alignment);
*data_cluster_cnt = (fatdata_cluster_cnt -
((fat_sectors_cnt
+ (sectors_per_cluster - 1))
/ sectors_per_cluster));
800a2e0: b4 81 08 00 add r1,r4,r1
800a2e4: f8 00 8c ad calli 802d598 <__udivsi3>
/*
* data cluster count too big? Then make clusters bigger
*/
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
800a2e8: 34 02 00 01 mvi r2,1
fat_sectors_cnt = loc_align_object (sectors_per_fat * fat_num,
sectors_per_cluster,
skip_alignment);
*data_cluster_cnt = (fatdata_cluster_cnt -
800a2ec: c9 c1 70 00 sub r14,r14,r1
+ (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)) ||
800a2f0: 5f 62 00 05 bne fp,r2,800a304 <msdos_format+0x4b4>
800a2f4: 34 03 0f f5 mvi r3,4085
800a2f8: 55 c3 00 07 bgu r14,r3,800a314 <msdos_format+0x4c4>
((fattype == FAT_FAT16) && (*data_cluster_cnt > FAT_FAT16_MAX_CLN))) {
sectors_per_cluster *= 2;
}
else {
finished = true;
800a2fc: 34 0b 00 01 mvi r11,1
800a300: e0 00 00 0c bi 800a330 <msdos_format+0x4e0>
800a304: 34 0b 00 01 mvi r11,1
+ (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)) ||
800a308: 5f 72 00 11 bne fp,r18,800a34c <msdos_format+0x4fc>
((fattype == FAT_FAT16) && (*data_cluster_cnt > FAT_FAT16_MAX_CLN))) {
800a30c: 38 01 ff f5 mvu r1,0xfff5
800a310: 50 2e 00 0f bgeu r1,r14,800a34c <msdos_format+0x4fc>
sectors_per_cluster *= 2;
800a314: b9 a0 08 00 mv r1,r13
800a318: 34 02 00 01 mvi r2,1
800a31c: fb ff db b3 calli 80011e8 <__ashlsi3>
finished = true;
}
/*
* when maximum cluster size is exceeded, we have invalid data, abort...
*/
if (fattype == FAT_FAT12) {
800a320: 34 02 00 01 mvi r2,1
/*
* data cluster count too big? Then make clusters bigger
*/
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
((fattype == FAT_FAT16) && (*data_cluster_cnt > FAT_FAT16_MAX_CLN))) {
sectors_per_cluster *= 2;
800a324: b8 20 68 00 mv r13,r1
finished = true;
}
/*
* when maximum cluster size is exceeded, we have invalid data, abort...
*/
if (fattype == FAT_FAT12) {
800a328: 5f 62 00 08 bne fp,r2,800a348 <msdos_format+0x4f8>
800a32c: 34 0b 00 00 mvi r11,0
if (MS_BYTES_PER_CLUSTER_LIMIT_FAT12 < (sectors_per_cluster * bytes_per_sector)) {
800a330: b9 a0 08 00 mv r1,r13
800a334: b9 e0 10 00 mv r2,r15
800a338: fb ff db fa calli 8001320 <__mulsi3>
800a33c: 34 03 10 00 mvi r3,4096
800a340: 54 23 00 09 bgu r1,r3,800a364 <msdos_format+0x514>
800a344: e0 00 00 07 bi 800a360 <msdos_format+0x510>
finished = true;
}
/*
* when maximum cluster size is exceeded, we have invalid data, abort...
*/
if (fattype == FAT_FAT12) {
800a348: 34 0b 00 00 mvi r11,0
if (MS_BYTES_PER_CLUSTER_LIMIT_FAT12 < (sectors_per_cluster * bytes_per_sector)) {
finished = true;
}
} else if ((sectors_per_cluster * bytes_per_sector)
800a34c: b9 e0 10 00 mv r2,r15
800a350: b9 a0 08 00 mv r1,r13
800a354: fb ff db f3 calli 8001320 <__mulsi3>
800a358: 38 02 80 00 mvu r2,0x8000
800a35c: 54 22 00 02 bgu r1,r2,800a364 <msdos_format+0x514>
> MS_BYTES_PER_CLUSTER_LIMIT) {
finished = true;
}
} while (!finished);
800a360: 45 60 ff af be r11,r0,800a21c <msdos_format+0x3cc>
*sectors_per_cluster_adj = sectors_per_cluster;
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
800a364: b9 80 08 00 mv r1,r12
800a368: ba 60 10 00 mv r2,r19
800a36c: f8 00 8c 8b calli 802d598 <__udivsi3>
800a370: 5b 81 02 6c sw (sp+620),r1
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 =
800a374: b9 e0 10 00 mv r2,r15
800a378: 34 01 10 01 mvi r1,4097
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;
800a37c: 5b 8d 02 68 sw (sp+616),r13
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 =
800a380: f8 00 8c 86 calli 802d598 <__udivsi3>
( 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
800a384: 34 03 0f f4 mvi r3,4084
&& sectors_per_cluster <= ms_sectors_per_cluster_limit_FAT12 ) {
800a388: f0 2d 20 00 cmpgeu r4,r1,r13
( 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
800a38c: f0 6e 60 00 cmpgeu r12,r3,r14
800a390: a0 8c 60 00 and r12,r4,r12
&& sectors_per_cluster <= ms_sectors_per_cluster_limit_FAT12 ) {
fattype = FAT_FAT12;
800a394: 34 04 00 01 mvi 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
800a398: 5d 80 00 0d bne r12,r0,800a3cc <msdos_format+0x57c>
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 =
800a39c: b9 e0 10 00 mv r2,r15
800a3a0: 38 01 80 01 mvu r1,0x8001
800a3a4: f8 00 8c 7d calli 802d598 <__udivsi3>
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
&& sectors_per_cluster <= ms_sectors_per_cluster_limit_FAT16 ) {
800a3a8: f0 2d 10 00 cmpgeu r2,r1,r13
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
800a3ac: 38 01 ff f4 mvu r1,0xfff4
800a3b0: f0 2e 20 00 cmpgeu r4,r1,r14
{
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;
800a3b4: 34 05 ff fe mvi r5,-2
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
800a3b8: a0 44 20 00 and r4,r2,r4
{
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;
800a3bc: fc 8c 20 00 cmpne r4,r4,r12
800a3c0: c8 04 20 00 sub r4,r0,r4
800a3c4: a0 85 20 00 and r4,r4,r5
800a3c8: 34 84 00 04 addi r4,r4,4
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(
800a3cc: 33 84 02 8e sb (sp+654),r4
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) {
800a3d0: 47 64 00 19 be fp,r4,800a434 <msdos_format+0x5e4>
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
|| fmt_params->fattype == FAT_FAT16 ) {
800a3d4: 34 84 ff ff addi r4,r4,-1
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
800a3d8: 20 84 00 ff andi r4,r4,0xff
800a3dc: 34 02 00 01 mvi r2,1
800a3e0: 34 0b 00 1f mvi r11,31
800a3e4: 54 82 00 04 bgu r4,r2,800a3f4 <msdos_format+0x5a4>
|| fmt_params->fattype == FAT_FAT16 ) {
/* start trying with small clusters */
fmt_params->sectors_per_cluster = 2;
800a3e8: 34 04 00 02 mvi r4,2
800a3ec: 5b 84 02 68 sw (sp+616),r4
800a3f0: e0 00 00 0d bi 800a424 <msdos_format+0x5d4>
#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 )
800a3f4: 34 01 00 01 mvi r1,1
800a3f8: b9 60 10 00 mv r2,r11
800a3fc: fb ff db 7b calli 80011e8 <__ashlsi3>
800a400: 2b 83 00 54 lw r3,(sp+84)
800a404: a0 23 08 00 and r1,r1,r3
800a408: 5c 20 00 03 bne r1,r0,800a414 <msdos_format+0x5c4>
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-- ) {
800a40c: 35 6b ff ff addi r11,r11,-1
800a410: 5d 61 ff f9 bne r11,r1,800a3f4 <msdos_format+0x5a4> <== ALWAYS TAKEN
if ( (gigs & ( 1 << b) ) != 0 )
break;
}
fmt_params->sectors_per_cluster = 1 << b;
800a414: 34 01 00 01 mvi r1,1
800a418: b9 60 10 00 mv r2,r11
800a41c: fb ff db 73 calli 80011e8 <__ashlsi3>
800a420: 5b 81 02 68 sw (sp+616),r1
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,
800a424: bb 00 08 00 mv r1,r24
800a428: 37 82 02 5c addi r2,sp,604
800a42c: fb ff fd c4 calli 8009b3c <msdos_set_sectors_per_cluster_from_request>
800a430: b8 20 c8 00 mv r25,r1
fmt_params );
}
}
if (fat_type != fmt_params->fattype && 1 < iteration_cnt) {
800a434: 43 84 02 8e lbu r4,(sp+654)
800a438: 76 a5 00 01 cmpgui r5,r21,0x1
800a43c: fc 9b 20 00 cmpne r4,r4,fp
800a440: a0 a4 20 00 and r4,r5,r4
800a444: 44 80 00 04 be r4,r0,800a454 <msdos_format+0x604>
--fmt_params->totl_sector_cnt;
800a448: 2b 84 02 60 lw r4,(sp+608)
800a44c: 34 84 ff ff addi r4,r4,-1
800a450: 5b 84 02 60 sw (sp+608),r4
}
}
++iteration_cnt;
800a454: 36 a2 00 01 addi r2,r21,1
800a458: 20 55 00 ff andi r21,r2,0xff
if (ret_val == 0) {
data_clusters_cnt =
fmt_params->totl_sector_cnt / fmt_params->sectors_per_cluster;
}
while( ret_val == 0
800a45c: 5f 20 00 05 bne r25,r0,800a470 <msdos_format+0x620> <== NEVER TAKEN
&& fmt_params->fattype != fat_type
800a460: 43 82 02 8e lbu r2,(sp+654)
800a464: 44 5b 00 03 be r2,fp,800a470 <msdos_format+0x620>
&& fmt_params->totl_sector_cnt > 0 ) {
800a468: 2b 84 02 60 lw r4,(sp+608)
800a46c: 5c 80 ff 21 bne r4,r0,800a0f0 <msdos_format+0x2a0> <== ALWAYS TAKEN
800a470: bb 20 b8 00 mv r23,r25
800a474: 2b 99 00 4c lw r25,(sp+76)
}
++iteration_cnt;
}
}
if ( fmt_params->totl_sector_cnt == 0 )
800a478: 2b 83 02 60 lw r3,(sp+608)
800a47c: 44 60 00 27 be r3,r0,800a518 <msdos_format+0x6c8> <== NEVER TAKEN
{
errno = EINVAL;
ret_val = -1;
}
if (0 == ret_val)
800a480: 5e e0 00 2f bne r23,r0,800a53c <msdos_format+0x6ec>
{
if (FAT_FAT32 != fmt_params->fattype)
800a484: 43 84 02 8e lbu r4,(sp+654)
800a488: 34 03 00 04 mvi r3,4
800a48c: 44 83 00 0e be r4,r3,800a4c4 <msdos_format+0x674>
{
fmt_params->files_per_root_dir = loc_align_object (fmt_params->root_dir_sectors,
800a490: 43 83 02 ac lbu r3,(sp+684)
800a494: 2b 82 02 68 lw r2,(sp+616)
800a498: 2b 81 02 78 lw r1,(sp+632)
800a49c: fb ff fd a2 calli 8009b24 <loc_align_object>
800a4a0: b8 20 58 00 mv r11,r1
fmt_params->sectors_per_cluster,
fmt_params->skip_alignment)
* (fmt_params->bytes_per_sector / FAT_DIRENTRY_SIZE);
800a4a4: 2b 81 02 5c lw r1,(sp+604)
800a4a8: 34 02 00 05 mvi r2,5
800a4ac: f8 00 8b eb calli 802d458 <__lshrsi3>
800a4b0: b8 20 18 00 mv r3,r1
800a4b4: b8 60 10 00 mv r2,r3
800a4b8: b9 60 08 00 mv r1,r11
800a4bc: fb ff db 99 calli 8001320 <__mulsi3>
if (0 == ret_val)
{
if (FAT_FAT32 != fmt_params->fattype)
{
fmt_params->files_per_root_dir = loc_align_object (fmt_params->root_dir_sectors,
800a4c0: 5b 81 02 74 sw (sp+628),r1
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,
800a4c4: 2b 81 02 64 lw r1,(sp+612)
800a4c8: 2b 82 02 68 lw r2,(sp+616)
800a4cc: 43 83 02 ac lbu r3,(sp+684)
800a4d0: fb ff fd 95 calli 8009b24 <loc_align_object>
800a4d4: 5b 81 02 64 sw (sp+612),r1
/*
* determine media code
*/
if (ret_val == 0) {
if ((rqdata != NULL) &&
800a4d8: 47 00 00 17 be r24,r0,800a534 <msdos_format+0x6e4>
(rqdata->media != 0)) {
800a4dc: 43 0b 00 14 lbu r11,(r24+20)
/*
* determine media code
*/
if (ret_val == 0) {
if ((rqdata != NULL) &&
800a4e0: 45 60 00 15 be r11,r0,800a534 <msdos_format+0x6e4>
(rqdata->media != 0)) {
const char valid_media_codes[] =
800a4e4: 78 03 08 02 mvhi r3,0x802
800a4e8: 38 63 e5 6c ori r3,r3,0xe56c
800a4ec: 28 65 00 00 lw r5,(r3+0)
800a4f0: 28 64 00 04 lw r4,(r3+4)
800a4f4: 40 63 00 08 lbu r3,(r3+8)
{0xF0,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF};
if (NULL==memchr(valid_media_codes,
800a4f8: 37 81 02 f8 addi r1,sp,760
800a4fc: b9 60 10 00 mv r2,r11
* determine media code
*/
if (ret_val == 0) {
if ((rqdata != NULL) &&
(rqdata->media != 0)) {
const char valid_media_codes[] =
800a500: 33 83 03 00 sb (sp+768),r3
{0xF0,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF};
if (NULL==memchr(valid_media_codes,
800a504: 34 03 00 09 mvi r3,9
* determine media code
*/
if (ret_val == 0) {
if ((rqdata != NULL) &&
(rqdata->media != 0)) {
const char valid_media_codes[] =
800a508: 5b 85 02 f8 sw (sp+760),r5
800a50c: 5b 84 02 fc sw (sp+764),r4
{0xF0,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF};
if (NULL==memchr(valid_media_codes,
800a510: f8 00 44 a9 calli 801b7b4 <memchr>
800a514: 5c 20 00 06 bne r1,r0,800a52c <msdos_format+0x6dc> <== NEVER TAKEN
rqdata->media,
sizeof(valid_media_codes))) {
ret_val = -1;
errno = EINVAL;
800a518: f8 00 41 cf calli 801ac54 <__errno>
800a51c: 34 03 00 16 mvi r3,22
800a520: 58 23 00 00 sw (r1+0),r3
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;
800a524: 34 17 ff ff mvi r23,-1
800a528: e0 00 00 05 bi 800a53c <msdos_format+0x6ec>
errno = EINVAL;
}
else {
fmt_params->media_code = rqdata->media;
800a52c: 33 8b 02 8d sb (sp+653),r11 <== NOT EXECUTED
800a530: e0 00 00 03 bi 800a53c <msdos_format+0x6ec> <== NOT EXECUTED
}
}
else {
fmt_params->media_code = FAT_BR_MEDIA_FIXED;
800a534: 34 03 ff f8 mvi r3,-8
800a538: 33 83 02 8d sb (sp+653),r3
}
/*
* determine location and size of root directory
* for formatting
*/
if (fmt_params->root_dir_sectors > 0) {
800a53c: 2b 8c 02 78 lw r12,(sp+632)
800a540: 2b 8b 02 64 lw r11,(sp+612)
800a544: 43 83 02 8c lbu r3,(sp+652)
800a548: 45 80 00 08 be r12,r0,800a568 <msdos_format+0x718>
fmt_params->root_dir_start_sec =
fmt_params->rsvd_sector_cnt
+ (fmt_params-> fat_num*fmt_params->sectors_per_fat);
800a54c: 2b 82 02 6c lw r2,(sp+620)
800a550: b8 60 08 00 mv r1,r3
800a554: fb ff db 73 calli 8001320 <__mulsi3>
800a558: b4 2b 58 00 add r11,r1,r11
/*
* determine location and size of root directory
* for formatting
*/
if (fmt_params->root_dir_sectors > 0) {
fmt_params->root_dir_start_sec =
800a55c: 5b 8b 02 7c sw (sp+636),r11
fmt_params->rsvd_sector_cnt
+ (fmt_params-> fat_num*fmt_params->sectors_per_fat);
fmt_params->root_dir_fmt_sec_cnt = fmt_params->root_dir_sectors;
800a560: 5b 8c 02 80 sw (sp+640),r12
800a564: e0 00 00 08 bi 800a584 <msdos_format+0x734>
/*
* 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);
800a568: 2b 82 02 6c lw r2,(sp+620)
800a56c: b8 60 08 00 mv r1,r3
800a570: fb ff db 6c calli 8001320 <__mulsi3>
fmt_params->root_dir_fmt_sec_cnt = fmt_params->sectors_per_cluster;
800a574: 2b 83 02 68 lw r3,(sp+616)
/*
* 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);
800a578: b4 2b 58 00 add r11,r1,r11
}
else {
/*
* for FAT32: root directory is in cluster 2
*/
fmt_params->root_dir_start_sec =
800a57c: 5b 8b 02 7c sw (sp+636),r11
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;
800a580: 5b 83 02 80 sw (sp+640),r3
}
/*
* determine usable OEMName
*/
if (ret_val == 0) {
800a584: 5e e0 00 3e bne r23,r0,800a67c <msdos_format+0x82c>
const char *from;
char *to = fmt_params->OEMName;
int cnt;
from = "RTEMS"; /* default: make "from" point to OS Name */
800a588: 78 03 08 02 mvhi r3,0x802
800a58c: 38 63 e4 3c ori r3,r3,0xe43c
if ((rqdata != NULL) &&
800a590: 47 17 00 05 be r24,r23,800a5a4 <msdos_format+0x754>
(rqdata->OEMName != NULL)) {
800a594: 2b 03 00 00 lw r3,(r24+0)
if (ret_val == 0) {
const char *from;
char *to = fmt_params->OEMName;
int cnt;
from = "RTEMS"; /* default: make "from" point to OS Name */
if ((rqdata != NULL) &&
800a598: 5c 60 00 03 bne r3,r0,800a5a4 <msdos_format+0x754>
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->OEMName;
int cnt;
from = "RTEMS"; /* default: make "from" point to OS Name */
800a59c: 78 03 08 02 mvhi r3,0x802
800a5a0: 38 63 e4 3c ori r3,r3,0xe43c
from = rqdata->OEMName;
}
for (cnt = 0;
cnt < (sizeof(fmt_params->OEMName)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
800a5a4: 78 04 08 03 mvhi r4,0x803
800a5a8: 38 84 02 78 ori r4,r4,0x278
800a5ac: 28 88 00 00 lw r8,(r4+0)
}
/*=========================================================================*\
| Function: |
\*-------------------------------------------------------------------------*/
int msdos_format
800a5b0: 37 87 02 98 addi r7,sp,664
from = rqdata->OEMName;
}
for (cnt = 0;
cnt < (sizeof(fmt_params->OEMName)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
800a5b4: 37 84 02 90 addi r4,sp,656
/*
* non-printable character in given name, so keep stuck
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
800a5b8: 34 06 00 20 mvi r6,32
800a5bc: e0 00 00 0c bi 800a5ec <msdos_format+0x79c>
from = rqdata->OEMName;
}
for (cnt = 0;
cnt < (sizeof(fmt_params->OEMName)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
800a5c0: 40 61 00 00 lbu r1,(r3+0)
800a5c4: b5 01 10 00 add r2,r8,r1
800a5c8: 40 42 00 01 lbu r2,(r2+1)
800a5cc: 20 42 00 97 andi r2,r2,0x97
800a5d0: 44 40 00 04 be r2,r0,800a5e0 <msdos_format+0x790>
*to++ = *from++;
800a5d4: 30 81 ff ff sb (r4+-1),r1
800a5d8: 34 63 00 01 addi r3,r3,1
800a5dc: e0 00 00 02 bi 800a5e4 <msdos_format+0x794>
/*
* non-printable character in given name, so keep stuck
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
800a5e0: 30 86 ff ff sb (r4+-1),r6
}
*to = '\0';
800a5e4: 30 80 00 00 sb (r4+0),r0
800a5e8: 34 84 00 01 addi r4,r4,1
from = "RTEMS"; /* default: make "from" point to OS Name */
if ((rqdata != NULL) &&
(rqdata->OEMName != NULL)) {
from = rqdata->OEMName;
}
for (cnt = 0;
800a5ec: 5c 87 ff f5 bne r4,r7,800a5c0 <msdos_format+0x770>
800a5f0: e0 00 01 fd bi 800ade4 <msdos_format+0xf94>
const char *from;
char *to = fmt_params->VolLabel;
int cnt;
from = ""; /* default: make "from" point to empty string */
if ((rqdata != NULL) &&
(rqdata->VolLabel != NULL)) {
800a5f4: 2b 03 00 04 lw r3,(r24+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) &&
800a5f8: 44 60 00 04 be r3,r0,800a608 <msdos_format+0x7b8>
(rqdata->VolLabel != NULL)) {
from = rqdata->VolLabel;
fmt_params->VolLabel_present = true;
800a5fc: 34 04 00 01 mvi r4,1
800a600: 33 84 02 a4 sb (sp+676),r4
800a604: e0 00 00 03 bi 800a610 <msdos_format+0x7c0>
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->VolLabel;
int cnt;
from = ""; /* default: make "from" point to empty string */
800a608: 78 03 08 02 mvhi r3,0x802
800a60c: 38 63 e4 e0 ori r3,r3,0xe4e0
fmt_params->VolLabel_present = true;
}
for (cnt = 0;
cnt < (sizeof(fmt_params->VolLabel)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
800a610: 78 04 08 03 mvhi r4,0x803
800a614: 38 84 02 78 ori r4,r4,0x278
}
/*=========================================================================*\
| Function: |
\*-------------------------------------------------------------------------*/
int msdos_format
800a618: 37 87 02 5c addi r7,sp,604
fmt_params->VolLabel_present = true;
}
for (cnt = 0;
cnt < (sizeof(fmt_params->VolLabel)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
800a61c: 28 88 00 00 lw r8,(r4+0)
}
/*=========================================================================*\
| Function: |
\*-------------------------------------------------------------------------*/
int msdos_format
800a620: 34 e7 00 48 addi r7,r7,72
fmt_params->VolLabel_present = true;
}
for (cnt = 0;
cnt < (sizeof(fmt_params->VolLabel)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
800a624: 37 84 02 99 addi r4,sp,665
/*
* non-printable character in given name, so keep stuck
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
800a628: 34 06 00 20 mvi r6,32
800a62c: e0 00 00 0c bi 800a65c <msdos_format+0x80c>
fmt_params->VolLabel_present = true;
}
for (cnt = 0;
cnt < (sizeof(fmt_params->VolLabel)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
800a630: 40 61 00 00 lbu r1,(r3+0)
800a634: b5 01 10 00 add r2,r8,r1
800a638: 40 42 00 01 lbu r2,(r2+1)
800a63c: 20 42 00 97 andi r2,r2,0x97
800a640: 44 40 00 04 be r2,r0,800a650 <msdos_format+0x800>
*to++ = *from++;
800a644: 30 81 ff ff sb (r4+-1),r1
800a648: 34 63 00 01 addi r3,r3,1
800a64c: e0 00 00 02 bi 800a654 <msdos_format+0x804>
/*
* non-printable character in given name, so keep stuck
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
800a650: 30 86 ff ff sb (r4+-1),r6
}
*to = '\0';
800a654: 30 80 00 00 sb (r4+0),r0
800a658: 34 84 00 01 addi r4,r4,1
if ((rqdata != NULL) &&
(rqdata->VolLabel != NULL)) {
from = rqdata->VolLabel;
fmt_params->VolLabel_present = true;
}
for (cnt = 0;
800a65c: 5c 87 ff f5 bne r4,r7,800a630 <msdos_format+0x7e0>
800a660: e0 00 01 e3 bi 800adec <msdos_format+0xf9c>
int rc;
struct timeval time_value;
rc = rtems_clock_get_tod_timeval(&time_value);
if (rc == RTEMS_SUCCESSFUL) {
*volid_ptr = time_value.tv_sec + time_value.tv_sec;
800a664: 2b 83 02 f8 lw r3,(sp+760) <== NOT EXECUTED
800a668: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED
800a66c: 5b 83 02 a8 sw (sp+680),r3 <== NOT EXECUTED
800a670: e0 00 00 03 bi 800a67c <msdos_format+0x82c> <== NOT EXECUTED
}
else {
*volid_ptr = rand();
800a674: f8 00 47 83 calli 801c480 <rand>
800a678: 5b 81 02 a8 sw (sp+680),r1
}
/*
* if requested, write whole disk/partition with 0xe5
*/
if ((ret_val == 0) &&
(rqdata != NULL) &&
800a67c: 7f 0d 00 00 cmpnei r13,r24,0
ret_val = msdos_format_determine_fmt_params(fd,rqdata,&fmt_params);
}
/*
* if requested, write whole disk/partition with 0xe5
*/
if ((ret_val == 0) &&
800a680: 66 e3 00 00 cmpei r3,r23,0
800a684: a1 a3 18 00 and r3,r13,r3
800a688: 44 60 00 0a be r3,r0,800a6b0 <msdos_format+0x860>
(rqdata != NULL) &&
800a68c: 43 03 00 15 lbu r3,(r24+21)
800a690: 5c 60 00 09 bne r3,r0,800a6b4 <msdos_format+0x864>
!(rqdata->quick_format)) {
ret_val = msdos_format_fill_sectors
800a694: 2b 84 02 60 lw r4,(sp+608)
800a698: 2b 85 02 5c lw r5,(sp+604)
800a69c: bb 00 08 00 mv r1,r24
800a6a0: bb 20 10 00 mv r2,r25
800a6a4: 34 06 00 e5 mvi r6,229
800a6a8: fb ff fd 83 calli 8009cb4 <msdos_format_fill_sectors>
800a6ac: b8 20 b8 00 mv r23,r1
}
/*
* create master boot record
*/
if (ret_val == 0) {
800a6b0: 5e e0 01 dd bne r23,r0,800ae24 <msdos_format+0xfd4>
/*
* Read the current MBR to obtain the partition table.
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
800a6b4: 78 03 08 02 mvhi r3,0x802
800a6b8: bb 00 08 00 mv r1,r24
800a6bc: 34 02 00 02 mvi r2,2
800a6c0: 38 63 e4 e4 ori r3,r3,0xe4e4
800a6c4: fb ff fd 44 calli 8009bd4 <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)) {
800a6c8: bb 20 08 00 mv r1,r25
800a6cc: 34 02 00 00 mvi r2,0
800a6d0: 34 03 00 00 mvi 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,
800a6d4: 2b 8b 02 5c lw r11,(sp+604)
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
int ret_val = 0;
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
800a6d8: f8 00 1e 73 calli 80120a4 <lseek>
800a6dc: 48 01 00 06 bg r0,r1,800a6f4 <msdos_format+0x8a4> <== NEVER TAKEN
ret_val = -1;
}
if (ret_val == 0) {
if (0 > read(fd,buffer,sector_size)) {
800a6e0: bb 20 08 00 mv r1,r25
800a6e4: 37 82 00 5c addi r2,sp,92
800a6e8: b9 60 18 00 mv r3,r11
800a6ec: f8 00 1f 5c calli 801245c <read>
800a6f0: 4c 20 01 c3 bge r1,r0,800adfc <msdos_format+0xfac> <== ALWAYS TAKEN
fmt_params.bytes_per_sector,
tmp_sec);
}
}
if (ret_val == 0 && rqdata != NULL && rqdata->sync_device) {
800a6f4: 34 17 ff ff mvi r23,-1 <== NOT EXECUTED
800a6f8: e0 00 01 cb bi 800ae24 <msdos_format+0xfd4> <== 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) {
800a6fc: b9 60 60 00 mv r12,r11
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
uint32_t total_sectors_num16 = 0;
800a700: 34 0b 00 00 mvi r11,0
* finally we are there: let's fill in the values into the MBR
* but first clear the MRB leaving the partition table.
*/
#define RTEMS_IDE_PARTITION_TABLE_OFFSET 0x1be
#define RTEMS_IDE_PARTITION_TABLE_SIZE (4 * 16)
memset(mbr,0,RTEMS_IDE_PARTITION_TABLE_OFFSET);
800a704: 34 02 00 00 mvi r2,0
800a708: 34 03 01 be mvi r3,446
800a70c: 37 81 00 5c addi r1,sp,92
800a710: f8 00 44 e0 calli 801ba90 <memset>
*/
/*
* fill OEMName
*/
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
fmt_params->OEMName,
800a714: 37 83 02 8f addi r3,sp,655
* with 0xEB,....
*/
/*
* fill OEMName
*/
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
800a718: 40 6a 00 01 lbu r10,(r3+1)
800a71c: 40 69 00 02 lbu r9,(r3+2)
800a720: 40 68 00 03 lbu r8,(r3+3)
800a724: 40 67 00 04 lbu r7,(r3+4)
800a728: 40 66 00 05 lbu r6,(r3+5)
800a72c: 40 65 00 06 lbu r5,(r3+6)
800a730: 40 63 00 07 lbu r3,(r3+7)
800a734: 37 84 00 5f addi r4,sp,95
800a738: 43 8e 02 8f lbu r14,(sp+655)
800a73c: 30 83 00 07 sb (r4+7),r3
fmt_params->OEMName,
FAT_BR_OEMNAME_SIZE);
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
800a740: 2b 83 02 5c lw r3,(sp+604)
* with 0xEB,....
*/
/*
* fill OEMName
*/
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
800a744: 30 8a 00 01 sb (r4+1),r10
800a748: 30 89 00 02 sb (r4+2),r9
800a74c: 30 88 00 03 sb (r4+3),r8
800a750: 30 87 00 04 sb (r4+4),r7
800a754: 30 86 00 05 sb (r4+5),r6
800a758: 30 85 00 06 sb (r4+6),r5
fmt_params->OEMName,
FAT_BR_OEMNAME_SIZE);
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
800a75c: b8 60 08 00 mv r1,r3
800a760: 34 02 00 08 mvi r2,8
* with 0xEB,....
*/
/*
* fill OEMName
*/
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
800a764: 33 8e 00 5f sb (sp+95),r14
fmt_params->OEMName,
FAT_BR_OEMNAME_SIZE);
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
800a768: 33 83 00 67 sb (sp+103),r3
* 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,
800a76c: 0f 80 02 5a sh (sp+602),r0
* 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);
800a770: f8 00 8b 3a calli 802d458 <__lshrsi3>
FAT_SET_BR_SECTORS_PER_CLUSTER(mbr , fmt_params->sectors_per_cluster);
800a774: 2b 83 02 68 lw r3,(sp+616)
* 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);
800a778: 33 81 00 68 sb (sp+104),r1
FAT_SET_BR_SECTORS_PER_CLUSTER(mbr , fmt_params->sectors_per_cluster);
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
800a77c: 34 02 00 08 mvi 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);
800a780: 33 83 00 69 sb (sp+105),r3
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
800a784: 2b 83 02 64 lw r3,(sp+612)
/* number of FATs on medium */
FAT_SET_BR_FAT_NUM(mbr , 2); /* standard/recommended value */
800a788: 34 0f 00 02 mvi r15,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... */
800a78c: 34 0e 00 01 mvi r14,1
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);
800a790: b8 60 08 00 mv r1,r3
800a794: 33 83 00 6a sb (sp+106),r3
800a798: f8 00 8b 30 calli 802d458 <__lshrsi3>
/* 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);
800a79c: 2b 83 02 74 lw r3,(sp+628)
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);
800a7a0: 33 81 00 6b sb (sp+107),r1
/* 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);
800a7a4: 34 02 00 08 mvi r2,8
800a7a8: b8 60 08 00 mv r1,r3
800a7ac: 33 83 00 6d sb (sp+109),r3
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 */
800a7b0: 33 8f 00 6c sb (sp+108),r15
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
800a7b4: f8 00 8b 29 calli 802d458 <__lshrsi3>
800a7b8: 33 81 00 6e sb (sp+110),r1
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
800a7bc: 34 02 00 08 mvi r2,8
800a7c0: b9 60 08 00 mv r1,r11
800a7c4: 33 8b 00 6f sb (sp+111),r11
800a7c8: f8 00 8b 24 calli 802d458 <__lshrsi3>
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
800a7cc: 43 83 02 8d lbu r3,(sp+653)
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
/* number of FATs on medium */
FAT_SET_BR_FAT_NUM(mbr , 2); /* standard/recommended value */
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
800a7d0: 33 81 00 70 sb (sp+112),r1
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);
800a7d4: 34 02 00 08 mvi r2,8
/* 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);
800a7d8: 33 83 00 71 sb (sp+113),r3
FAT_SET_BR_SECTORS_PER_TRACK(mbr , 255); /* only needed for INT13... */
800a7dc: 34 03 ff ff mvi r3,-1
800a7e0: 33 83 00 74 sb (sp+116),r3
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);
800a7e4: 21 81 ff ff andi r1,r12,0xffff
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
FAT_SET_BR_SECTORS_PER_TRACK(mbr , 255); /* only needed for INT13... */
FAT_SET_BR_NUMBER_OF_HEADS(mbr , 6); /* only needed for INT13... */
800a7e8: 34 03 00 06 mvi r3,6
800a7ec: 33 83 00 76 sb (sp+118),r3
FAT_SET_BR_HIDDEN_SECTORS(mbr , 1); /* only needed for INT13... */
FAT_SET_BR_TOTAL_SECTORS_NUM32(mbr , total_sectors_num32);
800a7f0: 33 8c 00 7c sb (sp+124),r12
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... */
800a7f4: 33 8e 00 78 sb (sp+120),r14
FAT_SET_BR_TOTAL_SECTORS_NUM32(mbr , total_sectors_num32);
800a7f8: f8 00 8b 18 calli 802d458 <__lshrsi3>
800a7fc: 33 81 00 7d sb (sp+125),r1
800a800: 34 02 00 10 mvi r2,16
800a804: b9 80 08 00 mv r1,r12
800a808: f8 00 8b 14 calli 802d458 <__lshrsi3>
800a80c: 33 81 00 7e sb (sp+126),r1
800a810: 34 02 00 18 mvi r2,24
800a814: b9 80 08 00 mv r1,r12
800a818: f8 00 8b 10 calli 802d458 <__lshrsi3>
if (fmt_params->fattype != FAT_FAT32) {
800a81c: 43 8c 02 8e lbu r12,(sp+654)
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);
800a820: 33 81 00 7f sb (sp+127),r1
if (fmt_params->fattype != FAT_FAT32) {
800a824: 34 03 00 04 mvi r3,4
800a828: 2b 8b 02 6c lw r11,(sp+620)
800a82c: 45 83 00 46 be r12,r3,800a944 <msdos_format+0xaf4>
FAT_SET_BR_SECTORS_PER_FAT(mbr ,fmt_params->sectors_per_fat);
800a830: b9 60 08 00 mv r1,r11
800a834: 34 02 00 08 mvi r2,8
800a838: 33 8b 00 72 sb (sp+114),r11
800a83c: f8 00 8b 07 calli 802d458 <__lshrsi3>
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 */
800a840: 2b 8b 02 a8 lw r11,(sp+680)
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);
800a844: 34 03 00 29 mvi r3,41
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);
800a848: 33 81 00 73 sb (sp+115),r1
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 */
800a84c: 34 02 00 08 mvi r2,8
800a850: 21 61 ff ff andi r1,r11,0xffff
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);
800a854: 33 83 00 82 sb (sp+130),r3
FAT_SET_BR_VOLID(mbr , fmt_params->vol_id); /* volume id */
800a858: 33 8b 00 83 sb (sp+131),r11
800a85c: f8 00 8a ff calli 802d458 <__lshrsi3>
800a860: 33 81 00 84 sb (sp+132),r1
800a864: 34 02 00 10 mvi r2,16
800a868: b9 60 08 00 mv r1,r11
800a86c: f8 00 8a fb calli 802d458 <__lshrsi3>
800a870: 33 81 00 85 sb (sp+133),r1
800a874: 34 02 00 18 mvi r2,24
800a878: b9 60 08 00 mv r1,r11
800a87c: f8 00 8a f7 calli 802d458 <__lshrsi3>
memcpy(FAT_GET_ADDR_BR_VOLLAB(mbr),
fmt_params->VolLabel,
800a880: 37 83 02 98 addi r3,sp,664
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 */
memcpy(FAT_GET_ADDR_BR_VOLLAB(mbr),
800a884: 40 6f 00 01 lbu r15,(r3+1)
800a888: 40 6e 00 02 lbu r14,(r3+2)
800a88c: 40 6b 00 03 lbu r11,(r3+3)
800a890: 40 6a 00 04 lbu r10,(r3+4)
800a894: 40 69 00 05 lbu r9,(r3+5)
800a898: 40 68 00 06 lbu r8,(r3+6)
800a89c: 40 67 00 07 lbu r7,(r3+7)
800a8a0: 40 66 00 08 lbu r6,(r3+8)
800a8a4: 40 65 00 09 lbu r5,(r3+9)
800a8a8: 43 90 02 98 lbu r16,(sp+664)
800a8ac: 40 63 00 0a lbu r3,(r3+10)
800a8b0: 37 84 00 87 addi r4,sp,135
800a8b4: 30 8f 00 01 sb (r4+1),r15
800a8b8: 30 83 00 0a sb (r4+10),r3
800a8bc: 30 8e 00 02 sb (r4+2),r14
800a8c0: 30 8b 00 03 sb (r4+3),r11
800a8c4: 30 8a 00 04 sb (r4+4),r10
800a8c8: 30 89 00 05 sb (r4+5),r9
800a8cc: 30 88 00 06 sb (r4+6),r8
800a8d0: 30 87 00 07 sb (r4+7),r7
800a8d4: 30 86 00 08 sb (r4+8),r6
800a8d8: 30 85 00 09 sb (r4+9),r5
fmt_params->VolLabel,
FAT_BR_VOLLAB_SIZE);
memcpy(FAT_GET_ADDR_BR_FILSYSTYPE(mbr),
800a8dc: 78 03 08 02 mvhi r3,0x802
if (fmt_params->fattype != FAT_FAT32) {
FAT_SET_BR_SECTORS_PER_FAT(mbr ,fmt_params->sectors_per_fat);
FAT_SET_BR_DRVNUM(mbr , 0); /* only needed for INT13... */
FAT_SET_BR_RSVD1(mbr , 0); /* fill with zero */
FAT_SET_BR_BOOTSIG(mbr , FAT_BR_BOOTSIG_VAL);
FAT_SET_BR_VOLID(mbr , fmt_params->vol_id); /* volume id */
800a8e0: 33 81 00 86 sb (sp+134),r1
memcpy(FAT_GET_ADDR_BR_VOLLAB(mbr),
800a8e4: 33 90 00 87 sb (sp+135),r16
fmt_params->VolLabel,
FAT_BR_VOLLAB_SIZE);
memcpy(FAT_GET_ADDR_BR_FILSYSTYPE(mbr),
800a8e8: 34 04 00 01 mvi r4,1
800a8ec: 38 63 e4 50 ori r3,r3,0xe450
800a8f0: 5d 84 00 03 bne r12,r4,800a8fc <msdos_format+0xaac>
800a8f4: 78 03 08 02 mvhi r3,0x802
800a8f8: 38 63 e4 44 ori r3,r3,0xe444
800a8fc: 40 6b 00 00 lbu r11,(r3+0)
800a900: 40 6a 00 01 lbu r10,(r3+1)
800a904: 40 69 00 02 lbu r9,(r3+2)
800a908: 40 68 00 03 lbu r8,(r3+3)
800a90c: 40 67 00 04 lbu r7,(r3+4)
800a910: 40 66 00 05 lbu r6,(r3+5)
800a914: 40 65 00 06 lbu r5,(r3+6)
800a918: 40 63 00 07 lbu r3,(r3+7)
800a91c: 37 84 00 92 addi r4,sp,146
800a920: 33 8b 00 92 sb (sp+146),r11
800a924: 30 8a 00 01 sb (r4+1),r10
800a928: 30 89 00 02 sb (r4+2),r9
800a92c: 30 88 00 03 sb (r4+3),r8
800a930: 30 87 00 04 sb (r4+4),r7
800a934: 30 86 00 05 sb (r4+5),r6
800a938: 30 85 00 06 sb (r4+6),r5
800a93c: 30 83 00 07 sb (r4+7),r3
800a940: e0 00 00 2b bi 800a9ec <msdos_format+0xb9c>
? "FAT12 "
: "FAT16 ",
FAT_BR_FILSYSTYPE_SIZE);
}
else {
FAT_SET_BR_SECTORS_PER_FAT32(mbr ,fmt_params->sectors_per_fat);
800a944: 34 02 00 08 mvi r2,8
800a948: 21 61 ff ff andi r1,r11,0xffff
800a94c: 33 8b 00 80 sb (sp+128),r11
800a950: f8 00 8a c2 calli 802d458 <__lshrsi3>
800a954: 33 81 00 81 sb (sp+129),r1
800a958: 34 02 00 10 mvi r2,16
800a95c: b9 60 08 00 mv r1,r11
800a960: f8 00 8a be calli 802d458 <__lshrsi3>
800a964: 33 81 00 82 sb (sp+130),r1
800a968: 34 02 00 18 mvi r2,24
800a96c: b9 60 08 00 mv r1,r11
800a970: f8 00 8a ba calli 802d458 <__lshrsi3>
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 */
800a974: 2b 83 02 84 lw r3,(sp+644)
? "FAT12 "
: "FAT16 ",
FAT_BR_FILSYSTYPE_SIZE);
}
else {
FAT_SET_BR_SECTORS_PER_FAT32(mbr ,fmt_params->sectors_per_fat);
800a978: 33 81 00 83 sb (sp+131),r1
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 */
800a97c: 34 02 00 08 mvi r2,8
800a980: b8 60 08 00 mv r1,r3
800a984: 33 83 00 8e sb (sp+142),r3
}
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 */
800a988: 33 8f 00 88 sb (sp+136),r15
FAT_SET_BR_FAT32_FS_INFO_SECTOR(mbr, 1); /* Put fsinfo to rsrvd sec 1*/
800a98c: 33 8e 00 8c sb (sp+140),r14
FAT_SET_BR_FAT32_BK_BOOT_SECTOR(mbr, fmt_params->mbr_copy_sec ); /* Put MBR copy to rsrvd sec */
800a990: f8 00 8a b2 calli 802d458 <__lshrsi3>
800a994: 33 81 00 8f sb (sp+143),r1
memset(FAT_GET_ADDR_BR_FAT32_RESERVED(mbr),0,FAT_BR_FAT32_RESERVED_SIZE);
800a998: 34 02 00 00 mvi r2,0
800a99c: 34 03 00 0c mvi r3,12
800a9a0: 37 81 00 90 addi r1,sp,144
800a9a4: f8 00 44 3b calli 801ba90 <memset>
FAT_SET_BR_FAT32_DRVNUM(mbr , 0); /* only needed for INT13... */
FAT_SET_BR_FAT32_RSVD1(mbr , 0); /* fill with zero */
FAT_SET_BR_FAT32_BOOTSIG(mbr ,FAT_BR_FAT32_BOOTSIG_VAL);
800a9a8: 34 03 00 29 mvi r3,41
800a9ac: 33 83 00 9e sb (sp+158),r3
FAT_SET_BR_FAT32_VOLID(mbr , 0); /* not set */
memset(FAT_GET_ADDR_BR_FAT32_VOLLAB(mbr) ,0,FAT_BR_VOLLAB_SIZE);
800a9b0: 37 81 00 a3 addi r1,sp,163
800a9b4: 34 03 00 0b mvi r3,11
800a9b8: 34 02 00 00 mvi r2,0
800a9bc: f8 00 44 35 calli 801ba90 <memset>
memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr),
800a9c0: 78 03 08 02 mvhi r3,0x802
800a9c4: 38 63 e4 f8 ori r3,r3,0xe4f8
800a9c8: 2c 67 00 00 lhu r7,(r3+0)
800a9cc: 2c 66 00 02 lhu r6,(r3+2)
800a9d0: 2c 65 00 04 lhu r5,(r3+4)
800a9d4: 2c 63 00 06 lhu r3,(r3+6)
800a9d8: 37 84 00 ae addi r4,sp,174
800a9dc: 0f 87 00 ae sh (sp+174),r7
800a9e0: 0c 86 00 02 sh (r4+2),r6
800a9e4: 0c 85 00 04 sh (r4+4),r5
800a9e8: 0c 83 00 06 sh (r4+6),r3
FAT_BR_FILSYSTYPE_SIZE);
}
/*
* add boot record signature
*/
FAT_SET_BR_SIGNATURE(mbr, FAT_BR_SIGNATURE_VAL);
800a9ec: 34 03 00 55 mvi r3,85
800a9f0: 33 83 02 5a sb (sp+602),r3
800a9f4: 34 03 ff aa mvi r3,-86
800a9f8: 33 83 02 5b sb (sp+603),r3
/*
* add jump to boot loader at start of sector
*/
FAT_SET_VAL8(mbr,0,0xeb);
800a9fc: 34 03 ff eb mvi r3,-21
800aa00: 33 83 00 5c sb (sp+92),r3
FAT_SET_VAL8(mbr,1,0x3c);
800aa04: 34 03 00 3c mvi r3,60
800aa08: 33 83 00 5d sb (sp+93),r3
FAT_SET_VAL8(mbr,2,0x90);
800aa0c: 34 03 ff 90 mvi r3,-112
800aa10: 33 83 00 5e sb (sp+94),r3
/*
* 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,
800aa14: 78 03 08 02 mvhi r3,0x802
800aa18: bb 00 08 00 mv r1,r24
800aa1c: 34 02 00 02 mvi r2,2
800aa20: 38 63 e5 04 ori r3,r3,0xe504
800aa24: fb ff fc 6c calli 8009bd4 <msdos_format_printf>
"write MRB sector\n");
ret_val = msdos_format_write_sec(fd,
800aa28: 2b 83 02 5c lw r3,(sp+604)
800aa2c: 37 8b 00 5c addi r11,sp,92
800aa30: bb 20 08 00 mv r1,r25
800aa34: 34 02 00 00 mvi r2,0
800aa38: b9 60 20 00 mv r4,r11
800aa3c: fb ff fc 80 calli 8009c3c <msdos_format_write_sec>
800aa40: b8 20 b8 00 mv r23,r1
0,
fmt_params.bytes_per_sector,
tmp_sec);
}
if ((ret_val == 0) &&
800aa44: 5c 20 00 f8 bne r1,r0,800ae24 <msdos_format+0xfd4> <== NEVER TAKEN
800aa48: 2b 83 02 84 lw r3,(sp+644)
800aa4c: 44 61 00 0d be r3,r1,800aa80 <msdos_format+0xc30>
(fmt_params.mbr_copy_sec != 0)) {
/*
* write copy of MBR
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
800aa50: 78 03 08 02 mvhi r3,0x802
800aa54: bb 00 08 00 mv r1,r24
800aa58: 34 02 00 02 mvi r2,2
800aa5c: 38 63 e5 18 ori r3,r3,0xe518
800aa60: fb ff fc 5d calli 8009bd4 <msdos_format_printf>
"write back up MRB sector\n");
ret_val = msdos_format_write_sec(fd,
800aa64: 2b 82 02 84 lw r2,(sp+644)
800aa68: 2b 83 02 5c lw r3,(sp+604)
800aa6c: bb 20 08 00 mv r1,r25
800aa70: b9 60 20 00 mv r4,r11
800aa74: fb ff fc 72 calli 8009c3c <msdos_format_write_sec>
800aa78: b8 20 b8 00 mv r23,r1
}
}
/*
* for FAT32: initialize info sector on disk
*/
if ((ret_val == 0) &&
800aa7c: 5c 20 00 ea bne r1,r0,800ae24 <msdos_format+0xfd4> <== NEVER TAKEN
(fmt_params.fsinfo_sec != 0)) {
800aa80: 2b 8c 02 88 lw r12,(sp+648)
}
}
/*
* for FAT32: initialize info sector on disk
*/
if ((ret_val == 0) &&
800aa84: 45 80 00 26 be r12,r0,800ab1c <msdos_format+0xccc>
(fmt_params.fsinfo_sec != 0)) {
ret_val = msdos_format_gen_fsinfo(tmp_sec);
800aa88: 37 8b 00 5c addi r11,sp,92
\*=========================================================================*/
{
/*
* clear fsinfo sector data
*/
memset(fsinfo,0,FAT_TOTAL_FSINFO_SIZE);
800aa8c: 34 02 00 00 mvi r2,0
800aa90: 34 03 02 00 mvi r3,512
800aa94: b9 60 08 00 mv r1,r11
800aa98: f8 00 43 fe calli 801ba90 <memset>
/*
* write LEADSIG, STRUCTSIG, TRAILSIG
*/
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
800aa9c: 34 03 00 52 mvi r3,82
800aaa0: 33 83 00 5c sb (sp+92),r3
800aaa4: 33 83 00 5d sb (sp+93),r3
800aaa8: 34 03 00 61 mvi r3,97
800aaac: 33 83 00 5e sb (sp+94),r3
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
800aab0: 33 83 02 43 sb (sp+579),r3
FAT_SET_FSINFO_TRAIL_SIGNATURE(fsinfo,FAT_FSINFO_TRAIL_SIGNATURE_VALUE);
800aab4: 34 03 00 55 mvi r3,85
800aab8: 33 83 02 5a sb (sp+602),r3
800aabc: 34 03 ff aa mvi r3,-86
800aac0: 33 83 02 5b sb (sp+603),r3
/*
* write "empty" values for free cluster count and next cluster number
*/
FAT_SET_FSINFO_FREE_CLUSTER_COUNT(fsinfo+FAT_FSI_INFO,
800aac4: 34 03 ff ff mvi r3,-1
800aac8: 33 83 02 44 sb (sp+580),r3
800aacc: 33 83 02 45 sb (sp+581),r3
800aad0: 33 83 02 46 sb (sp+582),r3
800aad4: 33 83 02 47 sb (sp+583),r3
0xffffffff);
FAT_SET_FSINFO_NEXT_FREE_CLUSTER (fsinfo+FAT_FSI_INFO,
800aad8: 33 83 02 48 sb (sp+584),r3
800aadc: 33 83 02 49 sb (sp+585),r3
800aae0: 33 83 02 4a sb (sp+586),r3
800aae4: 33 83 02 4b sb (sp+587),r3
/*
* write fsinfo sector
*/
if ((ret_val == 0) &&
(fmt_params.fsinfo_sec != 0)) {
ret_val = msdos_format_write_sec(fd,
800aae8: 2b 83 02 5c lw r3,(sp+604)
*/
memset(fsinfo,0,FAT_TOTAL_FSINFO_SIZE);
/*
* write LEADSIG, STRUCTSIG, TRAILSIG
*/
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
800aaec: 34 04 00 41 mvi r4,65
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
800aaf0: 34 05 00 72 mvi r5,114
*/
memset(fsinfo,0,FAT_TOTAL_FSINFO_SIZE);
/*
* write LEADSIG, STRUCTSIG, TRAILSIG
*/
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
800aaf4: 33 84 00 5f sb (sp+95),r4
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
800aaf8: 33 84 02 42 sb (sp+578),r4
/*
* write fsinfo sector
*/
if ((ret_val == 0) &&
(fmt_params.fsinfo_sec != 0)) {
ret_val = msdos_format_write_sec(fd,
800aafc: bb 20 08 00 mv r1,r25
800ab00: b9 80 10 00 mv r2,r12
800ab04: b9 60 20 00 mv r4,r11
memset(fsinfo,0,FAT_TOTAL_FSINFO_SIZE);
/*
* 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);
800ab08: 33 85 02 40 sb (sp+576),r5
800ab0c: 33 85 02 41 sb (sp+577),r5
/*
* write fsinfo sector
*/
if ((ret_val == 0) &&
(fmt_params.fsinfo_sec != 0)) {
ret_val = msdos_format_write_sec(fd,
800ab10: fb ff fc 4b calli 8009c3c <msdos_format_write_sec>
800ab14: b8 20 b8 00 mv r23,r1
}
/*
* write FAT as all empty
* -> write all FAT sectors as zero
*/
if (ret_val == 0) {
800ab18: 5c 20 00 c3 bne r1,r0,800ae24 <msdos_format+0xfd4> <== NEVER TAKEN
ret_val = msdos_format_fill_sectors
(rqdata,
800ab1c: 2b 82 02 6c lw r2,(sp+620)
800ab20: 43 81 02 8c lbu r1,(sp+652)
800ab24: fb ff d9 ff calli 8001320 <__mulsi3>
/*
* write FAT as all empty
* -> write all FAT sectors as zero
*/
if (ret_val == 0) {
ret_val = msdos_format_fill_sectors
800ab28: 2b 83 02 64 lw r3,(sp+612)
800ab2c: 2b 85 02 5c lw r5,(sp+604)
(rqdata,
800ab30: b8 20 20 00 mv r4,r1
/*
* write FAT as all empty
* -> write all FAT sectors as zero
*/
if (ret_val == 0) {
ret_val = msdos_format_fill_sectors
800ab34: bb 20 10 00 mv r2,r25
800ab38: bb 00 08 00 mv r1,r24
800ab3c: 34 06 00 00 mvi r6,0
800ab40: fb ff fc 5d calli 8009cb4 <msdos_format_fill_sectors>
800ab44: b8 20 b8 00 mv r23,r1
}
/*
* clear/init root directory
* -> write all directory sectors as 0x00
*/
if (ret_val == 0) {
800ab48: 5c 20 00 b7 bne r1,r0,800ae24 <msdos_format+0xfd4> <== NEVER TAKEN
ret_val = msdos_format_fill_sectors
800ab4c: 2b 83 02 7c lw r3,(sp+636)
800ab50: 2b 84 02 80 lw r4,(sp+640)
800ab54: 2b 85 02 5c lw r5,(sp+604)
800ab58: bb 00 08 00 mv r1,r24
800ab5c: bb 20 10 00 mv r2,r25
800ab60: 34 06 00 00 mvi r6,0
800ab64: fb ff fc 54 calli 8009cb4 <msdos_format_fill_sectors>
800ab68: b8 20 b8 00 mv r23,r1
0x00);
}
/*
* write volume label to first entry of directory
*/
if ((ret_val == 0) && fmt_params.VolLabel_present) {
800ab6c: 5c 20 00 ae bne r1,r0,800ae24 <msdos_format+0xfd4> <== NEVER TAKEN
800ab70: 43 83 02 a4 lbu r3,(sp+676)
800ab74: 44 61 00 18 be r3,r1,800abd4 <msdos_format+0xd84>
memset(tmp_sec,0,sizeof(tmp_sec));
800ab78: 37 8b 00 5c addi r11,sp,92
800ab7c: b9 60 08 00 mv r1,r11
800ab80: 34 02 00 00 mvi r2,0
800ab84: 34 03 02 00 mvi r3,512
800ab88: f8 00 43 c2 calli 801ba90 <memset>
memcpy(MSDOS_DIR_NAME(tmp_sec),fmt_params.VolLabel,MSDOS_SHORT_NAME_LEN);
800ab8c: 37 83 02 98 addi r3,sp,664
800ab90: 28 64 00 04 lw r4,(r3+4)
800ab94: 2b 85 02 98 lw r5,(sp+664)
*MSDOS_DIR_ATTR(tmp_sec) = MSDOS_ATTR_VOLUME_ID;
ret_val = msdos_format_write_sec
800ab98: 2b 82 02 7c lw r2,(sp+636)
/*
* 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);
800ab9c: 59 64 00 04 sw (r11+4),r4
800aba0: 2c 64 00 08 lhu r4,(r3+8)
800aba4: 40 63 00 0a lbu r3,(r3+10)
*MSDOS_DIR_ATTR(tmp_sec) = MSDOS_ATTR_VOLUME_ID;
ret_val = msdos_format_write_sec
800aba8: bb 20 08 00 mv r1,r25
/*
* 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);
800abac: 0d 64 00 08 sh (r11+8),r4
800abb0: 31 63 00 0a sb (r11+10),r3
*MSDOS_DIR_ATTR(tmp_sec) = MSDOS_ATTR_VOLUME_ID;
800abb4: 34 03 00 08 mvi r3,8
800abb8: 33 83 00 67 sb (sp+103),r3
ret_val = msdos_format_write_sec
800abbc: 2b 83 02 5c lw r3,(sp+604)
800abc0: b9 60 20 00 mv r4,r11
/*
* 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);
800abc4: 5b 85 00 5c sw (sp+92),r5
*MSDOS_DIR_ATTR(tmp_sec) = MSDOS_ATTR_VOLUME_ID;
ret_val = msdos_format_write_sec
800abc8: fb ff fc 1d calli 8009c3c <msdos_format_write_sec>
800abcc: b8 20 58 00 mv r11,r1
/*
* 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) {
800abd0: 5c 20 00 53 bne r1,r0,800ad1c <msdos_format+0xecc> <== NEVER TAKEN
uint32_t start_sector;
/*
* empty sector: all clusters are free/do not link further on
*/
memset(tmp_sec,0,sizeof(tmp_sec));
800abd4: 34 03 02 00 mvi r3,512
800abd8: 37 81 00 5c addi r1,sp,92
800abdc: 34 02 00 00 mvi r2,0
800abe0: f8 00 43 ac calli 801ba90 <memset>
switch(fmt_params.fattype) {
800abe4: 43 83 02 8e lbu r3,(sp+654)
800abe8: 34 04 00 02 mvi r4,2
800abec: 44 64 00 0c be r3,r4,800ac1c <msdos_format+0xdcc>
800abf0: 34 04 00 04 mvi r4,4
800abf4: 44 64 00 12 be r3,r4,800ac3c <msdos_format+0xdec>
800abf8: 34 04 00 01 mvi r4,1
800abfc: 5c 64 00 22 bne r3,r4,800ac84 <msdos_format+0xe34> <== NEVER TAKEN
case FAT_FAT12:
/* LSBits of FAT entry 0: media_type */
FAT_SET_VAL8(tmp_sec,0,(fmt_params.media_code));
800ac00: 43 83 02 8d lbu r3,(sp+653)
800ac04: 33 83 00 5c sb (sp+92),r3
/* 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)));
800ac08: 34 03 ff 8f mvi r3,-113
800ac0c: 33 83 00 5d sb (sp+93),r3
/* MSBits of FAT entry 1: MSBits of EOC */
FAT_SET_VAL8(tmp_sec,2,(FAT_FAT12_EOC >> 4));
800ac10: 34 03 ff ff mvi r3,-1
800ac14: 33 83 00 5e sb (sp+94),r3
break;
800ac18: e0 00 00 1f bi 800ac94 <msdos_format+0xe44>
case FAT_FAT16:
/* FAT entry 0: 0xff00|media_type */
FAT_SET_VAL8(tmp_sec,0,fmt_params.media_code);
800ac1c: 43 83 02 8d lbu r3,(sp+653)
FAT_SET_VAL8(tmp_sec,1,0xff);
/* FAT entry 1: EOC */
FAT_SET_VAL16(tmp_sec,2,FAT_FAT16_EOC);
800ac20: 34 04 ff f8 mvi r4,-8
800ac24: 33 84 00 5e sb (sp+94),r4
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);
800ac28: 33 83 00 5c sb (sp+92),r3
FAT_SET_VAL8(tmp_sec,1,0xff);
800ac2c: 34 03 ff ff mvi r3,-1
800ac30: 33 83 00 5d sb (sp+93),r3
/* FAT entry 1: EOC */
FAT_SET_VAL16(tmp_sec,2,FAT_FAT16_EOC);
800ac34: 33 83 00 5f sb (sp+95),r3
break;
800ac38: e0 00 00 17 bi 800ac94 <msdos_format+0xe44>
case FAT_FAT32:
/* FAT entry 0: 0xffffff00|media_type */
FAT_SET_VAL32(tmp_sec,0,0xffffff00|fmt_params.media_code);
800ac3c: 43 84 02 8d lbu r4,(sp+653)
800ac40: 34 03 ff 00 mvi r3,-256
800ac44: 34 02 00 08 mvi r2,8
800ac48: b8 83 18 00 or r3,r4,r3
800ac4c: 20 61 ff ff andi r1,r3,0xffff
800ac50: 33 83 00 5c sb (sp+92),r3
800ac54: f8 00 8a 01 calli 802d458 <__lshrsi3>
800ac58: 34 03 ff ff mvi r3,-1
800ac5c: 33 83 00 5e sb (sp+94),r3
800ac60: 33 83 00 5f sb (sp+95),r3
/* FAT entry 1: EOC */
FAT_SET_VAL32(tmp_sec,4,FAT_FAT32_EOC);
800ac64: 34 04 ff f8 mvi r4,-8
800ac68: 33 83 00 61 sb (sp+97),r3
800ac6c: 33 83 00 62 sb (sp+98),r3
800ac70: 34 03 00 0f mvi r3,15
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);
800ac74: 33 81 00 5d sb (sp+93),r1
/* FAT entry 1: EOC */
FAT_SET_VAL32(tmp_sec,4,FAT_FAT32_EOC);
800ac78: 33 84 00 60 sb (sp+96),r4
800ac7c: 33 83 00 63 sb (sp+99),r3
break;
800ac80: e0 00 00 05 bi 800ac94 <msdos_format+0xe44>
default:
ret_val = -1;
errno = EINVAL;
800ac84: f8 00 3f f4 calli 801ac54 <__errno> <== NOT EXECUTED
800ac88: 34 03 00 16 mvi r3,22 <== NOT EXECUTED
800ac8c: 58 23 00 00 sw (r1+0),r3 <== NOT EXECUTED
/* FAT entry 1: EOC */
FAT_SET_VAL32(tmp_sec,4,FAT_FAT32_EOC);
break;
default:
ret_val = -1;
800ac90: 34 17 ff ff mvi r23,-1 <== NOT EXECUTED
errno = EINVAL;
}
if (fmt_params.fattype == FAT_FAT32) {
800ac94: 43 84 02 8e lbu r4,(sp+654)
800ac98: 34 03 00 04 mvi r3,4
800ac9c: 5c 83 00 08 bne r4,r3,800acbc <msdos_format+0xe6c>
/*
* 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);
800aca0: 34 03 ff f8 mvi r3,-8
800aca4: 33 83 00 64 sb (sp+100),r3
800aca8: 34 03 ff ff mvi r3,-1
800acac: 33 83 00 65 sb (sp+101),r3
800acb0: 33 83 00 66 sb (sp+102),r3
800acb4: 34 03 00 0f mvi r3,15
800acb8: 33 83 00 67 sb (sp+103),r3
}
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
800acbc: 2b 81 02 64 lw r1,(sp+612)
800acc0: 2b 82 02 68 lw r2,(sp+616)
800acc4: 43 83 02 ac lbu r3,(sp+684)
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
800acc8: ba e0 58 00 mv r11,r23
800accc: 34 0c 00 00 mvi r12,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,
800acd0: fb ff fb 95 calli 8009b24 <loc_align_object>
800acd4: b8 20 78 00 mv r15,r1
fmt_params.skip_alignment);
for (i = 0;
(i < fmt_params.fat_num) && (ret_val == 0);
i++) {
ret_val = msdos_format_write_sec
(fd,
800acd8: 37 8e 00 5c addi r14,sp,92
}
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
800acdc: e0 00 00 0b bi 800ad08 <msdos_format+0xeb8>
(i < fmt_params.fat_num) && (ret_val == 0);
i++) {
ret_val = msdos_format_write_sec
(fd,
start_sector
+ (i * fmt_params.sectors_per_fat),
800ace0: 2b 82 02 6c lw r2,(sp+620)
800ace4: b9 80 08 00 mv r1,r12
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
(i < fmt_params.fat_num) && (ret_val == 0);
i++) {
800ace8: 35 8c 00 01 addi r12,r12,1
ret_val = msdos_format_write_sec
(fd,
start_sector
+ (i * fmt_params.sectors_per_fat),
800acec: fb ff d9 8d calli 8001320 <__mulsi3>
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
(i < fmt_params.fat_num) && (ret_val == 0);
i++) {
ret_val = msdos_format_write_sec
800acf0: 2b 83 02 5c lw r3,(sp+604)
(fd,
800acf4: b4 2f 10 00 add r2,r1,r15
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
(i < fmt_params.fat_num) && (ret_val == 0);
i++) {
ret_val = msdos_format_write_sec
800acf8: b9 c0 20 00 mv r4,r14
800acfc: bb 20 08 00 mv r1,r25
800ad00: fb ff fb cf calli 8009c3c <msdos_format_write_sec>
800ad04: b8 20 58 00 mv r11,r1
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);
800ad08: 43 82 02 8c lbu r2,(sp+652)
800ad0c: 65 63 00 00 cmpei r3,r11,0
800ad10: e8 4c 10 00 cmpg r2,r2,r12
}
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
800ad14: a0 62 10 00 and r2,r3,r2
800ad18: 5c 40 ff f2 bne r2,r0,800ace0 <msdos_format+0xe90>
fmt_params.bytes_per_sector,
tmp_sec);
}
}
if (ret_val == 0 && rqdata != NULL && rqdata->sync_device) {
800ad1c: 65 63 00 00 cmpei r3,r11,0
800ad20: a1 a3 68 00 and r13,r13,r3
800ad24: 45 a0 00 0a be r13,r0,800ad4c <msdos_format+0xefc>
800ad28: 43 03 00 17 lbu r3,(r24+23)
800ad2c: 34 0b 00 00 mvi r11,0
800ad30: 44 60 00 07 be r3,r0,800ad4c <msdos_format+0xefc>
return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr);
}
static inline int rtems_disk_fd_sync(int fd)
{
return ioctl(fd, RTEMS_BLKIO_SYNCDEV);
800ad34: 78 03 08 02 mvhi r3,0x802
800ad38: 38 63 e5 64 ori r3,r3,0xe564
800ad3c: 28 62 00 00 lw r2,(r3+0)
800ad40: bb 20 08 00 mv r1,r25
800ad44: f8 00 1c af calli 8012000 <ioctl>
800ad48: b8 20 58 00 mv r11,r1
/*
* cleanup:
* sync and unlock disk
* free any data structures (not needed now)
*/
if (fd != -1) {
800ad4c: 34 03 ff ff mvi r3,-1
800ad50: 47 23 00 03 be r25,r3,800ad5c <msdos_format+0xf0c> <== NEVER TAKEN
close(fd);
800ad54: bb 20 08 00 mv r1,r25
800ad58: fb ff e0 72 calli 8002f20 <close>
}
return ret_val;
}
800ad5c: b9 60 08 00 mv r1,r11
800ad60: 2b 9d 00 04 lw ra,(sp+4)
800ad64: 2b 8b 00 44 lw r11,(sp+68)
800ad68: 2b 8c 00 40 lw r12,(sp+64)
800ad6c: 2b 8d 00 3c lw r13,(sp+60)
800ad70: 2b 8e 00 38 lw r14,(sp+56)
800ad74: 2b 8f 00 34 lw r15,(sp+52)
800ad78: 2b 90 00 30 lw r16,(sp+48)
800ad7c: 2b 91 00 2c lw r17,(sp+44)
800ad80: 2b 92 00 28 lw r18,(sp+40)
800ad84: 2b 93 00 24 lw r19,(sp+36)
800ad88: 2b 94 00 20 lw r20,(sp+32)
800ad8c: 2b 95 00 1c lw r21,(sp+28)
800ad90: 2b 96 00 18 lw r22,(sp+24)
800ad94: 2b 97 00 14 lw r23,(sp+20)
800ad98: 2b 98 00 10 lw r24,(sp+16)
800ad9c: 2b 99 00 0c lw r25,(sp+12)
800ada0: 2b 9b 00 08 lw fp,(sp+8)
800ada4: 37 9c 03 00 addi sp,sp,768
800ada8: c3 a0 00 00 ret
/*
* compute formatting parameters
*/
if (ret_val == 0) {
ret_val = msdos_format_determine_fmt_params(fd,rqdata,&fmt_params);
800adac: 37 8b 02 5c addi r11,sp,604
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));
800adb0: 34 02 00 00 mvi r2,0
800adb4: 34 03 00 54 mvi r3,84
800adb8: b9 60 08 00 mv r1,r11
800adbc: f8 00 43 35 calli 801ba90 <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);
800adc0: 78 03 08 02 mvhi r3,0x802
800adc4: 38 63 e5 68 ori r3,r3,0xe568
800adc8: 28 62 00 00 lw r2,(r3+0)
800adcc: bb 20 08 00 mv r1,r25
800add0: b9 60 18 00 mv r3,r11
800add4: f8 00 1c 8b calli 8012000 <ioctl>
800add8: b8 20 b8 00 mv r23,r1
* 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) {
800addc: 5c 20 fd a7 bne r1,r0,800a478 <msdos_format+0x628> <== NEVER TAKEN
800ade0: e3 ff fc 57 bi 8009f3c <msdos_format+0xec>
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) &&
800ade4: 5f 00 fe 04 bne r24,r0,800a5f4 <msdos_format+0x7a4>
800ade8: e3 ff fe 08 bi 800a608 <msdos_format+0x7b8>
{
int ret_val = 0;
int rc;
struct timeval time_value;
rc = rtems_clock_get_tod_timeval(&time_value);
800adec: 37 81 02 f8 addi r1,sp,760
800adf0: f8 00 21 7b calli 80133dc <rtems_clock_get_tod_timeval>
if (rc == RTEMS_SUCCESSFUL) {
800adf4: 44 20 fe 1c be r1,r0,800a664 <msdos_format+0x814> <== NEVER TAKEN
800adf8: e3 ff fe 1f bi 800a674 <msdos_format+0x824>
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,
800adfc: 78 03 08 02 mvhi r3,0x802
800ae00: 38 63 e5 48 ori r3,r3,0xe548
800ae04: bb 00 08 00 mv r1,r24
800ae08: 34 02 00 02 mvi r2,2
800ae0c: fb ff fb 72 calli 8009bd4 <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) {
800ae10: 2b 8b 02 60 lw r11,(sp+608)
800ae14: 38 03 ff ff mvu r3,0xffff
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
uint32_t total_sectors_num16 = 0;
uint32_t total_sectors_num32 = 0;
800ae18: 34 0c 00 00 mvi r12,0
/* store total sector count in either 16 or 32 bit field in mbr */
if (fmt_params->totl_sector_cnt < 0x10000) {
800ae1c: 50 6b fe 3a bgeu r3,r11,800a704 <msdos_format+0x8b4>
800ae20: e3 ff fe 37 bi 800a6fc <msdos_format+0x8ac>
}
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
800ae24: ba e0 58 00 mv r11,r23
800ae28: e3 ff ff bd bi 800ad1c <msdos_format+0xecc>
08009cb4 <msdos_format_fill_sectors>:
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
8009cb4: 37 9c ff cc addi sp,sp,-52
8009cb8: 5b 8b 00 34 sw (sp+52),r11
8009cbc: 5b 8c 00 30 sw (sp+48),r12
8009cc0: 5b 8d 00 2c sw (sp+44),r13
8009cc4: 5b 8e 00 28 sw (sp+40),r14
8009cc8: 5b 8f 00 24 sw (sp+36),r15
8009ccc: 5b 90 00 20 sw (sp+32),r16
8009cd0: 5b 91 00 1c sw (sp+28),r17
8009cd4: 5b 92 00 18 sw (sp+24),r18
8009cd8: 5b 93 00 14 sw (sp+20),r19
8009cdc: 5b 94 00 10 sw (sp+16),r20
8009ce0: 5b 95 00 0c sw (sp+12),r21
8009ce4: 5b 96 00 08 sw (sp+8),r22
8009ce8: 5b 9d 00 04 sw (sp+4),ra
8009cec: b8 20 70 00 mv r14,r1
/*
* allocate and fill buffer
*/
if (ret_val == 0) {
fill_buffer = malloc(sector_size);
8009cf0: b8 a0 08 00 mv r1,r5
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
8009cf4: b8 40 b0 00 mv r22,r2
8009cf8: b8 60 68 00 mv r13,r3
8009cfc: b8 80 88 00 mv r17,r4
8009d00: b8 a0 98 00 mv r19,r5
8009d04: b8 c0 58 00 mv r11,r6
/*
* allocate and fill buffer
*/
if (ret_val == 0) {
fill_buffer = malloc(sector_size);
8009d08: fb ff e6 47 calli 8003624 <malloc>
8009d0c: b8 20 60 00 mv r12,r1
if (fill_buffer == NULL) {
8009d10: 5c 20 00 06 bne r1,r0,8009d28 <msdos_format_fill_sectors+0x74><== ALWAYS TAKEN
errno = ENOMEM;
8009d14: f8 00 43 d0 calli 801ac54 <__errno> <== NOT EXECUTED
8009d18: 34 02 00 0c mvi r2,12 <== NOT EXECUTED
8009d1c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
ret_val = -1;
8009d20: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED
8009d24: e0 00 00 05 bi 8009d38 <msdos_format_fill_sectors+0x84> <== NOT EXECUTED
}
else {
memset(fill_buffer,fill_byte,sector_size);
8009d28: b9 60 10 00 mv r2,r11
8009d2c: ba 60 18 00 mv r3,r19
8009d30: f8 00 47 58 calli 801ba90 <memset>
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
int ret_val = 0;
8009d34: 34 0b 00 00 mvi r11,0
else {
memset(fill_buffer,fill_byte,sector_size);
}
}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
8009d38: 78 03 08 02 mvhi r3,0x802
8009d3c: b9 c0 08 00 mv r1,r14
8009d40: 34 02 00 02 mvi r2,2
8009d44: 38 63 e4 10 ori r3,r3,0xe410
8009d48: fb ff ff a3 calli 8009bd4 <msdos_format_printf>
8009d4c: ba 20 08 00 mv r1,r17
8009d50: 34 02 00 64 mvi r2,100
8009d54: fb ff dd 73 calli 8001320 <__mulsi3>
while ((ret_val == 0) &&
(sector_cnt > 0)) {
int percent = (sector_cnt * 100) / total_sectors;
if (percent != last_percent) {
if ((percent & 1) == 0)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, ".");
8009d58: 78 0f 08 02 mvhi r15,0x802
else {
memset(fill_buffer,fill_byte,sector_size);
}
}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
8009d5c: b8 20 90 00 mv r18,r1
"Filling : ");
/*
* write to consecutive sectors
*/
while ((ret_val == 0) &&
8009d60: ba 20 80 00 mv r16,r17
\*=========================================================================*/
{
int ret_val = 0;
char *fill_buffer = NULL;
uint32_t total_sectors = sector_cnt;
int last_percent = -1;
8009d64: 34 15 ff ff mvi r21,-1
while ((ret_val == 0) &&
(sector_cnt > 0)) {
int percent = (sector_cnt * 100) / total_sectors;
if (percent != last_percent) {
if ((percent & 1) == 0)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, ".");
8009d68: 39 ef e1 e4 ori r15,r15,0xe1e4
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
"Filling : ");
/*
* write to consecutive sectors
*/
while ((ret_val == 0) &&
8009d6c: e0 00 00 16 bi 8009dc4 <msdos_format_fill_sectors+0x110>
(sector_cnt > 0)) {
int percent = (sector_cnt * 100) / total_sectors;
8009d70: ba 40 08 00 mv r1,r18
8009d74: ba 20 10 00 mv r2,r17
8009d78: f8 00 8e 08 calli 802d598 <__udivsi3>
8009d7c: b8 20 30 00 mv r6,r1
if (percent != last_percent) {
8009d80: 44 35 00 08 be r1,r21,8009da0 <msdos_format_fill_sectors+0xec>
if ((percent & 1) == 0)
8009d84: 20 21 00 01 andi r1,r1,0x1
8009d88: b8 c0 a8 00 mv r21,r6
8009d8c: 5c 20 00 05 bne r1,r0,8009da0 <msdos_format_fill_sectors+0xec>
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, ".");
8009d90: b9 c0 08 00 mv r1,r14
8009d94: 34 02 00 02 mvi r2,2
8009d98: b9 e0 18 00 mv r3,r15
8009d9c: fb ff ff 8e calli 8009bd4 <msdos_format_printf>
last_percent = percent;
}
ret_val = msdos_format_write_sec(fd,start_sector,sector_size,fill_buffer);
8009da0: b9 a0 10 00 mv r2,r13
8009da4: ba c0 08 00 mv r1,r22
8009da8: ba 60 18 00 mv r3,r19
8009dac: b9 80 20 00 mv r4,r12
8009db0: fb ff ff a3 calli 8009c3c <msdos_format_write_sec>
8009db4: b8 20 58 00 mv r11,r1
start_sector++;
8009db8: 35 ad 00 01 addi r13,r13,1
sector_cnt--;
8009dbc: 36 10 ff ff addi r16,r16,-1
8009dc0: 36 52 ff 9c addi r18,r18,-100
"Filling : ");
/*
* write to consecutive sectors
*/
while ((ret_val == 0) &&
(sector_cnt > 0)) {
8009dc4: 7e 14 00 00 cmpnei r20,r16,0
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
"Filling : ");
/*
* write to consecutive sectors
*/
while ((ret_val == 0) &&
8009dc8: 65 61 00 00 cmpei r1,r11,0
8009dcc: a2 81 a0 00 and r20,r20,r1
8009dd0: 5e 80 ff e8 bne r20,r0,8009d70 <msdos_format_fill_sectors+0xbc>
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");
8009dd4: 78 03 08 02 mvhi r3,0x802
8009dd8: b9 c0 08 00 mv r1,r14
8009ddc: 34 02 00 02 mvi r2,2
8009de0: 38 63 e5 14 ori r3,r3,0xe514
8009de4: fb ff ff 7c calli 8009bd4 <msdos_format_printf>
if (ret_val)
8009de8: 45 74 00 07 be r11,r20,8009e04 <msdos_format_fill_sectors+0x150><== ALWAYS TAKEN
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
8009dec: 78 03 08 02 mvhi r3,0x802 <== NOT EXECUTED
8009df0: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
8009df4: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8009df8: 38 63 e4 1c ori r3,r3,0xe41c <== NOT EXECUTED
8009dfc: b9 a0 20 00 mv r4,r13 <== NOT EXECUTED
8009e00: fb ff ff 75 calli 8009bd4 <msdos_format_printf> <== NOT EXECUTED
"filling error on sector: %d\n", start_sector);
/*
* cleanup
*/
if (fill_buffer != NULL) {
8009e04: 45 80 00 03 be r12,r0,8009e10 <msdos_format_fill_sectors+0x15c><== NEVER TAKEN
free(fill_buffer);
8009e08: b9 80 08 00 mv r1,r12
8009e0c: fb ff e4 70 calli 8002fcc <free>
fill_buffer = NULL;
}
return ret_val;
}
8009e10: b9 60 08 00 mv r1,r11
8009e14: 2b 9d 00 04 lw ra,(sp+4)
8009e18: 2b 8b 00 34 lw r11,(sp+52)
8009e1c: 2b 8c 00 30 lw r12,(sp+48)
8009e20: 2b 8d 00 2c lw r13,(sp+44)
8009e24: 2b 8e 00 28 lw r14,(sp+40)
8009e28: 2b 8f 00 24 lw r15,(sp+36)
8009e2c: 2b 90 00 20 lw r16,(sp+32)
8009e30: 2b 91 00 1c lw r17,(sp+28)
8009e34: 2b 92 00 18 lw r18,(sp+24)
8009e38: 2b 93 00 14 lw r19,(sp+20)
8009e3c: 2b 94 00 10 lw r20,(sp+16)
8009e40: 2b 95 00 0c lw r21,(sp+12)
8009e44: 2b 96 00 08 lw r22,(sp+8)
8009e48: 37 9c 00 34 addi sp,sp,52
8009e4c: c3 a0 00 00 ret
08009bd4 <msdos_format_printf>:
*/
static void
msdos_format_printf (const msdos_format_request_param_t *rqdata,
int info_level,
const char *format, ...)
{
8009bd4: 37 9c ff e0 addi sp,sp,-32
8009bd8: 5b 8b 00 08 sw (sp+8),r11
8009bdc: 5b 9d 00 04 sw (sp+4),ra
8009be0: 5b 83 00 0c sw (sp+12),r3
8009be4: 5b 84 00 10 sw (sp+16),r4
8009be8: 5b 85 00 14 sw (sp+20),r5
8009bec: 5b 86 00 18 sw (sp+24),r6
8009bf0: 5b 87 00 1c sw (sp+28),r7
8009bf4: 5b 88 00 20 sw (sp+32),r8
va_list args;
va_start (args, format);
if (rqdata != NULL && rqdata->info_level >= info_level)
8009bf8: 44 20 00 0d be r1,r0,8009c2c <msdos_format_printf+0x58>
8009bfc: 28 21 00 18 lw r1,(r1+24)
8009c00: 48 41 00 0b bg r2,r1,8009c2c <msdos_format_printf+0x58> <== ALWAYS TAKEN
{
vfprintf (stdout, format, args);
8009c04: 78 0b 08 03 mvhi r11,0x803 <== NOT EXECUTED
8009c08: 39 6b 02 80 ori r11,r11,0x280 <== NOT EXECUTED
8009c0c: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED
8009c10: b8 60 10 00 mv r2,r3 <== NOT EXECUTED
8009c14: 37 83 00 10 addi r3,sp,16 <== NOT EXECUTED
8009c18: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED
8009c1c: f8 00 64 04 calli 8022c2c <vfprintf> <== NOT EXECUTED
fflush (stdout);
8009c20: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED
8009c24: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED
8009c28: f8 00 45 1b calli 801b094 <fflush> <== NOT EXECUTED
}
va_end (args);
}
8009c2c: 2b 9d 00 04 lw ra,(sp+4)
8009c30: 2b 8b 00 08 lw r11,(sp+8)
8009c34: 37 9c 00 20 addi sp,sp,32
8009c38: c3 a0 00 00 ret
08009c3c <msdos_format_write_sec>:
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
8009c3c: 37 9c ff f0 addi sp,sp,-16
8009c40: 5b 8b 00 10 sw (sp+16),r11
8009c44: 5b 8c 00 0c sw (sp+12),r12
8009c48: 5b 8d 00 08 sw (sp+8),r13
8009c4c: 5b 9d 00 04 sw (sp+4),ra
8009c50: b8 20 60 00 mv r12,r1
int ret_val = 0;
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
8009c54: b8 60 08 00 mv r1,r3
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
8009c58: b8 60 58 00 mv r11,r3
8009c5c: b8 80 68 00 mv r13,r4
int ret_val = 0;
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
8009c60: fb ff dd b0 calli 8001320 <__mulsi3>
8009c64: b8 20 10 00 mv r2,r1
8009c68: 34 03 00 00 mvi r3,0
8009c6c: b9 80 08 00 mv r1,r12
8009c70: f8 00 21 0d calli 80120a4 <lseek>
8009c74: 34 05 ff ff mvi r5,-1
8009c78: 48 01 00 08 bg r0,r1,8009c98 <msdos_format_write_sec+0x5c> <== NEVER TAKEN
ret_val = -1;
}
if (ret_val == 0) {
if (0 > write(fd,buffer,sector_size)) {
8009c7c: b9 a0 10 00 mv r2,r13
8009c80: b9 60 18 00 mv r3,r11
8009c84: b9 80 08 00 mv r1,r12
8009c88: fb ff ed fa calli 8005470 <write>
8009c8c: 34 02 00 1f mvi r2,31
8009c90: f8 00 8d f2 calli 802d458 <__lshrsi3>
8009c94: c8 01 28 00 sub r5,r0,r1
ret_val = -1;
}
}
return ret_val;
}
8009c98: b8 a0 08 00 mv r1,r5
8009c9c: 2b 9d 00 04 lw ra,(sp+4)
8009ca0: 2b 8b 00 10 lw r11,(sp+16)
8009ca4: 2b 8c 00 0c lw r12,(sp+12)
8009ca8: 2b 8d 00 08 lw r13,(sp+8)
8009cac: 37 9c 00 10 addi sp,sp,16
8009cb0: c3 a0 00 00 ret
08017be0 <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
)
{
8017be0: 37 9c ff 90 addi sp,sp,-112
8017be4: 5b 8b 00 2c sw (sp+44),r11
8017be8: 5b 8c 00 28 sw (sp+40),r12
8017bec: 5b 8d 00 24 sw (sp+36),r13
8017bf0: 5b 8e 00 20 sw (sp+32),r14
8017bf4: 5b 8f 00 1c sw (sp+28),r15
8017bf8: 5b 90 00 18 sw (sp+24),r16
8017bfc: 5b 91 00 14 sw (sp+20),r17
8017c00: 5b 92 00 10 sw (sp+16),r18
8017c04: 5b 93 00 0c sw (sp+12),r19
8017c08: 5b 94 00 08 sw (sp+8),r20
8017c0c: 5b 9d 00 04 sw (sp+4),ra
int rc = RC_OK;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
8017c10: 28 2d 00 08 lw r13,(r1+8)
rtems_filesystem_mount_table_entry_t *mt_entry,
uint32_t cln,
fat_dir_pos_t *dir_pos,
char *dir_entry
)
{
8017c14: b8 20 80 00 mv r16,r1
8017c18: b8 40 60 00 mv r12,r2
8017c1c: b8 60 70 00 mv r14,r3
uint32_t cl4find = 0;
/*
* open fat-file corresponded to ".."
*/
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
8017c20: b8 60 10 00 mv r2,r3
8017c24: b9 a0 08 00 mv r1,r13
8017c28: 37 83 00 70 addi r3,sp,112
rtems_filesystem_mount_table_entry_t *mt_entry,
uint32_t cln,
fat_dir_pos_t *dir_pos,
char *dir_entry
)
{
8017c2c: b8 80 98 00 mv r19,r4
int rc = RC_OK;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
fat_file_fd_t *fat_fd = NULL;
8017c30: 5b 80 00 70 sw (sp+112),r0
uint32_t cl4find = 0;
/*
* open fat-file corresponded to ".."
*/
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
8017c34: fb ff dd 4c calli 800f164 <fat_file_open>
8017c38: b8 20 58 00 mv r11,r1
if (rc != RC_OK)
8017c3c: 5c 20 00 b8 bne r1,r0,8017f1c <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x33c><== NEVER TAKEN
return rc;
fat_fd->cln = cln;
8017c40: 2b 82 00 70 lw r2,(sp+112)
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
8017c44: 78 01 00 20 mvhi r1,0x20
8017c48: 58 41 00 14 sw (r2+20),r1
*/
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
if (rc != RC_OK)
return rc;
fat_fd->cln = cln;
8017c4c: 58 4c 00 1c sw (r2+28),r12
fat_fd->fat_file_type = FAT_DIRECTORY;
8017c50: 58 40 00 10 sw (r2+16),r0
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
fat_fd->map.file_cln = 0;
8017c54: 58 40 00 34 sw (r2+52),r0
fat_fd->map.disk_cln = fat_fd->cln;
8017c58: 58 4c 00 38 sw (r2+56),r12
rc = fat_file_size(&fs_info->fat, fat_fd);
8017c5c: b9 a0 08 00 mv r1,r13
8017c60: fb ff e0 3b calli 800fd4c <fat_file_size>
8017c64: b8 20 58 00 mv r11,r1
if (rc != RC_OK)
8017c68: 5c 20 00 18 bne r1,r0,8017cc8 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0xe8><== NEVER TAKEN
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
/* find "." node in opened directory */
memset(dot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
8017c6c: 37 8f 00 50 addi r15,sp,80
8017c70: 34 02 00 00 mvi r2,0
8017c74: 34 03 00 20 mvi r3,32
8017c78: b9 e0 08 00 mv r1,r15
msdos_long_to_short(".", 1, dot_node, MSDOS_SHORT_NAME_LEN);
8017c7c: 78 0b 08 02 mvhi r11,0x802
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
/* find "." node in opened directory */
memset(dot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
8017c80: f8 00 0f 84 calli 801ba90 <memset>
msdos_long_to_short(".", 1, dot_node, MSDOS_SHORT_NAME_LEN);
8017c84: 39 6b e1 e4 ori r11,r11,0xe1e4
8017c88: b9 60 08 00 mv r1,r11
8017c8c: 34 02 00 01 mvi r2,1
8017c90: b9 e0 18 00 mv r3,r15
8017c94: 34 04 00 0b mvi r4,11
8017c98: fb ff f9 fe calli 8016490 <msdos_long_to_short>
rc = msdos_find_name_in_fat_file(mt_entry, fat_fd, false, ".", 1,
8017c9c: 2b 82 00 70 lw r2,(sp+112)
8017ca0: b9 60 20 00 mv r4,r11
8017ca4: ba 00 08 00 mv r1,r16
8017ca8: 34 03 00 00 mvi r3,0
8017cac: 34 05 00 01 mvi r5,1
8017cb0: 34 06 00 01 mvi r6,1
8017cb4: b9 c0 38 00 mv r7,r14
8017cb8: b9 e0 40 00 mv r8,r15
8017cbc: fb ff fc 1b calli 8016d28 <msdos_find_name_in_fat_file>
8017cc0: b8 20 58 00 mv r11,r1
MSDOS_NAME_SHORT, dir_pos, dot_node);
if (rc != RC_OK)
8017cc4: 44 20 00 04 be r1,r0,8017cd4 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0xf4><== ALWAYS TAKEN
{
fat_file_close(&fs_info->fat, fat_fd);
8017cc8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
8017ccc: 2b 82 00 70 lw r2,(sp+112) <== NOT EXECUTED
8017cd0: e0 00 00 8d bi 8017f04 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x324><== NOT EXECUTED
return rc;
}
/* find ".." node in opened directory */
memset(dotdot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
8017cd4: 37 8c 00 30 addi r12,sp,48
8017cd8: b9 80 08 00 mv r1,r12
8017cdc: 34 02 00 00 mvi r2,0
8017ce0: 34 03 00 20 mvi r3,32
msdos_long_to_short("..", 2, dotdot_node, MSDOS_SHORT_NAME_LEN);
8017ce4: 78 0b 08 02 mvhi r11,0x802
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
/* find ".." node in opened directory */
memset(dotdot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
8017ce8: f8 00 0f 6a calli 801ba90 <memset>
msdos_long_to_short("..", 2, dotdot_node, MSDOS_SHORT_NAME_LEN);
8017cec: 39 6b e9 30 ori r11,r11,0xe930
8017cf0: b9 80 18 00 mv r3,r12
8017cf4: b9 60 08 00 mv r1,r11
8017cf8: 34 02 00 02 mvi r2,2
8017cfc: 34 04 00 0b mvi r4,11
8017d00: fb ff f9 e4 calli 8016490 <msdos_long_to_short>
rc = msdos_find_name_in_fat_file(mt_entry, fat_fd, false, "..", 2,
8017d04: 2b 82 00 70 lw r2,(sp+112)
8017d08: b9 60 20 00 mv r4,r11
8017d0c: b9 80 40 00 mv r8,r12
8017d10: ba 00 08 00 mv r1,r16
8017d14: 34 03 00 00 mvi r3,0
8017d18: 34 05 00 02 mvi r5,2
8017d1c: 34 06 00 01 mvi r6,1
8017d20: b9 c0 38 00 mv r7,r14
8017d24: fb ff fc 01 calli 8016d28 <msdos_find_name_in_fat_file>
8017d28: b8 20 58 00 mv r11,r1
8017d2c: 2b 8c 00 70 lw r12,(sp+112)
MSDOS_NAME_SHORT, dir_pos,
dotdot_node);
if (rc != RC_OK)
8017d30: 5c 20 00 73 bne r1,r0,8017efc <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x31c><== NEVER TAKEN
}
cl4find = MSDOS_EXTRACT_CLUSTER_NUM(dot_node);
/* close fat-file corresponded to ".." directory */
rc = fat_file_close(&fs_info->fat, fat_fd);
8017d34: b9 a0 08 00 mv r1,r13
8017d38: b9 80 10 00 mv r2,r12
{
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
cl4find = MSDOS_EXTRACT_CLUSTER_NUM(dot_node);
8017d3c: 2d f1 00 1a lhu r17,(r15+26)
8017d40: 2d ef 00 14 lhu r15,(r15+20)
/* close fat-file corresponded to ".." directory */
rc = fat_file_close(&fs_info->fat, fat_fd);
8017d44: fb ff de 41 calli 800f648 <fat_file_close>
8017d48: b8 20 58 00 mv r11,r1
if ( rc != RC_OK )
8017d4c: 5c 20 00 74 bne r1,r0,8017f1c <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x33c><== NEVER TAKEN
return rc;
if ( (MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
8017d50: 2f 92 00 44 lhu r18,(sp+68)
8017d54: 34 02 00 08 mvi r2,8
8017d58: 2f 8c 00 4a lhu r12,(sp+74)
8017d5c: ba 40 08 00 mv r1,r18
8017d60: fb ff a5 22 calli 80011e8 <__ashlsi3>
8017d64: b8 20 a0 00 mv r20,r1
8017d68: 34 02 00 08 mvi r2,8
8017d6c: ba 40 08 00 mv r1,r18
8017d70: f8 00 55 ba calli 802d458 <__lshrsi3>
8017d74: ba 81 08 00 or r1,r20,r1
8017d78: 34 02 00 10 mvi r2,16
8017d7c: 20 21 ff ff andi r1,r1,0xffff
8017d80: fb ff a5 1a calli 80011e8 <__ashlsi3>
8017d84: b8 20 90 00 mv r18,r1
8017d88: 34 02 00 08 mvi r2,8
8017d8c: b9 80 08 00 mv r1,r12
8017d90: fb ff a5 16 calli 80011e8 <__ashlsi3>
8017d94: b8 20 a0 00 mv r20,r1
8017d98: 34 02 00 08 mvi r2,8
8017d9c: b9 80 08 00 mv r1,r12
8017da0: f8 00 55 ae calli 802d458 <__lshrsi3>
8017da4: ba 81 10 00 or r2,r20,r1
8017da8: 20 42 ff ff andi r2,r2,0xffff
8017dac: ba 42 10 00 or r2,r18,r2
8017db0: 5c 4b 00 07 bne r2,r11,8017dcc <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x1ec><== ALWAYS TAKEN
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
8017db4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
8017db8: 59 c1 00 08 sw (r14+8),r1 <== NOT EXECUTED
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
8017dbc: 59 c1 00 0c sw (r14+12),r1 <== NOT EXECUTED
/*
* 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;
8017dc0: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
fat_dir_pos_init(
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
8017dc4: 59 c0 00 04 sw (r14+4),r0 <== NOT EXECUTED
8017dc8: 59 c1 00 00 sw (r14+0),r1 <== NOT EXECUTED
}
/* open fat-file corresponded to second ".." */
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
8017dcc: b9 a0 08 00 mv r1,r13
8017dd0: b9 c0 10 00 mv r2,r14
8017dd4: 37 83 00 70 addi r3,sp,112
8017dd8: fb ff dc e3 calli 800f164 <fat_file_open>
8017ddc: b8 20 58 00 mv r11,r1
if (rc != RC_OK)
8017de0: 5c 20 00 4f bne r1,r0,8017f1c <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x33c><== NEVER TAKEN
return rc;
if ((MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
8017de4: 2f 92 00 44 lhu r18,(sp+68)
8017de8: 34 02 00 08 mvi r2,8
8017dec: 2f 8c 00 4a lhu r12,(sp+74)
8017df0: ba 40 08 00 mv r1,r18
8017df4: fb ff a4 fd calli 80011e8 <__ashlsi3>
8017df8: b8 20 a0 00 mv r20,r1
8017dfc: 34 02 00 08 mvi r2,8
8017e00: ba 40 08 00 mv r1,r18
8017e04: f8 00 55 95 calli 802d458 <__lshrsi3>
8017e08: ba 81 08 00 or r1,r20,r1
8017e0c: 34 02 00 10 mvi r2,16
8017e10: 20 21 ff ff andi r1,r1,0xffff
8017e14: fb ff a4 f5 calli 80011e8 <__ashlsi3>
8017e18: b8 20 90 00 mv r18,r1
8017e1c: 34 02 00 08 mvi r2,8
8017e20: b9 80 08 00 mv r1,r12
8017e24: fb ff a4 f1 calli 80011e8 <__ashlsi3>
8017e28: b8 20 a0 00 mv r20,r1
8017e2c: 34 02 00 08 mvi r2,8
8017e30: b9 80 08 00 mv r1,r12
8017e34: f8 00 55 89 calli 802d458 <__lshrsi3>
8017e38: ba 81 10 00 or r2,r20,r1
8017e3c: 20 42 ff ff andi r2,r2,0xffff
8017e40: ba 42 08 00 or r1,r18,r2
8017e44: 2b 8c 00 70 lw r12,(sp+112)
8017e48: 5c 2b 00 02 bne r1,r11,8017e50 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x270><== ALWAYS TAKEN
fat_fd->cln = fs_info->fat.vol.rdir_cl;
8017e4c: 29 a1 00 3c lw r1,(r13+60) <== NOT EXECUTED
else
fat_fd->cln = MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node);
fat_fd->fat_file_type = FAT_DIRECTORY;
8017e50: 2b 82 00 70 lw r2,(sp+112)
return rc;
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);
8017e54: 59 81 00 1c sw (r12+28),r1
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
8017e58: 78 01 00 20 mvhi r1,0x20
8017e5c: 58 41 00 14 sw (r2+20),r1
fat_fd->map.file_cln = 0;
fat_fd->map.disk_cln = fat_fd->cln;
8017e60: 28 41 00 1c lw r1,(r2+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;
8017e64: 58 40 00 10 sw (r2+16),r0
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
fat_fd->map.file_cln = 0;
8017e68: 58 40 00 34 sw (r2+52),r0
fat_fd->map.disk_cln = fat_fd->cln;
8017e6c: 58 41 00 38 sw (r2+56),r1
rc = fat_file_size(&fs_info->fat, fat_fd);
8017e70: b9 a0 08 00 mv r1,r13
8017e74: fb ff df b6 calli 800fd4c <fat_file_size>
8017e78: b8 20 58 00 mv r11,r1
8017e7c: 2b 8c 00 70 lw r12,(sp+112)
if (rc != RC_OK)
8017e80: 5c 20 00 1f bne r1,r0,8017efc <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x31c><== NEVER TAKEN
8017e84: b9 e0 08 00 mv r1,r15
8017e88: 34 02 00 08 mvi r2,8
8017e8c: fb ff a4 d7 calli 80011e8 <__ashlsi3>
8017e90: b8 20 58 00 mv r11,r1
8017e94: 34 02 00 08 mvi r2,8
8017e98: b9 e0 08 00 mv r1,r15
8017e9c: f8 00 55 6f calli 802d458 <__lshrsi3>
8017ea0: b9 61 08 00 or r1,r11,r1
{
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
cl4find = MSDOS_EXTRACT_CLUSTER_NUM(dot_node);
8017ea4: 34 02 00 10 mvi r2,16
8017ea8: 20 21 ff ff andi r1,r1,0xffff
8017eac: fb ff a4 cf calli 80011e8 <__ashlsi3>
8017eb0: b8 20 58 00 mv r11,r1
8017eb4: 34 02 00 08 mvi r2,8
8017eb8: ba 20 08 00 mv r1,r17
8017ebc: fb ff a4 cb calli 80011e8 <__ashlsi3>
8017ec0: b8 20 78 00 mv r15,r1
8017ec4: 34 02 00 08 mvi r2,8
8017ec8: ba 20 08 00 mv r1,r17
8017ecc: f8 00 55 63 calli 802d458 <__lshrsi3>
8017ed0: b9 e1 18 00 or r3,r15,r1
8017ed4: 20 63 ff ff andi r3,r3,0xffff
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,
8017ed8: b9 80 10 00 mv r2,r12
8017edc: b9 63 18 00 or r3,r11,r3
8017ee0: ba 00 08 00 mv r1,r16
8017ee4: b9 c0 20 00 mv r4,r14
8017ee8: ba 60 28 00 mv r5,r19
8017eec: fb ff fe 71 calli 80178b0 <msdos_find_node_by_cluster_num_in_fat_file>
8017ef0: b8 20 58 00 mv r11,r1
8017ef4: 2b 8c 00 70 lw r12,(sp+112)
dir_pos, dir_entry);
if (rc != RC_OK)
8017ef8: 44 20 00 05 be r1,r0,8017f0c <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x32c><== ALWAYS TAKEN
{
fat_file_close(&fs_info->fat, fat_fd);
8017efc: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
8017f00: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
8017f04: fb ff dd d1 calli 800f648 <fat_file_close> <== NOT EXECUTED
return rc;
8017f08: e0 00 00 05 bi 8017f1c <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x33c><== NOT EXECUTED
}
rc = fat_file_close(&fs_info->fat, fat_fd);
8017f0c: b9 a0 08 00 mv r1,r13
8017f10: b9 80 10 00 mv r2,r12
8017f14: fb ff dd cd calli 800f648 <fat_file_close>
8017f18: b8 20 58 00 mv r11,r1
return rc;
}
8017f1c: b9 60 08 00 mv r1,r11
8017f20: 2b 9d 00 04 lw ra,(sp+4)
8017f24: 2b 8b 00 2c lw r11,(sp+44)
8017f28: 2b 8c 00 28 lw r12,(sp+40)
8017f2c: 2b 8d 00 24 lw r13,(sp+36)
8017f30: 2b 8e 00 20 lw r14,(sp+32)
8017f34: 2b 8f 00 1c lw r15,(sp+28)
8017f38: 2b 90 00 18 lw r16,(sp+24)
8017f3c: 2b 91 00 14 lw r17,(sp+20)
8017f40: 2b 92 00 10 lw r18,(sp+16)
8017f44: 2b 93 00 0c lw r19,(sp+12)
8017f48: 2b 94 00 08 lw r20,(sp+8)
8017f4c: 37 9c 00 70 addi sp,sp,112
8017f50: c3 a0 00 00 ret
08017f54 <msdos_get_name_node>:
int name_len,
msdos_name_type_t name_type,
fat_dir_pos_t *dir_pos,
char *name_dir_entry
)
{
8017f54: 37 9c ff e0 addi sp,sp,-32
8017f58: 5b 8b 00 20 sw (sp+32),r11
8017f5c: 5b 8c 00 1c sw (sp+28),r12
8017f60: 5b 8d 00 18 sw (sp+24),r13
8017f64: 5b 8e 00 14 sw (sp+20),r14
8017f68: 5b 8f 00 10 sw (sp+16),r15
8017f6c: 5b 90 00 0c sw (sp+12),r16
8017f70: 5b 91 00 08 sw (sp+8),r17
8017f74: 5b 9d 00 04 sw (sp+4),ra
8017f78: b8 20 70 00 mv r14,r1
8017f7c: 20 4f 00 ff andi r15,r2,0xff
int rc = RC_OK;
fat_file_fd_t *fat_fd = parent_loc->node_access;
uint32_t dotdot_cln = 0;
/* find name in fat-file which corresponds to the directory */
rc = msdos_find_name_in_fat_file(parent_loc->mt_entry, fat_fd,
8017f80: 28 21 00 14 lw r1,(r1+20)
8017f84: 29 c2 00 08 lw r2,(r14+8)
int name_len,
msdos_name_type_t name_type,
fat_dir_pos_t *dir_pos,
char *name_dir_entry
)
{
8017f88: b8 80 48 00 mv r9,r4
8017f8c: b8 a0 40 00 mv r8,r5
8017f90: b8 60 80 00 mv r16,r3
8017f94: b8 c0 60 00 mv r12,r6
8017f98: b8 e0 68 00 mv r13,r7
int rc = RC_OK;
fat_file_fd_t *fat_fd = parent_loc->node_access;
uint32_t dotdot_cln = 0;
/* find name in fat-file which corresponds to the directory */
rc = msdos_find_name_in_fat_file(parent_loc->mt_entry, fat_fd,
8017f9c: b9 00 30 00 mv r6,r8
8017fa0: b9 e0 18 00 mv r3,r15
8017fa4: ba 00 20 00 mv r4,r16
8017fa8: b9 20 28 00 mv r5,r9
8017fac: b9 80 38 00 mv r7,r12
8017fb0: b9 a0 40 00 mv r8,r13
8017fb4: fb ff fb 5d calli 8016d28 <msdos_find_name_in_fat_file>
create_node, name, name_len, name_type,
dir_pos, name_dir_entry);
if ((rc != RC_OK) && (rc != MSDOS_NAME_NOT_FOUND_ERR))
8017fb8: 7c 22 7d 01 cmpnei r2,r1,32001
int rc = RC_OK;
fat_file_fd_t *fat_fd = parent_loc->node_access;
uint32_t dotdot_cln = 0;
/* find name in fat-file which corresponds to the directory */
rc = msdos_find_name_in_fat_file(parent_loc->mt_entry, fat_fd,
8017fbc: b8 20 58 00 mv r11,r1
create_node, name, name_len, name_type,
dir_pos, name_dir_entry);
if ((rc != RC_OK) && (rc != MSDOS_NAME_NOT_FOUND_ERR))
8017fc0: 7c 21 00 00 cmpnei r1,r1,0
8017fc4: a0 41 08 00 and r1,r2,r1
8017fc8: 5c 20 00 30 bne r1,r0,8018088 <msdos_get_name_node+0x134> <== NEVER TAKEN
return rc;
if (!create_node)
8017fcc: 5d e1 00 2f bne r15,r1,8018088 <msdos_get_name_node+0x134>
{
/* if we search for valid name and name not found -> return */
if (rc == MSDOS_NAME_NOT_FOUND_ERR)
8017fd0: 34 01 7d 01 mvi r1,32001
8017fd4: 45 61 00 2d be r11,r1,8018088 <msdos_get_name_node+0x134>
* if we have deal with ".." - it is a special case :(((
*
* Really, we should return cluster num and offset not of ".." slot, but
* slot which correspondes to real directory name.
*/
if (rc == RC_OK)
8017fd8: 5d 6f 00 2c bne r11,r15,8018088 <msdos_get_name_node+0x134><== NEVER TAKEN
{
if (strncmp(name, "..", 2) == 0)
8017fdc: 78 02 08 02 mvhi r2,0x802
8017fe0: ba 00 08 00 mv r1,r16
8017fe4: 38 42 e9 30 ori r2,r2,0xe930
8017fe8: 34 03 00 02 mvi r3,2
8017fec: f8 00 13 4d calli 801cd20 <strncmp>
8017ff0: 5c 2b 00 26 bne r1,r11,8018088 <msdos_get_name_node+0x134>
{
dotdot_cln = MSDOS_EXTRACT_CLUSTER_NUM((name_dir_entry));
8017ff4: 2d b0 00 14 lhu r16,(r13+20)
8017ff8: 34 02 00 08 mvi r2,8
8017ffc: 2d af 00 1a lhu r15,(r13+26)
8018000: ba 00 08 00 mv r1,r16
8018004: fb ff a4 79 calli 80011e8 <__ashlsi3>
8018008: b8 20 88 00 mv r17,r1
801800c: 34 02 00 08 mvi r2,8
8018010: ba 00 08 00 mv r1,r16
8018014: f8 00 55 11 calli 802d458 <__lshrsi3>
8018018: ba 21 08 00 or r1,r17,r1
801801c: 34 02 00 10 mvi r2,16
8018020: 20 21 ff ff andi r1,r1,0xffff
8018024: fb ff a4 71 calli 80011e8 <__ashlsi3>
8018028: b8 20 80 00 mv r16,r1
801802c: 34 02 00 08 mvi r2,8
8018030: b9 e0 08 00 mv r1,r15
8018034: fb ff a4 6d calli 80011e8 <__ashlsi3>
8018038: b8 20 88 00 mv r17,r1
801803c: 34 02 00 08 mvi r2,8
8018040: b9 e0 08 00 mv r1,r15
8018044: f8 00 55 05 calli 802d458 <__lshrsi3>
8018048: ba 21 18 00 or r3,r17,r1
801804c: 20 63 ff ff andi r3,r3,0xffff
8018050: ba 03 10 00 or r2,r16,r3
/* are we right under root dir ? */
if (dotdot_cln == 0)
8018054: 5c 4b 00 08 bne r2,r11,8018074 <msdos_get_name_node+0x120>
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
8018058: 34 01 ff ff mvi r1,-1
801805c: 59 81 00 08 sw (r12+8),r1
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
8018060: 59 81 00 0c sw (r12+12),r1
/*
* we can relax about first_char field - it never should be
* used for root dir
*/
fat_dir_pos_init(dir_pos);
dir_pos->sname.cln = FAT_ROOTDIR_CLUSTER_NUM;
8018064: 34 01 00 01 mvi r1,1
fat_dir_pos_init(
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
8018068: 59 80 00 04 sw (r12+4),r0
801806c: 59 81 00 00 sw (r12+0),r1
8018070: e0 00 00 06 bi 8018088 <msdos_get_name_node+0x134>
}
else
{
rc =
8018074: 29 c1 00 14 lw r1,(r14+20)
8018078: b9 80 18 00 mv r3,r12
801807c: b9 a0 20 00 mv r4,r13
8018080: fb ff fe d8 calli 8017be0 <msdos_get_dotdot_dir_info_cluster_num_and_offset>
8018084: b8 20 58 00 mv r11,r1
}
}
}
}
return rc;
}
8018088: b9 60 08 00 mv r1,r11
801808c: 2b 9d 00 04 lw ra,(sp+4)
8018090: 2b 8b 00 20 lw r11,(sp+32)
8018094: 2b 8c 00 1c lw r12,(sp+28)
8018098: 2b 8d 00 18 lw r13,(sp+24)
801809c: 2b 8e 00 14 lw r14,(sp+20)
80180a0: 2b 8f 00 10 lw r15,(sp+16)
80180a4: 2b 90 00 0c lw r16,(sp+12)
80180a8: 2b 91 00 08 lw r17,(sp+8)
80180ac: 37 9c 00 20 addi sp,sp,32
80180b0: c3 a0 00 00 ret
0800aee8 <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
)
{
800aee8: 37 9c ff d0 addi sp,sp,-48
800aeec: 5b 8b 00 1c sw (sp+28),r11
800aef0: 5b 8c 00 18 sw (sp+24),r12
800aef4: 5b 8d 00 14 sw (sp+20),r13
800aef8: 5b 8e 00 10 sw (sp+16),r14
800aefc: 5b 8f 00 0c sw (sp+12),r15
800af00: 5b 90 00 08 sw (sp+8),r16
800af04: 5b 9d 00 04 sw (sp+4),ra
800af08: b8 20 68 00 mv r13,r1
800af0c: b8 40 80 00 mv r16,r2
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));
800af10: 34 01 00 01 mvi r1,1
800af14: 34 02 00 a4 mvi r2,164
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
)
{
800af18: b8 60 78 00 mv r15,r3
800af1c: b8 80 70 00 mv r14,r4
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = NULL;
fat_file_fd_t *fat_fd = NULL;
800af20: 5b 80 00 30 sw (sp+48),r0
fat_dir_pos_t root_pos;
uint32_t cl_buf_size;
fs_info = (msdos_fs_info_t *)calloc(1, sizeof(msdos_fs_info_t));
800af24: fb ff df e0 calli 8002ea4 <calloc>
800af28: b8 20 58 00 mv r11,r1
if (!fs_info)
800af2c: 44 20 00 41 be r1,r0,800b030 <msdos_initialize_support+0x148><== NEVER TAKEN
rtems_set_errno_and_return_minus_one(ENOMEM);
temp_mt_entry->fs_info = fs_info;
rc = fat_init_volume_info(&fs_info->fat, temp_mt_entry->dev);
800af30: 29 a2 00 38 lw r2,(r13+56)
fs_info = (msdos_fs_info_t *)calloc(1, sizeof(msdos_fs_info_t));
if (!fs_info)
rtems_set_errno_and_return_minus_one(ENOMEM);
temp_mt_entry->fs_info = fs_info;
800af34: 59 a1 00 08 sw (r13+8),r1
rc = fat_init_volume_info(&fs_info->fat, temp_mt_entry->dev);
800af38: f8 00 15 e3 calli 80106c4 <fat_init_volume_info>
800af3c: b8 20 60 00 mv r12,r1
if (rc != RC_OK)
800af40: 5c 20 00 11 bne r1,r0,800af84 <msdos_initialize_support+0x9c><== NEVER TAKEN
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
800af44: 34 01 ff ff mvi r1,-1
800af48: 5b 81 00 28 sw (sp+40),r1
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
800af4c: 5b 81 00 2c sw (sp+44),r1
/*
* 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;
800af50: 34 01 00 01 mvi r1,1
800af54: 5b 81 00 20 sw (sp+32),r1
rc = fat_file_open(&fs_info->fat, &root_pos, &fat_fd);
800af58: 37 82 00 20 addi r2,sp,32
800af5c: b9 60 08 00 mv r1,r11
800af60: 37 83 00 30 addi r3,sp,48
{
free(fs_info);
return rc;
}
fs_info->file_handlers = file_handlers;
800af64: 59 6f 00 98 sw (r11+152),r15
fs_info->directory_handlers = directory_handlers;
800af68: 59 6e 00 94 sw (r11+148),r14
fat_dir_pos_init(
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
800af6c: 5b 80 00 24 sw (sp+36),r0
* 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);
800af70: f8 00 10 7d calli 800f164 <fat_file_open>
800af74: b8 20 60 00 mv r12,r1
if (rc != RC_OK)
800af78: 44 20 00 06 be r1,r0,800af90 <msdos_initialize_support+0xa8><== ALWAYS TAKEN
{
fat_shutdown_drive(&fs_info->fat);
800af7c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800af80: f8 00 18 35 calli 8011054 <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info);
800af84: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800af88: fb ff e0 11 calli 8002fcc <free> <== NOT EXECUTED
return rc;
800af8c: e0 00 00 45 bi 800b0a0 <msdos_initialize_support+0x1b8> <== NOT EXECUTED
}
/* again: unfortunately "fat-file" is just almost fat file :( */
fat_fd->fat_file_type = FAT_DIRECTORY;
800af90: 2b 82 00 30 lw r2,(sp+48)
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
800af94: 78 01 00 20 mvhi r1,0x20
800af98: 58 41 00 14 sw (r2+20),r1
fat_fd->cln = fs_info->fat.vol.rdir_cl;
800af9c: 29 61 00 3c lw r1,(r11+60)
free(fs_info);
return rc;
}
/* again: unfortunately "fat-file" is just almost fat file :( */
fat_fd->fat_file_type = FAT_DIRECTORY;
800afa0: 58 40 00 10 sw (r2+16),r0
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
fat_fd->cln = fs_info->fat.vol.rdir_cl;
fat_fd->map.file_cln = 0;
800afa4: 58 40 00 34 sw (r2+52),r0
}
/* 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;
800afa8: 58 41 00 1c sw (r2+28),r1
fat_fd->map.file_cln = 0;
fat_fd->map.disk_cln = fat_fd->cln;
800afac: 58 41 00 38 sw (r2+56),r1
/* if we have FAT12/16 */
if ( fat_fd->cln == 0 )
800afb0: 5c 2c 00 07 bne r1,r12,800afcc <msdos_initialize_support+0xe4>
{
fat_fd->fat_file_size = fs_info->fat.vol.rdir_size;
800afb4: 29 63 00 2c lw r3,(r11+44)
cl_buf_size = (fs_info->fat.vol.bpc > fs_info->fat.vol.rdir_size) ?
fs_info->fat.vol.bpc :
800afb8: 2d 61 00 06 lhu r1,(r11+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;
800afbc: 58 43 00 18 sw (r2+24),r3
cl_buf_size = (fs_info->fat.vol.bpc > fs_info->fat.vol.rdir_size) ?
800afc0: 50 23 00 11 bgeu r1,r3,800b004 <msdos_initialize_support+0x11c><== NEVER TAKEN
800afc4: b8 60 08 00 mv r1,r3
800afc8: e0 00 00 0f bi 800b004 <msdos_initialize_support+0x11c>
fs_info->fat.vol.bpc :
fs_info->fat.vol.rdir_size;
}
else
{
rc = fat_file_size(&fs_info->fat, fat_fd);
800afcc: b9 60 08 00 mv r1,r11
800afd0: f8 00 13 5f calli 800fd4c <fat_file_size>
800afd4: b8 20 78 00 mv r15,r1
if ( rc != RC_OK )
800afd8: 44 20 00 0a be r1,r0,800b000 <msdos_initialize_support+0x118>
{
fat_file_close(&fs_info->fat, fat_fd);
800afdc: 2b 82 00 30 lw r2,(sp+48) <== NOT EXECUTED
800afe0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
free(fs_info);
return rc;
800afe4: b9 e0 60 00 mv r12,r15 <== NOT EXECUTED
else
{
rc = fat_file_size(&fs_info->fat, fat_fd);
if ( rc != RC_OK )
{
fat_file_close(&fs_info->fat, fat_fd);
800afe8: f8 00 11 98 calli 800f648 <fat_file_close> <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
800afec: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800aff0: f8 00 18 19 calli 8011054 <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info);
800aff4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800aff8: fb ff df f5 calli 8002fcc <free> <== NOT EXECUTED
return rc;
800affc: e0 00 00 29 bi 800b0a0 <msdos_initialize_support+0x1b8> <== NOT EXECUTED
}
cl_buf_size = fs_info->fat.vol.bpc;
800b000: 2d 61 00 06 lhu r1,(r11+6)
}
fs_info->cl_buf = (uint8_t *)calloc(cl_buf_size, sizeof(char));
800b004: 34 02 00 01 mvi r2,1
800b008: fb ff df a7 calli 8002ea4 <calloc>
800b00c: 59 61 00 a0 sw (r11+160),r1
if (fs_info->cl_buf == NULL)
800b010: 5c 20 00 0d bne r1,r0,800b044 <msdos_initialize_support+0x15c><== ALWAYS TAKEN
{
fat_file_close(&fs_info->fat, fat_fd);
800b014: 2b 82 00 30 lw r2,(sp+48) <== NOT EXECUTED
800b018: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800b01c: f8 00 11 8b calli 800f648 <fat_file_close> <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
800b020: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800b024: f8 00 18 0c calli 8011054 <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info);
800b028: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800b02c: fb ff df e8 calli 8002fcc <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENOMEM);
800b030: f8 00 3f 09 calli 801ac54 <__errno> <== NOT EXECUTED
800b034: 34 02 00 0c mvi r2,12 <== NOT EXECUTED
800b038: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
800b03c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
800b040: e0 00 00 18 bi 800b0a0 <msdos_initialize_support+0x1b8> <== NOT EXECUTED
}
sc = rtems_semaphore_create(3,
800b044: 34 02 00 01 mvi r2,1
800b048: 34 01 00 03 mvi r1,3
800b04c: 34 03 00 10 mvi r3,16
800b050: 34 04 00 00 mvi r4,0
800b054: 35 65 00 9c addi r5,r11,156
800b058: fb ff e9 5b calli 80055c4 <rtems_semaphore_create>
800b05c: 2b 82 00 30 lw r2,(sp+48)
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_FIFO,
0,
&fs_info->vol_sema);
if (sc != RTEMS_SUCCESSFUL)
800b060: 44 20 00 0c be r1,r0,800b090 <msdos_initialize_support+0x1a8><== ALWAYS TAKEN
{
fat_file_close(&fs_info->fat, fat_fd);
800b064: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800b068: f8 00 11 78 calli 800f648 <fat_file_close> <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
800b06c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800b070: f8 00 17 f9 calli 8011054 <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info->cl_buf);
800b074: 29 61 00 a0 lw r1,(r11+160) <== NOT EXECUTED
800b078: fb ff df d5 calli 8002fcc <free> <== NOT EXECUTED
free(fs_info);
800b07c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800b080: fb ff df d3 calli 8002fcc <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EIO );
800b084: f8 00 3e f4 calli 801ac54 <__errno> <== NOT EXECUTED
800b088: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
800b08c: e3 ff ff eb bi 800b038 <msdos_initialize_support+0x150> <== NOT EXECUTED
}
temp_mt_entry->mt_fs_root->location.node_access = fat_fd;
800b090: 29 a1 00 24 lw r1,(r13+36)
800b094: 58 22 00 08 sw (r1+8),r2
temp_mt_entry->mt_fs_root->location.handlers = directory_handlers;
800b098: 58 2e 00 10 sw (r1+16),r14
temp_mt_entry->ops = op_table;
800b09c: 59 b0 00 0c sw (r13+12),r16
return rc;
}
800b0a0: b9 80 08 00 mv r1,r12
800b0a4: 2b 9d 00 04 lw ra,(sp+4)
800b0a8: 2b 8b 00 1c lw r11,(sp+28)
800b0ac: 2b 8c 00 18 lw r12,(sp+24)
800b0b0: 2b 8d 00 14 lw r13,(sp+20)
800b0b4: 2b 8e 00 10 lw r14,(sp+16)
800b0b8: 2b 8f 00 0c lw r15,(sp+12)
800b0bc: 2b 90 00 08 lw r16,(sp+8)
800b0c0: 37 9c 00 30 addi sp,sp,48
800b0c4: c3 a0 00 00 ret
0800aeac <msdos_lock>:
.rename_h = msdos_rename,
.statvfs_h = rtems_filesystem_default_statvfs
};
void msdos_lock(const rtems_filesystem_mount_table_entry_t *mt_entry)
{
800aeac: 37 9c ff fc addi sp,sp,-4
800aeb0: 5b 9d 00 04 sw (sp+4),ra
msdos_fs_info_t *fs_info = mt_entry->fs_info;
rtems_status_code sc = rtems_semaphore_obtain(
fs_info->vol_sema,
800aeb4: 28 21 00 08 lw r1,(r1+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(
800aeb8: 34 02 00 00 mvi r2,0
800aebc: 34 03 00 00 mvi r3,0
800aec0: 28 21 00 9c lw r1,(r1+156)
800aec4: fb ff ea 6c calli 8005874 <rtems_semaphore_obtain>
fs_info->vol_sema,
RTEMS_WAIT,
RTEMS_NO_TIMEOUT
);
if (sc != RTEMS_SUCCESSFUL) {
800aec8: 44 20 00 05 be r1,r0,800aedc <msdos_lock+0x30> <== ALWAYS TAKEN
rtems_fatal_error_occurred(0xdeadbeef);
800aecc: 78 02 08 02 mvhi r2,0x802 <== NOT EXECUTED
800aed0: 38 42 e0 2c ori r2,r2,0xe02c <== NOT EXECUTED
800aed4: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED
800aed8: fb ff eb d9 calli 8005e3c <rtems_fatal_error_occurred> <== NOT EXECUTED
}
}
800aedc: 2b 9d 00 04 lw ra,(sp+4)
800aee0: 37 9c 00 04 addi sp,sp,4
800aee4: c3 a0 00 00 ret
08016490 <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)
{
8016490: 37 9c ff bc addi sp,sp,-68
8016494: 5b 8b 00 44 sw (sp+68),r11
8016498: 5b 8c 00 40 sw (sp+64),r12
801649c: 5b 8d 00 3c sw (sp+60),r13
80164a0: 5b 8e 00 38 sw (sp+56),r14
80164a4: 5b 8f 00 34 sw (sp+52),r15
80164a8: 5b 90 00 30 sw (sp+48),r16
80164ac: 5b 91 00 2c sw (sp+44),r17
80164b0: 5b 92 00 28 sw (sp+40),r18
80164b4: 5b 93 00 24 sw (sp+36),r19
80164b8: 5b 94 00 20 sw (sp+32),r20
80164bc: 5b 95 00 1c sw (sp+28),r21
80164c0: 5b 96 00 18 sw (sp+24),r22
80164c4: 5b 97 00 14 sw (sp+20),r23
80164c8: 5b 98 00 10 sw (sp+16),r24
80164cc: 5b 99 00 0c sw (sp+12),r25
80164d0: 5b 9b 00 08 sw (sp+8),fp
80164d4: 5b 9d 00 04 sw (sp+4),ra
80164d8: b8 20 78 00 mv r15,r1
80164dc: b8 40 70 00 mv r14,r2
int i;
/*
* Fill with spaces. This is how a short directory entry is padded.
*/
memset (sfn, ' ', sfn_len);
80164e0: b8 60 08 00 mv r1,r3
80164e4: 34 02 00 20 mvi r2,32
*
*/
#define MSDOS_L2S_PRINT 0
msdos_name_type_t
msdos_long_to_short(const char *lfn, int lfn_len, char* sfn, int sfn_len)
{
80164e8: b8 60 80 00 mv r16,r3
int i;
/*
* Fill with spaces. This is how a short directory entry is padded.
*/
memset (sfn, ' ', sfn_len);
80164ec: b8 80 18 00 mv r3,r4
80164f0: f8 00 15 68 calli 801ba90 <memset>
/*
* Handle '.' and '..' specially.
*/
if ((lfn[0] == '.') && (lfn_len == 1))
80164f4: 41 e2 00 00 lbu r2,(r15+0)
80164f8: 65 c1 00 01 cmpei r1,r14,1
80164fc: 64 42 00 2e cmpei r2,r2,46
8016500: a0 41 08 00 and r1,r2,r1
8016504: 44 20 00 03 be r1,r0,8016510 <msdos_long_to_short+0x80>
{
sfn[0] = '.';
8016508: 34 01 00 2e mvi r1,46
801650c: e0 00 00 0b bi 8016538 <msdos_long_to_short+0xa8>
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))
8016510: 34 04 00 00 mvi r4,0
8016514: 44 41 00 13 be r2,r1,8016560 <msdos_long_to_short+0xd0>
8016518: 41 e2 00 01 lbu r2,(r15+1)
801651c: 65 c3 00 02 cmpei r3,r14,2
8016520: b8 20 20 00 mv r4,r1
8016524: 64 42 00 2e cmpei r2,r2,46
8016528: a0 43 10 00 and r2,r2,r3
801652c: 44 40 00 0d be r2,r0,8016560 <msdos_long_to_short+0xd0> <== NEVER TAKEN
{
sfn[0] = sfn[1] = '.';
8016530: 34 01 00 2e mvi r1,46
8016534: 32 01 00 01 sb (r16+1),r1
8016538: 32 01 00 00 sb (r16+0),r1
#if MSDOS_L2S_PRINT
printf ("MSDOS_L2S: SHORT[2]: lfn:'%s' SFN:'%s'\n", lfn, sfn);
#endif
return MSDOS_NAME_SHORT;
801653c: 34 02 00 01 mvi r2,1
8016540: e0 00 00 58 bi 80166a0 <msdos_long_to_short+0x210>
* 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)
8016544: b5 e4 08 00 add r1,r15,r4
/*
* Filenames with only blanks and dots are not allowed!
*/
for (i = 0; i < lfn_len; i++)
if ((lfn[i] != ' ') && (lfn[i] != '.'))
8016548: 40 21 00 00 lbu r1,(r1+0)
801654c: 7c 22 00 2e cmpnei r2,r1,46
8016550: 7c 21 00 20 cmpnei r1,r1,32
8016554: a0 41 08 00 and r1,r2,r1
8016558: 5c 20 00 34 bne r1,r0,8016628 <msdos_long_to_short+0x198>
}
/*
* Filenames with only blanks and dots are not allowed!
*/
for (i = 0; i < lfn_len; i++)
801655c: 34 84 00 01 addi r4,r4,1
8016560: 49 c4 ff f9 bg r14,r4,8016544 <msdos_long_to_short+0xb4> <== ALWAYS TAKEN
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;
8016564: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
*/
for (i = 0; i < lfn_len; i++)
if ((lfn[i] != ' ') && (lfn[i] != '.'))
break;
if (i == lfn_len)
8016568: 44 8e 00 4e be r4,r14,80166a0 <msdos_long_to_short+0x210> <== NOT EXECUTED
801656c: e0 00 00 2f bi 8016628 <msdos_long_to_short+0x198> <== NOT EXECUTED
*
*/
static msdos_name_type_t
msdos_is_valid_name_char(const char ch)
{
if (strchr(" +,;=[]", ch) != NULL)
8016570: ba e0 08 00 mv r1,r23
8016574: b9 a0 10 00 mv r2,r13
8016578: f8 00 18 c8 calli 801c898 <strchr>
int dot_at = -1;
int count = 0;
while (*name && (count < name_len))
{
bool is_dot = *name == '.';
801657c: 65 b2 00 2e cmpei r18,r13,46
*/
static msdos_name_type_t
msdos_is_valid_name_char(const char ch)
{
if (strchr(" +,;=[]", ch) != NULL)
return MSDOS_NAME_LONG;
8016580: 34 0b 00 02 mvi r11,2
*
*/
static msdos_name_type_t
msdos_is_valid_name_char(const char ch)
{
if (strchr(" +,;=[]", ch) != NULL)
8016584: 5c 20 00 0c bne r1,r0,80165b4 <msdos_long_to_short+0x124>
return MSDOS_NAME_LONG;
if ((ch == '.') || isalnum((unsigned char)ch) ||
(strchr("$%'-_@~`!(){}^#&", ch) != NULL))
return MSDOS_NAME_SHORT;
8016588: 34 0b 00 01 mvi r11,1
msdos_is_valid_name_char(const char ch)
{
if (strchr(" +,;=[]", ch) != NULL)
return MSDOS_NAME_LONG;
if ((ch == '.') || isalnum((unsigned char)ch) ||
801658c: 5e 41 00 0a bne r18,r1,80165b4 <msdos_long_to_short+0x124>
8016590: 2a 61 00 00 lw r1,(r19+0)
8016594: b4 2d 08 00 add r1,r1,r13
8016598: 40 21 00 01 lbu r1,(r1+1)
801659c: 20 21 00 07 andi r1,r1,0x7
80165a0: 5c 32 00 05 bne r1,r18,80165b4 <msdos_long_to_short+0x124>
(strchr("$%'-_@~`!(){}^#&", ch) != NULL))
80165a4: ba c0 08 00 mv r1,r22
80165a8: b9 a0 10 00 mv r2,r13
80165ac: f8 00 18 bb calli 801c898 <strchr>
*/
static msdos_name_type_t
msdos_is_valid_name_char(const char ch)
{
if (strchr(" +,;=[]", ch) != NULL)
return MSDOS_NAME_LONG;
80165b0: 7c 2b 00 00 cmpnei r11,r1,0
#if MSDOS_NAME_TYPE_PRINT
printf ("MSDOS_NAME_TYPE: c:%02x type:%d\n", *name, type);
#endif
if ((type == MSDOS_NAME_INVALID) || (type == MSDOS_NAME_LONG))
80165b4: 65 62 00 02 cmpei r2,r11,2
80165b8: 65 61 00 00 cmpei r1,r11,0
80165bc: b8 41 08 00 or r1,r2,r1
80165c0: 5c 20 00 31 bne r1,r0,8016684 <msdos_long_to_short+0x1f4>
return type;
if (dot_at >= 0)
80165c4: 34 01 ff ff mvi r1,-1
80165c8: 46 21 00 05 be r17,r1,80165dc <msdos_long_to_short+0x14c>
{
if (is_dot || ((count - dot_at) > 3))
80165cc: 5e 40 00 49 bne r18,r0,80166f0 <msdos_long_to_short+0x260>
80165d0: c9 91 08 00 sub r1,r12,r17
80165d4: 48 39 00 47 bg r1,r25,80166f0 <msdos_long_to_short+0x260> <== NEVER TAKEN
80165d8: e0 00 00 06 bi 80165f0 <msdos_long_to_short+0x160>
return MSDOS_NAME_LONG;
}
}
else
{
if (count == 8 && !is_dot)
80165dc: 5d 9b 00 04 bne r12,fp,80165ec <msdos_long_to_short+0x15c>
80165e0: 46 40 00 44 be r18,r0,80166f0 <msdos_long_to_short+0x260> <== ALWAYS TAKEN
80165e4: 34 11 00 08 mvi r17,8 <== NOT EXECUTED
80165e8: e0 00 00 0e bi 8016620 <msdos_long_to_short+0x190> <== NOT EXECUTED
#endif
return MSDOS_NAME_LONG;
}
}
if (is_dot)
80165ec: 5e 40 00 08 bne r18,r0,801660c <msdos_long_to_short+0x17c>
dot_at = count;
else if ((*name >= 'A') && (*name <= 'Z'))
80165f0: 35 a1 ff bf addi r1,r13,-65
80165f4: 20 21 00 ff andi r1,r1,0xff
80165f8: 53 01 00 07 bgeu r24,r1,8016614 <msdos_long_to_short+0x184>
uppercase = true;
else if ((*name >= 'a') && (*name <= 'z'))
80165fc: 35 ad ff 9f addi r13,r13,-97
8016600: 21 ad 00 ff andi r13,r13,0xff
8016604: 53 0d 00 06 bgeu r24,r13,801661c <msdos_long_to_short+0x18c>
8016608: e0 00 00 06 bi 8016620 <msdos_long_to_short+0x190>
#endif
return MSDOS_NAME_LONG;
}
}
if (is_dot)
801660c: b9 80 88 00 mv r17,r12
8016610: e0 00 00 04 bi 8016620 <msdos_long_to_short+0x190>
dot_at = count;
else if ((*name >= 'A') && (*name <= 'Z'))
uppercase = true;
8016614: 34 14 00 01 mvi r20,1
8016618: e0 00 00 02 bi 8016620 <msdos_long_to_short+0x190>
else if ((*name >= 'a') && (*name <= 'z'))
lowercase = true;
801661c: 34 15 00 01 mvi r21,1
count++;
8016620: 35 8c 00 01 addi r12,r12,1
8016624: e0 00 00 0e bi 801665c <msdos_long_to_short+0x1cc>
*
*/
static msdos_name_type_t
msdos_is_valid_name_char(const char ch)
{
if (strchr(" +,;=[]", ch) != NULL)
8016628: 78 17 08 02 mvhi r23,0x802
return MSDOS_NAME_LONG;
if ((ch == '.') || isalnum((unsigned char)ch) ||
801662c: 78 13 08 03 mvhi r19,0x803
(strchr("$%'-_@~`!(){}^#&", ch) != NULL))
8016630: 78 16 08 02 mvhi r22,0x802
/*
* Filenames with only blanks and dots are not allowed!
*/
for (i = 0; i < lfn_len; i++)
if ((lfn[i] != ' ') && (lfn[i] != '.'))
8016634: 34 0c 00 00 mvi r12,0
8016638: 34 11 ff ff mvi r17,-1
801663c: 34 14 00 00 mvi r20,0
8016640: 34 15 00 00 mvi r21,0
*
*/
static msdos_name_type_t
msdos_is_valid_name_char(const char ch)
{
if (strchr(" +,;=[]", ch) != NULL)
8016644: 3a f7 eb 5c ori r23,r23,0xeb5c
return MSDOS_NAME_LONG;
if ((ch == '.') || isalnum((unsigned char)ch) ||
8016648: 3a 73 02 78 ori r19,r19,0x278
(strchr("$%'-_@~`!(){}^#&", ch) != NULL))
801664c: 3a d6 eb 64 ori r22,r22,0xeb64
}
}
if (is_dot)
dot_at = count;
else if ((*name >= 'A') && (*name <= 'Z'))
8016650: 34 18 00 19 mvi r24,25
return MSDOS_NAME_LONG;
}
}
else
{
if (count == 8 && !is_dot)
8016654: 34 1b 00 08 mvi fp,8
if ((type == MSDOS_NAME_INVALID) || (type == MSDOS_NAME_LONG))
return type;
if (dot_at >= 0)
{
if (is_dot || ((count - dot_at) > 3))
8016658: 34 19 00 03 mvi r25,3
* 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)
801665c: b5 ec 08 00 add r1,r15,r12
bool lowercase = false;
bool uppercase = false;
int dot_at = -1;
int count = 0;
while (*name && (count < name_len))
8016660: 40 2d 00 00 lbu r13,(r1+0)
8016664: e9 cc 10 00 cmpg r2,r14,r12
8016668: 7d a1 00 00 cmpnei r1,r13,0
801666c: a0 41 08 00 and r1,r2,r1
8016670: 5c 20 ff c0 bne r1,r0,8016570 <msdos_long_to_short+0xe0>
}
#if MSDOS_NAME_TYPE_PRINT
printf ("MSDOS_NAME_TYPE: SHORT[1]\n");
#endif
return MSDOS_NAME_SHORT;
8016674: 34 0b 00 01 mvi r11,1
count++;
name++;
}
if (lowercase && uppercase)
8016678: 46 a1 00 05 be r21,r1,801668c <msdos_long_to_short+0x1fc>
}
#if MSDOS_NAME_TYPE_PRINT
printf ("MSDOS_NAME_TYPE: SHORT[1]\n");
#endif
return MSDOS_NAME_SHORT;
801667c: 36 8b 00 01 addi r11,r20,1
8016680: e0 00 00 03 bi 801668c <msdos_long_to_short+0x1fc>
#if MSDOS_NAME_TYPE_PRINT
printf ("MSDOS_NAME_TYPE: c:%02x type:%d\n", *name, type);
#endif
if ((type == MSDOS_NAME_INVALID) || (type == MSDOS_NAME_LONG))
8016684: b9 60 10 00 mv r2,r11
* Is this a short name ?
*/
type = msdos_name_type (lfn, lfn_len);
if (type == MSDOS_NAME_INVALID)
8016688: 45 60 00 06 be r11,r0,80166a0 <msdos_long_to_short+0x210> <== NEVER TAKEN
printf ("MSDOS_L2S: INVALID[2]: lfn:'%s' SFN:'%s'\n", lfn, sfn);
#endif
return MSDOS_NAME_INVALID;
}
msdos_filename_unix2dos (lfn, lfn_len, sfn);
801668c: b9 c0 10 00 mv r2,r14
8016690: b9 e0 08 00 mv r1,r15
8016694: ba 00 18 00 mv r3,r16
8016698: f8 00 0d bd calli 8019d8c <msdos_filename_unix2dos>
#if MSDOS_L2S_PRINT
printf ("MSDOS_L2S: TYPE:%d lfn:'%s' SFN:'%s'\n", type, lfn, sfn);
#endif
return type;
801669c: b9 60 10 00 mv r2,r11
}
80166a0: b8 40 08 00 mv r1,r2
80166a4: 2b 9d 00 04 lw ra,(sp+4)
80166a8: 2b 8b 00 44 lw r11,(sp+68)
80166ac: 2b 8c 00 40 lw r12,(sp+64)
80166b0: 2b 8d 00 3c lw r13,(sp+60)
80166b4: 2b 8e 00 38 lw r14,(sp+56)
80166b8: 2b 8f 00 34 lw r15,(sp+52)
80166bc: 2b 90 00 30 lw r16,(sp+48)
80166c0: 2b 91 00 2c lw r17,(sp+44)
80166c4: 2b 92 00 28 lw r18,(sp+40)
80166c8: 2b 93 00 24 lw r19,(sp+36)
80166cc: 2b 94 00 20 lw r20,(sp+32)
80166d0: 2b 95 00 1c lw r21,(sp+28)
80166d4: 2b 96 00 18 lw r22,(sp+24)
80166d8: 2b 97 00 14 lw r23,(sp+20)
80166dc: 2b 98 00 10 lw r24,(sp+16)
80166e0: 2b 99 00 0c lw r25,(sp+12)
80166e4: 2b 9b 00 08 lw fp,(sp+8)
80166e8: 37 9c 00 44 addi sp,sp,68
80166ec: c3 a0 00 00 ret
{
#if MSDOS_NAME_TYPE_PRINT
printf ("MSDOS_NAME_TYPE: LONG[2]: is_dot:%d, at:%d cnt\n",
is_dot, dot_at, count);
#endif
return MSDOS_NAME_LONG;
80166f0: 34 0b 00 02 mvi r11,2
80166f4: e3 ff ff e6 bi 801668c <msdos_long_to_short+0x1fc>
0800b0c8 <msdos_mknod>:
const char *name,
size_t namelen,
mode_t mode,
dev_t dev
)
{
800b0c8: 37 9c ff fc addi sp,sp,-4
800b0cc: 5b 9d 00 04 sw (sp+4),ra
800b0d0: b8 40 38 00 mv r7,r2
800b0d4: b8 60 30 00 mv r6,r3
msdos_node_type_t type = 0;
/*
* Figure out what type of msdos node this is.
*/
if (S_ISDIR(mode))
800b0d8: 34 02 40 00 mvi r2,16384
800b0dc: 20 83 f0 00 andi r3,r4,0xf000
const char *name,
size_t namelen,
mode_t mode,
dev_t dev
)
{
800b0e0: b8 80 28 00 mv r5,r4
msdos_node_type_t type = 0;
/*
* Figure out what type of msdos node this is.
*/
if (S_ISDIR(mode))
800b0e4: 44 62 00 09 be r3,r2,800b108 <msdos_mknod+0x40>
{
type = MSDOS_DIRECTORY;
}
else if (S_ISREG(mode))
800b0e8: 38 04 80 00 mvu r4,0x8000
{
type = MSDOS_REGULAR_FILE;
800b0ec: 34 02 00 04 mvi r2,4
*/
if (S_ISDIR(mode))
{
type = MSDOS_DIRECTORY;
}
else if (S_ISREG(mode))
800b0f0: 44 64 00 07 be r3,r4,800b10c <msdos_mknod+0x44> <== ALWAYS TAKEN
{
type = MSDOS_REGULAR_FILE;
}
else
rtems_set_errno_and_return_minus_one(EINVAL);
800b0f4: f8 00 3e d8 calli 801ac54 <__errno> <== NOT EXECUTED
800b0f8: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
800b0fc: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
800b100: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
800b104: e0 00 00 06 bi 800b11c <msdos_mknod+0x54> <== NOT EXECUTED
/*
* Figure out what type of msdos node this is.
*/
if (S_ISDIR(mode))
{
type = MSDOS_DIRECTORY;
800b108: 34 02 00 00 mvi r2,0
}
else
rtems_set_errno_and_return_minus_one(EINVAL);
/* Create an MSDOS node */
rc = msdos_creat_node(parentloc, type, name, namelen, mode, NULL);
800b10c: b8 c0 20 00 mv r4,r6
800b110: b8 e0 18 00 mv r3,r7
800b114: 34 06 00 00 mvi r6,0
800b118: f8 00 2a 96 calli 8015b70 <msdos_creat_node>
return rc;
}
800b11c: 2b 9d 00 04 lw ra,(sp+4)
800b120: 37 9c 00 04 addi sp,sp,4
800b124: c3 a0 00 00 ret
0800b134 <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
)
{
800b134: 37 9c ff f4 addi sp,sp,-12 <== NOT EXECUTED
800b138: 5b 8b 00 0c sw (sp+12),r11 <== NOT EXECUTED
800b13c: 5b 8c 00 08 sw (sp+8),r12 <== NOT EXECUTED
800b140: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
int rc = RC_OK;
fat_file_fd_t *old_fat_fd = old_loc->node_access;
800b144: 28 4b 00 08 lw r11,(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_namelen
)
{
800b148: b8 40 60 00 mv r12,r2 <== NOT EXECUTED
/*
* create new directory entry as "hard link", copying relevant info from
* existing file
*/
rc = msdos_creat_node(new_parent_loc,
800b14c: b8 60 08 00 mv r1,r3 <== NOT EXECUTED
800b150: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
800b154: b8 80 18 00 mv r3,r4 <== NOT EXECUTED
800b158: b9 60 30 00 mv r6,r11 <== NOT EXECUTED
800b15c: b8 a0 20 00 mv r4,r5 <== NOT EXECUTED
800b160: 38 05 80 00 mvu r5,0x8000 <== NOT EXECUTED
800b164: f8 00 2a 83 calli 8015b70 <msdos_creat_node> <== NOT EXECUTED
MSDOS_HARD_LINK,new_name,new_namelen,S_IFREG,
old_fat_fd);
if (rc != RC_OK)
800b168: 5c 20 00 05 bne r1,r0,800b17c <msdos_rename+0x48> <== NOT EXECUTED
}
/*
* mark file removed
*/
rc = msdos_set_first_char4file_name(old_loc->mt_entry,
800b16c: 29 81 00 14 lw r1,(r12+20) <== NOT EXECUTED
800b170: 35 62 00 20 addi r2,r11,32 <== NOT EXECUTED
800b174: 34 03 00 e5 mvi r3,229 <== NOT EXECUTED
800b178: f8 00 2e 34 calli 8016a48 <msdos_set_first_char4file_name> <== NOT EXECUTED
&old_fat_fd->dir_pos,
MSDOS_THIS_DIR_ENTRY_EMPTY);
return rc;
}
800b17c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
800b180: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED
800b184: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED
800b188: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED
800b18c: c3 a0 00 00 ret <== NOT EXECUTED
0800b190 <msdos_rmnod>:
#include "msdos.h"
int
msdos_rmnod(const rtems_filesystem_location_info_t *parent_pathloc,
const rtems_filesystem_location_info_t *pathloc)
{
800b190: 37 9c ff e4 addi sp,sp,-28
800b194: 5b 8b 00 18 sw (sp+24),r11
800b198: 5b 8c 00 14 sw (sp+20),r12
800b19c: 5b 8d 00 10 sw (sp+16),r13
800b1a0: 5b 8e 00 0c sw (sp+12),r14
800b1a4: 5b 8f 00 08 sw (sp+8),r15
800b1a8: 5b 9d 00 04 sw (sp+4),ra
int rc = RC_OK;
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = pathloc->node_access;
800b1ac: 28 4c 00 08 lw r12,(r2+8)
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;
800b1b0: 28 41 00 14 lw r1,(r2+20)
#include "msdos.h"
int
msdos_rmnod(const rtems_filesystem_location_info_t *parent_pathloc,
const rtems_filesystem_location_info_t *pathloc)
{
800b1b4: b8 40 68 00 mv r13,r2
int rc = RC_OK;
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = pathloc->node_access;
if (fat_fd->fat_file_type == MSDOS_DIRECTORY)
800b1b8: 29 8e 00 10 lw r14,(r12+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;
800b1bc: 28 2f 00 08 lw r15,(r1+8)
fat_file_fd_t *fat_fd = pathloc->node_access;
if (fat_fd->fat_file_type == MSDOS_DIRECTORY)
800b1c0: 5d c0 00 14 bne r14,r0,800b210 <msdos_rmnod+0x80>
bool is_empty = false;
/*
* You cannot remove a node that still has children
*/
rc = msdos_dir_is_empty(pathloc->mt_entry, fat_fd, &is_empty);
800b1c4: b9 80 10 00 mv r2,r12
800b1c8: 37 83 00 1f addi r3,sp,31
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = pathloc->node_access;
if (fat_fd->fat_file_type == MSDOS_DIRECTORY)
{
bool is_empty = false;
800b1cc: 33 80 00 1f sb (sp+31),r0
/*
* You cannot remove a node that still has children
*/
rc = msdos_dir_is_empty(pathloc->mt_entry, fat_fd, &is_empty);
800b1d0: f8 00 2e 73 calli 8016b9c <msdos_dir_is_empty>
800b1d4: b8 20 58 00 mv r11,r1
if (rc != RC_OK)
800b1d8: 5c 2e 00 17 bne r1,r14,800b234 <msdos_rmnod+0xa4> <== NEVER TAKEN
{
return rc;
}
if (!is_empty)
800b1dc: 43 81 00 1f lbu r1,(sp+31)
800b1e0: 5c 2b 00 04 bne r1,r11,800b1f0 <msdos_rmnod+0x60>
{
rtems_set_errno_and_return_minus_one(ENOTEMPTY);
800b1e4: f8 00 3e 9c calli 801ac54 <__errno>
800b1e8: 34 02 00 5a mvi r2,90
800b1ec: e0 00 00 06 bi 800b204 <msdos_rmnod+0x74>
/*
* We deny attempts to delete open directory (if directory is current
* directory we assume it is open one)
*/
if (fat_fd->links_num > 1)
800b1f0: 29 82 00 08 lw r2,(r12+8)
800b1f4: 34 01 00 01 mvi r1,1
800b1f8: 50 22 00 06 bgeu r1,r2,800b210 <msdos_rmnod+0x80> <== ALWAYS TAKEN
{
rtems_set_errno_and_return_minus_one(EBUSY);
800b1fc: f8 00 3e 96 calli 801ac54 <__errno> <== NOT EXECUTED
800b200: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
800b204: 58 22 00 00 sw (r1+0),r2
800b208: 34 0b ff ff mvi r11,-1
800b20c: e0 00 00 0a bi 800b234 <msdos_rmnod+0xa4>
* not used - mount() not implemenetd yet.
*/
}
/* mark file removed */
rc = msdos_set_first_char4file_name(pathloc->mt_entry, &fat_fd->dir_pos,
800b210: 29 a1 00 14 lw r1,(r13+20)
800b214: 35 82 00 20 addi r2,r12,32
800b218: 34 03 00 e5 mvi r3,229
800b21c: f8 00 2e 0b calli 8016a48 <msdos_set_first_char4file_name>
800b220: b8 20 58 00 mv r11,r1
MSDOS_THIS_DIR_ENTRY_EMPTY);
if (rc != RC_OK)
800b224: 5c 20 00 04 bne r1,r0,800b234 <msdos_rmnod+0xa4> <== NEVER TAKEN
{
return rc;
}
fat_file_mark_removed(&fs_info->fat, fat_fd);
800b228: b9 e0 08 00 mv r1,r15
800b22c: b9 80 10 00 mv r2,r12
800b230: f8 00 12 a7 calli 800fccc <fat_file_mark_removed>
return rc;
}
800b234: b9 60 08 00 mv r1,r11
800b238: 2b 9d 00 04 lw ra,(sp+4)
800b23c: 2b 8b 00 18 lw r11,(sp+24)
800b240: 2b 8c 00 14 lw r12,(sp+20)
800b244: 2b 8d 00 10 lw r13,(sp+16)
800b248: 2b 8e 00 0c lw r14,(sp+12)
800b24c: 2b 8f 00 08 lw r15,(sp+8)
800b250: 37 9c 00 1c addi sp,sp,28
800b254: c3 a0 00 00 ret
080166f8 <msdos_set_dir_wrt_time_and_date>:
int
msdos_set_dir_wrt_time_and_date(
rtems_filesystem_mount_table_entry_t *mt_entry,
fat_file_fd_t *fat_fd
)
{
80166f8: 37 9c ff e0 addi sp,sp,-32
80166fc: 5b 8b 00 1c sw (sp+28),r11
8016700: 5b 8c 00 18 sw (sp+24),r12
8016704: 5b 8d 00 14 sw (sp+20),r13
8016708: 5b 8e 00 10 sw (sp+16),r14
801670c: 5b 8f 00 0c sw (sp+12),r15
8016710: 5b 90 00 08 sw (sp+8),r16
8016714: 5b 9d 00 04 sw (sp+4),ra
ssize_t ret1 = 0, ret2 = 0, ret3 = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
8016718: 28 2b 00 08 lw r11,(r1+8)
uint16_t time_val;
uint16_t date;
uint32_t sec = 0;
uint32_t byte = 0;
msdos_date_unix2dos(fat_fd->mtime, &date, &time_val);
801671c: 28 41 00 40 lw r1,(r2+64)
8016720: 37 8e 00 22 addi r14,sp,34
8016724: b9 c0 18 00 mv r3,r14
int
msdos_set_dir_wrt_time_and_date(
rtems_filesystem_mount_table_entry_t *mt_entry,
fat_file_fd_t *fat_fd
)
{
8016728: b8 40 60 00 mv r12,r2
uint16_t time_val;
uint16_t date;
uint32_t sec = 0;
uint32_t byte = 0;
msdos_date_unix2dos(fat_fd->mtime, &date, &time_val);
801672c: 37 82 00 20 addi r2,sp,32
8016730: f8 00 0c d1 calli 8019a74 <msdos_date_unix2dos>
/*
* calculate input for fat_sector_write: convert (cluster num, offset) to
* (sector num, new offset)
*/
sec = fat_cluster_num_to_sector_num(&fs_info->fat, fat_fd->dir_pos.sname.cln);
8016734: 29 82 00 20 lw r2,(r12+32)
8016738: b9 60 08 00 mv r1,r11
801673c: fb ff ff 42 calli 8016444 <fat_cluster_num_to_sector_num>
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
8016740: 29 8f 00 24 lw r15,(r12+36)
8016744: 41 62 00 02 lbu r2,(r11+2)
/*
* calculate input for fat_sector_write: convert (cluster num, offset) to
* (sector num, new offset)
*/
sec = fat_cluster_num_to_sector_num(&fs_info->fat, fat_fd->dir_pos.sname.cln);
8016748: b8 20 68 00 mv r13,r1
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
801674c: b9 e0 08 00 mv r1,r15
8016750: f8 00 5b 42 calli 802d458 <__lshrsi3>
/* byte points to start of 32bytes structure */
byte = fat_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1);
8016754: 2d 6c 00 00 lhu r12,(r11+0)
/*
* calculate input for fat_sector_write: convert (cluster num, offset) to
* (sector num, new offset)
*/
sec = fat_cluster_num_to_sector_num(&fs_info->fat, fat_fd->dir_pos.sname.cln);
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
8016758: b5 a1 68 00 add r13,r13,r1
* @param[in] value is the value to be swapped
* @return the value after being endian swapped
*/
static inline uint16_t CPU_swap_u16(uint16_t v)
{
return v << 8 | v >> 8;
801675c: 34 02 00 08 mvi r2,8
/* byte points to start of 32bytes structure */
byte = fat_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1);
8016760: 35 8c ff ff addi r12,r12,-1
8016764: a1 8f 60 00 and r12,r12,r15
time_val = CT_LE_W(time_val);
8016768: 2f 8f 00 22 lhu r15,(sp+34)
801676c: b9 e0 08 00 mv r1,r15
8016770: fb ff aa 9e calli 80011e8 <__ashlsi3>
8016774: b8 20 80 00 mv r16,r1
8016778: 34 02 00 08 mvi r2,8
801677c: b9 e0 08 00 mv r1,r15
8016780: f8 00 5b 36 calli 802d458 <__lshrsi3>
8016784: ba 01 08 00 or r1,r16,r1
ret1 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_WTIME_OFFSET,
8016788: 35 83 00 16 addi r3,r12,22
801678c: b9 c0 28 00 mv r5,r14
8016790: 34 04 00 02 mvi r4,2
sec = fat_cluster_num_to_sector_num(&fs_info->fat, fat_fd->dir_pos.sname.cln);
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
/* byte points to start of 32bytes structure */
byte = fat_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1);
time_val = CT_LE_W(time_val);
8016794: 0f 81 00 22 sh (sp+34),r1
ret1 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_WTIME_OFFSET,
8016798: b9 a0 10 00 mv r2,r13
801679c: b9 60 08 00 mv r1,r11
80167a0: fb ff e6 aa calli 8010248 <fat_sector_write>
2, (char *)(&time_val));
date = CT_LE_W(date);
80167a4: 2f 8e 00 20 lhu r14,(sp+32)
sec += (fat_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
/* byte points to start of 32bytes structure */
byte = fat_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1);
time_val = CT_LE_W(time_val);
ret1 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_WTIME_OFFSET,
80167a8: b8 20 78 00 mv r15,r1
80167ac: 34 02 00 08 mvi r2,8
80167b0: b9 c0 08 00 mv r1,r14
80167b4: fb ff aa 8d calli 80011e8 <__ashlsi3>
80167b8: b8 20 80 00 mv r16,r1
80167bc: 34 02 00 08 mvi r2,8
80167c0: b9 c0 08 00 mv r1,r14
80167c4: f8 00 5b 25 calli 802d458 <__lshrsi3>
80167c8: ba 01 10 00 or r2,r16,r1
2, (char *)(&time_val));
date = CT_LE_W(date);
ret2 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_WDATE_OFFSET,
80167cc: 35 83 00 18 addi r3,r12,24
byte = fat_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1);
time_val = CT_LE_W(time_val);
ret1 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_WTIME_OFFSET,
2, (char *)(&time_val));
date = CT_LE_W(date);
80167d0: 0f 82 00 20 sh (sp+32),r2
ret2 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_WDATE_OFFSET,
80167d4: b9 60 08 00 mv r1,r11
80167d8: b9 a0 10 00 mv r2,r13
80167dc: 34 04 00 02 mvi r4,2
80167e0: 37 85 00 20 addi r5,sp,32
80167e4: fb ff e6 99 calli 8010248 <fat_sector_write>
2, (char *)(&date));
ret3 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_ADATE_OFFSET,
80167e8: 35 83 00 12 addi r3,r12,18
80167ec: 34 04 00 02 mvi r4,2
80167f0: 37 85 00 20 addi r5,sp,32
time_val = CT_LE_W(time_val);
ret1 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_WTIME_OFFSET,
2, (char *)(&time_val));
date = CT_LE_W(date);
ret2 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_WDATE_OFFSET,
80167f4: b8 20 70 00 mv r14,r1
2, (char *)(&date));
ret3 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_ADATE_OFFSET,
80167f8: b9 a0 10 00 mv r2,r13
80167fc: b9 60 08 00 mv r1,r11
8016800: fb ff e6 92 calli 8010248 <fat_sector_write>
2, (char *)(&date));
if ( (ret1 < 0) || (ret2 < 0) || (ret3 < 0) )
8016804: 34 02 00 1f mvi r2,31
ret1 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_WTIME_OFFSET,
2, (char *)(&time_val));
date = CT_LE_W(date);
ret2 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_WDATE_OFFSET,
2, (char *)(&date));
ret3 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_ADATE_OFFSET,
8016808: b8 20 58 00 mv r11,r1
2, (char *)(&date));
if ( (ret1 < 0) || (ret2 < 0) || (ret3 < 0) )
801680c: b9 c0 08 00 mv r1,r14
8016810: f8 00 5b 12 calli 802d458 <__lshrsi3>
8016814: b8 20 60 00 mv r12,r1
8016818: 34 02 00 1f mvi r2,31
801681c: b9 e0 08 00 mv r1,r15
8016820: f8 00 5b 0e calli 802d458 <__lshrsi3>
8016824: b9 81 18 00 or r3,r12,r1
8016828: 20 63 00 ff andi r3,r3,0xff
return -1;
801682c: 34 02 ff ff mvi r2,-1
ret2 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_WDATE_OFFSET,
2, (char *)(&date));
ret3 = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_ADATE_OFFSET,
2, (char *)(&date));
if ( (ret1 < 0) || (ret2 < 0) || (ret3 < 0) )
8016830: 5c 60 00 03 bne r3,r0,801683c <msdos_set_dir_wrt_time_and_date+0x144><== NEVER TAKEN
return -1;
8016834: ed 63 10 00 cmpge r2,r11,r3
8016838: 34 42 ff ff addi r2,r2,-1
return RC_OK;
}
801683c: b8 40 08 00 mv r1,r2
8016840: 2b 9d 00 04 lw ra,(sp+4)
8016844: 2b 8b 00 1c lw r11,(sp+28)
8016848: 2b 8c 00 18 lw r12,(sp+24)
801684c: 2b 8d 00 14 lw r13,(sp+20)
8016850: 2b 8e 00 10 lw r14,(sp+16)
8016854: 2b 8f 00 0c lw r15,(sp+12)
8016858: 2b 90 00 08 lw r16,(sp+8)
801685c: 37 9c 00 20 addi sp,sp,32
8016860: c3 a0 00 00 ret
08016a48 <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
)
{
8016a48: 37 9c ff d0 addi sp,sp,-48
8016a4c: 5b 8b 00 24 sw (sp+36),r11
8016a50: 5b 8c 00 20 sw (sp+32),r12
8016a54: 5b 8d 00 1c sw (sp+28),r13
8016a58: 5b 8e 00 18 sw (sp+24),r14
8016a5c: 5b 8f 00 14 sw (sp+20),r15
8016a60: 5b 90 00 10 sw (sp+16),r16
8016a64: 5b 91 00 0c sw (sp+12),r17
8016a68: 5b 92 00 08 sw (sp+8),r18
8016a6c: 5b 9d 00 04 sw (sp+4),ra
8016a70: 33 83 00 28 sb (sp+40),r3
ssize_t ret;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
8016a74: 28 2b 00 08 lw r11,(r1+8)
uint32_t dir_block_size;
fat_pos_t start = dir_pos->lname;
8016a78: 28 41 00 08 lw r1,(r2+8)
8016a7c: 28 4c 00 00 lw r12,(r2+0)
8016a80: 28 50 00 04 lw r16,(r2+4)
8016a84: 5b 81 00 2c sw (sp+44),r1
8016a88: 28 41 00 0c lw r1,(r2+12)
8016a8c: 5b 81 00 30 sw (sp+48),r1
fat_pos_t end = dir_pos->sname;
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
8016a90: 29 61 00 3c lw r1,(r11+60)
8016a94: 5d 81 00 06 bne r12,r1,8016aac <msdos_set_first_char4file_name+0x64><== NEVER TAKEN
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
8016a98: 41 61 00 0e lbu r1,(r11+14)
8016a9c: 20 21 00 03 andi r1,r1,0x3
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) &&
8016aa0: 44 20 00 03 be r1,r0,8016aac <msdos_set_first_char4file_name+0x64><== NEVER TAKEN
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
dir_block_size = fs_info->fat.vol.rdir_size;
8016aa4: 29 6d 00 2c lw r13,(r11+44)
8016aa8: e0 00 00 02 bi 8016ab0 <msdos_set_first_char4file_name+0x68>
else
dir_block_size = fs_info->fat.vol.bpc;
8016aac: 2d 6d 00 06 lhu r13,(r11+6) <== NOT EXECUTED
if (dir_pos->lname.cln == FAT_FILE_SHORT_NAME)
8016ab0: 28 43 00 08 lw r3,(r2+8)
8016ab4: 34 01 ff ff mvi r1,-1
8016ab8: 5c 61 00 05 bne r3,r1,8016acc <msdos_set_first_char4file_name+0x84>
start = dir_pos->sname;
8016abc: 28 41 00 00 lw r1,(r2+0)
8016ac0: 5b 81 00 2c sw (sp+44),r1
8016ac4: 28 41 00 04 lw r1,(r2+4)
8016ac8: 5b 81 00 30 sw (sp+48),r1
uint32_t sec = (fat_cluster_num_to_sector_num(&fs_info->fat, start.cln) +
(start.ofs >> fs_info->fat.vol.sec_log2));
uint32_t byte = (start.ofs & (fs_info->fat.vol.bps - 1));
ret = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_NAME_OFFSET,
1, &fchar);
8016acc: 37 8f 00 28 addi r15,sp,40
{
int rc;
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
break;
rc = fat_get_fat_cluster(&fs_info->fat, start.cln, &start.cln);
8016ad0: 37 8e 00 2c addi r14,sp,44
* name code was written rather than use the fat_file_write
* interface.
*/
while (true)
{
uint32_t sec = (fat_cluster_num_to_sector_num(&fs_info->fat, start.cln) +
8016ad4: 2b 82 00 2c lw r2,(sp+44)
8016ad8: b9 60 08 00 mv r1,r11
8016adc: fb ff fe 5a calli 8016444 <fat_cluster_num_to_sector_num>
(start.ofs >> fs_info->fat.vol.sec_log2));
8016ae0: 2b 91 00 30 lw r17,(sp+48)
8016ae4: 41 62 00 02 lbu r2,(r11+2)
* name code was written rather than use the fat_file_write
* interface.
*/
while (true)
{
uint32_t sec = (fat_cluster_num_to_sector_num(&fs_info->fat, start.cln) +
8016ae8: b8 20 90 00 mv r18,r1
(start.ofs >> fs_info->fat.vol.sec_log2));
8016aec: ba 20 08 00 mv r1,r17
8016af0: f8 00 5a 5a calli 802d458 <__lshrsi3>
uint32_t byte = (start.ofs & (fs_info->fat.vol.bps - 1));
8016af4: 2d 64 00 00 lhu r4,(r11+0)
* name code was written rather than use the fat_file_write
* interface.
*/
while (true)
{
uint32_t sec = (fat_cluster_num_to_sector_num(&fs_info->fat, start.cln) +
8016af8: b6 41 10 00 add r2,r18,r1
(start.ofs >> fs_info->fat.vol.sec_log2));
uint32_t byte = (start.ofs & (fs_info->fat.vol.bps - 1));
ret = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_NAME_OFFSET,
8016afc: b9 e0 28 00 mv r5,r15
*/
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));
8016b00: 34 84 ff ff addi r4,r4,-1
ret = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_NAME_OFFSET,
8016b04: a0 91 18 00 and r3,r4,r17
8016b08: b9 60 08 00 mv r1,r11
8016b0c: 34 04 00 01 mvi r4,1
8016b10: fb ff e5 ce calli 8010248 <fat_sector_write>
1, &fchar);
if (ret < 0)
8016b14: 48 01 00 14 bg r0,r1,8016b64 <msdos_set_first_char4file_name+0x11c><== NEVER TAKEN
return -1;
if ((start.cln == end.cln) && (start.ofs == end.ofs))
8016b18: 2b 82 00 2c lw r2,(sp+44)
8016b1c: 5c 4c 00 03 bne r2,r12,8016b28 <msdos_set_first_char4file_name+0xe0><== NEVER TAKEN
8016b20: 2b 81 00 30 lw r1,(sp+48)
8016b24: 44 30 00 12 be r1,r16,8016b6c <msdos_set_first_char4file_name+0x124>
break;
start.ofs += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
8016b28: 2b 81 00 30 lw r1,(sp+48)
8016b2c: 34 21 00 20 addi r1,r1,32
8016b30: 5b 81 00 30 sw (sp+48),r1
if (start.ofs >= dir_block_size)
8016b34: 55 a1 ff e8 bgu r13,r1,8016ad4 <msdos_set_first_char4file_name+0x8c><== ALWAYS TAKEN
{
int rc;
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
8016b38: 29 61 00 3c lw r1,(r11+60) <== NOT EXECUTED
8016b3c: 5d 81 00 04 bne r12,r1,8016b4c <msdos_set_first_char4file_name+0x104><== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
8016b40: 41 61 00 0e lbu r1,(r11+14) <== NOT EXECUTED
8016b44: 20 21 00 03 andi r1,r1,0x3 <== 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) &&
8016b48: 5c 20 00 09 bne r1,r0,8016b6c <msdos_set_first_char4file_name+0x124><== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
break;
rc = fat_get_fat_cluster(&fs_info->fat, start.cln, &start.cln);
8016b4c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8016b50: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
8016b54: f8 00 06 89 calli 8018578 <fat_get_fat_cluster> <== NOT EXECUTED
if ( rc != RC_OK )
8016b58: 5c 20 00 06 bne r1,r0,8016b70 <msdos_set_first_char4file_name+0x128><== NOT EXECUTED
return rc;
start.ofs = 0;
8016b5c: 5b 80 00 30 sw (sp+48),r0 <== NOT EXECUTED
8016b60: e3 ff ff dd bi 8016ad4 <msdos_set_first_char4file_name+0x8c><== 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;
8016b64: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
8016b68: e0 00 00 02 bi 8016b70 <msdos_set_first_char4file_name+0x128><== NOT EXECUTED
return rc;
start.ofs = 0;
}
}
return RC_OK;
8016b6c: 34 01 00 00 mvi r1,0
}
8016b70: 2b 9d 00 04 lw ra,(sp+4)
8016b74: 2b 8b 00 24 lw r11,(sp+36)
8016b78: 2b 8c 00 20 lw r12,(sp+32)
8016b7c: 2b 8d 00 1c lw r13,(sp+28)
8016b80: 2b 8e 00 18 lw r14,(sp+24)
8016b84: 2b 8f 00 14 lw r15,(sp+20)
8016b88: 2b 90 00 10 lw r16,(sp+16)
8016b8c: 2b 91 00 0c lw r17,(sp+12)
8016b90: 2b 92 00 08 lw r18,(sp+8)
8016b94: 37 9c 00 30 addi sp,sp,48
8016b98: c3 a0 00 00 ret
08009b3c <msdos_set_sectors_per_cluster_from_request>:
static int
msdos_set_sectors_per_cluster_from_request(
const msdos_format_request_param_t *rqdata,
msdos_format_param_t *fmt_params )
{
8009b3c: 37 9c ff f0 addi sp,sp,-16
8009b40: 5b 8b 00 10 sw (sp+16),r11
8009b44: 5b 8c 00 0c sw (sp+12),r12
8009b48: 5b 8d 00 08 sw (sp+8),r13
8009b4c: 5b 9d 00 04 sw (sp+4),ra
8009b50: b8 40 60 00 mv r12,r2
int ret_val = -1;
uint32_t onebit;
if ( rqdata != NULL && rqdata->sectors_per_cluster > 0 ) {
8009b54: 44 20 00 04 be r1,r0,8009b64 <msdos_set_sectors_per_cluster_from_request+0x28>
8009b58: 28 21 00 08 lw r1,(r1+8)
8009b5c: 44 20 00 02 be r1,r0,8009b64 <msdos_set_sectors_per_cluster_from_request+0x28>
fmt_params->sectors_per_cluster = rqdata->sectors_per_cluster;
8009b60: 58 41 00 0c sw (r2+12),r1
static int
msdos_set_sectors_per_cluster_from_request(
const msdos_format_request_param_t *rqdata,
msdos_format_param_t *fmt_params )
{
8009b64: 34 0b 00 80 mvi r11,128
8009b68: 34 0d ff ff mvi r13,-1
* 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 ) {
8009b6c: 29 81 00 0c lw r1,(r12+12)
8009b70: 55 61 00 09 bgu r11,r1,8009b94 <msdos_set_sectors_per_cluster_from_request+0x58>
fmt_params->sectors_per_cluster = onebit;
if ( fmt_params->sectors_per_cluster
<= 32768L / fmt_params->bytes_per_sector ) {
8009b74: 29 82 00 00 lw r2,(r12+0)
* 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 ) {
fmt_params->sectors_per_cluster = onebit;
8009b78: 59 8b 00 0c sw (r12+12),r11
if ( fmt_params->sectors_per_cluster
<= 32768L / fmt_params->bytes_per_sector ) {
8009b7c: 38 01 80 00 mvu r1,0x8000
8009b80: f8 00 8e 86 calli 802d598 <__udivsi3>
* 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
8009b84: 50 2b 00 02 bgeu r1,r11,8009b8c <msdos_set_sectors_per_cluster_from_request+0x50><== ALWAYS TAKEN
8009b88: e0 00 00 03 bi 8009b94 <msdos_set_sectors_per_cluster_from_request+0x58><== NOT EXECUTED
<= 32768L / fmt_params->bytes_per_sector ) {
/* value is small enough so this value is ok */
onebit = 1;
8009b8c: 34 0b 00 01 mvi r11,1
ret_val = 0;
8009b90: 34 0d 00 00 mvi r13,0
* check sectors per cluster.
* must be power of 2
* must be smaller than or equal to 128
* sectors_per_cluster*bytes_per_sector must not be bigger than 32K
*/
for ( onebit = 128; onebit >= 1; onebit = onebit >> 1 ) {
8009b94: b9 60 08 00 mv r1,r11
8009b98: 34 02 00 01 mvi r2,1
8009b9c: f8 00 8e 2f calli 802d458 <__lshrsi3>
8009ba0: b8 20 58 00 mv r11,r1
8009ba4: 5c 20 ff f2 bne r1,r0,8009b6c <msdos_set_sectors_per_cluster_from_request+0x30>
ret_val = 0;
}
}
}
if (ret_val != 0) {
8009ba8: 45 a1 00 04 be r13,r1,8009bb8 <msdos_set_sectors_per_cluster_from_request+0x7c><== ALWAYS TAKEN
errno = EINVAL;
8009bac: f8 00 44 2a calli 801ac54 <__errno> <== NOT EXECUTED
8009bb0: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
8009bb4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
}
return ret_val;
}
8009bb8: b9 a0 08 00 mv r1,r13
8009bbc: 2b 9d 00 04 lw ra,(sp+4)
8009bc0: 2b 8b 00 10 lw r11,(sp+16)
8009bc4: 2b 8c 00 0c lw r12,(sp+12)
8009bc8: 2b 8d 00 08 lw r13,(sp+8)
8009bcc: 37 9c 00 10 addi sp,sp,16
8009bd0: c3 a0 00 00 ret
08018354 <msdos_sync>:
return MSDOS_NAME_NOT_FOUND_ERR;
}
int
msdos_sync(rtems_libio_t *iop)
{
8018354: 37 9c ff f4 addi sp,sp,-12
8018358: 5b 8b 00 0c sw (sp+12),r11
801835c: 5b 8c 00 08 sw (sp+8),r12
8018360: 5b 9d 00 04 sw (sp+4),ra
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
8018364: 28 21 00 20 lw r1,(r1+32)
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
8018368: 34 02 00 00 mvi r2,0
801836c: 34 03 00 00 mvi r3,0
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;
8018370: 28 2b 00 08 lw r11,(r1+8)
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
8018374: 29 61 00 9c lw r1,(r11+156)
8018378: fb ff b5 3f calli 8005874 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
801837c: 44 20 00 06 be r1,r0,8018394 <msdos_sync+0x40> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one(EIO);
8018380: f8 00 0a 35 calli 801ac54 <__errno> <== NOT EXECUTED
8018384: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
8018388: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
801838c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
8018390: e0 00 00 06 bi 80183a8 <msdos_sync+0x54> <== NOT EXECUTED
rc = fat_sync(&fs_info->fat);
8018394: b9 60 08 00 mv r1,r11
8018398: fb ff e2 ed calli 8010f4c <fat_sync>
801839c: b8 20 60 00 mv r12,r1
rtems_semaphore_release(fs_info->vol_sema);
80183a0: 29 61 00 9c lw r1,(r11+156)
80183a4: fb ff b5 84 calli 80059b4 <rtems_semaphore_release>
return rc;
}
80183a8: b9 80 08 00 mv r1,r12
80183ac: 2b 9d 00 04 lw ra,(sp+4)
80183b0: 2b 8b 00 0c lw r11,(sp+12)
80183b4: 2b 8c 00 08 lw r12,(sp+8)
80183b8: 37 9c 00 0c addi sp,sp,12
80183bc: c3 a0 00 00 ret
0800ae78 <msdos_unlock>:
rtems_fatal_error_occurred(0xdeadbeef);
}
}
void msdos_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry)
{
800ae78: 37 9c ff fc addi sp,sp,-4
800ae7c: 5b 9d 00 04 sw (sp+4),ra
msdos_fs_info_t *fs_info = mt_entry->fs_info;
rtems_status_code sc = rtems_semaphore_release(fs_info->vol_sema);
800ae80: 28 21 00 08 lw r1,(r1+8)
800ae84: 28 21 00 9c lw r1,(r1+156)
800ae88: fb ff ea cb calli 80059b4 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL) {
800ae8c: 44 20 00 05 be r1,r0,800aea0 <msdos_unlock+0x28> <== ALWAYS TAKEN
rtems_fatal_error_occurred(0xdeadbeef);
800ae90: 78 02 08 02 mvhi r2,0x802 <== NOT EXECUTED
800ae94: 38 42 e0 2c ori r2,r2,0xe02c <== NOT EXECUTED
800ae98: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED
800ae9c: fb ff eb e8 calli 8005e3c <rtems_fatal_error_occurred> <== NOT EXECUTED
}
}
800aea0: 2b 9d 00 04 lw ra,(sp+4)
800aea4: 37 9c 00 04 addi sp,sp,4
800aea8: c3 a0 00 00 ret
08003738 <newlib_delete_hook>:
void newlib_delete_hook(
rtems_tcb *current_task,
rtems_tcb *deleted_task
)
{
8003738: 37 9c ff f0 addi sp,sp,-16
800373c: 5b 8b 00 10 sw (sp+16),r11
8003740: 5b 8c 00 0c sw (sp+12),r12
8003744: 5b 8d 00 08 sw (sp+8),r13
8003748: 5b 9d 00 04 sw (sp+4),ra
800374c: b8 20 68 00 mv r13,r1
8003750: b8 40 60 00 mv r12,r2
/*
* The reentrancy structure was allocated by newlib using malloc()
*/
if (current_task == deleted_task) {
8003754: 5c 22 00 05 bne r1,r2,8003768 <newlib_delete_hook+0x30>
ptr = _REENT;
8003758: 78 02 08 01 mvhi r2,0x801
800375c: 38 42 a2 30 ori r2,r2,0xa230
8003760: 28 4b 00 00 lw r11,(r2+0)
8003764: e0 00 00 02 bi 800376c <newlib_delete_hook+0x34>
} else {
ptr = deleted_task->libc_reent;
8003768: 28 4b 01 14 lw r11,(r2+276)
}
if (ptr && ptr != _global_impure_ptr) {
800376c: 45 60 00 0b be r11,r0,8003798 <newlib_delete_hook+0x60> <== NEVER TAKEN
8003770: 78 02 08 01 mvhi r2,0x801
8003774: 38 42 91 4c ori r2,r2,0x914c
8003778: 28 41 00 00 lw r1,(r2+0)
800377c: 45 61 00 07 be r11,r1,8003798 <newlib_delete_hook+0x60>
_reclaim_reent(ptr);
*/
/*
* Just in case there are some buffers lying around.
*/
_fwalk(ptr, newlib_free_buffers);
8003780: 78 02 08 00 mvhi r2,0x800
8003784: b9 60 08 00 mv r1,r11
8003788: 38 42 35 14 ori r2,r2,0x3514
800378c: f8 00 3b ba calli 8012674 <_fwalk>
#if REENT_MALLOCED
free(ptr);
#else
_Workspace_Free(ptr);
8003790: b9 60 08 00 mv r1,r11
8003794: f8 00 15 3b calli 8008c80 <_Workspace_Free>
#endif
}
deleted_task->libc_reent = NULL;
8003798: 59 80 01 14 sw (r12+276),r0
/*
* Require the switch back to another task to install its own
*/
if ( current_task == deleted_task ) {
800379c: 5d ac 00 04 bne r13,r12,80037ac <newlib_delete_hook+0x74>
_REENT = 0;
80037a0: 78 01 08 01 mvhi r1,0x801
80037a4: 38 21 a2 30 ori r1,r1,0xa230
80037a8: 58 20 00 00 sw (r1+0),r0
}
}
80037ac: 2b 9d 00 04 lw ra,(sp+4)
80037b0: 2b 8b 00 10 lw r11,(sp+16)
80037b4: 2b 8c 00 0c lw r12,(sp+12)
80037b8: 2b 8d 00 08 lw r13,(sp+8)
80037bc: 37 9c 00 10 addi sp,sp,16
80037c0: c3 a0 00 00 ret
08003514 <newlib_free_buffers>:
* task.
*/
int newlib_free_buffers(
FILE *fp
)
{
8003514: 37 9c ff f8 addi sp,sp,-8
8003518: 5b 8b 00 08 sw (sp+8),r11
800351c: 5b 9d 00 04 sw (sp+4),ra
8003520: b8 20 58 00 mv r11,r1
switch ( fileno(fp) ) {
8003524: f8 00 3b 0e calli 801215c <fileno>
8003528: 34 02 00 02 mvi r2,2
800352c: 54 22 00 0c bgu r1,r2,800355c <newlib_free_buffers+0x48> <== NEVER TAKEN
case 0:
case 1:
case 2:
if (fp->_flags & __SMBF) {
8003530: 2d 61 00 0c lhu r1,(r11+12)
8003534: 20 21 00 80 andi r1,r1,0x80
8003538: 44 20 00 0b be r1,r0,8003564 <newlib_free_buffers+0x50> <== ALWAYS TAKEN
free( fp->_bf._base );
800353c: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED
8003540: fb ff fc f4 calli 8002910 <free> <== NOT EXECUTED
fp->_flags &= ~__SMBF;
8003544: 2d 61 00 0c lhu r1,(r11+12) <== NOT EXECUTED
fp->_bf._base = fp->_p = (unsigned char *) NULL;
8003548: 59 60 00 00 sw (r11+0),r0 <== NOT EXECUTED
800354c: 59 60 00 10 sw (r11+16),r0 <== NOT EXECUTED
case 0:
case 1:
case 2:
if (fp->_flags & __SMBF) {
free( fp->_bf._base );
fp->_flags &= ~__SMBF;
8003550: 20 21 ff 7f andi r1,r1,0xff7f <== NOT EXECUTED
8003554: 0d 61 00 0c sh (r11+12),r1 <== NOT EXECUTED
8003558: e0 00 00 03 bi 8003564 <newlib_free_buffers+0x50> <== NOT EXECUTED
fp->_bf._base = fp->_p = (unsigned char *) NULL;
}
break;
default:
fclose(fp);
800355c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8003560: f8 00 3a 33 calli 8011e2c <fclose> <== NOT EXECUTED
}
return 0;
}
8003564: 34 01 00 00 mvi r1,0
8003568: 2b 9d 00 04 lw ra,(sp+4)
800356c: 2b 8b 00 08 lw r11,(sp+8)
8003570: 37 9c 00 08 addi sp,sp,8
8003574: c3 a0 00 00 ret
080012d8 <notify>:
void
notify (s)
char *s;
{
80012d8: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
80012dc: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
80012e0: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
printf ("%s test appears to be inconsistent...\n", s);
80012e4: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED
80012e8: 38 21 9b 94 ori r1,r1,0x9b94 <== NOT EXECUTED
80012ec: f8 00 73 ca calli 801e214 <printf> <== NOT EXECUTED
printf (" PLEASE NOTIFY KARPINKSI!\n");
80012f0: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED
80012f4: 38 21 9b bc ori r1,r1,0x9bbc <== NOT EXECUTED
80012f8: f8 00 74 25 calli 801e38c <puts> <== NOT EXECUTED
}
80012fc: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8001300: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
8001304: c3 a0 00 00 ret <== NOT EXECUTED
08004914 <null_op_fsmount_me>:
rtems_filesystem_mount_table_entry_t *mt_entry,
const void *data
)
{
return -1;
}
8004914: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
8004918: c3 a0 00 00 ret <== NOT EXECUTED
08004924 <null_op_fsunmount_me>:
static void null_op_fsunmount_me(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
/* Do nothing */
}
8004924: c3 a0 00 00 ret <== NOT EXECUTED
080048ec <null_op_link>:
const char *name,
size_t namelen
)
{
return -1;
}
80048ec: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
80048f0: c3 a0 00 00 ret <== NOT EXECUTED
0800490c <null_op_mount>:
static int null_op_mount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
return -1;
}
800490c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
8004910: c3 a0 00 00 ret <== NOT EXECUTED
08004938 <null_op_readlink>:
char *buf,
size_t bufsize
)
{
return -1;
}
8004938: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
800493c: c3 a0 00 00 ret <== NOT EXECUTED
08004940 <null_op_rename>:
const char *name,
size_t namelen
)
{
return -1;
}
8004940: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
8004944: c3 a0 00 00 ret <== NOT EXECUTED
080048e4 <null_op_rmnod>:
const rtems_filesystem_location_info_t *parentloc,
const rtems_filesystem_location_info_t *loc
)
{
return -1;
}
80048e4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
80048e8: c3 a0 00 00 ret <== NOT EXECUTED
08004b94 <oproc>:
/*
* Handle output processing
*/
static void
oproc (unsigned char c, struct rtems_termios_tty *tty)
{
8004b94: 37 9c ff f4 addi sp,sp,-12
8004b98: 5b 8b 00 08 sw (sp+8),r11
8004b9c: 5b 9d 00 04 sw (sp+4),ra
8004ba0: 33 81 00 0c sb (sp+12),r1
int i;
if (tty->termios.c_oflag & OPOST) {
8004ba4: 28 41 00 34 lw r1,(r2+52)
/*
* Handle output processing
*/
static void
oproc (unsigned char c, struct rtems_termios_tty *tty)
{
8004ba8: b8 40 58 00 mv r11,r2
int i;
if (tty->termios.c_oflag & OPOST) {
8004bac: 20 22 00 01 andi r2,r1,0x1
8004bb0: 44 40 00 4d be r2,r0,8004ce4 <oproc+0x150> <== NEVER TAKEN
switch (c) {
8004bb4: 43 82 00 0c lbu r2,(sp+12)
8004bb8: 34 03 00 09 mvi r3,9
8004bbc: 44 43 00 21 be r2,r3,8004c40 <oproc+0xac>
8004bc0: 54 43 00 04 bgu r2,r3,8004bd0 <oproc+0x3c> <== ALWAYS TAKEN
8004bc4: 34 03 00 08 mvi r3,8 <== NOT EXECUTED
8004bc8: 5c 43 00 30 bne r2,r3,8004c88 <oproc+0xf4> <== NOT EXECUTED
8004bcc: e0 00 00 2b bi 8004c78 <oproc+0xe4> <== NOT EXECUTED
8004bd0: 34 03 00 0a mvi r3,10
8004bd4: 44 43 00 04 be r2,r3,8004be4 <oproc+0x50>
8004bd8: 34 03 00 0d mvi r3,13
8004bdc: 5c 43 00 2b bne r2,r3,8004c88 <oproc+0xf4> <== ALWAYS TAKEN
8004be0: e0 00 00 0c bi 8004c10 <oproc+0x7c> <== NOT EXECUTED
case '\n':
if (tty->termios.c_oflag & ONLRET)
8004be4: 20 22 00 20 andi r2,r1,0x20
8004be8: 44 40 00 02 be r2,r0,8004bf0 <oproc+0x5c> <== ALWAYS TAKEN
tty->column = 0;
8004bec: 59 60 00 28 sw (r11+40),r0 <== NOT EXECUTED
if (tty->termios.c_oflag & ONLCR) {
8004bf0: 20 21 00 04 andi r1,r1,0x4
8004bf4: 44 20 00 3c be r1,r0,8004ce4 <oproc+0x150> <== NEVER TAKEN
rtems_termios_puts ("\r", 1, tty);
8004bf8: 78 01 08 02 mvhi r1,0x802
8004bfc: 38 21 54 68 ori r1,r1,0x5468
8004c00: 34 02 00 01 mvi r2,1
8004c04: b9 60 18 00 mv r3,r11
8004c08: fb ff ff 90 calli 8004a48 <rtems_termios_puts>
8004c0c: e0 00 00 0b bi 8004c38 <oproc+0xa4>
tty->column = 0;
}
break;
case '\r':
if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0))
8004c10: 20 22 00 10 andi r2,r1,0x10 <== NOT EXECUTED
8004c14: 44 40 00 03 be r2,r0,8004c20 <oproc+0x8c> <== NOT EXECUTED
8004c18: 29 62 00 28 lw r2,(r11+40) <== NOT EXECUTED
8004c1c: 44 40 00 36 be r2,r0,8004cf4 <oproc+0x160> <== NOT EXECUTED
return;
if (tty->termios.c_oflag & OCRNL) {
8004c20: 20 22 00 08 andi r2,r1,0x8 <== NOT EXECUTED
8004c24: 44 40 00 05 be r2,r0,8004c38 <oproc+0xa4> <== NOT EXECUTED
c = '\n';
8004c28: 34 02 00 0a mvi r2,10 <== NOT EXECUTED
8004c2c: 33 82 00 0c sb (sp+12),r2 <== NOT EXECUTED
if (tty->termios.c_oflag & ONLRET)
8004c30: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED
8004c34: 44 20 00 2c be r1,r0,8004ce4 <oproc+0x150> <== NOT EXECUTED
tty->column = 0;
break;
}
tty->column = 0;
8004c38: 59 60 00 28 sw (r11+40),r0
break;
8004c3c: e0 00 00 2a bi 8004ce4 <oproc+0x150>
case '\t':
i = 8 - (tty->column & 7);
8004c40: 29 63 00 28 lw r3,(r11+40)
8004c44: 34 04 00 08 mvi r4,8
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
8004c48: 20 21 18 00 andi r1,r1,0x1800
}
tty->column = 0;
break;
case '\t':
i = 8 - (tty->column & 7);
8004c4c: 20 62 00 07 andi r2,r3,0x7
8004c50: c8 82 10 00 sub r2,r4,r2
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
8004c54: 34 04 18 00 mvi r4,6144
8004c58: b4 43 18 00 add r3,r2,r3
8004c5c: 5c 24 00 05 bne r1,r4,8004c70 <oproc+0xdc> <== NEVER TAKEN
tty->column += i;
rtems_termios_puts ( " ", i, tty);
8004c60: 78 01 08 02 mvhi r1,0x802
break;
case '\t':
i = 8 - (tty->column & 7);
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
tty->column += i;
8004c64: 59 63 00 28 sw (r11+40),r3
rtems_termios_puts ( " ", i, tty);
8004c68: 38 21 54 6c ori r1,r1,0x546c
8004c6c: e0 00 00 20 bi 8004cec <oproc+0x158>
return;
}
tty->column += i;
8004c70: 59 63 00 28 sw (r11+40),r3 <== NOT EXECUTED
break;
8004c74: e0 00 00 1c bi 8004ce4 <oproc+0x150> <== NOT EXECUTED
case '\b':
if (tty->column > 0)
8004c78: 29 61 00 28 lw r1,(r11+40) <== NOT EXECUTED
8004c7c: 4c 01 00 1a bge r0,r1,8004ce4 <oproc+0x150> <== NOT EXECUTED
tty->column--;
8004c80: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED
8004c84: e0 00 00 17 bi 8004ce0 <oproc+0x14c> <== NOT EXECUTED
break;
default:
if (tty->termios.c_oflag & OLCUC)
8004c88: 20 21 00 02 andi r1,r1,0x2
8004c8c: 44 20 00 0b be r1,r0,8004cb8 <oproc+0x124> <== ALWAYS TAKEN
c = toupper(c);
8004c90: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED
8004c94: 38 21 82 e0 ori r1,r1,0x82e0 <== NOT EXECUTED
8004c98: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
8004c9c: b4 22 08 00 add r1,r1,r2 <== NOT EXECUTED
8004ca0: 40 23 00 01 lbu r3,(r1+1) <== NOT EXECUTED
8004ca4: 34 01 00 02 mvi r1,2 <== NOT EXECUTED
8004ca8: 20 63 00 03 andi r3,r3,0x3 <== NOT EXECUTED
8004cac: 5c 61 00 02 bne r3,r1,8004cb4 <oproc+0x120> <== NOT EXECUTED
8004cb0: 34 42 ff e0 addi r2,r2,-32 <== NOT EXECUTED
8004cb4: 33 82 00 0c sb (sp+12),r2 <== NOT EXECUTED
if (!iscntrl(c))
8004cb8: 78 01 08 02 mvhi r1,0x802
8004cbc: 38 21 82 e0 ori r1,r1,0x82e0
8004cc0: 43 82 00 0c lbu r2,(sp+12)
8004cc4: 28 21 00 00 lw r1,(r1+0)
8004cc8: b4 22 08 00 add r1,r1,r2
8004ccc: 40 21 00 01 lbu r1,(r1+1)
8004cd0: 20 21 00 20 andi r1,r1,0x20
8004cd4: 5c 20 00 04 bne r1,r0,8004ce4 <oproc+0x150> <== NEVER TAKEN
tty->column++;
8004cd8: 29 61 00 28 lw r1,(r11+40)
8004cdc: 34 21 00 01 addi r1,r1,1
8004ce0: 59 61 00 28 sw (r11+40),r1
break;
}
}
rtems_termios_puts (&c, 1, tty);
8004ce4: 37 81 00 0c addi r1,sp,12
8004ce8: 34 02 00 01 mvi r2,1
8004cec: b9 60 18 00 mv r3,r11
8004cf0: fb ff ff 56 calli 8004a48 <rtems_termios_puts>
}
8004cf4: 2b 9d 00 04 lw ra,(sp+4)
8004cf8: 2b 8b 00 08 lw r11,(sp+8)
8004cfc: 37 9c 00 0c addi sp,sp,12
8004d00: c3 a0 00 00 ret
08002efc <partition_free>:
* RETURNS:
* N/A
*/
static void
partition_free(rtems_part_desc_t *part_desc)
{
8002efc: 37 9c ff f0 addi sp,sp,-16
8002f00: 5b 8b 00 10 sw (sp+16),r11
8002f04: 5b 8c 00 0c sw (sp+12),r12
8002f08: 5b 8d 00 08 sw (sp+8),r13
8002f0c: 5b 9d 00 04 sw (sp+4),ra
8002f10: b8 20 58 00 mv r11,r1
int part_num;
if (part_desc == NULL)
8002f14: 44 20 00 0f be r1,r0,8002f50 <partition_free+0x54>
return;
if (is_extended(part_desc->sys_type))
8002f18: 40 21 00 01 lbu r1,(r1+1)
* true if partition type is extended, false otherwise
*/
static bool
is_extended(uint8_t type)
{
return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED));
8002f1c: 64 22 00 85 cmpei r2,r1,133
8002f20: 64 21 00 05 cmpei r1,r1,5
8002f24: b8 41 08 00 or r1,r2,r1
int part_num;
if (part_desc == NULL)
return;
if (is_extended(part_desc->sys_type))
8002f28: 44 20 00 08 be r1,r0,8002f48 <partition_free+0x4c> <== ALWAYS TAKEN
8002f2c: b9 60 68 00 mv r13,r11 <== NOT EXECUTED
8002f30: 34 0c 00 04 mvi r12,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]);
8002f34: 29 a1 00 18 lw r1,(r13+24) <== NOT EXECUTED
8002f38: 35 8c ff ff addi r12,r12,-1 <== NOT EXECUTED
8002f3c: 35 ad 00 04 addi r13,r13,4 <== NOT EXECUTED
8002f40: fb ff ff ef calli 8002efc <partition_free> <== NOT EXECUTED
if (part_desc == NULL)
return;
if (is_extended(part_desc->sys_type))
{
for (part_num = 0;
8002f44: 5d 80 ff fc bne r12,r0,8002f34 <partition_free+0x38> <== NOT EXECUTED
{
partition_free(part_desc->sub_part[part_num]);
}
}
free(part_desc);
8002f48: b9 60 08 00 mv r1,r11
8002f4c: f8 00 04 13 calli 8003f98 <free>
}
8002f50: 2b 9d 00 04 lw ra,(sp+4)
8002f54: 2b 8b 00 10 lw r11,(sp+16)
8002f58: 2b 8c 00 0c lw r12,(sp+12)
8002f5c: 2b 8d 00 08 lw r13,(sp+8)
8002f60: 37 9c 00 10 addi sp,sp,16
8002f64: c3 a0 00 00 ret
08003344 <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)
{
8003344: 37 9c ff 88 addi sp,sp,-120
8003348: 5b 8b 00 28 sw (sp+40),r11
800334c: 5b 8c 00 24 sw (sp+36),r12
8003350: 5b 8d 00 20 sw (sp+32),r13
8003354: 5b 8e 00 1c sw (sp+28),r14
8003358: 5b 8f 00 18 sw (sp+24),r15
800335c: 5b 90 00 14 sw (sp+20),r16
8003360: 5b 91 00 10 sw (sp+16),r17
8003364: 5b 92 00 0c sw (sp+12),r18
8003368: 5b 93 00 08 sw (sp+8),r19
800336c: 5b 9d 00 04 sw (sp+4),ra
8003370: b8 40 58 00 mv r11,r2
struct stat dev_stat;
rtems_status_code rc;
int fd;
fd = open(dev_name, O_RDONLY);
8003374: 34 02 00 00 mvi r2,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)
{
8003378: b8 20 78 00 mv r15,r1
struct stat dev_stat;
rtems_status_code rc;
int fd;
fd = open(dev_name, O_RDONLY);
800337c: f8 00 07 32 calli 8005044 <open>
8003380: b8 20 68 00 mv r13,r1
if (fd < 0)
{
return RTEMS_INTERNAL_ERROR;
8003384: 34 0c 00 19 mvi r12,25
struct stat dev_stat;
rtems_status_code rc;
int fd;
fd = open(dev_name, O_RDONLY);
if (fd < 0)
8003388: 48 01 00 5f bg r0,r1,8003504 <partition_table_get+0x1c0> <== NEVER TAKEN
{
return RTEMS_INTERNAL_ERROR;
}
rc = fstat(fd, &dev_stat);
800338c: 37 82 00 2c addi r2,sp,44
8003390: f8 00 03 30 calli 8004050 <fstat>
8003394: b8 20 70 00 mv r14,r1
if (rc != RTEMS_SUCCESSFUL)
8003398: 5c 20 00 59 bne r1,r0,80034fc <partition_table_get+0x1b8> <== NEVER TAKEN
{
close(fd);
return RTEMS_INTERNAL_ERROR;
}
strncpy (disk_desc->dev_name, dev_name, 15);
800339c: b9 e0 10 00 mv r2,r15
80033a0: 34 03 00 0f mvi r3,15
80033a4: 35 61 00 08 addi r1,r11,8
80033a8: f8 00 46 fc calli 8014f98 <strncpy>
disk_desc->dev = dev_stat.st_rdev;
80033ac: 2b 81 00 44 lw r1,(sp+68)
disk_desc->sector_size = (dev_stat.st_blksize) ? dev_stat.st_blksize :
80033b0: 2b 83 00 68 lw r3,(sp+104)
80033b4: 34 02 02 00 mvi r2,512
close(fd);
return RTEMS_INTERNAL_ERROR;
}
strncpy (disk_desc->dev_name, dev_name, 15);
disk_desc->dev = dev_stat.st_rdev;
80033b8: 59 61 00 00 sw (r11+0),r1
80033bc: 2b 81 00 48 lw r1,(sp+72)
80033c0: 59 61 00 04 sw (r11+4),r1
disk_desc->sector_size = (dev_stat.st_blksize) ? dev_stat.st_blksize :
80033c4: 44 6e 00 02 be r3,r14,80033cc <partition_table_get+0x88> <== ALWAYS TAKEN
80033c8: b8 60 10 00 mv r2,r3 <== NOT EXECUTED
80033cc: 59 62 00 18 sw (r11+24),r2
rtems_part_desc_t *part_desc;
uint8_t *data;
rtems_status_code rc;
/* get MBR sector */
rc = get_sector(fd, 0, §or);
80033d0: b9 a0 08 00 mv r1,r13
80033d4: 34 02 00 00 mvi r2,0
80033d8: 37 83 00 78 addi r3,sp,120
*/
static rtems_status_code
read_mbr(int fd, rtems_disk_desc_t *disk_desc)
{
int part_num;
rtems_sector_data_t *sector = NULL;
80033dc: 5b 80 00 78 sw (sp+120),r0
rtems_part_desc_t *part_desc;
uint8_t *data;
rtems_status_code rc;
/* get MBR sector */
rc = get_sector(fd, 0, §or);
80033e0: fb ff fe f7 calli 8002fbc <get_sector>
80033e4: b8 20 60 00 mv r12,r1
80033e8: 2b 82 00 78 lw r2,(sp+120)
if (rc != RTEMS_SUCCESSFUL)
80033ec: 44 20 00 04 be r1,r0,80033fc <partition_table_get+0xb8> <== ALWAYS TAKEN
{
if (sector)
free(sector);
80033f0: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
/* get MBR sector */
rc = get_sector(fd, 0, §or);
if (rc != RTEMS_SUCCESSFUL)
{
if (sector)
80033f4: 5c 40 00 19 bne r2,r0,8003458 <partition_table_get+0x114> <== NOT EXECUTED
80033f8: e0 00 00 41 bi 80034fc <partition_table_get+0x1b8> <== 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) &&
80033fc: 40 44 02 02 lbu r4,(r2+514)
8003400: 34 03 00 55 mvi r3,85
8003404: 34 01 00 00 mvi r1,0
8003408: 5c 83 00 03 bne r4,r3,8003414 <partition_table_get+0xd0> <== NEVER TAKEN
* 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)
800340c: 40 41 02 03 lbu r1,(r2+515)
8003410: 64 21 00 aa cmpei r1,r1,170
free(sector);
return rc;
}
/* check if the partition table structure is MS-DOS style */
if (!msdos_signature_check(sector))
8003414: 5c 20 00 05 bne r1,r0,8003428 <partition_table_get+0xe4> <== ALWAYS TAKEN
{
free(sector);
8003418: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
800341c: f8 00 02 df calli 8003f98 <free> <== NOT EXECUTED
return RTEMS_INTERNAL_ERROR;
8003420: 34 0c 00 19 mvi r12,25 <== NOT EXECUTED
8003424: e0 00 00 36 bi 80034fc <partition_table_get+0x1b8> <== NOT EXECUTED
}
/* read and process 4 primary partition descriptors */
data = sector->data + RTEMS_IDE_PARTITION_TABLE_OFFSET;
8003428: 34 51 01 c2 addi r17,r2,450
800342c: b9 60 70 00 mv r14,r11
8003430: b9 60 80 00 mv r16,r11
8003434: 34 0f 00 01 mvi r15,1
for (part_num = 0;
part_num < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
part_num++)
{
rc = data_to_part_desc(data, &part_desc);
8003438: 37 93 00 74 addi r19,sp,116
/* read and process 4 primary partition descriptors */
data = sector->data + RTEMS_IDE_PARTITION_TABLE_OFFSET;
for (part_num = 0;
800343c: 34 12 00 05 mvi r18,5
part_num < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
part_num++)
{
rc = data_to_part_desc(data, &part_desc);
8003440: ba 20 08 00 mv r1,r17
8003444: ba 60 10 00 mv r2,r19
8003448: fb ff ff 0c calli 8003078 <data_to_part_desc>
800344c: b8 20 60 00 mv r12,r1
if (rc != RTEMS_SUCCESSFUL)
8003450: 44 20 00 04 be r1,r0,8003460 <partition_table_get+0x11c> <== ALWAYS TAKEN
{
free(sector);
8003454: 2b 81 00 78 lw r1,(sp+120) <== NOT EXECUTED
8003458: f8 00 02 d0 calli 8003f98 <free> <== NOT EXECUTED
800345c: e0 00 00 28 bi 80034fc <partition_table_get+0x1b8> <== NOT EXECUTED
return rc;
}
if (part_desc != NULL)
8003460: 2b 83 00 74 lw r3,(sp+116)
8003464: 44 61 00 0a be r3,r1,800348c <partition_table_get+0x148> <== NEVER TAKEN
{
part_desc->log_id = part_num + 1;
part_desc->disk_desc = disk_desc;
part_desc->end = part_desc->start + part_desc->size - 1;
8003468: 28 62 00 04 lw r2,(r3+4)
800346c: 28 61 00 08 lw r1,(r3+8)
return rc;
}
if (part_desc != NULL)
{
part_desc->log_id = part_num + 1;
8003470: 30 6f 00 02 sb (r3+2),r15
part_desc->disk_desc = disk_desc;
8003474: 58 6b 00 10 sw (r3+16),r11
part_desc->end = part_desc->start + part_desc->size - 1;
8003478: b4 41 08 00 add r1,r2,r1
800347c: 34 21 ff ff addi r1,r1,-1
8003480: 58 61 00 0c sw (r3+12),r1
disk_desc->partitions[part_num] = part_desc;
8003484: 5a 03 00 28 sw (r16+40),r3
8003488: e0 00 00 02 bi 8003490 <partition_table_get+0x14c>
}
else
{
disk_desc->partitions[part_num] = NULL;
800348c: 5a 00 00 28 sw (r16+40),r0 <== NOT EXECUTED
8003490: 35 ef 00 01 addi r15,r15,1
8003494: 36 10 00 04 addi r16,r16,4
/* read and process 4 primary partition descriptors */
data = sector->data + RTEMS_IDE_PARTITION_TABLE_OFFSET;
for (part_num = 0;
8003498: 45 f2 00 03 be r15,r18,80034a4 <partition_table_get+0x160>
else
{
disk_desc->partitions[part_num] = NULL;
}
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
800349c: 36 31 00 10 addi r17,r17,16
80034a0: e3 ff ff e8 bi 8003440 <partition_table_get+0xfc>
}
free(sector);
80034a4: 2b 81 00 78 lw r1,(sp+120)
80034a8: f8 00 02 bc calli 8003f98 <free>
disk_desc->last_log_id = RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
80034ac: 34 01 00 04 mvi r1,4
80034b0: 59 61 00 24 sw (r11+36),r1
80034b4: 34 0b 00 04 mvi r11,4
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];
80034b8: 29 c3 00 28 lw r3,(r14+40)
80034bc: 5b 83 00 74 sw (sp+116),r3
if (part_desc != NULL && is_extended(part_desc->sys_type))
80034c0: 44 60 00 0c be r3,r0,80034f0 <partition_table_get+0x1ac> <== NEVER TAKEN
80034c4: 40 61 00 01 lbu r1,(r3+1)
* true if partition type is extended, false otherwise
*/
static bool
is_extended(uint8_t type)
{
return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED));
80034c8: 64 22 00 85 cmpei r2,r1,133
80034cc: 64 21 00 05 cmpei r1,r1,5
80034d0: b8 41 08 00 or r1,r2,r1
for (part_num = 0;
part_num < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
part_num++)
{
part_desc = disk_desc->partitions[part_num];
if (part_desc != NULL && is_extended(part_desc->sys_type))
80034d4: 44 20 00 07 be r1,r0,80034f0 <partition_table_get+0x1ac>
{
read_extended_partition(fd, part_desc->start, part_desc);
80034d8: 28 62 00 04 lw r2,(r3+4)
80034dc: b9 a0 08 00 mv r1,r13
80034e0: fb ff ff 2d calli 8003194 <read_extended_partition>
free(part_desc);
80034e4: 2b 81 00 74 lw r1,(sp+116)
80034e8: f8 00 02 ac calli 8003f98 <free>
disk_desc->partitions[part_num] = NULL;
80034ec: 59 c0 00 28 sw (r14+40),r0
80034f0: 35 6b ff ff addi r11,r11,-1
80034f4: 35 ce 00 04 addi r14,r14,4
disk_desc->last_log_id = RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
/* There cannot be more than one extended partition,
but we are to process each primary partition */
for (part_num = 0;
80034f8: 5d 60 ff f0 bne r11,r0,80034b8 <partition_table_get+0x174>
disk_desc->sector_size = (dev_stat.st_blksize) ? dev_stat.st_blksize :
RTEMS_IDE_SECTOR_SIZE;
rc = read_mbr(fd, disk_desc);
close(fd);
80034fc: b9 a0 08 00 mv r1,r13
8003500: f8 00 02 7b calli 8003eec <close>
return rc;
}
8003504: b9 80 08 00 mv r1,r12
8003508: 2b 9d 00 04 lw ra,(sp+4)
800350c: 2b 8b 00 28 lw r11,(sp+40)
8003510: 2b 8c 00 24 lw r12,(sp+36)
8003514: 2b 8d 00 20 lw r13,(sp+32)
8003518: 2b 8e 00 1c lw r14,(sp+28)
800351c: 2b 8f 00 18 lw r15,(sp+24)
8003520: 2b 90 00 14 lw r16,(sp+20)
8003524: 2b 91 00 10 lw r17,(sp+16)
8003528: 2b 92 00 0c lw r18,(sp+12)
800352c: 2b 93 00 08 lw r19,(sp+8)
8003530: 37 9c 00 78 addi sp,sp,120
8003534: c3 a0 00 00 ret
08002a58 <pathconf>:
*/
long pathconf(
const char *path,
int name
)
{
8002a58: 37 9c ff f0 addi sp,sp,-16
8002a5c: 5b 8b 00 10 sw (sp+16),r11
8002a60: 5b 8c 00 0c sw (sp+12),r12
8002a64: 5b 8d 00 08 sw (sp+8),r13
8002a68: 5b 9d 00 04 sw (sp+4),ra
8002a6c: b8 40 68 00 mv r13,r2
int status;
int fd;
fd = open( path, O_RDONLY );
8002a70: 34 02 00 00 mvi r2,0
8002a74: fb ff ff 60 calli 80027f4 <open>
if ( fd == -1 )
return -1;
8002a78: 34 0b ff ff mvi r11,-1
)
{
int status;
int fd;
fd = open( path, O_RDONLY );
8002a7c: b8 20 60 00 mv r12,r1
if ( fd == -1 )
8002a80: 44 2b 00 06 be r1,r11,8002a98 <pathconf+0x40> <== ALWAYS TAKEN
return -1;
status = fpathconf( fd, name );
8002a84: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
8002a88: f8 00 17 6c calli 8008838 <fpathconf> <== NOT EXECUTED
8002a8c: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
(void) close( fd );
8002a90: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8002a94: f8 00 17 3e calli 800878c <close> <== NOT EXECUTED
return status;
}
8002a98: b9 60 08 00 mv r1,r11
8002a9c: 2b 9d 00 04 lw ra,(sp+4)
8002aa0: 2b 8b 00 10 lw r11,(sp+16)
8002aa4: 2b 8c 00 0c lw r12,(sp+12)
8002aa8: 2b 8d 00 08 lw r13,(sp+8)
8002aac: 37 9c 00 10 addi sp,sp,16
8002ab0: c3 a0 00 00 ret
080093fc <pipe_create>:
static uint16_t rtems_pipe_no = 0;
int pipe_create(
int filsdes[2]
)
{
80093fc: 37 9c ff d8 addi sp,sp,-40
8009400: 5b 8b 00 18 sw (sp+24),r11
8009404: 5b 8c 00 14 sw (sp+20),r12
8009408: 5b 8d 00 10 sw (sp+16),r13
800940c: 5b 8e 00 0c sw (sp+12),r14
8009410: 5b 8f 00 08 sw (sp+8),r15
8009414: 5b 9d 00 04 sw (sp+4),ra
8009418: b8 20 70 00 mv r14,r1
rtems_libio_t *iop;
int err = 0;
if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0)
800941c: 78 01 08 01 mvhi r1,0x801
8009420: 38 21 f0 ac ori r1,r1,0xf0ac
8009424: 34 02 01 ff mvi r2,511
8009428: f8 00 05 b6 calli 800ab00 <rtems_mkdir>
800942c: b8 20 78 00 mv r15,r1
return -1;
8009430: 34 0d ff ff mvi r13,-1
)
{
rtems_libio_t *iop;
int err = 0;
if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0)
8009434: 5c 20 00 43 bne r1,r0,8009540 <pipe_create+0x144>
return -1;
/* /tmp/.fifoXXXX */
char fifopath[15];
memcpy(fifopath, "/tmp/.fifo", 10);
8009438: 78 02 08 01 mvhi r2,0x801
800943c: 38 42 f0 b4 ori r2,r2,0xf0b4
8009440: 28 43 00 00 lw r3,(r2+0)
8009444: 28 41 00 04 lw r1,(r2+4)
8009448: 37 8b 00 1c addi r11,sp,28
800944c: 5b 83 00 1c sw (sp+28),r3
8009450: 59 61 00 04 sw (r11+4),r1
8009454: 2c 41 00 08 lhu r1,(r2+8)
sprintf(fifopath + 10, "%04x", rtems_pipe_no ++);
8009458: 78 02 08 02 mvhi r2,0x802
800945c: 38 42 07 a8 ori r2,r2,0x7a8
8009460: 2c 43 00 00 lhu r3,(r2+0)
if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0)
return -1;
/* /tmp/.fifoXXXX */
char fifopath[15];
memcpy(fifopath, "/tmp/.fifo", 10);
8009464: 0d 61 00 08 sh (r11+8),r1
sprintf(fifopath + 10, "%04x", rtems_pipe_no ++);
8009468: 34 61 00 01 addi r1,r3,1
800946c: 0c 41 00 00 sh (r2+0),r1
8009470: 78 02 08 01 mvhi r2,0x801
8009474: 38 42 f0 c0 ori r2,r2,0xf0c0
8009478: 37 81 00 26 addi r1,sp,38
800947c: f8 00 17 32 calli 800f144 <sprintf>
/* Try creating FIFO file until find an available file name */
while (mkfifo(fifopath, S_IRUSR|S_IWUSR) != 0) {
8009480: b9 60 08 00 mv r1,r11
8009484: 34 02 01 80 mvi r2,384
8009488: f8 00 04 d3 calli 800a7d4 <mkfifo>
800948c: b8 20 60 00 mv r12,r1
8009490: 44 2f 00 03 be r1,r15,800949c <pipe_create+0xa0> <== ALWAYS TAKEN
if (errno != EEXIST){
8009494: f8 00 13 94 calli 800e2e4 <__errno> <== NOT EXECUTED
8009498: e0 00 00 2a bi 8009540 <pipe_create+0x144> <== NOT EXECUTED
return -1;
/* sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); */
}
/* Non-blocking open to avoid waiting for writers */
filsdes[0] = open(fifopath, O_RDONLY | O_NONBLOCK);
800949c: b9 60 08 00 mv r1,r11
80094a0: 34 02 40 00 mvi r2,16384
80094a4: fb ff e5 d4 calli 8002bf4 <open>
80094a8: 59 c1 00 00 sw (r14+0),r1
if (filsdes[0] < 0) {
80094ac: 4c 2c 00 05 bge r1,r12,80094c0 <pipe_create+0xc4>
err = errno;
80094b0: f8 00 13 8d calli 800e2e4 <__errno>
80094b4: 28 2c 00 00 lw r12,(r1+0)
/* 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);
80094b8: b9 60 08 00 mv r1,r11
80094bc: e0 00 00 1b bi 8009528 <pipe_create+0x12c>
}
else {
/* Reset open file to blocking mode */
iop = rtems_libio_iop(filsdes[0]);
80094c0: 78 02 08 02 mvhi r2,0x802
80094c4: 38 42 00 10 ori r2,r2,0x10
80094c8: 28 44 00 00 lw r4,(r2+0)
80094cc: 34 02 00 00 mvi r2,0
80094d0: 50 24 00 07 bgeu r1,r4,80094ec <pipe_create+0xf0> <== NEVER TAKEN
80094d4: 34 02 00 2c mvi r2,44
80094d8: 78 0b 08 02 mvhi r11,0x802
80094dc: f8 00 51 2c calli 801d98c <__mulsi3>
80094e0: 39 6b 08 20 ori r11,r11,0x820
80094e4: 29 62 00 00 lw r2,(r11+0)
80094e8: b4 41 10 00 add r2,r2,r1
iop->flags &= ~LIBIO_FLAGS_NO_DELAY;
80094ec: 28 43 00 08 lw r3,(r2+8)
80094f0: 34 01 ff fe mvi r1,-2
int pipe_create(
int filsdes[2]
)
{
rtems_libio_t *iop;
int err = 0;
80094f4: 34 0c 00 00 mvi r12,0
unlink(fifopath);
}
else {
/* Reset open file to blocking mode */
iop = rtems_libio_iop(filsdes[0]);
iop->flags &= ~LIBIO_FLAGS_NO_DELAY;
80094f8: a0 61 08 00 and r1,r3,r1
80094fc: 58 41 00 08 sw (r2+8),r1
filsdes[1] = open(fifopath, O_WRONLY);
8009500: 37 81 00 1c addi r1,sp,28
8009504: 34 02 00 01 mvi r2,1
8009508: fb ff e5 bb calli 8002bf4 <open>
800950c: 59 c1 00 04 sw (r14+4),r1
if (filsdes[1] < 0) {
8009510: 4c 20 00 05 bge r1,r0,8009524 <pipe_create+0x128>
err = errno;
8009514: f8 00 13 74 calli 800e2e4 <__errno>
8009518: 28 2c 00 00 lw r12,(r1+0)
close(filsdes[0]);
800951c: 29 c1 00 00 lw r1,(r14+0)
8009520: fb ff e1 e0 calli 8001ca0 <close>
}
unlink(fifopath);
8009524: 37 81 00 1c addi r1,sp,28
8009528: fb ff ea 77 calli 8003f04 <unlink>
}
if(err != 0)
rtems_set_errno_and_return_minus_one(err);
return 0;
800952c: 34 0d 00 00 mvi r13,0
err = errno;
close(filsdes[0]);
}
unlink(fifopath);
}
if(err != 0)
8009530: 45 80 00 04 be r12,r0,8009540 <pipe_create+0x144>
rtems_set_errno_and_return_minus_one(err);
8009534: f8 00 13 6c calli 800e2e4 <__errno>
8009538: 58 2c 00 00 sw (r1+0),r12
800953c: 34 0d ff ff mvi r13,-1
return 0;
}
8009540: b9 a0 08 00 mv r1,r13
8009544: 2b 9d 00 04 lw ra,(sp+4)
8009548: 2b 8b 00 18 lw r11,(sp+24)
800954c: 2b 8c 00 14 lw r12,(sp+20)
8009550: 2b 8d 00 10 lw r13,(sp+16)
8009554: 2b 8e 00 0c lw r14,(sp+12)
8009558: 2b 8f 00 08 lw r15,(sp+8)
800955c: 37 9c 00 28 addi sp,sp,40
8009560: c3 a0 00 00 ret
0800ab50 <pipe_ioctl>:
pipe_control_t *pipe,
ioctl_command_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
800ab50: 37 9c ff f4 addi sp,sp,-12
800ab54: 5b 8b 00 0c sw (sp+12),r11
800ab58: 5b 8c 00 08 sw (sp+8),r12
800ab5c: 5b 9d 00 04 sw (sp+4),ra
800ab60: b8 60 60 00 mv r12,r3
if (cmd == FIONREAD) {
800ab64: 78 03 08 02 mvhi r3,0x802
800ab68: 38 63 28 f4 ori r3,r3,0x28f4
pipe_control_t *pipe,
ioctl_command_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
800ab6c: b8 20 58 00 mv r11,r1
if (cmd == FIONREAD) {
800ab70: 28 61 00 00 lw r1,(r3+0)
*(unsigned int *)buffer = pipe->Length;
PIPE_UNLOCK(pipe);
return 0;
}
return -EINVAL;
800ab74: 34 04 ff ea mvi r4,-22
ioctl_command_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
800ab78: 5c 41 00 0e bne r2,r1,800abb0 <pipe_ioctl+0x60>
if (buffer == NULL)
return -EFAULT;
800ab7c: 34 04 ff f2 mvi r4,-14
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
if (buffer == NULL)
800ab80: 45 80 00 0c be r12,r0,800abb0 <pipe_ioctl+0x60>
return -EFAULT;
if (! PIPE_LOCK(pipe))
800ab84: 29 61 00 28 lw r1,(r11+40)
800ab88: 34 02 00 00 mvi r2,0
800ab8c: 34 03 00 00 mvi r3,0
800ab90: fb ff e9 48 calli 80050b0 <rtems_semaphore_obtain>
return -EINTR;
800ab94: 34 04 ff fc mvi r4,-4
{
if (cmd == FIONREAD) {
if (buffer == NULL)
return -EFAULT;
if (! PIPE_LOCK(pipe))
800ab98: 5c 20 00 06 bne r1,r0,800abb0 <pipe_ioctl+0x60> <== NEVER TAKEN
return -EINTR;
/* Return length of pipe */
*(unsigned int *)buffer = pipe->Length;
800ab9c: 29 61 00 0c lw r1,(r11+12)
800aba0: 59 81 00 00 sw (r12+0),r1
PIPE_UNLOCK(pipe);
800aba4: 29 61 00 28 lw r1,(r11+40)
800aba8: fb ff e9 92 calli 80051f0 <rtems_semaphore_release>
return 0;
800abac: 34 04 00 00 mvi r4,0
}
return -EINVAL;
}
800abb0: b8 80 08 00 mv r1,r4
800abb4: 2b 9d 00 04 lw ra,(sp+4)
800abb8: 2b 8b 00 0c lw r11,(sp+12)
800abbc: 2b 8c 00 08 lw r12,(sp+8)
800abc0: 37 9c 00 0c addi sp,sp,12
800abc4: c3 a0 00 00 ret
0800a7a4 <pipe_read>:
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
800a7a4: 37 9c ff d8 addi sp,sp,-40
800a7a8: 5b 8b 00 24 sw (sp+36),r11
800a7ac: 5b 8c 00 20 sw (sp+32),r12
800a7b0: 5b 8d 00 1c sw (sp+28),r13
800a7b4: 5b 8e 00 18 sw (sp+24),r14
800a7b8: 5b 8f 00 14 sw (sp+20),r15
800a7bc: 5b 90 00 10 sw (sp+16),r16
800a7c0: 5b 91 00 0c sw (sp+12),r17
800a7c4: 5b 92 00 08 sw (sp+8),r18
800a7c8: 5b 9d 00 04 sw (sp+4),ra
800a7cc: b8 20 58 00 mv r11,r1
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
800a7d0: 28 21 00 28 lw r1,(r1+40)
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
800a7d4: b8 40 78 00 mv r15,r2
800a7d8: b8 60 80 00 mv r16,r3
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
800a7dc: 34 02 00 00 mvi r2,0
800a7e0: 34 03 00 00 mvi r3,0
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
800a7e4: b8 80 88 00 mv r17,r4
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
800a7e8: fb ff ea 32 calli 80050b0 <rtems_semaphore_obtain>
return -EINTR;
800a7ec: 34 0c ff fc mvi r12,-4
rtems_libio_t *iop
)
{
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
800a7f0: 5c 20 00 4d bne r1,r0,800a924 <pipe_read+0x180> <== NEVER TAKEN
800a7f4: 34 0c 00 00 mvi r12,0
}
/* Wait until pipe is no more empty or no writer exists */
pipe->waitingReaders ++;
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
800a7f8: 34 12 ff fc mvi r18,-4
800a7fc: e0 00 00 3f bi 800a8f8 <pipe_read+0x154>
return -EINTR;
while (read < count) {
while (PIPE_EMPTY(pipe)) {
/* Not an error */
if (pipe->Writers == 0)
800a800: 29 61 00 14 lw r1,(r11+20)
800a804: 44 2d 00 3e be r1,r13,800a8fc <pipe_read+0x158>
goto out_locked;
if (LIBIO_NODELAY(iop)) {
800a808: 2a 2d 00 08 lw r13,(r17+8)
800a80c: 21 ad 00 01 andi r13,r13,0x1
800a810: 5d a0 00 3d bne r13,r0,800a904 <pipe_read+0x160>
ret = -EAGAIN;
goto out_locked;
}
/* Wait until pipe is no more empty or no writer exists */
pipe->waitingReaders ++;
800a814: 29 61 00 18 lw r1,(r11+24)
800a818: 34 21 00 01 addi r1,r1,1
800a81c: 59 61 00 18 sw (r11+24),r1
PIPE_UNLOCK(pipe);
800a820: 29 61 00 28 lw r1,(r11+40)
800a824: fb ff ea 73 calli 80051f0 <rtems_semaphore_release>
if (! PIPE_READWAIT(pipe))
800a828: 29 61 00 2c lw r1,(r11+44)
800a82c: 34 02 00 00 mvi r2,0
800a830: f8 00 06 8b calli 800c25c <rtems_barrier_wait>
800a834: fc 2d 68 00 cmpne r13,r1,r13
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
800a838: 29 61 00 28 lw r1,(r11+40)
}
/* Wait until pipe is no more empty or no writer exists */
pipe->waitingReaders ++;
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
800a83c: c8 0d 68 00 sub r13,r0,r13
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
800a840: 34 02 00 00 mvi r2,0
800a844: 34 03 00 00 mvi r3,0
}
/* Wait until pipe is no more empty or no writer exists */
pipe->waitingReaders ++;
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
800a848: a1 b2 68 00 and r13,r13,r18
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
800a84c: fb ff ea 19 calli 80050b0 <rtems_semaphore_obtain>
800a850: 5c 20 00 31 bne r1,r0,800a914 <pipe_read+0x170> <== NEVER TAKEN
/* WARN waitingReaders not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingReaders --;
800a854: 29 62 00 18 lw r2,(r11+24)
800a858: 34 42 ff ff addi r2,r2,-1
800a85c: 59 62 00 18 sw (r11+24),r2
if (ret != 0)
800a860: 5d a1 00 2a bne r13,r1,800a908 <pipe_read+0x164> <== NEVER TAKEN
if (! PIPE_LOCK(pipe))
return -EINTR;
while (read < count) {
while (PIPE_EMPTY(pipe)) {
800a864: 29 6d 00 0c lw r13,(r11+12)
800a868: 45 a0 ff e6 be r13,r0,800a800 <pipe_read+0x5c>
if (ret != 0)
goto out_locked;
}
/* Read chunk bytes */
chunk = MIN(count - read, pipe->Length);
800a86c: ca 0c 08 00 sub r1,r16,r12
800a870: 50 2d 00 02 bgeu r1,r13,800a878 <pipe_read+0xd4>
800a874: b8 20 68 00 mv r13,r1
chunk1 = pipe->Size - pipe->Start;
800a878: 29 65 00 08 lw r5,(r11+8)
800a87c: 29 6e 00 04 lw r14,(r11+4)
800a880: 29 66 00 00 lw r6,(r11+0)
800a884: b5 ec 08 00 add r1,r15,r12
800a888: c9 c5 70 00 sub r14,r14,r5
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);
800a88c: b4 c5 10 00 add r2,r6,r5
800a890: b9 a0 18 00 mv r3,r13
}
/* Read chunk bytes */
chunk = MIN(count - read, pipe->Length);
chunk1 = pipe->Size - pipe->Start;
if (chunk > chunk1) {
800a894: 4d cd 00 08 bge r14,r13,800a8b4 <pipe_read+0x110>
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1);
800a898: b4 c5 10 00 add r2,r6,r5
800a89c: b9 c0 18 00 mv r3,r14
800a8a0: f8 00 15 af calli 800ff5c <memcpy>
memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1);
800a8a4: 29 62 00 00 lw r2,(r11+0)
800a8a8: b5 8e 08 00 add r1,r12,r14
800a8ac: b5 e1 08 00 add r1,r15,r1
800a8b0: c9 ae 18 00 sub r3,r13,r14
}
else
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk);
800a8b4: f8 00 15 aa calli 800ff5c <memcpy>
pipe->Start += chunk;
800a8b8: 29 61 00 08 lw r1,(r11+8)
pipe->Start %= pipe->Size;
800a8bc: 29 62 00 04 lw r2,(r11+4)
800a8c0: b5 a1 08 00 add r1,r13,r1
800a8c4: f8 00 59 8c calli 8020ef4 <__umodsi3>
800a8c8: 59 61 00 08 sw (r11+8),r1
pipe->Length -= chunk;
800a8cc: 29 61 00 0c lw r1,(r11+12)
800a8d0: c8 2d 08 00 sub r1,r1,r13
800a8d4: 59 61 00 0c sw (r11+12),r1
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
800a8d8: 5c 20 00 02 bne r1,r0,800a8e0 <pipe_read+0x13c>
pipe->Start = 0;
800a8dc: 59 60 00 08 sw (r11+8),r0
if (pipe->waitingWriters > 0)
800a8e0: 29 61 00 1c lw r1,(r11+28)
800a8e4: 44 20 00 04 be r1,r0,800a8f4 <pipe_read+0x150>
PIPE_WAKEUPWRITERS(pipe);
800a8e8: 29 61 00 30 lw r1,(r11+48)
800a8ec: 37 82 00 28 addi r2,sp,40
800a8f0: f8 00 06 3e calli 800c1e8 <rtems_barrier_release>
read += chunk;
800a8f4: b5 8d 60 00 add r12,r12,r13
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
return -EINTR;
while (read < count) {
800a8f8: 56 0c ff db bgu r16,r12,800a864 <pipe_read+0xc0>
while (PIPE_EMPTY(pipe)) {
/* Not an error */
if (pipe->Writers == 0)
800a8fc: 34 0d 00 00 mvi r13,0
800a900: e0 00 00 02 bi 800a908 <pipe_read+0x164>
goto out_locked;
if (LIBIO_NODELAY(iop)) {
ret = -EAGAIN;
800a904: 34 0d ff f5 mvi r13,-11
PIPE_WAKEUPWRITERS(pipe);
read += chunk;
}
out_locked:
PIPE_UNLOCK(pipe);
800a908: 29 61 00 28 lw r1,(r11+40)
800a90c: fb ff ea 39 calli 80051f0 <rtems_semaphore_release>
800a910: e0 00 00 02 bi 800a918 <pipe_read+0x174>
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
/* WARN waitingReaders not restored! */
ret = -EINTR;
800a914: 34 0d ff fc mvi r13,-4 <== NOT EXECUTED
out_locked:
PIPE_UNLOCK(pipe);
out_nolock:
if (read > 0)
800a918: 4c 0c 00 02 bge r0,r12,800a920 <pipe_read+0x17c>
800a91c: e0 00 00 02 bi 800a924 <pipe_read+0x180>
return read;
return ret;
800a920: b9 a0 60 00 mv r12,r13
}
800a924: b9 80 08 00 mv r1,r12
800a928: 2b 9d 00 04 lw ra,(sp+4)
800a92c: 2b 8b 00 24 lw r11,(sp+36)
800a930: 2b 8c 00 20 lw r12,(sp+32)
800a934: 2b 8d 00 1c lw r13,(sp+28)
800a938: 2b 8e 00 18 lw r14,(sp+24)
800a93c: 2b 8f 00 14 lw r15,(sp+20)
800a940: 2b 90 00 10 lw r16,(sp+16)
800a944: 2b 91 00 0c lw r17,(sp+12)
800a948: 2b 92 00 08 lw r18,(sp+8)
800a94c: 37 9c 00 28 addi sp,sp,40
800a950: c3 a0 00 00 ret
0800a2b8 <pipe_release>:
void pipe_release(
pipe_control_t **pipep,
rtems_libio_t *iop
)
{
800a2b8: 37 9c ff ec addi sp,sp,-20
800a2bc: 5b 8b 00 10 sw (sp+16),r11
800a2c0: 5b 8c 00 0c sw (sp+12),r12
800a2c4: 5b 8d 00 08 sw (sp+8),r13
800a2c8: 5b 9d 00 04 sw (sp+4),ra
800a2cc: b8 20 68 00 mv r13,r1
pipe_control_t *pipe = *pipep;
800a2d0: 28 2b 00 00 lw r11,(r1+0)
/* WARN pipe not released! */
if (!PIPE_LOCK(pipe))
rtems_fatal_error_occurred(0xdeadbeef);
#endif
mode = LIBIO_ACCMODE(iop);
800a2d4: 28 41 00 08 lw r1,(r2+8)
800a2d8: 20 2c 00 06 andi r12,r1,0x6
if (mode & LIBIO_FLAGS_READ)
800a2dc: 20 21 00 02 andi r1,r1,0x2
800a2e0: 44 20 00 04 be r1,r0,800a2f0 <pipe_release+0x38>
pipe->Readers --;
800a2e4: 29 61 00 10 lw r1,(r11+16)
800a2e8: 34 21 ff ff addi r1,r1,-1
800a2ec: 59 61 00 10 sw (r11+16),r1
if (mode & LIBIO_FLAGS_WRITE)
800a2f0: 21 81 00 04 andi r1,r12,0x4
800a2f4: 44 20 00 04 be r1,r0,800a304 <pipe_release+0x4c>
pipe->Writers --;
800a2f8: 29 61 00 14 lw r1,(r11+20)
800a2fc: 34 21 ff ff addi r1,r1,-1
800a300: 59 61 00 14 sw (r11+20),r1
PIPE_UNLOCK(pipe);
800a304: 29 61 00 28 lw r1,(r11+40)
800a308: fb ff eb ba calli 80051f0 <rtems_semaphore_release>
if (pipe->Readers == 0 && pipe->Writers == 0) {
800a30c: 29 62 00 10 lw r2,(r11+16)
800a310: 5c 40 00 07 bne r2,r0,800a32c <pipe_release+0x74>
800a314: 29 61 00 14 lw r1,(r11+20)
800a318: 5c 22 00 05 bne r1,r2,800a32c <pipe_release+0x74>
#if 0
/* To delete an anonymous pipe file when all users closed it */
if (pipe->Anonymous)
delfile = TRUE;
#endif
pipe_free(pipe);
800a31c: b9 60 08 00 mv r1,r11
800a320: fb ff ff d4 calli 800a270 <pipe_free>
*pipep = NULL;
800a324: 59 a0 00 00 sw (r13+0),r0
800a328: e0 00 00 0f bi 800a364 <pipe_release+0xac>
}
else if (pipe->Readers == 0 && mode != LIBIO_FLAGS_WRITE)
800a32c: 7d 81 00 04 cmpnei r1,r12,4
800a330: 64 42 00 00 cmpei r2,r2,0
800a334: a0 22 10 00 and r2,r1,r2
800a338: 44 40 00 03 be r2,r0,800a344 <pipe_release+0x8c>
/* Notify waiting Writers that all their partners left */
PIPE_WAKEUPWRITERS(pipe);
800a33c: 29 61 00 30 lw r1,(r11+48)
800a340: e0 00 00 07 bi 800a35c <pipe_release+0xa4>
else if (pipe->Writers == 0 && mode != LIBIO_FLAGS_READ)
800a344: 29 61 00 14 lw r1,(r11+20)
800a348: 7d 8c 00 02 cmpnei r12,r12,2
800a34c: 64 21 00 00 cmpei r1,r1,0
800a350: a1 81 60 00 and r12,r12,r1
800a354: 45 82 00 04 be r12,r2,800a364 <pipe_release+0xac> <== NEVER TAKEN
PIPE_WAKEUPREADERS(pipe);
800a358: 29 61 00 2c lw r1,(r11+44)
800a35c: 37 82 00 14 addi r2,sp,20
800a360: f8 00 07 a2 calli 800c1e8 <rtems_barrier_release>
pipe_unlock();
800a364: fb ff ff ba calli 800a24c <pipe_unlock>
iop->flags &= ~LIBIO_FLAGS_OPEN;
if(iop->pathinfo.ops->unlink_h(&iop->pathinfo))
return;
#endif
}
800a368: 2b 9d 00 04 lw ra,(sp+4)
800a36c: 2b 8b 00 10 lw r11,(sp+16)
800a370: 2b 8c 00 0c lw r12,(sp+12)
800a374: 2b 8d 00 08 lw r13,(sp+8)
800a378: 37 9c 00 14 addi sp,sp,20
800a37c: c3 a0 00 00 ret
0800a954 <pipe_write>:
pipe_control_t *pipe,
const void *buffer,
size_t count,
rtems_libio_t *iop
)
{
800a954: 37 9c ff d4 addi sp,sp,-44
800a958: 5b 8b 00 28 sw (sp+40),r11
800a95c: 5b 8c 00 24 sw (sp+36),r12
800a960: 5b 8d 00 20 sw (sp+32),r13
800a964: 5b 8e 00 1c sw (sp+28),r14
800a968: 5b 8f 00 18 sw (sp+24),r15
800a96c: 5b 90 00 14 sw (sp+20),r16
800a970: 5b 91 00 10 sw (sp+16),r17
800a974: 5b 92 00 0c sw (sp+12),r18
800a978: 5b 93 00 08 sw (sp+8),r19
800a97c: 5b 9d 00 04 sw (sp+4),ra
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
return 0;
800a980: 34 0c 00 00 mvi r12,0
pipe_control_t *pipe,
const void *buffer,
size_t count,
rtems_libio_t *iop
)
{
800a984: b8 20 58 00 mv r11,r1
800a988: b8 40 88 00 mv r17,r2
800a98c: b8 60 70 00 mv r14,r3
800a990: b8 80 90 00 mv r18,r4
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
800a994: 44 60 00 62 be r3,r0,800ab1c <pipe_write+0x1c8> <== NEVER TAKEN
return 0;
if (! PIPE_LOCK(pipe))
800a998: 28 21 00 28 lw r1,(r1+40)
800a99c: 34 02 00 00 mvi r2,0
800a9a0: 34 03 00 00 mvi r3,0
800a9a4: fb ff e9 c3 calli 80050b0 <rtems_semaphore_obtain>
return -EINTR;
800a9a8: 34 0c ff fc mvi r12,-4
/* Write nothing */
if (count == 0)
return 0;
if (! PIPE_LOCK(pipe))
800a9ac: 5c 20 00 5c bne r1,r0,800ab1c <pipe_write+0x1c8> <== NEVER TAKEN
return -EINTR;
if (pipe->Readers == 0) {
800a9b0: 29 62 00 10 lw r2,(r11+16)
800a9b4: 44 41 00 48 be r2,r1,800aad4 <pipe_write+0x180>
ret = -EPIPE;
goto out_locked;
}
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
800a9b8: 29 61 00 04 lw r1,(r11+4)
800a9bc: 34 10 00 01 mvi r16,1
800a9c0: 55 c1 00 02 bgu r14,r1,800a9c8 <pipe_write+0x74> <== NEVER TAKEN
800a9c4: b9 c0 80 00 mv r16,r14
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
ret = -EINTR;
800a9c8: 34 0c 00 00 mvi r12,0
}
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
800a9cc: 34 13 ff fc mvi r19,-4
800a9d0: e0 00 00 3e bi 800aac8 <pipe_write+0x174>
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
while (PIPE_SPACE(pipe) < chunk) {
if (LIBIO_NODELAY(iop)) {
800a9d4: 2a 4d 00 08 lw r13,(r18+8)
800a9d8: 21 ad 00 01 andi r13,r13,0x1
800a9dc: 5d a0 00 41 bne r13,r0,800aae0 <pipe_write+0x18c>
ret = -EAGAIN;
goto out_locked;
}
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
800a9e0: 29 61 00 1c lw r1,(r11+28)
800a9e4: 34 21 00 01 addi r1,r1,1
800a9e8: 59 61 00 1c sw (r11+28),r1
PIPE_UNLOCK(pipe);
800a9ec: 29 61 00 28 lw r1,(r11+40)
800a9f0: fb ff ea 00 calli 80051f0 <rtems_semaphore_release>
if (! PIPE_WRITEWAIT(pipe))
800a9f4: 29 61 00 30 lw r1,(r11+48)
800a9f8: 34 02 00 00 mvi r2,0
800a9fc: f8 00 06 18 calli 800c25c <rtems_barrier_wait>
800aa00: fc 2d 68 00 cmpne r13,r1,r13
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
800aa04: 29 61 00 28 lw r1,(r11+40)
}
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
800aa08: c8 0d 68 00 sub r13,r0,r13
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
800aa0c: 34 02 00 00 mvi r2,0
800aa10: 34 03 00 00 mvi r3,0
}
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
800aa14: a1 b3 68 00 and r13,r13,r19
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
800aa18: fb ff e9 a6 calli 80050b0 <rtems_semaphore_obtain>
800aa1c: 5c 20 00 3c bne r1,r0,800ab0c <pipe_write+0x1b8> <== NEVER TAKEN
/* WARN waitingWriters not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingWriters --;
800aa20: 29 62 00 1c lw r2,(r11+28)
800aa24: 34 42 ff ff addi r2,r2,-1
800aa28: 59 62 00 1c sw (r11+28),r2
if (ret != 0)
800aa2c: 5d a1 00 30 bne r13,r1,800aaec <pipe_write+0x198> <== NEVER TAKEN
goto out_locked;
if (pipe->Readers == 0) {
800aa30: 29 61 00 10 lw r1,(r11+16)
800aa34: 44 2d 00 2d be r1,r13,800aae8 <pipe_write+0x194> <== NEVER TAKEN
/* 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) {
800aa38: 29 6f 00 04 lw r15,(r11+4)
800aa3c: 29 61 00 0c lw r1,(r11+12)
800aa40: c9 e1 68 00 sub r13,r15,r1
800aa44: 56 0d ff e4 bgu r16,r13,800a9d4 <pipe_write+0x80>
ret = -EPIPE;
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
800aa48: c9 cc 10 00 sub r2,r14,r12
800aa4c: 50 4d 00 02 bgeu r2,r13,800aa54 <pipe_write+0x100>
800aa50: b8 40 68 00 mv r13,r2
chunk1 = pipe->Size - PIPE_WSTART(pipe);
800aa54: 29 62 00 08 lw r2,(r11+8)
800aa58: b4 22 08 00 add r1,r1,r2
800aa5c: b9 e0 10 00 mv r2,r15
800aa60: f8 00 59 25 calli 8020ef4 <__umodsi3>
800aa64: c9 e1 78 00 sub r15,r15,r1
800aa68: 29 63 00 00 lw r3,(r11+0)
800aa6c: b6 2c 10 00 add r2,r17,r12
if (chunk > chunk1) {
800aa70: 4d ed 00 09 bge r15,r13,800aa94 <pipe_write+0x140>
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1);
800aa74: b4 61 08 00 add r1,r3,r1
800aa78: b9 e0 18 00 mv r3,r15
800aa7c: f8 00 15 38 calli 800ff5c <memcpy>
memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1);
800aa80: b5 ec 10 00 add r2,r15,r12
800aa84: 29 61 00 00 lw r1,(r11+0)
800aa88: b6 22 10 00 add r2,r17,r2
800aa8c: c9 af 18 00 sub r3,r13,r15
800aa90: e0 00 00 03 bi 800aa9c <pipe_write+0x148>
}
else
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk);
800aa94: b4 61 08 00 add r1,r3,r1
800aa98: b9 a0 18 00 mv r3,r13
800aa9c: f8 00 15 30 calli 800ff5c <memcpy>
pipe->Length += chunk;
800aaa0: 29 61 00 0c lw r1,(r11+12)
800aaa4: b4 2d 08 00 add r1,r1,r13
800aaa8: 59 61 00 0c sw (r11+12),r1
if (pipe->waitingReaders > 0)
800aaac: 29 61 00 18 lw r1,(r11+24)
800aab0: 44 20 00 04 be r1,r0,800aac0 <pipe_write+0x16c>
PIPE_WAKEUPREADERS(pipe);
800aab4: 29 61 00 2c lw r1,(r11+44)
800aab8: 37 82 00 2c addi r2,sp,44
800aabc: f8 00 05 cb calli 800c1e8 <rtems_barrier_release>
written += chunk;
800aac0: b5 8d 60 00 add r12,r12,r13
/* Write of more than PIPE_BUF bytes can be interleaved */
chunk = 1;
800aac4: 34 10 00 01 mvi r16,1
}
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
800aac8: 55 cc ff dc bgu r14,r12,800aa38 <pipe_write+0xe4>
800aacc: 34 0d 00 00 mvi r13,0
800aad0: e0 00 00 07 bi 800aaec <pipe_write+0x198>
if (! PIPE_LOCK(pipe))
return -EINTR;
if (pipe->Readers == 0) {
ret = -EPIPE;
800aad4: 34 0d ff e0 mvi r13,-32
const void *buffer,
size_t count,
rtems_libio_t *iop
)
{
int chunk, chunk1, written = 0, ret = 0;
800aad8: 34 0c 00 00 mvi r12,0
800aadc: e0 00 00 04 bi 800aaec <pipe_write+0x198>
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
while (PIPE_SPACE(pipe) < chunk) {
if (LIBIO_NODELAY(iop)) {
ret = -EAGAIN;
800aae0: 34 0d ff f5 mvi r13,-11
800aae4: e0 00 00 02 bi 800aaec <pipe_write+0x198>
pipe->waitingWriters --;
if (ret != 0)
goto out_locked;
if (pipe->Readers == 0) {
ret = -EPIPE;
800aae8: 34 0d ff e0 mvi r13,-32 <== NOT EXECUTED
/* Write of more than PIPE_BUF bytes can be interleaved */
chunk = 1;
}
out_locked:
PIPE_UNLOCK(pipe);
800aaec: 29 61 00 28 lw r1,(r11+40)
800aaf0: fb ff e9 c0 calli 80051f0 <rtems_semaphore_release>
out_nolock:
#ifdef RTEMS_POSIX_API
/* Signal SIGPIPE */
if (ret == -EPIPE)
800aaf4: 34 01 ff e0 mvi r1,-32
800aaf8: 5d a1 00 06 bne r13,r1,800ab10 <pipe_write+0x1bc>
kill(getpid(), SIGPIPE);
800aafc: f8 00 01 36 calli 800afd4 <getpid>
800ab00: 34 02 00 0d mvi r2,13
800ab04: f8 00 02 ee calli 800b6bc <kill>
800ab08: e0 00 00 02 bi 800ab10 <pipe_write+0x1bc>
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
/* WARN waitingWriters not restored! */
ret = -EINTR;
800ab0c: 34 0d ff fc mvi r13,-4 <== NOT EXECUTED
/* Signal SIGPIPE */
if (ret == -EPIPE)
kill(getpid(), SIGPIPE);
#endif
if (written > 0)
800ab10: 4c 0c 00 02 bge r0,r12,800ab18 <pipe_write+0x1c4>
800ab14: e0 00 00 02 bi 800ab1c <pipe_write+0x1c8>
800ab18: b9 a0 60 00 mv r12,r13
return written;
return ret;
}
800ab1c: b9 80 08 00 mv r1,r12
800ab20: 2b 9d 00 04 lw ra,(sp+4)
800ab24: 2b 8b 00 28 lw r11,(sp+40)
800ab28: 2b 8c 00 24 lw r12,(sp+36)
800ab2c: 2b 8d 00 20 lw r13,(sp+32)
800ab30: 2b 8e 00 1c lw r14,(sp+28)
800ab34: 2b 8f 00 18 lw r15,(sp+24)
800ab38: 2b 90 00 14 lw r16,(sp+20)
800ab3c: 2b 91 00 10 lw r17,(sp+16)
800ab40: 2b 92 00 0c lw r18,(sp+12)
800ab44: 2b 93 00 08 lw r19,(sp+8)
800ab48: 37 9c 00 2c addi sp,sp,44
800ab4c: c3 a0 00 00 ret
08008524 <pthread_attr_setschedpolicy>:
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
8008524: 34 03 00 16 mvi r3,22
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
8008528: 44 20 00 0c be r1,r0,8008558 <pthread_attr_setschedpolicy+0x34>
800852c: 28 24 00 00 lw r4,(r1+0)
8008530: 44 80 00 0a be r4,r0,8008558 <pthread_attr_setschedpolicy+0x34>
return EINVAL;
switch ( policy ) {
8008534: 48 02 00 08 bg r0,r2,8008554 <pthread_attr_setschedpolicy+0x30>
8008538: 34 03 00 02 mvi r3,2
800853c: 4c 62 00 03 bge r3,r2,8008548 <pthread_attr_setschedpolicy+0x24>
8008540: 34 03 00 04 mvi r3,4
8008544: 5c 43 00 04 bne r2,r3,8008554 <pthread_attr_setschedpolicy+0x30><== NEVER TAKEN
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
8008548: 58 22 00 14 sw (r1+20),r2
return 0;
800854c: 34 03 00 00 mvi r3,0
8008550: e0 00 00 02 bi 8008558 <pthread_attr_setschedpolicy+0x34>
default:
return ENOTSUP;
8008554: 34 03 00 86 mvi r3,134
}
}
8008558: b8 60 08 00 mv r1,r3
800855c: c3 a0 00 00 ret
08003c28 <pthread_barrier_init>:
int pthread_barrier_init(
pthread_barrier_t *barrier,
const pthread_barrierattr_t *attr,
unsigned int count
)
{
8003c28: 37 9c ff dc addi sp,sp,-36
8003c2c: 5b 8b 00 14 sw (sp+20),r11
8003c30: 5b 8c 00 10 sw (sp+16),r12
8003c34: 5b 8d 00 0c sw (sp+12),r13
8003c38: 5b 8e 00 08 sw (sp+8),r14
8003c3c: 5b 9d 00 04 sw (sp+4),ra
/*
* Error check parameters
*/
if ( !barrier )
return EINVAL;
8003c40: 34 04 00 16 mvi r4,22
int pthread_barrier_init(
pthread_barrier_t *barrier,
const pthread_barrierattr_t *attr,
unsigned int count
)
{
8003c44: b8 20 68 00 mv r13,r1
8003c48: b8 60 58 00 mv r11,r3
const pthread_barrierattr_t *the_attr;
/*
* Error check parameters
*/
if ( !barrier )
8003c4c: 44 20 00 2a be r1,r0,8003cf4 <pthread_barrier_init+0xcc>
return EINVAL;
if ( count == 0 )
8003c50: 44 60 00 29 be r3,r0,8003cf4 <pthread_barrier_init+0xcc>
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
8003c54: 5c 40 00 05 bne r2,r0,8003c68 <pthread_barrier_init+0x40>
the_attr = attr;
} else {
(void) pthread_barrierattr_init( &my_attr );
8003c58: 37 8c 00 18 addi r12,sp,24
8003c5c: b9 80 08 00 mv r1,r12
8003c60: fb ff ff bb calli 8003b4c <pthread_barrierattr_init>
the_attr = &my_attr;
8003c64: b9 80 10 00 mv r2,r12
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
8003c68: 28 41 00 00 lw r1,(r2+0)
return EINVAL;
8003c6c: 34 04 00 16 mvi r4,22
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
8003c70: 44 20 00 21 be r1,r0,8003cf4 <pthread_barrier_init+0xcc>
return EINVAL;
switch ( the_attr->process_shared ) {
8003c74: 28 4e 00 04 lw r14,(r2+4)
8003c78: 5d c0 00 1f bne r14,r0,8003cf4 <pthread_barrier_init+0xcc> <== NEVER TAKEN
*
* 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;
8003c7c: 78 02 08 01 mvhi r2,0x801
8003c80: 38 42 69 08 ori r2,r2,0x6908
8003c84: 28 41 00 00 lw r1,(r2+0)
}
/*
* Convert from POSIX attributes to Core Barrier attributes
*/
the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE;
8003c88: 5b 80 00 20 sw (sp+32),r0
the_attributes.maximum_count = count;
8003c8c: 5b 8b 00 24 sw (sp+36),r11
++level;
8003c90: 34 21 00 01 addi r1,r1,1
_Thread_Dispatch_disable_level = level;
8003c94: 58 41 00 00 sw (r2+0),r1
* the inactive chain of free barrier control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void )
{
return (POSIX_Barrier_Control *)
_Objects_Allocate( &_POSIX_Barrier_Information );
8003c98: 78 0c 08 01 mvhi r12,0x801
8003c9c: 39 8c 6c 04 ori r12,r12,0x6c04
8003ca0: b9 80 08 00 mv r1,r12
8003ca4: f8 00 08 10 calli 8005ce4 <_Objects_Allocate>
8003ca8: b8 20 58 00 mv r11,r1
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_barrier = _POSIX_Barrier_Allocate();
if ( !the_barrier ) {
8003cac: 5c 2e 00 04 bne r1,r14,8003cbc <pthread_barrier_init+0x94>
_Thread_Enable_dispatch();
8003cb0: f8 00 0d 4c calli 80071e0 <_Thread_Enable_dispatch>
return EAGAIN;
8003cb4: 34 04 00 0b mvi r4,11
8003cb8: e0 00 00 0f bi 8003cf4 <pthread_barrier_init+0xcc>
}
_CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes );
8003cbc: 34 21 00 10 addi r1,r1,16
8003cc0: 37 82 00 20 addi r2,sp,32
8003cc4: f8 00 05 02 calli 80050cc <_CORE_barrier_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8003cc8: 29 6e 00 08 lw r14,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8003ccc: 29 8c 00 1c lw r12,(r12+28)
8003cd0: 34 02 00 02 mvi r2,2
8003cd4: 21 c1 ff ff andi r1,r14,0xffff
8003cd8: f8 00 3d 64 calli 8013268 <__ashlsi3>
8003cdc: b5 81 08 00 add r1,r12,r1
8003ce0: 58 2b 00 00 sw (r1+0),r11
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
8003ce4: 59 60 00 0c sw (r11+12),r0
);
/*
* Exit the critical section and return the user an operational barrier
*/
*barrier = the_barrier->Object.id;
8003ce8: 59 ae 00 00 sw (r13+0),r14
_Thread_Enable_dispatch();
8003cec: f8 00 0d 3d calli 80071e0 <_Thread_Enable_dispatch>
return 0;
8003cf0: 34 04 00 00 mvi r4,0
}
8003cf4: b8 80 08 00 mv r1,r4
8003cf8: 2b 9d 00 04 lw ra,(sp+4)
8003cfc: 2b 8b 00 14 lw r11,(sp+20)
8003d00: 2b 8c 00 10 lw r12,(sp+16)
8003d04: 2b 8d 00 0c lw r13,(sp+12)
8003d08: 2b 8e 00 08 lw r14,(sp+8)
8003d0c: 37 9c 00 24 addi sp,sp,36
8003d10: c3 a0 00 00 ret
080034bc <pthread_cleanup_push>:
void pthread_cleanup_push(
void (*routine)( void * ),
void *arg
)
{
80034bc: 37 9c ff f4 addi sp,sp,-12
80034c0: 5b 8b 00 0c sw (sp+12),r11
80034c4: 5b 8c 00 08 sw (sp+8),r12
80034c8: 5b 9d 00 04 sw (sp+4),ra
80034cc: b8 20 58 00 mv r11,r1
80034d0: b8 40 60 00 mv r12,r2
/*
* The POSIX standard does not address what to do when the routine
* is NULL. It also does not address what happens when we cannot
* allocate memory or anything else bad happens.
*/
if ( !routine )
80034d4: 44 20 00 13 be r1,r0,8003520 <pthread_cleanup_push+0x64>
*
* 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;
80034d8: 78 03 08 01 mvhi r3,0x801
80034dc: 38 63 68 e0 ori r3,r3,0x68e0
80034e0: 28 61 00 00 lw r1,(r3+0)
++level;
80034e4: 34 21 00 01 addi r1,r1,1
_Thread_Dispatch_disable_level = level;
80034e8: 58 61 00 00 sw (r3+0),r1
return;
_Thread_Disable_dispatch();
handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
80034ec: 34 01 00 10 mvi r1,16
80034f0: f8 00 12 61 calli 8007e74 <_Workspace_Allocate>
80034f4: b8 20 10 00 mv r2,r1
if ( handler ) {
80034f8: 44 20 00 09 be r1,r0,800351c <pthread_cleanup_push+0x60> <== NEVER TAKEN
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
80034fc: 78 03 08 01 mvhi r3,0x801
8003500: 38 63 6d 80 ori r3,r3,0x6d80
8003504: 28 61 00 10 lw r1,(r3+16)
handler_stack = &thread_support->Cancellation_Handlers;
8003508: 28 21 01 1c lw r1,(r1+284)
handler->routine = routine;
800350c: 58 4b 00 08 sw (r2+8),r11
handler->arg = arg;
8003510: 58 4c 00 0c sw (r2+12),r12
_Chain_Append( handler_stack, &handler->Node );
8003514: 34 21 00 e4 addi r1,r1,228
8003518: f8 00 05 29 calli 80049bc <_Chain_Append>
}
_Thread_Enable_dispatch();
800351c: f8 00 0d 58 calli 8006a7c <_Thread_Enable_dispatch>
}
8003520: 2b 9d 00 04 lw ra,(sp+4)
8003524: 2b 8b 00 0c lw r11,(sp+12)
8003528: 2b 8c 00 08 lw r12,(sp+8)
800352c: 37 9c 00 0c addi sp,sp,12
8003530: c3 a0 00 00 ret
080045dc <pthread_cond_init>:
*/
int pthread_cond_init(
pthread_cond_t *cond,
const pthread_condattr_t *attr
)
{
80045dc: 37 9c ff ec addi sp,sp,-20
80045e0: 5b 8b 00 14 sw (sp+20),r11
80045e4: 5b 8c 00 10 sw (sp+16),r12
80045e8: 5b 8d 00 0c sw (sp+12),r13
80045ec: 5b 8e 00 08 sw (sp+8),r14
80045f0: 5b 9d 00 04 sw (sp+4),ra
80045f4: b8 20 70 00 mv r14,r1
80045f8: b8 40 58 00 mv r11,r2
POSIX_Condition_variables_Control *the_cond;
const pthread_condattr_t *the_attr;
if ( attr ) the_attr = attr;
80045fc: 5c 40 00 03 bne r2,r0,8004608 <pthread_cond_init+0x2c>
else the_attr = &_POSIX_Condition_variables_Default_attributes;
8004600: 78 0b 08 01 mvhi r11,0x801
8004604: 39 6b 62 d4 ori r11,r11,0x62d4
/*
* Be careful about attributes when global!!!
*/
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
8004608: 29 63 00 04 lw r3,(r11+4)
800460c: 34 02 00 01 mvi r2,1
return EINVAL;
8004610: 34 01 00 16 mvi r1,22
else the_attr = &_POSIX_Condition_variables_Default_attributes;
/*
* Be careful about attributes when global!!!
*/
if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
8004614: 44 62 00 26 be r3,r2,80046ac <pthread_cond_init+0xd0> <== NEVER TAKEN
return EINVAL;
if ( !the_attr->is_initialized )
8004618: 29 62 00 00 lw r2,(r11+0)
800461c: 44 40 00 24 be r2,r0,80046ac <pthread_cond_init+0xd0>
*
* 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;
8004620: 78 02 08 01 mvhi r2,0x801
8004624: 38 42 78 f8 ori r2,r2,0x78f8
8004628: 28 41 00 00 lw r1,(r2+0)
++level;
800462c: 34 21 00 01 addi r1,r1,1
_Thread_Dispatch_disable_level = level;
8004630: 58 41 00 00 sw (r2+0),r1
RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control
*_POSIX_Condition_variables_Allocate( void )
{
return (POSIX_Condition_variables_Control *)
_Objects_Allocate( &_POSIX_Condition_variables_Information );
8004634: 78 0d 08 01 mvhi r13,0x801
8004638: 39 ad 7c 8c ori r13,r13,0x7c8c
800463c: b9 a0 08 00 mv r1,r13
8004640: f8 00 09 f9 calli 8006e24 <_Objects_Allocate>
8004644: b8 20 60 00 mv r12,r1
_Thread_Disable_dispatch();
the_cond = _POSIX_Condition_variables_Allocate();
if ( !the_cond ) {
8004648: 5c 20 00 04 bne r1,r0,8004658 <pthread_cond_init+0x7c>
_Thread_Enable_dispatch();
800464c: f8 00 0f a7 calli 80084e8 <_Thread_Enable_dispatch>
return ENOMEM;
8004650: 34 01 00 0c mvi r1,12
8004654: e0 00 00 16 bi 80046ac <pthread_cond_init+0xd0>
the_cond->process_shared = the_attr->process_shared;
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
_Thread_queue_Initialize(
8004658: 78 04 08 01 mvhi r4,0x801
if ( !the_cond ) {
_Thread_Enable_dispatch();
return ENOMEM;
}
the_cond->process_shared = the_attr->process_shared;
800465c: 29 61 00 04 lw r1,(r11+4)
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
_Thread_queue_Initialize(
8004660: 38 84 62 dc ori r4,r4,0x62dc
8004664: 28 83 00 00 lw r3,(r4+0)
if ( !the_cond ) {
_Thread_Enable_dispatch();
return ENOMEM;
}
the_cond->process_shared = the_attr->process_shared;
8004668: 59 81 00 10 sw (r12+16),r1
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
_Thread_queue_Initialize(
800466c: 34 04 00 74 mvi r4,116
8004670: 35 81 00 18 addi r1,r12,24
8004674: 34 02 00 00 mvi r2,0
return ENOMEM;
}
the_cond->process_shared = the_attr->process_shared;
the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX;
8004678: 59 80 00 14 sw (r12+20),r0
_Thread_queue_Initialize(
800467c: f8 00 12 25 calli 8008f10 <_Thread_queue_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8004680: 29 8b 00 08 lw r11,(r12+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8004684: 29 ad 00 1c lw r13,(r13+28)
8004688: 34 02 00 02 mvi r2,2
800468c: 21 61 ff ff andi r1,r11,0xffff
8004690: f8 00 3f 1b calli 80142fc <__ashlsi3>
8004694: b5 a1 10 00 add r2,r13,r1
8004698: 58 4c 00 00 sw (r2+0),r12
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
800469c: 59 80 00 0c sw (r12+12),r0
&_POSIX_Condition_variables_Information,
&the_cond->Object,
0
);
*cond = the_cond->Object.id;
80046a0: 59 cb 00 00 sw (r14+0),r11
_Thread_Enable_dispatch();
80046a4: f8 00 0f 91 calli 80084e8 <_Thread_Enable_dispatch>
return 0;
80046a8: 34 01 00 00 mvi r1,0
}
80046ac: 2b 9d 00 04 lw ra,(sp+4)
80046b0: 2b 8b 00 14 lw r11,(sp+20)
80046b4: 2b 8c 00 10 lw r12,(sp+16)
80046b8: 2b 8d 00 0c lw r13,(sp+12)
80046bc: 2b 8e 00 08 lw r14,(sp+8)
80046c0: 37 9c 00 14 addi sp,sp,20
80046c4: c3 a0 00 00 ret
08004450 <pthread_condattr_destroy>:
int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
if ( !attr || attr->is_initialized == false )
return EINVAL;
8004450: 34 02 00 16 mvi r2,22
int pthread_condattr_destroy(
pthread_condattr_t *attr
)
{
if ( !attr || attr->is_initialized == false )
8004454: 44 20 00 05 be r1,r0,8004468 <pthread_condattr_destroy+0x18>
8004458: 28 23 00 00 lw r3,(r1+0)
800445c: 44 60 00 03 be r3,r0,8004468 <pthread_condattr_destroy+0x18><== NEVER TAKEN
return EINVAL;
attr->is_initialized = false;
8004460: 58 20 00 00 sw (r1+0),r0
return 0;
8004464: 34 02 00 00 mvi r2,0
}
8004468: b8 40 08 00 mv r1,r2
800446c: c3 a0 00 00 ret
080038bc <pthread_create>:
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine)( void * ),
void *arg
)
{
80038bc: 37 9c ff a0 addi sp,sp,-96
80038c0: 5b 8b 00 3c sw (sp+60),r11
80038c4: 5b 8c 00 38 sw (sp+56),r12
80038c8: 5b 8d 00 34 sw (sp+52),r13
80038cc: 5b 8e 00 30 sw (sp+48),r14
80038d0: 5b 8f 00 2c sw (sp+44),r15
80038d4: 5b 90 00 28 sw (sp+40),r16
80038d8: 5b 91 00 24 sw (sp+36),r17
80038dc: 5b 92 00 20 sw (sp+32),r18
80038e0: 5b 93 00 1c sw (sp+28),r19
80038e4: 5b 94 00 18 sw (sp+24),r20
80038e8: 5b 95 00 14 sw (sp+20),r21
80038ec: 5b 9d 00 10 sw (sp+16),ra
struct sched_param schedparam;
Objects_Name name;
int rc;
if ( !start_routine )
return EFAULT;
80038f0: 34 0d 00 0e mvi r13,14
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine)( void * ),
void *arg
)
{
80038f4: b8 20 88 00 mv r17,r1
80038f8: b8 60 80 00 mv r16,r3
80038fc: b8 80 90 00 mv r18,r4
int schedpolicy = SCHED_RR;
struct sched_param schedparam;
Objects_Name name;
int rc;
if ( !start_routine )
8003900: 44 60 00 a5 be r3,r0,8003b94 <pthread_create+0x2d8> <== NEVER TAKEN
return EFAULT;
the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
8003904: b8 40 58 00 mv r11,r2
8003908: 5c 40 00 03 bne r2,r0,8003914 <pthread_create+0x58>
800390c: 78 0b 08 01 mvhi r11,0x801
8003910: 39 6b e2 1c ori r11,r11,0xe21c
if ( !the_attr->is_initialized )
8003914: 29 61 00 00 lw r1,(r11+0)
return EINVAL;
8003918: 34 0d 00 16 mvi r13,22
if ( !start_routine )
return EFAULT;
the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes;
if ( !the_attr->is_initialized )
800391c: 44 20 00 9e be r1,r0,8003b94 <pthread_create+0x2d8>
* stack space if it is allowed to allocate it itself.
*
* NOTE: If the user provides the stack we will let it drop below
* twice the minimum.
*/
if ( the_attr->stackaddr && !_Stack_Is_enough(the_attr->stacksize) )
8003920: 29 61 00 04 lw r1,(r11+4)
8003924: 44 20 00 06 be r1,r0,800393c <pthread_create+0x80>
8003928: 78 02 08 02 mvhi r2,0x802
800392c: 38 42 00 f8 ori r2,r2,0xf8
8003930: 29 63 00 08 lw r3,(r11+8)
8003934: 28 41 00 00 lw r1,(r2+0)
8003938: 54 23 00 97 bgu r1,r3,8003b94 <pthread_create+0x2d8>
* If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread
* inherits scheduling attributes from the creating thread. If it is
* PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
800393c: 29 62 00 10 lw r2,(r11+16)
8003940: 34 01 00 01 mvi r1,1
8003944: 44 41 00 05 be r2,r1,8003958 <pthread_create+0x9c>
8003948: 34 01 00 02 mvi r1,2
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
break;
default:
return EINVAL;
800394c: 34 0d 00 16 mvi r13,22
* If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread
* inherits scheduling attributes from the creating thread. If it is
* PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
8003950: 5c 41 00 91 bne r2,r1,8003b94 <pthread_create+0x2d8>
8003954: e0 00 00 14 bi 80039a4 <pthread_create+0xe8>
case PTHREAD_INHERIT_SCHED:
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
8003958: 78 02 08 02 mvhi r2,0x802
800395c: 38 42 0d 80 ori r2,r2,0xd80
8003960: 28 41 00 10 lw r1,(r2+16)
8003964: 28 22 01 1c lw r2,(r1+284)
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
8003968: 28 48 00 88 lw r8,(r2+136)
800396c: 28 47 00 8c lw r7,(r2+140)
8003970: 28 46 00 90 lw r6,(r2+144)
8003974: 28 45 00 94 lw r5,(r2+148)
8003978: 28 44 00 98 lw r4,(r2+152)
800397c: 28 43 00 9c lw r3,(r2+156)
* attributes structure.
*/
switch ( the_attr->inheritsched ) {
case PTHREAD_INHERIT_SCHED:
api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
schedpolicy = api->schedpolicy;
8003980: 28 4f 00 84 lw r15,(r2+132)
schedparam = api->schedparam;
8003984: 28 41 00 a0 lw r1,(r2+160)
8003988: 5b 88 00 40 sw (sp+64),r8
800398c: 5b 87 00 44 sw (sp+68),r7
8003990: 5b 86 00 48 sw (sp+72),r6
8003994: 5b 85 00 4c sw (sp+76),r5
8003998: 5b 84 00 50 sw (sp+80),r4
800399c: 5b 83 00 54 sw (sp+84),r3
80039a0: e0 00 00 0f bi 80039dc <pthread_create+0x120>
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
80039a4: 29 67 00 18 lw r7,(r11+24)
80039a8: 29 66 00 1c lw r6,(r11+28)
80039ac: 29 65 00 20 lw r5,(r11+32)
80039b0: 29 64 00 24 lw r4,(r11+36)
80039b4: 29 63 00 28 lw r3,(r11+40)
80039b8: 29 62 00 2c lw r2,(r11+44)
schedpolicy = api->schedpolicy;
schedparam = api->schedparam;
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
80039bc: 29 6f 00 14 lw r15,(r11+20)
schedparam = the_attr->schedparam;
80039c0: 29 61 00 30 lw r1,(r11+48)
80039c4: 5b 87 00 40 sw (sp+64),r7
80039c8: 5b 86 00 44 sw (sp+68),r6
80039cc: 5b 85 00 48 sw (sp+72),r5
80039d0: 5b 84 00 4c sw (sp+76),r4
80039d4: 5b 83 00 50 sw (sp+80),r3
80039d8: 5b 82 00 54 sw (sp+84),r2
/*
* Check the contentionscope since rtems only supports PROCESS wide
* contention (i.e. no system wide contention).
*/
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
80039dc: 29 6c 00 0c lw r12,(r11+12)
schedparam = api->schedparam;
break;
case PTHREAD_EXPLICIT_SCHED:
schedpolicy = the_attr->schedpolicy;
schedparam = the_attr->schedparam;
80039e0: 5b 81 00 58 sw (sp+88),r1
/*
* Check the contentionscope since rtems only supports PROCESS wide
* contention (i.e. no system wide contention).
*/
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
return ENOTSUP;
80039e4: 34 0d 00 86 mvi r13,134
/*
* Check the contentionscope since rtems only supports PROCESS wide
* contention (i.e. no system wide contention).
*/
if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS )
80039e8: 5d 80 00 6b bne r12,r0,8003b94 <pthread_create+0x2d8>
return ENOTSUP;
/*
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
80039ec: 2b 81 00 40 lw r1,(sp+64)
return EINVAL;
80039f0: 34 0d 00 16 mvi r13,22
return ENOTSUP;
/*
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
80039f4: f8 00 1a d2 calli 800a53c <_POSIX_Priority_Is_valid>
80039f8: 44 2c 00 67 be r1,r12,8003b94 <pthread_create+0x2d8> <== NEVER TAKEN
RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core(
int priority
)
{
return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1);
80039fc: 78 02 08 02 mvhi r2,0x802
8003a00: 38 42 00 fc ori r2,r2,0xfc
8003a04: 40 54 00 00 lbu r20,(r2+0)
core_priority = _POSIX_Priority_To_core( schedparam.sched_priority );
/*
* Set the core scheduling policy information.
*/
rc = _POSIX_Thread_Translate_sched_param(
8003a08: b9 e0 08 00 mv r1,r15
8003a0c: 37 82 00 40 addi r2,sp,64
8003a10: 37 83 00 60 addi r3,sp,96
8003a14: 37 84 00 5c addi r4,sp,92
* Interpret the scheduling parameters.
*/
if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) )
return EINVAL;
core_priority = _POSIX_Priority_To_core( schedparam.sched_priority );
8003a18: 2b 93 00 40 lw r19,(sp+64)
/*
* Set the core scheduling policy information.
*/
rc = _POSIX_Thread_Translate_sched_param(
8003a1c: f8 00 1a d0 calli 800a55c <_POSIX_Thread_Translate_sched_param>
8003a20: b8 20 68 00 mv r13,r1
schedpolicy,
&schedparam,
&budget_algorithm,
&budget_callout
);
if ( rc )
8003a24: 5c 20 00 5c bne r1,r0,8003b94 <pthread_create+0x2d8>
#endif
/*
* Lock the allocator mutex for protection
*/
_RTEMS_Lock_allocator();
8003a28: 78 0c 08 02 mvhi r12,0x802
8003a2c: 39 8c 09 68 ori r12,r12,0x968
8003a30: 29 81 00 00 lw r1,(r12+0)
8003a34: f8 00 05 2c calli 8004ee4 <_API_Mutex_Lock>
* _POSIX_Threads_Allocate
*/
RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void )
{
return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information );
8003a38: 78 02 08 02 mvhi r2,0x802
8003a3c: b8 40 08 00 mv r1,r2
8003a40: 38 21 0a 64 ori r1,r1,0xa64
8003a44: f8 00 08 52 calli 8005b8c <_Objects_Allocate>
8003a48: b8 20 70 00 mv r14,r1
* Allocate the thread control block.
*
* NOTE: Global threads are not currently supported.
*/
the_thread = _POSIX_Threads_Allocate();
if ( !the_thread ) {
8003a4c: 5c 2d 00 03 bne r1,r13,8003a58 <pthread_create+0x19c>
_RTEMS_Unlock_allocator();
8003a50: 29 81 00 00 lw r1,(r12+0)
8003a54: e0 00 00 21 bi 8003ad8 <pthread_create+0x21c>
static inline size_t _POSIX_Threads_Ensure_minimum_stack (
size_t size
)
{
if ( size >= PTHREAD_MINIMUM_STACK_SIZE )
8003a58: 78 02 08 02 mvhi r2,0x802
8003a5c: 38 42 00 f8 ori r2,r2,0xf8
8003a60: 28 41 00 00 lw r1,(r2+0)
/*
* Initialize the core thread for this task.
*/
name.name_p = NULL; /* posix threads don't have a name by default */
status = _Thread_Initialize(
8003a64: 29 6c 00 08 lw r12,(r11+8)
static inline size_t _POSIX_Threads_Ensure_minimum_stack (
size_t size
)
{
if ( size >= PTHREAD_MINIMUM_STACK_SIZE )
8003a68: 34 02 00 01 mvi r2,1
8003a6c: f8 00 63 4c calli 801c79c <__ashlsi3>
/*
* Initialize the core thread for this task.
*/
name.name_p = NULL; /* posix threads don't have a name by default */
status = _Thread_Initialize(
8003a70: 29 75 00 04 lw r21,(r11+4)
static inline size_t _POSIX_Threads_Ensure_minimum_stack (
size_t size
)
{
if ( size >= PTHREAD_MINIMUM_STACK_SIZE )
8003a74: b8 20 28 00 mv r5,r1
/*
* Initialize the core thread for this task.
*/
name.name_p = NULL; /* posix threads don't have a name by default */
status = _Thread_Initialize(
8003a78: 50 2c 00 02 bgeu r1,r12,8003a80 <pthread_create+0x1c4>
8003a7c: b9 80 28 00 mv r5,r12
8003a80: 2b 81 00 5c lw r1,(sp+92)
8003a84: 78 0c 08 02 mvhi r12,0x802
8003a88: 2b 88 00 60 lw r8,(sp+96)
8003a8c: 39 8c 0a 64 ori r12,r12,0xa64
8003a90: 5b 81 00 04 sw (sp+4),r1
8003a94: b8 a0 20 00 mv r4,r5
8003a98: b9 80 08 00 mv r1,r12
8003a9c: b9 c0 10 00 mv r2,r14
8003aa0: ba a0 18 00 mv r3,r21
8003aa4: 34 05 00 00 mvi r5,0
8003aa8: ca 93 30 00 sub r6,r20,r19
8003aac: 34 07 00 01 mvi r7,1
8003ab0: 5b 80 00 08 sw (sp+8),r0
8003ab4: 5b 80 00 0c sw (sp+12),r0
8003ab8: f8 00 0e 0d calli 80072ec <_Thread_Initialize>
budget_callout,
0, /* isr level */
name /* posix threads don't have a name */
);
if ( !status ) {
8003abc: 5c 20 00 0a bne r1,r0,8003ae4 <pthread_create+0x228>
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free (
Thread_Control *the_pthread
)
{
_Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object );
8003ac0: b9 80 08 00 mv r1,r12
8003ac4: b9 c0 10 00 mv r2,r14
8003ac8: f8 00 09 31 calli 8005f8c <_Objects_Free>
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
8003acc: 78 01 08 02 mvhi r1,0x802
8003ad0: 38 21 09 68 ori r1,r1,0x968
8003ad4: 28 21 00 00 lw r1,(r1+0)
8003ad8: f8 00 05 20 calli 8004f58 <_API_Mutex_Unlock>
return EAGAIN;
8003adc: 34 0d 00 0b mvi r13,11
8003ae0: e0 00 00 2d bi 8003b94 <pthread_create+0x2d8>
}
/*
* finish initializing the per API structure
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8003ae4: 29 cc 01 1c lw r12,(r14+284)
api->Attributes = *the_attr;
8003ae8: b9 60 10 00 mv r2,r11
8003aec: 34 03 00 40 mvi r3,64
8003af0: b9 80 08 00 mv r1,r12
8003af4: f8 00 28 b3 calli 800ddc0 <memcpy>
api->detachstate = the_attr->detachstate;
8003af8: 29 61 00 3c lw r1,(r11+60)
api->schedparam = schedparam;
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003afc: 34 02 00 01 mvi r2,1
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
api->schedpolicy = schedpolicy;
8003b00: 59 8f 00 84 sw (r12+132),r15
* finish initializing the per API structure
*/
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
8003b04: 59 81 00 40 sw (r12+64),r1
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
8003b08: 2b 81 00 40 lw r1,(sp+64)
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003b0c: ba 00 18 00 mv r3,r16
8003b10: ba 40 20 00 mv r4,r18
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
8003b14: 59 81 00 88 sw (r12+136),r1
8003b18: 2b 81 00 44 lw r1,(sp+68)
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003b1c: 34 05 00 00 mvi r5,0
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
api->Attributes = *the_attr;
api->detachstate = the_attr->detachstate;
api->schedpolicy = schedpolicy;
api->schedparam = schedparam;
8003b20: 59 81 00 8c sw (r12+140),r1
8003b24: 2b 81 00 48 lw r1,(sp+72)
8003b28: 59 81 00 90 sw (r12+144),r1
8003b2c: 2b 81 00 4c lw r1,(sp+76)
8003b30: 59 81 00 94 sw (r12+148),r1
8003b34: 2b 81 00 50 lw r1,(sp+80)
8003b38: 59 81 00 98 sw (r12+152),r1
8003b3c: 2b 81 00 54 lw r1,(sp+84)
8003b40: 59 81 00 9c sw (r12+156),r1
8003b44: 2b 81 00 58 lw r1,(sp+88)
8003b48: 59 81 00 a0 sw (r12+160),r1
/*
* POSIX threads are allocated and started in one operation.
*/
status = _Thread_Start(
8003b4c: b9 c0 08 00 mv r1,r14
8003b50: f8 00 10 b0 calli 8007e10 <_Thread_Start>
_RTEMS_Unlock_allocator();
return EINVAL;
}
#endif
if ( schedpolicy == SCHED_SPORADIC ) {
8003b54: 34 01 00 04 mvi r1,4
8003b58: 5d e1 00 09 bne r15,r1,8003b7c <pthread_create+0x2c0>
_Watchdog_Insert_ticks(
8003b5c: 35 81 00 90 addi r1,r12,144
8003b60: f8 00 10 e1 calli 8007ee4 <_Timespec_To_ticks>
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8003b64: 78 02 08 02 mvhi r2,0x802
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8003b68: 59 81 00 b4 sw (r12+180),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8003b6c: b8 40 08 00 mv r1,r2
8003b70: 38 21 09 80 ori r1,r1,0x980
8003b74: 35 82 00 a8 addi r2,r12,168
8003b78: f8 00 11 ab calli 8008224 <_Watchdog_Insert>
}
/*
* Return the id and indicate we successfully created the thread
*/
*thread = the_thread->Object.id;
8003b7c: 29 c1 00 08 lw r1,(r14+8)
8003b80: 5a 21 00 00 sw (r17+0),r1
_RTEMS_Unlock_allocator();
8003b84: 78 01 08 02 mvhi r1,0x802
8003b88: 38 21 09 68 ori r1,r1,0x968
8003b8c: 28 21 00 00 lw r1,(r1+0)
8003b90: f8 00 04 f2 calli 8004f58 <_API_Mutex_Unlock>
return 0;
}
8003b94: b9 a0 08 00 mv r1,r13
8003b98: 2b 9d 00 10 lw ra,(sp+16)
8003b9c: 2b 8b 00 3c lw r11,(sp+60)
8003ba0: 2b 8c 00 38 lw r12,(sp+56)
8003ba4: 2b 8d 00 34 lw r13,(sp+52)
8003ba8: 2b 8e 00 30 lw r14,(sp+48)
8003bac: 2b 8f 00 2c lw r15,(sp+44)
8003bb0: 2b 90 00 28 lw r16,(sp+40)
8003bb4: 2b 91 00 24 lw r17,(sp+36)
8003bb8: 2b 92 00 20 lw r18,(sp+32)
8003bbc: 2b 93 00 1c lw r19,(sp+28)
8003bc0: 2b 94 00 18 lw r20,(sp+24)
8003bc4: 2b 95 00 14 lw r21,(sp+20)
8003bc8: 37 9c 00 60 addi sp,sp,96
8003bcc: c3 a0 00 00 ret
080116b4 <pthread_exit>:
void pthread_exit(
void *value_ptr
)
{
80116b4: 37 9c ff fc addi sp,sp,-4
80116b8: 5b 9d 00 04 sw (sp+4),ra
_POSIX_Thread_Exit( _Thread_Executing, value_ptr );
80116bc: 78 03 08 01 mvhi r3,0x801
80116c0: 38 63 ae 00 ori r3,r3,0xae00
}
void pthread_exit(
void *value_ptr
)
{
80116c4: b8 20 10 00 mv r2,r1
_POSIX_Thread_Exit( _Thread_Executing, value_ptr );
80116c8: 28 61 00 10 lw r1,(r3+16)
80116cc: fb ff ff bb calli 80115b8 <_POSIX_Thread_Exit>
}
80116d0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
80116d4: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
80116d8: c3 a0 00 00 ret <== NOT EXECUTED
080262c8 <pthread_kill>:
int pthread_kill(
pthread_t thread,
int sig
)
{
80262c8: 37 9c ff e4 addi sp,sp,-28
80262cc: 5b 8b 00 18 sw (sp+24),r11
80262d0: 5b 8c 00 14 sw (sp+20),r12
80262d4: 5b 8d 00 10 sw (sp+16),r13
80262d8: 5b 8e 00 0c sw (sp+12),r14
80262dc: 5b 8f 00 08 sw (sp+8),r15
80262e0: 5b 9d 00 04 sw (sp+4),ra
80262e4: b8 40 58 00 mv r11,r2
POSIX_API_Control *api;
Thread_Control *the_thread;
Objects_Locations location;
if ( !sig )
80262e8: 44 40 00 04 be r2,r0,80262f8 <pthread_kill+0x30>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
80262ec: 34 4f ff ff addi r15,r2,-1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
80262f0: 34 02 00 1f mvi r2,31
80262f4: 50 4f 00 04 bgeu r2,r15,8026304 <pthread_kill+0x3c>
rtems_set_errno_and_return_minus_one( EINVAL );
80262f8: fb ff b3 58 calli 8013058 <__errno>
80262fc: 34 02 00 16 mvi r2,22
8026300: e0 00 00 2c bi 80263b0 <pthread_kill+0xe8>
the_thread = _Thread_Get( thread, &location );
8026304: 37 82 00 1c addi r2,sp,28
8026308: fb ff 9a 26 calli 800cba0 <_Thread_Get>
802630c: b8 20 60 00 mv r12,r1
switch ( location ) {
8026310: 2b 81 00 1c lw r1,(sp+28)
8026314: 5c 20 00 25 bne r1,r0,80263a8 <pthread_kill+0xe0> <== NEVER TAKEN
8026318: 78 01 08 02 mvhi r1,0x802
802631c: 38 21 91 d4 ori r1,r1,0x91d4
8026320: fb ff 90 55 calli 800a474 <_API_extensions_Add_post_switch>
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
8026324: 34 02 00 01 mvi r2,1
8026328: b9 60 08 00 mv r1,r11
802632c: fb ff 6e c0 calli 8001e2c <__ashlsi3>
8026330: 78 0d 08 02 mvhi r13,0x802
8026334: b4 2b 08 00 add r1,r1,r11
8026338: 34 02 00 02 mvi r2,2
802633c: 39 ad 9f 88 ori r13,r13,0x9f88
8026340: fb ff 6e bb calli 8001e2c <__ashlsi3>
8026344: b5 a1 08 00 add r1,r13,r1
8026348: 28 21 00 08 lw r1,(r1+8)
802634c: 34 0d 00 01 mvi r13,1
* If sig == 0 then just validate arguments
*/
_POSIX_signals_Add_post_switch_extension();
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8026350: 29 8e 01 1c lw r14,(r12+284)
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
8026354: 44 2d 00 12 be r1,r13,802639c <pthread_kill+0xd4>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
8026358: b9 e0 10 00 mv r2,r15
802635c: 34 01 00 01 mvi r1,1
8026360: fb ff 6e b3 calli 8001e2c <__ashlsi3>
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
8026364: 29 c2 00 d4 lw r2,(r14+212)
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
8026368: 34 03 00 00 mvi r3,0
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
802636c: b8 41 08 00 or r1,r2,r1
8026370: 59 c1 00 d4 sw (r14+212),r1
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
8026374: b9 60 10 00 mv r2,r11
8026378: b9 80 08 00 mv r1,r12
802637c: fb ff ff 78 calli 802615c <_POSIX_signals_Unblock_thread>
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
8026380: 78 02 08 02 mvhi r2,0x802
8026384: 38 42 9f 00 ori r2,r2,0x9f00
8026388: 28 41 00 08 lw r1,(r2+8)
802638c: 44 20 00 04 be r1,r0,802639c <pthread_kill+0xd4>
8026390: 28 41 00 10 lw r1,(r2+16)
8026394: 5d 81 00 02 bne r12,r1,802639c <pthread_kill+0xd4>
_Thread_Dispatch_necessary = true;
8026398: 30 4d 00 0c sb (r2+12),r13
}
_Thread_Enable_dispatch();
802639c: fb ff 99 f5 calli 800cb70 <_Thread_Enable_dispatch>
return 0;
80263a0: 34 01 00 00 mvi r1,0
80263a4: e0 00 00 05 bi 80263b8 <pthread_kill+0xf0>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
80263a8: fb ff b3 2c calli 8013058 <__errno> <== NOT EXECUTED
80263ac: 34 02 00 03 mvi r2,3 <== NOT EXECUTED
80263b0: 58 22 00 00 sw (r1+0),r2
80263b4: 34 01 ff ff mvi r1,-1
}
80263b8: 2b 9d 00 04 lw ra,(sp+4)
80263bc: 2b 8b 00 18 lw r11,(sp+24)
80263c0: 2b 8c 00 14 lw r12,(sp+20)
80263c4: 2b 8d 00 10 lw r13,(sp+16)
80263c8: 2b 8e 00 0c lw r14,(sp+12)
80263cc: 2b 8f 00 08 lw r15,(sp+8)
80263d0: 37 9c 00 1c addi sp,sp,28
80263d4: c3 a0 00 00 ret
08005ee8 <pthread_mutex_timedlock>:
*/
int pthread_mutex_timedlock(
pthread_mutex_t *mutex,
const struct timespec *abstime
)
{
8005ee8: 37 9c ff ec addi sp,sp,-20
8005eec: 5b 8b 00 10 sw (sp+16),r11
8005ef0: 5b 8c 00 0c sw (sp+12),r12
8005ef4: 5b 8d 00 08 sw (sp+8),r13
8005ef8: 5b 9d 00 04 sw (sp+4),ra
8005efc: b8 20 68 00 mv r13,r1
*
* 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 );
8005f00: b8 40 08 00 mv r1,r2
8005f04: 37 82 00 14 addi r2,sp,20
8005f08: f8 00 00 41 calli 800600c <_POSIX_Absolute_timeout_to_ticks>
int _EXFUN(pthread_mutex_trylock, (pthread_mutex_t *__mutex));
int _EXFUN(pthread_mutex_unlock, (pthread_mutex_t *__mutex));
#if defined(_POSIX_TIMEOUTS)
int _EXFUN(pthread_mutex_timedlock,
8005f0c: 64 2c 00 03 cmpei r12,r1,3
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks );
8005f10: 2b 83 00 14 lw r3,(sp+20)
*
* 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 );
8005f14: b8 20 58 00 mv r11,r1
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks );
8005f18: b9 80 10 00 mv r2,r12
8005f1c: b9 a0 08 00 mv r1,r13
8005f20: fb ff ff a3 calli 8005dac <_POSIX_Mutex_Lock_support>
* This service only gives us the option to block. We used a polling
* attempt to lock if the abstime was not in the future. If we did
* not obtain the mutex, then not look at the status immediately,
* make sure the right reason is returned.
*/
if ( !do_wait && (lock_status == EBUSY) ) {
8005f24: 5d 80 00 0b bne r12,r0,8005f50 <pthread_mutex_timedlock+0x68>
8005f28: 34 02 00 10 mvi r2,16
8005f2c: 5c 22 00 09 bne r1,r2,8005f50 <pthread_mutex_timedlock+0x68>
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
8005f30: 45 60 00 05 be r11,r0,8005f44 <pthread_mutex_timedlock+0x5c><== NEVER TAKEN
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
8005f34: 35 6b ff ff addi r11,r11,-1
8005f38: 34 02 00 01 mvi r2,1
8005f3c: 50 4b 00 04 bgeu r2,r11,8005f4c <pthread_mutex_timedlock+0x64><== ALWAYS TAKEN
8005f40: e0 00 00 04 bi 8005f50 <pthread_mutex_timedlock+0x68> <== NOT EXECUTED
* not obtain the mutex, then not look at the status immediately,
* make sure the right reason is returned.
*/
if ( !do_wait && (lock_status == EBUSY) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
8005f44: 34 01 00 16 mvi r1,22 <== NOT EXECUTED
8005f48: e0 00 00 02 bi 8005f50 <pthread_mutex_timedlock+0x68> <== NOT EXECUTED
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
8005f4c: 34 01 00 74 mvi r1,116
}
return lock_status;
}
8005f50: 2b 9d 00 04 lw ra,(sp+4)
8005f54: 2b 8b 00 10 lw r11,(sp+16)
8005f58: 2b 8c 00 0c lw r12,(sp+12)
8005f5c: 2b 8d 00 08 lw r13,(sp+8)
8005f60: 37 9c 00 14 addi sp,sp,20
8005f64: c3 a0 00 00 ret
08005a18 <pthread_mutexattr_setpshared>:
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
8005a18: 34 03 00 16 mvi r3,22
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
8005a1c: 44 20 00 07 be r1,r0,8005a38 <pthread_mutexattr_setpshared+0x20>
8005a20: 28 24 00 00 lw r4,(r1+0)
8005a24: 44 80 00 05 be r4,r0,8005a38 <pthread_mutexattr_setpshared+0x20>
return EINVAL;
switch ( pshared ) {
8005a28: 34 04 00 01 mvi r4,1
8005a2c: 54 44 00 03 bgu r2,r4,8005a38 <pthread_mutexattr_setpshared+0x20><== NEVER TAKEN
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
8005a30: 58 22 00 04 sw (r1+4),r2
return 0;
8005a34: 34 03 00 00 mvi r3,0
default:
return EINVAL;
}
}
8005a38: b8 60 08 00 mv r1,r3
8005a3c: c3 a0 00 00 ret
080031d4 <pthread_mutexattr_settype>:
pthread_mutexattr_t *attr,
int type
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
80031d4: 34 03 00 16 mvi r3,22
int pthread_mutexattr_settype(
pthread_mutexattr_t *attr,
int type
)
{
if ( !attr || !attr->is_initialized )
80031d8: 44 20 00 07 be r1,r0,80031f4 <pthread_mutexattr_settype+0x20>
80031dc: 28 24 00 00 lw r4,(r1+0)
80031e0: 44 80 00 05 be r4,r0,80031f4 <pthread_mutexattr_settype+0x20><== NEVER TAKEN
return EINVAL;
switch ( type ) {
80031e4: 34 04 00 03 mvi r4,3
80031e8: 54 44 00 03 bgu r2,r4,80031f4 <pthread_mutexattr_settype+0x20>
case PTHREAD_MUTEX_NORMAL:
case PTHREAD_MUTEX_RECURSIVE:
case PTHREAD_MUTEX_ERRORCHECK:
case PTHREAD_MUTEX_DEFAULT:
attr->type = type;
80031ec: 58 22 00 10 sw (r1+16),r2
return 0;
80031f0: 34 03 00 00 mvi r3,0
default:
return EINVAL;
}
}
80031f4: b8 60 08 00 mv r1,r3
80031f8: c3 a0 00 00 ret
08004138 <pthread_once>:
int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(void)
)
{
8004138: 37 9c ff ec addi sp,sp,-20
800413c: 5b 8b 00 10 sw (sp+16),r11
8004140: 5b 8c 00 0c sw (sp+12),r12
8004144: 5b 8d 00 08 sw (sp+8),r13
8004148: 5b 9d 00 04 sw (sp+4),ra
800414c: b8 20 58 00 mv r11,r1
8004150: b8 40 60 00 mv r12,r2
if ( !once_control || !init_routine )
8004154: 64 21 00 00 cmpei r1,r1,0
8004158: 64 42 00 00 cmpei r2,r2,0
800415c: b8 41 10 00 or r2,r2,r1
return EINVAL;
8004160: 34 01 00 16 mvi r1,22
int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(void)
)
{
if ( !once_control || !init_routine )
8004164: 5c 40 00 13 bne r2,r0,80041b0 <pthread_once+0x78>
return EINVAL;
if ( !once_control->init_executed ) {
8004168: 29 6d 00 04 lw r13,(r11+4)
once_control->init_executed = true;
(*init_routine)();
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
}
return 0;
800416c: 34 01 00 00 mvi r1,0
)
{
if ( !once_control || !init_routine )
return EINVAL;
if ( !once_control->init_executed ) {
8004170: 5d a2 00 10 bne r13,r2,80041b0 <pthread_once+0x78>
rtems_mode saveMode;
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
8004174: 34 01 01 00 mvi r1,256
8004178: 34 02 01 00 mvi r2,256
800417c: 37 83 00 14 addi r3,sp,20
8004180: f8 00 01 b0 calli 8004840 <rtems_task_mode>
if ( !once_control->init_executed ) {
8004184: 29 61 00 04 lw r1,(r11+4)
8004188: 5c 2d 00 05 bne r1,r13,800419c <pthread_once+0x64> <== NEVER TAKEN
once_control->is_initialized = true;
800418c: 34 01 00 01 mvi r1,1
8004190: 59 61 00 00 sw (r11+0),r1
once_control->init_executed = true;
8004194: 59 61 00 04 sw (r11+4),r1
(*init_routine)();
8004198: d9 80 00 00 call r12
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
800419c: 2b 81 00 14 lw r1,(sp+20)
80041a0: 34 02 01 00 mvi r2,256
80041a4: 37 83 00 14 addi r3,sp,20
80041a8: f8 00 01 a6 calli 8004840 <rtems_task_mode>
}
return 0;
80041ac: 34 01 00 00 mvi r1,0
}
80041b0: 2b 9d 00 04 lw ra,(sp+4)
80041b4: 2b 8b 00 10 lw r11,(sp+16)
80041b8: 2b 8c 00 0c lw r12,(sp+12)
80041bc: 2b 8d 00 08 lw r13,(sp+8)
80041c0: 37 9c 00 14 addi sp,sp,20
80041c4: c3 a0 00 00 ret
08004414 <pthread_rwlock_init>:
int pthread_rwlock_init(
pthread_rwlock_t *rwlock,
const pthread_rwlockattr_t *attr
)
{
8004414: 37 9c ff e0 addi sp,sp,-32
8004418: 5b 8b 00 14 sw (sp+20),r11
800441c: 5b 8c 00 10 sw (sp+16),r12
8004420: 5b 8d 00 0c sw (sp+12),r13
8004424: 5b 8e 00 08 sw (sp+8),r14
8004428: 5b 9d 00 04 sw (sp+4),ra
/*
* Error check parameters
*/
if ( !rwlock )
return EINVAL;
800442c: 34 03 00 16 mvi r3,22
int pthread_rwlock_init(
pthread_rwlock_t *rwlock,
const pthread_rwlockattr_t *attr
)
{
8004430: b8 20 68 00 mv r13,r1
const pthread_rwlockattr_t *the_attr;
/*
* Error check parameters
*/
if ( !rwlock )
8004434: 44 20 00 28 be r1,r0,80044d4 <pthread_rwlock_init+0xc0>
return EINVAL;
/*
* If the user passed in NULL, use the default attributes
*/
if ( attr ) {
8004438: 5c 40 00 05 bne r2,r0,800444c <pthread_rwlock_init+0x38>
the_attr = attr;
} else {
(void) pthread_rwlockattr_init( &default_attr );
800443c: 37 8b 00 18 addi r11,sp,24
8004440: b9 60 08 00 mv r1,r11
8004444: f8 00 02 2a calli 8004cec <pthread_rwlockattr_init>
the_attr = &default_attr;
8004448: b9 60 10 00 mv r2,r11
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
800444c: 28 41 00 00 lw r1,(r2+0)
return EINVAL;
8004450: 34 03 00 16 mvi r3,22
}
/*
* Now start error checking the attributes that we are going to use
*/
if ( !the_attr->is_initialized )
8004454: 44 20 00 20 be r1,r0,80044d4 <pthread_rwlock_init+0xc0> <== NEVER TAKEN
return EINVAL;
switch ( the_attr->process_shared ) {
8004458: 28 4e 00 04 lw r14,(r2+4)
800445c: 5d c0 00 1e bne r14,r0,80044d4 <pthread_rwlock_init+0xc0> <== NEVER TAKEN
*
* 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;
8004460: 78 02 08 02 mvhi r2,0x802
8004464: 38 42 43 28 ori r2,r2,0x4328
8004468: 28 41 00 00 lw r1,(r2+0)
*/
RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes(
CORE_RWLock_Attributes *the_attributes
)
{
the_attributes->XXX = 0;
800446c: 5b 80 00 20 sw (sp+32),r0
++level;
8004470: 34 21 00 01 addi r1,r1,1
_Thread_Dispatch_disable_level = level;
8004474: 58 41 00 00 sw (r2+0),r1
* the inactive chain of free RWLock control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void )
{
return (POSIX_RWLock_Control *)
_Objects_Allocate( &_POSIX_RWLock_Information );
8004478: 78 0c 08 02 mvhi r12,0x802
800447c: 39 8c 44 a4 ori r12,r12,0x44a4
8004480: b9 80 08 00 mv r1,r12
8004484: f8 00 0b 13 calli 80070d0 <_Objects_Allocate>
8004488: b8 20 58 00 mv r11,r1
*/
_Thread_Disable_dispatch(); /* prevents deletion */
the_rwlock = _POSIX_RWLock_Allocate();
if ( !the_rwlock ) {
800448c: 5c 2e 00 04 bne r1,r14,800449c <pthread_rwlock_init+0x88>
_Thread_Enable_dispatch();
8004490: f8 00 10 b1 calli 8008754 <_Thread_Enable_dispatch>
return EAGAIN;
8004494: 34 03 00 0b mvi r3,11
8004498: e0 00 00 0f bi 80044d4 <pthread_rwlock_init+0xc0>
}
_CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes );
800449c: 34 21 00 10 addi r1,r1,16
80044a0: 37 82 00 20 addi r2,sp,32
80044a4: f8 00 09 01 calli 80068a8 <_CORE_RWLock_Initialize>
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
80044a8: 29 6e 00 08 lw r14,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
80044ac: 29 8c 00 1c lw r12,(r12+28)
80044b0: 34 02 00 02 mvi r2,2
80044b4: 21 c1 ff ff andi r1,r14,0xffff
80044b8: fb ff f1 d9 calli 8000c1c <__ashlsi3>
80044bc: b5 81 08 00 add r1,r12,r1
80044c0: 58 2b 00 00 sw (r1+0),r11
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
80044c4: 59 60 00 0c sw (r11+12),r0
&_POSIX_RWLock_Information,
&the_rwlock->Object,
0
);
*rwlock = the_rwlock->Object.id;
80044c8: 59 ae 00 00 sw (r13+0),r14
_Thread_Enable_dispatch();
80044cc: f8 00 10 a2 calli 8008754 <_Thread_Enable_dispatch>
return 0;
80044d0: 34 03 00 00 mvi r3,0
}
80044d4: b8 60 08 00 mv r1,r3
80044d8: 2b 9d 00 04 lw ra,(sp+4)
80044dc: 2b 8b 00 14 lw r11,(sp+20)
80044e0: 2b 8c 00 10 lw r12,(sp+16)
80044e4: 2b 8d 00 0c lw r13,(sp+12)
80044e8: 2b 8e 00 08 lw r14,(sp+8)
80044ec: 37 9c 00 20 addi sp,sp,32
80044f0: c3 a0 00 00 ret
08004c60 <pthread_rwlock_timedrdlock>:
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
8004c60: 37 9c ff e0 addi sp,sp,-32
8004c64: 5b 8b 00 18 sw (sp+24),r11
8004c68: 5b 8c 00 14 sw (sp+20),r12
8004c6c: 5b 8d 00 10 sw (sp+16),r13
8004c70: 5b 8e 00 0c sw (sp+12),r14
8004c74: 5b 8f 00 08 sw (sp+8),r15
8004c78: 5b 9d 00 04 sw (sp+4),ra
8004c7c: b8 20 70 00 mv r14,r1
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
return EINVAL;
8004c80: 34 0b 00 16 mvi r11,22
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
8004c84: b8 40 08 00 mv r1,r2
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
8004c88: 45 c0 00 25 be r14,r0,8004d1c <pthread_rwlock_timedrdlock+0xbc>
*
* 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 );
8004c8c: 37 82 00 1c addi r2,sp,28
8004c90: f8 00 1b 21 calli 800b914 <_POSIX_Absolute_timeout_to_ticks>
8004c94: 29 c2 00 00 lw r2,(r14+0)
8004c98: b8 20 60 00 mv r12,r1
8004c9c: 78 01 08 01 mvhi r1,0x801
8004ca0: 38 21 9a 44 ori r1,r1,0x9a44
8004ca4: 37 83 00 20 addi r3,sp,32
8004ca8: f8 00 0b 0b calli 80078d4 <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
8004cac: 2b 8f 00 20 lw r15,(sp+32)
8004cb0: 5d e0 00 1b bne r15,r0,8004d1c <pthread_rwlock_timedrdlock+0xbc>
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,
8004cb4: 65 8d 00 03 cmpei r13,r12,3
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_reading(
8004cb8: 29 c2 00 00 lw r2,(r14+0)
8004cbc: 2b 84 00 1c lw r4,(sp+28)
8004cc0: 34 21 00 10 addi r1,r1,16
8004cc4: b9 a0 18 00 mv r3,r13
8004cc8: 34 05 00 00 mvi r5,0
8004ccc: f8 00 06 d2 calli 8006814 <_CORE_RWLock_Obtain_for_reading>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
8004cd0: f8 00 0e d7 calli 800882c <_Thread_Enable_dispatch>
if ( !do_wait ) {
8004cd4: 5d af 00 0c bne r13,r15,8004d04 <pthread_rwlock_timedrdlock+0xa4>
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
8004cd8: 78 01 08 01 mvhi r1,0x801
8004cdc: 38 21 9d a0 ori r1,r1,0x9da0
8004ce0: 28 21 00 10 lw r1,(r1+16)
8004ce4: 28 22 00 34 lw r2,(r1+52)
8004ce8: 34 01 00 02 mvi r1,2
8004cec: 5c 41 00 06 bne r2,r1,8004d04 <pthread_rwlock_timedrdlock+0xa4>
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
8004cf0: 45 8d 00 0b be r12,r13,8004d1c <pthread_rwlock_timedrdlock+0xbc><== NEVER TAKEN
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
8004cf4: 35 8c ff ff addi r12,r12,-1
8004cf8: 34 01 00 01 mvi r1,1
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
8004cfc: 34 0b 00 74 mvi r11,116
_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 ||
8004d00: 50 2c 00 07 bgeu r1,r12,8004d1c <pthread_rwlock_timedrdlock+0xbc><== ALWAYS TAKEN
return ETIMEDOUT;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
(CORE_RWLock_Status) _Thread_Executing->Wait.return_code
8004d04: 78 01 08 01 mvhi r1,0x801
8004d08: 38 21 9d a0 ori r1,r1,0x9da0
8004d0c: 28 21 00 10 lw r1,(r1+16)
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
8004d10: 28 21 00 34 lw r1,(r1+52)
8004d14: f8 00 00 43 calli 8004e20 <_POSIX_RWLock_Translate_core_RWLock_return_code>
8004d18: b8 20 58 00 mv r11,r1
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
8004d1c: b9 60 08 00 mv r1,r11
8004d20: 2b 9d 00 04 lw ra,(sp+4)
8004d24: 2b 8b 00 18 lw r11,(sp+24)
8004d28: 2b 8c 00 14 lw r12,(sp+20)
8004d2c: 2b 8d 00 10 lw r13,(sp+16)
8004d30: 2b 8e 00 0c lw r14,(sp+12)
8004d34: 2b 8f 00 08 lw r15,(sp+8)
8004d38: 37 9c 00 20 addi sp,sp,32
8004d3c: c3 a0 00 00 ret
08004d40 <pthread_rwlock_timedwrlock>:
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
8004d40: 37 9c ff e0 addi sp,sp,-32
8004d44: 5b 8b 00 18 sw (sp+24),r11
8004d48: 5b 8c 00 14 sw (sp+20),r12
8004d4c: 5b 8d 00 10 sw (sp+16),r13
8004d50: 5b 8e 00 0c sw (sp+12),r14
8004d54: 5b 8f 00 08 sw (sp+8),r15
8004d58: 5b 9d 00 04 sw (sp+4),ra
8004d5c: b8 20 70 00 mv r14,r1
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
return EINVAL;
8004d60: 34 0b 00 16 mvi r11,22
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
8004d64: b8 40 08 00 mv r1,r2
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
8004d68: 45 c0 00 25 be r14,r0,8004dfc <pthread_rwlock_timedwrlock+0xbc>
*
* 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 );
8004d6c: 37 82 00 1c addi r2,sp,28
8004d70: f8 00 1a e9 calli 800b914 <_POSIX_Absolute_timeout_to_ticks>
8004d74: 29 c2 00 00 lw r2,(r14+0)
8004d78: b8 20 60 00 mv r12,r1
8004d7c: 78 01 08 01 mvhi r1,0x801
8004d80: 38 21 9a 44 ori r1,r1,0x9a44
8004d84: 37 83 00 20 addi r3,sp,32
8004d88: f8 00 0a d3 calli 80078d4 <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
8004d8c: 2b 8f 00 20 lw r15,(sp+32)
8004d90: 5d e0 00 1b bne r15,r0,8004dfc <pthread_rwlock_timedwrlock+0xbc>
(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,
8004d94: 65 8d 00 03 cmpei r13,r12,3
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_writing(
8004d98: 29 c2 00 00 lw r2,(r14+0)
8004d9c: 2b 84 00 1c lw r4,(sp+28)
8004da0: 34 21 00 10 addi r1,r1,16
8004da4: b9 a0 18 00 mv r3,r13
8004da8: 34 05 00 00 mvi r5,0
8004dac: f8 00 06 d8 calli 800690c <_CORE_RWLock_Obtain_for_writing>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
8004db0: f8 00 0e 9f calli 800882c <_Thread_Enable_dispatch>
if ( !do_wait &&
8004db4: 5d af 00 0c bne r13,r15,8004de4 <pthread_rwlock_timedwrlock+0xa4>
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
8004db8: 78 01 08 01 mvhi r1,0x801
8004dbc: 38 21 9d a0 ori r1,r1,0x9da0
8004dc0: 28 21 00 10 lw r1,(r1+16)
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait &&
8004dc4: 28 22 00 34 lw r2,(r1+52)
8004dc8: 34 01 00 02 mvi r1,2
8004dcc: 5c 41 00 06 bne r2,r1,8004de4 <pthread_rwlock_timedwrlock+0xa4>
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
8004dd0: 45 8d 00 0b be r12,r13,8004dfc <pthread_rwlock_timedwrlock+0xbc><== NEVER TAKEN
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
8004dd4: 35 8c ff ff addi r12,r12,-1
8004dd8: 34 01 00 01 mvi r1,1
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
8004ddc: 34 0b 00 74 mvi r11,116
_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 ||
8004de0: 50 2c 00 07 bgeu r1,r12,8004dfc <pthread_rwlock_timedwrlock+0xbc><== ALWAYS TAKEN
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
(CORE_RWLock_Status) _Thread_Executing->Wait.return_code
8004de4: 78 01 08 01 mvhi r1,0x801
8004de8: 38 21 9d a0 ori r1,r1,0x9da0
8004dec: 28 21 00 10 lw r1,(r1+16)
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
8004df0: 28 21 00 34 lw r1,(r1+52)
8004df4: f8 00 00 0b calli 8004e20 <_POSIX_RWLock_Translate_core_RWLock_return_code>
8004df8: b8 20 58 00 mv r11,r1
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
8004dfc: b9 60 08 00 mv r1,r11
8004e00: 2b 9d 00 04 lw ra,(sp+4)
8004e04: 2b 8b 00 18 lw r11,(sp+24)
8004e08: 2b 8c 00 14 lw r12,(sp+20)
8004e0c: 2b 8d 00 10 lw r13,(sp+16)
8004e10: 2b 8e 00 0c lw r14,(sp+12)
8004e14: 2b 8f 00 08 lw r15,(sp+8)
8004e18: 37 9c 00 20 addi sp,sp,32
8004e1c: c3 a0 00 00 ret
08004fcc <pthread_rwlock_wrlock>:
*/
int pthread_rwlock_wrlock(
pthread_rwlock_t *rwlock
)
{
8004fcc: 37 9c ff f0 addi sp,sp,-16
8004fd0: 5b 8b 00 0c sw (sp+12),r11
8004fd4: 5b 8c 00 08 sw (sp+8),r12
8004fd8: 5b 9d 00 04 sw (sp+4),ra
POSIX_RWLock_Control *the_rwlock;
Objects_Locations location;
if ( !rwlock )
return EINVAL;
8004fdc: 34 0c 00 16 mvi r12,22
*/
int pthread_rwlock_wrlock(
pthread_rwlock_t *rwlock
)
{
8004fe0: b8 20 58 00 mv r11,r1
POSIX_RWLock_Control *the_rwlock;
Objects_Locations location;
if ( !rwlock )
8004fe4: 44 20 00 16 be r1,r0,800503c <pthread_rwlock_wrlock+0x70> <== NEVER TAKEN
8004fe8: 29 62 00 00 lw r2,(r11+0)
8004fec: 78 01 08 01 mvhi r1,0x801
8004ff0: 38 21 9a 44 ori r1,r1,0x9a44
8004ff4: 37 83 00 10 addi r3,sp,16
8004ff8: f8 00 0a 37 calli 80078d4 <_Objects_Get>
8004ffc: b8 20 10 00 mv r2,r1
return EINVAL;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
8005000: 2b 81 00 10 lw r1,(sp+16)
8005004: 5c 20 00 0e bne r1,r0,800503c <pthread_rwlock_wrlock+0x70>
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_writing(
8005008: 34 41 00 10 addi r1,r2,16
800500c: 29 62 00 00 lw r2,(r11+0)
8005010: 34 03 00 01 mvi r3,1
8005014: 34 04 00 00 mvi r4,0
8005018: 34 05 00 00 mvi r5,0
800501c: f8 00 06 3c calli 800690c <_CORE_RWLock_Obtain_for_writing>
true, /* do not timeout -- wait forever */
0,
NULL
);
_Thread_Enable_dispatch();
8005020: f8 00 0e 03 calli 800882c <_Thread_Enable_dispatch>
return _POSIX_RWLock_Translate_core_RWLock_return_code(
(CORE_RWLock_Status) _Thread_Executing->Wait.return_code
8005024: 78 01 08 01 mvhi r1,0x801
8005028: 38 21 9d a0 ori r1,r1,0x9da0
800502c: 28 21 00 10 lw r1,(r1+16)
0,
NULL
);
_Thread_Enable_dispatch();
return _POSIX_RWLock_Translate_core_RWLock_return_code(
8005030: 28 21 00 34 lw r1,(r1+52)
8005034: fb ff ff 7b calli 8004e20 <_POSIX_RWLock_Translate_core_RWLock_return_code>
8005038: b8 20 60 00 mv r12,r1
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
800503c: b9 80 08 00 mv r1,r12
8005040: 2b 9d 00 04 lw ra,(sp+4)
8005044: 2b 8b 00 0c lw r11,(sp+12)
8005048: 2b 8c 00 08 lw r12,(sp+8)
800504c: 37 9c 00 10 addi sp,sp,16
8005050: c3 a0 00 00 ret
0800578c <pthread_rwlockattr_setpshared>:
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
return EINVAL;
800578c: 34 03 00 16 mvi r3,22
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
8005790: 44 20 00 07 be r1,r0,80057ac <pthread_rwlockattr_setpshared+0x20>
return EINVAL;
if ( !attr->is_initialized )
8005794: 28 24 00 00 lw r4,(r1+0)
8005798: 44 80 00 05 be r4,r0,80057ac <pthread_rwlockattr_setpshared+0x20>
return EINVAL;
switch ( pshared ) {
800579c: 34 04 00 01 mvi r4,1
80057a0: 54 44 00 03 bgu r2,r4,80057ac <pthread_rwlockattr_setpshared+0x20><== NEVER TAKEN
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
80057a4: 58 22 00 04 sw (r1+4),r2
return 0;
80057a8: 34 03 00 00 mvi r3,0
default:
return EINVAL;
}
}
80057ac: b8 60 08 00 mv r1,r3
80057b0: c3 a0 00 00 ret
08006a6c <pthread_setschedparam>:
int pthread_setschedparam(
pthread_t thread,
int policy,
struct sched_param *param
)
{
8006a6c: 37 9c ff dc addi sp,sp,-36
8006a70: 5b 8b 00 18 sw (sp+24),r11
8006a74: 5b 8c 00 14 sw (sp+20),r12
8006a78: 5b 8d 00 10 sw (sp+16),r13
8006a7c: 5b 8e 00 0c sw (sp+12),r14
8006a80: 5b 8f 00 08 sw (sp+8),r15
8006a84: 5b 9d 00 04 sw (sp+4),ra
/*
* Check all the parameters
*/
if ( !param )
return EINVAL;
8006a88: 34 0e 00 16 mvi r14,22
int pthread_setschedparam(
pthread_t thread,
int policy,
struct sched_param *param
)
{
8006a8c: b8 20 58 00 mv r11,r1
8006a90: b8 40 78 00 mv r15,r2
8006a94: b8 60 60 00 mv r12,r3
int rc;
/*
* Check all the parameters
*/
if ( !param )
8006a98: 44 60 00 43 be r3,r0,8006ba4 <pthread_setschedparam+0x138>
return EINVAL;
rc = _POSIX_Thread_Translate_sched_param(
8006a9c: b8 40 08 00 mv r1,r2
8006aa0: 37 84 00 20 addi r4,sp,32
8006aa4: b8 60 10 00 mv r2,r3
8006aa8: 37 83 00 24 addi r3,sp,36
8006aac: f8 00 19 3b calli 800cf98 <_POSIX_Thread_Translate_sched_param>
8006ab0: b8 20 70 00 mv r14,r1
policy,
param,
&budget_algorithm,
&budget_callout
);
if ( rc )
8006ab4: 5c 20 00 3c bne r1,r0,8006ba4 <pthread_setschedparam+0x138>
return rc;
/*
* Actually change the scheduling policy and parameters
*/
the_thread = _Thread_Get( thread, &location );
8006ab8: b9 60 08 00 mv r1,r11
8006abc: 37 82 00 1c addi r2,sp,28
8006ac0: f8 00 0c 0f calli 8009afc <_Thread_Get>
8006ac4: b8 20 68 00 mv r13,r1
switch ( location ) {
8006ac8: 2b 81 00 1c lw r1,(sp+28)
8006acc: 5c 2e 00 35 bne r1,r14,8006ba0 <pthread_setschedparam+0x134>
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8006ad0: 29 ab 01 1c lw r11,(r13+284)
if ( api->schedpolicy == SCHED_SPORADIC )
8006ad4: 34 01 00 04 mvi r1,4
8006ad8: 29 62 00 84 lw r2,(r11+132)
8006adc: 5c 41 00 03 bne r2,r1,8006ae8 <pthread_setschedparam+0x7c>
(void) _Watchdog_Remove( &api->Sporadic_timer );
8006ae0: 35 61 00 a8 addi r1,r11,168
8006ae4: f8 00 10 c4 calli 800adf4 <_Watchdog_Remove>
api->schedpolicy = policy;
8006ae8: 59 6f 00 84 sw (r11+132),r15
api->schedparam = *param;
8006aec: 29 81 00 14 lw r1,(r12+20)
8006af0: 29 82 00 00 lw r2,(r12+0)
8006af4: 29 86 00 04 lw r6,(r12+4)
8006af8: 29 85 00 08 lw r5,(r12+8)
8006afc: 29 84 00 0c lw r4,(r12+12)
8006b00: 29 83 00 10 lw r3,(r12+16)
8006b04: 29 87 00 18 lw r7,(r12+24)
8006b08: 59 61 00 9c sw (r11+156),r1
the_thread->budget_algorithm = budget_algorithm;
8006b0c: 2b 81 00 24 lw r1,(sp+36)
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
api->schedpolicy = policy;
api->schedparam = *param;
8006b10: 59 62 00 88 sw (r11+136),r2
8006b14: 59 66 00 8c sw (r11+140),r6
8006b18: 59 65 00 90 sw (r11+144),r5
8006b1c: 59 64 00 94 sw (r11+148),r4
8006b20: 59 63 00 98 sw (r11+152),r3
8006b24: 59 67 00 a0 sw (r11+160),r7
the_thread->budget_algorithm = budget_algorithm;
8006b28: 59 a1 00 78 sw (r13+120),r1
the_thread->budget_callout = budget_callout;
8006b2c: 2b 81 00 20 lw r1,(sp+32)
8006b30: 59 a1 00 7c sw (r13+124),r1
switch ( api->schedpolicy ) {
8006b34: 48 0f 00 19 bg r0,r15,8006b98 <pthread_setschedparam+0x12c><== NEVER TAKEN
8006b38: 34 01 00 02 mvi r1,2
8006b3c: 4c 2f 00 04 bge r1,r15,8006b4c <pthread_setschedparam+0xe0>
8006b40: 34 01 00 04 mvi r1,4
8006b44: 5d e1 00 15 bne r15,r1,8006b98 <pthread_setschedparam+0x12c><== NEVER TAKEN
8006b48: e0 00 00 0e bi 8006b80 <pthread_setschedparam+0x114>
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
8006b4c: 78 01 08 01 mvhi r1,0x801
8006b50: 38 21 a8 e0 ori r1,r1,0xa8e0
8006b54: 28 21 00 00 lw r1,(r1+0)
the_thread->real_priority =
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
8006b58: 34 03 00 01 mvi r3,1
switch ( api->schedpolicy ) {
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
8006b5c: 59 a1 00 74 sw (r13+116),r1
8006b60: 78 01 08 01 mvhi r1,0x801
8006b64: 38 21 a0 fc ori r1,r1,0xa0fc
8006b68: 40 21 00 00 lbu r1,(r1+0)
8006b6c: c8 22 10 00 sub r2,r1,r2
the_thread->real_priority =
8006b70: 59 a2 00 18 sw (r13+24),r2
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
8006b74: b9 a0 08 00 mv r1,r13
8006b78: f8 00 0a 9b calli 80095e4 <_Thread_Change_priority>
the_thread,
the_thread->real_priority,
true
);
break;
8006b7c: e0 00 00 07 bi 8006b98 <pthread_setschedparam+0x12c>
case SCHED_SPORADIC:
api->ss_high_priority = api->schedparam.sched_priority;
8006b80: 59 62 00 a4 sw (r11+164),r2
_Watchdog_Remove( &api->Sporadic_timer );
8006b84: 35 61 00 a8 addi r1,r11,168
8006b88: f8 00 10 9b calli 800adf4 <_Watchdog_Remove>
_POSIX_Threads_Sporadic_budget_TSR( 0, the_thread );
8006b8c: 34 01 00 00 mvi r1,0
8006b90: b9 a0 10 00 mv r2,r13
8006b94: fb ff ff 65 calli 8006928 <_POSIX_Threads_Sporadic_budget_TSR>
break;
}
_Thread_Enable_dispatch();
8006b98: f8 00 0b cd calli 8009acc <_Thread_Enable_dispatch>
return 0;
8006b9c: e0 00 00 02 bi 8006ba4 <pthread_setschedparam+0x138>
#endif
case OBJECTS_ERROR:
break;
}
return ESRCH;
8006ba0: 34 0e 00 03 mvi r14,3
}
8006ba4: b9 c0 08 00 mv r1,r14
8006ba8: 2b 9d 00 04 lw ra,(sp+4)
8006bac: 2b 8b 00 18 lw r11,(sp+24)
8006bb0: 2b 8c 00 14 lw r12,(sp+20)
8006bb4: 2b 8d 00 10 lw r13,(sp+16)
8006bb8: 2b 8e 00 0c lw r14,(sp+12)
8006bbc: 2b 8f 00 08 lw r15,(sp+8)
8006bc0: 37 9c 00 24 addi sp,sp,36
8006bc4: c3 a0 00 00 ret
08003e64 <pthread_testcancel>:
/*
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
*/
void pthread_testcancel( void )
{
8003e64: 37 9c ff f8 addi sp,sp,-8
8003e68: 5b 8b 00 08 sw (sp+8),r11
8003e6c: 5b 9d 00 04 sw (sp+4),ra
* Don't even think about deleting a resource from an ISR.
* Besides this request is supposed to be for _Thread_Executing
* and the ISR context is not a thread.
*/
if ( _ISR_Is_in_progress() )
8003e70: 78 01 08 01 mvhi r1,0x801
8003e74: 38 21 6d 80 ori r1,r1,0x6d80
8003e78: 28 22 00 08 lw r2,(r1+8)
8003e7c: 5c 40 00 14 bne r2,r0,8003ecc <pthread_testcancel+0x68> <== NEVER TAKEN
return;
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
8003e80: 28 21 00 10 lw r1,(r1+16)
8003e84: 28 22 01 1c lw r2,(r1+284)
*
* 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;
8003e88: 78 01 08 01 mvhi r1,0x801
8003e8c: 38 21 68 e0 ori r1,r1,0x68e0
8003e90: 28 23 00 00 lw r3,(r1+0)
++level;
8003e94: 34 63 00 01 addi r3,r3,1
_Thread_Dispatch_disable_level = level;
8003e98: 58 23 00 00 sw (r1+0),r3
_Thread_Disable_dispatch();
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
8003e9c: 28 41 00 d8 lw r1,(r2+216)
*/
void pthread_testcancel( void )
{
POSIX_API_Control *thread_support;
bool cancel = false;
8003ea0: 34 0b 00 00 mvi r11,0
return;
thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
_Thread_Disable_dispatch();
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
8003ea4: 5c 2b 00 03 bne r1,r11,8003eb0 <pthread_testcancel+0x4c> <== NEVER TAKEN
/* Setting Cancelability State, P1003.1c/Draft 10, p. 183 */
int _EXFUN(pthread_setcancelstate, (int __state, int *__oldstate));
int _EXFUN(pthread_setcanceltype, (int __type, int *__oldtype));
void _EXFUN(pthread_testcancel, (void));
8003ea8: 28 4b 00 e0 lw r11,(r2+224)
8003eac: 7d 6b 00 00 cmpnei r11,r11,0
thread_support->cancelation_requested )
cancel = true;
_Thread_Enable_dispatch();
8003eb0: f8 00 0a f3 calli 8006a7c <_Thread_Enable_dispatch>
if ( cancel )
8003eb4: 45 60 00 06 be r11,r0,8003ecc <pthread_testcancel+0x68>
_POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED );
8003eb8: 78 01 08 01 mvhi r1,0x801
8003ebc: 38 21 6d 80 ori r1,r1,0x6d80
8003ec0: 28 21 00 10 lw r1,(r1+16)
8003ec4: 34 02 ff ff mvi r2,-1
8003ec8: f8 00 18 36 calli 8009fa0 <_POSIX_Thread_Exit>
}
8003ecc: 2b 9d 00 04 lw ra,(sp+4)
8003ed0: 2b 8b 00 08 lw r11,(sp+8)
8003ed4: 37 9c 00 08 addi sp,sp,8
8003ed8: c3 a0 00 00 ret
08009168 <ramdisk_allocate>:
void *area_begin,
uint32_t media_block_size,
rtems_blkdev_bnum media_block_count,
bool trace
)
{
8009168: 37 9c ff e4 addi sp,sp,-28
800916c: 5b 8b 00 1c sw (sp+28),r11
8009170: 5b 8c 00 18 sw (sp+24),r12
8009174: 5b 8d 00 14 sw (sp+20),r13
8009178: 5b 8e 00 10 sw (sp+16),r14
800917c: 5b 8f 00 0c sw (sp+12),r15
8009180: 5b 90 00 08 sw (sp+8),r16
8009184: 5b 9d 00 04 sw (sp+4),ra
8009188: b8 20 68 00 mv r13,r1
struct ramdisk *rd = malloc(sizeof(struct ramdisk));
800918c: 34 01 00 10 mvi r1,16
void *area_begin,
uint32_t media_block_size,
rtems_blkdev_bnum media_block_count,
bool trace
)
{
8009190: b8 40 78 00 mv r15,r2
8009194: b8 60 70 00 mv r14,r3
8009198: 20 90 00 ff andi r16,r4,0xff
struct ramdisk *rd = malloc(sizeof(struct ramdisk));
800919c: fb ff e7 6b calli 8002f48 <malloc>
80091a0: b8 20 60 00 mv r12,r1
80091a4: b8 20 58 00 mv r11,r1
if (rd == NULL) {
80091a8: 44 20 00 15 be r1,r0,80091fc <ramdisk_allocate+0x94> <== NEVER TAKEN
return NULL;
}
if (area_begin == NULL) {
80091ac: 5d a0 00 0d bne r13,r0,80091e0 <ramdisk_allocate+0x78>
area_begin = calloc(media_block_count, media_block_size);
80091b0: b9 c0 08 00 mv r1,r14
80091b4: b9 e0 10 00 mv r2,r15
80091b8: fb ff e5 8c calli 80027e8 <calloc>
80091bc: b8 20 68 00 mv r13,r1
if (area_begin == NULL) {
80091c0: 5c 20 00 05 bne r1,r0,80091d4 <ramdisk_allocate+0x6c> <== ALWAYS TAKEN
free(rd);
80091c4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
80091c8: fb ff e5 d2 calli 8002910 <free> <== NOT EXECUTED
return NULL;
80091cc: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
80091d0: e0 00 00 0b bi 80091fc <ramdisk_allocate+0x94> <== NOT EXECUTED
}
rd->malloced = true;
80091d4: 34 01 00 01 mvi r1,1
80091d8: 31 81 00 0d sb (r12+13),r1
80091dc: e0 00 00 02 bi 80091e4 <ramdisk_allocate+0x7c>
} else {
rd->malloced = false;
80091e0: 30 20 00 0d sb (r1+13),r0
}
rd->block_size = media_block_size;
rd->block_num = media_block_count;
rd->area = area_begin;
rd->trace = trace;
rd->initialized = true;
80091e4: 34 01 00 01 mvi r1,1
}
rd->malloced = true;
} else {
rd->malloced = false;
}
rd->block_size = media_block_size;
80091e8: 59 6f 00 00 sw (r11+0),r15
rd->block_num = media_block_count;
80091ec: 59 6e 00 04 sw (r11+4),r14
rd->area = area_begin;
80091f0: 59 6d 00 08 sw (r11+8),r13
rd->trace = trace;
80091f4: 31 70 00 0e sb (r11+14),r16
rd->initialized = true;
80091f8: 31 61 00 0c sb (r11+12),r1
return rd;
}
80091fc: b9 80 08 00 mv r1,r12
8009200: 2b 9d 00 04 lw ra,(sp+4)
8009204: 2b 8b 00 1c lw r11,(sp+28)
8009208: 2b 8c 00 18 lw r12,(sp+24)
800920c: 2b 8d 00 14 lw r13,(sp+20)
8009210: 2b 8e 00 10 lw r14,(sp+16)
8009214: 2b 8f 00 0c lw r15,(sp+12)
8009218: 2b 90 00 08 lw r16,(sp+8)
800921c: 37 9c 00 1c addi sp,sp,28
8009220: c3 a0 00 00 ret
08009224 <ramdisk_free>:
void ramdisk_free(ramdisk *rd)
{
8009224: 37 9c ff f8 addi sp,sp,-8
8009228: 5b 8b 00 08 sw (sp+8),r11
800922c: 5b 9d 00 04 sw (sp+4),ra
8009230: b8 20 58 00 mv r11,r1
if (rd != NULL) {
8009234: 44 20 00 07 be r1,r0,8009250 <ramdisk_free+0x2c> <== NEVER TAKEN
if (rd->malloced) {
8009238: 40 21 00 0d lbu r1,(r1+13)
800923c: 44 20 00 03 be r1,r0,8009248 <ramdisk_free+0x24>
free(rd->area);
8009240: 29 61 00 08 lw r1,(r11+8)
8009244: fb ff e5 b3 calli 8002910 <free>
}
free(rd);
8009248: b9 60 08 00 mv r1,r11
800924c: fb ff e5 b1 calli 8002910 <free>
}
}
8009250: 2b 9d 00 04 lw ra,(sp+4)
8009254: 2b 8b 00 08 lw r11,(sp+8)
8009258: 37 9c 00 08 addi sp,sp,8
800925c: c3 a0 00 00 ret
0800aabc <ramdisk_initialize>:
rtems_device_driver
ramdisk_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor __attribute__((unused)),
void *arg __attribute__((unused)))
{
800aabc: 37 9c ff c0 addi sp,sp,-64
800aac0: 5b 8b 00 34 sw (sp+52),r11
800aac4: 5b 8c 00 30 sw (sp+48),r12
800aac8: 5b 8d 00 2c sw (sp+44),r13
800aacc: 5b 8e 00 28 sw (sp+40),r14
800aad0: 5b 8f 00 24 sw (sp+36),r15
800aad4: 5b 90 00 20 sw (sp+32),r16
800aad8: 5b 91 00 1c sw (sp+28),r17
800aadc: 5b 92 00 18 sw (sp+24),r18
800aae0: 5b 93 00 14 sw (sp+20),r19
800aae4: 5b 94 00 10 sw (sp+16),r20
800aae8: 5b 95 00 0c sw (sp+12),r21
800aaec: 5b 96 00 08 sw (sp+8),r22
800aaf0: 5b 9d 00 04 sw (sp+4),ra
800aaf4: b8 20 b0 00 mv r22,r1
rtems_device_minor_number i;
rtems_ramdisk_config *c = rtems_ramdisk_configuration;
struct ramdisk *r;
rtems_status_code rc;
rc = rtems_disk_io_initialize();
800aaf8: fb ff e0 6f calli 8002cb4 <rtems_disk_io_initialize>
800aafc: b8 20 10 00 mv r2,r1
if (rc != RTEMS_SUCCESSFUL)
800ab00: 5c 20 00 40 bne r1,r0,800ac00 <ramdisk_initialize+0x144> <== NEVER TAKEN
* 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));
800ab04: 78 0d 08 02 mvhi r13,0x802
800ab08: 39 ad 80 10 ori r13,r13,0x8010
800ab0c: 29 a1 00 00 lw r1,(r13+0)
800ab10: 34 02 00 10 mvi r2,16
rtems_device_major_number major,
rtems_device_minor_number minor __attribute__((unused)),
void *arg __attribute__((unused)))
{
rtems_device_minor_number i;
rtems_ramdisk_config *c = rtems_ramdisk_configuration;
800ab14: 78 0c 08 02 mvhi r12,0x802
* 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));
800ab18: fb ff e4 d6 calli 8003e70 <calloc>
r->trace = false;
for (i = 0; i < rtems_ramdisk_configuration_size; i++, c++, r++)
800ab1c: b9 a0 a0 00 mv r20,r13
{
r->malloced = false;
r->initialized = true;
r->area = c->location;
}
rc = rtems_disk_create_phys(dev, c->block_size, c->block_num,
800ab20: 78 10 08 00 mvhi r16,0x800
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";
800ab24: 78 0d 08 02 mvhi r13,0x802
* 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));
800ab28: b8 20 58 00 mv r11,r1
r->trace = false;
800ab2c: 30 20 00 0e sb (r1+14),r0
rtems_device_major_number major,
rtems_device_minor_number minor __attribute__((unused)),
void *arg __attribute__((unused)))
{
rtems_device_minor_number i;
rtems_ramdisk_config *c = rtems_ramdisk_configuration;
800ab30: 39 8c 80 04 ori r12,r12,0x8004
* 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++)
800ab34: 34 0e 00 00 mvi r14,0
{
dev_t dev = rtems_filesystem_make_dev_t(major, i);
char name [] = RAMDISK_DEVICE_BASE_NAME "a";
800ab38: 39 ad 68 c0 ori r13,r13,0x68c0
{
r->malloced = false;
r->initialized = true;
r->area = c->location;
}
rc = rtems_disk_create_phys(dev, c->block_size, c->block_num,
800ab3c: 3a 10 ac 40 ori r16,r16,0xac40
800ab40: 37 95 00 38 addi r21,sp,56
}
}
else
{
r->malloced = false;
r->initialized = true;
800ab44: 34 0f 00 01 mvi r15,1
* 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++)
800ab48: e0 00 00 2b bi 800abf4 <ramdisk_initialize+0x138>
{
dev_t dev = rtems_filesystem_make_dev_t(major, i);
char name [] = RAMDISK_DEVICE_BASE_NAME "a";
800ab4c: 29 a1 00 04 lw r1,(r13+4)
800ab50: 29 a2 00 00 lw r2,(r13+0)
name [sizeof(RAMDISK_DEVICE_BASE_NAME)] += i;
r->block_size = c->block_size;
800ab54: 29 92 00 00 lw r18,(r12+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";
800ab58: 5b 81 00 3c sw (sp+60),r1
800ab5c: 5b 82 00 38 sw (sp+56),r2
800ab60: 41 a1 00 08 lbu r1,(r13+8)
name [sizeof(RAMDISK_DEVICE_BASE_NAME)] += i;
r->block_size = c->block_size;
r->block_num = c->block_num;
800ab64: 29 91 00 04 lw r17,(r12+4)
if (c->location == NULL)
800ab68: 29 93 00 08 lw r19,(r12+8)
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;
800ab6c: b5 c1 08 00 add r1,r14,r1
800ab70: 33 81 00 40 sb (sp+64),r1
r->block_size = c->block_size;
800ab74: 59 72 00 00 sw (r11+0),r18
r->block_num = c->block_num;
800ab78: 59 71 00 04 sw (r11+4),r17
if (c->location == NULL)
800ab7c: 5e 60 00 0a bne r19,r0,800aba4 <ramdisk_initialize+0xe8> <== NEVER TAKEN
{
r->malloced = true;
r->area = malloc(r->block_size * r->block_num);
800ab80: ba 40 10 00 mv r2,r18
800ab84: ba 20 08 00 mv r1,r17
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;
800ab88: 31 6f 00 0d sb (r11+13),r15
r->area = malloc(r->block_size * r->block_num);
800ab8c: fb ff d7 0d calli 80007c0 <__mulsi3>
800ab90: fb ff e6 ed calli 8004744 <malloc>
800ab94: 59 61 00 08 sw (r11+8),r1
if (r->area == NULL) /* No enough memory for this disk */
800ab98: 44 33 00 13 be r1,r19,800abe4 <ramdisk_initialize+0x128> <== NEVER TAKEN
r->initialized = false;
continue;
}
else
{
r->initialized = true;
800ab9c: 31 6f 00 0c sb (r11+12),r15
800aba0: e0 00 00 04 bi 800abb0 <ramdisk_initialize+0xf4>
}
}
else
{
r->malloced = false;
800aba4: 31 60 00 0d sb (r11+13),r0 <== NOT EXECUTED
r->initialized = true;
800aba8: 31 6f 00 0c sb (r11+12),r15 <== NOT EXECUTED
r->area = c->location;
800abac: 59 73 00 08 sw (r11+8),r19 <== NOT EXECUTED
}
rc = rtems_disk_create_phys(dev, c->block_size, c->block_num,
800abb0: ba c0 08 00 mv r1,r22
800abb4: b9 c0 10 00 mv r2,r14
800abb8: ba 40 18 00 mv r3,r18
800abbc: ba 20 20 00 mv r4,r17
800abc0: ba 00 28 00 mv r5,r16
800abc4: b9 60 30 00 mv r6,r11
800abc8: ba a0 38 00 mv r7,r21
800abcc: fb ff df 6e calli 8002984 <rtems_disk_create_phys>
ramdisk_ioctl, r, name);
if (rc != RTEMS_SUCCESSFUL)
800abd0: 44 20 00 06 be r1,r0,800abe8 <ramdisk_initialize+0x12c> <== ALWAYS TAKEN
{
if (r->malloced)
800abd4: 41 61 00 0d lbu r1,(r11+13) <== NOT EXECUTED
800abd8: 44 20 00 03 be r1,r0,800abe4 <ramdisk_initialize+0x128> <== NOT EXECUTED
{
free(r->area);
800abdc: 29 61 00 08 lw r1,(r11+8) <== NOT EXECUTED
800abe0: fb ff e4 ee calli 8003f98 <free> <== NOT EXECUTED
}
r->initialized = false;
800abe4: 31 60 00 0c sb (r11+12),r0 <== 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++)
800abe8: 35 ce 00 01 addi r14,r14,1
800abec: 35 8c 00 0c addi r12,r12,12
800abf0: 35 6b 00 10 addi r11,r11,16
800abf4: 2a 81 00 00 lw r1,(r20+0)
800abf8: 54 2e ff d5 bgu r1,r14,800ab4c <ramdisk_initialize+0x90>
free(r->area);
}
r->initialized = false;
}
}
return RTEMS_SUCCESSFUL;
800abfc: 34 02 00 00 mvi r2,0
}
800ac00: b8 40 08 00 mv r1,r2
800ac04: 2b 9d 00 04 lw ra,(sp+4)
800ac08: 2b 8b 00 34 lw r11,(sp+52)
800ac0c: 2b 8c 00 30 lw r12,(sp+48)
800ac10: 2b 8d 00 2c lw r13,(sp+44)
800ac14: 2b 8e 00 28 lw r14,(sp+40)
800ac18: 2b 8f 00 24 lw r15,(sp+36)
800ac1c: 2b 90 00 20 lw r16,(sp+32)
800ac20: 2b 91 00 1c lw r17,(sp+28)
800ac24: 2b 92 00 18 lw r18,(sp+24)
800ac28: 2b 93 00 14 lw r19,(sp+20)
800ac2c: 2b 94 00 10 lw r20,(sp+16)
800ac30: 2b 95 00 0c lw r21,(sp+12)
800ac34: 2b 96 00 08 lw r22,(sp+8)
800ac38: 37 9c 00 40 addi sp,sp,64
800ac3c: c3 a0 00 00 ret
08009024 <ramdisk_ioctl>:
return 0;
}
int
ramdisk_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
8009024: 37 9c ff e4 addi sp,sp,-28
8009028: 5b 8b 00 1c sw (sp+28),r11
800902c: 5b 8c 00 18 sw (sp+24),r12
8009030: 5b 8d 00 14 sw (sp+20),r13
8009034: 5b 8e 00 10 sw (sp+16),r14
8009038: 5b 8f 00 0c sw (sp+12),r15
800903c: 5b 90 00 08 sw (sp+8),r16
8009040: 5b 9d 00 04 sw (sp+4),ra
struct ramdisk *rd = rtems_disk_get_driver_data(dd);
switch (req)
8009044: 78 06 08 01 mvhi r6,0x801
8009048: 38 c6 88 b8 ori r6,r6,0x88b8
800904c: 28 c5 00 00 lw r5,(r6+0)
return 0;
}
int
ramdisk_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
8009050: b8 60 58 00 mv r11,r3
struct ramdisk *rd = rtems_disk_get_driver_data(dd);
8009054: 28 2c 00 3c lw r12,(r1+60)
switch (req)
8009058: 44 45 00 30 be r2,r5,8009118 <ramdisk_ioctl+0xf4>
800905c: 78 06 08 01 mvhi r6,0x801
8009060: 38 c6 8c 98 ori r6,r6,0x8c98
8009064: 28 c5 00 00 lw r5,(r6+0)
8009068: 5c 45 00 31 bne r2,r5,800912c <ramdisk_ioctl+0x108>
{
case RTEMS_BLKIO_REQUEST:
{
rtems_blkdev_request *r = argp;
switch (r->req)
800906c: 28 61 00 00 lw r1,(r3+0)
8009070: 44 20 00 04 be r1,r0,8009080 <ramdisk_ioctl+0x5c>
8009074: 34 02 00 01 mvi r2,1
8009078: 5c 22 00 2f bne r1,r2,8009134 <ramdisk_ioctl+0x110> <== NEVER TAKEN
800907c: e0 00 00 12 bi 80090c4 <ramdisk_ioctl+0xa0>
#endif
static int
ramdisk_read(struct ramdisk *rd, rtems_blkdev_request *req)
{
uint8_t *from = rd->area;
8009080: 29 8f 00 08 lw r15,(r12+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++)
8009084: 34 6d 00 18 addi r13,r3,24
8009088: 34 0e 00 00 mvi r14,0
800908c: e0 00 00 0b bi 80090b8 <ramdisk_ioctl+0x94>
#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);
8009090: 29 a2 00 00 lw r2,(r13+0)
8009094: 29 81 00 00 lw r1,(r12+0)
8009098: 29 b0 00 08 lw r16,(r13+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++)
800909c: 35 ce 00 01 addi r14,r14,1
#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);
80090a0: f8 00 3a 9d calli 8017b14 <__mulsi3>
80090a4: 29 a3 00 04 lw r3,(r13+4)
80090a8: b5 e1 10 00 add r2,r15,r1
80090ac: ba 00 08 00 mv r1,r16
80090b0: f8 00 25 df calli 801282c <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++)
80090b4: 35 ad 00 10 addi r13,r13,16
80090b8: 29 61 00 10 lw r1,(r11+16)
80090bc: 54 2e ff f5 bgu r1,r14,8009090 <ramdisk_ioctl+0x6c>
80090c0: e0 00 00 10 bi 8009100 <ramdisk_ioctl+0xdc>
}
static int
ramdisk_write(struct ramdisk *rd, rtems_blkdev_request *req)
{
uint8_t *to = rd->area;
80090c4: 29 8f 00 08 lw r15,(r12+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++)
80090c8: 34 6d 00 18 addi r13,r3,24
80090cc: 34 0e 00 00 mvi r14,0
80090d0: e0 00 00 0a bi 80090f8 <ramdisk_ioctl+0xd4>
#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);
80090d4: 29 a2 00 00 lw r2,(r13+0)
80090d8: 29 81 00 00 lw r1,(r12+0)
#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++)
80090dc: 35 ce 00 01 addi r14,r14,1
#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);
80090e0: f8 00 3a 8d calli 8017b14 <__mulsi3>
80090e4: 29 a2 00 08 lw r2,(r13+8)
80090e8: 29 a3 00 04 lw r3,(r13+4)
80090ec: b5 e1 08 00 add r1,r15,r1
#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++)
80090f0: 35 ad 00 10 addi r13,r13,16
#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);
80090f4: f8 00 25 ce calli 801282c <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++)
80090f8: 29 61 00 10 lw r1,(r11+16)
80090fc: 54 2e ff f6 bgu r1,r14,80090d4 <ramdisk_ioctl+0xb0>
static inline void rtems_blkdev_request_done(
rtems_blkdev_request *req,
rtems_status_code status
)
{
(*req->done)(req, status);
8009100: 29 63 00 04 lw r3,(r11+4)
8009104: b9 60 08 00 mv r1,r11
8009108: 34 02 00 00 mvi r2,0
800910c: d8 60 00 00 call r3
{
case RTEMS_BLKDEV_REQ_READ:
return ramdisk_read(rd, r);
case RTEMS_BLKDEV_REQ_WRITE:
return ramdisk_write(rd, r);
8009110: 34 01 00 00 mvi r1,0
8009114: e0 00 00 0c bi 8009144 <ramdisk_ioctl+0x120>
}
break;
}
case RTEMS_BLKIO_DELETED:
if (rd->free_at_delete_request) {
8009118: 41 81 00 0f lbu r1,(r12+15)
800911c: 44 20 00 06 be r1,r0,8009134 <ramdisk_ioctl+0x110>
ramdisk_free(rd);
8009120: b9 80 08 00 mv r1,r12
8009124: f8 00 00 40 calli 8009224 <ramdisk_free>
8009128: e0 00 00 03 bi 8009134 <ramdisk_ioctl+0x110>
}
break;
default:
return rtems_blkdev_ioctl (dd, req, argp);
800912c: f8 00 0b 97 calli 800bf88 <rtems_blkdev_ioctl>
8009130: e0 00 00 05 bi 8009144 <ramdisk_ioctl+0x120>
break;
}
errno = EINVAL;
8009134: f8 00 22 e6 calli 8011ccc <__errno>
8009138: 34 02 00 16 mvi r2,22
800913c: 58 22 00 00 sw (r1+0),r2
return -1;
8009140: 34 01 ff ff mvi r1,-1
}
8009144: 2b 9d 00 04 lw ra,(sp+4)
8009148: 2b 8b 00 1c lw r11,(sp+28)
800914c: 2b 8c 00 18 lw r12,(sp+24)
8009150: 2b 8d 00 14 lw r13,(sp+20)
8009154: 2b 8e 00 10 lw r14,(sp+16)
8009158: 2b 8f 00 0c lw r15,(sp+12)
800915c: 2b 90 00 08 lw r16,(sp+8)
8009160: 37 9c 00 1c addi sp,sp,28
8009164: c3 a0 00 00 ret
08009260 <ramdisk_register>:
rtems_blkdev_bnum media_block_count,
bool trace,
const char *disk,
dev_t *dev_ptr
)
{
8009260: 37 9c ff d8 addi sp,sp,-40
8009264: 5b 8b 00 24 sw (sp+36),r11
8009268: 5b 8c 00 20 sw (sp+32),r12
800926c: 5b 8d 00 1c sw (sp+28),r13
8009270: 5b 8e 00 18 sw (sp+24),r14
8009274: 5b 8f 00 14 sw (sp+20),r15
8009278: 5b 90 00 10 sw (sp+16),r16
800927c: 5b 91 00 0c sw (sp+12),r17
8009280: 5b 92 00 08 sw (sp+8),r18
8009284: 5b 9d 00 04 sw (sp+4),ra
8009288: b8 40 78 00 mv r15,r2
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);
800928c: 78 02 08 01 mvhi r2,0x801
rtems_blkdev_bnum media_block_count,
bool trace,
const char *disk,
dev_t *dev_ptr
)
{
8009290: b8 20 80 00 mv r16,r1
8009294: 20 6b 00 ff andi r11,r3,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);
8009298: 34 01 00 00 mvi r1,0
800929c: 38 42 8c 9c ori r2,r2,0x8c9c
80092a0: 37 83 00 28 addi r3,sp,40
rtems_blkdev_bnum media_block_count,
bool trace,
const char *disk,
dev_t *dev_ptr
)
{
80092a4: b8 80 90 00 mv r18,r4
80092a8: b8 a0 70 00 mv r14,r5
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number major = 0;
80092ac: 5b 80 00 28 sw (sp+40),r0
ramdisk *rd = NULL;
dev_t dev = 0;
sc = rtems_io_register_driver(0, &ramdisk_ops, &major);
80092b0: fb ff f0 cb calli 80055dc <rtems_io_register_driver>
80092b4: b8 20 88 00 mv r17,r1
if (sc != RTEMS_SUCCESSFUL) {
return RTEMS_UNSATISFIED;
80092b8: 34 0d 00 0d mvi r13,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) {
80092bc: 5c 20 00 1b bne r1,r0,8009328 <ramdisk_register+0xc8> <== NEVER TAKEN
return RTEMS_UNSATISFIED;
}
rd = ramdisk_allocate(NULL, media_block_size, media_block_count, trace);
80092c0: b9 60 20 00 mv r4,r11
80092c4: ba 00 10 00 mv r2,r16
80092c8: b9 e0 18 00 mv r3,r15
80092cc: fb ff ff a7 calli 8009168 <ramdisk_allocate>
80092d0: 2b 8b 00 28 lw r11,(sp+40)
80092d4: b8 20 60 00 mv r12,r1
if (rd == NULL) {
rtems_io_unregister_driver(major);
80092d8: b9 60 08 00 mv r1,r11
if (sc != RTEMS_SUCCESSFUL) {
return RTEMS_UNSATISFIED;
}
rd = ramdisk_allocate(NULL, media_block_size, media_block_count, trace);
if (rd == NULL) {
80092dc: 45 91 00 0e be r12,r17,8009314 <ramdisk_register+0xb4> <== NEVER TAKEN
return RTEMS_UNSATISFIED;
}
dev = rtems_filesystem_make_dev_t(major, 0);
sc = rtems_disk_create_phys(
80092e0: 78 05 08 00 mvhi r5,0x800
80092e4: b9 60 08 00 mv r1,r11
80092e8: 34 02 00 00 mvi r2,0
80092ec: ba 00 18 00 mv r3,r16
80092f0: b9 e0 20 00 mv r4,r15
80092f4: 38 a5 90 24 ori r5,r5,0x9024
80092f8: b9 80 30 00 mv r6,r12
80092fc: ba 40 38 00 mv r7,r18
8009300: fb ff e2 0d calli 8001b34 <rtems_disk_create_phys>
media_block_count,
ramdisk_ioctl,
rd,
disk
);
if (sc != RTEMS_SUCCESSFUL) {
8009304: 44 20 00 06 be r1,r0,800931c <ramdisk_register+0xbc> <== ALWAYS TAKEN
ramdisk_free(rd);
8009308: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800930c: fb ff ff c6 calli 8009224 <ramdisk_free> <== NOT EXECUTED
rtems_io_unregister_driver(major);
8009310: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED
8009314: fb ff f1 1f calli 8005790 <rtems_io_unregister_driver> <== NOT EXECUTED
return RTEMS_UNSATISFIED;
8009318: e0 00 00 04 bi 8009328 <ramdisk_register+0xc8> <== NOT EXECUTED
}
*dev_ptr = dev;
800931c: 59 cb 00 00 sw (r14+0),r11
8009320: 59 c0 00 04 sw (r14+4),r0
return RTEMS_SUCCESSFUL;
8009324: 34 0d 00 00 mvi r13,0
}
8009328: b9 a0 08 00 mv r1,r13
800932c: 2b 9d 00 04 lw ra,(sp+4)
8009330: 2b 8b 00 24 lw r11,(sp+36)
8009334: 2b 8c 00 20 lw r12,(sp+32)
8009338: 2b 8d 00 1c lw r13,(sp+28)
800933c: 2b 8e 00 18 lw r14,(sp+24)
8009340: 2b 8f 00 14 lw r15,(sp+20)
8009344: 2b 90 00 10 lw r16,(sp+16)
8009348: 2b 91 00 0c lw r17,(sp+12)
800934c: 2b 92 00 08 lw r18,(sp+8)
8009350: 37 9c 00 28 addi sp,sp,40
8009354: c3 a0 00 00 ret
08018008 <read>:
ssize_t read(
int fd,
void *buffer,
size_t count
)
{
8018008: 37 9c ff f0 addi sp,sp,-16
801800c: 5b 8b 00 0c sw (sp+12),r11
8018010: 5b 8c 00 08 sw (sp+8),r12
8018014: 5b 9d 00 04 sw (sp+4),ra
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
8018018: 78 04 08 01 mvhi r4,0x801
801801c: 38 84 a0 10 ori r4,r4,0xa010
ssize_t read(
int fd,
void *buffer,
size_t count
)
{
8018020: b8 40 60 00 mv r12,r2
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
8018024: 28 82 00 00 lw r2,(r4+0)
8018028: 54 41 00 02 bgu r2,r1,8018030 <read+0x28>
801802c: e0 00 00 14 bi 801807c <read+0x74>
iop = rtems_libio_iop( fd );
8018030: 34 02 00 2c mvi r2,44
8018034: 78 0b 08 01 mvhi r11,0x801
8018038: 5b 83 00 10 sw (sp+16),r3
801803c: 39 6b a8 7c ori r11,r11,0xa87c
8018040: fb ff fe b5 calli 8017b14 <__mulsi3>
8018044: 29 64 00 00 lw r4,(r11+0)
rtems_libio_check_is_open( iop );
8018048: 2b 83 00 10 lw r3,(sp+16)
)
{
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
801804c: b4 81 20 00 add r4,r4,r1
rtems_libio_check_is_open( iop );
8018050: 28 82 00 08 lw r2,(r4+8)
8018054: 20 41 01 00 andi r1,r2,0x100
8018058: 44 20 00 09 be r1,r0,801807c <read+0x74>
rtems_libio_check_buffer( buffer );
801805c: 5d 80 00 04 bne r12,r0,801806c <read+0x64> <== ALWAYS TAKEN
8018060: fb ff e7 1b calli 8011ccc <__errno> <== NOT EXECUTED
8018064: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
8018068: e0 00 00 07 bi 8018084 <read+0x7c> <== NOT EXECUTED
rtems_libio_check_count( count );
801806c: 34 01 00 00 mvi r1,0
8018070: 44 60 00 0d be r3,r0,80180a4 <read+0x9c>
rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_READ, EBADF );
8018074: 20 42 00 02 andi r2,r2,0x2
8018078: 5c 40 00 06 bne r2,r0,8018090 <read+0x88>
801807c: fb ff e7 14 calli 8011ccc <__errno>
8018080: 34 02 00 09 mvi r2,9
8018084: 58 22 00 00 sw (r1+0),r2
8018088: 34 01 ff ff mvi r1,-1
801808c: e0 00 00 06 bi 80180a4 <read+0x9c>
/*
* Now process the read().
*/
return (*iop->pathinfo.handlers->read_h)( iop, buffer, count );
8018090: 28 81 00 1c lw r1,(r4+28)
8018094: b9 80 10 00 mv r2,r12
8018098: 28 25 00 08 lw r5,(r1+8)
801809c: b8 80 08 00 mv r1,r4
80180a0: d8 a0 00 00 call r5
}
80180a4: 2b 9d 00 04 lw ra,(sp+4)
80180a8: 2b 8b 00 0c lw r11,(sp+12)
80180ac: 2b 8c 00 08 lw r12,(sp+8)
80180b0: 37 9c 00 10 addi sp,sp,16
80180b4: c3 a0 00 00 ret
08003194 <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)
{
8003194: 37 9c ff c0 addi sp,sp,-64
8003198: 5b 8b 00 38 sw (sp+56),r11
800319c: 5b 8c 00 34 sw (sp+52),r12
80031a0: 5b 8d 00 30 sw (sp+48),r13
80031a4: 5b 8e 00 2c sw (sp+44),r14
80031a8: 5b 8f 00 28 sw (sp+40),r15
80031ac: 5b 90 00 24 sw (sp+36),r16
80031b0: 5b 91 00 20 sw (sp+32),r17
80031b4: 5b 92 00 1c sw (sp+28),r18
80031b8: 5b 93 00 18 sw (sp+24),r19
80031bc: 5b 94 00 14 sw (sp+20),r20
80031c0: 5b 95 00 10 sw (sp+16),r21
80031c4: 5b 96 00 0c sw (sp+12),r22
80031c8: 5b 97 00 08 sw (sp+8),r23
80031cc: 5b 9d 00 04 sw (sp+4),ra
int i;
rtems_sector_data_t *sector = NULL;
80031d0: 5b 80 00 40 sw (sp+64),r0
* 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)
{
80031d4: b8 20 b0 00 mv r22,r1
80031d8: b8 40 90 00 mv r18,r2
80031dc: b8 60 60 00 mv r12,r3
rtems_part_desc_t *new_part_desc;
rtems_status_code rc;
if ((ext_part == NULL) || (ext_part->disk_desc == NULL))
{
return RTEMS_INTERNAL_ERROR;
80031e0: 34 0d 00 19 mvi r13,25
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))
80031e4: 44 60 00 47 be r3,r0,8003300 <read_extended_partition+0x16c><== NEVER TAKEN
80031e8: 28 62 00 10 lw r2,(r3+16)
80031ec: 44 40 00 45 be r2,r0,8003300 <read_extended_partition+0x16c><== NEVER TAKEN
{
return RTEMS_INTERNAL_ERROR;
}
/* get start sector of current extended partition */
here = ext_part->start;
80031f0: 28 71 00 04 lw r17,(r3+4)
/* get first extended partition sector */
rc = get_sector(fd, here, §or);
80031f4: 37 83 00 40 addi r3,sp,64
80031f8: ba 20 10 00 mv r2,r17
80031fc: fb ff ff 70 calli 8002fbc <get_sector>
8003200: b8 20 68 00 mv r13,r1
8003204: 2b 81 00 40 lw r1,(sp+64)
if (rc != RTEMS_SUCCESSFUL)
8003208: 45 a0 00 03 be r13,r0,8003214 <read_extended_partition+0x80><== ALWAYS TAKEN
{
if (sector)
800320c: 5c 20 00 3c bne r1,r0,80032fc <read_extended_partition+0x168><== NOT EXECUTED
8003210: e0 00 00 3c bi 8003300 <read_extended_partition+0x16c> <== 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) &&
8003214: 40 24 02 02 lbu r4,(r1+514)
8003218: 34 02 00 55 mvi r2,85
800321c: 34 03 00 00 mvi r3,0
8003220: 5c 82 00 03 bne r4,r2,800322c <read_extended_partition+0x98><== NEVER TAKEN
* 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)
8003224: 40 23 02 03 lbu r3,(r1+515)
8003228: 64 63 00 aa cmpei r3,r3,170
800322c: 34 30 01 d2 addi r16,r1,466
}
if (!msdos_signature_check(sector))
{
free(sector);
return RTEMS_INTERNAL_ERROR;
8003230: b9 80 78 00 mv r15,r12
* 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)
8003234: 35 95 00 10 addi r21,r12,16
for (i = 0; i < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER; i++)
{
/* if data_to_part_desc fails skip this partition
* and parse the next one
*/
rc = data_to_part_desc(data, &new_part_desc);
8003238: 37 94 00 3c addi r20,sp,60
if (sector)
free(sector);
return rc;
}
if (!msdos_signature_check(sector))
800323c: 5c 60 00 04 bne r3,r0,800324c <read_extended_partition+0xb8><== ALWAYS TAKEN
{
free(sector);
8003240: f8 00 03 56 calli 8003f98 <free> <== NOT EXECUTED
return RTEMS_INTERNAL_ERROR;
8003244: 34 0d 00 19 mvi r13,25 <== NOT EXECUTED
8003248: e0 00 00 2e bi 8003300 <read_extended_partition+0x16c> <== NOT EXECUTED
for (i = 0; i < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER; i++)
{
/* if data_to_part_desc fails skip this partition
* and parse the next one
*/
rc = data_to_part_desc(data, &new_part_desc);
800324c: 36 01 ff f0 addi r1,r16,-16
8003250: ba 80 10 00 mv r2,r20
8003254: fb ff ff 89 calli 8003078 <data_to_part_desc>
8003258: b8 20 68 00 mv r13,r1
if (rc != RTEMS_SUCCESSFUL)
800325c: 5c 20 00 27 bne r1,r0,80032f8 <read_extended_partition+0x164><== NEVER TAKEN
{
free(sector);
return rc;
}
if (new_part_desc == NULL)
8003260: 2b 8b 00 3c lw r11,(sp+60)
8003264: 45 61 00 22 be r11,r1,80032ec <read_extended_partition+0x158>
ext_part->sub_part[i] = new_part_desc;
new_part_desc->ext_part = ext_part;
new_part_desc->disk_desc = ext_part->disk_desc;
if (is_extended(new_part_desc->sys_type))
8003268: 41 63 00 01 lbu r3,(r11+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;
800326c: 29 8e 00 10 lw r14,(r12+16)
{
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
continue;
}
ext_part->sub_part[i] = new_part_desc;
8003270: 59 eb 00 18 sw (r15+24),r11
* true if partition type is extended, false otherwise
*/
static bool
is_extended(uint8_t type)
{
return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED));
8003274: 64 61 00 85 cmpei r1,r3,133
8003278: 64 63 00 05 cmpei r3,r3,5
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
continue;
}
ext_part->sub_part[i] = new_part_desc;
new_part_desc->ext_part = ext_part;
800327c: 59 6c 00 14 sw (r11+20),r12
new_part_desc->disk_desc = ext_part->disk_desc;
8003280: 59 6e 00 10 sw (r11+16),r14
* true if partition type is extended, false otherwise
*/
static bool
is_extended(uint8_t type)
{
return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED));
8003284: b8 23 18 00 or r3,r1,r3
8003288: 29 73 00 04 lw r19,(r11+4)
ext_part->sub_part[i] = new_part_desc;
new_part_desc->ext_part = ext_part;
new_part_desc->disk_desc = ext_part->disk_desc;
if (is_extended(new_part_desc->sys_type))
800328c: 44 60 00 09 be r3,r0,80032b0 <read_extended_partition+0x11c>
{
new_part_desc->log_id = EMPTY_PARTITION;
new_part_desc->start += start;
8003290: b6 72 98 00 add r19,r19,r18
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;
8003294: 31 60 00 02 sb (r11+2),r0
new_part_desc->start += start;
8003298: 59 73 00 04 sw (r11+4),r19
read_extended_partition(fd, start, new_part_desc);
800329c: ba c0 08 00 mv r1,r22
80032a0: ba 40 10 00 mv r2,r18
80032a4: b9 60 18 00 mv r3,r11
80032a8: fb ff ff bb calli 8003194 <read_extended_partition>
80032ac: e0 00 00 10 bi 80032ec <read_extended_partition+0x158>
}
else
{
rtems_disk_desc_t *disk_desc = new_part_desc->disk_desc;
disk_desc->partitions[disk_desc->last_log_id] = new_part_desc;
80032b0: 29 d7 00 24 lw r23,(r14+36)
80032b4: 34 02 00 02 mvi r2,2
80032b8: 36 e1 00 0a addi r1,r23,10
80032bc: fb ff f5 1a calli 8000724 <__ashlsi3>
80032c0: b5 c1 20 00 add r4,r14,r1
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;
80032c4: 29 61 00 08 lw r1,(r11+8)
}
else
{
rtems_disk_desc_t *disk_desc = new_part_desc->disk_desc;
disk_desc->partitions[disk_desc->last_log_id] = new_part_desc;
new_part_desc->log_id = ++disk_desc->last_log_id;
80032c8: 36 e3 00 01 addi r3,r23,1
80032cc: 59 c3 00 24 sw (r14+36),r3
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;
80032d0: 58 8b 00 00 sw (r4+0),r11
new_part_desc->log_id = ++disk_desc->last_log_id;
80032d4: 31 63 00 02 sb (r11+2),r3
new_part_desc->start += here;
new_part_desc->end = new_part_desc->start + new_part_desc->size - 1;
80032d8: 34 21 ff ff addi r1,r1,-1
else
{
rtems_disk_desc_t *disk_desc = new_part_desc->disk_desc;
disk_desc->partitions[disk_desc->last_log_id] = new_part_desc;
new_part_desc->log_id = ++disk_desc->last_log_id;
new_part_desc->start += here;
80032dc: b6 33 18 00 add r3,r17,r19
80032e0: 59 63 00 04 sw (r11+4),r3
new_part_desc->end = new_part_desc->start + new_part_desc->size - 1;
80032e4: b4 23 18 00 add r3,r1,r3
80032e8: 59 63 00 0c sw (r11+12),r3
80032ec: 35 ef 00 04 addi r15,r15,4
80032f0: 36 10 00 10 addi r16,r16,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++)
80032f4: 5d f5 ff d6 bne r15,r21,800324c <read_extended_partition+0xb8>
new_part_desc->end = new_part_desc->start + new_part_desc->size - 1;
}
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
}
free(sector);
80032f8: 2b 81 00 40 lw r1,(sp+64)
80032fc: f8 00 03 27 calli 8003f98 <free>
return RTEMS_SUCCESSFUL;
}
8003300: b9 a0 08 00 mv r1,r13
8003304: 2b 9d 00 04 lw ra,(sp+4)
8003308: 2b 8b 00 38 lw r11,(sp+56)
800330c: 2b 8c 00 34 lw r12,(sp+52)
8003310: 2b 8d 00 30 lw r13,(sp+48)
8003314: 2b 8e 00 2c lw r14,(sp+44)
8003318: 2b 8f 00 28 lw r15,(sp+40)
800331c: 2b 90 00 24 lw r16,(sp+36)
8003320: 2b 91 00 20 lw r17,(sp+32)
8003324: 2b 92 00 1c lw r18,(sp+28)
8003328: 2b 93 00 18 lw r19,(sp+24)
800332c: 2b 94 00 14 lw r20,(sp+20)
8003330: 2b 95 00 10 lw r21,(sp+16)
8003334: 2b 96 00 0c lw r22,(sp+12)
8003338: 2b 97 00 08 lw r23,(sp+8)
800333c: 37 9c 00 40 addi sp,sp,64
8003340: c3 a0 00 00 ret
08003080 <readv>:
ssize_t readv(
int fd,
const struct iovec *iov,
int iovcnt
)
{
8003080: 37 9c ff e8 addi sp,sp,-24
8003084: 5b 8b 00 18 sw (sp+24),r11
8003088: 5b 8c 00 14 sw (sp+20),r12
800308c: 5b 8d 00 10 sw (sp+16),r13
8003090: 5b 8e 00 0c sw (sp+12),r14
8003094: 5b 8f 00 08 sw (sp+8),r15
8003098: 5b 9d 00 04 sw (sp+4),ra
800309c: b8 60 70 00 mv r14,r3
int v;
int bytes;
rtems_libio_t *iop;
bool all_zeros;
rtems_libio_check_fd( fd );
80030a0: 78 03 08 01 mvhi r3,0x801
80030a4: 38 63 60 10 ori r3,r3,0x6010
ssize_t readv(
int fd,
const struct iovec *iov,
int iovcnt
)
{
80030a8: b8 40 60 00 mv r12,r2
int v;
int bytes;
rtems_libio_t *iop;
bool all_zeros;
rtems_libio_check_fd( fd );
80030ac: 28 62 00 00 lw r2,(r3+0)
80030b0: 54 41 00 02 bgu r2,r1,80030b8 <readv+0x38>
80030b4: e0 00 00 0c bi 80030e4 <readv+0x64>
iop = rtems_libio_iop( fd );
80030b8: 78 0b 08 01 mvhi r11,0x801
80030bc: 34 02 00 2c mvi r2,44
80030c0: 39 6b 67 f8 ori r11,r11,0x67f8
80030c4: f8 00 41 5d calli 8013638 <__mulsi3>
80030c8: 29 6d 00 00 lw r13,(r11+0)
80030cc: b5 a1 68 00 add r13,r13,r1
rtems_libio_check_is_open( iop );
80030d0: 29 a1 00 08 lw r1,(r13+8)
80030d4: 20 22 01 00 andi r2,r1,0x100
80030d8: 44 40 00 03 be r2,r0,80030e4 <readv+0x64>
rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_READ, EBADF );
80030dc: 20 21 00 02 andi r1,r1,0x2
80030e0: 5c 20 00 04 bne r1,r0,80030f0 <readv+0x70> <== ALWAYS TAKEN
80030e4: f8 00 28 be calli 800d3dc <__errno>
80030e8: 34 02 00 09 mvi r2,9
80030ec: e0 00 00 14 bi 800313c <readv+0xbc>
/*
* Argument validation on IO vector
*/
if ( !iov )
80030f0: 45 80 00 11 be r12,r0,8003134 <readv+0xb4>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt <= 0 )
80030f4: 49 c0 00 02 bg r14,r0,80030fc <readv+0x7c>
80030f8: e0 00 00 0f bi 8003134 <readv+0xb4>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt > IOV_MAX )
80030fc: 34 01 04 00 mvi r1,1024
8003100: 4c 2e 00 02 bge r1,r14,8003108 <readv+0x88> <== ALWAYS TAKEN
8003104: e0 00 00 0c bi 8003134 <readv+0xb4> <== NOT EXECUTED
8003108: b9 80 10 00 mv r2,r12
800310c: 34 01 00 01 mvi r1,1
8003110: 34 04 00 00 mvi r4,0
8003114: 34 03 00 00 mvi r3,0
8003118: e0 00 00 02 bi 8003120 <readv+0xa0>
if ( iov[v].iov_base == 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
/* check for wrap */
old = total;
total += iov[v].iov_len;
800311c: b8 c0 18 00 mv r3,r6
/*
* 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 )
8003120: 28 45 00 00 lw r5,(r2+0)
8003124: 44 a0 00 04 be r5,r0,8003134 <readv+0xb4>
rtems_set_errno_and_return_minus_one( EINVAL );
/* check for wrap */
old = total;
total += iov[v].iov_len;
8003128: 28 45 00 04 lw r5,(r2+4)
800312c: b4 65 30 00 add r6,r3,r5
if ( total < old )
8003130: 4c c3 00 05 bge r6,r3,8003144 <readv+0xc4>
rtems_set_errno_and_return_minus_one( EINVAL );
8003134: f8 00 28 aa calli 800d3dc <__errno>
8003138: 34 02 00 16 mvi r2,22
800313c: 58 22 00 00 sw (r1+0),r2
8003140: e0 00 00 19 bi 80031a4 <readv+0x124>
if ( iov[v].iov_len )
all_zeros = false;
8003144: 64 a5 00 00 cmpei r5,r5,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++ ) {
8003148: 34 84 00 01 addi r4,r4,1
total += iov[v].iov_len;
if ( total < old )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iov[v].iov_len )
all_zeros = false;
800314c: c8 05 28 00 sub r5,r0,r5
8003150: a0 25 08 00 and r1,r1,r5
* 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++ ) {
8003154: 34 42 00 08 addi r2,r2,8
8003158: 49 c4 ff f1 bg r14,r4,800311c <readv+0x9c>
* 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 ) {
return 0;
800315c: 34 0b 00 00 mvi r11,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 ) {
8003160: 5c 20 00 12 bne r1,r0,80031a8 <readv+0x128>
8003164: 34 0f 00 00 mvi r15,0
/*
* Now process the readv().
*/
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
bytes = (*iop->pathinfo.handlers->read_h)(
8003168: 29 a1 00 1c lw r1,(r13+28)
800316c: 29 82 00 00 lw r2,(r12+0)
8003170: 29 83 00 04 lw r3,(r12+4)
8003174: 28 24 00 08 lw r4,(r1+8)
8003178: b9 a0 08 00 mv r1,r13
800317c: d8 80 00 00 call r4
iop,
iov[v].iov_base,
iov[v].iov_len
);
if ( bytes < 0 )
8003180: 48 01 00 09 bg r0,r1,80031a4 <readv+0x124> <== NEVER TAKEN
return -1;
if ( bytes > 0 ) {
8003184: 44 20 00 02 be r1,r0,800318c <readv+0x10c> <== NEVER TAKEN
total += bytes;
8003188: b5 61 58 00 add r11,r11,r1
}
if (bytes != iov[ v ].iov_len)
800318c: 29 82 00 04 lw r2,(r12+4)
8003190: 5c 22 00 06 bne r1,r2,80031a8 <readv+0x128> <== NEVER TAKEN
}
/*
* Now process the readv().
*/
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
8003194: 35 ef 00 01 addi r15,r15,1
8003198: 35 8c 00 08 addi r12,r12,8
800319c: 49 cf ff f3 bg r14,r15,8003168 <readv+0xe8>
80031a0: e0 00 00 02 bi 80031a8 <readv+0x128>
iov[v].iov_base,
iov[v].iov_len
);
if ( bytes < 0 )
return -1;
80031a4: 34 0b ff ff mvi r11,-1
if (bytes != iov[ v ].iov_len)
break;
}
return total;
}
80031a8: b9 60 08 00 mv r1,r11
80031ac: 2b 9d 00 04 lw ra,(sp+4)
80031b0: 2b 8b 00 18 lw r11,(sp+24)
80031b4: 2b 8c 00 14 lw r12,(sp+20)
80031b8: 2b 8d 00 10 lw r13,(sp+16)
80031bc: 2b 8e 00 0c lw r14,(sp+12)
80031c0: 2b 8f 00 08 lw r15,(sp+8)
80031c4: 37 9c 00 18 addi sp,sp,24
80031c8: c3 a0 00 00 ret
08003ae8 <realloc>:
void *realloc(
void *ptr,
size_t size
)
{
8003ae8: 37 9c ff e8 addi sp,sp,-24
8003aec: 5b 8b 00 14 sw (sp+20),r11
8003af0: 5b 8c 00 10 sw (sp+16),r12
8003af4: 5b 8d 00 0c sw (sp+12),r13
8003af8: 5b 8e 00 08 sw (sp+8),r14
8003afc: 5b 9d 00 04 sw (sp+4),ra
8003b00: b8 20 58 00 mv r11,r1
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
8003b04: 78 01 08 01 mvhi r1,0x801
8003b08: 38 21 a8 88 ori r1,r1,0xa888
void *realloc(
void *ptr,
size_t size
)
{
8003b0c: b8 40 60 00 mv r12,r2
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
8003b10: 28 22 00 10 lw r2,(r1+16)
8003b14: 34 42 00 01 addi r2,r2,1
8003b18: 58 22 00 10 sw (r1+16),r2
/*
* Do not attempt to allocate memory if in a critical section or ISR.
*/
if (_System_state_Is_up(_System_state_Get())) {
8003b1c: 78 01 08 01 mvhi r1,0x801
8003b20: 38 21 ad f8 ori r1,r1,0xadf8
8003b24: 28 22 00 00 lw r2,(r1+0)
8003b28: 34 01 00 03 mvi r1,3
8003b2c: 5c 41 00 09 bne r2,r1,8003b50 <realloc+0x68>
* 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 )
8003b30: 78 01 08 01 mvhi r1,0x801
8003b34: 38 21 a9 78 ori r1,r1,0xa978
8003b38: 28 22 00 00 lw r2,(r1+0)
8003b3c: 5c 40 00 33 bne r2,r0,8003c08 <realloc+0x120> <== NEVER TAKEN
if (_Thread_Dispatch_in_critical_section())
return (void *) 0;
if (_ISR_Nest_level > 0)
8003b40: 78 01 08 01 mvhi r1,0x801
8003b44: 38 21 ae 00 ori r1,r1,0xae00
8003b48: 28 21 00 08 lw r1,(r1+8)
8003b4c: 5c 22 00 2f bne r1,r2,8003c08 <realloc+0x120> <== NEVER TAKEN
}
/*
* Continue with realloc().
*/
if ( !ptr )
8003b50: 5d 60 00 05 bne r11,r0,8003b64 <realloc+0x7c>
return malloc( size );
8003b54: b9 80 08 00 mv r1,r12
8003b58: fb ff fc fc calli 8002f48 <malloc>
8003b5c: b8 20 58 00 mv r11,r1
8003b60: e0 00 00 2b bi 8003c0c <realloc+0x124>
if ( !size ) {
8003b64: 5d 80 00 04 bne r12,r0,8003b74 <realloc+0x8c> <== ALWAYS TAKEN
free( ptr );
8003b68: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8003b6c: fb ff fb 69 calli 8002910 <free> <== NOT EXECUTED
8003b70: e0 00 00 26 bi 8003c08 <realloc+0x120> <== NOT EXECUTED
return (void *) 0;
}
if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) {
8003b74: 78 0d 08 01 mvhi r13,0x801
8003b78: 39 ad a0 54 ori r13,r13,0xa054
8003b7c: 29 a1 00 00 lw r1,(r13+0)
8003b80: b9 60 10 00 mv r2,r11
8003b84: 37 83 00 18 addi r3,sp,24
8003b88: f8 00 0c f2 calli 8006f50 <_Protected_heap_Get_block_size>
8003b8c: 5c 20 00 05 bne r1,r0,8003ba0 <realloc+0xb8>
errno = EINVAL;
8003b90: f8 00 38 4f calli 8011ccc <__errno>
8003b94: 34 02 00 16 mvi r2,22
8003b98: 58 22 00 00 sw (r1+0),r2
8003b9c: e0 00 00 1b bi 8003c08 <realloc+0x120>
}
/*
* Now resize it.
*/
if ( _Protected_heap_Resize_block( RTEMS_Malloc_Heap, ptr, size ) ) {
8003ba0: 29 a1 00 00 lw r1,(r13+0)
8003ba4: b9 60 10 00 mv r2,r11
8003ba8: b9 80 18 00 mv r3,r12
8003bac: f8 00 0d 03 calli 8006fb8 <_Protected_heap_Resize_block>
8003bb0: b8 20 70 00 mv r14,r1
8003bb4: 5c 20 00 16 bne r1,r0,8003c0c <realloc+0x124>
* 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 );
8003bb8: b9 80 08 00 mv r1,r12
8003bbc: fb ff fc e3 calli 8002f48 <malloc>
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
8003bc0: 78 02 08 01 mvhi r2,0x801
8003bc4: 38 42 a8 88 ori r2,r2,0xa888
* 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 );
8003bc8: b8 20 68 00 mv r13,r1
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
8003bcc: 28 41 00 04 lw r1,(r2+4)
8003bd0: 34 21 ff ff addi r1,r1,-1
8003bd4: 58 41 00 04 sw (r2+4),r1
if ( !new_area ) {
8003bd8: 45 ae 00 0c be r13,r14,8003c08 <realloc+0x120>
return (void *) 0;
}
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
8003bdc: 2b 81 00 18 lw r1,(sp+24)
8003be0: b9 80 18 00 mv r3,r12
8003be4: 50 2c 00 02 bgeu r1,r12,8003bec <realloc+0x104> <== NEVER TAKEN
8003be8: b8 20 18 00 mv r3,r1
8003bec: b9 60 10 00 mv r2,r11
8003bf0: b9 a0 08 00 mv r1,r13
8003bf4: f8 00 3b 0e calli 801282c <memcpy>
free( ptr );
8003bf8: b9 60 08 00 mv r1,r11
8003bfc: fb ff fb 45 calli 8002910 <free>
return new_area;
8003c00: b9 a0 58 00 mv r11,r13
8003c04: e0 00 00 02 bi 8003c0c <realloc+0x124>
new_area = malloc( size );
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
if ( !new_area ) {
return (void *) 0;
8003c08: 34 0b 00 00 mvi r11,0
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
free( ptr );
return new_area;
}
8003c0c: b9 60 08 00 mv r1,r11
8003c10: 2b 9d 00 04 lw ra,(sp+4)
8003c14: 2b 8b 00 14 lw r11,(sp+20)
8003c18: 2b 8c 00 10 lw r12,(sp+16)
8003c1c: 2b 8d 00 0c lw r13,(sp+12)
8003c20: 2b 8e 00 08 lw r14,(sp+8)
8003c24: 37 9c 00 18 addi sp,sp,24
8003c28: c3 a0 00 00 ret
080042c4 <rtems_aio_enqueue>:
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
80042c4: 37 9c ff bc addi sp,sp,-68
80042c8: 5b 8b 00 20 sw (sp+32),r11
80042cc: 5b 8c 00 1c sw (sp+28),r12
80042d0: 5b 8d 00 18 sw (sp+24),r13
80042d4: 5b 8e 00 14 sw (sp+20),r14
80042d8: 5b 8f 00 10 sw (sp+16),r15
80042dc: 5b 90 00 0c sw (sp+12),r16
80042e0: 5b 91 00 08 sw (sp+8),r17
80042e4: 5b 9d 00 04 sw (sp+4),ra
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);
80042e8: 78 0c 08 01 mvhi r12,0x801
80042ec: 39 8c 78 40 ori r12,r12,0x7840
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
80042f0: b8 20 58 00 mv r11,r1
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);
80042f4: b9 80 08 00 mv r1,r12
80042f8: f8 00 02 cd calli 8004e2c <pthread_mutex_lock>
80042fc: b8 20 70 00 mv r14,r1
if (result != 0) {
8004300: 44 20 00 04 be r1,r0,8004310 <rtems_aio_enqueue+0x4c> <== ALWAYS TAKEN
free (req);
8004304: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8004308: fb ff f5 75 calli 80018dc <free> <== NOT EXECUTED
return result;
800430c: e0 00 00 79 bi 80044f0 <rtems_aio_enqueue+0x22c> <== NOT EXECUTED
}
/* _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);
8004310: f8 00 05 71 calli 80058d4 <pthread_self>
8004314: 37 82 00 40 addi r2,sp,64
8004318: 37 83 00 24 addi r3,sp,36
800431c: f8 00 04 34 calli 80053ec <pthread_getschedparam>
req->caller_thread = pthread_self ();
8004320: f8 00 05 6d calli 80058d4 <pthread_self>
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
8004324: 29 62 00 14 lw r2,(r11+20)
/* _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 ();
8004328: 59 61 00 10 sw (r11+16),r1
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
800432c: 2b 83 00 24 lw r3,(sp+36)
8004330: 28 41 00 10 lw r1,(r2+16)
8004334: c8 61 08 00 sub r1,r3,r1
8004338: 59 61 00 0c sw (r11+12),r1
req->policy = policy;
800433c: 2b 81 00 40 lw r1,(sp+64)
8004340: 59 61 00 08 sw (r11+8),r1
req->aiocbp->error_code = EINPROGRESS;
8004344: 34 01 00 77 mvi r1,119
8004348: 58 41 00 2c sw (r2+44),r1
req->aiocbp->return_value = 0;
if ((aio_request_queue.idle_threads == 0) &&
800434c: 29 81 00 68 lw r1,(r12+104)
req->caller_thread = pthread_self ();
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
req->aiocbp->return_value = 0;
8004350: 58 40 00 30 sw (r2+48),r0
if ((aio_request_queue.idle_threads == 0) &&
8004354: 5c 2e 00 34 bne r1,r14,8004424 <rtems_aio_enqueue+0x160> <== NEVER TAKEN
8004358: 29 83 00 64 lw r3,(r12+100)
800435c: 34 01 00 04 mvi r1,4
8004360: 48 61 00 31 bg r3,r1,8004424 <rtems_aio_enqueue+0x160>
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);
8004364: 28 42 00 00 lw r2,(r2+0)
8004368: 78 01 08 01 mvhi r1,0x801
800436c: 38 21 78 88 ori r1,r1,0x7888
8004370: 34 03 00 01 mvi r3,1
8004374: fb ff ff 67 calli 8004110 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
8004378: 28 22 00 18 lw r2,(r1+24)
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);
800437c: b8 20 68 00 mv r13,r1
8004380: 34 31 00 08 addi r17,r1,8
8004384: 34 2f 00 1c addi r15,r1,28
8004388: 34 30 00 20 addi r16,r1,32
if (r_chain->new_fd == 1) {
800438c: 34 01 00 01 mvi r1,1
8004390: 5c 41 00 1c bne r2,r1,8004400 <rtems_aio_enqueue+0x13c>
RTEMS_INLINE_ROUTINE void _Chain_Prepend(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert(_Chain_Head(the_chain), the_node);
8004394: b9 60 10 00 mv r2,r11
8004398: ba 20 08 00 mv r1,r17
800439c: f8 00 08 87 calli 80065b8 <_Chain_Insert>
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
80043a0: 34 02 00 00 mvi r2,0
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;
80043a4: 59 a0 00 18 sw (r13+24),r0
pthread_mutex_init (&r_chain->mutex, NULL);
80043a8: b9 e0 08 00 mv r1,r15
80043ac: f8 00 02 43 calli 8004cb8 <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
80043b0: 34 02 00 00 mvi r2,0
80043b4: ba 00 08 00 mv r1,r16
80043b8: f8 00 01 1e calli 8004830 <pthread_cond_init>
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
80043bc: 78 02 08 01 mvhi r2,0x801
80043c0: 78 03 08 00 mvhi r3,0x800
80043c4: 37 81 00 44 addi r1,sp,68
80043c8: 38 42 78 48 ori r2,r2,0x7848
80043cc: 38 63 3d 5c ori r3,r3,0x3d5c
80043d0: b9 a0 20 00 mv r4,r13
80043d4: f8 00 03 41 calli 80050d8 <pthread_create>
80043d8: b8 20 58 00 mv r11,r1
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
80043dc: 44 20 00 05 be r1,r0,80043f0 <rtems_aio_enqueue+0x12c> <== ALWAYS TAKEN
pthread_mutex_unlock (&aio_request_queue.mutex);
80043e0: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
80043e4: f8 00 02 c5 calli 8004ef8 <pthread_mutex_unlock> <== NOT EXECUTED
return result;
80043e8: b9 60 70 00 mv r14,r11 <== NOT EXECUTED
80043ec: e0 00 00 41 bi 80044f0 <rtems_aio_enqueue+0x22c> <== NOT EXECUTED
}
++aio_request_queue.active_threads;
80043f0: 29 81 00 64 lw r1,(r12+100)
80043f4: 34 21 00 01 addi r1,r1,1
80043f8: 59 81 00 64 sw (r12+100),r1
80043fc: e0 00 00 3a bi 80044e4 <rtems_aio_enqueue+0x220>
}
else {
/* put request in the fd chain it belongs to */
pthread_mutex_lock (&r_chain->mutex);
8004400: b9 e0 08 00 mv r1,r15
8004404: f8 00 02 8a calli 8004e2c <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
8004408: ba 20 08 00 mv r1,r17
800440c: b9 60 10 00 mv r2,r11
8004410: fb ff fe 3d calli 8003d04 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
8004414: ba 00 08 00 mv r1,r16
8004418: f8 00 01 41 calli 800491c <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
800441c: b9 e0 08 00 mv r1,r15
8004420: e0 00 00 11 bi 8004464 <rtems_aio_enqueue+0x1a0>
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,
8004424: 28 42 00 00 lw r2,(r2+0)
8004428: 78 01 08 01 mvhi r1,0x801
800442c: 38 21 78 88 ori r1,r1,0x7888
8004430: 34 03 00 00 mvi r3,0
8004434: fb ff ff 37 calli 8004110 <rtems_aio_search_fd>
8004438: b8 20 60 00 mv r12,r1
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
800443c: 44 20 00 0c be r1,r0,800446c <rtems_aio_enqueue+0x1a8>
{
pthread_mutex_lock (&r_chain->mutex);
8004440: 34 2d 00 1c addi r13,r1,28
8004444: b9 a0 08 00 mv r1,r13
8004448: f8 00 02 79 calli 8004e2c <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
800444c: 35 81 00 08 addi r1,r12,8
8004450: b9 60 10 00 mv r2,r11
8004454: fb ff fe 2c calli 8003d04 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
8004458: 35 81 00 20 addi r1,r12,32
800445c: f8 00 01 30 calli 800491c <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
8004460: b9 a0 08 00 mv r1,r13
8004464: f8 00 02 a5 calli 8004ef8 <pthread_mutex_unlock>
8004468: e0 00 00 1f bi 80044e4 <rtems_aio_enqueue+0x220>
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
800446c: 29 62 00 14 lw r2,(r11+20)
8004470: 78 01 08 01 mvhi r1,0x801
8004474: 34 03 00 01 mvi r3,1
8004478: 28 42 00 00 lw r2,(r2+0)
800447c: 38 21 78 94 ori r1,r1,0x7894
8004480: fb ff ff 24 calli 8004110 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
8004484: 28 23 00 18 lw r3,(r1+24)
8004488: 34 02 00 01 mvi r2,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);
800448c: b8 20 60 00 mv r12,r1
8004490: 34 21 00 08 addi r1,r1,8
if (r_chain->new_fd == 1) {
8004494: 5c 62 00 0b bne r3,r2,80044c0 <rtems_aio_enqueue+0x1fc>
8004498: b9 60 10 00 mv r2,r11
800449c: f8 00 08 47 calli 80065b8 <_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);
80044a0: 35 81 00 1c addi r1,r12,28
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;
80044a4: 59 80 00 18 sw (r12+24),r0
pthread_mutex_init (&r_chain->mutex, NULL);
80044a8: 34 02 00 00 mvi r2,0
80044ac: f8 00 02 03 calli 8004cb8 <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
80044b0: 35 81 00 20 addi r1,r12,32
80044b4: 34 02 00 00 mvi r2,0
80044b8: f8 00 00 de calli 8004830 <pthread_cond_init>
80044bc: e0 00 00 03 bi 80044c8 <rtems_aio_enqueue+0x204>
} else
/* just insert the request in the existing fd chain */
rtems_aio_insert_prio (&r_chain->perfd, req);
80044c0: b9 60 10 00 mv r2,r11
80044c4: fb ff fe 10 calli 8003d04 <rtems_aio_insert_prio>
if (aio_request_queue.idle_threads > 0)
80044c8: 78 01 08 01 mvhi r1,0x801
80044cc: 38 21 78 40 ori r1,r1,0x7840
80044d0: 28 21 00 68 lw r1,(r1+104)
80044d4: 4c 01 00 04 bge r0,r1,80044e4 <rtems_aio_enqueue+0x220> <== ALWAYS TAKEN
pthread_cond_signal (&aio_request_queue.new_req);
80044d8: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
80044dc: 38 21 78 44 ori r1,r1,0x7844 <== NOT EXECUTED
80044e0: f8 00 01 0f calli 800491c <pthread_cond_signal> <== NOT EXECUTED
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
80044e4: 78 01 08 01 mvhi r1,0x801
80044e8: 38 21 78 40 ori r1,r1,0x7840
80044ec: f8 00 02 83 calli 8004ef8 <pthread_mutex_unlock>
return 0;
}
80044f0: b9 c0 08 00 mv r1,r14
80044f4: 2b 9d 00 04 lw ra,(sp+4)
80044f8: 2b 8b 00 20 lw r11,(sp+32)
80044fc: 2b 8c 00 1c lw r12,(sp+28)
8004500: 2b 8d 00 18 lw r13,(sp+24)
8004504: 2b 8e 00 14 lw r14,(sp+20)
8004508: 2b 8f 00 10 lw r15,(sp+16)
800450c: 2b 90 00 0c lw r16,(sp+12)
8004510: 2b 91 00 08 lw r17,(sp+8)
8004514: 37 9c 00 44 addi sp,sp,68
8004518: c3 a0 00 00 ret
08003d5c <rtems_aio_handle>:
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
8003d5c: 37 9c ff a0 addi sp,sp,-96
8003d60: 5b 8b 00 38 sw (sp+56),r11
8003d64: 5b 8c 00 34 sw (sp+52),r12
8003d68: 5b 8d 00 30 sw (sp+48),r13
8003d6c: 5b 8e 00 2c sw (sp+44),r14
8003d70: 5b 8f 00 28 sw (sp+40),r15
8003d74: 5b 90 00 24 sw (sp+36),r16
8003d78: 5b 91 00 20 sw (sp+32),r17
8003d7c: 5b 92 00 1c sw (sp+28),r18
8003d80: 5b 93 00 18 sw (sp+24),r19
8003d84: 5b 94 00 14 sw (sp+20),r20
8003d88: 5b 95 00 10 sw (sp+16),r21
8003d8c: 5b 96 00 0c sw (sp+12),r22
8003d90: 5b 97 00 08 sw (sp+8),r23
8003d94: 5b 9d 00 04 sw (sp+4),ra
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);
8003d98: 78 0b 08 01 mvhi r11,0x801
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)) {
8003d9c: 78 12 08 01 mvhi r18,0x801
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 &&
8003da0: 78 11 08 01 mvhi r17,0x801
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8003da4: 78 10 08 01 mvhi r16,0x801
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
8003da8: b8 20 60 00 mv r12,r1
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);
8003dac: 39 6b 78 40 ori r11,r11,0x7840
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
8003db0: 37 8e 00 58 addi r14,sp,88
&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) {
8003db4: 34 15 00 74 mvi r21,116
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)) {
8003db8: 3a 52 78 98 ori r18,r18,0x7898
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 &&
8003dbc: 3a 31 78 8c ori r17,r17,0x788c
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8003dc0: 3a 10 78 44 ori r16,r16,0x7844
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);
8003dc4: 37 94 00 3c addi r20,sp,60
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
switch (req->aiocbp->aio_lio_opcode) {
8003dc8: 34 17 00 02 mvi r23,2
default:
result = -1;
}
if (result == -1) {
req->aiocbp->return_value = -1;
8003dcc: 34 13 ff ff mvi r19,-1
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
switch (req->aiocbp->aio_lio_opcode) {
8003dd0: 34 16 00 03 mvi r22,3
/* 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);
8003dd4: 35 8f 00 1c addi r15,r12,28
8003dd8: b9 e0 08 00 mv r1,r15
8003ddc: f8 00 04 14 calli 8004e2c <pthread_mutex_lock>
if (result != 0)
8003de0: 5c 20 00 7d bne r1,r0,8003fd4 <rtems_aio_handle+0x278> <== NEVER TAKEN
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003de4: 29 8d 00 08 lw r13,(r12+8)
8003de8: 35 81 00 0c addi r1,r12,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)) {
8003dec: 45 a1 00 2e be r13,r1,8003ea4 <rtems_aio_handle+0x148>
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);
8003df0: f8 00 06 b9 calli 80058d4 <pthread_self>
8003df4: 37 82 00 60 addi r2,sp,96
8003df8: ba 80 18 00 mv r3,r20
8003dfc: f8 00 05 7c calli 80053ec <pthread_getschedparam>
param.sched_priority = req->priority;
8003e00: 29 a1 00 0c lw r1,(r13+12)
8003e04: 5b 81 00 3c sw (sp+60),r1
pthread_setschedparam (pthread_self(), req->policy, ¶m);
8003e08: f8 00 06 b3 calli 80058d4 <pthread_self>
8003e0c: 29 a2 00 08 lw r2,(r13+8)
8003e10: ba 80 18 00 mv r3,r20
8003e14: f8 00 06 b5 calli 80058e8 <pthread_setschedparam>
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
8003e18: b9 a0 08 00 mv r1,r13
8003e1c: f8 00 09 ce calli 8006554 <_Chain_Extract>
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
8003e20: b9 e0 08 00 mv r1,r15
8003e24: f8 00 04 35 calli 8004ef8 <pthread_mutex_unlock>
switch (req->aiocbp->aio_lio_opcode) {
8003e28: 29 a4 00 14 lw r4,(r13+20)
8003e2c: 28 81 00 28 lw r1,(r4+40)
8003e30: 44 37 00 0a be r1,r23,8003e58 <rtems_aio_handle+0xfc>
8003e34: 44 36 00 0f be r1,r22,8003e70 <rtems_aio_handle+0x114> <== NEVER TAKEN
8003e38: 34 02 00 01 mvi r2,1
8003e3c: 5c 22 00 10 bne r1,r2,8003e7c <rtems_aio_handle+0x120> <== NEVER TAKEN
case LIO_READ:
AIO_printf ("read\n");
result = pread (req->aiocbp->aio_fildes,
8003e40: 28 82 00 08 lw r2,(r4+8)
8003e44: 28 83 00 0c lw r3,(r4+12)
8003e48: 28 81 00 00 lw r1,(r4+0)
8003e4c: 28 84 00 04 lw r4,(r4+4)
8003e50: f8 00 2f 69 calli 800fbf4 <pread>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
8003e54: e0 00 00 09 bi 8003e78 <rtems_aio_handle+0x11c>
case LIO_WRITE:
AIO_printf ("write\n");
result = pwrite (req->aiocbp->aio_fildes,
8003e58: 28 82 00 08 lw r2,(r4+8)
8003e5c: 28 83 00 0c lw r3,(r4+12)
8003e60: 28 81 00 00 lw r1,(r4+0)
8003e64: 28 84 00 04 lw r4,(r4+4)
8003e68: f8 00 2f a7 calli 800fd04 <pwrite>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
8003e6c: e0 00 00 03 bi 8003e78 <rtems_aio_handle+0x11c>
case LIO_SYNC:
AIO_printf ("sync\n");
result = fsync (req->aiocbp->aio_fildes);
8003e70: 28 81 00 00 lw r1,(r4+0) <== NOT EXECUTED
8003e74: f8 00 1c 18 calli 800aed4 <fsync> <== NOT EXECUTED
break;
default:
result = -1;
}
if (result == -1) {
8003e78: 5c 33 00 07 bne r1,r19,8003e94 <rtems_aio_handle+0x138> <== ALWAYS TAKEN
req->aiocbp->return_value = -1;
8003e7c: 29 ad 00 14 lw r13,(r13+20) <== NOT EXECUTED
8003e80: 59 b3 00 30 sw (r13+48),r19 <== NOT EXECUTED
req->aiocbp->error_code = errno;
8003e84: f8 00 2b ac calli 800ed34 <__errno> <== NOT EXECUTED
8003e88: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
8003e8c: 59 a1 00 2c sw (r13+44),r1 <== NOT EXECUTED
8003e90: e3 ff ff d1 bi 8003dd4 <rtems_aio_handle+0x78> <== NOT EXECUTED
} else {
req->aiocbp->return_value = result;
8003e94: 29 a2 00 14 lw r2,(r13+20)
8003e98: 58 41 00 30 sw (r2+48),r1
req->aiocbp->error_code = 0;
8003e9c: 58 40 00 2c sw (r2+44),r0
8003ea0: e3 ff ff cd bi 8003dd4 <rtems_aio_handle+0x78>
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
8003ea4: b9 e0 08 00 mv r1,r15
8003ea8: f8 00 04 14 calli 8004ef8 <pthread_mutex_unlock>
pthread_mutex_lock (&aio_request_queue.mutex);
8003eac: b9 60 08 00 mv r1,r11
8003eb0: f8 00 03 df calli 8004e2c <pthread_mutex_lock>
if (rtems_chain_is_empty (chain))
8003eb4: 29 81 00 08 lw r1,(r12+8)
8003eb8: 5c 2d 00 44 bne r1,r13,8003fc8 <rtems_aio_handle+0x26c> <== NEVER TAKEN
{
clock_gettime (CLOCK_REALTIME, &timeout);
8003ebc: b9 c0 10 00 mv r2,r14
8003ec0: 34 01 00 01 mvi r1,1
8003ec4: f8 00 01 e9 calli 8004668 <clock_gettime>
timeout.tv_sec += 3;
8003ec8: 2b 81 00 58 lw r1,(sp+88)
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
8003ecc: 35 8d 00 20 addi r13,r12,32
8003ed0: b9 60 10 00 mv r2,r11
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
8003ed4: 34 21 00 03 addi r1,r1,3
8003ed8: 5b 81 00 58 sw (sp+88),r1
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
8003edc: b9 c0 18 00 mv r3,r14
8003ee0: b9 a0 08 00 mv r1,r13
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
8003ee4: 5b 80 00 5c sw (sp+92),r0
result = pthread_cond_timedwait (&r_chain->cond,
8003ee8: f8 00 02 b1 calli 80049ac <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) {
8003eec: 5c 35 00 37 bne r1,r21,8003fc8 <rtems_aio_handle+0x26c> <== NEVER TAKEN
8003ef0: b9 80 08 00 mv r1,r12
8003ef4: f8 00 09 98 calli 8006554 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
pthread_mutex_destroy (&r_chain->mutex);
8003ef8: b9 e0 08 00 mv r1,r15
8003efc: f8 00 03 12 calli 8004b44 <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->cond);
8003f00: b9 a0 08 00 mv r1,r13
8003f04: f8 00 02 11 calli 8004748 <pthread_cond_destroy>
free (r_chain);
8003f08: b9 80 08 00 mv r1,r12
8003f0c: fb ff f6 74 calli 80018dc <free>
/* 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)) {
8003f10: 29 61 00 54 lw r1,(r11+84)
8003f14: 5c 32 00 19 bne r1,r18,8003f78 <rtems_aio_handle+0x21c>
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
8003f18: 29 61 00 68 lw r1,(r11+104)
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
8003f1c: b9 c0 10 00 mv r2,r14
/* 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;
8003f20: 34 21 00 01 addi r1,r1,1
8003f24: 59 61 00 68 sw (r11+104),r1
--aio_request_queue.active_threads;
8003f28: 29 61 00 64 lw r1,(r11+100)
8003f2c: 34 21 ff ff addi r1,r1,-1
8003f30: 59 61 00 64 sw (r11+100),r1
clock_gettime (CLOCK_REALTIME, &timeout);
8003f34: 34 01 00 01 mvi r1,1
8003f38: f8 00 01 cc calli 8004668 <clock_gettime>
timeout.tv_sec += 3;
8003f3c: 2b 81 00 58 lw r1,(sp+88)
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8003f40: b9 60 10 00 mv r2,r11
8003f44: b9 c0 18 00 mv r3,r14
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;
8003f48: 34 21 00 03 addi r1,r1,3
8003f4c: 5b 81 00 58 sw (sp+88),r1
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8003f50: ba 00 08 00 mv r1,r16
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
timeout.tv_nsec = 0;
8003f54: 5b 80 00 5c sw (sp+92),r0
result = pthread_cond_timedwait (&aio_request_queue.new_req,
8003f58: f8 00 02 95 calli 80049ac <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) {
8003f5c: 5c 35 00 07 bne r1,r21,8003f78 <rtems_aio_handle+0x21c> <== NEVER TAKEN
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
8003f60: 29 61 00 68 lw r1,(r11+104)
8003f64: 34 21 ff ff addi r1,r1,-1
8003f68: 59 61 00 68 sw (r11+104),r1
pthread_mutex_unlock (&aio_request_queue.mutex);
8003f6c: b9 60 08 00 mv r1,r11
8003f70: f8 00 03 e2 calli 8004ef8 <pthread_mutex_unlock>
return NULL;
8003f74: e0 00 00 18 bi 8003fd4 <rtems_aio_handle+0x278>
}
}
/* 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;
8003f78: 29 61 00 68 lw r1,(r11+104)
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003f7c: 29 6d 00 54 lw r13,(r11+84)
}
}
/* 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;
8003f80: 34 21 ff ff addi r1,r1,-1
8003f84: 59 61 00 68 sw (r11+104),r1
++aio_request_queue.active_threads;
8003f88: 29 61 00 64 lw r1,(r11+100)
node = rtems_chain_first (&aio_request_queue.idle_req);
rtems_chain_extract (node);
r_chain = (rtems_aio_request_chain *) node;
8003f8c: b9 a0 60 00 mv r12,r13
}
/* 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;
++aio_request_queue.active_threads;
8003f90: 34 21 00 01 addi r1,r1,1
8003f94: 59 61 00 64 sw (r11+100),r1
8003f98: b9 a0 08 00 mv r1,r13
8003f9c: f8 00 09 6e calli 8006554 <_Chain_Extract>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003fa0: 29 64 00 48 lw r4,(r11+72)
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 &&
8003fa4: 29 a1 00 14 lw r1,(r13+20)
8003fa8: e0 00 00 02 bi 8003fb0 <rtems_aio_handle+0x254>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003fac: 28 84 00 00 lw r4,(r4+0)
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 &&
8003fb0: 28 82 00 14 lw r2,(r4+20)
8003fb4: 4c 41 00 02 bge r2,r1,8003fbc <rtems_aio_handle+0x260>
8003fb8: 5c 91 ff fd bne r4,r17,8003fac <rtems_aio_handle+0x250> <== ALWAYS TAKEN
RTEMS_INLINE_ROUTINE void rtems_chain_insert(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
{
_Chain_Insert( after_node, the_node );
8003fbc: 28 81 00 04 lw r1,(r4+4)
8003fc0: b9 a0 10 00 mv r2,r13
8003fc4: f8 00 09 7d calli 80065b8 <_Chain_Insert>
}
}
/* 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);
8003fc8: b9 60 08 00 mv r1,r11
8003fcc: f8 00 03 cb calli 8004ef8 <pthread_mutex_unlock>
8003fd0: e3 ff ff 81 bi 8003dd4 <rtems_aio_handle+0x78>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003fd4: 34 01 00 00 mvi r1,0
8003fd8: 2b 9d 00 04 lw ra,(sp+4)
8003fdc: 2b 8b 00 38 lw r11,(sp+56)
8003fe0: 2b 8c 00 34 lw r12,(sp+52)
8003fe4: 2b 8d 00 30 lw r13,(sp+48)
8003fe8: 2b 8e 00 2c lw r14,(sp+44)
8003fec: 2b 8f 00 28 lw r15,(sp+40)
8003ff0: 2b 90 00 24 lw r16,(sp+36)
8003ff4: 2b 91 00 20 lw r17,(sp+32)
8003ff8: 2b 92 00 1c lw r18,(sp+28)
8003ffc: 2b 93 00 18 lw r19,(sp+24)
8004000: 2b 94 00 14 lw r20,(sp+20)
8004004: 2b 95 00 10 lw r21,(sp+16)
8004008: 2b 96 00 0c lw r22,(sp+12)
800400c: 2b 97 00 08 lw r23,(sp+8)
8004010: 37 9c 00 60 addi sp,sp,96
8004014: c3 a0 00 00 ret
08004018 <rtems_aio_init>:
* 0 - if initialization succeeded
*/
int
rtems_aio_init (void)
{
8004018: 37 9c ff f4 addi sp,sp,-12
800401c: 5b 8b 00 0c sw (sp+12),r11
8004020: 5b 8c 00 08 sw (sp+8),r12
8004024: 5b 9d 00 04 sw (sp+4),ra
int result = 0;
result = pthread_attr_init (&aio_request_queue.attr);
8004028: 78 0c 08 01 mvhi r12,0x801
800402c: 39 8c 78 48 ori r12,r12,0x7848
8004030: b9 80 08 00 mv r1,r12
8004034: f8 00 04 12 calli 800507c <pthread_attr_init>
8004038: b8 20 58 00 mv r11,r1
if (result != 0)
800403c: 5c 20 00 2f bne r1,r0,80040f8 <rtems_aio_init+0xe0> <== NEVER TAKEN
return result;
result =
8004040: b9 80 08 00 mv r1,r12
8004044: 34 02 00 00 mvi r2,0
8004048: f8 00 04 1a calli 80050b0 <pthread_attr_setdetachstate>
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
800404c: 44 2b 00 03 be r1,r11,8004058 <rtems_aio_init+0x40> <== ALWAYS TAKEN
pthread_attr_destroy (&aio_request_queue.attr);
8004050: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8004054: f8 00 04 02 calli 800505c <pthread_attr_destroy> <== NOT EXECUTED
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
8004058: 78 01 08 01 mvhi r1,0x801
800405c: 38 21 78 40 ori r1,r1,0x7840
8004060: 34 02 00 00 mvi r2,0
8004064: f8 00 03 15 calli 8004cb8 <pthread_mutex_init>
if (result != 0)
8004068: 44 20 00 04 be r1,r0,8004078 <rtems_aio_init+0x60> <== ALWAYS TAKEN
pthread_attr_destroy (&aio_request_queue.attr);
800406c: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
8004070: 38 21 78 48 ori r1,r1,0x7848 <== NOT EXECUTED
8004074: f8 00 03 fa calli 800505c <pthread_attr_destroy> <== NOT EXECUTED
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
8004078: 78 01 08 01 mvhi r1,0x801
800407c: 38 21 78 44 ori r1,r1,0x7844
8004080: 34 02 00 00 mvi r2,0
8004084: f8 00 01 eb calli 8004830 <pthread_cond_init>
8004088: b8 20 58 00 mv r11,r1
if (result != 0) {
800408c: 44 20 00 07 be r1,r0,80040a8 <rtems_aio_init+0x90> <== ALWAYS TAKEN
pthread_mutex_destroy (&aio_request_queue.mutex);
8004090: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
8004094: 38 21 78 40 ori r1,r1,0x7840 <== NOT EXECUTED
8004098: f8 00 02 ab calli 8004b44 <pthread_mutex_destroy> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
800409c: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
80040a0: 38 21 78 48 ori r1,r1,0x7848 <== NOT EXECUTED
80040a4: f8 00 03 ee calli 800505c <pthread_attr_destroy> <== NOT EXECUTED
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
80040a8: 78 02 08 01 mvhi r2,0x801
80040ac: 78 01 08 01 mvhi r1,0x801
80040b0: 38 42 78 40 ori r2,r2,0x7840
80040b4: 38 21 78 8c ori r1,r1,0x788c
80040b8: 58 41 00 48 sw (r2+72),r1
head->previous = NULL;
tail->previous = head;
80040bc: 78 01 08 01 mvhi r1,0x801
80040c0: 38 21 78 88 ori r1,r1,0x7888
80040c4: 58 41 00 50 sw (r2+80),r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
80040c8: 78 01 08 01 mvhi r1,0x801
80040cc: 38 21 78 98 ori r1,r1,0x7898
80040d0: 58 41 00 54 sw (r2+84),r1
head->previous = NULL;
tail->previous = head;
80040d4: 78 01 08 01 mvhi r1,0x801
80040d8: 38 21 78 94 ori r1,r1,0x7894
80040dc: 58 41 00 5c sw (r2+92),r1
rtems_chain_initialize_empty (&aio_request_queue.work_req);
rtems_chain_initialize_empty (&aio_request_queue.idle_req);
aio_request_queue.active_threads = 0;
aio_request_queue.idle_threads = 0;
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
80040e0: 38 01 b0 0b mvu r1,0xb00b
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
80040e4: 58 40 00 4c sw (r2+76),r0
80040e8: 58 40 00 58 sw (r2+88),r0
}
rtems_chain_initialize_empty (&aio_request_queue.work_req);
rtems_chain_initialize_empty (&aio_request_queue.idle_req);
aio_request_queue.active_threads = 0;
80040ec: 58 40 00 64 sw (r2+100),r0
aio_request_queue.idle_threads = 0;
80040f0: 58 40 00 68 sw (r2+104),r0
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
80040f4: 58 41 00 60 sw (r2+96),r1
return result;
}
80040f8: b9 60 08 00 mv r1,r11
80040fc: 2b 9d 00 04 lw ra,(sp+4)
8004100: 2b 8b 00 0c lw r11,(sp+12)
8004104: 2b 8c 00 08 lw r12,(sp+8)
8004108: 37 9c 00 0c addi sp,sp,12
800410c: c3 a0 00 00 ret
08003d04 <rtems_aio_insert_prio>:
* NONE
*/
static void
rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req)
{
8003d04: 37 9c ff fc addi sp,sp,-4
8003d08: 5b 9d 00 04 sw (sp+4),ra
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003d0c: 28 23 00 00 lw r3,(r1+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
8003d10: 34 25 00 04 addi r5,r1,4
* NONE
*/
static void
rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req)
{
8003d14: b8 40 20 00 mv r4,r2
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
8003d18: 44 65 00 0d be r3,r5,8003d4c <rtems_aio_insert_prio+0x48> <== NEVER TAKEN
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;
8003d1c: 28 61 00 14 lw r1,(r3+20)
while (req->aiocbp->aio_reqprio > prio &&
8003d20: 28 42 00 14 lw r2,(r2+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;
8003d24: 28 21 00 10 lw r1,(r1+16)
while (req->aiocbp->aio_reqprio > prio &&
8003d28: 28 42 00 10 lw r2,(r2+16)
8003d2c: e0 00 00 04 bi 8003d3c <rtems_aio_insert_prio+0x38>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8003d30: 28 63 00 00 lw r3,(r3+0) <== NOT EXECUTED
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
!rtems_chain_is_tail (chain, node)) {
node = rtems_chain_next (node);
prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
8003d34: 28 61 00 14 lw r1,(r3+20) <== NOT EXECUTED
8003d38: 28 21 00 10 lw r1,(r1+16) <== 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 &&
8003d3c: 4c 22 00 02 bge r1,r2,8003d44 <rtems_aio_insert_prio+0x40> <== ALWAYS TAKEN
8003d40: 5c 65 ff fc bne r3,r5,8003d30 <rtems_aio_insert_prio+0x2c> <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void rtems_chain_insert(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
{
_Chain_Insert( after_node, the_node );
8003d44: 28 61 00 04 lw r1,(r3+4)
8003d48: b8 80 10 00 mv r2,r4
8003d4c: f8 00 0a 1b calli 80065b8 <_Chain_Insert>
}
rtems_chain_insert (node->previous, &req->next_prio);
}
}
8003d50: 2b 9d 00 04 lw ra,(sp+4)
8003d54: 37 9c 00 04 addi sp,sp,4
8003d58: c3 a0 00 00 ret
08004254 <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)
{
8004254: 37 9c ff f8 addi sp,sp,-8
8004258: 5b 8b 00 08 sw (sp+8),r11
800425c: 5b 9d 00 04 sw (sp+4),ra
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8004260: 28 2b 00 00 lw r11,(r1+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
8004264: 34 23 00 04 addi r3,r1,4
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
if (rtems_chain_is_empty (chain))
return AIO_ALLDONE;
8004268: 34 01 00 02 mvi r1,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))
800426c: 5d 63 00 04 bne r11,r3,800427c <rtems_aio_remove_req+0x28>
8004270: e0 00 00 11 bi 80042b4 <rtems_aio_remove_req+0x60>
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
8004274: 29 6b 00 00 lw r11,(r11+0) <== 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) {
8004278: 45 63 00 0e be r11,r3,80042b0 <rtems_aio_remove_req+0x5c> <== NOT EXECUTED
800427c: 29 61 00 14 lw r1,(r11+20)
8004280: 5c 22 ff fd bne r1,r2,8004274 <rtems_aio_remove_req+0x20> <== NEVER TAKEN
8004284: b9 60 08 00 mv r1,r11
8004288: f8 00 08 b3 calli 8006554 <_Chain_Extract>
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
800428c: 29 61 00 14 lw r1,(r11+20)
8004290: 34 02 00 8c mvi r2,140
8004294: 58 22 00 2c sw (r1+44),r2
current->aiocbp->return_value = -1;
8004298: 34 02 ff ff mvi r2,-1
800429c: 58 22 00 30 sw (r1+48),r2
free (current);
80042a0: b9 60 08 00 mv r1,r11
80042a4: fb ff f5 8e calli 80018dc <free>
}
return AIO_CANCELED;
80042a8: 34 01 00 00 mvi r1,0
80042ac: e0 00 00 02 bi 80042b4 <rtems_aio_remove_req+0x60>
node = rtems_chain_next (node);
current = (rtems_aio_request *) node;
}
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
80042b0: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
current->aiocbp->return_value = -1;
free (current);
}
return AIO_CANCELED;
}
80042b4: 2b 9d 00 04 lw ra,(sp+4)
80042b8: 2b 8b 00 08 lw r11,(sp+8)
80042bc: 37 9c 00 08 addi sp,sp,8
80042c0: c3 a0 00 00 ret
0800963c <rtems_bdbuf_add_to_modified_list_after_access>:
}
}
static void
rtems_bdbuf_add_to_modified_list_after_access (rtems_bdbuf_buffer *bd)
{
800963c: 37 9c ff f8 addi sp,sp,-8
8009640: 5b 8b 00 08 sw (sp+8),r11
8009644: 5b 9d 00 04 sw (sp+4),ra
8009648: b8 20 58 00 mv r11,r1
if (bdbuf_cache.sync_active && bdbuf_cache.sync_device == bd->dd)
800964c: 78 01 08 01 mvhi r1,0x801
8009650: 38 21 a7 74 ori r1,r1,0xa774
8009654: 40 22 00 30 lbu r2,(r1+48)
8009658: 44 40 00 08 be r2,r0,8009678 <rtems_bdbuf_add_to_modified_list_after_access+0x3c><== ALWAYS TAKEN
800965c: 28 21 00 38 lw r1,(r1+56) <== NOT EXECUTED
8009660: 29 62 00 14 lw r2,(r11+20) <== NOT EXECUTED
8009664: 5c 22 00 05 bne r1,r2,8009678 <rtems_bdbuf_add_to_modified_list_after_access+0x3c><== NOT EXECUTED
{
rtems_bdbuf_unlock_cache ();
8009668: fb ff ff c8 calli 8009588 <rtems_bdbuf_unlock_cache> <== NOT EXECUTED
/*
* Wait for the sync lock.
*/
rtems_bdbuf_lock_sync ();
800966c: fb ff ff a5 calli 8009500 <rtems_bdbuf_lock_sync> <== NOT EXECUTED
rtems_bdbuf_unlock_sync ();
8009670: fb ff ff d0 calli 80095b0 <rtems_bdbuf_unlock_sync> <== NOT EXECUTED
rtems_bdbuf_lock_cache ();
8009674: fb ff ff 99 calli 80094d8 <rtems_bdbuf_lock_cache> <== NOT EXECUTED
* difficult question. Is a snapshot of a block that is changing better than
* nothing being written? We have tended to think we should hold changes for
* only a specific period of time even if still changing and get onto disk
* and letting the file system try and recover this position if it can.
*/
if (bd->state == RTEMS_BDBUF_STATE_ACCESS_CACHED
8009678: 29 61 00 20 lw r1,(r11+32)
|| bd->state == RTEMS_BDBUF_STATE_ACCESS_EMPTY)
800967c: 64 22 00 05 cmpei r2,r1,5
8009680: 64 21 00 03 cmpei r1,r1,3
* 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
8009684: b8 41 08 00 or r1,r2,r1
8009688: 44 20 00 05 be r1,r0,800969c <rtems_bdbuf_add_to_modified_list_after_access+0x60>
|| bd->state == RTEMS_BDBUF_STATE_ACCESS_EMPTY)
bd->hold_timer = bdbuf_config.swap_block_hold;
800968c: 78 01 08 01 mvhi r1,0x801
8009690: 38 21 87 bc ori r1,r1,0x87bc
8009694: 28 21 00 10 lw r1,(r1+16)
8009698: 59 61 00 2c sw (r11+44),r1
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800969c: 34 01 00 07 mvi r1,7
80096a0: 59 61 00 20 sw (r11+32),r1
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
80096a4: 78 01 08 01 mvhi r1,0x801
80096a8: 38 21 a7 74 ori r1,r1,0xa774
the_node->next = tail;
80096ac: 78 02 08 01 mvhi r2,0x801
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
80096b0: 28 23 00 54 lw r3,(r1+84)
the_node->next = tail;
80096b4: 38 42 a7 c4 ori r2,r2,0xa7c4
80096b8: 59 62 00 00 sw (r11+0),r2
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)
80096bc: 29 62 00 24 lw r2,(r11+36)
tail->previous = the_node;
80096c0: 58 2b 00 54 sw (r1+84),r11
old_last->next = the_node;
80096c4: 58 6b 00 00 sw (r3+0),r11
the_node->previous = old_last;
80096c8: 59 63 00 04 sw (r11+4),r3
80096cc: 44 40 00 05 be r2,r0,80096e0 <rtems_bdbuf_add_to_modified_list_after_access+0xa4>
rtems_bdbuf_wake (&bdbuf_cache.access_waiters);
80096d0: 78 01 08 01 mvhi r1,0x801
80096d4: 38 21 a7 d8 ori r1,r1,0xa7d8
80096d8: fb ff ff c0 calli 80095d8 <rtems_bdbuf_wake>
80096dc: e0 00 00 04 bi 80096ec <rtems_bdbuf_add_to_modified_list_after_access+0xb0>
else if (rtems_bdbuf_has_buffer_waiters ())
80096e0: 28 21 00 74 lw r1,(r1+116)
80096e4: 44 22 00 02 be r1,r2,80096ec <rtems_bdbuf_add_to_modified_list_after_access+0xb0>
rtems_bdbuf_wake_swapper ();
80096e8: fb ff ff c8 calli 8009608 <rtems_bdbuf_wake_swapper>
}
80096ec: 2b 9d 00 04 lw ra,(sp+4)
80096f0: 2b 8b 00 08 lw r11,(sp+8)
80096f4: 37 9c 00 08 addi sp,sp,8
80096f8: c3 a0 00 00 ret
08009798 <rtems_bdbuf_anonymous_wait>:
* 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)
{
8009798: 37 9c ff f4 addi sp,sp,-12
800979c: 5b 8b 00 0c sw (sp+12),r11
80097a0: 5b 8c 00 08 sw (sp+8),r12
80097a4: 5b 9d 00 04 sw (sp+4),ra
80097a8: b8 20 58 00 mv r11,r1
rtems_mode prev_mode;
/*
* Indicate we are waiting.
*/
++waiters->count;
80097ac: 28 21 00 00 lw r1,(r1+0)
80097b0: 34 21 00 01 addi r1,r1,1
80097b4: 59 61 00 00 sw (r11+0),r1
* 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 ();
80097b8: fb ff ff de calli 8009730 <rtems_bdbuf_disable_preemption>
80097bc: b8 20 60 00 mv r12,r1
/*
* Unlock the cache, wait, and lock the cache when we return.
*/
rtems_bdbuf_unlock_cache ();
80097c0: fb ff ff 72 calli 8009588 <rtems_bdbuf_unlock_cache>
sc = rtems_semaphore_obtain (waiters->sema, RTEMS_WAIT, RTEMS_BDBUF_WAIT_TIMEOUT);
80097c4: 29 61 00 04 lw r1,(r11+4)
80097c8: 34 02 00 00 mvi r2,0
80097cc: 34 03 00 00 mvi r3,0
80097d0: fb ff ed d7 calli 8004f2c <rtems_semaphore_obtain>
80097d4: b8 20 10 00 mv r2,r1
if (sc == RTEMS_TIMEOUT)
80097d8: 34 01 00 06 mvi r1,6
80097dc: 5c 41 00 04 bne r2,r1,80097ec <rtems_bdbuf_anonymous_wait+0x54><== ALWAYS TAKEN
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_CACHE_WAIT_TO);
80097e0: 34 01 00 03 mvi r1,3 <== NOT EXECUTED
80097e4: fb ff ff 2a calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
80097e8: e0 00 00 03 bi 80097f4 <rtems_bdbuf_anonymous_wait+0x5c> <== NOT EXECUTED
if (sc != RTEMS_UNSATISFIED)
80097ec: 34 01 00 0d mvi r1,13
80097f0: 44 41 00 03 be r2,r1,80097fc <rtems_bdbuf_anonymous_wait+0x64><== ALWAYS TAKEN
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_CACHE_WAIT_2);
80097f4: 34 01 00 02 mvi r1,2 <== NOT EXECUTED
80097f8: fb ff ff 25 calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
rtems_bdbuf_lock_cache ();
80097fc: fb ff ff 37 calli 80094d8 <rtems_bdbuf_lock_cache>
rtems_bdbuf_restore_preemption (prev_mode);
8009800: b9 80 08 00 mv r1,r12
8009804: fb ff ff d9 calli 8009768 <rtems_bdbuf_restore_preemption>
--waiters->count;
8009808: 29 61 00 00 lw r1,(r11+0)
800980c: 34 21 ff ff addi r1,r1,-1
8009810: 59 61 00 00 sw (r11+0),r1
}
8009814: 2b 9d 00 04 lw ra,(sp+4)
8009818: 2b 8b 00 0c lw r11,(sp+12)
800981c: 2b 8c 00 08 lw r12,(sp+8)
8009820: 37 9c 00 0c addi sp,sp,12
8009824: c3 a0 00 00 ret
080099b0 <rtems_bdbuf_create_task.clone.11>:
return NULL;
}
static rtems_status_code
rtems_bdbuf_create_task(
80099b0: 37 9c ff f0 addi sp,sp,-16
80099b4: 5b 8b 00 10 sw (sp+16),r11
80099b8: 5b 8c 00 0c sw (sp+12),r12
80099bc: 5b 8d 00 08 sw (sp+8),r13
80099c0: 5b 9d 00 04 sw (sp+4),ra
rtems_task_argument arg,
rtems_id *id
)
{
rtems_status_code sc;
size_t stack_size = bdbuf_config.task_stack_size ?
80099c4: 78 07 08 01 mvhi r7,0x801
80099c8: 38 e7 87 bc ori r7,r7,0x87bc
80099cc: 28 e7 00 1c lw r7,(r7+28)
return NULL;
}
static rtems_status_code
rtems_bdbuf_create_task(
80099d0: b8 60 68 00 mv r13,r3
80099d4: b8 80 60 00 mv r12,r4
80099d8: b8 a0 58 00 mv r11,r5
rtems_id *id
)
{
rtems_status_code sc;
size_t stack_size = bdbuf_config.task_stack_size ?
bdbuf_config.task_stack_size : RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT;
80099dc: 5c e0 00 02 bne r7,r0,80099e4 <rtems_bdbuf_create_task.clone.11+0x34><== ALWAYS TAKEN
80099e0: 34 07 10 00 mvi r7,4096 <== NOT EXECUTED
priority = priority != 0 ? priority : default_priority;
80099e4: 5c 40 00 02 bne r2,r0,80099ec <rtems_bdbuf_create_task.clone.11+0x3c><== ALWAYS TAKEN
80099e8: 34 02 00 0f mvi r2,15 <== NOT EXECUTED
sc = rtems_task_create (name,
80099ec: b8 e0 18 00 mv r3,r7
80099f0: 34 04 04 00 mvi r4,1024
80099f4: 34 05 00 00 mvi r5,0
80099f8: b9 60 30 00 mv r6,r11
80099fc: f8 00 13 ea calli 800e9a4 <rtems_task_create>
stack_size,
RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR,
RTEMS_LOCAL | RTEMS_NO_FLOATING_POINT,
id);
if (sc == RTEMS_SUCCESSFUL)
8009a00: 5c 20 00 05 bne r1,r0,8009a14 <rtems_bdbuf_create_task.clone.11+0x64><== NEVER TAKEN
sc = rtems_task_start (*id, entry, arg);
8009a04: 29 61 00 00 lw r1,(r11+0)
8009a08: b9 a0 10 00 mv r2,r13
8009a0c: b9 80 18 00 mv r3,r12
8009a10: fb ff ee 19 calli 8005274 <rtems_task_start>
return sc;
}
8009a14: 2b 9d 00 04 lw ra,(sp+4)
8009a18: 2b 8b 00 10 lw r11,(sp+16)
8009a1c: 2b 8c 00 0c lw r12,(sp+12)
8009a20: 2b 8d 00 08 lw r13,(sp+8)
8009a24: 37 9c 00 10 addi sp,sp,16
8009a28: c3 a0 00 00 ret
08009730 <rtems_bdbuf_disable_preemption>:
--bd->group->users;
}
static rtems_mode
rtems_bdbuf_disable_preemption (void)
{
8009730: 37 9c ff f8 addi sp,sp,-8
8009734: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_mode prev_mode = 0;
sc = rtems_task_mode (RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &prev_mode);
8009738: 34 01 01 00 mvi r1,256
800973c: 34 02 01 00 mvi r2,256
8009740: 37 83 00 08 addi r3,sp,8
static rtems_mode
rtems_bdbuf_disable_preemption (void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_mode prev_mode = 0;
8009744: 5b 80 00 08 sw (sp+8),r0
sc = rtems_task_mode (RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &prev_mode);
8009748: f8 00 15 12 calli 800eb90 <rtems_task_mode>
if (sc != RTEMS_SUCCESSFUL)
800974c: 44 20 00 03 be r1,r0,8009758 <rtems_bdbuf_disable_preemption+0x28><== ALWAYS TAKEN
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_PREEMPT_DIS);
8009750: 34 01 00 05 mvi r1,5 <== NOT EXECUTED
8009754: fb ff ff 4e calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
return prev_mode;
}
8009758: 2b 81 00 08 lw r1,(sp+8)
800975c: 2b 9d 00 04 lw ra,(sp+4)
8009760: 37 9c 00 08 addi sp,sp,8
8009764: c3 a0 00 00 ret
0800ab8c <rtems_bdbuf_execute_read_request>:
static rtems_status_code
rtems_bdbuf_execute_read_request (rtems_disk_device *dd,
rtems_bdbuf_buffer *bd,
uint32_t transfer_count)
{
800ab8c: 37 9c ff d0 addi sp,sp,-48
800ab90: 5b 9b 00 08 sw (sp+8),fp
800ab94: 34 1b 00 30 mvi fp,48
800ab98: b7 7c d8 00 add fp,fp,sp
800ab9c: 5b 8b 00 30 sw (sp+48),r11
800aba0: 5b 8c 00 2c sw (sp+44),r12
800aba4: 5b 8d 00 28 sw (sp+40),r13
800aba8: 5b 8e 00 24 sw (sp+36),r14
800abac: 5b 8f 00 20 sw (sp+32),r15
800abb0: 5b 90 00 1c sw (sp+28),r16
800abb4: 5b 91 00 18 sw (sp+24),r17
800abb8: 5b 92 00 14 sw (sp+20),r18
800abbc: 5b 93 00 10 sw (sp+16),r19
800abc0: 5b 94 00 0c sw (sp+12),r20
800abc4: 5b 9d 00 04 sw (sp+4),ra
800abc8: b8 40 60 00 mv r12,r2
rtems_blkdev_request *req = NULL;
rtems_blkdev_bnum media_block = bd->block;
800abcc: 28 4d 00 18 lw r13,(r2+24)
uint32_t media_blocks_per_block = dd->media_blocks_per_block;
uint32_t block_size = dd->block_size;
800abd0: 28 30 00 24 lw r16,(r1+36)
rtems_bdbuf_buffer *bd,
uint32_t transfer_count)
{
rtems_blkdev_request *req = NULL;
rtems_blkdev_bnum media_block = bd->block;
uint32_t media_blocks_per_block = dd->media_blocks_per_block;
800abd4: 28 34 00 2c lw r20,(r1+44)
/*
* TODO: This type of request structure is wrong and should be removed.
*/
#define bdbuf_alloc(size) __builtin_alloca (size)
req = bdbuf_alloc (sizeof (rtems_blkdev_request) +
800abd8: 34 02 00 04 mvi r2,4
static rtems_status_code
rtems_bdbuf_execute_read_request (rtems_disk_device *dd,
rtems_bdbuf_buffer *bd,
uint32_t transfer_count)
{
800abdc: b8 20 70 00 mv r14,r1
/*
* TODO: This type of request structure is wrong and should be removed.
*/
#define bdbuf_alloc(size) __builtin_alloca (size)
req = bdbuf_alloc (sizeof (rtems_blkdev_request) +
800abe0: b8 60 08 00 mv r1,r3
static rtems_status_code
rtems_bdbuf_execute_read_request (rtems_disk_device *dd,
rtems_bdbuf_buffer *bd,
uint32_t transfer_count)
{
800abe4: b8 60 88 00 mv r17,r3
/*
* TODO: This type of request structure is wrong and should be removed.
*/
#define bdbuf_alloc(size) __builtin_alloca (size)
req = bdbuf_alloc (sizeof (rtems_blkdev_request) +
800abe8: f8 00 33 56 calli 8017940 <__ashlsi3>
800abec: 34 02 00 02 mvi r2,2
800abf0: 34 21 00 22 addi r1,r1,34
800abf4: f8 00 33 a1 calli 8017a78 <__lshrsi3>
800abf8: 34 02 00 02 mvi r2,2
800abfc: f8 00 33 51 calli 8017940 <__ashlsi3>
}
req->bufnum = transfer_index;
return rtems_bdbuf_execute_transfer_request (dd, req, true);
}
800ac00: bb 80 90 00 mv r18,sp
/*
* TODO: This type of request structure is wrong and should be removed.
*/
#define bdbuf_alloc(size) __builtin_alloca (size)
req = bdbuf_alloc (sizeof (rtems_blkdev_request) +
800ac04: cb 81 e0 00 sub sp,sp,r1
800ac08: 34 02 00 03 mvi r2,3
800ac0c: 37 81 00 0b addi r1,sp,11
800ac10: f8 00 33 9a calli 8017a78 <__lshrsi3>
800ac14: 34 02 00 03 mvi r2,3
800ac18: f8 00 33 4a calli 8017940 <__ashlsi3>
sizeof (rtems_blkdev_sg_buffer) * transfer_count);
req->req = RTEMS_BLKDEV_REQ_READ;
req->done = rtems_bdbuf_transfer_done;
800ac1c: 78 02 08 00 mvhi r2,0x800
800ac20: 38 42 98 28 ori r2,r2,0x9828
#define bdbuf_alloc(size) __builtin_alloca (size)
req = bdbuf_alloc (sizeof (rtems_blkdev_request) +
sizeof (rtems_blkdev_sg_buffer) * transfer_count);
req->req = RTEMS_BLKDEV_REQ_READ;
800ac24: 58 20 00 00 sw (r1+0),r0
req->done = rtems_bdbuf_transfer_done;
800ac28: 58 22 00 04 sw (r1+4),r2
/*
* TODO: This type of request structure is wrong and should be removed.
*/
#define bdbuf_alloc(size) __builtin_alloca (size)
req = bdbuf_alloc (sizeof (rtems_blkdev_request) +
800ac2c: b8 20 58 00 mv r11,r1
sizeof (rtems_blkdev_sg_buffer) * transfer_count);
req->req = RTEMS_BLKDEV_REQ_READ;
req->done = rtems_bdbuf_transfer_done;
req->io_task = rtems_task_self ();
800ac30: f8 00 10 41 calli 800ed34 <rtems_task_self>
800ac34: 59 61 00 14 sw (r11+20),r1
req->bufnum = 0;
800ac38: 59 60 00 10 sw (r11+16),r0
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800ac3c: 34 01 00 09 mvi r1,9
800ac40: 59 81 00 20 sw (r12+32),r1
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_TRANSFER);
req->bufs [0].user = bd;
req->bufs [0].block = media_block;
req->bufs [0].length = block_size;
req->bufs [0].buffer = bd->buffer;
800ac44: 29 81 00 1c lw r1,(r12+28)
req->io_task = rtems_task_self ();
req->bufnum = 0;
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_TRANSFER);
req->bufs [0].user = bd;
800ac48: 59 6c 00 24 sw (r11+36),r12
req->bufs [0].block = media_block;
800ac4c: 59 6d 00 18 sw (r11+24),r13
req->bufs [0].length = block_size;
800ac50: 59 70 00 1c sw (r11+28),r16
req->bufs [0].buffer = bd->buffer;
800ac54: 59 61 00 20 sw (r11+32),r1
800ac58: b9 60 60 00 mv r12,r11
{
rtems_blkdev_request *req = NULL;
rtems_blkdev_bnum media_block = bd->block;
uint32_t media_blocks_per_block = dd->media_blocks_per_block;
uint32_t block_size = dd->block_size;
uint32_t transfer_index = 1;
800ac5c: 34 0f 00 01 mvi r15,1
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800ac60: 34 13 00 09 mvi r19,9
req->bufs [0].buffer = bd->buffer;
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_users ("read", bd);
while (transfer_index < transfer_count)
800ac64: e0 00 00 0e bi 800ac9c <rtems_bdbuf_execute_read_request+0x110>
{
media_block += media_blocks_per_block;
800ac68: b5 b4 68 00 add r13,r13,r20
bd = rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block);
800ac6c: b9 c0 08 00 mv r1,r14
800ac70: b9 a0 10 00 mv r2,r13
800ac74: fb ff ff a6 calli 800ab0c <rtems_bdbuf_get_buffer_for_read_ahead>
800ac78: 35 8c 00 10 addi r12,r12,16
if (bd == NULL)
800ac7c: 44 20 00 09 be r1,r0,800aca0 <rtems_bdbuf_execute_read_request+0x114><== NEVER TAKEN
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800ac80: 58 33 00 20 sw (r1+32),r19
if (bd == NULL)
break;
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_TRANSFER);
req->bufs [transfer_index].user = bd;
800ac84: 59 81 00 24 sw (r12+36),r1
req->bufs [transfer_index].block = media_block;
req->bufs [transfer_index].length = block_size;
req->bufs [transfer_index].buffer = bd->buffer;
800ac88: 28 21 00 1c lw r1,(r1+28)
break;
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_TRANSFER);
req->bufs [transfer_index].user = bd;
req->bufs [transfer_index].block = media_block;
800ac8c: 59 8d 00 18 sw (r12+24),r13
req->bufs [transfer_index].length = block_size;
800ac90: 59 90 00 1c sw (r12+28),r16
req->bufs [transfer_index].buffer = bd->buffer;
800ac94: 59 81 00 20 sw (r12+32),r1
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_users ("read", bd);
++transfer_index;
800ac98: 35 ef 00 01 addi r15,r15,1
req->bufs [0].buffer = bd->buffer;
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_users ("read", bd);
while (transfer_index < transfer_count)
800ac9c: 56 2f ff f3 bgu r17,r15,800ac68 <rtems_bdbuf_execute_read_request+0xdc>
rtems_bdbuf_show_users ("read", bd);
++transfer_index;
}
req->bufnum = transfer_index;
800aca0: 59 6f 00 10 sw (r11+16),r15
return rtems_bdbuf_execute_transfer_request (dd, req, true);
800aca4: b9 c0 08 00 mv r1,r14
800aca8: b9 60 10 00 mv r2,r11
800acac: 34 03 00 01 mvi r3,1
800acb0: fb ff fc 8b calli 8009edc <rtems_bdbuf_execute_transfer_request>
}
800acb4: ba 40 e0 00 mv sp,r18
800acb8: 2b 9d 00 04 lw ra,(sp+4)
800acbc: 2b 8b 00 30 lw r11,(sp+48)
800acc0: 2b 8c 00 2c lw r12,(sp+44)
800acc4: 2b 8d 00 28 lw r13,(sp+40)
800acc8: 2b 8e 00 24 lw r14,(sp+36)
800accc: 2b 8f 00 20 lw r15,(sp+32)
800acd0: 2b 90 00 1c lw r16,(sp+28)
800acd4: 2b 91 00 18 lw r17,(sp+24)
800acd8: 2b 92 00 14 lw r18,(sp+20)
800acdc: 2b 93 00 10 lw r19,(sp+16)
800ace0: 2b 94 00 0c lw r20,(sp+12)
800ace4: 2b 9b 00 08 lw fp,(sp+8)
800ace8: 37 9c 00 30 addi sp,sp,48
800acec: c3 a0 00 00 ret
08009edc <rtems_bdbuf_execute_transfer_request>:
static rtems_status_code
rtems_bdbuf_execute_transfer_request (rtems_disk_device *dd,
rtems_blkdev_request *req,
bool cache_locked)
{
8009edc: 37 9c ff cc addi sp,sp,-52
8009ee0: 5b 8b 00 34 sw (sp+52),r11
8009ee4: 5b 8c 00 30 sw (sp+48),r12
8009ee8: 5b 8d 00 2c sw (sp+44),r13
8009eec: 5b 8e 00 28 sw (sp+40),r14
8009ef0: 5b 8f 00 24 sw (sp+36),r15
8009ef4: 5b 90 00 20 sw (sp+32),r16
8009ef8: 5b 91 00 1c sw (sp+28),r17
8009efc: 5b 92 00 18 sw (sp+24),r18
8009f00: 5b 93 00 14 sw (sp+20),r19
8009f04: 5b 94 00 10 sw (sp+16),r20
8009f08: 5b 95 00 0c sw (sp+12),r21
8009f0c: 5b 96 00 08 sw (sp+8),r22
8009f10: 5b 9d 00 04 sw (sp+4),ra
8009f14: b8 20 58 00 mv r11,r1
8009f18: b8 40 68 00 mv r13,r2
8009f1c: b8 60 90 00 mv r18,r3
rtems_status_code sc = RTEMS_SUCCESSFUL;
uint32_t transfer_index = 0;
bool wake_transfer_waiters = false;
bool wake_buffer_waiters = false;
if (cache_locked)
8009f20: 44 60 00 02 be r3,r0,8009f28 <rtems_bdbuf_execute_transfer_request+0x4c>
rtems_bdbuf_unlock_cache ();
8009f24: fb ff fd 99 calli 8009588 <rtems_bdbuf_unlock_cache>
/* The return value will be ignored for transfer requests */
dd->ioctl (dd->phys_dev, RTEMS_BLKIO_REQUEST, req);
8009f28: 78 03 08 01 mvhi r3,0x801
8009f2c: 38 63 8c 98 ori r3,r3,0x8c98
8009f30: 28 62 00 00 lw r2,(r3+0)
8009f34: 29 64 00 38 lw r4,(r11+56)
8009f38: 29 61 00 08 lw r1,(r11+8)
8009f3c: b9 a0 18 00 mv r3,r13
8009f40: d8 80 00 00 call r4
/* Wait for transfer request completion */
rtems_bdbuf_wait_for_transient_event ();
8009f44: fb ff fd ee calli 80096fc <rtems_bdbuf_wait_for_transient_event>
sc = req->status;
8009f48: 29 ac 00 0c lw r12,(r13+12)
rtems_bdbuf_lock_cache ();
8009f4c: fb ff fd 63 calli 80094d8 <rtems_bdbuf_lock_cache>
/* Statistics */
if (req->req == RTEMS_BLKDEV_REQ_READ)
8009f50: 29 a2 00 00 lw r2,(r13+0)
8009f54: 29 a1 00 10 lw r1,(r13+16)
8009f58: 5c 40 00 13 bne r2,r0,8009fa4 <rtems_bdbuf_execute_transfer_request+0xc8>
{
dd->stats.read_blocks += req->bufnum;
8009f5c: 29 63 00 50 lw r3,(r11+80)
8009f60: b4 61 08 00 add r1,r3,r1
8009f64: 59 61 00 50 sw (r11+80),r1
if (sc != RTEMS_SUCCESSFUL)
8009f68: 45 82 00 04 be r12,r2,8009f78 <rtems_bdbuf_execute_transfer_request+0x9c>
++dd->stats.read_errors;
8009f6c: 29 61 00 54 lw r1,(r11+84)
8009f70: 34 21 00 01 addi r1,r1,1
8009f74: 59 61 00 54 sw (r11+84),r1
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
8009f78: 78 0e 08 01 mvhi r14,0x801
the_node->next = tail;
8009f7c: 78 0f 08 01 mvhi r15,0x801
8009f80: b9 a0 88 00 mv r17,r13
bool waiters = bd->waiters;
if (waiters)
wake_transfer_waiters = true;
else
wake_buffer_waiters = true;
8009f84: 34 13 00 00 mvi r19,0
8009f88: 34 14 00 00 mvi r20,0
8009f8c: 34 10 00 00 mvi r16,0
rtems_bdbuf_group_release (bd);
if (sc == RTEMS_SUCCESSFUL && bd->state == RTEMS_BDBUF_STATE_TRANSFER)
8009f90: 34 16 00 09 mvi r22,9
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
8009f94: 34 15 00 02 mvi r21,2
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
8009f98: 39 ce a7 74 ori r14,r14,0xa774
the_node->next = tail;
8009f9c: 39 ef a7 b8 ori r15,r15,0xa7b8
8009fa0: e0 00 00 22 bi 800a028 <rtems_bdbuf_execute_transfer_request+0x14c>
if (sc != RTEMS_SUCCESSFUL)
++dd->stats.read_errors;
}
else
{
dd->stats.write_blocks += req->bufnum;
8009fa4: 29 62 00 5c lw r2,(r11+92)
8009fa8: b4 41 08 00 add r1,r2,r1
8009fac: 59 61 00 5c sw (r11+92),r1
++dd->stats.write_transfers;
8009fb0: 29 61 00 58 lw r1,(r11+88)
8009fb4: 34 21 00 01 addi r1,r1,1
8009fb8: 59 61 00 58 sw (r11+88),r1
if (sc != RTEMS_SUCCESSFUL)
8009fbc: 45 80 ff ef be r12,r0,8009f78 <rtems_bdbuf_execute_transfer_request+0x9c>
++dd->stats.write_errors;
8009fc0: 29 61 00 60 lw r1,(r11+96)
8009fc4: 34 21 00 01 addi r1,r1,1
8009fc8: 59 61 00 60 sw (r11+96),r1
8009fcc: e3 ff ff eb bi 8009f78 <rtems_bdbuf_execute_transfer_request+0x9c>
}
for (transfer_index = 0; transfer_index < req->bufnum; ++transfer_index)
{
rtems_bdbuf_buffer *bd = req->bufs [transfer_index].user;
8009fd0: 2a 2b 00 24 lw r11,(r17+36)
bool waiters = bd->waiters;
if (waiters)
8009fd4: 29 61 00 24 lw r1,(r11+36)
8009fd8: 44 20 00 03 be r1,r0,8009fe4 <rtems_bdbuf_execute_transfer_request+0x108>
wake_transfer_waiters = true;
8009fdc: 34 14 00 01 mvi r20,1
8009fe0: e0 00 00 02 bi 8009fe8 <rtems_bdbuf_execute_transfer_request+0x10c>
else
wake_buffer_waiters = true;
8009fe4: 34 13 00 01 mvi r19,1
rtems_bdbuf_group_release (bd);
8009fe8: 29 61 00 28 lw r1,(r11+40)
8009fec: fb ff fe 56 calli 8009944 <rtems_bdbuf_group_release.clone.8>
if (sc == RTEMS_SUCCESSFUL && bd->state == RTEMS_BDBUF_STATE_TRANSFER)
8009ff0: 5d 80 00 0a bne r12,r0,800a018 <rtems_bdbuf_execute_transfer_request+0x13c>
8009ff4: 29 61 00 20 lw r1,(r11+32)
8009ff8: 5c 36 00 08 bne r1,r22,800a018 <rtems_bdbuf_execute_transfer_request+0x13c><== NEVER TAKEN
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
8009ffc: 29 c1 00 48 lw r1,(r14+72)
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800a000: 59 75 00 20 sw (r11+32),r21
the_node->next = tail;
800a004: 59 6f 00 00 sw (r11+0),r15
tail->previous = the_node;
800a008: 59 cb 00 48 sw (r14+72),r11
old_last->next = the_node;
800a00c: 58 2b 00 00 sw (r1+0),r11
the_node->previous = old_last;
800a010: 59 61 00 04 sw (r11+4),r1
wake_buffer_waiters = true;
rtems_bdbuf_group_release (bd);
if (sc == RTEMS_SUCCESSFUL && bd->state == RTEMS_BDBUF_STATE_TRANSFER)
rtems_bdbuf_make_cached_and_add_to_lru_list (bd);
800a014: e0 00 00 03 bi 800a020 <rtems_bdbuf_execute_transfer_request+0x144>
else
rtems_bdbuf_discard_buffer (bd);
800a018: b9 60 08 00 mv r1,r11
800a01c: fb ff ff 85 calli 8009e30 <rtems_bdbuf_discard_buffer>
++dd->stats.write_transfers;
if (sc != RTEMS_SUCCESSFUL)
++dd->stats.write_errors;
}
for (transfer_index = 0; transfer_index < req->bufnum; ++transfer_index)
800a020: 36 10 00 01 addi r16,r16,1
800a024: 36 31 00 10 addi r17,r17,16
800a028: 29 a1 00 10 lw r1,(r13+16)
800a02c: 54 30 ff e9 bgu r1,r16,8009fd0 <rtems_bdbuf_execute_transfer_request+0xf4>
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_users ("transfer", bd);
}
if (wake_transfer_waiters)
800a030: 46 80 00 04 be r20,r0,800a040 <rtems_bdbuf_execute_transfer_request+0x164>
rtems_bdbuf_wake (&bdbuf_cache.transfer_waiters);
800a034: 78 01 08 01 mvhi r1,0x801
800a038: 38 21 a7 e0 ori r1,r1,0xa7e0
800a03c: fb ff fd 67 calli 80095d8 <rtems_bdbuf_wake>
if (wake_buffer_waiters)
800a040: 46 60 00 04 be r19,r0,800a050 <rtems_bdbuf_execute_transfer_request+0x174>
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
800a044: 78 01 08 01 mvhi r1,0x801
800a048: 38 21 a7 e8 ori r1,r1,0xa7e8
800a04c: fb ff fd 63 calli 80095d8 <rtems_bdbuf_wake>
if (!cache_locked)
800a050: 5e 40 00 02 bne r18,r0,800a058 <rtems_bdbuf_execute_transfer_request+0x17c>
rtems_bdbuf_unlock_cache ();
800a054: fb ff fd 4d calli 8009588 <rtems_bdbuf_unlock_cache>
if (sc == RTEMS_SUCCESSFUL || sc == RTEMS_UNSATISFIED)
800a058: 65 82 00 0d cmpei r2,r12,13
800a05c: 65 81 00 00 cmpei r1,r12,0
800a060: b8 41 08 00 or r1,r2,r1
800a064: 5c 20 00 02 bne r1,r0,800a06c <rtems_bdbuf_execute_transfer_request+0x190>
return sc;
else
return RTEMS_IO_ERROR;
800a068: 34 0c 00 1b mvi r12,27
}
800a06c: b9 80 08 00 mv r1,r12
800a070: 2b 9d 00 04 lw ra,(sp+4)
800a074: 2b 8b 00 34 lw r11,(sp+52)
800a078: 2b 8c 00 30 lw r12,(sp+48)
800a07c: 2b 8d 00 2c lw r13,(sp+44)
800a080: 2b 8e 00 28 lw r14,(sp+40)
800a084: 2b 8f 00 24 lw r15,(sp+36)
800a088: 2b 90 00 20 lw r16,(sp+32)
800a08c: 2b 91 00 1c lw r17,(sp+28)
800a090: 2b 92 00 18 lw r18,(sp+24)
800a094: 2b 93 00 14 lw r19,(sp+20)
800a098: 2b 94 00 10 lw r20,(sp+16)
800a09c: 2b 95 00 0c lw r21,(sp+12)
800a0a0: 2b 96 00 08 lw r22,(sp+8)
800a0a4: 37 9c 00 34 addi sp,sp,52
800a0a8: c3 a0 00 00 ret
0800948c <rtems_bdbuf_fatal>:
#define RTEMS_BDBUF_AVL_MAX_HEIGHT (32)
#endif
static void
rtems_bdbuf_fatal (rtems_fatal_code error)
{
800948c: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
8009490: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
8009494: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
rtems_fatal (RTEMS_FATAL_SOURCE_BDBUF, error);
8009498: 34 01 00 03 mvi r1,3 <== NOT EXECUTED
800949c: fb ff ef ec calli 800544c <rtems_fatal> <== NOT EXECUTED
08009528 <rtems_bdbuf_fatal_with_state>:
}
static void
rtems_bdbuf_fatal_with_state (rtems_bdbuf_buf_state state,
rtems_bdbuf_fatal_code error)
{
8009528: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED
800952c: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED
8009530: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
8009534: b8 40 58 00 mv r11,r2 <== NOT EXECUTED
rtems_bdbuf_fatal ((((uint32_t) state) << 16) | error);
8009538: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
800953c: f8 00 39 01 calli 8017940 <__ashlsi3> <== NOT EXECUTED
8009540: b9 61 08 00 or r1,r11,r1 <== NOT EXECUTED
8009544: fb ff ff d2 calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
}
8009548: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
800954c: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED
8009550: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED
8009554: c3 a0 00 00 ret <== NOT EXECUTED
0800b598 <rtems_bdbuf_get>:
rtems_status_code
rtems_bdbuf_get (rtems_disk_device *dd,
rtems_blkdev_bnum block,
rtems_bdbuf_buffer **bd_ptr)
{
800b598: 37 9c ff e8 addi sp,sp,-24
800b59c: 5b 8b 00 18 sw (sp+24),r11
800b5a0: 5b 8c 00 14 sw (sp+20),r12
800b5a4: 5b 8d 00 10 sw (sp+16),r13
800b5a8: 5b 8e 00 0c sw (sp+12),r14
800b5ac: 5b 8f 00 08 sw (sp+8),r15
800b5b0: 5b 9d 00 04 sw (sp+4),ra
800b5b4: b8 20 58 00 mv r11,r1
800b5b8: b8 40 70 00 mv r14,r2
800b5bc: b8 60 78 00 mv r15,r3
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *bd = NULL;
rtems_blkdev_bnum media_block;
rtems_bdbuf_lock_cache ();
800b5c0: fb ff f7 c6 calli 80094d8 <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)
800b5c4: 29 61 00 28 lw r1,(r11+40)
*/
*media_block_ptr = rtems_bdbuf_media_block (dd, block) + dd->start;
}
else
{
sc = RTEMS_INVALID_ID;
800b5c8: 34 0d 00 04 mvi r13,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;
800b5cc: 34 0c 00 00 mvi r12,0
rtems_blkdev_bnum block,
rtems_blkdev_bnum *media_block_ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (block < dd->block_count)
800b5d0: 51 c1 00 26 bgeu r14,r1,800b668 <rtems_bdbuf_get+0xd0> <== NEVER TAKEN
}
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)
800b5d4: 29 62 00 30 lw r2,(r11+48)
800b5d8: 48 02 00 05 bg r0,r2,800b5ec <rtems_bdbuf_get+0x54> <== NEVER TAKEN
return block << dd->block_to_media_block_shift;
800b5dc: b9 c0 08 00 mv r1,r14
800b5e0: f8 00 30 d8 calli 8017940 <__ashlsi3>
800b5e4: b8 20 10 00 mv r2,r1
800b5e8: e0 00 00 09 bi 800b60c <rtems_bdbuf_get+0x74>
/*
* 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);
800b5ec: 29 64 00 24 lw r4,(r11+36) <== NOT EXECUTED
800b5f0: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
800b5f4: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
800b5f8: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
800b5fc: f8 00 28 92 calli 8015844 <__muldi3> <== NOT EXECUTED
800b600: 29 64 00 20 lw r4,(r11+32) <== NOT EXECUTED
800b604: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
800b608: f8 00 2d 05 calli 8016a1c <__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;
800b60c: 29 64 00 18 lw r4,(r11+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);
800b610: b9 60 08 00 mv r1,r11
800b614: b4 44 10 00 add r2,r2,r4
800b618: fb ff fe 19 calli 800ae7c <rtems_bdbuf_get_buffer_for_access>
800b61c: b8 20 60 00 mv r12,r1
switch (bd->state)
800b620: 28 21 00 20 lw r1,(r1+32)
800b624: 34 02 00 02 mvi r2,2
800b628: 44 22 00 06 be r1,r2,800b640 <rtems_bdbuf_get+0xa8>
800b62c: 34 02 00 07 mvi r2,7
800b630: 44 22 00 08 be r1,r2,800b650 <rtems_bdbuf_get+0xb8>
800b634: 34 02 00 01 mvi r2,1
800b638: 5c 22 00 09 bne r1,r2,800b65c <rtems_bdbuf_get+0xc4> <== NEVER TAKEN
800b63c: e0 00 00 03 bi 800b648 <rtems_bdbuf_get+0xb0>
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800b640: 34 01 00 03 mvi r1,3
800b644: e0 00 00 04 bi 800b654 <rtems_bdbuf_get+0xbc>
800b648: 34 01 00 05 mvi r1,5
800b64c: e0 00 00 02 bi 800b654 <rtems_bdbuf_get+0xbc>
800b650: 34 01 00 04 mvi r1,4
800b654: 59 81 00 20 sw (r12+32),r1
800b658: e0 00 00 03 bi 800b664 <rtems_bdbuf_get+0xcc>
* 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);
800b65c: 34 02 00 0f mvi r2,15 <== NOT EXECUTED
800b660: fb ff f7 b2 calli 8009528 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
static rtems_status_code
rtems_bdbuf_get_media_block (const rtems_disk_device *dd,
rtems_blkdev_bnum block,
rtems_blkdev_bnum *media_block_ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
800b664: 34 0d 00 00 mvi r13,0
rtems_bdbuf_show_users ("get", bd);
rtems_bdbuf_show_usage ();
}
}
rtems_bdbuf_unlock_cache ();
800b668: fb ff f7 c8 calli 8009588 <rtems_bdbuf_unlock_cache>
*bd_ptr = bd;
return sc;
}
800b66c: b9 a0 08 00 mv r1,r13
}
}
rtems_bdbuf_unlock_cache ();
*bd_ptr = bd;
800b670: 59 ec 00 00 sw (r15+0),r12
return sc;
}
800b674: 2b 9d 00 04 lw ra,(sp+4)
800b678: 2b 8b 00 18 lw r11,(sp+24)
800b67c: 2b 8c 00 14 lw r12,(sp+20)
800b680: 2b 8d 00 10 lw r13,(sp+16)
800b684: 2b 8e 00 0c lw r14,(sp+12)
800b688: 2b 8f 00 08 lw r15,(sp+8)
800b68c: 37 9c 00 18 addi sp,sp,24
800b690: c3 a0 00 00 ret
0800ae7c <rtems_bdbuf_get_buffer_for_access>:
}
static rtems_bdbuf_buffer *
rtems_bdbuf_get_buffer_for_access (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
800ae7c: 37 9c ff c8 addi sp,sp,-56
800ae80: 5b 8b 00 38 sw (sp+56),r11
800ae84: 5b 8c 00 34 sw (sp+52),r12
800ae88: 5b 8d 00 30 sw (sp+48),r13
800ae8c: 5b 8e 00 2c sw (sp+44),r14
800ae90: 5b 8f 00 28 sw (sp+40),r15
800ae94: 5b 90 00 24 sw (sp+36),r16
800ae98: 5b 91 00 20 sw (sp+32),r17
800ae9c: 5b 92 00 1c sw (sp+28),r18
800aea0: 5b 93 00 18 sw (sp+24),r19
800aea4: 5b 94 00 14 sw (sp+20),r20
800aea8: 5b 95 00 10 sw (sp+16),r21
800aeac: 5b 96 00 0c sw (sp+12),r22
800aeb0: 5b 97 00 08 sw (sp+8),r23
800aeb4: 5b 9d 00 04 sw (sp+4),ra
rtems_bdbuf_buffer *bd = NULL;
do
{
bd = rtems_bdbuf_avl_search (&bdbuf_cache.tree, dd, block);
800aeb8: 78 0c 08 01 mvhi r12,0x801
static bool
rtems_bdbuf_wait_for_recycle (rtems_bdbuf_buffer *bd)
{
while (true)
{
switch (bd->state)
800aebc: 78 14 08 01 mvhi r20,0x801
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);
800aec0: 78 13 08 01 mvhi r19,0x801
}
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);
800aec4: 78 12 08 01 mvhi r18,0x801
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
800aec8: 78 11 08 01 mvhi r17,0x801
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
800aecc: 78 10 08 01 mvhi r16,0x801
{
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);
800aed0: 78 0d 08 01 mvhi r13,0x801
}
static void
rtems_bdbuf_wait_for_buffer (void)
{
if (!rtems_chain_is_empty (&bdbuf_cache.modified))
800aed4: 78 0f 08 01 mvhi r15,0x801
}
static rtems_bdbuf_buffer *
rtems_bdbuf_get_buffer_for_access (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
800aed8: b8 20 70 00 mv r14,r1
800aedc: b8 40 a8 00 mv r21,r2
rtems_bdbuf_buffer *bd = NULL;
do
{
bd = rtems_bdbuf_avl_search (&bdbuf_cache.tree, dd, block);
800aee0: 39 8c a7 74 ori r12,r12,0xa774
static bool
rtems_bdbuf_wait_for_recycle (rtems_bdbuf_buffer *bd)
{
while (true)
{
switch (bd->state)
800aee4: 34 17 00 0a mvi r23,10
800aee8: 3a 94 8c d4 ori r20,r20,0x8cd4
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);
800aeec: 3a 73 a7 e0 ori r19,r19,0xa7e0
}
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);
800aef0: 3a 52 a7 d8 ori r18,r18,0xa7d8
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800aef4: 34 16 00 08 mvi r22,8
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
800aef8: 3a 31 a7 d0 ori r17,r17,0xa7d0
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
800aefc: 3a 10 a7 b4 ori r16,r16,0xa7b4
{
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);
800af00: 39 ad a7 e8 ori r13,r13,0xa7e8
}
static void
rtems_bdbuf_wait_for_buffer (void)
{
if (!rtems_chain_is_empty (&bdbuf_cache.modified))
800af04: 39 ef a7 c4 ori r15,r15,0xa7c4
{
rtems_bdbuf_buffer *bd = NULL;
do
{
bd = rtems_bdbuf_avl_search (&bdbuf_cache.tree, dd, block);
800af08: 29 81 00 3c lw r1,(r12+60)
800af0c: b9 c0 10 00 mv r2,r14
800af10: ba a0 18 00 mv r3,r21
800af14: fb ff fa 7a calli 80098fc <rtems_bdbuf_avl_search.clone.5>
800af18: b8 20 58 00 mv r11,r1
if (bd != NULL)
800af1c: 44 20 00 30 be r1,r0,800afdc <rtems_bdbuf_get_buffer_for_access+0x160>
{
if (bd->group->bds_per_group != dd->bds_per_group)
800af20: 28 21 00 28 lw r1,(r1+40)
800af24: 29 c2 00 34 lw r2,(r14+52)
800af28: 28 21 00 08 lw r1,(r1+8)
800af2c: 44 22 00 37 be r1,r2,800b008 <rtems_bdbuf_get_buffer_for_access+0x18c>
static bool
rtems_bdbuf_wait_for_recycle (rtems_bdbuf_buffer *bd)
{
while (true)
{
switch (bd->state)
800af30: 29 61 00 20 lw r1,(r11+32)
800af34: 54 37 00 1c bgu r1,r23,800afa4 <rtems_bdbuf_get_buffer_for_access+0x128><== NEVER TAKEN
800af38: 34 02 00 02 mvi r2,2
800af3c: f8 00 32 81 calli 8017940 <__ashlsi3>
800af40: b6 81 08 00 add r1,r20,r1
800af44: 28 21 00 00 lw r1,(r1+0)
800af48: c0 20 00 00 b r1
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
800af4c: 29 61 00 04 lw r1,(r11+4) <== NOT EXECUTED
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
800af50: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800af54: 59 76 00 20 sw (r11+32),r22 <== NOT EXECUTED
previous = the_node->previous;
next->previous = previous;
800af58: 58 41 00 04 sw (r2+4),r1 <== NOT EXECUTED
previous->next = next;
800af5c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
800af60: 29 81 00 60 lw r1,(r12+96) <== NOT EXECUTED
the_node->next = tail;
800af64: 59 71 00 00 sw (r11+0),r17 <== NOT EXECUTED
tail->previous = the_node;
800af68: 59 8b 00 60 sw (r12+96),r11 <== NOT EXECUTED
old_last->next = the_node;
800af6c: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
the_node->previous = old_last;
800af70: 59 61 00 04 sw (r11+4),r1 <== 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 ();
800af74: fb ff f9 a5 calli 8009608 <rtems_bdbuf_wake_swapper> <== NOT EXECUTED
800af78: e3 ff ff ee bi 800af30 <rtems_bdbuf_get_buffer_for_access+0xb4><== NOT EXECUTED
case RTEMS_BDBUF_STATE_MODIFIED:
rtems_bdbuf_request_sync_for_modified_buffer (bd);
break;
case RTEMS_BDBUF_STATE_CACHED:
case RTEMS_BDBUF_STATE_EMPTY:
if (bd->waiters == 0)
800af7c: 29 61 00 24 lw r1,(r11+36)
800af80: 44 20 00 0c be r1,r0,800afb0 <rtems_bdbuf_get_buffer_for_access+0x134><== NEVER TAKEN
800af84: e0 00 00 1e bi 800affc <rtems_bdbuf_get_buffer_for_access+0x180>
}
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);
800af88: b9 60 08 00 mv r1,r11
800af8c: ba 40 10 00 mv r2,r18
800af90: e0 00 00 03 bi 800af9c <rtems_bdbuf_get_buffer_for_access+0x120>
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);
800af94: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800af98: ba 60 10 00 mv r2,r19 <== NOT EXECUTED
800af9c: fb ff fa 6e calli 8009954 <rtems_bdbuf_wait>
800afa0: e3 ff ff e4 bi 800af30 <rtems_bdbuf_get_buffer_for_access+0xb4>
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_8);
800afa4: 34 02 00 14 mvi r2,20 <== NOT EXECUTED
800afa8: fb ff f9 60 calli 8009528 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
800afac: e3 ff ff e1 bi 800af30 <rtems_bdbuf_get_buffer_for_access+0xb4><== NOT EXECUTED
{
if (bd->group->bds_per_group != dd->bds_per_group)
{
if (rtems_bdbuf_wait_for_recycle (bd))
{
rtems_bdbuf_remove_from_tree_and_lru_list (bd);
800afb0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800afb4: fb ff fd aa calli 800a65c <rtems_bdbuf_remove_from_tree_and_lru_list><== NOT EXECUTED
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
800afb8: 29 81 00 40 lw r1,(r12+64) <== NOT EXECUTED
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800afbc: 59 60 00 20 sw (r11+32),r0 <== NOT EXECUTED
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
800afc0: 59 70 00 04 sw (r11+4),r16 <== NOT EXECUTED
before_node = after_node->next;
after_node->next = the_node;
800afc4: 59 8b 00 40 sw (r12+64),r11 <== NOT EXECUTED
the_node->next = before_node;
800afc8: 59 61 00 00 sw (r11+0),r1 <== NOT EXECUTED
before_node->previous = the_node;
800afcc: 58 2b 00 04 sw (r1+4),r11 <== 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);
800afd0: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800afd4: fb ff f9 81 calli 80095d8 <rtems_bdbuf_wake> <== NOT EXECUTED
800afd8: e3 ff ff cc bi 800af08 <rtems_bdbuf_get_buffer_for_access+0x8c><== NOT EXECUTED
bd = NULL;
}
}
else
{
bd = rtems_bdbuf_get_buffer_from_lru_list (dd, block);
800afdc: b9 c0 08 00 mv r1,r14
800afe0: ba a0 10 00 mv r2,r21
800afe4: fb ff fd b3 calli 800a6b0 <rtems_bdbuf_get_buffer_from_lru_list>
800afe8: b8 20 58 00 mv r11,r1
if (bd == NULL)
800afec: 5c 20 00 07 bne r1,r0,800b008 <rtems_bdbuf_get_buffer_for_access+0x18c>
}
static void
rtems_bdbuf_wait_for_buffer (void)
{
if (!rtems_chain_is_empty (&bdbuf_cache.modified))
800aff0: 29 81 00 4c lw r1,(r12+76)
800aff4: 44 2f 00 02 be r1,r15,800affc <rtems_bdbuf_get_buffer_for_access+0x180>
rtems_bdbuf_wake_swapper ();
800aff8: fb ff f9 84 calli 8009608 <rtems_bdbuf_wake_swapper>
rtems_bdbuf_anonymous_wait (&bdbuf_cache.buffer_waiters);
800affc: b9 a0 08 00 mv r1,r13
800b000: fb ff f9 e6 calli 8009798 <rtems_bdbuf_anonymous_wait>
800b004: e3 ff ff c1 bi 800af08 <rtems_bdbuf_get_buffer_for_access+0x8c>
static void
rtems_bdbuf_wait_for_access (rtems_bdbuf_buffer *bd)
{
while (true)
{
switch (bd->state)
800b008: 78 0e 08 01 mvhi r14,0x801
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);
800b00c: 78 0d 08 01 mvhi r13,0x801
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);
800b010: 78 0c 08 01 mvhi r12,0x801
static void
rtems_bdbuf_wait_for_access (rtems_bdbuf_buffer *bd)
{
while (true)
{
switch (bd->state)
800b014: 34 0f 00 09 mvi r15,9
800b018: 39 ce 8d 00 ori r14,r14,0x8d00
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);
800b01c: 39 ad a7 e0 ori r13,r13,0xa7e0
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);
800b020: 39 8c a7 d8 ori r12,r12,0xa7d8
static void
rtems_bdbuf_wait_for_access (rtems_bdbuf_buffer *bd)
{
while (true)
{
switch (bd->state)
800b024: 29 61 00 20 lw r1,(r11+32)
800b028: 34 22 ff ff addi r2,r1,-1
800b02c: 54 4f 00 15 bgu r2,r15,800b080 <rtems_bdbuf_get_buffer_for_access+0x204><== NEVER TAKEN
800b030: b8 40 08 00 mv r1,r2
800b034: 34 02 00 02 mvi r2,2
800b038: f8 00 32 42 calli 8017940 <__ashlsi3>
800b03c: b5 c1 08 00 add r1,r14,r1
800b040: 28 21 00 00 lw r1,(r1+0)
800b044: c0 20 00 00 b r1
{
case RTEMS_BDBUF_STATE_MODIFIED:
rtems_bdbuf_group_release (bd);
800b048: 29 61 00 28 lw r1,(r11+40)
800b04c: fb ff fa 3e calli 8009944 <rtems_bdbuf_group_release.clone.8>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
800b050: 29 62 00 00 lw r2,(r11+0)
previous = the_node->previous;
800b054: 29 61 00 04 lw r1,(r11+4)
next->previous = previous;
800b058: 58 41 00 04 sw (r2+4),r1
previous->next = next;
800b05c: 58 22 00 00 sw (r1+0),r2
800b060: e0 00 00 0b bi 800b08c <rtems_bdbuf_get_buffer_for_access+0x210>
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);
800b064: b9 60 08 00 mv r1,r11
800b068: b9 80 10 00 mv r2,r12
800b06c: e0 00 00 03 bi 800b078 <rtems_bdbuf_get_buffer_for_access+0x1fc>
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);
800b070: b9 60 08 00 mv r1,r11
800b074: b9 a0 10 00 mv r2,r13
800b078: fb ff fa 37 calli 8009954 <rtems_bdbuf_wait>
800b07c: e3 ff ff ea bi 800b024 <rtems_bdbuf_get_buffer_for_access+0x1a8>
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_7);
800b080: 34 02 00 13 mvi r2,19 <== NOT EXECUTED
800b084: fb ff f9 29 calli 8009528 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
800b088: e3 ff ff e7 bi 800b024 <rtems_bdbuf_get_buffer_for_access+0x1a8><== NOT EXECUTED
}
}
while (bd == NULL);
rtems_bdbuf_wait_for_access (bd);
rtems_bdbuf_group_obtain (bd);
800b08c: 29 61 00 28 lw r1,(r11+40)
800b090: fb ff fa 29 calli 8009934 <rtems_bdbuf_group_obtain.clone.7>
return bd;
}
800b094: b9 60 08 00 mv r1,r11
800b098: 2b 9d 00 04 lw ra,(sp+4)
800b09c: 2b 8b 00 38 lw r11,(sp+56)
800b0a0: 2b 8c 00 34 lw r12,(sp+52)
800b0a4: 2b 8d 00 30 lw r13,(sp+48)
800b0a8: 2b 8e 00 2c lw r14,(sp+44)
800b0ac: 2b 8f 00 28 lw r15,(sp+40)
800b0b0: 2b 90 00 24 lw r16,(sp+36)
800b0b4: 2b 91 00 20 lw r17,(sp+32)
800b0b8: 2b 92 00 1c lw r18,(sp+28)
800b0bc: 2b 93 00 18 lw r19,(sp+24)
800b0c0: 2b 94 00 14 lw r20,(sp+20)
800b0c4: 2b 95 00 10 lw r21,(sp+16)
800b0c8: 2b 96 00 0c lw r22,(sp+12)
800b0cc: 2b 97 00 08 lw r23,(sp+8)
800b0d0: 37 9c 00 38 addi sp,sp,56
800b0d4: c3 a0 00 00 ret
0800ab0c <rtems_bdbuf_get_buffer_for_read_ahead>:
}
static rtems_bdbuf_buffer *
rtems_bdbuf_get_buffer_for_read_ahead (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
800ab0c: 37 9c ff ec addi sp,sp,-20
800ab10: 5b 8b 00 14 sw (sp+20),r11
800ab14: 5b 8c 00 10 sw (sp+16),r12
800ab18: 5b 8d 00 0c sw (sp+12),r13
800ab1c: 5b 8e 00 08 sw (sp+8),r14
800ab20: 5b 9d 00 04 sw (sp+4),ra
rtems_bdbuf_buffer *bd = NULL;
bd = rtems_bdbuf_avl_search (&bdbuf_cache.tree, dd, block);
800ab24: 78 04 08 01 mvhi r4,0x801
800ab28: 38 84 a7 74 ori r4,r4,0xa774
}
static rtems_bdbuf_buffer *
rtems_bdbuf_get_buffer_for_read_ahead (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
800ab2c: b8 20 70 00 mv r14,r1
rtems_bdbuf_buffer *bd = NULL;
bd = rtems_bdbuf_avl_search (&bdbuf_cache.tree, dd, block);
800ab30: 28 81 00 3c lw r1,(r4+60)
}
static rtems_bdbuf_buffer *
rtems_bdbuf_get_buffer_for_read_ahead (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
800ab34: b8 40 68 00 mv r13,r2
rtems_bdbuf_buffer *bd = NULL;
bd = rtems_bdbuf_avl_search (&bdbuf_cache.tree, dd, block);
800ab38: b9 a0 18 00 mv r3,r13
800ab3c: b9 c0 10 00 mv r2,r14
800ab40: fb ff fb 6f calli 80098fc <rtems_bdbuf_avl_search.clone.5>
800ab44: b8 20 60 00 mv r12,r1
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;
800ab48: 34 0b 00 00 mvi r11,0
{
rtems_bdbuf_buffer *bd = NULL;
bd = rtems_bdbuf_avl_search (&bdbuf_cache.tree, dd, block);
if (bd == NULL)
800ab4c: 5c 20 00 08 bne r1,r0,800ab6c <rtems_bdbuf_get_buffer_for_read_ahead+0x60><== NEVER TAKEN
{
bd = rtems_bdbuf_get_buffer_from_lru_list (dd, block);
800ab50: b9 c0 08 00 mv r1,r14
800ab54: b9 a0 10 00 mv r2,r13
800ab58: fb ff fe d6 calli 800a6b0 <rtems_bdbuf_get_buffer_from_lru_list>
800ab5c: b8 20 58 00 mv r11,r1
if (bd != NULL)
800ab60: 44 2c 00 03 be r1,r12,800ab6c <rtems_bdbuf_get_buffer_for_read_ahead+0x60><== NEVER TAKEN
rtems_bdbuf_group_obtain (bd);
800ab64: 28 21 00 28 lw r1,(r1+40)
800ab68: fb ff fb 73 calli 8009934 <rtems_bdbuf_group_obtain.clone.7>
* thus no need for a read ahead.
*/
bd = NULL;
return bd;
}
800ab6c: b9 60 08 00 mv r1,r11
800ab70: 2b 9d 00 04 lw ra,(sp+4)
800ab74: 2b 8b 00 14 lw r11,(sp+20)
800ab78: 2b 8c 00 10 lw r12,(sp+16)
800ab7c: 2b 8d 00 0c lw r13,(sp+12)
800ab80: 2b 8e 00 08 lw r14,(sp+8)
800ab84: 37 9c 00 14 addi sp,sp,20
800ab88: c3 a0 00 00 ret
0800a6b0 <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)
{
800a6b0: 37 9c ff 48 addi sp,sp,-184
800a6b4: 5b 8b 00 38 sw (sp+56),r11
800a6b8: 5b 8c 00 34 sw (sp+52),r12
800a6bc: 5b 8d 00 30 sw (sp+48),r13
800a6c0: 5b 8e 00 2c sw (sp+44),r14
800a6c4: 5b 8f 00 28 sw (sp+40),r15
800a6c8: 5b 90 00 24 sw (sp+36),r16
800a6cc: 5b 91 00 20 sw (sp+32),r17
800a6d0: 5b 92 00 1c sw (sp+28),r18
800a6d4: 5b 93 00 18 sw (sp+24),r19
800a6d8: 5b 94 00 14 sw (sp+20),r20
800a6dc: 5b 95 00 10 sw (sp+16),r21
800a6e0: 5b 96 00 0c sw (sp+12),r22
800a6e4: 5b 97 00 08 sw (sp+8),r23
800a6e8: 5b 9d 00 04 sw (sp+4),ra
void rtems_bdbuf_reset_device_stats (rtems_disk_device *dd)
{
rtems_bdbuf_lock_cache ();
memset (&dd->stats, 0, sizeof(dd->stats));
rtems_bdbuf_unlock_cache ();
}
800a6ec: 78 0f 08 01 mvhi r15,0x801
800a6f0: 39 ef a7 74 ori r15,r15,0xa774
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))
800a6f4: 78 13 08 01 mvhi r19,0x801
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
800a6f8: 78 12 08 01 mvhi r18,0x801
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);
800a6fc: 78 10 08 01 mvhi r16,0x801
}
static rtems_bdbuf_buffer *
rtems_bdbuf_get_buffer_from_lru_list (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
800a700: b8 20 70 00 mv r14,r1
800a704: b8 40 88 00 mv r17,r2
void rtems_bdbuf_reset_device_stats (rtems_disk_device *dd)
{
rtems_bdbuf_lock_cache ();
memset (&dd->stats, 0, sizeof(dd->stats));
rtems_bdbuf_unlock_cache ();
}
800a708: 29 ed 00 40 lw r13,(r15+64)
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))
800a70c: 3a 73 a7 b8 ori r19,r19,0xa7b8
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;
800a710: 34 16 00 01 mvi r22,1
800a714: 3a 52 a7 b4 ori r18,r18,0xa7b4
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);
800a718: 3a 10 a7 e8 ori r16,r16,0xa7e8
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))
800a71c: e0 00 00 e6 bi 800aab4 <rtems_bdbuf_get_buffer_from_lru_list+0x404>
bd->group->bds_per_group, dd->bds_per_group);
/*
* If nobody waits for this BD, we may recycle it.
*/
if (bd->waiters == 0)
800a720: 29 a1 00 24 lw r1,(r13+36)
800a724: 5c 20 00 e3 bne r1,r0,800aab0 <rtems_bdbuf_get_buffer_from_lru_list+0x400>
{
if (bd->group->bds_per_group == dd->bds_per_group)
800a728: 29 ab 00 28 lw r11,(r13+40)
800a72c: 29 cc 00 34 lw r12,(r14+52)
800a730: 29 62 00 08 lw r2,(r11+8)
800a734: 5c 4c 00 05 bne r2,r12,800a748 <rtems_bdbuf_get_buffer_from_lru_list+0x98>
{
rtems_bdbuf_remove_from_tree_and_lru_list (bd);
800a738: b9 a0 08 00 mv r1,r13
800a73c: fb ff ff c8 calli 800a65c <rtems_bdbuf_remove_from_tree_and_lru_list>
800a740: b9 a0 60 00 mv r12,r13
800a744: e0 00 00 2a bi 800a7ec <rtems_bdbuf_get_buffer_from_lru_list+0x13c>
empty_bd = bd;
}
else if (bd->group->users == 0)
800a748: 29 61 00 0c lw r1,(r11+12)
800a74c: 5c 20 00 d9 bne r1,r0,800aab0 <rtems_bdbuf_get_buffer_from_lru_list+0x400>
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;
800a750: 29 e1 00 20 lw r1,(r15+32)
for (b = 0, bd = group->bdbuf;
800a754: 29 75 00 10 lw r21,(r11+16)
800a758: 34 14 00 00 mvi r20,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;
800a75c: f8 00 35 53 calli 8017ca8 <__udivsi3>
for (b = 0, bd = group->bdbuf;
b < group->bds_per_group;
b++, bd += bufs_per_bd)
800a760: 34 02 00 38 mvi r2,56
800a764: f8 00 34 ec calli 8017b14 <__mulsi3>
800a768: b8 20 b8 00 mv r23,r1
800a76c: e0 00 00 05 bi 800a780 <rtems_bdbuf_get_buffer_from_lru_list+0xd0>
rtems_bdbuf_remove_from_tree_and_lru_list (bd);
800a770: ba a0 08 00 mv r1,r21
800a774: fb ff ff ba calli 800a65c <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)
800a778: 36 94 00 01 addi r20,r20,1
800a77c: b6 b7 a8 00 add r21,r21,r23
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;
800a780: 29 61 00 08 lw r1,(r11+8)
800a784: 54 34 ff fb bgu r1,r20,800a770 <rtems_bdbuf_get_buffer_from_lru_list+0xc0>
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;
800a788: 29 e1 00 20 lw r1,(r15+32)
800a78c: b9 80 10 00 mv r2,r12
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;
800a790: 59 6c 00 08 sw (r11+8),r12
bufs_per_bd = bdbuf_cache.max_bds_per_group / new_bds_per_group;
800a794: f8 00 35 45 calli 8017ca8 <__udivsi3>
for (b = 1, bd = group->bdbuf + bufs_per_bd;
800a798: 34 02 00 38 mvi r2,56
800a79c: f8 00 34 de calli 8017b14 <__mulsi3>
800a7a0: 29 63 00 10 lw r3,(r11+16)
800a7a4: 29 e5 00 40 lw r5,(r15+64)
800a7a8: 34 04 00 01 mvi r4,1
800a7ac: b4 61 18 00 add r3,r3,r1
800a7b0: e0 00 00 09 bi 800a7d4 <rtems_bdbuf_get_buffer_from_lru_list+0x124>
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800a7b4: 58 60 00 20 sw (r3+32),r0
static void
rtems_bdbuf_make_free_and_add_to_lru_list (rtems_bdbuf_buffer *bd)
{
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_FREE);
rtems_chain_prepend_unprotected (&bdbuf_cache.lru, &bd->link);
800a7b8: b8 60 10 00 mv r2,r3
800a7bc: 58 72 00 04 sw (r3+4),r18
before_node = after_node->next;
after_node->next = the_node;
the_node->next = before_node;
800a7c0: 58 65 00 00 sw (r3+0),r5
before_node->previous = the_node;
800a7c4: 58 a3 00 04 sw (r5+4),r3
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)
800a7c8: 34 84 00 01 addi r4,r4,1
800a7cc: b4 61 18 00 add r3,r3,r1
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
after_node->next = the_node;
800a7d0: b8 40 28 00 mv r5,r2
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;
800a7d4: 55 84 ff f8 bgu r12,r4,800a7b4 <rtems_bdbuf_get_buffer_from_lru_list+0x104>
800a7d8: 59 e5 00 40 sw (r15+64),r5
b < group->bds_per_group;
b++, bd += bufs_per_bd)
rtems_bdbuf_make_free_and_add_to_lru_list (bd);
if (b > 1)
800a7dc: 52 c4 00 03 bgeu r22,r4,800a7e8 <rtems_bdbuf_get_buffer_from_lru_list+0x138>
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
800a7e0: ba 00 08 00 mv r1,r16
800a7e4: fb ff fb 7d calli 80095d8 <rtems_bdbuf_wake>
return group->bdbuf;
800a7e8: 29 6c 00 10 lw r12,(r11+16)
}
else if (bd->group->users == 0)
empty_bd = rtems_bdbuf_group_realloc (bd->group, dd->bds_per_group);
}
if (empty_bd != NULL)
800a7ec: 45 80 00 b1 be r12,r0,800aab0 <rtems_bdbuf_get_buffer_from_lru_list+0x400><== NEVER TAKEN
rtems_bdbuf_buffer* node)
{
const rtems_disk_device *dd = node->dd;
rtems_blkdev_bnum block = node->block;
rtems_bdbuf_buffer* p = *root;
800a7f0: 78 03 08 01 mvhi r3,0x801
800a7f4: 38 63 a7 74 ori r3,r3,0xa774
800a7f8: 28 6b 00 3c lw r11,(r3+60)
static void
rtems_bdbuf_setup_empty_buffer (rtems_bdbuf_buffer *bd,
rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
bd->dd = dd ;
800a7fc: 59 8e 00 14 sw (r12+20),r14
bd->block = block;
800a800: 59 91 00 18 sw (r12+24),r17
bd->avl.left = NULL;
800a804: 59 80 00 08 sw (r12+8),r0
bd->avl.right = NULL;
800a808: 59 80 00 0c sw (r12+12),r0
bd->waiters = 0;
800a80c: 59 80 00 24 sw (r12+36),r0
rtems_bdbuf_buffer* buf_stack[RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer** buf_prev = buf_stack;
bool modified = false;
if (p == NULL)
800a810: 45 60 00 05 be r11,r0,800a824 <rtems_bdbuf_get_buffer_from_lru_list+0x174>
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;
800a814: 37 90 00 3c addi r16,sp,60
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
{
p->avl.cache = 1;
800a818: 34 03 00 01 mvi r3,1
break;
}
}
else if ((p->dd != dd) || (p->block != block))
{
p->avl.cache = -1;
800a81c: 34 02 ff ff mvi r2,-1
800a820: e0 00 00 14 bi 800a870 <rtems_bdbuf_get_buffer_from_lru_list+0x1c0>
bool modified = false;
if (p == NULL)
{
*root = node;
800a824: 58 6c 00 3c sw (r3+60),r12
node->avl.left = NULL;
node->avl.right = NULL;
node->avl.bal = 0;
800a828: 31 80 00 11 sb (r12+17),r0
800a82c: e0 00 00 9e bi 800aaa4 <rtems_bdbuf_get_buffer_from_lru_list+0x3f4>
while (p != NULL)
{
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
800a830: 5c 2e 00 09 bne r1,r14,800a854 <rtems_bdbuf_get_buffer_from_lru_list+0x1a4><== NEVER TAKEN
800a834: 29 61 00 18 lw r1,(r11+24)
800a838: 50 31 00 06 bgeu r1,r17,800a850 <rtems_bdbuf_get_buffer_from_lru_list+0x1a0>
{
p->avl.cache = 1;
q = p->avl.right;
800a83c: 29 61 00 0c lw r1,(r11+12)
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
{
p->avl.cache = 1;
800a840: 31 63 00 10 sb (r11+16),r3
q = p->avl.right;
if (q == NULL)
800a844: 5c 20 00 09 bne r1,r0,800a868 <rtems_bdbuf_get_buffer_from_lru_list+0x1b8>
{
q = node;
p->avl.right = q = node;
800a848: 59 6c 00 0c sw (r11+12),r12
800a84c: e0 00 00 0e bi 800a884 <rtems_bdbuf_get_buffer_from_lru_list+0x1d4>
break;
}
}
else if ((p->dd != dd) || (p->block != block))
800a850: 44 31 00 ac be r1,r17,800ab00 <rtems_bdbuf_get_buffer_from_lru_list+0x450><== NEVER TAKEN
{
p->avl.cache = -1;
q = p->avl.left;
800a854: 29 61 00 08 lw r1,(r11+8)
break;
}
}
else if ((p->dd != dd) || (p->block != block))
{
p->avl.cache = -1;
800a858: 31 62 00 10 sb (r11+16),r2
q = p->avl.left;
if (q == NULL)
800a85c: 5c 20 00 03 bne r1,r0,800a868 <rtems_bdbuf_get_buffer_from_lru_list+0x1b8>
{
q = node;
p->avl.left = q;
800a860: 59 6c 00 08 sw (r11+8),r12
800a864: e0 00 00 08 bi 800a884 <rtems_bdbuf_get_buffer_from_lru_list+0x1d4>
}
else if ((p->dd != dd) || (p->block != block))
{
p->avl.cache = -1;
q = p->avl.left;
if (q == NULL)
800a868: b8 80 80 00 mv r16,r4
800a86c: b8 20 58 00 mv r11,r1
while (p != NULL)
{
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
800a870: 29 61 00 14 lw r1,(r11+20)
return 0;
}
while (p != NULL)
{
*buf_prev++ = p;
800a874: 5a 0b 00 00 sw (r16+0),r11
800a878: 36 04 00 04 addi r4,r16,4
if (((uintptr_t) p->dd < (uintptr_t) dd)
800a87c: 55 c1 ff f0 bgu r14,r1,800a83c <rtems_bdbuf_get_buffer_from_lru_list+0x18c><== NEVER TAKEN
800a880: e3 ff ff ec bi 800a830 <rtems_bdbuf_get_buffer_from_lru_list+0x180>
}
p = q;
}
q->avl.left = q->avl.right = NULL;
800a884: 59 80 00 0c sw (r12+12),r0
800a888: 59 80 00 08 sw (r12+8),r0
q->avl.bal = 0;
800a88c: 31 80 00 11 sb (r12+17),r0
modified = true;
buf_prev--;
while (modified)
{
if (p->avl.cache == -1)
800a890: 34 0e ff ff mvi r14,-1
p->avl.bal = 0;
modified = false;
break;
case 0:
p->avl.bal = 1;
800a894: 34 13 00 01 mvi r19,1
800a898: 34 11 00 01 mvi r17,1
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;
if (p2->avl.bal == +1) p1->avl.bal = -1; else p1->avl.bal = 0;
800a89c: 34 15 ff ff mvi r21,-1
default:
break;
}
}
q = p;
if (buf_prev > buf_stack)
800a8a0: 37 94 00 3c addi r20,sp,60
800a8a4: e0 00 00 02 bi 800a8ac <rtems_bdbuf_get_buffer_from_lru_list+0x1fc>
q->avl.left = q->avl.right = NULL;
q->avl.bal = 0;
modified = true;
buf_prev--;
while (modified)
800a8a8: b9 e0 58 00 mv r11,r15
{
if (p->avl.cache == -1)
800a8ac: 41 61 00 10 lbu r1,(r11+16)
800a8b0: 34 02 00 18 mvi r2,24
800a8b4: f8 00 34 23 calli 8017940 <__ashlsi3>
800a8b8: 34 02 00 18 mvi r2,24
800a8bc: f8 00 34 48 calli 80179dc <__ashrsi3>
800a8c0: 41 62 00 11 lbu r2,(r11+17)
800a8c4: 5c 2e 00 2f bne r1,r14,800a980 <rtems_bdbuf_get_buffer_from_lru_list+0x2d0>
{
switch (p->avl.bal)
800a8c8: b8 40 08 00 mv r1,r2
800a8cc: 34 02 00 18 mvi r2,24
800a8d0: f8 00 34 1c calli 8017940 <__ashlsi3>
800a8d4: 34 02 00 18 mvi r2,24
800a8d8: f8 00 34 41 calli 80179dc <__ashrsi3>
800a8dc: 44 20 00 04 be r1,r0,800a8ec <rtems_bdbuf_get_buffer_from_lru_list+0x23c>
800a8e0: 44 31 00 30 be r1,r17,800a9a0 <rtems_bdbuf_get_buffer_from_lru_list+0x2f0>
800a8e4: 5c 2e 00 5d bne r1,r14,800aa58 <rtems_bdbuf_get_buffer_from_lru_list+0x3a8><== NEVER TAKEN
800a8e8: e0 00 00 03 bi 800a8f4 <rtems_bdbuf_get_buffer_from_lru_list+0x244>
p->avl.bal = 0;
modified = false;
break;
case 0:
p->avl.bal = -1;
800a8ec: 31 6e 00 11 sb (r11+17),r14
800a8f0: e0 00 00 5a bi 800aa58 <rtems_bdbuf_get_buffer_from_lru_list+0x3a8>
break;
case -1:
p1 = p->avl.left;
800a8f4: 29 6f 00 08 lw r15,(r11+8)
if (p1->avl.bal == -1) /* simple LL-turn */
800a8f8: 34 02 00 18 mvi r2,24
800a8fc: 41 e1 00 11 lbu r1,(r15+17)
800a900: f8 00 34 10 calli 8017940 <__ashlsi3>
800a904: 34 02 00 18 mvi r2,24
800a908: f8 00 34 35 calli 80179dc <__ashrsi3>
800a90c: 29 ed 00 0c lw r13,(r15+12)
800a910: 5c 2e 00 04 bne r1,r14,800a920 <rtems_bdbuf_get_buffer_from_lru_list+0x270>
{
p->avl.left = p1->avl.right;
800a914: 59 6d 00 08 sw (r11+8),r13
p1->avl.right = p;
800a918: 59 eb 00 0c sw (r15+12),r11
800a91c: e0 00 00 2f bi 800a9d8 <rtems_bdbuf_get_buffer_from_lru_list+0x328>
p = p1;
}
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
800a920: 29 a1 00 08 lw r1,(r13+8)
p2->avl.left = p1;
800a924: 59 af 00 08 sw (r13+8),r15
p->avl.left = p2->avl.right;
p2->avl.right = p;
if (p2->avl.bal == -1) p->avl.bal = +1; else p->avl.bal = 0;
800a928: 34 02 00 18 mvi r2,24
p = p1;
}
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
800a92c: 59 e1 00 0c sw (r15+12),r1
p2->avl.left = p1;
p->avl.left = p2->avl.right;
800a930: 29 a1 00 0c lw r1,(r13+12)
p2->avl.right = p;
800a934: 59 ab 00 0c sw (r13+12),r11
p->avl.bal = 0;
p = p1;
}
else /* double LR-turn */
{
p2 = p1->avl.right;
800a938: b9 a0 90 00 mv r18,r13
p1->avl.right = p2->avl.left;
p2->avl.left = p1;
p->avl.left = p2->avl.right;
800a93c: 59 61 00 08 sw (r11+8),r1
p2->avl.right = p;
if (p2->avl.bal == -1) p->avl.bal = +1; else p->avl.bal = 0;
800a940: 41 a1 00 11 lbu r1,(r13+17)
800a944: f8 00 33 ff calli 8017940 <__ashlsi3>
800a948: 34 02 00 18 mvi r2,24
800a94c: f8 00 34 24 calli 80179dc <__ashrsi3>
800a950: 5c 2e 00 03 bne r1,r14,800a95c <rtems_bdbuf_get_buffer_from_lru_list+0x2ac>
800a954: 31 71 00 11 sb (r11+17),r17
800a958: e0 00 00 02 bi 800a960 <rtems_bdbuf_get_buffer_from_lru_list+0x2b0>
800a95c: 31 60 00 11 sb (r11+17),r0
if (p2->avl.bal == +1) p1->avl.bal = -1; else p1->avl.bal = 0;
800a960: 41 a1 00 11 lbu r1,(r13+17)
800a964: 34 02 00 18 mvi r2,24
800a968: f8 00 33 f6 calli 8017940 <__ashlsi3>
800a96c: 34 02 00 18 mvi r2,24
800a970: f8 00 34 1b calli 80179dc <__ashrsi3>
800a974: 5c 31 00 34 bne r1,r17,800aa44 <rtems_bdbuf_get_buffer_from_lru_list+0x394>
800a978: 31 f5 00 11 sb (r15+17),r21
800a97c: e0 00 00 33 bi 800aa48 <rtems_bdbuf_get_buffer_from_lru_list+0x398>
break;
}
}
else
{
switch (p->avl.bal)
800a980: b8 40 08 00 mv r1,r2
800a984: 34 02 00 18 mvi r2,24
800a988: f8 00 33 ee calli 8017940 <__ashlsi3>
800a98c: 34 02 00 18 mvi r2,24
800a990: f8 00 34 13 calli 80179dc <__ashrsi3>
800a994: 44 20 00 05 be r1,r0,800a9a8 <rtems_bdbuf_get_buffer_from_lru_list+0x2f8>
800a998: 44 31 00 06 be r1,r17,800a9b0 <rtems_bdbuf_get_buffer_from_lru_list+0x300>
800a99c: 5c 2e 00 2f bne r1,r14,800aa58 <rtems_bdbuf_get_buffer_from_lru_list+0x3a8><== NEVER TAKEN
{
case -1:
p->avl.bal = 0;
800a9a0: 31 60 00 11 sb (r11+17),r0
800a9a4: e0 00 00 2b bi 800aa50 <rtems_bdbuf_get_buffer_from_lru_list+0x3a0>
modified = false;
break;
case 0:
p->avl.bal = 1;
800a9a8: 31 73 00 11 sb (r11+17),r19
800a9ac: e0 00 00 2b bi 800aa58 <rtems_bdbuf_get_buffer_from_lru_list+0x3a8>
break;
case 1:
p1 = p->avl.right;
800a9b0: 29 6f 00 0c lw r15,(r11+12)
if (p1->avl.bal == 1) /* simple RR-turn */
800a9b4: 34 02 00 18 mvi r2,24
800a9b8: 41 e1 00 11 lbu r1,(r15+17)
800a9bc: f8 00 33 e1 calli 8017940 <__ashlsi3>
800a9c0: 34 02 00 18 mvi r2,24
800a9c4: f8 00 34 06 calli 80179dc <__ashrsi3>
800a9c8: 29 ed 00 08 lw r13,(r15+8)
800a9cc: 5c 31 00 06 bne r1,r17,800a9e4 <rtems_bdbuf_get_buffer_from_lru_list+0x334>
{
p->avl.right = p1->avl.left;
800a9d0: 59 6d 00 0c sw (r11+12),r13
p1->avl.left = p;
800a9d4: 59 eb 00 08 sw (r15+8),r11
p->avl.bal = 0;
800a9d8: 31 60 00 11 sb (r11+17),r0
800a9dc: b9 e0 90 00 mv r18,r15
800a9e0: e0 00 00 1a bi 800aa48 <rtems_bdbuf_get_buffer_from_lru_list+0x398>
p = p1;
}
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
800a9e4: 29 a1 00 0c lw r1,(r13+12)
p2->avl.right = p1;
800a9e8: 59 af 00 0c sw (r13+12),r15
p->avl.right = p2->avl.left;
p2->avl.left = p;
if (p2->avl.bal == +1) p->avl.bal = -1; else p->avl.bal = 0;
800a9ec: 34 02 00 18 mvi r2,24
p = p1;
}
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
800a9f0: 59 e1 00 08 sw (r15+8),r1
p2->avl.right = p1;
p->avl.right = p2->avl.left;
800a9f4: 29 a1 00 08 lw r1,(r13+8)
p2->avl.left = p;
800a9f8: 59 ab 00 08 sw (r13+8),r11
p->avl.bal = 0;
p = p1;
}
else /* double RL-turn */
{
p2 = p1->avl.left;
800a9fc: b9 a0 90 00 mv r18,r13
p1->avl.left = p2->avl.right;
p2->avl.right = p1;
p->avl.right = p2->avl.left;
800aa00: 59 61 00 0c sw (r11+12),r1
p2->avl.left = p;
if (p2->avl.bal == +1) p->avl.bal = -1; else p->avl.bal = 0;
800aa04: 41 a1 00 11 lbu r1,(r13+17)
800aa08: f8 00 33 ce calli 8017940 <__ashlsi3>
800aa0c: 34 02 00 18 mvi r2,24
800aa10: f8 00 33 f3 calli 80179dc <__ashrsi3>
800aa14: 5c 31 00 03 bne r1,r17,800aa20 <rtems_bdbuf_get_buffer_from_lru_list+0x370><== ALWAYS TAKEN
800aa18: 31 6e 00 11 sb (r11+17),r14 <== NOT EXECUTED
800aa1c: e0 00 00 02 bi 800aa24 <rtems_bdbuf_get_buffer_from_lru_list+0x374><== NOT EXECUTED
800aa20: 31 60 00 11 sb (r11+17),r0
if (p2->avl.bal == -1) p1->avl.bal = +1; else p1->avl.bal = 0;
800aa24: 41 a1 00 11 lbu r1,(r13+17)
800aa28: 34 02 00 18 mvi r2,24
800aa2c: f8 00 33 c5 calli 8017940 <__ashlsi3>
800aa30: 34 02 00 18 mvi r2,24
800aa34: f8 00 33 ea calli 80179dc <__ashrsi3>
800aa38: 5c 2e 00 03 bne r1,r14,800aa44 <rtems_bdbuf_get_buffer_from_lru_list+0x394><== ALWAYS TAKEN
800aa3c: 31 f3 00 11 sb (r15+17),r19 <== NOT EXECUTED
800aa40: e0 00 00 02 bi 800aa48 <rtems_bdbuf_get_buffer_from_lru_list+0x398><== NOT EXECUTED
800aa44: 31 e0 00 11 sb (r15+17),r0
p = p2;
}
p->avl.bal = 0;
800aa48: 32 40 00 11 sb (r18+17),r0
800aa4c: ba 40 58 00 mv r11,r18
modified = false;
800aa50: 34 0d 00 00 mvi r13,0
800aa54: e0 00 00 02 bi 800aa5c <rtems_bdbuf_get_buffer_from_lru_list+0x3ac>
break;
}
}
else
{
switch (p->avl.bal)
800aa58: 34 0d 00 01 mvi r13,1
default:
break;
}
}
q = p;
if (buf_prev > buf_stack)
800aa5c: 52 90 00 0d bgeu r20,r16,800aa90 <rtems_bdbuf_get_buffer_from_lru_list+0x3e0>
{
p = *--buf_prev;
800aa60: 36 10 ff fc addi r16,r16,-4
800aa64: 2a 0f 00 00 lw r15,(r16+0)
if (p->avl.cache == -1)
800aa68: 34 02 00 18 mvi r2,24
800aa6c: 41 e1 00 10 lbu r1,(r15+16)
800aa70: f8 00 33 b4 calli 8017940 <__ashlsi3>
800aa74: 34 02 00 18 mvi r2,24
800aa78: f8 00 33 d9 calli 80179dc <__ashrsi3>
800aa7c: 5c 2e 00 03 bne r1,r14,800aa88 <rtems_bdbuf_get_buffer_from_lru_list+0x3d8>
{
p->avl.left = q;
800aa80: 59 eb 00 08 sw (r15+8),r11
800aa84: e0 00 00 07 bi 800aaa0 <rtems_bdbuf_get_buffer_from_lru_list+0x3f0>
}
else
{
p->avl.right = q;
800aa88: 59 eb 00 0c sw (r15+12),r11
800aa8c: e0 00 00 05 bi 800aaa0 <rtems_bdbuf_get_buffer_from_lru_list+0x3f0>
}
}
else
{
*root = p;
800aa90: 78 01 08 01 mvhi r1,0x801
800aa94: 38 21 a7 74 ori r1,r1,0xa774
800aa98: 58 2b 00 3c sw (r1+60),r11
800aa9c: e0 00 00 02 bi 800aaa4 <rtems_bdbuf_get_buffer_from_lru_list+0x3f4>
q->avl.left = q->avl.right = NULL;
q->avl.bal = 0;
modified = true;
buf_prev--;
while (modified)
800aaa0: 5d a0 ff 82 bne r13,r0,800a8a8 <rtems_bdbuf_get_buffer_from_lru_list+0x1f8>
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800aaa4: 34 01 00 01 mvi r1,1
800aaa8: 59 81 00 20 sw (r12+32),r1
if (empty_bd != NULL)
{
rtems_bdbuf_setup_empty_buffer (empty_bd, dd, block);
return empty_bd;
800aaac: e0 00 00 04 bi 800aabc <rtems_bdbuf_get_buffer_from_lru_list+0x40c>
void rtems_bdbuf_reset_device_stats (rtems_disk_device *dd)
{
rtems_bdbuf_lock_cache ();
memset (&dd->stats, 0, sizeof(dd->stats));
rtems_bdbuf_unlock_cache ();
}
800aab0: 29 ad 00 00 lw r13,(r13+0)
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))
800aab4: 5d b3 ff 1b bne r13,r19,800a720 <rtems_bdbuf_get_buffer_from_lru_list+0x70>
}
node = rtems_chain_next (node);
}
return NULL;
800aab8: 34 0c 00 00 mvi r12,0
}
800aabc: b9 80 08 00 mv r1,r12
800aac0: 2b 9d 00 04 lw ra,(sp+4)
800aac4: 2b 8b 00 38 lw r11,(sp+56)
800aac8: 2b 8c 00 34 lw r12,(sp+52)
800aacc: 2b 8d 00 30 lw r13,(sp+48)
800aad0: 2b 8e 00 2c lw r14,(sp+44)
800aad4: 2b 8f 00 28 lw r15,(sp+40)
800aad8: 2b 90 00 24 lw r16,(sp+36)
800aadc: 2b 91 00 20 lw r17,(sp+32)
800aae0: 2b 92 00 1c lw r18,(sp+28)
800aae4: 2b 93 00 18 lw r19,(sp+24)
800aae8: 2b 94 00 14 lw r20,(sp+20)
800aaec: 2b 95 00 10 lw r21,(sp+16)
800aaf0: 2b 96 00 0c lw r22,(sp+12)
800aaf4: 2b 97 00 08 lw r23,(sp+8)
800aaf8: 37 9c 00 b8 addi sp,sp,184
800aafc: c3 a0 00 00 ret
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);
800ab00: 34 01 00 08 mvi r1,8 <== NOT EXECUTED
800ab04: fb ff fa 62 calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
800ab08: e3 ff ff e7 bi 800aaa4 <rtems_bdbuf_get_buffer_from_lru_list+0x3f4><== NOT EXECUTED
0800b0d8 <rtems_bdbuf_init>:
*
* @return rtems_status_code The initialisation status.
*/
rtems_status_code
rtems_bdbuf_init (void)
{
800b0d8: 37 9c ff cc addi sp,sp,-52
800b0dc: 5b 8b 00 34 sw (sp+52),r11
800b0e0: 5b 8c 00 30 sw (sp+48),r12
800b0e4: 5b 8d 00 2c sw (sp+44),r13
800b0e8: 5b 8e 00 28 sw (sp+40),r14
800b0ec: 5b 8f 00 24 sw (sp+36),r15
800b0f0: 5b 90 00 20 sw (sp+32),r16
800b0f4: 5b 91 00 1c sw (sp+28),r17
800b0f8: 5b 92 00 18 sw (sp+24),r18
800b0fc: 5b 93 00 14 sw (sp+20),r19
800b100: 5b 94 00 10 sw (sp+16),r20
800b104: 5b 95 00 0c sw (sp+12),r21
800b108: 5b 96 00 08 sw (sp+8),r22
800b10c: 5b 9d 00 04 sw (sp+4),ra
rtems_mode prev_mode;
if (rtems_bdbuf_tracer)
printf ("bdbuf:init\n");
if (rtems_interrupt_is_in_progress())
800b110: 78 01 08 01 mvhi r1,0x801
800b114: 38 21 ae 00 ori r1,r1,0xae00
800b118: 28 2b 00 08 lw r11,(r1+8)
return RTEMS_CALLED_FROM_ISR;
800b11c: 34 03 00 12 mvi r3,18
rtems_mode prev_mode;
if (rtems_bdbuf_tracer)
printf ("bdbuf:init\n");
if (rtems_interrupt_is_in_progress())
800b120: 5d 60 01 0e bne r11,r0,800b558 <rtems_bdbuf_init+0x480> <== NEVER TAKEN
return RTEMS_CALLED_FROM_ISR;
/*
* Check the configuration table values.
*/
if ((bdbuf_config.buffer_max % bdbuf_config.buffer_min) != 0)
800b124: 78 0c 08 01 mvhi r12,0x801
800b128: 39 8c 87 bc ori r12,r12,0x87bc
800b12c: 29 8f 00 28 lw r15,(r12+40)
800b130: 29 8d 00 24 lw r13,(r12+36)
800b134: b9 e0 08 00 mv r1,r15
800b138: b9 a0 10 00 mv r2,r13
800b13c: f8 00 32 eb calli 8017ce8 <__umodsi3>
800b140: b8 20 70 00 mv r14,r1
return RTEMS_INVALID_NUMBER;
800b144: 34 03 00 0a mvi r3,10
return RTEMS_CALLED_FROM_ISR;
/*
* Check the configuration table values.
*/
if ((bdbuf_config.buffer_max % bdbuf_config.buffer_min) != 0)
800b148: 5c 2b 01 04 bne r1,r11,800b558 <rtems_bdbuf_init+0x480> <== NEVER TAKEN
* 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 ();
if (bdbuf_cache.initialised)
800b14c: 78 0b 08 01 mvhi r11,0x801
800b150: 39 6b a7 74 ori r11,r11,0xa774
/*
* 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 ();
800b154: fb ff f9 77 calli 8009730 <rtems_bdbuf_disable_preemption>
if (bdbuf_cache.initialised)
800b158: 41 70 00 95 lbu r16,(r11+149)
/*
* 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 ();
800b15c: b8 20 88 00 mv r17,r1
if (bdbuf_cache.initialised)
800b160: 46 0e 00 04 be r16,r14,800b170 <rtems_bdbuf_init+0x98> <== ALWAYS TAKEN
{
rtems_bdbuf_restore_preemption (prev_mode);
800b164: fb ff f9 81 calli 8009768 <rtems_bdbuf_restore_preemption> <== NOT EXECUTED
return RTEMS_RESOURCE_IN_USE;
800b168: 34 03 00 0c mvi r3,12 <== NOT EXECUTED
800b16c: e0 00 00 fb bi 800b558 <rtems_bdbuf_init+0x480> <== NOT EXECUTED
}
memset(&bdbuf_cache, 0, sizeof(bdbuf_cache));
800b170: 34 02 00 00 mvi r2,0
800b174: 34 03 00 98 mvi r3,152
800b178: b9 60 08 00 mv r1,r11
800b17c: f8 00 1d ed calli 8012930 <memset>
bdbuf_cache.initialised = true;
800b180: 34 01 00 01 mvi r1,1
800b184: 31 61 00 95 sb (r11+149),r1
rtems_bdbuf_restore_preemption (prev_mode);
800b188: ba 20 08 00 mv r1,r17
800b18c: fb ff f9 77 calli 8009768 <rtems_bdbuf_restore_preemption>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
800b190: 78 02 08 01 mvhi r2,0x801
800b194: 38 42 a7 80 ori r2,r2,0xa780
800b198: 59 62 00 08 sw (r11+8),r2
head->previous = NULL;
tail->previous = head;
800b19c: 78 02 08 01 mvhi r2,0x801
800b1a0: 38 42 a7 7c ori r2,r2,0xa77c
800b1a4: 59 62 00 10 sw (r11+16),r2
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
800b1a8: 78 02 08 01 mvhi r2,0x801
800b1ac: 38 42 a7 b8 ori r2,r2,0xa7b8
800b1b0: 59 62 00 40 sw (r11+64),r2
head->previous = NULL;
tail->previous = head;
800b1b4: 78 02 08 01 mvhi r2,0x801
800b1b8: 38 42 a7 b4 ori r2,r2,0xa7b4
800b1bc: 59 62 00 48 sw (r11+72),r2
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
800b1c0: 78 02 08 01 mvhi r2,0x801
800b1c4: 38 42 a7 c4 ori r2,r2,0xa7c4
800b1c8: 59 62 00 4c sw (r11+76),r2
head->previous = NULL;
tail->previous = head;
800b1cc: 78 02 08 01 mvhi r2,0x801
800b1d0: 38 42 a7 c0 ori r2,r2,0xa7c0
800b1d4: 59 62 00 54 sw (r11+84),r2
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
800b1d8: 78 02 08 01 mvhi r2,0x801
800b1dc: 38 42 a7 d0 ori r2,r2,0xa7d0
800b1e0: 59 62 00 58 sw (r11+88),r2
head->previous = NULL;
tail->previous = head;
800b1e4: 78 02 08 01 mvhi r2,0x801
800b1e8: 38 42 a7 cc ori r2,r2,0xa7cc
800b1ec: 59 62 00 60 sw (r11+96),r2
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
800b1f0: 78 02 08 01 mvhi r2,0x801
800b1f4: 38 42 a8 00 ori r2,r2,0xa800
800b1f8: 59 62 00 88 sw (r11+136),r2
head->previous = NULL;
tail->previous = head;
800b1fc: 78 02 08 01 mvhi r2,0x801
800b200: 38 42 a7 fc ori r2,r2,0xa7fc
800b204: 59 62 00 90 sw (r11+144),r2
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'),
800b208: 78 02 08 01 mvhi r2,0x801
800b20c: 38 42 8c b8 ori r2,r2,0x8cb8
800b210: 28 41 00 00 lw r1,(r2+0)
800b214: 78 05 08 01 mvhi r5,0x801
*/
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;
800b218: 59 60 00 38 sw (r11+56),r0
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
800b21c: 59 60 00 0c sw (r11+12),r0
800b220: 59 60 00 44 sw (r11+68),r0
800b224: 59 60 00 50 sw (r11+80),r0
800b228: 59 60 00 5c sw (r11+92),r0
800b22c: 59 60 00 8c sw (r11+140),r0
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'),
800b230: 34 02 00 01 mvi r2,1
800b234: 34 03 00 54 mvi r3,84
800b238: 34 04 00 00 mvi r4,0
800b23c: 38 a5 a7 9c ori r5,r5,0xa79c
800b240: fb ff e6 8f calli 8004c7c <rtems_semaphore_create>
800b244: b8 20 70 00 mv r14,r1
1, RTEMS_BDBUF_CACHE_LOCK_ATTRIBS, 0,
&bdbuf_cache.lock);
if (sc != RTEMS_SUCCESSFUL)
800b248: 5c 30 00 a1 bne r1,r16,800b4cc <rtems_bdbuf_init+0x3f4> <== NEVER TAKEN
goto error;
rtems_bdbuf_lock_cache ();
800b24c: fb ff f8 a3 calli 80094d8 <rtems_bdbuf_lock_cache>
sc = rtems_semaphore_create (rtems_build_name ('B', 'D', 'C', 's'),
800b250: 78 02 08 01 mvhi r2,0x801
800b254: 38 42 8c bc ori r2,r2,0x8cbc
800b258: 28 41 00 00 lw r1,(r2+0)
800b25c: 78 05 08 01 mvhi r5,0x801
800b260: 34 02 00 01 mvi r2,1
800b264: 34 03 00 54 mvi r3,84
800b268: 34 04 00 00 mvi r4,0
800b26c: 38 a5 a7 a0 ori r5,r5,0xa7a0
800b270: fb ff e6 83 calli 8004c7c <rtems_semaphore_create>
800b274: b8 20 80 00 mv r16,r1
1, RTEMS_BDBUF_CACHE_LOCK_ATTRIBS, 0,
&bdbuf_cache.sync_lock);
if (sc != RTEMS_SUCCESSFUL)
800b278: 5c 2e 00 95 bne r1,r14,800b4cc <rtems_bdbuf_init+0x3f4> <== NEVER TAKEN
goto error;
sc = rtems_semaphore_create (rtems_build_name ('B', 'D', 'C', 'a'),
800b27c: 78 02 08 01 mvhi r2,0x801
800b280: 38 42 8c c0 ori r2,r2,0x8cc0
800b284: 28 41 00 00 lw r1,(r2+0)
800b288: 78 05 08 01 mvhi r5,0x801
800b28c: 34 02 00 00 mvi r2,0
800b290: 34 03 00 24 mvi r3,36
800b294: 34 04 00 00 mvi r4,0
800b298: 38 a5 a7 dc ori r5,r5,0xa7dc
800b29c: fb ff e6 78 calli 8004c7c <rtems_semaphore_create>
800b2a0: b8 20 70 00 mv r14,r1
0, RTEMS_BDBUF_CACHE_WAITER_ATTRIBS, 0,
&bdbuf_cache.access_waiters.sema);
if (sc != RTEMS_SUCCESSFUL)
800b2a4: 5c 30 00 8a bne r1,r16,800b4cc <rtems_bdbuf_init+0x3f4> <== NEVER TAKEN
goto error;
sc = rtems_semaphore_create (rtems_build_name ('B', 'D', 'C', 't'),
800b2a8: 78 02 08 01 mvhi r2,0x801
800b2ac: 38 42 8c c4 ori r2,r2,0x8cc4
800b2b0: 28 41 00 00 lw r1,(r2+0)
800b2b4: 78 05 08 01 mvhi r5,0x801
800b2b8: 34 02 00 00 mvi r2,0
800b2bc: 34 03 00 24 mvi r3,36
800b2c0: 34 04 00 00 mvi r4,0
800b2c4: 38 a5 a7 e4 ori r5,r5,0xa7e4
800b2c8: fb ff e6 6d calli 8004c7c <rtems_semaphore_create>
800b2cc: b8 20 80 00 mv r16,r1
0, RTEMS_BDBUF_CACHE_WAITER_ATTRIBS, 0,
&bdbuf_cache.transfer_waiters.sema);
if (sc != RTEMS_SUCCESSFUL)
800b2d0: 5c 2e 00 7f bne r1,r14,800b4cc <rtems_bdbuf_init+0x3f4> <== NEVER TAKEN
goto error;
sc = rtems_semaphore_create (rtems_build_name ('B', 'D', 'C', 'b'),
800b2d4: 78 02 08 01 mvhi r2,0x801
800b2d8: 38 42 8c c8 ori r2,r2,0x8cc8
800b2dc: 28 41 00 00 lw r1,(r2+0)
800b2e0: 78 05 08 01 mvhi r5,0x801
800b2e4: 34 02 00 00 mvi r2,0
800b2e8: 34 03 00 24 mvi r3,36
800b2ec: 34 04 00 00 mvi r4,0
800b2f0: 38 a5 a7 ec ori r5,r5,0xa7ec
800b2f4: fb ff e6 62 calli 8004c7c <rtems_semaphore_create>
800b2f8: b8 20 70 00 mv r14,r1
0, RTEMS_BDBUF_CACHE_WAITER_ATTRIBS, 0,
&bdbuf_cache.buffer_waiters.sema);
if (sc != RTEMS_SUCCESSFUL)
800b2fc: 5c 30 00 74 bne r1,r16,800b4cc <rtems_bdbuf_init+0x3f4> <== NEVER TAKEN
/*
* Compute the various number of elements in the cache.
*/
bdbuf_cache.buffer_min_count =
bdbuf_config.size / bdbuf_config.buffer_min;
800b300: 29 81 00 20 lw r1,(r12+32)
800b304: b9 a0 10 00 mv r2,r13
800b308: f8 00 32 68 calli 8017ca8 <__udivsi3>
800b30c: b8 20 60 00 mv r12,r1
goto error;
/*
* Compute the various number of elements in the cache.
*/
bdbuf_cache.buffer_min_count =
800b310: 59 61 00 1c sw (r11+28),r1
bdbuf_config.size / bdbuf_config.buffer_min;
bdbuf_cache.max_bds_per_group =
bdbuf_config.buffer_max / bdbuf_config.buffer_min;
800b314: b9 a0 10 00 mv r2,r13
800b318: b9 e0 08 00 mv r1,r15
800b31c: f8 00 32 63 calli 8017ca8 <__udivsi3>
800b320: b8 20 10 00 mv r2,r1
/*
* 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 =
800b324: 59 61 00 20 sw (r11+32),r1
bdbuf_config.buffer_max / bdbuf_config.buffer_min;
bdbuf_cache.group_count =
bdbuf_cache.buffer_min_count / bdbuf_cache.max_bds_per_group;
800b328: b9 80 08 00 mv r1,r12
800b32c: f8 00 32 5f calli 8017ca8 <__udivsi3>
*/
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 =
800b330: 59 61 00 7c sw (r11+124),r1
bdbuf_cache.buffer_min_count / bdbuf_cache.max_bds_per_group;
800b334: b8 20 78 00 mv r15,r1
/*
* Allocate the memory for the buffer descriptors.
*/
bdbuf_cache.bds = calloc (sizeof (rtems_bdbuf_buffer),
800b338: b9 80 10 00 mv r2,r12
800b33c: 34 01 00 38 mvi r1,56
800b340: fb ff dd 2a calli 80027e8 <calloc>
800b344: 59 61 00 14 sw (r11+20),r1
bdbuf_cache.buffer_min_count);
if (!bdbuf_cache.bds)
800b348: 44 2e 00 61 be r1,r14,800b4cc <rtems_bdbuf_init+0x3f4> <== NEVER TAKEN
goto error;
/*
* Allocate the memory for the buffer descriptors.
*/
bdbuf_cache.groups = calloc (sizeof (rtems_bdbuf_group),
800b34c: 34 01 00 14 mvi r1,20
800b350: b9 e0 10 00 mv r2,r15
800b354: fb ff dd 25 calli 80027e8 <calloc>
800b358: 59 61 00 80 sw (r11+128),r1
bdbuf_cache.group_count);
if (!bdbuf_cache.groups)
800b35c: 44 2e 00 5c be r1,r14,800b4cc <rtems_bdbuf_init+0x3f4> <== NEVER TAKEN
*
* The memory allocate allows a
*/
if (rtems_memalign ((void **) &bdbuf_cache.buffers,
cache_aligment,
bdbuf_cache.buffer_min_count * bdbuf_config.buffer_min) != 0)
800b360: b9 a0 10 00 mv r2,r13
* 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,
800b364: 78 0b 08 01 mvhi r11,0x801
cache_aligment,
bdbuf_cache.buffer_min_count * bdbuf_config.buffer_min) != 0)
800b368: b9 80 08 00 mv r1,r12
800b36c: f8 00 31 ea calli 8017b14 <__mulsi3>
* 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,
800b370: 39 6b a7 8c ori r11,r11,0xa78c
cache_aligment,
bdbuf_cache.buffer_min_count * bdbuf_config.buffer_min) != 0)
800b374: b8 20 18 00 mv r3,r1
* 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,
800b378: 34 02 00 20 mvi r2,32
800b37c: b9 60 08 00 mv r1,r11
800b380: f8 00 08 3d calli 800d474 <rtems_memalign>
800b384: 5c 20 00 52 bne r1,r0,800b4cc <rtems_bdbuf_init+0x3f4> <== NEVER TAKEN
/*
* 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,
800b388: 78 01 08 01 mvhi r1,0x801
800b38c: 38 21 a7 74 ori r1,r1,0xa774
800b390: 28 2c 00 80 lw r12,(r1+128)
bd = bdbuf_cache.bds, buffer = bdbuf_cache.buffers;
800b394: 28 2e 00 14 lw r14,(r1+20)
bd->group = group;
bd->buffer = buffer;
rtems_chain_append_unprotected (&bdbuf_cache.lru, &bd->link);
if ((b % bdbuf_cache.max_bds_per_group) ==
800b398: 28 33 00 20 lw r19,(r1+32)
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
800b39c: 78 10 08 01 mvhi r16,0x801
/*
* 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;
800b3a0: 28 32 00 18 lw r18,(r1+24)
b < bdbuf_cache.buffer_min_count;
800b3a4: 28 35 00 1c lw r21,(r1+28)
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))
800b3a8: 36 74 ff ff addi r20,r19,-1
800b3ac: 28 23 00 48 lw r3,(r1+72)
/*
* 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;
800b3b0: b9 c0 58 00 mv r11,r14
/*
* 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,
800b3b4: b9 80 88 00 mv r17,r12
800b3b8: 34 0f 00 00 mvi r15,0
800b3bc: 3a 10 a7 b8 ori r16,r16,0xa7b8
800b3c0: e0 00 00 11 bi 800b404 <rtems_bdbuf_init+0x32c>
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;
800b3c4: 59 60 00 14 sw (r11+20),r0
bd->group = group;
800b3c8: 59 71 00 28 sw (r11+40),r17
bd->buffer = buffer;
800b3cc: 59 72 00 1c sw (r11+28),r18
800b3d0: 59 70 00 00 sw (r11+0),r16
tail->previous = the_node;
old_last->next = the_node;
800b3d4: 58 6b 00 00 sw (r3+0),r11
the_node->previous = old_last;
800b3d8: 59 63 00 04 sw (r11+4),r3
rtems_chain_append_unprotected (&bdbuf_cache.lru, &bd->link);
if ((b % bdbuf_cache.max_bds_per_group) ==
800b3dc: b9 e0 08 00 mv r1,r15
800b3e0: ba 60 10 00 mv r2,r19
{
bd->dd = BDBUF_INVALID_DEV;
bd->group = group;
bd->buffer = buffer;
rtems_chain_append_unprotected (&bdbuf_cache.lru, &bd->link);
800b3e4: b9 60 b0 00 mv r22,r11
if ((b % bdbuf_cache.max_bds_per_group) ==
800b3e8: f8 00 32 40 calli 8017ce8 <__umodsi3>
800b3ec: 5c 34 00 02 bne r1,r20,800b3f4 <rtems_bdbuf_init+0x31c>
(bdbuf_cache.max_bds_per_group - 1))
group++;
800b3f0: 36 31 00 14 addi r17,r17,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)
800b3f4: 35 ef 00 01 addi r15,r15,1
800b3f8: 35 6b 00 38 addi r11,r11,56
800b3fc: b6 4d 90 00 add r18,r18,r13
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
800b400: ba c0 18 00 mv r3,r22
/*
* 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,
800b404: 56 af ff f0 bgu r21,r15,800b3c4 <rtems_bdbuf_init+0x2ec>
800b408: 78 01 08 01 mvhi r1,0x801
800b40c: 38 21 a7 74 ori r1,r1,0xa774
b < bdbuf_cache.group_count;
b++,
group++,
bd += bdbuf_cache.max_bds_per_group)
{
group->bds_per_group = bdbuf_cache.max_bds_per_group;
800b410: 28 2b 00 20 lw r11,(r1+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,
800b414: 58 23 00 48 sw (r1+72),r3
group = bdbuf_cache.groups,
bd = bdbuf_cache.bds;
b < bdbuf_cache.group_count;
b++,
group++,
bd += bdbuf_cache.max_bds_per_group)
800b418: 34 02 00 38 mvi r2,56
}
for (b = 0,
group = bdbuf_cache.groups,
bd = bdbuf_cache.bds;
b < bdbuf_cache.group_count;
800b41c: 28 2d 00 7c lw r13,(r1+124)
b++,
group++,
bd += bdbuf_cache.max_bds_per_group)
800b420: b9 60 08 00 mv r1,r11
800b424: f8 00 31 bc calli 8017b14 <__mulsi3>
800b428: 34 02 00 00 mvi r2,0
800b42c: e0 00 00 06 bi 800b444 <rtems_bdbuf_init+0x36c>
{
group->bds_per_group = bdbuf_cache.max_bds_per_group;
group->bdbuf = bd;
800b430: 59 8e 00 10 sw (r12+16),r14
b < bdbuf_cache.group_count;
b++,
group++,
bd += bdbuf_cache.max_bds_per_group)
{
group->bds_per_group = bdbuf_cache.max_bds_per_group;
800b434: 59 8b 00 08 sw (r12+8),r11
for (b = 0,
group = bdbuf_cache.groups,
bd = bdbuf_cache.bds;
b < bdbuf_cache.group_count;
b++,
800b438: 34 42 00 01 addi r2,r2,1
group++,
800b43c: 35 8c 00 14 addi r12,r12,20
bd += bdbuf_cache.max_bds_per_group)
800b440: b5 c1 70 00 add r14,r14,r1
if ((b % bdbuf_cache.max_bds_per_group) ==
(bdbuf_cache.max_bds_per_group - 1))
group++;
}
for (b = 0,
800b444: 55 a2 ff fb bgu r13,r2,800b430 <rtems_bdbuf_init+0x358>
* Create and start swapout task. This task will create and manage the worker
* threads.
*/
bdbuf_cache.swapout_enabled = true;
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'S', 'W', 'P'),
800b448: 78 0b 08 01 mvhi r11,0x801
800b44c: 78 02 08 01 mvhi r2,0x801
800b450: 38 42 8c cc ori r2,r2,0x8ccc
800b454: 39 6b 87 bc ori r11,r11,0x87bc
/*
* Create and start swapout task. This task will create and manage the worker
* threads.
*/
bdbuf_cache.swapout_enabled = true;
800b458: 78 0c 08 01 mvhi r12,0x801
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'S', 'W', 'P'),
800b45c: 28 41 00 00 lw r1,(r2+0)
800b460: 29 62 00 08 lw r2,(r11+8)
/*
* Create and start swapout task. This task will create and manage the worker
* threads.
*/
bdbuf_cache.swapout_enabled = true;
800b464: 39 8c a7 74 ori r12,r12,0xa774
800b468: 34 0d 00 01 mvi r13,1
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'S', 'W', 'P'),
800b46c: 78 03 08 00 mvhi r3,0x800
/*
* Create and start swapout task. This task will create and manage the worker
* threads.
*/
bdbuf_cache.swapout_enabled = true;
800b470: 31 8d 00 04 sb (r12+4),r13
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'S', 'W', 'P'),
800b474: 38 63 a2 60 ori r3,r3,0xa260
800b478: 34 04 00 00 mvi r4,0
800b47c: b9 80 28 00 mv r5,r12
800b480: fb ff f9 4c calli 80099b0 <rtems_bdbuf_create_task.clone.11>
bdbuf_config.swapout_priority,
RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT,
rtems_bdbuf_swapout_task,
0,
&bdbuf_cache.swapout);
if (sc != RTEMS_SUCCESSFUL)
800b484: 5c 20 00 12 bne r1,r0,800b4cc <rtems_bdbuf_init+0x3f4> <== NEVER TAKEN
goto error;
if (bdbuf_config.max_read_ahead_blocks > 0)
800b488: 29 62 00 00 lw r2,(r11+0)
800b48c: 44 41 00 0d be r2,r1,800b4c0 <rtems_bdbuf_init+0x3e8>
{
bdbuf_cache.read_ahead_enabled = true;
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'R', 'D', 'A'),
800b490: 78 02 08 01 mvhi r2,0x801
800b494: 38 42 8c d0 ori r2,r2,0x8cd0
800b498: 28 41 00 00 lw r1,(r2+0)
800b49c: 29 62 00 2c lw r2,(r11+44)
800b4a0: 78 03 08 00 mvhi r3,0x800
800b4a4: 78 05 08 01 mvhi r5,0x801
if (sc != RTEMS_SUCCESSFUL)
goto error;
if (bdbuf_config.max_read_ahead_blocks > 0)
{
bdbuf_cache.read_ahead_enabled = true;
800b4a8: 31 8d 00 94 sb (r12+148),r13
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'R', 'D', 'A'),
800b4ac: 38 63 ac f0 ori r3,r3,0xacf0
800b4b0: 34 04 00 00 mvi r4,0
800b4b4: 38 a5 a7 f8 ori r5,r5,0xa7f8
800b4b8: fb ff f9 3e calli 80099b0 <rtems_bdbuf_create_task.clone.11>
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)
800b4bc: 5c 20 00 04 bne r1,r0,800b4cc <rtems_bdbuf_init+0x3f4> <== NEVER TAKEN
goto error;
}
rtems_bdbuf_unlock_cache ();
800b4c0: fb ff f8 32 calli 8009588 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
800b4c4: 34 03 00 00 mvi r3,0
800b4c8: e0 00 00 24 bi 800b558 <rtems_bdbuf_init+0x480>
error:
if (bdbuf_cache.read_ahead_task != 0)
800b4cc: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
800b4d0: 38 21 a7 74 ori r1,r1,0xa774 <== NOT EXECUTED
800b4d4: 28 21 00 84 lw r1,(r1+132) <== NOT EXECUTED
800b4d8: 44 20 00 02 be r1,r0,800b4e0 <rtems_bdbuf_init+0x408> <== NOT EXECUTED
rtems_task_delete (bdbuf_cache.read_ahead_task);
800b4dc: f8 00 0d 89 calli 800eb00 <rtems_task_delete> <== NOT EXECUTED
if (bdbuf_cache.swapout != 0)
800b4e0: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
800b4e4: 38 21 a7 74 ori r1,r1,0xa774 <== NOT EXECUTED
800b4e8: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
800b4ec: 44 20 00 02 be r1,r0,800b4f4 <rtems_bdbuf_init+0x41c> <== NOT EXECUTED
rtems_task_delete (bdbuf_cache.swapout);
800b4f0: f8 00 0d 84 calli 800eb00 <rtems_task_delete> <== NOT EXECUTED
free (bdbuf_cache.buffers);
800b4f4: 78 0b 08 01 mvhi r11,0x801 <== NOT EXECUTED
800b4f8: 39 6b a7 74 ori r11,r11,0xa774 <== NOT EXECUTED
800b4fc: 29 61 00 18 lw r1,(r11+24) <== NOT EXECUTED
800b500: fb ff dd 04 calli 8002910 <free> <== NOT EXECUTED
free (bdbuf_cache.groups);
800b504: 29 61 00 80 lw r1,(r11+128) <== NOT EXECUTED
800b508: fb ff dd 02 calli 8002910 <free> <== NOT EXECUTED
free (bdbuf_cache.bds);
800b50c: 29 61 00 14 lw r1,(r11+20) <== NOT EXECUTED
800b510: fb ff dd 00 calli 8002910 <free> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.buffer_waiters.sema);
800b514: 29 61 00 78 lw r1,(r11+120) <== NOT EXECUTED
800b518: fb ff e6 56 calli 8004e70 <rtems_semaphore_delete> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.access_waiters.sema);
800b51c: 29 61 00 68 lw r1,(r11+104) <== NOT EXECUTED
800b520: fb ff e6 54 calli 8004e70 <rtems_semaphore_delete> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.transfer_waiters.sema);
800b524: 29 61 00 70 lw r1,(r11+112) <== NOT EXECUTED
800b528: fb ff e6 52 calli 8004e70 <rtems_semaphore_delete> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.sync_lock);
800b52c: 29 61 00 2c lw r1,(r11+44) <== NOT EXECUTED
800b530: fb ff e6 50 calli 8004e70 <rtems_semaphore_delete> <== NOT EXECUTED
if (bdbuf_cache.lock != 0)
800b534: 29 61 00 28 lw r1,(r11+40) <== NOT EXECUTED
800b538: 44 20 00 04 be r1,r0,800b548 <rtems_bdbuf_init+0x470> <== NOT EXECUTED
{
rtems_bdbuf_unlock_cache ();
800b53c: fb ff f8 13 calli 8009588 <rtems_bdbuf_unlock_cache> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.lock);
800b540: 29 61 00 28 lw r1,(r11+40) <== NOT EXECUTED
800b544: fb ff e6 4b calli 8004e70 <rtems_semaphore_delete> <== NOT EXECUTED
}
bdbuf_cache.initialised = false;
800b548: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED
800b54c: 38 21 a7 74 ori r1,r1,0xa774 <== NOT EXECUTED
800b550: 30 20 00 95 sb (r1+149),r0 <== NOT EXECUTED
return RTEMS_UNSATISFIED;
800b554: 34 03 00 0d mvi r3,13 <== NOT EXECUTED
}
800b558: b8 60 08 00 mv r1,r3
800b55c: 2b 9d 00 04 lw ra,(sp+4)
800b560: 2b 8b 00 34 lw r11,(sp+52)
800b564: 2b 8c 00 30 lw r12,(sp+48)
800b568: 2b 8d 00 2c lw r13,(sp+44)
800b56c: 2b 8e 00 28 lw r14,(sp+40)
800b570: 2b 8f 00 24 lw r15,(sp+36)
800b574: 2b 90 00 20 lw r16,(sp+32)
800b578: 2b 91 00 1c lw r17,(sp+28)
800b57c: 2b 92 00 18 lw r18,(sp+24)
800b580: 2b 93 00 14 lw r19,(sp+20)
800b584: 2b 94 00 10 lw r20,(sp+16)
800b588: 2b 95 00 0c lw r21,(sp+12)
800b58c: 2b 96 00 08 lw r22,(sp+8)
800b590: 37 9c 00 34 addi sp,sp,52
800b594: c3 a0 00 00 ret
080094a0 <rtems_bdbuf_lock>:
* @param lock The mutex to lock.
* @param fatal_error_code The error code if the call fails.
*/
static void
rtems_bdbuf_lock (rtems_id lock, uint32_t fatal_error_code)
{
80094a0: 37 9c ff f8 addi sp,sp,-8
80094a4: 5b 8b 00 08 sw (sp+8),r11
80094a8: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc = rtems_semaphore_obtain (lock,
80094ac: 34 03 00 00 mvi r3,0
* @param lock The mutex to lock.
* @param fatal_error_code The error code if the call fails.
*/
static void
rtems_bdbuf_lock (rtems_id lock, uint32_t fatal_error_code)
{
80094b0: b8 40 58 00 mv r11,r2
rtems_status_code sc = rtems_semaphore_obtain (lock,
80094b4: 34 02 00 00 mvi r2,0
80094b8: fb ff ee 9d calli 8004f2c <rtems_semaphore_obtain>
RTEMS_WAIT,
RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
80094bc: 44 20 00 03 be r1,r0,80094c8 <rtems_bdbuf_lock+0x28> <== ALWAYS TAKEN
rtems_bdbuf_fatal (fatal_error_code);
80094c0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
80094c4: fb ff ff f2 calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
}
80094c8: 2b 9d 00 04 lw ra,(sp+4)
80094cc: 2b 8b 00 08 lw r11,(sp+8)
80094d0: 37 9c 00 08 addi sp,sp,8
80094d4: c3 a0 00 00 ret
0800bbb8 <rtems_bdbuf_purge_dev>:
}
}
void
rtems_bdbuf_purge_dev (rtems_disk_device *dd)
{
800bbb8: 37 9c ff 50 addi sp,sp,-176
800bbbc: 5b 8b 00 24 sw (sp+36),r11
800bbc0: 5b 8c 00 20 sw (sp+32),r12
800bbc4: 5b 8d 00 1c sw (sp+28),r13
800bbc8: 5b 8e 00 18 sw (sp+24),r14
800bbcc: 5b 8f 00 14 sw (sp+20),r15
800bbd0: 5b 90 00 10 sw (sp+16),r16
800bbd4: 5b 91 00 0c sw (sp+12),r17
800bbd8: 5b 92 00 08 sw (sp+8),r18
800bbdc: 5b 9d 00 04 sw (sp+4),ra
800bbe0: b8 20 68 00 mv r13,r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
800bbe4: 37 81 00 ac addi r1,sp,172
800bbe8: 5b 81 00 a8 sw (sp+168),r1
head->previous = NULL;
tail->previous = head;
800bbec: 37 81 00 a8 addi r1,sp,168
800bbf0: 5b 81 00 b0 sw (sp+176),r1
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
800bbf4: 5b 80 00 ac sw (sp+172),r0
rtems_chain_control purge_list;
rtems_chain_initialize_empty (&purge_list);
rtems_bdbuf_lock_cache ();
800bbf8: fb ff f6 38 calli 80094d8 <rtems_bdbuf_lock_cache>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
800bbfc: 29 a1 00 64 lw r1,(r13+100)
800bc00: 34 02 00 00 mvi r2,0
800bc04: 5c 20 00 03 bne r1,r0,800bc10 <rtems_bdbuf_purge_dev+0x58> <== NEVER TAKEN
}
}
}
void
rtems_bdbuf_purge_dev (rtems_disk_device *dd)
800bc08: 29 a2 00 68 lw r2,(r13+104)
800bc0c: 64 42 00 00 cmpei r2,r2,0
}
static void
rtems_bdbuf_read_ahead_cancel (rtems_disk_device *dd)
{
if (rtems_bdbuf_is_read_ahead_active (dd))
800bc10: 5c 40 00 06 bne r2,r0,800bc28 <rtems_bdbuf_purge_dev+0x70> <== ALWAYS TAKEN
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
800bc14: 29 a2 00 68 lw r2,(r13+104) <== NOT EXECUTED
next->previous = previous;
800bc18: 58 22 00 04 sw (r1+4),r2 <== NOT EXECUTED
previous->next = next;
800bc1c: 58 41 00 00 sw (r2+0),r1 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
800bc20: 59 a0 00 68 sw (r13+104),r0 <== NOT EXECUTED
800bc24: 59 a0 00 64 sw (r13+100),r0 <== NOT EXECUTED
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;
800bc28: 34 01 ff ff mvi r1,-1
800bc2c: 59 a1 00 6c sw (r13+108),r1
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;
800bc30: 78 01 08 01 mvhi r1,0x801
800bc34: 38 21 a7 74 ori r1,r1,0xa774
while (cur != NULL)
{
if (cur->dd == dd)
{
switch (cur->state)
800bc38: 78 0f 08 01 mvhi r15,0x801
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);
800bc3c: 78 0e 08 01 mvhi r14,0x801
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;
800bc40: 28 2b 00 3c lw r11,(r1+60)
*prev = NULL;
800bc44: 5b 80 00 28 sw (sp+40),r0
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;
800bc48: 37 8c 00 28 addi r12,sp,40
while (cur != NULL)
{
if (cur->dd == dd)
{
switch (cur->state)
800bc4c: 34 10 00 0a mvi r16,10
800bc50: 39 ef 8d 28 ori r15,r15,0x8d28
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800bc54: 34 12 00 06 mvi r18,6
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
800bc58: 37 91 00 ac addi r17,sp,172
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);
800bc5c: 39 ce a7 e0 ori r14,r14,0xa7e0
800bc60: e0 00 00 32 bi 800bd28 <rtems_bdbuf_purge_dev+0x170>
*prev = NULL;
while (cur != NULL)
{
if (cur->dd == dd)
800bc64: 29 61 00 14 lw r1,(r11+20)
800bc68: 5c 2d 00 1c bne r1,r13,800bcd8 <rtems_bdbuf_purge_dev+0x120>
{
switch (cur->state)
800bc6c: 29 61 00 20 lw r1,(r11+32)
800bc70: 54 30 00 18 bgu r1,r16,800bcd0 <rtems_bdbuf_purge_dev+0x118><== NEVER TAKEN
800bc74: 34 02 00 02 mvi r2,2
800bc78: f8 00 2f 32 calli 8017940 <__ashlsi3>
800bc7c: b5 e1 08 00 add r1,r15,r1
800bc80: 28 21 00 00 lw r1,(r1+0)
800bc84: c0 20 00 00 b r1
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);
800bc88: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
800bc8c: fb ff f6 53 calli 80095d8 <rtems_bdbuf_wake> <== NOT EXECUTED
/* Fall through */
case RTEMS_BDBUF_STATE_MODIFIED:
rtems_bdbuf_group_release (cur);
800bc90: 29 61 00 28 lw r1,(r11+40)
800bc94: fb ff f7 2c calli 8009944 <rtems_bdbuf_group_release.clone.8>
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
800bc98: 29 61 00 04 lw r1,(r11+4)
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
800bc9c: 29 62 00 00 lw r2,(r11+0)
previous = the_node->previous;
next->previous = previous;
800bca0: 58 41 00 04 sw (r2+4),r1
previous->next = next;
800bca4: 58 22 00 00 sw (r1+0),r2
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
800bca8: 2b 81 00 b0 lw r1,(sp+176)
the_node->next = tail;
800bcac: 59 71 00 00 sw (r11+0),r17
tail->previous = the_node;
800bcb0: 5b 8b 00 b0 sw (sp+176),r11
old_last->next = the_node;
800bcb4: 58 2b 00 00 sw (r1+0),r11
the_node->previous = old_last;
800bcb8: 59 61 00 04 sw (r11+4),r1
800bcbc: e0 00 00 07 bi 800bcd8 <rtems_bdbuf_purge_dev+0x120>
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800bcc0: 59 70 00 20 sw (r11+32),r16 <== NOT EXECUTED
800bcc4: e0 00 00 05 bi 800bcd8 <rtems_bdbuf_purge_dev+0x120> <== NOT EXECUTED
800bcc8: 59 72 00 20 sw (r11+32),r18
800bccc: e0 00 00 03 bi 800bcd8 <rtems_bdbuf_purge_dev+0x120>
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);
800bcd0: 34 01 00 17 mvi r1,23 <== NOT EXECUTED
800bcd4: fb ff f5 ee calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
}
}
if (cur->avl.left != NULL)
800bcd8: 29 61 00 08 lw r1,(r11+8)
800bcdc: 44 20 00 05 be r1,r0,800bcf0 <rtems_bdbuf_purge_dev+0x138>
{
/* Left */
++prev;
800bce0: 35 8c 00 04 addi r12,r12,4
*prev = cur;
800bce4: 59 8b 00 00 sw (r12+0),r11
cur = cur->avl.left;
800bce8: 29 6b 00 08 lw r11,(r11+8)
800bcec: e0 00 00 0f bi 800bd28 <rtems_bdbuf_purge_dev+0x170>
}
else if (cur->avl.right != NULL)
800bcf0: 29 62 00 0c lw r2,(r11+12)
800bcf4: 44 41 00 06 be r2,r1,800bd0c <rtems_bdbuf_purge_dev+0x154>
{
/* Right */
++prev;
800bcf8: 35 8c 00 04 addi r12,r12,4
*prev = cur;
800bcfc: 59 8b 00 00 sw (r12+0),r11
cur = cur->avl.right;
800bd00: 29 6b 00 0c lw r11,(r11+12)
800bd04: e0 00 00 09 bi 800bd28 <rtems_bdbuf_purge_dev+0x170>
while (*prev != NULL
&& (cur == (*prev)->avl.right || (*prev)->avl.right == NULL))
{
/* Up */
cur = *prev;
--prev;
800bd08: 35 8c ff fc addi r12,r12,-4
800bd0c: b9 60 10 00 mv r2,r11
*prev = cur;
cur = cur->avl.right;
}
else
{
while (*prev != NULL
800bd10: 29 8b 00 00 lw r11,(r12+0)
800bd14: 45 60 00 05 be r11,r0,800bd28 <rtems_bdbuf_purge_dev+0x170>
&& (cur == (*prev)->avl.right || (*prev)->avl.right == NULL))
800bd18: 29 61 00 0c lw r1,(r11+12)
800bd1c: 44 41 ff fb be r2,r1,800bd08 <rtems_bdbuf_purge_dev+0x150>
800bd20: 44 20 ff fa be r1,r0,800bd08 <rtems_bdbuf_purge_dev+0x150>
800bd24: e0 00 00 1f bi 800bda0 <rtems_bdbuf_purge_dev+0x1e8>
rtems_bdbuf_buffer **prev = stack;
rtems_bdbuf_buffer *cur = bdbuf_cache.tree;
*prev = NULL;
while (cur != NULL)
800bd28: 5d 60 ff cf bne r11,r0,800bc64 <rtems_bdbuf_purge_dev+0xac>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail(
const Chain_Control *the_chain
)
{
return &the_chain->Tail.Node;
800bd2c: 37 8d 00 a8 addi r13,sp,168
800bd30: 37 8c 00 ac addi r12,sp,172
800bd34: e0 00 00 03 bi 800bd40 <rtems_bdbuf_purge_dev+0x188>
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;
800bd38: 34 0b 00 01 mvi r11,1
rtems_bdbuf_discard_buffer (bd);
800bd3c: fb ff f8 3d calli 8009e30 <rtems_bdbuf_discard_buffer>
void rtems_bdbuf_reset_device_stats (rtems_disk_device *dd)
{
rtems_bdbuf_lock_cache ();
memset (&dd->stats, 0, sizeof(dd->stats));
rtems_bdbuf_unlock_cache ();
}
800bd40: 2b 81 00 a8 lw r1,(sp+168)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
800bd44: 44 2c 00 07 be r1,r12,800bd60 <rtems_bdbuf_purge_dev+0x1a8>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
800bd48: 28 22 00 00 lw r2,(r1+0)
head->next = new_first;
800bd4c: 5b 82 00 a8 sw (sp+168),r2
new_first->previous = head;
800bd50: 58 4d 00 04 sw (r2+4),r13
while ((node = rtems_chain_get_unprotected (purge_list)) != NULL)
{
rtems_bdbuf_buffer *bd = (rtems_bdbuf_buffer *) node;
if (bd->waiters == 0)
800bd54: 28 22 00 24 lw r2,(r1+36)
800bd58: 44 40 ff f8 be r2,r0,800bd38 <rtems_bdbuf_purge_dev+0x180> <== ALWAYS TAKEN
800bd5c: e3 ff ff f8 bi 800bd3c <rtems_bdbuf_purge_dev+0x184> <== NOT EXECUTED
wake_buffer_waiters = true;
rtems_bdbuf_discard_buffer (bd);
}
if (wake_buffer_waiters)
800bd60: 45 60 00 04 be r11,r0,800bd70 <rtems_bdbuf_purge_dev+0x1b8>
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
800bd64: 78 01 08 01 mvhi r1,0x801
800bd68: 38 21 a7 e8 ori r1,r1,0xa7e8
800bd6c: fb ff f6 1b calli 80095d8 <rtems_bdbuf_wake>
rtems_chain_initialize_empty (&purge_list);
rtems_bdbuf_lock_cache ();
rtems_bdbuf_read_ahead_reset (dd);
rtems_bdbuf_gather_for_purge (&purge_list, dd);
rtems_bdbuf_purge_list (&purge_list);
rtems_bdbuf_unlock_cache ();
800bd70: fb ff f6 06 calli 8009588 <rtems_bdbuf_unlock_cache>
}
800bd74: 2b 9d 00 04 lw ra,(sp+4)
800bd78: 2b 8b 00 24 lw r11,(sp+36)
800bd7c: 2b 8c 00 20 lw r12,(sp+32)
800bd80: 2b 8d 00 1c lw r13,(sp+28)
800bd84: 2b 8e 00 18 lw r14,(sp+24)
800bd88: 2b 8f 00 14 lw r15,(sp+20)
800bd8c: 2b 90 00 10 lw r16,(sp+16)
800bd90: 2b 91 00 0c lw r17,(sp+12)
800bd94: 2b 92 00 08 lw r18,(sp+8)
800bd98: 37 9c 00 b0 addi sp,sp,176
800bd9c: c3 a0 00 00 ret
cur = *prev;
--prev;
}
if (*prev != NULL)
/* Right */
cur = (*prev)->avl.right;
800bda0: b8 20 58 00 mv r11,r1
800bda4: e3 ff ff e1 bi 800bd28 <rtems_bdbuf_purge_dev+0x170>
0800b694 <rtems_bdbuf_read>:
rtems_status_code
rtems_bdbuf_read (rtems_disk_device *dd,
rtems_blkdev_bnum block,
rtems_bdbuf_buffer **bd_ptr)
{
800b694: 37 9c ff e8 addi sp,sp,-24
800b698: 5b 8b 00 18 sw (sp+24),r11
800b69c: 5b 8c 00 14 sw (sp+20),r12
800b6a0: 5b 8d 00 10 sw (sp+16),r13
800b6a4: 5b 8e 00 0c sw (sp+12),r14
800b6a8: 5b 8f 00 08 sw (sp+8),r15
800b6ac: 5b 9d 00 04 sw (sp+4),ra
800b6b0: b8 20 58 00 mv r11,r1
800b6b4: b8 40 68 00 mv r13,r2
800b6b8: b8 60 78 00 mv r15,r3
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *bd = NULL;
rtems_blkdev_bnum media_block;
rtems_bdbuf_lock_cache ();
800b6bc: fb ff f7 87 calli 80094d8 <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)
800b6c0: 29 61 00 28 lw r1,(r11+40)
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;
800b6c4: 34 0c 00 00 mvi r12,0
*/
*media_block_ptr = rtems_bdbuf_media_block (dd, block) + dd->start;
}
else
{
sc = RTEMS_INVALID_ID;
800b6c8: 34 0e 00 04 mvi r14,4
rtems_blkdev_bnum block,
rtems_blkdev_bnum *media_block_ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (block < dd->block_count)
800b6cc: 51 a1 00 71 bgeu r13,r1,800b890 <rtems_bdbuf_read+0x1fc> <== NEVER TAKEN
}
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)
800b6d0: 29 62 00 30 lw r2,(r11+48)
800b6d4: 48 02 00 05 bg r0,r2,800b6e8 <rtems_bdbuf_read+0x54> <== NEVER TAKEN
return block << dd->block_to_media_block_shift;
800b6d8: b9 a0 08 00 mv r1,r13
800b6dc: f8 00 30 99 calli 8017940 <__ashlsi3>
800b6e0: b8 20 10 00 mv r2,r1
800b6e4: e0 00 00 09 bi 800b708 <rtems_bdbuf_read+0x74>
/*
* 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);
800b6e8: 29 64 00 24 lw r4,(r11+36) <== NOT EXECUTED
800b6ec: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
800b6f0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
800b6f4: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
800b6f8: f8 00 28 53 calli 8015844 <__muldi3> <== NOT EXECUTED
800b6fc: 29 64 00 20 lw r4,(r11+32) <== NOT EXECUTED
800b700: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
800b704: f8 00 2c c6 calli 8016a1c <__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;
800b708: 29 63 00 18 lw r3,(r11+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);
800b70c: b9 60 08 00 mv r1,r11
800b710: b4 43 10 00 add r2,r2,r3
800b714: fb ff fd da calli 800ae7c <rtems_bdbuf_get_buffer_for_access>
800b718: b8 20 60 00 mv r12,r1
switch (bd->state)
800b71c: 28 21 00 20 lw r1,(r1+32)
800b720: 34 02 00 02 mvi r2,2
800b724: 44 22 00 06 be r1,r2,800b73c <rtems_bdbuf_read+0xa8>
800b728: 34 02 00 07 mvi r2,7
800b72c: 44 22 00 09 be r1,r2,800b750 <rtems_bdbuf_read+0xbc>
800b730: 34 02 00 01 mvi r2,1
800b734: 5c 22 00 31 bne r1,r2,800b7f8 <rtems_bdbuf_read+0x164> <== NEVER TAKEN
800b738: e0 00 00 0d bi 800b76c <rtems_bdbuf_read+0xd8>
{
case RTEMS_BDBUF_STATE_CACHED:
++dd->stats.read_hits;
800b73c: 29 61 00 44 lw r1,(r11+68)
800b740: 34 21 00 01 addi r1,r1,1
800b744: 59 61 00 44 sw (r11+68),r1
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800b748: 34 01 00 03 mvi r1,3
800b74c: e0 00 00 05 bi 800b760 <rtems_bdbuf_read+0xcc>
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;
800b750: 29 61 00 44 lw r1,(r11+68)
800b754: 34 21 00 01 addi r1,r1,1
800b758: 59 61 00 44 sw (r11+68),r1
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800b75c: 34 01 00 04 mvi r1,4
800b760: 59 81 00 20 sw (r12+32),r1
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_CACHED);
break;
case RTEMS_BDBUF_STATE_MODIFIED:
++dd->stats.read_hits;
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_MODIFIED);
break;
800b764: 34 0e 00 00 mvi r14,0
800b768: e0 00 00 28 bi 800b808 <rtems_bdbuf_read+0x174>
case RTEMS_BDBUF_STATE_EMPTY:
++dd->stats.read_misses;
800b76c: 29 61 00 48 lw r1,(r11+72)
800b770: 34 21 00 01 addi r1,r1,1
800b774: 59 61 00 48 sw (r11+72),r1
static void
rtems_bdbuf_set_read_ahead_trigger (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
if (dd->read_ahead.trigger != block)
800b778: 29 61 00 6c lw r1,(r11+108)
800b77c: 44 2d 00 10 be r1,r13,800b7bc <rtems_bdbuf_read+0x128>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
800b780: 29 61 00 64 lw r1,(r11+100)
800b784: 34 02 00 00 mvi r2,0
800b788: 5c 20 00 03 bne r1,r0,800b794 <rtems_bdbuf_read+0x100> <== NEVER TAKEN
dd->read_ahead.next = block + 2;
}
}
rtems_status_code
rtems_bdbuf_read (rtems_disk_device *dd,
800b78c: 29 62 00 68 lw r2,(r11+104)
800b790: 64 42 00 00 cmpei r2,r2,0
}
static void
rtems_bdbuf_read_ahead_cancel (rtems_disk_device *dd)
{
if (rtems_bdbuf_is_read_ahead_active (dd))
800b794: 5c 40 00 06 bne r2,r0,800b7ac <rtems_bdbuf_read+0x118> <== ALWAYS TAKEN
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
800b798: 29 62 00 68 lw r2,(r11+104) <== NOT EXECUTED
next->previous = previous;
800b79c: 58 22 00 04 sw (r1+4),r2 <== NOT EXECUTED
previous->next = next;
800b7a0: 58 41 00 00 sw (r2+0),r1 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
800b7a4: 59 60 00 68 sw (r11+104),r0 <== NOT EXECUTED
800b7a8: 59 60 00 64 sw (r11+100),r0 <== NOT EXECUTED
rtems_blkdev_bnum block)
{
if (dd->read_ahead.trigger != block)
{
rtems_bdbuf_read_ahead_cancel (dd);
dd->read_ahead.trigger = block + 1;
800b7ac: 35 a1 00 01 addi r1,r13,1
800b7b0: 59 61 00 6c sw (r11+108),r1
dd->read_ahead.next = block + 2;
800b7b4: 35 a1 00 02 addi r1,r13,2
800b7b8: 59 61 00 70 sw (r11+112),r1
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);
800b7bc: b9 60 08 00 mv r1,r11
800b7c0: b9 80 10 00 mv r2,r12
800b7c4: 34 03 00 01 mvi r3,1
800b7c8: fb ff fc f1 calli 800ab8c <rtems_bdbuf_execute_read_request>
800b7cc: b8 20 70 00 mv r14,r1
if (sc == RTEMS_SUCCESSFUL)
800b7d0: 5c 20 00 0d bne r1,r0,800b804 <rtems_bdbuf_read+0x170>
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800b7d4: 34 01 00 03 mvi r1,3
800b7d8: 59 81 00 20 sw (r12+32),r1
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
800b7dc: 29 82 00 00 lw r2,(r12+0)
previous = the_node->previous;
800b7e0: 29 81 00 04 lw r1,(r12+4)
next->previous = previous;
800b7e4: 58 41 00 04 sw (r2+4),r1
previous->next = next;
800b7e8: 58 22 00 00 sw (r1+0),r2
sc = rtems_bdbuf_execute_read_request (dd, bd, 1);
if (sc == RTEMS_SUCCESSFUL)
{
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_CACHED);
rtems_chain_extract_unprotected (&bd->link);
rtems_bdbuf_group_obtain (bd);
800b7ec: 29 81 00 28 lw r1,(r12+40)
800b7f0: fb ff f8 51 calli 8009934 <rtems_bdbuf_group_obtain.clone.7>
800b7f4: e0 00 00 05 bi 800b808 <rtems_bdbuf_read+0x174>
{
bd = NULL;
}
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_4);
800b7f8: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
800b7fc: fb ff f7 4b calli 8009528 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
800b800: e3 ff ff d9 bi 800b764 <rtems_bdbuf_read+0xd0> <== NOT EXECUTED
rtems_chain_extract_unprotected (&bd->link);
rtems_bdbuf_group_obtain (bd);
}
else
{
bd = NULL;
800b804: 34 0c 00 00 mvi r12,0
static void
rtems_bdbuf_check_read_ahead_trigger (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
if (bdbuf_cache.read_ahead_task != 0
800b808: 78 01 08 01 mvhi r1,0x801
800b80c: 38 21 a7 74 ori r1,r1,0xa774
800b810: 28 21 00 84 lw r1,(r1+132)
800b814: 44 20 00 1f be r1,r0,800b890 <rtems_bdbuf_read+0x1fc>
&& dd->read_ahead.trigger == block
800b818: 29 62 00 6c lw r2,(r11+108)
800b81c: 5c 4d 00 1d bne r2,r13,800b890 <rtems_bdbuf_read+0x1fc>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
800b820: 29 63 00 64 lw r3,(r11+100)
800b824: 34 02 00 00 mvi r2,0
800b828: 5c 60 00 03 bne r3,r0,800b834 <rtems_bdbuf_read+0x1a0> <== NEVER TAKEN
dd->read_ahead.next = block + 2;
}
}
rtems_status_code
rtems_bdbuf_read (rtems_disk_device *dd,
800b82c: 29 62 00 68 lw r2,(r11+104)
800b830: 64 42 00 00 cmpei r2,r2,0
rtems_bdbuf_check_read_ahead_trigger (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
if (bdbuf_cache.read_ahead_task != 0
&& dd->read_ahead.trigger == block
&& !rtems_bdbuf_is_read_ahead_active (dd))
800b834: 18 42 00 01 xori r2,r2,0x1
800b838: 5c 40 00 16 bne r2,r0,800b890 <rtems_bdbuf_read+0x1fc> <== NEVER TAKEN
void rtems_bdbuf_reset_device_stats (rtems_disk_device *dd)
{
rtems_bdbuf_lock_cache ();
memset (&dd->stats, 0, sizeof(dd->stats));
rtems_bdbuf_unlock_cache ();
}
800b83c: 78 04 08 01 mvhi r4,0x801
800b840: 38 84 a7 74 ori r4,r4,0xa774
&& !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))
800b844: 28 83 00 88 lw r3,(r4+136)
800b848: 78 02 08 01 mvhi r2,0x801
800b84c: 38 42 a8 00 ori r2,r2,0xa800
800b850: 5c 62 00 06 bne r3,r2,800b868 <rtems_bdbuf_read+0x1d4> <== NEVER TAKEN
{
sc = rtems_event_send (bdbuf_cache.read_ahead_task,
800b854: 34 02 00 02 mvi r2,2
800b858: f8 00 0b 2f calli 800e514 <rtems_event_send>
RTEMS_BDBUF_READ_AHEAD_WAKE_UP);
if (sc != RTEMS_SUCCESSFUL)
800b85c: 44 20 00 03 be r1,r0,800b868 <rtems_bdbuf_read+0x1d4> <== ALWAYS TAKEN
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_RA_WAKE_UP);
800b860: 34 01 00 07 mvi r1,7 <== NOT EXECUTED
800b864: fb ff f7 0a calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
800b868: 78 01 08 01 mvhi r1,0x801
800b86c: 38 21 a7 74 ori r1,r1,0xa774
800b870: 28 23 00 90 lw r3,(r1+144)
the_node->next = tail;
800b874: 78 02 08 01 mvhi r2,0x801
}
rtems_chain_append_unprotected (chain, &dd->read_ahead.node);
800b878: 35 64 00 64 addi r4,r11,100
800b87c: 38 42 a8 00 ori r2,r2,0xa800
800b880: 59 62 00 64 sw (r11+100),r2
tail->previous = the_node;
800b884: 58 24 00 90 sw (r1+144),r4
old_last->next = the_node;
800b888: 58 64 00 00 sw (r3+0),r4
the_node->previous = old_last;
800b88c: 59 63 00 68 sw (r11+104),r3
}
rtems_bdbuf_check_read_ahead_trigger (dd, block);
}
rtems_bdbuf_unlock_cache ();
800b890: fb ff f7 3e calli 8009588 <rtems_bdbuf_unlock_cache>
*bd_ptr = bd;
return sc;
}
800b894: b9 c0 08 00 mv r1,r14
rtems_bdbuf_check_read_ahead_trigger (dd, block);
}
rtems_bdbuf_unlock_cache ();
*bd_ptr = bd;
800b898: 59 ec 00 00 sw (r15+0),r12
return sc;
}
800b89c: 2b 9d 00 04 lw ra,(sp+4)
800b8a0: 2b 8b 00 18 lw r11,(sp+24)
800b8a4: 2b 8c 00 14 lw r12,(sp+20)
800b8a8: 2b 8d 00 10 lw r13,(sp+16)
800b8ac: 2b 8e 00 0c lw r14,(sp+12)
800b8b0: 2b 8f 00 08 lw r15,(sp+8)
800b8b4: 37 9c 00 18 addi sp,sp,24
800b8b8: c3 a0 00 00 ret
0800acf0 <rtems_bdbuf_read_ahead_task>:
return sc;
}
static rtems_task
rtems_bdbuf_read_ahead_task (rtems_task_argument arg)
{
800acf0: 37 9c ff d8 addi sp,sp,-40
800acf4: 5b 8b 00 28 sw (sp+40),r11
800acf8: 5b 8c 00 24 sw (sp+36),r12
800acfc: 5b 8d 00 20 sw (sp+32),r13
800ad00: 5b 8e 00 1c sw (sp+28),r14
800ad04: 5b 8f 00 18 sw (sp+24),r15
800ad08: 5b 90 00 14 sw (sp+20),r16
800ad0c: 5b 91 00 10 sw (sp+16),r17
800ad10: 5b 92 00 0c sw (sp+12),r18
800ad14: 5b 93 00 08 sw (sp+8),r19
800ad18: 5b 9d 00 04 sw (sp+4),ra
rtems_chain_control *chain = &bdbuf_cache.read_ahead_chain;
while (bdbuf_cache.read_ahead_enabled)
800ad1c: 78 0d 08 01 mvhi r13,0x801
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
800ad20: 78 10 08 01 mvhi r16,0x801
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;
800ad24: 78 0f 08 01 mvhi r15,0x801
rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block);
if (bd != NULL)
{
uint32_t transfer_count = dd->block_count - block;
uint32_t max_transfer_count = bdbuf_config.max_read_ahead_blocks;
800ad28: 78 0e 08 01 mvhi r14,0x801
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)
800ad2c: 39 ad a7 74 ori r13,r13,0xa774
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
800ad30: 3a 10 a8 00 ori r16,r16,0xa800
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;
800ad34: 39 ef a7 fc ori r15,r15,0xa7fc
rtems_bdbuf_execute_read_request (dd, bd, transfer_count);
}
}
else
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
800ad38: 34 12 ff ff mvi r18,-1
rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block);
if (bd != NULL)
{
uint32_t transfer_count = dd->block_count - block;
uint32_t max_transfer_count = bdbuf_config.max_read_ahead_blocks;
800ad3c: 39 ce 87 bc ori r14,r14,0x87bc
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)
800ad40: e0 00 00 40 bi 800ae40 <rtems_bdbuf_read_ahead_task+0x150>
{
rtems_chain_node *node;
rtems_bdbuf_wait_for_event (RTEMS_BDBUF_READ_AHEAD_WAKE_UP);
800ad44: 34 01 00 02 mvi r1,2
800ad48: fb ff fa c1 calli 800984c <rtems_bdbuf_wait_for_event>
rtems_bdbuf_lock_cache ();
800ad4c: fb ff f9 e3 calli 80094d8 <rtems_bdbuf_lock_cache>
while ((node = rtems_chain_get_unprotected (chain)) != NULL)
800ad50: e0 00 00 2f bi 800ae0c <rtems_bdbuf_read_ahead_task+0x11c>
}
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)
800ad54: 29 62 00 30 lw r2,(r11+48)
800ad58: 48 02 00 04 bg r0,r2,800ad68 <rtems_bdbuf_read_ahead_task+0x78><== NEVER TAKEN
return block << dd->block_to_media_block_shift;
800ad5c: b9 80 08 00 mv r1,r12
800ad60: f8 00 32 f8 calli 8017940 <__ashlsi3>
800ad64: e0 00 00 0a bi 800ad8c <rtems_bdbuf_read_ahead_task+0x9c>
/*
* 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);
800ad68: 29 62 00 24 lw r2,(r11+36) <== NOT EXECUTED
800ad6c: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
800ad70: b9 80 20 00 mv r4,r12 <== NOT EXECUTED
800ad74: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
800ad78: f8 00 2a b3 calli 8015844 <__muldi3> <== NOT EXECUTED
800ad7c: 29 64 00 20 lw r4,(r11+32) <== NOT EXECUTED
800ad80: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
800ad84: f8 00 2f 26 calli 8016a1c <__udivdi3> <== NOT EXECUTED
800ad88: b8 40 08 00 mv r1,r2 <== 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;
800ad8c: 29 62 00 18 lw r2,(r11+24)
static rtems_status_code
rtems_bdbuf_get_media_block (const rtems_disk_device *dd,
rtems_blkdev_bnum block,
rtems_blkdev_bnum *media_block_ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
800ad90: 34 11 00 00 mvi r17,0
/*
* 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;
800ad94: b4 22 10 00 add r2,r1,r2
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
800ad98: 59 60 00 68 sw (r11+104),r0
800ad9c: 59 60 00 64 sw (r11+100),r0
rtems_status_code sc =
rtems_bdbuf_get_media_block (dd, block, &media_block);
rtems_chain_set_off_chain (&dd->read_ahead.node);
if (sc == RTEMS_SUCCESSFUL)
800ada0: 5e 20 00 1a bne r17,r0,800ae08 <rtems_bdbuf_read_ahead_task+0x118>
{
rtems_bdbuf_buffer *bd =
800ada4: b9 60 08 00 mv r1,r11
800ada8: fb ff ff 59 calli 800ab0c <rtems_bdbuf_get_buffer_for_read_ahead>
800adac: b8 20 98 00 mv r19,r1
rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block);
if (bd != NULL)
800adb0: 44 31 00 17 be r1,r17,800ae0c <rtems_bdbuf_read_ahead_task+0x11c><== NEVER TAKEN
{
uint32_t transfer_count = dd->block_count - block;
800adb4: 29 63 00 28 lw r3,(r11+40)
uint32_t max_transfer_count = bdbuf_config.max_read_ahead_blocks;
800adb8: 29 d1 00 00 lw r17,(r14+0)
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;
800adbc: c8 6c 18 00 sub r3,r3,r12
uint32_t max_transfer_count = bdbuf_config.max_read_ahead_blocks;
if (transfer_count >= max_transfer_count)
800adc0: 56 23 00 0a bgu r17,r3,800ade8 <rtems_bdbuf_read_ahead_task+0xf8>
{
transfer_count = max_transfer_count;
dd->read_ahead.trigger = block + transfer_count / 2;
800adc4: ba 20 08 00 mv r1,r17
800adc8: 34 02 00 01 mvi r2,1
800adcc: f8 00 33 2b calli 8017a78 <__lshrsi3>
800add0: b4 2c 08 00 add r1,r1,r12
dd->read_ahead.next = block + transfer_count;
800add4: b6 2c 60 00 add r12,r17,r12
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;
800add8: 59 61 00 6c sw (r11+108),r1
dd->read_ahead.next = block + transfer_count;
800addc: 59 6c 00 70 sw (r11+112),r12
800ade0: ba 20 18 00 mv r3,r17
800ade4: e0 00 00 02 bi 800adec <rtems_bdbuf_read_ahead_task+0xfc>
}
else
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
800ade8: 59 72 00 6c sw (r11+108),r18
}
++dd->stats.read_ahead_transfers;
800adec: 29 61 00 4c lw r1,(r11+76)
rtems_bdbuf_execute_read_request (dd, bd, transfer_count);
800adf0: ba 60 10 00 mv r2,r19
else
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
}
++dd->stats.read_ahead_transfers;
800adf4: 34 21 00 01 addi r1,r1,1
800adf8: 59 61 00 4c sw (r11+76),r1
rtems_bdbuf_execute_read_request (dd, bd, transfer_count);
800adfc: b9 60 08 00 mv r1,r11
800ae00: fb ff ff 63 calli 800ab8c <rtems_bdbuf_execute_read_request>
800ae04: e0 00 00 02 bi 800ae0c <rtems_bdbuf_read_ahead_task+0x11c>
}
}
else
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
800ae08: 59 72 00 6c sw (r11+108),r18
void rtems_bdbuf_reset_device_stats (rtems_disk_device *dd)
{
rtems_bdbuf_lock_cache ();
memset (&dd->stats, 0, sizeof(dd->stats));
rtems_bdbuf_unlock_cache ();
}
800ae0c: 29 ab 00 88 lw r11,(r13+136)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
800ae10: 45 70 00 0b be r11,r16,800ae3c <rtems_bdbuf_read_ahead_task+0x14c>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
800ae14: 29 61 00 00 lw r1,(r11+0)
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 *)
800ae18: 35 6b ff 9c addi r11,r11,-100
((char *) node - offsetof (rtems_disk_device, read_ahead.node));
rtems_blkdev_bnum block = dd->read_ahead.next;
800ae1c: 29 6c 00 70 lw r12,(r11+112)
head->next = new_first;
800ae20: 59 a1 00 88 sw (r13+136),r1
new_first->previous = head;
800ae24: 58 2f 00 04 sw (r1+4),r15
rtems_blkdev_bnum block,
rtems_blkdev_bnum *media_block_ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (block < dd->block_count)
800ae28: 29 61 00 28 lw r1,(r11+40)
800ae2c: 54 2c ff ca bgu r1,r12,800ad54 <rtems_bdbuf_read_ahead_task+0x64>
while ((node = rtems_chain_get_unprotected (chain)) != NULL)
{
rtems_disk_device *dd = (rtems_disk_device *)
((char *) node - offsetof (rtems_disk_device, read_ahead.node));
rtems_blkdev_bnum block = dd->read_ahead.next;
rtems_blkdev_bnum media_block = 0;
800ae30: 34 02 00 00 mvi r2,0
*/
*media_block_ptr = rtems_bdbuf_media_block (dd, block) + dd->start;
}
else
{
sc = RTEMS_INVALID_ID;
800ae34: 34 11 00 04 mvi r17,4
800ae38: e3 ff ff d8 bi 800ad98 <rtems_bdbuf_read_ahead_task+0xa8>
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
}
}
rtems_bdbuf_unlock_cache ();
800ae3c: fb ff f9 d3 calli 8009588 <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)
800ae40: 41 a1 00 94 lbu r1,(r13+148)
800ae44: 5c 20 ff c0 bne r1,r0,800ad44 <rtems_bdbuf_read_ahead_task+0x54><== ALWAYS TAKEN
}
rtems_bdbuf_unlock_cache ();
}
rtems_task_delete (RTEMS_SELF);
800ae48: f8 00 0f 2e calli 800eb00 <rtems_task_delete> <== NOT EXECUTED
}
800ae4c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
800ae50: 2b 8b 00 28 lw r11,(sp+40) <== NOT EXECUTED
800ae54: 2b 8c 00 24 lw r12,(sp+36) <== NOT EXECUTED
800ae58: 2b 8d 00 20 lw r13,(sp+32) <== NOT EXECUTED
800ae5c: 2b 8e 00 1c lw r14,(sp+28) <== NOT EXECUTED
800ae60: 2b 8f 00 18 lw r15,(sp+24) <== NOT EXECUTED
800ae64: 2b 90 00 14 lw r16,(sp+20) <== NOT EXECUTED
800ae68: 2b 91 00 10 lw r17,(sp+16) <== NOT EXECUTED
800ae6c: 2b 92 00 0c lw r18,(sp+12) <== NOT EXECUTED
800ae70: 2b 93 00 08 lw r19,(sp+8) <== NOT EXECUTED
800ae74: 37 9c 00 28 addi sp,sp,40 <== NOT EXECUTED
800ae78: c3 a0 00 00 ret <== NOT EXECUTED
0800b8bc <rtems_bdbuf_release>:
return RTEMS_SUCCESSFUL;
}
rtems_status_code
rtems_bdbuf_release (rtems_bdbuf_buffer *bd)
{
800b8bc: 37 9c ff f8 addi sp,sp,-8
800b8c0: 5b 8b 00 08 sw (sp+8),r11
800b8c4: 5b 9d 00 04 sw (sp+4),ra
800b8c8: b8 20 58 00 mv r11,r1
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;
800b8cc: 34 01 00 09 mvi r1,9
}
static rtems_status_code
rtems_bdbuf_check_bd_and_lock_cache (rtems_bdbuf_buffer *bd, const char *kind)
{
if (bd == NULL)
800b8d0: 45 60 00 2c be r11,r0,800b980 <rtems_bdbuf_release+0xc4> <== NEVER TAKEN
if (rtems_bdbuf_tracer)
{
printf ("bdbuf:%s: %" PRIu32 "\n", kind, bd->block);
rtems_bdbuf_show_users (kind, bd);
}
rtems_bdbuf_lock_cache();
800b8d4: fb ff f7 01 calli 80094d8 <rtems_bdbuf_lock_cache>
sc = rtems_bdbuf_check_bd_and_lock_cache (bd, "release");
if (sc != RTEMS_SUCCESSFUL)
return sc;
switch (bd->state)
800b8d8: 29 61 00 20 lw r1,(r11+32)
800b8dc: 34 02 00 04 mvi r2,4
800b8e0: 44 22 00 21 be r1,r2,800b964 <rtems_bdbuf_release+0xa8>
800b8e4: 54 22 00 04 bgu r1,r2,800b8f4 <rtems_bdbuf_release+0x38>
800b8e8: 34 02 00 03 mvi r2,3
800b8ec: 5c 22 00 21 bne r1,r2,800b970 <rtems_bdbuf_release+0xb4> <== NEVER TAKEN
800b8f0: e0 00 00 04 bi 800b900 <rtems_bdbuf_release+0x44>
800b8f4: 34 02 00 06 mvi r2,6
800b8f8: 54 22 00 1e bgu r1,r2,800b970 <rtems_bdbuf_release+0xb4> <== NEVER TAKEN
800b8fc: e0 00 00 17 bi 800b958 <rtems_bdbuf_release+0x9c>
}
static void
rtems_bdbuf_add_to_lru_list_after_access (rtems_bdbuf_buffer *bd)
{
rtems_bdbuf_group_release (bd);
800b900: 29 61 00 28 lw r1,(r11+40)
800b904: fb ff f8 10 calli 8009944 <rtems_bdbuf_group_release.clone.8>
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800b908: 34 01 00 02 mvi r1,2
800b90c: 59 61 00 20 sw (r11+32),r1
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
800b910: 78 01 08 01 mvhi r1,0x801
800b914: 38 21 a7 74 ori r1,r1,0xa774
800b918: 28 23 00 48 lw r3,(r1+72)
the_node->next = tail;
800b91c: 78 02 08 01 mvhi r2,0x801
tail->previous = the_node;
800b920: 58 2b 00 48 sw (r1+72),r11
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
800b924: 38 42 a7 b8 ori r2,r2,0xa7b8
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)
800b928: 29 61 00 24 lw r1,(r11+36)
800b92c: 59 62 00 00 sw (r11+0),r2
tail->previous = the_node;
old_last->next = the_node;
800b930: 58 6b 00 00 sw (r3+0),r11
the_node->previous = old_last;
800b934: 59 63 00 04 sw (r11+4),r3
800b938: 44 20 00 04 be r1,r0,800b948 <rtems_bdbuf_release+0x8c>
rtems_bdbuf_wake (&bdbuf_cache.access_waiters);
800b93c: 78 01 08 01 mvhi r1,0x801
800b940: 38 21 a7 d8 ori r1,r1,0xa7d8
800b944: e0 00 00 03 bi 800b950 <rtems_bdbuf_release+0x94>
else
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
800b948: 78 01 08 01 mvhi r1,0x801
800b94c: 38 21 a7 e8 ori r1,r1,0xa7e8
800b950: fb ff f7 22 calli 80095d8 <rtems_bdbuf_wake>
800b954: e0 00 00 09 bi 800b978 <rtems_bdbuf_release+0xbc>
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);
800b958: b9 60 08 00 mv r1,r11
800b95c: fb ff f9 4c calli 8009e8c <rtems_bdbuf_discard_buffer_after_access>
break;
800b960: e0 00 00 06 bi 800b978 <rtems_bdbuf_release+0xbc>
case RTEMS_BDBUF_STATE_ACCESS_MODIFIED:
rtems_bdbuf_add_to_modified_list_after_access (bd);
800b964: b9 60 08 00 mv r1,r11
800b968: fb ff f7 35 calli 800963c <rtems_bdbuf_add_to_modified_list_after_access>
break;
800b96c: e0 00 00 03 bi 800b978 <rtems_bdbuf_release+0xbc>
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_0);
800b970: 34 02 00 0e mvi r2,14 <== NOT EXECUTED
800b974: fb ff f6 ed calli 8009528 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
}
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
800b978: fb ff f7 04 calli 8009588 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
800b97c: 34 01 00 00 mvi r1,0
}
800b980: 2b 9d 00 04 lw ra,(sp+4)
800b984: 2b 8b 00 08 lw r11,(sp+8)
800b988: 37 9c 00 08 addi sp,sp,8
800b98c: c3 a0 00 00 ret
0800b990 <rtems_bdbuf_release_modified>:
rtems_status_code
rtems_bdbuf_release_modified (rtems_bdbuf_buffer *bd)
{
800b990: 37 9c ff f8 addi sp,sp,-8
800b994: 5b 9d 00 04 sw (sp+4),ra
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;
800b998: 34 02 00 09 mvi r2,9
}
static rtems_status_code
rtems_bdbuf_check_bd_and_lock_cache (rtems_bdbuf_buffer *bd, const char *kind)
{
if (bd == NULL)
800b99c: 44 20 00 15 be r1,r0,800b9f0 <rtems_bdbuf_release_modified+0x60><== NEVER TAKEN
if (rtems_bdbuf_tracer)
{
printf ("bdbuf:%s: %" PRIu32 "\n", kind, bd->block);
rtems_bdbuf_show_users (kind, bd);
}
rtems_bdbuf_lock_cache();
800b9a0: 5b 81 00 08 sw (sp+8),r1
800b9a4: fb ff f6 cd calli 80094d8 <rtems_bdbuf_lock_cache>
sc = rtems_bdbuf_check_bd_and_lock_cache (bd, "release modified");
if (sc != RTEMS_SUCCESSFUL)
return sc;
switch (bd->state)
800b9a8: 2b 81 00 08 lw r1,(sp+8)
800b9ac: 34 03 00 03 mvi r3,3
800b9b0: 28 22 00 20 lw r2,(r1+32)
800b9b4: 54 62 00 0a bgu r3,r2,800b9dc <rtems_bdbuf_release_modified+0x4c><== NEVER TAKEN
800b9b8: 34 03 00 05 mvi r3,5
800b9bc: 50 62 00 04 bgeu r3,r2,800b9cc <rtems_bdbuf_release_modified+0x3c><== ALWAYS TAKEN
800b9c0: 34 03 00 06 mvi r3,6 <== NOT EXECUTED
800b9c4: 5c 43 00 06 bne r2,r3,800b9dc <rtems_bdbuf_release_modified+0x4c><== NOT EXECUTED
800b9c8: e0 00 00 03 bi 800b9d4 <rtems_bdbuf_release_modified+0x44> <== NOT EXECUTED
{
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);
800b9cc: fb ff f7 1c calli 800963c <rtems_bdbuf_add_to_modified_list_after_access>
break;
800b9d0: e0 00 00 06 bi 800b9e8 <rtems_bdbuf_release_modified+0x58>
case RTEMS_BDBUF_STATE_ACCESS_PURGED:
rtems_bdbuf_discard_buffer_after_access (bd);
800b9d4: fb ff f9 2e calli 8009e8c <rtems_bdbuf_discard_buffer_after_access><== NOT EXECUTED
break;
800b9d8: e0 00 00 04 bi 800b9e8 <rtems_bdbuf_release_modified+0x58> <== NOT EXECUTED
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_6);
800b9dc: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
800b9e0: 34 02 00 12 mvi r2,18 <== NOT EXECUTED
800b9e4: fb ff f6 d1 calli 8009528 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
}
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
800b9e8: fb ff f6 e8 calli 8009588 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
800b9ec: 34 02 00 00 mvi r2,0
}
800b9f0: b8 40 08 00 mv r1,r2
800b9f4: 2b 9d 00 04 lw ra,(sp+4)
800b9f8: 37 9c 00 08 addi sp,sp,8
800b9fc: c3 a0 00 00 ret
08009a2c <rtems_bdbuf_remove_from_tree>:
return bdbuf_cache.buffer_waiters.count;
}
static void
rtems_bdbuf_remove_from_tree (rtems_bdbuf_buffer *bd)
{
8009a2c: 37 9c ff 58 addi sp,sp,-168
8009a30: 5b 8b 00 28 sw (sp+40),r11
8009a34: 5b 8c 00 24 sw (sp+36),r12
8009a38: 5b 8d 00 20 sw (sp+32),r13
8009a3c: 5b 8e 00 1c sw (sp+28),r14
8009a40: 5b 8f 00 18 sw (sp+24),r15
8009a44: 5b 90 00 14 sw (sp+20),r16
8009a48: 5b 91 00 10 sw (sp+16),r17
8009a4c: 5b 92 00 0c sw (sp+12),r18
8009a50: 5b 93 00 08 sw (sp+8),r19
8009a54: 5b 9d 00 04 sw (sp+4),ra
*/
static int
rtems_bdbuf_avl_remove(rtems_bdbuf_buffer** root,
const rtems_bdbuf_buffer* node)
{
const rtems_disk_device *dd = node->dd;
8009a58: 28 2f 00 14 lw r15,(r1+20)
rtems_blkdev_bnum block = node->block;
8009a5c: 28 2e 00 18 lw r14,(r1+24)
return bdbuf_cache.buffer_waiters.count;
}
static void
rtems_bdbuf_remove_from_tree (rtems_bdbuf_buffer *bd)
{
8009a60: b8 20 68 00 mv r13,r1
const rtems_bdbuf_buffer* node)
{
const rtems_disk_device *dd = node->dd;
rtems_blkdev_bnum block = node->block;
rtems_bdbuf_buffer* p = *root;
8009a64: 78 01 08 01 mvhi r1,0x801
8009a68: 38 21 a7 74 ori r1,r1,0xa774
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));
8009a6c: 37 8c 00 2c addi r12,sp,44
const rtems_bdbuf_buffer* node)
{
const rtems_disk_device *dd = node->dd;
rtems_blkdev_bnum block = node->block;
rtems_bdbuf_buffer* p = *root;
8009a70: 28 2b 00 3c lw r11,(r1+60)
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));
8009a74: 34 03 00 80 mvi r3,128
8009a78: b9 80 08 00 mv r1,r12
8009a7c: 34 02 00 00 mvi r2,0
8009a80: f8 00 23 ac calli 8012930 <memset>
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
{
p->avl.cache = 1;
8009a84: 34 04 00 01 mvi r4,1
p = p->avl.right;
}
else if ((p->dd != dd) || (p->block != block))
{
p->avl.cache = -1;
8009a88: 34 03 ff ff mvi r3,-1
8009a8c: e0 00 00 0f bi 8009ac8 <rtems_bdbuf_remove_from_tree+0x9c>
while (p != NULL)
{
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
8009a90: 29 61 00 14 lw r1,(r11+20)
memset (buf_stack, 0, sizeof(buf_stack));
while (p != NULL)
{
*buf_prev++ = p;
8009a94: 59 8b 00 00 sw (r12+0),r11
8009a98: 35 82 00 04 addi r2,r12,4
if (((uintptr_t) p->dd < (uintptr_t) dd)
8009a9c: 55 e1 00 04 bgu r15,r1,8009aac <rtems_bdbuf_remove_from_tree+0x80><== NEVER TAKEN
|| ((p->dd == dd) && (p->block < block)))
8009aa0: 5c 2f 00 07 bne r1,r15,8009abc <rtems_bdbuf_remove_from_tree+0x90><== NEVER TAKEN
8009aa4: 29 61 00 18 lw r1,(r11+24)
8009aa8: 50 2e 00 04 bgeu r1,r14,8009ab8 <rtems_bdbuf_remove_from_tree+0x8c>
{
p->avl.cache = 1;
8009aac: 31 64 00 10 sb (r11+16),r4
p = p->avl.right;
8009ab0: 29 6b 00 0c lw r11,(r11+12)
8009ab4: e0 00 00 04 bi 8009ac4 <rtems_bdbuf_remove_from_tree+0x98>
}
else if ((p->dd != dd) || (p->block != block))
8009ab8: 44 2e 00 06 be r1,r14,8009ad0 <rtems_bdbuf_remove_from_tree+0xa4>
{
p->avl.cache = -1;
8009abc: 31 63 00 10 sb (r11+16),r3
p = p->avl.left;
8009ac0: 29 6b 00 08 lw r11,(r11+8)
memset (buf_stack, 0, sizeof(buf_stack));
while (p != NULL)
{
*buf_prev++ = p;
8009ac4: b8 40 60 00 mv r12,r2
bool modified = false;
memset (buf_stack, 0, sizeof(buf_stack));
while (p != NULL)
8009ac8: 5d 60 ff f2 bne r11,r0,8009a90 <rtems_bdbuf_remove_from_tree+0x64><== ALWAYS TAKEN
8009acc: e0 00 00 ca bi 8009df4 <rtems_bdbuf_remove_from_tree+0x3c8><== NOT EXECUTED
}
q = p;
buf_prev--;
if (buf_prev > buf_stack)
8009ad0: 37 81 00 2c addi r1,sp,44
|| ((p->dd == dd) && (p->block < block)))
{
p->avl.cache = 1;
p = p->avl.right;
}
else if ((p->dd != dd) || (p->block != block))
8009ad4: b9 80 20 00 mv r4,r12
{
p = *(buf_prev - 1);
}
else
{
p = NULL;
8009ad8: 34 0e 00 00 mvi r14,0
}
q = p;
buf_prev--;
if (buf_prev > buf_stack)
8009adc: 50 2c 00 02 bgeu r1,r12,8009ae4 <rtems_bdbuf_remove_from_tree+0xb8>
{
p = *(buf_prev - 1);
8009ae0: 29 8e ff fc lw r14,(r12+-4)
{
p = NULL;
}
/* at this moment q - is a node to delete, p is q's parent */
if (q->avl.right == NULL)
8009ae4: 29 6d 00 0c lw r13,(r11+12)
8009ae8: 5d a0 00 05 bne r13,r0,8009afc <rtems_bdbuf_remove_from_tree+0xd0>
{
r = q->avl.left;
8009aec: 29 6d 00 08 lw r13,(r11+8)
if (r != NULL)
8009af0: 45 a0 00 25 be r13,r0,8009b84 <rtems_bdbuf_remove_from_tree+0x158>
{
r->avl.bal = 0;
8009af4: 31 a0 00 11 sb (r13+17),r0
8009af8: e0 00 00 23 bi 8009b84 <rtems_bdbuf_remove_from_tree+0x158>
{
rtems_bdbuf_buffer **t;
r = q->avl.right;
if (r->avl.left == NULL)
8009afc: 29 a1 00 08 lw r1,(r13+8)
8009b00: 44 20 00 06 be r1,r0,8009b18 <rtems_bdbuf_remove_from_tree+0xec>
8009b04: b9 a0 08 00 mv r1,r13
8009b08: b9 a0 18 00 mv r3,r13
8009b0c: b8 40 60 00 mv r12,r2
while (s->avl.left != NULL)
{
*buf_prev++ = r = s;
s = r->avl.left;
r->avl.cache = -1;
8009b10: 34 05 ff ff mvi r5,-1
8009b14: e0 00 00 0f bi 8009b50 <rtems_bdbuf_remove_from_tree+0x124>
r = q->avl.right;
if (r->avl.left == NULL)
{
r->avl.left = q->avl.left;
8009b18: 29 61 00 08 lw r1,(r11+8)
8009b1c: 59 a1 00 08 sw (r13+8),r1
r->avl.bal = q->avl.bal;
8009b20: 41 61 00 11 lbu r1,(r11+17)
8009b24: 31 a1 00 11 sb (r13+17),r1
r->avl.cache = 1;
8009b28: 34 01 00 01 mvi r1,1
8009b2c: 31 a1 00 10 sb (r13+16),r1
*buf_prev++ = q = r;
8009b30: 59 8d 00 00 sw (r12+0),r13
memset (buf_stack, 0, sizeof(buf_stack));
while (p != NULL)
{
*buf_prev++ = p;
8009b34: b8 40 60 00 mv r12,r2
8009b38: e0 00 00 13 bi 8009b84 <rtems_bdbuf_remove_from_tree+0x158>
t = buf_prev++;
s = r;
while (s->avl.left != NULL)
{
*buf_prev++ = r = s;
8009b3c: 59 81 00 00 sw (r12+0),r1
s = r->avl.left;
r->avl.cache = -1;
8009b40: 30 25 00 10 sb (r1+16),r5
8009b44: b8 20 18 00 mv r3,r1
t = buf_prev++;
s = r;
while (s->avl.left != NULL)
{
*buf_prev++ = r = s;
8009b48: 35 8c 00 04 addi r12,r12,4
s = r->avl.left;
r->avl.cache = -1;
8009b4c: b8 40 08 00 mv r1,r2
else
{
t = buf_prev++;
s = r;
while (s->avl.left != NULL)
8009b50: 28 22 00 08 lw r2,(r1+8)
8009b54: 5c 40 ff fa bne r2,r0,8009b3c <rtems_bdbuf_remove_from_tree+0x110>
*buf_prev++ = r = s;
s = r->avl.left;
r->avl.cache = -1;
}
s->avl.left = q->avl.left;
8009b58: 29 62 00 08 lw r2,(r11+8)
8009b5c: 58 22 00 08 sw (r1+8),r2
r->avl.left = s->avl.right;
8009b60: 28 22 00 0c lw r2,(r1+12)
s->avl.right = q->avl.right;
8009b64: 58 2d 00 0c sw (r1+12),r13
s->avl.bal = q->avl.bal;
s->avl.cache = 1;
*t = q = s;
8009b68: b8 20 68 00 mv r13,r1
s = r->avl.left;
r->avl.cache = -1;
}
s->avl.left = q->avl.left;
r->avl.left = s->avl.right;
8009b6c: 58 62 00 08 sw (r3+8),r2
s->avl.right = q->avl.right;
s->avl.bal = q->avl.bal;
8009b70: 41 62 00 11 lbu r2,(r11+17)
8009b74: 30 22 00 11 sb (r1+17),r2
s->avl.cache = 1;
8009b78: 34 02 00 01 mvi r2,1
8009b7c: 30 22 00 10 sb (r1+16),r2
*t = q = s;
8009b80: 58 81 00 00 sw (r4+0),r1
}
}
if (p != NULL)
8009b84: 45 c0 00 0e be r14,r0,8009bbc <rtems_bdbuf_remove_from_tree+0x190>
{
if (p->avl.cache == -1)
8009b88: 41 c1 00 10 lbu r1,(r14+16)
8009b8c: 34 02 00 18 mvi r2,24
8009b90: f8 00 37 6c calli 8017940 <__ashlsi3>
8009b94: 34 02 00 18 mvi r2,24
8009b98: f8 00 37 91 calli 80179dc <__ashrsi3>
8009b9c: 34 02 ff ff mvi r2,-1
8009ba0: 5c 22 00 05 bne r1,r2,8009bb4 <rtems_bdbuf_remove_from_tree+0x188>
{
p->avl.left = q;
8009ba4: 59 cd 00 08 sw (r14+8),r13
modified = true;
while (modified)
{
if (buf_prev > buf_stack)
8009ba8: 37 81 00 2c addi r1,sp,44
8009bac: 55 81 00 08 bgu r12,r1,8009bcc <rtems_bdbuf_remove_from_tree+0x1a0>
8009bb0: e0 00 00 94 bi 8009e00 <rtems_bdbuf_remove_from_tree+0x3d4>
{
p->avl.left = q;
}
else
{
p->avl.right = q;
8009bb4: 59 cd 00 0c sw (r14+12),r13
8009bb8: e3 ff ff fc bi 8009ba8 <rtems_bdbuf_remove_from_tree+0x17c>
}
}
else
{
*root = q;
8009bbc: 78 01 08 01 mvhi r1,0x801
8009bc0: 38 21 a7 74 ori r1,r1,0xa774
8009bc4: 58 2d 00 3c sw (r1+60),r13
8009bc8: e3 ff ff f8 bi 8009ba8 <rtems_bdbuf_remove_from_tree+0x17c>
else
{
break;
}
if (p->avl.cache == -1)
8009bcc: 34 0f ff ff mvi r15,-1
{
case -1:
p->avl.bal = 0;
break;
case 0:
p->avl.bal = 1;
8009bd0: 34 11 00 01 mvi r17,1
}
if (p->avl.cache == -1)
{
/* rebalance left branch */
switch (p->avl.bal)
8009bd4: 34 10 00 01 mvi r16,1
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;
8009bd8: 34 13 ff ff mvi r19,-1
default:
break;
}
}
if (buf_prev > buf_stack)
8009bdc: b8 20 90 00 mv r18,r1
while (modified)
{
if (buf_prev > buf_stack)
{
p = *--buf_prev;
8009be0: 35 8c ff fc addi r12,r12,-4
8009be4: 29 8b 00 00 lw r11,(r12+0)
else
{
break;
}
if (p->avl.cache == -1)
8009be8: 34 02 00 18 mvi r2,24
8009bec: 41 61 00 10 lbu r1,(r11+16)
8009bf0: f8 00 37 54 calli 8017940 <__ashlsi3>
8009bf4: 34 02 00 18 mvi r2,24
8009bf8: f8 00 37 79 calli 80179dc <__ashrsi3>
8009bfc: 41 62 00 11 lbu r2,(r11+17)
8009c00: 5c 2f 00 32 bne r1,r15,8009cc8 <rtems_bdbuf_remove_from_tree+0x29c>
{
/* rebalance left branch */
switch (p->avl.bal)
8009c04: b8 40 08 00 mv r1,r2
8009c08: 34 02 00 18 mvi r2,24
8009c0c: f8 00 37 4d calli 8017940 <__ashlsi3>
8009c10: 34 02 00 18 mvi r2,24
8009c14: f8 00 37 72 calli 80179dc <__ashrsi3>
8009c18: 44 20 00 04 be r1,r0,8009c28 <rtems_bdbuf_remove_from_tree+0x1fc>
8009c1c: 44 30 00 05 be r1,r16,8009c30 <rtems_bdbuf_remove_from_tree+0x204>
8009c20: 5c 2f 00 62 bne r1,r15,8009da8 <rtems_bdbuf_remove_from_tree+0x37c><== NEVER TAKEN
8009c24: e0 00 00 32 bi 8009cec <rtems_bdbuf_remove_from_tree+0x2c0>
{
case -1:
p->avl.bal = 0;
break;
case 0:
p->avl.bal = 1;
8009c28: 31 71 00 11 sb (r11+17),r17
8009c2c: e0 00 00 0e bi 8009c64 <rtems_bdbuf_remove_from_tree+0x238>
modified = false;
break;
case +1:
p1 = p->avl.right;
8009c30: 29 6e 00 0c lw r14,(r11+12)
if (p1->avl.bal >= 0) /* simple RR-turn */
8009c34: 34 02 00 18 mvi r2,24
8009c38: 41 c1 00 11 lbu r1,(r14+17)
8009c3c: f8 00 37 41 calli 8017940 <__ashlsi3>
8009c40: 34 02 00 18 mvi r2,24
8009c44: f8 00 37 66 calli 80179dc <__ashrsi3>
8009c48: 29 cd 00 08 lw r13,(r14+8)
8009c4c: 48 01 00 08 bg r0,r1,8009c6c <rtems_bdbuf_remove_from_tree+0x240>
{
p->avl.right = p1->avl.left;
8009c50: 59 6d 00 0c sw (r11+12),r13
p1->avl.left = p;
8009c54: 59 cb 00 08 sw (r14+8),r11
if (p1->avl.bal == 0)
8009c58: 5c 20 00 36 bne r1,r0,8009d30 <rtems_bdbuf_remove_from_tree+0x304>
{
p1->avl.bal = -1;
8009c5c: 31 cf 00 11 sb (r14+17),r15
8009c60: b9 c0 58 00 mv r11,r14
modified = false;
8009c64: 34 0d 00 00 mvi r13,0
8009c68: e0 00 00 51 bi 8009dac <rtems_bdbuf_remove_from_tree+0x380>
}
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
8009c6c: 29 a1 00 0c lw r1,(r13+12)
p2->avl.right = p1;
8009c70: 59 ae 00 0c sw (r13+12),r14
p->avl.right = p2->avl.left;
p2->avl.left = p;
if (p2->avl.bal == +1) p->avl.bal = -1; else p->avl.bal = 0;
8009c74: 34 02 00 18 mvi r2,24
}
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
8009c78: 59 c1 00 08 sw (r14+8),r1
p2->avl.right = p1;
p->avl.right = p2->avl.left;
8009c7c: 29 a1 00 08 lw r1,(r13+8)
p2->avl.left = p;
8009c80: 59 ab 00 08 sw (r13+8),r11
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
p2->avl.right = p1;
p->avl.right = p2->avl.left;
8009c84: 59 61 00 0c sw (r11+12),r1
p2->avl.left = p;
if (p2->avl.bal == +1) p->avl.bal = -1; else p->avl.bal = 0;
8009c88: 41 a1 00 11 lbu r1,(r13+17)
8009c8c: f8 00 37 2d calli 8017940 <__ashlsi3>
8009c90: 34 02 00 18 mvi r2,24
8009c94: f8 00 37 52 calli 80179dc <__ashrsi3>
8009c98: 5c 30 00 03 bne r1,r16,8009ca4 <rtems_bdbuf_remove_from_tree+0x278>
8009c9c: 31 6f 00 11 sb (r11+17),r15
8009ca0: e0 00 00 02 bi 8009ca8 <rtems_bdbuf_remove_from_tree+0x27c>
8009ca4: 31 60 00 11 sb (r11+17),r0
if (p2->avl.bal == -1) p1->avl.bal = 1; else p1->avl.bal = 0;
8009ca8: 41 a1 00 11 lbu r1,(r13+17)
8009cac: 34 02 00 18 mvi r2,24
8009cb0: f8 00 37 24 calli 8017940 <__ashlsi3>
8009cb4: 34 02 00 18 mvi r2,24
8009cb8: f8 00 37 49 calli 80179dc <__ashrsi3>
8009cbc: 5c 2f 00 38 bne r1,r15,8009d9c <rtems_bdbuf_remove_from_tree+0x370><== ALWAYS TAKEN
8009cc0: 31 d1 00 11 sb (r14+17),r17 <== NOT EXECUTED
8009cc4: e0 00 00 37 bi 8009da0 <rtems_bdbuf_remove_from_tree+0x374><== NOT EXECUTED
}
}
else
{
/* rebalance right branch */
switch (p->avl.bal)
8009cc8: b8 40 08 00 mv r1,r2
8009ccc: 34 02 00 18 mvi r2,24
8009cd0: f8 00 37 1c calli 8017940 <__ashlsi3>
8009cd4: 34 02 00 18 mvi r2,24
8009cd8: f8 00 37 41 calli 80179dc <__ashrsi3>
8009cdc: 44 20 00 06 be r1,r0,8009cf4 <rtems_bdbuf_remove_from_tree+0x2c8>
8009ce0: 44 30 00 03 be r1,r16,8009cec <rtems_bdbuf_remove_from_tree+0x2c0>
8009ce4: 5c 2f 00 31 bne r1,r15,8009da8 <rtems_bdbuf_remove_from_tree+0x37c><== NEVER TAKEN
8009ce8: e0 00 00 05 bi 8009cfc <rtems_bdbuf_remove_from_tree+0x2d0>
{
case +1:
p->avl.bal = 0;
8009cec: 31 60 00 11 sb (r11+17),r0
8009cf0: e0 00 00 2e bi 8009da8 <rtems_bdbuf_remove_from_tree+0x37c>
break;
case 0:
p->avl.bal = -1;
8009cf4: 31 6f 00 11 sb (r11+17),r15
8009cf8: e3 ff ff db bi 8009c64 <rtems_bdbuf_remove_from_tree+0x238>
modified = false;
break;
case -1:
p1 = p->avl.left;
8009cfc: 29 6e 00 08 lw r14,(r11+8)
if (p1->avl.bal <= 0) /* simple LL-turn */
8009d00: 34 02 00 18 mvi r2,24
8009d04: 41 c1 00 11 lbu r1,(r14+17)
8009d08: f8 00 37 0e calli 8017940 <__ashlsi3>
8009d0c: 34 02 00 18 mvi r2,24
8009d10: f8 00 37 33 calli 80179dc <__ashrsi3>
8009d14: 29 cd 00 0c lw r13,(r14+12)
8009d18: 48 20 00 0a bg r1,r0,8009d40 <rtems_bdbuf_remove_from_tree+0x314>
{
p->avl.left = p1->avl.right;
8009d1c: 59 6d 00 08 sw (r11+8),r13
p1->avl.right = p;
8009d20: 59 cb 00 0c sw (r14+12),r11
if (p1->avl.bal == 0)
8009d24: 5c 20 00 03 bne r1,r0,8009d30 <rtems_bdbuf_remove_from_tree+0x304>
{
p1->avl.bal = 1;
8009d28: 31 d0 00 11 sb (r14+17),r16
8009d2c: e3 ff ff cd bi 8009c60 <rtems_bdbuf_remove_from_tree+0x234>
modified = false;
}
else
{
p->avl.bal = 0;
8009d30: 31 60 00 11 sb (r11+17),r0
p1->avl.bal = 0;
8009d34: 31 c0 00 11 sb (r14+17),r0
8009d38: b9 c0 58 00 mv r11,r14
8009d3c: e0 00 00 1b bi 8009da8 <rtems_bdbuf_remove_from_tree+0x37c>
}
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
8009d40: 29 a1 00 08 lw r1,(r13+8)
p2->avl.left = p1;
8009d44: 59 ae 00 08 sw (r13+8),r14
p->avl.left = p2->avl.right;
p2->avl.right = p;
if (p2->avl.bal == -1) p->avl.bal = 1; else p->avl.bal = 0;
8009d48: 34 02 00 18 mvi r2,24
}
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
8009d4c: 59 c1 00 0c sw (r14+12),r1
p2->avl.left = p1;
p->avl.left = p2->avl.right;
8009d50: 29 a1 00 0c lw r1,(r13+12)
p2->avl.right = p;
8009d54: 59 ab 00 0c sw (r13+12),r11
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
p2->avl.left = p1;
p->avl.left = p2->avl.right;
8009d58: 59 61 00 08 sw (r11+8),r1
p2->avl.right = p;
if (p2->avl.bal == -1) p->avl.bal = 1; else p->avl.bal = 0;
8009d5c: 41 a1 00 11 lbu r1,(r13+17)
8009d60: f8 00 36 f8 calli 8017940 <__ashlsi3>
8009d64: 34 02 00 18 mvi r2,24
8009d68: f8 00 37 1d calli 80179dc <__ashrsi3>
8009d6c: 5c 2f 00 03 bne r1,r15,8009d78 <rtems_bdbuf_remove_from_tree+0x34c>
8009d70: 31 70 00 11 sb (r11+17),r16
8009d74: e0 00 00 02 bi 8009d7c <rtems_bdbuf_remove_from_tree+0x350>
8009d78: 31 60 00 11 sb (r11+17),r0
if (p2->avl.bal == +1) p1->avl.bal = -1; else p1->avl.bal = 0;
8009d7c: 41 a1 00 11 lbu r1,(r13+17)
8009d80: 34 02 00 18 mvi r2,24
8009d84: f8 00 36 ef calli 8017940 <__ashlsi3>
8009d88: 34 02 00 18 mvi r2,24
8009d8c: f8 00 37 14 calli 80179dc <__ashrsi3>
8009d90: 5c 30 00 03 bne r1,r16,8009d9c <rtems_bdbuf_remove_from_tree+0x370>
8009d94: 31 d3 00 11 sb (r14+17),r19
8009d98: e0 00 00 02 bi 8009da0 <rtems_bdbuf_remove_from_tree+0x374>
8009d9c: 31 c0 00 11 sb (r14+17),r0
p = p2;
p2->avl.bal = 0;
8009da0: 31 a0 00 11 sb (r13+17),r0
8009da4: b9 a0 58 00 mv r11,r13
}
}
else
{
/* rebalance right branch */
switch (p->avl.bal)
8009da8: 34 0d 00 01 mvi r13,1
default:
break;
}
}
if (buf_prev > buf_stack)
8009dac: 52 4c 00 0c bgeu r18,r12,8009ddc <rtems_bdbuf_remove_from_tree+0x3b0>
{
q = *(buf_prev - 1);
8009db0: 29 8e ff fc lw r14,(r12+-4)
if (q->avl.cache == -1)
8009db4: 34 02 00 18 mvi r2,24
8009db8: 41 c1 00 10 lbu r1,(r14+16)
8009dbc: f8 00 36 e1 calli 8017940 <__ashlsi3>
8009dc0: 34 02 00 18 mvi r2,24
8009dc4: f8 00 37 06 calli 80179dc <__ashrsi3>
8009dc8: 5c 2f 00 03 bne r1,r15,8009dd4 <rtems_bdbuf_remove_from_tree+0x3a8>
{
q->avl.left = p;
8009dcc: 59 cb 00 08 sw (r14+8),r11
8009dd0: e0 00 00 07 bi 8009dec <rtems_bdbuf_remove_from_tree+0x3c0>
}
else
{
q->avl.right = p;
8009dd4: 59 cb 00 0c sw (r14+12),r11
8009dd8: e0 00 00 05 bi 8009dec <rtems_bdbuf_remove_from_tree+0x3c0>
}
}
else
{
*root = p;
8009ddc: 78 01 08 01 mvhi r1,0x801
8009de0: 38 21 a7 74 ori r1,r1,0xa774
8009de4: 58 2b 00 3c sw (r1+60),r11
8009de8: e0 00 00 06 bi 8009e00 <rtems_bdbuf_remove_from_tree+0x3d4>
*root = q;
}
modified = true;
while (modified)
8009dec: 5d a0 ff 7d bne r13,r0,8009be0 <rtems_bdbuf_remove_from_tree+0x1b4>
8009df0: e0 00 00 04 bi 8009e00 <rtems_bdbuf_remove_from_tree+0x3d4>
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);
8009df4: 29 a1 00 20 lw r1,(r13+32) <== NOT EXECUTED
8009df8: 34 02 00 1b mvi r2,27 <== NOT EXECUTED
8009dfc: fb ff fd cb calli 8009528 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
}
8009e00: 2b 9d 00 04 lw ra,(sp+4)
8009e04: 2b 8b 00 28 lw r11,(sp+40)
8009e08: 2b 8c 00 24 lw r12,(sp+36)
8009e0c: 2b 8d 00 20 lw r13,(sp+32)
8009e10: 2b 8e 00 1c lw r14,(sp+28)
8009e14: 2b 8f 00 18 lw r15,(sp+24)
8009e18: 2b 90 00 14 lw r16,(sp+20)
8009e1c: 2b 91 00 10 lw r17,(sp+16)
8009e20: 2b 92 00 0c lw r18,(sp+12)
8009e24: 2b 93 00 08 lw r19,(sp+8)
8009e28: 37 9c 00 a8 addi sp,sp,168
8009e2c: c3 a0 00 00 ret
0800a65c <rtems_bdbuf_remove_from_tree_and_lru_list>:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_TREE_RM);
}
static void
rtems_bdbuf_remove_from_tree_and_lru_list (rtems_bdbuf_buffer *bd)
{
800a65c: 37 9c ff f8 addi sp,sp,-8
800a660: 5b 8b 00 08 sw (sp+8),r11
800a664: 5b 9d 00 04 sw (sp+4),ra
switch (bd->state)
800a668: 28 22 00 20 lw r2,(r1+32)
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_TREE_RM);
}
static void
rtems_bdbuf_remove_from_tree_and_lru_list (rtems_bdbuf_buffer *bd)
{
800a66c: b8 20 58 00 mv r11,r1
switch (bd->state)
800a670: 44 40 00 08 be r2,r0,800a690 <rtems_bdbuf_remove_from_tree_and_lru_list+0x34>
800a674: 34 03 00 02 mvi r3,2
800a678: 5c 43 00 03 bne r2,r3,800a684 <rtems_bdbuf_remove_from_tree_and_lru_list+0x28><== NEVER TAKEN
{
case RTEMS_BDBUF_STATE_FREE:
break;
case RTEMS_BDBUF_STATE_CACHED:
rtems_bdbuf_remove_from_tree (bd);
800a67c: fb ff fc ec calli 8009a2c <rtems_bdbuf_remove_from_tree>
break;
800a680: e0 00 00 04 bi 800a690 <rtems_bdbuf_remove_from_tree_and_lru_list+0x34>
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_10);
800a684: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
800a688: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
800a68c: fb ff fb a7 calli 8009528 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
800a690: 29 62 00 00 lw r2,(r11+0)
previous = the_node->previous;
800a694: 29 61 00 04 lw r1,(r11+4)
next->previous = previous;
800a698: 58 41 00 04 sw (r2+4),r1
previous->next = next;
800a69c: 58 22 00 00 sw (r1+0),r2
}
rtems_chain_extract_unprotected (&bd->link);
}
800a6a0: 2b 9d 00 04 lw ra,(sp+4)
800a6a4: 2b 8b 00 08 lw r11,(sp+8)
800a6a8: 37 9c 00 08 addi sp,sp,8
800a6ac: c3 a0 00 00 ret
08009768 <rtems_bdbuf_restore_preemption>:
static void
rtems_bdbuf_restore_preemption (rtems_mode prev_mode)
{
8009768: 37 9c ff f8 addi sp,sp,-8
800976c: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc = rtems_task_mode (prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode);
8009770: 38 02 ff ff mvu r2,0xffff
8009774: 37 83 00 08 addi r3,sp,8
return prev_mode;
}
static void
rtems_bdbuf_restore_preemption (rtems_mode prev_mode)
{
8009778: 5b 81 00 08 sw (sp+8),r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc = rtems_task_mode (prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode);
800977c: f8 00 15 05 calli 800eb90 <rtems_task_mode>
if (sc != RTEMS_SUCCESSFUL)
8009780: 44 20 00 03 be r1,r0,800978c <rtems_bdbuf_restore_preemption+0x24><== ALWAYS TAKEN
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_PREEMPT_RST);
8009784: 34 01 00 06 mvi r1,6 <== NOT EXECUTED
8009788: fb ff ff 41 calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
}
800978c: 2b 9d 00 04 lw ra,(sp+4)
8009790: 37 9c 00 08 addi sp,sp,8
8009794: c3 a0 00 00 ret
0800bda8 <rtems_bdbuf_set_block_size>:
rtems_status_code
rtems_bdbuf_set_block_size (rtems_disk_device *dd,
uint32_t block_size,
bool sync)
{
800bda8: 37 9c ff e4 addi sp,sp,-28
800bdac: 5b 8b 00 1c sw (sp+28),r11
800bdb0: 5b 8c 00 18 sw (sp+24),r12
800bdb4: 5b 8d 00 14 sw (sp+20),r13
800bdb8: 5b 8e 00 10 sw (sp+16),r14
800bdbc: 5b 8f 00 0c sw (sp+12),r15
800bdc0: 5b 90 00 08 sw (sp+8),r16
800bdc4: 5b 9d 00 04 sw (sp+4),ra
800bdc8: 20 63 00 ff andi r3,r3,0xff
800bdcc: b8 20 58 00 mv r11,r1
800bdd0: b8 40 68 00 mv r13,r2
/*
* We do not care about the synchronization status since we will purge the
* device later.
*/
if (sync)
800bdd4: 44 60 00 02 be r3,r0,800bddc <rtems_bdbuf_set_block_size+0x34>
rtems_bdbuf_syncdev (dd);
800bdd8: fb ff ff 60 calli 800bb58 <rtems_bdbuf_syncdev>
rtems_bdbuf_lock_cache ();
800bddc: fb ff f5 bf calli 80094d8 <rtems_bdbuf_lock_cache>
sc = RTEMS_INVALID_NUMBER;
}
}
else
{
sc = RTEMS_INVALID_NUMBER;
800bde0: 34 0c 00 0a mvi r12,10
if (sync)
rtems_bdbuf_syncdev (dd);
rtems_bdbuf_lock_cache ();
if (block_size > 0)
800bde4: 45 a0 00 33 be r13,r0,800beb0 <rtems_bdbuf_set_block_size+0x108>
rtems_bdbuf_bds_per_group (size_t size)
{
size_t bufs_per_size;
size_t bds_per_size;
if (size > bdbuf_config.buffer_max)
800bde8: 78 02 08 01 mvhi r2,0x801
800bdec: 38 42 87 bc ori r2,r2,0x87bc
800bdf0: 28 41 00 28 lw r1,(r2+40)
800bdf4: 55 a1 00 2f bgu r13,r1,800beb0 <rtems_bdbuf_set_block_size+0x108><== NEVER TAKEN
return 0;
bufs_per_size = ((size - 1) / bdbuf_config.buffer_min) + 1;
800bdf8: 28 42 00 24 lw r2,(r2+36)
800bdfc: 35 a1 ff ff addi r1,r13,-1
800be00: f8 00 2f aa calli 8017ca8 <__udivsi3>
800be04: 34 2c 00 01 addi r12,r1,1
for (bds_per_size = 1;
800be08: 34 02 00 01 mvi r2,1
800be0c: e0 00 00 05 bi 800be20 <rtems_bdbuf_set_block_size+0x78>
bds_per_size < bufs_per_size;
bds_per_size <<= 1)
800be10: b8 40 08 00 mv r1,r2
800be14: 34 02 00 01 mvi r2,1
800be18: f8 00 2e ca calli 8017940 <__ashlsi3>
800be1c: b8 20 10 00 mv r2,r1
if (size > bdbuf_config.buffer_max)
return 0;
bufs_per_size = ((size - 1) / bdbuf_config.buffer_min) + 1;
for (bds_per_size = 1;
800be20: 55 82 ff fc bgu r12,r2,800be10 <rtems_bdbuf_set_block_size+0x68>
bds_per_size < bufs_per_size;
bds_per_size <<= 1)
;
return bdbuf_cache.max_bds_per_group / bds_per_size;
800be24: 78 01 08 01 mvhi r1,0x801
800be28: 38 21 a7 74 ori r1,r1,0xa774
800be2c: 28 21 00 20 lw r1,(r1+32)
rtems_bdbuf_purge_dev (dd);
}
else
{
sc = RTEMS_INVALID_NUMBER;
800be30: 34 0c 00 0a mvi r12,10
for (bds_per_size = 1;
bds_per_size < bufs_per_size;
bds_per_size <<= 1)
;
return bdbuf_cache.max_bds_per_group / bds_per_size;
800be34: f8 00 2f 9d calli 8017ca8 <__udivsi3>
800be38: b8 20 78 00 mv r15,r1
if (block_size > 0)
{
size_t bds_per_group = rtems_bdbuf_bds_per_group (block_size);
if (bds_per_group != 0)
800be3c: 44 20 00 1d be r1,r0,800beb0 <rtems_bdbuf_set_block_size+0x108><== NEVER TAKEN
{
int block_to_media_block_shift = 0;
uint32_t media_blocks_per_block = block_size / dd->media_block_size;
800be40: 29 70 00 20 lw r16,(r11+32)
800be44: b9 a0 08 00 mv r1,r13
{
size_t bds_per_group = rtems_bdbuf_bds_per_group (block_size);
if (bds_per_group != 0)
{
int block_to_media_block_shift = 0;
800be48: 34 0c 00 00 mvi r12,0
uint32_t media_blocks_per_block = block_size / dd->media_block_size;
800be4c: ba 00 10 00 mv r2,r16
800be50: f8 00 2f 96 calli 8017ca8 <__udivsi3>
800be54: b8 20 70 00 mv r14,r1
uint32_t one = 1;
while ((one << block_to_media_block_shift) < media_blocks_per_block)
800be58: e0 00 00 02 bi 800be60 <rtems_bdbuf_set_block_size+0xb8>
{
++block_to_media_block_shift;
800be5c: 35 8c 00 01 addi r12,r12,1
{
int block_to_media_block_shift = 0;
uint32_t media_blocks_per_block = block_size / dd->media_block_size;
uint32_t one = 1;
while ((one << block_to_media_block_shift) < media_blocks_per_block)
800be60: 34 01 00 01 mvi r1,1
800be64: b9 80 10 00 mv r2,r12
800be68: f8 00 2e b6 calli 8017940 <__ashlsi3>
800be6c: 55 c1 ff fc bgu r14,r1,800be5c <rtems_bdbuf_set_block_size+0xb4>
{
++block_to_media_block_shift;
}
if ((dd->media_block_size << block_to_media_block_shift) != block_size)
800be70: ba 00 08 00 mv r1,r16
800be74: b9 80 10 00 mv r2,r12
800be78: f8 00 2e b2 calli 8017940 <__ashlsi3>
800be7c: 44 2d 00 02 be r1,r13,800be84 <rtems_bdbuf_set_block_size+0xdc><== ALWAYS TAKEN
block_to_media_block_shift = -1;
800be80: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
dd->block_size = block_size;
dd->block_count = dd->size / media_blocks_per_block;
800be84: 29 61 00 1c lw r1,(r11+28)
800be88: b9 c0 10 00 mv r2,r14
}
if ((dd->media_block_size << block_to_media_block_shift) != block_size)
block_to_media_block_shift = -1;
dd->block_size = block_size;
800be8c: 59 6d 00 24 sw (r11+36),r13
dd->block_count = dd->size / media_blocks_per_block;
800be90: f8 00 2f 86 calli 8017ca8 <__udivsi3>
800be94: 59 61 00 28 sw (r11+40),r1
dd->media_blocks_per_block = media_blocks_per_block;
dd->block_to_media_block_shift = block_to_media_block_shift;
800be98: 59 6c 00 30 sw (r11+48),r12
if ((dd->media_block_size << block_to_media_block_shift) != block_size)
block_to_media_block_shift = -1;
dd->block_size = block_size;
dd->block_count = dd->size / media_blocks_per_block;
dd->media_blocks_per_block = media_blocks_per_block;
800be9c: 59 6e 00 2c sw (r11+44),r14
dd->block_to_media_block_shift = block_to_media_block_shift;
dd->bds_per_group = bds_per_group;
800bea0: 59 6f 00 34 sw (r11+52),r15
rtems_bdbuf_purge_dev (dd);
800bea4: b9 60 08 00 mv r1,r11
800bea8: fb ff ff 44 calli 800bbb8 <rtems_bdbuf_purge_dev>
rtems_status_code
rtems_bdbuf_set_block_size (rtems_disk_device *dd,
uint32_t block_size,
bool sync)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
800beac: 34 0c 00 00 mvi r12,0
else
{
sc = RTEMS_INVALID_NUMBER;
}
rtems_bdbuf_unlock_cache ();
800beb0: fb ff f5 b6 calli 8009588 <rtems_bdbuf_unlock_cache>
return sc;
}
800beb4: b9 80 08 00 mv r1,r12
800beb8: 2b 9d 00 04 lw ra,(sp+4)
800bebc: 2b 8b 00 1c lw r11,(sp+28)
800bec0: 2b 8c 00 18 lw r12,(sp+24)
800bec4: 2b 8d 00 14 lw r13,(sp+20)
800bec8: 2b 8e 00 10 lw r14,(sp+16)
800becc: 2b 8f 00 0c lw r15,(sp+12)
800bed0: 2b 90 00 08 lw r16,(sp+8)
800bed4: 37 9c 00 1c addi sp,sp,28
800bed8: c3 a0 00 00 ret
08009358 <rtems_bdbuf_swapout_modified_processing>:
rtems_chain_control* chain,
rtems_chain_control* transfer,
bool sync_active,
bool update_timers,
uint32_t timer_delta)
{
8009358: 37 9c ff f0 addi sp,sp,-16
800935c: 5b 8b 00 10 sw (sp+16),r11
8009360: 5b 8c 00 0c sw (sp+12),r12
8009364: 5b 8d 00 08 sw (sp+8),r13
8009368: 5b 8e 00 04 sw (sp+4),r14
void rtems_bdbuf_reset_device_stats (rtems_disk_device *dd)
{
rtems_bdbuf_lock_cache ();
memset (&dd->stats, 0, sizeof(dd->stats));
rtems_bdbuf_unlock_cache ();
}
800936c: 28 47 00 00 lw r7,(r2+0)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
8009370: 34 42 00 04 addi r2,r2,4
rtems_chain_control* transfer,
bool sync_active,
bool update_timers,
uint32_t timer_delta)
{
if (!rtems_chain_is_empty (chain))
8009374: 44 e2 00 40 be r7,r2,8009474 <rtems_bdbuf_swapout_modified_processing+0x11c>
* A sync active with no valid dev means sync all.
*/
if (sync_active && (*dd_ptr == BDBUF_INVALID_DEV))
sync_all = true;
else
sync_all = false;
8009378: 34 0a 00 00 mvi r10,0
node = node->next;
/*
* A sync active with no valid dev means sync all.
*/
if (sync_active && (*dd_ptr == BDBUF_INVALID_DEV))
800937c: 44 80 00 03 be r4,r0,8009388 <rtems_bdbuf_swapout_modified_processing+0x30>
* @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,
8009380: 28 2a 00 00 lw r10,(r1+0)
8009384: 65 4a 00 00 cmpei r10,r10,0
}
static bool
rtems_bdbuf_has_buffer_waiters (void)
{
return bdbuf_cache.buffer_waiters.count;
8009388: 78 08 08 01 mvhi r8,0x801
800938c: 39 08 a7 74 ori r8,r8,0xa774
8009390: 29 0d 00 74 lw r13,(r8+116)
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
8009394: 34 0c 00 09 mvi r12,9
* 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))
8009398: 5d 40 00 06 bne r10,r0,80093b0 <rtems_bdbuf_swapout_modified_processing+0x58>
800939c: 44 8a 00 04 be r4,r10,80093ac <rtems_bdbuf_swapout_modified_processing+0x54>
80093a0: 28 29 00 00 lw r9,(r1+0)
80093a4: 28 e8 00 14 lw r8,(r7+20)
80093a8: 45 28 00 02 be r9,r8,80093b0 <rtems_bdbuf_swapout_modified_processing+0x58>
|| rtems_bdbuf_has_buffer_waiters ())
80093ac: 45 a0 00 02 be r13,r0,80093b4 <rtems_bdbuf_swapout_modified_processing+0x5c>
bd->hold_timer = 0;
80093b0: 58 e0 00 2c sw (r7+44),r0
if (bd->hold_timer)
80093b4: 28 e8 00 2c lw r8,(r7+44)
80093b8: 45 00 00 0b be r8,r0,80093e4 <rtems_bdbuf_swapout_modified_processing+0x8c>
{
if (update_timers)
80093bc: 44 a0 00 06 be r5,r0,80093d4 <rtems_bdbuf_swapout_modified_processing+0x7c>
{
if (bd->hold_timer > timer_delta)
80093c0: 50 c8 00 04 bgeu r6,r8,80093d0 <rtems_bdbuf_swapout_modified_processing+0x78>
bd->hold_timer -= timer_delta;
80093c4: c9 06 40 00 sub r8,r8,r6
80093c8: 58 e8 00 2c sw (r7+44),r8
80093cc: e0 00 00 02 bi 80093d4 <rtems_bdbuf_swapout_modified_processing+0x7c>
else
bd->hold_timer = 0;
80093d0: 58 e0 00 2c sw (r7+44),r0
}
if (bd->hold_timer)
80093d4: 28 e8 00 2c lw r8,(r7+44)
80093d8: 45 00 00 03 be r8,r0,80093e4 <rtems_bdbuf_swapout_modified_processing+0x8c>
{
node = node->next;
80093dc: 28 e7 00 00 lw r7,(r7+0)
continue;
80093e0: e0 00 00 1d bi 8009454 <rtems_bdbuf_swapout_modified_processing+0xfc>
/*
* 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)
80093e4: 28 28 00 00 lw r8,(r1+0)
80093e8: 5d 00 00 03 bne r8,r0,80093f4 <rtems_bdbuf_swapout_modified_processing+0x9c>
*dd_ptr = bd->dd;
80093ec: 28 e8 00 14 lw r8,(r7+20)
80093f0: 58 28 00 00 sw (r1+0),r8
if (bd->dd == *dd_ptr)
80093f4: 28 eb 00 14 lw r11,(r7+20)
80093f8: 28 28 00 00 lw r8,(r1+0)
80093fc: 28 e9 00 00 lw r9,(r7+0)
8009400: 5d 68 00 14 bne r11,r8,8009450 <rtems_bdbuf_swapout_modified_processing+0xf8><== NEVER TAKEN
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
8009404: 28 e8 00 04 lw r8,(r7+4)
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
8009408: 58 ec 00 20 sw (r7+32),r12
next->previous = previous;
800940c: 59 28 00 04 sw (r9+4),r8
previous->next = next;
8009410: 59 09 00 00 sw (r8+0),r9
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_TRANSFER);
rtems_chain_extract_unprotected (node);
tnode = tnode->previous;
8009414: 28 68 00 08 lw r8,(r3+8)
while (node && !rtems_chain_is_head (transfer, tnode))
8009418: e0 00 00 0b bi 8009444 <rtems_bdbuf_swapout_modified_processing+0xec>
{
rtems_bdbuf_buffer* tbd = (rtems_bdbuf_buffer*) tnode;
if (bd->block > tbd->block)
800941c: 28 eb 00 18 lw r11,(r7+24)
8009420: 29 0e 00 18 lw r14,(r8+24)
8009424: 51 cb 00 07 bgeu r14,r11,8009440 <rtems_bdbuf_swapout_modified_processing+0xe8>
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
8009428: 29 0b 00 00 lw r11,(r8+0)
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
800942c: 58 e8 00 04 sw (r7+4),r8
before_node = after_node->next;
after_node->next = the_node;
8009430: 59 07 00 00 sw (r8+0),r7
the_node->next = before_node;
8009434: 58 eb 00 00 sw (r7+0),r11
before_node->previous = the_node;
8009438: 59 67 00 04 sw (r11+4),r7
800943c: e0 00 00 05 bi 8009450 <rtems_bdbuf_swapout_modified_processing+0xf8>
{
rtems_chain_insert_unprotected (tnode, node);
node = NULL;
}
else
tnode = tnode->previous;
8009440: 29 08 00 04 lw r8,(r8+4)
rtems_chain_extract_unprotected (node);
tnode = tnode->previous;
while (node && !rtems_chain_is_head (transfer, tnode))
8009444: 44 e0 00 03 be r7,r0,8009450 <rtems_bdbuf_swapout_modified_processing+0xf8><== NEVER TAKEN
8009448: 5d 03 ff f5 bne r8,r3,800941c <rtems_bdbuf_swapout_modified_processing+0xc4>
800944c: e0 00 00 04 bi 800945c <rtems_bdbuf_swapout_modified_processing+0x104>
8009450: b9 20 38 00 mv r7,r9
if (sync_active && (*dd_ptr == BDBUF_INVALID_DEV))
sync_all = true;
else
sync_all = false;
while (!rtems_chain_is_tail (chain, node))
8009454: 5c e2 ff d1 bne r7,r2,8009398 <rtems_bdbuf_swapout_modified_processing+0x40>
8009458: e0 00 00 07 bi 8009474 <rtems_bdbuf_swapout_modified_processing+0x11c>
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
800945c: 28 68 00 00 lw r8,(r3+0)
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
8009460: 58 e3 00 04 sw (r7+4),r3
before_node = after_node->next;
after_node->next = the_node;
8009464: 58 67 00 00 sw (r3+0),r7
the_node->next = before_node;
8009468: 58 e8 00 00 sw (r7+0),r8
before_node->previous = the_node;
800946c: 59 07 00 04 sw (r8+4),r7
8009470: e3 ff ff f8 bi 8009450 <rtems_bdbuf_swapout_modified_processing+0xf8>
{
node = node->next;
}
}
}
}
8009474: 2b 8b 00 10 lw r11,(sp+16)
8009478: 2b 8c 00 0c lw r12,(sp+12)
800947c: 2b 8d 00 08 lw r13,(sp+8)
8009480: 2b 8e 00 04 lw r14,(sp+4)
8009484: 37 9c 00 10 addi sp,sp,16
8009488: c3 a0 00 00 ret
0800a260 <rtems_bdbuf_swapout_task>:
* not this.
* @return rtems_task Not used.
*/
static rtems_task
rtems_bdbuf_swapout_task (rtems_task_argument arg)
{
800a260: 37 9c ff b0 addi sp,sp,-80
800a264: 5b 8b 00 34 sw (sp+52),r11
800a268: 5b 8c 00 30 sw (sp+48),r12
800a26c: 5b 8d 00 2c sw (sp+44),r13
800a270: 5b 8e 00 28 sw (sp+40),r14
800a274: 5b 8f 00 24 sw (sp+36),r15
800a278: 5b 90 00 20 sw (sp+32),r16
800a27c: 5b 91 00 1c sw (sp+28),r17
800a280: 5b 92 00 18 sw (sp+24),r18
800a284: 5b 93 00 14 sw (sp+20),r19
800a288: 5b 94 00 10 sw (sp+16),r20
800a28c: 5b 95 00 0c sw (sp+12),r21
800a290: 5b 96 00 08 sw (sp+8),r22
800a294: 5b 9d 00 04 sw (sp+4),ra
rtems_bdbuf_swapout_transfer transfer;
uint32_t period_in_ticks;
const uint32_t period_in_msecs = bdbuf_config.swapout_period;
800a298: 78 0b 08 01 mvhi r11,0x801
800a29c: 39 6b 87 bc ori r11,r11,0x87bc
800a2a0: 29 73 00 0c lw r19,(r11+12)
uint32_t timer_delta;
transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
800a2a4: fb ff fd 7c calli 8009894 <rtems_bdbuf_swapout_writereq_alloc>
800a2a8: 5b 81 00 4c sw (sp+76),r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
800a2ac: 37 81 00 3c addi r1,sp,60
800a2b0: 5b 81 00 38 sw (sp+56),r1
head->previous = NULL;
tail->previous = head;
800a2b4: 37 81 00 38 addi r1,sp,56
800a2b8: 5b 81 00 40 sw (sp+64),r1
transfer.syncing = false;
/*
* Localise the period.
*/
period_in_ticks = RTEMS_MICROSECONDS_TO_TICKS (period_in_msecs * 1000);
800a2bc: 34 02 03 e8 mvi r2,1000
800a2c0: ba 60 08 00 mv r1,r19
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
800a2c4: 5b 80 00 3c sw (sp+60),r0
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;
800a2c8: 5b 80 00 44 sw (sp+68),r0
transfer.syncing = false;
800a2cc: 33 80 00 48 sb (sp+72),r0
/*
* Localise the period.
*/
period_in_ticks = RTEMS_MICROSECONDS_TO_TICKS (period_in_msecs * 1000);
800a2d0: f8 00 36 11 calli 8017b14 <__mulsi3>
800a2d4: 78 02 08 01 mvhi r2,0x801
800a2d8: 38 42 87 ec ori r2,r2,0x87ec
800a2dc: 28 42 00 0c lw r2,(r2+12)
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
800a2e0: 78 0c 08 01 mvhi r12,0x801
the_node->next = tail;
800a2e4: 78 0f 08 01 mvhi r15,0x801
800a2e8: f8 00 36 70 calli 8017ca8 <__udivsi3>
800a2ec: b8 20 b0 00 mv r22,r1
rtems_bdbuf_swapout_workers_open (void)
{
rtems_status_code sc;
size_t w;
rtems_bdbuf_lock_cache ();
800a2f0: fb ff fc 7a calli 80094d8 <rtems_bdbuf_lock_cache>
worker->transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
rtems_chain_initialize_empty (&worker->transfer.bds);
worker->transfer.dd = BDBUF_INVALID_DEV;
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'D', 'o', 'a' + w),
800a2f4: 78 01 08 01 mvhi r1,0x801
800a2f8: 38 21 8c b4 ori r1,r1,0x8cb4
800a2fc: 78 0e 08 00 mvhi r14,0x800
rtems_status_code sc;
size_t w;
rtems_bdbuf_lock_cache ();
for (w = 0; w < bdbuf_config.swapout_workers; w++)
800a300: 34 0d 00 00 mvi r13,0
800a304: b9 60 80 00 mv r16,r11
800a308: 29 74 00 14 lw r20,(r11+20)
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
800a30c: 39 8c a7 74 ori r12,r12,0xa774
the_node->next = tail;
800a310: 39 ef a7 80 ori r15,r15,0xa780
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;
800a314: 34 12 00 01 mvi r18,1
worker->transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
rtems_chain_initialize_empty (&worker->transfer.bds);
worker->transfer.dd = BDBUF_INVALID_DEV;
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'D', 'o', 'a' + w),
800a318: 28 31 00 00 lw r17,(r1+0)
800a31c: 39 ce a5 a4 ori r14,r14,0xa5a4
800a320: e0 00 00 20 bi 800a3a0 <rtems_bdbuf_swapout_task+0x140>
for (w = 0; w < bdbuf_config.swapout_workers; w++)
{
rtems_bdbuf_swapout_worker* worker;
worker = malloc (sizeof (rtems_bdbuf_swapout_worker));
800a324: 34 01 00 28 mvi r1,40 <== NOT EXECUTED
800a328: fb ff e3 08 calli 8002f48 <malloc> <== NOT EXECUTED
800a32c: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
if (!worker)
800a330: 5c 20 00 03 bne r1,r0,800a33c <rtems_bdbuf_swapout_task+0xdc><== NOT EXECUTED
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WK_NOMEM);
800a334: 34 01 00 0a mvi r1,10 <== NOT EXECUTED
800a338: fb ff fc 55 calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
800a33c: 29 81 00 10 lw r1,(r12+16) <== NOT EXECUTED
the_node->next = tail;
800a340: 59 6f 00 00 sw (r11+0),r15 <== NOT EXECUTED
tail->previous = the_node;
800a344: 59 8b 00 10 sw (r12+16),r11 <== NOT EXECUTED
old_last->next = the_node;
800a348: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
the_node->previous = old_last;
800a34c: 59 61 00 04 sw (r11+4),r1 <== NOT EXECUTED
rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
worker->enabled = true;
800a350: 31 72 00 0c sb (r11+12),r18 <== NOT EXECUTED
worker->transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
800a354: fb ff fd 50 calli 8009894 <rtems_bdbuf_swapout_writereq_alloc><== NOT EXECUTED
800a358: 59 61 00 24 sw (r11+36),r1 <== 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 );
800a35c: 35 61 00 14 addi r1,r11,20 <== 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),
800a360: 35 a2 00 61 addi r2,r13,97 <== NOT EXECUTED
head->next = tail;
800a364: 59 61 00 10 sw (r11+16),r1 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
800a368: 35 61 00 10 addi r1,r11,16 <== NOT EXECUTED
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
800a36c: 59 61 00 18 sw (r11+24),r1 <== NOT EXECUTED
800a370: b8 51 08 00 or r1,r2,r17 <== NOT EXECUTED
800a374: 2a 02 00 18 lw r2,(r16+24) <== NOT EXECUTED
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
800a378: 59 60 00 14 sw (r11+20),r0 <== 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;
800a37c: 59 60 00 1c sw (r11+28),r0 <== NOT EXECUTED
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'D', 'o', 'a' + w),
800a380: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
800a384: b9 60 20 00 mv r4,r11 <== NOT EXECUTED
800a388: 35 65 00 08 addi r5,r11,8 <== NOT EXECUTED
800a38c: fb ff fd 89 calli 80099b0 <rtems_bdbuf_create_task.clone.11><== 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)
800a390: 44 20 00 03 be r1,r0,800a39c <rtems_bdbuf_swapout_task+0x13c><== NOT EXECUTED
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WK_CREATE);
800a394: 34 01 00 0d mvi r1,13 <== NOT EXECUTED
800a398: fb ff fc 3d calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
rtems_status_code sc;
size_t w;
rtems_bdbuf_lock_cache ();
for (w = 0; w < bdbuf_config.swapout_workers; w++)
800a39c: 35 ad 00 01 addi r13,r13,1 <== NOT EXECUTED
800a3a0: 56 8d ff e1 bgu r20,r13,800a324 <rtems_bdbuf_swapout_task+0xc4><== NEVER TAKEN
/*
* Create the worker threads.
*/
rtems_bdbuf_swapout_workers_open ();
while (bdbuf_cache.swapout_enabled)
800a3a4: 78 0c 08 01 mvhi r12,0x801
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
800a3a8: 78 12 08 01 mvhi r18,0x801
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;
800a3ac: 78 11 08 01 mvhi r17,0x801
/*
* 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,
800a3b0: 78 10 08 01 mvhi r16,0x801
timer_delta);
/*
* Process the cache's modified list.
*/
rtems_bdbuf_swapout_modified_processing (&transfer->dd,
800a3b4: 78 0f 08 01 mvhi r15,0x801
&worker->id);
if (sc != RTEMS_SUCCESSFUL)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WK_CREATE);
}
rtems_bdbuf_unlock_cache ();
800a3b8: fb ff fc 74 calli 8009588 <rtems_bdbuf_unlock_cache>
/*
* Create the worker threads.
*/
rtems_bdbuf_swapout_workers_open ();
while (bdbuf_cache.swapout_enabled)
800a3bc: 39 8c a7 74 ori r12,r12,0xa774
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
800a3c0: 3a 52 a7 80 ori r18,r18,0xa780
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;
800a3c4: 3a 31 a7 7c ori r17,r17,0xa77c
/*
* 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,
800a3c8: 3a 10 a7 cc ori r16,r16,0xa7cc
timer_delta);
/*
* Process the cache's modified list.
*/
rtems_bdbuf_swapout_modified_processing (&transfer->dd,
800a3cc: 39 ef a7 c0 ori r15,r15,0xa7c0
/*
* Create the worker threads.
*/
rtems_bdbuf_swapout_workers_open ();
while (bdbuf_cache.swapout_enabled)
800a3d0: e0 00 00 52 bi 800a518 <rtems_bdbuf_swapout_task+0x2b8>
/*
* 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,
800a3d4: 34 0e 00 00 mvi r14,0
rtems_bdbuf_swapout_transfer* transfer)
{
rtems_bdbuf_swapout_worker* worker;
bool transfered_buffers = false;
rtems_bdbuf_lock_cache ();
800a3d8: fb ff fc 40 calli 80094d8 <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)
800a3dc: 41 84 00 30 lbu r4,(r12+48)
worker = NULL;
800a3e0: 34 0d 00 00 mvi r13,0
/*
* 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,
800a3e4: 37 8b 00 38 addi r11,sp,56
* 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)
800a3e8: 5c 80 00 0b bne r4,r0,800a414 <rtems_bdbuf_swapout_task+0x1b4>
void rtems_bdbuf_reset_device_stats (rtems_disk_device *dd)
{
rtems_bdbuf_lock_cache ();
memset (&dd->stats, 0, sizeof(dd->stats));
rtems_bdbuf_unlock_cache ();
}
800a3ec: 29 8d 00 08 lw r13,(r12+8)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
800a3f0: 45 b2 00 07 be r13,r18,800a40c <rtems_bdbuf_swapout_task+0x1ac><== ALWAYS TAKEN
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
800a3f4: 29 a2 00 00 lw r2,(r13+0) <== NOT EXECUTED
else
{
worker = (rtems_bdbuf_swapout_worker*)
rtems_chain_get_unprotected (&bdbuf_cache.swapout_workers);
if (worker)
transfer = &worker->transfer;
800a3f8: 35 ab 00 10 addi r11,r13,16 <== NOT EXECUTED
head->next = new_first;
800a3fc: 59 82 00 08 sw (r12+8),r2 <== NOT EXECUTED
new_first->previous = head;
800a400: 58 51 00 04 sw (r2+4),r17 <== NOT EXECUTED
worker = NULL;
else
{
worker = (rtems_bdbuf_swapout_worker*)
rtems_chain_get_unprotected (&bdbuf_cache.swapout_workers);
if (worker)
800a404: 5d a0 00 04 bne r13,r0,800a414 <rtems_bdbuf_swapout_task+0x1b4><== NOT EXECUTED
800a408: e0 00 00 02 bi 800a410 <rtems_bdbuf_swapout_task+0x1b0> <== NOT EXECUTED
800a40c: b8 80 68 00 mv r13,r4
/*
* 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,
800a410: 37 8b 00 38 addi r11,sp,56
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 );
800a414: 35 74 00 04 addi r20,r11,4
head->next = tail;
800a418: 59 74 00 00 sw (r11+0),r20
head->previous = NULL;
800a41c: 59 60 00 04 sw (r11+4),r0
tail->previous = head;
800a420: 59 6b 00 08 sw (r11+8),r11
if (worker)
transfer = &worker->transfer;
}
rtems_chain_initialize_empty (&transfer->bds);
transfer->dd = BDBUF_INVALID_DEV;
800a424: 59 60 00 0c sw (r11+12),r0
transfer->syncing = bdbuf_cache.sync_active;
800a428: 31 64 00 10 sb (r11+16),r4
/*
* When the sync is for a device limit the sync to that device. If the sync
* is for a buffer handle process the devices in the order on the sync
* list. This means the dev is BDBUF_INVALID_DEV.
*/
if (bdbuf_cache.sync_active)
800a42c: 44 80 00 03 be r4,r0,800a438 <rtems_bdbuf_swapout_task+0x1d8>
transfer->dd = bdbuf_cache.sync_device;
800a430: 29 81 00 38 lw r1,(r12+56)
800a434: 59 61 00 0c sw (r11+12),r1
/*
* 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,
800a438: 35 75 00 0c addi r21,r11,12
800a43c: ba a0 08 00 mv r1,r21
800a440: ba 00 10 00 mv r2,r16
800a444: b9 60 18 00 mv r3,r11
800a448: 34 04 00 01 mvi r4,1
800a44c: 34 05 00 00 mvi r5,0
800a450: ba 60 30 00 mv r6,r19
800a454: fb ff fb c1 calli 8009358 <rtems_bdbuf_swapout_modified_processing>
timer_delta);
/*
* Process the cache's modified list.
*/
rtems_bdbuf_swapout_modified_processing (&transfer->dd,
800a458: 41 84 00 30 lbu r4,(r12+48)
800a45c: ba a0 08 00 mv r1,r21
800a460: b9 c0 28 00 mv r5,r14
800a464: b9 e0 10 00 mv r2,r15
800a468: b9 60 18 00 mv r3,r11
800a46c: ba 60 30 00 mv r6,r19
800a470: fb ff fb ba calli 8009358 <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 ();
800a474: fb ff fc 45 calli 8009588 <rtems_bdbuf_unlock_cache>
/*
* If there are buffers to transfer to the media transfer them.
*/
if (!rtems_chain_is_empty (&transfer->bds))
800a478: 29 61 00 00 lw r1,(r11+0)
rtems_bdbuf_swapout_processing (unsigned long timer_delta,
bool update_timers,
rtems_bdbuf_swapout_transfer* transfer)
{
rtems_bdbuf_swapout_worker* worker;
bool transfered_buffers = false;
800a47c: 34 0e 00 00 mvi r14,0
rtems_bdbuf_unlock_cache ();
/*
* If there are buffers to transfer to the media transfer them.
*/
if (!rtems_chain_is_empty (&transfer->bds))
800a480: 44 34 00 0d be r1,r20,800a4b4 <rtems_bdbuf_swapout_task+0x254>
{
if (worker)
800a484: 45 a0 00 09 be r13,r0,800a4a8 <rtems_bdbuf_swapout_task+0x248><== ALWAYS TAKEN
{
rtems_status_code sc = rtems_event_send (worker->id,
800a488: 29 a1 00 08 lw r1,(r13+8) <== NOT EXECUTED
800a48c: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
else
{
rtems_bdbuf_swapout_write (transfer);
}
transfered_buffers = true;
800a490: 34 0e 00 01 mvi r14,1 <== NOT EXECUTED
*/
if (!rtems_chain_is_empty (&transfer->bds))
{
if (worker)
{
rtems_status_code sc = rtems_event_send (worker->id,
800a494: f8 00 10 20 calli 800e514 <rtems_event_send> <== NOT EXECUTED
RTEMS_BDBUF_SWAPOUT_SYNC);
if (sc != RTEMS_SUCCESSFUL)
800a498: 44 20 00 07 be r1,r0,800a4b4 <rtems_bdbuf_swapout_task+0x254><== NOT EXECUTED
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WAKE_2);
800a49c: 34 01 00 0c mvi r1,12 <== NOT EXECUTED
800a4a0: fb ff fb fb calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
800a4a4: e0 00 00 04 bi 800a4b4 <rtems_bdbuf_swapout_task+0x254> <== NOT EXECUTED
}
else
{
rtems_bdbuf_swapout_write (transfer);
800a4a8: b9 60 08 00 mv r1,r11
800a4ac: fb ff ff 00 calli 800a0ac <rtems_bdbuf_swapout_write>
}
transfered_buffers = true;
800a4b0: 34 0e 00 01 mvi r14,1
}
if (bdbuf_cache.sync_active && !transfered_buffers)
800a4b4: 41 82 00 30 lbu r2,(r12+48)
800a4b8: 44 40 00 0c be r2,r0,800a4e8 <rtems_bdbuf_swapout_task+0x288>
800a4bc: 5d c0 ff c6 bne r14,r0,800a3d4 <rtems_bdbuf_swapout_task+0x174>
{
rtems_id sync_requester;
rtems_bdbuf_lock_cache ();
800a4c0: fb ff fc 06 calli 80094d8 <rtems_bdbuf_lock_cache>
sync_requester = bdbuf_cache.sync_requester;
800a4c4: 29 8b 00 34 lw r11,(r12+52)
bdbuf_cache.sync_active = false;
800a4c8: 31 80 00 30 sb (r12+48),r0
bdbuf_cache.sync_requester = 0;
800a4cc: 59 80 00 34 sw (r12+52),r0
rtems_bdbuf_unlock_cache ();
800a4d0: fb ff fc 2e calli 8009588 <rtems_bdbuf_unlock_cache>
if (sync_requester)
800a4d4: 45 6e 00 06 be r11,r14,800a4ec <rtems_bdbuf_swapout_task+0x28c><== NEVER TAKEN
800a4d8: b9 60 08 00 mv r1,r11
800a4dc: 78 02 80 00 mvhi r2,0x8000
800a4e0: fb ff eb 21 calli 8005164 <rtems_event_system_send>
800a4e4: e0 00 00 02 bi 800a4ec <rtems_bdbuf_swapout_task+0x28c>
/*
* 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,
800a4e8: 5d c2 ff bb bne r14,r2,800a3d4 <rtems_bdbuf_swapout_task+0x174>
*/
update_timers = false;
}
while (transfered_buffers);
sc = rtems_event_receive (RTEMS_BDBUF_SWAPOUT_SYNC,
800a4ec: 34 02 00 00 mvi r2,0
800a4f0: 34 01 00 04 mvi r1,4
800a4f4: ba c0 18 00 mv r3,r22
800a4f8: 37 84 00 50 addi r4,sp,80
800a4fc: f8 00 0f a0 calli 800e37c <rtems_event_receive>
RTEMS_EVENT_ALL | RTEMS_WAIT,
period_in_ticks,
&out);
if ((sc != RTEMS_SUCCESSFUL) && (sc != RTEMS_TIMEOUT))
800a500: 7c 22 00 06 cmpnei r2,r1,6
800a504: 7c 21 00 00 cmpnei r1,r1,0
800a508: a0 41 08 00 and r1,r2,r1
800a50c: 44 20 00 03 be r1,r0,800a518 <rtems_bdbuf_swapout_task+0x2b8><== ALWAYS TAKEN
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SWAPOUT_RE);
800a510: 34 01 00 18 mvi r1,24 <== NOT EXECUTED
800a514: fb ff fb de calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
/*
* Create the worker threads.
*/
rtems_bdbuf_swapout_workers_open ();
while (bdbuf_cache.swapout_enabled)
800a518: 41 81 00 04 lbu r1,(r12+4)
800a51c: 44 20 00 03 be r1,r0,800a528 <rtems_bdbuf_swapout_task+0x2c8><== NEVER TAKEN
800a520: 34 0e 00 01 mvi r14,1
800a524: e3 ff ff ad bi 800a3d8 <rtems_bdbuf_swapout_task+0x178>
static void
rtems_bdbuf_swapout_workers_close (void)
{
rtems_chain_node* node;
rtems_bdbuf_lock_cache ();
800a528: fb ff fb ec calli 80094d8 <rtems_bdbuf_lock_cache> <== NOT EXECUTED
void rtems_bdbuf_reset_device_stats (rtems_disk_device *dd)
{
rtems_bdbuf_lock_cache ();
memset (&dd->stats, 0, sizeof(dd->stats));
rtems_bdbuf_unlock_cache ();
}
800a52c: 29 8b 00 08 lw r11,(r12+8) <== 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))
800a530: 78 0c 08 01 mvhi r12,0x801 <== NOT EXECUTED
800a534: 39 8c a7 80 ori r12,r12,0xa780 <== NOT EXECUTED
800a538: e0 00 00 06 bi 800a550 <rtems_bdbuf_swapout_task+0x2f0> <== NOT EXECUTED
{
rtems_bdbuf_swapout_worker* worker = (rtems_bdbuf_swapout_worker*) node;
worker->enabled = false;
rtems_event_send (worker->id, RTEMS_BDBUF_SWAPOUT_SYNC);
800a53c: 29 61 00 08 lw r1,(r11+8) <== NOT EXECUTED
node = rtems_chain_first (&bdbuf_cache.swapout_workers);
while (!rtems_chain_is_tail (&bdbuf_cache.swapout_workers, node))
{
rtems_bdbuf_swapout_worker* worker = (rtems_bdbuf_swapout_worker*) node;
worker->enabled = false;
800a540: 31 60 00 0c sb (r11+12),r0 <== NOT EXECUTED
rtems_event_send (worker->id, RTEMS_BDBUF_SWAPOUT_SYNC);
800a544: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
800a548: f8 00 0f f3 calli 800e514 <rtems_event_send> <== NOT EXECUTED
void rtems_bdbuf_reset_device_stats (rtems_disk_device *dd)
{
rtems_bdbuf_lock_cache ();
memset (&dd->stats, 0, sizeof(dd->stats));
rtems_bdbuf_unlock_cache ();
}
800a54c: 29 6b 00 00 lw r11,(r11+0) <== 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))
800a550: 5d 6c ff fb bne r11,r12,800a53c <rtems_bdbuf_swapout_task+0x2dc><== NOT EXECUTED
worker->enabled = false;
rtems_event_send (worker->id, RTEMS_BDBUF_SWAPOUT_SYNC);
node = rtems_chain_next (node);
}
rtems_bdbuf_unlock_cache ();
800a554: fb ff fc 0d calli 8009588 <rtems_bdbuf_unlock_cache> <== NOT EXECUTED
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SWAPOUT_RE);
}
rtems_bdbuf_swapout_workers_close ();
free (transfer.write_req);
800a558: 2b 81 00 4c lw r1,(sp+76) <== NOT EXECUTED
800a55c: fb ff e0 ed calli 8002910 <free> <== NOT EXECUTED
rtems_task_delete (RTEMS_SELF);
800a560: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
800a564: f8 00 11 67 calli 800eb00 <rtems_task_delete> <== NOT EXECUTED
}
800a568: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
800a56c: 2b 8b 00 34 lw r11,(sp+52) <== NOT EXECUTED
800a570: 2b 8c 00 30 lw r12,(sp+48) <== NOT EXECUTED
800a574: 2b 8d 00 2c lw r13,(sp+44) <== NOT EXECUTED
800a578: 2b 8e 00 28 lw r14,(sp+40) <== NOT EXECUTED
800a57c: 2b 8f 00 24 lw r15,(sp+36) <== NOT EXECUTED
800a580: 2b 90 00 20 lw r16,(sp+32) <== NOT EXECUTED
800a584: 2b 91 00 1c lw r17,(sp+28) <== NOT EXECUTED
800a588: 2b 92 00 18 lw r18,(sp+24) <== NOT EXECUTED
800a58c: 2b 93 00 14 lw r19,(sp+20) <== NOT EXECUTED
800a590: 2b 94 00 10 lw r20,(sp+16) <== NOT EXECUTED
800a594: 2b 95 00 0c lw r21,(sp+12) <== NOT EXECUTED
800a598: 2b 96 00 08 lw r22,(sp+8) <== NOT EXECUTED
800a59c: 37 9c 00 50 addi sp,sp,80 <== NOT EXECUTED
800a5a0: c3 a0 00 00 ret <== NOT EXECUTED
0800a5a4 <rtems_bdbuf_swapout_worker_task>:
* @param arg A pointer to the worker thread's private data.
* @return rtems_task Not used.
*/
static rtems_task
rtems_bdbuf_swapout_worker_task (rtems_task_argument arg)
{
800a5a4: 37 9c ff e8 addi sp,sp,-24 <== NOT EXECUTED
800a5a8: 5b 8b 00 18 sw (sp+24),r11 <== NOT EXECUTED
800a5ac: 5b 8c 00 14 sw (sp+20),r12 <== NOT EXECUTED
800a5b0: 5b 8d 00 10 sw (sp+16),r13 <== NOT EXECUTED
800a5b4: 5b 8e 00 0c sw (sp+12),r14 <== NOT EXECUTED
800a5b8: 5b 8f 00 08 sw (sp+8),r15 <== NOT EXECUTED
800a5bc: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
800a5c0: 78 0c 08 01 mvhi r12,0x801 <== NOT EXECUTED
the_node->next = tail;
800a5c4: 78 0d 08 01 mvhi r13,0x801 <== NOT EXECUTED
800a5c8: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
while (worker->enabled)
{
rtems_bdbuf_wait_for_event (RTEMS_BDBUF_SWAPOUT_SYNC);
rtems_bdbuf_swapout_write (&worker->transfer);
800a5cc: 34 2e 00 10 addi r14,r1,16 <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
800a5d0: 34 2f 00 14 addi r15,r1,20 <== NOT EXECUTED
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
800a5d4: 39 8c a7 74 ori r12,r12,0xa774 <== NOT EXECUTED
the_node->next = tail;
800a5d8: 39 ad a7 80 ori r13,r13,0xa780 <== 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)
800a5dc: e0 00 00 10 bi 800a61c <rtems_bdbuf_swapout_worker_task+0x78><== NOT EXECUTED
{
rtems_bdbuf_wait_for_event (RTEMS_BDBUF_SWAPOUT_SYNC);
800a5e0: 34 01 00 04 mvi r1,4 <== NOT EXECUTED
800a5e4: fb ff fc 9a calli 800984c <rtems_bdbuf_wait_for_event> <== NOT EXECUTED
rtems_bdbuf_swapout_write (&worker->transfer);
800a5e8: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
800a5ec: fb ff fe b0 calli 800a0ac <rtems_bdbuf_swapout_write> <== NOT EXECUTED
rtems_bdbuf_lock_cache ();
800a5f0: fb ff fb ba calli 80094d8 <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;
800a5f4: 29 81 00 10 lw r1,(r12+16) <== NOT EXECUTED
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
800a5f8: 59 6f 00 10 sw (r11+16),r15 <== NOT EXECUTED
rtems_chain_initialize_empty (&worker->transfer.bds);
worker->transfer.dd = BDBUF_INVALID_DEV;
800a5fc: 59 60 00 1c sw (r11+28),r0 <== NOT EXECUTED
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
800a600: 59 6d 00 00 sw (r11+0),r13 <== NOT EXECUTED
tail->previous = the_node;
800a604: 59 8b 00 10 sw (r12+16),r11 <== NOT EXECUTED
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
800a608: 59 60 00 14 sw (r11+20),r0 <== NOT EXECUTED
tail->previous = head;
800a60c: 59 6e 00 18 sw (r11+24),r14 <== 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;
800a610: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
the_node->previous = old_last;
800a614: 59 61 00 04 sw (r11+4),r1 <== NOT EXECUTED
rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
rtems_bdbuf_unlock_cache ();
800a618: fb ff fb dc calli 8009588 <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)
800a61c: 41 61 00 0c lbu r1,(r11+12) <== NOT EXECUTED
800a620: 5c 20 ff f0 bne r1,r0,800a5e0 <rtems_bdbuf_swapout_worker_task+0x3c><== NOT EXECUTED
rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
rtems_bdbuf_unlock_cache ();
}
free (worker->transfer.write_req);
800a624: 29 61 00 24 lw r1,(r11+36) <== NOT EXECUTED
800a628: fb ff e0 ba calli 8002910 <free> <== NOT EXECUTED
free (worker);
800a62c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800a630: fb ff e0 b8 calli 8002910 <free> <== NOT EXECUTED
rtems_task_delete (RTEMS_SELF);
800a634: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
800a638: f8 00 11 32 calli 800eb00 <rtems_task_delete> <== NOT EXECUTED
}
800a63c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
800a640: 2b 8b 00 18 lw r11,(sp+24) <== NOT EXECUTED
800a644: 2b 8c 00 14 lw r12,(sp+20) <== NOT EXECUTED
800a648: 2b 8d 00 10 lw r13,(sp+16) <== NOT EXECUTED
800a64c: 2b 8e 00 0c lw r14,(sp+12) <== NOT EXECUTED
800a650: 2b 8f 00 08 lw r15,(sp+8) <== NOT EXECUTED
800a654: 37 9c 00 18 addi sp,sp,24 <== NOT EXECUTED
800a658: c3 a0 00 00 ret <== NOT EXECUTED
0800a0ac <rtems_bdbuf_swapout_write>:
*
* @param transfer The transfer transaction.
*/
static void
rtems_bdbuf_swapout_write (rtems_bdbuf_swapout_transfer* transfer)
{
800a0ac: 37 9c ff d0 addi sp,sp,-48
800a0b0: 5b 8b 00 30 sw (sp+48),r11
800a0b4: 5b 8c 00 2c sw (sp+44),r12
800a0b8: 5b 8d 00 28 sw (sp+40),r13
800a0bc: 5b 8e 00 24 sw (sp+36),r14
800a0c0: 5b 8f 00 20 sw (sp+32),r15
800a0c4: 5b 90 00 1c sw (sp+28),r16
800a0c8: 5b 91 00 18 sw (sp+24),r17
800a0cc: 5b 92 00 14 sw (sp+20),r18
800a0d0: 5b 93 00 10 sw (sp+16),r19
800a0d4: 5b 94 00 0c sw (sp+12),r20
800a0d8: 5b 95 00 08 sw (sp+8),r21
800a0dc: 5b 9d 00 04 sw (sp+4),ra
800a0e0: b8 20 58 00 mv r11,r1
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
800a0e4: 34 2f 00 04 addi r15,r1,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))
800a0e8: 28 21 00 00 lw r1,(r1+0)
800a0ec: 44 2f 00 4f be r1,r15,800a228 <rtems_bdbuf_swapout_write+0x17c><== NEVER TAKEN
* 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;
800a0f0: 29 6d 00 0c lw r13,(r11+12)
* should be possible to make this change with little effect in this
* code. The array that is passed is broken in design and should be
* removed. Merging members of a struct into the first member is
* trouble waiting to happen.
*/
transfer->write_req->status = RTEMS_RESOURCE_IN_USE;
800a0f4: 34 02 00 0c mvi r2,12
* 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))
800a0f8: 78 0e 08 01 mvhi r14,0x801
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;
800a0fc: 29 a1 00 08 lw r1,(r13+8)
* 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;
800a100: 29 b5 00 2c lw r21,(r13+44)
{
/*
* The last block number used when the driver only supports
* continuous blocks in a single request.
*/
uint32_t last_block = 0;
800a104: 34 10 00 00 mvi r16,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;
800a108: 28 34 00 0c lw r20,(r1+12)
* should be possible to make this change with little effect in this
* code. The array that is passed is broken in design and should be
* removed. Merging members of a struct into the first member is
* trouble waiting to happen.
*/
transfer->write_req->status = RTEMS_RESOURCE_IN_USE;
800a10c: 29 61 00 14 lw r1,(r11+20)
if (write)
{
rtems_bdbuf_execute_transfer_request (dd, transfer->write_req, false);
transfer->write_req->status = RTEMS_RESOURCE_IN_USE;
800a110: 34 13 00 0c mvi r19,12
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;
800a114: 22 94 00 01 andi r20,r20,0x1
* 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;
800a118: 58 22 00 0c sw (r1+12),r2
transfer->write_req->bufnum = 0;
800a11c: 58 20 00 10 sw (r1+16),r0
* 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))
800a120: 39 ce 87 bc ori r14,r14,0x87bc
* trouble waiting to happen.
*/
transfer->write_req->status = RTEMS_RESOURCE_IN_USE;
transfer->write_req->bufnum = 0;
while ((node = rtems_chain_get_unprotected(&transfer->bds)) != NULL)
800a124: e0 00 00 30 bi 800a1e4 <rtems_bdbuf_swapout_write+0x138>
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 &&
800a128: 29 62 00 14 lw r2,(r11+20)
800a12c: 28 42 00 10 lw r2,(r2+16)
800a130: 44 40 00 0a be r2,r0,800a158 <rtems_bdbuf_swapout_write+0xac>
800a134: 29 83 00 18 lw r3,(r12+24)
bd->block != last_block + media_blocks_per_block)
800a138: b6 15 10 00 add r2,r16,r21
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 &&
800a13c: 44 62 00 07 be r3,r2,800a158 <rtems_bdbuf_swapout_write+0xac>
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
800a140: 59 8b 00 04 sw (r12+4),r11
before_node = after_node->next;
after_node->next = the_node;
800a144: 59 6c 00 00 sw (r11+0),r12
the_node->next = before_node;
800a148: 59 81 00 00 sw (r12+0),r1
before_node->previous = the_node;
800a14c: 58 2c 00 04 sw (r1+4),r12
bd->block != last_block + media_blocks_per_block)
{
rtems_chain_prepend_unprotected (&transfer->bds, &bd->link);
write = true;
800a150: 34 01 00 01 mvi r1,1
800a154: e0 00 00 16 bi 800a1ac <rtems_bdbuf_swapout_write+0x100>
}
else
{
rtems_blkdev_sg_buffer* buf;
buf = &transfer->write_req->bufs[transfer->write_req->bufnum];
800a158: 29 70 00 14 lw r16,(r11+20)
transfer->write_req->bufnum++;
buf->user = bd;
800a15c: 34 02 00 04 mvi r2,4
write = true;
}
else
{
rtems_blkdev_sg_buffer* buf;
buf = &transfer->write_req->bufs[transfer->write_req->bufnum];
800a160: 2a 11 00 10 lw r17,(r16+16)
transfer->write_req->bufnum++;
800a164: 36 21 00 01 addi r1,r17,1
800a168: 5a 01 00 10 sw (r16+16),r1
buf->user = bd;
800a16c: 36 21 00 02 addi r1,r17,2
800a170: f8 00 35 f4 calli 8017940 <__ashlsi3>
800a174: b6 01 90 00 add r18,r16,r1
800a178: 5a 4c 00 04 sw (r18+4),r12
buf->block = bd->block;
800a17c: ba 20 08 00 mv r1,r17
800a180: 34 02 00 04 mvi r2,4
800a184: f8 00 35 ef calli 8017940 <__ashlsi3>
800a188: b6 01 80 00 add r16,r16,r1
800a18c: 29 81 00 18 lw r1,(r12+24)
800a190: 5a 01 00 18 sw (r16+24),r1
buf->length = dd->block_size;
800a194: 29 a1 00 24 lw r1,(r13+36)
800a198: 5a 01 00 1c sw (r16+28),r1
buf->buffer = bd->buffer;
800a19c: 29 81 00 1c lw r1,(r12+28)
last_block = bd->block;
800a1a0: 29 90 00 18 lw r16,(r12+24)
buf = &transfer->write_req->bufs[transfer->write_req->bufnum];
transfer->write_req->bufnum++;
buf->user = bd;
buf->block = bd->block;
buf->length = dd->block_size;
buf->buffer = bd->buffer;
800a1a4: 5a 41 00 00 sw (r18+0),r1
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;
800a1a8: 34 01 00 00 mvi r1,0
/*
* Perform the transfer if there are no more buffers, or the transfer
* size has reached the configured max. value.
*/
if (rtems_chain_is_empty (&transfer->bds) ||
800a1ac: 29 62 00 00 lw r2,(r11+0)
800a1b0: 44 4f 00 06 be r2,r15,800a1c8 <rtems_bdbuf_swapout_write+0x11c>
(transfer->write_req->bufnum >= bdbuf_config.max_write_blocks))
800a1b4: 29 62 00 14 lw r2,(r11+20)
/*
* Perform the transfer if there are no more buffers, or the transfer
* size has reached the configured max. value.
*/
if (rtems_chain_is_empty (&transfer->bds) ||
800a1b8: 29 c3 00 04 lw r3,(r14+4)
800a1bc: 28 42 00 10 lw r2,(r2+16)
800a1c0: 50 43 00 02 bgeu r2,r3,800a1c8 <rtems_bdbuf_swapout_write+0x11c>
(transfer->write_req->bufnum >= bdbuf_config.max_write_blocks))
write = true;
if (write)
800a1c4: 44 20 00 08 be r1,r0,800a1e4 <rtems_bdbuf_swapout_write+0x138>
{
rtems_bdbuf_execute_transfer_request (dd, transfer->write_req, false);
800a1c8: 29 62 00 14 lw r2,(r11+20)
800a1cc: b9 a0 08 00 mv r1,r13
800a1d0: 34 03 00 00 mvi r3,0
800a1d4: fb ff ff 42 calli 8009edc <rtems_bdbuf_execute_transfer_request>
transfer->write_req->status = RTEMS_RESOURCE_IN_USE;
800a1d8: 29 61 00 14 lw r1,(r11+20)
800a1dc: 58 33 00 0c sw (r1+12),r19
transfer->write_req->bufnum = 0;
800a1e0: 58 20 00 10 sw (r1+16),r0
void rtems_bdbuf_reset_device_stats (rtems_disk_device *dd)
{
rtems_bdbuf_lock_cache ();
memset (&dd->stats, 0, sizeof(dd->stats));
rtems_bdbuf_unlock_cache ();
}
800a1e4: 29 6c 00 00 lw r12,(r11+0)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
800a1e8: 45 8f 00 06 be r12,r15,800a200 <rtems_bdbuf_swapout_write+0x154>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
800a1ec: 29 81 00 00 lw r1,(r12+0)
head->next = new_first;
800a1f0: 59 61 00 00 sw (r11+0),r1
new_first->previous = head;
800a1f4: 58 2b 00 04 sw (r1+4),r11
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 &&
800a1f8: 5e 80 ff cc bne r20,r0,800a128 <rtems_bdbuf_swapout_write+0x7c>
800a1fc: e3 ff ff d7 bi 800a158 <rtems_bdbuf_swapout_write+0xac>
/*
* If sync'ing and the deivce is capability of handling a sync IO control
* call perform the call.
*/
if (transfer->syncing &&
800a200: 41 61 00 10 lbu r1,(r11+16)
800a204: 44 20 00 09 be r1,r0,800a228 <rtems_bdbuf_swapout_write+0x17c>
(dd->phys_dev->capabilities & RTEMS_BLKDEV_CAP_SYNC))
800a208: 29 a1 00 08 lw r1,(r13+8)
800a20c: 28 22 00 0c lw r2,(r1+12)
800a210: 20 42 00 02 andi r2,r2,0x2
/*
* If sync'ing and the deivce is capability of handling a sync IO control
* call perform the call.
*/
if (transfer->syncing &&
800a214: 44 40 00 05 be r2,r0,800a228 <rtems_bdbuf_swapout_write+0x17c><== ALWAYS TAKEN
(dd->phys_dev->capabilities & RTEMS_BLKDEV_CAP_SYNC))
{
/* int result = */ dd->ioctl (dd->phys_dev, RTEMS_BLKDEV_REQ_SYNC, NULL);
800a218: 29 a4 00 38 lw r4,(r13+56) <== NOT EXECUTED
800a21c: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
800a220: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
800a224: d8 80 00 00 call r4 <== NOT EXECUTED
/* How should the error be handled ? */
}
}
}
800a228: 2b 9d 00 04 lw ra,(sp+4)
800a22c: 2b 8b 00 30 lw r11,(sp+48)
800a230: 2b 8c 00 2c lw r12,(sp+44)
800a234: 2b 8d 00 28 lw r13,(sp+40)
800a238: 2b 8e 00 24 lw r14,(sp+36)
800a23c: 2b 8f 00 20 lw r15,(sp+32)
800a240: 2b 90 00 1c lw r16,(sp+28)
800a244: 2b 91 00 18 lw r17,(sp+24)
800a248: 2b 92 00 14 lw r18,(sp+20)
800a24c: 2b 93 00 10 lw r19,(sp+16)
800a250: 2b 94 00 0c lw r20,(sp+12)
800a254: 2b 95 00 08 lw r21,(sp+8)
800a258: 37 9c 00 30 addi sp,sp,48
800a25c: c3 a0 00 00 ret
08009894 <rtems_bdbuf_swapout_writereq_alloc>:
*
* @return rtems_blkdev_request* The write reference memory.
*/
static rtems_blkdev_request*
rtems_bdbuf_swapout_writereq_alloc (void)
{
8009894: 37 9c ff f8 addi sp,sp,-8
8009898: 5b 8b 00 08 sw (sp+8),r11
800989c: 5b 9d 00 04 sw (sp+4),ra
* 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)));
80098a0: 78 01 08 01 mvhi r1,0x801
80098a4: 38 21 87 bc ori r1,r1,0x87bc
80098a8: 28 21 00 04 lw r1,(r1+4)
80098ac: 34 02 00 04 mvi r2,4
80098b0: f8 00 38 24 calli 8017940 <__ashlsi3>
* 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 =
malloc (sizeof (rtems_blkdev_request) +
80098b4: 34 21 00 18 addi r1,r1,24
80098b8: fb ff e5 a4 calli 8002f48 <malloc>
80098bc: b8 20 58 00 mv r11,r1
(bdbuf_config.max_write_blocks * sizeof (rtems_blkdev_sg_buffer)));
if (!write_req)
80098c0: 5c 20 00 03 bne r1,r0,80098cc <rtems_bdbuf_swapout_writereq_alloc+0x38><== ALWAYS TAKEN
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_REQ_NOMEM);
80098c4: 34 01 00 09 mvi r1,9 <== NOT EXECUTED
80098c8: fb ff fe f1 calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
write_req->req = RTEMS_BLKDEV_REQ_WRITE;
80098cc: 34 01 00 01 mvi r1,1
80098d0: 59 61 00 00 sw (r11+0),r1
write_req->done = rtems_bdbuf_transfer_done;
80098d4: 78 01 08 00 mvhi r1,0x800
80098d8: 38 21 98 28 ori r1,r1,0x9828
80098dc: 59 61 00 04 sw (r11+4),r1
write_req->io_task = rtems_task_self ();
80098e0: f8 00 15 15 calli 800ed34 <rtems_task_self>
80098e4: 59 61 00 14 sw (r11+20),r1
return write_req;
}
80098e8: b9 60 08 00 mv r1,r11
80098ec: 2b 9d 00 04 lw ra,(sp+4)
80098f0: 2b 8b 00 08 lw r11,(sp+8)
80098f4: 37 9c 00 08 addi sp,sp,8
80098f8: c3 a0 00 00 ret
0800ba00 <rtems_bdbuf_sync>:
rtems_status_code
rtems_bdbuf_sync (rtems_bdbuf_buffer *bd)
{
800ba00: 37 9c ff ec addi sp,sp,-20
800ba04: 5b 8b 00 14 sw (sp+20),r11
800ba08: 5b 8c 00 10 sw (sp+16),r12
800ba0c: 5b 8d 00 0c sw (sp+12),r13
800ba10: 5b 8e 00 08 sw (sp+8),r14
800ba14: 5b 9d 00 04 sw (sp+4),ra
800ba18: b8 20 58 00 mv r11,r1
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;
800ba1c: 34 01 00 09 mvi r1,9
}
static rtems_status_code
rtems_bdbuf_check_bd_and_lock_cache (rtems_bdbuf_buffer *bd, const char *kind)
{
if (bd == NULL)
800ba20: 45 60 00 47 be r11,r0,800bb3c <rtems_bdbuf_sync+0x13c> <== NEVER TAKEN
if (rtems_bdbuf_tracer)
{
printf ("bdbuf:%s: %" PRIu32 "\n", kind, bd->block);
rtems_bdbuf_show_users (kind, bd);
}
rtems_bdbuf_lock_cache();
800ba24: fb ff f6 ad calli 80094d8 <rtems_bdbuf_lock_cache>
sc = rtems_bdbuf_check_bd_and_lock_cache (bd, "sync");
if (sc != RTEMS_SUCCESSFUL)
return sc;
switch (bd->state)
800ba28: 29 61 00 20 lw r1,(r11+32)
800ba2c: 34 02 00 03 mvi r2,3
800ba30: 54 41 00 3f bgu r2,r1,800bb2c <rtems_bdbuf_sync+0x12c> <== NEVER TAKEN
800ba34: 34 02 00 05 mvi r2,5
800ba38: 50 41 00 04 bgeu r2,r1,800ba48 <rtems_bdbuf_sync+0x48> <== ALWAYS TAKEN
800ba3c: 34 02 00 06 mvi r2,6 <== NOT EXECUTED
800ba40: 5c 22 00 3b bne r1,r2,800bb2c <rtems_bdbuf_sync+0x12c> <== NOT EXECUTED
800ba44: e0 00 00 37 bi 800bb20 <rtems_bdbuf_sync+0x120> <== NOT EXECUTED
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800ba48: 34 01 00 08 mvi r1,8
800ba4c: 59 61 00 20 sw (r11+32),r1
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
800ba50: 78 01 08 01 mvhi r1,0x801
800ba54: 38 21 a7 74 ori r1,r1,0xa774
800ba58: 28 23 00 60 lw r3,(r1+96)
the_node->next = tail;
800ba5c: 78 02 08 01 mvhi r2,0x801
tail->previous = the_node;
800ba60: 58 2b 00 60 sw (r1+96),r11
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
800ba64: 38 42 a7 d0 ori r2,r2,0xa7d0
{
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_SYNC);
rtems_chain_append_unprotected (&bdbuf_cache.sync, &bd->link);
if (bd->waiters)
800ba68: 29 61 00 24 lw r1,(r11+36)
800ba6c: 59 62 00 00 sw (r11+0),r2
tail->previous = the_node;
old_last->next = the_node;
800ba70: 58 6b 00 00 sw (r3+0),r11
the_node->previous = old_last;
800ba74: 59 63 00 04 sw (r11+4),r3
800ba78: 44 20 00 04 be r1,r0,800ba88 <rtems_bdbuf_sync+0x88>
rtems_bdbuf_wake (&bdbuf_cache.access_waiters);
800ba7c: 78 01 08 01 mvhi r1,0x801
800ba80: 38 21 a7 d8 ori r1,r1,0xa7d8
800ba84: fb ff f6 d5 calli 80095d8 <rtems_bdbuf_wake>
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);
800ba88: 78 0c 08 01 mvhi r12,0x801
rtems_chain_append_unprotected (&bdbuf_cache.sync, &bd->link);
if (bd->waiters)
rtems_bdbuf_wake (&bdbuf_cache.access_waiters);
rtems_bdbuf_wake_swapper ();
800ba8c: fb ff f6 df calli 8009608 <rtems_bdbuf_wake_swapper>
static void
rtems_bdbuf_wait_for_sync_done (rtems_bdbuf_buffer *bd)
{
while (true)
{
switch (bd->state)
800ba90: 34 0e 00 07 mvi r14,7
800ba94: 34 0d 00 0a mvi r13,10
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);
800ba98: 39 8c a7 e0 ori r12,r12,0xa7e0
static void
rtems_bdbuf_wait_for_sync_done (rtems_bdbuf_buffer *bd)
{
while (true)
{
switch (bd->state)
800ba9c: 29 61 00 20 lw r1,(r11+32)
800baa0: 34 02 00 01 mvi r2,1
800baa4: 44 20 00 07 be r1,r0,800bac0 <rtems_bdbuf_sync+0xc0> <== NEVER TAKEN
800baa8: 51 c1 00 09 bgeu r14,r1,800bacc <rtems_bdbuf_sync+0xcc>
800baac: 54 2d 00 05 bgu r1,r13,800bac0 <rtems_bdbuf_sync+0xc0> <== NEVER TAKEN
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);
800bab0: b9 60 08 00 mv r1,r11
800bab4: b9 80 10 00 mv r2,r12
800bab8: fb ff f7 a7 calli 8009954 <rtems_bdbuf_wait>
800babc: e3 ff ff f8 bi 800ba9c <rtems_bdbuf_sync+0x9c>
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_9);
800bac0: 34 02 00 15 mvi r2,21 <== NOT EXECUTED
800bac4: fb ff f6 99 calli 8009528 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
800bac8: e3 ff ff f5 bi 800ba9c <rtems_bdbuf_sync+0x9c> <== 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
800bacc: 29 63 00 24 lw r3,(r11+36)
800bad0: 5c 60 00 19 bne r3,r0,800bb34 <rtems_bdbuf_sync+0x134>
&& (bd->state == RTEMS_BDBUF_STATE_CACHED
|| bd->state == RTEMS_BDBUF_STATE_EMPTY))
800bad4: 34 23 ff ff addi r3,r1,-1
/*
* We may have created a cached or empty buffer which may be recycled.
*/
if (bd->waiters == 0
&& (bd->state == RTEMS_BDBUF_STATE_CACHED
800bad8: 54 62 00 17 bgu r3,r2,800bb34 <rtems_bdbuf_sync+0x134> <== NEVER TAKEN
|| bd->state == RTEMS_BDBUF_STATE_EMPTY))
{
if (bd->state == RTEMS_BDBUF_STATE_EMPTY)
800badc: 5c 22 00 0d bne r1,r2,800bb10 <rtems_bdbuf_sync+0x110>
{
rtems_bdbuf_remove_from_tree (bd);
800bae0: b9 60 08 00 mv r1,r11
800bae4: fb ff f7 d2 calli 8009a2c <rtems_bdbuf_remove_from_tree>
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
800bae8: 78 01 08 01 mvhi r1,0x801
800baec: 38 21 a7 b4 ori r1,r1,0xa7b4
800baf0: 59 61 00 04 sw (r11+4),r1
before_node = after_node->next;
800baf4: 78 01 08 01 mvhi r1,0x801
800baf8: 38 21 a7 74 ori r1,r1,0xa774
800bafc: 28 22 00 40 lw r2,(r1+64)
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
800bb00: 59 60 00 20 sw (r11+32),r0
after_node->next = the_node;
800bb04: 58 2b 00 40 sw (r1+64),r11
the_node->next = before_node;
800bb08: 59 62 00 00 sw (r11+0),r2
before_node->previous = the_node;
800bb0c: 58 4b 00 04 sw (r2+4),r11
if (bd->state == RTEMS_BDBUF_STATE_EMPTY)
{
rtems_bdbuf_remove_from_tree (bd);
rtems_bdbuf_make_free_and_add_to_lru_list (bd);
}
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
800bb10: 78 01 08 01 mvhi r1,0x801
800bb14: 38 21 a7 e8 ori r1,r1,0xa7e8
800bb18: fb ff f6 b0 calli 80095d8 <rtems_bdbuf_wake>
800bb1c: e0 00 00 06 bi 800bb34 <rtems_bdbuf_sync+0x134>
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);
800bb20: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800bb24: fb ff f8 da calli 8009e8c <rtems_bdbuf_discard_buffer_after_access><== NOT EXECUTED
break;
800bb28: e0 00 00 03 bi 800bb34 <rtems_bdbuf_sync+0x134> <== NOT EXECUTED
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_5);
800bb2c: 34 02 00 11 mvi r2,17 <== NOT EXECUTED
800bb30: fb ff f6 7e calli 8009528 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
}
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
800bb34: fb ff f6 95 calli 8009588 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
800bb38: 34 01 00 00 mvi r1,0
}
800bb3c: 2b 9d 00 04 lw ra,(sp+4)
800bb40: 2b 8b 00 14 lw r11,(sp+20)
800bb44: 2b 8c 00 10 lw r12,(sp+16)
800bb48: 2b 8d 00 0c lw r13,(sp+12)
800bb4c: 2b 8e 00 08 lw r14,(sp+8)
800bb50: 37 9c 00 14 addi sp,sp,20
800bb54: c3 a0 00 00 ret
08009558 <rtems_bdbuf_unlock>:
* @param lock The mutex to unlock.
* @param fatal_error_code The error code if the call fails.
*/
static void
rtems_bdbuf_unlock (rtems_id lock, uint32_t fatal_error_code)
{
8009558: 37 9c ff f8 addi sp,sp,-8
800955c: 5b 8b 00 08 sw (sp+8),r11
8009560: 5b 9d 00 04 sw (sp+4),ra
8009564: b8 40 58 00 mv r11,r2
rtems_status_code sc = rtems_semaphore_release (lock);
8009568: fb ff ee c1 calli 800506c <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
800956c: 44 20 00 03 be r1,r0,8009578 <rtems_bdbuf_unlock+0x20> <== ALWAYS TAKEN
rtems_bdbuf_fatal (fatal_error_code);
8009570: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8009574: fb ff ff c6 calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
}
8009578: 2b 9d 00 04 lw ra,(sp+4)
800957c: 2b 8b 00 08 lw r11,(sp+8)
8009580: 37 9c 00 08 addi sp,sp,8
8009584: c3 a0 00 00 ret
0800984c <rtems_bdbuf_wait_for_event>:
return RTEMS_UNSATISFIED;
}
static void
rtems_bdbuf_wait_for_event (rtems_event_set event)
{
800984c: 37 9c ff f4 addi sp,sp,-12
8009850: 5b 8b 00 08 sw (sp+8),r11
8009854: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_event_set out = 0;
sc = rtems_event_receive (event,
8009858: 34 02 00 00 mvi r2,0
800985c: 34 03 00 00 mvi r3,0
8009860: 37 84 00 0c addi r4,sp,12
return RTEMS_UNSATISFIED;
}
static void
rtems_bdbuf_wait_for_event (rtems_event_set event)
{
8009864: b8 20 58 00 mv r11,r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_event_set out = 0;
8009868: 5b 80 00 0c sw (sp+12),r0
sc = rtems_event_receive (event,
800986c: f8 00 12 c4 calli 800e37c <rtems_event_receive>
RTEMS_EVENT_ALL | RTEMS_WAIT,
RTEMS_NO_TIMEOUT,
&out);
if (sc != RTEMS_SUCCESSFUL || out != event)
8009870: 5c 20 00 03 bne r1,r0,800987c <rtems_bdbuf_wait_for_event+0x30><== NEVER TAKEN
8009874: 2b 81 00 0c lw r1,(sp+12)
8009878: 44 2b 00 03 be r1,r11,8009884 <rtems_bdbuf_wait_for_event+0x38><== ALWAYS TAKEN
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_WAIT_EVNT);
800987c: 34 01 00 1c mvi r1,28 <== NOT EXECUTED
8009880: fb ff ff 03 calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
}
8009884: 2b 9d 00 04 lw ra,(sp+4)
8009888: 2b 8b 00 08 lw r11,(sp+8)
800988c: 37 9c 00 0c addi sp,sp,12
8009890: c3 a0 00 00 ret
080096fc <rtems_bdbuf_wait_for_transient_event>:
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_WAIT_EVNT);
}
static void
rtems_bdbuf_wait_for_transient_event (void)
{
80096fc: 37 9c ff f8 addi sp,sp,-8
8009700: 5b 9d 00 04 sw (sp+4),ra
rtems_interval ticks
)
{
rtems_event_set event_out;
return rtems_event_system_receive(
8009704: 78 01 80 00 mvhi r1,0x8000
8009708: 34 02 00 00 mvi r2,0
800970c: 34 03 00 00 mvi r3,0
8009710: 37 84 00 08 addi r4,sp,8
8009714: f8 00 14 84 calli 800e924 <rtems_event_system_receive>
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc = rtems_event_transient_receive (RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
8009718: 44 20 00 03 be r1,r0,8009724 <rtems_bdbuf_wait_for_transient_event+0x28><== ALWAYS TAKEN
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_WAIT_TRANS_EVNT);
800971c: 34 01 00 1d mvi r1,29 <== NOT EXECUTED
8009720: fb ff ff 5b calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
}
8009724: 2b 9d 00 04 lw ra,(sp+4)
8009728: 37 9c 00 08 addi sp,sp,8
800972c: c3 a0 00 00 ret
080095d8 <rtems_bdbuf_wake>:
* 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)
{
80095d8: 37 9c ff fc addi sp,sp,-4
80095dc: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (waiters->count > 0)
80095e0: 28 22 00 00 lw r2,(r1+0)
80095e4: 44 40 00 06 be r2,r0,80095fc <rtems_bdbuf_wake+0x24>
{
sc = rtems_semaphore_flush (waiters->sema);
80095e8: 28 21 00 04 lw r1,(r1+4)
80095ec: f8 00 14 a3 calli 800e878 <rtems_semaphore_flush>
if (sc != RTEMS_SUCCESSFUL)
80095f0: 44 20 00 03 be r1,r0,80095fc <rtems_bdbuf_wake+0x24> <== ALWAYS TAKEN
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_CACHE_WAKE);
80095f4: 34 01 00 04 mvi r1,4 <== NOT EXECUTED
80095f8: fb ff ff a5 calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
}
}
80095fc: 2b 9d 00 04 lw ra,(sp+4)
8009600: 37 9c 00 04 addi sp,sp,4
8009604: c3 a0 00 00 ret
08009608 <rtems_bdbuf_wake_swapper>:
static void
rtems_bdbuf_wake_swapper (void)
{
8009608: 37 9c ff fc addi sp,sp,-4
800960c: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc = rtems_event_send (bdbuf_cache.swapout,
8009610: 78 01 08 01 mvhi r1,0x801
8009614: 38 21 a7 74 ori r1,r1,0xa774
8009618: 28 21 00 00 lw r1,(r1+0)
800961c: 34 02 00 04 mvi r2,4
8009620: f8 00 13 bd calli 800e514 <rtems_event_send>
RTEMS_BDBUF_SWAPOUT_SYNC);
if (sc != RTEMS_SUCCESSFUL)
8009624: 44 20 00 03 be r1,r0,8009630 <rtems_bdbuf_wake_swapper+0x28><== ALWAYS TAKEN
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WAKE_1);
8009628: 34 01 00 0b mvi r1,11 <== NOT EXECUTED
800962c: fb ff ff 98 calli 800948c <rtems_bdbuf_fatal> <== NOT EXECUTED
}
8009630: 2b 9d 00 04 lw ra,(sp+4)
8009634: 37 9c 00 04 addi sp,sp,4
8009638: c3 a0 00 00 ret
08000ddc <rtems_bdpart_create>:
const rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
const unsigned *dist,
size_t count
)
{
8000ddc: 37 9c ff c4 addi sp,sp,-60
8000de0: 5b 8b 00 38 sw (sp+56),r11
8000de4: 5b 8c 00 34 sw (sp+52),r12
8000de8: 5b 8d 00 30 sw (sp+48),r13
8000dec: 5b 8e 00 2c sw (sp+44),r14
8000df0: 5b 8f 00 28 sw (sp+40),r15
8000df4: 5b 90 00 24 sw (sp+36),r16
8000df8: 5b 91 00 20 sw (sp+32),r17
8000dfc: 5b 92 00 1c sw (sp+28),r18
8000e00: 5b 93 00 18 sw (sp+24),r19
8000e04: 5b 94 00 14 sw (sp+20),r20
8000e08: 5b 95 00 10 sw (sp+16),r21
8000e0c: 5b 96 00 0c sw (sp+12),r22
8000e10: 5b 97 00 08 sw (sp+8),r23
8000e14: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
8000e18: 34 0f 00 00 mvi r15,0
const rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
const unsigned *dist,
size_t count
)
{
8000e1c: b8 40 70 00 mv r14,r2
8000e20: b8 60 a8 00 mv r21,r3
8000e24: b8 80 90 00 mv r18,r4
8000e28: b8 a0 68 00 mv r13,r5
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
8000e2c: 44 40 00 04 be r2,r0,8000e3c <rtems_bdpart_create+0x60> <== NEVER TAKEN
size_t count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
8000e30: 28 42 00 00 lw r2,(r2+0)
8000e34: 5c 40 00 02 bne r2,r0,8000e3c <rtems_bdpart_create+0x60> <== NEVER TAKEN
&& format->mbr.dos_compatibility;
8000e38: 41 cf 00 08 lbu r15,(r14+8)
const unsigned *dist,
size_t count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
8000e3c: 21 ef 00 ff andi r15,r15,0xff
&& 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 =
8000e40: 65 eb 00 00 cmpei r11,r15,0
8000e44: 34 02 ff c2 mvi r2,-62
8000e48: c8 0b 58 00 sub r11,r0,r11
8000e4c: a1 62 58 00 and r11,r11,r2
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
rtems_blkdev_bnum disk_end = 0;
8000e50: 5b 80 00 3c sw (sp+60),r0
rtems_blkdev_bnum pos = 0;
rtems_blkdev_bnum dist_sum = 0;
rtems_blkdev_bnum record_space =
8000e54: 35 6b 00 3f addi r11,r11,63
size_t i = 0;
/* Check if we have something to do */
if (count == 0) {
/* Nothing to do */
return RTEMS_SUCCESSFUL;
8000e58: 34 0c 00 00 mvi r12,0
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) {
8000e5c: 45 a0 00 5c be r13,r0,8000fcc <rtems_bdpart_create+0x1f0> <== NEVER TAKEN
/* Nothing to do */
return RTEMS_SUCCESSFUL;
}
/* Check parameter */
if (format == NULL || pt == NULL || dist == NULL) {
8000e60: 66 a3 00 00 cmpei r3,r21,0
8000e64: 65 c2 00 00 cmpei r2,r14,0
return RTEMS_INVALID_ADDRESS;
8000e68: 34 0c 00 09 mvi r12,9
/* Nothing to do */
return RTEMS_SUCCESSFUL;
}
/* Check parameter */
if (format == NULL || pt == NULL || dist == NULL) {
8000e6c: b8 62 10 00 or r2,r3,r2
8000e70: 5c 40 00 57 bne r2,r0,8000fcc <rtems_bdpart_create+0x1f0> <== NEVER TAKEN
8000e74: 46 42 00 56 be r18,r2,8000fcc <rtems_bdpart_create+0x1f0> <== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
}
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, NULL, NULL, &disk_end);
8000e78: 34 03 00 00 mvi r3,0
8000e7c: 37 84 00 3c addi r4,sp,60
8000e80: f8 00 01 85 calli 8001494 <rtems_bdpart_get_disk_data>
8000e84: b8 20 60 00 mv r12,r1
if (sc != RTEMS_SUCCESSFUL) {
8000e88: ba 40 10 00 mv r2,r18
8000e8c: 34 01 00 00 mvi r1,0
8000e90: 34 11 00 00 mvi r17,0
8000e94: 45 80 00 09 be r12,r0,8000eb8 <rtems_bdpart_create+0xdc> <== ALWAYS TAKEN
8000e98: e0 00 00 4d bi 8000fcc <rtems_bdpart_create+0x1f0> <== NOT EXECUTED
/* Get distribution sum and check for overflow */
for (i = 0; i < count; ++i) {
unsigned prev_sum = dist_sum;
dist_sum += dist [i];
8000e9c: 28 44 00 00 lw r4,(r2+0)
8000ea0: b6 24 18 00 add r3,r17,r4
if (dist_sum < prev_sum) {
8000ea4: 56 23 00 49 bgu r17,r3,8000fc8 <rtems_bdpart_create+0x1ec> <== NEVER TAKEN
8000ea8: 34 42 00 04 addi r2,r2,4
return RTEMS_INVALID_NUMBER;
}
if (dist [i] == 0) {
8000eac: 44 80 00 47 be r4,r0,8000fc8 <rtems_bdpart_create+0x1ec> <== NEVER TAKEN
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
/* Get distribution sum and check for overflow */
for (i = 0; i < count; ++i) {
8000eb0: 34 21 00 01 addi r1,r1,1
unsigned prev_sum = dist_sum;
dist_sum += dist [i];
8000eb4: b8 60 88 00 mv r17,r3
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
/* Get distribution sum and check for overflow */
for (i = 0; i < count; ++i) {
8000eb8: 55 a1 ff f9 bgu r13,r1,8000e9c <rtems_bdpart_create+0xc0>
return RTEMS_INVALID_NUMBER;
}
}
/* Check format */
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
8000ebc: 29 c1 00 00 lw r1,(r14+0)
8000ec0: 5c 20 00 3e bne r1,r0,8000fb8 <rtems_bdpart_create+0x1dc> <== NEVER TAKEN
return RTEMS_NOT_IMPLEMENTED;
}
/* Align end of disk on cylinder boundary if necessary */
if (dos_compatibility) {
8000ec4: 45 e1 00 07 be r15,r1,8000ee0 <rtems_bdpart_create+0x104> <== NEVER TAKEN
disk_end -= (disk_end % record_space);
8000ec8: 2b 8e 00 3c lw r14,(sp+60)
8000ecc: b9 60 10 00 mv r2,r11
8000ed0: b9 c0 08 00 mv r1,r14
8000ed4: f8 00 92 69 calli 8025878 <__umodsi3>
8000ed8: c9 c1 08 00 sub r1,r14,r1
8000edc: 5b 81 00 3c sw (sp+60),r1
/*
* In case we need an extended partition and logical partitions we have to
* account for the space of each EBR.
*/
if (count > 4) {
8000ee0: 34 01 00 04 mvi r1,4
/*
* We need at least space for the MBR and the compatibility space for the
* first primary partition.
*/
overhead += record_space;
8000ee4: b9 60 70 00 mv r14,r11
/*
* In case we need an extended partition and logical partitions we have to
* account for the space of each EBR.
*/
if (count > 4) {
8000ee8: 50 2d 00 05 bgeu r1,r13,8000efc <rtems_bdpart_create+0x120><== NEVER TAKEN
overhead += (count - 3) * record_space;
8000eec: b9 60 08 00 mv r1,r11
8000ef0: 35 a2 ff fd addi r2,r13,-3
8000ef4: fb ff fe 33 calli 80007c0 <__mulsi3>
8000ef8: b4 2b 70 00 add r14,r1,r11
/*
* Account space to align every partition on cylinder boundaries if
* necessary.
*/
if (dos_compatibility) {
8000efc: 45 e0 00 05 be r15,r0,8000f10 <rtems_bdpart_create+0x134> <== NEVER TAKEN
overhead += (count - 1) * record_space;
8000f00: b9 60 08 00 mv r1,r11
8000f04: 35 a2 ff ff addi r2,r13,-1
8000f08: fb ff fe 2e calli 80007c0 <__mulsi3>
8000f0c: b5 c1 70 00 add r14,r14,r1
}
/* Check disk space */
if ((overhead + count) > disk_end) {
8000f10: 2b 94 00 3c lw r20,(sp+60)
8000f14: b5 cd 08 00 add r1,r14,r13
8000f18: 54 34 00 2a bgu r1,r20,8000fc0 <rtems_bdpart_create+0x1e4> <== NEVER TAKEN
/* Begin of first primary partition */
pos = record_space;
/* Space for partitions */
free_space = disk_end - overhead;
8000f1c: ca 8e b0 00 sub r22,r20,r14
8000f20: ba a0 80 00 mv r16,r21
if ((overhead + count) > disk_end) {
return RTEMS_IO_ERROR;
}
/* Begin of first primary partition */
pos = record_space;
8000f24: b9 60 70 00 mv r14,r11
/* Space for partitions */
free_space = disk_end - overhead;
for (i = 0; i < count; ++i) {
8000f28: 34 0f 00 00 mvi r15,0
/* Align partition upwards */
s += record_space - (s % record_space);
/* Reserve space for the EBR if necessary */
if (count > 4 && i > 2) {
8000f2c: 75 b7 00 04 cmpgui r23,r13,0x4
pos = record_space;
/* Space for partitions */
free_space = disk_end - overhead;
for (i = 0; i < count; ++i) {
8000f30: e0 00 00 1b bi 8000f9c <rtems_bdpart_create+0x1c0>
rtems_bdpart_partition *p = pt + i;
/* Partition size */
rtems_blkdev_bnum s = free_space * dist [i];
8000f34: 2a 53 00 00 lw r19,(r18+0)
8000f38: ba c0 08 00 mv r1,r22
8000f3c: ba 60 10 00 mv r2,r19
8000f40: fb ff fe 20 calli 80007c0 <__mulsi3>
if (s < free_space || s < dist [i]) {
8000f44: 56 c1 00 21 bgu r22,r1,8000fc8 <rtems_bdpart_create+0x1ec> <== NEVER TAKEN
8000f48: 56 61 00 20 bgu r19,r1,8000fc8 <rtems_bdpart_create+0x1ec> <== NEVER TAKEN
/* TODO: Calculate without overflow */
return RTEMS_INVALID_NUMBER;
}
s /= dist_sum;
8000f4c: ba 20 10 00 mv r2,r17
8000f50: f8 00 92 3a calli 8025838 <__udivsi3>
8000f54: b8 20 98 00 mv r19,r1
/* Ensure that the partition is not empty */
if (s == 0) {
8000f58: 5c 20 00 02 bne r1,r0,8000f60 <rtems_bdpart_create+0x184> <== ALWAYS TAKEN
s = 1;
8000f5c: 34 13 00 01 mvi r19,1 <== NOT EXECUTED
}
/* Align partition upwards */
s += record_space - (s % record_space);
8000f60: ba 60 08 00 mv r1,r19
8000f64: b9 60 10 00 mv r2,r11
8000f68: f8 00 92 44 calli 8025878 <__umodsi3>
/* Reserve space for the EBR if necessary */
if (count > 4 && i > 2) {
8000f6c: 75 e2 00 02 cmpgui r2,r15,0x2
if (s == 0) {
s = 1;
}
/* Align partition upwards */
s += record_space - (s % record_space);
8000f70: b6 6b 98 00 add r19,r19,r11
/* Reserve space for the EBR if necessary */
if (count > 4 && i > 2) {
8000f74: a0 57 10 00 and r2,r2,r23
if (s == 0) {
s = 1;
}
/* Align partition upwards */
s += record_space - (s % record_space);
8000f78: ca 61 08 00 sub r1,r19,r1
/* Reserve space for the EBR if necessary */
if (count > 4 && i > 2) {
8000f7c: 44 40 00 02 be r2,r0,8000f84 <rtems_bdpart_create+0x1a8>
pos += record_space;
8000f80: b5 cb 70 00 add r14,r14,r11
}
/* Partition begin and end */
p->begin = pos;
8000f84: 5a 0e 00 00 sw (r16+0),r14
pos += s;
8000f88: b5 c1 70 00 add r14,r14,r1
p->end = pos;
8000f8c: 5a 0e 00 04 sw (r16+4),r14
pos = record_space;
/* Space for partitions */
free_space = disk_end - overhead;
for (i = 0; i < count; ++i) {
8000f90: 35 ef 00 01 addi r15,r15,1
8000f94: 36 10 00 30 addi r16,r16,48
8000f98: 36 52 00 04 addi r18,r18,4
8000f9c: 55 af ff e6 bgu r13,r15,8000f34 <rtems_bdpart_create+0x158>
pos += s;
p->end = pos;
}
/* Expand the last partition to the disk end */
pt [count - 1].end = disk_end;
8000fa0: 35 a1 ff ff addi r1,r13,-1
8000fa4: 34 02 00 30 mvi r2,48
8000fa8: fb ff fe 06 calli 80007c0 <__mulsi3>
8000fac: b6 a1 08 00 add r1,r21,r1
8000fb0: 58 34 00 04 sw (r1+4),r20
return RTEMS_SUCCESSFUL;
8000fb4: e0 00 00 06 bi 8000fcc <rtems_bdpart_create+0x1f0>
}
}
/* Check format */
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
return RTEMS_NOT_IMPLEMENTED;
8000fb8: 34 0c 00 18 mvi r12,24 <== NOT EXECUTED
8000fbc: e0 00 00 04 bi 8000fcc <rtems_bdpart_create+0x1f0> <== NOT EXECUTED
overhead += (count - 1) * record_space;
}
/* Check disk space */
if ((overhead + count) > disk_end) {
return RTEMS_IO_ERROR;
8000fc0: 34 0c 00 1b mvi r12,27 <== NOT EXECUTED
8000fc4: e0 00 00 02 bi 8000fcc <rtems_bdpart_create+0x1f0> <== NOT EXECUTED
/* Partition size */
rtems_blkdev_bnum s = free_space * dist [i];
if (s < free_space || s < dist [i]) {
/* TODO: Calculate without overflow */
return RTEMS_INVALID_NUMBER;
8000fc8: 34 0c 00 0a mvi r12,10 <== NOT EXECUTED
/* Expand the last partition to the disk end */
pt [count - 1].end = disk_end;
return RTEMS_SUCCESSFUL;
}
8000fcc: b9 80 08 00 mv r1,r12
8000fd0: 2b 9d 00 04 lw ra,(sp+4)
8000fd4: 2b 8b 00 38 lw r11,(sp+56)
8000fd8: 2b 8c 00 34 lw r12,(sp+52)
8000fdc: 2b 8d 00 30 lw r13,(sp+48)
8000fe0: 2b 8e 00 2c lw r14,(sp+44)
8000fe4: 2b 8f 00 28 lw r15,(sp+40)
8000fe8: 2b 90 00 24 lw r16,(sp+36)
8000fec: 2b 91 00 20 lw r17,(sp+32)
8000ff0: 2b 92 00 1c lw r18,(sp+28)
8000ff4: 2b 93 00 18 lw r19,(sp+24)
8000ff8: 2b 94 00 14 lw r20,(sp+20)
8000ffc: 2b 95 00 10 lw r21,(sp+16)
8001000: 2b 96 00 0c lw r22,(sp+12)
8001004: 2b 97 00 08 lw r23,(sp+8)
8001008: 37 9c 00 3c addi sp,sp,60
800100c: c3 a0 00 00 ret
08001010 <rtems_bdpart_dump>:
{
uuid_unparse_lower( type, str);
}
void rtems_bdpart_dump( const rtems_bdpart_partition *pt, size_t count)
{
8001010: 37 9c ff 80 addi sp,sp,-128
8001014: 5b 8b 00 44 sw (sp+68),r11
8001018: 5b 8c 00 40 sw (sp+64),r12
800101c: 5b 8d 00 3c sw (sp+60),r13
8001020: 5b 8e 00 38 sw (sp+56),r14
8001024: 5b 8f 00 34 sw (sp+52),r15
8001028: 5b 90 00 30 sw (sp+48),r16
800102c: 5b 91 00 2c sw (sp+44),r17
8001030: 5b 92 00 28 sw (sp+40),r18
8001034: 5b 93 00 24 sw (sp+36),r19
8001038: 5b 94 00 20 sw (sp+32),r20
800103c: 5b 95 00 1c sw (sp+28),r21
8001040: 5b 96 00 18 sw (sp+24),r22
8001044: 5b 97 00 14 sw (sp+20),r23
8001048: 5b 98 00 10 sw (sp+16),r24
800104c: 5b 99 00 0c sw (sp+12),r25
8001050: 5b 9b 00 08 sw (sp+8),fp
8001054: 5b 9d 00 04 sw (sp+4),ra
size_t i = 0;
printf(
8001058: 78 03 08 02 mvhi r3,0x802
{
uuid_unparse_lower( type, str);
}
void rtems_bdpart_dump( const rtems_bdpart_partition *pt, size_t count)
{
800105c: b8 20 58 00 mv r11,r1
size_t i = 0;
printf(
8001060: b8 60 08 00 mv r1,r3
8001064: 38 21 63 24 ori r1,r1,0x6324
break;
case RTEMS_BDPART_MBR_FAT_16_LBA:
type = "FAT 16 LBA";
break;
case RTEMS_BDPART_MBR_FAT_32:
type = "FAT 32";
8001068: 78 14 08 02 mvhi r20,0x802
break;
case RTEMS_BDPART_MBR_DATA:
type = "DATA";
break;
default:
snprintf( type_buffer, sizeof( type_buffer), "0x%02" PRIx8, type_mbr);
800106c: 78 13 08 02 mvhi r19,0x802
break;
case RTEMS_BDPART_MBR_FAT_16:
type = "FAT 16";
break;
case RTEMS_BDPART_MBR_FAT_16_LBA:
type = "FAT 16 LBA";
8001070: 78 12 08 02 mvhi r18,0x802
break;
case RTEMS_BDPART_MBR_FAT_32_LBA:
type = "FAT 32 LBA";
break;
case RTEMS_BDPART_MBR_DATA:
type = "DATA";
8001074: 78 11 08 02 mvhi r17,0x802
break;
case RTEMS_BDPART_MBR_FAT_32:
type = "FAT 32";
break;
case RTEMS_BDPART_MBR_FAT_32_LBA:
type = "FAT 32 LBA";
8001078: 78 10 08 02 mvhi r16,0x802
uint8_t type_mbr = 0;
if (rtems_bdpart_to_mbr_partition_type( p->type, &type_mbr)) {
switch (type_mbr) {
case RTEMS_BDPART_MBR_FAT_12:
type = "FAT 12";
800107c: 78 0f 08 02 mvhi r15,0x802
break;
case RTEMS_BDPART_MBR_FAT_16:
type = "FAT 16";
8001080: 78 0e 08 02 mvhi r14,0x802
} else {
rtems_bdpart_type_to_string( p->type, type_buffer);
type = type_buffer;
}
printf(
8001084: 78 0d 08 02 mvhi r13,0x802
{
uuid_unparse_lower( type, str);
}
void rtems_bdpart_dump( const rtems_bdpart_partition *pt, size_t count)
{
8001088: 5b 82 00 48 sw (sp+72),r2
"------------+------------+-----------------------------------------------------\n"
" BEGIN | END | TYPE\n"
"------------+------------+-----------------------------------------------------\n"
);
for (i = 0; i < count; ++i) {
800108c: 34 15 00 00 mvi r21,0
void rtems_bdpart_dump( const rtems_bdpart_partition *pt, size_t count)
{
size_t i = 0;
printf(
8001090: f8 00 4d 9b calli 80146fc <puts>
snprintf( type_buffer, sizeof( type_buffer), "0x%02" PRIx8, type_mbr);
type = type_buffer;
break;
}
} else {
rtems_bdpart_type_to_string( p->type, type_buffer);
8001094: 37 8c 00 4c addi r12,sp,76
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) {
8001098: 34 16 00 0b mvi r22,11
break;
case RTEMS_BDPART_MBR_FAT_16_LBA:
type = "FAT 16 LBA";
break;
case RTEMS_BDPART_MBR_FAT_32:
type = "FAT 32";
800109c: 3a 94 63 10 ori r20,r20,0x6310
break;
case RTEMS_BDPART_MBR_DATA:
type = "DATA";
break;
default:
snprintf( type_buffer, sizeof( type_buffer), "0x%02" PRIx8, type_mbr);
80010a0: 3a 73 64 64 ori r19,r19,0x6464
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) {
80010a4: 34 1b 00 0e mvi fp,14
break;
case RTEMS_BDPART_MBR_FAT_16:
type = "FAT 16";
break;
case RTEMS_BDPART_MBR_FAT_16_LBA:
type = "FAT 16 LBA";
80010a8: 3a 52 63 18 ori r18,r18,0x6318
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) {
80010ac: 34 19 00 da mvi r25,218
break;
case RTEMS_BDPART_MBR_FAT_32_LBA:
type = "FAT 32 LBA";
break;
case RTEMS_BDPART_MBR_DATA:
type = "DATA";
80010b0: 3a 31 62 fc ori r17,r17,0x62fc
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) {
80010b4: 34 18 00 0c mvi r24,12
break;
case RTEMS_BDPART_MBR_FAT_32:
type = "FAT 32";
break;
case RTEMS_BDPART_MBR_FAT_32_LBA:
type = "FAT 32 LBA";
80010b8: 3a 10 63 04 ori r16,r16,0x6304
uint8_t type_mbr = 0;
if (rtems_bdpart_to_mbr_partition_type( p->type, &type_mbr)) {
switch (type_mbr) {
case RTEMS_BDPART_MBR_FAT_12:
type = "FAT 12";
80010bc: 39 ef 62 f4 ori r15,r15,0x62f4
break;
case RTEMS_BDPART_MBR_FAT_16:
type = "FAT 16";
80010c0: 39 ce 62 ec ori r14,r14,0x62ec
} else {
rtems_bdpart_type_to_string( p->type, type_buffer);
type = type_buffer;
}
printf(
80010c4: 39 ad 64 6c ori r13,r13,0x646c
"------------+------------+-----------------------------------------------------\n"
" BEGIN | END | TYPE\n"
"------------+------------+-----------------------------------------------------\n"
);
for (i = 0; i < count; ++i) {
80010c8: e0 00 00 28 bi 8001168 <rtems_bdpart_dump+0x158>
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)) {
80010cc: 35 77 00 08 addi r23,r11,8
80010d0: ba e0 08 00 mv r1,r23
80010d4: 37 82 00 83 addi r2,sp,131
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;
80010d8: 33 80 00 83 sb (sp+131),r0
if (rtems_bdpart_to_mbr_partition_type( p->type, &type_mbr)) {
80010dc: f8 00 00 e1 calli 8001460 <rtems_bdpart_to_mbr_partition_type>
80010e0: 44 20 00 18 be r1,r0,8001140 <rtems_bdpart_dump+0x130> <== NEVER TAKEN
switch (type_mbr) {
80010e4: 43 85 00 83 lbu r5,(sp+131)
break;
case RTEMS_BDPART_MBR_FAT_16_LBA:
type = "FAT 16 LBA";
break;
case RTEMS_BDPART_MBR_FAT_32:
type = "FAT 32";
80010e8: ba 80 20 00 mv r4,r20
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) {
80010ec: 44 b6 00 19 be r5,r22,8001150 <rtems_bdpart_dump+0x140> <== ALWAYS TAKEN
80010f0: 54 b6 00 08 bgu r5,r22,8001110 <rtems_bdpart_dump+0x100> <== NOT EXECUTED
80010f4: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
case RTEMS_BDPART_MBR_FAT_12:
type = "FAT 12";
80010f8: b9 e0 20 00 mv r4,r15 <== 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) {
80010fc: 44 a1 00 15 be r5,r1,8001150 <rtems_bdpart_dump+0x140> <== NOT EXECUTED
8001100: 34 01 00 04 mvi r1,4 <== NOT EXECUTED
case RTEMS_BDPART_MBR_FAT_12:
type = "FAT 12";
break;
case RTEMS_BDPART_MBR_FAT_16:
type = "FAT 16";
8001104: b9 c0 20 00 mv r4,r14 <== 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) {
8001108: 5c a1 00 08 bne r5,r1,8001128 <rtems_bdpart_dump+0x118> <== NOT EXECUTED
800110c: e0 00 00 11 bi 8001150 <rtems_bdpart_dump+0x140> <== NOT EXECUTED
break;
case RTEMS_BDPART_MBR_FAT_16:
type = "FAT 16";
break;
case RTEMS_BDPART_MBR_FAT_16_LBA:
type = "FAT 16 LBA";
8001110: ba 40 20 00 mv r4,r18 <== 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) {
8001114: 44 bb 00 0f be r5,fp,8001150 <rtems_bdpart_dump+0x140> <== NOT EXECUTED
break;
case RTEMS_BDPART_MBR_FAT_32_LBA:
type = "FAT 32 LBA";
break;
case RTEMS_BDPART_MBR_DATA:
type = "DATA";
8001118: ba 20 20 00 mv r4,r17 <== 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) {
800111c: 44 b9 00 0d be r5,r25,8001150 <rtems_bdpart_dump+0x140> <== NOT EXECUTED
break;
case RTEMS_BDPART_MBR_FAT_32:
type = "FAT 32";
break;
case RTEMS_BDPART_MBR_FAT_32_LBA:
type = "FAT 32 LBA";
8001120: ba 00 20 00 mv r4,r16 <== 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) {
8001124: 44 b8 00 0b be r5,r24,8001150 <rtems_bdpart_dump+0x140> <== NOT EXECUTED
break;
case RTEMS_BDPART_MBR_DATA:
type = "DATA";
break;
default:
snprintf( type_buffer, sizeof( type_buffer), "0x%02" PRIx8, type_mbr);
8001128: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800112c: 34 02 00 34 mvi r2,52 <== NOT EXECUTED
8001130: ba 60 18 00 mv r3,r19 <== NOT EXECUTED
8001134: b8 a0 20 00 mv r4,r5 <== NOT EXECUTED
8001138: f8 00 4d a7 calli 80147d4 <snprintf> <== NOT EXECUTED
800113c: e0 00 00 04 bi 800114c <rtems_bdpart_dump+0x13c> <== NOT EXECUTED
static void rtems_bdpart_type_to_string(
const uuid_t type,
char str [37]
)
{
uuid_unparse_lower( type, str);
8001140: ba e0 08 00 mv r1,r23 <== NOT EXECUTED
8001144: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
8001148: f8 00 27 79 calli 800af2c <uuid_unparse_lower> <== NOT EXECUTED
type = type_buffer;
break;
}
} else {
rtems_bdpart_type_to_string( p->type, type_buffer);
type = type_buffer;
800114c: b9 80 20 00 mv r4,r12 <== NOT EXECUTED
}
printf(
8001150: 29 62 00 00 lw r2,(r11+0)
8001154: 29 63 00 04 lw r3,(r11+4)
8001158: b9 a0 08 00 mv r1,r13
"------------+------------+-----------------------------------------------------\n"
" BEGIN | END | TYPE\n"
"------------+------------+-----------------------------------------------------\n"
);
for (i = 0; i < count; ++i) {
800115c: 36 b5 00 01 addi r21,r21,1
} else {
rtems_bdpart_type_to_string( p->type, type_buffer);
type = type_buffer;
}
printf(
8001160: f8 00 4d 1c calli 80145d0 <printf>
"------------+------------+-----------------------------------------------------\n"
" BEGIN | END | TYPE\n"
"------------+------------+-----------------------------------------------------\n"
);
for (i = 0; i < count; ++i) {
8001164: 35 6b 00 30 addi r11,r11,48
8001168: 2b 81 00 48 lw r1,(sp+72)
800116c: 54 35 ff d8 bgu r1,r21,80010cc <rtems_bdpart_dump+0xbc>
p->end,
type
);
}
puts( "------------+------------+-----------------------------------------------------");
8001170: 78 01 08 02 mvhi r1,0x802
8001174: 38 21 64 14 ori r1,r1,0x6414
8001178: f8 00 4d 61 calli 80146fc <puts>
}
800117c: 2b 9d 00 04 lw ra,(sp+4)
8001180: 2b 8b 00 44 lw r11,(sp+68)
8001184: 2b 8c 00 40 lw r12,(sp+64)
8001188: 2b 8d 00 3c lw r13,(sp+60)
800118c: 2b 8e 00 38 lw r14,(sp+56)
8001190: 2b 8f 00 34 lw r15,(sp+52)
8001194: 2b 90 00 30 lw r16,(sp+48)
8001198: 2b 91 00 2c lw r17,(sp+44)
800119c: 2b 92 00 28 lw r18,(sp+40)
80011a0: 2b 93 00 24 lw r19,(sp+36)
80011a4: 2b 94 00 20 lw r20,(sp+32)
80011a8: 2b 95 00 1c lw r21,(sp+28)
80011ac: 2b 96 00 18 lw r22,(sp+24)
80011b0: 2b 97 00 14 lw r23,(sp+20)
80011b4: 2b 98 00 10 lw r24,(sp+16)
80011b8: 2b 99 00 0c lw r25,(sp+12)
80011bc: 2b 9b 00 08 lw fp,(sp+8)
80011c0: 37 9c 00 80 addi sp,sp,128
80011c4: c3 a0 00 00 ret
08001494 <rtems_bdpart_get_disk_data>:
const char *disk_name,
int *fd_ptr,
rtems_disk_device **dd_ptr,
rtems_blkdev_bnum *disk_end
)
{
8001494: 37 9c ff e4 addi sp,sp,-28
8001498: 5b 8b 00 18 sw (sp+24),r11
800149c: 5b 8c 00 14 sw (sp+20),r12
80014a0: 5b 8d 00 10 sw (sp+16),r13
80014a4: 5b 8e 00 0c sw (sp+12),r14
80014a8: 5b 8f 00 08 sw (sp+8),r15
80014ac: 5b 9d 00 04 sw (sp+4),ra
80014b0: b8 40 70 00 mv r14,r2
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);
80014b4: 34 02 00 02 mvi r2,2
const char *disk_name,
int *fd_ptr,
rtems_disk_device **dd_ptr,
rtems_blkdev_bnum *disk_end
)
{
80014b8: b8 60 68 00 mv r13,r3
80014bc: b8 80 78 00 mv r15,r4
rtems_status_code sc = RTEMS_SUCCESSFUL;
int rv = 0;
int fd = -1;
rtems_disk_device *dd = NULL;
80014c0: 5b 80 00 1c sw (sp+28),r0
rtems_blkdev_bnum disk_begin = 0;
rtems_blkdev_bnum block_size = 0;
/* Open device file */
fd = open( disk_name, O_RDWR);
80014c4: f8 00 0e e0 calli 8005044 <open>
80014c8: b8 20 60 00 mv r12,r1
if (fd < 0) {
sc = RTEMS_INVALID_NAME;
80014cc: 34 0b 00 03 mvi r11,3
rtems_blkdev_bnum disk_begin = 0;
rtems_blkdev_bnum block_size = 0;
/* Open device file */
fd = open( disk_name, O_RDWR);
if (fd < 0) {
80014d0: 48 01 00 12 bg r0,r1,8001518 <rtems_bdpart_get_disk_data+0x84><== NEVER TAKEN
static inline int rtems_disk_fd_get_disk_device(
int fd,
rtems_disk_device **dd_ptr
)
{
return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr);
80014d4: 78 03 08 02 mvhi r3,0x802
80014d8: 38 63 61 04 ori r3,r3,0x6104
80014dc: 28 62 00 00 lw r2,(r3+0)
80014e0: 37 83 00 1c addi r3,sp,28
80014e4: f8 00 0b 46 calli 80041fc <ioctl>
goto error;
}
/* Get disk handle */
rv = rtems_disk_fd_get_disk_device( fd, &dd);
if (rv != 0) {
80014e8: 5c 20 00 0c bne r1,r0,8001518 <rtems_bdpart_get_disk_data+0x84><== NEVER TAKEN
sc = RTEMS_INVALID_NAME;
goto error;
}
/* Get disk begin, end and block size */
disk_begin = dd->start;
80014ec: 2b 81 00 1c lw r1,(sp+28)
*disk_end = dd->size;
block_size = dd->block_size;
/* Check block size */
if (block_size < RTEMS_BDPART_BLOCK_SIZE) {
sc = RTEMS_IO_ERROR;
80014f0: 34 0b 00 1b mvi r11,27
goto error;
}
/* Get disk begin, end and block size */
disk_begin = dd->start;
*disk_end = dd->size;
80014f4: 28 23 00 1c lw r3,(r1+28)
sc = RTEMS_INVALID_NAME;
goto error;
}
/* Get disk begin, end and block size */
disk_begin = dd->start;
80014f8: 28 22 00 18 lw r2,(r1+24)
*disk_end = dd->size;
80014fc: 59 e3 00 00 sw (r15+0),r3
block_size = dd->block_size;
/* Check block size */
if (block_size < RTEMS_BDPART_BLOCK_SIZE) {
8001500: 28 21 00 24 lw r1,(r1+36)
8001504: 34 03 01 ff mvi r3,511
8001508: 50 61 00 04 bgeu r3,r1,8001518 <rtems_bdpart_get_disk_data+0x84><== NEVER TAKEN
int *fd_ptr,
rtems_disk_device **dd_ptr,
rtems_blkdev_bnum *disk_end
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
800150c: 7c 4b 00 00 cmpnei r11,r2,0
8001510: c8 0b 58 00 sub r11,r0,r11
8001514: 21 6b 00 1b andi r11,r11,0x1b
goto error;
}
error:
if (sc == RTEMS_SUCCESSFUL && fd_ptr != NULL && dd_ptr != NULL) {
8001518: 65 62 00 00 cmpei r2,r11,0
800151c: 7d c1 00 00 cmpnei r1,r14,0
8001520: a0 41 08 00 and r1,r2,r1
8001524: 44 20 00 06 be r1,r0,800153c <rtems_bdpart_get_disk_data+0xa8>
8001528: 45 a0 00 05 be r13,r0,800153c <rtems_bdpart_get_disk_data+0xa8><== NEVER TAKEN
*fd_ptr = fd;
*dd_ptr = dd;
800152c: 2b 81 00 1c lw r1,(sp+28)
}
error:
if (sc == RTEMS_SUCCESSFUL && fd_ptr != NULL && dd_ptr != NULL) {
*fd_ptr = fd;
8001530: 59 cc 00 00 sw (r14+0),r12
*dd_ptr = dd;
8001534: 59 a1 00 00 sw (r13+0),r1
8001538: e0 00 00 03 bi 8001544 <rtems_bdpart_get_disk_data+0xb0>
} else {
close( fd);
800153c: b9 80 08 00 mv r1,r12
8001540: f8 00 0a 6b calli 8003eec <close>
}
return sc;
}
8001544: b9 60 08 00 mv r1,r11
8001548: 2b 9d 00 04 lw ra,(sp+4)
800154c: 2b 8b 00 18 lw r11,(sp+24)
8001550: 2b 8c 00 14 lw r12,(sp+20)
8001554: 2b 8d 00 10 lw r13,(sp+16)
8001558: 2b 8e 00 0c lw r14,(sp+12)
800155c: 2b 8f 00 08 lw r15,(sp+8)
8001560: 37 9c 00 1c addi sp,sp,28
8001564: c3 a0 00 00 ret
0801fd98 <rtems_bdpart_mount>:
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
801fd98: 37 9c ff d4 addi sp,sp,-44 <== NOT EXECUTED
801fd9c: 5b 8b 00 2c sw (sp+44),r11 <== NOT EXECUTED
801fda0: 5b 8c 00 28 sw (sp+40),r12 <== NOT EXECUTED
801fda4: 5b 8d 00 24 sw (sp+36),r13 <== NOT EXECUTED
801fda8: 5b 8e 00 20 sw (sp+32),r14 <== NOT EXECUTED
801fdac: 5b 8f 00 1c sw (sp+28),r15 <== NOT EXECUTED
801fdb0: 5b 90 00 18 sw (sp+24),r16 <== NOT EXECUTED
801fdb4: 5b 91 00 14 sw (sp+20),r17 <== NOT EXECUTED
801fdb8: 5b 92 00 10 sw (sp+16),r18 <== NOT EXECUTED
801fdbc: 5b 93 00 0c sw (sp+12),r19 <== NOT EXECUTED
801fdc0: 5b 94 00 08 sw (sp+8),r20 <== NOT EXECUTED
801fdc4: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
rtems_status_code esc = RTEMS_SUCCESSFUL;
const char *disk_file_name = strrchr( disk_name, '/');
801fdc8: 34 02 00 2f mvi r2,47 <== NOT EXECUTED
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
801fdcc: b8 80 98 00 mv r19,r4 <== NOT EXECUTED
801fdd0: b8 60 a0 00 mv r20,r3 <== NOT EXECUTED
801fdd4: b8 20 88 00 mv r17,r1 <== NOT EXECUTED
rtems_status_code esc = RTEMS_SUCCESSFUL;
const char *disk_file_name = strrchr( disk_name, '/');
801fdd8: f8 00 86 54 calli 8041728 <strrchr> <== NOT EXECUTED
801fddc: b8 20 58 00 mv r11,r1 <== 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);
801fde0: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
801fde4: f8 00 82 76 calli 80407bc <strlen> <== NOT EXECUTED
801fde8: b8 20 70 00 mv r14,r1 <== NOT EXECUTED
size_t mount_base_size = strlen( mount_base);
801fdec: ba 60 08 00 mv r1,r19 <== NOT EXECUTED
801fdf0: f8 00 82 73 calli 80407bc <strlen> <== NOT EXECUTED
801fdf4: b8 20 78 00 mv r15,r1 <== NOT EXECUTED
size_t i = 0;
/* Create logical disk name base */
logical_disk_name = malloc( disk_name_size + RTEMS_BDPART_NUMBER_SIZE);
801fdf8: 35 c1 00 04 addi r1,r14,4 <== NOT EXECUTED
801fdfc: fb ff 85 ab calli 80014a8 <malloc> <== NOT EXECUTED
801fe00: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
if (logical_disk_name == NULL) {
return RTEMS_NO_MEMORY;
801fe04: 34 0c 00 1a mvi r12,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) {
801fe08: 44 20 00 48 be r1,r0,801ff28 <rtems_bdpart_mount+0x190> <== NOT EXECUTED
return RTEMS_NO_MEMORY;
}
strncpy( logical_disk_name, disk_name, disk_name_size);
801fe0c: ba 20 10 00 mv r2,r17 <== NOT EXECUTED
801fe10: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
801fe14: f8 00 83 0d calli 8040a48 <strncpy> <== NOT EXECUTED
if (disk_file_name != NULL) {
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;
801fe18: b9 c0 80 00 mv r16,r14 <== NOT EXECUTED
return RTEMS_NO_MEMORY;
}
strncpy( logical_disk_name, disk_name, disk_name_size);
/* Get disk file name */
if (disk_file_name != NULL) {
801fe1c: 45 60 00 05 be r11,r0,801fe30 <rtems_bdpart_mount+0x98> <== NOT EXECUTED
disk_file_name += 1;
801fe20: 35 71 00 01 addi r17,r11,1 <== NOT EXECUTED
disk_file_name_size = strlen( disk_file_name);
801fe24: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
801fe28: f8 00 82 65 calli 80407bc <strlen> <== NOT EXECUTED
801fe2c: b8 20 80 00 mv r16,r1 <== 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);
801fe30: b6 0f 90 00 add r18,r16,r15 <== NOT EXECUTED
801fe34: 36 41 00 05 addi r1,r18,5 <== NOT EXECUTED
801fe38: fb ff 85 9c calli 80014a8 <malloc> <== NOT EXECUTED
801fe3c: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
if (mount_point == NULL) {
esc = RTEMS_NO_MEMORY;
801fe40: 34 0c 00 1a mvi r12,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) {
801fe44: 44 20 00 35 be r1,r0,801ff18 <rtems_bdpart_mount+0x180> <== NOT EXECUTED
esc = RTEMS_NO_MEMORY;
goto cleanup;
}
strncpy( mount_point, mount_base, mount_base_size);
801fe48: ba 60 10 00 mv r2,r19 <== NOT EXECUTED
801fe4c: b9 e0 18 00 mv r3,r15 <== NOT EXECUTED
801fe50: f8 00 82 fe calli 8040a48 <strncpy> <== NOT EXECUTED
mount_point [mount_base_size] = '/';
801fe54: b5 6f 08 00 add r1,r11,r15 <== NOT EXECUTED
801fe58: 34 02 00 2f mvi r2,47 <== NOT EXECUTED
801fe5c: 30 22 00 00 sb (r1+0),r2 <== NOT EXECUTED
strncpy( mount_point + mount_base_size + 1, disk_file_name, disk_file_name_size);
801fe60: 35 e1 00 01 addi r1,r15,1 <== NOT EXECUTED
801fe64: ba 00 18 00 mv r3,r16 <== NOT EXECUTED
801fe68: b5 61 08 00 add r1,r11,r1 <== NOT EXECUTED
801fe6c: ba 20 10 00 mv r2,r17 <== NOT EXECUTED
/* Markers */
logical_disk_marker = logical_disk_name + disk_name_size;
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
801fe70: 36 52 00 01 addi r18,r18,1 <== 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);
801fe74: 78 10 08 06 mvhi r16,0x806 <== NOT EXECUTED
esc = RTEMS_IO_ERROR;
goto cleanup;
}
/* Mount */
rv = mount(
801fe78: 78 0f 08 05 mvhi r15,0x805 <== NOT EXECUTED
esc = RTEMS_NO_MEMORY;
goto cleanup;
}
strncpy( mount_point, mount_base, mount_base_size);
mount_point [mount_base_size] = '/';
strncpy( mount_point + mount_base_size + 1, disk_file_name, disk_file_name_size);
801fe7c: f8 00 82 f3 calli 8040a48 <strncpy> <== NOT EXECUTED
/* Markers */
logical_disk_marker = logical_disk_name + disk_name_size;
801fe80: b5 ae 70 00 add r14,r13,r14 <== NOT EXECUTED
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
801fe84: b5 72 90 00 add r18,r11,r18 <== NOT EXECUTED
/* Mount supported file systems for each partition */
for (i = 0; i < count; ++i) {
801fe88: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
/* Create logical disk name */
int rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
801fe8c: 3a 10 0a 4c ori r16,r16,0xa4c <== NOT EXECUTED
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
801fe90: 34 13 00 03 mvi r19,3 <== NOT EXECUTED
esc = RTEMS_IO_ERROR;
goto cleanup;
}
/* Mount */
rv = mount(
801fe94: 39 ef ea 74 ori r15,r15,0xea74 <== 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) {
801fe98: e0 00 00 1a bi 801ff00 <rtems_bdpart_mount+0x168> <== NOT EXECUTED
/* Create logical disk name */
int rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
801fe9c: 35 8c 00 01 addi r12,r12,1 <== NOT EXECUTED
801fea0: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
801fea4: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
801fea8: ba 00 18 00 mv r3,r16 <== NOT EXECUTED
801feac: b9 80 20 00 mv r4,r12 <== NOT EXECUTED
801feb0: f8 00 7e aa calli 803f958 <snprintf> <== NOT EXECUTED
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
801feb4: 48 33 00 16 bg r1,r19,801ff0c <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);
801feb8: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
801febc: 34 03 00 04 mvi r3,4 <== NOT EXECUTED
801fec0: ba 40 08 00 mv r1,r18 <== NOT EXECUTED
801fec4: f8 00 82 e1 calli 8040a48 <strncpy> <== NOT EXECUTED
rv = rtems_mkdir( mount_point, S_IRWXU | S_IRWXG | S_IRWXO);
801fec8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801fecc: 34 02 01 ff mvi r2,511 <== NOT EXECUTED
801fed0: f8 00 12 c0 calli 80249d0 <rtems_mkdir> <== NOT EXECUTED
801fed4: b8 20 88 00 mv r17,r1 <== NOT EXECUTED
if (rv != 0) {
801fed8: 5c 20 00 0f bne r1,r0,801ff14 <rtems_bdpart_mount+0x17c> <== NOT EXECUTED
esc = RTEMS_IO_ERROR;
goto cleanup;
}
/* Mount */
rv = mount(
801fedc: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
801fee0: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801fee4: b9 e0 18 00 mv r3,r15 <== NOT EXECUTED
801fee8: 34 04 00 00 mvi r4,0 <== NOT EXECUTED
801feec: 34 05 00 00 mvi r5,0 <== NOT EXECUTED
801fef0: fb ff 86 0f calli 800172c <mount> <== NOT EXECUTED
mount_point,
"msdos",
0,
NULL
);
if (rv != 0) {
801fef4: 44 31 00 03 be r1,r17,801ff00 <rtems_bdpart_mount+0x168> <== NOT EXECUTED
rmdir( mount_point);
801fef8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801fefc: f8 00 12 7f calli 80248f8 <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) {
801ff00: 56 8c ff e7 bgu r20,r12,801fe9c <rtems_bdpart_mount+0x104> <== NOT EXECUTED
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
rtems_status_code esc = RTEMS_SUCCESSFUL;
801ff04: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
801ff08: e0 00 00 04 bi 801ff18 <rtems_bdpart_mount+0x180> <== 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;
801ff0c: 34 0c 00 03 mvi r12,3 <== NOT EXECUTED
801ff10: e0 00 00 02 bi 801ff18 <rtems_bdpart_mount+0x180> <== 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;
801ff14: 34 0c 00 1b mvi r12,27 <== NOT EXECUTED
}
}
cleanup:
free( logical_disk_name);
801ff18: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
801ff1c: fb ff 84 67 calli 80010b8 <free> <== NOT EXECUTED
free( mount_point);
801ff20: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801ff24: fb ff 84 65 calli 80010b8 <free> <== NOT EXECUTED
return esc;
}
801ff28: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801ff2c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
801ff30: 2b 8b 00 2c lw r11,(sp+44) <== NOT EXECUTED
801ff34: 2b 8c 00 28 lw r12,(sp+40) <== NOT EXECUTED
801ff38: 2b 8d 00 24 lw r13,(sp+36) <== NOT EXECUTED
801ff3c: 2b 8e 00 20 lw r14,(sp+32) <== NOT EXECUTED
801ff40: 2b 8f 00 1c lw r15,(sp+28) <== NOT EXECUTED
801ff44: 2b 90 00 18 lw r16,(sp+24) <== NOT EXECUTED
801ff48: 2b 91 00 14 lw r17,(sp+20) <== NOT EXECUTED
801ff4c: 2b 92 00 10 lw r18,(sp+16) <== NOT EXECUTED
801ff50: 2b 93 00 0c lw r19,(sp+12) <== NOT EXECUTED
801ff54: 2b 94 00 08 lw r20,(sp+8) <== NOT EXECUTED
801ff58: 37 9c 00 2c addi sp,sp,44 <== NOT EXECUTED
801ff5c: c3 a0 00 00 ret <== NOT EXECUTED
08001b28 <rtems_bdpart_new_record>:
static rtems_status_code rtems_bdpart_new_record(
rtems_disk_device *dd,
rtems_blkdev_bnum index,
rtems_bdbuf_buffer **block
)
{
8001b28: 37 9c ff ec addi sp,sp,-20
8001b2c: 5b 8b 00 10 sw (sp+16),r11
8001b30: 5b 8c 00 0c sw (sp+12),r12
8001b34: 5b 8d 00 08 sw (sp+8),r13
8001b38: 5b 9d 00 04 sw (sp+4),ra
8001b3c: b8 60 60 00 mv r12,r3
rtems_status_code sc = RTEMS_SUCCESSFUL;
/* Synchronize previous block if necessary */
if (*block != NULL) {
8001b40: 28 63 00 00 lw r3,(r3+0)
static rtems_status_code rtems_bdpart_new_record(
rtems_disk_device *dd,
rtems_blkdev_bnum index,
rtems_bdbuf_buffer **block
)
{
8001b44: b8 20 68 00 mv r13,r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
/* Synchronize previous block if necessary */
if (*block != NULL) {
8001b48: 44 60 00 07 be r3,r0,8001b64 <rtems_bdpart_new_record+0x3c>
sc = rtems_bdbuf_sync( *block);
8001b4c: b8 60 08 00 mv r1,r3
8001b50: 5b 82 00 14 sw (sp+20),r2
8001b54: f8 00 2e b8 calli 800d634 <rtems_bdbuf_sync>
8001b58: b8 20 58 00 mv r11,r1
if (sc != RTEMS_SUCCESSFUL) {
8001b5c: 2b 82 00 14 lw r2,(sp+20)
8001b60: 5c 20 00 16 bne r1,r0,8001bb8 <rtems_bdpart_new_record+0x90><== NEVER TAKEN
return sc;
}
}
/* Read the new record block (this accounts for disk block sizes > 512) */
sc = rtems_bdbuf_read( dd, index, block);
8001b64: b9 a0 08 00 mv r1,r13
8001b68: b9 80 18 00 mv r3,r12
8001b6c: f8 00 2d d7 calli 800d2c8 <rtems_bdbuf_read>
8001b70: b8 20 58 00 mv r11,r1
if (sc != RTEMS_SUCCESSFUL) {
8001b74: 5c 20 00 11 bne r1,r0,8001bb8 <rtems_bdpart_new_record+0x90><== NEVER TAKEN
return sc;
}
/* just in case block did not get filled in */
if ( *block == NULL ) {
8001b78: 29 81 00 00 lw r1,(r12+0)
8001b7c: 44 2b 00 0e be r1,r11,8001bb4 <rtems_bdpart_new_record+0x8c><== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
}
/* Clear record */
memset( (*block)->buffer, 0, RTEMS_BDPART_BLOCK_SIZE);
8001b80: 28 21 00 1c lw r1,(r1+28)
8001b84: 34 02 00 00 mvi r2,0
8001b88: 34 03 02 00 mvi r3,512
8001b8c: f8 00 4a 1e calli 8014404 <memset>
/* Write signature */
(*block)->buffer [RTEMS_BDPART_MBR_OFFSET_SIGNATURE_0] =
8001b90: 29 81 00 00 lw r1,(r12+0)
8001b94: 34 02 00 55 mvi r2,85
8001b98: 28 21 00 1c lw r1,(r1+28)
8001b9c: 30 22 01 fe sb (r1+510),r2
RTEMS_BDPART_MBR_SIGNATURE_0;
(*block)->buffer [RTEMS_BDPART_MBR_OFFSET_SIGNATURE_1] =
8001ba0: 29 81 00 00 lw r1,(r12+0)
8001ba4: 34 02 ff aa mvi r2,-86
8001ba8: 28 21 00 1c lw r1,(r1+28)
8001bac: 30 22 01 ff sb (r1+511),r2
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
8001bb0: e0 00 00 02 bi 8001bb8 <rtems_bdpart_new_record+0x90>
return sc;
}
/* just in case block did not get filled in */
if ( *block == NULL ) {
return RTEMS_INVALID_ADDRESS;
8001bb4: 34 0b 00 09 mvi r11,9 <== NOT EXECUTED
RTEMS_BDPART_MBR_SIGNATURE_0;
(*block)->buffer [RTEMS_BDPART_MBR_OFFSET_SIGNATURE_1] =
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
8001bb8: b9 60 08 00 mv r1,r11
8001bbc: 2b 9d 00 04 lw ra,(sp+4)
8001bc0: 2b 8b 00 10 lw r11,(sp+16)
8001bc4: 2b 8c 00 0c lw r12,(sp+12)
8001bc8: 2b 8d 00 08 lw r13,(sp+8)
8001bcc: 37 9c 00 14 addi sp,sp,20
8001bd0: c3 a0 00 00 ret
08001568 <rtems_bdpart_read>:
const char *disk_name,
rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
size_t *count
)
{
8001568: 37 9c ff bc addi sp,sp,-68
800156c: 5b 8b 00 2c sw (sp+44),r11
8001570: 5b 8c 00 28 sw (sp+40),r12
8001574: 5b 8d 00 24 sw (sp+36),r13
8001578: 5b 8e 00 20 sw (sp+32),r14
800157c: 5b 8f 00 1c sw (sp+28),r15
8001580: 5b 90 00 18 sw (sp+24),r16
8001584: 5b 91 00 14 sw (sp+20),r17
8001588: 5b 92 00 10 sw (sp+16),r18
800158c: 5b 93 00 0c sw (sp+12),r19
8001590: 5b 94 00 08 sw (sp+8),r20
8001594: 5b 9d 00 04 sw (sp+4),ra
8001598: b8 20 58 00 mv r11,r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *block = NULL;
rtems_bdpart_partition *p = pt - 1;
800159c: 34 61 ff d0 addi r1,r3,-48
size_t *count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *block = NULL;
80015a0: 5b 80 00 44 sw (sp+68),r0
rtems_bdpart_partition *p = pt - 1;
80015a4: 5b 81 00 40 sw (sp+64),r1
const char *disk_name,
rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
size_t *count
)
{
80015a8: b8 40 78 00 mv r15,r2
80015ac: b8 60 70 00 mv r14,r3
80015b0: b8 80 68 00 mv r13,r4
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);
80015b4: 34 10 00 00 mvi r16,0
80015b8: 44 80 00 05 be r4,r0,80015cc <rtems_bdpart_read+0x64> <== NEVER TAKEN
80015bc: 28 81 00 00 lw r1,(r4+0)
80015c0: 34 02 00 30 mvi r2,48
80015c4: fb ff fc 7f calli 80007c0 <__mulsi3>
80015c8: b8 20 80 00 mv r16,r1
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;
80015cc: 34 01 ff ff mvi r1,-1
80015d0: 5b 81 00 34 sw (sp+52),r1
rtems_disk_device *dd = NULL;
/* Check parameter */
if (format == NULL || pt == NULL || count == NULL) {
80015d4: 65 c2 00 00 cmpei r2,r14,0
80015d8: 65 e1 00 00 cmpei r1,r15,0
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *block = NULL;
rtems_bdpart_partition *p = pt - 1;
const rtems_bdpart_partition *p_end = pt + (count != NULL ? *count : 0);
rtems_blkdev_bnum ep_begin = 0; /* Extended partition begin */
80015dc: 5b 80 00 3c sw (sp+60),r0
rtems_blkdev_bnum ebr = 0; /* Extended boot record block index */
rtems_blkdev_bnum disk_end = 0;
80015e0: 5b 80 00 38 sw (sp+56),r0
size_t i = 0;
const uint8_t *data = NULL;
int fd = -1;
rtems_disk_device *dd = NULL;
80015e4: 5b 80 00 30 sw (sp+48),r0
/* Check parameter */
if (format == NULL || pt == NULL || count == NULL) {
80015e8: b8 41 10 00 or r2,r2,r1
return RTEMS_INVALID_ADDRESS;
80015ec: 34 0c 00 09 mvi r12,9
const uint8_t *data = NULL;
int fd = -1;
rtems_disk_device *dd = NULL;
/* Check parameter */
if (format == NULL || pt == NULL || count == NULL) {
80015f0: 5c 40 00 77 bne r2,r0,80017cc <rtems_bdpart_read+0x264> <== NEVER TAKEN
80015f4: 45 a2 00 76 be r13,r2,80017cc <rtems_bdpart_read+0x264> <== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
}
/* Set count to a save value */
*count = 0;
80015f8: 59 a0 00 00 sw (r13+0),r0
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
80015fc: b9 60 08 00 mv r1,r11
8001600: 37 82 00 34 addi r2,sp,52
8001604: 37 83 00 30 addi r3,sp,48
8001608: 37 84 00 38 addi r4,sp,56
800160c: fb ff ff a2 calli 8001494 <rtems_bdpart_get_disk_data>
8001610: b8 20 60 00 mv r12,r1
if (sc != RTEMS_SUCCESSFUL) {
8001614: 5c 20 00 6e bne r1,r0,80017cc <rtems_bdpart_read+0x264> <== NEVER TAKEN
return sc;
}
/* Read MBR */
sc = rtems_bdpart_read_record( dd, 0, &block);
8001618: 2b 81 00 30 lw r1,(sp+48)
800161c: 34 02 00 00 mvi r2,0
8001620: 37 83 00 44 addi r3,sp,68
8001624: fb ff fe ff calli 8001220 <rtems_bdpart_read_record>
8001628: b8 20 88 00 mv r17,r1
if (sc != RTEMS_SUCCESSFUL) {
800162c: b8 20 58 00 mv r11,r1
8001630: 5c 2c 00 60 bne r1,r12,80017b0 <rtems_bdpart_read+0x248> <== NEVER TAKEN
esc = sc;
goto cleanup;
}
/* Read the first partition entry */
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
8001634: 2b 81 00 44 lw r1,(sp+68)
{
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);
8001638: b5 d0 80 00 add r16,r14,r16
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);
800163c: 37 93 00 40 addi r19,sp,64
esc = sc;
goto cleanup;
}
/* Read the first partition entry */
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
8001640: 28 34 00 1c lw r20,(r1+28)
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
8001644: 37 92 00 3c addi r18,sp,60
8001648: ba 60 10 00 mv r2,r19
esc = sc;
goto cleanup;
}
/* Read the first partition entry */
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
800164c: 36 8c 01 be addi r12,r20,446
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
8001650: b9 80 08 00 mv r1,r12
8001654: ba 00 18 00 mv r3,r16
8001658: ba 40 20 00 mv r4,r18
800165c: fb ff ff 47 calli 8001378 <rtems_bdpart_read_mbr_partition>
if (sc != RTEMS_SUCCESSFUL) {
8001660: b8 20 58 00 mv r11,r1
8001664: 5c 31 00 53 bne r1,r17,80017b0 <rtems_bdpart_read+0x248> <== NEVER TAKEN
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) {
8001668: 2b 81 00 40 lw r1,(sp+64)
esc = RTEMS_NOT_IMPLEMENTED;
800166c: 34 0b 00 18 mvi r11,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) {
8001670: 40 22 00 08 lbu r2,(r1+8)
8001674: 34 01 00 ee mvi r1,238
8001678: 44 41 00 4e be r2,r1,80017b0 <rtems_bdpart_read+0x248> <== NEVER TAKEN
}
/* 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
800167c: 2b 81 00 44 lw r1,(sp+68)
esc = RTEMS_NOT_IMPLEMENTED;
goto cleanup;
}
/* Set format */
format->type = RTEMS_BDPART_FORMAT_MBR;
8001680: 59 e0 00 00 sw (r15+0),r0
}
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_read(
8001684: 36 94 01 ee addi r20,r20,494
goto cleanup;
}
/* Set format */
format->type = RTEMS_BDPART_FORMAT_MBR;
format->mbr.disk_id = rtems_uint32_from_little_endian(
8001688: 28 21 00 1c lw r1,(r1+28)
/* Iterate through the rest of the primary partition table */
for (i = 1; i < 4; ++i) {
data += RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE;
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
800168c: ba 60 58 00 mv r11,r19
goto cleanup;
}
/* Set format */
format->type = RTEMS_BDPART_FORMAT_MBR;
format->mbr.disk_id = rtems_uint32_from_little_endian(
8001690: 34 21 01 b8 addi r1,r1,440
8001694: fb ff fe cd calli 80011c8 <rtems_uint32_from_little_endian>
8001698: 59 e1 00 04 sw (r15+4),r1
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
);
format->mbr.dos_compatibility = true;
800169c: 34 01 00 01 mvi r1,1
80016a0: 31 e1 00 08 sb (r15+8),r1
/* Iterate through the rest of the primary partition table */
for (i = 1; i < 4; ++i) {
data += RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE;
80016a4: 35 8c 00 10 addi r12,r12,16
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
80016a8: b9 80 08 00 mv r1,r12
80016ac: b9 60 10 00 mv r2,r11
80016b0: ba 00 18 00 mv r3,r16
80016b4: ba 40 20 00 mv r4,r18
80016b8: fb ff ff 30 calli 8001378 <rtems_bdpart_read_mbr_partition>
if (sc != RTEMS_SUCCESSFUL) {
80016bc: 5c 20 00 38 bne r1,r0,800179c <rtems_bdpart_read+0x234> <== NEVER TAKEN
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) {
80016c0: 5d 94 ff f9 bne r12,r20,80016a4 <rtems_bdpart_read+0x13c>
goto cleanup;
}
}
/* Iterate through the logical partitions within the extended partition */
ebr = ep_begin;
80016c4: 2b 8c 00 3c lw r12,(sp+60)
esc = sc;
goto cleanup;
}
/* Read first partition entry */
sc = rtems_bdpart_read_mbr_partition(
80016c8: b9 60 90 00 mv r18,r11
{
rtems_blkdev_bnum begin =
rtems_uint32_from_little_endian( data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
uint8_t type = data [RTEMS_BDPART_MBR_OFFSET_TYPE];
if (type == RTEMS_BDPART_MBR_EXTENDED) {
80016cc: 34 11 00 05 mvi r17,5
}
}
/* Iterate through the logical partitions within the extended partition */
ebr = ep_begin;
while (ebr != 0) {
80016d0: e0 00 00 26 bi 8001768 <rtems_bdpart_read+0x200>
rtems_blkdev_bnum tmp = 0;
/* Read EBR */
sc = rtems_bdpart_read_record( dd, ebr, &block);
80016d4: 2b 81 00 30 lw r1,(sp+48)
80016d8: b9 80 10 00 mv r2,r12
80016dc: 37 83 00 44 addi r3,sp,68
80016e0: fb ff fe d0 calli 8001220 <rtems_bdpart_read_record>
80016e4: b8 20 78 00 mv r15,r1
if (sc != RTEMS_SUCCESSFUL) {
80016e8: 5c 20 00 2f bne r1,r0,80017a4 <rtems_bdpart_read+0x23c> <== NEVER TAKEN
goto cleanup;
}
/* Read first partition entry */
sc = rtems_bdpart_read_mbr_partition(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0,
80016ec: 2b 81 00 44 lw r1,(sp+68)
esc = sc;
goto cleanup;
}
/* Read first partition entry */
sc = rtems_bdpart_read_mbr_partition(
80016f0: ba 40 10 00 mv r2,r18
80016f4: ba 00 18 00 mv r3,r16
80016f8: 28 21 00 1c lw r1,(r1+28)
80016fc: 34 04 00 00 mvi r4,0
8001700: 34 21 01 be addi r1,r1,446
8001704: fb ff ff 1d calli 8001378 <rtems_bdpart_read_mbr_partition>
8001708: b8 20 58 00 mv r11,r1
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0,
&p,
p_end,
NULL
);
if (sc != RTEMS_SUCCESSFUL) {
800170c: 5c 2f 00 29 bne r1,r15,80017b0 <rtems_bdpart_read+0x248> <== NEVER TAKEN
esc = sc;
goto cleanup;
}
/* Adjust partition begin */
tmp = p->begin + ebr;
8001710: 2b 85 00 40 lw r5,(sp+64)
8001714: 28 a2 00 00 lw r2,(r5+0)
8001718: b5 82 08 00 add r1,r12,r2
if (tmp > p->begin) {
800171c: 50 41 00 24 bgeu r2,r1,80017ac <rtems_bdpart_read+0x244> <== NEVER TAKEN
p->begin = tmp;
8001720: 58 a1 00 00 sw (r5+0),r1
esc = RTEMS_IO_ERROR;
goto cleanup;
}
/* Adjust partition end */
tmp = p->end + ebr;
8001724: 28 a1 00 04 lw r1,(r5+4)
8001728: b5 81 60 00 add r12,r12,r1
if (tmp > p->end) {
800172c: 50 2c 00 20 bgeu r1,r12,80017ac <rtems_bdpart_read+0x244> <== NEVER TAKEN
goto cleanup;
}
/* Read second partition entry for next EBR block */
ebr = rtems_bdpart_next_ebr(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_1
8001730: 2b 81 00 44 lw r1,(sp+68)
}
/* Adjust partition end */
tmp = p->end + ebr;
if (tmp > p->end) {
p->end = tmp;
8001734: 58 ac 00 04 sw (r5+4),r12
esc = RTEMS_IO_ERROR;
goto cleanup;
}
/* Read second partition entry for next EBR block */
ebr = rtems_bdpart_next_ebr(
8001738: 28 21 00 1c lw r1,(r1+28)
800173c: 34 2f 01 ce addi r15,r1,462
== RTEMS_BDPART_MBR_SIGNATURE_1;
}
static rtems_blkdev_bnum rtems_bdpart_next_ebr( const uint8_t *data)
{
rtems_blkdev_bnum begin =
8001740: 34 21 01 d6 addi r1,r1,470
8001744: fb ff fe a1 calli 80011c8 <rtems_uint32_from_little_endian>
8001748: b8 20 60 00 mv r12,r1
rtems_uint32_from_little_endian( data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
uint8_t type = data [RTEMS_BDPART_MBR_OFFSET_TYPE];
if (type == RTEMS_BDPART_MBR_EXTENDED) {
800174c: 41 e1 00 04 lbu r1,(r15+4)
8001750: 5c 31 00 07 bne r1,r17,800176c <rtems_bdpart_read+0x204>
/* Read second partition entry for next EBR block */
ebr = rtems_bdpart_next_ebr(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_1
);
if (ebr != 0) {
8001754: 45 8b 00 05 be r12,r11,8001768 <rtems_bdpart_read+0x200> <== NEVER TAKEN
/* Adjust partition EBR block index */
tmp = ebr + ep_begin;
8001758: 2b 81 00 3c lw r1,(sp+60)
800175c: b5 81 08 00 add r1,r12,r1
if (tmp > ebr) {
8001760: 51 81 00 13 bgeu r12,r1,80017ac <rtems_bdpart_read+0x244> <== NEVER TAKEN
8001764: b8 20 60 00 mv r12,r1
}
}
/* Iterate through the logical partitions within the extended partition */
ebr = ep_begin;
while (ebr != 0) {
8001768: 5d 80 ff db bne r12,r0,80016d4 <rtems_bdpart_read+0x16c> <== ALWAYS TAKEN
}
}
}
/* Return partition count */
*count = (size_t) (p - pt + 1);
800176c: 2b 81 00 40 lw r1,(sp+64)
8001770: 34 02 00 04 mvi r2,4
rtems_bdpart_partition *pt,
size_t *count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
8001774: 34 0b 00 00 mvi r11,0
}
}
}
/* Return partition count */
*count = (size_t) (p - pt + 1);
8001778: c8 2e 08 00 sub r1,r1,r14
800177c: f8 00 8f 88 calli 802559c <__ashrsi3>
8001780: 78 03 08 02 mvhi r3,0x802
8001784: 38 63 64 84 ori r3,r3,0x6484
8001788: 28 62 00 00 lw r2,(r3+0)
800178c: fb ff fc 0d calli 80007c0 <__mulsi3>
8001790: 34 21 00 01 addi r1,r1,1
8001794: 59 a1 00 00 sw (r13+0),r1
8001798: e0 00 00 06 bi 80017b0 <rtems_bdpart_read+0x248>
/* Iterate through the rest of the primary partition table */
for (i = 1; i < 4; ++i) {
data += RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE;
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
800179c: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
80017a0: e0 00 00 04 bi 80017b0 <rtems_bdpart_read+0x248> <== NOT EXECUTED
ebr = ep_begin;
while (ebr != 0) {
rtems_blkdev_bnum tmp = 0;
/* Read EBR */
sc = rtems_bdpart_read_record( dd, ebr, &block);
80017a4: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
80017a8: e0 00 00 02 bi 80017b0 <rtems_bdpart_read+0x248> <== NOT EXECUTED
/* Adjust partition EBR block index */
tmp = ebr + ep_begin;
if (tmp > ebr) {
ebr = tmp;
} else {
esc = RTEMS_IO_ERROR;
80017ac: 34 0b 00 1b mvi r11,27 <== NOT EXECUTED
/* Return partition count */
*count = (size_t) (p - pt + 1);
cleanup:
if (fd >= 0) {
80017b0: 2b 81 00 34 lw r1,(sp+52)
80017b4: 48 01 00 02 bg r0,r1,80017bc <rtems_bdpart_read+0x254> <== NEVER TAKEN
close( fd);
80017b8: f8 00 09 cd calli 8003eec <close>
}
if (block != NULL) {
80017bc: 2b 81 00 44 lw r1,(sp+68)
rtems_bdbuf_release( block);
}
return esc;
80017c0: b9 60 60 00 mv r12,r11
if (fd >= 0) {
close( fd);
}
if (block != NULL) {
80017c4: 44 20 00 02 be r1,r0,80017cc <rtems_bdpart_read+0x264> <== NEVER TAKEN
rtems_bdbuf_release( block);
80017c8: f8 00 2f 4a calli 800d4f0 <rtems_bdbuf_release>
}
return esc;
}
80017cc: b9 80 08 00 mv r1,r12
80017d0: 2b 9d 00 04 lw ra,(sp+4)
80017d4: 2b 8b 00 2c lw r11,(sp+44)
80017d8: 2b 8c 00 28 lw r12,(sp+40)
80017dc: 2b 8d 00 24 lw r13,(sp+36)
80017e0: 2b 8e 00 20 lw r14,(sp+32)
80017e4: 2b 8f 00 1c lw r15,(sp+28)
80017e8: 2b 90 00 18 lw r16,(sp+24)
80017ec: 2b 91 00 14 lw r17,(sp+20)
80017f0: 2b 92 00 10 lw r18,(sp+16)
80017f4: 2b 93 00 0c lw r19,(sp+12)
80017f8: 2b 94 00 08 lw r20,(sp+8)
80017fc: 37 9c 00 44 addi sp,sp,68
8001800: c3 a0 00 00 ret
08001378 <rtems_bdpart_read_mbr_partition>:
const uint8_t *data,
rtems_bdpart_partition **p,
const rtems_bdpart_partition *p_end,
rtems_blkdev_bnum *ep_begin
)
{
8001378: 37 9c ff e4 addi sp,sp,-28
800137c: 5b 8b 00 1c sw (sp+28),r11
8001380: 5b 8c 00 18 sw (sp+24),r12
8001384: 5b 8d 00 14 sw (sp+20),r13
8001388: 5b 8e 00 10 sw (sp+16),r14
800138c: 5b 8f 00 0c sw (sp+12),r15
8001390: 5b 90 00 08 sw (sp+8),r16
8001394: 5b 9d 00 04 sw (sp+4),ra
8001398: b8 20 60 00 mv r12,r1
rtems_blkdev_bnum begin =
800139c: 34 21 00 08 addi r1,r1,8
const uint8_t *data,
rtems_bdpart_partition **p,
const rtems_bdpart_partition *p_end,
rtems_blkdev_bnum *ep_begin
)
{
80013a0: b8 40 58 00 mv r11,r2
80013a4: b8 60 78 00 mv r15,r3
80013a8: b8 80 80 00 mv r16,r4
rtems_blkdev_bnum begin =
80013ac: fb ff ff 87 calli 80011c8 <rtems_uint32_from_little_endian>
80013b0: b8 20 68 00 mv r13,r1
rtems_uint32_from_little_endian( data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
rtems_blkdev_bnum size =
80013b4: 35 81 00 0c addi r1,r12,12
80013b8: fb ff ff 84 calli 80011c8 <rtems_uint32_from_little_endian>
rtems_uint32_from_little_endian( data + RTEMS_BDPART_MBR_OFFSET_SIZE);
rtems_blkdev_bnum end = begin + size;
uint8_t type = data [RTEMS_BDPART_MBR_OFFSET_TYPE];
80013bc: 41 8e 00 04 lbu r14,(r12+4)
if (type == RTEMS_BDPART_MBR_EMPTY) {
return RTEMS_SUCCESSFUL;
80013c0: 34 05 00 00 mvi r5,0
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) {
80013c4: 45 c0 00 1d be r14,r0,8001438 <rtems_bdpart_read_mbr_partition+0xc0><== NEVER TAKEN
return RTEMS_SUCCESSFUL;
} else if (*p == p_end) {
80013c8: 29 62 00 00 lw r2,(r11+0)
return RTEMS_TOO_MANY;
80013cc: 34 05 00 05 mvi r5,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) {
80013d0: 44 4f 00 1a be r2,r15,8001438 <rtems_bdpart_read_mbr_partition+0xc0><== NEVER TAKEN
{
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;
80013d4: b4 2d 78 00 add r15,r1,r13
if (type == RTEMS_BDPART_MBR_EMPTY) {
return RTEMS_SUCCESSFUL;
} else if (*p == p_end) {
return RTEMS_TOO_MANY;
} else if (begin >= end) {
return RTEMS_IO_ERROR;
80013d8: 34 05 00 1b mvi r5,27
if (type == RTEMS_BDPART_MBR_EMPTY) {
return RTEMS_SUCCESSFUL;
} else if (*p == p_end) {
return RTEMS_TOO_MANY;
} else if (begin >= end) {
80013dc: 51 af 00 17 bgeu r13,r15,8001438 <rtems_bdpart_read_mbr_partition+0xc0><== NEVER TAKEN
return RTEMS_IO_ERROR;
} else if (type == RTEMS_BDPART_MBR_EXTENDED) {
80013e0: 34 01 00 05 mvi r1,5
80013e4: 5d c1 00 05 bne r14,r1,80013f8 <rtems_bdpart_read_mbr_partition+0x80>
(*p)->end = end;
rtems_bdpart_to_partition_type( type, (*p)->type);
(*p)->flags = data [RTEMS_BDPART_MBR_OFFSET_FLAGS];
}
return RTEMS_SUCCESSFUL;
80013e8: 34 05 00 00 mvi r5,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) {
80013ec: 46 00 00 13 be r16,r0,8001438 <rtems_bdpart_read_mbr_partition+0xc0><== NEVER TAKEN
*ep_begin = begin;
80013f0: 5a 0d 00 00 sw (r16+0),r13
80013f4: e0 00 00 11 bi 8001438 <rtems_bdpart_read_mbr_partition+0xc0>
}
} else {
/* Increment partition index */
++(*p);
80013f8: 34 41 00 30 addi r1,r2,48
/* Clear partition */
memset( *p, 0, sizeof( rtems_bdpart_partition));
80013fc: 34 03 00 30 mvi r3,48
8001400: 34 02 00 00 mvi r2,0
if (ep_begin != NULL) {
*ep_begin = begin;
}
} else {
/* Increment partition index */
++(*p);
8001404: 59 61 00 00 sw (r11+0),r1
/* Clear partition */
memset( *p, 0, sizeof( rtems_bdpart_partition));
8001408: f8 00 4b ff calli 8014404 <memset>
/* Set values */
(*p)->begin = begin;
800140c: 29 62 00 00 lw r2,(r11+0)
(*p)->end = end;
rtems_bdpart_to_partition_type( type, (*p)->type);
8001410: b9 c0 08 00 mv r1,r14
/* Clear partition */
memset( *p, 0, sizeof( rtems_bdpart_partition));
/* Set values */
(*p)->begin = begin;
8001414: 58 4d 00 00 sw (r2+0),r13
(*p)->end = end;
8001418: 58 4f 00 04 sw (r2+4),r15
rtems_bdpart_to_partition_type( type, (*p)->type);
800141c: 34 42 00 08 addi r2,r2,8
8001420: fb ff ff a3 calli 80012ac <rtems_bdpart_to_partition_type>
(*p)->flags = data [RTEMS_BDPART_MBR_OFFSET_FLAGS];
8001424: 29 61 00 00 lw r1,(r11+0)
8001428: 41 82 00 00 lbu r2,(r12+0)
}
return RTEMS_SUCCESSFUL;
800142c: 34 05 00 00 mvi r5,0
/* Set values */
(*p)->begin = begin;
(*p)->end = end;
rtems_bdpart_to_partition_type( type, (*p)->type);
(*p)->flags = data [RTEMS_BDPART_MBR_OFFSET_FLAGS];
8001430: 58 20 00 28 sw (r1+40),r0
8001434: 58 22 00 2c sw (r1+44),r2
}
return RTEMS_SUCCESSFUL;
}
8001438: b8 a0 08 00 mv r1,r5
800143c: 2b 9d 00 04 lw ra,(sp+4)
8001440: 2b 8b 00 1c lw r11,(sp+28)
8001444: 2b 8c 00 18 lw r12,(sp+24)
8001448: 2b 8d 00 14 lw r13,(sp+20)
800144c: 2b 8e 00 10 lw r14,(sp+16)
8001450: 2b 8f 00 0c lw r15,(sp+12)
8001454: 2b 90 00 08 lw r16,(sp+8)
8001458: 37 9c 00 1c addi sp,sp,28
800145c: c3 a0 00 00 ret
08001220 <rtems_bdpart_read_record>:
static rtems_status_code rtems_bdpart_read_record(
rtems_disk_device *dd,
rtems_blkdev_bnum index,
rtems_bdbuf_buffer **block
)
{
8001220: 37 9c ff f0 addi sp,sp,-16
8001224: 5b 8b 00 0c sw (sp+12),r11
8001228: 5b 8c 00 08 sw (sp+8),r12
800122c: 5b 9d 00 04 sw (sp+4),ra
8001230: b8 60 58 00 mv r11,r3
rtems_status_code sc = RTEMS_SUCCESSFUL;
/* Release previous block if necessary */
if (*block != NULL) {
8001234: 28 63 00 00 lw r3,(r3+0)
static rtems_status_code rtems_bdpart_read_record(
rtems_disk_device *dd,
rtems_blkdev_bnum index,
rtems_bdbuf_buffer **block
)
{
8001238: b8 20 60 00 mv r12,r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
/* Release previous block if necessary */
if (*block != NULL) {
800123c: 44 60 00 06 be r3,r0,8001254 <rtems_bdpart_read_record+0x34>
sc = rtems_bdbuf_release( *block);
8001240: b8 60 08 00 mv r1,r3
8001244: 5b 82 00 10 sw (sp+16),r2
8001248: f8 00 30 aa calli 800d4f0 <rtems_bdbuf_release>
if (sc != RTEMS_SUCCESSFUL) {
800124c: 2b 82 00 10 lw r2,(sp+16)
8001250: 5c 20 00 12 bne r1,r0,8001298 <rtems_bdpart_read_record+0x78><== NEVER TAKEN
return sc;
}
}
/* Read the record block */
sc = rtems_bdbuf_read( dd, index, block);
8001254: b9 80 08 00 mv r1,r12
8001258: b9 60 18 00 mv r3,r11
800125c: f8 00 30 1b calli 800d2c8 <rtems_bdbuf_read>
if (sc != RTEMS_SUCCESSFUL) {
8001260: 5c 20 00 0e bne r1,r0,8001298 <rtems_bdpart_read_record+0x78><== NEVER TAKEN
return sc;
}
/* just in case block did not get filled in */
if ( *block == NULL ) {
8001264: 29 62 00 00 lw r2,(r11+0)
8001268: 44 41 00 0b be r2,r1,8001294 <rtems_bdpart_read_record+0x74><== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
}
/* Check MBR signature */
if (!rtems_bdpart_is_valid_record( (*block)->buffer)) {
800126c: 28 43 00 1c lw r3,(r2+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]
8001270: 34 04 00 55 mvi r4,85
8001274: 34 02 00 00 mvi r2,0
8001278: 40 65 01 fe lbu r5,(r3+510)
800127c: 5c a4 00 03 bne r5,r4,8001288 <rtems_bdpart_read_record+0x68><== NEVER TAKEN
}
return RTEMS_SUCCESSFUL;
}
static rtems_status_code rtems_bdpart_read_record(
8001280: 40 62 01 ff lbu r2,(r3+511)
8001284: 64 42 00 aa cmpei r2,r2,170
if ( *block == NULL ) {
return RTEMS_INVALID_ADDRESS;
}
/* Check MBR signature */
if (!rtems_bdpart_is_valid_record( (*block)->buffer)) {
8001288: 5c 40 00 04 bne r2,r0,8001298 <rtems_bdpart_read_record+0x78><== ALWAYS TAKEN
return RTEMS_IO_ERROR;
800128c: 34 01 00 1b mvi r1,27 <== NOT EXECUTED
8001290: e0 00 00 02 bi 8001298 <rtems_bdpart_read_record+0x78> <== NOT EXECUTED
return sc;
}
/* just in case block did not get filled in */
if ( *block == NULL ) {
return RTEMS_INVALID_ADDRESS;
8001294: 34 01 00 09 mvi r1,9 <== NOT EXECUTED
if (!rtems_bdpart_is_valid_record( (*block)->buffer)) {
return RTEMS_IO_ERROR;
}
return RTEMS_SUCCESSFUL;
}
8001298: 2b 9d 00 04 lw ra,(sp+4)
800129c: 2b 8b 00 0c lw r11,(sp+12)
80012a0: 2b 8c 00 08 lw r12,(sp+8)
80012a4: 37 9c 00 10 addi sp,sp,16
80012a8: c3 a0 00 00 ret
08001804 <rtems_bdpart_register>:
rtems_status_code rtems_bdpart_register(
const char *disk_name,
const rtems_bdpart_partition *pt,
size_t count
)
{
8001804: 37 9c ff c4 addi sp,sp,-60
8001808: 5b 8b 00 30 sw (sp+48),r11
800180c: 5b 8c 00 2c sw (sp+44),r12
8001810: 5b 8d 00 28 sw (sp+40),r13
8001814: 5b 8e 00 24 sw (sp+36),r14
8001818: 5b 8f 00 20 sw (sp+32),r15
800181c: 5b 90 00 1c sw (sp+28),r16
8001820: 5b 91 00 18 sw (sp+24),r17
8001824: 5b 92 00 14 sw (sp+20),r18
8001828: 5b 93 00 10 sw (sp+16),r19
800182c: 5b 94 00 0c sw (sp+12),r20
8001830: 5b 95 00 08 sw (sp+8),r21
8001834: 5b 9d 00 04 sw (sp+4),ra
8001838: b8 20 78 00 mv r15,r1
800183c: b8 40 58 00 mv r11,r2
8001840: b8 60 a8 00 mv r21,r3
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;
8001844: 5b 80 00 3c sw (sp+60),r0
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);
8001848: f8 00 4d 58 calli 8014da8 <strlen>
800184c: b8 20 70 00 mv r14,r1
size_t i = 0;
int fd = -1;
8001850: 34 01 ff ff mvi r1,-1
8001854: 5b 81 00 38 sw (sp+56),r1
rtems_disk_device *dd = NULL;
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
8001858: 37 82 00 38 addi r2,sp,56
800185c: b9 e0 08 00 mv r1,r15
8001860: 37 83 00 34 addi r3,sp,52
8001864: 37 84 00 3c addi r4,sp,60
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;
8001868: 5b 80 00 34 sw (sp+52),r0
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
800186c: fb ff ff 0a calli 8001494 <rtems_bdpart_get_disk_data>
8001870: b8 20 60 00 mv r12,r1
if (sc != RTEMS_SUCCESSFUL) {
8001874: 5c 20 00 30 bne r1,r0,8001934 <rtems_bdpart_register+0x130><== NEVER TAKEN
static inline dev_t rtems_disk_get_device_identifier(
const rtems_disk_device *dd
)
{
return dd->dev;
8001878: 2b 81 00 34 lw r1,(sp+52)
800187c: 28 32 00 04 lw r18,(r1+4)
8001880: 28 31 00 00 lw r17,(r1+0)
return sc;
}
disk = rtems_disk_get_device_identifier( dd);
close( fd);
8001884: 2b 81 00 38 lw r1,(sp+56)
)
{
union __rtems_dev_t temp;
temp.device = device;
return temp.__overlay.minor;
8001888: ba 40 80 00 mv r16,r18
800188c: f8 00 09 98 calli 8003eec <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);
8001890: 35 c1 00 04 addi r1,r14,4
8001894: f8 00 0b ac calli 8004744 <malloc>
8001898: b8 20 68 00 mv r13,r1
if (logical_disk_name == NULL) {
800189c: 44 2c 00 25 be r1,r12,8001930 <rtems_bdpart_register+0x12c><== NEVER TAKEN
return RTEMS_NO_MEMORY;
}
strncpy( logical_disk_name, disk_name, disk_name_size);
80018a0: b9 e0 10 00 mv r2,r15
80018a4: b9 c0 18 00 mv r3,r14
/* 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);
80018a8: 78 0f 08 02 mvhi r15,0x802
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;
80018ac: b5 ae a0 00 add r20,r13,r14
/* Create logical disk name */
logical_disk_name = malloc( disk_name_size + RTEMS_BDPART_NUMBER_SIZE);
if (logical_disk_name == NULL) {
return RTEMS_NO_MEMORY;
}
strncpy( logical_disk_name, disk_name, disk_name_size);
80018b0: f8 00 4d ba calli 8014f98 <strncpy>
logical_disk_marker = logical_disk_name + disk_name_size;
/* Create a logical disk for each partition */
for (i = 0; i < count; ++i) {
80018b4: 34 0e 00 00 mvi r14,0
/* 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);
80018b8: 39 ef 64 98 ori r15,r15,0x6498
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
80018bc: 34 13 00 03 mvi r19,3
}
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) {
80018c0: e0 00 00 15 bi 8001914 <rtems_bdpart_register+0x110>
/* 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);
80018c4: 35 ce 00 01 addi r14,r14,1
80018c8: ba 80 08 00 mv r1,r20
80018cc: 34 02 00 04 mvi r2,4
80018d0: b9 e0 18 00 mv r3,r15
80018d4: b9 c0 20 00 mv r4,r14
for (i = 0; i < count; ++i) {
const rtems_bdpart_partition *p = pt + i;
int rv = 0;
/* New minor number */
++minor;
80018d8: 36 10 00 01 addi r16,r16,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);
80018dc: f8 00 4b be calli 80147d4 <snprintf>
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
80018e0: 48 33 00 10 bg r1,r19,8001920 <rtems_bdpart_register+0x11c><== NEVER TAKEN
/* Create logical disk */
sc = rtems_disk_create_log(
logical_disk,
disk,
p->begin,
p->end - p->begin,
80018e4: 29 65 00 00 lw r5,(r11+0)
esc = RTEMS_INVALID_NAME;
goto cleanup;
}
/* Create logical disk */
sc = rtems_disk_create_log(
80018e8: 29 66 00 04 lw r6,(r11+4)
80018ec: ba 20 08 00 mv r1,r17
80018f0: ba 00 10 00 mv r2,r16
80018f4: ba 20 18 00 mv r3,r17
80018f8: ba 40 20 00 mv r4,r18
80018fc: c8 c5 30 00 sub r6,r6,r5
8001900: b9 a0 38 00 mv r7,r13
8001904: f8 00 03 d7 calli 8002860 <rtems_disk_create_log>
8001908: b8 20 60 00 mv r12,r1
800190c: 35 6b 00 30 addi r11,r11,48
disk,
p->begin,
p->end - p->begin,
logical_disk_name
);
if (sc != RTEMS_SUCCESSFUL) {
8001910: 5c 20 00 05 bne r1,r0,8001924 <rtems_bdpart_register+0x120><== NEVER TAKEN
}
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) {
8001914: 56 ae ff ec bgu r21,r14,80018c4 <rtems_bdpart_register+0xc0>
const rtems_bdpart_partition *pt,
size_t count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
8001918: 34 0c 00 00 mvi r12,0
800191c: e0 00 00 02 bi 8001924 <rtems_bdpart_register+0x120>
logical_disk = rtems_filesystem_make_dev_t( major, minor);
/* Set partition number for logical disk name */
rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
esc = RTEMS_INVALID_NAME;
8001920: 34 0c 00 03 mvi r12,3 <== NOT EXECUTED
}
}
cleanup:
free( logical_disk_name);
8001924: b9 a0 08 00 mv r1,r13
8001928: f8 00 09 9c calli 8003f98 <free>
return esc;
800192c: e0 00 00 02 bi 8001934 <rtems_bdpart_register+0x130>
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) {
return RTEMS_NO_MEMORY;
8001930: 34 0c 00 1a mvi r12,26 <== NOT EXECUTED
cleanup:
free( logical_disk_name);
return esc;
}
8001934: b9 80 08 00 mv r1,r12
8001938: 2b 9d 00 04 lw ra,(sp+4)
800193c: 2b 8b 00 30 lw r11,(sp+48)
8001940: 2b 8c 00 2c lw r12,(sp+44)
8001944: 2b 8d 00 28 lw r13,(sp+40)
8001948: 2b 8e 00 24 lw r14,(sp+36)
800194c: 2b 8f 00 20 lw r15,(sp+32)
8001950: 2b 90 00 1c lw r16,(sp+28)
8001954: 2b 91 00 18 lw r17,(sp+24)
8001958: 2b 92 00 14 lw r18,(sp+20)
800195c: 2b 93 00 10 lw r19,(sp+16)
8001960: 2b 94 00 0c lw r20,(sp+12)
8001964: 2b 95 00 08 lw r21,(sp+8)
8001968: 37 9c 00 3c addi sp,sp,60
800196c: c3 a0 00 00 ret
08001970 <rtems_bdpart_register_from_disk>:
rtems_status_code rtems_bdpart_register_from_disk( const char *disk_name)
{
8001970: 37 9c fc dc addi sp,sp,-804
8001974: 5b 8b 00 0c sw (sp+12),r11
8001978: 5b 8c 00 08 sw (sp+8),r12
800197c: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_bdpart_format format;
rtems_bdpart_partition pt [RTEMS_BDPART_PARTITION_NUMBER_HINT];
size_t count = RTEMS_BDPART_PARTITION_NUMBER_HINT;
8001980: 34 02 00 10 mvi r2,16
/* Read partitions */
sc = rtems_bdpart_read( disk_name, &format, pt, &count);
8001984: 37 8b 00 10 addi r11,sp,16
rtems_status_code rtems_bdpart_register_from_disk( const char *disk_name)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_bdpart_format format;
rtems_bdpart_partition pt [RTEMS_BDPART_PARTITION_NUMBER_HINT];
size_t count = RTEMS_BDPART_PARTITION_NUMBER_HINT;
8001988: 5b 82 03 24 sw (sp+804),r2
/* Read partitions */
sc = rtems_bdpart_read( disk_name, &format, pt, &count);
800198c: b9 60 18 00 mv r3,r11
8001990: 37 82 03 10 addi r2,sp,784
8001994: 37 84 03 24 addi r4,sp,804
return esc;
}
rtems_status_code rtems_bdpart_register_from_disk( const char *disk_name)
{
8001998: b8 20 60 00 mv r12,r1
rtems_bdpart_format format;
rtems_bdpart_partition pt [RTEMS_BDPART_PARTITION_NUMBER_HINT];
size_t count = RTEMS_BDPART_PARTITION_NUMBER_HINT;
/* Read partitions */
sc = rtems_bdpart_read( disk_name, &format, pt, &count);
800199c: fb ff fe f3 calli 8001568 <rtems_bdpart_read>
if (sc != RTEMS_SUCCESSFUL) {
80019a0: 5c 20 00 05 bne r1,r0,80019b4 <rtems_bdpart_register_from_disk+0x44><== NEVER TAKEN
return sc;
}
/* Register partitions */
return rtems_bdpart_register( disk_name, pt, count);
80019a4: 2b 83 03 24 lw r3,(sp+804)
80019a8: b9 80 08 00 mv r1,r12
80019ac: b9 60 10 00 mv r2,r11
80019b0: fb ff ff 95 calli 8001804 <rtems_bdpart_register>
}
80019b4: 2b 9d 00 04 lw ra,(sp+4)
80019b8: 2b 8b 00 0c lw r11,(sp+12)
80019bc: 2b 8c 00 08 lw r12,(sp+8)
80019c0: 37 9c 03 24 addi sp,sp,804
80019c4: c3 a0 00 00 ret
0801ff60 <rtems_bdpart_unmount>:
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
801ff60: 37 9c ff dc addi sp,sp,-36 <== NOT EXECUTED
801ff64: 5b 8b 00 24 sw (sp+36),r11 <== NOT EXECUTED
801ff68: 5b 8c 00 20 sw (sp+32),r12 <== NOT EXECUTED
801ff6c: 5b 8d 00 1c sw (sp+28),r13 <== NOT EXECUTED
801ff70: 5b 8e 00 18 sw (sp+24),r14 <== NOT EXECUTED
801ff74: 5b 8f 00 14 sw (sp+20),r15 <== NOT EXECUTED
801ff78: 5b 90 00 10 sw (sp+16),r16 <== NOT EXECUTED
801ff7c: 5b 91 00 0c sw (sp+12),r17 <== NOT EXECUTED
801ff80: 5b 92 00 08 sw (sp+8),r18 <== NOT EXECUTED
801ff84: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
rtems_status_code esc = RTEMS_SUCCESSFUL;
const char *disk_file_name = strrchr( disk_name, '/');
801ff88: 34 02 00 2f mvi r2,47 <== NOT EXECUTED
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
801ff8c: b8 80 88 00 mv r17,r4 <== NOT EXECUTED
801ff90: b8 60 90 00 mv r18,r3 <== NOT EXECUTED
801ff94: b8 20 78 00 mv r15,r1 <== NOT EXECUTED
rtems_status_code esc = RTEMS_SUCCESSFUL;
const char *disk_file_name = strrchr( disk_name, '/');
801ff98: f8 00 85 e4 calli 8041728 <strrchr> <== NOT EXECUTED
801ff9c: b8 20 58 00 mv r11,r1 <== 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);
801ffa0: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
801ffa4: f8 00 82 06 calli 80407bc <strlen> <== NOT EXECUTED
801ffa8: b8 20 70 00 mv r14,r1 <== NOT EXECUTED
size_t mount_base_size = strlen( mount_base);
801ffac: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
801ffb0: f8 00 82 03 calli 80407bc <strlen> <== NOT EXECUTED
801ffb4: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
size_t i = 0;
/* Get disk file name */
if (disk_file_name != NULL) {
801ffb8: 45 60 00 05 be r11,r0,801ffcc <rtems_bdpart_unmount+0x6c> <== NOT EXECUTED
disk_file_name += 1;
801ffbc: 35 6f 00 01 addi r15,r11,1 <== NOT EXECUTED
disk_file_name_size = strlen( disk_file_name);
801ffc0: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
801ffc4: f8 00 81 fe calli 80407bc <strlen> <== NOT EXECUTED
801ffc8: b8 20 70 00 mv r14,r1 <== 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);
801ffcc: b5 cd 80 00 add r16,r14,r13 <== NOT EXECUTED
801ffd0: 36 01 00 05 addi r1,r16,5 <== NOT EXECUTED
801ffd4: fb ff 85 35 calli 80014a8 <malloc> <== NOT EXECUTED
801ffd8: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
if (mount_point == NULL) {
esc = RTEMS_NO_MEMORY;
801ffdc: 34 0c 00 1a mvi r12,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) {
801ffe0: 44 20 00 27 be r1,r0,802007c <rtems_bdpart_unmount+0x11c> <== NOT EXECUTED
esc = RTEMS_NO_MEMORY;
goto cleanup;
}
strncpy( mount_point, mount_base, mount_base_size);
801ffe4: b9 a0 18 00 mv r3,r13 <== NOT EXECUTED
801ffe8: ba 20 10 00 mv r2,r17 <== NOT EXECUTED
801ffec: f8 00 82 97 calli 8040a48 <strncpy> <== NOT EXECUTED
mount_point [mount_base_size] = '/';
801fff0: b5 6d 08 00 add r1,r11,r13 <== NOT EXECUTED
801fff4: 34 02 00 2f mvi r2,47 <== NOT EXECUTED
801fff8: 30 22 00 00 sb (r1+0),r2 <== NOT EXECUTED
strncpy( mount_point + mount_base_size + 1, disk_file_name, disk_file_name_size);
801fffc: 35 a1 00 01 addi r1,r13,1 <== NOT EXECUTED
8020000: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
8020004: b5 61 08 00 add r1,r11,r1 <== NOT EXECUTED
8020008: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
/* Marker */
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
802000c: 36 10 00 01 addi r16,r16,1 <== 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);
8020010: 78 0d 08 06 mvhi r13,0x806 <== NOT EXECUTED
esc = RTEMS_NO_MEMORY;
goto cleanup;
}
strncpy( mount_point, mount_base, mount_base_size);
mount_point [mount_base_size] = '/';
strncpy( mount_point + mount_base_size + 1, disk_file_name, disk_file_name_size);
8020014: f8 00 82 8d calli 8040a48 <strncpy> <== NOT EXECUTED
/* Marker */
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
8020018: b5 70 80 00 add r16,r11,r16 <== NOT EXECUTED
/* Mount supported file systems for each partition */
for (i = 0; i < count; ++i) {
802001c: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
/* Create mount point */
int rv = snprintf( mount_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
8020020: 39 ad 0a 4c ori r13,r13,0xa4c <== NOT EXECUTED
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
8020024: 34 0f 00 03 mvi r15,3 <== NOT EXECUTED
/* Marker */
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
/* Mount supported file systems for each partition */
for (i = 0; i < count; ++i) {
8020028: e0 00 00 0f bi 8020064 <rtems_bdpart_unmount+0x104> <== NOT EXECUTED
/* Create mount point */
int rv = snprintf( mount_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
802002c: 35 8c 00 01 addi r12,r12,1 <== NOT EXECUTED
8020030: ba 00 08 00 mv r1,r16 <== NOT EXECUTED
8020034: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
8020038: b9 a0 18 00 mv r3,r13 <== NOT EXECUTED
802003c: b9 80 20 00 mv r4,r12 <== NOT EXECUTED
8020040: f8 00 7e 46 calli 803f958 <snprintf> <== NOT EXECUTED
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
8020044: 48 2f 00 0b bg r1,r15,8020070 <rtems_bdpart_unmount+0x110> <== NOT EXECUTED
esc = RTEMS_INVALID_NAME;
goto cleanup;
}
/* Unmount */
rv = unmount( mount_point);
8020048: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
802004c: f8 00 14 1c calli 80250bc <unmount> <== NOT EXECUTED
8020050: b8 20 70 00 mv r14,r1 <== NOT EXECUTED
if (rv == 0) {
8020054: 5c 20 00 04 bne r1,r0,8020064 <rtems_bdpart_unmount+0x104> <== NOT EXECUTED
/* Remove mount point */
rv = rmdir( mount_point);
8020058: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
802005c: f8 00 12 27 calli 80248f8 <rmdir> <== NOT EXECUTED
if (rv != 0) {
8020060: 5c 2e 00 06 bne r1,r14,8020078 <rtems_bdpart_unmount+0x118><== NOT EXECUTED
/* Marker */
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
/* Mount supported file systems for each partition */
for (i = 0; i < count; ++i) {
8020064: 56 4c ff f2 bgu r18,r12,802002c <rtems_bdpart_unmount+0xcc><== NOT EXECUTED
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
rtems_status_code esc = RTEMS_SUCCESSFUL;
8020068: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
802006c: e0 00 00 04 bi 802007c <rtems_bdpart_unmount+0x11c> <== 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;
8020070: 34 0c 00 03 mvi r12,3 <== NOT EXECUTED
8020074: e0 00 00 02 bi 802007c <rtems_bdpart_unmount+0x11c> <== NOT EXECUTED
rv = unmount( mount_point);
if (rv == 0) {
/* Remove mount point */
rv = rmdir( mount_point);
if (rv != 0) {
esc = RTEMS_IO_ERROR;
8020078: 34 0c 00 1b mvi r12,27 <== NOT EXECUTED
}
}
cleanup:
free( mount_point);
802007c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8020080: fb ff 84 0e calli 80010b8 <free> <== NOT EXECUTED
return esc;
}
8020084: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8020088: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
802008c: 2b 8b 00 24 lw r11,(sp+36) <== NOT EXECUTED
8020090: 2b 8c 00 20 lw r12,(sp+32) <== NOT EXECUTED
8020094: 2b 8d 00 1c lw r13,(sp+28) <== NOT EXECUTED
8020098: 2b 8e 00 18 lw r14,(sp+24) <== NOT EXECUTED
802009c: 2b 8f 00 14 lw r15,(sp+20) <== NOT EXECUTED
80200a0: 2b 90 00 10 lw r16,(sp+16) <== NOT EXECUTED
80200a4: 2b 91 00 0c lw r17,(sp+12) <== NOT EXECUTED
80200a8: 2b 92 00 08 lw r18,(sp+8) <== NOT EXECUTED
80200ac: 37 9c 00 24 addi sp,sp,36 <== NOT EXECUTED
80200b0: c3 a0 00 00 ret <== NOT EXECUTED
080019c8 <rtems_bdpart_unregister>:
rtems_status_code rtems_bdpart_unregister(
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count
)
{
80019c8: 37 9c ff dc addi sp,sp,-36
80019cc: 5b 8b 00 18 sw (sp+24),r11
80019d0: 5b 8c 00 14 sw (sp+20),r12
80019d4: 5b 8d 00 10 sw (sp+16),r13
80019d8: 5b 8e 00 0c sw (sp+12),r14
80019dc: 5b 8f 00 08 sw (sp+8),r15
80019e0: 5b 9d 00 04 sw (sp+4),ra
rtems_device_minor_number minor = 0;
rtems_blkdev_bnum disk_end = 0;
dev_t disk = 0;
dev_t logical_disk = 0;
size_t i = 0;
int fd = -1;
80019e4: 34 02 ff ff mvi r2,-1
80019e8: 5b 82 00 20 sw (sp+32),r2
rtems_status_code rtems_bdpart_unregister(
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count
)
{
80019ec: b8 60 78 00 mv r15,r3
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);
80019f0: 37 82 00 20 addi r2,sp,32
80019f4: 37 83 00 1c addi r3,sp,28
80019f8: 37 84 00 24 addi r4,sp,36
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
rtems_blkdev_bnum disk_end = 0;
80019fc: 5b 80 00 24 sw (sp+36),r0
dev_t disk = 0;
dev_t logical_disk = 0;
size_t i = 0;
int fd = -1;
rtems_disk_device *dd = NULL;
8001a00: 5b 80 00 1c sw (sp+28),r0
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
8001a04: fb ff fe a4 calli 8001494 <rtems_bdpart_get_disk_data>
8001a08: b8 20 58 00 mv r11,r1
if (sc != RTEMS_SUCCESSFUL) {
8001a0c: 5c 20 00 11 bne r1,r0,8001a50 <rtems_bdpart_unregister+0x88><== NEVER TAKEN
8001a10: 2b 82 00 1c lw r2,(sp+28)
return sc;
}
disk = rtems_disk_get_device_identifier( dd);
close( fd);
8001a14: 2b 81 00 20 lw r1,(sp+32)
/* 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) {
8001a18: 34 0c 00 00 mvi r12,0
8001a1c: 28 4e 00 00 lw r14,(r2+0)
8001a20: 28 4d 00 04 lw r13,(r2+4)
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);
8001a24: f8 00 09 32 calli 8003eec <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) {
8001a28: e0 00 00 07 bi 8001a44 <rtems_bdpart_unregister+0x7c>
/* New minor number */
++minor;
8001a2c: 35 ad 00 01 addi r13,r13,1
/* Get the device identifier */
logical_disk = rtems_filesystem_make_dev_t( major, minor);
/* Delete logical disk */
sc = rtems_disk_delete( logical_disk);
8001a30: b9 c0 08 00 mv r1,r14
8001a34: b9 a0 10 00 mv r2,r13
8001a38: f8 00 02 ff calli 8002634 <rtems_disk_delete>
if (sc != RTEMS_SUCCESSFUL) {
8001a3c: 5c 20 00 04 bne r1,r0,8001a4c <rtems_bdpart_unregister+0x84><== NEVER TAKEN
/* 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) {
8001a40: 35 8c 00 01 addi r12,r12,1
8001a44: 55 ec ff fa bgu r15,r12,8001a2c <rtems_bdpart_unregister+0x64>
8001a48: e0 00 00 02 bi 8001a50 <rtems_bdpart_unregister+0x88>
/* Get the device identifier */
logical_disk = rtems_filesystem_make_dev_t( major, minor);
/* Delete logical disk */
sc = rtems_disk_delete( logical_disk);
8001a4c: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
return sc;
}
}
return RTEMS_SUCCESSFUL;
}
8001a50: b9 60 08 00 mv r1,r11
8001a54: 2b 9d 00 04 lw ra,(sp+4)
8001a58: 2b 8b 00 18 lw r11,(sp+24)
8001a5c: 2b 8c 00 14 lw r12,(sp+20)
8001a60: 2b 8d 00 10 lw r13,(sp+16)
8001a64: 2b 8e 00 0c lw r14,(sp+12)
8001a68: 2b 8f 00 08 lw r15,(sp+8)
8001a6c: 37 9c 00 24 addi sp,sp,36
8001a70: c3 a0 00 00 ret
08001bd4 <rtems_bdpart_write>:
const char *disk_name,
const rtems_bdpart_format *format,
const rtems_bdpart_partition *pt,
size_t count
)
{
8001bd4: 37 9c ff c0 addi sp,sp,-64
8001bd8: 5b 8b 00 2c sw (sp+44),r11
8001bdc: 5b 8c 00 28 sw (sp+40),r12
8001be0: 5b 8d 00 24 sw (sp+36),r13
8001be4: 5b 8e 00 20 sw (sp+32),r14
8001be8: 5b 8f 00 1c sw (sp+28),r15
8001bec: 5b 90 00 18 sw (sp+24),r16
8001bf0: 5b 91 00 14 sw (sp+20),r17
8001bf4: 5b 92 00 10 sw (sp+16),r18
8001bf8: 5b 93 00 0c sw (sp+12),r19
8001bfc: 5b 94 00 08 sw (sp+8),r20
8001c00: 5b 9d 00 04 sw (sp+4),ra
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;
8001c04: 34 0c 00 00 mvi r12,0
const char *disk_name,
const rtems_bdpart_format *format,
const rtems_bdpart_partition *pt,
size_t count
)
{
8001c08: b8 40 80 00 mv r16,r2
8001c0c: b8 60 90 00 mv r18,r3
8001c10: b8 80 78 00 mv r15,r4
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;
8001c14: 44 40 00 04 be r2,r0,8001c24 <rtems_bdpart_write+0x50> <== NEVER TAKEN
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
8001c18: 28 42 00 00 lw r2,(r2+0)
8001c1c: 5c 40 00 02 bne r2,r0,8001c24 <rtems_bdpart_write+0x50> <== NEVER TAKEN
&& format->mbr.dos_compatibility;
8001c20: 42 0c 00 08 lbu r12,(r16+8)
size_t count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
8001c24: 21 8c 00 ff andi r12,r12,0xff
&& 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 =
8001c28: 65 8e 00 00 cmpei r14,r12,0
8001c2c: 34 02 ff c2 mvi r2,-62
8001c30: c8 0e 70 00 sub r14,r0,r14
8001c34: a1 c2 70 00 and r14,r14,r2
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;
8001c38: 34 02 ff ff mvi r2,-1
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;
8001c3c: 5b 80 00 3c sw (sp+60),r0
rtems_blkdev_bnum disk_end = 0;
8001c40: 5b 80 00 38 sw (sp+56),r0
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;
8001c44: 5b 82 00 34 sw (sp+52),r2
rtems_disk_device *dd = NULL;
8001c48: 5b 80 00 30 sw (sp+48),r0
bool dos_compatibility = format != NULL
&& 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 =
8001c4c: 35 ce 00 3f addi r14,r14,63
rtems_disk_device *dd = NULL;
/* Check if we have something to do */
if (count == 0) {
/* Nothing to do */
return RTEMS_SUCCESSFUL;
8001c50: 34 0b 00 00 mvi r11,0
uint8_t *data = NULL;
int fd = -1;
rtems_disk_device *dd = NULL;
/* Check if we have something to do */
if (count == 0) {
8001c54: 45 e0 00 a8 be r15,r0,8001ef4 <rtems_bdpart_write+0x320> <== NEVER TAKEN
/* Nothing to do */
return RTEMS_SUCCESSFUL;
}
/* Check parameter */
if (format == NULL || pt == NULL) {
8001c58: 66 4d 00 00 cmpei r13,r18,0
8001c5c: 66 02 00 00 cmpei r2,r16,0
return RTEMS_INVALID_ADDRESS;
8001c60: 34 0b 00 09 mvi r11,9
/* Nothing to do */
return RTEMS_SUCCESSFUL;
}
/* Check parameter */
if (format == NULL || pt == NULL) {
8001c64: b9 a2 68 00 or r13,r13,r2
8001c68: 5d a0 00 a3 bne r13,r0,8001ef4 <rtems_bdpart_write+0x320> <== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
}
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
8001c6c: 37 82 00 34 addi r2,sp,52
8001c70: 37 83 00 30 addi r3,sp,48
8001c74: 37 84 00 38 addi r4,sp,56
8001c78: fb ff fe 07 calli 8001494 <rtems_bdpart_get_disk_data>
8001c7c: b8 20 58 00 mv r11,r1
if (sc != RTEMS_SUCCESSFUL) {
8001c80: 5c 2d 00 9d bne r1,r13,8001ef4 <rtems_bdpart_write+0x320> <== NEVER TAKEN
return sc;
}
/* Align end of disk on cylinder boundary if necessary */
if (dos_compatibility) {
8001c84: 45 81 00 07 be r12,r1,8001ca0 <rtems_bdpart_write+0xcc> <== NEVER TAKEN
disk_end -= (disk_end % record_space);
8001c88: 2b 8b 00 38 lw r11,(sp+56)
8001c8c: b9 c0 10 00 mv r2,r14
8001c90: b9 60 08 00 mv r1,r11
8001c94: f8 00 8e f9 calli 8025878 <__umodsi3>
8001c98: c9 61 08 00 sub r1,r11,r1
8001c9c: 5b 81 00 38 sw (sp+56),r1
/* 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) {
8001ca0: 2b 84 00 38 lw r4,(sp+56)
8001ca4: ba 40 88 00 mv r17,r18
if (dos_compatibility) {
disk_end -= (disk_end % record_space);
}
/* Check that we have a consistent partition table */
for (i = 0; i < count; ++i) {
8001ca8: ba 40 08 00 mv r1,r18
8001cac: 34 02 00 00 mvi r2,0
8001cb0: e0 00 00 0b bi 8001cdc <rtems_bdpart_write+0x108>
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) {
8001cb4: 28 23 00 00 lw r3,(r1+0)
8001cb8: 50 64 00 84 bgeu r3,r4,8001ec8 <rtems_bdpart_write+0x2f4> <== NEVER TAKEN
8001cbc: 28 25 00 04 lw r5,(r1+4)
8001cc0: 54 a4 00 82 bgu r5,r4,8001ec8 <rtems_bdpart_write+0x2f4> <== NEVER TAKEN
esc = RTEMS_INVALID_NUMBER;
goto cleanup;
}
/* Check that begin and end are valid */
if (p->begin >= p->end) {
8001cc4: 50 65 00 81 bgeu r3,r5,8001ec8 <rtems_bdpart_write+0x2f4> <== NEVER TAKEN
esc = RTEMS_INVALID_NUMBER;
goto cleanup;
}
/* Check that partitions do not overlap */
if (i > 0 && pt [i - 1].end > p->begin) {
8001cc8: 44 40 00 03 be r2,r0,8001cd4 <rtems_bdpart_write+0x100>
8001ccc: 28 25 ff d4 lw r5,(r1+-44)
8001cd0: 54 a3 00 7e bgu r5,r3,8001ec8 <rtems_bdpart_write+0x2f4> <== NEVER TAKEN
if (dos_compatibility) {
disk_end -= (disk_end % record_space);
}
/* Check that we have a consistent partition table */
for (i = 0; i < count; ++i) {
8001cd4: 34 42 00 01 addi r2,r2,1
8001cd8: 34 21 00 30 addi r1,r1,48
8001cdc: 55 e2 ff f6 bgu r15,r2,8001cb4 <rtems_bdpart_write+0xe0>
goto cleanup;
}
}
/* Check format */
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
8001ce0: 2a 01 00 00 lw r1,(r16+0)
esc = RTEMS_NOT_IMPLEMENTED;
8001ce4: 34 0b 00 18 mvi r11,24
goto cleanup;
}
}
/* Check format */
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
8001ce8: 5c 20 00 7d bne r1,r0,8001edc <rtems_bdpart_write+0x308> <== NEVER TAKEN
* 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;
8001cec: 34 01 00 04 mvi r1,4
8001cf0: b9 e0 68 00 mv r13,r15
8001cf4: 50 2f 00 02 bgeu r1,r15,8001cfc <rtems_bdpart_write+0x128> <== NEVER TAKEN
8001cf8: 34 0d 00 03 mvi r13,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) {
8001cfc: 5d 80 00 08 bne r12,r0,8001d1c <rtems_bdpart_write+0x148> <== ALWAYS TAKEN
* 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) {
8001d00: 34 02 00 30 mvi r2,48
8001d04: b9 a0 08 00 mv r1,r13
8001d08: fb ff fa ae calli 80007c0 <__mulsi3>
8001d0c: b6 41 60 00 add r12,r18,r1
8001d10: b9 80 10 00 mv r2,r12
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
8001d14: b9 a0 08 00 mv r1,r13
8001d18: e0 00 00 0d bi 8001d4c <rtems_bdpart_write+0x178>
/*
* 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) {
8001d1c: 2a 42 00 00 lw r2,(r18+0)
8001d20: 34 01 00 3f mvi r1,63
esc = RTEMS_INVALID_NUMBER;
8001d24: 34 0b 00 0a mvi r11,10
/*
* 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) {
8001d28: 5c 41 00 6d bne r2,r1,8001edc <rtems_bdpart_write+0x308> <== NEVER TAKEN
8001d2c: e3 ff ff f5 bi 8001d00 <rtems_bdpart_write+0x12c>
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
8001d30: b8 40 18 00 mv r3,r2
* The space for the EBR and maybe some space which is needed for DOS
* compatibility resides between the partitions. So there have to be gaps of
* the appropriate size between the partitions.
*/
for (i = ppc; i < count; ++i) {
if ((pt [i].begin - pt [i - 1].end) < record_space) {
8001d34: 28 64 00 00 lw r4,(r3+0)
8001d38: 28 63 ff d4 lw r3,(r3+-44)
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
8001d3c: 34 42 00 30 addi r2,r2,48
* 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) {
8001d40: c8 83 18 00 sub r3,r4,r3
8001d44: 55 c3 00 61 bgu r14,r3,8001ec8 <rtems_bdpart_write+0x2f4> <== NEVER TAKEN
* 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) {
8001d48: 34 21 00 01 addi r1,r1,1
8001d4c: 55 e1 ff f9 bgu r15,r1,8001d30 <rtems_bdpart_write+0x15c>
8001d50: 34 0b 00 00 mvi r11,0
uint8_t type = 0;
const rtems_bdpart_partition *p = pt + i;
/* Check type */
if (!rtems_bdpart_to_mbr_partition_type( p->type, &type)) {
8001d54: 37 94 00 43 addi r20,sp,67
esc = RTEMS_INVALID_ID;
goto cleanup;
}
/* Check flags */
if (p->flags > 0xffU) {
8001d58: 34 13 00 ff mvi r19,255
8001d5c: e0 00 00 0c bi 8001d8c <rtems_bdpart_write+0x1b8>
uint8_t type = 0;
const rtems_bdpart_partition *p = pt + i;
/* Check type */
if (!rtems_bdpart_to_mbr_partition_type( p->type, &type)) {
8001d60: 36 41 00 08 addi r1,r18,8
8001d64: ba 80 10 00 mv r2,r20
}
}
/* Check that we can convert the parition descriptions to the MBR format */
for (i = 0; i < count; ++i) {
uint8_t type = 0;
8001d68: 33 80 00 43 sb (sp+67),r0
const rtems_bdpart_partition *p = pt + i;
/* Check type */
if (!rtems_bdpart_to_mbr_partition_type( p->type, &type)) {
8001d6c: fb ff fd bd calli 8001460 <rtems_bdpart_to_mbr_partition_type>
8001d70: 44 20 00 58 be r1,r0,8001ed0 <rtems_bdpart_write+0x2fc> <== NEVER TAKEN
esc = RTEMS_INVALID_ID;
goto cleanup;
}
/* Check flags */
if (p->flags > 0xffU) {
8001d74: 2a 42 00 28 lw r2,(r18+40)
8001d78: 2a 41 00 2c lw r1,(r18+44)
8001d7c: 36 52 00 30 addi r18,r18,48
8001d80: 5c 40 00 54 bne r2,r0,8001ed0 <rtems_bdpart_write+0x2fc> <== NEVER TAKEN
8001d84: 54 33 00 53 bgu r1,r19,8001ed0 <rtems_bdpart_write+0x2fc> <== NEVER TAKEN
goto cleanup;
}
}
/* Check that we can convert the parition descriptions to the MBR format */
for (i = 0; i < count; ++i) {
8001d88: 35 6b 00 01 addi r11,r11,1
8001d8c: 55 eb ff f5 bgu r15,r11,8001d60 <rtems_bdpart_write+0x18c>
/* Check ID */
/* TODO */
}
/* New MBR */
sc = rtems_bdpart_new_record( dd, 0, &block);
8001d90: 2b 81 00 30 lw r1,(sp+48)
8001d94: 34 02 00 00 mvi r2,0
8001d98: 37 83 00 3c addi r3,sp,60
8001d9c: fb ff ff 63 calli 8001b28 <rtems_bdpart_new_record>
if (sc != RTEMS_SUCCESSFUL) {
8001da0: b8 20 58 00 mv r11,r1
8001da4: 5c 20 00 4e bne r1,r0,8001edc <rtems_bdpart_write+0x308> <== NEVER TAKEN
}
/* Write disk ID */
rtems_uint32_to_little_endian(
format->mbr.disk_id,
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
8001da8: 2b 81 00 3c lw r1,(sp+60)
esc = sc;
goto cleanup;
}
/* Write disk ID */
rtems_uint32_to_little_endian(
8001dac: 28 22 00 1c lw r2,(r1+28)
8001db0: 2a 01 00 04 lw r1,(r16+4)
8001db4: 34 42 01 b8 addi r2,r2,440
8001db8: fb ff ff 2f calli 8001a74 <rtems_uint32_to_little_endian>
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;
8001dbc: 2b 81 00 3c lw r1,(sp+60)
8001dc0: 28 32 00 1c lw r18,(r1+28)
8001dc4: 36 52 01 be addi r18,r18,446
8001dc8: ba 40 80 00 mv r16,r18
for (i = 0; i < ppc; ++i) {
8001dcc: e0 00 00 0b bi 8001df8 <rtems_bdpart_write+0x224>
/* Write partition entry */
rtems_bdpart_write_mbr_partition(
data,
p->begin,
p->end - p->begin,
8001dd0: 2a 22 00 00 lw r2,(r17+0)
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(
8001dd4: 2a 23 00 04 lw r3,(r17+4)
8001dd8: 42 24 00 08 lbu r4,(r17+8)
8001ddc: 42 25 00 2f lbu r5,(r17+47)
8001de0: ba 00 08 00 mv r1,r16
8001de4: c8 62 18 00 sub r3,r3,r2
8001de8: fb ff ff 37 calli 8001ac4 <rtems_bdpart_write_mbr_partition>
p->end - p->begin,
rtems_bdpart_mbr_partition_type( p->type),
(uint8_t) p->flags
);
data += RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE;
8001dec: 36 10 00 10 addi r16,r16,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) {
8001df0: 35 6b 00 01 addi r11,r11,1
8001df4: 36 31 00 30 addi r17,r17,48
8001df8: 55 ab ff f6 bgu r13,r11,8001dd0 <rtems_bdpart_write+0x1fc>
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
8001dfc: b9 a0 08 00 mv r1,r13
8001e00: 34 02 00 04 mvi r2,4
8001e04: fb ff fa 48 calli 8000724 <__ashlsi3>
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) {
8001e08: b6 41 08 00 add r1,r18,r1
const rtems_bdpart_partition *pt,
size_t count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
8001e0c: 34 0b 00 00 mvi r11,0
data += RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE;
}
/* Write extended partition with logical partitions if necessary */
if (ppc != count) {
8001e10: 45 af 00 33 be r13,r15,8001edc <rtems_bdpart_write+0x308> <== NEVER TAKEN
rtems_blkdev_bnum ebr = 0; /* Extended boot record block index */
/* Begin of extended partition */
rtems_blkdev_bnum ep_begin = pt [ppc].begin - record_space;
8001e14: 29 91 00 00 lw r17,(r12+0)
/* Write extended partition */
rtems_bdpart_write_mbr_partition(
8001e18: 2b 83 00 38 lw r3,(sp+56)
8001e1c: 34 04 00 05 mvi r4,5
/* 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;
8001e20: ca 2e 88 00 sub r17,r17,r14
/* Write extended partition */
rtems_bdpart_write_mbr_partition(
8001e24: ba 20 10 00 mv r2,r17
8001e28: c8 71 18 00 sub r3,r3,r17
8001e2c: 34 05 00 00 mvi r5,0
8001e30: fb ff ff 25 calli 8001ac4 <rtems_bdpart_write_mbr_partition>
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
8001e34: 35 8c 00 04 addi r12,r12,4
RTEMS_BDPART_MBR_EXTENDED,
0
);
/* Write logical partitions */
for (i = ppc; i < count; ++i) {
8001e38: b9 a0 80 00 mv r16,r13
);
}
/* New EBR */
ebr = p->begin - record_space;
sc = rtems_bdpart_new_record( dd, ebr, &block);
8001e3c: 37 8b 00 3c addi r11,sp,60
RTEMS_BDPART_MBR_EXTENDED,
0
);
/* Write logical partitions */
for (i = ppc; i < count; ++i) {
8001e40: e0 00 00 1f bi 8001ebc <rtems_bdpart_write+0x2e8>
const rtems_bdpart_partition *p = pt + i;
/* Write second partition entry */
if (i > ppc) {
8001e44: 51 b0 00 0c bgeu r13,r16,8001e74 <rtems_bdpart_write+0x2a0>
rtems_blkdev_bnum begin = p->begin - record_space;
rtems_bdpart_write_mbr_partition(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_1,
8001e48: 2b 81 00 3c lw r1,(sp+60)
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;
8001e4c: 29 84 ff fc lw r4,(r12+-4)
rtems_bdpart_write_mbr_partition(
8001e50: 2b 83 00 38 lw r3,(sp+56)
8001e54: 28 21 00 1c lw r1,(r1+28)
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;
8001e58: c8 8e 20 00 sub r4,r4,r14
rtems_bdpart_write_mbr_partition(
8001e5c: c8 91 10 00 sub r2,r4,r17
8001e60: c8 64 18 00 sub r3,r3,r4
8001e64: 34 21 01 ce addi r1,r1,462
8001e68: 34 04 00 05 mvi r4,5
8001e6c: 34 05 00 00 mvi r5,0
8001e70: fb ff ff 15 calli 8001ac4 <rtems_bdpart_write_mbr_partition>
0
);
}
/* New EBR */
ebr = p->begin - record_space;
8001e74: 29 82 ff fc lw r2,(r12+-4)
sc = rtems_bdpart_new_record( dd, ebr, &block);
8001e78: 2b 81 00 30 lw r1,(sp+48)
8001e7c: b9 60 18 00 mv r3,r11
8001e80: c8 4e 10 00 sub r2,r2,r14
8001e84: fb ff ff 29 calli 8001b28 <rtems_bdpart_new_record>
if (sc != RTEMS_SUCCESSFUL) {
8001e88: 5c 20 00 14 bne r1,r0,8001ed8 <rtems_bdpart_write+0x304> <== NEVER TAKEN
goto cleanup;
}
/* Write first partition entry */
rtems_bdpart_write_mbr_partition(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0,
8001e8c: 2b 81 00 3c lw r1,(sp+60)
esc = sc;
goto cleanup;
}
/* Write first partition entry */
rtems_bdpart_write_mbr_partition(
8001e90: 29 84 00 00 lw r4,(r12+0)
8001e94: 29 83 ff fc lw r3,(r12+-4)
8001e98: 28 21 00 1c lw r1,(r1+28)
8001e9c: 41 85 00 2b lbu r5,(r12+43)
8001ea0: c8 83 18 00 sub r3,r4,r3
8001ea4: 41 84 00 04 lbu r4,(r12+4)
8001ea8: 34 21 01 be addi r1,r1,446
8001eac: b9 c0 10 00 mv r2,r14
8001eb0: fb ff ff 05 calli 8001ac4 <rtems_bdpart_write_mbr_partition>
RTEMS_BDPART_MBR_EXTENDED,
0
);
/* Write logical partitions */
for (i = ppc; i < count; ++i) {
8001eb4: 36 10 00 01 addi r16,r16,1
8001eb8: 35 8c 00 30 addi r12,r12,48
8001ebc: 55 f0 ff e2 bgu r15,r16,8001e44 <rtems_bdpart_write+0x270>
const rtems_bdpart_partition *pt,
size_t count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
8001ec0: 34 0b 00 00 mvi r11,0
8001ec4: e0 00 00 06 bi 8001edc <rtems_bdpart_write+0x308>
* 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;
8001ec8: 34 0b 00 0a mvi r11,10 <== NOT EXECUTED
8001ecc: e0 00 00 04 bi 8001edc <rtems_bdpart_write+0x308> <== NOT EXECUTED
goto cleanup;
}
/* Check flags */
if (p->flags > 0xffU) {
esc = RTEMS_INVALID_ID;
8001ed0: 34 0b 00 04 mvi r11,4 <== NOT EXECUTED
8001ed4: e0 00 00 02 bi 8001edc <rtems_bdpart_write+0x308> <== NOT EXECUTED
);
}
/* New EBR */
ebr = p->begin - record_space;
sc = rtems_bdpart_new_record( dd, ebr, &block);
8001ed8: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
}
}
cleanup:
if (fd >= 0) {
8001edc: 2b 81 00 34 lw r1,(sp+52)
8001ee0: 48 01 00 02 bg r0,r1,8001ee8 <rtems_bdpart_write+0x314> <== NEVER TAKEN
close( fd);
8001ee4: f8 00 08 02 calli 8003eec <close>
}
if (block != NULL) {
8001ee8: 2b 81 00 3c lw r1,(sp+60)
8001eec: 44 20 00 02 be r1,r0,8001ef4 <rtems_bdpart_write+0x320> <== NEVER TAKEN
rtems_bdbuf_sync( block);
8001ef0: f8 00 2d d1 calli 800d634 <rtems_bdbuf_sync>
}
return esc;
}
8001ef4: b9 60 08 00 mv r1,r11
8001ef8: 2b 9d 00 04 lw ra,(sp+4)
8001efc: 2b 8b 00 2c lw r11,(sp+44)
8001f00: 2b 8c 00 28 lw r12,(sp+40)
8001f04: 2b 8d 00 24 lw r13,(sp+36)
8001f08: 2b 8e 00 20 lw r14,(sp+32)
8001f0c: 2b 8f 00 1c lw r15,(sp+28)
8001f10: 2b 90 00 18 lw r16,(sp+24)
8001f14: 2b 91 00 14 lw r17,(sp+20)
8001f18: 2b 92 00 10 lw r18,(sp+16)
8001f1c: 2b 93 00 0c lw r19,(sp+12)
8001f20: 2b 94 00 08 lw r20,(sp+8)
8001f24: 37 9c 00 40 addi sp,sp,64
8001f28: c3 a0 00 00 ret
080019e4 <rtems_blkdev_create_partition>:
const char *partition,
const char *parent_block_device,
rtems_blkdev_bnum media_block_begin,
rtems_blkdev_bnum media_block_count
)
{
80019e4: 37 9c ff 94 addi sp,sp,-108
80019e8: 5b 8b 00 20 sw (sp+32),r11
80019ec: 5b 8c 00 1c sw (sp+28),r12
80019f0: 5b 8d 00 18 sw (sp+24),r13
80019f4: 5b 8e 00 14 sw (sp+20),r14
80019f8: 5b 8f 00 10 sw (sp+16),r15
80019fc: 5b 90 00 0c sw (sp+12),r16
8001a00: 5b 91 00 08 sw (sp+8),r17
8001a04: 5b 9d 00 04 sw (sp+4),ra
8001a08: b8 20 78 00 mv r15,r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
int fd = open(parent_block_device, O_RDWR);
8001a0c: b8 40 08 00 mv r1,r2
8001a10: 34 02 00 02 mvi r2,2
const char *partition,
const char *parent_block_device,
rtems_blkdev_bnum media_block_begin,
rtems_blkdev_bnum media_block_count
)
{
8001a14: b8 60 88 00 mv r17,r3
8001a18: b8 80 80 00 mv r16,r4
rtems_status_code sc = RTEMS_SUCCESSFUL;
int fd = open(parent_block_device, O_RDWR);
8001a1c: f8 00 0a e4 calli 80045ac <open>
8001a20: b8 20 68 00 mv r13,r1
if (sc != RTEMS_SUCCESSFUL) {
close(fd);
}
} else {
sc = RTEMS_INVALID_ID;
8001a24: 34 0b 00 04 mvi r11,4
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
int fd = open(parent_block_device, O_RDWR);
if (fd >= 0) {
8001a28: 48 01 00 2e bg r0,r1,8001ae0 <rtems_blkdev_create_partition+0xfc>
int rv;
struct stat st;
rv = fstat(fd, &st);
8001a2c: 37 82 00 24 addi r2,sp,36
8001a30: f8 00 06 e2 calli 80035b8 <fstat>
}
} else {
sc = RTEMS_NOT_IMPLEMENTED;
}
} else {
sc = RTEMS_INVALID_NODE;
8001a34: 34 0b 00 15 mvi r11,21
if (fd >= 0) {
int rv;
struct stat st;
rv = fstat(fd, &st);
if (rv == 0 && S_ISBLK(st.st_mode)) {
8001a38: 5c 20 00 28 bne r1,r0,8001ad8 <rtems_blkdev_create_partition+0xf4><== NEVER TAKEN
8001a3c: 2b 82 00 30 lw r2,(sp+48)
8001a40: 34 01 60 00 mvi r1,24576
8001a44: 20 42 f0 00 andi r2,r2,0xf000
8001a48: 5c 41 00 24 bne r2,r1,8001ad8 <rtems_blkdev_create_partition+0xf4>
static inline int rtems_disk_fd_get_disk_device(
int fd,
rtems_disk_device **dd_ptr
)
{
return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr);
8001a4c: 78 03 08 01 mvhi r3,0x801
8001a50: 38 63 8e 60 ori r3,r3,0x8e60
8001a54: 28 62 00 00 lw r2,(r3+0)
8001a58: b9 a0 08 00 mv r1,r13
8001a5c: 37 83 00 6c addi r3,sp,108
8001a60: f8 00 07 41 calli 8003764 <ioctl>
8001a64: b8 20 70 00 mv r14,r1
}
} else {
sc = RTEMS_NO_MEMORY;
}
} else {
sc = RTEMS_NOT_IMPLEMENTED;
8001a68: 34 0b 00 18 mvi r11,24
rv = fstat(fd, &st);
if (rv == 0 && S_ISBLK(st.st_mode)) {
rtems_disk_device *phys_dd;
rv = rtems_disk_fd_get_disk_device(fd, &phys_dd);
if (rv == 0) {
8001a6c: 5c 20 00 1b bne r1,r0,8001ad8 <rtems_blkdev_create_partition+0xf4><== NEVER TAKEN
rtems_blkdev_imfs_context *ctx = malloc(sizeof(*ctx));
8001a70: 34 01 00 80 mvi r1,128
8001a74: f8 00 08 8e calli 8003cac <malloc>
8001a78: b8 20 60 00 mv r12,r1
if (ctx != NULL) {
8001a7c: 44 2e 00 16 be r1,r14,8001ad4 <rtems_blkdev_create_partition+0xf0><== NEVER TAKEN
sc = rtems_disk_init_log(
8001a80: 2b 82 00 6c lw r2,(sp+108)
8001a84: ba 20 18 00 mv r3,r17
8001a88: ba 00 20 00 mv r4,r16
8001a8c: f8 00 00 97 calli 8001ce8 <rtems_disk_init_log>
8001a90: b8 20 58 00 mv r11,r1
phys_dd,
media_block_begin,
media_block_count
);
if (sc == RTEMS_SUCCESSFUL) {
8001a94: 5c 20 00 0d bne r1,r0,8001ac8 <rtems_blkdev_create_partition+0xe4>
ctx->fd = fd;
rv = IMFS_make_generic_node(
8001a98: 78 03 08 01 mvhi r3,0x801
8001a9c: b9 e0 08 00 mv r1,r15
8001aa0: 34 02 61 ff mvi r2,25087
8001aa4: 38 63 8f d0 ori r3,r3,0x8fd0
8001aa8: b9 80 20 00 mv r4,r12
media_block_begin,
media_block_count
);
if (sc == RTEMS_SUCCESSFUL) {
ctx->fd = fd;
8001aac: 59 8d 00 78 sw (r12+120),r13
rv = IMFS_make_generic_node(
8001ab0: f8 00 04 92 calli 8002cf8 <IMFS_make_generic_node>
S_IFBLK | S_IRWXU | S_IRWXG | S_IRWXO,
&rtems_blkdev_imfs_control,
ctx
);
if (rv != 0) {
8001ab4: 44 2b 00 0b be r1,r11,8001ae0 <rtems_blkdev_create_partition+0xfc><== ALWAYS TAKEN
free(ctx);
8001ab8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8001abc: f8 00 06 91 calli 8003500 <free> <== NOT EXECUTED
sc = RTEMS_UNSATISFIED;
8001ac0: 34 0b 00 0d mvi r11,13 <== NOT EXECUTED
8001ac4: e0 00 00 05 bi 8001ad8 <rtems_blkdev_create_partition+0xf4><== NOT EXECUTED
}
} else {
free(ctx);
8001ac8: b9 80 08 00 mv r1,r12
8001acc: f8 00 06 8d calli 8003500 <free>
8001ad0: e0 00 00 02 bi 8001ad8 <rtems_blkdev_create_partition+0xf4>
}
} else {
sc = RTEMS_NO_MEMORY;
8001ad4: 34 0b 00 1a mvi r11,26 <== NOT EXECUTED
} else {
sc = RTEMS_INVALID_NODE;
}
if (sc != RTEMS_SUCCESSFUL) {
close(fd);
8001ad8: b9 a0 08 00 mv r1,r13
8001adc: f8 00 06 5e calli 8003454 <close>
} else {
sc = RTEMS_INVALID_ID;
}
return sc;
}
8001ae0: b9 60 08 00 mv r1,r11
8001ae4: 2b 9d 00 04 lw ra,(sp+4)
8001ae8: 2b 8b 00 20 lw r11,(sp+32)
8001aec: 2b 8c 00 1c lw r12,(sp+28)
8001af0: 2b 8d 00 18 lw r13,(sp+24)
8001af4: 2b 8e 00 14 lw r14,(sp+20)
8001af8: 2b 8f 00 10 lw r15,(sp+16)
8001afc: 2b 90 00 0c lw r16,(sp+12)
8001b00: 2b 91 00 08 lw r17,(sp+8)
8001b04: 37 9c 00 6c addi sp,sp,108
8001b08: c3 a0 00 00 ret
0800c348 <rtems_blkdev_generic_ioctl>:
rtems_device_driver
rtems_blkdev_generic_ioctl(
rtems_device_major_number major __attribute__((unused)),
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
800c348: 37 9c ff f8 addi sp,sp,-8
800c34c: 5b 8b 00 08 sw (sp+8),r11
800c350: 5b 9d 00 04 sw (sp+4),ra
rtems_libio_ioctl_args_t *args = arg;
rtems_libio_t *iop = args->iop;
rtems_disk_device *dd = iop->data1;
if (args->command != RTEMS_BLKIO_REQUEST)
800c354: 78 04 08 01 mvhi r4,0x801
800c358: 38 84 8c 98 ori r4,r4,0x8c98
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
rtems_libio_ioctl_args_t *args = arg;
rtems_libio_t *iop = args->iop;
rtems_disk_device *dd = iop->data1;
800c35c: 28 61 00 00 lw r1,(r3+0)
rtems_device_driver
rtems_blkdev_generic_ioctl(
rtems_device_major_number major __attribute__((unused)),
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
800c360: b8 60 58 00 mv r11,r3
rtems_libio_ioctl_args_t *args = arg;
rtems_libio_t *iop = args->iop;
rtems_disk_device *dd = iop->data1;
if (args->command != RTEMS_BLKIO_REQUEST)
800c364: 28 62 00 04 lw r2,(r3+4)
800c368: 28 83 00 00 lw r3,(r4+0)
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
rtems_libio_ioctl_args_t *args = arg;
rtems_libio_t *iop = args->iop;
rtems_disk_device *dd = iop->data1;
800c36c: 28 21 00 28 lw r1,(r1+40)
if (args->command != RTEMS_BLKIO_REQUEST)
800c370: 44 43 00 05 be r2,r3,800c384 <rtems_blkdev_generic_ioctl+0x3c><== NEVER TAKEN
{
args->ioctl_return = dd->ioctl(dd,
800c374: 28 24 00 38 lw r4,(r1+56)
800c378: 29 63 00 08 lw r3,(r11+8)
800c37c: d8 80 00 00 call r4
800c380: e0 00 00 02 bi 800c388 <rtems_blkdev_generic_ioctl+0x40>
{
/*
* It is not allowed to directly access the driver circumventing the
* cache.
*/
args->ioctl_return = -1;
800c384: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
800c388: 59 61 00 0c sw (r11+12),r1
}
return RTEMS_SUCCESSFUL;
}
800c38c: 34 01 00 00 mvi r1,0
800c390: 2b 9d 00 04 lw ra,(sp+4)
800c394: 2b 8b 00 08 lw r11,(sp+8)
800c398: 37 9c 00 08 addi sp,sp,8
800c39c: c3 a0 00 00 ret
0800c0cc <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)
{
800c0cc: 37 9c ff d8 addi sp,sp,-40
800c0d0: 5b 8b 00 24 sw (sp+36),r11
800c0d4: 5b 8c 00 20 sw (sp+32),r12
800c0d8: 5b 8d 00 1c sw (sp+28),r13
800c0dc: 5b 8e 00 18 sw (sp+24),r14
800c0e0: 5b 8f 00 14 sw (sp+20),r15
800c0e4: 5b 90 00 10 sw (sp+16),r16
800c0e8: 5b 91 00 0c sw (sp+12),r17
800c0ec: 5b 92 00 08 sw (sp+8),r18
800c0f0: 5b 9d 00 04 sw (sp+4),ra
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;
800c0f4: 28 61 00 00 lw r1,(r3+0)
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);
800c0f8: 28 6c 00 04 lw r12,(r3+4)
rtems_device_driver
rtems_blkdev_generic_read(
rtems_device_major_number major __attribute__((unused)),
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
800c0fc: b8 60 58 00 mv r11,r3
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;
800c100: 28 32 00 28 lw r18,(r1+40)
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);
800c104: b9 80 08 00 mv r1,r12
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;
800c108: 28 71 00 08 lw r17,(r3+8)
{
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;
800c10c: 2a 4f 00 24 lw r15,(r18+36)
char *buf = args->buffer;
uint32_t count = args->count;
800c110: 28 6d 00 0c lw r13,(r3+12)
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (args->offset / block_size);
800c114: b9 e0 10 00 mv r2,r15
800c118: f8 00 2e e4 calli 8017ca8 <__udivsi3>
800c11c: b8 20 80 00 mv r16,r1
uint32_t blkofs = (uint32_t) (args->offset % block_size);
800c120: b9 e0 10 00 mv r2,r15
800c124: b9 80 08 00 mv r1,r12
800c128: f8 00 2e f0 calli 8017ce8 <__umodsi3>
800c12c: b8 20 70 00 mv r14,r1
args->bytes_moved = 0;
800c130: 59 60 00 14 sw (r11+20),r0
while (count > 0)
800c134: e0 00 00 19 bi 800c198 <rtems_blkdev_generic_read+0xcc>
{
rtems_bdbuf_buffer *diskbuf;
uint32_t copy;
rc = rtems_bdbuf_read(dd, block, &diskbuf);
800c138: ba 40 08 00 mv r1,r18
800c13c: ba 00 10 00 mv r2,r16
800c140: 37 83 00 28 addi r3,sp,40
800c144: fb ff fd 54 calli 800b694 <rtems_bdbuf_read>
if (rc != RTEMS_SUCCESSFUL)
800c148: 5c 20 00 16 bne r1,r0,800c1a0 <rtems_blkdev_generic_read+0xd4><== NEVER TAKEN
break;
copy = block_size - blkofs;
800c14c: c9 ee 60 00 sub r12,r15,r14
800c150: 51 ac 00 02 bgeu r13,r12,800c158 <rtems_blkdev_generic_read+0x8c><== ALWAYS TAKEN
800c154: b9 a0 60 00 mv r12,r13 <== NOT EXECUTED
if (copy > count)
copy = count;
memcpy(buf, (char *)diskbuf->buffer + blkofs, copy);
800c158: 2b 81 00 28 lw r1,(sp+40)
800c15c: b9 80 18 00 mv r3,r12
800c160: 28 22 00 1c lw r2,(r1+28)
800c164: ba 20 08 00 mv r1,r17
800c168: b4 4e 10 00 add r2,r2,r14
800c16c: f8 00 19 b0 calli 801282c <memcpy>
rc = rtems_bdbuf_release(diskbuf);
800c170: 2b 81 00 28 lw r1,(sp+40)
800c174: fb ff fd d2 calli 800b8bc <rtems_bdbuf_release>
args->bytes_moved += copy;
800c178: 29 62 00 14 lw r2,(r11+20)
800c17c: b4 4c 10 00 add r2,r2,r12
800c180: 59 62 00 14 sw (r11+20),r2
if (rc != RTEMS_SUCCESSFUL)
800c184: 5c 20 00 07 bne r1,r0,800c1a0 <rtems_blkdev_generic_read+0xd4><== NEVER TAKEN
break;
count -= copy;
800c188: c9 ac 68 00 sub r13,r13,r12
buf += copy;
800c18c: b6 2c 88 00 add r17,r17,r12
blkofs = 0;
block++;
800c190: 36 10 00 01 addi r16,r16,1
args->bytes_moved += copy;
if (rc != RTEMS_SUCCESSFUL)
break;
count -= copy;
buf += copy;
blkofs = 0;
800c194: 34 0e 00 00 mvi r14,0
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)
800c198: 5d a0 ff e8 bne r13,r0,800c138 <rtems_blkdev_generic_read+0x6c>
800c19c: 34 01 00 00 mvi r1,0
blkofs = 0;
block++;
}
return rc;
}
800c1a0: 2b 9d 00 04 lw ra,(sp+4)
800c1a4: 2b 8b 00 24 lw r11,(sp+36)
800c1a8: 2b 8c 00 20 lw r12,(sp+32)
800c1ac: 2b 8d 00 1c lw r13,(sp+28)
800c1b0: 2b 8e 00 18 lw r14,(sp+24)
800c1b4: 2b 8f 00 14 lw r15,(sp+20)
800c1b8: 2b 90 00 10 lw r16,(sp+16)
800c1bc: 2b 91 00 0c lw r17,(sp+12)
800c1c0: 2b 92 00 08 lw r18,(sp+8)
800c1c4: 37 9c 00 28 addi sp,sp,40
800c1c8: c3 a0 00 00 ret
0800c1cc <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)
{
800c1cc: 37 9c ff d8 addi sp,sp,-40
800c1d0: 5b 8b 00 24 sw (sp+36),r11
800c1d4: 5b 8c 00 20 sw (sp+32),r12
800c1d8: 5b 8d 00 1c sw (sp+28),r13
800c1dc: 5b 8e 00 18 sw (sp+24),r14
800c1e0: 5b 8f 00 14 sw (sp+20),r15
800c1e4: 5b 90 00 10 sw (sp+16),r16
800c1e8: 5b 91 00 0c sw (sp+12),r17
800c1ec: 5b 92 00 08 sw (sp+8),r18
800c1f0: 5b 9d 00 04 sw (sp+4),ra
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;
800c1f4: 28 61 00 00 lw r1,(r3+0)
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);
800c1f8: 28 6d 00 04 lw r13,(r3+4)
rtems_device_driver
rtems_blkdev_generic_write(
rtems_device_major_number major __attribute__((unused)),
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
800c1fc: b8 60 58 00 mv r11,r3
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;
800c200: 28 32 00 28 lw r18,(r1+40)
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);
800c204: b9 a0 08 00 mv r1,r13
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;
800c208: 28 71 00 08 lw r17,(r3+8)
{
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;
800c20c: 2a 4f 00 24 lw r15,(r18+36)
char *buf = args->buffer;
uint32_t count = args->count;
800c210: 28 6c 00 0c lw r12,(r3+12)
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (args->offset / block_size);
800c214: b9 e0 10 00 mv r2,r15
800c218: f8 00 2e a4 calli 8017ca8 <__udivsi3>
800c21c: b8 20 80 00 mv r16,r1
uint32_t blkofs = (uint32_t) (args->offset % block_size);
800c220: b9 e0 10 00 mv r2,r15
800c224: b9 a0 08 00 mv r1,r13
800c228: f8 00 2e b0 calli 8017ce8 <__umodsi3>
800c22c: b8 20 70 00 mv r14,r1
args->bytes_moved = 0;
800c230: 59 60 00 14 sw (r11+20),r0
while (count > 0)
800c234: e0 00 00 22 bi 800c2bc <rtems_blkdev_generic_write+0xf0>
{
rtems_bdbuf_buffer *diskbuf;
uint32_t copy;
if ((blkofs == 0) && (count >= block_size))
800c238: f1 8f 10 00 cmpgeu r2,r12,r15
800c23c: 65 c1 00 00 cmpei r1,r14,0
800c240: a0 41 08 00 and r1,r2,r1
800c244: 44 20 00 06 be r1,r0,800c25c <rtems_blkdev_generic_write+0x90><== NEVER TAKEN
rc = rtems_bdbuf_get(dd, block, &diskbuf);
800c248: ba 40 08 00 mv r1,r18
800c24c: ba 00 10 00 mv r2,r16
800c250: 37 83 00 28 addi r3,sp,40
800c254: fb ff fc d1 calli 800b598 <rtems_bdbuf_get>
800c258: e0 00 00 05 bi 800c26c <rtems_blkdev_generic_write+0xa0>
else
rc = rtems_bdbuf_read(dd, block, &diskbuf);
800c25c: ba 40 08 00 mv r1,r18 <== NOT EXECUTED
800c260: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
800c264: 37 83 00 28 addi r3,sp,40 <== NOT EXECUTED
800c268: fb ff fd 0b calli 800b694 <rtems_bdbuf_read> <== NOT EXECUTED
if (rc != RTEMS_SUCCESSFUL)
800c26c: 5c 20 00 16 bne r1,r0,800c2c4 <rtems_blkdev_generic_write+0xf8><== NEVER TAKEN
break;
copy = block_size - blkofs;
800c270: c9 ee 68 00 sub r13,r15,r14
800c274: 51 8d 00 02 bgeu r12,r13,800c27c <rtems_blkdev_generic_write+0xb0><== ALWAYS TAKEN
800c278: b9 80 68 00 mv r13,r12 <== NOT EXECUTED
if (copy > count)
copy = count;
memcpy((char *)diskbuf->buffer + blkofs, buf, copy);
800c27c: 2b 81 00 28 lw r1,(sp+40)
800c280: ba 20 10 00 mv r2,r17
800c284: b9 a0 18 00 mv r3,r13
800c288: 28 21 00 1c lw r1,(r1+28)
800c28c: b4 2e 08 00 add r1,r1,r14
800c290: f8 00 19 67 calli 801282c <memcpy>
args->bytes_moved += copy;
800c294: 29 61 00 14 lw r1,(r11+20)
800c298: b4 2d 08 00 add r1,r1,r13
800c29c: 59 61 00 14 sw (r11+20),r1
rc = rtems_bdbuf_release_modified(diskbuf);
800c2a0: 2b 81 00 28 lw r1,(sp+40)
800c2a4: fb ff fd bb calli 800b990 <rtems_bdbuf_release_modified>
if (rc != RTEMS_SUCCESSFUL)
800c2a8: 5c 20 00 07 bne r1,r0,800c2c4 <rtems_blkdev_generic_write+0xf8><== NEVER TAKEN
break;
count -= copy;
800c2ac: c9 8d 60 00 sub r12,r12,r13
buf += copy;
800c2b0: b6 2d 88 00 add r17,r17,r13
blkofs = 0;
block++;
800c2b4: 36 10 00 01 addi r16,r16,1
if (rc != RTEMS_SUCCESSFUL)
break;
count -= copy;
buf += copy;
blkofs = 0;
800c2b8: 34 0e 00 00 mvi r14,0
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)
800c2bc: 5d 80 ff df bne r12,r0,800c238 <rtems_blkdev_generic_write+0x6c>
800c2c0: 34 01 00 00 mvi r1,0
blkofs = 0;
block++;
}
return rc;
}
800c2c4: 2b 9d 00 04 lw ra,(sp+4)
800c2c8: 2b 8b 00 24 lw r11,(sp+36)
800c2cc: 2b 8c 00 20 lw r12,(sp+32)
800c2d0: 2b 8d 00 1c lw r13,(sp+28)
800c2d4: 2b 8e 00 18 lw r14,(sp+24)
800c2d8: 2b 8f 00 14 lw r15,(sp+20)
800c2dc: 2b 90 00 10 lw r16,(sp+16)
800c2e0: 2b 91 00 0c lw r17,(sp+12)
800c2e4: 2b 92 00 08 lw r18,(sp+8)
800c2e8: 37 9c 00 28 addi sp,sp,40
800c2ec: c3 a0 00 00 ret
08001568 <rtems_blkdev_imfs_fsync_or_fdatasync>:
}
static int rtems_blkdev_imfs_fsync_or_fdatasync(
rtems_libio_t *iop
)
{
8001568: 37 9c ff fc addi sp,sp,-4
800156c: 5b 9d 00 04 sw (sp+4),ra
} else {
sc = RTEMS_INVALID_ID;
}
return sc;
}
8001570: 28 21 00 14 lw r1,(r1+20)
)
{
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);
8001574: 28 21 00 50 lw r1,(r1+80)
8001578: f8 00 2c fb calli 800c964 <rtems_bdbuf_syncdev>
static int rtems_blkdev_imfs_fsync_or_fdatasync(
rtems_libio_t *iop
)
{
int rv = 0;
800157c: 34 02 00 00 mvi r2,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);
if (sc != RTEMS_SUCCESSFUL) {
8001580: 44 20 00 05 be r1,r0,8001594 <rtems_blkdev_imfs_fsync_or_fdatasync+0x2c><== ALWAYS TAKEN
errno = EIO;
8001584: f8 00 43 c5 calli 8012498 <__errno> <== NOT EXECUTED
8001588: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
800158c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
rv = -1;
8001590: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED
}
return rv;
}
8001594: b8 40 08 00 mv r1,r2
8001598: 2b 9d 00 04 lw ra,(sp+4)
800159c: 37 9c 00 04 addi sp,sp,4
80015a0: c3 a0 00 00 ret
080015a4 <rtems_blkdev_imfs_ioctl>:
static int rtems_blkdev_imfs_ioctl(
rtems_libio_t *iop,
uint32_t request,
void *buffer
)
{
80015a4: 37 9c ff fc addi sp,sp,-4
80015a8: 5b 9d 00 04 sw (sp+4),ra
int rv = 0;
if (request != RTEMS_BLKIO_REQUEST) {
80015ac: 78 05 08 01 mvhi r5,0x801
80015b0: 38 a5 8f c8 ori r5,r5,0x8fc8
80015b4: 28 a4 00 00 lw r4,(r5+0)
80015b8: 44 44 00 06 be r2,r4,80015d0 <rtems_blkdev_imfs_ioctl+0x2c><== NEVER TAKEN
} else {
sc = RTEMS_INVALID_ID;
}
return sc;
}
80015bc: 28 21 00 14 lw r1,(r1+20)
)
{
int rv = 0;
if (request != RTEMS_BLKIO_REQUEST) {
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
80015c0: 28 21 00 50 lw r1,(r1+80)
rtems_disk_device *dd = &ctx->dd;
rv = (*dd->ioctl)(dd, request, buffer);
80015c4: 28 24 00 38 lw r4,(r1+56)
80015c8: d8 80 00 00 call r4
80015cc: e0 00 00 05 bi 80015e0 <rtems_blkdev_imfs_ioctl+0x3c>
} else {
/*
* It is not allowed to directly access the driver circumventing the cache.
*/
errno = EINVAL;
80015d0: f8 00 43 b2 calli 8012498 <__errno> <== NOT EXECUTED
80015d4: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
80015d8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
rv = -1;
80015dc: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
}
return rv;
}
80015e0: 2b 9d 00 04 lw ra,(sp+4)
80015e4: 37 9c 00 04 addi sp,sp,4
80015e8: c3 a0 00 00 ret
08001770 <rtems_blkdev_imfs_read>:
static ssize_t rtems_blkdev_imfs_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
8001770: 37 9c ff d4 addi sp,sp,-44
8001774: 5b 8b 00 28 sw (sp+40),r11
8001778: 5b 8c 00 24 sw (sp+36),r12
800177c: 5b 8d 00 20 sw (sp+32),r13
8001780: 5b 8e 00 1c sw (sp+28),r14
8001784: 5b 8f 00 18 sw (sp+24),r15
8001788: 5b 90 00 14 sw (sp+20),r16
800178c: 5b 91 00 10 sw (sp+16),r17
8001790: 5b 92 00 0c sw (sp+12),r18
8001794: 5b 93 00 08 sw (sp+8),r19
8001798: 5b 9d 00 04 sw (sp+4),ra
800179c: b8 20 58 00 mv r11,r1
} else {
sc = RTEMS_INVALID_ID;
}
return sc;
}
80017a0: 28 21 00 14 lw r1,(r1+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;
80017a4: 29 6c 00 04 lw r12,(r11+4)
static ssize_t rtems_blkdev_imfs_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
80017a8: b8 40 78 00 mv r15,r2
int rv;
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
80017ac: 28 33 00 50 lw r19,(r1+80)
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);
80017b0: b9 80 08 00 mv r1,r12
static ssize_t rtems_blkdev_imfs_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
80017b4: b8 60 70 00 mv r14,r3
int rv;
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
off_t offset = iop->offset;
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
80017b8: 2a 71 00 24 lw r17,(r19+36)
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
80017bc: ba 20 10 00 mv r2,r17
80017c0: f8 00 5b 29 calli 8018464 <__divsi3>
80017c4: b8 20 90 00 mv r18,r1
ssize_t block_offset = (ssize_t) (offset % block_size);
80017c8: ba 20 10 00 mv r2,r17
80017cc: b9 80 08 00 mv r1,r12
80017d0: f8 00 5b 55 calli 8018524 <__modsi3>
80017d4: b8 20 80 00 mv r16,r1
)
{
int rv;
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
80017d8: b9 c0 60 00 mv r12,r14
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) {
80017dc: e0 00 00 16 bi 8001834 <rtems_blkdev_imfs_read+0xc4>
rtems_bdbuf_buffer *bd;
rtems_status_code sc = rtems_bdbuf_read(dd, block, &bd);
80017e0: ba 60 08 00 mv r1,r19
80017e4: ba 40 10 00 mv r2,r18
80017e8: 37 83 00 2c addi r3,sp,44
80017ec: f8 00 2b 2d calli 800c4a0 <rtems_bdbuf_read>
if (sc == RTEMS_SUCCESSFUL) {
80017f0: 5c 20 00 18 bne r1,r0,8001850 <rtems_blkdev_imfs_read+0xe0><== NEVER TAKEN
ssize_t copy = block_size - block_offset;
80017f4: ca 30 68 00 sub r13,r17,r16
80017f8: 4d 8d 00 02 bge r12,r13,8001800 <rtems_blkdev_imfs_read+0x90>
80017fc: b9 80 68 00 mv r13,r12
if (copy > remaining) {
copy = remaining;
}
memcpy(dst, (char *) bd->buffer + block_offset, (size_t) copy);
8001800: 2b 81 00 2c lw r1,(sp+44)
8001804: b9 a0 18 00 mv r3,r13
8001808: 28 22 00 1c lw r2,(r1+28)
800180c: b9 e0 08 00 mv r1,r15
8001810: b4 50 10 00 add r2,r2,r16
8001814: f8 00 46 1a calli 801307c <memcpy>
sc = rtems_bdbuf_release(bd);
8001818: 2b 81 00 2c lw r1,(sp+44)
800181c: f8 00 2b ab calli 800c6c8 <rtems_bdbuf_release>
if (sc == RTEMS_SUCCESSFUL) {
8001820: 5c 20 00 0c bne r1,r0,8001850 <rtems_blkdev_imfs_read+0xe0><== NEVER TAKEN
block_offset = 0;
remaining -= copy;
8001824: c9 8d 60 00 sub r12,r12,r13
dst += copy;
8001828: b5 ed 78 00 add r15,r15,r13
++block;
800182c: 36 52 00 01 addi r18,r18,1
memcpy(dst, (char *) bd->buffer + block_offset, (size_t) copy);
sc = rtems_bdbuf_release(bd);
if (sc == RTEMS_SUCCESSFUL) {
block_offset = 0;
8001830: 34 10 00 00 mvi r16,0
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) {
8001834: 49 80 ff eb bg r12,r0,80017e0 <rtems_blkdev_imfs_read+0x70>
} else {
remaining = -1;
}
}
if (remaining >= 0) {
8001838: 5d 80 00 06 bne r12,r0,8001850 <rtems_blkdev_imfs_read+0xe0><== NEVER TAKEN
iop->offset += count;
800183c: 29 61 00 04 lw r1,(r11+4)
8001840: b4 2e 08 00 add r1,r1,r14
8001844: 59 61 00 04 sw (r11+4),r1
rv = (ssize_t) count;
8001848: b9 c0 08 00 mv r1,r14
800184c: e0 00 00 05 bi 8001860 <rtems_blkdev_imfs_read+0xf0>
} else {
errno = EIO;
8001850: f8 00 43 12 calli 8012498 <__errno> <== NOT EXECUTED
8001854: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
8001858: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
rv = -1;
800185c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
}
return rv;
}
8001860: 2b 9d 00 04 lw ra,(sp+4)
8001864: 2b 8b 00 28 lw r11,(sp+40)
8001868: 2b 8c 00 24 lw r12,(sp+36)
800186c: 2b 8d 00 20 lw r13,(sp+32)
8001870: 2b 8e 00 1c lw r14,(sp+28)
8001874: 2b 8f 00 18 lw r15,(sp+24)
8001878: 2b 90 00 14 lw r16,(sp+20)
800187c: 2b 91 00 10 lw r17,(sp+16)
8001880: 2b 92 00 0c lw r18,(sp+12)
8001884: 2b 93 00 08 lw r19,(sp+8)
8001888: 37 9c 00 2c addi sp,sp,44
800188c: c3 a0 00 00 ret
0800162c <rtems_blkdev_imfs_write>:
static ssize_t rtems_blkdev_imfs_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
800162c: 37 9c ff d4 addi sp,sp,-44
8001630: 5b 8b 00 28 sw (sp+40),r11
8001634: 5b 8c 00 24 sw (sp+36),r12
8001638: 5b 8d 00 20 sw (sp+32),r13
800163c: 5b 8e 00 1c sw (sp+28),r14
8001640: 5b 8f 00 18 sw (sp+24),r15
8001644: 5b 90 00 14 sw (sp+20),r16
8001648: 5b 91 00 10 sw (sp+16),r17
800164c: 5b 92 00 0c sw (sp+12),r18
8001650: 5b 93 00 08 sw (sp+8),r19
8001654: 5b 9d 00 04 sw (sp+4),ra
8001658: b8 20 60 00 mv r12,r1
} else {
sc = RTEMS_INVALID_ID;
}
return sc;
}
800165c: 28 21 00 14 lw r1,(r1+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;
8001660: 29 8b 00 04 lw r11,(r12+4)
static ssize_t rtems_blkdev_imfs_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
8001664: b8 40 90 00 mv r18,r2
int rv;
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
8001668: 28 33 00 50 lw r19,(r1+80)
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);
800166c: b9 60 08 00 mv r1,r11
static ssize_t rtems_blkdev_imfs_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
8001670: b8 60 88 00 mv r17,r3
int rv;
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
off_t offset = iop->offset;
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
8001674: 2a 6f 00 24 lw r15,(r19+36)
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
8001678: b9 e0 10 00 mv r2,r15
800167c: f8 00 5b 7a calli 8018464 <__divsi3>
8001680: b8 20 80 00 mv r16,r1
ssize_t block_offset = (ssize_t) (offset % block_size);
8001684: b9 e0 10 00 mv r2,r15
8001688: b9 60 08 00 mv r1,r11
800168c: f8 00 5b a6 calli 8018524 <__modsi3>
8001690: b8 20 70 00 mv r14,r1
)
{
int rv;
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
8001694: ba 20 58 00 mv r11,r17
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) {
8001698: e0 00 00 1f bi 8001714 <rtems_blkdev_imfs_write+0xe8>
rtems_status_code sc;
rtems_bdbuf_buffer *bd;
if (block_offset == 0 && remaining >= block_size) {
800169c: ed 6f 10 00 cmpge r2,r11,r15
80016a0: 65 c1 00 00 cmpei r1,r14,0
80016a4: a0 41 08 00 and r1,r2,r1
80016a8: 44 20 00 06 be r1,r0,80016c0 <rtems_blkdev_imfs_write+0x94>
sc = rtems_bdbuf_get(dd, block, &bd);
80016ac: ba 60 08 00 mv r1,r19
80016b0: ba 00 10 00 mv r2,r16
80016b4: 37 83 00 2c addi r3,sp,44
80016b8: f8 00 2b 3b calli 800c3a4 <rtems_bdbuf_get>
80016bc: e0 00 00 05 bi 80016d0 <rtems_blkdev_imfs_write+0xa4>
} else {
sc = rtems_bdbuf_read(dd, block, &bd);
80016c0: ba 60 08 00 mv r1,r19
80016c4: ba 00 10 00 mv r2,r16
80016c8: 37 83 00 2c addi r3,sp,44
80016cc: f8 00 2b 75 calli 800c4a0 <rtems_bdbuf_read>
}
if (sc == RTEMS_SUCCESSFUL) {
80016d0: 5c 20 00 18 bne r1,r0,8001730 <rtems_blkdev_imfs_write+0x104><== NEVER TAKEN
ssize_t copy = block_size - block_offset;
80016d4: c9 ee 68 00 sub r13,r15,r14
80016d8: 4d 6d 00 02 bge r11,r13,80016e0 <rtems_blkdev_imfs_write+0xb4>
80016dc: b9 60 68 00 mv r13,r11
if (copy > remaining) {
copy = remaining;
}
memcpy((char *) bd->buffer + block_offset, src, (size_t) copy);
80016e0: 2b 81 00 2c lw r1,(sp+44)
80016e4: ba 40 10 00 mv r2,r18
80016e8: b9 a0 18 00 mv r3,r13
80016ec: 28 21 00 1c lw r1,(r1+28)
80016f0: b4 2e 08 00 add r1,r1,r14
80016f4: f8 00 46 62 calli 801307c <memcpy>
sc = rtems_bdbuf_release_modified(bd);
80016f8: 2b 81 00 2c lw r1,(sp+44)
80016fc: f8 00 2c 28 calli 800c79c <rtems_bdbuf_release_modified>
if (sc == RTEMS_SUCCESSFUL) {
8001700: 5c 20 00 0c bne r1,r0,8001730 <rtems_blkdev_imfs_write+0x104><== NEVER TAKEN
block_offset = 0;
remaining -= copy;
8001704: c9 6d 58 00 sub r11,r11,r13
src += copy;
8001708: b6 4d 90 00 add r18,r18,r13
++block;
800170c: 36 10 00 01 addi r16,r16,1
memcpy((char *) bd->buffer + block_offset, src, (size_t) copy);
sc = rtems_bdbuf_release_modified(bd);
if (sc == RTEMS_SUCCESSFUL) {
block_offset = 0;
8001710: 34 0e 00 00 mvi r14,0
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) {
8001714: 49 60 ff e2 bg r11,r0,800169c <rtems_blkdev_imfs_write+0x70>
} else {
remaining = -1;
}
}
if (remaining >= 0) {
8001718: 5d 60 00 06 bne r11,r0,8001730 <rtems_blkdev_imfs_write+0x104><== NEVER TAKEN
iop->offset += count;
800171c: 29 81 00 04 lw r1,(r12+4)
8001720: b4 31 08 00 add r1,r1,r17
8001724: 59 81 00 04 sw (r12+4),r1
rv = (ssize_t) count;
8001728: ba 20 08 00 mv r1,r17
800172c: e0 00 00 05 bi 8001740 <rtems_blkdev_imfs_write+0x114>
} else {
errno = EIO;
8001730: f8 00 43 5a calli 8012498 <__errno> <== NOT EXECUTED
8001734: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
8001738: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
rv = -1;
800173c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
}
return rv;
}
8001740: 2b 9d 00 04 lw ra,(sp+4)
8001744: 2b 8b 00 28 lw r11,(sp+40)
8001748: 2b 8c 00 24 lw r12,(sp+36)
800174c: 2b 8d 00 20 lw r13,(sp+32)
8001750: 2b 8e 00 1c lw r14,(sp+28)
8001754: 2b 8f 00 18 lw r15,(sp+24)
8001758: 2b 90 00 14 lw r16,(sp+20)
800175c: 2b 91 00 10 lw r17,(sp+16)
8001760: 2b 92 00 0c lw r18,(sp+12)
8001764: 2b 93 00 08 lw r19,(sp+8)
8001768: 37 9c 00 2c addi sp,sp,44
800176c: c3 a0 00 00 ret
0800bf88 <rtems_blkdev_ioctl>:
#include <rtems/blkdev.h>
#include <rtems/bdbuf.h>
int
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
800bf88: 37 9c ff fc addi sp,sp,-4
800bf8c: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc;
int rc = 0;
switch (req)
800bf90: 78 06 08 01 mvhi r6,0x801
800bf94: 38 c6 87 80 ori r6,r6,0x8780
800bf98: 28 c5 00 00 lw r5,(r6+0)
#include <rtems/blkdev.h>
#include <rtems/bdbuf.h>
int
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
800bf9c: b8 20 20 00 mv r4,r1
rtems_status_code sc;
int rc = 0;
switch (req)
800bfa0: 44 45 00 2a be r2,r5,800c048 <rtems_blkdev_ioctl+0xc0>
800bfa4: 54 45 00 14 bgu r2,r5,800bff4 <rtems_blkdev_ioctl+0x6c>
800bfa8: 78 06 08 01 mvhi r6,0x801
800bfac: 38 c6 8d 54 ori r6,r6,0x8d54
800bfb0: 28 c5 00 00 lw r5,(r6+0)
800bfb4: 44 45 00 37 be r2,r5,800c090 <rtems_blkdev_ioctl+0x108>
800bfb8: 54 45 00 06 bgu r2,r5,800bfd0 <rtems_blkdev_ioctl+0x48>
800bfbc: 78 04 08 01 mvhi r4,0x801
800bfc0: 38 84 87 90 ori r4,r4,0x8790
800bfc4: 28 83 00 00 lw r3,(r4+0)
800bfc8: 5c 43 00 39 bne r2,r3,800c0ac <rtems_blkdev_ioctl+0x124>
800bfcc: e0 00 00 29 bi 800c070 <rtems_blkdev_ioctl+0xe8>
800bfd0: 78 06 08 01 mvhi r6,0x801
800bfd4: 38 c6 8d 58 ori r6,r6,0x8d58
800bfd8: 28 c5 00 00 lw r5,(r6+0)
800bfdc: 44 45 00 32 be r2,r5,800c0a4 <rtems_blkdev_ioctl+0x11c> <== NEVER TAKEN
800bfe0: 78 05 08 01 mvhi r5,0x801
800bfe4: 38 a5 87 7c ori r5,r5,0x877c
800bfe8: 28 a1 00 00 lw r1,(r5+0)
800bfec: 5c 41 00 30 bne r2,r1,800c0ac <rtems_blkdev_ioctl+0x124> <== NEVER TAKEN
800bff0: e0 00 00 14 bi 800c040 <rtems_blkdev_ioctl+0xb8>
800bff4: 78 06 08 01 mvhi r6,0x801
800bff8: 38 c6 87 8c ori r6,r6,0x878c
800bffc: 28 c5 00 00 lw r5,(r6+0)
800c000: 44 45 00 22 be r2,r5,800c088 <rtems_blkdev_ioctl+0x100>
800c004: 54 45 00 06 bgu r2,r5,800c01c <rtems_blkdev_ioctl+0x94>
800c008: 78 05 08 01 mvhi r5,0x801
800c00c: 38 a5 87 88 ori r5,r5,0x8788
800c010: 28 a1 00 00 lw r1,(r5+0)
800c014: 5c 41 00 26 bne r2,r1,800c0ac <rtems_blkdev_ioctl+0x124> <== NEVER TAKEN
800c018: e0 00 00 14 bi 800c068 <rtems_blkdev_ioctl+0xe0>
800c01c: 78 06 08 01 mvhi r6,0x801
800c020: 38 c6 8d 5c ori r6,r6,0x8d5c
800c024: 28 c4 00 00 lw r4,(r6+0)
800c028: 44 44 00 1c be r2,r4,800c098 <rtems_blkdev_ioctl+0x110>
800c02c: 78 05 08 01 mvhi r5,0x801
800c030: 38 a5 87 84 ori r5,r5,0x8784
800c034: 28 a4 00 00 lw r4,(r5+0)
800c038: 5c 44 00 1d bne r2,r4,800c0ac <rtems_blkdev_ioctl+0x124> <== NEVER TAKEN
800c03c: e0 00 00 07 bi 800c058 <rtems_blkdev_ioctl+0xd0>
{
case RTEMS_BLKIO_GETMEDIABLKSIZE:
*(uint32_t *) argp = dd->media_block_size;
800c040: 28 81 00 20 lw r1,(r4+32)
800c044: e0 00 00 02 bi 800c04c <rtems_blkdev_ioctl+0xc4>
break;
case RTEMS_BLKIO_GETBLKSIZE:
*(uint32_t *) argp = dd->block_size;
800c048: 28 21 00 24 lw r1,(r1+36)
800c04c: 58 61 00 00 sw (r3+0),r1
int
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
800c050: 34 02 00 00 mvi r2,0
*(uint32_t *) argp = dd->media_block_size;
break;
case RTEMS_BLKIO_GETBLKSIZE:
*(uint32_t *) argp = dd->block_size;
break;
800c054: e0 00 00 1a bi 800c0bc <rtems_blkdev_ioctl+0x134>
case RTEMS_BLKIO_SETBLKSIZE:
sc = rtems_bdbuf_set_block_size(dd, *(uint32_t *) argp, true);
800c058: 28 62 00 00 lw r2,(r3+0)
800c05c: 34 03 00 01 mvi r3,1
800c060: fb ff ff 52 calli 800bda8 <rtems_bdbuf_set_block_size>
800c064: e0 00 00 04 bi 800c074 <rtems_blkdev_ioctl+0xec>
rc = -1;
}
break;
case RTEMS_BLKIO_GETSIZE:
*(rtems_blkdev_bnum *) argp = dd->size;
800c068: 28 81 00 1c lw r1,(r4+28)
800c06c: e3 ff ff f8 bi 800c04c <rtems_blkdev_ioctl+0xc4>
break;
case RTEMS_BLKIO_SYNCDEV:
sc = rtems_bdbuf_syncdev(dd);
800c070: fb ff fe ba calli 800bb58 <rtems_bdbuf_syncdev>
int
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
800c074: 34 02 00 00 mvi r2,0
*(rtems_blkdev_bnum *) argp = dd->size;
break;
case RTEMS_BLKIO_SYNCDEV:
sc = rtems_bdbuf_syncdev(dd);
if (sc != RTEMS_SUCCESSFUL) {
800c078: 44 20 00 11 be r1,r0,800c0bc <rtems_blkdev_ioctl+0x134> <== ALWAYS TAKEN
errno = EIO;
800c07c: f8 00 17 14 calli 8011ccc <__errno> <== NOT EXECUTED
800c080: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
800c084: e0 00 00 0c bi 800c0b4 <rtems_blkdev_ioctl+0x12c> <== NOT EXECUTED
rc = -1;
}
break;
case RTEMS_BLKIO_GETDISKDEV:
*(rtems_disk_device **) argp = dd;
800c088: 58 61 00 00 sw (r3+0),r1
800c08c: e3 ff ff f1 bi 800c050 <rtems_blkdev_ioctl+0xc8>
break;
case RTEMS_BLKIO_PURGEDEV:
rtems_bdbuf_purge_dev(dd);
800c090: fb ff fe ca calli 800bbb8 <rtems_bdbuf_purge_dev>
800c094: e3 ff ff ef bi 800c050 <rtems_blkdev_ioctl+0xc8>
break;
case RTEMS_BLKIO_GETDEVSTATS:
rtems_bdbuf_get_device_stats(dd, (rtems_blkdev_stats *) argp);
800c098: b8 60 10 00 mv r2,r3
800c09c: fb ff ff 90 calli 800bedc <rtems_bdbuf_get_device_stats>
800c0a0: e3 ff ff ec bi 800c050 <rtems_blkdev_ioctl+0xc8>
break;
case RTEMS_BLKIO_RESETDEVSTATS:
rtems_bdbuf_reset_device_stats(dd);
800c0a4: fb ff ff ab calli 800bf50 <rtems_bdbuf_reset_device_stats>
800c0a8: e3 ff ff ea bi 800c050 <rtems_blkdev_ioctl+0xc8>
break;
default:
errno = EINVAL;
800c0ac: f8 00 17 08 calli 8011ccc <__errno>
800c0b0: 34 02 00 16 mvi r2,22
800c0b4: 58 22 00 00 sw (r1+0),r2
rc = -1;
800c0b8: 34 02 ff ff mvi r2,-1
break;
}
return rc;
}
800c0bc: b8 40 08 00 mv r1,r2
800c0c0: 2b 9d 00 04 lw ra,(sp+4)
800c0c4: 37 9c 00 04 addi sp,sp,4
800c0c8: c3 a0 00 00 ret
08020e18 <rtems_blkstats>:
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
void rtems_blkstats(FILE *output, const char *device, bool reset)
{
8020e18: 37 9c ff 84 addi sp,sp,-124 <== NOT EXECUTED
8020e1c: 5b 8b 00 14 sw (sp+20),r11 <== NOT EXECUTED
8020e20: 5b 8c 00 10 sw (sp+16),r12 <== NOT EXECUTED
8020e24: 5b 8d 00 0c sw (sp+12),r13 <== NOT EXECUTED
8020e28: 5b 8e 00 08 sw (sp+8),r14 <== NOT EXECUTED
8020e2c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
8020e30: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
int fd = open(device, O_RDONLY);
8020e34: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
8020e38: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
void rtems_blkstats(FILE *output, const char *device, bool reset)
{
8020e3c: 20 6e 00 ff andi r14,r3,0xff <== NOT EXECUTED
int fd = open(device, O_RDONLY);
8020e40: fb ff 83 da calli 8001da8 <open> <== NOT EXECUTED
8020e44: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
if (fd >= 0) {
8020e48: 48 01 00 45 bg r0,r1,8020f5c <rtems_blkstats+0x144> <== NOT EXECUTED
struct stat st;
int rv;
rv = fstat(fd, &st);
8020e4c: 37 82 00 18 addi r2,sp,24 <== NOT EXECUTED
8020e50: f8 00 08 e9 calli 80231f4 <fstat> <== NOT EXECUTED
if (rv == 0) {
8020e54: 5c 20 00 2f bne r1,r0,8020f10 <rtems_blkstats+0xf8> <== NOT EXECUTED
if (S_ISBLK(st.st_mode)) {
8020e58: 2b 82 00 24 lw r2,(sp+36) <== NOT EXECUTED
8020e5c: 34 01 60 00 mvi r1,24576 <== NOT EXECUTED
8020e60: 20 42 f0 00 andi r2,r2,0xf000 <== NOT EXECUTED
8020e64: 5c 41 00 26 bne r2,r1,8020efc <rtems_blkstats+0xe4> <== NOT EXECUTED
if (reset) {
8020e68: 45 c0 00 0f be r14,r0,8020ea4 <rtems_blkstats+0x8c> <== 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);
8020e6c: 78 03 08 05 mvhi r3,0x805 <== NOT EXECUTED
8020e70: 38 63 eb 30 ori r3,r3,0xeb30 <== NOT EXECUTED
8020e74: 28 62 00 00 lw r2,(r3+0) <== NOT EXECUTED
8020e78: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8020e7c: f8 00 0c 23 calli 8023f08 <ioctl> <== NOT EXECUTED
rv = rtems_disk_fd_reset_device_stats(fd);
if (rv != 0) {
8020e80: 44 20 00 2c be r1,r0,8020f30 <rtems_blkstats+0x118> <== NOT EXECUTED
fprintf(output, "error: reset stats: %s\n", strerror(errno));
8020e84: f8 00 5f c2 calli 8038d8c <__errno> <== NOT EXECUTED
8020e88: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
8020e8c: f8 00 7e 2b calli 8040738 <strerror> <== NOT EXECUTED
8020e90: 78 02 08 05 mvhi r2,0x805 <== NOT EXECUTED
8020e94: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
8020e98: 38 42 ea 94 ori r2,r2,0xea94 <== NOT EXECUTED
8020e9c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8020ea0: e0 00 00 23 bi 8020f2c <rtems_blkstats+0x114> <== NOT EXECUTED
static inline int rtems_disk_fd_get_device_stats(
int fd,
rtems_blkdev_stats *stats
)
{
return ioctl(fd, RTEMS_BLKIO_GETDEVSTATS, stats);
8020ea4: 78 03 08 05 mvhi r3,0x805 <== NOT EXECUTED
8020ea8: 38 63 eb 34 ori r3,r3,0xeb34 <== NOT EXECUTED
8020eac: 28 62 00 00 lw r2,(r3+0) <== NOT EXECUTED
}
} else {
rtems_blkdev_stats stats;
rv = rtems_disk_fd_get_device_stats(fd, &stats);
8020eb0: 37 8d 00 60 addi r13,sp,96 <== NOT EXECUTED
8020eb4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8020eb8: b9 a0 18 00 mv r3,r13 <== NOT EXECUTED
8020ebc: f8 00 0c 13 calli 8023f08 <ioctl> <== NOT EXECUTED
if (rv == 0) {
8020ec0: 5c 2e 00 07 bne r1,r14,8020edc <rtems_blkstats+0xc4> <== NOT EXECUTED
rtems_blkdev_print_stats(
8020ec4: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
8020ec8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
8020ecc: 38 42 9b 04 ori r2,r2,0x9b04 <== NOT EXECUTED
8020ed0: b9 60 18 00 mv r3,r11 <== NOT EXECUTED
8020ed4: f8 00 00 31 calli 8020f98 <rtems_blkdev_print_stats> <== NOT EXECUTED
8020ed8: e0 00 00 16 bi 8020f30 <rtems_blkstats+0x118> <== NOT EXECUTED
&stats,
(rtems_printk_plugin_t) fprintf,
output
);
} else {
fprintf(output, "error: get stats: %s\n", strerror(errno));
8020edc: f8 00 5f ac calli 8038d8c <__errno> <== NOT EXECUTED
8020ee0: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
8020ee4: f8 00 7e 15 calli 8040738 <strerror> <== NOT EXECUTED
8020ee8: 78 02 08 05 mvhi r2,0x805 <== NOT EXECUTED
8020eec: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
8020ef0: 38 42 ea ac ori r2,r2,0xeaac <== NOT EXECUTED
8020ef4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8020ef8: e0 00 00 0d bi 8020f2c <rtems_blkstats+0x114> <== NOT EXECUTED
}
}
} else {
fprintf(output, "error: not a block device\n");
8020efc: 78 01 08 05 mvhi r1,0x805 <== NOT EXECUTED
8020f00: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
8020f04: 38 21 ea c4 ori r1,r1,0xeac4 <== NOT EXECUTED
8020f08: f8 00 63 6a calli 8039cb0 <fputs> <== NOT EXECUTED
8020f0c: e0 00 00 09 bi 8020f30 <rtems_blkstats+0x118> <== NOT EXECUTED
}
} else {
fprintf(output, "error: get file stats: %s\n", strerror(errno));
8020f10: f8 00 5f 9f calli 8038d8c <__errno> <== NOT EXECUTED
8020f14: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
8020f18: f8 00 7e 08 calli 8040738 <strerror> <== NOT EXECUTED
8020f1c: 78 02 08 05 mvhi r2,0x805 <== NOT EXECUTED
8020f20: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
8020f24: 38 42 ea e0 ori r2,r2,0xeae0 <== NOT EXECUTED
8020f28: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8020f2c: f8 00 62 f6 calli 8039b04 <fprintf> <== NOT EXECUTED
}
rv = close(fd);
8020f30: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8020f34: f8 00 07 6c calli 8022ce4 <close> <== NOT EXECUTED
if (rv != 0) {
8020f38: 44 20 00 11 be r1,r0,8020f7c <rtems_blkstats+0x164> <== NOT EXECUTED
fprintf(output, "error: close device: %s\n", strerror(errno));
8020f3c: f8 00 5f 94 calli 8038d8c <__errno> <== NOT EXECUTED
8020f40: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
8020f44: f8 00 7d fd calli 8040738 <strerror> <== NOT EXECUTED
8020f48: 78 02 08 05 mvhi r2,0x805 <== NOT EXECUTED
8020f4c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
8020f50: 38 42 ea fc ori r2,r2,0xeafc <== NOT EXECUTED
8020f54: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8020f58: e0 00 00 08 bi 8020f78 <rtems_blkstats+0x160> <== NOT EXECUTED
}
} else {
fprintf(output, "error: open device: %s\n", strerror(errno));
8020f5c: f8 00 5f 8c calli 8038d8c <__errno> <== NOT EXECUTED
8020f60: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
8020f64: f8 00 7d f5 calli 8040738 <strerror> <== NOT EXECUTED
8020f68: 78 02 08 05 mvhi r2,0x805 <== NOT EXECUTED
8020f6c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
8020f70: 38 42 eb 18 ori r2,r2,0xeb18 <== NOT EXECUTED
8020f74: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8020f78: f8 00 62 e3 calli 8039b04 <fprintf> <== NOT EXECUTED
}
}
8020f7c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8020f80: 2b 8b 00 14 lw r11,(sp+20) <== NOT EXECUTED
8020f84: 2b 8c 00 10 lw r12,(sp+16) <== NOT EXECUTED
8020f88: 2b 8d 00 0c lw r13,(sp+12) <== NOT EXECUTED
8020f8c: 2b 8e 00 08 lw r14,(sp+8) <== NOT EXECUTED
8020f90: 37 9c 00 7c addi sp,sp,124 <== NOT EXECUTED
8020f94: c3 a0 00 00 ret <== NOT EXECUTED
0800419c <rtems_chain_get_with_wait>:
rtems_chain_control *chain,
rtems_event_set events,
rtems_interval timeout,
rtems_chain_node **node_ptr
)
{
800419c: 37 9c ff e4 addi sp,sp,-28
80041a0: 5b 8b 00 18 sw (sp+24),r11
80041a4: 5b 8c 00 14 sw (sp+20),r12
80041a8: 5b 8d 00 10 sw (sp+16),r13
80041ac: 5b 8e 00 0c sw (sp+12),r14
80041b0: 5b 8f 00 08 sw (sp+8),r15
80041b4: 5b 9d 00 04 sw (sp+4),ra
80041b8: b8 20 78 00 mv r15,r1
80041bc: b8 40 70 00 mv r14,r2
80041c0: b8 60 68 00 mv r13,r3
80041c4: b8 80 60 00 mv r12,r4
80041c8: e0 00 00 08 bi 80041e8 <rtems_chain_get_with_wait+0x4c>
while (
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
) {
rtems_event_set out;
sc = rtems_event_receive(
80041cc: b9 c0 08 00 mv r1,r14
80041d0: 34 02 00 00 mvi r2,0
80041d4: b9 a0 18 00 mv r3,r13
80041d8: 37 84 00 1c addi r4,sp,28
80041dc: fb ff fd b8 calli 80038bc <rtems_event_receive>
80041e0: b8 20 28 00 mv r5,r1
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_chain_node *node = NULL;
while (
80041e4: 5c 2b 00 06 bne r1,r11,80041fc <rtems_chain_get_with_wait+0x60><== ALWAYS TAKEN
*/
RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get(
rtems_chain_control *the_chain
)
{
return _Chain_Get( the_chain );
80041e8: b9 e0 08 00 mv r1,r15
80041ec: f8 00 01 9b calli 8004858 <_Chain_Get>
80041f0: b8 20 58 00 mv r11,r1
sc == RTEMS_SUCCESSFUL
&& (node = rtems_chain_get( chain )) == NULL
80041f4: 44 20 ff f6 be r1,r0,80041cc <rtems_chain_get_with_wait+0x30>
80041f8: 34 05 00 00 mvi r5,0
}
*node_ptr = node;
return sc;
}
80041fc: b8 a0 08 00 mv r1,r5
timeout,
&out
);
}
*node_ptr = node;
8004200: 59 8b 00 00 sw (r12+0),r11
return sc;
}
8004204: 2b 9d 00 04 lw ra,(sp+4)
8004208: 2b 8b 00 18 lw r11,(sp+24)
800420c: 2b 8c 00 14 lw r12,(sp+20)
8004210: 2b 8d 00 10 lw r13,(sp+16)
8004214: 2b 8e 00 0c lw r14,(sp+12)
8004218: 2b 8f 00 08 lw r15,(sp+8)
800421c: 37 9c 00 1c addi sp,sp,28
8004220: c3 a0 00 00 ret
080115d8 <rtems_clock_set_nanoseconds_extension>:
* error code - if unsuccessful
*/
rtems_status_code rtems_clock_set_nanoseconds_extension(
rtems_nanoseconds_extension_routine routine
)
{
80115d8: b8 20 18 00 mv r3,r1
if ( !routine )
return RTEMS_INVALID_ADDRESS;
80115dc: 34 01 00 09 mvi r1,9
*/
rtems_status_code rtems_clock_set_nanoseconds_extension(
rtems_nanoseconds_extension_routine routine
)
{
if ( !routine )
80115e0: 44 60 00 05 be r3,r0,80115f4 <rtems_clock_set_nanoseconds_extension+0x1c><== ALWAYS TAKEN
return RTEMS_INVALID_ADDRESS;
_Watchdog_Nanoseconds_since_tick_handler = routine;
80115e4: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
80115e8: 38 42 b1 c8 ori r2,r2,0xb1c8 <== NOT EXECUTED
80115ec: 58 43 00 00 sw (r2+0),r3 <== NOT EXECUTED
return RTEMS_SUCCESSFUL;
80115f0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
}
80115f4: c3 a0 00 00 ret
080019b4 <rtems_cpu_usage_report_with_plugin>:
*/
void rtems_cpu_usage_report_with_plugin(
void *context,
rtems_printk_plugin_t print
)
{
80019b4: 37 9c ff 7c addi sp,sp,-132
80019b8: 5b 8b 00 44 sw (sp+68),r11
80019bc: 5b 8c 00 40 sw (sp+64),r12
80019c0: 5b 8d 00 3c sw (sp+60),r13
80019c4: 5b 8e 00 38 sw (sp+56),r14
80019c8: 5b 8f 00 34 sw (sp+52),r15
80019cc: 5b 90 00 30 sw (sp+48),r16
80019d0: 5b 91 00 2c sw (sp+44),r17
80019d4: 5b 92 00 28 sw (sp+40),r18
80019d8: 5b 93 00 24 sw (sp+36),r19
80019dc: 5b 94 00 20 sw (sp+32),r20
80019e0: 5b 95 00 1c sw (sp+28),r21
80019e4: 5b 96 00 18 sw (sp+24),r22
80019e8: 5b 97 00 14 sw (sp+20),r23
80019ec: 5b 98 00 10 sw (sp+16),r24
80019f0: 5b 99 00 0c sw (sp+12),r25
80019f4: 5b 9b 00 08 sw (sp+8),fp
80019f8: 5b 9d 00 04 sw (sp+4),ra
80019fc: b8 20 88 00 mv r17,r1
8001a00: b8 40 70 00 mv r14,r2
uint32_t seconds, nanoseconds;
#else
uint32_t total_units = 0;
#endif
if ( !print )
8001a04: 44 40 00 a0 be r2,r0,8001c84 <rtems_cpu_usage_report_with_plugin+0x2d0><== NEVER TAKEN
* the number of "ticks" we gave credit for to give the user a rough
* guideline as to what each number means proportionally.
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Set_to_zero( &total );
uptime_at_last_reset = CPU_usage_Uptime_at_last_reset;
8001a08: 78 02 08 02 mvhi r2,0x802
8001a0c: 38 42 32 a8 ori r2,r2,0x32a8
8001a10: 28 43 00 00 lw r3,(r2+0)
8001a14: 28 42 00 04 lw r2,(r2+4)
}
}
}
#endif
(*print)(
8001a18: 78 0c 08 02 mvhi r12,0x802
if ( !the_thread )
continue;
rtems_object_get_name( the_thread->Object.id, sizeof(name), name );
(*print)(
8001a1c: 78 13 08 01 mvhi r19,0x801
* the number of "ticks" we gave credit for to give the user a rough
* guideline as to what each number means proportionally.
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Set_to_zero( &total );
uptime_at_last_reset = CPU_usage_Uptime_at_last_reset;
8001a20: 5b 82 00 54 sw (sp+84),r2
}
}
}
#endif
(*print)(
8001a24: 78 02 08 01 mvhi r2,0x801
8001a28: 38 42 f3 fc ori r2,r2,0xf3fc
Thread_Control *the_thread,
Timestamp_Control *time_of_context_switch
)
{
#ifndef RTEMS_SMP
if ( _Thread_Executing->Object.id == the_thread->Object.id ) {
8001a2c: 78 0d 08 02 mvhi r13,0x802
8001a30: 78 0f 08 02 mvhi r15,0x802
*/
seconds = _Timestamp_Get_seconds( &ran );
nanoseconds = _Timestamp_Get_nanoseconds( &ran ) /
TOD_NANOSECONDS_PER_MICROSECOND;
(*print)( context,
8001a34: 78 12 08 01 mvhi r18,0x801
static inline void _Timestamp64_implementation_Set_to_zero(
Timestamp64_Control *_time
)
{
*_time = 0;
8001a38: 5b 80 00 70 sw (sp+112),r0
8001a3c: 5b 80 00 74 sw (sp+116),r0
* the number of "ticks" we gave credit for to give the user a rough
* guideline as to what each number means proportionally.
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Set_to_zero( &total );
uptime_at_last_reset = CPU_usage_Uptime_at_last_reset;
8001a40: 5b 83 00 50 sw (sp+80),r3
}
}
}
#endif
(*print)(
8001a44: 39 8c 2c f8 ori r12,r12,0x2cf8
8001a48: d9 c0 00 00 call r14
the_thread = (Thread_Control *)information->local_table[ i ];
if ( !the_thread )
continue;
rtems_object_get_name( the_thread->Object.id, sizeof(name), name );
8001a4c: 37 97 00 58 addi r23,sp,88
(*print)(
8001a50: 3a 73 f5 70 ori r19,r19,0xf570
Thread_Control *the_thread,
Timestamp_Control *time_of_context_switch
)
{
#ifndef RTEMS_SMP
if ( _Thread_Executing->Object.id == the_thread->Object.id ) {
8001a54: 39 ad 32 20 ori r13,r13,0x3220
8001a58: 37 96 00 78 addi r22,sp,120
8001a5c: 39 ef 2c e0 ori r15,r15,0x2ce0
_Timestamp_Add_to( &ran, &used );
} else {
_TOD_Get_uptime( &uptime );
}
_Timestamp_Subtract( &uptime_at_last_reset, &uptime, &total );
_Timestamp_Divide( &ran, &total, &ival, &fval );
8001a60: 37 9b 00 68 addi fp,sp,104
8001a64: 37 99 00 70 addi r25,sp,112
8001a68: 37 98 00 80 addi r24,sp,128
*/
seconds = _Timestamp_Get_seconds( &ran );
nanoseconds = _Timestamp_Get_nanoseconds( &ran ) /
TOD_NANOSECONDS_PER_MICROSECOND;
(*print)( context,
8001a6c: 3a 52 f5 84 ori r18,r18,0xf584
#if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
if ( !_Objects_Information_table[ api_index ] )
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
8001a70: 29 81 00 00 lw r1,(r12+0)
if ( information ) {
8001a74: 34 15 00 04 mvi r21,4
8001a78: 34 14 00 01 mvi r20,1
#if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
if ( !_Objects_Information_table[ api_index ] )
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
8001a7c: 28 30 00 04 lw r16,(r1+4)
if ( information ) {
8001a80: 5e 00 00 60 bne r16,r0,8001c00 <rtems_cpu_usage_report_with_plugin+0x24c><== ALWAYS TAKEN
8001a84: e0 00 00 61 bi 8001c08 <rtems_cpu_usage_report_with_plugin+0x254><== NOT EXECUTED
for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ];
8001a88: 2a 01 00 1c lw r1,(r16+28)
8001a8c: b4 35 08 00 add r1,r1,r21
8001a90: 28 2b 00 00 lw r11,(r1+0)
if ( !the_thread )
8001a94: 45 60 00 59 be r11,r0,8001bf8 <rtems_cpu_usage_report_with_plugin+0x244><== NEVER TAKEN
continue;
rtems_object_get_name( the_thread->Object.id, sizeof(name), name );
8001a98: 29 61 00 08 lw r1,(r11+8)
8001a9c: 34 02 00 0d mvi r2,13
8001aa0: ba e0 18 00 mv r3,r23
8001aa4: f8 00 0c 9b calli 8004d10 <rtems_object_get_name>
(*print)(
8001aa8: 29 63 00 08 lw r3,(r11+8)
8001aac: ba 60 10 00 mv r2,r19
8001ab0: ba 20 08 00 mv r1,r17
8001ab4: ba e0 20 00 mv r4,r23
8001ab8: d9 c0 00 00 call r14
/*
* If this is the currently executing thread, account for time
* since the last context switch.
*/
ran = the_thread->cpu_time_used;
8001abc: 29 61 00 80 lw r1,(r11+128)
8001ac0: 5b 81 00 68 sw (sp+104),r1
8001ac4: 29 61 00 84 lw r1,(r11+132)
8001ac8: 5b 81 00 6c sw (sp+108),r1
Thread_Control *the_thread,
Timestamp_Control *time_of_context_switch
)
{
#ifndef RTEMS_SMP
if ( _Thread_Executing->Object.id == the_thread->Object.id ) {
8001acc: 29 a1 00 10 lw r1,(r13+16)
8001ad0: 28 22 00 08 lw r2,(r1+8)
8001ad4: 29 61 00 08 lw r1,(r11+8)
8001ad8: 5c 41 00 17 bne r2,r1,8001b34 <rtems_cpu_usage_report_with_plugin+0x180>
*time_of_context_switch = _Thread_Time_of_last_context_switch;
8001adc: 29 a3 00 24 lw r3,(r13+36)
*/
static inline void _TOD_Get_uptime(
Timestamp_Control *time
)
{
_TOD_Get_with_nanoseconds( time, &_TOD.uptime );
8001ae0: b9 e0 10 00 mv r2,r15
8001ae4: ba c0 08 00 mv r1,r22
8001ae8: 29 ab 00 20 lw r11,(r13+32)
8001aec: 5b 83 00 4c sw (sp+76),r3
8001af0: f8 00 11 d6 calli 8006248 <_TOD_Get_with_nanoseconds>
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
8001af4: 2b 82 00 6c lw r2,(sp+108)
8001af8: 2b 85 00 7c lw r5,(sp+124)
8001afc: 2b 84 00 68 lw r4,(sp+104)
8001b00: 2b 81 00 78 lw r1,(sp+120)
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
8001b04: 2b 83 00 4c lw r3,(sp+76)
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
8001b08: b4 45 28 00 add r5,r2,r5
8001b0c: f4 45 10 00 cmpgu r2,r2,r5
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
8001b10: c8 a3 18 00 sub r3,r5,r3
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
8001b14: b4 81 08 00 add r1,r4,r1
8001b18: b4 41 08 00 add r1,r2,r1
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
8001b1c: f4 65 28 00 cmpgu r5,r3,r5
8001b20: c8 2b 08 00 sub r1,r1,r11
8001b24: c8 25 28 00 sub r5,r1,r5
8001b28: 5b 85 00 68 sw (sp+104),r5
8001b2c: 5b 83 00 6c sw (sp+108),r3
8001b30: e0 00 00 04 bi 8001b40 <rtems_cpu_usage_report_with_plugin+0x18c>
8001b34: ba c0 08 00 mv r1,r22
8001b38: b9 e0 10 00 mv r2,r15
8001b3c: f8 00 11 c3 calli 8006248 <_TOD_Get_with_nanoseconds>
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
8001b40: 2b 82 00 7c lw r2,(sp+124)
8001b44: 2b 84 00 54 lw r4,(sp+84)
8001b48: 2b 85 00 50 lw r5,(sp+80)
8001b4c: 2b 81 00 78 lw r1,(sp+120)
8001b50: c8 44 18 00 sub r3,r2,r4
8001b54: f4 62 10 00 cmpgu r2,r3,r2
8001b58: c8 25 08 00 sub r1,r1,r5
8001b5c: c8 22 08 00 sub r1,r1,r2
8001b60: 5b 81 00 70 sw (sp+112),r1
8001b64: 5b 83 00 74 sw (sp+116),r3
_Timestamp_Add_to( &ran, &used );
} else {
_TOD_Get_uptime( &uptime );
}
_Timestamp_Subtract( &uptime_at_last_reset, &uptime, &total );
_Timestamp_Divide( &ran, &total, &ival, &fval );
8001b68: bb 60 08 00 mv r1,fp
8001b6c: bb 20 10 00 mv r2,r25
8001b70: 37 83 00 84 addi r3,sp,132
8001b74: bb 00 20 00 mv r4,r24
8001b78: f8 00 1c c6 calli 8008e90 <_Timestamp64_Divide>
static inline uint32_t _Timestamp64_implementation_Get_seconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time / 1000000000L);
8001b7c: 78 07 08 01 mvhi r7,0x801
}
void rtems_cpu_usage_report( void )
{
rtems_cpu_usage_report_with_plugin( NULL, printk_plugin );
}
8001b80: 2b 86 00 68 lw r6,(sp+104)
8001b84: 2b 85 00 6c lw r5,(sp+108)
8001b88: 38 e7 f6 88 ori r7,r7,0xf688
8001b8c: 28 e4 00 00 lw r4,(r7+0)
8001b90: b8 c0 08 00 mv r1,r6
8001b94: b8 a0 10 00 mv r2,r5
8001b98: 34 03 00 00 mvi r3,0
8001b9c: 5b 85 00 48 sw (sp+72),r5
8001ba0: 5b 86 00 4c sw (sp+76),r6
8001ba4: f8 00 5b 2f calli 8018860 <__divdi3>
static inline uint32_t _Timestamp64_implementation_Get_nanoseconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time % 1000000000L);
8001ba8: 2b 85 00 48 lw r5,(sp+72)
static inline uint32_t _Timestamp64_implementation_Get_seconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time / 1000000000L);
8001bac: b8 40 58 00 mv r11,r2
static inline uint32_t _Timestamp64_implementation_Get_nanoseconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time % 1000000000L);
8001bb0: 2b 86 00 4c lw r6,(sp+76)
8001bb4: b8 a0 10 00 mv r2,r5
8001bb8: 78 05 08 01 mvhi r5,0x801
8001bbc: 38 a5 f6 88 ori r5,r5,0xf688
8001bc0: 28 a4 00 00 lw r4,(r5+0)
8001bc4: b8 c0 08 00 mv r1,r6
8001bc8: 34 03 00 00 mvi r3,0
8001bcc: f8 00 5d 27 calli 8019068 <__moddi3>
/*
* Print the information
*/
seconds = _Timestamp_Get_seconds( &ran );
nanoseconds = _Timestamp_Get_nanoseconds( &ran ) /
8001bd0: b8 40 08 00 mv r1,r2
8001bd4: 34 02 03 e8 mvi r2,1000
8001bd8: f8 00 70 61 calli 801dd5c <__udivsi3>
TOD_NANOSECONDS_PER_MICROSECOND;
(*print)( context,
8001bdc: 2b 85 00 84 lw r5,(sp+132)
8001be0: 2b 86 00 80 lw r6,(sp+128)
/*
* Print the information
*/
seconds = _Timestamp_Get_seconds( &ran );
nanoseconds = _Timestamp_Get_nanoseconds( &ran ) /
8001be4: b8 20 20 00 mv r4,r1
TOD_NANOSECONDS_PER_MICROSECOND;
(*print)( context,
8001be8: ba 40 10 00 mv r2,r18
8001bec: ba 20 08 00 mv r1,r17
8001bf0: b9 60 18 00 mv r3,r11
8001bf4: d9 c0 00 00 call r14
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
if ( information ) {
for ( i=1 ; i <= information->maximum ; i++ ) {
8001bf8: 36 94 00 01 addi r20,r20,1
8001bfc: 36 b5 00 04 addi r21,r21,4
8001c00: 2e 01 00 10 lhu r1,(r16+16)
8001c04: 50 34 ff a1 bgeu r1,r20,8001a88 <rtems_cpu_usage_report_with_plugin+0xd4>
" ID | NAME | TICKS | PERCENT\n"
#endif
"------------+----------------------------------------+---------------+---------\n"
);
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
8001c08: 78 07 08 02 mvhi r7,0x802
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
if ( information ) {
for ( i=1 ; i <= information->maximum ; i++ ) {
8001c0c: 35 8c 00 04 addi r12,r12,4
" ID | NAME | TICKS | PERCENT\n"
#endif
"------------+----------------------------------------+---------------+---------\n"
);
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
8001c10: 38 e7 2d 04 ori r7,r7,0x2d04
8001c14: 5d 87 ff 97 bne r12,r7,8001a70 <rtems_cpu_usage_report_with_plugin+0xbc>
static inline uint32_t _Timestamp64_implementation_Get_seconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time / 1000000000L);
8001c18: 78 05 08 01 mvhi r5,0x801
8001c1c: 38 a5 f6 88 ori r5,r5,0xf688
}
void rtems_cpu_usage_report( void )
{
rtems_cpu_usage_report_with_plugin( NULL, printk_plugin );
}
8001c20: 2b 8f 00 70 lw r15,(sp+112)
8001c24: 2b 8d 00 74 lw r13,(sp+116)
8001c28: 28 a4 00 00 lw r4,(r5+0)
8001c2c: 34 03 00 00 mvi r3,0
8001c30: b9 e0 08 00 mv r1,r15
8001c34: b9 a0 10 00 mv r2,r13
8001c38: f8 00 5b 0a calli 8018860 <__divdi3>
static inline uint32_t _Timestamp64_implementation_Get_nanoseconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time % 1000000000L);
8001c3c: 78 07 08 01 mvhi r7,0x801
8001c40: 38 e7 f6 88 ori r7,r7,0xf688
8001c44: 28 e4 00 00 lw r4,(r7+0)
8001c48: 34 03 00 00 mvi r3,0
static inline uint32_t _Timestamp64_implementation_Get_seconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time / 1000000000L);
8001c4c: b8 40 60 00 mv r12,r2
static inline uint32_t _Timestamp64_implementation_Get_nanoseconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time % 1000000000L);
8001c50: b9 e0 08 00 mv r1,r15
8001c54: b9 a0 10 00 mv r2,r13
8001c58: f8 00 5d 04 calli 8019068 <__moddi3>
}
}
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
seconds = _Timestamp_Get_seconds( &total );
nanoseconds = _Timestamp_Get_nanoseconds( &total ) /
8001c5c: b8 40 08 00 mv r1,r2
TOD_NANOSECONDS_PER_MICROSECOND;
(*print)(
8001c60: 78 0b 08 01 mvhi r11,0x801
}
}
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
seconds = _Timestamp_Get_seconds( &total );
nanoseconds = _Timestamp_Get_nanoseconds( &total ) /
8001c64: 34 02 03 e8 mvi r2,1000
8001c68: f8 00 70 3d calli 801dd5c <__udivsi3>
TOD_NANOSECONDS_PER_MICROSECOND;
(*print)(
8001c6c: 39 6b f5 9c ori r11,r11,0xf59c
}
}
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
seconds = _Timestamp_Get_seconds( &total );
nanoseconds = _Timestamp_Get_nanoseconds( &total ) /
8001c70: b8 20 20 00 mv r4,r1
TOD_NANOSECONDS_PER_MICROSECOND;
(*print)(
8001c74: b9 60 10 00 mv r2,r11
8001c78: ba 20 08 00 mv r1,r17
8001c7c: b9 80 18 00 mv r3,r12
8001c80: d9 c0 00 00 call r14
"-------------------------------------------------------------------------------\n",
_Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset,
total_units
);
#endif
}
8001c84: 2b 9d 00 04 lw ra,(sp+4)
8001c88: 2b 8b 00 44 lw r11,(sp+68)
8001c8c: 2b 8c 00 40 lw r12,(sp+64)
8001c90: 2b 8d 00 3c lw r13,(sp+60)
8001c94: 2b 8e 00 38 lw r14,(sp+56)
8001c98: 2b 8f 00 34 lw r15,(sp+52)
8001c9c: 2b 90 00 30 lw r16,(sp+48)
8001ca0: 2b 91 00 2c lw r17,(sp+44)
8001ca4: 2b 92 00 28 lw r18,(sp+40)
8001ca8: 2b 93 00 24 lw r19,(sp+36)
8001cac: 2b 94 00 20 lw r20,(sp+32)
8001cb0: 2b 95 00 1c lw r21,(sp+28)
8001cb4: 2b 96 00 18 lw r22,(sp+24)
8001cb8: 2b 97 00 14 lw r23,(sp+20)
8001cbc: 2b 98 00 10 lw r24,(sp+16)
8001cc0: 2b 99 00 0c lw r25,(sp+12)
8001cc4: 2b 9b 00 08 lw fp,(sp+8)
8001cc8: 37 9c 00 84 addi sp,sp,132
8001ccc: c3 a0 00 00 ret
08011b0c <rtems_deviceio_errno>:
[RTEMS_IO_ERROR] = EIO,
[RTEMS_PROXY_BLOCKING] = EIO
};
int rtems_deviceio_errno(rtems_status_code sc)
{
8011b0c: 37 9c ff f8 addi sp,sp,-8
8011b10: 5b 8b 00 08 sw (sp+8),r11
8011b14: 5b 9d 00 04 sw (sp+4),ra
if (sc == RTEMS_SUCCESSFUL) {
return 0;
8011b18: 34 02 00 00 mvi r2,0
[RTEMS_PROXY_BLOCKING] = EIO
};
int rtems_deviceio_errno(rtems_status_code sc)
{
if (sc == RTEMS_SUCCESSFUL) {
8011b1c: 44 20 00 0d be r1,r0,8011b50 <rtems_deviceio_errno+0x44>
return 0;
} else {
int eno = EINVAL;
if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) {
8011b20: 34 02 00 1c mvi r2,28
int rtems_deviceio_errno(rtems_status_code sc)
{
if (sc == RTEMS_SUCCESSFUL) {
return 0;
} else {
int eno = EINVAL;
8011b24: 34 0b 00 16 mvi r11,22
if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) {
8011b28: 54 22 00 07 bgu r1,r2,8011b44 <rtems_deviceio_errno+0x38> <== NEVER TAKEN
eno = status_code_to_errno [sc];
8011b2c: 78 0b 08 01 mvhi r11,0x801
8011b30: 34 02 00 02 mvi r2,2
8011b34: 39 6b 90 d8 ori r11,r11,0x90d8
8011b38: f8 00 17 82 calli 8017940 <__ashlsi3>
8011b3c: b5 61 08 00 add r1,r11,r1
8011b40: 28 2b 00 00 lw r11,(r1+0)
}
errno = eno;
8011b44: f8 00 00 62 calli 8011ccc <__errno>
8011b48: 58 2b 00 00 sw (r1+0),r11
return -1;
8011b4c: 34 02 ff ff mvi r2,-1
}
}
8011b50: b8 40 08 00 mv r1,r2
8011b54: 2b 9d 00 04 lw ra,(sp+4)
8011b58: 2b 8b 00 08 lw r11,(sp+8)
8011b5c: 37 9c 00 08 addi sp,sp,8
8011b60: c3 a0 00 00 ret
08001a10 <rtems_disk_create_log>:
dev_t phys,
rtems_blkdev_bnum block_begin,
rtems_blkdev_bnum block_count,
const char *name
)
{
8001a10: 37 9c ff d4 addi sp,sp,-44
8001a14: 5b 8b 00 24 sw (sp+36),r11
8001a18: 5b 8c 00 20 sw (sp+32),r12
8001a1c: 5b 8d 00 1c sw (sp+28),r13
8001a20: 5b 8e 00 18 sw (sp+24),r14
8001a24: 5b 8f 00 14 sw (sp+20),r15
8001a28: 5b 90 00 10 sw (sp+16),r16
8001a2c: 5b 91 00 0c sw (sp+12),r17
8001a30: 5b 92 00 08 sw (sp+8),r18
8001a34: 5b 9d 00 04 sw (sp+4),ra
8001a38: b8 20 70 00 mv r14,r1
8001a3c: b8 40 68 00 mv r13,r2
8001a40: b8 60 90 00 mv r18,r3
8001a44: b8 80 60 00 mv r12,r4
8001a48: b8 a0 80 00 mv r16,r5
8001a4c: b8 c0 78 00 mv r15,r6
8001a50: b8 e0 88 00 mv r17,r7
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_disk_device *phys_dd = NULL;
rtems_disk_device *dd = NULL;
8001a54: 5b 80 00 2c sw (sp+44),r0
char *alloc_name = NULL;
8001a58: 5b 80 00 28 sw (sp+40),r0
sc = disk_lock();
8001a5c: fb ff fe 9c calli 80014cc <disk_lock>
8001a60: b8 20 58 00 mv r11,r1
if (sc != RTEMS_SUCCESSFUL) {
8001a64: 5c 20 00 28 bne r1,r0,8001b04 <rtems_disk_create_log+0xf4> <== NEVER TAKEN
return sc;
}
phys_dd = get_disk_entry(phys, true);
8001a68: b9 80 10 00 mv r2,r12
8001a6c: ba 40 08 00 mv r1,r18
8001a70: 34 03 00 01 mvi r3,1
8001a74: fb ff fe 4f calli 80013b0 <get_disk_entry>
8001a78: b8 20 60 00 mv r12,r1
if (phys_dd == NULL) {
8001a7c: 5c 2b 00 04 bne r1,r11,8001a8c <rtems_disk_create_log+0x7c>
disk_unlock();
8001a80: fb ff fe a6 calli 8001518 <disk_unlock>
return RTEMS_INVALID_ID;
8001a84: 34 0b 00 04 mvi r11,4
8001a88: e0 00 00 1f bi 8001b04 <rtems_disk_create_log+0xf4>
}
sc = create_disk(dev, name, &dd, &alloc_name);
8001a8c: b9 c0 08 00 mv r1,r14
8001a90: b9 a0 10 00 mv r2,r13
8001a94: ba 20 18 00 mv r3,r17
8001a98: 37 84 00 2c addi r4,sp,44
8001a9c: 37 85 00 28 addi r5,sp,40
8001aa0: fb ff fe af calli 800155c <create_disk>
8001aa4: b8 20 58 00 mv r11,r1
if (sc != RTEMS_SUCCESSFUL) {
8001aa8: 5c 20 00 16 bne r1,r0,8001b00 <rtems_disk_create_log+0xf0>
disk_unlock();
return sc;
}
sc = rtems_disk_init_log(
8001aac: 2b 81 00 2c lw r1,(sp+44)
8001ab0: ba 00 18 00 mv r3,r16
8001ab4: b9 80 10 00 mv r2,r12
8001ab8: b9 e0 20 00 mv r4,r15
8001abc: f8 00 2a ce calli 800c5f4 <rtems_disk_init_log>
phys_dd,
block_begin,
block_count
);
dd->dev = dev;
8001ac0: 2b 83 00 2c lw r3,(sp+44)
disk_unlock();
return sc;
}
sc = rtems_disk_init_log(
8001ac4: b8 20 58 00 mv r11,r1
block_begin,
block_count
);
dd->dev = dev;
dd->name = alloc_name;
8001ac8: 2b 81 00 28 lw r1,(sp+40)
phys_dd,
block_begin,
block_count
);
dd->dev = dev;
8001acc: 58 6e 00 00 sw (r3+0),r14
8001ad0: 58 6d 00 04 sw (r3+4),r13
dd->name = alloc_name;
8001ad4: 58 61 00 10 sw (r3+16),r1
++phys_dd->uses;
8001ad8: 29 81 00 14 lw r1,(r12+20)
8001adc: 34 21 00 01 addi r1,r1,1
8001ae0: 59 81 00 14 sw (r12+20),r1
if (sc != RTEMS_SUCCESSFUL) {
8001ae4: 45 60 00 07 be r11,r0,8001b00 <rtems_disk_create_log+0xf0>
dd->ioctl = null_handler;
8001ae8: 78 01 08 00 mvhi r1,0x800
8001aec: 38 21 14 68 ori r1,r1,0x1468
8001af0: 58 61 00 38 sw (r3+56),r1
rtems_disk_delete(dev);
8001af4: b9 a0 10 00 mv r2,r13
8001af8: b9 c0 08 00 mv r1,r14
8001afc: fb ff ff 3a calli 80017e4 <rtems_disk_delete>
disk_unlock();
return sc;
}
disk_unlock();
8001b00: fb ff fe 86 calli 8001518 <disk_unlock>
return RTEMS_SUCCESSFUL;
}
8001b04: b9 60 08 00 mv r1,r11
8001b08: 2b 9d 00 04 lw ra,(sp+4)
8001b0c: 2b 8b 00 24 lw r11,(sp+36)
8001b10: 2b 8c 00 20 lw r12,(sp+32)
8001b14: 2b 8d 00 1c lw r13,(sp+28)
8001b18: 2b 8e 00 18 lw r14,(sp+24)
8001b1c: 2b 8f 00 14 lw r15,(sp+20)
8001b20: 2b 90 00 10 lw r16,(sp+16)
8001b24: 2b 91 00 0c lw r17,(sp+12)
8001b28: 2b 92 00 08 lw r18,(sp+8)
8001b2c: 37 9c 00 2c addi sp,sp,44
8001b30: c3 a0 00 00 ret
08001b34 <rtems_disk_create_phys>:
rtems_blkdev_bnum block_count,
rtems_block_device_ioctl handler,
void *driver_data,
const char *name
)
{
8001b34: 37 9c ff d4 addi sp,sp,-44
8001b38: 5b 8b 00 24 sw (sp+36),r11
8001b3c: 5b 8c 00 20 sw (sp+32),r12
8001b40: 5b 8d 00 1c sw (sp+28),r13
8001b44: 5b 8e 00 18 sw (sp+24),r14
8001b48: 5b 8f 00 14 sw (sp+20),r15
8001b4c: 5b 90 00 10 sw (sp+16),r16
8001b50: 5b 91 00 0c sw (sp+12),r17
8001b54: 5b 92 00 08 sw (sp+8),r18
8001b58: 5b 9d 00 04 sw (sp+4),ra
rtems_disk_device *dd = NULL;
8001b5c: 5b 80 00 2c sw (sp+44),r0
rtems_status_code sc = RTEMS_SUCCESSFUL;
char *alloc_name = NULL;
8001b60: 5b 80 00 28 sw (sp+40),r0
rtems_blkdev_bnum block_count,
rtems_block_device_ioctl handler,
void *driver_data,
const char *name
)
{
8001b64: b8 20 68 00 mv r13,r1
8001b68: b8 40 60 00 mv r12,r2
8001b6c: b8 60 88 00 mv r17,r3
8001b70: b8 80 80 00 mv r16,r4
8001b74: b8 a0 70 00 mv r14,r5
8001b78: b8 c0 78 00 mv r15,r6
8001b7c: b8 e0 90 00 mv r18,r7
rtems_disk_device *dd = NULL;
rtems_status_code sc = RTEMS_SUCCESSFUL;
char *alloc_name = NULL;
if (handler == NULL) {
return RTEMS_INVALID_ADDRESS;
8001b80: 34 0b 00 09 mvi r11,9
{
rtems_disk_device *dd = NULL;
rtems_status_code sc = RTEMS_SUCCESSFUL;
char *alloc_name = NULL;
if (handler == NULL) {
8001b84: 44 a0 00 20 be r5,r0,8001c04 <rtems_disk_create_phys+0xd0>
return RTEMS_INVALID_ADDRESS;
}
sc = disk_lock();
8001b88: fb ff fe 51 calli 80014cc <disk_lock>
8001b8c: b8 20 58 00 mv r11,r1
if (sc != RTEMS_SUCCESSFUL) {
8001b90: 5c 20 00 1d bne r1,r0,8001c04 <rtems_disk_create_phys+0xd0><== NEVER TAKEN
return sc;
}
sc = create_disk(dev, name, &dd, &alloc_name);
8001b94: b9 a0 08 00 mv r1,r13
8001b98: b9 80 10 00 mv r2,r12
8001b9c: ba 40 18 00 mv r3,r18
8001ba0: 37 84 00 2c addi r4,sp,44
8001ba4: 37 85 00 28 addi r5,sp,40
8001ba8: fb ff fe 6d calli 800155c <create_disk>
8001bac: b8 20 58 00 mv r11,r1
if (sc != RTEMS_SUCCESSFUL) {
8001bb0: 5c 20 00 14 bne r1,r0,8001c00 <rtems_disk_create_phys+0xcc>
disk_unlock();
return sc;
}
sc = rtems_disk_init_phys(
8001bb4: 2b 81 00 2c lw r1,(sp+44)
8001bb8: ba 00 18 00 mv r3,r16
8001bbc: ba 20 10 00 mv r2,r17
8001bc0: b9 c0 20 00 mv r4,r14
8001bc4: b9 e0 28 00 mv r5,r15
8001bc8: f8 00 2a 5e calli 800c540 <rtems_disk_init_phys>
block_count,
handler,
driver_data
);
dd->dev = dev;
8001bcc: 2b 83 00 2c lw r3,(sp+44)
disk_unlock();
return sc;
}
sc = rtems_disk_init_phys(
8001bd0: b8 20 58 00 mv r11,r1
handler,
driver_data
);
dd->dev = dev;
dd->name = alloc_name;
8001bd4: 2b 81 00 28 lw r1,(sp+40)
block_count,
handler,
driver_data
);
dd->dev = dev;
8001bd8: 58 6d 00 00 sw (r3+0),r13
8001bdc: 58 6c 00 04 sw (r3+4),r12
dd->name = alloc_name;
8001be0: 58 61 00 10 sw (r3+16),r1
if (sc != RTEMS_SUCCESSFUL) {
8001be4: 45 60 00 07 be r11,r0,8001c00 <rtems_disk_create_phys+0xcc>
dd->ioctl = null_handler;
8001be8: 78 01 08 00 mvhi r1,0x800
8001bec: 38 21 14 68 ori r1,r1,0x1468
8001bf0: 58 61 00 38 sw (r3+56),r1
rtems_disk_delete(dev);
8001bf4: b9 80 10 00 mv r2,r12
8001bf8: b9 a0 08 00 mv r1,r13
8001bfc: fb ff fe fa calli 80017e4 <rtems_disk_delete>
disk_unlock();
return sc;
}
disk_unlock();
8001c00: fb ff fe 46 calli 8001518 <disk_unlock>
return RTEMS_SUCCESSFUL;
}
8001c04: b9 60 08 00 mv r1,r11
8001c08: 2b 9d 00 04 lw ra,(sp+4)
8001c0c: 2b 8b 00 24 lw r11,(sp+36)
8001c10: 2b 8c 00 20 lw r12,(sp+32)
8001c14: 2b 8d 00 1c lw r13,(sp+28)
8001c18: 2b 8e 00 18 lw r14,(sp+24)
8001c1c: 2b 8f 00 14 lw r15,(sp+20)
8001c20: 2b 90 00 10 lw r16,(sp+16)
8001c24: 2b 91 00 0c lw r17,(sp+12)
8001c28: 2b 92 00 08 lw r18,(sp+8)
8001c2c: 37 9c 00 2c addi sp,sp,44
8001c30: c3 a0 00 00 ret
080017e4 <rtems_disk_delete>:
}
}
rtems_status_code
rtems_disk_delete(dev_t dev)
{
80017e4: 37 9c ff c4 addi sp,sp,-60
80017e8: 5b 8b 00 38 sw (sp+56),r11
80017ec: 5b 8c 00 34 sw (sp+52),r12
80017f0: 5b 8d 00 30 sw (sp+48),r13
80017f4: 5b 8e 00 2c sw (sp+44),r14
80017f8: 5b 8f 00 28 sw (sp+40),r15
80017fc: 5b 90 00 24 sw (sp+36),r16
8001800: 5b 91 00 20 sw (sp+32),r17
8001804: 5b 92 00 1c sw (sp+28),r18
8001808: 5b 93 00 18 sw (sp+24),r19
800180c: 5b 94 00 14 sw (sp+20),r20
8001810: 5b 95 00 10 sw (sp+16),r21
8001814: 5b 96 00 0c sw (sp+12),r22
8001818: 5b 97 00 08 sw (sp+8),r23
800181c: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_disk_device *dd = NULL;
sc = disk_lock();
8001820: 5b 82 00 3c sw (sp+60),r2
}
}
rtems_status_code
rtems_disk_delete(dev_t dev)
{
8001824: b8 20 58 00 mv r11,r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_disk_device *dd = NULL;
sc = disk_lock();
8001828: fb ff ff 29 calli 80014cc <disk_lock>
800182c: b8 20 68 00 mv r13,r1
if (sc != RTEMS_SUCCESSFUL) {
8001830: 2b 82 00 3c lw r2,(sp+60)
8001834: 5c 20 00 66 bne r1,r0,80019cc <rtems_disk_delete+0x1e8> <== NEVER TAKEN
return sc;
}
dd = get_disk_entry(dev, true);
8001838: b9 60 08 00 mv r1,r11
800183c: 34 03 00 01 mvi r3,1
8001840: fb ff fe dc calli 80013b0 <get_disk_entry>
8001844: b8 20 60 00 mv r12,r1
if (dd == NULL) {
8001848: 5c 2d 00 04 bne r1,r13,8001858 <rtems_disk_delete+0x74> <== ALWAYS TAKEN
disk_unlock();
800184c: fb ff ff 33 calli 8001518 <disk_unlock> <== NOT EXECUTED
return RTEMS_INVALID_ID;
8001850: 34 0d 00 04 mvi r13,4 <== NOT EXECUTED
8001854: e0 00 00 5e bi 80019cc <rtems_disk_delete+0x1e8> <== NOT EXECUTED
}
static void
rtems_disk_cleanup(rtems_disk_device *disk_to_remove)
{
rtems_disk_device *const physical_disk = disk_to_remove->phys_dev;
8001858: 29 8b 00 08 lw r11,(r12+8)
disk_unlock();
return RTEMS_INVALID_ID;
}
dd->deleted = true;
800185c: 34 01 00 01 mvi r1,1
8001860: 31 81 00 40 sb (r12+64),r1
{
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) {
8001864: 41 61 00 40 lbu r1,(r11+64)
8001868: 44 20 00 43 be r1,r0,8001974 <rtems_disk_delete+0x190>
dev_t dev = physical_disk->dev;
unsigned deleted_count = 0;
for (major = 0; major < disktab_size; ++major) {
800186c: 78 0e 08 01 mvhi r14,0x801
rtems_disk_device_table *dtab = disktab + major;
8001870: 78 0c 08 01 mvhi r12,0x801
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;
8001874: 29 77 00 00 lw r23,(r11+0)
8001878: 29 76 00 04 lw r22,(r11+4)
800187c: 34 11 00 00 mvi r17,0
unsigned deleted_count = 0;
8001880: 34 0f 00 00 mvi r15,0
for (major = 0; major < disktab_size; ++major) {
8001884: 34 10 00 00 mvi r16,0
8001888: 39 ce a7 54 ori r14,r14,0xa754
rtems_disk_device_table *dtab = disktab + major;
800188c: 39 8c a7 50 ori r12,r12,0xa750
if (dd->uses == 0) {
++deleted_count;
dtab->minor [minor] = NULL;
free_disk_device(dd);
} else {
dd->deleted = true;
8001890: 34 15 00 01 mvi r21,1
8001894: e0 00 00 22 bi 800191c <rtems_disk_delete+0x138>
if (physical_disk->deleted) {
dev_t dev = physical_disk->dev;
unsigned deleted_count = 0;
for (major = 0; major < disktab_size; ++major) {
rtems_disk_device_table *dtab = disktab + major;
8001898: 29 94 00 00 lw r20,(r12+0)
800189c: 34 13 00 00 mvi r19,0
for (minor = 0; minor < dtab->size; ++minor) {
80018a0: 34 12 00 00 mvi r18,0
if (physical_disk->deleted) {
dev_t dev = physical_disk->dev;
unsigned deleted_count = 0;
for (major = 0; major < disktab_size; ++major) {
rtems_disk_device_table *dtab = disktab + major;
80018a4: b6 91 a0 00 add r20,r20,r17
80018a8: e0 00 00 19 bi 800190c <rtems_disk_delete+0x128>
for (minor = 0; minor < dtab->size; ++minor) {
rtems_disk_device *dd = dtab->minor [minor];
80018ac: 2a 81 00 00 lw r1,(r20+0)
80018b0: b4 33 08 00 add r1,r1,r19
80018b4: 28 22 00 00 lw r2,(r1+0)
if (dd != NULL && dd->phys_dev->dev == dev && dd != physical_disk) {
80018b8: 44 40 00 13 be r2,r0,8001904 <rtems_disk_delete+0x120>
80018bc: 28 43 00 08 lw r3,(r2+8)
80018c0: fc 4b 20 00 cmpne r4,r2,r11
80018c4: 28 65 00 00 lw r5,(r3+0)
80018c8: 28 63 00 04 lw r3,(r3+4)
80018cc: 98 b7 28 00 xor r5,r5,r23
80018d0: 98 76 18 00 xor r3,r3,r22
80018d4: b8 a3 18 00 or r3,r5,r3
80018d8: 64 63 00 00 cmpei r3,r3,0
80018dc: a0 83 18 00 and r3,r4,r3
80018e0: 44 60 00 09 be r3,r0,8001904 <rtems_disk_delete+0x120>
if (dd->uses == 0) {
80018e4: 28 43 00 14 lw r3,(r2+20)
80018e8: 5c 60 00 06 bne r3,r0,8001900 <rtems_disk_delete+0x11c>
++deleted_count;
dtab->minor [minor] = NULL;
80018ec: 58 20 00 00 sw (r1+0),r0
free_disk_device(dd);
80018f0: b8 40 08 00 mv r1,r2
for (minor = 0; minor < dtab->size; ++minor) {
rtems_disk_device *dd = dtab->minor [minor];
if (dd != NULL && dd->phys_dev->dev == dev && dd != physical_disk) {
if (dd->uses == 0) {
++deleted_count;
80018f4: 35 ef 00 01 addi r15,r15,1
dtab->minor [minor] = NULL;
free_disk_device(dd);
80018f8: fb ff fe de calli 8001470 <free_disk_device>
80018fc: e0 00 00 02 bi 8001904 <rtems_disk_delete+0x120>
} else {
dd->deleted = true;
8001900: 30 55 00 40 sb (r2+64),r21
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) {
8001904: 36 52 00 01 addi r18,r18,1
8001908: 36 73 00 04 addi r19,r19,4
800190c: 2a 81 00 04 lw r1,(r20+4)
8001910: 54 32 ff e7 bgu r1,r18,80018ac <rtems_disk_delete+0xc8>
if (physical_disk->deleted) {
dev_t dev = physical_disk->dev;
unsigned deleted_count = 0;
for (major = 0; major < disktab_size; ++major) {
8001914: 36 10 00 01 addi r16,r16,1
8001918: 36 31 00 08 addi r17,r17,8
800191c: 29 c1 00 00 lw r1,(r14+0)
8001920: 54 30 ff de bgu r1,r16,8001898 <rtems_disk_delete+0xb4>
}
}
}
}
physical_disk->uses -= deleted_count;
8001924: 29 61 00 14 lw r1,(r11+20)
8001928: c8 2f 78 00 sub r15,r1,r15
800192c: 59 6f 00 14 sw (r11+20),r15
if (physical_disk->uses == 0) {
8001930: 5d e0 00 26 bne r15,r0,80019c8 <rtems_disk_delete+0x1e4>
rtems_filesystem_split_dev_t(physical_disk->dev, major, minor);
disktab [major].minor [minor] = NULL;
8001934: 78 02 08 01 mvhi r2,0x801
8001938: 38 42 a7 50 ori r2,r2,0xa750
800193c: 29 61 00 00 lw r1,(r11+0)
8001940: 28 4c 00 00 lw r12,(r2+0)
8001944: 34 02 00 03 mvi r2,3
8001948: f8 00 57 fe calli 8017940 <__ashlsi3>
}
}
physical_disk->uses -= deleted_count;
if (physical_disk->uses == 0) {
rtems_filesystem_split_dev_t(physical_disk->dev, major, minor);
800194c: 29 6e 00 04 lw r14,(r11+4)
disktab [major].minor [minor] = NULL;
8001950: b5 81 10 00 add r2,r12,r1
8001954: 28 4c 00 00 lw r12,(r2+0)
8001958: b9 c0 08 00 mv r1,r14
800195c: 34 02 00 02 mvi r2,2
8001960: f8 00 57 f8 calli 8017940 <__ashlsi3>
8001964: b5 81 08 00 add r1,r12,r1
8001968: 58 20 00 00 sw (r1+0),r0
free_disk_device(physical_disk);
800196c: b9 60 08 00 mv r1,r11
8001970: e0 00 00 15 bi 80019c4 <rtems_disk_delete+0x1e0>
}
} else {
if (disk_to_remove->uses == 0) {
8001974: 29 81 00 14 lw r1,(r12+20)
8001978: 5c 20 00 14 bne r1,r0,80019c8 <rtems_disk_delete+0x1e4> <== NEVER TAKEN
--physical_disk->uses;
800197c: 29 61 00 14 lw r1,(r11+20)
rtems_filesystem_split_dev_t(disk_to_remove->dev, major, minor);
disktab [major].minor [minor] = NULL;
8001980: 78 02 08 01 mvhi r2,0x801
8001984: 38 42 a7 50 ori r2,r2,0xa750
disktab [major].minor [minor] = NULL;
free_disk_device(physical_disk);
}
} else {
if (disk_to_remove->uses == 0) {
--physical_disk->uses;
8001988: 34 21 ff ff addi r1,r1,-1
800198c: 59 61 00 14 sw (r11+20),r1
rtems_filesystem_split_dev_t(disk_to_remove->dev, major, minor);
disktab [major].minor [minor] = NULL;
8001990: 29 81 00 00 lw r1,(r12+0)
8001994: 28 4b 00 00 lw r11,(r2+0)
8001998: 34 02 00 03 mvi r2,3
800199c: f8 00 57 e9 calli 8017940 <__ashlsi3>
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);
80019a0: 29 8e 00 04 lw r14,(r12+4)
disktab [major].minor [minor] = NULL;
80019a4: b5 61 10 00 add r2,r11,r1
80019a8: 28 4b 00 00 lw r11,(r2+0)
80019ac: b9 c0 08 00 mv r1,r14
80019b0: 34 02 00 02 mvi r2,2
80019b4: f8 00 57 e3 calli 8017940 <__ashlsi3>
80019b8: b5 61 08 00 add r1,r11,r1
80019bc: 58 20 00 00 sw (r1+0),r0
free_disk_device(disk_to_remove);
80019c0: b9 80 08 00 mv r1,r12
80019c4: fb ff fe ab calli 8001470 <free_disk_device>
}
dd->deleted = true;
rtems_disk_cleanup(dd);
disk_unlock();
80019c8: fb ff fe d4 calli 8001518 <disk_unlock>
return RTEMS_SUCCESSFUL;
}
80019cc: b9 a0 08 00 mv r1,r13
80019d0: 2b 9d 00 04 lw ra,(sp+4)
80019d4: 2b 8b 00 38 lw r11,(sp+56)
80019d8: 2b 8c 00 34 lw r12,(sp+52)
80019dc: 2b 8d 00 30 lw r13,(sp+48)
80019e0: 2b 8e 00 2c lw r14,(sp+44)
80019e4: 2b 8f 00 28 lw r15,(sp+40)
80019e8: 2b 90 00 24 lw r16,(sp+36)
80019ec: 2b 91 00 20 lw r17,(sp+32)
80019f0: 2b 92 00 1c lw r18,(sp+28)
80019f4: 2b 93 00 18 lw r19,(sp+24)
80019f8: 2b 94 00 14 lw r20,(sp+20)
80019fc: 2b 95 00 10 lw r21,(sp+16)
8001a00: 2b 96 00 0c lw r22,(sp+12)
8001a04: 2b 97 00 08 lw r23,(sp+8)
8001a08: 37 9c 00 3c addi sp,sp,60
8001a0c: c3 a0 00 00 ret
08001e64 <rtems_disk_io_initialize>:
rtems_status_code
rtems_disk_io_initialize(void)
{
8001e64: 37 9c ff e8 addi sp,sp,-24
8001e68: 5b 8b 00 18 sw (sp+24),r11
8001e6c: 5b 8c 00 14 sw (sp+20),r12
8001e70: 5b 8d 00 10 sw (sp+16),r13
8001e74: 5b 8e 00 0c sw (sp+12),r14
8001e78: 5b 8f 00 08 sw (sp+8),r15
8001e7c: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number size = DISKTAB_INITIAL_SIZE;
if (disktab_size > 0) {
8001e80: 78 0d 08 01 mvhi r13,0x801
8001e84: 39 ad a7 54 ori r13,r13,0xa754
8001e88: 29 ae 00 00 lw r14,(r13+0)
return RTEMS_SUCCESSFUL;
8001e8c: 34 0c 00 00 mvi r12,0
rtems_disk_io_initialize(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number size = DISKTAB_INITIAL_SIZE;
if (disktab_size > 0) {
8001e90: 5d c0 00 26 bne r14,r0,8001f28 <rtems_disk_io_initialize+0xc4>
return RTEMS_SUCCESSFUL;
}
disktab = calloc(size, sizeof(rtems_disk_device_table));
8001e94: 34 01 00 08 mvi r1,8
8001e98: 34 02 00 08 mvi r2,8
8001e9c: 78 0b 08 01 mvhi r11,0x801
8001ea0: f8 00 02 52 calli 80027e8 <calloc>
8001ea4: 39 6b a7 50 ori r11,r11,0xa750
8001ea8: 59 61 00 00 sw (r11+0),r1
if (disktab == NULL) {
return RTEMS_NO_MEMORY;
8001eac: 34 0c 00 1a mvi r12,26
if (disktab_size > 0) {
return RTEMS_SUCCESSFUL;
}
disktab = calloc(size, sizeof(rtems_disk_device_table));
if (disktab == NULL) {
8001eb0: 44 2e 00 1e be r1,r14,8001f28 <rtems_disk_io_initialize+0xc4><== NEVER TAKEN
return RTEMS_NO_MEMORY;
}
diskdevs_protected = false;
8001eb4: 78 01 08 01 mvhi r1,0x801
sc = rtems_semaphore_create(
8001eb8: 78 02 08 01 mvhi r2,0x801
disktab = calloc(size, sizeof(rtems_disk_device_table));
if (disktab == NULL) {
return RTEMS_NO_MEMORY;
}
diskdevs_protected = false;
8001ebc: 38 21 a7 5c ori r1,r1,0xa75c
sc = rtems_semaphore_create(
8001ec0: 38 42 88 c0 ori r2,r2,0x88c0
disktab = calloc(size, sizeof(rtems_disk_device_table));
if (disktab == NULL) {
return RTEMS_NO_MEMORY;
}
diskdevs_protected = false;
8001ec4: 30 20 00 00 sb (r1+0),r0
sc = rtems_semaphore_create(
8001ec8: 78 0e 08 01 mvhi r14,0x801
8001ecc: 28 41 00 00 lw r1,(r2+0)
8001ed0: 39 ce a7 58 ori r14,r14,0xa758
8001ed4: 34 02 00 01 mvi r2,1
8001ed8: 34 03 00 10 mvi r3,16
8001edc: 34 04 00 00 mvi r4,0
8001ee0: b9 c0 28 00 mv r5,r14
8001ee4: f8 00 0b 66 calli 8004c7c <rtems_semaphore_create>
8001ee8: b8 20 78 00 mv r15,r1
RTEMS_FIFO | RTEMS_BINARY_SEMAPHORE | RTEMS_NO_INHERIT_PRIORITY
| RTEMS_NO_PRIORITY_CEILING | RTEMS_LOCAL,
0,
&diskdevs_mutex
);
if (sc != RTEMS_SUCCESSFUL) {
8001eec: 44 20 00 04 be r1,r0,8001efc <rtems_disk_io_initialize+0x98><== ALWAYS TAKEN
free(disktab);
8001ef0: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED
8001ef4: f8 00 02 87 calli 8002910 <free> <== NOT EXECUTED
return RTEMS_NO_MEMORY;
8001ef8: e0 00 00 0c bi 8001f28 <rtems_disk_io_initialize+0xc4> <== NOT EXECUTED
}
sc = rtems_bdbuf_init();
8001efc: f8 00 24 77 calli 800b0d8 <rtems_bdbuf_init>
if (sc != RTEMS_SUCCESSFUL) {
8001f00: 44 2f 00 07 be r1,r15,8001f1c <rtems_disk_io_initialize+0xb8><== ALWAYS TAKEN
rtems_semaphore_delete(diskdevs_mutex);
8001f04: 29 c1 00 00 lw r1,(r14+0) <== NOT EXECUTED
free(disktab);
return RTEMS_UNSATISFIED;
8001f08: 34 0c 00 0d mvi r12,13 <== NOT EXECUTED
return RTEMS_NO_MEMORY;
}
sc = rtems_bdbuf_init();
if (sc != RTEMS_SUCCESSFUL) {
rtems_semaphore_delete(diskdevs_mutex);
8001f0c: f8 00 0b d9 calli 8004e70 <rtems_semaphore_delete> <== NOT EXECUTED
free(disktab);
8001f10: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED
8001f14: f8 00 02 7f calli 8002910 <free> <== NOT EXECUTED
return RTEMS_UNSATISFIED;
8001f18: e0 00 00 04 bi 8001f28 <rtems_disk_io_initialize+0xc4> <== NOT EXECUTED
}
disktab_size = size;
8001f1c: 34 01 00 08 mvi r1,8
8001f20: 59 a1 00 00 sw (r13+0),r1
return RTEMS_SUCCESSFUL;
8001f24: 34 0c 00 00 mvi r12,0
}
8001f28: b9 80 08 00 mv r1,r12
8001f2c: 2b 9d 00 04 lw ra,(sp+4)
8001f30: 2b 8b 00 18 lw r11,(sp+24)
8001f34: 2b 8c 00 14 lw r12,(sp+20)
8001f38: 2b 8d 00 10 lw r13,(sp+16)
8001f3c: 2b 8e 00 0c lw r14,(sp+12)
8001f40: 2b 8f 00 08 lw r15,(sp+8)
8001f44: 37 9c 00 18 addi sp,sp,24
8001f48: c3 a0 00 00 ret
08001d24 <rtems_disk_next>:
rtems_disk_device *
rtems_disk_next(dev_t dev)
{
8001d24: 37 9c ff e0 addi sp,sp,-32
8001d28: 5b 8b 00 20 sw (sp+32),r11
8001d2c: 5b 8c 00 1c sw (sp+28),r12
8001d30: 5b 8d 00 18 sw (sp+24),r13
8001d34: 5b 8e 00 14 sw (sp+20),r14
8001d38: 5b 8f 00 10 sw (sp+16),r15
8001d3c: 5b 90 00 0c sw (sp+12),r16
8001d40: 5b 91 00 08 sw (sp+8),r17
8001d44: 5b 9d 00 04 sw (sp+4),ra
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) {
8001d48: 34 03 ff ff mvi r3,-1
8001d4c: 5c 23 00 02 bne r1,r3,8001d54 <rtems_disk_next+0x30>
8001d50: 44 41 00 09 be r2,r1,8001d74 <rtems_disk_next+0x50> <== ALWAYS TAKEN
rtems_filesystem_split_dev_t(dev, major, minor);
/* If minor wraps around */
if ((minor + 1) < minor) {
8001d54: 34 4c 00 01 addi r12,r2,1
)
{
union __rtems_dev_t temp;
temp.device = device;
return temp.__overlay.major;
8001d58: b8 20 58 00 mv r11,r1
8001d5c: 51 82 00 08 bgeu r12,r2,8001d7c <rtems_disk_next+0x58> <== ALWAYS TAKEN
/* If major wraps around */
if ((major + 1) < major) {
8001d60: 34 2b 00 01 addi r11,r1,1 <== NOT EXECUTED
return NULL;
8001d64: 34 0d 00 00 mvi r13,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) {
8001d68: 54 2b 00 34 bgu r1,r11,8001e38 <rtems_disk_next+0x114> <== NOT EXECUTED
return NULL;
}
++major;
minor = 0;
8001d6c: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
8001d70: e0 00 00 03 bi 8001d7c <rtems_disk_next+0x58> <== NOT EXECUTED
rtems_disk_next(dev_t dev)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_disk_device_table *dtab = NULL;
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
8001d74: 34 0c 00 00 mvi r12,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;
8001d78: 34 0b 00 00 mvi r11,0
} else {
++minor;
}
}
sc = disk_lock();
8001d7c: fb ff fd d4 calli 80014cc <disk_lock>
if (sc != RTEMS_SUCCESSFUL) {
return NULL;
8001d80: 34 0d 00 00 mvi r13,0
++minor;
}
}
sc = disk_lock();
if (sc != RTEMS_SUCCESSFUL) {
8001d84: 5c 20 00 2d bne r1,r0,8001e38 <rtems_disk_next+0x114> <== NEVER TAKEN
return NULL;
}
if (major >= disktab_size) {
8001d88: 78 01 08 01 mvhi r1,0x801
8001d8c: 38 21 a7 54 ori r1,r1,0xa754
8001d90: 28 30 00 00 lw r16,(r1+0)
8001d94: 56 0b 00 03 bgu r16,r11,8001da0 <rtems_disk_next+0x7c> <== ALWAYS TAKEN
disk_unlock();
8001d98: fb ff fd e0 calli 8001518 <disk_unlock> <== NOT EXECUTED
return NULL;
8001d9c: e0 00 00 27 bi 8001e38 <rtems_disk_next+0x114> <== NOT EXECUTED
}
dtab = disktab + major;
8001da0: 78 01 08 01 mvhi r1,0x801
8001da4: 38 21 a7 50 ori r1,r1,0xa750
8001da8: 28 2f 00 00 lw r15,(r1+0)
8001dac: 34 02 00 03 mvi r2,3
8001db0: b9 60 08 00 mv r1,r11
8001db4: f8 00 56 e3 calli 8017940 <__ashlsi3>
8001db8: b5 e1 68 00 add r13,r15,r1
while (true) {
if (dtab->minor == NULL || minor >= dtab->size) {
8001dbc: 29 b1 00 00 lw r17,(r13+0)
8001dc0: 46 20 00 03 be r17,r0,8001dcc <rtems_disk_next+0xa8>
8001dc4: 29 a1 00 04 lw r1,(r13+4)
8001dc8: 54 2c 00 0c bgu r1,r12,8001df8 <rtems_disk_next+0xd4>
minor = 0;
++major;
8001dcc: 35 6b 00 01 addi r11,r11,1
if (major >= disktab_size) {
8001dd0: 56 0b 00 04 bgu r16,r11,8001de0 <rtems_disk_next+0xbc>
disk_unlock();
8001dd4: fb ff fd d1 calli 8001518 <disk_unlock>
return NULL;
8001dd8: 34 0d 00 00 mvi r13,0
8001ddc: e0 00 00 17 bi 8001e38 <rtems_disk_next+0x114>
}
dtab = disktab + major;
8001de0: b9 60 08 00 mv r1,r11
8001de4: 34 02 00 03 mvi r2,3
8001de8: f8 00 56 d6 calli 8017940 <__ashlsi3>
8001dec: b5 e1 68 00 add r13,r15,r1
}
dtab = disktab + major;
while (true) {
if (dtab->minor == NULL || minor >= dtab->size) {
minor = 0;
8001df0: 34 0c 00 00 mvi r12,0
if (major >= disktab_size) {
disk_unlock();
return NULL;
}
dtab = disktab + major;
8001df4: e3 ff ff f2 bi 8001dbc <rtems_disk_next+0x98>
} else if (dtab->minor [minor] == NULL) {
8001df8: 34 02 00 02 mvi r2,2
8001dfc: b9 80 08 00 mv r1,r12
8001e00: f8 00 56 d0 calli 8017940 <__ashlsi3>
8001e04: b6 21 88 00 add r17,r17,r1
8001e08: 2a 22 00 00 lw r2,(r17+0)
8001e0c: b8 20 70 00 mv r14,r1
8001e10: 5c 40 00 03 bne r2,r0,8001e1c <rtems_disk_next+0xf8>
++minor;
8001e14: 35 8c 00 01 addi r12,r12,1
8001e18: e3 ff ff e9 bi 8001dbc <rtems_disk_next+0x98>
} else {
++dtab->minor [minor]->uses;
8001e1c: 28 41 00 14 lw r1,(r2+20)
8001e20: 34 21 00 01 addi r1,r1,1
8001e24: 58 41 00 14 sw (r2+20),r1
disk_unlock();
8001e28: fb ff fd bc calli 8001518 <disk_unlock>
return dtab->minor [minor];
8001e2c: 29 a1 00 00 lw r1,(r13+0)
8001e30: b4 2e 70 00 add r14,r1,r14
8001e34: 29 cd 00 00 lw r13,(r14+0)
}
}
}
8001e38: b9 a0 08 00 mv r1,r13
8001e3c: 2b 9d 00 04 lw ra,(sp+4)
8001e40: 2b 8b 00 20 lw r11,(sp+32)
8001e44: 2b 8c 00 1c lw r12,(sp+28)
8001e48: 2b 8d 00 18 lw r13,(sp+24)
8001e4c: 2b 8e 00 14 lw r14,(sp+20)
8001e50: 2b 8f 00 10 lw r15,(sp+16)
8001e54: 2b 90 00 0c lw r16,(sp+12)
8001e58: 2b 91 00 08 lw r17,(sp+8)
8001e5c: 37 9c 00 20 addi sp,sp,32
8001e60: c3 a0 00 00 ret
08001c34 <rtems_disk_obtain>:
return RTEMS_SUCCESSFUL;
}
rtems_disk_device *
rtems_disk_obtain(dev_t dev)
{
8001c34: 37 9c ff ec addi sp,sp,-20
8001c38: 5b 8b 00 10 sw (sp+16),r11
8001c3c: 5b 8c 00 0c sw (sp+12),r12
8001c40: 5b 8d 00 08 sw (sp+8),r13
8001c44: 5b 9d 00 04 sw (sp+4),ra
8001c48: b8 20 68 00 mv r13,r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_disk_device *dd = NULL;
rtems_interrupt_level level;
rtems_interrupt_disable(level);
8001c4c: 90 00 60 00 rcsr r12,IE
8001c50: 34 01 ff fe mvi r1,-2
8001c54: a1 81 08 00 and r1,r12,r1
8001c58: d0 01 00 00 wcsr IE,r1
if (!diskdevs_protected) {
8001c5c: 78 03 08 01 mvhi r3,0x801
8001c60: 38 63 a7 5c ori r3,r3,0xa75c
8001c64: 40 61 00 00 lbu r1,(r3+0)
8001c68: 20 21 00 ff andi r1,r1,0xff
8001c6c: 5c 20 00 07 bne r1,r0,8001c88 <rtems_disk_obtain+0x54> <== NEVER TAKEN
/* Frequent and quickest case */
dd = get_disk_entry(dev, false);
8001c70: b9 a0 08 00 mv r1,r13
8001c74: 34 03 00 00 mvi r3,0
8001c78: fb ff fd ce calli 80013b0 <get_disk_entry>
8001c7c: b8 20 58 00 mv r11,r1
rtems_interrupt_enable(level);
8001c80: d0 0c 00 00 wcsr IE,r12
8001c84: e0 00 00 0c bi 8001cb4 <rtems_disk_obtain+0x80>
} else {
rtems_interrupt_enable(level);
8001c88: d0 0c 00 00 wcsr IE,r12 <== NOT EXECUTED
sc = disk_lock();
8001c8c: 5b 82 00 14 sw (sp+20),r2 <== NOT EXECUTED
8001c90: fb ff fe 0f calli 80014cc <disk_lock> <== NOT EXECUTED
rtems_disk_device *
rtems_disk_obtain(dev_t dev)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_disk_device *dd = NULL;
8001c94: 34 0b 00 00 mvi r11,0 <== NOT EXECUTED
rtems_interrupt_enable(level);
} else {
rtems_interrupt_enable(level);
sc = disk_lock();
if (sc == RTEMS_SUCCESSFUL) {
8001c98: 2b 82 00 14 lw r2,(sp+20) <== NOT EXECUTED
8001c9c: 5c 20 00 06 bne r1,r0,8001cb4 <rtems_disk_obtain+0x80> <== NOT EXECUTED
dd = get_disk_entry(dev, false);
8001ca0: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
8001ca4: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
8001ca8: fb ff fd c2 calli 80013b0 <get_disk_entry> <== NOT EXECUTED
8001cac: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
disk_unlock();
8001cb0: fb ff fe 1a calli 8001518 <disk_unlock> <== NOT EXECUTED
}
}
return dd;
}
8001cb4: b9 60 08 00 mv r1,r11
8001cb8: 2b 9d 00 04 lw ra,(sp+4)
8001cbc: 2b 8b 00 10 lw r11,(sp+16)
8001cc0: 2b 8c 00 0c lw r12,(sp+12)
8001cc4: 2b 8d 00 08 lw r13,(sp+8)
8001cc8: 37 9c 00 14 addi sp,sp,20
8001ccc: c3 a0 00 00 ret
0800e924 <rtems_event_system_receive>:
rtems_event_set event_in,
rtems_option option_set,
rtems_interval ticks,
rtems_event_set *event_out
)
{
800e924: 37 9c ff f8 addi sp,sp,-8
800e928: 5b 8b 00 08 sw (sp+8),r11
800e92c: 5b 9d 00 04 sw (sp+4),ra
} else {
*event_out = event->pending_events;
sc = RTEMS_SUCCESSFUL;
}
} else {
sc = RTEMS_INVALID_ADDRESS;
800e930: 34 05 00 09 mvi r5,9
rtems_event_set *event_out
)
{
rtems_status_code sc;
if ( event_out != NULL ) {
800e934: 44 80 00 17 be r4,r0,800e990 <rtems_event_system_receive+0x6c><== NEVER TAKEN
Thread_Control *executing = _Thread_Executing;
800e938: 78 05 08 01 mvhi r5,0x801
800e93c: 38 a5 ae 00 ori r5,r5,0xae00
800e940: 28 ab 00 10 lw r11,(r5+16)
RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ];
800e944: 29 66 01 18 lw r6,(r11+280)
Event_Control *event = &api->System_event;
if ( !_Event_sets_Is_empty( event_in ) ) {
800e948: 44 20 00 0f be r1,r0,800e984 <rtems_event_system_receive+0x60><== NEVER TAKEN
*
* 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;
800e94c: 78 07 08 01 mvhi r7,0x801
800e950: 38 e7 a9 78 ori r7,r7,0xa978
800e954: 28 e5 00 00 lw r5,(r7+0)
++level;
800e958: 34 a5 00 01 addi r5,r5,1
_Thread_Dispatch_disable_level = level;
800e95c: 58 e5 00 00 sw (r7+0),r5
_Thread_Disable_dispatch();
_Event_Seize(
800e960: 78 07 08 01 mvhi r7,0x801
800e964: b9 60 28 00 mv r5,r11
800e968: 34 c6 00 04 addi r6,r6,4
800e96c: 38 e7 b2 28 ori r7,r7,0xb228
800e970: 78 08 00 04 mvhi r8,0x4
800e974: fb ff fe a1 calli 800e3f8 <_Event_Seize>
executing,
event,
&_System_event_Sync_state,
STATES_WAITING_FOR_SYSTEM_EVENT
);
_Thread_Enable_dispatch();
800e978: fb ff e4 12 calli 80079c0 <_Thread_Enable_dispatch>
sc = executing->Wait.return_code;
800e97c: 29 65 00 34 lw r5,(r11+52)
800e980: e0 00 00 04 bi 800e990 <rtems_event_system_receive+0x6c>
} else {
*event_out = event->pending_events;
800e984: 28 c1 00 04 lw r1,(r6+4) <== NOT EXECUTED
sc = RTEMS_SUCCESSFUL;
800e988: 34 05 00 00 mvi r5,0 <== NOT EXECUTED
);
_Thread_Enable_dispatch();
sc = executing->Wait.return_code;
} else {
*event_out = event->pending_events;
800e98c: 58 81 00 00 sw (r4+0),r1 <== NOT EXECUTED
} else {
sc = RTEMS_INVALID_ADDRESS;
}
return sc;
}
800e990: b8 a0 08 00 mv r1,r5
800e994: 2b 9d 00 04 lw ra,(sp+4)
800e998: 2b 8b 00 08 lw r11,(sp+8)
800e99c: 37 9c 00 08 addi sp,sp,8
800e9a0: c3 a0 00 00 ret
08005164 <rtems_event_system_send>:
rtems_status_code rtems_event_system_send(
rtems_id id,
rtems_event_set event_in
)
{
8005164: 37 9c ff f4 addi sp,sp,-12
8005168: 5b 8b 00 08 sw (sp+8),r11
800516c: 5b 9d 00 04 sw (sp+4),ra
8005170: b8 40 58 00 mv r11,r2
rtems_status_code sc;
Thread_Control *thread;
Objects_Locations location;
RTEMS_API_Control *api;
thread = _Thread_Get( id, &location );
8005174: 37 82 00 0c addi r2,sp,12
8005178: f8 00 0a 1e calli 80079f0 <_Thread_Get>
switch ( location ) {
800517c: 2b 82 00 0c lw r2,(sp+12)
8005180: 5c 40 00 0b bne r2,r0,80051ac <rtems_event_system_send+0x48><== NEVER TAKEN
case OBJECTS_LOCAL:
api = thread->API_Extensions[ THREAD_API_RTEMS ];
_Event_Surrender(
8005184: 28 23 01 18 lw r3,(r1+280)
8005188: 78 04 08 01 mvhi r4,0x801
800518c: b9 60 10 00 mv r2,r11
8005190: 34 63 00 04 addi r3,r3,4
8005194: 38 84 b2 28 ori r4,r4,0xb228
8005198: 78 05 00 04 mvhi r5,0x4
800519c: f8 00 24 f4 calli 800e56c <_Event_Surrender>
event_in,
&api->System_event,
&_System_event_Sync_state,
STATES_WAITING_FOR_SYSTEM_EVENT
);
_Thread_Enable_dispatch();
80051a0: f8 00 0a 08 calli 80079c0 <_Thread_Enable_dispatch>
sc = RTEMS_SUCCESSFUL;
80051a4: 34 01 00 00 mvi r1,0
break;
80051a8: e0 00 00 02 bi 80051b0 <rtems_event_system_send+0x4c>
case OBJECTS_REMOTE:
sc = RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
break;
#endif
default:
sc = RTEMS_INVALID_ID;
80051ac: 34 01 00 04 mvi r1,4 <== NOT EXECUTED
break;
}
return sc;
}
80051b0: 2b 9d 00 04 lw ra,(sp+4)
80051b4: 2b 8b 00 08 lw r11,(sp+8)
80051b8: 37 9c 00 0c addi sp,sp,12
80051bc: c3 a0 00 00 ret
08003458 <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, ...)
{
8003458: 37 9c ff d4 addi sp,sp,-44 <== NOT EXECUTED
800345c: 5b 8b 00 0c sw (sp+12),r11 <== NOT EXECUTED
8003460: 5b 8c 00 08 sw (sp+8),r12 <== NOT EXECUTED
8003464: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:abort:");
8003468: 78 0b 08 03 mvhi r11,0x803 <== NOT EXECUTED
800346c: 39 6b b2 90 ori r11,r11,0xb290 <== 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, ...)
{
8003470: 5b 82 00 14 sw (sp+20),r2 <== NOT EXECUTED
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:abort:");
8003474: 29 62 00 00 lw r2,(r11+0) <== 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, ...)
{
8003478: 5b 84 00 1c sw (sp+28),r4 <== NOT EXECUTED
800347c: 5b 85 00 20 sw (sp+32),r5 <== NOT EXECUTED
8003480: 5b 86 00 24 sw (sp+36),r6 <== NOT EXECUTED
8003484: 5b 87 00 28 sw (sp+40),r7 <== NOT EXECUTED
8003488: 5b 88 00 2c sw (sp+44),r8 <== NOT EXECUTED
800348c: 5b 81 00 10 sw (sp+16),r1 <== NOT EXECUTED
8003490: 5b 83 00 18 sw (sp+24),r3 <== NOT EXECUTED
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:abort:");
8003494: 28 42 00 0c lw r2,(r2+12) <== NOT EXECUTED
8003498: 78 03 08 03 mvhi r3,0x803 <== 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, ...)
{
800349c: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:abort:");
80034a0: b8 60 08 00 mv r1,r3 <== NOT EXECUTED
80034a4: 38 21 55 38 ori r1,r1,0x5538 <== NOT EXECUTED
80034a8: f8 00 78 fa calli 8021890 <fputs> <== NOT EXECUTED
vfprintf (stderr, format, args);
80034ac: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED
80034b0: 37 83 00 14 addi r3,sp,20 <== NOT EXECUTED
80034b4: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
80034b8: 28 21 00 0c lw r1,(r1+12) <== NOT EXECUTED
80034bc: f8 00 9a 6f calli 8029e78 <vfprintf> <== NOT EXECUTED
fprintf (stderr, "\n");
80034c0: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED
80034c4: 34 01 00 0a mvi r1,10 <== NOT EXECUTED
80034c8: 28 42 00 0c lw r2,(r2+12) <== NOT EXECUTED
80034cc: f8 00 78 ad calli 8021780 <fputc> <== NOT EXECUTED
fflush (stderr);
80034d0: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED
80034d4: 28 21 00 0c lw r1,(r1+12) <== NOT EXECUTED
80034d8: f8 00 77 1c calli 8021148 <fflush> <== NOT EXECUTED
va_end (args);
exit (1);
80034dc: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
80034e0: f8 00 76 0e calli 8020d18 <exit> <== NOT EXECUTED
08004184 <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)
{
8004184: 37 9c ff cc addi sp,sp,-52
8004188: 5b 8b 00 30 sw (sp+48),r11
800418c: 5b 8c 00 2c sw (sp+44),r12
8004190: 5b 8d 00 28 sw (sp+40),r13
8004194: 5b 8e 00 24 sw (sp+36),r14
8004198: 5b 8f 00 20 sw (sp+32),r15
800419c: 5b 90 00 1c sw (sp+28),r16
80041a0: 5b 91 00 18 sw (sp+24),r17
80041a4: 5b 92 00 14 sw (sp+20),r18
80041a8: 5b 93 00 10 sw (sp+16),r19
80041ac: 5b 94 00 0c sw (sp+12),r20
80041b0: 5b 95 00 08 sw (sp+8),r21
80041b4: 5b 9d 00 04 sw (sp+4),ra
static bool
rtems_fdisk_is_erased_blocks_starvation (rtems_flashdisk* fd)
{
bool starvation = fd->erased_blocks < fd->starvation_threshold;
if (starvation)
80041b8: 28 23 00 28 lw r3,(r1+40)
80041bc: 28 22 00 24 lw r2,(r1+36)
* 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)
{
80041c0: b8 20 58 00 mv r11,r1
static bool
rtems_fdisk_is_erased_blocks_starvation (rtems_flashdisk* fd)
{
bool starvation = fd->erased_blocks < fd->starvation_threshold;
if (starvation)
80041c4: 50 62 00 0c bgeu r3,r2,80041f4 <rtems_fdisk_compact+0x70>
fd->starvations++;
80041c8: 28 22 00 70 lw r2,(r1+112)
80041cc: 34 42 00 01 addi r2,r2,1
80041d0: 58 22 00 70 sw (r1+112),r2
uint32_t pages;
if (rtems_fdisk_is_erased_blocks_starvation (fd))
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " resolve starvation");
80041d4: 78 02 08 03 mvhi r2,0x803
80041d8: 38 42 58 68 ori r2,r2,0x5868
80041dc: fb ff fb 1a calli 8002e44 <rtems_fdisk_printf>
#endif
ssc = rtems_fdisk_segment_queue_pop_head (&fd->used);
80041e0: 35 61 00 40 addi r1,r11,64
80041e4: fb ff fa 94 calli 8002c34 <rtems_fdisk_segment_queue_pop_head>
80041e8: b8 20 60 00 mv r12,r1
if (!ssc)
80041ec: 5c 20 00 13 bne r1,r0,8004238 <rtems_fdisk_compact+0xb4> <== ALWAYS TAKEN
80041f0: e0 00 00 0c bi 8004220 <rtems_fdisk_compact+0x9c> <== NOT EXECUTED
{
uint32_t dst_pages;
uint32_t segments;
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " compacting");
80041f4: 78 11 08 03 mvhi r17,0x803
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",
80041f8: 78 10 08 03 mvhi r16,0x803
#endif
break;
}
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " ssc scan: %d-%d: p=%ld, seg=%ld",
80041fc: 78 0f 08 03 mvhi r15,0x803
* compaction or less delay when compacting but it may mean the disk
* will fill.
*/
while (ssc &&
((pages + ssc->pages_active) < dst_pages) &&
8004200: 34 0e 00 00 mvi r14,0
{
uint32_t dst_pages;
uint32_t segments;
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " compacting");
8004204: 3a 31 58 b4 ori r17,r17,0x58b4
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",
8004208: 3a 10 58 f4 ori r16,r16,0x58f4
* 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))
800420c: 34 14 00 01 mvi r20,1
#endif
break;
}
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " ssc scan: %d-%d: p=%ld, seg=%ld",
8004210: 39 ef 59 28 ori r15,r15,0x5928
ssc->device, ssc->segment,
pages, segments);
#endif
rtems_fdisk_segment_queue_remove (&fd->available, dsc);
8004214: 35 73 00 34 addi r19,r11,52
* We now copy the pages to the new segment.
*/
while (pages)
{
ssc = rtems_fdisk_segment_queue_pop_head (&fd->used);
8004218: 35 72 00 40 addi r18,r11,64
800421c: e0 00 00 5b bi 8004388 <rtems_fdisk_compact+0x204>
rtems_fdisk_printf (fd, " resolve starvation");
#endif
ssc = rtems_fdisk_segment_queue_pop_head (&fd->used);
if (!ssc)
ssc = rtems_fdisk_segment_queue_pop_head (&fd->available);
8004220: 35 61 00 34 addi r1,r11,52 <== NOT EXECUTED
8004224: fb ff fa 84 calli 8002c34 <rtems_fdisk_segment_queue_pop_head><== NOT EXECUTED
8004228: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
return EIO;
}
}
else
{
rtems_fdisk_error ("compacting: nothing to recycle");
800422c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8004230: 38 21 58 94 ori r1,r1,0x5894 <== NOT EXECUTED
ssc = rtems_fdisk_segment_queue_pop_head (&fd->used);
if (!ssc)
ssc = rtems_fdisk_segment_queue_pop_head (&fd->available);
if (ssc)
8004234: 45 80 00 17 be r12,r0,8004290 <rtems_fdisk_compact+0x10c> <== NOT EXECUTED
{
dsc = rtems_fdisk_seg_most_available (&fd->available);
8004238: 29 61 00 34 lw r1,(r11+52)
800423c: fb ff fe af calli 8003cf8 <rtems_fdisk_seg_most_available.clone.9>
8004240: b8 20 18 00 mv r3,r1
if (dsc)
8004244: 44 20 00 07 be r1,r0,8004260 <rtems_fdisk_compact+0xdc> <== NEVER TAKEN
{
ret = rtems_fdisk_recycle_segment (fd, ssc, dsc, &pages);
8004248: b9 60 08 00 mv r1,r11
800424c: b9 80 10 00 mv r2,r12
8004250: 37 84 00 34 addi r4,sp,52
8004254: fb ff fe c2 calli 8003d5c <rtems_fdisk_recycle_segment>
if (ret)
8004258: 44 20 ff e7 be r1,r0,80041f4 <rtems_fdisk_compact+0x70> <== ALWAYS TAKEN
800425c: e0 00 00 4d bi 8004390 <rtems_fdisk_compact+0x20c> <== NOT EXECUTED
return ret;
}
else
{
rtems_fdisk_error ("compacting: starvation");
8004260: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8004264: 38 21 58 7c ori r1,r1,0x587c <== NOT EXECUTED
8004268: e0 00 00 0a bi 8004290 <rtems_fdisk_compact+0x10c> <== NOT EXECUTED
{
uint32_t dst_pages;
uint32_t segments;
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " compacting");
800426c: ba 20 10 00 mv r2,r17
8004270: b9 60 08 00 mv r1,r11
8004274: fb ff fa f4 calli 8002e44 <rtems_fdisk_printf>
#endif
dsc = rtems_fdisk_seg_most_available (&fd->available);
8004278: 29 61 00 34 lw r1,(r11+52)
800427c: fb ff fe 9f calli 8003cf8 <rtems_fdisk_seg_most_available.clone.9>
8004280: b8 20 60 00 mv r12,r1
if (dsc == 0)
8004284: 5c 20 00 06 bne r1,r0,800429c <rtems_fdisk_compact+0x118> <== ALWAYS TAKEN
{
rtems_fdisk_error ("compacting: no available segments to compact too");
8004288: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800428c: 38 21 58 c0 ori r1,r1,0x58c0 <== NOT EXECUTED
8004290: fb ff fc 4a calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
return EIO;
8004294: 34 01 00 05 mvi r1,5 <== NOT EXECUTED
8004298: e0 00 00 3e bi 8004390 <rtems_fdisk_compact+0x20c> <== NOT EXECUTED
* 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)
800429c: 28 35 00 20 lw r21,(r1+32)
* 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);
80042a0: 28 21 00 1c lw r1,(r1+28)
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",
80042a4: 29 83 00 08 lw r3,(r12+8)
* 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)
80042a8: c8 15 a8 00 sub r21,r0,r21
* 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);
80042ac: ca a1 a8 00 sub r21,r21,r1
80042b0: 29 81 00 14 lw r1,(r12+20)
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",
80042b4: 29 84 00 0c lw r4,(r12+12)
80042b8: ba 00 10 00 mv r2,r16
* 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);
80042bc: b6 a1 a8 00 add r21,r21,r1
80042c0: 29 81 00 24 lw r1,(r12+36)
{
rtems_fdisk_error ("compacting: no available segments to compact too");
return EIO;
}
ssc = fd->used.head;
80042c4: 29 6d 00 40 lw r13,(r11+64)
dst_pages = rtems_fdisk_seg_pages_available (dsc);
segments = 0;
pages = 0;
80042c8: 5b 80 00 34 sw (sp+52),r0
* 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);
80042cc: ca a1 a8 00 sub r21,r21,r1
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",
80042d0: b9 60 08 00 mv r1,r11
80042d4: fb ff fa dc calli 8002e44 <rtems_fdisk_printf>
80042d8: 2b 85 00 34 lw r5,(sp+52)
return EIO;
}
ssc = fd->used.head;
dst_pages = rtems_fdisk_seg_pages_available (dsc);
segments = 0;
80042dc: 34 06 00 00 mvi r6,0
* 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 &&
80042e0: e0 00 00 04 bi 80042f0 <rtems_fdisk_compact+0x16c>
((pages + ssc->pages_active) < dst_pages) &&
((compacted_segs + segments) < fd->compact_segs))
{
pages += ssc->pages_active;
segments++;
ssc = ssc->next;
80042e4: 29 ad 00 00 lw r13,(r13+0)
while (ssc &&
((pages + ssc->pages_active) < dst_pages) &&
((compacted_segs + segments) < fd->compact_segs))
{
pages += ssc->pages_active;
segments++;
80042e8: 34 c6 00 01 addi r6,r6,1
while (ssc &&
((pages + ssc->pages_active) < dst_pages) &&
((compacted_segs + segments) < fd->compact_segs))
{
pages += ssc->pages_active;
80042ec: b8 40 28 00 mv r5,r2
* we handle during one compaction. A lower number means less aggressive
* compaction or less delay when compacting but it may mean the disk
* will fill.
*/
while (ssc &&
80042f0: 5d a0 00 03 bne r13,r0,80042fc <rtems_fdisk_compact+0x178>
80042f4: 5b 85 00 34 sw (sp+52),r5
80042f8: e0 00 00 0a bi 8004320 <rtems_fdisk_compact+0x19c>
((pages + ssc->pages_active) < dst_pages) &&
80042fc: 29 a2 00 1c lw r2,(r13+28)
8004300: b4 a2 10 00 add r2,r5,r2
* we handle during one compaction. A lower number means less aggressive
* compaction or less delay when compacting but it may mean the disk
* will fill.
*/
while (ssc &&
8004304: 50 55 00 31 bgeu r2,r21,80043c8 <rtems_fdisk_compact+0x244>
((pages + ssc->pages_active) < dst_pages) &&
8004308: 29 63 00 0c lw r3,(r11+12)
800430c: b4 ce 08 00 add r1,r6,r14
8004310: 54 61 ff f5 bgu r3,r1,80042e4 <rtems_fdisk_compact+0x160> <== ALWAYS TAKEN
8004314: e0 00 00 2d bi 80043c8 <rtems_fdisk_compact+0x244> <== NOT EXECUTED
* We need a source segment and have pages to copy and
* compacting one segment to another is silly. Compaction needs
* to free at least one more segment.
*/
if (!ssc || (pages == 0) || ((compacted_segs + segments) == 1))
8004318: b5 c6 70 00 add r14,r14,r6
800431c: 5d d4 00 07 bne r14,r20,8004338 <rtems_fdisk_compact+0x1b4>
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " nothing to compact");
8004320: 78 02 08 03 mvhi r2,0x803
8004324: b9 60 08 00 mv r1,r11
8004328: 38 42 59 14 ori r2,r2,0x5914
800432c: fb ff fa c6 calli 8002e44 <rtems_fdisk_printf>
}
compacted_segs += segments;
}
return 0;
8004330: 34 01 00 00 mvi r1,0
if (!ssc || (pages == 0) || ((compacted_segs + segments) == 1))
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " nothing to compact");
#endif
break;
8004334: e0 00 00 17 bi 8004390 <rtems_fdisk_compact+0x20c>
}
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " ssc scan: %d-%d: p=%ld, seg=%ld",
8004338: 29 a3 00 08 lw r3,(r13+8)
800433c: 29 a4 00 0c lw r4,(r13+12)
8004340: b9 e0 10 00 mv r2,r15
8004344: b9 60 08 00 mv r1,r11
8004348: fb ff fa bf calli 8002e44 <rtems_fdisk_printf>
ssc->device, ssc->segment,
pages, segments);
#endif
rtems_fdisk_segment_queue_remove (&fd->available, dsc);
800434c: ba 60 08 00 mv r1,r19
8004350: b9 80 10 00 mv r2,r12
8004354: fb ff fa 52 calli 8002c9c <rtems_fdisk_segment_queue_remove>
/*
* We now copy the pages to the new segment.
*/
while (pages)
8004358: e0 00 00 0a bi 8004380 <rtems_fdisk_compact+0x1fc>
{
ssc = rtems_fdisk_segment_queue_pop_head (&fd->used);
800435c: ba 40 08 00 mv r1,r18
8004360: fb ff fa 35 calli 8002c34 <rtems_fdisk_segment_queue_pop_head>
8004364: b8 20 10 00 mv r2,r1
if (ssc)
8004368: 44 20 00 06 be r1,r0,8004380 <rtems_fdisk_compact+0x1fc> <== NEVER TAKEN
{
ret = rtems_fdisk_recycle_segment (fd, ssc, dsc, &pages);
800436c: b9 60 08 00 mv r1,r11
8004370: b9 80 18 00 mv r3,r12
8004374: 37 84 00 34 addi r4,sp,52
8004378: fb ff fe 79 calli 8003d5c <rtems_fdisk_recycle_segment>
if (ret)
800437c: 5c 20 00 05 bne r1,r0,8004390 <rtems_fdisk_compact+0x20c> <== NEVER TAKEN
/*
* We now copy the pages to the new segment.
*/
while (pages)
8004380: 2b 81 00 34 lw r1,(sp+52)
8004384: 5c 20 ff f6 bne r1,r0,800435c <rtems_fdisk_compact+0x1d8>
rtems_fdisk_error ("compacting: nothing to recycle");
return EIO;
}
}
while (fd->used.head)
8004388: 29 61 00 40 lw r1,(r11+64)
800438c: 5c 20 ff b8 bne r1,r0,800426c <rtems_fdisk_compact+0xe8>
compacted_segs += segments;
}
return 0;
}
8004390: 2b 9d 00 04 lw ra,(sp+4)
8004394: 2b 8b 00 30 lw r11,(sp+48)
8004398: 2b 8c 00 2c lw r12,(sp+44)
800439c: 2b 8d 00 28 lw r13,(sp+40)
80043a0: 2b 8e 00 24 lw r14,(sp+36)
80043a4: 2b 8f 00 20 lw r15,(sp+32)
80043a8: 2b 90 00 1c lw r16,(sp+28)
80043ac: 2b 91 00 18 lw r17,(sp+24)
80043b0: 2b 92 00 14 lw r18,(sp+20)
80043b4: 2b 93 00 10 lw r19,(sp+16)
80043b8: 2b 94 00 0c lw r20,(sp+12)
80043bc: 2b 95 00 08 lw r21,(sp+8)
80043c0: 37 9c 00 34 addi sp,sp,52
80043c4: c3 a0 00 00 ret
rtems_fdisk_error ("compacting: nothing to recycle");
return EIO;
}
}
while (fd->used.head)
80043c8: 5b 85 00 34 sw (sp+52),r5
* 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))
80043cc: 5c a0 ff d3 bne r5,r0,8004318 <rtems_fdisk_compact+0x194>
80043d0: e3 ff ff d4 bi 8004320 <rtems_fdisk_compact+0x19c>
080035e4 <rtems_fdisk_erase_segment>:
/**
* Erase the segment.
*/
static int
rtems_fdisk_erase_segment (rtems_flashdisk* fd, rtems_fdisk_segment_ctl* sc)
{
80035e4: 37 9c ff e4 addi sp,sp,-28
80035e8: 5b 8b 00 1c sw (sp+28),r11
80035ec: 5b 8c 00 18 sw (sp+24),r12
80035f0: 5b 8d 00 14 sw (sp+20),r13
80035f4: 5b 8e 00 10 sw (sp+16),r14
80035f8: 5b 8f 00 0c sw (sp+12),r15
80035fc: 5b 90 00 08 sw (sp+8),r16
8003600: 5b 9d 00 04 sw (sp+4),ra
int ret;
uint32_t device;
uint32_t segment;
const rtems_fdisk_segment_desc* sd;
const rtems_fdisk_driver_handlers* ops;
device = sc->device;
8003604: 28 4d 00 08 lw r13,(r2+8)
segment = sc->segment;
8003608: 28 4e 00 0c lw r14,(r2+12)
/**
* Erase the segment.
*/
static int
rtems_fdisk_erase_segment (rtems_flashdisk* fd, rtems_fdisk_segment_ctl* sc)
{
800360c: b8 20 60 00 mv r12,r1
8003610: b8 40 58 00 mv r11,r2
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;
8003614: b9 a0 08 00 mv r1,r13
8003618: 34 02 00 01 mvi r2,1
800361c: fb ff f7 b1 calli 80014e0 <__ashlsi3>
8003620: b4 2d 08 00 add r1,r1,r13
8003624: 34 02 00 02 mvi r2,2
8003628: fb ff f7 ae calli 80014e0 <__ashlsi3>
800362c: 29 82 00 2c lw r2,(r12+44)
8003630: b4 41 10 00 add r2,r2,r1
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;
8003634: 28 41 00 08 lw r1,(r2+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;
8003638: 28 50 00 00 lw r16,(r2+0)
800363c: 34 02 00 30 mvi r2,48
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);
8003640: 28 2f 00 08 lw r15,(r1+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;
8003644: b9 c0 08 00 mv r1,r14
8003648: fb ff f7 f4 calli 8001618 <__mulsi3>
800364c: b6 01 10 00 add r2,r16,r1
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);
8003650: 28 41 00 04 lw r1,(r2+4)
8003654: 29 e4 00 10 lw r4,(r15+16)
8003658: b9 a0 10 00 mv r2,r13
800365c: b9 c0 18 00 mv r3,r14
8003660: d8 80 00 00 call r4
8003664: b8 20 68 00 mv r13,r1
if (ret)
8003668: 44 20 00 13 be r1,r0,80036b4 <rtems_fdisk_erase_segment+0xd0><== ALWAYS TAKEN
{
rtems_fdisk_error (" erase-segment:%02d-%03d: " \
800366c: 29 6f 00 08 lw r15,(r11+8) <== NOT EXECUTED
8003670: 29 6e 00 0c lw r14,(r11+12) <== NOT EXECUTED
8003674: f8 00 80 bb calli 8023960 <strerror> <== NOT EXECUTED
8003678: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
800367c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8003680: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
8003684: 38 21 55 48 ori r1,r1,0x5548 <== NOT EXECUTED
8003688: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
800368c: b9 a0 28 00 mv r5,r13 <== NOT EXECUTED
8003690: fb ff ff 4a calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
"segment erase failed: %s (%d)",
sc->device, sc->segment, strerror (ret), ret);
sc->failed = true;
8003694: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
8003698: 59 61 00 28 sw (r11+40),r1 <== NOT EXECUTED
if (!rtems_fdisk_segment_queue_present (&fd->failed, sc))
800369c: 29 81 00 58 lw r1,(r12+88) <== NOT EXECUTED
80036a0: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
80036a4: fb ff ff 97 calli 8003500 <rtems_fdisk_segment_queue_present.clone.2><== NOT EXECUTED
80036a8: 5c 20 00 18 bne r1,r0,8003708 <rtems_fdisk_erase_segment+0x124><== NOT EXECUTED
rtems_fdisk_segment_queue_push_tail (&fd->failed, sc);
80036ac: 35 81 00 58 addi r1,r12,88 <== NOT EXECUTED
80036b0: e0 00 00 14 bi 8003700 <rtems_fdisk_erase_segment+0x11c> <== NOT EXECUTED
return ret;
}
fd->erased_blocks += sc->pages;
80036b4: 29 82 00 28 lw r2,(r12+40)
80036b8: 29 61 00 14 lw r1,(r11+20)
80036bc: b4 41 08 00 add r1,r2,r1
80036c0: 59 81 00 28 sw (r12+40),r1
sc->erased++;
80036c4: 29 61 00 2c lw r1,(r11+44)
memset (sc->page_descriptors, 0xff, sc->pages_desc * fd->block_size);
80036c8: 29 62 00 18 lw r2,(r11+24)
rtems_fdisk_segment_queue_push_tail (&fd->failed, sc);
return ret;
}
fd->erased_blocks += sc->pages;
sc->erased++;
80036cc: 34 21 00 01 addi r1,r1,1
80036d0: 59 61 00 2c sw (r11+44),r1
memset (sc->page_descriptors, 0xff, sc->pages_desc * fd->block_size);
80036d4: 29 81 00 14 lw r1,(r12+20)
80036d8: fb ff f7 d0 calli 8001618 <__mulsi3>
80036dc: b8 20 18 00 mv r3,r1
80036e0: 29 61 00 10 lw r1,(r11+16)
80036e4: 34 02 00 ff mvi r2,255
80036e8: f8 00 7b 47 calli 8022404 <memset>
/*
* Push to the tail of the available queue. It is a very
* simple type of wear reduction. Every other available
* segment will now get a go.
*/
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
80036ec: 35 81 00 34 addi r1,r12,52
fd->erased_blocks += sc->pages;
sc->erased++;
memset (sc->page_descriptors, 0xff, sc->pages_desc * fd->block_size);
sc->pages_active = 0;
80036f0: 59 60 00 1c sw (r11+28),r0
sc->pages_used = 0;
80036f4: 59 60 00 20 sw (r11+32),r0
sc->pages_bad = 0;
80036f8: 59 60 00 24 sw (r11+36),r0
sc->failed = false;
80036fc: 59 60 00 28 sw (r11+40),r0
/*
* Push to the tail of the available queue. It is a very
* simple type of wear reduction. Every other available
* segment will now get a go.
*/
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
8003700: b9 60 10 00 mv r2,r11
8003704: fb ff fd 58 calli 8002c64 <rtems_fdisk_segment_queue_push_tail>
return 0;
}
8003708: b9 a0 08 00 mv r1,r13
800370c: 2b 9d 00 04 lw ra,(sp+4)
8003710: 2b 8b 00 1c lw r11,(sp+28)
8003714: 2b 8c 00 18 lw r12,(sp+24)
8003718: 2b 8d 00 14 lw r13,(sp+20)
800371c: 2b 8e 00 10 lw r14,(sp+16)
8003720: 2b 8f 00 0c lw r15,(sp+12)
8003724: 2b 90 00 08 lw r16,(sp+8)
8003728: 37 9c 00 1c addi sp,sp,28
800372c: c3 a0 00 00 ret
080033b8 <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, ...)
{
80033b8: 37 9c ff d4 addi sp,sp,-44 <== NOT EXECUTED
80033bc: 5b 8b 00 0c sw (sp+12),r11 <== NOT EXECUTED
80033c0: 5b 8c 00 08 sw (sp+8),r12 <== NOT EXECUTED
80033c4: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
int ret;
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:error:");
80033c8: 78 0b 08 03 mvhi r11,0x803 <== NOT EXECUTED
80033cc: 39 6b b2 90 ori r11,r11,0xb290 <== 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, ...)
{
80033d0: 5b 82 00 14 sw (sp+20),r2 <== NOT EXECUTED
int ret;
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:error:");
80033d4: 29 62 00 00 lw r2,(r11+0) <== 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, ...)
{
80033d8: 5b 84 00 1c sw (sp+28),r4 <== NOT EXECUTED
80033dc: 5b 85 00 20 sw (sp+32),r5 <== NOT EXECUTED
80033e0: 5b 86 00 24 sw (sp+36),r6 <== NOT EXECUTED
80033e4: 5b 87 00 28 sw (sp+40),r7 <== NOT EXECUTED
80033e8: 5b 88 00 2c sw (sp+44),r8 <== NOT EXECUTED
80033ec: 5b 81 00 10 sw (sp+16),r1 <== NOT EXECUTED
80033f0: 5b 83 00 18 sw (sp+24),r3 <== NOT EXECUTED
int ret;
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:error:");
80033f4: 28 42 00 0c lw r2,(r2+12) <== NOT EXECUTED
80033f8: 78 03 08 03 mvhi r3,0x803 <== 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, ...)
{
80033fc: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
int ret;
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:error:");
8003400: b8 60 08 00 mv r1,r3 <== NOT EXECUTED
8003404: 38 21 55 28 ori r1,r1,0x5528 <== NOT EXECUTED
8003408: f8 00 79 22 calli 8021890 <fputs> <== NOT EXECUTED
ret = vfprintf (stderr, format, args);
800340c: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED
8003410: 37 83 00 14 addi r3,sp,20 <== NOT EXECUTED
8003414: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
8003418: 28 21 00 0c lw r1,(r1+12) <== NOT EXECUTED
800341c: f8 00 9a 97 calli 8029e78 <vfprintf> <== NOT EXECUTED
fprintf (stderr, "\n");
8003420: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED
{
int ret;
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:error:");
ret = vfprintf (stderr, format, args);
8003424: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
fprintf (stderr, "\n");
8003428: 34 01 00 0a mvi r1,10 <== NOT EXECUTED
800342c: 28 42 00 0c lw r2,(r2+12) <== NOT EXECUTED
8003430: f8 00 78 d4 calli 8021780 <fputc> <== NOT EXECUTED
fflush (stderr);
8003434: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED
8003438: 28 21 00 0c lw r1,(r1+12) <== NOT EXECUTED
800343c: f8 00 77 43 calli 8021148 <fflush> <== NOT EXECUTED
va_end (args);
return ret;
}
8003440: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8003444: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8003448: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED
800344c: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED
8003450: 37 9c 00 2c addi sp,sp,44 <== NOT EXECUTED
8003454: c3 a0 00 00 ret <== NOT EXECUTED
08002d94 <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, ...)
{
8002d94: 37 9c ff d4 addi sp,sp,-44
8002d98: 5b 8b 00 10 sw (sp+16),r11
8002d9c: 5b 8c 00 0c sw (sp+12),r12
8002da0: 5b 8d 00 08 sw (sp+8),r13
8002da4: 5b 9d 00 04 sw (sp+4),ra
8002da8: 5b 82 00 14 sw (sp+20),r2
8002dac: 5b 83 00 18 sw (sp+24),r3
8002db0: 5b 84 00 1c sw (sp+28),r4
8002db4: 5b 85 00 20 sw (sp+32),r5
8002db8: 5b 86 00 24 sw (sp+36),r6
8002dbc: 5b 87 00 28 sw (sp+40),r7
8002dc0: 5b 88 00 2c sw (sp+44),r8
int ret = 0;
if (fd->info_level >= 2)
8002dc4: 28 21 00 6c lw r1,(r1+108)
* @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, ...)
{
8002dc8: b8 40 68 00 mv r13,r2
int ret = 0;
if (fd->info_level >= 2)
8002dcc: 34 02 00 01 mvi r2,1
* @return int The number of bytes written to the output.
*/
static int
rtems_fdisk_info (const rtems_flashdisk* fd, const char *format, ...)
{
int ret = 0;
8002dd0: 34 0c 00 00 mvi r12,0
if (fd->info_level >= 2)
8002dd4: 50 41 00 15 bgeu r2,r1,8002e28 <rtems_fdisk_info+0x94> <== ALWAYS TAKEN
{
va_list args;
va_start (args, format);
fprintf (stdout, "fdisk:");
8002dd8: 78 0b 08 03 mvhi r11,0x803 <== NOT EXECUTED
8002ddc: 39 6b b2 90 ori r11,r11,0xb290 <== NOT EXECUTED
8002de0: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED
8002de4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8002de8: 38 21 54 a4 ori r1,r1,0x54a4 <== NOT EXECUTED
8002dec: 28 42 00 08 lw r2,(r2+8) <== NOT EXECUTED
8002df0: f8 00 7a a8 calli 8021890 <fputs> <== NOT EXECUTED
ret = vfprintf (stdout, format, args);
8002df4: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED
8002df8: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
8002dfc: 37 83 00 18 addi r3,sp,24 <== NOT EXECUTED
8002e00: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED
8002e04: f8 00 9c 1d calli 8029e78 <vfprintf> <== NOT EXECUTED
fprintf (stdout, "\n");
8002e08: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED
if (fd->info_level >= 2)
{
va_list args;
va_start (args, format);
fprintf (stdout, "fdisk:");
ret = vfprintf (stdout, format, args);
8002e0c: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
fprintf (stdout, "\n");
8002e10: 34 01 00 0a mvi r1,10 <== NOT EXECUTED
8002e14: 28 42 00 08 lw r2,(r2+8) <== NOT EXECUTED
8002e18: f8 00 7a 5a calli 8021780 <fputc> <== NOT EXECUTED
fflush (stdout);
8002e1c: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED
8002e20: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED
8002e24: f8 00 78 c9 calli 8021148 <fflush> <== NOT EXECUTED
va_end (args);
}
return ret;
}
8002e28: b9 80 08 00 mv r1,r12
8002e2c: 2b 9d 00 04 lw ra,(sp+4)
8002e30: 2b 8b 00 10 lw r11,(sp+16)
8002e34: 2b 8c 00 0c lw r12,(sp+12)
8002e38: 2b 8d 00 08 lw r13,(sp+8)
8002e3c: 37 9c 00 2c addi sp,sp,44
8002e40: c3 a0 00 00 ret
08005504 <rtems_fdisk_initialize>:
*/
rtems_device_driver
rtems_fdisk_initialize (rtems_device_major_number major,
rtems_device_minor_number minor,
void* arg __attribute__((unused)))
{
8005504: 37 9c ff a0 addi sp,sp,-96
8005508: 5b 8b 00 44 sw (sp+68),r11
800550c: 5b 8c 00 40 sw (sp+64),r12
8005510: 5b 8d 00 3c sw (sp+60),r13
8005514: 5b 8e 00 38 sw (sp+56),r14
8005518: 5b 8f 00 34 sw (sp+52),r15
800551c: 5b 90 00 30 sw (sp+48),r16
8005520: 5b 91 00 2c sw (sp+44),r17
8005524: 5b 92 00 28 sw (sp+40),r18
8005528: 5b 93 00 24 sw (sp+36),r19
800552c: 5b 94 00 20 sw (sp+32),r20
8005530: 5b 95 00 1c sw (sp+28),r21
8005534: 5b 96 00 18 sw (sp+24),r22
8005538: 5b 97 00 14 sw (sp+20),r23
800553c: 5b 98 00 10 sw (sp+16),r24
8005540: 5b 99 00 0c sw (sp+12),r25
8005544: 5b 9b 00 08 sw (sp+8),fp
8005548: 5b 9d 00 04 sw (sp+4),ra
800554c: b8 20 78 00 mv r15,r1
const rtems_flashdisk_config* c = rtems_flashdisk_configuration;
rtems_flashdisk* fd;
rtems_status_code sc;
sc = rtems_disk_io_initialize ();
8005550: fb ff f5 47 calli 8002a6c <rtems_disk_io_initialize>
8005554: b8 20 58 00 mv r11,r1
if (sc != RTEMS_SUCCESSFUL)
8005558: b8 20 18 00 mv r3,r1
800555c: 5c 20 01 21 bne r1,r0,80059e0 <rtems_fdisk_initialize+0x4dc><== NEVER TAKEN
static rtems_status_code
rtems_fdisk_crc16_gen_factors (uint16_t pattern)
{
uint32_t b;
rtems_fdisk_crc16_factor = malloc (sizeof (uint16_t) * 256);
8005560: 34 01 02 00 mvi r1,512
8005564: f8 00 05 b5 calli 8006c38 <malloc>
8005568: 78 02 08 04 mvhi r2,0x804
800556c: 38 42 b7 e0 ori r2,r2,0xb7e0
8005570: 58 41 00 00 sw (r2+0),r1
if (!rtems_fdisk_crc16_factor)
return RTEMS_NO_MEMORY;
8005574: 34 03 00 1a mvi r3,26
rtems_fdisk_crc16_gen_factors (uint16_t pattern)
{
uint32_t b;
rtems_fdisk_crc16_factor = malloc (sizeof (uint16_t) * 256);
if (!rtems_fdisk_crc16_factor)
8005578: 44 2b 01 1a be r1,r11,80059e0 <rtems_fdisk_initialize+0x4dc><== NEVER TAKEN
800557c: b8 20 60 00 mv r12,r1
return RTEMS_NO_MEMORY;
for (b = 0; b < 256; b++)
8005580: 34 0e 01 00 mvi r14,256
rtems_fdisk_crc16_gen_factors (uint16_t pattern)
{
uint32_t b;
rtems_fdisk_crc16_factor = malloc (sizeof (uint16_t) * 256);
if (!rtems_fdisk_crc16_factor)
8005584: 21 62 ff ff andi r2,r11,0xffff
8005588: 34 0d 00 09 mvi r13,9
800558c: e0 00 00 0d bi 80055c0 <rtems_fdisk_initialize+0xbc>
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;
8005590: 20 41 00 01 andi r1,r2,0x1
8005594: 44 20 00 07 be r1,r0,80055b0 <rtems_fdisk_initialize+0xac>
8005598: b8 40 08 00 mv r1,r2
800559c: 34 02 00 01 mvi r2,1
80055a0: fb ff ef f7 calli 800157c <__lshrsi3>
80055a4: 20 21 ff ff andi r1,r1,0xffff
80055a8: 18 22 84 08 xori r2,r1,0x8408
80055ac: e0 00 00 05 bi 80055c0 <rtems_fdisk_initialize+0xbc>
80055b0: b8 40 08 00 mv r1,r2
80055b4: 34 02 00 01 mvi r2,1
80055b8: fb ff ef f1 calli 800157c <__lshrsi3>
80055bc: 20 22 ff ff andi r2,r1,0xffff
80055c0: 35 ad ff ff addi r13,r13,-1
for (b = 0; b < 256; b++)
{
uint32_t i;
uint16_t v = b;
for (i = 8; i--;)
80055c4: 5d a0 ff f3 bne r13,r0,8005590 <rtems_fdisk_initialize+0x8c>
v = v & 1 ? (v >> 1) ^ pattern : v >> 1;
rtems_fdisk_crc16_factor[b] = v & 0xffff;
80055c8: 0d 82 00 00 sh (r12+0),r2
rtems_fdisk_crc16_factor = malloc (sizeof (uint16_t) * 256);
if (!rtems_fdisk_crc16_factor)
return RTEMS_NO_MEMORY;
for (b = 0; b < 256; b++)
80055cc: 35 6b 00 01 addi r11,r11,1
80055d0: 35 8c 00 02 addi r12,r12,2
80055d4: 5d 6e ff ec bne r11,r14,8005584 <rtems_fdisk_initialize+0x80>
80055d8: e0 00 01 16 bi 8005a30 <rtems_fdisk_initialize+0x52c>
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";
80055dc: 29 c1 00 04 lw r1,(r14+4)
80055e0: 29 c2 00 00 lw r2,(r14+0)
dev_t dev = rtems_filesystem_make_dev_t (major, minor);
uint32_t device;
uint32_t blocks = 0;
int ret;
fd = &rtems_flashdisks[minor];
80055e4: 2b 6b 00 00 lw r11,(fp+0)
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";
80055e8: 5b 81 00 5c sw (sp+92),r1
80055ec: 5b 82 00 58 sw (sp+88),r2
80055f0: 2d c1 00 08 lhu r1,(r14+8)
dev_t dev = rtems_filesystem_make_dev_t (major, minor);
uint32_t device;
uint32_t blocks = 0;
int ret;
fd = &rtems_flashdisks[minor];
80055f4: b5 76 58 00 add r11,r11,r22
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++)
80055f8: 34 13 00 00 mvi r19,0
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";
80055fc: 0f 81 00 60 sh (sp+96),r1
uint32_t blocks = 0;
int ret;
fd = &rtems_flashdisks[minor];
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
8005600: b5 a1 08 00 add r1,r13,r1
8005604: 33 81 00 61 sb (sp+97),r1
fd->major = major;
8005608: 59 6f 00 00 sw (r11+0),r15
fd->minor = minor;
800560c: 59 6d 00 04 sw (r11+4),r13
fd->flags = c->flags;
8005610: 29 81 00 0c lw r1,(r12+12)
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;
8005614: 34 10 00 00 mvi r16,0
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++)
8005618: 34 12 00 00 mvi r18,0
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
fd->major = major;
fd->minor = minor;
fd->flags = c->flags;
800561c: 59 61 00 08 sw (r11+8),r1
fd->compact_segs = c->compact_segs;
8005620: 29 81 00 14 lw r1,(r12+20)
8005624: 59 61 00 0c sw (r11+12),r1
fd->avail_compact_segs = c->avail_compact_segs;
8005628: 29 81 00 18 lw r1,(r12+24)
800562c: 59 61 00 10 sw (r11+16),r1
fd->block_size = c->block_size;
8005630: 29 91 00 00 lw r17,(r12+0)
8005634: 59 71 00 14 sw (r11+20),r17
fd->unavail_blocks = c->unavail_blocks;
8005638: 29 81 00 10 lw r1,(r12+16)
800563c: 59 61 00 20 sw (r11+32),r1
fd->info_level = c->info_level;
8005640: 29 81 00 1c lw r1,(r12+28)
8005644: 59 61 00 6c sw (r11+108),r1
for (device = 0; device < c->device_count; device++)
8005648: 29 81 00 04 lw r1,(r12+4)
800564c: 5b 81 00 54 sw (sp+84),r1
8005650: e0 00 00 23 bi 80056dc <rtems_fdisk_initialize+0x1d8>
blocks += rtems_fdisk_blocks_in_device (&c->devices[device],
8005654: 29 99 00 08 lw r25,(r12+8)
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++)
8005658: 34 18 00 00 mvi r24,0
800565c: 34 17 00 00 mvi r23,0
fd->block_size = c->block_size;
fd->unavail_blocks = c->unavail_blocks;
fd->info_level = c->info_level;
for (device = 0; device < c->device_count; device++)
blocks += rtems_fdisk_blocks_in_device (&c->devices[device],
8005660: b7 33 c8 00 add r25,r25,r19
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++)
8005664: 2b 24 00 00 lw r4,(r25+0)
*/
static uint32_t
rtems_fdisk_blocks_in_device (const rtems_fdisk_device_desc* dd,
uint32_t page_size)
{
uint32_t count = 0;
8005668: 34 14 00 00 mvi r20,0
800566c: e0 00 00 18 bi 80056cc <rtems_fdisk_initialize+0x1c8>
uint32_t s;
for (s = 0; s < dd->segment_count; s++)
{
const rtems_fdisk_segment_desc* sd = &dd->segments[s];
8005670: 2b 23 00 04 lw r3,(r25+4)
*/
static uint32_t
rtems_fdisk_pages_in_segment (const rtems_fdisk_segment_desc* sd,
uint32_t page_size)
{
return sd->size / page_size;
8005674: ba 20 10 00 mv r2,r17
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++)
8005678: 36 f7 00 01 addi r23,r23,1
{
const rtems_fdisk_segment_desc* sd = &dd->segments[s];
800567c: b4 78 18 00 add r3,r3,r24
*/
static uint32_t
rtems_fdisk_pages_in_segment (const rtems_fdisk_segment_desc* sd,
uint32_t page_size)
{
return sd->size / page_size;
8005680: 28 61 00 08 lw r1,(r3+8)
8005684: 5b 84 00 48 sw (sp+72),r4
8005688: 5b 83 00 4c sw (sp+76),r3
800568c: fb ff ef ef calli 8001648 <__udivsi3>
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;
8005690: 34 25 ff ff addi r5,r1,-1
static uint32_t
rtems_fdisk_page_desc_pages (const rtems_fdisk_segment_desc* sd,
uint32_t page_size)
{
uint32_t pages = rtems_fdisk_pages_in_segment (sd, page_size);
uint32_t bytes = pages * sizeof (rtems_fdisk_page_desc);
8005694: 34 02 00 03 mvi r2,3
8005698: 5b 85 00 50 sw (sp+80),r5
800569c: fb ff ef 91 calli 80014e0 <__ashlsi3>
return ((bytes - 1) / page_size) + 1;
80056a0: ba 20 10 00 mv r2,r17
80056a4: 34 21 ff ff addi r1,r1,-1
80056a8: fb ff ef e8 calli 8001648 <__udivsi3>
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) -
rtems_fdisk_page_desc_pages (sd, page_size)) * sd->count;
80056ac: 2b 83 00 4c lw r3,(sp+76)
80056b0: 2b 85 00 50 lw r5,(sp+80)
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++)
80056b4: 37 18 00 0c addi r24,r24,12
{
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;
80056b8: 2c 62 00 00 lhu r2,(r3+0)
80056bc: c8 a1 08 00 sub r1,r5,r1
80056c0: fb ff ef d6 calli 8001618 <__mulsi3>
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++)
80056c4: 2b 84 00 48 lw r4,(sp+72)
{
const rtems_fdisk_segment_desc* sd = &dd->segments[s];
count +=
80056c8: b6 81 a0 00 add r20,r20,r1
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++)
80056cc: 54 97 ff e9 bgu r4,r23,8005670 <rtems_fdisk_initialize+0x16c>
fd->block_size = c->block_size;
fd->unavail_blocks = c->unavail_blocks;
fd->info_level = c->info_level;
for (device = 0; device < c->device_count; device++)
blocks += rtems_fdisk_blocks_in_device (&c->devices[device],
80056d0: b6 14 80 00 add r16,r16,r20
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++)
80056d4: 36 52 00 01 addi r18,r18,1
80056d8: 36 73 00 0c addi r19,r19,12
80056dc: 2b 82 00 54 lw r2,(sp+84)
80056e0: 54 52 ff dd bgu r2,r18,8005654 <rtems_fdisk_initialize+0x150>
c->block_size);
/*
* One copy buffer of a page size.
*/
fd->copy_buffer = malloc (c->block_size);
80056e4: ba 20 08 00 mv r1,r17
80056e8: f8 00 05 54 calli 8006c38 <malloc>
80056ec: 59 61 00 68 sw (r11+104),r1
if (!fd->copy_buffer)
80056f0: 44 20 00 bb be r1,r0,80059dc <rtems_fdisk_initialize+0x4d8><== NEVER TAKEN
return RTEMS_NO_MEMORY;
fd->blocks = calloc (blocks, sizeof (rtems_fdisk_block_ctl));
80056f4: ba 00 08 00 mv r1,r16
80056f8: 34 02 00 08 mvi r2,8
80056fc: f8 00 02 e6 calli 8006294 <calloc>
8005700: 59 61 00 18 sw (r11+24),r1
if (!fd->blocks)
8005704: 44 20 00 b6 be r1,r0,80059dc <rtems_fdisk_initialize+0x4d8><== NEVER TAKEN
return RTEMS_NO_MEMORY;
fd->block_count = blocks;
fd->devices = calloc (c->device_count, sizeof (rtems_fdisk_device_ctl));
8005708: 2b 81 00 54 lw r1,(sp+84)
fd->blocks = calloc (blocks, sizeof (rtems_fdisk_block_ctl));
if (!fd->blocks)
return RTEMS_NO_MEMORY;
fd->block_count = blocks;
800570c: 59 70 00 1c sw (r11+28),r16
fd->devices = calloc (c->device_count, sizeof (rtems_fdisk_device_ctl));
8005710: 34 02 00 0c mvi r2,12
8005714: f8 00 02 e0 calli 8006294 <calloc>
8005718: 59 61 00 2c sw (r11+44),r1
if (!fd->devices)
800571c: 44 20 00 b0 be r1,r0,80059dc <rtems_fdisk_initialize+0x4d8><== NEVER TAKEN
return RTEMS_NO_MEMORY;
sc = rtems_semaphore_create (rtems_build_name ('F', 'D', 'S', 'K'), 1,
8005720: 78 02 08 03 mvhi r2,0x803
8005724: 38 42 5f b8 ori r2,r2,0x5fb8
8005728: 28 41 00 00 lw r1,(r2+0)
800572c: 34 03 00 54 mvi r3,84
8005730: 34 02 00 01 mvi r2,1
8005734: 34 04 00 00 mvi r4,0
8005738: 35 65 00 64 addi r5,r11,100
800573c: f8 00 0e 50 calli 800907c <rtems_semaphore_create>
8005740: b8 20 88 00 mv r17,r1
RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE |
RTEMS_INHERIT_PRIORITY, 0, &fd->lock);
if (sc != RTEMS_SUCCESSFUL)
8005744: 44 20 00 0b be r1,r0,8005770 <rtems_fdisk_initialize+0x26c><== ALWAYS TAKEN
{
rtems_fdisk_error ("disk lock create failed");
8005748: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800574c: 38 21 5f 28 ori r1,r1,0x5f28 <== NOT EXECUTED
8005750: fb ff f7 1a calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
free (fd->copy_buffer);
8005754: 29 61 00 68 lw r1,(r11+104) <== NOT EXECUTED
8005758: f8 00 03 4d calli 800648c <free> <== NOT EXECUTED
free (fd->blocks);
800575c: 29 61 00 18 lw r1,(r11+24) <== NOT EXECUTED
8005760: f8 00 03 4b calli 800648c <free> <== NOT EXECUTED
free (fd->devices);
8005764: 29 61 00 2c lw r1,(r11+44) <== NOT EXECUTED
8005768: f8 00 03 49 calli 800648c <free> <== NOT EXECUTED
800576c: e0 00 00 8f bi 80059a8 <rtems_fdisk_initialize+0x4a4> <== NOT EXECUTED
return sc;
}
sc = rtems_disk_create_phys(dev, c->block_size,
8005770: 29 64 00 20 lw r4,(r11+32)
8005774: 29 83 00 00 lw r3,(r12+0)
8005778: b9 e0 08 00 mv r1,r15
800577c: ca 04 20 00 sub r4,r16,r4
8005780: b9 a0 10 00 mv r2,r13
8005784: ba a0 28 00 mv r5,r21
8005788: 34 06 00 00 mvi r6,0
800578c: 37 87 00 58 addi r7,sp,88
8005790: fb ff f3 eb calli 800273c <rtems_disk_create_phys>
8005794: b8 20 80 00 mv r16,r1
blocks - fd->unavail_blocks,
rtems_fdisk_ioctl, NULL, name);
if (sc != RTEMS_SUCCESSFUL)
8005798: 5c 31 00 04 bne r1,r17,80057a8 <rtems_fdisk_initialize+0x2a4><== NEVER TAKEN
800579c: 34 13 00 00 mvi r19,0
80057a0: 34 12 00 00 mvi r18,0
80057a4: e0 00 00 4f bi 80058e0 <rtems_fdisk_initialize+0x3dc>
{
rtems_semaphore_delete (fd->lock);
80057a8: 29 61 00 64 lw r1,(r11+100) <== NOT EXECUTED
80057ac: f8 00 0e b1 calli 8009270 <rtems_semaphore_delete> <== NOT EXECUTED
rtems_disk_delete (dev);
80057b0: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
80057b4: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
80057b8: fb ff f3 0d calli 80023ec <rtems_disk_delete> <== NOT EXECUTED
free (fd->copy_buffer);
80057bc: 29 61 00 68 lw r1,(r11+104) <== NOT EXECUTED
80057c0: f8 00 03 33 calli 800648c <free> <== NOT EXECUTED
free (fd->blocks);
80057c4: 29 61 00 18 lw r1,(r11+24) <== NOT EXECUTED
80057c8: f8 00 03 31 calli 800648c <free> <== NOT EXECUTED
free (fd->devices);
80057cc: 29 61 00 2c lw r1,(r11+44) <== NOT EXECUTED
80057d0: f8 00 03 2f calli 800648c <free> <== NOT EXECUTED
rtems_fdisk_error ("disk create phy failed");
80057d4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
80057d8: 38 21 5f 40 ori r1,r1,0x5f40 <== NOT EXECUTED
80057dc: fb ff f6 f7 calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
80057e0: e0 00 00 59 bi 8005944 <rtems_fdisk_initialize+0x440> <== NOT EXECUTED
{
rtems_fdisk_segment_ctl* sc;
uint32_t segment_count;
uint32_t segment;
segment_count = rtems_fdisk_count_segments (&c->devices[device]);
80057e4: 29 90 00 08 lw r16,(r12+8)
static uint32_t
rtems_fdisk_count_segments (const rtems_fdisk_device_desc* dd)
{
uint32_t count = 0;
uint32_t segment;
for (segment = 0; segment < dd->segment_count; segment++)
80057e8: 34 03 00 00 mvi r3,0
* Count the segments for a device.
*/
static uint32_t
rtems_fdisk_count_segments (const rtems_fdisk_device_desc* dd)
{
uint32_t count = 0;
80057ec: 34 14 00 00 mvi r20,0
{
rtems_fdisk_segment_ctl* sc;
uint32_t segment_count;
uint32_t segment;
segment_count = rtems_fdisk_count_segments (&c->devices[device]);
80057f0: b6 13 80 00 add r16,r16,r19
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++)
80057f4: 2a 01 00 00 lw r1,(r16+0)
80057f8: 5b 81 00 54 sw (sp+84),r1
80057fc: 34 01 00 00 mvi r1,0
8005800: e0 00 00 07 bi 800581c <rtems_fdisk_initialize+0x318>
count += dd->segments[segment].count;
8005804: 2a 02 00 04 lw r2,(r16+4)
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++)
8005808: 34 21 00 01 addi r1,r1,1
count += dd->segments[segment].count;
800580c: b4 43 10 00 add r2,r2,r3
8005810: 2c 42 00 00 lhu r2,(r2+0)
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++)
8005814: 34 63 00 0c addi r3,r3,12
count += dd->segments[segment].count;
8005818: b6 82 a0 00 add r20,r20,r2
static uint32_t
rtems_fdisk_count_segments (const rtems_fdisk_device_desc* dd)
{
uint32_t count = 0;
uint32_t segment;
for (segment = 0; segment < dd->segment_count; segment++)
800581c: 2b 82 00 54 lw r2,(sp+84)
8005820: 54 41 ff f9 bgu r2,r1,8005804 <rtems_fdisk_initialize+0x300>
uint32_t segment_count;
uint32_t segment;
segment_count = rtems_fdisk_count_segments (&c->devices[device]);
fd->devices[device].segments = calloc (segment_count,
8005824: 29 77 00 2c lw r23,(r11+44)
8005828: ba 80 08 00 mv r1,r20
800582c: 34 02 00 30 mvi r2,48
8005830: f8 00 02 99 calli 8006294 <calloc>
8005834: b6 f3 b8 00 add r23,r23,r19
8005838: 5a e1 00 00 sw (r23+0),r1
800583c: b8 20 88 00 mv r17,r1
sizeof (rtems_fdisk_segment_ctl));
if (!fd->devices[device].segments)
8005840: 44 20 00 04 be r1,r0,8005850 <rtems_fdisk_initialize+0x34c><== NEVER TAKEN
8005844: 34 19 00 00 mvi r25,0
8005848: 34 18 00 00 mvi r24,0
800584c: e0 00 00 1f bi 80058c8 <rtems_fdisk_initialize+0x3c4>
{
rtems_disk_delete (dev);
8005850: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
8005854: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
8005858: fb ff f2 e5 calli 80023ec <rtems_disk_delete> <== NOT EXECUTED
rtems_semaphore_delete (fd->lock);
800585c: 29 61 00 64 lw r1,(r11+100) <== NOT EXECUTED
8005860: f8 00 0e 84 calli 8009270 <rtems_semaphore_delete> <== NOT EXECUTED
free (fd->copy_buffer);
8005864: 29 61 00 68 lw r1,(r11+104) <== NOT EXECUTED
8005868: f8 00 03 09 calli 800648c <free> <== NOT EXECUTED
free (fd->blocks);
800586c: 29 61 00 18 lw r1,(r11+24) <== NOT EXECUTED
8005870: f8 00 03 07 calli 800648c <free> <== NOT EXECUTED
free (fd->devices);
8005874: 29 61 00 2c lw r1,(r11+44) <== NOT EXECUTED
8005878: f8 00 03 05 calli 800648c <free> <== NOT EXECUTED
800587c: e0 00 00 58 bi 80059dc <rtems_fdisk_initialize+0x4d8> <== NOT EXECUTED
for (segment = 0; segment < c->devices[device].segment_count; segment++)
{
const rtems_fdisk_segment_desc* sd;
uint32_t seg_segment;
sd = &c->devices[device].segments[segment];
8005880: 2a 04 00 04 lw r4,(r16+4)
for (seg_segment = 0; seg_segment < sd->count; seg_segment++, sc++)
8005884: ba 20 10 00 mv r2,r17
8005888: 34 03 00 00 mvi r3,0
for (segment = 0; segment < c->devices[device].segment_count; segment++)
{
const rtems_fdisk_segment_desc* sd;
uint32_t seg_segment;
sd = &c->devices[device].segments[segment];
800588c: b4 99 20 00 add r4,r4,r25
for (seg_segment = 0; seg_segment < sd->count; seg_segment++, sc++)
8005890: 2c 81 00 00 lhu r1,(r4+0)
8005894: e0 00 00 07 bi 80058b0 <rtems_fdisk_initialize+0x3ac>
{
sc->descriptor = sd;
sc->device = device;
sc->segment = seg_segment;
8005898: 58 43 00 0c sw (r2+12),r3
sd = &c->devices[device].segments[segment];
for (seg_segment = 0; seg_segment < sd->count; seg_segment++, sc++)
{
sc->descriptor = sd;
800589c: 58 44 00 04 sw (r2+4),r4
sc->device = device;
80058a0: 58 52 00 08 sw (r2+8),r18
sc->segment = seg_segment;
sc->erased = 0;
80058a4: 58 40 00 2c sw (r2+44),r0
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++)
80058a8: 34 63 00 01 addi r3,r3,1
80058ac: 34 42 00 30 addi r2,r2,48
80058b0: 54 23 ff fa bgu r1,r3,8005898 <rtems_fdisk_initialize+0x394>
* @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,
80058b4: 34 02 00 30 mvi r2,48
80058b8: fb ff ef 58 calli 8001618 <__mulsi3>
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++)
80058bc: b6 21 88 00 add r17,r17,r1
return RTEMS_NO_MEMORY;
}
sc = fd->devices[device].segments;
for (segment = 0; segment < c->devices[device].segment_count; segment++)
80058c0: 37 18 00 01 addi r24,r24,1
80058c4: 37 39 00 0c addi r25,r25,12
80058c8: 2b 81 00 54 lw r1,(sp+84)
80058cc: 54 38 ff ed bgu r1,r24,8005880 <rtems_fdisk_initialize+0x37c>
sc->segment = seg_segment;
sc->erased = 0;
}
}
fd->devices[device].segment_count = segment_count;
80058d0: 5a f4 00 04 sw (r23+4),r20
fd->devices[device].descriptor = &c->devices[device];
80058d4: 5a f0 00 08 sw (r23+8),r16
free (fd->devices);
rtems_fdisk_error ("disk create phy failed");
return sc;
}
for (device = 0; device < c->device_count; device++)
80058d8: 36 52 00 01 addi r18,r18,1
80058dc: 36 73 00 0c addi r19,r19,12
80058e0: 29 81 00 04 lw r1,(r12+4)
80058e4: 54 32 ff c0 bgu r1,r18,80057e4 <rtems_fdisk_initialize+0x2e0>
fd->devices[device].segment_count = segment_count;
fd->devices[device].descriptor = &c->devices[device];
}
fd->device_count = c->device_count;
80058e8: 59 61 00 30 sw (r11+48),r1
ret = rtems_fdisk_recover_block_mappings (fd);
80058ec: b9 60 08 00 mv r1,r11
80058f0: fb ff f8 0f calli 800392c <rtems_fdisk_recover_block_mappings>
80058f4: b8 20 80 00 mv r16,r1
if (ret)
80058f8: 44 20 00 15 be r1,r0,800594c <rtems_fdisk_initialize+0x448><== ALWAYS TAKEN
{
rtems_disk_delete (dev);
80058fc: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
8005900: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
8005904: fb ff f2 ba calli 80023ec <rtems_disk_delete> <== NOT EXECUTED
rtems_semaphore_delete (fd->lock);
8005908: 29 61 00 64 lw r1,(r11+100) <== NOT EXECUTED
800590c: f8 00 0e 59 calli 8009270 <rtems_semaphore_delete> <== NOT EXECUTED
free (fd->copy_buffer);
8005910: 29 61 00 68 lw r1,(r11+104) <== NOT EXECUTED
8005914: f8 00 02 de calli 800648c <free> <== NOT EXECUTED
free (fd->blocks);
8005918: 29 61 00 18 lw r1,(r11+24) <== NOT EXECUTED
800591c: f8 00 02 dc calli 800648c <free> <== NOT EXECUTED
free (fd->devices);
8005920: 29 61 00 2c lw r1,(r11+44) <== NOT EXECUTED
8005924: f8 00 02 da calli 800648c <free> <== NOT EXECUTED
rtems_fdisk_error ("recovery of disk failed: %s (%d)",
8005928: ba 00 08 00 mv r1,r16 <== NOT EXECUTED
800592c: f8 00 78 0d calli 8023960 <strerror> <== NOT EXECUTED
8005930: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
8005934: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8005938: 38 21 5f 58 ori r1,r1,0x5f58 <== NOT EXECUTED
800593c: ba 00 18 00 mv r3,r16 <== NOT EXECUTED
8005940: fb ff f6 9e calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
strerror (ret), ret);
return ret;
8005944: ba 00 18 00 mv r3,r16 <== NOT EXECUTED
8005948: e0 00 00 26 bi 80059e0 <rtems_fdisk_initialize+0x4dc> <== NOT EXECUTED
}
ret = rtems_fdisk_compact (fd);
800594c: b9 60 08 00 mv r1,r11
8005950: fb ff fa 0d calli 8004184 <rtems_fdisk_compact>
8005954: b8 20 88 00 mv r17,r1
8005958: 36 d6 00 74 addi r22,r22,116
if (ret)
800595c: 44 30 00 15 be r1,r16,80059b0 <rtems_fdisk_initialize+0x4ac><== ALWAYS TAKEN
{
rtems_disk_delete (dev);
8005960: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
8005964: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
8005968: fb ff f2 a1 calli 80023ec <rtems_disk_delete> <== NOT EXECUTED
rtems_semaphore_delete (fd->lock);
800596c: 29 61 00 64 lw r1,(r11+100) <== NOT EXECUTED
8005970: f8 00 0e 40 calli 8009270 <rtems_semaphore_delete> <== NOT EXECUTED
free (fd->copy_buffer);
8005974: 29 61 00 68 lw r1,(r11+104) <== NOT EXECUTED
8005978: f8 00 02 c5 calli 800648c <free> <== NOT EXECUTED
free (fd->blocks);
800597c: 29 61 00 18 lw r1,(r11+24) <== NOT EXECUTED
8005980: f8 00 02 c3 calli 800648c <free> <== NOT EXECUTED
free (fd->devices);
8005984: 29 61 00 2c lw r1,(r11+44) <== NOT EXECUTED
8005988: f8 00 02 c1 calli 800648c <free> <== NOT EXECUTED
rtems_fdisk_error ("compacting of disk failed: %s (%d)",
800598c: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
8005990: f8 00 77 f4 calli 8023960 <strerror> <== NOT EXECUTED
8005994: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
8005998: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800599c: 38 21 5f 7c ori r1,r1,0x5f7c <== NOT EXECUTED
80059a0: ba 20 18 00 mv r3,r17 <== NOT EXECUTED
80059a4: fb ff f6 85 calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
strerror (ret), ret);
return ret;
80059a8: ba 20 18 00 mv r3,r17 <== NOT EXECUTED
80059ac: e0 00 00 0d bi 80059e0 <rtems_fdisk_initialize+0x4dc> <== NOT EXECUTED
sizeof (rtems_flashdisk));
if (!rtems_flashdisks)
return RTEMS_NO_MEMORY;
for (minor = 0; minor < rtems_flashdisk_configuration_size; minor++, c++)
80059b0: 35 ad 00 01 addi r13,r13,1
80059b4: 35 8c 00 20 addi r12,r12,32
80059b8: 78 01 08 03 mvhi r1,0x803
80059bc: 38 21 b0 04 ori r1,r1,0xb004
80059c0: 28 22 00 00 lw r2,(r1+0)
80059c4: 54 4d ff 06 bgu r2,r13,80055dc <rtems_fdisk_initialize+0xd8>
strerror (ret), ret);
return ret;
}
}
rtems_flashdisk_count = rtems_flashdisk_configuration_size;
80059c8: 78 01 08 04 mvhi r1,0x804
80059cc: 38 21 b7 dc ori r1,r1,0xb7dc
80059d0: 58 22 00 00 sw (r1+0),r2
return RTEMS_SUCCESSFUL;
80059d4: 34 03 00 00 mvi r3,0
80059d8: e0 00 00 02 bi 80059e0 <rtems_fdisk_initialize+0x4dc>
fd->block_count = blocks;
fd->devices = calloc (c->device_count, sizeof (rtems_fdisk_device_ctl));
if (!fd->devices)
return RTEMS_NO_MEMORY;
80059dc: 34 03 00 1a mvi r3,26 <== NOT EXECUTED
}
rtems_flashdisk_count = rtems_flashdisk_configuration_size;
return RTEMS_SUCCESSFUL;
}
80059e0: b8 60 08 00 mv r1,r3
80059e4: 2b 9d 00 04 lw ra,(sp+4)
80059e8: 2b 8b 00 44 lw r11,(sp+68)
80059ec: 2b 8c 00 40 lw r12,(sp+64)
80059f0: 2b 8d 00 3c lw r13,(sp+60)
80059f4: 2b 8e 00 38 lw r14,(sp+56)
80059f8: 2b 8f 00 34 lw r15,(sp+52)
80059fc: 2b 90 00 30 lw r16,(sp+48)
8005a00: 2b 91 00 2c lw r17,(sp+44)
8005a04: 2b 92 00 28 lw r18,(sp+40)
8005a08: 2b 93 00 24 lw r19,(sp+36)
8005a0c: 2b 94 00 20 lw r20,(sp+32)
8005a10: 2b 95 00 1c lw r21,(sp+28)
8005a14: 2b 96 00 18 lw r22,(sp+24)
8005a18: 2b 97 00 14 lw r23,(sp+20)
8005a1c: 2b 98 00 10 lw r24,(sp+16)
8005a20: 2b 99 00 0c lw r25,(sp+12)
8005a24: 2b 9b 00 08 lw fp,(sp+8)
8005a28: 37 9c 00 60 addi sp,sp,96
8005a2c: c3 a0 00 00 ret
sc = rtems_fdisk_crc16_gen_factors (0x8408);
if (sc != RTEMS_SUCCESSFUL)
return sc;
rtems_flashdisks = calloc (rtems_flashdisk_configuration_size,
8005a30: 78 0b 08 03 mvhi r11,0x803
8005a34: 39 6b b0 04 ori r11,r11,0xb004
8005a38: 29 61 00 00 lw r1,(r11+0)
8005a3c: 34 02 00 74 mvi r2,116
8005a40: f8 00 02 15 calli 8006294 <calloc>
8005a44: 78 02 08 04 mvhi r2,0x804
8005a48: 38 42 b7 d8 ori r2,r2,0xb7d8
8005a4c: 58 41 00 00 sw (r2+0),r1
sizeof (rtems_flashdisk));
if (!rtems_flashdisks)
return RTEMS_NO_MEMORY;
8005a50: 34 03 00 1a mvi r3,26
return sc;
rtems_flashdisks = calloc (rtems_flashdisk_configuration_size,
sizeof (rtems_flashdisk));
if (!rtems_flashdisks)
8005a54: 44 20 ff e3 be r1,r0,80059e0 <rtems_fdisk_initialize+0x4dc><== NEVER TAKEN
8005a58: 78 0c 08 03 mvhi r12,0x803
return RTEMS_NO_MEMORY;
for (minor = 0; minor < rtems_flashdisk_configuration_size; minor++, c++)
{
char name[] = RTEMS_FLASHDISK_DEVICE_BASE_NAME "a";
8005a5c: 78 0e 08 03 mvhi r14,0x803
free (fd->blocks);
free (fd->devices);
return sc;
}
sc = rtems_disk_create_phys(dev, c->block_size,
8005a60: 78 15 08 00 mvhi r21,0x800
return sc;
rtems_flashdisks = calloc (rtems_flashdisk_configuration_size,
sizeof (rtems_flashdisk));
if (!rtems_flashdisks)
8005a64: 34 16 00 00 mvi r22,0
8005a68: 39 8c 4f 0c ori r12,r12,0x4f0c
8005a6c: 34 0d 00 00 mvi r13,0
return RTEMS_NO_MEMORY;
for (minor = 0; minor < rtems_flashdisk_configuration_size; minor++, c++)
{
char name[] = RTEMS_FLASHDISK_DEVICE_BASE_NAME "a";
8005a70: 39 ce 5f a0 ori r14,r14,0x5fa0
dev_t dev = rtems_filesystem_make_dev_t (major, minor);
uint32_t device;
uint32_t blocks = 0;
int ret;
fd = &rtems_flashdisks[minor];
8005a74: b8 40 d8 00 mv fp,r2
free (fd->blocks);
free (fd->devices);
return sc;
}
sc = rtems_disk_create_phys(dev, c->block_size,
8005a78: 3a b5 43 d4 ori r21,r21,0x43d4
8005a7c: e3 ff ff cf bi 80059b8 <rtems_fdisk_initialize+0x4b4>
080043d4 <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)
{
80043d4: 37 9c ff 60 addi sp,sp,-160
80043d8: 5b 8b 00 5c sw (sp+92),r11
80043dc: 5b 8c 00 58 sw (sp+88),r12
80043e0: 5b 8d 00 54 sw (sp+84),r13
80043e4: 5b 8e 00 50 sw (sp+80),r14
80043e8: 5b 8f 00 4c sw (sp+76),r15
80043ec: 5b 90 00 48 sw (sp+72),r16
80043f0: 5b 91 00 44 sw (sp+68),r17
80043f4: 5b 92 00 40 sw (sp+64),r18
80043f8: 5b 93 00 3c sw (sp+60),r19
80043fc: 5b 94 00 38 sw (sp+56),r20
8004400: 5b 95 00 34 sw (sp+52),r21
8004404: 5b 96 00 30 sw (sp+48),r22
8004408: 5b 97 00 2c sw (sp+44),r23
800440c: 5b 98 00 28 sw (sp+40),r24
8004410: 5b 99 00 24 sw (sp+36),r25
8004414: 5b 9b 00 20 sw (sp+32),fp
8004418: 5b 9d 00 1c sw (sp+28),ra
800441c: 5b 83 00 60 sw (sp+96),r3
dev_t device
)
{
union __rtems_dev_t temp;
temp.device = device;
8004420: 28 2e 00 04 lw r14,(r1+4)
8004424: b8 40 60 00 mv r12,r2
8004428: b8 20 68 00 mv r13,r1
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;
800442c: f8 00 72 37 calli 8020d08 <__errno>
8004430: 58 20 00 00 sw (r1+0),r0
sc = rtems_semaphore_obtain (rtems_flashdisks[minor].lock, RTEMS_WAIT, 0);
8004434: 34 02 00 74 mvi r2,116
8004438: b9 c0 08 00 mv r1,r14
800443c: 78 0b 08 04 mvhi r11,0x804
8004440: fb ff f4 76 calli 8001618 <__mulsi3>
8004444: 39 6b b7 d8 ori r11,r11,0xb7d8
8004448: 29 62 00 00 lw r2,(r11+0)
800444c: 5b 81 00 64 sw (sp+100),r1
8004450: 34 03 00 00 mvi r3,0
8004454: b4 41 10 00 add r2,r2,r1
8004458: 28 41 00 64 lw r1,(r2+100)
800445c: 34 02 00 00 mvi r2,0
8004460: f8 00 13 b3 calli 800932c <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
8004464: 5c 20 04 04 bne r1,r0,8005474 <rtems_fdisk_ioctl+0x10a0> <== NEVER TAKEN
errno = EIO;
else
{
errno = 0;
8004468: f8 00 72 28 calli 8020d08 <__errno>
800446c: 58 20 00 00 sw (r1+0),r0
switch (req)
8004470: 78 01 08 03 mvhi r1,0x803
8004474: 38 21 5f ac ori r1,r1,0x5fac
8004478: 28 22 00 00 lw r2,(r1+0)
800447c: 45 82 02 98 be r12,r2,8004edc <rtems_fdisk_ioctl+0xb08> <== NEVER TAKEN
8004480: 55 82 00 0b bgu r12,r2,80044ac <rtems_fdisk_ioctl+0xd8>
8004484: 78 03 08 03 mvhi r3,0x803
8004488: 38 63 5f b0 ori r3,r3,0x5fb0
800448c: 28 62 00 00 lw r2,(r3+0)
8004490: 45 82 02 76 be r12,r2,8004e68 <rtems_fdisk_ioctl+0xa94> <== NEVER TAKEN
8004494: 55 82 02 7d bgu r12,r2,8004e88 <rtems_fdisk_ioctl+0xab4> <== NEVER TAKEN
8004498: 78 01 08 03 mvhi r1,0x803
800449c: 38 21 5f b4 ori r1,r1,0x5fb4
80044a0: 28 22 00 00 lw r2,(r1+0)
80044a4: 5d 82 03 e8 bne r12,r2,8005444 <rtems_fdisk_ioctl+0x1070>
80044a8: e0 00 02 34 bi 8004d78 <rtems_fdisk_ioctl+0x9a4> <== NOT EXECUTED
80044ac: 78 03 08 03 mvhi r3,0x803
80044b0: 38 63 4f 08 ori r3,r3,0x4f08
80044b4: 28 62 00 00 lw r2,(r3+0)
80044b8: 45 82 02 f1 be r12,r2,800507c <rtems_fdisk_ioctl+0xca8> <== NEVER TAKEN
80044bc: 54 4c 02 ea bgu r2,r12,8005064 <rtems_fdisk_ioctl+0xc90> <== NEVER TAKEN
80044c0: 78 01 08 03 mvhi r1,0x803
80044c4: 38 21 54 94 ori r1,r1,0x5494
80044c8: 28 22 00 00 lw r2,(r1+0)
80044cc: 5d 82 03 de bne r12,r2,8005444 <rtems_fdisk_ioctl+0x1070> <== NEVER TAKEN
{
case RTEMS_BLKIO_REQUEST:
if ((minor >= rtems_flashdisk_count) ||
80044d0: 78 02 08 04 mvhi r2,0x804
80044d4: 38 42 b7 dc ori r2,r2,0xb7dc
80044d8: 28 42 00 00 lw r2,(r2+0)
80044dc: 51 c2 00 06 bgeu r14,r2,80044f4 <rtems_fdisk_ioctl+0x120> <== NEVER TAKEN
(rtems_flashdisks[minor].device_count == 0))
80044e0: 29 62 00 00 lw r2,(r11+0)
80044e4: 2b 83 00 64 lw r3,(sp+100)
80044e8: b4 43 10 00 add r2,r2,r3
{
errno = 0;
switch (req)
{
case RTEMS_BLKIO_REQUEST:
if ((minor >= rtems_flashdisk_count) ||
80044ec: 28 42 00 30 lw r2,(r2+48)
80044f0: 5c 40 00 04 bne r2,r0,8004500 <rtems_fdisk_ioctl+0x12c> <== ALWAYS TAKEN
(rtems_flashdisks[minor].device_count == 0))
{
errno = ENODEV;
80044f4: f8 00 72 05 calli 8020d08 <__errno> <== NOT EXECUTED
80044f8: 34 02 00 13 mvi r2,19 <== NOT EXECUTED
80044fc: e0 00 02 1d bi 8004d70 <rtems_fdisk_ioctl+0x99c> <== NOT EXECUTED
}
else
{
switch (r->req)
8004500: 2b 81 00 60 lw r1,(sp+96)
8004504: 28 22 00 00 lw r2,(r1+0)
8004508: 44 40 00 04 be r2,r0,8004518 <rtems_fdisk_ioctl+0x144>
800450c: 34 04 00 01 mvi r4,1
8004510: 5c 44 02 16 bne r2,r4,8004d68 <rtems_fdisk_ioctl+0x994> <== NEVER TAKEN
8004514: e0 00 00 a7 bi 80047b0 <rtems_fdisk_ioctl+0x3dc>
{
case RTEMS_BLKDEV_REQ_READ:
errno = rtems_fdisk_read (&rtems_flashdisks[minor], r);
8004518: f8 00 71 fc calli 8020d08 <__errno>
800451c: 2b 82 00 64 lw r2,(sp+100)
8004520: 29 6c 00 00 lw r12,(r11+0)
* @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;
8004524: 2b 83 00 60 lw r3,(sp+96)
bc = &fd->blocks[block];
if (!bc->segment)
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "read-block: no segment mapping: %d", block);
8004528: 78 14 08 03 mvhi r20,0x803
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);
800452c: 78 18 08 03 mvhi r24,0x803
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
8004530: 78 17 08 03 mvhi r23,0x803
8004534: 78 16 08 03 mvhi r22,0x803
8004538: 78 15 08 03 mvhi r21,0x803
bc = &fd->blocks[block];
if (!bc->segment)
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "read-block: no segment mapping: %d", block);
800453c: 3a 94 59 8c ori r20,r20,0x598c
else
{
switch (r->req)
{
case RTEMS_BLKDEV_REQ_READ:
errno = rtems_fdisk_read (&rtems_flashdisks[minor], r);
8004540: 5b 81 00 68 sw (sp+104),r1
8004544: b5 82 60 00 add r12,r12,r2
* @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;
8004548: 34 71 00 18 addi r17,r3,24
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
800454c: 34 19 00 00 mvi r25,0
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);
8004550: 3b 18 59 58 ori r24,r24,0x5958
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
8004554: 3a f7 55 8c ori r23,r23,0x558c
8004558: 3a d6 59 b0 ori r22,r22,0x59b0
800455c: 3a b5 55 88 ori r21,r21,0x5588
8004560: 5b 94 00 6c sw (sp+108),r20
8004564: e0 00 00 89 bi 8004788 <rtems_fdisk_ioctl+0x3b4>
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
{
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
8004568: 2a 21 00 04 lw r1,(r17+4)
800456c: 29 82 00 14 lw r2,(r12+20)
8004570: fb ff f4 36 calli 8001648 <__udivsi3>
8004574: b8 20 a0 00 mv r20,r1
data = sg->buffer;
8004578: 2a 2e 00 08 lw r14,(r17+8)
for (b = 0; b < fb; b++, data += fd->block_size)
800457c: 34 1b 00 00 mvi fp,0
8004580: e0 00 00 80 bi 8004780 <rtems_fdisk_ioctl+0x3ac>
{
ret = rtems_fdisk_read_block (fd, sg->block + b, data);
8004584: 2a 30 00 00 lw r16,(r17+0)
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);
8004588: b9 80 08 00 mv r1,r12
800458c: bb 00 10 00 mv r2,r24
uint32_t b;
fb = sg->length / fd->block_size;
data = sg->buffer;
for (b = 0; b < fb; b++, data += fd->block_size)
{
ret = rtems_fdisk_read_block (fd, sg->block + b, data);
8004590: b7 70 80 00 add r16,fp,r16
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);
8004594: ba 00 18 00 mv r3,r16
8004598: fb ff f9 ff calli 8002d94 <rtems_fdisk_info>
/*
* Broken out to allow info messages when testing.
*/
if (block >= (fd->block_count - fd->unavail_blocks))
800459c: 29 83 00 1c lw r3,(r12+28)
80045a0: 29 81 00 20 lw r1,(r12+32)
80045a4: c8 61 08 00 sub r1,r3,r1
80045a8: 54 30 00 07 bgu r1,r16,80045c4 <rtems_fdisk_ioctl+0x1f0> <== ALWAYS TAKEN
{
rtems_fdisk_error ("read-block: block out of range: %d", block);
80045ac: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
80045b0: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
80045b4: 38 21 59 68 ori r1,r1,0x5968 <== NOT EXECUTED
80045b8: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
80045bc: fb ff fb 7f calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
80045c0: e0 00 00 6e bi 8004778 <rtems_fdisk_ioctl+0x3a4> <== NOT EXECUTED
return EIO;
}
bc = &fd->blocks[block];
80045c4: ba 00 08 00 mv r1,r16
80045c8: 34 02 00 03 mvi r2,3
80045cc: fb ff f3 c5 calli 80014e0 <__ashlsi3>
80045d0: 29 92 00 18 lw r18,(r12+24)
80045d4: b6 41 90 00 add r18,r18,r1
if (!bc->segment)
80045d8: 2a 4b 00 00 lw r11,(r18+0)
80045dc: 5d 60 00 0a bne r11,r0,8004604 <rtems_fdisk_ioctl+0x230>
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "read-block: no segment mapping: %d", block);
80045e0: 2b 82 00 6c lw r2,(sp+108)
80045e4: ba 00 18 00 mv r3,r16
80045e8: b9 80 08 00 mv r1,r12
80045ec: fb ff f9 ea calli 8002d94 <rtems_fdisk_info>
#endif
memset (buffer, 0xff, fd->block_size);
80045f0: 29 83 00 14 lw r3,(r12+20)
80045f4: b9 c0 08 00 mv r1,r14
80045f8: 34 02 00 ff mvi r2,255
80045fc: f8 00 77 82 calli 8022404 <memset>
8004600: e0 00 03 b7 bi 80054dc <rtems_fdisk_ioctl+0x1108>
return 0;
}
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
8004604: 2a 4f 00 04 lw r15,(r18+4)
8004608: 34 02 00 03 mvi r2,3
800460c: b9 e0 08 00 mv r1,r15
8004610: fb ff f3 b4 calli 80014e0 <__ashlsi3>
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
8004614: 29 69 00 00 lw r9,(r11+0)
memset (buffer, 0xff, fd->block_size);
return 0;
}
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
8004618: 29 6d 00 10 lw r13,(r11+16)
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
800461c: 29 64 00 08 lw r4,(r11+8)
8004620: 29 65 00 0c lw r5,(r11+12)
memset (buffer, 0xff, fd->block_size);
return 0;
}
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
8004624: b5 a1 68 00 add r13,r13,r1
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
8004628: 29 67 00 14 lw r7,(r11+20)
800462c: 29 68 00 1c lw r8,(r11+28)
8004630: 29 66 00 20 lw r6,(r11+32)
8004634: 29 63 00 24 lw r3,(r11+36)
8004638: ba e0 08 00 mv r1,r23
800463c: 45 20 00 02 be r9,r0,8004644 <rtems_fdisk_ioctl+0x270>
8004640: ba a0 08 00 mv r1,r21
8004644: 5b 86 00 04 sw (sp+4),r6
8004648: 5b 83 00 08 sw (sp+8),r3
800464c: 5b 81 00 0c sw (sp+12),r1
8004650: 2d a3 00 02 lhu r3,(r13+2)
8004654: ba c0 10 00 mv r2,r22
8004658: b9 e0 30 00 mv r6,r15
800465c: 5b 83 00 10 sw (sp+16),r3
8004660: 2d a3 00 00 lhu r3,(r13+0)
8004664: 5b 83 00 14 sw (sp+20),r3
8004668: 29 a1 00 04 lw r1,(r13+4)
800466c: ba 00 18 00 mv r3,r16
8004670: 5b 81 00 18 sw (sp+24),r1
8004674: b9 80 08 00 mv r1,r12
8004678: fb ff f9 c7 calli 8002d94 <rtems_fdisk_info>
}
rtems_flashdisk_count = rtems_flashdisk_configuration_size;
return RTEMS_SUCCESSFUL;
}
800467c: 2d a3 00 02 lhu r3,(r13+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))
8004680: 20 61 00 01 andi r1,r3,0x1
8004684: 5c 20 00 35 bne r1,r0,8004758 <rtems_fdisk_ioctl+0x384> <== NEVER TAKEN
* only set a flag by changing it from 1 to 0.
*/
static bool
rtems_fdisk_page_desc_flags_clear (rtems_fdisk_page_desc* pd, uint16_t flags)
{
return (pd->flags & flags) == flags ? true : false;
8004688: 20 63 00 02 andi r3,r3,0x2
pd->flags, pd->crc, pd->block);
#endif
if (rtems_fdisk_page_desc_flags_set (pd, RTEMS_FDISK_PAGE_ACTIVE))
{
if (rtems_fdisk_page_desc_flags_clear (pd, RTEMS_FDISK_PAGE_USED))
800468c: 34 01 00 02 mvi r1,2
8004690: 2a 44 00 04 lw r4,(r18+4)
8004694: 5c 61 00 29 bne r3,r1,8004738 <rtems_fdisk_ioctl+0x364> <== NEVER TAKEN
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);
8004698: 29 8f 00 14 lw r15,(r12+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,
800469c: 29 61 00 18 lw r1,(r11+24)
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,
80046a0: b9 e0 10 00 mv r2,r15
80046a4: b4 24 08 00 add r1,r1,r4
80046a8: fb ff f3 dc calli 8001618 <__mulsi3>
80046ac: b8 20 18 00 mv r3,r1
80046b0: b9 60 10 00 mv r2,r11
80046b4: b9 80 08 00 mv r1,r12
80046b8: b9 c0 20 00 mv r4,r14
80046bc: b9 e0 28 00 mv r5,r15
80046c0: fb ff fa 0d calli 8002ef4 <rtems_fdisk_seg_read>
80046c4: b8 20 98 00 mv r19,r1
* driver. This skips the page descriptors.
*/
int ret = rtems_fdisk_seg_read_page (fd, sc,
bc->page + sc->pages_desc, buffer);
if (ret)
80046c8: 44 20 00 0f be r1,r0,8004704 <rtems_fdisk_ioctl+0x330> <== ALWAYS TAKEN
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
80046cc: 29 6e 00 08 lw r14,(r11+8) <== NOT EXECUTED
80046d0: 29 6d 00 0c lw r13,(r11+12) <== NOT EXECUTED
80046d4: 2a 4b 00 04 lw r11,(r18+4) <== NOT EXECUTED
80046d8: f8 00 7c a2 calli 8023960 <strerror> <== NOT EXECUTED
80046dc: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
80046e0: b8 20 30 00 mv r6,r1 <== NOT EXECUTED
80046e4: 38 42 59 f8 ori r2,r2,0x59f8 <== NOT EXECUTED
80046e8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
80046ec: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
80046f0: b9 a0 20 00 mv r4,r13 <== NOT EXECUTED
80046f4: b9 60 28 00 mv r5,r11 <== NOT EXECUTED
80046f8: ba 60 38 00 mv r7,r19 <== NOT EXECUTED
80046fc: fb ff f9 a6 calli 8002d94 <rtems_fdisk_info> <== NOT EXECUTED
8004700: e0 00 00 1e bi 8004778 <rtems_fdisk_ioctl+0x3a4> <== NOT EXECUTED
strerror (ret), ret);
#endif
return ret;
}
cs = rtems_fdisk_page_checksum (buffer, fd->block_size);
8004704: 29 82 00 14 lw r2,(r12+20)
8004708: b9 c0 08 00 mv r1,r14
800470c: fb ff f9 83 calli 8002d18 <rtems_fdisk_page_checksum>
if (cs == pd->crc)
8004710: 2d a4 00 00 lhu r4,(r13+0)
strerror (ret), ret);
#endif
return ret;
}
cs = rtems_fdisk_page_checksum (buffer, fd->block_size);
8004714: b8 20 28 00 mv r5,r1
if (cs == pd->crc)
8004718: 44 24 03 71 be r1,r4,80054dc <rtems_fdisk_ioctl+0x1108>
return 0;
rtems_fdisk_error ("read-block: crc failure: %d: buffer:%04x page:%04x",
800471c: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
8004720: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
8004724: b8 a0 18 00 mv r3,r5 <== NOT EXECUTED
8004728: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
800472c: 38 21 5a 30 ori r1,r1,0x5a30 <== NOT EXECUTED
8004730: fb ff fb 22 calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
8004734: e0 00 00 11 bi 8004778 <rtems_fdisk_ioctl+0x3a4> <== NOT EXECUTED
block, cs, pd->crc);
}
else
{
rtems_fdisk_error ("read-block: block points to used page: %d: %d-%d-%d",
8004738: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
800473c: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
8004740: b8 80 28 00 mv r5,r4 <== NOT EXECUTED
8004744: 38 21 5a 64 ori r1,r1,0x5a64 <== NOT EXECUTED
8004748: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
800474c: 29 63 00 08 lw r3,(r11+8) <== NOT EXECUTED
8004750: 29 64 00 0c lw r4,(r11+12) <== NOT EXECUTED
8004754: e0 00 00 08 bi 8004774 <rtems_fdisk_ioctl+0x3a0> <== NOT EXECUTED
block, sc->device, sc->segment, bc->page);
}
}
else
{
rtems_fdisk_error ("read-block: block page not active: %d: %d-%d-%d",
8004758: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
800475c: 29 63 00 08 lw r3,(r11+8) <== NOT EXECUTED
8004760: 29 64 00 0c lw r4,(r11+12) <== NOT EXECUTED
8004764: 2a 45 00 04 lw r5,(r18+4) <== NOT EXECUTED
8004768: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
800476c: 38 21 5a 98 ori r1,r1,0x5a98 <== NOT EXECUTED
8004770: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
8004774: fb ff fb 11 calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
if (ret)
break;
}
}
rtems_blkdev_request_done (req, ret ? RTEMS_IO_ERROR : RTEMS_SUCCESSFUL);
8004778: 34 02 00 1b mvi r2,27 <== NOT EXECUTED
800477c: e0 00 00 07 bi 8004798 <rtems_fdisk_ioctl+0x3c4> <== NOT EXECUTED
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
data = sg->buffer;
for (b = 0; b < fb; b++, data += fd->block_size)
8004780: 56 9b ff 81 bgu r20,fp,8004584 <rtems_fdisk_ioctl+0x1b0>
8004784: e0 00 03 5a bi 80054ec <rtems_fdisk_ioctl+0x1118>
{
rtems_blkdev_sg_buffer* sg = req->bufs;
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
8004788: 2b 82 00 60 lw r2,(sp+96)
800478c: 28 41 00 10 lw r1,(r2+16)
8004790: 54 39 ff 76 bgu r1,r25,8004568 <rtems_fdisk_ioctl+0x194>
if (ret)
break;
}
}
rtems_blkdev_request_done (req, ret ? RTEMS_IO_ERROR : RTEMS_SUCCESSFUL);
8004794: 34 02 00 00 mvi r2,0
static inline void rtems_blkdev_request_done(
rtems_blkdev_request *req,
rtems_status_code status
)
{
(*req->done)(req, status);
8004798: 2b 83 00 60 lw r3,(sp+96)
800479c: 28 64 00 04 lw r4,(r3+4)
80047a0: b8 60 08 00 mv r1,r3
80047a4: d8 80 00 00 call r4
else
{
switch (r->req)
{
case RTEMS_BLKDEV_REQ_READ:
errno = rtems_fdisk_read (&rtems_flashdisks[minor], r);
80047a8: 2b 81 00 68 lw r1,(sp+104)
80047ac: e0 00 03 24 bi 800543c <rtems_fdisk_ioctl+0x1068>
break;
case RTEMS_BLKDEV_REQ_WRITE:
errno = rtems_fdisk_write (&rtems_flashdisks[minor], r);
80047b0: f8 00 71 56 calli 8020d08 <__errno>
80047b4: 78 02 08 04 mvhi r2,0x804
80047b8: 38 42 b7 d8 ori r2,r2,0xb7d8
80047bc: 28 42 00 00 lw r2,(r2+0)
80047c0: 2b 83 00 64 lw r3,(sp+100)
80047c4: 5b 81 00 94 sw (sp+148),r1
* @retval 0 Always. The request done callback contains the status.
*/
static int
rtems_fdisk_write (rtems_flashdisk* fd, rtems_blkdev_request* req)
{
rtems_blkdev_sg_buffer* sg = req->bufs;
80047c8: 2b 81 00 60 lw r1,(sp+96)
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);
80047cc: b4 43 c0 00 add r24,r2,r3
rtems_fdisk_page_desc* pd;
uint32_t page;
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%d", block);
80047d0: 78 02 08 03 mvhi r2,0x803
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: " \
80047d4: 78 03 08 03 mvhi r3,0x803
rtems_fdisk_page_desc* pd;
uint32_t page;
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%d", block);
80047d8: 38 42 5a c8 ori r2,r2,0x5ac8
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: " \
80047dc: 38 63 55 8c ori r3,r3,0x558c
* @retval 0 Always. The request done callback contains the status.
*/
static int
rtems_fdisk_write (rtems_flashdisk* fd, rtems_blkdev_request* req)
{
rtems_blkdev_sg_buffer* sg = req->bufs;
80047e0: 34 3b 00 18 addi fp,r1,24
rtems_fdisk_page_desc* pd;
uint32_t page;
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%d", block);
80047e4: 5b 82 00 68 sw (sp+104),r2
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: " \
80047e8: 5b 83 00 6c sw (sp+108),r3
80047ec: 78 01 08 03 mvhi r1,0x803
{
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: " \
80047f0: 78 02 08 03 mvhi r2,0x803
*/
ret = rtems_fdisk_seg_write_page (fd, sc, page + sc->pages_desc, buffer);
if (ret)
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%02d-%03d-%03d: write page failed: " \
80047f4: 78 03 08 03 mvhi r3,0x803
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: " \
80047f8: 38 21 5c 48 ori r1,r1,0x5c48
{
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: " \
80047fc: 38 42 5c d0 ori r2,r2,0x5cd0
*/
ret = rtems_fdisk_seg_write_page (fd, sc, page + sc->pages_desc, buffer);
if (ret)
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%02d-%03d-%03d: write page failed: " \
8004800: 38 63 5c 98 ori r3,r3,0x5c98
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: " \
8004804: 5b 81 00 70 sw (sp+112),r1
{
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: " \
8004808: 5b 82 00 74 sw (sp+116),r2
*/
ret = rtems_fdisk_seg_write_page (fd, sc, page + sc->pages_desc, buffer);
if (ret)
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%02d-%03d-%03d: write page failed: " \
800480c: 5b 83 00 78 sw (sp+120),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: " \
8004810: 78 01 08 03 mvhi r1,0x803
#if RTEMS_FDISK_TRACE
if (fd->info_level >= 3)
{
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
rtems_fdisk_info (fd, " write:%d=>%02d-%03d: queue check: %s",
8004814: 78 02 08 03 mvhi r2,0x803
{
sc = bc->segment;
pd = &sc->page_descriptors[bc->page];
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%02d-%03d-%03d: flag used",
8004818: 78 03 08 03 mvhi r3,0x803
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: " \
800481c: 38 21 55 88 ori r1,r1,0x5588
#if RTEMS_FDISK_TRACE
if (fd->info_level >= 3)
{
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
rtems_fdisk_info (fd, " write:%d=>%02d-%03d: queue check: %s",
8004820: 38 42 5c 20 ori r2,r2,0x5c20
{
sc = bc->segment;
pd = &sc->page_descriptors[bc->page];
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%02d-%03d-%03d: flag used",
8004824: 38 63 5a fc ori r3,r3,0x5afc
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: " \
8004828: 5b 81 00 7c sw (sp+124),r1
#if RTEMS_FDISK_TRACE
if (fd->info_level >= 3)
{
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
rtems_fdisk_info (fd, " write:%d=>%02d-%03d: queue check: %s",
800482c: 5b 82 00 80 sw (sp+128),r2
{
sc = bc->segment;
pd = &sc->page_descriptors[bc->page];
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%02d-%03d-%03d: flag used",
8004830: 5b 83 00 84 sw (sp+132),r3
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",
8004834: 78 01 08 03 mvhi r1,0x803
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: " \
8004838: 78 02 08 03 mvhi r2,0x803
&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: "
800483c: 78 03 08 03 mvhi r3,0x803
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",
8004840: 38 21 5b 20 ori r1,r1,0x5b20
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: " \
8004844: 38 42 5b c4 ori r2,r2,0x5bc4
&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: "
8004848: 38 63 5b 78 ori r3,r3,0x5b78
{
rtems_blkdev_sg_buffer* sg = req->bufs;
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
800484c: 34 17 00 00 mvi r23,0
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",
8004850: 5b 81 00 88 sw (sp+136),r1
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: " \
8004854: 5b 82 00 8c sw (sp+140),r2
&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: "
8004858: 5b 83 00 90 sw (sp+144),r3
800485c: e0 00 01 39 bi 8004d40 <rtems_fdisk_ioctl+0x96c>
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
{
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
8004860: 2b 61 00 04 lw r1,(fp+4)
8004864: 2b 02 00 14 lw r2,(r24+20)
data = sg->buffer;
for (b = 0; b < fb; b++, data += fd->block_size)
8004868: 34 16 00 00 mvi r22,0
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
{
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
800486c: fb ff f3 77 calli 8001648 <__udivsi3>
8004870: 5b 81 00 98 sw (sp+152),r1
data = sg->buffer;
8004874: 2b 75 00 08 lw r21,(fp+8)
8004878: e0 00 01 2d bi 8004d2c <rtems_fdisk_ioctl+0x958>
for (b = 0; b < fb; b++, data += fd->block_size)
{
ret = rtems_fdisk_write_block (fd, sg->block + b, data);
800487c: 2b 63 00 00 lw r3,(fp+0)
rtems_fdisk_page_desc* pd;
uint32_t page;
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%d", block);
8004880: 2b 82 00 68 lw r2,(sp+104)
8004884: bb 00 08 00 mv r1,r24
uint32_t b;
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);
8004888: b6 c3 c8 00 add r25,r22,r3
rtems_fdisk_page_desc* pd;
uint32_t page;
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%d", block);
800488c: bb 20 18 00 mv r3,r25
8004890: fb ff f9 41 calli 8002d94 <rtems_fdisk_info>
/*
* Broken out to allow info messages when testing.
*/
if (block >= (fd->block_count - fd->unavail_blocks))
8004894: 2b 07 00 1c lw r7,(r24+28)
8004898: 2b 06 00 20 lw r6,(r24+32)
800489c: c8 e6 30 00 sub r6,r7,r6
80048a0: 54 d9 00 07 bgu r6,r25,80048bc <rtems_fdisk_ioctl+0x4e8> <== ALWAYS TAKEN
{
rtems_fdisk_error ("write-block: block out of range: %d", block);
80048a4: 78 04 08 03 mvhi r4,0x803 <== NOT EXECUTED
80048a8: b8 80 08 00 mv r1,r4 <== NOT EXECUTED
80048ac: bb 20 10 00 mv r2,r25 <== NOT EXECUTED
80048b0: 38 21 5a d8 ori r1,r1,0x5ad8 <== NOT EXECUTED
80048b4: fb ff fa c1 calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
80048b8: e0 00 01 20 bi 8004d38 <rtems_fdisk_ioctl+0x964> <== NOT EXECUTED
return EIO;
}
bc = &fd->blocks[block];
80048bc: bb 20 08 00 mv r1,r25
80048c0: 34 02 00 03 mvi r2,3
80048c4: fb ff f3 07 calli 80014e0 <__ashlsi3>
80048c8: 2b 06 00 18 lw r6,(r24+24)
80048cc: b4 c1 80 00 add r16,r6,r1
/*
* Does the page exist in flash ?
*/
if (bc->segment)
80048d0: 2a 0d 00 00 lw r13,(r16+0)
80048d4: 45 a0 00 82 be r13,r0,8004adc <rtems_fdisk_ioctl+0x708>
{
sc = bc->segment;
pd = &sc->page_descriptors[bc->page];
80048d8: 2a 14 00 04 lw r20,(r16+4)
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%02d-%03d-%03d: flag used",
80048dc: 29 a3 00 08 lw r3,(r13+8)
80048e0: 29 a4 00 0c lw r4,(r13+12)
80048e4: 2b 82 00 84 lw r2,(sp+132)
80048e8: ba 80 28 00 mv r5,r20
80048ec: bb 00 08 00 mv r1,r24
* Does the page exist in flash ?
*/
if (bc->segment)
{
sc = bc->segment;
pd = &sc->page_descriptors[bc->page];
80048f0: 29 ac 00 10 lw r12,(r13+16)
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%02d-%03d-%03d: flag used",
80048f4: fb ff f9 28 calli 8002d94 <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,
80048f8: 29 a8 00 18 lw r8,(r13+24)
80048fc: 2a 07 00 04 lw r7,(r16+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);
8004900: 2b 12 00 14 lw r18,(r24+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,
8004904: 29 af 00 08 lw r15,(r13+8)
uint32_t device,
uint32_t segment,
uint32_t page,
const void* buffer)
{
return rtems_fdisk_seg_verify (fd, device, segment,
8004908: b5 07 08 00 add r1,r8,r7
800490c: ba 40 10 00 mv r2,r18
8004910: fb ff f3 42 calli 8001618 <__mulsi3>
8004914: b8 20 98 00 mv r19,r1
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;
8004918: 34 02 00 01 mvi r2,1
800491c: b9 e0 08 00 mv r1,r15
8004920: fb ff f2 f0 calli 80014e0 <__ashlsi3>
8004924: 34 02 00 02 mvi r2,2
8004928: b4 2f 08 00 add r1,r1,r15
800492c: fb ff f2 ed calli 80014e0 <__ashlsi3>
8004930: 2b 07 00 2c lw r7,(r24+44)
#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,
8004934: 29 b1 00 0c lw r17,(r13+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;
8004938: 34 02 00 30 mvi r2,48
800493c: b4 e1 58 00 add r11,r7,r1
8004940: 29 6e 00 00 lw r14,(r11+0)
8004944: ba 20 08 00 mv r1,r17
8004948: fb ff f3 34 calli 8001618 <__mulsi3>
800494c: b5 c1 38 00 add r7,r14,r1
8004950: 28 ee 00 04 lw r14,(r7+4)
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;
8004954: 29 67 00 08 lw r7,(r11+8)
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " seg-verify: %02d-%03d: o=%08x s=%d",
8004958: 2b 82 00 88 lw r2,(sp+136)
800495c: b9 e0 18 00 mv r3,r15
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;
8004960: 28 eb 00 08 lw r11,(r7+8)
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " seg-verify: %02d-%03d: o=%08x s=%d",
8004964: ba 20 20 00 mv r4,r17
8004968: ba 60 28 00 mv r5,r19
800496c: ba 40 30 00 mv r6,r18
8004970: bb 00 08 00 mv r1,r24
8004974: fb ff f9 34 calli 8002e44 <rtems_fdisk_printf>
device, segment, offset, size);
#endif
return ops->verify (sd, device, segment, offset, buffer, size);
8004978: 29 67 00 0c lw r7,(r11+12)
800497c: b9 c0 08 00 mv r1,r14
8004980: b9 e0 10 00 mv r2,r15
8004984: ba 20 18 00 mv r3,r17
8004988: ba 60 20 00 mv r4,r19
800498c: ba a0 28 00 mv r5,r21
8004990: ba 40 30 00 mv r6,r18
8004994: d8 e0 00 00 call r7
8004998: 2a 0e 00 04 lw r14,(r16+4)
#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,
800499c: 5c 20 00 0b bne r1,r0,80049c8 <rtems_fdisk_ioctl+0x5f4>
bc->page + sc->pages_desc, buffer) == 0)
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%d=>%02d-%03d-%03d: page verified",
80049a0: 78 07 08 03 mvhi r7,0x803
80049a4: 29 a4 00 08 lw r4,(r13+8)
80049a8: 29 a5 00 0c lw r5,(r13+12)
80049ac: b8 e0 10 00 mv r2,r7
80049b0: bb 00 08 00 mv r1,r24
80049b4: 38 42 5b 48 ori r2,r2,0x5b48
80049b8: bb 20 18 00 mv r3,r25
80049bc: b9 c0 30 00 mv r6,r14
80049c0: fb ff f8 f5 calli 8002d94 <rtems_fdisk_info>
80049c4: e0 00 00 d7 bi 8004d20 <rtems_fdisk_ioctl+0x94c>
* Does the page exist in flash ?
*/
if (bc->segment)
{
sc = bc->segment;
pd = &sc->page_descriptors[bc->page];
80049c8: 34 02 00 03 mvi r2,3
80049cc: ba 80 08 00 mv r1,r20
80049d0: fb ff f2 c4 calli 80014e0 <__ashlsi3>
80049d4: b5 81 60 00 add r12,r12,r1
* 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;
80049d8: 2d 87 00 02 lhu r7,(r12+2)
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)) +
80049dc: b9 c0 08 00 mv r1,r14
80049e0: 34 02 00 03 mvi r2,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;
80049e4: 20 e7 ff fd andi r7,r7,0xfffd
80049e8: 0d 87 00 02 sh (r12+2),r7
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)) +
80049ec: fb ff f2 bd calli 80014e0 <__ashlsi3>
((uint8_t*) &page_desc->flags) - ((uint8_t*) page_desc));
if ((fd->flags & RTEMS_FDISK_BLANK_CHECK_BEFORE_WRITE))
80049f0: 2b 07 00 08 lw r7,(r24+8)
rtems_fdisk_segment_ctl* sc,
uint32_t page,
const rtems_fdisk_page_desc* page_desc)
{
uint32_t offset = ((page * sizeof (rtems_fdisk_page_desc)) +
((uint8_t*) &page_desc->flags) - ((uint8_t*) page_desc));
80049f4: 34 2f 00 02 addi r15,r1,2
if ((fd->flags & RTEMS_FDISK_BLANK_CHECK_BEFORE_WRITE))
80049f8: 20 e7 00 08 andi r7,r7,0x8
80049fc: 44 e0 00 14 be r7,r0,8004a4c <rtems_fdisk_ioctl+0x678> <== NEVER TAKEN
{
uint16_t flash_flags;
int ret;
ret = rtems_fdisk_seg_read (fd, sc, offset,
8004a00: bb 00 08 00 mv r1,r24
8004a04: b9 a0 10 00 mv r2,r13
8004a08: b9 e0 18 00 mv r3,r15
8004a0c: 37 84 00 a2 addi r4,sp,162
8004a10: 34 05 00 02 mvi r5,2
8004a14: fb ff f9 38 calli 8002ef4 <rtems_fdisk_seg_read>
8004a18: b8 20 58 00 mv r11,r1
&flash_flags, sizeof (flash_flags));
if (ret)
8004a1c: 5c 20 00 14 bne r1,r0,8004a6c <rtems_fdisk_ioctl+0x698> <== NEVER TAKEN
return ret;
if ((flash_flags & page_desc->flags) != page_desc->flags)
8004a20: 2f 85 00 a2 lhu r5,(sp+162)
8004a24: 2d 88 00 02 lhu r8,(r12+2)
8004a28: a1 05 38 00 and r7,r8,r5
8004a2c: 44 e8 00 08 be r7,r8,8004a4c <rtems_fdisk_ioctl+0x678> <== ALWAYS TAKEN
{
rtems_fdisk_error (" seg-write-page-flags: %02d-%03d-%03d: "
8004a30: 2b 81 00 90 lw r1,(sp+144) <== NOT EXECUTED
8004a34: 29 a2 00 08 lw r2,(r13+8) <== NOT EXECUTED
8004a38: 29 a3 00 0c lw r3,(r13+12) <== NOT EXECUTED
8004a3c: b9 c0 20 00 mv r4,r14 <== NOT EXECUTED
8004a40: b9 00 30 00 mv r6,r8 <== NOT EXECUTED
8004a44: fb ff fa 5d calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
8004a48: e0 00 00 17 bi 8004aa4 <rtems_fdisk_ioctl+0x6d0> <== NOT EXECUTED
sc->device, sc->segment, page,
flash_flags, page_desc->flags);
return ret;
}
}
return rtems_fdisk_seg_write (fd, sc, offset,
8004a4c: bb 00 08 00 mv r1,r24
8004a50: b9 a0 10 00 mv r2,r13
8004a54: b9 e0 18 00 mv r3,r15
8004a58: 35 84 00 02 addi r4,r12,2
8004a5c: 34 05 00 02 mvi r5,2
8004a60: fb ff f9 97 calli 80030bc <rtems_fdisk_seg_write>
8004a64: b8 20 58 00 mv r11,r1
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)
8004a68: 44 20 00 0f be r1,r0,8004aa4 <rtems_fdisk_ioctl+0x6d0> <== ALWAYS TAKEN
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%02d-%03d-%03d: " \
8004a6c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8004a70: 29 ac 00 08 lw r12,(r13+8) <== NOT EXECUTED
8004a74: 29 ae 00 0c lw r14,(r13+12) <== NOT EXECUTED
8004a78: 2a 0f 00 04 lw r15,(r16+4) <== NOT EXECUTED
8004a7c: f8 00 7b b9 calli 8023960 <strerror> <== NOT EXECUTED
8004a80: 2b 82 00 8c lw r2,(sp+140) <== NOT EXECUTED
8004a84: b8 20 30 00 mv r6,r1 <== NOT EXECUTED
8004a88: b9 80 18 00 mv r3,r12 <== NOT EXECUTED
8004a8c: bb 00 08 00 mv r1,r24 <== NOT EXECUTED
8004a90: b9 c0 20 00 mv r4,r14 <== NOT EXECUTED
8004a94: b9 e0 28 00 mv r5,r15 <== NOT EXECUTED
8004a98: b9 60 38 00 mv r7,r11 <== NOT EXECUTED
8004a9c: fb ff f8 be calli 8002d94 <rtems_fdisk_info> <== NOT EXECUTED
8004aa0: e0 00 00 07 bi 8004abc <rtems_fdisk_ioctl+0x6e8> <== NOT EXECUTED
strerror (ret), ret);
#endif
}
else
{
sc->pages_active--;
8004aa4: 29 a6 00 1c lw r6,(r13+28)
8004aa8: 34 c6 ff ff addi r6,r6,-1
8004aac: 59 a6 00 1c sw (r13+28),r6
sc->pages_used++;
8004ab0: 29 a6 00 20 lw r6,(r13+32)
8004ab4: 34 c6 00 01 addi r6,r6,1
8004ab8: 59 a6 00 20 sw (r13+32),r6
/*
* 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);
8004abc: bb 00 08 00 mv r1,r24
8004ac0: b9 a0 10 00 mv r2,r13
8004ac4: fb ff fb 1b calli 8003730 <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)
8004ac8: 2b 06 00 08 lw r6,(r24+8)
8004acc: 20 c6 00 02 andi r6,r6,0x2
8004ad0: 5c c0 00 03 bne r6,r0,8004adc <rtems_fdisk_ioctl+0x708> <== NEVER TAKEN
rtems_fdisk_compact (fd);
8004ad4: bb 00 08 00 mv r1,r24
8004ad8: fb ff fd ab calli 8004184 <rtems_fdisk_compact>
/*
* Is it time to compact the disk ?
*
* We override the background compaction configruation.
*/
if (rtems_fdisk_segment_count_queue (&fd->available) <=
8004adc: 2b 01 00 34 lw r1,(r24+52)
8004ae0: fb ff fa 81 calli 80034e4 <rtems_fdisk_segment_count_queue.clone.1>
8004ae4: 2b 06 00 10 lw r6,(r24+16)
8004ae8: 54 26 00 03 bgu r1,r6,8004af4 <rtems_fdisk_ioctl+0x720>
fd->avail_compact_segs)
rtems_fdisk_compact (fd);
8004aec: bb 00 08 00 mv r1,r24
8004af0: fb ff fd a5 calli 8004184 <rtems_fdisk_compact>
/*
* Get the next avaliable segment.
*/
sc = rtems_fdisk_segment_queue_pop_head (&fd->available);
8004af4: 37 0b 00 34 addi r11,r24,52
8004af8: b9 60 08 00 mv r1,r11
8004afc: fb ff f8 4e calli 8002c34 <rtems_fdisk_segment_queue_pop_head>
8004b00: b8 20 98 00 mv r19,r1
/*
* Is the flash disk full ?
*/
if (!sc)
8004b04: 5c 20 00 0f bne r1,r0,8004b40 <rtems_fdisk_ioctl+0x76c> <== ALWAYS TAKEN
{
/*
* 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))
8004b08: 2b 06 00 08 lw r6,(r24+8) <== NOT EXECUTED
8004b0c: 20 c6 00 02 andi r6,r6,0x2 <== NOT EXECUTED
8004b10: 44 c1 00 03 be r6,r1,8004b1c <rtems_fdisk_ioctl+0x748> <== NOT EXECUTED
rtems_fdisk_compact (fd);
8004b14: bb 00 08 00 mv r1,r24 <== NOT EXECUTED
8004b18: fb ff fd 9b calli 8004184 <rtems_fdisk_compact> <== NOT EXECUTED
/*
* Try again for some free space.
*/
sc = rtems_fdisk_segment_queue_pop_head (&fd->available);
8004b1c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8004b20: fb ff f8 45 calli 8002c34 <rtems_fdisk_segment_queue_pop_head><== NOT EXECUTED
8004b24: b8 20 98 00 mv r19,r1 <== NOT EXECUTED
if (!sc)
8004b28: 5c 20 00 06 bne r1,r0,8004b40 <rtems_fdisk_ioctl+0x76c> <== NOT EXECUTED
{
rtems_fdisk_error ("write-block: no available pages");
8004b2c: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
8004b30: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
8004b34: 38 21 5c 00 ori r1,r1,0x5c00 <== NOT EXECUTED
8004b38: fb ff fa 20 calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
8004b3c: e0 00 00 7f bi 8004d38 <rtems_fdisk_ioctl+0x964> <== NOT EXECUTED
return ENOSPC;
}
}
#if RTEMS_FDISK_TRACE
if (fd->info_level >= 3)
8004b40: 2b 07 00 6c lw r7,(r24+108)
8004b44: 34 06 00 02 mvi r6,2
8004b48: 50 c7 00 0d bgeu r6,r7,8004b7c <rtems_fdisk_ioctl+0x7a8> <== ALWAYS TAKEN
{
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
8004b4c: 37 8b 00 9c addi r11,sp,156 <== NOT EXECUTED
8004b50: bb 00 08 00 mv r1,r24 <== NOT EXECUTED
8004b54: ba 60 10 00 mv r2,r19 <== NOT EXECUTED
8004b58: b9 60 18 00 mv r3,r11 <== NOT EXECUTED
8004b5c: fb ff fa 70 calli 800351c <rtems_fdisk_queue_status> <== NOT EXECUTED
rtems_fdisk_info (fd, " write:%d=>%02d-%03d: queue check: %s",
8004b60: 2b 82 00 80 lw r2,(sp+128) <== NOT EXECUTED
8004b64: 2a 64 00 08 lw r4,(r19+8) <== NOT EXECUTED
8004b68: 2a 65 00 0c lw r5,(r19+12) <== NOT EXECUTED
8004b6c: bb 00 08 00 mv r1,r24 <== NOT EXECUTED
8004b70: bb 20 18 00 mv r3,r25 <== NOT EXECUTED
8004b74: b9 60 30 00 mv r6,r11 <== NOT EXECUTED
8004b78: fb ff f8 87 calli 8002d94 <rtems_fdisk_info> <== NOT EXECUTED
/*
* Find the next avaliable page in the segment.
*/
pd = sc->page_descriptors;
8004b7c: 2a 6b 00 10 lw r11,(r19+16)
for (page = 0; page < sc->pages; page++, pd++)
8004b80: 34 0e 00 00 mvi r14,0
8004b84: e0 00 00 58 bi 8004ce4 <rtems_fdisk_ioctl+0x910>
{
if (rtems_fdisk_page_desc_erased (pd))
8004b88: b9 60 08 00 mv r1,r11
8004b8c: fb ff f8 5b calli 8002cf8 <rtems_fdisk_page_desc_erased>
8004b90: 44 20 00 53 be r1,r0,8004cdc <rtems_fdisk_ioctl+0x908>
{
pd->crc = rtems_fdisk_page_checksum (buffer, fd->block_size);
8004b94: 2b 02 00 14 lw r2,(r24+20)
8004b98: ba a0 08 00 mv r1,r21
8004b9c: fb ff f8 5f calli 8002d18 <rtems_fdisk_page_checksum>
* 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;
8004ba0: 2d 68 00 02 lhu r8,(r11+2)
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);
8004ba4: 0d 61 00 00 sh (r11+0),r1
pd->block = block;
8004ba8: 59 79 00 04 sw (r11+4),r25
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: " \
8004bac: 2a 6a 00 00 lw r10,(r19+0)
* 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;
8004bb0: 21 06 ff fe andi r6,r8,0xfffe
if (rtems_fdisk_page_desc_erased (pd))
{
pd->crc = rtems_fdisk_page_checksum (buffer, fd->block_size);
pd->block = block;
bc->segment = sc;
8004bb4: 5a 13 00 00 sw (r16+0),r19
bc->page = page;
8004bb8: 5a 0e 00 04 sw (r16+4),r14
* 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;
8004bbc: 0d 66 00 02 sh (r11+2),r6
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);
8004bc0: b8 20 78 00 mv r15,r1
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: " \
8004bc4: 2a 64 00 08 lw r4,(r19+8)
8004bc8: 2a 65 00 0c lw r5,(r19+12)
8004bcc: 2a 68 00 1c lw r8,(r19+28)
8004bd0: 2a 6d 00 20 lw r13,(r19+32)
8004bd4: 2a 6c 00 24 lw r12,(r19+36)
8004bd8: 2b 89 00 6c lw r9,(sp+108)
8004bdc: 45 40 00 02 be r10,r0,8004be4 <rtems_fdisk_ioctl+0x810> <== ALWAYS TAKEN
8004be0: 2b 89 00 7c lw r9,(sp+124) <== NOT EXECUTED
8004be4: 2b 82 00 70 lw r2,(sp+112)
8004be8: 5b 86 00 10 sw (sp+16),r6
8004bec: bb 20 18 00 mv r3,r25
8004bf0: b9 c0 30 00 mv r6,r14
8004bf4: ba 20 38 00 mv r7,r17
8004bf8: bb 00 08 00 mv r1,r24
8004bfc: 5b 8d 00 04 sw (sp+4),r13
8004c00: 5b 89 00 0c sw (sp+12),r9
8004c04: 5b 8c 00 08 sw (sp+8),r12
8004c08: 5b 8f 00 14 sw (sp+20),r15
8004c0c: 5b 99 00 18 sw (sp+24),r25
8004c10: fb ff f8 61 calli 8002d94 <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);
8004c14: 2a 67 00 18 lw r7,(r19+24)
8004c18: bb 00 08 00 mv r1,r24
8004c1c: ba 60 10 00 mv r2,r19
8004c20: b5 c7 18 00 add r3,r14,r7
8004c24: ba a0 20 00 mv r4,r21
8004c28: fb ff f9 8c calli 8003258 <rtems_fdisk_seg_write_page>
8004c2c: b8 20 68 00 mv r13,r1
if (ret)
8004c30: 44 20 00 08 be r1,r0,8004c50 <rtems_fdisk_ioctl+0x87c> <== ALWAYS TAKEN
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%02d-%03d-%03d: write page failed: " \
8004c34: 2a 6b 00 08 lw r11,(r19+8) <== NOT EXECUTED
8004c38: 2a 6c 00 0c lw r12,(r19+12) <== NOT EXECUTED
8004c3c: f8 00 7b 49 calli 8023960 <strerror> <== NOT EXECUTED
8004c40: b8 20 30 00 mv r6,r1 <== NOT EXECUTED
8004c44: 2b 82 00 78 lw r2,(sp+120) <== NOT EXECUTED
8004c48: bb 00 08 00 mv r1,r24 <== NOT EXECUTED
8004c4c: e0 00 00 0f bi 8004c88 <rtems_fdisk_ioctl+0x8b4> <== NOT EXECUTED
strerror (ret), ret);
#endif
}
else
{
ret = rtems_fdisk_seg_write_page_desc (fd, sc, page, pd);
8004c50: bb 00 08 00 mv r1,r24
8004c54: ba 60 10 00 mv r2,r19
8004c58: b9 c0 18 00 mv r3,r14
8004c5c: b9 60 20 00 mv r4,r11
8004c60: fb ff f9 58 calli 80031c0 <rtems_fdisk_seg_write_page_desc>
8004c64: b8 20 68 00 mv r13,r1
if (ret)
8004c68: 44 20 00 0e be r1,r0,8004ca0 <rtems_fdisk_ioctl+0x8cc> <== ALWAYS TAKEN
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%02d-%03d-%03d: " \
8004c6c: 2a 6b 00 08 lw r11,(r19+8) <== NOT EXECUTED
8004c70: 2a 6c 00 0c lw r12,(r19+12) <== NOT EXECUTED
8004c74: 2a 0e 00 04 lw r14,(r16+4) <== NOT EXECUTED
8004c78: f8 00 7b 3a calli 8023960 <strerror> <== NOT EXECUTED
8004c7c: 2b 82 00 74 lw r2,(sp+116) <== NOT EXECUTED
8004c80: b8 20 30 00 mv r6,r1 <== NOT EXECUTED
8004c84: bb 00 08 00 mv r1,r24 <== NOT EXECUTED
8004c88: b9 60 18 00 mv r3,r11 <== NOT EXECUTED
8004c8c: b9 80 20 00 mv r4,r12 <== NOT EXECUTED
8004c90: b9 c0 28 00 mv r5,r14 <== NOT EXECUTED
8004c94: b9 a0 38 00 mv r7,r13 <== NOT EXECUTED
8004c98: fb ff f8 3f calli 8002d94 <rtems_fdisk_info> <== NOT EXECUTED
8004c9c: e0 00 00 04 bi 8004cac <rtems_fdisk_ioctl+0x8d8> <== NOT EXECUTED
strerror (ret), ret);
#endif
}
else
{
sc->pages_active++;
8004ca0: 2a 63 00 1c lw r3,(r19+28)
8004ca4: 34 63 00 01 addi r3,r3,1
8004ca8: 5a 63 00 1c sw (r19+28),r3
}
}
rtems_fdisk_queue_segment (fd, sc);
8004cac: bb 00 08 00 mv r1,r24
8004cb0: ba 60 10 00 mv r2,r19
8004cb4: fb ff fa 9f calli 8003730 <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)
8004cb8: 2b 06 00 28 lw r6,(r24+40)
8004cbc: 2b 03 00 24 lw r3,(r24+36)
8004cc0: 50 c3 00 17 bgeu r6,r3,8004d1c <rtems_fdisk_ioctl+0x948>
fd->starvations++;
8004cc4: 2b 03 00 70 lw r3,(r24+112)
}
rtems_fdisk_queue_segment (fd, sc);
if (rtems_fdisk_is_erased_blocks_starvation (fd))
rtems_fdisk_compact (fd);
8004cc8: bb 00 08 00 mv r1,r24
rtems_fdisk_is_erased_blocks_starvation (rtems_flashdisk* fd)
{
bool starvation = fd->erased_blocks < fd->starvation_threshold;
if (starvation)
fd->starvations++;
8004ccc: 34 63 00 01 addi r3,r3,1
8004cd0: 5b 03 00 70 sw (r24+112),r3
}
rtems_fdisk_queue_segment (fd, sc);
if (rtems_fdisk_is_erased_blocks_starvation (fd))
rtems_fdisk_compact (fd);
8004cd4: fb ff fd 2c calli 8004184 <rtems_fdisk_compact>
8004cd8: e0 00 00 11 bi 8004d1c <rtems_fdisk_ioctl+0x948>
* Find the next avaliable page in the segment.
*/
pd = sc->page_descriptors;
for (page = 0; page < sc->pages; page++, pd++)
8004cdc: 35 ce 00 01 addi r14,r14,1
8004ce0: 35 6b 00 08 addi r11,r11,8
8004ce4: 2a 71 00 14 lw r17,(r19+20)
8004ce8: 56 2e ff a8 bgu r17,r14,8004b88 <rtems_fdisk_ioctl+0x7b4> <== ALWAYS TAKEN
return ret;
}
}
rtems_fdisk_error ("write-block: no erased page descs in segment: %d-%d",
8004cec: 78 04 08 03 mvhi r4,0x803 <== NOT EXECUTED
8004cf0: 2a 62 00 08 lw r2,(r19+8) <== NOT EXECUTED
8004cf4: 2a 63 00 0c lw r3,(r19+12) <== NOT EXECUTED
8004cf8: b8 80 08 00 mv r1,r4 <== NOT EXECUTED
8004cfc: 38 21 5d 0c ori r1,r1,0x5d0c <== NOT EXECUTED
8004d00: fb ff f9 ae calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
sc->device, sc->segment);
sc->failed = true;
8004d04: 34 04 00 01 mvi r4,1 <== NOT EXECUTED
8004d08: 5a 64 00 28 sw (r19+40),r4 <== NOT EXECUTED
rtems_fdisk_queue_segment (fd, sc);
8004d0c: bb 00 08 00 mv r1,r24 <== NOT EXECUTED
8004d10: ba 60 10 00 mv r2,r19 <== NOT EXECUTED
8004d14: fb ff fa 87 calli 8003730 <rtems_fdisk_queue_segment> <== NOT EXECUTED
8004d18: e0 00 00 08 bi 8004d38 <rtems_fdisk_ioctl+0x964> <== NOT EXECUTED
fb = sg->length / fd->block_size;
data = sg->buffer;
for (b = 0; b < fb; b++, data += fd->block_size)
{
ret = rtems_fdisk_write_block (fd, sg->block + b, data);
if (ret)
8004d1c: 5d a0 00 07 bne r13,r0,8004d38 <rtems_fdisk_ioctl+0x964> <== NEVER TAKEN
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)
8004d20: 2b 03 00 14 lw r3,(r24+20)
8004d24: 36 d6 00 01 addi r22,r22,1
8004d28: b6 a3 a8 00 add r21,r21,r3
8004d2c: 2b 81 00 98 lw r1,(sp+152)
8004d30: 54 36 fe d3 bgu r1,r22,800487c <rtems_fdisk_ioctl+0x4a8>
8004d34: e0 00 01 f1 bi 80054f8 <rtems_fdisk_ioctl+0x1124>
if (ret)
break;
}
}
rtems_blkdev_request_done (req, ret ? RTEMS_IO_ERROR : RTEMS_SUCCESSFUL);
8004d38: 34 02 00 1b mvi r2,27 <== NOT EXECUTED
8004d3c: e0 00 00 05 bi 8004d50 <rtems_fdisk_ioctl+0x97c> <== NOT EXECUTED
{
rtems_blkdev_sg_buffer* sg = req->bufs;
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
8004d40: 2b 82 00 60 lw r2,(sp+96)
8004d44: 28 43 00 10 lw r3,(r2+16)
8004d48: 54 77 fe c6 bgu r3,r23,8004860 <rtems_fdisk_ioctl+0x48c>
if (ret)
break;
}
}
rtems_blkdev_request_done (req, ret ? RTEMS_IO_ERROR : RTEMS_SUCCESSFUL);
8004d4c: 34 02 00 00 mvi r2,0
8004d50: 2b 83 00 60 lw r3,(sp+96)
8004d54: 28 64 00 04 lw r4,(r3+4)
8004d58: b8 60 08 00 mv r1,r3
8004d5c: d8 80 00 00 call r4
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);
8004d60: 2b 81 00 94 lw r1,(sp+148)
8004d64: e0 00 01 b6 bi 800543c <rtems_fdisk_ioctl+0x1068>
break;
default:
errno = EINVAL;
8004d68: f8 00 6f e8 calli 8020d08 <__errno> <== NOT EXECUTED
8004d6c: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
8004d70: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
break;
8004d74: e0 00 01 b8 bi 8005454 <rtems_fdisk_ioctl+0x1080> <== NOT EXECUTED
}
}
break;
case RTEMS_FDISK_IOCTL_ERASE_DISK:
errno = rtems_fdisk_erase_disk (&rtems_flashdisks[minor]);
8004d78: f8 00 6f e4 calli 8020d08 <__errno> <== NOT EXECUTED
8004d7c: 2b 82 00 64 lw r2,(sp+100) <== NOT EXECUTED
8004d80: 29 6b 00 00 lw r11,(r11+0) <== NOT EXECUTED
8004d84: b8 20 80 00 mv r16,r1 <== NOT EXECUTED
for (device = 0; device < fd->device_count; device++)
{
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " erase-flash:%02d", device);
8004d88: 78 0f 08 03 mvhi r15,0x803 <== NOT EXECUTED
}
}
break;
case RTEMS_FDISK_IOCTL_ERASE_DISK:
errno = rtems_fdisk_erase_disk (&rtems_flashdisks[minor]);
8004d8c: b5 62 58 00 add r11,r11,r2 <== NOT EXECUTED
{
uint32_t device;
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "erase-disk");
8004d90: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
8004d94: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8004d98: 38 42 5d 40 ori r2,r2,0x5d40 <== NOT EXECUTED
rtems_fdisk_device_erase (const rtems_flashdisk* fd, uint32_t device)
{
const rtems_fdisk_driver_handlers* ops;
ops = fd->devices[device].descriptor->flash_ops;
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " device-erase: %02d", device);
8004d9c: 78 0e 08 03 mvhi r14,0x803 <== NOT EXECUTED
{
uint32_t device;
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "erase-disk");
8004da0: fb ff f7 fd calli 8002d94 <rtems_fdisk_info> <== NOT EXECUTED
8004da4: 34 0d 00 00 mvi r13,0 <== NOT EXECUTED
*/
static int
rtems_fdisk_erase_flash (const rtems_flashdisk* fd)
{
uint32_t device;
for (device = 0; device < fd->device_count; device++)
8004da8: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
{
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " erase-flash:%02d", device);
8004dac: 39 ef 5d 4c ori r15,r15,0x5d4c <== NOT EXECUTED
rtems_fdisk_device_erase (const rtems_flashdisk* fd, uint32_t device)
{
const rtems_fdisk_driver_handlers* ops;
ops = fd->devices[device].descriptor->flash_ops;
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " device-erase: %02d", device);
8004db0: 39 ce 5d 60 ori r14,r14,0x5d60 <== NOT EXECUTED
8004db4: e0 00 00 16 bi 8004e0c <rtems_fdisk_ioctl+0xa38> <== NOT EXECUTED
for (device = 0; device < fd->device_count; device++)
{
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " erase-flash:%02d", device);
8004db8: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
8004dbc: b9 80 18 00 mv r3,r12 <== NOT EXECUTED
8004dc0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8004dc4: fb ff f7 f4 calli 8002d94 <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;
8004dc8: 29 61 00 2c lw r1,(r11+44) <== NOT EXECUTED
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " device-erase: %02d", device);
8004dcc: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
8004dd0: b9 80 18 00 mv r3,r12 <== 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;
8004dd4: b4 2d 08 00 add r1,r1,r13 <== NOT EXECUTED
8004dd8: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED
8004ddc: 28 31 00 08 lw r17,(r1+8) <== NOT EXECUTED
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " device-erase: %02d", device);
8004de0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8004de4: fb ff f8 18 calli 8002e44 <rtems_fdisk_printf> <== NOT EXECUTED
#endif
return ops->erase_device (fd->devices[device].descriptor, device);
8004de8: 29 61 00 2c lw r1,(r11+44) <== NOT EXECUTED
8004dec: 2a 23 00 14 lw r3,(r17+20) <== NOT EXECUTED
8004df0: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
8004df4: b4 2d 08 00 add r1,r1,r13 <== NOT EXECUTED
8004df8: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED
8004dfc: 35 ad 00 0c addi r13,r13,12 <== NOT EXECUTED
8004e00: d8 60 00 00 call r3 <== NOT EXECUTED
rtems_fdisk_info (fd, " erase-flash:%02d", device);
#endif
ret = rtems_fdisk_device_erase (fd, device);
if (ret != 0)
8004e04: 5c 20 00 16 bne r1,r0,8004e5c <rtems_fdisk_ioctl+0xa88> <== NOT EXECUTED
*/
static int
rtems_fdisk_erase_flash (const rtems_flashdisk* fd)
{
uint32_t device;
for (device = 0; device < fd->device_count; device++)
8004e08: 35 8c 00 01 addi r12,r12,1 <== NOT EXECUTED
8004e0c: 29 61 00 30 lw r1,(r11+48) <== NOT EXECUTED
8004e10: 54 2c ff ea bgu r1,r12,8004db8 <rtems_fdisk_ioctl+0x9e4> <== NOT EXECUTED
8004e14: 34 0d 00 00 mvi r13,0 <== NOT EXECUTED
8004e18: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
8004e1c: e0 00 00 0a bi 8004e44 <rtems_fdisk_ioctl+0xa70> <== NOT EXECUTED
if (ret == 0)
{
for (device = 0; device < fd->device_count; device++)
{
if (!fd->devices[device].segments)
8004e20: 29 61 00 2c lw r1,(r11+44) <== NOT EXECUTED
8004e24: b4 2d 08 00 add r1,r1,r13 <== NOT EXECUTED
8004e28: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
8004e2c: 44 20 00 0a be r1,r0,8004e54 <rtems_fdisk_ioctl+0xa80> <== NOT EXECUTED
return ENOMEM;
ret = rtems_fdisk_recover_block_mappings (fd);
8004e30: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8004e34: fb ff fa be calli 800392c <rtems_fdisk_recover_block_mappings><== NOT EXECUTED
8004e38: 35 ad 00 0c addi r13,r13,12 <== NOT EXECUTED
if (ret)
8004e3c: 5c 20 00 08 bne r1,r0,8004e5c <rtems_fdisk_ioctl+0xa88> <== NOT EXECUTED
ret = rtems_fdisk_erase_flash (fd);
if (ret == 0)
{
for (device = 0; device < fd->device_count; device++)
8004e40: 35 8c 00 01 addi r12,r12,1 <== NOT EXECUTED
8004e44: 29 61 00 30 lw r1,(r11+48) <== NOT EXECUTED
8004e48: 54 2c ff f6 bgu r1,r12,8004e20 <rtems_fdisk_ioctl+0xa4c> <== NOT EXECUTED
8004e4c: 34 04 00 00 mvi r4,0 <== NOT EXECUTED
8004e50: e0 00 00 04 bi 8004e60 <rtems_fdisk_ioctl+0xa8c> <== NOT EXECUTED
{
if (!fd->devices[device].segments)
return ENOMEM;
8004e54: 34 04 00 0c mvi r4,12 <== NOT EXECUTED
8004e58: e0 00 00 02 bi 8004e60 <rtems_fdisk_ioctl+0xa8c> <== NOT EXECUTED
8004e5c: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
}
}
break;
case RTEMS_FDISK_IOCTL_ERASE_DISK:
errno = rtems_fdisk_erase_disk (&rtems_flashdisks[minor]);
8004e60: 5a 04 00 00 sw (r16+0),r4 <== NOT EXECUTED
break;
8004e64: e0 00 01 7c bi 8005454 <rtems_fdisk_ioctl+0x1080> <== NOT EXECUTED
case RTEMS_FDISK_IOCTL_COMPACT:
errno = rtems_fdisk_compact (&rtems_flashdisks[minor]);
8004e68: f8 00 6f a8 calli 8020d08 <__errno> <== NOT EXECUTED
8004e6c: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED
8004e70: 2b 83 00 64 lw r3,(sp+100) <== NOT EXECUTED
8004e74: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
8004e78: b4 43 08 00 add r1,r2,r3 <== NOT EXECUTED
8004e7c: fb ff fc c2 calli 8004184 <rtems_fdisk_compact> <== NOT EXECUTED
8004e80: 59 81 00 00 sw (r12+0),r1 <== NOT EXECUTED
break;
8004e84: e0 00 01 74 bi 8005454 <rtems_fdisk_ioctl+0x1080> <== NOT EXECUTED
case RTEMS_FDISK_IOCTL_ERASE_USED:
errno = rtems_fdisk_erase_used (&rtems_flashdisks[minor]);
8004e88: f8 00 6f a0 calli 8020d08 <__errno> <== NOT EXECUTED
8004e8c: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
8004e90: 29 6c 00 00 lw r12,(r11+0) <== NOT EXECUTED
8004e94: 2b 81 00 64 lw r1,(sp+100) <== NOT EXECUTED
*/
static int
rtems_fdisk_erase_used (rtems_flashdisk* fd)
{
rtems_fdisk_segment_ctl* sc;
int latched_ret = 0;
8004e98: 34 0b 00 00 mvi r11,0 <== 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]);
8004e9c: b5 81 60 00 add r12,r12,r1 <== NOT EXECUTED
rtems_fdisk_erase_used (rtems_flashdisk* fd)
{
rtems_fdisk_segment_ctl* sc;
int latched_ret = 0;
while ((sc = rtems_fdisk_segment_queue_pop_head (&fd->erase)))
8004ea0: 35 8e 00 4c addi r14,r12,76 <== NOT EXECUTED
8004ea4: e0 00 00 08 bi 8004ec4 <rtems_fdisk_ioctl+0xaf0> <== NOT EXECUTED
{
/*
* The segment will either end up on the available queue or
* the failed queue.
*/
int ret = rtems_fdisk_erase_segment (fd, sc);
8004ea8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8004eac: fb ff f9 ce calli 80035e4 <rtems_fdisk_erase_segment> <== NOT EXECUTED
if (ret && !latched_ret)
8004eb0: 7c 23 00 00 cmpnei r3,r1,0 <== NOT EXECUTED
8004eb4: 65 62 00 00 cmpei r2,r11,0 <== NOT EXECUTED
8004eb8: a0 62 10 00 and r2,r3,r2 <== NOT EXECUTED
8004ebc: 44 40 00 02 be r2,r0,8004ec4 <rtems_fdisk_ioctl+0xaf0> <== NOT EXECUTED
8004ec0: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
rtems_fdisk_erase_used (rtems_flashdisk* fd)
{
rtems_fdisk_segment_ctl* sc;
int latched_ret = 0;
while ((sc = rtems_fdisk_segment_queue_pop_head (&fd->erase)))
8004ec4: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
8004ec8: fb ff f7 5b calli 8002c34 <rtems_fdisk_segment_queue_pop_head><== NOT EXECUTED
8004ecc: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
8004ed0: 5c 20 ff f6 bne r1,r0,8004ea8 <rtems_fdisk_ioctl+0xad4> <== 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]);
8004ed4: 59 ab 00 00 sw (r13+0),r11 <== NOT EXECUTED
break;
8004ed8: e0 00 01 5f bi 8005454 <rtems_fdisk_ioctl+0x1080> <== NOT EXECUTED
case RTEMS_FDISK_IOCTL_MONITORING:
errno = rtems_fdisk_monitoring_data (&rtems_flashdisks[minor],
8004edc: f8 00 6f 8b calli 8020d08 <__errno> <== NOT EXECUTED
8004ee0: 2b 82 00 64 lw r2,(sp+100) <== NOT EXECUTED
8004ee4: 29 6b 00 00 lw r11,(r11+0) <== NOT EXECUTED
rtems_fdisk_monitor_data* data)
{
uint32_t i;
uint32_t j;
data->block_size = fd->block_size;
8004ee8: 2b 83 00 60 lw r3,(sp+96) <== 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],
8004eec: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
8004ef0: b5 62 58 00 add r11,r11,r2 <== NOT EXECUTED
rtems_fdisk_monitor_data* data)
{
uint32_t i;
uint32_t j;
data->block_size = fd->block_size;
8004ef4: 29 62 00 14 lw r2,(r11+20) <== NOT EXECUTED
data->block_count = fd->block_count;
8004ef8: 29 65 00 1c lw r5,(r11+28) <== NOT EXECUTED
data->unavail_blocks = fd->unavail_blocks;
data->device_count = fd->device_count;
8004efc: 29 6c 00 30 lw r12,(r11+48) <== NOT EXECUTED
rtems_fdisk_monitor_data* data)
{
uint32_t i;
uint32_t j;
data->block_size = fd->block_size;
8004f00: 58 62 00 00 sw (r3+0),r2 <== NOT EXECUTED
data->block_count = fd->block_count;
data->unavail_blocks = fd->unavail_blocks;
8004f04: 29 62 00 20 lw r2,(r11+32) <== NOT EXECUTED
{
uint32_t i;
uint32_t j;
data->block_size = fd->block_size;
data->block_count = fd->block_count;
8004f08: 58 65 00 04 sw (r3+4),r5 <== NOT EXECUTED
data->unavail_blocks = fd->unavail_blocks;
data->device_count = fd->device_count;
8004f0c: 58 6c 00 0c sw (r3+12),r12 <== 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;
8004f10: 58 62 00 08 sw (r3+8),r2 <== NOT EXECUTED
data->device_count = fd->device_count;
data->blocks_used = 0;
8004f14: 58 60 00 18 sw (r3+24),r0 <== NOT EXECUTED
8004f18: 34 04 00 00 mvi r4,0 <== NOT EXECUTED
for (i = 0; i < fd->block_count; i++)
8004f1c: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
8004f20: b8 60 08 00 mv r1,r3 <== NOT EXECUTED
8004f24: e0 00 00 0a bi 8004f4c <rtems_fdisk_ioctl+0xb78> <== NOT EXECUTED
if (fd->blocks[i].segment)
8004f28: 29 63 00 18 lw r3,(r11+24) <== NOT EXECUTED
8004f2c: b4 64 18 00 add r3,r3,r4 <== NOT EXECUTED
8004f30: 28 63 00 00 lw r3,(r3+0) <== NOT EXECUTED
8004f34: 44 60 00 04 be r3,r0,8004f44 <rtems_fdisk_ioctl+0xb70> <== NOT EXECUTED
data->blocks_used++;
8004f38: 28 23 00 18 lw r3,(r1+24) <== NOT EXECUTED
8004f3c: 34 63 00 01 addi r3,r3,1 <== NOT EXECUTED
8004f40: 58 23 00 18 sw (r1+24),r3 <== 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++)
8004f44: 34 42 00 01 addi r2,r2,1 <== NOT EXECUTED
8004f48: 34 84 00 08 addi r4,r4,8 <== NOT EXECUTED
8004f4c: 54 a2 ff f7 bgu r5,r2,8004f28 <rtems_fdisk_ioctl+0xb54> <== NOT EXECUTED
if (fd->blocks[i].segment)
data->blocks_used++;
data->segs_available = rtems_fdisk_segment_count_queue (&fd->available);
8004f50: 29 61 00 34 lw r1,(r11+52) <== NOT EXECUTED
8004f54: fb ff f9 64 calli 80034e4 <rtems_fdisk_segment_count_queue.clone.1><== NOT EXECUTED
8004f58: 2b 82 00 60 lw r2,(sp+96) <== NOT EXECUTED
8004f5c: 58 41 00 1c sw (r2+28),r1 <== NOT EXECUTED
data->segs_used = rtems_fdisk_segment_count_queue (&fd->used);
8004f60: 29 61 00 40 lw r1,(r11+64) <== NOT EXECUTED
8004f64: fb ff f9 60 calli 80034e4 <rtems_fdisk_segment_count_queue.clone.1><== NOT EXECUTED
8004f68: 2b 83 00 60 lw r3,(sp+96) <== NOT EXECUTED
8004f6c: 58 61 00 20 sw (r3+32),r1 <== NOT EXECUTED
data->segs_failed = rtems_fdisk_segment_count_queue (&fd->failed);
8004f70: 29 61 00 58 lw r1,(r11+88) <== NOT EXECUTED
8004f74: fb ff f9 5c calli 80034e4 <rtems_fdisk_segment_count_queue.clone.1><== NOT EXECUTED
8004f78: 2b 82 00 60 lw r2,(sp+96) <== NOT EXECUTED
data->page_count = 0;
data->pages_desc = 0;
data->pages_active = 0;
data->pages_used = 0;
data->pages_bad = 0;
data->seg_erases = 0;
8004f7c: 34 05 00 00 mvi r5,0 <== NOT EXECUTED
for (i = 0; i < fd->device_count; i++)
8004f80: 34 04 00 00 mvi r4,0 <== 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);
8004f84: 58 41 00 24 sw (r2+36),r1 <== NOT EXECUTED
data->segment_count = 0;
8004f88: 58 40 00 10 sw (r2+16),r0 <== NOT EXECUTED
data->page_count = 0;
8004f8c: 58 40 00 14 sw (r2+20),r0 <== NOT EXECUTED
data->pages_desc = 0;
8004f90: 58 40 00 2c sw (r2+44),r0 <== NOT EXECUTED
data->pages_active = 0;
8004f94: 58 40 00 30 sw (r2+48),r0 <== NOT EXECUTED
data->pages_used = 0;
8004f98: 58 40 00 34 sw (r2+52),r0 <== NOT EXECUTED
data->pages_bad = 0;
8004f9c: 58 40 00 38 sw (r2+56),r0 <== NOT EXECUTED
data->seg_erases = 0;
8004fa0: 58 40 00 28 sw (r2+40),r0 <== NOT EXECUTED
8004fa4: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
8004fa8: e0 00 00 29 bi 800504c <rtems_fdisk_ioctl+0xc78> <== NOT EXECUTED
for (i = 0; i < fd->device_count; i++)
{
data->segment_count += fd->devices[i].segment_count;
8004fac: 29 67 00 2c lw r7,(r11+44) <== NOT EXECUTED
8004fb0: 28 22 00 10 lw r2,(r1+16) <== NOT EXECUTED
8004fb4: 34 06 00 00 mvi r6,0 <== NOT EXECUTED
8004fb8: b4 e5 38 00 add r7,r7,r5 <== NOT EXECUTED
8004fbc: 28 e8 00 04 lw r8,(r7+4) <== NOT EXECUTED
for (j = 0; j < fd->devices[i].segment_count; j++)
8004fc0: 34 03 00 00 mvi r3,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;
8004fc4: b4 48 10 00 add r2,r2,r8 <== NOT EXECUTED
8004fc8: 58 22 00 10 sw (r1+16),r2 <== NOT EXECUTED
8004fcc: e0 00 00 1d bi 8005040 <rtems_fdisk_ioctl+0xc6c> <== NOT EXECUTED
for (j = 0; j < fd->devices[i].segment_count; j++)
{
rtems_fdisk_segment_ctl* sc = &fd->devices[i].segments[j];
8004fd0: 28 e2 00 00 lw r2,(r7+0) <== NOT EXECUTED
data->page_count += sc->pages;
8004fd4: 28 2a 00 14 lw r10,(r1+20) <== 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++)
8004fd8: 34 63 00 01 addi r3,r3,1 <== NOT EXECUTED
{
rtems_fdisk_segment_ctl* sc = &fd->devices[i].segments[j];
8004fdc: b4 46 10 00 add r2,r2,r6 <== NOT EXECUTED
data->page_count += sc->pages;
8004fe0: 28 49 00 14 lw r9,(r2+20) <== 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++)
8004fe4: 34 c6 00 30 addi r6,r6,48 <== NOT EXECUTED
{
rtems_fdisk_segment_ctl* sc = &fd->devices[i].segments[j];
data->page_count += sc->pages;
8004fe8: b5 49 48 00 add r9,r10,r9 <== NOT EXECUTED
8004fec: 58 29 00 14 sw (r1+20),r9 <== NOT EXECUTED
data->pages_desc += sc->pages_desc;
8004ff0: 28 2a 00 2c lw r10,(r1+44) <== NOT EXECUTED
8004ff4: 28 49 00 18 lw r9,(r2+24) <== NOT EXECUTED
8004ff8: b5 49 48 00 add r9,r10,r9 <== NOT EXECUTED
8004ffc: 58 29 00 2c sw (r1+44),r9 <== NOT EXECUTED
data->pages_active += sc->pages_active;
8005000: 28 2a 00 30 lw r10,(r1+48) <== NOT EXECUTED
8005004: 28 49 00 1c lw r9,(r2+28) <== NOT EXECUTED
8005008: b5 49 48 00 add r9,r10,r9 <== NOT EXECUTED
800500c: 58 29 00 30 sw (r1+48),r9 <== NOT EXECUTED
data->pages_used += sc->pages_used;
8005010: 28 2a 00 34 lw r10,(r1+52) <== NOT EXECUTED
8005014: 28 49 00 20 lw r9,(r2+32) <== NOT EXECUTED
8005018: b5 49 48 00 add r9,r10,r9 <== NOT EXECUTED
800501c: 58 29 00 34 sw (r1+52),r9 <== NOT EXECUTED
data->pages_bad += sc->pages_bad;
8005020: 28 2a 00 38 lw r10,(r1+56) <== NOT EXECUTED
8005024: 28 49 00 24 lw r9,(r2+36) <== NOT EXECUTED
data->seg_erases += sc->erased;
8005028: 28 42 00 2c lw r2,(r2+44) <== 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;
800502c: b5 49 48 00 add r9,r10,r9 <== NOT EXECUTED
8005030: 58 29 00 38 sw (r1+56),r9 <== NOT EXECUTED
data->seg_erases += sc->erased;
8005034: 28 29 00 28 lw r9,(r1+40) <== NOT EXECUTED
8005038: b5 22 10 00 add r2,r9,r2 <== NOT EXECUTED
800503c: 58 22 00 28 sw (r1+40),r2 <== 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++)
8005040: 55 03 ff e4 bgu r8,r3,8004fd0 <rtems_fdisk_ioctl+0xbfc> <== 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++)
8005044: 34 84 00 01 addi r4,r4,1 <== NOT EXECUTED
8005048: 34 a5 00 0c addi r5,r5,12 <== NOT EXECUTED
800504c: 55 84 ff d8 bgu r12,r4,8004fac <rtems_fdisk_ioctl+0xbd8> <== NOT EXECUTED
data->pages_bad += sc->pages_bad;
data->seg_erases += sc->erased;
}
}
data->info_level = fd->info_level;
8005050: 29 62 00 6c lw r2,(r11+108) <== NOT EXECUTED
8005054: 2b 83 00 60 lw r3,(sp+96) <== NOT EXECUTED
8005058: 58 62 00 3c sw (r3+60),r2 <== 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],
800505c: 59 a0 00 00 sw (r13+0),r0 <== NOT EXECUTED
(rtems_fdisk_monitor_data*) argp);
break;
8005060: e0 00 00 fd bi 8005454 <rtems_fdisk_ioctl+0x1080> <== NOT EXECUTED
case RTEMS_FDISK_IOCTL_INFO_LEVEL:
rtems_flashdisks[minor].info_level = (uintptr_t) argp;
8005064: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED
8005068: 2b 81 00 64 lw r1,(sp+100) <== NOT EXECUTED
800506c: 2b 83 00 60 lw r3,(sp+96) <== NOT EXECUTED
8005070: b4 41 10 00 add r2,r2,r1 <== NOT EXECUTED
8005074: 58 43 00 6c sw (r2+108),r3 <== NOT EXECUTED
break;
8005078: e0 00 00 f7 bi 8005454 <rtems_fdisk_ioctl+0x1080> <== NOT EXECUTED
case RTEMS_FDISK_IOCTL_PRINT_STATUS:
errno = rtems_fdisk_print_status (&rtems_flashdisks[minor]);
800507c: f8 00 6f 23 calli 8020d08 <__errno>
8005080: 5b 81 00 60 sw (sp+96),r1
8005084: 29 6b 00 00 lw r11,(r11+0)
8005088: 2b 81 00 64 lw r1,(sp+100)
800508c: b5 61 58 00 add r11,r11,r1
*/
static int
rtems_fdisk_print_status (rtems_flashdisk* fd)
{
#if RTEMS_FDISK_TRACE
uint32_t current_info_level = fd->info_level;
8005090: 29 62 00 6c lw r2,(r11+108)
uint32_t count;
uint32_t device;
fd->info_level = 3;
rtems_fdisk_printf (fd,
8005094: 29 64 00 04 lw r4,(r11+4)
8005098: 29 63 00 00 lw r3,(r11+0)
*/
static int
rtems_fdisk_print_status (rtems_flashdisk* fd)
{
#if RTEMS_FDISK_TRACE
uint32_t current_info_level = fd->info_level;
800509c: 5b 82 00 68 sw (sp+104),r2
uint32_t total;
uint32_t count;
uint32_t device;
fd->info_level = 3;
80050a0: 34 02 00 03 mvi r2,3
80050a4: 59 62 00 6c sw (r11+108),r2
rtems_fdisk_printf (fd,
80050a8: 78 02 08 03 mvhi r2,0x803
80050ac: 38 42 5d 74 ori r2,r2,0x5d74
80050b0: b9 60 08 00 mv r1,r11
80050b4: fb ff f7 64 calli 8002e44 <rtems_fdisk_printf>
"Flash Disk Driver Status : %d.%d", fd->major, fd->minor);
rtems_fdisk_printf (fd, "Block count\t%d", fd->block_count);
80050b8: 29 63 00 1c lw r3,(r11+28)
80050bc: 78 02 08 03 mvhi r2,0x803
80050c0: 38 42 5d 98 ori r2,r2,0x5d98
80050c4: b9 60 08 00 mv r1,r11
80050c8: fb ff f7 5f calli 8002e44 <rtems_fdisk_printf>
rtems_fdisk_printf (fd, "Unavail blocks\t%d", fd->unavail_blocks);
80050cc: 29 63 00 20 lw r3,(r11+32)
80050d0: 78 02 08 03 mvhi r2,0x803
80050d4: 38 42 5d a8 ori r2,r2,0x5da8
80050d8: b9 60 08 00 mv r1,r11
80050dc: fb ff f7 5a calli 8002e44 <rtems_fdisk_printf>
rtems_fdisk_printf (fd, "Starvation threshold\t%d", fd->starvation_threshold);
80050e0: 29 63 00 24 lw r3,(r11+36)
80050e4: 78 02 08 03 mvhi r2,0x803
80050e8: 38 42 5d bc ori r2,r2,0x5dbc
80050ec: b9 60 08 00 mv r1,r11
80050f0: fb ff f7 55 calli 8002e44 <rtems_fdisk_printf>
rtems_fdisk_printf (fd, "Starvations\t%d", fd->starvations);
80050f4: 29 63 00 70 lw r3,(r11+112)
80050f8: 78 02 08 03 mvhi r2,0x803
80050fc: 38 42 5d d4 ori r2,r2,0x5dd4
8005100: b9 60 08 00 mv r1,r11
8005104: fb ff f7 50 calli 8002e44 <rtems_fdisk_printf>
count = rtems_fdisk_segment_count_queue (&fd->available);
8005108: 29 61 00 34 lw r1,(r11+52)
800510c: fb ff f8 f6 calli 80034e4 <rtems_fdisk_segment_count_queue.clone.1>
total = count;
rtems_fdisk_printf (fd, "Available queue\t%ld (%ld)",
8005110: 29 64 00 3c lw r4,(r11+60)
rtems_fdisk_printf (fd, "Block count\t%d", fd->block_count);
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);
8005114: b8 20 60 00 mv r12,r1
total = count;
rtems_fdisk_printf (fd, "Available queue\t%ld (%ld)",
8005118: 78 02 08 03 mvhi r2,0x803
800511c: b9 80 18 00 mv r3,r12
8005120: 38 42 5d e4 ori r2,r2,0x5de4
8005124: b9 60 08 00 mv r1,r11
8005128: fb ff f7 47 calli 8002e44 <rtems_fdisk_printf>
count, rtems_fdisk_segment_queue_count (&fd->available));
count = rtems_fdisk_segment_count_queue (&fd->used);
800512c: 29 61 00 40 lw r1,(r11+64)
8005130: fb ff f8 ed calli 80034e4 <rtems_fdisk_segment_count_queue.clone.1>
total += count;
rtems_fdisk_printf (fd, "Used queue\t%ld (%ld)",
8005134: 29 64 00 48 lw r4,(r11+72)
8005138: 78 02 08 03 mvhi r2,0x803
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)",
count, rtems_fdisk_segment_queue_count (&fd->available));
count = rtems_fdisk_segment_count_queue (&fd->used);
800513c: b8 20 18 00 mv r3,r1
total += count;
rtems_fdisk_printf (fd, "Used queue\t%ld (%ld)",
8005140: 38 42 5e 00 ori r2,r2,0x5e00
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;
8005144: b4 2c 60 00 add r12,r1,r12
rtems_fdisk_printf (fd, "Used queue\t%ld (%ld)",
8005148: b9 60 08 00 mv r1,r11
800514c: fb ff f7 3e calli 8002e44 <rtems_fdisk_printf>
count, rtems_fdisk_segment_queue_count (&fd->used));
count = rtems_fdisk_segment_count_queue (&fd->erase);
8005150: 29 61 00 4c lw r1,(r11+76)
8005154: fb ff f8 e4 calli 80034e4 <rtems_fdisk_segment_count_queue.clone.1>
total += count;
rtems_fdisk_printf (fd, "Erase queue\t%ld (%ld)",
8005158: 29 64 00 54 lw r4,(r11+84)
800515c: 78 02 08 03 mvhi r2,0x803
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)",
count, rtems_fdisk_segment_queue_count (&fd->used));
count = rtems_fdisk_segment_count_queue (&fd->erase);
8005160: b8 20 18 00 mv r3,r1
total += count;
rtems_fdisk_printf (fd, "Erase queue\t%ld (%ld)",
8005164: 38 42 5e 18 ori r2,r2,0x5e18
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;
8005168: b5 81 60 00 add r12,r12,r1
rtems_fdisk_printf (fd, "Erase queue\t%ld (%ld)",
800516c: b9 60 08 00 mv r1,r11
8005170: fb ff f7 35 calli 8002e44 <rtems_fdisk_printf>
count, rtems_fdisk_segment_queue_count (&fd->erase));
count = rtems_fdisk_segment_count_queue (&fd->failed);
8005174: 29 61 00 58 lw r1,(r11+88)
8005178: fb ff f8 db calli 80034e4 <rtems_fdisk_segment_count_queue.clone.1>
800517c: b8 20 20 00 mv r4,r1
total += count;
rtems_fdisk_printf (fd, "Failed queue\t%ld (%ld)",
8005180: b8 80 18 00 mv r3,r4
8005184: 29 64 00 60 lw r4,(r11+96)
8005188: 78 02 08 03 mvhi r2,0x803
800518c: 38 42 5e 30 ori r2,r2,0x5e30
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;
8005190: b5 81 60 00 add r12,r12,r1
rtems_fdisk_printf (fd, "Failed queue\t%ld (%ld)",
8005194: b9 60 08 00 mv r1,r11
8005198: fb ff f7 2b calli 8002e44 <rtems_fdisk_printf>
count, rtems_fdisk_segment_queue_count (&fd->failed));
count = 0;
for (device = 0; device < fd->device_count; device++)
800519c: 29 63 00 30 lw r3,(r11+48)
80051a0: 34 05 00 00 mvi r5,0
80051a4: 34 02 00 00 mvi 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;
80051a8: 34 04 00 00 mvi r4,0
80051ac: e0 00 00 07 bi 80051c8 <rtems_fdisk_ioctl+0xdf4>
for (device = 0; device < fd->device_count; device++)
count += fd->devices[device].segment_count;
80051b0: 29 61 00 2c lw r1,(r11+44)
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++)
80051b4: 34 42 00 01 addi r2,r2,1
count += fd->devices[device].segment_count;
80051b8: b4 25 08 00 add r1,r1,r5
80051bc: 28 21 00 04 lw r1,(r1+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++)
80051c0: 34 a5 00 0c addi r5,r5,12
count += fd->devices[device].segment_count;
80051c4: b4 81 20 00 add r4,r4,r1
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++)
80051c8: 54 62 ff fa bgu r3,r2,80051b0 <rtems_fdisk_ioctl+0xddc>
count += fd->devices[device].segment_count;
rtems_fdisk_printf (fd, "Queue total\t%ld of %ld, %s", total, count,
80051cc: 78 05 08 03 mvhi r5,0x803
80051d0: 38 a5 59 50 ori r5,r5,0x5950
80051d4: 5d 84 00 03 bne r12,r4,80051e0 <rtems_fdisk_ioctl+0xe0c> <== NEVER TAKEN
80051d8: 78 05 08 03 mvhi r5,0x803
80051dc: 38 a5 59 4c ori r5,r5,0x594c
80051e0: 78 02 08 03 mvhi r2,0x803
80051e4: 38 42 5e 48 ori r2,r2,0x5e48
80051e8: b9 80 18 00 mv r3,r12
80051ec: b9 60 08 00 mv r1,r11
80051f0: fb ff f7 15 calli 8002e44 <rtems_fdisk_printf>
total == count ? "ok" : "MISSING");
rtems_fdisk_printf (fd, "Device count\t%d", fd->device_count);
80051f4: 29 63 00 30 lw r3,(r11+48)
80051f8: 78 02 08 03 mvhi r2,0x803
for (block = 0; block < fd->block_count; block++)
{
if ((fd->blocks[block].segment == sc) &&
(fd->blocks[block].page == page) && !is_active)
rtems_fdisk_printf (fd,
80051fc: 78 13 08 03 mvhi r19,0x803
{
if (fd->blocks[block].segment == sc)
count++;
}
rtems_fdisk_printf (fd, " %3ld %s p:%3ld a:%3ld/%3ld" \
8005200: 78 12 08 03 mvhi r18,0x803
count += fd->devices[device].segment_count;
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);
8005204: b9 60 08 00 mv r1,r11
8005208: 38 42 5e 64 ori r2,r2,0x5e64
for (device = 0; device < fd->device_count; device++)
{
uint32_t block;
uint32_t seg;
rtems_fdisk_printf (fd, " Device\t\t%ld", device);
800520c: 78 15 08 03 mvhi r21,0x803
rtems_fdisk_printf (fd, " Segment count\t%ld",
8005210: 78 14 08 03 mvhi r20,0x803
for (block = 0; block < fd->block_count; block++)
{
if ((fd->blocks[block].segment == sc) &&
(fd->blocks[block].page == page) && !is_active)
rtems_fdisk_printf (fd,
8005214: 3a 73 5e 98 ori r19,r19,0x5e98
{
if (fd->blocks[block].segment == sc)
count++;
}
rtems_fdisk_printf (fd, " %3ld %s p:%3ld a:%3ld/%3ld" \
8005218: 3a 52 5e c8 ori r18,r18,0x5ec8
count += fd->devices[device].segment_count;
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);
800521c: fb ff f7 0a calli 8002e44 <rtems_fdisk_printf>
8005220: 34 0f 00 00 mvi r15,0
for (device = 0; device < fd->device_count; device++)
8005224: 34 0e 00 00 mvi r14,0
{
uint32_t block;
uint32_t seg;
rtems_fdisk_printf (fd, " Device\t\t%ld", device);
8005228: 3a b5 5e 74 ori r21,r21,0x5e74
rtems_fdisk_printf (fd, " Segment count\t%ld",
800522c: 3a 94 5e 84 ori r20,r20,0x5e84
8005230: 5b 93 00 6c sw (sp+108),r19
8005234: 5b 92 00 70 sw (sp+112),r18
8005238: e0 00 00 69 bi 80053dc <rtems_fdisk_ioctl+0x1008>
for (device = 0; device < fd->device_count; device++)
{
uint32_t block;
uint32_t seg;
rtems_fdisk_printf (fd, " Device\t\t%ld", device);
800523c: ba a0 10 00 mv r2,r21
8005240: b9 c0 18 00 mv r3,r14
8005244: b9 60 08 00 mv r1,r11
8005248: fb ff f6 ff calli 8002e44 <rtems_fdisk_printf>
rtems_fdisk_printf (fd, " Segment count\t%ld",
800524c: 29 63 00 2c lw r3,(r11+44)
8005250: b9 60 08 00 mv r1,r11
8005254: ba 80 10 00 mv r2,r20
8005258: b4 6f 18 00 add r3,r3,r15
800525c: 28 63 00 04 lw r3,(r3+4)
8005260: 34 16 00 00 mvi r22,0
fd->devices[device].segment_count);
for (seg = 0; seg < fd->devices[device].segment_count; seg++)
8005264: 34 10 00 00 mvi r16,0
{
uint32_t block;
uint32_t seg;
rtems_fdisk_printf (fd, " Device\t\t%ld", device);
rtems_fdisk_printf (fd, " Segment count\t%ld",
8005268: fb ff f6 f7 calli 8002e44 <rtems_fdisk_printf>
800526c: e0 00 00 56 bi 80053c4 <rtems_fdisk_ioctl+0xff0>
fd->devices[device].segment_count);
for (seg = 0; seg < fd->devices[device].segment_count; seg++)
{
rtems_fdisk_segment_ctl* sc = &fd->devices[device].segments[seg];
8005270: 28 2c 00 00 lw r12,(r1+0)
uint32_t active = 0;
uint32_t used = 0;
bool is_active = false;
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
8005274: 37 83 00 9c addi r3,sp,156
8005278: b9 60 08 00 mv r1,r11
rtems_fdisk_printf (fd, " Segment count\t%ld",
fd->devices[device].segment_count);
for (seg = 0; seg < fd->devices[device].segment_count; seg++)
{
rtems_fdisk_segment_ctl* sc = &fd->devices[device].segments[seg];
800527c: b5 96 60 00 add r12,r12,r22
uint32_t active = 0;
uint32_t used = 0;
bool is_active = false;
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
8005280: b9 80 10 00 mv r2,r12
8005284: fb ff f8 a6 calli 800351c <rtems_fdisk_queue_status>
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;
8005288: 34 13 00 00 mvi r19,0
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
800528c: 34 1b 00 00 mvi fp,0
{
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;
8005290: 34 19 00 00 mvi r25,0
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;
8005294: 34 17 00 00 mvi r23,0
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;
8005298: 34 18 00 00 mvi r24,0
bool is_active = false;
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
for (page = 0; page < sc->pages; page++)
800529c: 34 0d 00 00 mvi r13,0
80052a0: e0 00 00 27 bi 800533c <rtems_fdisk_ioctl+0xf68>
{
if (rtems_fdisk_page_desc_erased (&sc->page_descriptors[page]))
80052a4: 29 91 00 10 lw r17,(r12+16)
80052a8: b6 3b 88 00 add r17,r17,fp
80052ac: ba 20 08 00 mv r1,r17
80052b0: fb ff f6 92 calli 8002cf8 <rtems_fdisk_page_desc_erased>
80052b4: 44 20 00 03 be r1,r0,80052c0 <rtems_fdisk_ioctl+0xeec>
erased++;
80052b8: 37 18 00 01 addi r24,r24,1
80052bc: e0 00 00 0b bi 80052e8 <rtems_fdisk_ioctl+0xf14>
}
rtems_flashdisk_count = rtems_flashdisk_configuration_size;
return RTEMS_SUCCESSFUL;
}
80052c0: 2e 24 00 02 lhu r4,(r17+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],
80052c4: 20 83 00 01 andi r3,r4,0x1
80052c8: 5c 61 00 08 bne r3,r1,80052e8 <rtems_fdisk_ioctl+0xf14> <== NEVER TAKEN
RTEMS_FDISK_PAGE_ACTIVE))
{
if (rtems_fdisk_page_desc_flags_set (&sc->page_descriptors[page],
80052cc: 20 84 00 02 andi r4,r4,0x2
80052d0: 20 84 ff ff andi r4,r4,0xffff
80052d4: 5c 83 00 03 bne r4,r3,80052e0 <rtems_fdisk_ioctl+0xf0c>
RTEMS_FDISK_PAGE_USED))
used++;
80052d8: 37 39 00 01 addi r25,r25,1
80052dc: e0 00 00 03 bi 80052e8 <rtems_fdisk_ioctl+0xf14>
else
{
active++;
80052e0: 36 f7 00 01 addi r23,r23,1
is_active = true;
80052e4: 34 13 00 01 mvi r19,1
80052e8: 34 12 00 00 mvi r18,0
}
}
for (block = 0; block < fd->block_count; block++)
80052ec: 34 11 00 00 mvi r17,0
80052f0: e0 00 00 0f bi 800532c <rtems_fdisk_ioctl+0xf58>
{
if ((fd->blocks[block].segment == sc) &&
80052f4: 29 61 00 18 lw r1,(r11+24)
80052f8: b4 32 08 00 add r1,r1,r18
80052fc: 28 23 00 00 lw r3,(r1+0)
8005300: 5c 6c 00 09 bne r3,r12,8005324 <rtems_fdisk_ioctl+0xf50>
8005304: 28 21 00 04 lw r1,(r1+4)
8005308: 5c 2d 00 07 bne r1,r13,8005324 <rtems_fdisk_ioctl+0xf50>
(fd->blocks[block].page == page) && !is_active)
800530c: 5e 60 00 06 bne r19,r0,8005324 <rtems_fdisk_ioctl+0xf50> <== ALWAYS TAKEN
rtems_fdisk_printf (fd,
8005310: 2b 82 00 6c lw r2,(sp+108) <== NOT EXECUTED
8005314: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8005318: b9 a0 18 00 mv r3,r13 <== NOT EXECUTED
800531c: ba 20 20 00 mv r4,r17 <== NOT EXECUTED
8005320: fb ff f6 c9 calli 8002e44 <rtems_fdisk_printf> <== NOT EXECUTED
active++;
is_active = true;
}
}
for (block = 0; block < fd->block_count; block++)
8005324: 36 31 00 01 addi r17,r17,1
8005328: 36 52 00 08 addi r18,r18,8
800532c: 29 61 00 1c lw r1,(r11+28)
8005330: 54 31 ff f1 bgu r1,r17,80052f4 <rtems_fdisk_ioctl+0xf20>
bool is_active = false;
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
for (page = 0; page < sc->pages; page++)
8005334: 35 ad 00 01 addi r13,r13,1
8005338: 37 7b 00 08 addi fp,fp,8
800533c: 29 85 00 14 lw r5,(r12+20)
8005340: 54 ad ff d9 bgu r5,r13,80052a4 <rtems_fdisk_ioctl+0xed0>
page, block);
}
}
count = 0;
for (block = 0; block < fd->block_count; block++)
8005344: 29 66 00 1c lw r6,(r11+28)
8005348: 34 04 00 00 mvi r4,0
800534c: 34 03 00 00 mvi r3,0
8005350: 34 01 00 00 mvi r1,0
8005354: e0 00 00 08 bi 8005374 <rtems_fdisk_ioctl+0xfa0>
{
if (fd->blocks[block].segment == sc)
8005358: 29 67 00 18 lw r7,(r11+24)
page, block);
}
}
count = 0;
for (block = 0; block < fd->block_count; block++)
800535c: 34 63 00 01 addi r3,r3,1
{
if (fd->blocks[block].segment == sc)
8005360: b4 e4 38 00 add r7,r7,r4
8005364: 28 e7 00 00 lw r7,(r7+0)
page, block);
}
}
count = 0;
for (block = 0; block < fd->block_count; block++)
8005368: 34 84 00 08 addi r4,r4,8
{
if (fd->blocks[block].segment == sc)
count++;
800536c: e4 ec 38 00 cmpe r7,r7,r12
8005370: b4 27 08 00 add r1,r1,r7
page, block);
}
}
count = 0;
for (block = 0; block < fd->block_count; block++)
8005374: 54 c3 ff f9 bgu r6,r3,8005358 <rtems_fdisk_ioctl+0xf84>
rtems_fdisk_printf (fd, " %3ld %s p:%3ld a:%3ld/%3ld" \
" u:%3ld/%3ld e:%3ld/%3ld br:%ld",
seg, queues,
sc->pages, sc->pages_active, active,
sc->pages_used, used, erased,
sc->pages - (sc->pages_active +
8005378: 29 86 00 1c lw r6,(r12+28)
sc->pages_used + sc->pages_bad),
800537c: 29 88 00 20 lw r8,(r12+32)
{
if (fd->blocks[block].segment == sc)
count++;
}
rtems_fdisk_printf (fd, " %3ld %s p:%3ld a:%3ld/%3ld" \
8005380: 5b 99 00 04 sw (sp+4),r25
8005384: 5b 98 00 08 sw (sp+8),r24
* @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)
8005388: 29 83 00 24 lw r3,(r12+36)
{
if (fd->blocks[block].segment == sc)
count++;
}
rtems_fdisk_printf (fd, " %3ld %s p:%3ld a:%3ld/%3ld" \
800538c: 2b 82 00 70 lw r2,(sp+112)
8005390: 5b 81 00 10 sw (sp+16),r1
* @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)
8005394: c8 03 18 00 sub r3,r0,r3
rtems_fdisk_printf (fd, " %3ld %s p:%3ld a:%3ld/%3ld" \
" u:%3ld/%3ld e:%3ld/%3ld br:%ld",
seg, queues,
sc->pages, sc->pages_active, active,
sc->pages_used, used, erased,
sc->pages - (sc->pages_active +
8005398: c8 66 18 00 sub r3,r3,r6
sc->pages_used + sc->pages_bad),
800539c: c8 68 18 00 sub r3,r3,r8
{
if (fd->blocks[block].segment == sc)
count++;
}
rtems_fdisk_printf (fd, " %3ld %s p:%3ld a:%3ld/%3ld" \
80053a0: b4 65 18 00 add r3,r3,r5
80053a4: 5b 83 00 0c sw (sp+12),r3
80053a8: b9 60 08 00 mv r1,r11
80053ac: ba 00 18 00 mv r3,r16
80053b0: 37 84 00 9c addi r4,sp,156
80053b4: ba e0 38 00 mv r7,r23
80053b8: fb ff f6 a3 calli 8002e44 <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++)
80053bc: 36 10 00 01 addi r16,r16,1
80053c0: 36 d6 00 30 addi r22,r22,48
80053c4: 29 61 00 2c lw r1,(r11+44)
80053c8: b4 2f 08 00 add r1,r1,r15
80053cc: 28 23 00 04 lw r3,(r1+4)
80053d0: 54 70 ff a8 bgu r3,r16,8005270 <rtems_fdisk_ioctl+0xe9c>
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++)
80053d4: 35 ce 00 01 addi r14,r14,1
80053d8: 35 ef 00 0c addi r15,r15,12
80053dc: 29 61 00 30 lw r1,(r11+48)
80053e0: 54 2e ff 97 bgu r1,r14,800523c <rtems_fdisk_ioctl+0xe68>
}
{
rtems_fdisk_segment_ctl* sc = fd->used.head;
int count = 0;
rtems_fdisk_printf (fd, "Used List:");
80053e4: 78 02 08 03 mvhi r2,0x803
80053e8: b9 60 08 00 mv r1,r11
80053ec: 38 42 5f 04 ori r2,r2,0x5f04
while (sc)
{
rtems_fdisk_printf (fd, " %3d %02d:%03d u:%3ld",
80053f0: 78 0d 08 03 mvhi r13,0x803
count);
}
}
{
rtems_fdisk_segment_ctl* sc = fd->used.head;
80053f4: 29 6c 00 40 lw r12,(r11+64)
int count = 0;
80053f8: 34 0e 00 00 mvi r14,0
rtems_fdisk_printf (fd, "Used List:");
80053fc: fb ff f6 92 calli 8002e44 <rtems_fdisk_printf>
while (sc)
{
rtems_fdisk_printf (fd, " %3d %02d:%03d u:%3ld",
8005400: 39 ad 5f 10 ori r13,r13,0x5f10
8005404: e0 00 00 0a bi 800542c <rtems_fdisk_ioctl+0x1058>
8005408: 29 84 00 08 lw r4,(r12+8)
800540c: 29 85 00 0c lw r5,(r12+12)
8005410: 29 86 00 20 lw r6,(r12+32)
8005414: b9 c0 18 00 mv r3,r14
8005418: b9 60 08 00 mv r1,r11
800541c: b9 a0 10 00 mv r2,r13
8005420: fb ff f6 89 calli 8002e44 <rtems_fdisk_printf>
count, sc->device, sc->segment, sc->pages_used);
sc = sc->next;
8005424: 29 8c 00 00 lw r12,(r12+0)
count++;
8005428: 35 ce 00 01 addi r14,r14,1
{
rtems_fdisk_segment_ctl* sc = fd->used.head;
int count = 0;
rtems_fdisk_printf (fd, "Used List:");
while (sc)
800542c: 5d 80 ff f7 bne r12,r0,8005408 <rtems_fdisk_ioctl+0x1034>
count, sc->device, sc->segment, sc->pages_used);
sc = sc->next;
count++;
}
}
fd->info_level = current_info_level;
8005430: 2b 83 00 68 lw r3,(sp+104)
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]);
8005434: 2b 81 00 60 lw r1,(sp+96)
count, sc->device, sc->segment, sc->pages_used);
sc = sc->next;
count++;
}
}
fd->info_level = current_info_level;
8005438: 59 63 00 6c sw (r11+108),r3
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]);
800543c: 58 20 00 00 sw (r1+0),r0
break;
8005440: e0 00 00 05 bi 8005454 <rtems_fdisk_ioctl+0x1080>
default:
rtems_blkdev_ioctl (dd, req, argp);
8005444: 2b 83 00 60 lw r3,(sp+96)
8005448: b9 a0 08 00 mv r1,r13
800544c: b9 80 10 00 mv r2,r12
8005450: f8 00 39 fe calli 8013c48 <rtems_blkdev_ioctl>
break;
}
sc = rtems_semaphore_release (rtems_flashdisks[minor].lock);
8005454: 78 02 08 04 mvhi r2,0x804
8005458: 38 42 b7 d8 ori r2,r2,0xb7d8
800545c: 28 42 00 00 lw r2,(r2+0)
8005460: 2b 83 00 64 lw r3,(sp+100)
8005464: b4 43 08 00 add r1,r2,r3
8005468: 28 21 00 64 lw r1,(r1+100)
800546c: f8 00 10 00 calli 800946c <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
8005470: 44 20 00 04 be r1,r0,8005480 <rtems_fdisk_ioctl+0x10ac> <== ALWAYS TAKEN
errno = EIO;
8005474: f8 00 6e 25 calli 8020d08 <__errno> <== NOT EXECUTED
8005478: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
800547c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
}
return errno == 0 ? 0 : -1;
8005480: f8 00 6e 22 calli 8020d08 <__errno>
8005484: 28 21 00 00 lw r1,(r1+0)
8005488: 7c 21 00 00 cmpnei r1,r1,0
}
800548c: c8 01 08 00 sub r1,r0,r1
8005490: 2b 9d 00 1c lw ra,(sp+28)
8005494: 2b 8b 00 5c lw r11,(sp+92)
8005498: 2b 8c 00 58 lw r12,(sp+88)
800549c: 2b 8d 00 54 lw r13,(sp+84)
80054a0: 2b 8e 00 50 lw r14,(sp+80)
80054a4: 2b 8f 00 4c lw r15,(sp+76)
80054a8: 2b 90 00 48 lw r16,(sp+72)
80054ac: 2b 91 00 44 lw r17,(sp+68)
80054b0: 2b 92 00 40 lw r18,(sp+64)
80054b4: 2b 93 00 3c lw r19,(sp+60)
80054b8: 2b 94 00 38 lw r20,(sp+56)
80054bc: 2b 95 00 34 lw r21,(sp+52)
80054c0: 2b 96 00 30 lw r22,(sp+48)
80054c4: 2b 97 00 2c lw r23,(sp+44)
80054c8: 2b 98 00 28 lw r24,(sp+40)
80054cc: 2b 99 00 24 lw r25,(sp+36)
80054d0: 2b 9b 00 20 lw fp,(sp+32)
80054d4: 37 9c 00 a0 addi sp,sp,160
80054d8: c3 a0 00 00 ret
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)
80054dc: 29 81 00 14 lw r1,(r12+20)
80054e0: 37 7b 00 01 addi fp,fp,1
80054e4: b5 c1 70 00 add r14,r14,r1
80054e8: e3 ff fc a6 bi 8004780 <rtems_fdisk_ioctl+0x3ac>
{
rtems_blkdev_sg_buffer* sg = req->bufs;
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
80054ec: 37 39 00 01 addi r25,r25,1
80054f0: 36 31 00 10 addi r17,r17,16
80054f4: e3 ff fc a5 bi 8004788 <rtems_fdisk_ioctl+0x3b4>
{
rtems_blkdev_sg_buffer* sg = req->bufs;
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
80054f8: 36 f7 00 01 addi r23,r23,1
80054fc: 37 7b 00 10 addi fp,fp,16
8005500: e3 ff fe 10 bi 8004d40 <rtems_fdisk_ioctl+0x96c>
08003730 <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)
{
8003730: 37 9c ff e4 addi sp,sp,-28
8003734: 5b 8b 00 1c sw (sp+28),r11
8003738: 5b 8c 00 18 sw (sp+24),r12
800373c: 5b 8d 00 14 sw (sp+20),r13
8003740: 5b 8e 00 10 sw (sp+16),r14
8003744: 5b 9d 00 0c sw (sp+12),ra
8003748: b8 20 60 00 mv r12,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",
800374c: 28 41 00 28 lw r1,(r2+40)
* @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)
{
8003750: b8 40 58 00 mv r11,r2
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " queue-seg:%02d-%03d: p=%d a=%d u=%d b=%d f=%s n=%s",
8003754: 28 43 00 08 lw r3,(r2+8)
8003758: 28 44 00 0c lw r4,(r2+12)
800375c: 28 45 00 14 lw r5,(r2+20)
8003760: 28 46 00 1c lw r6,(r2+28)
8003764: 28 47 00 20 lw r7,(r2+32)
8003768: 28 48 00 24 lw r8,(r2+36)
800376c: 78 02 08 03 mvhi r2,0x803
8003770: 38 42 72 78 ori r2,r2,0x7278
8003774: 44 20 00 03 be r1,r0,8003780 <rtems_fdisk_queue_segment+0x50><== ALWAYS TAKEN
8003778: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
800377c: 38 42 55 80 ori r2,r2,0x5580 <== NOT EXECUTED
8003780: 29 69 00 00 lw r9,(r11+0)
8003784: 78 01 08 03 mvhi r1,0x803
8003788: 38 21 55 8c ori r1,r1,0x558c
800378c: 45 20 00 03 be r9,r0,8003798 <rtems_fdisk_queue_segment+0x68>
8003790: 78 01 08 03 mvhi r1,0x803
8003794: 38 21 55 88 ori r1,r1,0x5588
8003798: 5b 82 00 04 sw (sp+4),r2
800379c: 78 02 08 03 mvhi r2,0x803
80037a0: 5b 81 00 08 sw (sp+8),r1
80037a4: 38 42 55 94 ori r2,r2,0x5594
80037a8: b9 80 08 00 mv r1,r12
80037ac: fb ff fd 7a calli 8002d94 <rtems_fdisk_info>
/*
* If the segment has failed then check the failed queue and append
* if not failed.
*/
if (sc->failed)
80037b0: 29 61 00 28 lw r1,(r11+40)
80037b4: 44 20 00 07 be r1,r0,80037d0 <rtems_fdisk_queue_segment+0xa0><== ALWAYS TAKEN
{
if (!rtems_fdisk_segment_queue_present (&fd->failed, sc))
80037b8: 29 81 00 58 lw r1,(r12+88) <== NOT EXECUTED
80037bc: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
80037c0: fb ff ff 50 calli 8003500 <rtems_fdisk_segment_queue_present.clone.2><== NOT EXECUTED
80037c4: 5c 20 00 53 bne r1,r0,8003910 <rtems_fdisk_queue_segment+0x1e0><== NOT EXECUTED
rtems_fdisk_segment_queue_push_tail (&fd->failed, sc);
80037c8: 35 81 00 58 addi r1,r12,88 <== NOT EXECUTED
80037cc: e0 00 00 4f bi 8003908 <rtems_fdisk_queue_segment+0x1d8> <== NOT EXECUTED
}
/*
* Remove the queue from the available or used queue.
*/
rtems_fdisk_segment_queue_remove (&fd->available, sc);
80037d0: 35 8d 00 34 addi r13,r12,52
80037d4: b9 a0 08 00 mv r1,r13
80037d8: b9 60 10 00 mv r2,r11
80037dc: fb ff fd 30 calli 8002c9c <rtems_fdisk_segment_queue_remove>
rtems_fdisk_segment_queue_remove (&fd->used, sc);
80037e0: 35 8e 00 40 addi r14,r12,64
80037e4: b9 c0 08 00 mv r1,r14
80037e8: b9 60 10 00 mv r2,r11
80037ec: fb ff fd 2c calli 8002c9c <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);
80037f0: 29 61 00 1c lw r1,(r11+28)
80037f4: 29 66 00 20 lw r6,(r11+32)
80037f8: 29 64 00 24 lw r4,(r11+36)
80037fc: 29 65 00 14 lw r5,(r11+20)
8003800: b4 c1 10 00 add r2,r6,r1
8003804: b4 44 20 00 add r4,r2,r4
* 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)
8003808: 5c a4 00 20 bne r5,r4,8003888 <rtems_fdisk_queue_segment+0x158>
{
if (sc->pages_active)
800380c: 44 20 00 16 be r1,r0,8003864 <rtems_fdisk_queue_segment+0x134><== NEVER TAKEN
/*
* 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;
8003810: 29 83 00 40 lw r3,(r12+64)
8003814: b8 60 10 00 mv r2,r3
while (seg)
8003818: e0 00 00 04 bi 8003828 <rtems_fdisk_queue_segment+0xf8>
{
if (sc->pages_used > seg->pages_used)
800381c: 28 41 00 20 lw r1,(r2+32)
8003820: 54 c1 00 04 bgu r6,r1,8003830 <rtems_fdisk_queue_segment+0x100>
break;
seg = seg->next;
8003824: 28 42 00 00 lw r2,(r2+0)
* 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)
8003828: 5c 40 ff fd bne r2,r0,800381c <rtems_fdisk_queue_segment+0xec>
800382c: e0 00 00 34 bi 80038fc <rtems_fdisk_queue_segment+0x1cc>
rtems_fdisk_segment_ctl* item,
rtems_fdisk_segment_ctl* sc)
{
if (item)
{
rtems_fdisk_segment_ctl** prev = &queue->head;
8003830: 35 81 00 40 addi r1,r12,64
8003834: e0 00 00 0a bi 800385c <rtems_fdisk_queue_segment+0x12c>
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
{
if (item == it)
8003838: 5c 43 00 07 bne r2,r3,8003854 <rtems_fdisk_queue_segment+0x124>
{
sc->next = item;
800383c: 59 62 00 00 sw (r11+0),r2
*prev = sc;
8003840: 58 2b 00 00 sw (r1+0),r11
queue->count++;
8003844: 29 81 00 48 lw r1,(r12+72)
8003848: 34 21 00 01 addi r1,r1,1
800384c: 59 81 00 48 sw (r12+72),r1
8003850: e0 00 00 30 bi 8003910 <rtems_fdisk_queue_segment+0x1e0>
return;
}
prev = &it->next;
8003854: b8 60 08 00 mv r1,r3
it = it->next;
8003858: 28 63 00 00 lw r3,(r3+0)
if (item)
{
rtems_fdisk_segment_ctl** prev = &queue->head;
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
800385c: 5c 60 ff f7 bne r3,r0,8003838 <rtems_fdisk_queue_segment+0x108><== ALWAYS TAKEN
8003860: e0 00 00 27 bi 80038fc <rtems_fdisk_queue_segment+0x1cc> <== NOT EXECUTED
else
rtems_fdisk_segment_queue_push_tail (&fd->used, sc);
}
else
{
if ((fd->flags & RTEMS_FDISK_BACKGROUND_ERASE))
8003864: 29 82 00 08 lw r2,(r12+8) <== NOT EXECUTED
8003868: 20 42 00 01 andi r2,r2,0x1 <== NOT EXECUTED
800386c: 44 41 00 03 be r2,r1,8003878 <rtems_fdisk_queue_segment+0x148><== NOT EXECUTED
rtems_fdisk_segment_queue_push_tail (&fd->erase, sc);
8003870: 35 81 00 4c addi r1,r12,76 <== NOT EXECUTED
8003874: e0 00 00 25 bi 8003908 <rtems_fdisk_queue_segment+0x1d8> <== NOT EXECUTED
else
rtems_fdisk_erase_segment (fd, sc);
8003878: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800387c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
8003880: fb ff ff 59 calli 80035e4 <rtems_fdisk_erase_segment> <== NOT EXECUTED
8003884: e0 00 00 23 bi 8003910 <rtems_fdisk_queue_segment+0x1e0> <== NOT EXECUTED
* 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;
8003888: 29 83 00 34 lw r3,(r12+52)
* 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);
800388c: c8 a4 20 00 sub r4,r5,r4
* 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;
8003890: b8 60 10 00 mv r2,r3
while (seg)
8003894: e0 00 00 0b bi 80038c0 <rtems_fdisk_queue_segment+0x190>
*
* @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)
8003898: 28 41 00 24 lw r1,(r2+36)
* 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);
800389c: 28 45 00 20 lw r5,(r2+32)
*
* @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)
80038a0: c8 01 08 00 sub r1,r0,r1
* 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);
80038a4: c8 25 08 00 sub r1,r1,r5
80038a8: 28 45 00 14 lw r5,(r2+20)
80038ac: b4 25 08 00 add r1,r1,r5
80038b0: 28 45 00 1c lw r5,(r2+28)
80038b4: c8 25 08 00 sub r1,r1,r5
*/
rtems_fdisk_segment_ctl* seg = fd->available.head;
while (seg)
{
if (rtems_fdisk_seg_pages_available (sc) <
80038b8: 54 24 00 04 bgu r1,r4,80038c8 <rtems_fdisk_queue_segment+0x198>
rtems_fdisk_seg_pages_available (seg))
break;
seg = seg->next;
80038bc: 28 42 00 00 lw r2,(r2+0)
* 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)
80038c0: 5c 40 ff f6 bne r2,r0,8003898 <rtems_fdisk_queue_segment+0x168>
80038c4: e0 00 00 10 bi 8003904 <rtems_fdisk_queue_segment+0x1d4>
rtems_fdisk_segment_ctl* item,
rtems_fdisk_segment_ctl* sc)
{
if (item)
{
rtems_fdisk_segment_ctl** prev = &queue->head;
80038c8: 35 81 00 34 addi r1,r12,52
80038cc: e0 00 00 0a bi 80038f4 <rtems_fdisk_queue_segment+0x1c4>
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
{
if (item == it)
80038d0: 5c 43 00 07 bne r2,r3,80038ec <rtems_fdisk_queue_segment+0x1bc><== NEVER TAKEN
{
sc->next = item;
80038d4: 59 62 00 00 sw (r11+0),r2
*prev = sc;
80038d8: 58 2b 00 00 sw (r1+0),r11
queue->count++;
80038dc: 29 81 00 3c lw r1,(r12+60)
80038e0: 34 21 00 01 addi r1,r1,1
80038e4: 59 81 00 3c sw (r12+60),r1
80038e8: e0 00 00 0a bi 8003910 <rtems_fdisk_queue_segment+0x1e0>
return;
}
prev = &it->next;
80038ec: b8 60 08 00 mv r1,r3 <== NOT EXECUTED
it = it->next;
80038f0: 28 63 00 00 lw r3,(r3+0) <== NOT EXECUTED
if (item)
{
rtems_fdisk_segment_ctl** prev = &queue->head;
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
80038f4: 5c 60 ff f7 bne r3,r0,80038d0 <rtems_fdisk_queue_segment+0x1a0><== ALWAYS TAKEN
80038f8: e0 00 00 03 bi 8003904 <rtems_fdisk_queue_segment+0x1d4> <== NOT EXECUTED
}
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->used, seg, sc);
else
rtems_fdisk_segment_queue_push_tail (&fd->used, sc);
80038fc: b9 c0 08 00 mv r1,r14
8003900: e0 00 00 02 bi 8003908 <rtems_fdisk_queue_segment+0x1d8>
}
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->available, seg, sc);
else
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
8003904: b9 a0 08 00 mv r1,r13
8003908: b9 60 10 00 mv r2,r11
800390c: fb ff fc d6 calli 8002c64 <rtems_fdisk_segment_queue_push_tail>
}
}
8003910: 2b 9d 00 0c lw ra,(sp+12)
8003914: 2b 8b 00 1c lw r11,(sp+28)
8003918: 2b 8c 00 18 lw r12,(sp+24)
800391c: 2b 8d 00 14 lw r13,(sp+20)
8003920: 2b 8e 00 10 lw r14,(sp+16)
8003924: 37 9c 00 1c addi sp,sp,28
8003928: c3 a0 00 00 ret
0800392c <rtems_fdisk_recover_block_mappings>:
/**
* Recover the block mappings from the devices.
*/
static int
rtems_fdisk_recover_block_mappings (rtems_flashdisk* fd)
{
800392c: 37 9c ff bc addi sp,sp,-68
8003930: 5b 8b 00 44 sw (sp+68),r11
8003934: 5b 8c 00 40 sw (sp+64),r12
8003938: 5b 8d 00 3c sw (sp+60),r13
800393c: 5b 8e 00 38 sw (sp+56),r14
8003940: 5b 8f 00 34 sw (sp+52),r15
8003944: 5b 90 00 30 sw (sp+48),r16
8003948: 5b 91 00 2c sw (sp+44),r17
800394c: 5b 92 00 28 sw (sp+40),r18
8003950: 5b 93 00 24 sw (sp+36),r19
8003954: 5b 94 00 20 sw (sp+32),r20
8003958: 5b 95 00 1c sw (sp+28),r21
800395c: 5b 96 00 18 sw (sp+24),r22
8003960: 5b 97 00 14 sw (sp+20),r23
8003964: 5b 98 00 10 sw (sp+16),r24
8003968: 5b 99 00 0c sw (sp+12),r25
800396c: 5b 9b 00 08 sw (sp+8),fp
8003970: 5b 9d 00 04 sw (sp+4),ra
8003974: b8 20 58 00 mv r11,r1
* Initialise the segment control queue.
*/
static void
rtems_fdisk_segment_queue_init (rtems_fdisk_segment_ctl_queue* queue)
{
queue->head = queue->tail = 0;
8003978: 58 20 00 38 sw (r1+56),r0
800397c: 58 20 00 34 sw (r1+52),r0
queue->count = 0;
8003980: 58 20 00 3c sw (r1+60),r0
* Initialise the segment control queue.
*/
static void
rtems_fdisk_segment_queue_init (rtems_fdisk_segment_ctl_queue* queue)
{
queue->head = queue->tail = 0;
8003984: 58 20 00 44 sw (r1+68),r0
8003988: 58 20 00 40 sw (r1+64),r0
queue->count = 0;
800398c: 58 20 00 48 sw (r1+72),r0
* Initialise the segment control queue.
*/
static void
rtems_fdisk_segment_queue_init (rtems_fdisk_segment_ctl_queue* queue)
{
queue->head = queue->tail = 0;
8003990: 58 20 00 50 sw (r1+80),r0
8003994: 58 20 00 4c sw (r1+76),r0
queue->count = 0;
8003998: 58 20 00 54 sw (r1+84),r0
* Initialise the segment control queue.
*/
static void
rtems_fdisk_segment_queue_init (rtems_fdisk_segment_ctl_queue* queue)
{
queue->head = queue->tail = 0;
800399c: 58 20 00 5c sw (r1+92),r0
80039a0: 58 20 00 58 sw (r1+88),r0
queue->count = 0;
80039a4: 58 20 00 60 sw (r1+96),r0
rtems_fdisk_segment_queue_init (&fd->failed);
/*
* Clear the lock mappings.
*/
memset (fd->blocks, 0, fd->block_count * sizeof (rtems_fdisk_block_ctl));
80039a8: 28 21 00 1c lw r1,(r1+28)
80039ac: 34 02 00 03 mvi r2,3
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);
80039b0: 78 16 08 03 mvhi r22,0x803
rtems_fdisk_segment_queue_init (&fd->failed);
/*
* Clear the lock mappings.
*/
memset (fd->blocks, 0, fd->block_count * sizeof (rtems_fdisk_block_ctl));
80039b4: fb ff f6 cb calli 80014e0 <__ashlsi3>
80039b8: b8 20 18 00 mv r3,r1
80039bc: 29 61 00 18 lw r1,(r11+24)
80039c0: 34 02 00 00 mvi r2,0
if (!sc->page_descriptors)
sc->page_descriptors = malloc (sc->pages_desc * fd->block_size);
if (!sc->page_descriptors)
rtems_fdisk_abort ("no memory for page descriptors");
80039c4: 78 15 08 03 mvhi r21,0x803
* 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: " \
80039c8: 78 14 08 03 mvhi r20,0x803
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,
80039cc: 78 13 08 03 mvhi r19,0x803
++fd->erased_blocks;
}
else
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_warning (fd, "page not blank: %d-%d-%d",
80039d0: 78 12 08 03 mvhi r18,0x803
ret = rtems_fdisk_seg_write_page_desc (fd, sc,
page, pd);
if (ret)
{
rtems_fdisk_error ("forcing page to used failed: %d-%d-%d",
80039d4: 78 11 08 03 mvhi r17,0x803
rtems_fdisk_segment_queue_init (&fd->failed);
/*
* Clear the lock mappings.
*/
memset (fd->blocks, 0, fd->block_count * sizeof (rtems_fdisk_block_ctl));
80039d8: f8 00 7a 8b calli 8022404 <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++)
80039dc: 34 17 00 00 mvi r23,0
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;
80039e0: 59 60 00 28 sw (r11+40),r0
fd->starvation_threshold = 0;
80039e4: 59 60 00 24 sw (r11+36),r0
for (device = 0; device < fd->device_count; device++)
80039e8: 34 10 00 00 mvi r16,0
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);
80039ec: 3a d6 55 c8 ori r22,r22,0x55c8
if (!sc->page_descriptors)
sc->page_descriptors = malloc (sc->pages_desc * fd->block_size);
if (!sc->page_descriptors)
rtems_fdisk_abort ("no memory for page descriptors");
80039f0: 3a b5 55 ec ori r21,r21,0x55ec
* 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: " \
80039f4: 3a 94 56 c0 ori r20,r20,0x56c0
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,
80039f8: 3a 73 56 94 ori r19,r19,0x5694
++fd->erased_blocks;
}
else
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_warning (fd, "page not blank: %d-%d-%d",
80039fc: 3a 52 56 50 ori r18,r18,0x5650
* 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;
8003a00: 34 19 ff fd mvi r25,-3
ret = rtems_fdisk_seg_write_page_desc (fd, sc,
page, pd);
if (ret)
{
rtems_fdisk_error ("forcing page to used failed: %d-%d-%d",
8003a04: 3a 31 56 6c ori r17,r17,0x566c
/*
* 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++)
8003a08: e0 00 00 a5 bi 8003c9c <rtems_fdisk_recover_block_mappings+0x370>
{
uint32_t segment;
for (segment = 0; segment < fd->devices[device].segment_count; segment++)
{
rtems_fdisk_segment_ctl* sc = &fd->devices[device].segments[segment];
8003a0c: 28 2c 00 00 lw r12,(r1+0)
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);
8003a10: ba 00 18 00 mv r3,r16
8003a14: b9 e0 20 00 mv r4,r15
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];
8003a18: b5 98 60 00 add r12,r12,r24
const rtems_fdisk_segment_desc* sd = sc->descriptor;
8003a1c: 29 8e 00 04 lw r14,(r12+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);
8003a20: ba c0 10 00 mv r2,r22
8003a24: b9 60 08 00 mv r1,r11
8003a28: fb ff fc db calli 8002d94 <rtems_fdisk_info>
#endif
sc->pages_desc = rtems_fdisk_page_desc_pages (sd, fd->block_size);
8003a2c: 29 6d 00 14 lw r13,(r11+20)
*/
static uint32_t
rtems_fdisk_pages_in_segment (const rtems_fdisk_segment_desc* sd,
uint32_t page_size)
{
return sd->size / page_size;
8003a30: 29 c1 00 08 lw r1,(r14+8)
8003a34: b9 a0 10 00 mv r2,r13
8003a38: fb ff f7 04 calli 8001648 <__udivsi3>
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);
8003a3c: 34 02 00 03 mvi r2,3
*/
static uint32_t
rtems_fdisk_pages_in_segment (const rtems_fdisk_segment_desc* sd,
uint32_t page_size)
{
return sd->size / page_size;
8003a40: b8 20 70 00 mv r14,r1
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);
8003a44: fb ff f6 a7 calli 80014e0 <__ashlsi3>
return ((bytes - 1) / page_size) + 1;
8003a48: b9 a0 10 00 mv r2,r13
8003a4c: 34 21 ff ff addi r1,r1,-1
8003a50: fb ff f6 fe calli 8001648 <__udivsi3>
8003a54: 34 23 00 01 addi r3,r1,1
#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)
8003a58: 29 62 00 24 lw r2,(r11+36)
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;
8003a5c: c9 c3 08 00 sub r1,r14,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);
8003a60: 59 83 00 18 sw (r12+24),r3
sc->pages =
8003a64: 59 81 00 14 sw (r12+20),r1
rtems_fdisk_pages_in_segment (sd, fd->block_size) - sc->pages_desc;
if (sc->pages > fd->starvation_threshold)
8003a68: 50 41 00 02 bgeu r2,r1,8003a70 <rtems_fdisk_recover_block_mappings+0x144>
fd->starvation_threshold = sc->pages;
8003a6c: 59 61 00 24 sw (r11+36),r1
sc->pages_used = 0;
sc->pages_bad = 0;
sc->failed = false;
if (!sc->page_descriptors)
8003a70: 29 81 00 10 lw r1,(r12+16)
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;
8003a74: 59 80 00 1c sw (r12+28),r0
sc->pages_used = 0;
8003a78: 59 80 00 20 sw (r12+32),r0
sc->pages_bad = 0;
8003a7c: 59 80 00 24 sw (r12+36),r0
sc->failed = false;
8003a80: 59 80 00 28 sw (r12+40),r0
if (!sc->page_descriptors)
8003a84: 5c 20 00 06 bne r1,r0,8003a9c <rtems_fdisk_recover_block_mappings+0x170><== NEVER TAKEN
sc->page_descriptors = malloc (sc->pages_desc * fd->block_size);
8003a88: b8 60 08 00 mv r1,r3
8003a8c: b9 a0 10 00 mv r2,r13
8003a90: fb ff f6 e2 calli 8001618 <__mulsi3>
8003a94: f8 00 0c 69 calli 8006c38 <malloc>
8003a98: 59 81 00 10 sw (r12+16),r1
if (!sc->page_descriptors)
8003a9c: 29 81 00 10 lw r1,(r12+16)
8003aa0: 5c 20 00 03 bne r1,r0,8003aac <rtems_fdisk_recover_block_mappings+0x180><== ALWAYS TAKEN
rtems_fdisk_abort ("no memory for page descriptors");
8003aa4: ba a0 08 00 mv r1,r21 <== NOT EXECUTED
8003aa8: fb ff fe 6c calli 8003458 <rtems_fdisk_abort> <== NOT EXECUTED
* 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,
8003aac: 29 82 00 18 lw r2,(r12+24)
8003ab0: 29 61 00 14 lw r1,(r11+20)
sc->page_descriptors = malloc (sc->pages_desc * fd->block_size);
if (!sc->page_descriptors)
rtems_fdisk_abort ("no memory for page descriptors");
pd = sc->page_descriptors;
8003ab4: 29 8d 00 10 lw r13,(r12+16)
* 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,
8003ab8: fb ff f6 d8 calli 8001618 <__mulsi3>
8003abc: b8 20 28 00 mv r5,r1
8003ac0: b9 80 10 00 mv r2,r12
8003ac4: b9 60 08 00 mv r1,r11
8003ac8: 34 03 00 00 mvi r3,0
8003acc: b9 a0 20 00 mv r4,r13
8003ad0: fb ff fd 09 calli 8002ef4 <rtems_fdisk_seg_read>
8003ad4: b8 20 70 00 mv r14,r1
sc->pages_desc * fd->block_size);
if (ret)
8003ad8: 44 20 00 61 be r1,r0,8003c5c <rtems_fdisk_recover_block_mappings+0x330><== ALWAYS TAKEN
{
rtems_fdisk_error ("recover-block-mappings:%02d-%03d: " \
8003adc: f8 00 7f a1 calli 8023960 <strerror> <== NOT EXECUTED
8003ae0: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
8003ae4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8003ae8: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
8003aec: b9 e0 18 00 mv r3,r15 <== NOT EXECUTED
8003af0: b9 c0 28 00 mv r5,r14 <== NOT EXECUTED
8003af4: 38 21 56 0c ori r1,r1,0x560c <== NOT EXECUTED
8003af8: fb ff fe 30 calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
"read page desc failed: %s (%d)",
device, segment, strerror (ret), ret);
return ret;
8003afc: e0 00 00 6b bi 8003ca8 <rtems_fdisk_recover_block_mappings+0x37c><== NOT EXECUTED
* If the page is active see if the block is with-in range and
* if the block is a duplicate.
*/
for (page = 0; page < sc->pages; page++, pd++)
{
if (rtems_fdisk_page_desc_erased (pd))
8003b00: b9 a0 08 00 mv r1,r13
8003b04: fb ff fc 7d calli 8002cf8 <rtems_fdisk_page_desc_erased>
8003b08: 44 20 00 26 be r1,r0,8003ba0 <rtems_fdisk_recover_block_mappings+0x274><== NEVER TAKEN
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);
8003b0c: 29 7b 00 14 lw fp,(r11+20)
if (rtems_fdisk_page_desc_erased (pd))
{
/*
* Is the page erased ?
*/
ret = rtems_fdisk_seg_blank_check_page (fd, sc,
8003b10: 29 81 00 18 lw r1,(r12+24)
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,
8003b14: bb 60 10 00 mv r2,fp
8003b18: b5 c1 08 00 add r1,r14,r1
8003b1c: fb ff f6 bf calli 8001618 <__mulsi3>
8003b20: b8 20 18 00 mv r3,r1
8003b24: b9 80 10 00 mv r2,r12
8003b28: b9 60 08 00 mv r1,r11
8003b2c: bb 60 20 00 mv r4,fp
8003b30: fb ff fd 2c calli 8002fe0 <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)
8003b34: 5c 20 00 05 bne r1,r0,8003b48 <rtems_fdisk_recover_block_mappings+0x21c><== NEVER TAKEN
{
++fd->erased_blocks;
8003b38: 29 61 00 28 lw r1,(r11+40)
8003b3c: 34 21 00 01 addi r1,r1,1
8003b40: 59 61 00 28 sw (r11+40),r1
8003b44: e0 00 00 44 bi 8003c54 <rtems_fdisk_recover_block_mappings+0x328>
}
else
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_warning (fd, "page not blank: %d-%d-%d",
8003b48: 29 a6 00 04 lw r6,(r13+4) <== NOT EXECUTED
8003b4c: ba 40 10 00 mv r2,r18 <== NOT EXECUTED
8003b50: ba 00 18 00 mv r3,r16 <== NOT EXECUTED
8003b54: b9 e0 20 00 mv r4,r15 <== NOT EXECUTED
8003b58: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8003b5c: b9 c0 28 00 mv r5,r14 <== NOT EXECUTED
8003b60: fb ff fd eb calli 800330c <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;
8003b64: 2d a1 00 02 lhu r1,(r13+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,
8003b68: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
8003b6c: b9 c0 18 00 mv r3,r14 <== 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;
8003b70: a0 39 08 00 and r1,r1,r25 <== NOT EXECUTED
8003b74: 0d a1 00 02 sh (r13+2),r1 <== 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,
8003b78: b9 a0 20 00 mv r4,r13 <== NOT EXECUTED
8003b7c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8003b80: fb ff fd 90 calli 80031c0 <rtems_fdisk_seg_write_page_desc><== NOT EXECUTED
page, pd);
if (ret)
8003b84: 44 20 00 0b be r1,r0,8003bb0 <rtems_fdisk_recover_block_mappings+0x284><== NOT EXECUTED
{
rtems_fdisk_error ("forcing page to used failed: %d-%d-%d",
8003b88: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
8003b8c: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
8003b90: b9 e0 18 00 mv r3,r15 <== NOT EXECUTED
8003b94: b9 c0 20 00 mv r4,r14 <== NOT EXECUTED
8003b98: fb ff fe 08 calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
8003b9c: e0 00 00 05 bi 8003bb0 <rtems_fdisk_recover_block_mappings+0x284><== NOT EXECUTED
}
rtems_flashdisk_count = rtems_flashdisk_configuration_size;
return RTEMS_SUCCESSFUL;
}
8003ba0: 2d a2 00 02 lhu r2,(r13+2) <== NOT EXECUTED
sc->pages_used++;
}
}
else
{
if (rtems_fdisk_page_desc_flags_set (pd, RTEMS_FDISK_PAGE_USED))
8003ba4: 20 43 00 02 andi r3,r2,0x2 <== NOT EXECUTED
8003ba8: 20 63 ff ff andi r3,r3,0xffff <== NOT EXECUTED
8003bac: 5c 61 00 05 bne r3,r1,8003bc0 <rtems_fdisk_recover_block_mappings+0x294><== NOT EXECUTED
{
sc->pages_used++;
8003bb0: 29 81 00 20 lw r1,(r12+32) <== NOT EXECUTED
8003bb4: 34 21 00 01 addi r1,r1,1 <== NOT EXECUTED
8003bb8: 59 81 00 20 sw (r12+32),r1 <== NOT EXECUTED
8003bbc: e0 00 00 26 bi 8003c54 <rtems_fdisk_recover_block_mappings+0x328><== NOT EXECUTED
}
else if (rtems_fdisk_page_desc_flags_set (pd, RTEMS_FDISK_PAGE_ACTIVE))
8003bc0: 20 42 00 01 andi r2,r2,0x1 <== NOT EXECUTED
8003bc4: 5c 40 00 21 bne r2,r0,8003c48 <rtems_fdisk_recover_block_mappings+0x31c><== NOT EXECUTED
{
if (pd->block >= fd->block_count)
8003bc8: 29 a6 00 04 lw r6,(r13+4) <== NOT EXECUTED
8003bcc: 29 61 00 1c lw r1,(r11+28) <== NOT EXECUTED
8003bd0: 54 26 00 08 bgu r1,r6,8003bf0 <rtems_fdisk_recover_block_mappings+0x2c4><== NOT EXECUTED
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_warning (fd,
8003bd4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8003bd8: ba 60 10 00 mv r2,r19 <== NOT EXECUTED
8003bdc: ba 00 18 00 mv r3,r16 <== NOT EXECUTED
8003be0: b9 e0 20 00 mv r4,r15 <== NOT EXECUTED
8003be4: b9 c0 28 00 mv r5,r14 <== NOT EXECUTED
8003be8: fb ff fd c9 calli 800330c <rtems_fdisk_warning> <== NOT EXECUTED
8003bec: e0 00 00 17 bi 8003c48 <rtems_fdisk_recover_block_mappings+0x31c><== 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)
8003bf0: b8 c0 08 00 mv r1,r6 <== NOT EXECUTED
8003bf4: 34 02 00 03 mvi r2,3 <== NOT EXECUTED
8003bf8: fb ff f6 3a calli 80014e0 <__ashlsi3> <== NOT EXECUTED
8003bfc: 29 64 00 18 lw r4,(r11+24) <== NOT EXECUTED
8003c00: b4 81 20 00 add r4,r4,r1 <== NOT EXECUTED
8003c04: 28 83 00 00 lw r3,(r4+0) <== NOT EXECUTED
8003c08: 44 60 00 0a be r3,r0,8003c30 <rtems_fdisk_recover_block_mappings+0x304><== 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: " \
8003c0c: 28 62 00 08 lw r2,(r3+8) <== NOT EXECUTED
8003c10: 28 84 00 04 lw r4,(r4+4) <== NOT EXECUTED
8003c14: 28 63 00 0c lw r3,(r3+12) <== NOT EXECUTED
8003c18: ba 80 08 00 mv r1,r20 <== NOT EXECUTED
8003c1c: ba 00 28 00 mv r5,r16 <== NOT EXECUTED
8003c20: b9 e0 30 00 mv r6,r15 <== NOT EXECUTED
8003c24: b9 c0 38 00 mv r7,r14 <== NOT EXECUTED
8003c28: fb ff fd e4 calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
8003c2c: e0 00 00 07 bi 8003c48 <rtems_fdisk_recover_block_mappings+0x31c><== NOT EXECUTED
fd->blocks[pd->block].page = page;
/*
* The page is active.
*/
sc->pages_active++;
8003c30: 29 81 00 1c lw r1,(r12+28) <== NOT EXECUTED
{
/**
* @todo
* Add start up crc checks here.
*/
fd->blocks[pd->block].segment = sc;
8003c34: 58 8c 00 00 sw (r4+0),r12 <== NOT EXECUTED
fd->blocks[pd->block].page = page;
8003c38: 58 8e 00 04 sw (r4+4),r14 <== NOT EXECUTED
/*
* The page is active.
*/
sc->pages_active++;
8003c3c: 34 21 00 01 addi r1,r1,1 <== NOT EXECUTED
8003c40: 59 81 00 1c sw (r12+28),r1 <== NOT EXECUTED
8003c44: e0 00 00 04 bi 8003c54 <rtems_fdisk_recover_block_mappings+0x328><== NOT EXECUTED
}
}
else
sc->pages_bad++;
8003c48: 29 81 00 24 lw r1,(r12+36) <== NOT EXECUTED
8003c4c: 34 21 00 01 addi r1,r1,1 <== NOT EXECUTED
8003c50: 59 81 00 24 sw (r12+36),r1 <== 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++)
8003c54: 35 ce 00 01 addi r14,r14,1
8003c58: 35 ad 00 08 addi r13,r13,8
8003c5c: 29 81 00 14 lw r1,(r12+20)
8003c60: 54 2e ff a8 bgu r1,r14,8003b00 <rtems_fdisk_recover_block_mappings+0x1d4>
}
/*
* Place the segment on to the correct queue.
*/
rtems_fdisk_queue_segment (fd, sc);
8003c64: b9 60 08 00 mv r1,r11
8003c68: b9 80 10 00 mv r2,r12
8003c6c: fb ff fe b1 calli 8003730 <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++)
8003c70: 35 ef 00 01 addi r15,r15,1
8003c74: 37 18 00 30 addi r24,r24,48
8003c78: e0 00 00 03 bi 8003c84 <rtems_fdisk_recover_block_mappings+0x358>
/*
* 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++)
8003c7c: 34 18 00 00 mvi r24,0
8003c80: 34 0f 00 00 mvi r15,0
{
uint32_t segment;
for (segment = 0; segment < fd->devices[device].segment_count; segment++)
8003c84: 29 61 00 2c lw r1,(r11+44)
8003c88: b4 37 08 00 add r1,r1,r23
8003c8c: 28 22 00 04 lw r2,(r1+4)
8003c90: 54 4f ff 5f bgu r2,r15,8003a0c <rtems_fdisk_recover_block_mappings+0xe0>
/*
* 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++)
8003c94: 36 10 00 01 addi r16,r16,1
8003c98: 36 f7 00 0c addi r23,r23,12
8003c9c: 29 61 00 30 lw r1,(r11+48)
8003ca0: 54 30 ff f7 bgu r1,r16,8003c7c <rtems_fdisk_recover_block_mappings+0x350>
*/
rtems_fdisk_queue_segment (fd, sc);
}
}
return 0;
8003ca4: 34 0e 00 00 mvi r14,0
}
8003ca8: b9 c0 08 00 mv r1,r14
8003cac: 2b 9d 00 04 lw ra,(sp+4)
8003cb0: 2b 8b 00 44 lw r11,(sp+68)
8003cb4: 2b 8c 00 40 lw r12,(sp+64)
8003cb8: 2b 8d 00 3c lw r13,(sp+60)
8003cbc: 2b 8e 00 38 lw r14,(sp+56)
8003cc0: 2b 8f 00 34 lw r15,(sp+52)
8003cc4: 2b 90 00 30 lw r16,(sp+48)
8003cc8: 2b 91 00 2c lw r17,(sp+44)
8003ccc: 2b 92 00 28 lw r18,(sp+40)
8003cd0: 2b 93 00 24 lw r19,(sp+36)
8003cd4: 2b 94 00 20 lw r20,(sp+32)
8003cd8: 2b 95 00 1c lw r21,(sp+28)
8003cdc: 2b 96 00 18 lw r22,(sp+24)
8003ce0: 2b 97 00 14 lw r23,(sp+20)
8003ce4: 2b 98 00 10 lw r24,(sp+16)
8003ce8: 2b 99 00 0c lw r25,(sp+12)
8003cec: 2b 9b 00 08 lw fp,(sp+8)
8003cf0: 37 9c 00 44 addi sp,sp,68
8003cf4: c3 a0 00 00 ret
08003d5c <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)
{
8003d5c: 37 9c ff b8 addi sp,sp,-72
8003d60: 5b 8b 00 48 sw (sp+72),r11
8003d64: 5b 8c 00 44 sw (sp+68),r12
8003d68: 5b 8d 00 40 sw (sp+64),r13
8003d6c: 5b 8e 00 3c sw (sp+60),r14
8003d70: 5b 8f 00 38 sw (sp+56),r15
8003d74: 5b 90 00 34 sw (sp+52),r16
8003d78: 5b 91 00 30 sw (sp+48),r17
8003d7c: 5b 92 00 2c sw (sp+44),r18
8003d80: 5b 93 00 28 sw (sp+40),r19
8003d84: 5b 94 00 24 sw (sp+36),r20
8003d88: 5b 95 00 20 sw (sp+32),r21
8003d8c: 5b 96 00 1c sw (sp+28),r22
8003d90: 5b 97 00 18 sw (sp+24),r23
8003d94: 5b 98 00 14 sw (sp+20),r24
8003d98: 5b 99 00 10 sw (sp+16),r25
8003d9c: 5b 9b 00 0c sw (sp+12),fp
8003da0: 5b 9d 00 08 sw (sp+8),ra
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",
8003da4: 78 16 08 03 mvhi r22,0x803
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",
8003da8: 78 15 08 03 mvhi r21,0x803
static int
rtems_fdisk_recycle_segment (rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* ssc,
rtems_fdisk_segment_ctl* dsc,
uint32_t *pages)
{
8003dac: b8 20 58 00 mv r11,r1
8003db0: b8 40 68 00 mv r13,r2
8003db4: b8 60 60 00 mv r12,r3
8003db8: b8 80 90 00 mv r18,r4
int ret;
uint32_t spage;
uint32_t used = 0;
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
8003dbc: 34 17 00 00 mvi r23,0
uint32_t *pages)
{
int ret;
uint32_t spage;
uint32_t used = 0;
uint32_t active = 0;
8003dc0: 34 14 00 00 mvi r20,0
rtems_fdisk_segment_ctl* dsc,
uint32_t *pages)
{
int ret;
uint32_t spage;
uint32_t used = 0;
8003dc4: 34 13 00 00 mvi r19,0
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
8003dc8: 34 10 00 00 mvi r16,0
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",
8003dcc: 3a d6 57 44 ori r22,r22,0x5744
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",
8003dd0: 3a b5 57 6c ori r21,r21,0x576c
int ret;
uint32_t spage;
uint32_t used = 0;
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
8003dd4: e0 00 00 c4 bi 80040e4 <rtems_fdisk_recycle_segment+0x388>
{
rtems_fdisk_page_desc* spd = &ssc->page_descriptors[spage];
8003dd8: 29 b1 00 10 lw r17,(r13+16)
if (!dsc && ssc->pages_active > 0)
8003ddc: 5d 80 00 07 bne r12,r0,8003df8 <rtems_fdisk_recycle_segment+0x9c>
8003de0: 29 a1 00 1c lw r1,(r13+28)
8003de4: 44 2c 00 05 be r1,r12,8003df8 <rtems_fdisk_recycle_segment+0x9c><== ALWAYS TAKEN
{
rtems_fdisk_error ("recycle: no available dst segment");
8003de8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8003dec: 38 21 56 f0 ori r1,r1,0x56f0 <== NOT EXECUTED
8003df0: fb ff fd 72 calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
8003df4: e0 00 00 2f bi 8003eb0 <rtems_fdisk_recycle_segment+0x154> <== NOT EXECUTED
uint32_t used = 0;
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
{
rtems_fdisk_page_desc* spd = &ssc->page_descriptors[spage];
8003df8: b6 37 88 00 add r17,r17,r23
}
rtems_flashdisk_count = rtems_flashdisk_configuration_size;
return RTEMS_SUCCESSFUL;
}
8003dfc: 2e 22 00 02 lhu r2,(r17+2)
{
rtems_fdisk_error ("recycle: no available dst segment");
return EIO;
}
if (rtems_fdisk_page_desc_flags_set (spd, RTEMS_FDISK_PAGE_ACTIVE) &&
8003e00: 20 41 00 01 andi r1,r2,0x1
8003e04: 5c 20 00 ae bne r1,r0,80040bc <rtems_fdisk_recycle_segment+0x360><== NEVER TAKEN
8003e08: 20 42 00 02 andi r2,r2,0x2
8003e0c: 20 42 ff ff andi r2,r2,0xffff
8003e10: 44 41 00 ab be r2,r1,80040bc <rtems_fdisk_recycle_segment+0x360><== NEVER TAKEN
* 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];
8003e14: 29 99 00 10 lw r25,(r12+16)
uint32_t page;
for (page = 0; page < sc->pages; page++, pd++)
8003e18: 34 0f 00 00 mvi r15,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];
8003e1c: bb 20 c0 00 mv r24,r25
8003e20: e0 00 00 08 bi 8003e40 <rtems_fdisk_recycle_segment+0xe4>
uint32_t page;
for (page = 0; page < sc->pages; page++, pd++)
if (rtems_fdisk_page_desc_erased (pd))
8003e24: bb 00 08 00 mv r1,r24
8003e28: fb ff fb b4 calli 8002cf8 <rtems_fdisk_page_desc_erased>
8003e2c: 44 20 00 03 be r1,r0,8003e38 <rtems_fdisk_recycle_segment+0xdc>
dpage = rtems_fdisk_seg_next_available_page (dsc);
dpd = &dsc->page_descriptors[dpage];
active++;
if (dpage >= dsc->pages)
8003e30: 51 ee 00 06 bgeu r15,r14,8003e48 <rtems_fdisk_recycle_segment+0xec><== NEVER TAKEN
8003e34: e0 00 00 21 bi 8003eb8 <rtems_fdisk_recycle_segment+0x15c>
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++)
8003e38: 35 ef 00 01 addi r15,r15,1
8003e3c: 37 18 00 08 addi r24,r24,8
8003e40: 29 8e 00 14 lw r14,(r12+20)
8003e44: 55 cf ff f8 bgu r14,r15,8003e24 <rtems_fdisk_recycle_segment+0xc8><== ALWAYS TAKEN
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
}
}
static int
rtems_fdisk_recycle_segment (rtems_flashdisk* fd,
8003e48: 29 84 00 24 lw r4,(r12+36) <== NOT EXECUTED
* 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);
8003e4c: 29 81 00 20 lw r1,(r12+32) <== NOT EXECUTED
active++;
if (dpage >= dsc->pages)
{
rtems_fdisk_error ("recycle: %02d-%03d: " \
8003e50: 29 82 00 08 lw r2,(r12+8) <== NOT EXECUTED
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
}
}
static int
rtems_fdisk_recycle_segment (rtems_flashdisk* fd,
8003e54: c8 04 20 00 sub r4,r0,r4 <== NOT EXECUTED
* 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);
8003e58: c8 81 20 00 sub r4,r4,r1 <== NOT EXECUTED
8003e5c: 29 81 00 1c lw r1,(r12+28) <== NOT EXECUTED
active++;
if (dpage >= dsc->pages)
{
rtems_fdisk_error ("recycle: %02d-%03d: " \
8003e60: 29 83 00 0c lw r3,(r12+12) <== NOT EXECUTED
* 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);
8003e64: c8 81 20 00 sub r4,r4,r1 <== NOT EXECUTED
active++;
if (dpage >= dsc->pages)
{
rtems_fdisk_error ("recycle: %02d-%03d: " \
8003e68: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8003e6c: b4 8e 20 00 add r4,r4,r14 <== NOT EXECUTED
8003e70: 38 21 57 14 ori r1,r1,0x5714 <== NOT EXECUTED
8003e74: fb ff fd 51 calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
"no page desc available: %d",
dsc->device, dsc->segment,
rtems_fdisk_seg_pages_available (dsc));
dsc->failed = true;
8003e78: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
8003e7c: 59 81 00 28 sw (r12+40),r1 <== NOT EXECUTED
rtems_fdisk_queue_segment (fd, dsc);
8003e80: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
8003e84: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8003e88: fb ff fe 2a calli 8003730 <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;
8003e8c: 29 61 00 40 lw r1,(r11+64) <== NOT EXECUTED
8003e90: 59 a1 00 00 sw (r13+0),r1 <== NOT EXECUTED
queue->head = sc;
if (queue->tail == 0)
8003e94: 29 61 00 44 lw r1,(r11+68) <== NOT EXECUTED
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = queue->head;
queue->head = sc;
8003e98: 59 6d 00 40 sw (r11+64),r13 <== NOT EXECUTED
if (queue->tail == 0)
8003e9c: 5c 20 00 02 bne r1,r0,8003ea4 <rtems_fdisk_recycle_segment+0x148><== NOT EXECUTED
queue->tail = sc;
8003ea0: 59 6d 00 44 sw (r11+68),r13 <== NOT EXECUTED
queue->count++;
8003ea4: 29 61 00 48 lw r1,(r11+72) <== NOT EXECUTED
8003ea8: 34 21 00 01 addi r1,r1,1 <== NOT EXECUTED
8003eac: 59 61 00 48 sw (r11+72),r1 <== 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;
8003eb0: 34 0e 00 05 mvi r14,5 <== NOT EXECUTED
8003eb4: e0 00 00 a0 bi 8004134 <rtems_fdisk_recycle_segment+0x3d8> <== NOT EXECUTED
}
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "recycle: %02d-%03d-%03d=>%02d-%03d-%03d",
8003eb8: 29 a3 00 08 lw r3,(r13+8)
8003ebc: 29 a4 00 0c lw r4,(r13+12)
8003ec0: 29 86 00 08 lw r6,(r12+8)
8003ec4: 29 87 00 0c lw r7,(r12+12)
8003ec8: ba c0 10 00 mv r2,r22
8003ecc: ba 00 28 00 mv r5,r16
8003ed0: b9 e0 40 00 mv r8,r15
8003ed4: b9 60 08 00 mv r1,r11
8003ed8: fb ff fb af calli 8002d94 <rtems_fdisk_info>
ssc->device, ssc->segment, spage,
dsc->device, dsc->segment, dpage);
#endif
ret = rtems_fdisk_seg_copy_page (fd, ssc,
8003edc: 29 ae 00 18 lw r14,(r13+24)
8003ee0: 29 98 00 18 lw r24,(r12+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",
8003ee4: 29 a3 00 08 lw r3,(r13+8)
8003ee8: 29 a4 00 0c lw r4,(r13+12)
8003eec: 29 86 00 08 lw r6,(r12+8)
8003ef0: 29 87 00 0c lw r7,(r12+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,
8003ef4: b6 0e 70 00 add r14,r16,r14
8003ef8: b5 f8 c0 00 add r24,r15,r24
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",
8003efc: b9 c0 28 00 mv r5,r14
8003f00: bb 00 40 00 mv r8,r24
8003f04: ba a0 10 00 mv r2,r21
8003f08: b9 60 08 00 mv r1,r11
8003f0c: fb ff fb ce calli 8002e44 <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);
8003f10: 29 7b 00 14 lw fp,(r11+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,
8003f14: b9 c0 08 00 mv r1,r14
8003f18: bb 60 10 00 mv r2,fp
8003f1c: fb ff f5 bf calli 8001618 <__mulsi3>
8003f20: 29 64 00 68 lw r4,(r11+104)
8003f24: b8 20 18 00 mv r3,r1
8003f28: b9 a0 10 00 mv r2,r13
8003f2c: b9 60 08 00 mv r1,r11
8003f30: bb 60 28 00 mv r5,fp
8003f34: fb ff fb f0 calli 8002ef4 <rtems_fdisk_seg_read>
8003f38: b8 20 70 00 mv r14,r1
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)
8003f3c: 5c 20 00 08 bne r1,r0,8003f5c <rtems_fdisk_recycle_segment+0x200><== NEVER TAKEN
return ret;
return rtems_fdisk_seg_write_page (fd, dst_sc, dst_page,
8003f40: 29 64 00 68 lw r4,(r11+104)
8003f44: b9 60 08 00 mv r1,r11
8003f48: b9 80 10 00 mv r2,r12
8003f4c: bb 00 18 00 mv r3,r24
8003f50: fb ff fc c2 calli 8003258 <rtems_fdisk_seg_write_page>
8003f54: b8 20 70 00 mv r14,r1
#endif
ret = rtems_fdisk_seg_copy_page (fd, ssc,
spage + ssc->pages_desc,
dsc,
dpage + dsc->pages_desc);
if (ret)
8003f58: 44 20 00 0c be r1,r0,8003f88 <rtems_fdisk_recycle_segment+0x22c><== ALWAYS TAKEN
{
rtems_fdisk_error ("recycle: %02d-%03d-%03d=>" \
8003f5c: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
8003f60: 29 b4 00 08 lw r20,(r13+8) <== NOT EXECUTED
8003f64: 29 b3 00 0c lw r19,(r13+12) <== NOT EXECUTED
8003f68: 29 92 00 08 lw r18,(r12+8) <== NOT EXECUTED
8003f6c: 29 91 00 0c lw r17,(r12+12) <== NOT EXECUTED
8003f70: f8 00 7e 7c calli 8023960 <strerror> <== NOT EXECUTED
8003f74: b8 20 40 00 mv r8,r1 <== NOT EXECUTED
8003f78: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8003f7c: 5b 8e 00 04 sw (sp+4),r14 <== NOT EXECUTED
8003f80: 38 21 57 9c ori r1,r1,0x579c <== NOT EXECUTED
8003f84: e0 00 00 18 bi 8003fe4 <rtems_fdisk_recycle_segment+0x288> <== NOT EXECUTED
uint32_t dst_pages;
rtems_fdisk_page_desc* dpd;
uint32_t dpage;
dpage = rtems_fdisk_seg_next_available_page (dsc);
dpd = &dsc->page_descriptors[dpage];
8003f88: 34 02 00 03 mvi r2,3
8003f8c: b9 e0 08 00 mv r1,r15
8003f90: fb ff f5 54 calli 80014e0 <__ashlsi3>
8003f94: b7 21 20 00 add r4,r25,r1
rtems_fdisk_queue_segment (fd, dsc);
rtems_fdisk_segment_queue_push_head (&fd->used, ssc);
return ret;
}
*dpd = *spd;
8003f98: 2a 21 00 00 lw r1,(r17+0)
ret = rtems_fdisk_seg_write_page_desc (fd,
8003f9c: b9 80 10 00 mv r2,r12
8003fa0: b9 e0 18 00 mv r3,r15
rtems_fdisk_queue_segment (fd, dsc);
rtems_fdisk_segment_queue_push_head (&fd->used, ssc);
return ret;
}
*dpd = *spd;
8003fa4: 58 81 00 00 sw (r4+0),r1
8003fa8: 2a 21 00 04 lw r1,(r17+4)
8003fac: 58 81 00 04 sw (r4+4),r1
ret = rtems_fdisk_seg_write_page_desc (fd,
8003fb0: b9 60 08 00 mv r1,r11
8003fb4: fb ff fc 83 calli 80031c0 <rtems_fdisk_seg_write_page_desc>
8003fb8: b8 20 70 00 mv r14,r1
dsc,
dpage, dpd);
if (ret)
8003fbc: 44 20 00 1e be r1,r0,8004034 <rtems_fdisk_recycle_segment+0x2d8>
{
rtems_fdisk_error ("recycle: %02d-%03d-%03d=>" \
8003fc0: 29 b4 00 08 lw r20,(r13+8) <== NOT EXECUTED
8003fc4: 29 b3 00 0c lw r19,(r13+12) <== NOT EXECUTED
8003fc8: 29 92 00 08 lw r18,(r12+8) <== NOT EXECUTED
8003fcc: 29 91 00 0c lw r17,(r12+12) <== NOT EXECUTED
8003fd0: f8 00 7e 64 calli 8023960 <strerror> <== NOT EXECUTED
8003fd4: b8 20 40 00 mv r8,r1 <== NOT EXECUTED
8003fd8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8003fdc: 5b 8e 00 04 sw (sp+4),r14 <== NOT EXECUTED
8003fe0: 38 21 57 e0 ori r1,r1,0x57e0 <== NOT EXECUTED
8003fe4: ba 80 10 00 mv r2,r20 <== NOT EXECUTED
8003fe8: ba 60 18 00 mv r3,r19 <== NOT EXECUTED
8003fec: ba 00 20 00 mv r4,r16 <== NOT EXECUTED
8003ff0: ba 40 28 00 mv r5,r18 <== NOT EXECUTED
8003ff4: ba 20 30 00 mv r6,r17 <== NOT EXECUTED
8003ff8: b9 e0 38 00 mv r7,r15 <== NOT EXECUTED
8003ffc: fb ff fc ef calli 80033b8 <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);
8004000: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8004004: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
8004008: fb ff fd ca calli 8003730 <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;
800400c: 29 61 00 40 lw r1,(r11+64) <== NOT EXECUTED
8004010: 59 a1 00 00 sw (r13+0),r1 <== NOT EXECUTED
queue->head = sc;
if (queue->tail == 0)
8004014: 29 61 00 44 lw r1,(r11+68) <== NOT EXECUTED
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = queue->head;
queue->head = sc;
8004018: 59 6d 00 40 sw (r11+64),r13 <== NOT EXECUTED
if (queue->tail == 0)
800401c: 5c 20 00 02 bne r1,r0,8004024 <rtems_fdisk_recycle_segment+0x2c8><== NOT EXECUTED
queue->tail = sc;
8004020: 59 6d 00 44 sw (r11+68),r13 <== NOT EXECUTED
queue->count++;
8004024: 29 61 00 48 lw r1,(r11+72) <== NOT EXECUTED
8004028: 34 21 00 01 addi r1,r1,1 <== NOT EXECUTED
800402c: 59 61 00 48 sw (r11+72),r1 <== NOT EXECUTED
8004030: e0 00 00 41 bi 8004134 <rtems_fdisk_recycle_segment+0x3d8> <== NOT EXECUTED
rtems_fdisk_queue_segment (fd, dsc);
rtems_fdisk_segment_queue_push_head (&fd->used, ssc);
return ret;
}
dsc->pages_active++;
8004034: 29 81 00 1c lw r1,(r12+28)
*/
ssc->pages_active--;
ssc->pages_used++;
fd->blocks[spd->block].segment = dsc;
8004038: 34 02 00 03 mvi r2,3
rtems_fdisk_queue_segment (fd, dsc);
rtems_fdisk_segment_queue_push_head (&fd->used, ssc);
return ret;
}
dsc->pages_active++;
800403c: 34 21 00 01 addi r1,r1,1
8004040: 59 81 00 1c sw (r12+28),r1
* 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--;
8004044: 29 a1 00 1c lw r1,(r13+28)
8004048: 34 21 ff ff addi r1,r1,-1
800404c: 59 a1 00 1c sw (r13+28),r1
ssc->pages_used++;
8004050: 29 a1 00 20 lw r1,(r13+32)
8004054: 34 21 00 01 addi r1,r1,1
8004058: 59 a1 00 20 sw (r13+32),r1
fd->blocks[spd->block].segment = dsc;
800405c: 2a 21 00 04 lw r1,(r17+4)
8004060: fb ff f5 20 calli 80014e0 <__ashlsi3>
8004064: 29 62 00 18 lw r2,(r11+24)
8004068: b4 41 08 00 add r1,r2,r1
800406c: 58 2c 00 00 sw (r1+0),r12
fd->blocks[spd->block].page = dpage;
8004070: 58 2f 00 04 sw (r1+4),r15
/*
* Place the segment on to the correct queue.
*/
rtems_fdisk_queue_segment (fd, dsc);
8004074: b9 80 10 00 mv r2,r12
8004078: b9 60 08 00 mv r1,r11
800407c: fb ff fd ad calli 8003730 <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);
8004080: 29 82 00 20 lw r2,(r12+32)
8004084: 29 81 00 1c lw r1,(r12+28)
8004088: b4 41 08 00 add r1,r2,r1
800408c: 29 82 00 24 lw r2,(r12+36)
8004090: b4 22 08 00 add r1,r1,r2
/*
* Get new destination segment if necessary.
*/
dst_pages = rtems_fdisk_seg_pages_available (dsc);
if (dst_pages == 0)
8004094: 29 82 00 14 lw r2,(r12+20)
8004098: 5c 41 00 04 bne r2,r1,80040a8 <rtems_fdisk_recycle_segment+0x34c>
dsc = rtems_fdisk_seg_most_available (&fd->available);
800409c: 29 61 00 34 lw r1,(r11+52)
80040a0: fb ff ff 16 calli 8003cf8 <rtems_fdisk_seg_most_available.clone.9>
80040a4: b8 20 60 00 mv r12,r1
(*pages)--;
80040a8: 2a 41 00 00 lw r1,(r18+0)
uint32_t dpage;
dpage = rtems_fdisk_seg_next_available_page (dsc);
dpd = &dsc->page_descriptors[dpage];
active++;
80040ac: 36 94 00 01 addi r20,r20,1
*/
dst_pages = rtems_fdisk_seg_pages_available (dsc);
if (dst_pages == 0)
dsc = rtems_fdisk_seg_most_available (&fd->available);
(*pages)--;
80040b0: 34 21 ff ff addi r1,r1,-1
80040b4: 5a 41 00 00 sw (r18+0),r1
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))
{
80040b8: e0 00 00 09 bi 80040dc <rtems_fdisk_recycle_segment+0x380>
if (dst_pages == 0)
dsc = rtems_fdisk_seg_most_available (&fd->available);
(*pages)--;
}
else if (rtems_fdisk_page_desc_erased (spd))
80040bc: ba 20 08 00 mv r1,r17
80040c0: fb ff fb 0e calli 8002cf8 <rtems_fdisk_page_desc_erased>
80040c4: 44 20 00 05 be r1,r0,80040d8 <rtems_fdisk_recycle_segment+0x37c><== ALWAYS TAKEN
{
--fd->erased_blocks;
80040c8: 29 61 00 28 lw r1,(r11+40) <== NOT EXECUTED
80040cc: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED
80040d0: 59 61 00 28 sw (r11+40),r1 <== NOT EXECUTED
80040d4: e0 00 00 02 bi 80040dc <rtems_fdisk_recycle_segment+0x380> <== NOT EXECUTED
}
else
{
used++;
80040d8: 36 73 00 01 addi r19,r19,1
int ret;
uint32_t spage;
uint32_t used = 0;
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
80040dc: 36 10 00 01 addi r16,r16,1
80040e0: 36 f7 00 08 addi r23,r23,8
80040e4: 29 a1 00 14 lw r1,(r13+20)
80040e8: 54 30 ff 3c bgu r1,r16,8003dd8 <rtems_fdisk_recycle_segment+0x7c><== NEVER TAKEN
used++;
}
}
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, "ssc end: %d-%d: p=%ld, a=%ld, u=%ld",
80040ec: 29 a3 00 08 lw r3,(r13+8)
80040f0: 29 a4 00 0c lw r4,(r13+12)
80040f4: 78 02 08 03 mvhi r2,0x803
80040f8: 38 42 58 24 ori r2,r2,0x5824
80040fc: b9 60 08 00 mv r1,r11
8004100: ba 40 28 00 mv r5,r18
8004104: ba 80 30 00 mv r6,r20
8004108: ba 60 38 00 mv r7,r19
800410c: fb ff fb 4e calli 8002e44 <rtems_fdisk_printf>
ssc->device, ssc->segment,
pages, active, used);
#endif
if (ssc->pages_active != 0)
8004110: 29 a2 00 1c lw r2,(r13+28)
8004114: 44 40 00 04 be r2,r0,8004124 <rtems_fdisk_recycle_segment+0x3c8><== ALWAYS TAKEN
{
rtems_fdisk_error ("compacting: ssc pages not 0: %d",
8004118: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800411c: 38 21 58 48 ori r1,r1,0x5848 <== NOT EXECUTED
8004120: fb ff fc a6 calli 80033b8 <rtems_fdisk_error> <== NOT EXECUTED
ssc->pages_active);
}
ret = rtems_fdisk_erase_segment (fd, ssc);
8004124: b9 60 08 00 mv r1,r11
8004128: b9 a0 10 00 mv r2,r13
800412c: fb ff fd 2e calli 80035e4 <rtems_fdisk_erase_segment>
8004130: b8 20 70 00 mv r14,r1
return ret;
}
8004134: b9 c0 08 00 mv r1,r14
8004138: 2b 9d 00 08 lw ra,(sp+8)
800413c: 2b 8b 00 48 lw r11,(sp+72)
8004140: 2b 8c 00 44 lw r12,(sp+68)
8004144: 2b 8d 00 40 lw r13,(sp+64)
8004148: 2b 8e 00 3c lw r14,(sp+60)
800414c: 2b 8f 00 38 lw r15,(sp+56)
8004150: 2b 90 00 34 lw r16,(sp+52)
8004154: 2b 91 00 30 lw r17,(sp+48)
8004158: 2b 92 00 2c lw r18,(sp+44)
800415c: 2b 93 00 28 lw r19,(sp+40)
8004160: 2b 94 00 24 lw r20,(sp+36)
8004164: 2b 95 00 20 lw r21,(sp+32)
8004168: 2b 96 00 1c lw r22,(sp+28)
800416c: 2b 97 00 18 lw r23,(sp+24)
8004170: 2b 98 00 14 lw r24,(sp+20)
8004174: 2b 99 00 10 lw r25,(sp+16)
8004178: 2b 9b 00 0c lw fp,(sp+12)
800417c: 37 9c 00 48 addi sp,sp,72
8004180: c3 a0 00 00 ret
080030bc <rtems_fdisk_seg_write>:
rtems_fdisk_seg_write (const rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
uint32_t offset,
const void* buffer,
uint32_t size)
{
80030bc: 37 9c ff d8 addi sp,sp,-40
80030c0: 5b 8b 00 28 sw (sp+40),r11
80030c4: 5b 8c 00 24 sw (sp+36),r12
80030c8: 5b 8d 00 20 sw (sp+32),r13
80030cc: 5b 8e 00 1c sw (sp+28),r14
80030d0: 5b 8f 00 18 sw (sp+24),r15
80030d4: 5b 90 00 14 sw (sp+20),r16
80030d8: 5b 91 00 10 sw (sp+16),r17
80030dc: 5b 92 00 0c sw (sp+12),r18
80030e0: 5b 93 00 08 sw (sp+8),r19
80030e4: 5b 9d 00 04 sw (sp+4),ra
int ret;
uint32_t device;
uint32_t segment;
const rtems_fdisk_segment_desc* sd;
const rtems_fdisk_driver_handlers* ops;
device = sc->device;
80030e8: 28 4b 00 08 lw r11,(r2+8)
segment = sc->segment;
80030ec: 28 4d 00 0c lw r13,(r2+12)
rtems_fdisk_seg_write (const rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
uint32_t offset,
const void* buffer,
uint32_t size)
{
80030f0: b8 20 70 00 mv r14,r1
80030f4: b8 40 60 00 mv r12,r2
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;
80030f8: b9 60 08 00 mv r1,r11
80030fc: 34 02 00 01 mvi r2,1
rtems_fdisk_seg_write (const rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
uint32_t offset,
const void* buffer,
uint32_t size)
{
8003100: b8 60 88 00 mv r17,r3
8003104: b8 a0 80 00 mv r16,r5
8003108: b8 80 90 00 mv r18,r4
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;
800310c: fb ff f8 f5 calli 80014e0 <__ashlsi3>
8003110: 34 02 00 02 mvi r2,2
8003114: b4 2b 08 00 add r1,r1,r11
8003118: fb ff f8 f2 calli 80014e0 <__ashlsi3>
800311c: 29 cf 00 2c lw r15,(r14+44)
8003120: 34 02 00 30 mvi r2,48
8003124: b5 e1 78 00 add r15,r15,r1
8003128: 29 f3 00 00 lw r19,(r15+0)
800312c: b9 a0 08 00 mv r1,r13
8003130: fb ff f9 3a calli 8001618 <__mulsi3>
8003134: b6 61 08 00 add r1,r19,r1
8003138: 28 33 00 04 lw r19,(r1+4)
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;
800313c: 29 e1 00 08 lw r1,(r15+8)
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " seg-write: %02d-%03d: o=%08x s=%d",
8003140: 78 02 08 03 mvhi r2,0x803
8003144: 38 42 54 f4 ori r2,r2,0x54f4
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;
8003148: 28 2f 00 08 lw r15,(r1+8)
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " seg-write: %02d-%03d: o=%08x s=%d",
800314c: b9 60 18 00 mv r3,r11
8003150: b9 a0 20 00 mv r4,r13
8003154: ba 20 28 00 mv r5,r17
8003158: ba 00 30 00 mv r6,r16
800315c: b9 c0 08 00 mv r1,r14
8003160: fb ff ff 39 calli 8002e44 <rtems_fdisk_printf>
device, segment, offset, size);
#endif
ret = ops->write (sd, device, segment, offset, buffer, size);
8003164: 29 e7 00 04 lw r7,(r15+4)
8003168: ba 60 08 00 mv r1,r19
800316c: b9 60 10 00 mv r2,r11
8003170: b9 a0 18 00 mv r3,r13
8003174: ba 20 20 00 mv r4,r17
8003178: ba 40 28 00 mv r5,r18
800317c: ba 00 30 00 mv r6,r16
8003180: d8 e0 00 00 call r7
if (ret)
8003184: 44 20 00 03 be r1,r0,8003190 <rtems_fdisk_seg_write+0xd4> <== ALWAYS TAKEN
sc->failed = true;
8003188: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
800318c: 59 82 00 28 sw (r12+40),r2 <== NOT EXECUTED
return ret;
}
8003190: 2b 9d 00 04 lw ra,(sp+4)
8003194: 2b 8b 00 28 lw r11,(sp+40)
8003198: 2b 8c 00 24 lw r12,(sp+36)
800319c: 2b 8d 00 20 lw r13,(sp+32)
80031a0: 2b 8e 00 1c lw r14,(sp+28)
80031a4: 2b 8f 00 18 lw r15,(sp+24)
80031a8: 2b 90 00 14 lw r16,(sp+20)
80031ac: 2b 91 00 10 lw r17,(sp+16)
80031b0: 2b 92 00 0c lw r18,(sp+12)
80031b4: 2b 93 00 08 lw r19,(sp+8)
80031b8: 37 9c 00 28 addi sp,sp,40
80031bc: c3 a0 00 00 ret
08003258 <rtems_fdisk_seg_write_page>:
static int
rtems_fdisk_seg_write_page (rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
uint32_t page,
const void* buffer)
{
8003258: 37 9c ff e8 addi sp,sp,-24
800325c: 5b 8b 00 18 sw (sp+24),r11
8003260: 5b 8c 00 14 sw (sp+20),r12
8003264: 5b 8d 00 10 sw (sp+16),r13
8003268: 5b 8e 00 0c sw (sp+12),r14
800326c: 5b 8f 00 08 sw (sp+8),r15
8003270: 5b 9d 00 04 sw (sp+4),ra
8003274: b8 20 58 00 mv r11,r1
if ((fd->flags & RTEMS_FDISK_BLANK_CHECK_BEFORE_WRITE))
8003278: 28 21 00 08 lw r1,(r1+8)
static int
rtems_fdisk_seg_write_page (rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
uint32_t page,
const void* buffer)
{
800327c: b8 40 68 00 mv r13,r2
8003280: b8 60 70 00 mv r14,r3
if ((fd->flags & RTEMS_FDISK_BLANK_CHECK_BEFORE_WRITE))
8003284: 20 21 00 08 andi r1,r1,0x8
static int
rtems_fdisk_seg_write_page (rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
uint32_t page,
const void* buffer)
{
8003288: b8 80 78 00 mv r15,r4
if ((fd->flags & RTEMS_FDISK_BLANK_CHECK_BEFORE_WRITE))
800328c: 44 20 00 0b be r1,r0,80032b8 <rtems_fdisk_seg_write_page+0x60><== NEVER TAKEN
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);
8003290: 29 6c 00 14 lw r12,(r11+20)
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,
8003294: b8 60 08 00 mv r1,r3
8003298: b9 80 10 00 mv r2,r12
800329c: fb ff f8 df calli 8001618 <__mulsi3>
80032a0: b8 20 18 00 mv r3,r1
80032a4: b9 a0 10 00 mv r2,r13
80032a8: b9 60 08 00 mv r1,r11
80032ac: b9 80 20 00 mv r4,r12
80032b0: fb ff ff 4c calli 8002fe0 <rtems_fdisk_seg_blank_check>
const void* buffer)
{
if ((fd->flags & RTEMS_FDISK_BLANK_CHECK_BEFORE_WRITE))
{
int ret = rtems_fdisk_seg_blank_check_page (fd, sc, page);
if (ret)
80032b4: 5c 20 00 0e bne r1,r0,80032ec <rtems_fdisk_seg_write_page+0x94><== NEVER TAKEN
return ret;
}
--fd->erased_blocks;
80032b8: 29 61 00 28 lw r1,(r11+40)
return rtems_fdisk_seg_write (fd, sc,
page * fd->block_size, buffer, fd->block_size);
80032bc: 29 6c 00 14 lw r12,(r11+20)
{
int ret = rtems_fdisk_seg_blank_check_page (fd, sc, page);
if (ret)
return ret;
}
--fd->erased_blocks;
80032c0: 34 21 ff ff addi r1,r1,-1
80032c4: 59 61 00 28 sw (r11+40),r1
return rtems_fdisk_seg_write (fd, sc,
80032c8: b9 80 10 00 mv r2,r12
80032cc: b9 c0 08 00 mv r1,r14
80032d0: fb ff f8 d2 calli 8001618 <__mulsi3>
80032d4: b8 20 18 00 mv r3,r1
80032d8: b9 a0 10 00 mv r2,r13
80032dc: b9 60 08 00 mv r1,r11
80032e0: b9 e0 20 00 mv r4,r15
80032e4: b9 80 28 00 mv r5,r12
80032e8: fb ff ff 75 calli 80030bc <rtems_fdisk_seg_write>
page * fd->block_size, buffer, fd->block_size);
}
80032ec: 2b 9d 00 04 lw ra,(sp+4)
80032f0: 2b 8b 00 18 lw r11,(sp+24)
80032f4: 2b 8c 00 14 lw r12,(sp+20)
80032f8: 2b 8d 00 10 lw r13,(sp+16)
80032fc: 2b 8e 00 0c lw r14,(sp+12)
8003300: 2b 8f 00 08 lw r15,(sp+8)
8003304: 37 9c 00 18 addi sp,sp,24
8003308: c3 a0 00 00 ret
080031c0 <rtems_fdisk_seg_write_page_desc>:
static int
rtems_fdisk_seg_write_page_desc (const rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
uint32_t page,
const rtems_fdisk_page_desc* page_desc)
{
80031c0: 37 9c ff ec addi sp,sp,-20
80031c4: 5b 8b 00 14 sw (sp+20),r11
80031c8: 5b 8c 00 10 sw (sp+16),r12
80031cc: 5b 8d 00 0c sw (sp+12),r13
80031d0: 5b 8e 00 08 sw (sp+8),r14
80031d4: 5b 9d 00 04 sw (sp+4),ra
80031d8: b8 20 58 00 mv r11,r1
80031dc: b8 40 68 00 mv r13,r2
uint32_t offset = page * sizeof (rtems_fdisk_page_desc);
80031e0: b8 60 08 00 mv r1,r3
80031e4: 34 02 00 03 mvi r2,3
static int
rtems_fdisk_seg_write_page_desc (const rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
uint32_t page,
const rtems_fdisk_page_desc* page_desc)
{
80031e8: b8 80 70 00 mv r14,r4
uint32_t offset = page * sizeof (rtems_fdisk_page_desc);
80031ec: fb ff f8 bd calli 80014e0 <__ashlsi3>
80031f0: b8 20 60 00 mv r12,r1
if ((fd->flags & RTEMS_FDISK_BLANK_CHECK_BEFORE_WRITE))
80031f4: 29 61 00 08 lw r1,(r11+8)
80031f8: 20 21 00 08 andi r1,r1,0x8
80031fc: 44 20 00 08 be r1,r0,800321c <rtems_fdisk_seg_write_page_desc+0x5c><== NEVER TAKEN
{
int ret = rtems_fdisk_seg_blank_check (fd, sc,
8003200: b9 60 08 00 mv r1,r11
8003204: b9 a0 10 00 mv r2,r13
8003208: b9 80 18 00 mv r3,r12
800320c: 34 04 00 08 mvi r4,8
8003210: fb ff ff 74 calli 8002fe0 <rtems_fdisk_seg_blank_check>
8003214: b8 20 28 00 mv r5,r1
offset,
sizeof (rtems_fdisk_page_desc));
if (ret)
8003218: 5c 20 00 08 bne r1,r0,8003238 <rtems_fdisk_seg_write_page_desc+0x78><== NEVER TAKEN
return ret;
}
return rtems_fdisk_seg_write (fd, sc, offset,
800321c: 34 05 00 08 mvi r5,8
8003220: b9 60 08 00 mv r1,r11
8003224: b9 a0 10 00 mv r2,r13
8003228: b9 80 18 00 mv r3,r12
800322c: b9 c0 20 00 mv r4,r14
8003230: fb ff ff a3 calli 80030bc <rtems_fdisk_seg_write>
8003234: b8 20 28 00 mv r5,r1
page_desc, sizeof (rtems_fdisk_page_desc));
}
8003238: b8 a0 08 00 mv r1,r5
800323c: 2b 9d 00 04 lw ra,(sp+4)
8003240: 2b 8b 00 14 lw r11,(sp+20)
8003244: 2b 8c 00 10 lw r12,(sp+16)
8003248: 2b 8d 00 0c lw r13,(sp+12)
800324c: 2b 8e 00 08 lw r14,(sp+8)
8003250: 37 9c 00 14 addi sp,sp,20
8003254: c3 a0 00 00 ret
08002c34 <rtems_fdisk_segment_queue_pop_head>:
* 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)
8002c34: 28 22 00 00 lw r2,(r1+0)
8002c38: 44 40 00 09 be r2,r0,8002c5c <rtems_fdisk_segment_queue_pop_head+0x28><== NEVER TAKEN
{
rtems_fdisk_segment_ctl* sc = queue->head;
queue->head = sc->next;
8002c3c: 28 43 00 00 lw r3,(r2+0)
8002c40: 58 23 00 00 sw (r1+0),r3
if (!queue->head)
8002c44: 5c 60 00 02 bne r3,r0,8002c4c <rtems_fdisk_segment_queue_pop_head+0x18>
queue->tail = 0;
8002c48: 58 20 00 04 sw (r1+4),r0
queue->count--;
8002c4c: 28 23 00 08 lw r3,(r1+8)
8002c50: 34 63 ff ff addi r3,r3,-1
8002c54: 58 23 00 08 sw (r1+8),r3
sc->next = 0;
8002c58: 58 40 00 00 sw (r2+0),r0
return sc;
}
return 0;
}
8002c5c: b8 40 08 00 mv r1,r2
8002c60: c3 a0 00 00 ret
08002c64 <rtems_fdisk_segment_queue_push_tail>:
*/
static void
rtems_fdisk_segment_queue_push_tail (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
8002c64: 44 40 00 0d be r2,r0,8002c98 <rtems_fdisk_segment_queue_push_tail+0x34><== NEVER TAKEN
{
sc->next = 0;
if (queue->head)
8002c68: 28 23 00 00 lw r3,(r1+0)
rtems_fdisk_segment_queue_push_tail (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = 0;
8002c6c: 58 40 00 00 sw (r2+0),r0
if (queue->head)
8002c70: 44 60 00 05 be r3,r0,8002c84 <rtems_fdisk_segment_queue_push_tail+0x20>
{
queue->tail->next = sc;
8002c74: 28 23 00 04 lw r3,(r1+4)
8002c78: 58 62 00 00 sw (r3+0),r2
queue->tail = sc;
8002c7c: 58 22 00 04 sw (r1+4),r2
8002c80: e0 00 00 03 bi 8002c8c <rtems_fdisk_segment_queue_push_tail+0x28>
}
else
{
queue->head = queue->tail = sc;
8002c84: 58 22 00 04 sw (r1+4),r2
8002c88: 58 22 00 00 sw (r1+0),r2
}
queue->count++;
8002c8c: 28 22 00 08 lw r2,(r1+8)
8002c90: 34 42 00 01 addi r2,r2,1
8002c94: 58 22 00 08 sw (r1+8),r2
8002c98: c3 a0 00 00 ret
08002c9c <rtems_fdisk_segment_queue_remove>:
static void
rtems_fdisk_segment_queue_remove (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_segment_ctl* prev = 0;
rtems_fdisk_segment_ctl* it = queue->head;
8002c9c: 28 24 00 00 lw r4,(r1+0)
*/
static void
rtems_fdisk_segment_queue_remove (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_segment_ctl* prev = 0;
8002ca0: 34 03 00 00 mvi r3,0
/*
* Do not change sc->next as sc could be on another queue.
*/
while (it)
8002ca4: e0 00 00 13 bi 8002cf0 <rtems_fdisk_segment_queue_remove+0x54>
{
if (sc == it)
8002ca8: 5c 44 00 10 bne r2,r4,8002ce8 <rtems_fdisk_segment_queue_remove+0x4c>
8002cac: 28 44 00 00 lw r4,(r2+0)
{
if (prev == 0)
8002cb0: 5c 60 00 05 bne r3,r0,8002cc4 <rtems_fdisk_segment_queue_remove+0x28>
{
queue->head = sc->next;
8002cb4: 58 24 00 00 sw (r1+0),r4
if (queue->head == 0)
8002cb8: 5c 83 00 07 bne r4,r3,8002cd4 <rtems_fdisk_segment_queue_remove+0x38>
queue->tail = 0;
8002cbc: 58 20 00 04 sw (r1+4),r0
8002cc0: e0 00 00 05 bi 8002cd4 <rtems_fdisk_segment_queue_remove+0x38>
}
else
{
prev->next = sc->next;
8002cc4: 58 64 00 00 sw (r3+0),r4
if (queue->tail == sc)
8002cc8: 28 24 00 04 lw r4,(r1+4)
8002ccc: 5c 82 00 02 bne r4,r2,8002cd4 <rtems_fdisk_segment_queue_remove+0x38><== NEVER TAKEN
queue->tail = prev;
8002cd0: 58 23 00 04 sw (r1+4),r3
}
sc->next = 0;
8002cd4: 58 40 00 00 sw (r2+0),r0
queue->count--;
8002cd8: 28 22 00 08 lw r2,(r1+8)
8002cdc: 34 42 ff ff addi r2,r2,-1
8002ce0: 58 22 00 08 sw (r1+8),r2
break;
8002ce4: c3 a0 00 00 ret
}
prev = it;
it = it->next;
8002ce8: b8 80 18 00 mv r3,r4
8002cec: 28 84 00 00 lw r4,(r4+0)
/*
* Do not change sc->next as sc could be on another queue.
*/
while (it)
8002cf0: 5c 80 ff ee bne r4,r0,8002ca8 <rtems_fdisk_segment_queue_remove+0xc>
8002cf4: c3 a0 00 00 ret
0800330c <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, ...)
{
800330c: 37 9c ff d4 addi sp,sp,-44 <== NOT EXECUTED
8003310: 5b 8b 00 10 sw (sp+16),r11 <== NOT EXECUTED
8003314: 5b 8c 00 0c sw (sp+12),r12 <== NOT EXECUTED
8003318: 5b 8d 00 08 sw (sp+8),r13 <== NOT EXECUTED
800331c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
8003320: 5b 82 00 14 sw (sp+20),r2 <== NOT EXECUTED
8003324: 5b 83 00 18 sw (sp+24),r3 <== NOT EXECUTED
8003328: 5b 84 00 1c sw (sp+28),r4 <== NOT EXECUTED
800332c: 5b 85 00 20 sw (sp+32),r5 <== NOT EXECUTED
8003330: 5b 86 00 24 sw (sp+36),r6 <== NOT EXECUTED
8003334: 5b 87 00 28 sw (sp+40),r7 <== NOT EXECUTED
8003338: 5b 88 00 2c sw (sp+44),r8 <== NOT EXECUTED
int ret = 0;
if (fd->info_level >= 1)
800333c: 28 21 00 6c lw r1,(r1+108) <== 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, ...)
{
8003340: b8 40 68 00 mv r13,r2 <== NOT EXECUTED
int ret = 0;
8003344: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
if (fd->info_level >= 1)
8003348: 44 20 00 15 be r1,r0,800339c <rtems_fdisk_warning+0x90> <== NOT EXECUTED
{
va_list args;
va_start (args, format);
fprintf (stdout, "fdisk:warning:");
800334c: 78 0b 08 03 mvhi r11,0x803 <== NOT EXECUTED
8003350: 39 6b b2 90 ori r11,r11,0xb290 <== NOT EXECUTED
8003354: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED
8003358: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800335c: 38 21 55 18 ori r1,r1,0x5518 <== NOT EXECUTED
8003360: 28 42 00 08 lw r2,(r2+8) <== NOT EXECUTED
8003364: f8 00 79 4b calli 8021890 <fputs> <== NOT EXECUTED
ret = vfprintf (stdout, format, args);
8003368: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED
800336c: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
8003370: 37 83 00 18 addi r3,sp,24 <== NOT EXECUTED
8003374: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED
8003378: f8 00 9a c0 calli 8029e78 <vfprintf> <== NOT EXECUTED
fprintf (stdout, "\n");
800337c: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED
if (fd->info_level >= 1)
{
va_list args;
va_start (args, format);
fprintf (stdout, "fdisk:warning:");
ret = vfprintf (stdout, format, args);
8003380: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
fprintf (stdout, "\n");
8003384: 34 01 00 0a mvi r1,10 <== NOT EXECUTED
8003388: 28 42 00 08 lw r2,(r2+8) <== NOT EXECUTED
800338c: f8 00 78 fd calli 8021780 <fputc> <== NOT EXECUTED
fflush (stdout);
8003390: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED
8003394: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED
8003398: f8 00 77 6c calli 8021148 <fflush> <== NOT EXECUTED
va_end (args);
}
return ret;
}
800339c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
80033a0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
80033a4: 2b 8b 00 10 lw r11,(sp+16) <== NOT EXECUTED
80033a8: 2b 8c 00 0c lw r12,(sp+12) <== NOT EXECUTED
80033ac: 2b 8d 00 08 lw r13,(sp+8) <== NOT EXECUTED
80033b0: 37 9c 00 2c addi sp,sp,44 <== NOT EXECUTED
80033b4: c3 a0 00 00 ret <== NOT EXECUTED
080043e8 <rtems_filesystem_do_unmount>:
}
void rtems_filesystem_do_unmount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
80043e8: 37 9c ff f4 addi sp,sp,-12
80043ec: 5b 8b 00 0c sw (sp+12),r11
80043f0: 5b 8c 00 08 sw (sp+8),r12
80043f4: 5b 9d 00 04 sw (sp+4),ra
*/
#include <rtems/userenv.h>
static inline void rtems_libio_lock( void )
{
rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
80043f8: 78 0c 08 01 mvhi r12,0x801
80043fc: 39 8c a8 84 ori r12,r12,0xa884
8004400: b8 20 58 00 mv r11,r1
8004404: 29 81 00 00 lw r1,(r12+0)
8004408: 34 03 00 00 mvi r3,0
800440c: 34 02 00 00 mvi r2,0
8004410: f8 00 02 c7 calli 8004f2c <rtems_semaphore_obtain>
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
8004414: 29 62 00 00 lw r2,(r11+0)
previous = the_node->previous;
8004418: 29 61 00 04 lw r1,(r11+4)
next->previous = previous;
800441c: 58 41 00 04 sw (r2+4),r1
previous->next = next;
8004420: 58 22 00 00 sw (r1+0),r2
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
8004424: 29 81 00 00 lw r1,(r12+0)
8004428: f8 00 03 11 calli 800506c <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);
800442c: 29 61 00 20 lw r1,(r11+32)
8004430: f8 00 00 71 calli 80045f4 <rtems_filesystem_global_location_release>
(*mt_entry->ops->fsunmount_me_h)(mt_entry);
8004434: 29 61 00 0c lw r1,(r11+12)
8004438: 28 22 00 3c lw r2,(r1+60)
800443c: b9 60 08 00 mv r1,r11
8004440: d8 40 00 00 call r2
if (mt_entry->unmount_task != 0) {
8004444: 29 61 00 3c lw r1,(r11+60)
8004448: 44 20 00 08 be r1,r0,8004468 <rtems_filesystem_do_unmount+0x80><== NEVER TAKEN
*/
RTEMS_INLINE_ROUTINE rtems_status_code rtems_event_transient_send(
rtems_id id
)
{
return rtems_event_system_send( id, RTEMS_EVENT_SYSTEM_TRANSIENT );
800444c: 78 02 80 00 mvhi r2,0x8000
8004450: f8 00 03 45 calli 8005164 <rtems_event_system_send>
rtems_status_code sc =
rtems_event_transient_send(mt_entry->unmount_task);
if (sc != RTEMS_SUCCESSFUL) {
8004454: 44 20 00 05 be r1,r0,8004468 <rtems_filesystem_do_unmount+0x80><== ALWAYS TAKEN
rtems_fatal_error_occurred(0xdeadbeef);
8004458: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED
800445c: 38 42 88 bc ori r2,r2,0x88bc <== NOT EXECUTED
8004460: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED
8004464: f8 00 03 ff calli 8005460 <rtems_fatal_error_occurred> <== NOT EXECUTED
}
}
free(mt_entry);
8004468: b9 60 08 00 mv r1,r11
800446c: fb ff f9 29 calli 8002910 <free>
}
8004470: 2b 9d 00 04 lw ra,(sp+4)
8004474: 2b 8b 00 0c lw r11,(sp+12)
8004478: 2b 8c 00 08 lw r12,(sp+8)
800447c: 37 9c 00 0c addi sp,sp,12
8004480: c3 a0 00 00 ret
0800d638 <rtems_filesystem_eval_path_generic>:
void rtems_filesystem_eval_path_generic(
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const rtems_filesystem_eval_path_generic_config *config
)
{
800d638: 37 9c ff d0 addi sp,sp,-48
800d63c: 5b 8b 00 30 sw (sp+48),r11
800d640: 5b 8c 00 2c sw (sp+44),r12
800d644: 5b 8d 00 28 sw (sp+40),r13
800d648: 5b 8e 00 24 sw (sp+36),r14
800d64c: 5b 8f 00 20 sw (sp+32),r15
800d650: 5b 90 00 1c sw (sp+28),r16
800d654: 5b 91 00 18 sw (sp+24),r17
800d658: 5b 92 00 14 sw (sp+20),r18
800d65c: 5b 93 00 10 sw (sp+16),r19
800d660: 5b 94 00 0c sw (sp+12),r20
800d664: 5b 95 00 08 sw (sp+8),r21
800d668: 5b 9d 00 04 sw (sp+4),ra
} else {
/* This is the root file system */
status = (*config->eval_token)(ctx, arg, ".", 1);
}
} else {
status = (*config->eval_token)(ctx, arg, "..", 2);
800d66c: 78 11 08 01 mvhi r17,0x801
¤tloc->mt_entry->mt_point_node
);
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
} else {
/* This is the root file system */
status = (*config->eval_token)(ctx, arg, ".", 1);
800d670: 78 0f 08 01 mvhi r15,0x801
void rtems_filesystem_eval_path_generic(
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const rtems_filesystem_eval_path_generic_config *config
)
{
800d674: b8 20 58 00 mv r11,r1
800d678: b8 40 70 00 mv r14,r2
800d67c: b8 60 60 00 mv r12,r3
static inline bool rtems_filesystem_is_current_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 1 && token [0] == '.';
800d680: 34 15 00 01 mvi r21,1
static inline bool rtems_filesystem_is_parent_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 2 && token [0] == '.' && token [1] == '.';
800d684: 34 14 00 02 mvi r20,2
800d688: 34 12 00 2e mvi r18,46
rtems_filesystem_eval_path_error(ctx, EINVAL);
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
}
}
} else if (rtems_filesystem_is_parent_directory(token, tokenlen)) {
rtems_filesystem_location_info_t *currentloc =
800d68c: 34 33 00 18 addi r19,r1,24
} else {
/* This is the root file system */
status = (*config->eval_token)(ctx, arg, ".", 1);
}
} else {
status = (*config->eval_token)(ctx, arg, "..", 2);
800d690: 3a 31 8e fc ori r17,r17,0x8efc
¤tloc->mt_entry->mt_point_node
);
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
} else {
/* This is the root file system */
status = (*config->eval_token)(ctx, arg, ".", 1);
800d694: 39 ef 8a 74 ori r15,r15,0x8a74
rtems_filesystem_eval_path_context_t *ctx,
const char **token,
size_t *tokenlen
)
{
rtems_filesystem_eval_path_next_token(ctx);
800d698: b9 60 08 00 mv r1,r11
800d69c: f8 00 00 7e calli 800d894 <rtems_filesystem_eval_path_next_token>
*token = ctx->token;
*tokenlen = ctx->tokenlen;
800d6a0: 29 6d 00 0c lw r13,(r11+12)
const char **token,
size_t *tokenlen
)
{
rtems_filesystem_eval_path_next_token(ctx);
*token = ctx->token;
800d6a4: 29 70 00 08 lw r16,(r11+8)
const char *token;
size_t tokenlen;
rtems_filesystem_eval_path_get_next_token(ctx, &token, &tokenlen);
if (tokenlen > 0) {
800d6a8: 45 a0 00 5e be r13,r0,800d820 <rtems_filesystem_eval_path_generic+0x1e8>
if ((*config->is_directory)(ctx, arg)) {
800d6ac: 29 83 00 00 lw r3,(r12+0)
800d6b0: b9 60 08 00 mv r1,r11
800d6b4: b9 c0 10 00 mv r2,r14
800d6b8: d8 60 00 00 call r3
800d6bc: 44 20 00 44 be r1,r0,800d7cc <rtems_filesystem_eval_path_generic+0x194>
static inline bool rtems_filesystem_is_current_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 1 && token [0] == '.';
800d6c0: 5d b5 00 49 bne r13,r21,800d7e4 <rtems_filesystem_eval_path_generic+0x1ac>
800d6c4: 42 01 00 00 lbu r1,(r16+0)
800d6c8: 5c 32 00 48 bne r1,r18,800d7e8 <rtems_filesystem_eval_path_generic+0x1b0>
if (rtems_filesystem_is_current_directory(token, tokenlen)) {
if (rtems_filesystem_eval_path_has_path(ctx)) {
800d6cc: 29 61 00 04 lw r1,(r11+4)
800d6d0: 5c 20 00 24 bne r1,r0,800d760 <rtems_filesystem_eval_path_generic+0x128>
status = (*config->eval_token)(ctx, arg, ".", 1);
} else {
int eval_flags = rtems_filesystem_eval_path_get_flags(ctx);
if ((eval_flags & RTEMS_FS_REJECT_TERMINAL_DOT) == 0) {
800d6d4: 29 62 00 10 lw r2,(r11+16)
800d6d8: 20 42 01 00 andi r2,r2,0x100
800d6dc: 44 41 00 21 be r2,r1,800d760 <rtems_filesystem_eval_path_generic+0x128>
status = (*config->eval_token)(ctx, arg, ".", 1);
} else {
rtems_filesystem_eval_path_error(ctx, EINVAL);
800d6e0: b9 60 08 00 mv r1,r11
800d6e4: 34 02 00 16 mvi r2,22
800d6e8: e0 00 00 3b bi 800d7d4 <rtems_filesystem_eval_path_generic+0x19c>
static inline bool rtems_filesystem_is_parent_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 2 && token [0] == '.' && token [1] == '.';
800d6ec: 42 01 00 00 lbu r1,(r16+0)
800d6f0: 5c 32 00 3e bne r1,r18,800d7e8 <rtems_filesystem_eval_path_generic+0x1b0>
800d6f4: 42 01 00 01 lbu r1,(r16+1)
800d6f8: 5c 32 00 3c bne r1,r18,800d7e8 <rtems_filesystem_eval_path_generic+0x1b0><== NEVER TAKEN
}
} else {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
}
}
}
800d6fc: 29 62 00 30 lw r2,(r11+48)
static bool is_eval_path_root(
const rtems_filesystem_eval_path_context_t *ctx,
const rtems_filesystem_location_info_t *loc
)
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
800d700: 29 61 00 2c lw r1,(r11+44)
const rtems_filesystem_location_info_t *rootloc = &ctx->rootloc->location;
return mt_entry == rootloc->mt_entry
&& (*mt_entry->ops->are_nodes_equal_h)( loc, rootloc );
800d704: 28 43 00 14 lw r3,(r2+20)
800d708: 5c 23 00 3e bne r1,r3,800d800 <rtems_filesystem_eval_path_generic+0x1c8>
800d70c: 28 21 00 0c lw r1,(r1+12)
800d710: 28 23 00 10 lw r3,(r1+16)
800d714: ba 60 08 00 mv r1,r19
800d718: d8 60 00 00 call r3
800d71c: 44 20 00 39 be r1,r0,800d800 <rtems_filesystem_eval_path_generic+0x1c8>
800d720: e0 00 00 10 bi 800d760 <rtems_filesystem_eval_path_generic+0x128>
if (is_eval_path_root(ctx, currentloc)) {
/* This prevents the escape from a chroot() environment */
status = (*config->eval_token)(ctx, arg, ".", 1);
} else if (is_fs_root(currentloc)) {
if (currentloc->mt_entry->mt_point_node != NULL) {
800d724: 29 62 00 2c lw r2,(r11+44)
800d728: 28 41 00 20 lw r1,(r2+32)
800d72c: 44 20 00 0d be r1,r0,800d760 <rtems_filesystem_eval_path_generic+0x128><== NEVER TAKEN
static inline void rtems_filesystem_eval_path_put_back_token(
rtems_filesystem_eval_path_context_t *ctx
)
{
size_t tokenlen = ctx->tokenlen;
800d730: 29 61 00 0c lw r1,(r11+12)
ctx->path -= tokenlen;
800d734: 29 63 00 00 lw r3,(r11+0)
ctx->pathlen += tokenlen;
ctx->tokenlen = 0;
800d738: 59 60 00 0c sw (r11+12),r0
rtems_filesystem_eval_path_put_back_token(ctx);
rtems_filesystem_eval_path_restart(
800d73c: 34 42 00 20 addi r2,r2,32
rtems_filesystem_eval_path_context_t *ctx
)
{
size_t tokenlen = ctx->tokenlen;
ctx->path -= tokenlen;
800d740: c8 61 18 00 sub r3,r3,r1
800d744: 59 63 00 00 sw (r11+0),r3
ctx->pathlen += tokenlen;
800d748: 29 63 00 04 lw r3,(r11+4)
800d74c: b4 61 08 00 add r1,r3,r1
800d750: 59 61 00 04 sw (r11+4),r1
800d754: b9 60 08 00 mv r1,r11
800d758: fb ff da a8 calli 80041f8 <rtems_filesystem_eval_path_restart>
800d75c: e0 00 00 31 bi 800d820 <rtems_filesystem_eval_path_generic+0x1e8>
¤tloc->mt_entry->mt_point_node
);
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
} else {
/* This is the root file system */
status = (*config->eval_token)(ctx, arg, ".", 1);
800d760: 29 85 00 04 lw r5,(r12+4)
800d764: b9 60 08 00 mv r1,r11
800d768: b9 c0 10 00 mv r2,r14
800d76c: b9 e0 18 00 mv r3,r15
800d770: 34 04 00 01 mvi r4,1
800d774: e0 00 00 06 bi 800d78c <rtems_filesystem_eval_path_generic+0x154>
}
} else {
status = (*config->eval_token)(ctx, arg, "..", 2);
800d778: 29 85 00 04 lw r5,(r12+4)
800d77c: b9 60 08 00 mv r1,r11
800d780: b9 c0 10 00 mv r2,r14
800d784: ba 20 18 00 mv r3,r17
800d788: 34 04 00 02 mvi r4,2
800d78c: d8 a0 00 00 call r5
800d790: b8 20 68 00 mv r13,r1
}
} else {
status = (*config->eval_token)(ctx, arg, token, tokenlen);
}
if (status == RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY) {
800d794: 5c 34 00 12 bne r1,r20,800d7dc <rtems_filesystem_eval_path_generic+0x1a4>
if (rtems_filesystem_eval_path_has_path(ctx)) {
800d798: 29 61 00 04 lw r1,(r11+4)
800d79c: 44 20 00 10 be r1,r0,800d7dc <rtems_filesystem_eval_path_generic+0x1a4>
int eval_flags;
rtems_filesystem_eval_path_eat_delimiter(ctx);
800d7a0: b9 60 08 00 mv r1,r11
800d7a4: f8 00 00 2d calli 800d858 <rtems_filesystem_eval_path_eat_delimiter>
eval_flags = rtems_filesystem_eval_path_get_flags(ctx);
if (
(eval_flags & RTEMS_FS_ACCEPT_RESIDUAL_DELIMITERS) == 0
800d7a8: 29 61 00 10 lw r1,(r11+16)
800d7ac: 20 21 00 80 andi r1,r1,0x80
if (rtems_filesystem_eval_path_has_path(ctx)) {
int eval_flags;
rtems_filesystem_eval_path_eat_delimiter(ctx);
eval_flags = rtems_filesystem_eval_path_get_flags(ctx);
if (
800d7b0: 44 20 00 03 be r1,r0,800d7bc <rtems_filesystem_eval_path_generic+0x184>
(eval_flags & RTEMS_FS_ACCEPT_RESIDUAL_DELIMITERS) == 0
|| rtems_filesystem_eval_path_has_path(ctx)
800d7b4: 29 61 00 04 lw r1,(r11+4)
800d7b8: 44 20 00 09 be r1,r0,800d7dc <rtems_filesystem_eval_path_generic+0x1a4>
) {
rtems_filesystem_eval_path_error(ctx, ENOENT);
800d7bc: b9 60 08 00 mv r1,r11
800d7c0: 34 02 00 02 mvi r2,2
800d7c4: fb ff d9 59 calli 8003d28 <rtems_filesystem_eval_path_error>
800d7c8: e0 00 00 05 bi 800d7dc <rtems_filesystem_eval_path_generic+0x1a4>
}
}
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOTDIR);
800d7cc: b9 60 08 00 mv r1,r11
800d7d0: 34 02 00 14 mvi r2,20
800d7d4: fb ff d9 55 calli 8003d28 <rtems_filesystem_eval_path_error>
800d7d8: e0 00 00 12 bi 800d820 <rtems_filesystem_eval_path_generic+0x1e8>
)
{
rtems_filesystem_eval_path_generic_status status =
RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
while (status == RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE) {
800d7dc: 45 a0 ff af be r13,r0,800d698 <rtems_filesystem_eval_path_generic+0x60>
800d7e0: e0 00 00 10 bi 800d820 <rtems_filesystem_eval_path_generic+0x1e8>
static inline bool rtems_filesystem_is_parent_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 2 && token [0] == '.' && token [1] == '.';
800d7e4: 45 b4 ff c2 be r13,r20,800d6ec <rtems_filesystem_eval_path_generic+0xb4>
}
} else {
status = (*config->eval_token)(ctx, arg, "..", 2);
}
} else {
status = (*config->eval_token)(ctx, arg, token, tokenlen);
800d7e8: 29 85 00 04 lw r5,(r12+4)
800d7ec: b9 60 08 00 mv r1,r11
800d7f0: b9 c0 10 00 mv r2,r14
800d7f4: ba 00 18 00 mv r3,r16
800d7f8: b9 a0 20 00 mv r4,r13
800d7fc: e3 ff ff e4 bi 800d78c <rtems_filesystem_eval_path_generic+0x154>
#include <rtems/libio_.h>
static bool is_fs_root( const rtems_filesystem_location_info_t *loc )
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
800d800: 29 62 00 2c lw r2,(r11+44)
const rtems_filesystem_location_info_t *mt_fs_root =
&mt_entry->mt_fs_root->location;
return (*mt_entry->ops->are_nodes_equal_h)( loc, mt_fs_root );
800d804: 28 41 00 0c lw r1,(r2+12)
800d808: 28 42 00 24 lw r2,(r2+36)
800d80c: 28 23 00 10 lw r3,(r1+16)
800d810: ba 60 08 00 mv r1,r19
800d814: d8 60 00 00 call r3
rtems_filesystem_eval_path_get_currentloc( ctx );
if (is_eval_path_root(ctx, currentloc)) {
/* This prevents the escape from a chroot() environment */
status = (*config->eval_token)(ctx, arg, ".", 1);
} else if (is_fs_root(currentloc)) {
800d818: 5c 20 ff c3 bne r1,r0,800d724 <rtems_filesystem_eval_path_generic+0xec>
800d81c: e3 ff ff d7 bi 800d778 <rtems_filesystem_eval_path_generic+0x140>
}
} else {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
}
}
}
800d820: 2b 9d 00 04 lw ra,(sp+4)
800d824: 2b 8b 00 30 lw r11,(sp+48)
800d828: 2b 8c 00 2c lw r12,(sp+44)
800d82c: 2b 8d 00 28 lw r13,(sp+40)
800d830: 2b 8e 00 24 lw r14,(sp+36)
800d834: 2b 8f 00 20 lw r15,(sp+32)
800d838: 2b 90 00 1c lw r16,(sp+28)
800d83c: 2b 91 00 18 lw r17,(sp+24)
800d840: 2b 92 00 14 lw r18,(sp+20)
800d844: 2b 93 00 10 lw r19,(sp+16)
800d848: 2b 94 00 0c lw r20,(sp+12)
800d84c: 2b 95 00 08 lw r21,(sp+8)
800d850: 37 9c 00 30 addi sp,sp,48
800d854: c3 a0 00 00 ret
08004288 <rtems_filesystem_eval_path_recursive>:
void rtems_filesystem_eval_path_recursive(
rtems_filesystem_eval_path_context_t *ctx,
const char *path,
size_t pathlen
)
{
8004288: 37 9c ff e8 addi sp,sp,-24
800428c: 5b 8b 00 18 sw (sp+24),r11
8004290: 5b 8c 00 14 sw (sp+20),r12
8004294: 5b 8d 00 10 sw (sp+16),r13
8004298: 5b 8e 00 0c sw (sp+12),r14
800429c: 5b 8f 00 08 sw (sp+8),r15
80042a0: 5b 9d 00 04 sw (sp+4),ra
80042a4: b8 20 58 00 mv r11,r1
80042a8: b8 40 68 00 mv r13,r2
80042ac: b8 60 60 00 mv r12,r3
if (pathlen > 0) {
80042b0: 44 60 00 22 be r3,r0,8004338 <rtems_filesystem_eval_path_recursive+0xb0><== NEVER TAKEN
if (ctx->recursionlevel < RTEMS_FILESYSTEM_SYMLOOP_MAX) {
80042b4: 28 23 00 14 lw r3,(r1+20)
80042b8: 34 02 00 1f mvi r2,31
80042bc: 48 62 00 1d bg r3,r2,8004330 <rtems_filesystem_eval_path_recursive+0xa8>
const char *saved_path = ctx->path;
size_t saved_pathlen = ctx->pathlen;
if (rtems_filesystem_is_delimiter(path [0])) {
80042c0: 41 a2 00 00 lbu r2,(r13+0)
size_t pathlen
)
{
if (pathlen > 0) {
if (ctx->recursionlevel < RTEMS_FILESYSTEM_SYMLOOP_MAX) {
const char *saved_path = ctx->path;
80042c4: 28 2f 00 00 lw r15,(r1+0)
size_t saved_pathlen = ctx->pathlen;
80042c8: 28 2e 00 04 lw r14,(r1+4)
gid_t node_gid
);
static inline bool rtems_filesystem_is_delimiter(char c)
{
return c == '/' || c == '\\';
80042cc: 64 43 00 5c cmpei r3,r2,92
80042d0: 64 42 00 2f cmpei r2,r2,47
80042d4: b8 62 10 00 or r2,r3,r2
if (rtems_filesystem_is_delimiter(path [0])) {
80042d8: 44 40 00 03 be r2,r0,80042e4 <rtems_filesystem_eval_path_recursive+0x5c>
rtems_filesystem_eval_path_restart(ctx, &ctx->rootloc);
80042dc: 34 22 00 30 addi r2,r1,48
80042e0: fb ff ff c6 calli 80041f8 <rtems_filesystem_eval_path_restart>
}
ctx->path = path;
ctx->pathlen = pathlen;
++ctx->recursionlevel;
80042e4: 29 61 00 14 lw r1,(r11+20)
if (rtems_filesystem_is_delimiter(path [0])) {
rtems_filesystem_eval_path_restart(ctx, &ctx->rootloc);
}
ctx->path = path;
80042e8: 59 6d 00 00 sw (r11+0),r13
ctx->pathlen = pathlen;
80042ec: 59 6c 00 04 sw (r11+4),r12
++ctx->recursionlevel;
80042f0: 34 21 00 01 addi r1,r1,1
80042f4: 59 61 00 14 sw (r11+20),r1
while (ctx->pathlen > 0) {
80042f8: e0 00 00 06 bi 8004310 <rtems_filesystem_eval_path_recursive+0x88>
(*ctx->currentloc.mt_entry->ops->eval_path_h)(ctx);
80042fc: 29 61 00 2c lw r1,(r11+44)
8004300: 28 21 00 0c lw r1,(r1+12)
8004304: 28 22 00 08 lw r2,(r1+8)
8004308: b9 60 08 00 mv r1,r11
800430c: d8 40 00 00 call r2
ctx->path = path;
ctx->pathlen = pathlen;
++ctx->recursionlevel;
while (ctx->pathlen > 0) {
8004310: 29 61 00 04 lw r1,(r11+4)
8004314: 5c 20 ff fa bne r1,r0,80042fc <rtems_filesystem_eval_path_recursive+0x74>
(*ctx->currentloc.mt_entry->ops->eval_path_h)(ctx);
}
--ctx->recursionlevel;
8004318: 29 61 00 14 lw r1,(r11+20)
ctx->path = saved_path;
800431c: 59 6f 00 00 sw (r11+0),r15
ctx->pathlen = saved_pathlen;
8004320: 59 6e 00 04 sw (r11+4),r14
++ctx->recursionlevel;
while (ctx->pathlen > 0) {
(*ctx->currentloc.mt_entry->ops->eval_path_h)(ctx);
}
--ctx->recursionlevel;
8004324: 34 21 ff ff addi r1,r1,-1
8004328: 59 61 00 14 sw (r11+20),r1
800432c: e0 00 00 05 bi 8004340 <rtems_filesystem_eval_path_recursive+0xb8>
ctx->path = saved_path;
ctx->pathlen = saved_pathlen;
} else {
rtems_filesystem_eval_path_error(ctx, ELOOP);
8004330: 34 02 00 5c mvi r2,92
8004334: e0 00 00 02 bi 800433c <rtems_filesystem_eval_path_recursive+0xb4>
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
8004338: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
800433c: fb ff fe 7b calli 8003d28 <rtems_filesystem_eval_path_error>
}
}
8004340: 2b 9d 00 04 lw ra,(sp+4)
8004344: 2b 8b 00 18 lw r11,(sp+24)
8004348: 2b 8c 00 14 lw r12,(sp+20)
800434c: 2b 8d 00 10 lw r13,(sp+16)
8004350: 2b 8e 00 0c lw r14,(sp+12)
8004354: 2b 8f 00 08 lw r15,(sp+8)
8004358: 37 9c 00 18 addi sp,sp,24
800435c: c3 a0 00 00 ret
0800d2d0 <rtems_filesystem_get_mount_handler>:
rtems_filesystem_fsmount_me_t
rtems_filesystem_get_mount_handler(
const char *type
)
{
800d2d0: 37 9c ff f4 addi sp,sp,-12
800d2d4: 5b 9d 00 04 sw (sp+4),ra
find_arg fa = {
800d2d8: 5b 81 00 08 sw (sp+8),r1
800d2dc: 5b 80 00 0c sw (sp+12),r0
.type = type,
.mount_h = NULL
};
if ( type != NULL ) {
800d2e0: 44 20 00 05 be r1,r0,800d2f4 <rtems_filesystem_get_mount_handler+0x24><== NEVER TAKEN
rtems_filesystem_iterate( find_handler, &fa );
800d2e4: 78 01 08 00 mvhi r1,0x800
800d2e8: 38 21 d1 6c ori r1,r1,0xd16c
800d2ec: 37 82 00 08 addi r2,sp,8
800d2f0: fb ff ff c7 calli 800d20c <rtems_filesystem_iterate>
}
return fa.mount_h;
}
800d2f4: 2b 81 00 0c lw r1,(sp+12)
800d2f8: 2b 9d 00 04 lw ra,(sp+4)
800d2fc: 37 9c 00 0c addi sp,sp,12
800d300: c3 a0 00 00 ret
08002778 <rtems_filesystem_initialize>:
/*
* Default mode for created files.
*/
void rtems_filesystem_initialize( void )
{
8002778: 37 9c ff f8 addi sp,sp,-8
800277c: 5b 8b 00 08 sw (sp+8),r11
8002780: 5b 9d 00 04 sw (sp+4),ra
int rv = 0;
const rtems_filesystem_mount_configuration *root_config =
&rtems_filesystem_root_configuration;
rv = mount(
8002784: 78 05 08 01 mvhi r5,0x801
8002788: 38 a5 87 a4 ori r5,r5,0x87a4
800278c: 28 a2 00 04 lw r2,(r5+4)
8002790: 28 a1 00 00 lw r1,(r5+0)
8002794: 28 a3 00 08 lw r3,(r5+8)
8002798: 28 a4 00 0c lw r4,(r5+12)
800279c: 28 a5 00 10 lw r5,(r5+16)
80027a0: f8 00 02 8b calli 80031cc <mount>
root_config->filesystemtype,
root_config->options,
root_config->data
);
if ( rv != 0 )
rtems_fatal_error_occurred( 0xABCD0002 );
80027a4: 78 02 08 01 mvhi r2,0x801
{
int rv = 0;
const rtems_filesystem_mount_configuration *root_config =
&rtems_filesystem_root_configuration;
rv = mount(
80027a8: b8 20 58 00 mv r11,r1
root_config->filesystemtype,
root_config->options,
root_config->data
);
if ( rv != 0 )
rtems_fatal_error_occurred( 0xABCD0002 );
80027ac: 38 42 89 50 ori r2,r2,0x8950
root_config->target,
root_config->filesystemtype,
root_config->options,
root_config->data
);
if ( rv != 0 )
80027b0: 5c 20 00 08 bne r1,r0,80027d0 <rtems_filesystem_initialize+0x58><== NEVER TAKEN
*
* 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);
80027b4: 78 01 08 01 mvhi r1,0x801
80027b8: 38 21 89 48 ori r1,r1,0x8948
80027bc: 34 02 01 ff mvi r2,511
80027c0: f8 00 02 21 calli 8003044 <mkdir>
if ( rv != 0 )
80027c4: 44 2b 00 05 be r1,r11,80027d8 <rtems_filesystem_initialize+0x60><== ALWAYS TAKEN
rtems_fatal_error_occurred( 0xABCD0003 );
80027c8: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED
80027cc: 38 42 89 54 ori r2,r2,0x8954 <== NOT EXECUTED
80027d0: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED
80027d4: f8 00 0b 23 calli 8005460 <rtems_fatal_error_occurred> <== NOT EXECUTED
* it will be mounted onto is created. Moreover, if it is going to
* use a device, then it is REALLY unfair to attempt this
* before device drivers are initialized. So we return via a base
* filesystem image and nothing auto-mounted at this point.
*/
}
80027d8: 2b 9d 00 04 lw ra,(sp+4)
80027dc: 2b 8b 00 08 lw r11,(sp+8)
80027e0: 37 9c 00 08 addi sp,sp,8
80027e4: c3 a0 00 00 ret
0800d20c <rtems_filesystem_iterate>:
bool rtems_filesystem_iterate(
rtems_per_filesystem_routine routine,
void *routine_arg
)
{
800d20c: 37 9c ff e8 addi sp,sp,-24
800d210: 5b 8b 00 18 sw (sp+24),r11
800d214: 5b 8c 00 14 sw (sp+20),r12
800d218: 5b 8d 00 10 sw (sp+16),r13
800d21c: 5b 8e 00 0c sw (sp+12),r14
800d220: 5b 8f 00 08 sw (sp+8),r15
800d224: 5b 9d 00 04 sw (sp+4),ra
const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0];
800d228: 78 0b 08 01 mvhi r11,0x801
bool rtems_filesystem_iterate(
rtems_per_filesystem_routine routine,
void *routine_arg
)
{
800d22c: b8 20 70 00 mv r14,r1
800d230: b8 40 78 00 mv r15,r2
const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0];
rtems_chain_node *node = NULL;
bool stop = false;
800d234: 34 03 00 00 mvi r3,0
bool rtems_filesystem_iterate(
rtems_per_filesystem_routine routine,
void *routine_arg
)
{
const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0];
800d238: 39 6b 87 94 ori r11,r11,0x8794
rtems_chain_node *node = NULL;
bool stop = false;
while ( table_entry->type && !stop ) {
800d23c: e0 00 00 06 bi 800d254 <rtems_filesystem_iterate+0x48>
stop = (*routine)( table_entry, routine_arg );
800d240: b9 60 08 00 mv r1,r11
800d244: b9 e0 10 00 mv r2,r15
800d248: d9 c0 00 00 call r14
800d24c: b8 20 18 00 mv r3,r1
++table_entry;
800d250: 35 6b 00 08 addi r11,r11,8
{
const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0];
rtems_chain_node *node = NULL;
bool stop = false;
while ( table_entry->type && !stop ) {
800d254: 29 61 00 00 lw r1,(r11+0)
800d258: 44 20 00 03 be r1,r0,800d264 <rtems_filesystem_iterate+0x58>
800d25c: 44 60 ff f9 be r3,r0,800d240 <rtems_filesystem_iterate+0x34>
800d260: e0 00 00 13 bi 800d2ac <rtems_filesystem_iterate+0xa0>
800d264: b8 60 58 00 mv r11,r3
stop = (*routine)( table_entry, routine_arg );
++table_entry;
}
if ( !stop ) {
800d268: 5c 23 00 11 bne r1,r3,800d2ac <rtems_filesystem_iterate+0xa0>
rtems_libio_lock();
800d26c: fb ff ff d4 calli 800d1bc <rtems_libio_lock>
}
}
rtems_libio_unlock();
rtems_set_errno_and_return_minus_one( ENOENT );
}
800d270: 78 03 08 01 mvhi r3,0x801
800d274: 38 63 a1 98 ori r3,r3,0xa198
++table_entry;
}
if ( !stop ) {
rtems_libio_lock();
for (
800d278: 78 0d 08 01 mvhi r13,0x801
}
}
rtems_libio_unlock();
rtems_set_errno_and_return_minus_one( ENOENT );
}
800d27c: 28 6c 00 00 lw r12,(r3+0)
++table_entry;
}
if ( !stop ) {
rtems_libio_lock();
for (
800d280: 39 ad a1 9c ori r13,r13,0xa19c
800d284: e0 00 00 06 bi 800d29c <rtems_filesystem_iterate+0x90>
!rtems_chain_is_tail( &filesystem_chain, node ) && !stop;
node = rtems_chain_next( node )
) {
const filesystem_node *fsn = (filesystem_node *) node;
stop = (*routine)( &fsn->entry, routine_arg );
800d288: 35 81 00 08 addi r1,r12,8
800d28c: b9 e0 10 00 mv r2,r15
800d290: d9 c0 00 00 call r14
}
}
rtems_libio_unlock();
rtems_set_errno_and_return_minus_one( ENOENT );
}
800d294: 29 8c 00 00 lw r12,(r12+0)
!rtems_chain_is_tail( &filesystem_chain, node ) && !stop;
node = rtems_chain_next( node )
) {
const filesystem_node *fsn = (filesystem_node *) node;
stop = (*routine)( &fsn->entry, routine_arg );
800d298: b8 20 58 00 mv r11,r1
++table_entry;
}
if ( !stop ) {
rtems_libio_lock();
for (
800d29c: 45 8d 00 02 be r12,r13,800d2a4 <rtems_filesystem_iterate+0x98>
node = rtems_chain_first( &filesystem_chain );
!rtems_chain_is_tail( &filesystem_chain, node ) && !stop;
800d2a0: 45 60 ff fa be r11,r0,800d288 <rtems_filesystem_iterate+0x7c><== ALWAYS TAKEN
) {
const filesystem_node *fsn = (filesystem_node *) node;
stop = (*routine)( &fsn->entry, routine_arg );
}
rtems_libio_unlock();
800d2a4: fb ff ff d1 calli 800d1e8 <rtems_libio_unlock>
800d2a8: b9 60 18 00 mv r3,r11
}
return stop;
}
800d2ac: b8 60 08 00 mv r1,r3
800d2b0: 2b 9d 00 04 lw ra,(sp+4)
800d2b4: 2b 8b 00 18 lw r11,(sp+24)
800d2b8: 2b 8c 00 14 lw r12,(sp+20)
800d2bc: 2b 8d 00 10 lw r13,(sp+16)
800d2c0: 2b 8e 00 0c lw r14,(sp+12)
800d2c4: 2b 8f 00 08 lw r15,(sp+8)
800d2c8: 37 9c 00 18 addi sp,sp,24
800d2cc: c3 a0 00 00 ret
08004484 <rtems_filesystem_location_remove_from_mt_entry>:
}
void rtems_filesystem_location_remove_from_mt_entry(
rtems_filesystem_location_info_t *loc
)
{
8004484: 37 9c ff fc addi sp,sp,-4
8004488: 5b 9d 00 04 sw (sp+4),ra
rtems_filesystem_mt_entry_declare_lock_context(lock_context);
bool do_unmount;
rtems_filesystem_mt_entry_lock(lock_context);
800448c: 90 00 20 00 rcsr r4,IE
8004490: 34 02 ff fe mvi r2,-2
8004494: a0 82 10 00 and r2,r4,r2
8004498: d0 02 00 00 wcsr IE,r2
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
800449c: 28 23 00 00 lw r3,(r1+0)
previous = the_node->previous;
80044a0: 28 22 00 04 lw r2,(r1+4)
next->previous = previous;
80044a4: 58 62 00 04 sw (r3+4),r2
previous->next = next;
80044a8: 58 43 00 00 sw (r2+0),r3
rtems_chain_extract_unprotected(&loc->mt_entry_node);
do_unmount = rtems_filesystem_is_ready_for_unmount(loc->mt_entry);
80044ac: 28 22 00 14 lw r2,(r1+20)
80044b0: 34 03 00 00 mvi r3,0
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;
80044b4: 40 45 00 28 lbu r5,(r2+40)
80044b8: 5c a0 00 0d bne r5,r0,80044ec <rtems_filesystem_location_remove_from_mt_entry+0x68>
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 )
80044bc: 28 46 00 14 lw r6,(r2+20)
80044c0: 28 45 00 1c lw r5,(r2+28)
80044c4: 5c c5 00 0a bne r6,r5,80044ec <rtems_filesystem_location_remove_from_mt_entry+0x68>
&& mt_entry->mt_fs_root->reference_count == 1;
80044c8: 28 43 00 24 lw r3,(r2+36)
++global_loc->deferred_released_count;
}
}
}
void rtems_filesystem_location_remove_from_mt_entry(
80044cc: 28 63 00 18 lw r3,(r3+24)
static inline bool rtems_filesystem_is_ready_for_unmount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
bool ready = !mt_entry->mounted
80044d0: 64 63 00 01 cmpei r3,r3,1
&& rtems_chain_has_only_one_node( &mt_entry->location_chain )
&& mt_entry->mt_fs_root->reference_count == 1;
if ( ready ) {
80044d4: 44 60 00 06 be r3,r0,80044ec <rtems_filesystem_location_remove_from_mt_entry+0x68><== ALWAYS TAKEN
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 );
80044d8: 34 45 00 18 addi r5,r2,24 <== NOT EXECUTED
head->next = tail;
80044dc: 58 45 00 14 sw (r2+20),r5 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
80044e0: 34 45 00 14 addi r5,r2,20 <== NOT EXECUTED
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
80044e4: 58 40 00 18 sw (r2+24),r0 <== NOT EXECUTED
tail->previous = head;
80044e8: 58 45 00 1c sw (r2+28),r5 <== NOT EXECUTED
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);
rtems_filesystem_mt_entry_unlock(lock_context);
80044ec: d0 04 00 00 wcsr IE,r4
if (do_unmount) {
80044f0: 44 60 00 03 be r3,r0,80044fc <rtems_filesystem_location_remove_from_mt_entry+0x78><== ALWAYS TAKEN
rtems_filesystem_do_unmount(loc->mt_entry);
80044f4: 28 21 00 14 lw r1,(r1+20) <== NOT EXECUTED
80044f8: fb ff ff bc calli 80043e8 <rtems_filesystem_do_unmount> <== NOT EXECUTED
}
}
80044fc: 2b 9d 00 04 lw ra,(sp+4)
8004500: 37 9c 00 04 addi sp,sp,4
8004504: c3 a0 00 00 ret
08004780 <rtems_filesystem_location_transform_to_global>:
}
rtems_filesystem_global_location_t *rtems_filesystem_location_transform_to_global(
rtems_filesystem_location_info_t *loc
)
{
8004780: 37 9c ff f0 addi sp,sp,-16
8004784: 5b 8b 00 0c sw (sp+12),r11
8004788: 5b 8c 00 08 sw (sp+8),r12
800478c: 5b 9d 00 04 sw (sp+4),ra
8004790: b8 20 60 00 mv r12,r1
rtems_filesystem_global_location_t *global_loc = malloc(sizeof(*global_loc));
8004794: 34 01 00 24 mvi r1,36
8004798: fb ff f9 ec calli 8002f48 <malloc>
800479c: b8 20 58 00 mv r11,r1
if (global_loc != NULL) {
80047a0: 44 20 00 0a be r1,r0,80047c8 <rtems_filesystem_location_transform_to_global+0x48><== NEVER TAKEN
global_loc->reference_count = 1;
80047a4: 34 02 00 01 mvi r2,1
80047a8: 58 22 00 18 sw (r1+24),r2
global_loc->deferred_released_next = NULL;
80047ac: 58 20 00 1c sw (r1+28),r0
global_loc->deferred_released_count = 0;
rtems_filesystem_location_copy(&global_loc->location, loc);
80047b0: b9 80 10 00 mv r2,r12
rtems_filesystem_global_location_t *global_loc = malloc(sizeof(*global_loc));
if (global_loc != NULL) {
global_loc->reference_count = 1;
global_loc->deferred_released_next = NULL;
global_loc->deferred_released_count = 0;
80047b4: 58 20 00 20 sw (r1+32),r0
rtems_filesystem_location_copy(&global_loc->location, loc);
80047b8: fb ff fe ea calli 8004360 <rtems_filesystem_location_copy>
rtems_filesystem_location_remove_from_mt_entry(loc);
80047bc: b9 80 08 00 mv r1,r12
80047c0: fb ff ff 31 calli 8004484 <rtems_filesystem_location_remove_from_mt_entry>
80047c4: e0 00 00 0a bi 80047ec <rtems_filesystem_location_transform_to_global+0x6c>
} else {
rtems_filesystem_location_free(loc);
80047c8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
80047cc: f8 00 22 20 calli 800d04c <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;
return rtems_filesystem_global_location_obtain( &global_loc );
80047d0: 37 81 00 10 addi r1,sp,16 <== NOT EXECUTED
);
static inline rtems_filesystem_global_location_t *
rtems_filesystem_global_location_obtain_null(void)
{
rtems_filesystem_global_location_t *global_loc = NULL;
80047d4: 5b 80 00 10 sw (sp+16),r0 <== NOT EXECUTED
return rtems_filesystem_global_location_obtain( &global_loc );
80047d8: fb ff ff b0 calli 8004698 <rtems_filesystem_global_location_obtain><== NOT EXECUTED
80047dc: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
global_loc = rtems_filesystem_global_location_obtain_null();
errno = ENOMEM;
80047e0: f8 00 35 3b calli 8011ccc <__errno> <== NOT EXECUTED
80047e4: 34 02 00 0c mvi r2,12 <== NOT EXECUTED
80047e8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
}
return global_loc;
}
80047ec: b9 60 08 00 mv r1,r11
80047f0: 2b 9d 00 04 lw ra,(sp+4)
80047f4: 2b 8b 00 0c lw r11,(sp+12)
80047f8: 2b 8c 00 08 lw r12,(sp+8)
80047fc: 37 9c 00 10 addi sp,sp,16
8004800: c3 a0 00 00 ret
08001c34 <rtems_gxx_key_create>:
int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *))
{
8001c34: 37 9c ff f0 addi sp,sp,-16
8001c38: 5b 8b 00 10 sw (sp+16),r11
8001c3c: 5b 8c 00 0c sw (sp+12),r12
8001c40: 5b 8d 00 08 sw (sp+8),r13
8001c44: 5b 9d 00 04 sw (sp+4),ra
8001c48: b8 20 68 00 mv r13,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 ) );
8001c4c: 34 01 00 08 mvi r1,8
}
return 0;
}
int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *))
{
8001c50: b8 40 60 00 mv r12,r2
* 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 ) );
8001c54: f8 00 01 3e calli 800214c <malloc>
*key = new_key;
8001c58: 59 a1 00 00 sw (r13+0),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 ) );
8001c5c: b8 20 58 00 mv r11,r1
*key = new_key;
new_key->val = NULL;
8001c60: 58 20 00 00 sw (r1+0),r0
new_key->dtor = dtor;
8001c64: 58 2c 00 04 sw (r1+4),r12
"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 );
8001c68: b9 60 10 00 mv r2,r11
8001c6c: 34 01 00 00 mvi r1,0
8001c70: b9 80 18 00 mv r3,r12
8001c74: f8 00 0a 31 calli 8004538 <rtems_task_variable_add>
if ( status == RTEMS_SUCCESSFUL )
return 0;
8001c78: 34 02 00 00 mvi r2,0
);
#endif
/* register with RTEMS the buffer that will hold the key values */
status = rtems_task_variable_add( RTEMS_SELF, (void **)new_key, dtor );
if ( status == RTEMS_SUCCESSFUL )
8001c7c: 44 20 00 04 be r1,r0,8001c8c <rtems_gxx_key_create+0x58> <== ALWAYS TAKEN
return 0;
free( new_key );
8001c80: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8001c84: fb ff ff 64 calli 8001a14 <free> <== NOT EXECUTED
return -1;
8001c88: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED
}
8001c8c: b8 40 08 00 mv r1,r2
8001c90: 2b 9d 00 04 lw ra,(sp+4)
8001c94: 2b 8b 00 10 lw r11,(sp+16)
8001c98: 2b 8c 00 0c lw r12,(sp+12)
8001c9c: 2b 8d 00 08 lw r13,(sp+8)
8001ca0: 37 9c 00 10 addi sp,sp,16
8001ca4: c3 a0 00 00 ret
08001cb4 <rtems_gxx_key_delete>:
int rtems_gxx_key_delete (__gthread_key_t key)
{
8001cb4: 37 9c ff f8 addi sp,sp,-8
8001cb8: 5b 8b 00 08 sw (sp+8),r11
8001cbc: 5b 9d 00 04 sw (sp+4),ra
8001cc0: b8 20 58 00 mv r11,r1
#ifdef DEBUG_GXX_WRAPPERS
printk( "gxx_wrappers: delete key=%x\n", key );
#endif
/* register with RTEMS the buffer that will hold the key values */
status = rtems_task_variable_delete( RTEMS_SELF, (void **)key );
8001cc4: b9 60 10 00 mv r2,r11
8001cc8: 34 01 00 00 mvi r1,0
8001ccc: f8 00 0a 4a calli 80045f4 <rtems_task_variable_delete>
if ( status == RTEMS_SUCCESSFUL ) {
8001cd0: 5c 20 00 04 bne r1,r0,8001ce0 <rtems_gxx_key_delete+0x2c> <== NEVER TAKEN
/* Hmm - hopefully all tasks using this key have gone away... */
if ( key ) free( *(void **)key );
8001cd4: 45 61 00 03 be r11,r1,8001ce0 <rtems_gxx_key_delete+0x2c> <== NEVER TAKEN
8001cd8: 29 61 00 00 lw r1,(r11+0)
8001cdc: fb ff ff 4e calli 8001a14 <free>
return 0;
}
key = NULL;
return 0;
}
8001ce0: 34 01 00 00 mvi r1,0
8001ce4: 2b 9d 00 04 lw ra,(sp+4)
8001ce8: 2b 8b 00 08 lw r11,(sp+8)
8001cec: 37 9c 00 08 addi sp,sp,8
8001cf0: c3 a0 00 00 ret
08001bb4 <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))
{
8001bb4: 37 9c ff e8 addi sp,sp,-24
8001bb8: 5b 8b 00 14 sw (sp+20),r11
8001bbc: 5b 8c 00 10 sw (sp+16),r12
8001bc0: 5b 8d 00 0c sw (sp+12),r13
8001bc4: 5b 8e 00 08 sw (sp+8),r14
8001bc8: 5b 9d 00 04 sw (sp+4),ra
#ifdef DEBUG_GXX_WRAPPERS
printk( "gxx_wrappers: once=%x, func=%x\n", *once, func );
#endif
if ( *(volatile __gthread_once_t *)once == 0 ) {
8001bcc: 28 2d 00 00 lw r13,(r1+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))
{
8001bd0: b8 20 58 00 mv r11,r1
8001bd4: b8 40 70 00 mv r14,r2
#ifdef DEBUG_GXX_WRAPPERS
printk( "gxx_wrappers: once=%x, func=%x\n", *once, func );
#endif
if ( *(volatile __gthread_once_t *)once == 0 ) {
8001bd8: 5d a0 00 0f bne r13,r0,8001c14 <rtems_gxx_once+0x60>
rtems_mode saveMode;
__gthread_once_t o;
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
8001bdc: 34 01 01 00 mvi r1,256
8001be0: 34 02 01 00 mvi r2,256
8001be4: 37 83 00 18 addi r3,sp,24
8001be8: f8 00 09 cb calli 8004314 <rtems_task_mode>
if ( (o = *(volatile __gthread_once_t *)once) == 0 ) {
8001bec: 29 6c 00 00 lw r12,(r11+0)
8001bf0: 5d 8d 00 03 bne r12,r13,8001bfc <rtems_gxx_once+0x48> <== NEVER TAKEN
*(volatile __gthread_once_t *)once = 1;
8001bf4: 34 01 00 01 mvi r1,1
8001bf8: 59 61 00 00 sw (r11+0),r1
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
8001bfc: 2b 81 00 18 lw r1,(sp+24)
8001c00: 34 02 01 00 mvi r2,256
8001c04: 37 83 00 18 addi r3,sp,24
8001c08: f8 00 09 c3 calli 8004314 <rtems_task_mode>
if ( o == 0 )
8001c0c: 5d 80 00 02 bne r12,r0,8001c14 <rtems_gxx_once+0x60> <== NEVER TAKEN
(*func)();
8001c10: d9 c0 00 00 call r14
}
return 0;
}
8001c14: 34 01 00 00 mvi r1,0
8001c18: 2b 9d 00 04 lw ra,(sp+4)
8001c1c: 2b 8b 00 14 lw r11,(sp+20)
8001c20: 2b 8c 00 10 lw r12,(sp+16)
8001c24: 2b 8d 00 0c lw r13,(sp+12)
8001c28: 2b 8e 00 08 lw r14,(sp+8)
8001c2c: 37 9c 00 18 addi sp,sp,24
8001c30: c3 a0 00 00 ret
08001d64 <rtems_gxx_setspecific>:
int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr)
{
8001d64: 37 9c ff f4 addi sp,sp,-12
8001d68: 5b 8b 00 0c sw (sp+12),r11
8001d6c: 5b 8c 00 08 sw (sp+8),r12
8001d70: 5b 9d 00 04 sw (sp+4),ra
8001d74: b8 20 58 00 mv r11,r1
rtems_task_self()
);
#endif
/* register with RTEMS the buffer that will hold the key values */
status = rtems_task_variable_add( RTEMS_SELF, (void **)key, key->dtor );
8001d78: 29 63 00 04 lw r3,(r11+4)
#endif
return p;
}
int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr)
{
8001d7c: b8 40 60 00 mv r12,r2
rtems_task_self()
);
#endif
/* register with RTEMS the buffer that will hold the key values */
status = rtems_task_variable_add( RTEMS_SELF, (void **)key, key->dtor );
8001d80: 34 01 00 00 mvi r1,0
8001d84: b9 60 10 00 mv r2,r11
8001d88: f8 00 09 ec calli 8004538 <rtems_task_variable_add>
if ( status == RTEMS_SUCCESSFUL ) {
/* now let's set the proper value */
key->val = (void *)ptr;
return 0;
}
return -1;
8001d8c: 34 03 ff ff mvi r3,-1
);
#endif
/* register with RTEMS the buffer that will hold the key values */
status = rtems_task_variable_add( RTEMS_SELF, (void **)key, key->dtor );
if ( status == RTEMS_SUCCESSFUL ) {
8001d90: 5c 20 00 03 bne r1,r0,8001d9c <rtems_gxx_setspecific+0x38> <== NEVER TAKEN
/* now let's set the proper value */
key->val = (void *)ptr;
8001d94: 59 6c 00 00 sw (r11+0),r12
return 0;
8001d98: 34 03 00 00 mvi r3,0
}
return -1;
}
8001d9c: b8 60 08 00 mv r1,r3
8001da0: 2b 9d 00 04 lw ra,(sp+4)
8001da4: 2b 8b 00 0c lw r11,(sp+12)
8001da8: 2b 8c 00 08 lw r12,(sp+8)
8001dac: 37 9c 00 0c addi sp,sp,12
8001db0: c3 a0 00 00 ret
08006bb8 <rtems_heap_allocate_aligned_with_boundary>:
void *rtems_heap_allocate_aligned_with_boundary(
size_t size,
uintptr_t alignment,
uintptr_t boundary
)
{
8006bb8: 37 9c ff f0 addi sp,sp,-16
8006bbc: 5b 8b 00 10 sw (sp+16),r11
8006bc0: 5b 8c 00 0c sw (sp+12),r12
8006bc4: 5b 8d 00 08 sw (sp+8),r13
8006bc8: 5b 9d 00 04 sw (sp+4),ra
if (
8006bcc: 78 05 08 02 mvhi r5,0x802
8006bd0: 38 a5 76 c8 ori r5,r5,0x76c8
void *rtems_heap_allocate_aligned_with_boundary(
size_t size,
uintptr_t alignment,
uintptr_t boundary
)
{
8006bd4: b8 40 60 00 mv r12,r2
if (
8006bd8: 28 a2 00 00 lw r2,(r5+0)
void *rtems_heap_allocate_aligned_with_boundary(
size_t size,
uintptr_t alignment,
uintptr_t boundary
)
{
8006bdc: b8 20 68 00 mv r13,r1
if (
8006be0: 34 01 00 03 mvi r1,3
void *rtems_heap_allocate_aligned_with_boundary(
size_t size,
uintptr_t alignment,
uintptr_t boundary
)
{
8006be4: b8 60 58 00 mv r11,r3
if (
8006be8: 5c 41 00 04 bne r2,r1,8006bf8 <rtems_heap_allocate_aligned_with_boundary+0x40><== NEVER TAKEN
_System_state_Is_up( _System_state_Get() )
&& !malloc_is_system_state_OK()
8006bec: fb ff fb 34 calli 80058bc <malloc_is_system_state_OK>
) {
return NULL;
8006bf0: 34 05 00 00 mvi r5,0
uintptr_t boundary
)
{
if (
_System_state_Is_up( _System_state_Get() )
&& !malloc_is_system_state_OK()
8006bf4: 44 20 00 0a be r1,r0,8006c1c <rtems_heap_allocate_aligned_with_boundary+0x64>
) {
return NULL;
}
malloc_deferred_frees_process();
8006bf8: fb ff fb 3b calli 80058e4 <malloc_deferred_frees_process>
/* FIXME: Statistics, boundary checks */
return _Protected_heap_Allocate_aligned_with_boundary(
8006bfc: 78 05 08 02 mvhi r5,0x802
8006c00: 38 a5 60 54 ori r5,r5,0x6054
8006c04: 28 a1 00 00 lw r1,(r5+0)
8006c08: b9 a0 10 00 mv r2,r13
8006c0c: b9 80 18 00 mv r3,r12
8006c10: b9 60 20 00 mv r4,r11
8006c14: f8 00 11 a2 calli 800b29c <_Protected_heap_Allocate_aligned_with_boundary>
8006c18: b8 20 28 00 mv r5,r1
RTEMS_Malloc_Heap,
size,
alignment,
boundary
);
}
8006c1c: b8 a0 08 00 mv r1,r5
8006c20: 2b 9d 00 04 lw ra,(sp+4)
8006c24: 2b 8b 00 10 lw r11,(sp+16)
8006c28: 2b 8c 00 0c lw r12,(sp+12)
8006c2c: 2b 8d 00 08 lw r13,(sp+8)
8006c30: 37 9c 00 10 addi sp,sp,16
8006c34: c3 a0 00 00 ret
0800224c <rtems_heap_extend_via_sbrk>:
void *rtems_heap_extend_via_sbrk(
Heap_Control *heap,
size_t alloc_size
)
{
800224c: 37 9c ff e8 addi sp,sp,-24
8002250: 5b 8b 00 18 sw (sp+24),r11
8002254: 5b 8c 00 14 sw (sp+20),r12
8002258: 5b 8d 00 10 sw (sp+16),r13
800225c: 5b 8e 00 0c sw (sp+12),r14
8002260: 5b 8f 00 08 sw (sp+8),r15
8002264: 5b 9d 00 04 sw (sp+4),ra
8002268: b8 40 60 00 mv r12,r2
ptrdiff_t sbrk_amount = RTEMS_Malloc_Sbrk_amount;
800226c: 78 02 08 01 mvhi r2,0x801
8002270: 38 42 59 30 ori r2,r2,0x5930
8002274: 28 4d 00 00 lw r13,(r2+0)
void *rtems_heap_extend_via_sbrk(
Heap_Control *heap,
size_t alloc_size
)
{
8002278: b8 20 78 00 mv r15,r1
ptrdiff_t sbrk_amount = RTEMS_Malloc_Sbrk_amount;
ptrdiff_t sbrk_size = (ptrdiff_t) alloc_size;
ptrdiff_t misaligned = sbrk_size % sbrk_amount;
800227c: b9 80 08 00 mv r1,r12
8002280: b9 a0 10 00 mv r2,r13
Heap_Control *heap,
size_t alloc_size
)
{
ptrdiff_t sbrk_amount = RTEMS_Malloc_Sbrk_amount;
ptrdiff_t sbrk_size = (ptrdiff_t) alloc_size;
8002284: b9 80 58 00 mv r11,r12
ptrdiff_t misaligned = sbrk_size % sbrk_amount;
8002288: f8 00 41 66 calli 8012820 <__modsi3>
void *return_this = NULL;
if ( misaligned != 0 ) {
800228c: 44 20 00 03 be r1,r0,8002298 <rtems_heap_extend_via_sbrk+0x4c>
sbrk_size += sbrk_amount - misaligned;
8002290: b5 8d 58 00 add r11,r12,r13
8002294: c9 61 58 00 sub r11,r11,r1
}
if ( sbrk_size > 0 && sbrk_amount > 0 ) {
8002298: 69 61 00 00 cmpgi r1,r11,0
800229c: 69 ad 00 00 cmpgi r13,r13,0
)
{
ptrdiff_t sbrk_amount = RTEMS_Malloc_Sbrk_amount;
ptrdiff_t sbrk_size = (ptrdiff_t) alloc_size;
ptrdiff_t misaligned = sbrk_size % sbrk_amount;
void *return_this = NULL;
80022a0: 34 0e 00 00 mvi r14,0
if ( misaligned != 0 ) {
sbrk_size += sbrk_amount - misaligned;
}
if ( sbrk_size > 0 && sbrk_amount > 0 ) {
80022a4: a0 2d 68 00 and r13,r1,r13
80022a8: 45 a0 00 18 be r13,r0,8002308 <rtems_heap_extend_via_sbrk+0xbc><== NEVER TAKEN
void *area_begin = sbrk( sbrk_size );
80022ac: b9 60 08 00 mv r1,r11
80022b0: fb ff f8 43 calli 80003bc <sbrk>
80022b4: b8 20 10 00 mv r2,r1
if ( area_begin != (void *) -1 ) {
80022b8: 34 01 ff ff mvi r1,-1
80022bc: 44 41 00 13 be r2,r1,8002308 <rtems_heap_extend_via_sbrk+0xbc>
bool ok = _Protected_heap_Extend( heap, area_begin, sbrk_size );
80022c0: b9 e0 08 00 mv r1,r15
80022c4: b9 60 18 00 mv r3,r11
80022c8: f8 00 0c ab calli 8005574 <_Protected_heap_Extend>
if ( ok ) {
80022cc: 44 20 00 0d be r1,r0,8002300 <rtems_heap_extend_via_sbrk+0xb4>
MSBUMP( space_available, sbrk_size );
80022d0: 78 03 08 01 mvhi r3,0x801
80022d4: 38 63 59 00 ori r3,r3,0x5900
80022d8: 28 61 00 00 lw r1,(r3+0)
80022dc: b9 80 10 00 mv r2,r12
80022e0: 34 04 00 00 mvi r4,0
80022e4: b5 61 58 00 add r11,r11,r1
80022e8: 58 6b 00 00 sw (r3+0),r11
80022ec: b9 e0 08 00 mv r1,r15
80022f0: 34 03 00 00 mvi r3,0
80022f4: f8 00 0c 86 calli 800550c <_Protected_heap_Allocate_aligned_with_boundary>
80022f8: b8 20 70 00 mv r14,r1
80022fc: e0 00 00 03 bi 8002308 <rtems_heap_extend_via_sbrk+0xbc>
return_this = _Protected_heap_Allocate( heap, alloc_size );
} else {
sbrk( -sbrk_size );
8002300: c8 0b 08 00 sub r1,r0,r11
8002304: fb ff f8 2e calli 80003bc <sbrk>
}
}
}
return return_this;
}
8002308: b9 c0 08 00 mv r1,r14
800230c: 2b 9d 00 04 lw ra,(sp+4)
8002310: 2b 8b 00 18 lw r11,(sp+24)
8002314: 2b 8c 00 14 lw r12,(sp+20)
8002318: 2b 8d 00 10 lw r13,(sp+16)
800231c: 2b 8e 00 0c lw r14,(sp+12)
8002320: 2b 8f 00 08 lw r15,(sp+8)
8002324: 37 9c 00 18 addi sp,sp,24
8002328: c3 a0 00 00 ret
08003c2c <rtems_heap_null_extend>:
Heap_Control *heap __attribute__((unused)),
size_t alloc_size __attribute__((unused))
)
{
return NULL;
}
8003c2c: 34 01 00 00 mvi r1,0
8003c30: c3 a0 00 00 ret
08003538 <rtems_ide_part_table_free>:
* RETURNS:
* N/A
*/
void
rtems_ide_part_table_free(rtems_disk_desc_t *disk_desc)
{
8003538: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
800353c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
partition_table_free( disk_desc );
8003540: fb ff fe 8a calli 8002f68 <partition_table_free> <== NOT EXECUTED
}
8003544: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8003548: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
800354c: c3 a0 00 00 ret <== NOT EXECUTED
08003550 <rtems_ide_part_table_get>:
* RTEMS_SUCCESSFUL if success,
* RTEMS_INTERNAL_ERROR otherwise
*/
rtems_status_code
rtems_ide_part_table_get(const char *dev_name, rtems_disk_desc_t *disk_desc)
{
8003550: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
8003554: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
return partition_table_get( dev_name, disk_desc );
8003558: fb ff ff 7b calli 8003344 <partition_table_get> <== NOT EXECUTED
}
800355c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8003560: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
8003564: c3 a0 00 00 ret <== NOT EXECUTED
08003568 <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)
{
8003568: 37 9c ff c0 addi sp,sp,-64
800356c: 5b 8b 00 30 sw (sp+48),r11
8003570: 5b 8c 00 2c sw (sp+44),r12
8003574: 5b 8d 00 28 sw (sp+40),r13
8003578: 5b 8e 00 24 sw (sp+36),r14
800357c: 5b 8f 00 20 sw (sp+32),r15
8003580: 5b 90 00 1c sw (sp+28),r16
8003584: 5b 91 00 18 sw (sp+24),r17
8003588: 5b 92 00 14 sw (sp+20),r18
800358c: 5b 93 00 10 sw (sp+16),r19
8003590: 5b 94 00 0c sw (sp+12),r20
8003594: 5b 95 00 08 sw (sp+8),r21
8003598: 5b 9d 00 04 sw (sp+4),ra
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));
800359c: 34 02 01 28 mvi r2,296
* 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)
{
80035a0: b8 20 98 00 mv r19,r1
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));
80035a4: 34 01 00 01 mvi r1,1
80035a8: f8 00 02 32 calli 8003e70 <calloc>
80035ac: b8 20 58 00 mv r11,r1
if (disk_desc == NULL)
{
return RTEMS_NO_MEMORY;
80035b0: 34 0e 00 1a mvi r14,26
/* 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)
80035b4: 44 20 00 31 be r1,r0,8003678 <rtems_ide_part_table_initialize+0x110><== NEVER TAKEN
{
return RTEMS_NO_MEMORY;
}
/* get partition table */
rc = partition_table_get(dev_name, disk_desc);
80035b8: ba 60 08 00 mv r1,r19
80035bc: b9 60 10 00 mv r2,r11
80035c0: fb ff ff 61 calli 8003344 <partition_table_get>
80035c4: b8 20 70 00 mv r14,r1
if (rc != RTEMS_SUCCESSFUL)
80035c8: 44 20 00 04 be r1,r0,80035d8 <rtems_ide_part_table_initialize+0x70><== ALWAYS TAKEN
{
free(disk_desc);
80035cc: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
80035d0: f8 00 02 72 calli 8003f98 <free> <== NOT EXECUTED
return rc;
80035d4: e0 00 00 29 bi 8003678 <rtems_ide_part_table_initialize+0x110><== 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++)
{
sprintf(name, "%s%d", dev_name, part_num + 1);
80035d8: 78 10 08 02 mvhi r16,0x802
rc = rtems_disk_create_log(dev, disk_desc->dev, part_desc->start,
part_desc->size, name);
if (rc != RTEMS_SUCCESSFUL)
{
fprintf(stdout,"Cannot create device %s, error code %d\n", name, rc);
80035dc: 78 0d 08 02 mvhi r13,0x802
80035e0: 78 0f 08 02 mvhi r15,0x802
/* 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);
80035e4: 29 75 00 00 lw r21,(r11+0)
80035e8: 29 74 00 04 lw r20,(r11+4)
)
{
union __rtems_dev_t temp;
temp.device = device;
return temp.__overlay.minor;
80035ec: b9 60 90 00 mv r18,r11
/* create logical disks on the physical one */
for (part_num = 0; part_num < disk_desc->last_log_id; part_num++)
80035f0: 34 0c 00 00 mvi r12,0
{
sprintf(name, "%s%d", dev_name, part_num + 1);
80035f4: 37 91 00 34 addi r17,sp,52
80035f8: 3a 10 64 ac ori r16,r16,0x64ac
rc = rtems_disk_create_log(dev, disk_desc->dev, part_desc->start,
part_desc->size, name);
if (rc != RTEMS_SUCCESSFUL)
{
fprintf(stdout,"Cannot create device %s, error code %d\n", name, rc);
80035fc: 39 ad 82 70 ori r13,r13,0x8270
8003600: 39 ef 64 b4 ori r15,r15,0x64b4
*/
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++)
8003604: e0 00 00 19 bi 8003668 <rtems_ide_part_table_initialize+0x100>
{
sprintf(name, "%s%d", dev_name, part_num + 1);
8003608: 35 8c 00 01 addi r12,r12,1
800360c: ba 00 10 00 mv r2,r16
8003610: ba 20 08 00 mv r1,r17
8003614: ba 60 18 00 mv r3,r19
8003618: b9 80 20 00 mv r4,r12
800361c: f8 00 44 b8 calli 80148fc <sprintf>
dev = rtems_filesystem_make_dev_t(major, ++minor);
part_desc = disk_desc->partitions[part_num];
8003620: 2a 46 00 28 lw r6,(r18+40)
)
{
union __rtems_dev_t temp;
temp.__overlay.major = _major;
temp.__overlay.minor = _minor;
8003624: b5 94 10 00 add r2,r12,r20
if (part_desc == NULL)
8003628: 44 c0 00 0f be r6,r0,8003664 <rtems_ide_part_table_initialize+0xfc>
{
continue;
}
rc = rtems_disk_create_log(dev, disk_desc->dev, part_desc->start,
800362c: 29 64 00 04 lw r4,(r11+4)
8003630: 28 c5 00 04 lw r5,(r6+4)
8003634: 29 63 00 00 lw r3,(r11+0)
8003638: 28 c6 00 08 lw r6,(r6+8)
800363c: ba a0 08 00 mv r1,r21
8003640: ba 20 38 00 mv r7,r17
8003644: fb ff fc 87 calli 8002860 <rtems_disk_create_log>
8003648: b8 20 20 00 mv r4,r1
part_desc->size, name);
if (rc != RTEMS_SUCCESSFUL)
800364c: 44 20 00 06 be r1,r0,8003664 <rtems_ide_part_table_initialize+0xfc><== ALWAYS TAKEN
{
fprintf(stdout,"Cannot create device %s, error code %d\n", name, rc);
8003650: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED
8003654: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
8003658: ba 20 18 00 mv r3,r17 <== NOT EXECUTED
800365c: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED
8003660: f8 00 42 2f calli 8013f1c <fprintf> <== NOT EXECUTED
continue;
8003664: 36 52 00 04 addi r18,r18,4
*/
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++)
8003668: 29 61 00 24 lw r1,(r11+36)
800366c: 48 2c ff e7 bg r1,r12,8003608 <rtems_ide_part_table_initialize+0xa0>
fprintf(stdout,"Cannot create device %s, error code %d\n", name, rc);
continue;
}
}
partition_table_free(disk_desc);
8003670: b9 60 08 00 mv r1,r11
8003674: fb ff fe 3d calli 8002f68 <partition_table_free>
return RTEMS_SUCCESSFUL;
}
8003678: b9 c0 08 00 mv r1,r14
800367c: 2b 9d 00 04 lw ra,(sp+4)
8003680: 2b 8b 00 30 lw r11,(sp+48)
8003684: 2b 8c 00 2c lw r12,(sp+44)
8003688: 2b 8d 00 28 lw r13,(sp+40)
800368c: 2b 8e 00 24 lw r14,(sp+36)
8003690: 2b 8f 00 20 lw r15,(sp+32)
8003694: 2b 90 00 1c lw r16,(sp+28)
8003698: 2b 91 00 18 lw r17,(sp+24)
800369c: 2b 92 00 14 lw r18,(sp+20)
80036a0: 2b 93 00 10 lw r19,(sp+16)
80036a4: 2b 94 00 0c lw r20,(sp+12)
80036a8: 2b 95 00 08 lw r21,(sp+8)
80036ac: 37 9c 00 40 addi sp,sp,64
80036b0: c3 a0 00 00 ret
08006a90 <rtems_iterate_over_all_threads>:
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
{
8006a90: 37 9c ff e4 addi sp,sp,-28
8006a94: 5b 8b 00 1c sw (sp+28),r11
8006a98: 5b 8c 00 18 sw (sp+24),r12
8006a9c: 5b 8d 00 14 sw (sp+20),r13
8006aa0: 5b 8e 00 10 sw (sp+16),r14
8006aa4: 5b 8f 00 0c sw (sp+12),r15
8006aa8: 5b 90 00 08 sw (sp+8),r16
8006aac: 5b 9d 00 04 sw (sp+4),ra
8006ab0: b8 20 78 00 mv r15,r1
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
8006ab4: 44 20 00 17 be r1,r0,8006b10 <rtems_iterate_over_all_threads+0x80><== NEVER TAKEN
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
8006ab8: 78 02 08 02 mvhi r2,0x802
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
8006abc: 78 0b 08 02 mvhi r11,0x802
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
8006ac0: 38 42 2c f4 ori r2,r2,0x2cf4
uint32_t i;
uint32_t api_index;
Thread_Control *the_thread;
Objects_Information *information;
if ( !routine )
8006ac4: 39 6b 2c f8 ori r11,r11,0x2cf8
#endif
#include <rtems/system.h>
#include <rtems/score/thread.h>
void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
8006ac8: 34 50 00 10 addi r16,r2,16
#if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
if ( !_Objects_Information_table[ api_index ] )
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
8006acc: 29 61 00 00 lw r1,(r11+0)
if ( !information )
8006ad0: 34 0e 00 04 mvi r14,4
8006ad4: 34 0d 00 01 mvi r13,1
#if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
if ( !_Objects_Information_table[ api_index ] )
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
8006ad8: 28 2c 00 04 lw r12,(r1+4)
if ( !information )
8006adc: 5d 80 00 09 bne r12,r0,8006b00 <rtems_iterate_over_all_threads+0x70>
8006ae0: e0 00 00 0a bi 8006b08 <rtems_iterate_over_all_threads+0x78>
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ];
8006ae4: 29 81 00 1c lw r1,(r12+28)
8006ae8: b4 2e 08 00 add r1,r1,r14
8006aec: 28 21 00 00 lw r1,(r1+0)
if ( !the_thread )
8006af0: 44 20 00 02 be r1,r0,8006af8 <rtems_iterate_over_all_threads+0x68>
continue;
(*routine)(the_thread);
8006af4: d9 e0 00 00 call r15
information = _Objects_Information_table[ api_index ][ 1 ];
if ( !information )
continue;
for ( i=1 ; i <= information->maximum ; i++ ) {
8006af8: 35 ad 00 01 addi r13,r13,1
8006afc: 35 ce 00 04 addi r14,r14,4
8006b00: 2d 81 00 10 lhu r1,(r12+16)
8006b04: 50 2d ff f8 bgeu r1,r13,8006ae4 <rtems_iterate_over_all_threads+0x54>
8006b08: 35 6b 00 04 addi r11,r11,4
Objects_Information *information;
if ( !routine )
return;
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
8006b0c: 5d 70 ff f0 bne r11,r16,8006acc <rtems_iterate_over_all_threads+0x3c>
(*routine)(the_thread);
}
}
}
8006b10: 2b 9d 00 04 lw ra,(sp+4)
8006b14: 2b 8b 00 1c lw r11,(sp+28)
8006b18: 2b 8c 00 18 lw r12,(sp+24)
8006b1c: 2b 8d 00 14 lw r13,(sp+20)
8006b20: 2b 8e 00 10 lw r14,(sp+16)
8006b24: 2b 8f 00 0c lw r15,(sp+12)
8006b28: 2b 90 00 08 lw r16,(sp+8)
8006b2c: 37 9c 00 1c addi sp,sp,28
8006b30: c3 a0 00 00 ret
08002b54 <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 )
{
8002b54: 37 9c ff f4 addi sp,sp,-12
8002b58: 5b 8b 00 0c sw (sp+12),r11
8002b5c: 5b 8c 00 08 sw (sp+8),r12
8002b60: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code rc;
uint32_t i;
rtems_libio_t *iop;
if (rtems_libio_number_iops > 0)
8002b64: 78 01 08 01 mvhi r1,0x801
8002b68: 38 21 a0 10 ori r1,r1,0xa010
8002b6c: 28 2c 00 00 lw r12,(r1+0)
8002b70: 45 80 00 19 be r12,r0,8002bd4 <rtems_libio_init+0x80> <== NEVER TAKEN
{
rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops,
8002b74: b9 80 08 00 mv r1,r12
8002b78: 34 02 00 2c mvi r2,44
8002b7c: fb ff ff 1b calli 80027e8 <calloc>
8002b80: b8 20 58 00 mv r11,r1
8002b84: 78 01 08 01 mvhi r1,0x801
8002b88: 38 21 a8 7c ori r1,r1,0xa87c
8002b8c: 58 2b 00 00 sw (r1+0),r11
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
8002b90: 34 01 00 1a mvi r1,26
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)
8002b94: 45 60 00 1b be r11,r0,8002c00 <rtems_libio_init+0xac>
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
iop = rtems_libio_iop_freelist = rtems_libio_iops;
8002b98: 78 01 08 01 mvhi r1,0x801
8002b9c: 38 21 a8 80 ori r1,r1,0xa880
8002ba0: 58 2b 00 00 sw (r1+0),r11
for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++)
8002ba4: 34 02 00 00 mvi r2,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);
iop = rtems_libio_iop_freelist = rtems_libio_iops;
8002ba8: b9 60 08 00 mv r1,r11
for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++)
8002bac: e0 00 00 02 bi 8002bb4 <rtems_libio_init+0x60>
iop->data1 = iop + 1;
8002bb0: 58 21 ff fc sw (r1+-4),r1
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++)
8002bb4: 34 42 00 01 addi r2,r2,1
8002bb8: 34 21 00 2c addi r1,r1,44
8002bbc: 55 82 ff fd bgu r12,r2,8002bb0 <rtems_libio_init+0x5c>
iop->data1 = iop + 1;
iop->data1 = NULL;
8002bc0: b9 80 08 00 mv r1,r12
8002bc4: 34 02 00 2c mvi r2,44
8002bc8: f8 00 53 d3 calli 8017b14 <__mulsi3>
8002bcc: b5 61 08 00 add r1,r11,r1
8002bd0: 58 20 ff fc sw (r1+-4),r0
/*
* Create the binary semaphore used to provide mutual exclusion
* on the IOP Table.
*/
rc = rtems_semaphore_create(
8002bd4: 78 02 08 01 mvhi r2,0x801
8002bd8: 38 42 89 94 ori r2,r2,0x8994
8002bdc: 28 41 00 00 lw r1,(r2+0)
8002be0: 78 05 08 01 mvhi r5,0x801
8002be4: 34 03 00 54 mvi r3,84
8002be8: 34 02 00 01 mvi r2,1
8002bec: 34 04 00 00 mvi r4,0
8002bf0: 38 a5 a8 84 ori r5,r5,0xa884
8002bf4: f8 00 08 22 calli 8004c7c <rtems_semaphore_create>
8002bf8: b8 20 18 00 mv r3,r1
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&rtems_libio_semaphore
);
if ( rc != RTEMS_SUCCESSFUL )
8002bfc: 44 20 00 02 be r1,r0,8002c04 <rtems_libio_init+0xb0> <== ALWAYS TAKEN
rtems_fatal_error_occurred( rc );
8002c00: f8 00 0a 18 calli 8005460 <rtems_fatal_error_occurred>
/*
* Initialize the base file system infrastructure.
*/
if (rtems_fs_init_helper)
8002c04: 78 02 08 01 mvhi r2,0x801
8002c08: 38 42 a0 0c ori r2,r2,0xa00c
8002c0c: 28 41 00 00 lw r1,(r2+0)
8002c10: 44 23 00 02 be r1,r3,8002c18 <rtems_libio_init+0xc4>
(* rtems_fs_init_helper)();
8002c14: d8 20 00 00 call r1
}
8002c18: 2b 9d 00 04 lw ra,(sp+4)
8002c1c: 2b 8b 00 0c lw r11,(sp+12)
8002c20: 2b 8c 00 08 lw r12,(sp+8)
8002c24: 37 9c 00 0c addi sp,sp,12
8002c28: c3 a0 00 00 ret
08002b8c <rtems_libio_set_private_env>:
rtems_status_code rtems_libio_set_private_env(void)
{
8002b8c: 37 9c ff ec addi sp,sp,-20
8002b90: 5b 8b 00 14 sw (sp+20),r11
8002b94: 5b 8c 00 10 sw (sp+16),r12
8002b98: 5b 8d 00 0c sw (sp+12),r13
8002b9c: 5b 8e 00 08 sw (sp+8),r14
8002ba0: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_id self_task_id = rtems_task_self();
8002ba4: f8 00 07 18 calli 8004804 <rtems_task_self>
rtems_user_env_t *old_env = rtems_current_user_env;
8002ba8: 78 02 08 01 mvhi r2,0x801
8002bac: 38 42 41 48 ori r2,r2,0x4148
8002bb0: 28 4d 00 00 lw r13,(r2+0)
bool uses_global_env = old_env == &rtems_global_user_env;
bool uses_shared_env = old_env->task_id != self_task_id;
if (uses_global_env || uses_shared_env) {
8002bb4: 78 02 08 01 mvhi r2,0x801
8002bb8: 38 42 41 1c ori r2,r2,0x411c
}
rtems_status_code rtems_libio_set_private_env(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_id self_task_id = rtems_task_self();
8002bbc: b8 20 70 00 mv r14,r1
rtems_user_env_t *old_env = rtems_current_user_env;
bool uses_global_env = old_env == &rtems_global_user_env;
bool uses_shared_env = old_env->task_id != self_task_id;
8002bc0: 29 a1 00 24 lw r1,(r13+36)
if (uses_global_env || uses_shared_env) {
8002bc4: 45 a2 00 03 be r13,r2,8002bd0 <rtems_libio_set_private_env+0x44>
_Thread_Enable_dispatch();
}
rtems_status_code rtems_libio_set_private_env(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
8002bc8: 34 0c 00 00 mvi r12,0
rtems_id self_task_id = rtems_task_self();
rtems_user_env_t *old_env = rtems_current_user_env;
bool uses_global_env = old_env == &rtems_global_user_env;
bool uses_shared_env = old_env->task_id != self_task_id;
if (uses_global_env || uses_shared_env) {
8002bcc: 44 2e 00 2c be r1,r14,8002c7c <rtems_libio_set_private_env+0xf0>
rtems_user_env_t *new_env = calloc(1, sizeof(*new_env));
8002bd0: 34 01 00 01 mvi r1,1
8002bd4: 34 02 00 2c mvi r2,44
8002bd8: f8 00 16 ba calli 80086c0 <calloc>
8002bdc: b8 20 58 00 mv r11,r1
if (sc != RTEMS_SUCCESSFUL) {
free_user_env(new_env);
}
} else {
sc = RTEMS_NO_MEMORY;
8002be0: 34 0c 00 1a mvi r12,26
bool uses_shared_env = old_env->task_id != self_task_id;
if (uses_global_env || uses_shared_env) {
rtems_user_env_t *new_env = calloc(1, sizeof(*new_env));
if (new_env != NULL) {
8002be4: 44 20 00 26 be r1,r0,8002c7c <rtems_libio_set_private_env+0xf0>
*new_env = *old_env;
8002be8: b9 a0 10 00 mv r2,r13
8002bec: 34 03 00 2c mvi r3,44
8002bf0: f8 00 25 e2 calli 800c378 <memcpy>
new_env->reference_count = 1;
8002bf4: 34 01 00 01 mvi r1,1
8002bf8: 59 61 00 28 sw (r11+40),r1
new_env->task_id = self_task_id;
new_env->root_directory =
rtems_filesystem_global_location_obtain(&old_env->root_directory);
8002bfc: 35 a1 00 04 addi r1,r13,4
rtems_user_env_t *new_env = calloc(1, sizeof(*new_env));
if (new_env != NULL) {
*new_env = *old_env;
new_env->reference_count = 1;
new_env->task_id = self_task_id;
8002c00: 59 6e 00 24 sw (r11+36),r14
new_env->root_directory =
rtems_filesystem_global_location_obtain(&old_env->root_directory);
8002c04: f8 00 03 a4 calli 8003a94 <rtems_filesystem_global_location_obtain>
if (new_env != NULL) {
*new_env = *old_env;
new_env->reference_count = 1;
new_env->task_id = self_task_id;
new_env->root_directory =
8002c08: 59 61 00 04 sw (r11+4),r1
rtems_filesystem_global_location_obtain(&old_env->root_directory);
new_env->current_directory =
rtems_filesystem_global_location_obtain(&old_env->current_directory);
8002c0c: b9 a0 08 00 mv r1,r13
8002c10: f8 00 03 a1 calli 8003a94 <rtems_filesystem_global_location_obtain>
rtems_fatal_error_occurred(0xdeadbeef);
}
rtems_current_user_env = &rtems_global_user_env;
}
}
8002c14: 29 63 00 04 lw r3,(r11+4)
new_env->root_directory =
rtems_filesystem_global_location_obtain(&old_env->root_directory);
new_env->current_directory =
rtems_filesystem_global_location_obtain(&old_env->current_directory);
if (
8002c18: 78 02 08 01 mvhi r2,0x801
*new_env = *old_env;
new_env->reference_count = 1;
new_env->task_id = self_task_id;
new_env->root_directory =
rtems_filesystem_global_location_obtain(&old_env->root_directory);
new_env->current_directory =
8002c1c: 59 61 00 00 sw (r11+0),r1
rtems_filesystem_global_location_obtain(&old_env->current_directory);
if (
8002c20: 28 63 00 10 lw r3,(r3+16)
8002c24: 38 42 2a 94 ori r2,r2,0x2a94
8002c28: 44 62 00 10 be r3,r2,8002c68 <rtems_libio_set_private_env+0xdc>
!rtems_filesystem_global_location_is_null(new_env->root_directory)
&& !rtems_filesystem_global_location_is_null(new_env->current_directory)
8002c2c: 28 21 00 10 lw r1,(r1+16)
8002c30: 44 22 00 0e be r1,r2,8002c68 <rtems_libio_set_private_env+0xdc><== NEVER TAKEN
) {
sc = rtems_task_variable_add(
8002c34: 78 0e 08 01 mvhi r14,0x801
8002c38: 39 ce 41 48 ori r14,r14,0x4148
8002c3c: 78 03 08 00 mvhi r3,0x800
8002c40: 34 01 00 00 mvi r1,0
8002c44: b9 c0 10 00 mv r2,r14
8002c48: 38 63 2b 08 ori r3,r3,0x2b08
8002c4c: f8 00 07 13 calli 8004898 <rtems_task_variable_add>
8002c50: b8 20 60 00 mv r12,r1
RTEMS_SELF,
(void **) &rtems_current_user_env,
free_user_env
);
if (sc == RTEMS_SUCCESSFUL) {
8002c54: 5c 20 00 07 bne r1,r0,8002c70 <rtems_libio_set_private_env+0xe4>
free_user_env_protected(old_env);
8002c58: b9 a0 08 00 mv r1,r13
8002c5c: fb ff ff c2 calli 8002b64 <free_user_env_protected>
rtems_current_user_env = new_env;
8002c60: 59 cb 00 00 sw (r14+0),r11
8002c64: e0 00 00 06 bi 8002c7c <rtems_libio_set_private_env+0xf0>
} else {
sc = RTEMS_TOO_MANY;
}
} else {
sc = RTEMS_UNSATISFIED;
8002c68: 34 0c 00 0d mvi r12,13
8002c6c: e0 00 00 02 bi 8002c74 <rtems_libio_set_private_env+0xe8>
);
if (sc == RTEMS_SUCCESSFUL) {
free_user_env_protected(old_env);
rtems_current_user_env = new_env;
} else {
sc = RTEMS_TOO_MANY;
8002c70: 34 0c 00 05 mvi r12,5
} else {
sc = RTEMS_UNSATISFIED;
}
if (sc != RTEMS_SUCCESSFUL) {
free_user_env(new_env);
8002c74: b9 60 08 00 mv r1,r11
8002c78: fb ff ff a4 calli 8002b08 <free_user_env>
sc = RTEMS_NO_MEMORY;
}
}
return sc;
}
8002c7c: b9 80 08 00 mv r1,r12
8002c80: 2b 9d 00 04 lw ra,(sp+4)
8002c84: 2b 8b 00 14 lw r11,(sp+20)
8002c88: 2b 8c 00 10 lw r12,(sp+16)
8002c8c: 2b 8d 00 0c lw r13,(sp+12)
8002c90: 2b 8e 00 08 lw r14,(sp+8)
8002c94: 37 9c 00 14 addi sp,sp,20
8002c98: c3 a0 00 00 ret
08002c9c <rtems_libio_share_private_env>:
rtems_status_code rtems_libio_share_private_env(rtems_id task_id)
{
8002c9c: 37 9c ff ec addi sp,sp,-20
8002ca0: 5b 8b 00 10 sw (sp+16),r11
8002ca4: 5b 8c 00 0c sw (sp+12),r12
8002ca8: 5b 8d 00 08 sw (sp+8),r13
8002cac: 5b 9d 00 04 sw (sp+4),ra
8002cb0: b8 20 68 00 mv r13,r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_id self_task_id = rtems_task_self();
8002cb4: f8 00 06 d4 calli 8004804 <rtems_task_self>
if (task_id != RTEMS_SELF && self_task_id != task_id) {
8002cb8: fc 2d 08 00 cmpne r1,r1,r13
8002cbc: 7d a2 00 00 cmpnei r2,r13,0
return sc;
}
rtems_status_code rtems_libio_share_private_env(rtems_id task_id)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
8002cc0: 34 0b 00 00 mvi r11,0
rtems_id self_task_id = rtems_task_self();
if (task_id != RTEMS_SELF && self_task_id != task_id) {
8002cc4: a0 22 08 00 and r1,r1,r2
8002cc8: 44 20 00 21 be r1,r0,8002d4c <rtems_libio_share_private_env+0xb0>
/*
* We have to disable the thread dispatching to prevent deletion of the
* environment in the meantime.
*/
_Thread_Disable_dispatch();
sc = rtems_task_variable_get(
8002ccc: 78 0c 08 01 mvhi r12,0x801
/*
* We have to disable the thread dispatching to prevent deletion of the
* environment in the meantime.
*/
_Thread_Disable_dispatch();
8002cd0: fb ff ff 88 calli 8002af0 <_Thread_Disable_dispatch>
sc = rtems_task_variable_get(
8002cd4: 39 8c 41 48 ori r12,r12,0x4148
8002cd8: b9 a0 08 00 mv r1,r13
8002cdc: b9 80 10 00 mv r2,r12
8002ce0: 37 83 00 14 addi r3,sp,20
8002ce4: f8 00 07 3f calli 80049e0 <rtems_task_variable_get>
8002ce8: b8 20 58 00 mv r11,r1
task_id,
(void *) &rtems_current_user_env,
(void *) &env
);
if (sc == RTEMS_SUCCESSFUL) {
8002cec: 5c 20 00 06 bne r1,r0,8002d04 <rtems_libio_share_private_env+0x68>
++env->reference_count;
8002cf0: 2b 81 00 14 lw r1,(sp+20)
8002cf4: 28 22 00 28 lw r2,(r1+40)
8002cf8: 34 42 00 01 addi r2,r2,1
8002cfc: 58 22 00 28 sw (r1+40),r2
8002d00: e0 00 00 02 bi 8002d08 <rtems_libio_share_private_env+0x6c>
} else {
sc = RTEMS_UNSATISFIED;
8002d04: 34 0b 00 0d mvi r11,13
}
_Thread_Enable_dispatch();
8002d08: f8 00 10 6b calli 8006eb4 <_Thread_Enable_dispatch>
if (sc == RTEMS_SUCCESSFUL) {
8002d0c: 5d 60 00 10 bne r11,r0,8002d4c <rtems_libio_share_private_env+0xb0>
sc = rtems_task_variable_add(
8002d10: 78 03 08 00 mvhi r3,0x800
8002d14: 34 01 00 00 mvi r1,0
8002d18: b9 80 10 00 mv r2,r12
8002d1c: 38 63 2b 08 ori r3,r3,0x2b08
8002d20: f8 00 06 de calli 8004898 <rtems_task_variable_add>
8002d24: b8 20 58 00 mv r11,r1
RTEMS_SELF,
(void **) &rtems_current_user_env,
free_user_env
);
if (sc == RTEMS_SUCCESSFUL) {
8002d28: 5c 20 00 06 bne r1,r0,8002d40 <rtems_libio_share_private_env+0xa4><== NEVER TAKEN
free_user_env_protected(rtems_current_user_env);
8002d2c: 29 81 00 00 lw r1,(r12+0)
8002d30: fb ff ff 8d calli 8002b64 <free_user_env_protected>
rtems_current_user_env = env;
8002d34: 2b 81 00 14 lw r1,(sp+20)
8002d38: 59 81 00 00 sw (r12+0),r1
8002d3c: e0 00 00 04 bi 8002d4c <rtems_libio_share_private_env+0xb0>
} else {
free_user_env_protected(env);
8002d40: 2b 81 00 14 lw r1,(sp+20) <== NOT EXECUTED
sc = RTEMS_TOO_MANY;
8002d44: 34 0b 00 05 mvi r11,5 <== NOT EXECUTED
);
if (sc == RTEMS_SUCCESSFUL) {
free_user_env_protected(rtems_current_user_env);
rtems_current_user_env = env;
} else {
free_user_env_protected(env);
8002d48: fb ff ff 87 calli 8002b64 <free_user_env_protected> <== NOT EXECUTED
}
}
}
return sc;
}
8002d4c: b9 60 08 00 mv r1,r11
8002d50: 2b 9d 00 04 lw ra,(sp+4)
8002d54: 2b 8b 00 10 lw r11,(sp+16)
8002d58: 2b 8c 00 0c lw r12,(sp+12)
8002d5c: 2b 8d 00 08 lw r13,(sp+8)
8002d60: 37 9c 00 14 addi sp,sp,20
8002d64: c3 a0 00 00 ret
08002cd4 <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 ) {
8002cd4: 20 24 00 06 andi r4,r1,0x6
8002cd8: 34 03 00 06 mvi r3,6
fcntl_flags |= O_RDWR;
8002cdc: 34 02 00 02 mvi r2,2
int rtems_libio_to_fcntl_flags( uint32_t flags )
{
int fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
8002ce0: 44 83 00 06 be r4,r3,8002cf8 <rtems_libio_to_fcntl_flags+0x24>
fcntl_flags |= O_RDWR;
} else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) {
8002ce4: 20 23 00 02 andi r3,r1,0x2
fcntl_flags |= O_RDONLY;
8002ce8: 34 02 00 00 mvi r2,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) {
8002cec: 5c 60 00 03 bne r3,r0,8002cf8 <rtems_libio_to_fcntl_flags+0x24><== ALWAYS TAKEN
fcntl_flags |= O_RDONLY;
} else if ( (flags & LIBIO_FLAGS_WRITE) == LIBIO_FLAGS_WRITE) {
8002cf0: 20 22 00 04 andi r2,r1,0x4 <== NOT EXECUTED
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;
8002cf4: 7c 42 00 00 cmpnei r2,r2,0 <== NOT EXECUTED
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 ) {
8002cf8: 20 23 00 01 andi r3,r1,0x1
8002cfc: 44 60 00 02 be r3,r0,8002d04 <rtems_libio_to_fcntl_flags+0x30>
fcntl_flags |= O_NONBLOCK;
8002d00: 38 42 40 00 ori r2,r2,0x4000
}
if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) {
8002d04: 20 23 02 00 andi r3,r1,0x200
8002d08: 44 60 00 02 be r3,r0,8002d10 <rtems_libio_to_fcntl_flags+0x3c>
fcntl_flags |= O_APPEND;
8002d0c: 38 42 00 08 ori r2,r2,0x8
}
if ( (flags & LIBIO_FLAGS_CREATE) == LIBIO_FLAGS_CREATE ) {
8002d10: 20 21 04 00 andi r1,r1,0x400
8002d14: 44 20 00 02 be r1,r0,8002d1c <rtems_libio_to_fcntl_flags+0x48>
fcntl_flags |= O_CREAT;
8002d18: 38 42 02 00 ori r2,r2,0x200
}
return fcntl_flags;
}
8002d1c: b8 40 08 00 mv r1,r2
8002d20: c3 a0 00 00 ret
08002d68 <rtems_libio_use_global_env>:
void rtems_libio_use_global_env(void)
{
8002d68: 37 9c ff f4 addi sp,sp,-12
8002d6c: 5b 8b 00 0c sw (sp+12),r11
8002d70: 5b 8c 00 08 sw (sp+8),r12
8002d74: 5b 9d 00 04 sw (sp+4),ra
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) {
8002d78: 78 0b 08 01 mvhi r11,0x801
8002d7c: 39 6b 41 48 ori r11,r11,0x4148
8002d80: 29 61 00 00 lw r1,(r11+0)
8002d84: 78 0c 08 01 mvhi r12,0x801
8002d88: 39 8c 41 1c ori r12,r12,0x411c
8002d8c: 44 2c 00 0a be r1,r12,8002db4 <rtems_libio_use_global_env+0x4c>
sc = rtems_task_variable_delete(
8002d90: 34 01 00 00 mvi r1,0
8002d94: b9 60 10 00 mv r2,r11
8002d98: f8 00 06 ef calli 8004954 <rtems_task_variable_delete>
RTEMS_SELF,
(void **) &rtems_current_user_env
);
if (sc != RTEMS_SUCCESSFUL) {
8002d9c: 44 20 00 05 be r1,r0,8002db0 <rtems_libio_use_global_env+0x48><== ALWAYS TAKEN
rtems_fatal_error_occurred(0xdeadbeef);
8002da0: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED
8002da4: 38 42 2a 8c ori r2,r2,0x2a8c <== NOT EXECUTED
8002da8: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED
8002dac: f8 00 07 a0 calli 8004c2c <rtems_fatal_error_occurred> <== NOT EXECUTED
}
rtems_current_user_env = &rtems_global_user_env;
8002db0: 59 6c 00 00 sw (r11+0),r12
}
}
8002db4: 2b 9d 00 04 lw ra,(sp+4)
8002db8: 2b 8b 00 0c lw r11,(sp+12)
8002dbc: 2b 8c 00 08 lw r12,(sp+8)
8002dc0: 37 9c 00 0c addi sp,sp,12
8002dc4: c3 a0 00 00 ret
08005d4c <rtems_malloc_statistics_at_free>:
* size and thus we skip updating the statistics.
*/
static void rtems_malloc_statistics_at_free(
void *pointer
)
{
8005d4c: 37 9c ff f8 addi sp,sp,-8
8005d50: 5b 9d 00 04 sw (sp+4),ra
uintptr_t size;
if (_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &size) ) {
8005d54: 78 03 08 02 mvhi r3,0x802
8005d58: 38 63 60 54 ori r3,r3,0x6054
* size and thus we skip updating the statistics.
*/
static void rtems_malloc_statistics_at_free(
void *pointer
)
{
8005d5c: b8 20 10 00 mv r2,r1
uintptr_t size;
if (_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &size) ) {
8005d60: 28 61 00 00 lw r1,(r3+0)
8005d64: 37 83 00 08 addi r3,sp,8
8005d68: f8 00 15 96 calli 800b3c0 <_Protected_heap_Get_block_size>
8005d6c: 44 20 00 0b be r1,r0,8005d98 <rtems_malloc_statistics_at_free+0x4c><== NEVER TAKEN
MSBUMP(lifetime_freed, size);
8005d70: 78 01 08 02 mvhi r1,0x802
8005d74: 38 21 71 18 ori r1,r1,0x7118
8005d78: 2b 83 00 08 lw r3,(sp+8)
8005d7c: 28 22 00 2c lw r2,(r1+44)
8005d80: 28 24 00 28 lw r4,(r1+40)
8005d84: b4 62 10 00 add r2,r3,r2
8005d88: f4 62 18 00 cmpgu r3,r3,r2
8005d8c: 58 22 00 2c sw (r1+44),r2
8005d90: b4 64 18 00 add r3,r3,r4
8005d94: 58 23 00 28 sw (r1+40),r3
}
}
8005d98: 2b 9d 00 04 lw ra,(sp+4)
8005d9c: 37 9c 00 08 addi sp,sp,8
8005da0: c3 a0 00 00 ret
08005da4 <rtems_malloc_statistics_at_malloc>:
}
static void rtems_malloc_statistics_at_malloc(
void *pointer
)
{
8005da4: 37 9c ff f8 addi sp,sp,-8
8005da8: 5b 9d 00 04 sw (sp+4),ra
uintptr_t actual_size = 0;
8005dac: 5b 80 00 08 sw (sp+8),r0
}
static void rtems_malloc_statistics_at_malloc(
void *pointer
)
{
8005db0: b8 20 10 00 mv r2,r1
uintptr_t actual_size = 0;
uint32_t current_depth;
rtems_malloc_statistics_t *s = &rtems_malloc_statistics;
if ( !pointer )
8005db4: 44 20 00 15 be r1,r0,8005e08 <rtems_malloc_statistics_at_malloc+0x64><== NEVER TAKEN
return;
_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, pointer, &actual_size);
8005db8: 78 03 08 02 mvhi r3,0x802
8005dbc: 38 63 60 54 ori r3,r3,0x6054
8005dc0: 28 61 00 00 lw r1,(r3+0)
8005dc4: 37 83 00 08 addi r3,sp,8
8005dc8: f8 00 15 7e calli 800b3c0 <_Protected_heap_Get_block_size>
MSBUMP(lifetime_allocated, actual_size);
8005dcc: 78 01 08 02 mvhi r1,0x802
8005dd0: 38 21 71 18 ori r1,r1,0x7118
8005dd4: 2b 83 00 08 lw r3,(sp+8)
8005dd8: 28 22 00 24 lw r2,(r1+36)
8005ddc: 28 24 00 20 lw r4,(r1+32)
8005de0: b4 62 10 00 add r2,r3,r2
8005de4: f4 62 18 00 cmpgu r3,r3,r2
8005de8: 58 22 00 24 sw (r1+36),r2
8005dec: b4 64 18 00 add r3,r3,r4
8005df0: 58 23 00 20 sw (r1+32),r3
current_depth = (uint32_t) (s->lifetime_allocated - s->lifetime_freed);
8005df4: 28 23 00 2c lw r3,(r1+44)
8005df8: c8 43 10 00 sub r2,r2,r3
if (current_depth > s->max_depth)
8005dfc: 28 23 00 18 lw r3,(r1+24)
8005e00: 50 62 00 02 bgeu r3,r2,8005e08 <rtems_malloc_statistics_at_malloc+0x64>
s->max_depth = current_depth;
8005e04: 58 22 00 18 sw (r1+24),r2
}
8005e08: 2b 9d 00 04 lw ra,(sp+4)
8005e0c: 37 9c 00 08 addi sp,sp,8
8005e10: c3 a0 00 00 ret
0800d474 <rtems_memalign>:
int rtems_memalign(
void **pointer,
size_t alignment,
size_t size
)
{
800d474: 37 9c ff ec addi sp,sp,-20
800d478: 5b 8b 00 14 sw (sp+20),r11
800d47c: 5b 8c 00 10 sw (sp+16),r12
800d480: 5b 8d 00 0c sw (sp+12),r13
800d484: 5b 8e 00 08 sw (sp+8),r14
800d488: 5b 9d 00 04 sw (sp+4),ra
/*
* Parameter error checks
*/
if ( !pointer )
return EINVAL;
800d48c: 34 0c 00 16 mvi r12,22
int rtems_memalign(
void **pointer,
size_t alignment,
size_t size
)
{
800d490: b8 20 58 00 mv r11,r1
800d494: b8 40 68 00 mv r13,r2
800d498: b8 60 70 00 mv r14,r3
void *return_this;
/*
* Parameter error checks
*/
if ( !pointer )
800d49c: 44 20 00 1d be r1,r0,800d510 <rtems_memalign+0x9c>
return EINVAL;
*pointer = NULL;
800d4a0: 58 20 00 00 sw (r1+0),r0
/*
* Do not attempt to allocate memory if not in correct system state.
*/
if ( _System_state_Is_up(_System_state_Get()) &&
800d4a4: 78 01 08 01 mvhi r1,0x801
800d4a8: 38 21 ad f8 ori r1,r1,0xadf8
800d4ac: 28 22 00 00 lw r2,(r1+0)
800d4b0: 34 01 00 03 mvi r1,3
800d4b4: 5c 41 00 03 bne r2,r1,800d4c0 <rtems_memalign+0x4c>
!malloc_is_system_state_OK() )
800d4b8: fb ff d6 46 calli 8002dd0 <malloc_is_system_state_OK>
*pointer = NULL;
/*
* Do not attempt to allocate memory if not in correct system state.
*/
if ( _System_state_Is_up(_System_state_Get()) &&
800d4bc: 44 20 00 15 be r1,r0,800d510 <rtems_memalign+0x9c> <== NEVER TAKEN
return EINVAL;
/*
* If some free's have been deferred, then do them now.
*/
malloc_deferred_frees_process();
800d4c0: fb ff d6 4e calli 8002df8 <malloc_deferred_frees_process>
Heap_Control *heap,
uintptr_t size,
uintptr_t alignment
)
{
return
800d4c4: 78 01 08 01 mvhi r1,0x801
800d4c8: 38 21 a0 54 ori r1,r1,0xa054
800d4cc: 28 21 00 00 lw r1,(r1+0)
800d4d0: b9 a0 18 00 mv r3,r13
800d4d4: b9 c0 10 00 mv r2,r14
800d4d8: 34 04 00 00 mvi r4,0
800d4dc: fb ff e6 6d calli 8006e90 <_Protected_heap_Allocate_aligned_with_boundary>
800d4e0: b8 20 68 00 mv r13,r1
RTEMS_Malloc_Heap,
size,
alignment
);
if ( !return_this )
return ENOMEM;
800d4e4: 34 0c 00 0c mvi r12,12
return_this = _Protected_heap_Allocate_aligned(
RTEMS_Malloc_Heap,
size,
alignment
);
if ( !return_this )
800d4e8: 44 20 00 0a be r1,r0,800d510 <rtems_memalign+0x9c>
return ENOMEM;
/*
* If configured, update the more involved statistics
*/
if ( rtems_malloc_statistics_helpers )
800d4ec: 78 02 08 01 mvhi r2,0x801
800d4f0: 38 42 a7 0c ori r2,r2,0xa70c
800d4f4: 28 41 00 00 lw r1,(r2+0)
800d4f8: 44 20 00 04 be r1,r0,800d508 <rtems_memalign+0x94>
(*rtems_malloc_statistics_helpers->at_malloc)(pointer);
800d4fc: 28 22 00 04 lw r2,(r1+4)
800d500: b9 60 08 00 mv r1,r11
800d504: d8 40 00 00 call r2
*pointer = return_this;
800d508: 59 6d 00 00 sw (r11+0),r13
return 0;
800d50c: 34 0c 00 00 mvi r12,0
}
800d510: b9 80 08 00 mv r1,r12
800d514: 2b 9d 00 04 lw ra,(sp+4)
800d518: 2b 8b 00 14 lw r11,(sp+20)
800d51c: 2b 8c 00 10 lw r12,(sp+16)
800d520: 2b 8d 00 0c lw r13,(sp+12)
800d524: 2b 8e 00 08 lw r14,(sp+8)
800d528: 37 9c 00 14 addi sp,sp,20
800d52c: c3 a0 00 00 ret
08011fc0 <rtems_message_queue_broadcast>:
rtems_id id,
const void *buffer,
size_t size,
uint32_t *count
)
{
8011fc0: 37 9c ff e4 addi sp,sp,-28
8011fc4: 5b 8b 00 14 sw (sp+20),r11
8011fc8: 5b 8c 00 10 sw (sp+16),r12
8011fcc: 5b 8d 00 0c sw (sp+12),r13
8011fd0: 5b 8e 00 08 sw (sp+8),r14
8011fd4: 5b 9d 00 04 sw (sp+4),ra
8011fd8: b8 20 60 00 mv r12,r1
8011fdc: b8 40 68 00 mv r13,r2
8011fe0: b8 60 70 00 mv r14,r3
8011fe4: b8 80 58 00 mv r11,r4
register Message_queue_Control *the_message_queue;
Objects_Locations location;
CORE_message_queue_Status core_status;
if ( !buffer )
return RTEMS_INVALID_ADDRESS;
8011fe8: 34 01 00 09 mvi r1,9
{
register Message_queue_Control *the_message_queue;
Objects_Locations location;
CORE_message_queue_Status core_status;
if ( !buffer )
8011fec: 44 40 00 16 be r2,r0,8012044 <rtems_message_queue_broadcast+0x84><== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
if ( !count )
8011ff0: 44 80 00 15 be r4,r0,8012044 <rtems_message_queue_broadcast+0x84><== NEVER TAKEN
Objects_Id id,
Objects_Locations *location
)
{
return (Message_queue_Control *)
_Objects_Get( &_Message_queue_Information, id, location );
8011ff4: 78 01 08 04 mvhi r1,0x804
8011ff8: b9 80 10 00 mv r2,r12
8011ffc: 38 21 06 10 ori r1,r1,0x610
8012000: 37 83 00 1c addi r3,sp,28
8012004: f8 00 1a 7a calli 80189ec <_Objects_Get>
return RTEMS_INVALID_ADDRESS;
the_message_queue = _Message_queue_Get( id, &location );
switch ( location ) {
8012008: 2b 82 00 1c lw r2,(sp+28)
801200c: 5c 40 00 0d bne r2,r0,8012040 <rtems_message_queue_broadcast+0x80>
case OBJECTS_LOCAL:
core_status = _CORE_message_queue_Broadcast(
8012010: b9 a0 10 00 mv r2,r13
8012014: b9 c0 18 00 mv r3,r14
8012018: b9 80 20 00 mv r4,r12
801201c: 34 05 00 00 mvi r5,0
8012020: b9 60 30 00 mv r6,r11
8012024: 34 21 00 14 addi r1,r1,20
8012028: f8 00 11 77 calli 8016604 <_CORE_message_queue_Broadcast>
NULL,
#endif
count
);
_Thread_Enable_dispatch();
801202c: 5b 81 00 18 sw (sp+24),r1
8012030: f8 00 1e df calli 8019bac <_Thread_Enable_dispatch>
return
8012034: 2b 81 00 18 lw r1,(sp+24)
8012038: f8 00 01 0e calli 8012470 <_Message_queue_Translate_core_message_queue_return_code>
801203c: e0 00 00 02 bi 8012044 <rtems_message_queue_broadcast+0x84>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8012040: 34 01 00 04 mvi r1,4
}
8012044: 2b 9d 00 04 lw ra,(sp+4)
8012048: 2b 8b 00 14 lw r11,(sp+20)
801204c: 2b 8c 00 10 lw r12,(sp+16)
8012050: 2b 8d 00 0c lw r13,(sp+12)
8012054: 2b 8e 00 08 lw r14,(sp+8)
8012058: 37 9c 00 1c addi sp,sp,28
801205c: c3 a0 00 00 ret
08007b48 <rtems_mkdir>:
return (retval);
}
int
rtems_mkdir(const char *path, mode_t mode)
{
8007b48: 37 9c ff 84 addi sp,sp,-124
8007b4c: 5b 8b 00 34 sw (sp+52),r11
8007b50: 5b 8c 00 30 sw (sp+48),r12
8007b54: 5b 8d 00 2c sw (sp+44),r13
8007b58: 5b 8e 00 28 sw (sp+40),r14
8007b5c: 5b 8f 00 24 sw (sp+36),r15
8007b60: 5b 90 00 20 sw (sp+32),r16
8007b64: 5b 91 00 1c sw (sp+28),r17
8007b68: 5b 92 00 18 sw (sp+24),r18
8007b6c: 5b 93 00 14 sw (sp+20),r19
8007b70: 5b 94 00 10 sw (sp+16),r20
8007b74: 5b 95 00 0c sw (sp+12),r21
8007b78: 5b 96 00 08 sw (sp+8),r22
8007b7c: 5b 9d 00 04 sw (sp+4),ra
8007b80: b8 40 b0 00 mv r22,r2
int success = 0;
char *dup_path = strdup(path);
8007b84: f8 00 6e 5e calli 80234fc <strdup>
8007b88: b8 20 60 00 mv r12,r1
if (dup_path != NULL) {
success = build(dup_path, mode);
free(dup_path);
}
return success != 0 ? 0 : -1;
8007b8c: 34 01 ff ff mvi r1,-1
rtems_mkdir(const char *path, mode_t mode)
{
int success = 0;
char *dup_path = strdup(path);
if (dup_path != NULL) {
8007b90: 45 80 00 4d be r12,r0,8007cc4 <rtems_mkdir+0x17c>
char *p;
p = path;
oumask = 0;
retval = 1;
if (p[0] == '/') /* Skip leading '/'. */
8007b94: 41 8b 00 00 lbu r11,(r12+0)
8007b98: 34 0e 00 00 mvi r14,0
8007b9c: 34 01 00 01 mvi r1,1
++p;
8007ba0: 65 6b 00 2f cmpei r11,r11,47
retval = 0;
break;
}
}
if (!last)
*p = '/';
8007ba4: 34 15 00 2f mvi r21,47
p = path;
oumask = 0;
retval = 1;
if (p[0] == '/') /* Skip leading '/'. */
++p;
8007ba8: b5 8b 58 00 add r11,r12,r11
first = 0;
}
if (last)
(void)umask(oumask);
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
if (errno == EEXIST || errno == EISDIR) {
8007bac: 34 14 00 11 mvi r20,17
if (stat(path, &sb) < 0) {
8007bb0: 37 93 00 38 addi r19,sp,56
retval = 0;
break;
} else if (!S_ISDIR(sb.st_mode)) {
8007bb4: 34 12 40 00 mvi r18,16384
first = 0;
}
if (last)
(void)umask(oumask);
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
if (errno == EEXIST || errno == EISDIR) {
8007bb8: 34 11 00 15 mvi r17,21
*
* We change the user's umask and then restore it,
* instead of doing chmod's.
*/
oumask = umask(0);
numask = oumask & ~(S_IWUSR | S_IXUSR);
8007bbc: 34 10 ff 3f mvi r16,-193
if (p[0] == '/') /* Skip leading '/'. */
++p;
for (first = 1, last = 0; !last ; ++p) {
if (p[0] == '\0')
last = 1;
else if (p[0] != '/')
8007bc0: 34 0f 00 2f mvi r15,47
oumask = 0;
retval = 1;
if (p[0] == '/') /* Skip leading '/'. */
++p;
for (first = 1, last = 0; !last ; ++p) {
if (p[0] == '\0')
8007bc4: 41 64 00 00 lbu r4,(r11+0)
last = 1;
8007bc8: 34 03 00 01 mvi r3,1
oumask = 0;
retval = 1;
if (p[0] == '/') /* Skip leading '/'. */
++p;
for (first = 1, last = 0; !last ; ++p) {
if (p[0] == '\0')
8007bcc: 44 80 00 03 be r4,r0,8007bd8 <rtems_mkdir+0x90>
last = 1;
else if (p[0] != '/')
8007bd0: 5c 8f 00 33 bne r4,r15,8007c9c <rtems_mkdir+0x154>
8007bd4: 34 03 00 00 mvi r3,0
continue;
*p = '\0';
8007bd8: 31 60 00 00 sb (r11+0),r0
if (!last && p[1] == '\0')
8007bdc: 34 0d 00 01 mvi r13,1
8007be0: 5c 60 00 03 bne r3,r0,8007bec <rtems_mkdir+0xa4>
8007be4: 41 6d 00 01 lbu r13,(r11+1)
8007be8: 65 ad 00 00 cmpei r13,r13,0
last = 1;
if (first) {
8007bec: 44 20 00 06 be r1,r0,8007c04 <rtems_mkdir+0xbc>
* mkdir [-m mode] dir
*
* We change the user's umask and then restore it,
* instead of doing chmod's.
*/
oumask = umask(0);
8007bf0: 34 01 00 00 mvi r1,0
8007bf4: f8 00 03 55 calli 8008948 <umask>
8007bf8: b8 20 70 00 mv r14,r1
numask = oumask & ~(S_IWUSR | S_IXUSR);
(void)umask(numask);
8007bfc: a0 30 08 00 and r1,r1,r16
8007c00: f8 00 03 52 calli 8008948 <umask>
first = 0;
}
if (last)
(void)umask(oumask);
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
8007c04: 34 03 01 ff mvi r3,511
oumask = umask(0);
numask = oumask & ~(S_IWUSR | S_IXUSR);
(void)umask(numask);
first = 0;
}
if (last)
8007c08: 45 a0 00 04 be r13,r0,8007c18 <rtems_mkdir+0xd0>
(void)umask(oumask);
8007c0c: b9 c0 08 00 mv r1,r14
8007c10: f8 00 03 4e calli 8008948 <umask>
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
8007c14: ba c0 18 00 mv r3,r22
8007c18: b9 80 08 00 mv r1,r12
8007c1c: b8 60 10 00 mv r2,r3
8007c20: fb ff fc 45 calli 8006d34 <mkdir>
8007c24: 4c 20 00 1b bge r1,r0,8007c90 <rtems_mkdir+0x148>
if (errno == EEXIST || errno == EISDIR) {
8007c28: f8 00 64 38 calli 8020d08 <__errno>
8007c2c: 28 21 00 00 lw r1,(r1+0)
8007c30: 44 34 00 04 be r1,r20,8007c40 <rtems_mkdir+0xf8>
8007c34: f8 00 64 35 calli 8020d08 <__errno>
8007c38: 28 21 00 00 lw r1,(r1+0)
8007c3c: 5c 31 00 1a bne r1,r17,8007ca4 <rtems_mkdir+0x15c> <== ALWAYS TAKEN
if (stat(path, &sb) < 0) {
8007c40: b9 80 08 00 mv r1,r12
8007c44: ba 60 10 00 mv r2,r19
8007c48: f8 00 00 32 calli 8007d10 <stat>
8007c4c: 48 01 00 16 bg r0,r1,8007ca4 <rtems_mkdir+0x15c> <== NEVER TAKEN
retval = 0;
break;
} else if (!S_ISDIR(sb.st_mode)) {
8007c50: 2b 81 00 44 lw r1,(sp+68)
8007c54: 20 21 f0 00 andi r1,r1,0xf000
8007c58: 44 32 00 0c be r1,r18,8007c88 <rtems_mkdir+0x140>
if (last)
8007c5c: 45 a0 00 06 be r13,r0,8007c74 <rtems_mkdir+0x12c>
errno = EEXIST;
8007c60: f8 00 64 2a calli 8020d08 <__errno>
8007c64: 34 02 00 11 mvi r2,17
8007c68: 58 22 00 00 sw (r1+0),r2
else
errno = ENOTDIR;
retval = 0;
8007c6c: 34 0b 00 00 mvi r11,0
8007c70: e0 00 00 11 bi 8007cb4 <rtems_mkdir+0x16c>
break;
} else if (!S_ISDIR(sb.st_mode)) {
if (last)
errno = EEXIST;
else
errno = ENOTDIR;
8007c74: f8 00 64 25 calli 8020d08 <__errno>
8007c78: 34 02 00 14 mvi r2,20
8007c7c: 58 22 00 00 sw (r1+0),r2
retval = 0;
8007c80: 34 0b 00 00 mvi r11,0
8007c84: e0 00 00 0a bi 8007cac <rtems_mkdir+0x164>
break;
}
if (last)
8007c88: 5d a0 00 1e bne r13,r0,8007d00 <rtems_mkdir+0x1b8>
8007c8c: e0 00 00 02 bi 8007c94 <rtems_mkdir+0x14c>
} else {
retval = 0;
break;
}
}
if (!last)
8007c90: 5d a0 00 1e bne r13,r0,8007d08 <rtems_mkdir+0x1c0>
*p = '/';
8007c94: 31 75 00 00 sb (r11+0),r21
8007c98: 34 01 00 00 mvi r1,0
p = path;
oumask = 0;
retval = 1;
if (p[0] == '/') /* Skip leading '/'. */
++p;
for (first = 1, last = 0; !last ; ++p) {
8007c9c: 35 6b 00 01 addi r11,r11,1
8007ca0: e3 ff ff c9 bi 8007bc4 <rtems_mkdir+0x7c>
if (last)
(void)umask(oumask);
if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
if (errno == EEXIST || errno == EISDIR) {
if (stat(path, &sb) < 0) {
retval = 0;
8007ca4: 34 0b 00 00 mvi r11,0
}
}
if (!last)
*p = '/';
}
if (!first && !last)
8007ca8: 5d a0 00 03 bne r13,r0,8007cb4 <rtems_mkdir+0x16c> <== ALWAYS TAKEN
(void)umask(oumask);
8007cac: b9 c0 08 00 mv r1,r14
8007cb0: f8 00 03 26 calli 8008948 <umask>
int success = 0;
char *dup_path = strdup(path);
if (dup_path != NULL) {
success = build(dup_path, mode);
free(dup_path);
8007cb4: b9 80 08 00 mv r1,r12
8007cb8: fb ff f9 f5 calli 800648c <free>
}
return success != 0 ? 0 : -1;
8007cbc: 7d 61 00 00 cmpnei r1,r11,0
8007cc0: 34 21 ff ff addi r1,r1,-1
}
8007cc4: 2b 9d 00 04 lw ra,(sp+4)
8007cc8: 2b 8b 00 34 lw r11,(sp+52)
8007ccc: 2b 8c 00 30 lw r12,(sp+48)
8007cd0: 2b 8d 00 2c lw r13,(sp+44)
8007cd4: 2b 8e 00 28 lw r14,(sp+40)
8007cd8: 2b 8f 00 24 lw r15,(sp+36)
8007cdc: 2b 90 00 20 lw r16,(sp+32)
8007ce0: 2b 91 00 1c lw r17,(sp+28)
8007ce4: 2b 92 00 18 lw r18,(sp+24)
8007ce8: 2b 93 00 14 lw r19,(sp+20)
8007cec: 2b 94 00 10 lw r20,(sp+16)
8007cf0: 2b 95 00 0c lw r21,(sp+12)
8007cf4: 2b 96 00 08 lw r22,(sp+8)
8007cf8: 37 9c 00 7c addi sp,sp,124
8007cfc: c3 a0 00 00 ret
errno = ENOTDIR;
retval = 0;
break;
}
if (last)
retval = 2;
8007d00: 34 0b 00 02 mvi r11,2
8007d04: e3 ff ff ec bi 8007cb4 <rtems_mkdir+0x16c>
} else {
retval = 0;
break;
}
}
if (!last)
8007d08: 34 0b 00 01 mvi r11,1
8007d0c: e3 ff ff ea bi 8007cb4 <rtems_mkdir+0x16c>
08005048 <rtems_partition_create>:
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
8005048: 37 9c ff d8 addi sp,sp,-40
800504c: 5b 8b 00 28 sw (sp+40),r11
8005050: 5b 8c 00 24 sw (sp+36),r12
8005054: 5b 8d 00 20 sw (sp+32),r13
8005058: 5b 8e 00 1c sw (sp+28),r14
800505c: 5b 8f 00 18 sw (sp+24),r15
8005060: 5b 90 00 14 sw (sp+20),r16
8005064: 5b 91 00 10 sw (sp+16),r17
8005068: 5b 92 00 0c sw (sp+12),r18
800506c: 5b 93 00 08 sw (sp+8),r19
8005070: 5b 9d 00 04 sw (sp+4),ra
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
8005074: 34 07 00 03 mvi r7,3
uint32_t length,
uint32_t buffer_size,
rtems_attribute attribute_set,
rtems_id *id
)
{
8005078: b8 20 88 00 mv r17,r1
800507c: b8 40 70 00 mv r14,r2
8005080: b8 60 78 00 mv r15,r3
8005084: b8 80 60 00 mv r12,r4
8005088: b8 a0 98 00 mv r19,r5
800508c: b8 c0 80 00 mv r16,r6
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
8005090: 44 20 00 36 be r1,r0,8005168 <rtems_partition_create+0x120>
return RTEMS_INVALID_NAME;
if ( !starting_address )
return RTEMS_INVALID_ADDRESS;
8005094: 34 07 00 09 mvi r7,9
register Partition_Control *the_partition;
if ( !rtems_is_name_valid( name ) )
return RTEMS_INVALID_NAME;
if ( !starting_address )
8005098: 44 40 00 34 be r2,r0,8005168 <rtems_partition_create+0x120>
return RTEMS_INVALID_ADDRESS;
if ( !id )
800509c: 44 c0 00 33 be r6,r0,8005168 <rtems_partition_create+0x120><== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
80050a0: 64 82 00 00 cmpei r2,r4,0
80050a4: 64 61 00 00 cmpei r1,r3,0
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
80050a8: 34 07 00 08 mvi r7,8
return RTEMS_INVALID_ADDRESS;
if ( !id )
return RTEMS_INVALID_ADDRESS;
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
80050ac: b8 41 08 00 or r1,r2,r1
80050b0: 5c 20 00 2e bne r1,r0,8005168 <rtems_partition_create+0x120>
80050b4: 54 83 00 2d bgu r4,r3,8005168 <rtems_partition_create+0x120>
*/
RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned (
uint32_t buffer_size
)
{
return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0);
80050b8: 20 81 00 03 andi r1,r4,0x3
80050bc: 5c 20 00 2b bne r1,r0,8005168 <rtems_partition_create+0x120>
)
{
#if (CPU_ALIGNMENT == 0)
return true;
#else
return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
80050c0: 21 d2 00 03 andi r18,r14,0x3
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
if ( !_Addresses_Is_aligned( starting_address ) )
return RTEMS_INVALID_ADDRESS;
80050c4: 34 07 00 09 mvi r7,9
if ( length == 0 || buffer_size == 0 || length < buffer_size ||
!_Partition_Is_buffer_size_aligned( buffer_size ) )
return RTEMS_INVALID_SIZE;
if ( !_Addresses_Is_aligned( starting_address ) )
80050c8: 5e 41 00 28 bne r18,r1,8005168 <rtems_partition_create+0x120>
*
* 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;
80050cc: 78 02 08 02 mvhi r2,0x802
80050d0: 38 42 43 28 ori r2,r2,0x4328
80050d4: 28 41 00 00 lw r1,(r2+0)
++level;
80050d8: 34 21 00 01 addi r1,r1,1
_Thread_Dispatch_disable_level = level;
80050dc: 58 41 00 00 sw (r2+0),r1
* This function allocates a partition control block from
* the inactive chain of free partition control blocks.
*/
RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void )
{
return (Partition_Control *) _Objects_Allocate( &_Partition_Information );
80050e0: 78 0d 08 02 mvhi r13,0x802
80050e4: 39 ad 41 68 ori r13,r13,0x4168
80050e8: b9 a0 08 00 mv r1,r13
80050ec: f8 00 07 f9 calli 80070d0 <_Objects_Allocate>
80050f0: b8 20 58 00 mv r11,r1
_Thread_Disable_dispatch(); /* prevents deletion */
the_partition = _Partition_Allocate();
if ( !the_partition ) {
80050f4: 5c 32 00 04 bne r1,r18,8005104 <rtems_partition_create+0xbc>
_Thread_Enable_dispatch();
80050f8: f8 00 0d 97 calli 8008754 <_Thread_Enable_dispatch>
return RTEMS_TOO_MANY;
80050fc: 34 07 00 05 mvi r7,5
8005100: e0 00 00 1a bi 8005168 <rtems_partition_create+0x120>
}
#endif
the_partition->starting_address = starting_address;
the_partition->length = length;
the_partition->buffer_size = buffer_size;
8005104: 58 2c 00 18 sw (r1+24),r12
the_partition->attribute_set = attribute_set;
the_partition->number_of_used_blocks = 0;
_Chain_Initialize( &the_partition->Memory, starting_address,
length / buffer_size, buffer_size );
8005108: b9 80 10 00 mv r2,r12
_Thread_Enable_dispatch();
return RTEMS_TOO_MANY;
}
#endif
the_partition->starting_address = starting_address;
800510c: 58 2e 00 10 sw (r1+16),r14
the_partition->length = length;
8005110: 58 2f 00 14 sw (r1+20),r15
the_partition->buffer_size = buffer_size;
the_partition->attribute_set = attribute_set;
8005114: 58 33 00 1c sw (r1+28),r19
the_partition->number_of_used_blocks = 0;
8005118: 58 20 00 20 sw (r1+32),r0
_Chain_Initialize( &the_partition->Memory, starting_address,
800511c: 34 32 00 24 addi r18,r1,36
length / buffer_size, buffer_size );
8005120: b9 e0 08 00 mv r1,r15
8005124: f8 00 63 0c calli 801dd54 <__udivsi3>
8005128: b8 20 18 00 mv r3,r1
the_partition->length = length;
the_partition->buffer_size = buffer_size;
the_partition->attribute_set = attribute_set;
the_partition->number_of_used_blocks = 0;
_Chain_Initialize( &the_partition->Memory, starting_address,
800512c: b9 80 20 00 mv r4,r12
8005130: ba 40 08 00 mv r1,r18
8005134: b9 c0 10 00 mv r2,r14
8005138: f8 00 04 e3 calli 80064c4 <_Chain_Initialize>
Objects_Name name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
800513c: 29 6c 00 08 lw r12,(r11+8)
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8005140: 29 ad 00 1c lw r13,(r13+28)
8005144: 34 02 00 02 mvi r2,2
8005148: 21 81 ff ff andi r1,r12,0xffff
800514c: fb ff ee b4 calli 8000c1c <__ashlsi3>
8005150: b5 a1 08 00 add r1,r13,r1
8005154: 58 2b 00 00 sw (r1+0),r11
information,
_Objects_Get_index( the_object->id ),
the_object
);
the_object->name = name;
8005158: 59 71 00 0c sw (r11+12),r17
&_Partition_Information,
&the_partition->Object,
(Objects_Name) name
);
*id = the_partition->Object.id;
800515c: 5a 0c 00 00 sw (r16+0),r12
name,
0 /* Not used */
);
#endif
_Thread_Enable_dispatch();
8005160: f8 00 0d 7d calli 8008754 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8005164: 34 07 00 00 mvi r7,0
}
8005168: b8 e0 08 00 mv r1,r7
800516c: 2b 9d 00 04 lw ra,(sp+4)
8005170: 2b 8b 00 28 lw r11,(sp+40)
8005174: 2b 8c 00 24 lw r12,(sp+36)
8005178: 2b 8d 00 20 lw r13,(sp+32)
800517c: 2b 8e 00 1c lw r14,(sp+28)
8005180: 2b 8f 00 18 lw r15,(sp+24)
8005184: 2b 90 00 14 lw r16,(sp+20)
8005188: 2b 91 00 10 lw r17,(sp+16)
800518c: 2b 92 00 0c lw r18,(sp+12)
8005190: 2b 93 00 08 lw r19,(sp+8)
8005194: 37 9c 00 28 addi sp,sp,40
8005198: c3 a0 00 00 ret
08034644 <rtems_rate_monotonic_period>:
rtems_status_code rtems_rate_monotonic_period(
rtems_id id,
rtems_interval length
)
{
8034644: 37 9c ff e8 addi sp,sp,-24
8034648: 5b 8b 00 14 sw (sp+20),r11
803464c: 5b 8c 00 10 sw (sp+16),r12
8034650: 5b 8d 00 0c sw (sp+12),r13
8034654: 5b 8e 00 08 sw (sp+8),r14
8034658: 5b 9d 00 04 sw (sp+4),ra
803465c: b8 20 60 00 mv r12,r1
8034660: 78 01 08 06 mvhi r1,0x806
8034664: b8 40 68 00 mv r13,r2
8034668: 38 21 ab 30 ori r1,r1,0xab30
803466c: b9 80 10 00 mv r2,r12
8034670: 37 83 00 18 addi r3,sp,24
8034674: fb ff 41 8e calli 8004cac <_Objects_Get>
8034678: b8 20 58 00 mv r11,r1
rtems_rate_monotonic_period_states local_state;
ISR_Level level;
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
803467c: 2b 81 00 18 lw r1,(sp+24)
8034680: 5c 20 00 65 bne r1,r0,8034814 <rtems_rate_monotonic_period+0x1d0>
RTEMS_INLINE_ROUTINE bool _Thread_Is_executing (
const Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Executing );
8034684: 78 03 08 06 mvhi r3,0x806
8034688: 38 63 a5 00 ori r3,r3,0xa500
case OBJECTS_LOCAL:
if ( !_Thread_Is_executing( the_period->owner ) ) {
803468c: 29 62 00 40 lw r2,(r11+64)
8034690: 28 61 00 10 lw r1,(r3+16)
8034694: 44 41 00 04 be r2,r1,80346a4 <rtems_rate_monotonic_period+0x60>
_Thread_Enable_dispatch();
8034698: fb ff 45 4e calli 8005bd0 <_Thread_Enable_dispatch>
return RTEMS_NOT_OWNER_OF_RESOURCE;
803469c: 34 0c 00 17 mvi r12,23
80346a0: e0 00 00 5e bi 8034818 <rtems_rate_monotonic_period+0x1d4>
}
if ( length == RTEMS_PERIOD_STATUS ) {
80346a4: 5d a0 00 0d bne r13,r0,80346d8 <rtems_rate_monotonic_period+0x94>
switch ( the_period->state ) {
80346a8: 29 61 00 38 lw r1,(r11+56)
80346ac: 34 02 00 04 mvi r2,4
80346b0: 34 0c 00 00 mvi r12,0
80346b4: 54 22 00 07 bgu r1,r2,80346d0 <rtems_rate_monotonic_period+0x8c><== NEVER TAKEN
80346b8: 78 0b 08 06 mvhi r11,0x806
80346bc: 34 02 00 02 mvi r2,2
80346c0: fb ff 2e ce calli 80001f8 <__ashlsi3>
80346c4: 39 6b 27 44 ori r11,r11,0x2744
80346c8: b5 61 08 00 add r1,r11,r1
80346cc: 28 2c 00 00 lw r12,(r1+0)
case RATE_MONOTONIC_ACTIVE:
default: /* unreached -- only to remove warnings */
return_value = RTEMS_SUCCESSFUL;
break;
}
_Thread_Enable_dispatch();
80346d0: fb ff 45 40 calli 8005bd0 <_Thread_Enable_dispatch>
return( return_value );
80346d4: e0 00 00 51 bi 8034818 <rtems_rate_monotonic_period+0x1d4>
}
_ISR_Disable( level );
80346d8: 90 00 70 00 rcsr r14,IE
80346dc: 34 01 ff fe mvi r1,-2
80346e0: a1 c1 08 00 and r1,r14,r1
80346e4: d0 01 00 00 wcsr IE,r1
if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {
80346e8: 29 63 00 38 lw r3,(r11+56)
80346ec: 5c 60 00 13 bne r3,r0,8034738 <rtems_rate_monotonic_period+0xf4>
_ISR_Enable( level );
80346f0: d0 0e 00 00 wcsr IE,r14
the_period->next_length = length;
/*
* Baseline statistics information for the beginning of a period.
*/
_Rate_monotonic_Initiate_statistics( the_period );
80346f4: b9 60 08 00 mv r1,r11
_ISR_Disable( level );
if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {
_ISR_Enable( level );
the_period->next_length = length;
80346f8: 59 6d 00 3c sw (r11+60),r13
/*
* Baseline statistics information for the beginning of a period.
*/
_Rate_monotonic_Initiate_statistics( the_period );
80346fc: fb ff ff a5 calli 8034590 <_Rate_monotonic_Initiate_statistics>
the_period->state = RATE_MONOTONIC_ACTIVE;
8034700: 34 01 00 02 mvi r1,2
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
8034704: 78 03 08 03 mvhi r3,0x803
8034708: 59 61 00 38 sw (r11+56),r1
803470c: 38 63 48 38 ori r3,r3,0x4838
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8034710: 78 01 08 06 mvhi r1,0x806
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8034714: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
8034718: 59 63 00 2c sw (r11+44),r3
the_watchdog->id = id;
803471c: 59 6c 00 30 sw (r11+48),r12
the_watchdog->user_data = user_data;
8034720: 59 60 00 34 sw (r11+52),r0
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8034724: 59 6d 00 1c sw (r11+28),r13
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8034728: 38 21 a0 f8 ori r1,r1,0xa0f8
803472c: 35 62 00 10 addi r2,r11,16
8034730: fb ff 48 de calli 8006aa8 <_Watchdog_Insert>
8034734: e0 00 00 1f bi 80347b0 <rtems_rate_monotonic_period+0x16c>
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
if ( the_period->state == RATE_MONOTONIC_ACTIVE ) {
8034738: 34 01 00 02 mvi r1,2
803473c: 5c 61 00 20 bne r3,r1,80347bc <rtems_rate_monotonic_period+0x178>
/*
* Update statistics from the concluding period.
*/
_Rate_monotonic_Update_statistics( the_period );
8034740: b9 60 08 00 mv r1,r11
8034744: fb ff ff 49 calli 8034468 <_Rate_monotonic_Update_statistics>
/*
* This tells the _Rate_monotonic_Timeout that this task is
* in the process of blocking on the period and that we
* may be changing the length of the next period.
*/
the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING;
8034748: 34 01 00 01 mvi r1,1
803474c: 59 61 00 38 sw (r11+56),r1
the_period->next_length = length;
8034750: 59 6d 00 3c sw (r11+60),r13
_ISR_Enable( level );
8034754: d0 0e 00 00 wcsr IE,r14
_Thread_Executing->Wait.id = the_period->Object.id;
8034758: 78 01 08 06 mvhi r1,0x806
803475c: 38 21 a5 00 ori r1,r1,0xa500
8034760: 29 62 00 08 lw r2,(r11+8)
8034764: 28 21 00 10 lw r1,(r1+16)
8034768: 58 22 00 20 sw (r1+32),r2
_Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
803476c: 34 02 40 00 mvi r2,16384
8034770: fb ff 47 ba calli 8006658 <_Thread_Set_state>
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
8034774: 90 00 08 00 rcsr r1,IE
8034778: 34 02 ff fe mvi r2,-2
803477c: a0 22 10 00 and r2,r1,r2
8034780: d0 02 00 00 wcsr IE,r2
local_state = the_period->state;
the_period->state = RATE_MONOTONIC_ACTIVE;
8034784: 34 03 00 02 mvi r3,2
/*
* Did the watchdog timer expire while we were actually blocking
* on it?
*/
_ISR_Disable( level );
local_state = the_period->state;
8034788: 29 62 00 38 lw r2,(r11+56)
the_period->state = RATE_MONOTONIC_ACTIVE;
803478c: 59 63 00 38 sw (r11+56),r3
_ISR_Enable( level );
8034790: d0 01 00 00 wcsr IE,r1
/*
* If it did, then we want to unblock ourself and continue as
* if nothing happen. The period was reset in the timeout routine.
*/
if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING )
8034794: 34 01 00 03 mvi r1,3
8034798: 5c 41 00 06 bne r2,r1,80347b0 <rtems_rate_monotonic_period+0x16c>
_Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD );
803479c: 78 01 08 06 mvhi r1,0x806
80347a0: 38 21 a5 00 ori r1,r1,0xa500
80347a4: 28 21 00 10 lw r1,(r1+16)
80347a8: 34 02 40 00 mvi r2,16384
80347ac: fb ff 62 42 calli 800d0b4 <_Thread_Clear_state>
_Thread_Enable_dispatch();
80347b0: fb ff 45 08 calli 8005bd0 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
80347b4: 34 0c 00 00 mvi r12,0
80347b8: e0 00 00 18 bi 8034818 <rtems_rate_monotonic_period+0x1d4>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
80347bc: 34 0c 00 04 mvi r12,4
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}
if ( the_period->state == RATE_MONOTONIC_EXPIRED ) {
80347c0: 5c 6c 00 16 bne r3,r12,8034818 <rtems_rate_monotonic_period+0x1d4><== NEVER TAKEN
/*
* Update statistics from the concluding period
*/
_Rate_monotonic_Update_statistics( the_period );
80347c4: b9 60 08 00 mv r1,r11
80347c8: fb ff ff 28 calli 8034468 <_Rate_monotonic_Update_statistics>
_ISR_Enable( level );
80347cc: d0 0e 00 00 wcsr IE,r14
the_period->state = RATE_MONOTONIC_ACTIVE;
80347d0: 34 01 00 02 mvi r1,2
80347d4: 59 61 00 38 sw (r11+56),r1
80347d8: 78 01 08 06 mvhi r1,0x806
80347dc: 38 21 a0 f8 ori r1,r1,0xa0f8
80347e0: 35 62 00 10 addi r2,r11,16
the_period->next_length = length;
80347e4: 59 6d 00 3c sw (r11+60),r13
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
80347e8: 59 6d 00 1c sw (r11+28),r13
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
80347ec: fb ff 48 af calli 8006aa8 <_Watchdog_Insert>
80347f0: 78 01 08 06 mvhi r1,0x806
80347f4: 38 21 60 18 ori r1,r1,0x6018
80347f8: 28 23 00 34 lw r3,(r1+52)
80347fc: 29 62 00 3c lw r2,(r11+60)
8034800: 29 61 00 40 lw r1,(r11+64)
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Scheduler_Release_job(the_period->owner, the_period->next_length);
_Thread_Enable_dispatch();
return RTEMS_TIMEOUT;
8034804: 34 0c 00 06 mvi r12,6
8034808: d8 60 00 00 call r3
the_period->state = RATE_MONOTONIC_ACTIVE;
the_period->next_length = length;
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Scheduler_Release_job(the_period->owner, the_period->next_length);
_Thread_Enable_dispatch();
803480c: fb ff 44 f1 calli 8005bd0 <_Thread_Enable_dispatch>
return RTEMS_TIMEOUT;
8034810: e0 00 00 02 bi 8034818 <rtems_rate_monotonic_period+0x1d4>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8034814: 34 0c 00 04 mvi r12,4
}
8034818: b9 80 08 00 mv r1,r12
803481c: 2b 9d 00 04 lw ra,(sp+4)
8034820: 2b 8b 00 14 lw r11,(sp+20)
8034824: 2b 8c 00 10 lw r12,(sp+16)
8034828: 2b 8d 00 0c lw r13,(sp+12)
803482c: 2b 8e 00 08 lw r14,(sp+8)
8034830: 37 9c 00 18 addi sp,sp,24
8034834: c3 a0 00 00 ret
08025f28 <rtems_rate_monotonic_report_statistics_with_plugin>:
void rtems_rate_monotonic_report_statistics_with_plugin(
void *context,
rtems_printk_plugin_t print
)
{
8025f28: 37 9c ff 5c addi sp,sp,-164
8025f2c: 5b 8b 00 44 sw (sp+68),r11
8025f30: 5b 8c 00 40 sw (sp+64),r12
8025f34: 5b 8d 00 3c sw (sp+60),r13
8025f38: 5b 8e 00 38 sw (sp+56),r14
8025f3c: 5b 8f 00 34 sw (sp+52),r15
8025f40: 5b 90 00 30 sw (sp+48),r16
8025f44: 5b 91 00 2c sw (sp+44),r17
8025f48: 5b 92 00 28 sw (sp+40),r18
8025f4c: 5b 93 00 24 sw (sp+36),r19
8025f50: 5b 94 00 20 sw (sp+32),r20
8025f54: 5b 95 00 1c sw (sp+28),r21
8025f58: 5b 96 00 18 sw (sp+24),r22
8025f5c: 5b 97 00 14 sw (sp+20),r23
8025f60: 5b 98 00 10 sw (sp+16),r24
8025f64: 5b 99 00 0c sw (sp+12),r25
8025f68: 5b 9b 00 08 sw (sp+8),fp
8025f6c: 5b 9d 00 04 sw (sp+4),ra
8025f70: b8 20 60 00 mv r12,r1
8025f74: b8 40 58 00 mv r11,r2
rtems_id id;
rtems_rate_monotonic_period_statistics the_stats;
rtems_rate_monotonic_period_status the_status;
char name[5];
if ( !print )
8025f78: 44 40 00 72 be r2,r0,8026140 <rtems_rate_monotonic_report_statistics_with_plugin+0x218><== NEVER TAKEN
return;
(*print)( context, "Period information by period\n" );
8025f7c: 78 02 08 05 mvhi r2,0x805
8025f80: 38 42 f8 48 ori r2,r2,0xf848
8025f84: d9 60 00 00 call r11
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
(*print)( context, "--- CPU times are in seconds ---\n" );
8025f88: 78 02 08 05 mvhi r2,0x805
8025f8c: 38 42 f8 68 ori r2,r2,0xf868
8025f90: b9 80 08 00 mv r1,r12
8025f94: d9 60 00 00 call r11
(*print)( context, "--- Wall times are in seconds ---\n" );
8025f98: 78 02 08 05 mvhi r2,0x805
8025f9c: 38 42 f8 8c ori r2,r2,0xf88c
8025fa0: b9 80 08 00 mv r1,r12
8025fa4: d9 60 00 00 call r11
Be sure to test the various cases.
(*print)( context,"\
1234567890123456789012345678901234567890123456789012345678901234567890123456789\
\n");
*/
(*print)( context, " ID OWNER COUNT MISSED "
8025fa8: 78 02 08 05 mvhi r2,0x805
8025fac: 38 42 f8 b0 ori r2,r2,0xf8b0
8025fb0: b9 80 08 00 mv r1,r12
8025fb4: d9 60 00 00 call r11
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
" "
#endif
" WALL TIME\n"
);
(*print)( context, " "
8025fb8: 78 02 08 05 mvhi r2,0x805
8025fbc: b9 80 08 00 mv r1,r12
8025fc0: 38 42 f8 fc ori r2,r2,0xf8fc
8025fc4: d9 60 00 00 call r11
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
8025fc8: 78 01 08 06 mvhi r1,0x806
8025fcc: 38 21 ab 30 ori r1,r1,0xab30
rtems_object_get_name( the_status.owner, sizeof(name), name );
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
8025fd0: 78 11 08 05 mvhi r17,0x805
struct timespec *min_cpu = &the_stats.min_cpu_time;
struct timespec *max_cpu = &the_stats.max_cpu_time;
struct timespec *total_cpu = &the_stats.total_cpu_time;
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
(*print)( context,
8025fd4: 78 10 08 05 mvhi r16,0x805
struct timespec *min_wall = &the_stats.min_wall_time;
struct timespec *max_wall = &the_stats.max_wall_time;
struct timespec *total_wall = &the_stats.total_wall_time;
_Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
(*print)( context,
8025fd8: 78 0f 08 05 mvhi r15,0x805
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
8025fdc: 78 0e 08 06 mvhi r14,0x806
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
8025fe0: 28 2d 00 08 lw r13,(r1+8)
id <= _Rate_monotonic_Information.maximum_id ;
8025fe4: b8 20 a0 00 mv r20,r1
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
8025fe8: 37 99 00 48 addi r25,sp,72
#if defined(RTEMS_DEBUG)
status = rtems_rate_monotonic_get_status( id, &the_status );
if ( status != RTEMS_SUCCESSFUL )
continue;
#else
(void) rtems_rate_monotonic_get_status( id, &the_status );
8025fec: 37 98 00 80 addi r24,sp,128
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
8025ff0: 37 93 00 a0 addi r19,sp,160
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
8025ff4: 3a 31 f9 48 ori r17,r17,0xf948
{
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
struct timespec cpu_average;
struct timespec *min_cpu = &the_stats.min_cpu_time;
struct timespec *max_cpu = &the_stats.max_cpu_time;
struct timespec *total_cpu = &the_stats.total_cpu_time;
8025ff8: 37 97 00 60 addi r23,sp,96
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
8025ffc: 37 92 00 98 addi r18,sp,152
(*print)( context,
8026000: 3a 10 f9 60 ori r16,r16,0xf960
{
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
struct timespec wall_average;
struct timespec *min_wall = &the_stats.min_wall_time;
struct timespec *max_wall = &the_stats.max_wall_time;
struct timespec *total_wall = &the_stats.total_wall_time;
8026004: 37 96 00 78 addi r22,sp,120
_Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
(*print)( context,
8026008: 39 ef f9 80 ori r15,r15,0xf980
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
(*print)( context, "\n" );
802600c: 39 ce 10 00 ori r14,r14,0x1000
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
8026010: e0 00 00 4a bi 8026138 <rtems_rate_monotonic_report_statistics_with_plugin+0x210>
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
status = rtems_rate_monotonic_get_statistics( id, &the_stats );
8026014: b9 a0 08 00 mv r1,r13
8026018: bb 20 10 00 mv r2,r25
802601c: f8 00 37 f8 calli 8033ffc <rtems_rate_monotonic_get_statistics>
8026020: b8 20 a8 00 mv r21,r1
if ( status != RTEMS_SUCCESSFUL )
8026024: 5c 20 00 44 bne r1,r0,8026134 <rtems_rate_monotonic_report_statistics_with_plugin+0x20c>
#if defined(RTEMS_DEBUG)
status = rtems_rate_monotonic_get_status( id, &the_status );
if ( status != RTEMS_SUCCESSFUL )
continue;
#else
(void) rtems_rate_monotonic_get_status( id, &the_status );
8026028: bb 00 10 00 mv r2,r24
802602c: b9 a0 08 00 mv r1,r13
8026030: f8 00 38 80 calli 8034230 <rtems_rate_monotonic_get_status>
#endif
rtems_object_get_name( the_status.owner, sizeof(name), name );
8026034: 2b 81 00 80 lw r1,(sp+128)
8026038: 34 02 00 05 mvi r2,5
802603c: ba 60 18 00 mv r3,r19
8026040: fb ff 98 8e calli 800c278 <rtems_object_get_name>
/*
* Print part of report line that is not dependent on granularity
*/
(*print)( context,
8026044: 2b 85 00 48 lw r5,(sp+72)
8026048: 2b 86 00 4c lw r6,(sp+76)
802604c: ba 20 10 00 mv r2,r17
8026050: b9 80 08 00 mv r1,r12
8026054: b9 a0 18 00 mv r3,r13
8026058: ba 60 20 00 mv r4,r19
802605c: d9 60 00 00 call r11
);
/*
* If the count is zero, don't print statistics
*/
if (the_stats.count == 0) {
8026060: 2b 82 00 48 lw r2,(sp+72)
8026064: 5c 55 00 05 bne r2,r21,8026078 <rtems_rate_monotonic_report_statistics_with_plugin+0x150>
(*print)( context, "\n" );
8026068: b9 80 08 00 mv r1,r12
802606c: b9 c0 10 00 mv r2,r14
8026070: d9 60 00 00 call r11
continue;
8026074: e0 00 00 30 bi 8026134 <rtems_rate_monotonic_report_statistics_with_plugin+0x20c>
struct timespec cpu_average;
struct timespec *min_cpu = &the_stats.min_cpu_time;
struct timespec *max_cpu = &the_stats.max_cpu_time;
struct timespec *total_cpu = &the_stats.total_cpu_time;
_Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average );
8026078: ba 40 18 00 mv r3,r18
802607c: ba e0 08 00 mv r1,r23
8026080: f8 00 04 c0 calli 8027380 <_Timespec_Divide_by_integer>
(*print)( context,
8026084: 2b 81 00 54 lw r1,(sp+84)
8026088: 34 02 03 e8 mvi r2,1000
802608c: f8 00 c9 93 calli 80586d8 <__divsi3>
8026090: b8 20 d8 00 mv fp,r1
8026094: 2b 81 00 5c lw r1,(sp+92)
8026098: 34 02 03 e8 mvi r2,1000
802609c: f8 00 c9 8f calli 80586d8 <__divsi3>
80260a0: b8 20 a8 00 mv r21,r1
80260a4: 2b 81 00 9c lw r1,(sp+156)
80260a8: 34 02 03 e8 mvi r2,1000
80260ac: f8 00 c9 8b calli 80586d8 <__divsi3>
80260b0: 2b 85 00 58 lw r5,(sp+88)
80260b4: 2b 87 00 98 lw r7,(sp+152)
80260b8: 2b 83 00 50 lw r3,(sp+80)
80260bc: b8 20 40 00 mv r8,r1
80260c0: bb 60 20 00 mv r4,fp
80260c4: ba a0 30 00 mv r6,r21
80260c8: ba 00 10 00 mv r2,r16
80260cc: b9 80 08 00 mv r1,r12
80260d0: d9 60 00 00 call r11
struct timespec wall_average;
struct timespec *min_wall = &the_stats.min_wall_time;
struct timespec *max_wall = &the_stats.max_wall_time;
struct timespec *total_wall = &the_stats.total_wall_time;
_Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average);
80260d4: 2b 82 00 48 lw r2,(sp+72)
80260d8: ba 40 18 00 mv r3,r18
80260dc: ba c0 08 00 mv r1,r22
80260e0: f8 00 04 a8 calli 8027380 <_Timespec_Divide_by_integer>
(*print)( context,
80260e4: 2b 81 00 6c lw r1,(sp+108)
80260e8: 34 02 03 e8 mvi r2,1000
80260ec: f8 00 c9 7b calli 80586d8 <__divsi3>
80260f0: b8 20 d8 00 mv fp,r1
80260f4: 2b 81 00 74 lw r1,(sp+116)
80260f8: 34 02 03 e8 mvi r2,1000
80260fc: f8 00 c9 77 calli 80586d8 <__divsi3>
8026100: b8 20 a8 00 mv r21,r1
8026104: 2b 81 00 9c lw r1,(sp+156)
8026108: 34 02 03 e8 mvi r2,1000
802610c: f8 00 c9 73 calli 80586d8 <__divsi3>
8026110: 2b 83 00 68 lw r3,(sp+104)
8026114: 2b 85 00 70 lw r5,(sp+112)
8026118: 2b 87 00 98 lw r7,(sp+152)
802611c: b8 20 40 00 mv r8,r1
8026120: b9 e0 10 00 mv r2,r15
8026124: b9 80 08 00 mv r1,r12
8026128: bb 60 20 00 mv r4,fp
802612c: ba a0 30 00 mv r6,r21
8026130: d9 60 00 00 call r11
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
id <= _Rate_monotonic_Information.maximum_id ;
id++ ) {
8026134: 35 ad 00 01 addi r13,r13,1
/*
* Cycle through all possible ids and try to report on each one. If it
* is a period that is inactive, we just get an error back. No big deal.
*/
for ( id=_Rate_monotonic_Information.minimum_id ;
8026138: 2a 81 00 0c lw r1,(r20+12)
802613c: 50 2d ff b6 bgeu r1,r13,8026014 <rtems_rate_monotonic_report_statistics_with_plugin+0xec>
the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall
);
#endif
}
}
}
8026140: 2b 9d 00 04 lw ra,(sp+4)
8026144: 2b 8b 00 44 lw r11,(sp+68)
8026148: 2b 8c 00 40 lw r12,(sp+64)
802614c: 2b 8d 00 3c lw r13,(sp+60)
8026150: 2b 8e 00 38 lw r14,(sp+56)
8026154: 2b 8f 00 34 lw r15,(sp+52)
8026158: 2b 90 00 30 lw r16,(sp+48)
802615c: 2b 91 00 2c lw r17,(sp+44)
8026160: 2b 92 00 28 lw r18,(sp+40)
8026164: 2b 93 00 24 lw r19,(sp+36)
8026168: 2b 94 00 20 lw r20,(sp+32)
802616c: 2b 95 00 1c lw r21,(sp+28)
8026170: 2b 96 00 18 lw r22,(sp+24)
8026174: 2b 97 00 14 lw r23,(sp+20)
8026178: 2b 98 00 10 lw r24,(sp+16)
802617c: 2b 99 00 0c lw r25,(sp+12)
8026180: 2b 9b 00 08 lw fp,(sp+8)
8026184: 37 9c 00 a4 addi sp,sp,164
8026188: c3 a0 00 00 ret
08004720 <rtems_rbheap_allocate>:
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
8004720: 37 9c ff e8 addi sp,sp,-24
8004724: 5b 8b 00 18 sw (sp+24),r11
8004728: 5b 8c 00 14 sw (sp+20),r12
800472c: 5b 8d 00 10 sw (sp+16),r13
8004730: 5b 8e 00 0c sw (sp+12),r14
8004734: 5b 8f 00 08 sw (sp+8),r15
8004738: 5b 9d 00 04 sw (sp+4),ra
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;
800473c: 28 2d 00 30 lw r13,(r1+48)
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
8004740: b8 40 60 00 mv r12,r2
8004744: b8 20 58 00 mv r11,r1
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
8004748: b8 40 08 00 mv r1,r2
800474c: b9 a0 10 00 mv r2,r13
8004750: f8 00 3c d8 calli 8013ab0 <__umodsi3>
if (excess > 0) {
8004754: b9 80 70 00 mv r14,r12
8004758: 44 20 00 03 be r1,r0,8004764 <rtems_rbheap_allocate+0x44> <== ALWAYS TAKEN
value += alignment - excess;
800475c: b5 8d 70 00 add r14,r12,r13 <== NOT EXECUTED
8004760: c9 c1 70 00 sub r14,r14,r1 <== 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) {
8004764: f1 cc 08 00 cmpgeu r1,r14,r12
8004768: 7d 8c 00 00 cmpnei r12,r12,0
800476c: a0 2c 60 00 and r12,r1,r12
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
8004770: 34 01 00 00 mvi r1,0
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
8004774: 45 80 00 3b be r12,r0,8004860 <rtems_rbheap_allocate+0x140>
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
if (chunk != NULL) {
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
8004778: 29 61 00 00 lw r1,(r11+0)
rtems_chain_control *free_chain,
size_t size
)
{
rtems_chain_node *current = rtems_chain_first(free_chain);
const rtems_chain_node *tail = rtems_chain_tail(free_chain);
800477c: 35 63 00 04 addi r3,r11,4
rtems_rbheap_chunk *big_enough = NULL;
8004780: 34 0c 00 00 mvi r12,0
8004784: e0 00 00 06 bi 800479c <rtems_rbheap_allocate+0x7c>
while (current != tail && big_enough == NULL) {
rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current;
if (free_chunk->size >= size) {
8004788: 28 2c 00 1c lw r12,(r1+28)
800478c: f1 8e 60 00 cmpgeu r12,r12,r14
8004790: c8 0c 60 00 sub r12,r0,r12
8004794: a0 2c 60 00 and r12,r1,r12
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
if (chunk != NULL) {
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
8004798: 28 21 00 00 lw r1,(r1+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) {
800479c: 65 84 00 00 cmpei r4,r12,0
80047a0: fc 23 10 00 cmpne r2,r1,r3
80047a4: a0 82 10 00 and r2,r4,r2
80047a8: 5c 40 ff f8 bne r2,r0,8004788 <rtems_rbheap_allocate+0x68>
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
80047ac: 34 01 00 00 mvi r1,0
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) {
80047b0: 45 82 00 2c be r12,r2,8004860 <rtems_rbheap_allocate+0x140>
uintptr_t free_size = free_chunk->size;
80047b4: 29 8f 00 1c lw r15,(r12+28)
if (free_size > aligned_size) {
80047b8: 51 cf 00 21 bgeu r14,r15,800483c <rtems_rbheap_allocate+0x11c>
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
if (chunk != NULL) {
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
80047bc: 29 6d 00 0c lw r13,(r11+12)
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
80047c0: 35 61 00 10 addi r1,r11,16
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
80047c4: 45 a1 00 06 be r13,r1,80047dc <rtems_rbheap_allocate+0xbc> <== NEVER TAKEN
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
80047c8: 29 a1 00 00 lw r1,(r13+0)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
80047cc: 35 62 00 0c addi r2,r11,12
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
80047d0: 59 61 00 0c sw (r11+12),r1
new_first->previous = head;
80047d4: 58 22 00 04 sw (r1+4),r2
80047d8: e0 00 00 0b bi 8004804 <rtems_rbheap_allocate+0xe4>
{
rtems_chain_control *chain = &control->spare_descriptor_chain;
rtems_chain_node *chunk = rtems_chain_get_unprotected(chain);
if (chunk == NULL) {
(*control->extend_descriptors)(control);
80047dc: 29 62 00 34 lw r2,(r11+52) <== NOT EXECUTED
80047e0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
80047e4: d8 40 00 00 call r2 <== NOT EXECUTED
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
if (chunk != NULL) {
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
80047e8: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
80047ec: 44 2d 00 1c be r1,r13,800485c <rtems_rbheap_allocate+0x13c><== 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;
80047f0: 28 22 00 00 lw r2,(r1+0) <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
80047f4: 35 63 00 0c addi r3,r11,12 <== NOT EXECUTED
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
new_first->previous = head;
80047f8: b8 20 68 00 mv r13,r1 <== 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;
80047fc: 59 62 00 0c sw (r11+12),r2 <== NOT EXECUTED
new_first->previous = head;
8004800: 58 43 00 04 sw (r2+4),r3 <== NOT EXECUTED
uintptr_t free_size = free_chunk->size;
if (free_size > aligned_size) {
rtems_rbheap_chunk *new_chunk = get_chunk(control);
if (new_chunk != NULL) {
8004804: 45 a0 00 16 be r13,r0,800485c <rtems_rbheap_allocate+0x13c><== NEVER TAKEN
uintptr_t new_free_size = free_size - aligned_size;
free_chunk->size = new_free_size;
new_chunk->begin = free_chunk->begin + new_free_size;
8004808: 29 82 00 18 lw r2,(r12+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;
800480c: c9 ee 08 00 sub r1,r15,r14
free_chunk->size = new_free_size;
8004810: 59 81 00 1c sw (r12+28),r1
new_chunk->begin = free_chunk->begin + new_free_size;
8004814: b4 22 08 00 add r1,r1,r2
8004818: 59 a1 00 18 sw (r13+24),r1
new_chunk->size = aligned_size;
800481c: 59 ae 00 1c sw (r13+28),r14
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
8004820: 59 a0 00 04 sw (r13+4),r0
8004824: 59 a0 00 00 sw (r13+0),r0
static void insert_into_tree(
rtems_rbtree_control *tree,
rtems_rbheap_chunk *chunk
)
{
_RBTree_Insert_unprotected(tree, &chunk->tree_node);
8004828: 35 61 00 18 addi r1,r11,24
800482c: 35 a2 00 08 addi r2,r13,8
8004830: f8 00 07 6f calli 80065ec <_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;
8004834: 29 a1 00 18 lw r1,(r13+24)
8004838: e0 00 00 0a bi 8004860 <rtems_rbheap_allocate+0x140>
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
800483c: 29 81 00 04 lw r1,(r12+4)
)
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
8004840: 29 82 00 00 lw r2,(r12+0)
previous = the_node->previous;
next->previous = previous;
8004844: 58 41 00 04 sw (r2+4),r1
previous->next = next;
8004848: 58 22 00 00 sw (r1+0),r2
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
800484c: 59 80 00 04 sw (r12+4),r0
8004850: 59 80 00 00 sw (r12+0),r0
}
} else {
rtems_chain_extract_unprotected(&free_chunk->chain_node);
rtems_chain_set_off_chain(&free_chunk->chain_node);
ptr = (void *) free_chunk->begin;
8004854: 29 81 00 18 lw r1,(r12+24)
8004858: e0 00 00 02 bi 8004860 <rtems_rbheap_allocate+0x140>
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
800485c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
}
}
}
return ptr;
}
8004860: 2b 9d 00 04 lw ra,(sp+4)
8004864: 2b 8b 00 18 lw r11,(sp+24)
8004868: 2b 8c 00 14 lw r12,(sp+20)
800486c: 2b 8d 00 10 lw r13,(sp+16)
8004870: 2b 8e 00 0c lw r14,(sp+12)
8004874: 2b 8f 00 08 lw r15,(sp+8)
8004878: 37 9c 00 18 addi sp,sp,24
800487c: c3 a0 00 00 ret
080049bc <rtems_rbheap_extend_descriptors_with_malloc>:
void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control)
{
80049bc: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED
80049c0: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED
80049c4: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
80049c8: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
80049cc: 34 01 00 20 mvi r1,32 <== NOT EXECUTED
80049d0: fb ff f5 a0 calli 8002050 <malloc> <== NOT EXECUTED
if (chunk != NULL) {
80049d4: 44 20 00 07 be r1,r0,80049f0 <rtems_rbheap_extend_descriptors_with_malloc+0x34><== 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);
80049d8: 35 62 00 0c addi r2,r11,12 <== NOT EXECUTED
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
80049dc: 58 22 00 04 sw (r1+4),r2 <== NOT EXECUTED
before_node = after_node->next;
80049e0: 29 62 00 0c lw r2,(r11+12) <== NOT EXECUTED
after_node->next = the_node;
80049e4: 59 61 00 0c sw (r11+12),r1 <== NOT EXECUTED
the_node->next = before_node;
80049e8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
before_node->previous = the_node;
80049ec: 58 41 00 04 sw (r2+4),r1 <== NOT EXECUTED
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
80049f0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
80049f4: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED
80049f8: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED
80049fc: c3 a0 00 00 ret <== NOT EXECUTED
08004880 <rtems_rbheap_free>:
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
8004880: 37 9c ff c8 addi sp,sp,-56
8004884: 5b 8b 00 18 sw (sp+24),r11
8004888: 5b 8c 00 14 sw (sp+20),r12
800488c: 5b 8d 00 10 sw (sp+16),r13
8004890: 5b 8e 00 0c sw (sp+12),r14
8004894: 5b 8f 00 08 sw (sp+8),r15
8004898: 5b 9d 00 04 sw (sp+4),ra
800489c: b8 20 58 00 mv r11,r1
80048a0: b8 40 60 00 mv r12,r2
rtems_status_code sc = RTEMS_SUCCESSFUL;
80048a4: 34 01 00 00 mvi r1,0
if (ptr != NULL) {
80048a8: 44 40 00 3c be r2,r0,8004998 <rtems_rbheap_free+0x118>
#define NULL_PAGE rtems_rbheap_chunk_of_node(NULL)
static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key)
{
rtems_rbheap_chunk chunk = { .begin = key };
80048ac: 37 81 00 1c addi r1,sp,28
80048b0: 34 02 00 00 mvi r2,0
80048b4: 34 03 00 20 mvi r3,32
80048b8: f8 00 27 dd calli 800e82c <memset>
return rtems_rbheap_chunk_of_node(
80048bc: 37 8e 00 24 addi r14,sp,36
#define NULL_PAGE rtems_rbheap_chunk_of_node(NULL)
static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key)
{
rtems_rbheap_chunk chunk = { .begin = key };
80048c0: 5b 8c 00 34 sw (sp+52),r12
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
RBTree_Node* iter_node = the_rbtree->root;
80048c4: 29 6d 00 1c lw r13,(r11+28)
RBTree_Node* found = NULL;
80048c8: 34 0c 00 00 mvi r12,0
80048cc: e0 00 00 0e bi 8004904 <rtems_rbheap_free+0x84>
int compare_result;
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
80048d0: 29 63 00 28 lw r3,(r11+40)
80048d4: b9 c0 08 00 mv r1,r14
80048d8: b9 a0 10 00 mv r2,r13
80048dc: d8 60 00 00 call r3
if ( _RBTree_Is_equal( compare_result ) ) {
80048e0: 5c 20 00 04 bne r1,r0,80048f0 <rtems_rbheap_free+0x70>
found = iter_node;
if ( the_rbtree->is_unique )
80048e4: 41 62 00 2c lbu r2,(r11+44)
80048e8: 5c 41 00 09 bne r2,r1,800490c <rtems_rbheap_free+0x8c> <== ALWAYS TAKEN
80048ec: b9 a0 60 00 mv r12,r13 <== NOT EXECUTED
break;
}
RBTree_Direction dir =
(RBTree_Direction) _RBTree_Is_greater( compare_result );
iter_node = iter_node->child[dir];
80048f0: 68 21 00 00 cmpgi r1,r1,0
80048f4: 34 02 00 02 mvi r2,2
80048f8: fb ff f1 03 calli 8000d04 <__ashlsi3>
80048fc: b5 a1 68 00 add r13,r13,r1
8004900: 29 ad 00 04 lw r13,(r13+4)
)
{
RBTree_Node* iter_node = the_rbtree->root;
RBTree_Node* found = NULL;
int compare_result;
while (iter_node) {
8004904: 5d a0 ff f3 bne r13,r0,80048d0 <rtems_rbheap_free+0x50>
8004908: b9 80 68 00 mv r13,r12
if (ptr != NULL) {
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr);
if (chunk != NULL_PAGE) {
800490c: 35 ac ff f8 addi r12,r13,-8
check_and_merge(free_chain, chunk_tree, chunk, pred);
} else {
sc = RTEMS_INCORRECT_STATE;
}
} else {
sc = RTEMS_INVALID_ID;
8004910: 34 01 00 04 mvi r1,4
if (ptr != NULL) {
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr);
if (chunk != NULL_PAGE) {
8004914: 45 a0 00 21 be r13,r0,8004998 <rtems_rbheap_free+0x118>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
8004918: 29 a2 ff f8 lw r2,(r13+-8)
800491c: 34 01 00 00 mvi r1,0
8004920: 5c 40 00 03 bne r2,r0,800492c <rtems_rbheap_free+0xac>
add_to_chain(free_chain, b);
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
8004924: 29 81 00 04 lw r1,(r12+4)
8004928: 64 21 00 00 cmpei r1,r1,0
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr);
if (chunk != NULL_PAGE) {
if (!rtems_rbheap_is_chunk_free(chunk)) {
800492c: 18 22 00 01 xori r2,r1,0x1
check_and_merge(free_chain, chunk_tree, chunk, succ);
add_to_chain(free_chain, chunk);
check_and_merge(free_chain, chunk_tree, chunk, pred);
} else {
sc = RTEMS_INCORRECT_STATE;
8004930: 34 01 00 0e mvi r1,14
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr);
if (chunk != NULL_PAGE) {
if (!rtems_rbheap_is_chunk_free(chunk)) {
8004934: 5c 40 00 19 bne r2,r0,8004998 <rtems_rbheap_free+0x118>
static rtems_rbheap_chunk *get_next(
const rtems_rbheap_chunk *chunk,
RBTree_Direction dir
)
{
return rtems_rbheap_chunk_of_node(
8004938: 35 8e 00 08 addi r14,r12,8
800493c: b9 c0 08 00 mv r1,r14
8004940: f8 00 07 d0 calli 8006880 <_RBTree_Next_unprotected>
8004944: b8 20 78 00 mv r15,r1
8004948: 34 02 00 01 mvi r2,1
800494c: b9 c0 08 00 mv r1,r14
8004950: f8 00 07 cc calli 8006880 <_RBTree_Next_unprotected>
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (ptr != NULL) {
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
8004954: 35 6d 00 18 addi r13,r11,24
static rtems_rbheap_chunk *get_next(
const rtems_rbheap_chunk *chunk,
RBTree_Direction dir
)
{
return rtems_rbheap_chunk_of_node(
8004958: 34 24 ff f8 addi r4,r1,-8
if (chunk != NULL_PAGE) {
if (!rtems_rbheap_is_chunk_free(chunk)) {
rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT);
rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT);
check_and_merge(free_chain, chunk_tree, chunk, succ);
800495c: b9 a0 10 00 mv r2,r13
8004960: b9 60 08 00 mv r1,r11
8004964: b9 80 18 00 mv r3,r12
8004968: fb ff fe f0 calli 8004528 <check_and_merge>
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
800496c: 29 62 00 00 lw r2,(r11+0)
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
8004970: 59 8b 00 04 sw (r12+4),r11
before_node = after_node->next;
after_node->next = the_node;
8004974: 59 6c 00 00 sw (r11+0),r12
the_node->next = before_node;
8004978: 59 82 00 00 sw (r12+0),r2
before_node->previous = the_node;
800497c: 58 4c 00 04 sw (r2+4),r12
add_to_chain(free_chain, chunk);
check_and_merge(free_chain, chunk_tree, chunk, pred);
8004980: b9 60 08 00 mv r1,r11
8004984: b9 a0 10 00 mv r2,r13
8004988: b9 80 18 00 mv r3,r12
800498c: 35 e4 ff f8 addi r4,r15,-8
8004990: fb ff fe e6 calli 8004528 <check_and_merge>
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
8004994: 34 01 00 00 mvi r1,0
sc = RTEMS_INVALID_ID;
}
}
return sc;
}
8004998: 2b 9d 00 04 lw ra,(sp+4)
800499c: 2b 8b 00 18 lw r11,(sp+24)
80049a0: 2b 8c 00 14 lw r12,(sp+20)
80049a4: 2b 8d 00 10 lw r13,(sp+16)
80049a8: 2b 8e 00 0c lw r14,(sp+12)
80049ac: 2b 8f 00 08 lw r15,(sp+8)
80049b0: 37 9c 00 38 addi sp,sp,56
80049b4: c3 a0 00 00 ret
080045b8 <rtems_rbheap_initialize>:
uintptr_t area_size,
uintptr_t alignment,
rtems_rbheap_extend_descriptors extend_descriptors,
void *handler_arg
)
{
80045b8: 37 9c ff dc addi sp,sp,-36
80045bc: 5b 8b 00 24 sw (sp+36),r11
80045c0: 5b 8c 00 20 sw (sp+32),r12
80045c4: 5b 8d 00 1c sw (sp+28),r13
80045c8: 5b 8e 00 18 sw (sp+24),r14
80045cc: 5b 8f 00 14 sw (sp+20),r15
80045d0: 5b 90 00 10 sw (sp+16),r16
80045d4: 5b 91 00 0c sw (sp+12),r17
80045d8: 5b 92 00 08 sw (sp+8),r18
80045dc: 5b 9d 00 04 sw (sp+4),ra
}
} else {
sc = RTEMS_INVALID_ADDRESS;
}
} else {
sc = RTEMS_INVALID_NUMBER;
80045e0: 34 0f 00 0a mvi r15,10
uintptr_t area_size,
uintptr_t alignment,
rtems_rbheap_extend_descriptors extend_descriptors,
void *handler_arg
)
{
80045e4: b8 20 58 00 mv r11,r1
80045e8: b8 40 60 00 mv r12,r2
80045ec: b8 80 70 00 mv r14,r4
80045f0: b8 a0 88 00 mv r17,r5
80045f4: b8 c0 90 00 mv r18,r6
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (alignment > 0) {
80045f8: 44 80 00 3e be r4,r0,80046f0 <rtems_rbheap_initialize+0x138>
uintptr_t begin = (uintptr_t) area_begin;
uintptr_t end = begin + area_size;
80045fc: b4 43 80 00 add r16,r2,r3
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
8004600: b8 40 08 00 mv r1,r2
8004604: b8 80 10 00 mv r2,r4
8004608: f8 00 3d 2a calli 8013ab0 <__umodsi3>
if (excess > 0) {
800460c: b9 80 68 00 mv r13,r12
8004610: 44 20 00 03 be r1,r0,800461c <rtems_rbheap_initialize+0x64>
value += alignment - excess;
8004614: b5 8e 68 00 add r13,r12,r14
8004618: c9 a1 68 00 sub r13,r13,r1
uintptr_t begin = (uintptr_t) area_begin;
uintptr_t end = begin + area_size;
uintptr_t aligned_begin = align_up(alignment, begin);
uintptr_t aligned_end = align_down(alignment, end);
if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) {
800461c: f1 ac 08 00 cmpgeu r1,r13,r12
8004620: f6 0c 60 00 cmpgu r12,r16,r12
insert_into_tree(chunk_tree, first);
} else {
sc = RTEMS_NO_MEMORY;
}
} else {
sc = RTEMS_INVALID_ADDRESS;
8004624: 34 0f 00 09 mvi r15,9
uintptr_t begin = (uintptr_t) area_begin;
uintptr_t end = begin + area_size;
uintptr_t aligned_begin = align_up(alignment, begin);
uintptr_t aligned_end = align_down(alignment, end);
if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) {
8004628: a0 2c 60 00 and r12,r1,r12
800462c: 45 80 00 31 be r12,r0,80046f0 <rtems_rbheap_initialize+0x138>
return value;
}
static uintptr_t align_down(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
8004630: ba 00 08 00 mv r1,r16
8004634: b9 c0 10 00 mv r2,r14
8004638: f8 00 3d 1e calli 8013ab0 <__umodsi3>
return value - excess;
800463c: ca 01 80 00 sub r16,r16,r1
uintptr_t begin = (uintptr_t) area_begin;
uintptr_t end = begin + area_size;
uintptr_t aligned_begin = align_up(alignment, begin);
uintptr_t aligned_end = align_down(alignment, end);
if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) {
8004640: 51 b0 00 2c bgeu r13,r16,80046f0 <rtems_rbheap_initialize+0x138>
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 );
8004644: 35 61 00 04 addi r1,r11,4
{
the_rbtree->permanent_null = NULL;
the_rbtree->root = NULL;
the_rbtree->first[0] = NULL;
the_rbtree->first[1] = NULL;
the_rbtree->compare_function = compare_function;
8004648: 78 02 08 00 mvhi r2,0x800
800464c: 38 42 45 18 ori r2,r2,0x4518
head->next = tail;
8004650: 59 61 00 00 sw (r11+0),r1
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
8004654: 35 6c 00 0c addi r12,r11,12
the_rbtree->is_unique = is_unique;
8004658: 34 01 00 01 mvi r1,1
Chain_Node *tail = _Chain_Tail( the_chain );
800465c: 35 6f 00 10 addi r15,r11,16
{
the_rbtree->permanent_null = NULL;
the_rbtree->root = NULL;
the_rbtree->first[0] = NULL;
the_rbtree->first[1] = NULL;
the_rbtree->compare_function = compare_function;
8004660: 59 62 00 28 sw (r11+40),r2
the_rbtree->is_unique = is_unique;
8004664: 31 61 00 2c sb (r11+44),r1
head->next = tail;
head->previous = NULL;
8004668: 59 60 00 04 sw (r11+4),r0
tail->previous = head;
800466c: 59 6b 00 08 sw (r11+8),r11
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
8004670: 59 6f 00 0c sw (r11+12),r15
head->previous = NULL;
8004674: 59 60 00 10 sw (r11+16),r0
tail->previous = head;
8004678: 59 6c 00 14 sw (r11+20),r12
RBTree_Control *the_rbtree,
RBTree_Compare_function compare_function,
bool is_unique
)
{
the_rbtree->permanent_null = NULL;
800467c: 59 60 00 18 sw (r11+24),r0
the_rbtree->root = NULL;
8004680: 59 60 00 1c sw (r11+28),r0
the_rbtree->first[0] = NULL;
8004684: 59 60 00 20 sw (r11+32),r0
the_rbtree->first[1] = NULL;
8004688: 59 60 00 24 sw (r11+36),r0
rtems_rbheap_chunk *first = NULL;
rtems_chain_initialize_empty(free_chain);
rtems_chain_initialize_empty(&control->spare_descriptor_chain);
rtems_rbtree_initialize_empty(chunk_tree, chunk_compare, true);
control->alignment = alignment;
800468c: 59 6e 00 30 sw (r11+48),r14
control->handler_arg = handler_arg;
8004690: 59 72 00 38 sw (r11+56),r18
control->extend_descriptors = extend_descriptors;
8004694: 59 71 00 34 sw (r11+52),r17
{
rtems_chain_control *chain = &control->spare_descriptor_chain;
rtems_chain_node *chunk = rtems_chain_get_unprotected(chain);
if (chunk == NULL) {
(*control->extend_descriptors)(control);
8004698: b9 60 08 00 mv r1,r11
800469c: da 20 00 00 call r17
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
if (chunk != NULL) {
rtems_rbheap_add_to_spare_descriptor_chain(control, chunk);
}
}
80046a0: 29 62 00 0c lw r2,(r11+12)
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
80046a4: 44 4f 00 12 be r2,r15,80046ec <rtems_rbheap_initialize+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;
80046a8: 28 41 00 00 lw r1,(r2+0)
head->next = new_first;
80046ac: 59 61 00 0c sw (r11+12),r1
new_first->previous = head;
80046b0: 58 2c 00 04 sw (r1+4),r12
control->alignment = alignment;
control->handler_arg = handler_arg;
control->extend_descriptors = extend_descriptors;
first = get_chunk(control);
if (first != NULL) {
80046b4: 44 40 00 0e be r2,r0,80046ec <rtems_rbheap_initialize+0x134><== NEVER TAKEN
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
80046b8: 29 61 00 00 lw r1,(r11+0)
first->begin = aligned_begin;
first->size = aligned_end - aligned_begin;
80046bc: ca 0d 80 00 sub r16,r16,r13
control->handler_arg = handler_arg;
control->extend_descriptors = extend_descriptors;
first = get_chunk(control);
if (first != NULL) {
first->begin = aligned_begin;
80046c0: 58 4d 00 18 sw (r2+24),r13
first->size = aligned_end - aligned_begin;
80046c4: 58 50 00 1c sw (r2+28),r16
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
80046c8: 58 4b 00 04 sw (r2+4),r11
before_node = after_node->next;
after_node->next = the_node;
80046cc: 59 62 00 00 sw (r11+0),r2
the_node->next = before_node;
80046d0: 58 41 00 00 sw (r2+0),r1
before_node->previous = the_node;
80046d4: 58 22 00 04 sw (r1+4),r2
static void insert_into_tree(
rtems_rbtree_control *tree,
rtems_rbheap_chunk *chunk
)
{
_RBTree_Insert_unprotected(tree, &chunk->tree_node);
80046d8: 35 61 00 18 addi r1,r11,24
80046dc: 34 42 00 08 addi r2,r2,8
80046e0: f8 00 07 c3 calli 80065ec <_RBTree_Insert_unprotected>
uintptr_t alignment,
rtems_rbheap_extend_descriptors extend_descriptors,
void *handler_arg
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
80046e4: 34 0f 00 00 mvi r15,0
80046e8: e0 00 00 02 bi 80046f0 <rtems_rbheap_initialize+0x138>
first->begin = aligned_begin;
first->size = aligned_end - aligned_begin;
add_to_chain(free_chain, first);
insert_into_tree(chunk_tree, first);
} else {
sc = RTEMS_NO_MEMORY;
80046ec: 34 0f 00 1a mvi r15,26
} else {
sc = RTEMS_INVALID_NUMBER;
}
return sc;
}
80046f0: b9 e0 08 00 mv r1,r15
80046f4: 2b 9d 00 04 lw ra,(sp+4)
80046f8: 2b 8b 00 24 lw r11,(sp+36)
80046fc: 2b 8c 00 20 lw r12,(sp+32)
8004700: 2b 8d 00 1c lw r13,(sp+28)
8004704: 2b 8e 00 18 lw r14,(sp+24)
8004708: 2b 8f 00 14 lw r15,(sp+20)
800470c: 2b 90 00 10 lw r16,(sp+16)
8004710: 2b 91 00 0c lw r17,(sp+12)
8004714: 2b 92 00 08 lw r18,(sp+8)
8004718: 37 9c 00 24 addi sp,sp,36
800471c: c3 a0 00 00 ret
080187c8 <rtems_rfs_bitmap_load_map>:
* @return int The error number (errno). No error if 0.
*/
static int
rtems_rfs_bitmap_load_map (rtems_rfs_bitmap_control* control,
rtems_rfs_bitmap_map* map)
{
80187c8: 37 9c ff f4 addi sp,sp,-12
80187cc: 5b 8b 00 0c sw (sp+12),r11
80187d0: 5b 8c 00 08 sw (sp+8),r12
80187d4: 5b 9d 00 04 sw (sp+4),ra
80187d8: b8 40 60 00 mv r12,r2
int rc;
if (!control->buffer)
80187dc: 28 22 00 00 lw r2,(r1+0)
* @return int The error number (errno). No error if 0.
*/
static int
rtems_rfs_bitmap_load_map (rtems_rfs_bitmap_control* control,
rtems_rfs_bitmap_map* map)
{
80187e0: b8 20 58 00 mv r11,r1
int rc;
if (!control->buffer)
return ENXIO;
80187e4: 34 01 00 06 mvi r1,6
rtems_rfs_bitmap_load_map (rtems_rfs_bitmap_control* control,
rtems_rfs_bitmap_map* map)
{
int rc;
if (!control->buffer)
80187e8: 44 40 00 0b be r2,r0,8018814 <rtems_rfs_bitmap_load_map+0x4c>
return ENXIO;
*map = NULL;
rc = rtems_rfs_buffer_handle_request (control->fs,
80187ec: 29 61 00 04 lw r1,(r11+4)
80187f0: 29 63 00 08 lw r3,(r11+8)
int rc;
if (!control->buffer)
return ENXIO;
*map = NULL;
80187f4: 59 80 00 00 sw (r12+0),r0
rc = rtems_rfs_buffer_handle_request (control->fs,
80187f8: 34 04 00 01 mvi r4,1
80187fc: f8 00 08 a3 calli 801aa88 <rtems_rfs_buffer_handle_request>
control->buffer,
control->block,
true);
if (rc)
8018800: 5c 20 00 05 bne r1,r0,8018814 <rtems_rfs_bitmap_load_map+0x4c><== NEVER TAKEN
return rc;
*map = rtems_rfs_buffer_data (control->buffer);
8018804: 29 62 00 00 lw r2,(r11+0)
8018808: 28 42 00 08 lw r2,(r2+8)
801880c: 28 42 00 1c lw r2,(r2+28)
8018810: 59 82 00 00 sw (r12+0),r2
return 0;
}
8018814: 2b 9d 00 04 lw ra,(sp+4)
8018818: 2b 8b 00 0c lw r11,(sp+12)
801881c: 2b 8c 00 08 lw r12,(sp+8)
8018820: 37 9c 00 0c addi sp,sp,12
8018824: c3 a0 00 00 ret
08018f7c <rtems_rfs_bitmap_map_alloc>:
int
rtems_rfs_bitmap_map_alloc (rtems_rfs_bitmap_control* control,
rtems_rfs_bitmap_bit seed,
bool* allocated,
rtems_rfs_bitmap_bit* bit)
{
8018f7c: 37 9c ff e8 addi sp,sp,-24
8018f80: 5b 8b 00 18 sw (sp+24),r11
8018f84: 5b 8c 00 14 sw (sp+20),r12
8018f88: 5b 8d 00 10 sw (sp+16),r13
8018f8c: 5b 8e 00 0c sw (sp+12),r14
8018f90: 5b 8f 00 08 sw (sp+8),r15
8018f94: 5b 9d 00 04 sw (sp+4),ra
8018f98: b8 20 60 00 mv r12,r1
8018f9c: b8 60 70 00 mv r14,r3
8018fa0: b8 80 78 00 mv r15,r4
int rc = 0;
/*
* By default we assume the allocation failed.
*/
*allocated = false;
8018fa4: 30 60 00 00 sb (r3+0),r0
* seed up then from the seed down a window number of bits, then repeat the
* process from the window distance from the seed, again above then
* below. Keep moving out until all bits have been searched.
*/
upper_seed = seed;
lower_seed = seed;
8018fa8: b8 40 58 00 mv r11,r2
* of bits from the original seed above then below. That is search from the
* seed up then from the seed down a window number of bits, then repeat the
* process from the window distance from the seed, again above then
* below. Keep moving out until all bits have been searched.
*/
upper_seed = seed;
8018fac: b8 40 68 00 mv r13,r2
* we have searched all of the map. The seed may not be aligned to a window
* boundary so we may need to search a partial window and this may also not
* be balanced for the upper or lower seeds. We move to the limits, search
* then return false if no clear bits are found.
*/
while (((upper_seed >= 0) && (upper_seed < control->size))
8018fb0: e0 00 00 1b bi 801901c <rtems_rfs_bitmap_map_alloc+0xa0>
|| ((lower_seed >= 0) && (lower_seed < control->size)))
{
/*
* Search up first so bits allocated in succession are grouped together.
*/
if (upper_seed < control->size)
8018fb4: 29 81 00 0c lw r1,(r12+12)
8018fb8: 51 a1 00 0a bgeu r13,r1,8018fe0 <rtems_rfs_bitmap_map_alloc+0x64>
{
*bit = upper_seed;
8018fbc: 59 ed 00 00 sw (r15+0),r13
rc = rtems_rfs_search_map_for_clear_bit (control, bit, allocated,
8018fc0: b9 80 08 00 mv r1,r12
8018fc4: b9 e0 10 00 mv r2,r15
8018fc8: b9 c0 18 00 mv r3,r14
8018fcc: 34 04 00 01 mvi r4,1
8018fd0: fb ff fe 16 calli 8018828 <rtems_rfs_search_map_for_clear_bit.clone.0>
window, 1);
if ((rc > 0) || *allocated)
8018fd4: 48 20 00 18 bg r1,r0,8019034 <rtems_rfs_bitmap_map_alloc+0xb8><== NEVER TAKEN
8018fd8: 41 c1 00 00 lbu r1,(r14+0)
8018fdc: 5c 20 00 16 bne r1,r0,8019034 <rtems_rfs_bitmap_map_alloc+0xb8>
break;
}
if (lower_seed >= 0)
8018fe0: 48 0b 00 0a bg r0,r11,8019008 <rtems_rfs_bitmap_map_alloc+0x8c>
{
*bit = lower_seed;
8018fe4: 59 eb 00 00 sw (r15+0),r11
rc = rtems_rfs_search_map_for_clear_bit (control, bit, allocated,
8018fe8: b9 80 08 00 mv r1,r12
8018fec: b9 e0 10 00 mv r2,r15
8018ff0: b9 c0 18 00 mv r3,r14
8018ff4: 34 04 ff ff mvi r4,-1
8018ff8: fb ff fe 0c calli 8018828 <rtems_rfs_search_map_for_clear_bit.clone.0>
window, -1);
if ((rc > 0) || *allocated)
8018ffc: 48 20 00 0e bg r1,r0,8019034 <rtems_rfs_bitmap_map_alloc+0xb8><== NEVER TAKEN
8019000: 41 c1 00 00 lbu r1,(r14+0)
8019004: 5c 20 00 0c bne r1,r0,8019034 <rtems_rfs_bitmap_map_alloc+0xb8>
/*
* Do not bound the limits at the edges of the map. Do not update if an
* edge has been passed.
*/
if (upper_seed < control->size)
8019008: 29 81 00 0c lw r1,(r12+12)
801900c: 51 a1 00 02 bgeu r13,r1,8019014 <rtems_rfs_bitmap_map_alloc+0x98>
upper_seed += window;
8019010: 35 ad 08 00 addi r13,r13,2048
if (lower_seed >= 0)
8019014: 48 0b 00 02 bg r0,r11,801901c <rtems_rfs_bitmap_map_alloc+0xa0>
lower_seed -= window;
8019018: 35 6b f8 00 addi r11,r11,-2048
* we have searched all of the map. The seed may not be aligned to a window
* boundary so we may need to search a partial window and this may also not
* be balanced for the upper or lower seeds. We move to the limits, search
* then return false if no clear bits are found.
*/
while (((upper_seed >= 0) && (upper_seed < control->size))
801901c: 48 0d 00 03 bg r0,r13,8019028 <rtems_rfs_bitmap_map_alloc+0xac>
8019020: 29 81 00 0c lw r1,(r12+12)
8019024: 54 2d ff e4 bgu r1,r13,8018fb4 <rtems_rfs_bitmap_map_alloc+0x38>
|| ((lower_seed >= 0) && (lower_seed < control->size)))
8019028: 48 0b 00 03 bg r0,r11,8019034 <rtems_rfs_bitmap_map_alloc+0xb8>
801902c: 29 81 00 0c lw r1,(r12+12)
8019030: 54 2b ff e1 bgu r1,r11,8018fb4 <rtems_rfs_bitmap_map_alloc+0x38>
if (lower_seed >= 0)
lower_seed -= window;
}
return 0;
}
8019034: 34 01 00 00 mvi r1,0
8019038: 2b 9d 00 04 lw ra,(sp+4)
801903c: 2b 8b 00 18 lw r11,(sp+24)
8019040: 2b 8c 00 14 lw r12,(sp+20)
8019044: 2b 8d 00 10 lw r13,(sp+16)
8019048: 2b 8e 00 0c lw r14,(sp+12)
801904c: 2b 8f 00 08 lw r15,(sp+8)
8019050: 37 9c 00 18 addi sp,sp,24
8019054: c3 a0 00 00 ret
08018b2c <rtems_rfs_bitmap_mask>:
return 0;
}
rtems_rfs_bitmap_element
rtems_rfs_bitmap_mask (unsigned int size)
{
8018b2c: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
8018b30: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
rtems_rfs_bitmap_element mask = RTEMS_RFS_BITMAP_ELEMENT_FULL_MASK;
mask >>= (rtems_rfs_bitmap_element_bits () - size);
8018b34: 34 02 00 20 mvi r2,32 <== NOT EXECUTED
8018b38: c8 41 10 00 sub r2,r2,r1 <== NOT EXECUTED
8018b3c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
8018b40: fb ff a2 8f calli 800157c <__lshrsi3> <== NOT EXECUTED
return mask;
}
8018b44: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8018b48: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
8018b4c: c3 a0 00 00 ret <== NOT EXECUTED
08018b50 <rtems_rfs_bitmap_mask_section>:
rtems_rfs_bitmap_element
rtems_rfs_bitmap_mask_section (unsigned int start, unsigned int end)
{
8018b50: 37 9c ff f8 addi sp,sp,-8
8018b54: 5b 8b 00 08 sw (sp+8),r11
8018b58: 5b 9d 00 04 sw (sp+4),ra
8018b5c: b8 20 58 00 mv r11,r1
rtems_rfs_bitmap_element mask = 0;
8018b60: 34 01 00 00 mvi r1,0
if (end > start)
8018b64: 51 62 00 07 bgeu r11,r2,8018b80 <rtems_rfs_bitmap_mask_section+0x30><== NEVER TAKEN
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);
8018b68: c9 62 10 00 sub r2,r11,r2
8018b6c: 34 42 00 20 addi r2,r2,32
8018b70: 34 01 ff ff mvi r1,-1
8018b74: fb ff a2 82 calli 800157c <__lshrsi3>
rtems_rfs_bitmap_element
rtems_rfs_bitmap_mask_section (unsigned int start, unsigned int end)
{
rtems_rfs_bitmap_element mask = 0;
if (end > start)
mask = rtems_rfs_bitmap_mask (end - start) << start;
8018b78: b9 60 10 00 mv r2,r11
8018b7c: fb ff a2 59 calli 80014e0 <__ashlsi3>
return mask;
}
8018b80: 2b 9d 00 04 lw ra,(sp+4)
8018b84: 2b 8b 00 08 lw r11,(sp+8)
8018b88: 37 9c 00 08 addi sp,sp,8
8018b8c: c3 a0 00 00 ret
08019204 <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)
{
8019204: 37 9c ff e4 addi sp,sp,-28
8019208: 5b 8b 00 1c sw (sp+28),r11
801920c: 5b 8c 00 18 sw (sp+24),r12
8019210: 5b 8d 00 14 sw (sp+20),r13
8019214: 5b 8e 00 10 sw (sp+16),r14
8019218: 5b 8f 00 0c sw (sp+12),r15
801921c: 5b 90 00 08 sw (sp+8),r16
8019220: 5b 9d 00 04 sw (sp+4),ra
8019224: b8 80 68 00 mv r13,r4
/*
* 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);
8019228: 34 04 00 01 mvi r4,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)
{
801922c: b8 20 78 00 mv r15,r1
8019230: b8 40 60 00 mv r12,r2
8019234: b8 60 70 00 mv r14,r3
8019238: b8 a0 58 00 mv r11,r5
/*
* 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);
801923c: f8 00 06 13 calli 801aa88 <rtems_rfs_buffer_handle_request>
if (rc > 0)
8019240: 48 20 00 27 bg r1,r0,80192dc <rtems_rfs_block_find_indirect+0xd8><== NEVER TAKEN
return rc;
*result = rtems_rfs_block_get_number (buffer, offset);
8019244: 29 81 00 08 lw r1,(r12+8)
8019248: 34 02 00 02 mvi r2,2
801924c: 28 2c 00 1c lw r12,(r1+28)
8019250: b9 a0 08 00 mv r1,r13
8019254: fb ff a0 a3 calli 80014e0 <__ashlsi3>
8019258: b5 81 60 00 add r12,r12,r1
801925c: 41 81 00 00 lbu r1,(r12+0)
8019260: 41 90 00 03 lbu r16,(r12+3)
8019264: 34 02 00 18 mvi r2,24
8019268: fb ff a0 9e calli 80014e0 <__ashlsi3>
801926c: ba 01 80 00 or r16,r16,r1
8019270: 41 81 00 01 lbu r1,(r12+1)
8019274: 34 02 00 10 mvi r2,16
8019278: fb ff a0 9a calli 80014e0 <__ashlsi3>
801927c: ba 01 80 00 or r16,r16,r1
8019280: 41 81 00 02 lbu r1,(r12+2)
8019284: 34 02 00 08 mvi r2,8
8019288: fb ff a0 96 calli 80014e0 <__ashlsi3>
801928c: ba 01 10 00 or r2,r16,r1
8019290: 59 62 00 00 sw (r11+0),r2
if ((*result + 1) == 0)
8019294: 34 01 ff ff mvi r1,-1
8019298: 5c 41 00 02 bne r2,r1,80192a0 <rtems_rfs_block_find_indirect+0x9c><== ALWAYS TAKEN
*result = 0;
801929c: 59 60 00 00 sw (r11+0),r0 <== NOT EXECUTED
if (*result >= rtems_rfs_fs_blocks (fs))
80192a0: 29 63 00 00 lw r3,(r11+0)
80192a4: 29 e2 00 04 lw r2,(r15+4)
" block=%" PRId32 ", indirect=%" PRId32 "/%d\n", *result, block, offset);
*result = 0;
rc = EIO;
}
return 0;
80192a8: 34 01 00 00 mvi r1,0
*result = rtems_rfs_block_get_number (buffer, offset);
if ((*result + 1) == 0)
*result = 0;
if (*result >= rtems_rfs_fs_blocks (fs))
80192ac: 54 43 00 0c bgu r2,r3,80192dc <rtems_rfs_block_find_indirect+0xd8><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_FIND))
80192b0: 34 02 10 00 mvi r2,4096 <== NOT EXECUTED
80192b4: fb ff de 9d calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
80192b8: 44 20 00 07 be r1,r0,80192d4 <rtems_rfs_block_find_indirect+0xd0><== NOT EXECUTED
printf ("rtems-rfs: block-find: invalid block in table:"
80192bc: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED
80192c0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
80192c4: 38 21 7c 9c ori r1,r1,0x7c9c <== NOT EXECUTED
80192c8: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
80192cc: b9 a0 20 00 mv r4,r13 <== NOT EXECUTED
80192d0: f8 00 24 e9 calli 8022674 <printf> <== NOT EXECUTED
" block=%" PRId32 ", indirect=%" PRId32 "/%d\n", *result, block, offset);
*result = 0;
80192d4: 59 60 00 00 sw (r11+0),r0 <== NOT EXECUTED
rc = EIO;
}
return 0;
80192d8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
}
80192dc: 2b 9d 00 04 lw ra,(sp+4)
80192e0: 2b 8b 00 1c lw r11,(sp+28)
80192e4: 2b 8c 00 18 lw r12,(sp+24)
80192e8: 2b 8d 00 14 lw r13,(sp+20)
80192ec: 2b 8e 00 10 lw r14,(sp+16)
80192f0: 2b 8f 00 0c lw r15,(sp+12)
80192f4: 2b 90 00 08 lw r16,(sp+8)
80192f8: 37 9c 00 1c addi sp,sp,28
80192fc: c3 a0 00 00 ret
0801966c <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)
{
801966c: 37 9c ff ec addi sp,sp,-20 <== NOT EXECUTED
8019670: 5b 8b 00 14 sw (sp+20),r11 <== NOT EXECUTED
8019674: 5b 8c 00 10 sw (sp+16),r12 <== NOT EXECUTED
8019678: 5b 8d 00 0c sw (sp+12),r13 <== NOT EXECUTED
801967c: 5b 8e 00 08 sw (sp+8),r14 <== NOT EXECUTED
8019680: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
8019684: b8 40 68 00 mv r13,r2 <== NOT EXECUTED
if (pos == 0)
8019688: b8 43 10 00 or r2,r2,r3 <== NOT EXECUTED
void
rtems_rfs_block_get_block_size (rtems_rfs_file_system* fs,
rtems_rfs_pos pos,
rtems_rfs_block_size* size)
{
801968c: b8 60 60 00 mv r12,r3 <== NOT EXECUTED
8019690: b8 80 58 00 mv r11,r4 <== NOT EXECUTED
if (pos == 0)
8019694: 5c 40 00 04 bne r2,r0,80196a4 <rtems_rfs_block_get_block_size+0x38><== 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;
8019698: 58 80 00 00 sw (r4+0),r0 <== NOT EXECUTED
size->offset = 0;
801969c: 58 80 00 04 sw (r4+4),r0 <== NOT EXECUTED
80196a0: e0 00 00 0f bi 80196dc <rtems_rfs_block_get_block_size+0x70><== NOT EXECUTED
rtems_rfs_block_set_size_zero (size);
else
{
size->count = pos / rtems_rfs_fs_block_size (fs) + 1;
80196a4: 28 2e 00 08 lw r14,(r1+8) <== NOT EXECUTED
80196a8: b8 60 10 00 mv r2,r3 <== NOT EXECUTED
80196ac: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
80196b0: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
80196b4: b9 c0 20 00 mv r4,r14 <== NOT EXECUTED
80196b8: f8 00 59 dd calli 802fe2c <__udivdi3> <== NOT EXECUTED
80196bc: 34 42 00 01 addi r2,r2,1 <== NOT EXECUTED
80196c0: 59 62 00 00 sw (r11+0),r2 <== NOT EXECUTED
size->offset = pos % rtems_rfs_fs_block_size (fs);
80196c4: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
80196c8: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
80196cc: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
80196d0: b9 c0 20 00 mv r4,r14 <== NOT EXECUTED
80196d4: f8 00 5b c4 calli 80305e4 <__umoddi3> <== NOT EXECUTED
80196d8: 59 62 00 04 sw (r11+4),r2 <== NOT EXECUTED
}
}
80196dc: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
80196e0: 2b 8b 00 14 lw r11,(sp+20) <== NOT EXECUTED
80196e4: 2b 8c 00 10 lw r12,(sp+16) <== NOT EXECUTED
80196e8: 2b 8d 00 0c lw r13,(sp+12) <== NOT EXECUTED
80196ec: 2b 8e 00 08 lw r14,(sp+8) <== NOT EXECUTED
80196f0: 37 9c 00 14 addi sp,sp,20 <== NOT EXECUTED
80196f4: c3 a0 00 00 ret <== NOT EXECUTED
08019974 <rtems_rfs_block_map_close>:
int
rtems_rfs_block_map_close (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map)
{
8019974: 37 9c ff d8 addi sp,sp,-40
8019978: 5b 8b 00 28 sw (sp+40),r11
801997c: 5b 8c 00 24 sw (sp+36),r12
8019980: 5b 8d 00 20 sw (sp+32),r13
8019984: 5b 8e 00 1c sw (sp+28),r14
8019988: 5b 8f 00 18 sw (sp+24),r15
801998c: 5b 90 00 14 sw (sp+20),r16
8019990: 5b 91 00 10 sw (sp+16),r17
8019994: 5b 92 00 0c sw (sp+12),r18
8019998: 5b 93 00 08 sw (sp+8),r19
801999c: 5b 9d 00 04 sw (sp+4),ra
80199a0: b8 40 58 00 mv r11,r2
int rc = 0;
int brc;
if (map->dirty && map->inode)
80199a4: 40 42 00 00 lbu r2,(r2+0)
}
int
rtems_rfs_block_map_close (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map)
{
80199a8: b8 20 80 00 mv r16,r1
int rc = 0;
80199ac: 34 0c 00 00 mvi r12,0
int brc;
if (map->dirty && map->inode)
80199b0: 44 40 00 75 be r2,r0,8019b84 <rtems_rfs_block_map_close+0x210>
80199b4: 29 62 00 04 lw r2,(r11+4)
80199b8: 44 40 00 73 be r2,r0,8019b84 <rtems_rfs_block_map_close+0x210><== NEVER TAKEN
{
brc = rtems_rfs_inode_load (fs, map->inode);
80199bc: fb ff d4 c7 calli 800ecd8 <rtems_rfs_inode_load>
if (brc > 0)
80199c0: b8 20 60 00 mv r12,r1
80199c4: 48 20 00 70 bg r1,r0,8019b84 <rtems_rfs_block_map_close+0x210><== NEVER TAKEN
80199c8: b9 60 88 00 mv r17,r11
80199cc: 34 0c 00 00 mvi r12,0
*/
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);
rtems_rfs_buffer_mark_dirty (&handle->buffer);
80199d0: 34 0e 00 01 mvi r14,1
if (rc == 0)
{
int b;
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
80199d4: 34 12 00 14 mvi r18,20
rtems_rfs_inode_set_block (map->inode, b, map->blocks[b]);
80199d8: 29 6d 00 04 lw r13,(r11+4)
80199dc: 2a 2f 00 24 lw r15,(r17+36)
* @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);
80199e0: 34 02 00 18 mvi r2,24
80199e4: 29 b3 00 0c lw r19,(r13+12)
80199e8: b9 e0 08 00 mv r1,r15
80199ec: fb ff 9e e4 calli 800157c <__lshrsi3>
80199f0: b6 6c 98 00 add r19,r19,r12
80199f4: 32 61 00 1c sb (r19+28),r1
80199f8: 29 b3 00 0c lw r19,(r13+12)
80199fc: 34 02 00 10 mvi r2,16
8019a00: b9 e0 08 00 mv r1,r15
8019a04: fb ff 9e de calli 800157c <__lshrsi3>
8019a08: b6 6c 98 00 add r19,r19,r12
8019a0c: 32 61 00 1d sb (r19+29),r1
8019a10: 29 b3 00 0c lw r19,(r13+12)
8019a14: b9 e0 08 00 mv r1,r15
8019a18: 34 02 00 08 mvi r2,8
8019a1c: fb ff 9e d8 calli 800157c <__lshrsi3>
8019a20: b6 6c 98 00 add r19,r19,r12
8019a24: 32 61 00 1e sb (r19+30),r1
8019a28: 29 a1 00 0c lw r1,(r13+12)
rtems_rfs_buffer_mark_dirty (&handle->buffer);
8019a2c: 36 31 00 04 addi r17,r17,4
* @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);
8019a30: b4 2c 08 00 add r1,r1,r12
8019a34: 30 2f 00 1f sb (r1+31),r15
rtems_rfs_buffer_mark_dirty (&handle->buffer);
8019a38: 31 ae 00 10 sb (r13+16),r14
8019a3c: 35 8c 00 04 addi r12,r12,4
if (rc == 0)
{
int b;
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
8019a40: 5d 92 ff e6 bne r12,r18,80199d8 <rtems_rfs_block_map_close+0x64>
rtems_rfs_inode_set_block (map->inode, b, map->blocks[b]);
rtems_rfs_inode_set_block_count (map->inode, map->size.count);
8019a44: 29 6c 00 04 lw r12,(r11+4)
8019a48: 29 6d 00 08 lw r13,(r11+8)
* @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);
8019a4c: 34 02 00 18 mvi r2,24
8019a50: 29 8f 00 0c lw r15,(r12+12)
8019a54: b9 a0 08 00 mv r1,r13
8019a58: fb ff 9e c9 calli 800157c <__lshrsi3>
8019a5c: 31 e1 00 0c sb (r15+12),r1
8019a60: 29 8f 00 0c lw r15,(r12+12)
8019a64: b9 a0 08 00 mv r1,r13
8019a68: 34 02 00 10 mvi r2,16
8019a6c: fb ff 9e c4 calli 800157c <__lshrsi3>
8019a70: 31 e1 00 0d sb (r15+13),r1
8019a74: 29 8f 00 0c lw r15,(r12+12)
8019a78: b9 a0 08 00 mv r1,r13
8019a7c: 34 02 00 08 mvi r2,8
8019a80: fb ff 9e bf calli 800157c <__lshrsi3>
8019a84: 31 e1 00 0e sb (r15+14),r1
8019a88: 29 81 00 0c lw r1,(r12+12)
*/
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);
8019a8c: 34 02 00 08 mvi r2,8
* @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);
8019a90: 30 2d 00 0f sb (r1+15),r13
rtems_rfs_buffer_mark_dirty (&handle->buffer);
8019a94: 31 8e 00 10 sb (r12+16),r14
rtems_rfs_inode_set_block_offset (map->inode, map->size.offset);
8019a98: 29 6c 00 04 lw r12,(r11+4)
8019a9c: 2d 6d 00 0e lhu r13,(r11+14)
*/
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);
8019aa0: 29 8f 00 0c lw r15,(r12+12)
8019aa4: b9 a0 08 00 mv r1,r13
8019aa8: fb ff 9e b5 calli 800157c <__lshrsi3>
8019aac: 31 e1 00 0a sb (r15+10),r1
8019ab0: 29 81 00 0c lw r1,(r12+12)
* @param block_count The last map block number.
*/
static inline void
rtems_rfs_inode_set_last_map_block (rtems_rfs_inode_handle* handle, uint32_t last_map_block)
{
rtems_rfs_write_u32 (&handle->node->last_map_block, last_map_block);
8019ab4: 34 02 00 18 mvi r2,24
*/
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);
8019ab8: 30 2d 00 0b sb (r1+11),r13
rtems_rfs_buffer_mark_dirty (&handle->buffer);
8019abc: 31 8e 00 10 sb (r12+16),r14
rtems_rfs_inode_set_last_map_block (map->inode, map->last_map_block);
8019ac0: 29 6c 00 04 lw r12,(r11+4)
8019ac4: 29 6d 00 1c lw r13,(r11+28)
* @param block_count The last map block number.
*/
static inline void
rtems_rfs_inode_set_last_map_block (rtems_rfs_inode_handle* handle, uint32_t last_map_block)
{
rtems_rfs_write_u32 (&handle->node->last_map_block, last_map_block);
8019ac8: 29 8f 00 0c lw r15,(r12+12)
8019acc: b9 a0 08 00 mv r1,r13
8019ad0: fb ff 9e ab calli 800157c <__lshrsi3>
8019ad4: 31 e1 00 30 sb (r15+48),r1
8019ad8: 29 8f 00 0c lw r15,(r12+12)
8019adc: b9 a0 08 00 mv r1,r13
8019ae0: 34 02 00 10 mvi r2,16
8019ae4: fb ff 9e a6 calli 800157c <__lshrsi3>
8019ae8: 31 e1 00 31 sb (r15+49),r1
8019aec: 29 8f 00 0c lw r15,(r12+12)
8019af0: b9 a0 08 00 mv r1,r13
8019af4: 34 02 00 08 mvi r2,8
8019af8: fb ff 9e a1 calli 800157c <__lshrsi3>
8019afc: 31 e1 00 32 sb (r15+50),r1
8019b00: 29 81 00 0c lw r1,(r12+12)
* @param block_count The last data block number.
*/
static inline void
rtems_rfs_inode_set_last_data_block (rtems_rfs_inode_handle* handle, uint32_t last_data_block)
{
rtems_rfs_write_u32 (&handle->node->last_data_block, last_data_block);
8019b04: 34 02 00 18 mvi r2,24
* @param block_count The last map block number.
*/
static inline void
rtems_rfs_inode_set_last_map_block (rtems_rfs_inode_handle* handle, uint32_t last_map_block)
{
rtems_rfs_write_u32 (&handle->node->last_map_block, last_map_block);
8019b08: 30 2d 00 33 sb (r1+51),r13
rtems_rfs_buffer_mark_dirty (&handle->buffer);
8019b0c: 31 8e 00 10 sb (r12+16),r14
rtems_rfs_inode_set_last_data_block (map->inode, map->last_data_block);
8019b10: 29 6c 00 04 lw r12,(r11+4)
8019b14: 29 6d 00 20 lw r13,(r11+32)
* @param block_count The last data block number.
*/
static inline void
rtems_rfs_inode_set_last_data_block (rtems_rfs_inode_handle* handle, uint32_t last_data_block)
{
rtems_rfs_write_u32 (&handle->node->last_data_block, last_data_block);
8019b18: 29 8f 00 0c lw r15,(r12+12)
8019b1c: b9 a0 08 00 mv r1,r13
8019b20: fb ff 9e 97 calli 800157c <__lshrsi3>
8019b24: 31 e1 00 34 sb (r15+52),r1
8019b28: 29 8f 00 0c lw r15,(r12+12)
8019b2c: 34 02 00 10 mvi r2,16
8019b30: b9 a0 08 00 mv r1,r13
8019b34: fb ff 9e 92 calli 800157c <__lshrsi3>
8019b38: 31 e1 00 35 sb (r15+53),r1
8019b3c: 29 8f 00 0c lw r15,(r12+12)
8019b40: 34 02 00 08 mvi r2,8
8019b44: b9 a0 08 00 mv r1,r13
8019b48: fb ff 9e 8d calli 800157c <__lshrsi3>
8019b4c: 31 e1 00 36 sb (r15+54),r1
8019b50: 29 81 00 0c lw r1,(r12+12)
brc = rtems_rfs_inode_unload (fs, map->inode, true);
8019b54: 34 03 00 01 mvi r3,1
8019b58: 30 2d 00 37 sb (r1+55),r13
8019b5c: 29 62 00 04 lw r2,(r11+4)
rtems_rfs_buffer_mark_dirty (&handle->buffer);
8019b60: 31 8e 00 10 sb (r12+16),r14
8019b64: ba 00 08 00 mv r1,r16
8019b68: fb ff d4 d2 calli 800eeb0 <rtems_rfs_inode_unload>
8019b6c: b8 20 60 00 mv r12,r1
8019b70: 34 02 00 1f mvi r2,31
8019b74: a4 20 08 00 not r1,r1
8019b78: f8 00 69 63 calli 8034104 <__ashrsi3>
8019b7c: a1 81 60 00 and r12,r12,r1
if (brc > 0)
rc = brc;
map->dirty = false;
8019b80: 31 60 00 00 sb (r11+0),r0
*/
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);
8019b84: 35 62 00 38 addi r2,r11,56
}
}
map->inode = NULL;
8019b88: 59 60 00 04 sw (r11+4),r0
8019b8c: ba 00 08 00 mv r1,r16
8019b90: f8 00 03 4f calli 801a8cc <rtems_rfs_buffer_handle_release>
8019b94: ba 00 08 00 mv r1,r16
handle->dirty = false;
8019b98: 31 60 00 38 sb (r11+56),r0
handle->bnum = 0;
8019b9c: 59 60 00 3c sw (r11+60),r0
handle->buffer = NULL;
8019ba0: 59 60 00 40 sw (r11+64),r0
*/
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);
8019ba4: 35 62 00 44 addi r2,r11,68
8019ba8: f8 00 03 49 calli 801a8cc <rtems_rfs_buffer_handle_release>
rc = brc;
brc = rtems_rfs_buffer_handle_close (fs, &map->doubly_buffer);
if ((brc > 0) && (rc == 0))
rc = brc;
return rc;
}
8019bac: b9 80 08 00 mv r1,r12
handle->dirty = false;
8019bb0: 31 60 00 44 sb (r11+68),r0
handle->bnum = 0;
8019bb4: 59 60 00 48 sw (r11+72),r0
handle->buffer = NULL;
8019bb8: 59 60 00 4c sw (r11+76),r0
8019bbc: 2b 9d 00 04 lw ra,(sp+4)
8019bc0: 2b 8b 00 28 lw r11,(sp+40)
8019bc4: 2b 8c 00 24 lw r12,(sp+36)
8019bc8: 2b 8d 00 20 lw r13,(sp+32)
8019bcc: 2b 8e 00 1c lw r14,(sp+28)
8019bd0: 2b 8f 00 18 lw r15,(sp+24)
8019bd4: 2b 90 00 14 lw r16,(sp+20)
8019bd8: 2b 91 00 10 lw r17,(sp+16)
8019bdc: 2b 92 00 0c lw r18,(sp+12)
8019be0: 2b 93 00 08 lw r19,(sp+8)
8019be4: 37 9c 00 28 addi sp,sp,40
8019be8: c3 a0 00 00 ret
08019bec <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)
{
8019bec: 37 9c ff d4 addi sp,sp,-44
8019bf0: 5b 8b 00 28 sw (sp+40),r11
8019bf4: 5b 8c 00 24 sw (sp+36),r12
8019bf8: 5b 8d 00 20 sw (sp+32),r13
8019bfc: 5b 8e 00 1c sw (sp+28),r14
8019c00: 5b 8f 00 18 sw (sp+24),r15
8019c04: 5b 90 00 14 sw (sp+20),r16
8019c08: 5b 91 00 10 sw (sp+16),r17
8019c0c: 5b 92 00 0c sw (sp+12),r18
8019c10: 5b 93 00 08 sw (sp+8),r19
8019c14: 5b 9d 00 04 sw (sp+4),ra
int rc = 0;
*block = 0;
8019c18: 58 80 00 00 sw (r4+0),r0
/*
* Range checking here makes the remaining logic simpler.
*/
if (rtems_rfs_block_pos_block_past_end (bpos, &map->size))
8019c1c: 28 6f 00 00 lw r15,(r3+0)
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)
{
8019c20: b8 20 60 00 mv r12,r1
8019c24: b8 40 58 00 mv r11,r2
8019c28: b8 60 70 00 mv r14,r3
8019c2c: b8 80 68 00 mv r13,r4
*block = 0;
/*
* Range checking here makes the remaining logic simpler.
*/
if (rtems_rfs_block_pos_block_past_end (bpos, &map->size))
8019c30: 45 e0 00 04 be r15,r0,8019c40 <rtems_rfs_block_map_find+0x54>
8019c34: 28 41 00 08 lw r1,(r2+8)
return ENXIO;
8019c38: 34 06 00 06 mvi r6,6
*block = 0;
/*
* Range checking here makes the remaining logic simpler.
*/
if (rtems_rfs_block_pos_block_past_end (bpos, &map->size))
8019c3c: 44 20 00 4e be r1,r0,8019d74 <rtems_rfs_block_map_find+0x188><== NEVER TAKEN
8019c40: 29 71 00 08 lw r17,(r11+8)
return ENXIO;
8019c44: 34 06 00 06 mvi r6,6
*block = 0;
/*
* Range checking here makes the remaining logic simpler.
*/
if (rtems_rfs_block_pos_block_past_end (bpos, &map->size))
8019c48: 51 f1 00 4b bgeu r15,r17,8019d74 <rtems_rfs_block_map_find+0x188>
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))
8019c4c: 29 61 00 10 lw r1,(r11+16)
8019c50: 5d e1 00 03 bne r15,r1,8019c5c <rtems_rfs_block_map_find+0x70>
8019c54: 29 61 00 18 lw r1,(r11+24)
8019c58: 5c 20 00 08 bne r1,r0,8019c78 <rtems_rfs_block_map_find+0x8c>
/*
* 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)
8019c5c: 34 01 00 05 mvi r1,5
8019c60: 56 21 00 08 bgu r17,r1,8019c80 <rtems_rfs_block_map_find+0x94>
{
*block = map->blocks[bpos->bno];
8019c64: 35 e1 00 08 addi r1,r15,8
8019c68: 34 02 00 02 mvi r2,2
8019c6c: fb ff 9e 1d calli 80014e0 <__ashlsi3>
8019c70: b5 61 08 00 add r1,r11,r1
8019c74: 28 21 00 04 lw r1,(r1+4)
8019c78: 59 a1 00 00 sw (r13+0),r1
8019c7c: e0 00 00 35 bi 8019d50 <rtems_rfs_block_map_find+0x164>
* 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;
8019c80: 29 90 00 34 lw r16,(r12+52)
8019c84: b9 e0 08 00 mv r1,r15
8019c88: ba 00 10 00 mv r2,r16
8019c8c: f8 00 69 9e calli 8034304 <__umodsi3>
singly = bpos->bno / fs->blocks_per_block;
8019c90: ba 00 10 00 mv r2,r16
* 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;
8019c94: b8 20 90 00 mv r18,r1
singly = bpos->bno / fs->blocks_per_block;
8019c98: b9 e0 08 00 mv r1,r15
8019c9c: fb ff 9e 6b calli 8001648 <__udivsi3>
if (map->size.count <= fs->block_map_singly_blocks)
8019ca0: 29 82 00 38 lw r2,(r12+56)
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = bpos->bno % fs->blocks_per_block;
singly = bpos->bno / fs->blocks_per_block;
8019ca4: 5b 81 00 2c sw (sp+44),r1
8019ca8: b8 20 78 00 mv r15,r1
if (map->size.count <= fs->block_map_singly_blocks)
8019cac: 56 22 00 0a bgu r17,r2,8019cd4 <rtems_rfs_block_map_find+0xe8><== NEVER TAKEN
{
/*
* This is a single indirect table of blocks anchored off a slot in the
* inode.
*/
rc = rtems_rfs_block_find_indirect (fs,
8019cb0: 34 02 00 02 mvi r2,2
8019cb4: 34 21 00 08 addi r1,r1,8
8019cb8: fb ff 9e 0a calli 80014e0 <__ashlsi3>
8019cbc: b5 61 18 00 add r3,r11,r1
8019cc0: 35 70 00 38 addi r16,r11,56
8019cc4: b9 80 08 00 mv r1,r12
8019cc8: ba 00 10 00 mv r2,r16
8019ccc: 28 63 00 04 lw r3,(r3+4)
8019cd0: e0 00 00 1b bi 8019d3c <rtems_rfs_block_map_find+0x150>
* The map is doubly indirect.
*/
rtems_rfs_block_no doubly;
doubly = singly / fs->blocks_per_block;
singly %= fs->blocks_per_block;
8019cd4: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
8019cd8: f8 00 69 8b calli 8034304 <__umodsi3> <== NOT EXECUTED
8019cdc: b8 20 98 00 mv r19,r1 <== NOT EXECUTED
8019ce0: 5b 81 00 2c sw (sp+44),r1 <== NOT EXECUTED
if (map->size.count < fs->block_map_doubly_blocks)
8019ce4: 29 81 00 3c lw r1,(r12+60) <== NOT EXECUTED
{
/*
* This should never happen. Here so Joel can remove once his coverage
* testing gets to the file systems.
*/
rc = ENXIO;
8019ce8: 34 06 00 06 mvi r6,6 <== NOT EXECUTED
rtems_rfs_block_no doubly;
doubly = singly / fs->blocks_per_block;
singly %= fs->blocks_per_block;
if (map->size.count < fs->block_map_doubly_blocks)
8019cec: 52 21 00 22 bgeu r17,r1,8019d74 <rtems_rfs_block_map_find+0x188><== NOT EXECUTED
/*
* The map is doubly indirect.
*/
rtems_rfs_block_no doubly;
doubly = singly / fs->blocks_per_block;
8019cf0: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
8019cf4: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
8019cf8: fb ff 9e 54 calli 8001648 <__udivsi3> <== NOT EXECUTED
singly %= fs->blocks_per_block;
if (map->size.count < fs->block_map_doubly_blocks)
{
rc = rtems_rfs_block_find_indirect (fs,
8019cfc: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
8019d00: 34 21 00 08 addi r1,r1,8 <== NOT EXECUTED
8019d04: fb ff 9d f7 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
8019d08: b5 61 18 00 add r3,r11,r1 <== NOT EXECUTED
8019d0c: 28 63 00 04 lw r3,(r3+4) <== NOT EXECUTED
8019d10: 35 71 00 44 addi r17,r11,68 <== NOT EXECUTED
8019d14: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8019d18: ba 20 10 00 mv r2,r17 <== NOT EXECUTED
8019d1c: ba 60 20 00 mv r4,r19 <== NOT EXECUTED
8019d20: 37 85 00 2c addi r5,sp,44 <== NOT EXECUTED
8019d24: fb ff fd 38 calli 8019204 <rtems_rfs_block_find_indirect> <== NOT EXECUTED
8019d28: b8 20 30 00 mv r6,r1 <== NOT EXECUTED
&map->doubly_buffer,
map->blocks[doubly],
singly, &singly);
if (rc == 0)
8019d2c: 5c 20 00 12 bne r1,r0,8019d74 <rtems_rfs_block_map_find+0x188><== NOT EXECUTED
{
rc = rtems_rfs_block_find_indirect (fs,
8019d30: 2b 83 00 2c lw r3,(sp+44) <== NOT EXECUTED
8019d34: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8019d38: 35 62 00 38 addi r2,r11,56 <== NOT EXECUTED
8019d3c: ba 40 20 00 mv r4,r18
8019d40: b9 a0 28 00 mv r5,r13
8019d44: fb ff fd 30 calli 8019204 <rtems_rfs_block_find_indirect>
8019d48: b8 20 30 00 mv r6,r1
}
}
}
}
if (rc == 0)
8019d4c: 5c 20 00 0a bne r1,r0,8019d74 <rtems_rfs_block_map_find+0x188><== NEVER TAKEN
{
rtems_rfs_block_copy_bpos (&map->bpos, bpos);
8019d50: 29 c1 00 00 lw r1,(r14+0)
map->bpos.block = *block;
8019d54: 34 06 00 00 mvi r6,0
}
}
if (rc == 0)
{
rtems_rfs_block_copy_bpos (&map->bpos, bpos);
8019d58: 59 61 00 10 sw (r11+16),r1
8019d5c: 29 c1 00 04 lw r1,(r14+4)
8019d60: 59 61 00 14 sw (r11+20),r1
8019d64: 29 c1 00 08 lw r1,(r14+8)
8019d68: 59 61 00 18 sw (r11+24),r1
map->bpos.block = *block;
8019d6c: 29 a1 00 00 lw r1,(r13+0)
8019d70: 59 61 00 18 sw (r11+24),r1
}
return rc;
}
8019d74: b8 c0 08 00 mv r1,r6
8019d78: 2b 9d 00 04 lw ra,(sp+4)
8019d7c: 2b 8b 00 28 lw r11,(sp+40)
8019d80: 2b 8c 00 24 lw r12,(sp+36)
8019d84: 2b 8d 00 20 lw r13,(sp+32)
8019d88: 2b 8e 00 1c lw r14,(sp+28)
8019d8c: 2b 8f 00 18 lw r15,(sp+24)
8019d90: 2b 90 00 14 lw r16,(sp+20)
8019d94: 2b 91 00 10 lw r17,(sp+16)
8019d98: 2b 92 00 0c lw r18,(sp+12)
8019d9c: 2b 93 00 08 lw r19,(sp+8)
8019da0: 37 9c 00 2c addi sp,sp,44
8019da4: c3 a0 00 00 ret
08019eb0 <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)
{
8019eb0: 37 9c ff b8 addi sp,sp,-72
8019eb4: 5b 8b 00 40 sw (sp+64),r11
8019eb8: 5b 8c 00 3c sw (sp+60),r12
8019ebc: 5b 8d 00 38 sw (sp+56),r13
8019ec0: 5b 8e 00 34 sw (sp+52),r14
8019ec4: 5b 8f 00 30 sw (sp+48),r15
8019ec8: 5b 90 00 2c sw (sp+44),r16
8019ecc: 5b 91 00 28 sw (sp+40),r17
8019ed0: 5b 92 00 24 sw (sp+36),r18
8019ed4: 5b 93 00 20 sw (sp+32),r19
8019ed8: 5b 94 00 1c sw (sp+28),r20
8019edc: 5b 95 00 18 sw (sp+24),r21
8019ee0: 5b 96 00 14 sw (sp+20),r22
8019ee4: 5b 97 00 10 sw (sp+16),r23
8019ee8: 5b 98 00 0c sw (sp+12),r24
8019eec: 5b 99 00 08 sw (sp+8),r25
8019ef0: 5b 9d 00 04 sw (sp+4),ra
8019ef4: b8 20 60 00 mv r12,r1
8019ef8: b8 40 58 00 mv r11,r2
int b;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
8019efc: 34 01 00 00 mvi r1,0
8019f00: 34 02 20 00 mvi r2,8192
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)
{
8019f04: b8 60 b0 00 mv r22,r3
8019f08: b8 80 c8 00 mv r25,r4
int b;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
8019f0c: fb ff db 87 calli 8010d28 <rtems_rfs_trace>
8019f10: 44 20 00 06 be r1,r0,8019f28 <rtems_rfs_block_map_grow+0x78><== ALWAYS TAKEN
printf ("rtems-rfs: block-map-grow: entry: blocks=%zd count=%" PRIu32 "\n",
8019f14: 29 63 00 08 lw r3,(r11+8) <== NOT EXECUTED
8019f18: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8019f1c: 38 21 7d 1c ori r1,r1,0x7d1c <== NOT EXECUTED
8019f20: ba c0 10 00 mv r2,r22 <== NOT EXECUTED
8019f24: f8 00 21 d4 calli 8022674 <printf> <== NOT EXECUTED
blocks, map->size.count);
if ((map->size.count + blocks) >= rtems_rfs_fs_max_block_map_blocks (fs))
8019f28: 29 61 00 08 lw r1,(r11+8)
8019f2c: 29 82 00 3c lw r2,(r12+60)
return EFBIG;
8019f30: 34 0d 00 1b mvi r13,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))
8019f34: b6 c1 08 00 add r1,r22,r1
8019f38: 50 22 00 e7 bgeu r1,r2,801a2d4 <rtems_rfs_block_map_grow+0x424><== NEVER TAKEN
8019f3c: 34 10 00 00 mvi r16,0
rc = rtems_rfs_group_bitmap_alloc (fs, map->last_data_block,
false, &block);
if (rc > 0)
return rc;
if (map->size.count < RTEMS_RFS_INODE_BLOCKS)
8019f40: 34 18 00 04 mvi r24,4
return rc;
}
}
}
rtems_rfs_block_set_number (&map->singly_buffer, direct, block);
8019f44: 34 15 00 01 mvi r21,1
singly,
singly_block);
}
else
{
rc = rtems_rfs_buffer_handle_request (fs,
8019f48: 35 74 00 44 addi r20,r11,68
}
singly_block = rtems_rfs_block_get_number (&map->doubly_buffer,
singly);
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
8019f4c: 35 6f 00 38 addi r15,r11,56
* doubly indirect block as well. Both always occur when direct is 0
* and the doubly indirect block when singly is 0.
*/
if (direct == 0)
{
rc = rtems_rfs_block_map_indirect_alloc (fs, map,
8019f50: 37 97 00 44 addi r23,sp,68
8019f54: e0 00 00 de bi 801a2cc <rtems_rfs_block_map_grow+0x41c>
/*
* 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,
8019f58: 29 62 00 20 lw r2,(r11+32)
8019f5c: b9 80 08 00 mv r1,r12
8019f60: 34 03 00 00 mvi r3,0
8019f64: 37 84 00 48 addi r4,sp,72
8019f68: fb ff d2 02 calli 800e770 <rtems_rfs_group_bitmap_alloc>
8019f6c: b8 20 68 00 mv r13,r1
false, &block);
if (rc > 0)
8019f70: 48 20 00 d9 bg r1,r0,801a2d4 <rtems_rfs_block_map_grow+0x424><== NEVER TAKEN
return rc;
if (map->size.count < RTEMS_RFS_INODE_BLOCKS)
8019f74: 29 6d 00 08 lw r13,(r11+8)
8019f78: 55 b8 00 08 bgu r13,r24,8019f98 <rtems_rfs_block_map_grow+0xe8>
map->blocks[map->size.count] = block;
8019f7c: 34 02 00 02 mvi r2,2
8019f80: 35 a1 00 08 addi r1,r13,8
8019f84: fb ff 9d 57 calli 80014e0 <__ashlsi3>
8019f88: 2b 82 00 48 lw r2,(sp+72)
8019f8c: b5 61 08 00 add r1,r11,r1
8019f90: 58 22 00 04 sw (r1+4),r2
8019f94: e0 00 00 c3 bi 801a2a0 <rtems_rfs_block_map_grow+0x3f0>
* 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;
8019f98: 29 91 00 34 lw r17,(r12+52)
8019f9c: b9 a0 08 00 mv r1,r13
8019fa0: ba 20 10 00 mv r2,r17
8019fa4: f8 00 68 d8 calli 8034304 <__umodsi3>
singly = map->size.count / fs->blocks_per_block;
8019fa8: ba 20 10 00 mv r2,r17
* 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;
8019fac: b8 20 70 00 mv r14,r1
singly = map->size.count / fs->blocks_per_block;
8019fb0: b9 a0 08 00 mv r1,r13
8019fb4: fb ff 9d a5 calli 8001648 <__udivsi3>
if (map->size.count < fs->block_map_singly_blocks)
8019fb8: 29 82 00 38 lw r2,(r12+56)
*/
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;
8019fbc: b8 20 98 00 mv r19,r1
if (map->size.count < fs->block_map_singly_blocks)
8019fc0: 51 a2 00 19 bgeu r13,r2,801a024 <rtems_rfs_block_map_grow+0x174><== NEVER TAKEN
* 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) ||
8019fc4: 45 c0 00 05 be r14,r0,8019fd8 <rtems_rfs_block_map_grow+0x128><== NEVER TAKEN
((singly == 0) && (direct == RTEMS_RFS_INODE_BLOCKS)))
8019fc8: 65 c2 00 05 cmpei r2,r14,5
8019fcc: 64 21 00 00 cmpei r1,r1,0
* 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) ||
8019fd0: a0 41 08 00 and r1,r2,r1
8019fd4: 44 20 00 0c be r1,r0,801a004 <rtems_rfs_block_map_grow+0x154><== NEVER TAKEN
/*
* 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,
8019fd8: 36 61 00 08 addi r1,r19,8
8019fdc: 34 02 00 02 mvi r2,2
8019fe0: fb ff 9d 40 calli 80014e0 <__ashlsi3>
8019fe4: b5 61 28 00 add r5,r11,r1
8019fe8: 34 a4 00 04 addi r4,r5,4
8019fec: 65 a5 00 05 cmpei r5,r13,5
8019ff0: b9 80 08 00 mv r1,r12
8019ff4: b9 60 10 00 mv r2,r11
8019ff8: b9 e0 18 00 mv r3,r15
8019ffc: fb ff fc c1 calli 8019300 <rtems_rfs_block_map_indirect_alloc>
801a000: e0 00 00 82 bi 801a208 <rtems_rfs_block_map_grow+0x358>
&map->blocks[singly],
upping);
}
else
{
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
801a004: 34 02 00 02 mvi r2,2
801a008: 36 61 00 08 addi r1,r19,8
801a00c: fb ff 9d 35 calli 80014e0 <__ashlsi3>
801a010: b5 61 18 00 add r3,r11,r1
801a014: b9 e0 10 00 mv r2,r15
801a018: b9 80 08 00 mv r1,r12
801a01c: 28 63 00 04 lw r3,(r3+4)
801a020: e0 00 00 78 bi 801a200 <rtems_rfs_block_map_grow+0x350>
* Doubly indirect tables are being used.
*/
rtems_rfs_block_no doubly;
rtems_rfs_block_no singly_block;
doubly = singly / fs->blocks_per_block;
801a024: ba 20 10 00 mv r2,r17 <== NOT EXECUTED
801a028: fb ff 9d 88 calli 8001648 <__udivsi3> <== NOT EXECUTED
singly %= fs->blocks_per_block;
801a02c: ba 20 10 00 mv r2,r17 <== 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;
801a030: b8 20 90 00 mv r18,r1 <== NOT EXECUTED
singly %= fs->blocks_per_block;
801a034: ba 60 08 00 mv r1,r19 <== NOT EXECUTED
801a038: f8 00 68 b3 calli 8034304 <__umodsi3> <== NOT EXECUTED
801a03c: b8 20 88 00 mv r17,r1 <== 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)
801a040: 5d c0 00 4e bne r14,r0,801a178 <rtems_rfs_block_map_grow+0x2c8><== NOT EXECUTED
{
rc = rtems_rfs_block_map_indirect_alloc (fs, map,
801a044: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801a048: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801a04c: b9 e0 18 00 mv r3,r15 <== NOT EXECUTED
801a050: ba e0 20 00 mv r4,r23 <== NOT EXECUTED
801a054: 34 05 00 00 mvi r5,0 <== NOT EXECUTED
801a058: fb ff fc aa calli 8019300 <rtems_rfs_block_map_indirect_alloc><== NOT EXECUTED
801a05c: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
&map->singly_buffer,
&singly_block,
false);
if (rc > 0)
801a060: 4d c1 00 02 bge r14,r1,801a068 <rtems_rfs_block_map_grow+0x1b8><== NOT EXECUTED
801a064: e0 00 00 6b bi 801a210 <rtems_rfs_block_map_grow+0x360> <== 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) ||
801a068: 46 20 00 05 be r17,r0,801a07c <rtems_rfs_block_map_grow+0x1cc><== NOT EXECUTED
((doubly == 0) && (singly == RTEMS_RFS_INODE_BLOCKS)))
801a06c: 66 33 00 05 cmpei r19,r17,5 <== NOT EXECUTED
801a070: 66 41 00 00 cmpei r1,r18,0 <== 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) ||
801a074: a2 61 98 00 and r19,r19,r1 <== NOT EXECUTED
801a078: 46 60 00 10 be r19,r0,801a0b8 <rtems_rfs_block_map_grow+0x208><== 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,
801a07c: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801a080: 36 41 00 08 addi r1,r18,8 <== NOT EXECUTED
801a084: fb ff 9d 17 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a088: 29 67 00 08 lw r7,(r11+8) <== NOT EXECUTED
801a08c: 29 85 00 38 lw r5,(r12+56) <== NOT EXECUTED
801a090: b5 61 30 00 add r6,r11,r1 <== NOT EXECUTED
801a094: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801a098: e4 e5 28 00 cmpe r5,r7,r5 <== NOT EXECUTED
801a09c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801a0a0: ba 80 18 00 mv r3,r20 <== NOT EXECUTED
801a0a4: 34 c4 00 04 addi r4,r6,4 <== NOT EXECUTED
801a0a8: fb ff fc 96 calli 8019300 <rtems_rfs_block_map_indirect_alloc><== NOT EXECUTED
801a0ac: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
&map->doubly_buffer,
&map->blocks[doubly],
upping);
if (rc > 0)
801a0b0: 4c 01 00 12 bge r0,r1,801a0f8 <rtems_rfs_block_map_grow+0x248><== NOT EXECUTED
801a0b4: e0 00 00 0c bi 801a0e4 <rtems_rfs_block_map_grow+0x234> <== NOT EXECUTED
return rc;
}
}
else
{
rc = rtems_rfs_buffer_handle_request (fs, &map->doubly_buffer,
801a0b8: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801a0bc: 36 41 00 08 addi r1,r18,8 <== NOT EXECUTED
801a0c0: fb ff 9d 08 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a0c4: b5 61 18 00 add r3,r11,r1 <== NOT EXECUTED
801a0c8: 28 63 00 04 lw r3,(r3+4) <== NOT EXECUTED
801a0cc: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801a0d0: ba 80 10 00 mv r2,r20 <== NOT EXECUTED
801a0d4: 34 04 00 01 mvi r4,1 <== NOT EXECUTED
801a0d8: f8 00 02 6c calli 801aa88 <rtems_rfs_buffer_handle_request><== NOT EXECUTED
801a0dc: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
map->blocks[doubly], true);
if (rc > 0)
801a0e0: 4e 61 00 06 bge r19,r1,801a0f8 <rtems_rfs_block_map_grow+0x248><== NOT EXECUTED
{
rtems_rfs_group_bitmap_free (fs, false, singly_block);
801a0e4: 2b 83 00 44 lw r3,(sp+68) <== NOT EXECUTED
801a0e8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801a0ec: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801a0f0: fb ff d2 38 calli 800e9d0 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
801a0f4: e0 00 00 47 bi 801a210 <rtems_rfs_block_map_grow+0x360> <== NOT EXECUTED
rtems_rfs_group_bitmap_free (fs, false, block);
return rc;
}
}
rtems_rfs_block_set_number (&map->doubly_buffer,
801a0f8: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
801a0fc: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801a100: fb ff 9c f8 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a104: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
801a108: 29 61 00 4c lw r1,(r11+76) <== NOT EXECUTED
801a10c: 34 02 00 18 mvi r2,24 <== NOT EXECUTED
801a110: 28 31 00 1c lw r17,(r1+28) <== NOT EXECUTED
801a114: 2b 81 00 44 lw r1,(sp+68) <== NOT EXECUTED
801a118: b6 2d 88 00 add r17,r17,r13 <== NOT EXECUTED
801a11c: fb ff 9d 18 calli 800157c <__lshrsi3> <== NOT EXECUTED
801a120: 32 21 00 00 sb (r17+0),r1 <== NOT EXECUTED
801a124: 29 61 00 4c lw r1,(r11+76) <== NOT EXECUTED
801a128: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
801a12c: 28 31 00 1c lw r17,(r1+28) <== NOT EXECUTED
801a130: 2b 81 00 44 lw r1,(sp+68) <== NOT EXECUTED
801a134: b6 2d 88 00 add r17,r17,r13 <== NOT EXECUTED
801a138: fb ff 9d 11 calli 800157c <__lshrsi3> <== NOT EXECUTED
801a13c: 32 21 00 01 sb (r17+1),r1 <== NOT EXECUTED
801a140: 29 61 00 4c lw r1,(r11+76) <== NOT EXECUTED
801a144: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
801a148: 28 31 00 1c lw r17,(r1+28) <== NOT EXECUTED
801a14c: 2b 81 00 44 lw r1,(sp+68) <== NOT EXECUTED
801a150: b6 2d 88 00 add r17,r17,r13 <== NOT EXECUTED
801a154: fb ff 9d 0a calli 800157c <__lshrsi3> <== NOT EXECUTED
801a158: 32 21 00 02 sb (r17+2),r1 <== NOT EXECUTED
801a15c: 29 61 00 4c lw r1,(r11+76) <== NOT EXECUTED
801a160: 28 21 00 1c lw r1,(r1+28) <== NOT EXECUTED
801a164: b4 2d 68 00 add r13,r1,r13 <== NOT EXECUTED
801a168: 2b 81 00 44 lw r1,(sp+68) <== NOT EXECUTED
801a16c: 31 a1 00 03 sb (r13+3),r1 <== NOT EXECUTED
801a170: 31 75 00 44 sb (r11+68),r21 <== NOT EXECUTED
801a174: e0 00 00 2c bi 801a224 <rtems_rfs_block_map_grow+0x374> <== NOT EXECUTED
singly,
singly_block);
}
else
{
rc = rtems_rfs_buffer_handle_request (fs,
801a178: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801a17c: 36 41 00 08 addi r1,r18,8 <== NOT EXECUTED
801a180: fb ff 9c d8 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a184: b5 61 18 00 add r3,r11,r1 <== NOT EXECUTED
801a188: 28 63 00 04 lw r3,(r3+4) <== NOT EXECUTED
801a18c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801a190: ba 80 10 00 mv r2,r20 <== NOT EXECUTED
801a194: 34 04 00 01 mvi r4,1 <== NOT EXECUTED
801a198: f8 00 02 3c calli 801aa88 <rtems_rfs_buffer_handle_request><== NOT EXECUTED
801a19c: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
&map->doubly_buffer,
map->blocks[doubly],
true);
if (rc > 0)
801a1a0: 4c 01 00 02 bge r0,r1,801a1a8 <rtems_rfs_block_map_grow+0x2f8><== NOT EXECUTED
801a1a4: e0 00 00 1b bi 801a210 <rtems_rfs_block_map_grow+0x360> <== NOT EXECUTED
{
rtems_rfs_group_bitmap_free (fs, false, block);
return rc;
}
singly_block = rtems_rfs_block_get_number (&map->doubly_buffer,
801a1a8: 29 61 00 4c lw r1,(r11+76) <== NOT EXECUTED
801a1ac: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801a1b0: 28 2d 00 1c lw r13,(r1+28) <== NOT EXECUTED
801a1b4: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
801a1b8: fb ff 9c ca calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a1bc: b5 a1 68 00 add r13,r13,r1 <== NOT EXECUTED
801a1c0: 41 a1 00 00 lbu r1,(r13+0) <== NOT EXECUTED
801a1c4: 41 b1 00 03 lbu r17,(r13+3) <== NOT EXECUTED
801a1c8: 34 02 00 18 mvi r2,24 <== NOT EXECUTED
801a1cc: fb ff 9c c5 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a1d0: ba 21 88 00 or r17,r17,r1 <== NOT EXECUTED
801a1d4: 41 a1 00 01 lbu r1,(r13+1) <== NOT EXECUTED
801a1d8: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
801a1dc: fb ff 9c c1 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a1e0: ba 21 88 00 or r17,r17,r1 <== NOT EXECUTED
801a1e4: 41 a1 00 02 lbu r1,(r13+2) <== NOT EXECUTED
801a1e8: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
801a1ec: fb ff 9c bd calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a1f0: ba 21 18 00 or r3,r17,r1 <== NOT EXECUTED
801a1f4: 5b 83 00 44 sw (sp+68),r3 <== NOT EXECUTED
singly);
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
801a1f8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801a1fc: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
801a200: 34 04 00 01 mvi r4,1
801a204: f8 00 02 21 calli 801aa88 <rtems_rfs_buffer_handle_request>
801a208: b8 20 68 00 mv r13,r1
singly_block, true);
if (rc > 0)
801a20c: 4c 01 00 06 bge r0,r1,801a224 <rtems_rfs_block_map_grow+0x374><== ALWAYS TAKEN
{
rtems_rfs_group_bitmap_free (fs, false, block);
801a210: 2b 83 00 48 lw r3,(sp+72) <== NOT EXECUTED
801a214: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801a218: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801a21c: fb ff d1 ed calli 800e9d0 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
return rc;
801a220: e0 00 00 2d bi 801a2d4 <rtems_rfs_block_map_grow+0x424> <== NOT EXECUTED
}
}
}
rtems_rfs_block_set_number (&map->singly_buffer, direct, block);
801a224: b9 c0 08 00 mv r1,r14
801a228: 34 02 00 02 mvi r2,2
801a22c: fb ff 9c ad calli 80014e0 <__ashlsi3>
801a230: b8 20 68 00 mv r13,r1
801a234: 29 61 00 40 lw r1,(r11+64)
801a238: 34 02 00 18 mvi r2,24
801a23c: 28 2e 00 1c lw r14,(r1+28)
801a240: 2b 81 00 48 lw r1,(sp+72)
801a244: b5 cd 70 00 add r14,r14,r13
801a248: fb ff 9c cd calli 800157c <__lshrsi3>
801a24c: 31 c1 00 00 sb (r14+0),r1
801a250: 29 61 00 40 lw r1,(r11+64)
801a254: 34 02 00 10 mvi r2,16
801a258: 28 2e 00 1c lw r14,(r1+28)
801a25c: 2b 81 00 48 lw r1,(sp+72)
801a260: b5 cd 70 00 add r14,r14,r13
801a264: fb ff 9c c6 calli 800157c <__lshrsi3>
801a268: 31 c1 00 01 sb (r14+1),r1
801a26c: 29 61 00 40 lw r1,(r11+64)
801a270: 34 02 00 08 mvi r2,8
801a274: 28 2e 00 1c lw r14,(r1+28)
801a278: 2b 81 00 48 lw r1,(sp+72)
801a27c: b5 cd 70 00 add r14,r14,r13
801a280: fb ff 9c bf calli 800157c <__lshrsi3>
801a284: 31 c1 00 02 sb (r14+2),r1
801a288: 29 61 00 40 lw r1,(r11+64)
801a28c: 28 21 00 1c lw r1,(r1+28)
801a290: b4 2d 68 00 add r13,r1,r13
801a294: 2b 81 00 48 lw r1,(sp+72)
801a298: 31 a1 00 03 sb (r13+3),r1
801a29c: 31 75 00 38 sb (r11+56),r21
}
map->size.count++;
801a2a0: 29 61 00 08 lw r1,(r11+8)
map->size.offset = 0;
801a2a4: 59 60 00 0c sw (r11+12),r0
}
rtems_rfs_block_set_number (&map->singly_buffer, direct, block);
}
map->size.count++;
801a2a8: 34 21 00 01 addi r1,r1,1
801a2ac: 59 61 00 08 sw (r11+8),r1
map->size.offset = 0;
if (b == 0)
801a2b0: 5e 00 00 03 bne r16,r0,801a2bc <rtems_rfs_block_map_grow+0x40c><== NEVER TAKEN
*new_block = block;
801a2b4: 2b 81 00 48 lw r1,(sp+72)
801a2b8: 5b 21 00 00 sw (r25+0),r1
map->last_data_block = block;
801a2bc: 2b 81 00 48 lw r1,(sp+72)
map->dirty = true;
801a2c0: 31 75 00 00 sb (r11+0),r21
/*
* 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++)
801a2c4: 36 10 00 01 addi r16,r16,1
map->size.count++;
map->size.offset = 0;
if (b == 0)
*new_block = block;
map->last_data_block = block;
801a2c8: 59 61 00 20 sw (r11+32),r1
/*
* 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++)
801a2cc: 56 d0 ff 23 bgu r22,r16,8019f58 <rtems_rfs_block_map_grow+0xa8>
*new_block = block;
map->last_data_block = block;
map->dirty = true;
}
return 0;
801a2d0: 34 0d 00 00 mvi r13,0
}
801a2d4: b9 a0 08 00 mv r1,r13
801a2d8: 2b 9d 00 04 lw ra,(sp+4)
801a2dc: 2b 8b 00 40 lw r11,(sp+64)
801a2e0: 2b 8c 00 3c lw r12,(sp+60)
801a2e4: 2b 8d 00 38 lw r13,(sp+56)
801a2e8: 2b 8e 00 34 lw r14,(sp+52)
801a2ec: 2b 8f 00 30 lw r15,(sp+48)
801a2f0: 2b 90 00 2c lw r16,(sp+44)
801a2f4: 2b 91 00 28 lw r17,(sp+40)
801a2f8: 2b 92 00 24 lw r18,(sp+36)
801a2fc: 2b 93 00 20 lw r19,(sp+32)
801a300: 2b 94 00 1c lw r20,(sp+28)
801a304: 2b 95 00 18 lw r21,(sp+24)
801a308: 2b 96 00 14 lw r22,(sp+20)
801a30c: 2b 97 00 10 lw r23,(sp+16)
801a310: 2b 98 00 0c lw r24,(sp+12)
801a314: 2b 99 00 08 lw r25,(sp+8)
801a318: 37 9c 00 48 addi sp,sp,72
801a31c: c3 a0 00 00 ret
08019300 <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)
{
8019300: 37 9c ff d8 addi sp,sp,-40
8019304: 5b 8b 00 24 sw (sp+36),r11
8019308: 5b 8c 00 20 sw (sp+32),r12
801930c: 5b 8d 00 1c sw (sp+28),r13
8019310: 5b 8e 00 18 sw (sp+24),r14
8019314: 5b 8f 00 14 sw (sp+20),r15
8019318: 5b 90 00 10 sw (sp+16),r16
801931c: 5b 91 00 0c sw (sp+12),r17
8019320: 5b 92 00 08 sw (sp+8),r18
8019324: 5b 9d 00 04 sw (sp+4),ra
8019328: b8 40 70 00 mv r14,r2
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);
801932c: 28 42 00 1c lw r2,(r2+28)
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)
{
8019330: b8 60 58 00 mv r11,r3
8019334: b8 80 78 00 mv r15,r4
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);
8019338: 34 03 00 00 mvi r3,0
801933c: 37 84 00 28 addi r4,sp,40
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)
{
8019340: b8 20 68 00 mv r13,r1
8019344: b8 a0 80 00 mv r16,r5
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);
8019348: fb ff d5 0a calli 800e770 <rtems_rfs_group_bitmap_alloc>
801934c: b8 20 60 00 mv r12,r1
if (rc > 0)
8019350: 48 20 00 47 bg r1,r0,801946c <rtems_rfs_block_map_indirect_alloc+0x16c><== NEVER TAKEN
return rc;
rc = rtems_rfs_buffer_handle_request (fs, buffer, new_block, false);
8019354: 2b 83 00 28 lw r3,(sp+40)
8019358: b9 a0 08 00 mv r1,r13
801935c: b9 60 10 00 mv r2,r11
8019360: 34 04 00 00 mvi r4,0
8019364: f8 00 05 c9 calli 801aa88 <rtems_rfs_buffer_handle_request>
8019368: b8 20 60 00 mv r12,r1
if (rc > 0)
801936c: 4c 01 00 06 bge r0,r1,8019384 <rtems_rfs_block_map_indirect_alloc+0x84><== ALWAYS TAKEN
{
rtems_rfs_group_bitmap_free (fs, false, new_block);
8019370: 2b 83 00 28 lw r3,(sp+40) <== NOT EXECUTED
8019374: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
8019378: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801937c: fb ff d5 95 calli 800e9d0 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
return rc;
8019380: e0 00 00 3b bi 801946c <rtems_rfs_block_map_indirect_alloc+0x16c><== NOT EXECUTED
}
memset (rtems_rfs_buffer_data (buffer), 0xff, rtems_rfs_fs_block_size (fs));
8019384: 29 61 00 08 lw r1,(r11+8)
8019388: 29 a3 00 08 lw r3,(r13+8)
801938c: 34 02 00 ff mvi r2,255
8019390: 28 21 00 1c lw r1,(r1+28)
8019394: f8 00 24 1c calli 8022404 <memset>
if (upping)
8019398: 46 00 00 2f be r16,r0,8019454 <rtems_rfs_block_map_indirect_alloc+0x154><== NEVER TAKEN
{
int b;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
801939c: 34 01 00 00 mvi r1,0
80193a0: 34 02 20 00 mvi r2,8192
80193a4: fb ff de 61 calli 8010d28 <rtems_rfs_trace>
80193a8: 44 20 00 05 be r1,r0,80193bc <rtems_rfs_block_map_indirect_alloc+0xbc><== ALWAYS TAKEN
printf ("rtems-rfs: block-map-grow: upping: block-count=%" PRId32 "\n",
80193ac: 29 c2 00 08 lw r2,(r14+8) <== NOT EXECUTED
80193b0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
80193b4: 38 21 7c e8 ori r1,r1,0x7ce8 <== NOT EXECUTED
80193b8: f8 00 24 af calli 8022674 <printf> <== NOT EXECUTED
80193bc: b9 c0 68 00 mv r13,r14
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)
{
80193c0: 34 0c 00 00 mvi r12,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]);
80193c4: 34 11 00 01 mvi r17,1
{
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++)
80193c8: 34 10 00 14 mvi r16,20
rtems_rfs_block_set_number (buffer, b, map->blocks[b]);
80193cc: 29 61 00 08 lw r1,(r11+8)
80193d0: 34 02 00 18 mvi r2,24
80193d4: 28 32 00 1c lw r18,(r1+28)
80193d8: 29 a1 00 24 lw r1,(r13+36)
80193dc: b6 4c 90 00 add r18,r18,r12
80193e0: fb ff a0 67 calli 800157c <__lshrsi3>
80193e4: 32 41 00 00 sb (r18+0),r1
80193e8: 29 61 00 08 lw r1,(r11+8)
80193ec: 34 02 00 10 mvi r2,16
80193f0: 28 32 00 1c lw r18,(r1+28)
80193f4: 29 a1 00 24 lw r1,(r13+36)
80193f8: b6 4c 90 00 add r18,r18,r12
80193fc: fb ff a0 60 calli 800157c <__lshrsi3>
8019400: 32 41 00 01 sb (r18+1),r1
8019404: 29 61 00 08 lw r1,(r11+8)
8019408: 34 02 00 08 mvi r2,8
801940c: 28 32 00 1c lw r18,(r1+28)
8019410: 29 a1 00 24 lw r1,(r13+36)
8019414: b6 4c 90 00 add r18,r18,r12
8019418: fb ff a0 59 calli 800157c <__lshrsi3>
801941c: 32 41 00 02 sb (r18+2),r1
8019420: 29 61 00 08 lw r1,(r11+8)
8019424: 29 a2 00 24 lw r2,(r13+36)
8019428: 35 ad 00 04 addi r13,r13,4
801942c: 28 21 00 1c lw r1,(r1+28)
8019430: b4 2c 08 00 add r1,r1,r12
8019434: 30 22 00 03 sb (r1+3),r2
8019438: 31 71 00 00 sb (r11+0),r17
801943c: 35 8c 00 04 addi r12,r12,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++)
8019440: 5d 90 ff e3 bne r12,r16,80193cc <rtems_rfs_block_map_indirect_alloc+0xcc>
rtems_rfs_block_set_number (buffer, b, map->blocks[b]);
memset (map->blocks, 0, sizeof (map->blocks));
8019444: 35 c1 00 24 addi r1,r14,36
8019448: 34 02 00 00 mvi r2,0
801944c: 34 03 00 14 mvi r3,20
8019450: f8 00 23 ed calli 8022404 <memset>
}
rtems_rfs_buffer_mark_dirty (buffer);
8019454: 34 01 00 01 mvi r1,1
8019458: 31 61 00 00 sb (r11+0),r1
*block = new_block;
801945c: 2b 81 00 28 lw r1,(sp+40)
map->last_map_block = new_block;
return 0;
8019460: 34 0c 00 00 mvi r12,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;
8019464: 59 e1 00 00 sw (r15+0),r1
map->last_map_block = new_block;
8019468: 59 c1 00 1c sw (r14+28),r1
return 0;
}
801946c: b9 80 08 00 mv r1,r12
8019470: 2b 9d 00 04 lw ra,(sp+4)
8019474: 2b 8b 00 24 lw r11,(sp+36)
8019478: 2b 8c 00 20 lw r12,(sp+32)
801947c: 2b 8d 00 1c lw r13,(sp+28)
8019480: 2b 8e 00 18 lw r14,(sp+24)
8019484: 2b 8f 00 14 lw r15,(sp+20)
8019488: 2b 90 00 10 lw r16,(sp+16)
801948c: 2b 91 00 0c lw r17,(sp+12)
8019490: 2b 92 00 08 lw r18,(sp+8)
8019494: 37 9c 00 28 addi sp,sp,40
8019498: c3 a0 00 00 ret
0801949c <rtems_rfs_block_map_indirect_shrink.clone.6>:
* @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,
801949c: 37 9c ff dc addi sp,sp,-36
80194a0: 5b 8b 00 24 sw (sp+36),r11
80194a4: 5b 8c 00 20 sw (sp+32),r12
80194a8: 5b 8d 00 1c sw (sp+28),r13
80194ac: 5b 8e 00 18 sw (sp+24),r14
80194b0: 5b 8f 00 14 sw (sp+20),r15
80194b4: 5b 90 00 10 sw (sp+16),r16
80194b8: 5b 91 00 0c sw (sp+12),r17
80194bc: 5b 92 00 08 sw (sp+8),r18
80194c0: 5b 9d 00 04 sw (sp+4),ra
80194c4: b8 20 80 00 mv r16,r1
80194c8: b8 40 60 00 mv r12,r2
80194cc: b8 60 70 00 mv r14,r3
80194d0: b8 80 58 00 mv r11,r4
80194d4: b8 a0 68 00 mv r13,r5
* 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) ||
80194d8: 44 a0 00 06 be r5,r0,80194f0 <rtems_rfs_block_map_indirect_shrink.clone.6+0x54><== NEVER TAKEN
((indirect == 0) && (index == RTEMS_RFS_INODE_BLOCKS)))
80194dc: 64 81 00 00 cmpei r1,r4,0
80194e0: 64 a2 00 05 cmpei r2,r5,5
* 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) ||
80194e4: a0 41 10 00 and r2,r2,r1
rtems_rfs_block_map* map,
rtems_rfs_buffer_handle* buffer,
rtems_rfs_block_no indirect,
rtems_rfs_block_no index)
{
int rc = 0;
80194e8: 34 01 00 00 mvi r1,0
* 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) ||
80194ec: 44 40 00 2a be r2,r0,8019594 <rtems_rfs_block_map_indirect_shrink.clone.6+0xf8>
((indirect == 0) && (index == RTEMS_RFS_INODE_BLOCKS)))
{
rtems_rfs_block_no block_to_free = map->blocks[indirect];
80194f0: 35 61 00 08 addi r1,r11,8
80194f4: 34 02 00 02 mvi r2,2
if ((indirect == 0) && (index == RTEMS_RFS_INODE_BLOCKS))
80194f8: 65 ad 00 05 cmpei r13,r13,5
80194fc: 65 6b 00 00 cmpei r11,r11,0
* 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];
8019500: fb ff 9f f8 calli 80014e0 <__ashlsi3>
8019504: b5 81 10 00 add r2,r12,r1
if ((indirect == 0) && (index == RTEMS_RFS_INODE_BLOCKS))
8019508: a1 ab 58 00 and r11,r13,r11
* 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];
801950c: 28 4f 00 04 lw r15,(r2+4)
if ((indirect == 0) && (index == RTEMS_RFS_INODE_BLOCKS))
8019510: 45 60 00 1a be r11,r0,8019578 <rtems_rfs_block_map_indirect_shrink.clone.6+0xdc><== NEVER TAKEN
/*
* 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);
8019514: 29 c1 00 00 lw r1,(r14+0)
8019518: 34 0d 00 00 mvi r13,0
if ((index == 0) ||
((indirect == 0) && (index == RTEMS_RFS_INODE_BLOCKS)))
{
rtems_rfs_block_no block_to_free = map->blocks[indirect];
if ((indirect == 0) && (index == RTEMS_RFS_INODE_BLOCKS))
801951c: b9 80 70 00 mv r14,r12
8019520: 28 2b 00 1c lw r11,(r1+28)
{
/*
* Move to direct inode access.
*/
int b;
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
8019524: 34 11 00 05 mvi r17,5
map->blocks[b] = rtems_rfs_block_get_number (buffer, b);
8019528: 41 61 00 00 lbu r1,(r11+0)
801952c: 34 02 00 18 mvi r2,24
{
/*
* Move to direct inode access.
*/
int b;
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
8019530: 35 ad 00 01 addi r13,r13,1
map->blocks[b] = rtems_rfs_block_get_number (buffer, b);
8019534: fb ff 9f eb calli 80014e0 <__ashlsi3>
8019538: b8 20 90 00 mv r18,r1
801953c: 41 61 00 01 lbu r1,(r11+1)
8019540: 34 02 00 10 mvi r2,16
8019544: fb ff 9f e7 calli 80014e0 <__ashlsi3>
8019548: ba 41 10 00 or r2,r18,r1
801954c: 41 72 00 03 lbu r18,(r11+3)
8019550: 41 61 00 02 lbu r1,(r11+2)
{
/*
* Move to direct inode access.
*/
int b;
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
8019554: 35 6b 00 04 addi r11,r11,4
map->blocks[b] = rtems_rfs_block_get_number (buffer, b);
8019558: b8 52 90 00 or r18,r2,r18
801955c: 34 02 00 08 mvi r2,8
8019560: fb ff 9f e0 calli 80014e0 <__ashlsi3>
8019564: ba 41 10 00 or r2,r18,r1
8019568: 59 c2 00 24 sw (r14+36),r2
{
/*
* Move to direct inode access.
*/
int b;
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
801956c: 35 ce 00 04 addi r14,r14,4
8019570: 5d b1 ff ee bne r13,r17,8019528 <rtems_rfs_block_map_indirect_shrink.clone.6+0x8c>
8019574: e0 00 00 02 bi 801957c <rtems_rfs_block_map_indirect_shrink.clone.6+0xe0>
else
{
/*
* One less singly indirect block in the inode.
*/
map->blocks[indirect] = 0;
8019578: 58 40 00 04 sw (r2+4),r0 <== NOT EXECUTED
}
rc = rtems_rfs_group_bitmap_free (fs, false, block_to_free);
801957c: ba 00 08 00 mv r1,r16
8019580: 34 02 00 00 mvi r2,0
8019584: b9 e0 18 00 mv r3,r15
8019588: fb ff d5 12 calli 800e9d0 <rtems_rfs_group_bitmap_free>
if (rc > 0)
801958c: 48 20 00 02 bg r1,r0,8019594 <rtems_rfs_block_map_indirect_shrink.clone.6+0xf8><== NEVER TAKEN
return rc;
map->last_map_block = block_to_free;
8019590: 59 8f 00 1c sw (r12+28),r15
}
return rc;
}
8019594: 2b 9d 00 04 lw ra,(sp+4)
8019598: 2b 8b 00 24 lw r11,(sp+36)
801959c: 2b 8c 00 20 lw r12,(sp+32)
80195a0: 2b 8d 00 1c lw r13,(sp+28)
80195a4: 2b 8e 00 18 lw r14,(sp+24)
80195a8: 2b 8f 00 14 lw r15,(sp+20)
80195ac: 2b 90 00 10 lw r16,(sp+16)
80195b0: 2b 91 00 0c lw r17,(sp+12)
80195b4: 2b 92 00 08 lw r18,(sp+8)
80195b8: 37 9c 00 24 addi sp,sp,36
80195bc: c3 a0 00 00 ret
08019758 <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)
{
8019758: 37 9c ff dc addi sp,sp,-36
801975c: 5b 8b 00 24 sw (sp+36),r11
8019760: 5b 8c 00 20 sw (sp+32),r12
8019764: 5b 8d 00 1c sw (sp+28),r13
8019768: 5b 8e 00 18 sw (sp+24),r14
801976c: 5b 8f 00 14 sw (sp+20),r15
8019770: 5b 90 00 10 sw (sp+16),r16
8019774: 5b 91 00 0c sw (sp+12),r17
8019778: 5b 92 00 08 sw (sp+8),r18
801977c: 5b 9d 00 04 sw (sp+4),ra
* 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;
8019780: 30 60 00 00 sb (r3+0),r0
map->inode = NULL;
8019784: 58 60 00 04 sw (r3+4),r0
* @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;
8019788: 58 60 00 08 sw (r3+8),r0
size->offset = 0;
801978c: 58 60 00 0c sw (r3+12),r0
* @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;
8019790: 58 60 00 10 sw (r3+16),r0
bpos->boff = 0;
8019794: 58 60 00 14 sw (r3+20),r0
bpos->block = 0;
8019798: 58 60 00 18 sw (r3+24),r0
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
801979c: 30 60 00 38 sb (r3+56),r0
handle->bnum = 0;
80197a0: 58 60 00 3c sw (r3+60),r0
handle->buffer = NULL;
80197a4: 58 60 00 40 sw (r3+64),r0
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
80197a8: 30 60 00 44 sb (r3+68),r0
handle->bnum = 0;
80197ac: 58 60 00 48 sw (r3+72),r0
handle->buffer = NULL;
80197b0: 58 60 00 4c sw (r3+76),r0
int
rtems_rfs_block_map_open (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* inode,
rtems_rfs_block_map* map)
{
80197b4: b8 20 78 00 mv r15,r1
80197b8: b8 40 70 00 mv r14,r2
80197bc: b8 60 58 00 mv r11,r3
return rc;
rc = rtems_rfs_buffer_handle_open (fs, &map->doubly_buffer);
if (rc > 0)
return rc;
rc = rtems_rfs_inode_load (fs, inode);
80197c0: fb ff d5 46 calli 800ecd8 <rtems_rfs_inode_load>
80197c4: b8 20 60 00 mv r12,r1
if (rc > 0)
80197c8: 4c 01 00 0e bge r0,r1,8019800 <rtems_rfs_block_map_open+0xa8><== ALWAYS TAKEN
*/
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);
80197cc: 35 62 00 38 addi r2,r11,56 <== NOT EXECUTED
80197d0: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
80197d4: f8 00 04 3e calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
80197d8: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
handle->dirty = false;
80197dc: 31 60 00 38 sb (r11+56),r0 <== NOT EXECUTED
handle->bnum = 0;
80197e0: 59 60 00 3c sw (r11+60),r0 <== NOT EXECUTED
handle->buffer = NULL;
80197e4: 59 60 00 40 sw (r11+64),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);
80197e8: 35 62 00 44 addi r2,r11,68 <== NOT EXECUTED
80197ec: f8 00 04 38 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
handle->dirty = false;
80197f0: 31 60 00 44 sb (r11+68),r0 <== NOT EXECUTED
handle->bnum = 0;
80197f4: 59 60 00 48 sw (r11+72),r0 <== NOT EXECUTED
handle->buffer = NULL;
80197f8: 59 60 00 4c sw (r11+76),r0 <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &map->singly_buffer);
rtems_rfs_buffer_handle_close (fs, &map->doubly_buffer);
return rc;
80197fc: e0 00 00 52 bi 8019944 <rtems_rfs_block_map_open+0x1ec> <== NOT EXECUTED
int
rtems_rfs_block_map_free_all (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map)
{
return rtems_rfs_block_map_shrink (fs, map, map->size.count);
}
8019800: 29 cc 00 0c lw r12,(r14+12)
/*
* Extract the block and block count data from the inode into the targets
* byte order.
*/
map->inode = inode;
8019804: 59 6e 00 04 sw (r11+4),r14
int
rtems_rfs_block_map_free_all (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map)
{
return rtems_rfs_block_map_shrink (fs, map, map->size.count);
}
8019808: b9 60 80 00 mv r16,r11
* @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]);
801980c: 35 8d 00 1c addi r13,r12,28
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,
8019810: 35 91 00 30 addi r17,r12,48
8019814: 41 a1 00 00 lbu r1,(r13+0)
8019818: 34 02 00 18 mvi r2,24
801981c: fb ff 9f 31 calli 80014e0 <__ashlsi3>
8019820: b8 20 90 00 mv r18,r1
8019824: 41 a1 00 01 lbu r1,(r13+1)
8019828: 34 02 00 10 mvi r2,16
801982c: fb ff 9f 2d calli 80014e0 <__ashlsi3>
8019830: ba 41 08 00 or r1,r18,r1
8019834: 41 b2 00 03 lbu r18,(r13+3)
8019838: 34 02 00 08 mvi r2,8
801983c: b8 32 90 00 or r18,r1,r18
8019840: 41 a1 00 02 lbu r1,(r13+2)
* 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++)
map->blocks[b] = rtems_rfs_inode_get_block (inode, b);
8019844: 35 ad 00 04 addi r13,r13,4
8019848: fb ff 9f 26 calli 80014e0 <__ashlsi3>
801984c: ba 41 08 00 or r1,r18,r1
8019850: 5a 01 00 24 sw (r16+36),r1
8019854: 36 10 00 04 addi r16,r16,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++)
8019858: 5d b1 ff ef bne r13,r17,8019814 <rtems_rfs_block_map_open+0xbc>
* @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);
801985c: 41 81 00 0c lbu r1,(r12+12)
8019860: 35 8d 00 0c addi r13,r12,12
8019864: 41 b0 00 03 lbu r16,(r13+3)
8019868: 34 02 00 18 mvi r2,24
801986c: fb ff 9f 1d calli 80014e0 <__ashlsi3>
8019870: ba 01 80 00 or r16,r16,r1
8019874: 41 a1 00 01 lbu r1,(r13+1)
8019878: 34 02 00 10 mvi r2,16
801987c: fb ff 9f 19 calli 80014e0 <__ashlsi3>
8019880: ba 01 80 00 or r16,r16,r1
8019884: 41 a1 00 02 lbu r1,(r13+2)
8019888: 34 02 00 08 mvi r2,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);
801988c: 35 8d 00 0a addi r13,r12,10
* @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);
8019890: fb ff 9f 14 calli 80014e0 <__ashlsi3>
8019894: ba 01 08 00 or r1,r16,r1
map->blocks[b] = rtems_rfs_inode_get_block (inode, b);
map->size.count = rtems_rfs_inode_get_block_count (inode);
8019898: 59 61 00 08 sw (r11+8),r1
* @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);
801989c: 41 81 00 0a lbu r1,(r12+10)
80198a0: 34 02 00 08 mvi r2,8
80198a4: fb ff 9f 0f calli 80014e0 <__ashlsi3>
80198a8: 41 a2 00 01 lbu r2,(r13+1)
* @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);
80198ac: 35 8d 00 30 addi r13,r12,48
* @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);
80198b0: b8 22 08 00 or r1,r1,r2
map->size.offset = rtems_rfs_inode_get_block_offset (inode);
80198b4: 20 21 ff ff andi r1,r1,0xffff
80198b8: 59 61 00 0c sw (r11+12),r1
* @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);
80198bc: 41 81 00 30 lbu r1,(r12+48)
80198c0: 41 b0 00 03 lbu r16,(r13+3)
80198c4: 34 02 00 18 mvi r2,24
80198c8: fb ff 9f 06 calli 80014e0 <__ashlsi3>
80198cc: ba 01 80 00 or r16,r16,r1
80198d0: 41 a1 00 01 lbu r1,(r13+1)
80198d4: 34 02 00 10 mvi r2,16
80198d8: fb ff 9f 02 calli 80014e0 <__ashlsi3>
80198dc: ba 01 80 00 or r16,r16,r1
80198e0: 41 a1 00 02 lbu r1,(r13+2)
80198e4: 34 02 00 08 mvi r2,8
* @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);
80198e8: 35 8d 00 34 addi r13,r12,52
* @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);
80198ec: fb ff 9e fd calli 80014e0 <__ashlsi3>
80198f0: ba 01 08 00 or r1,r16,r1
map->last_map_block = rtems_rfs_inode_get_last_map_block (inode);
80198f4: 59 61 00 1c sw (r11+28),r1
* @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);
80198f8: 41 81 00 34 lbu r1,(r12+52)
80198fc: 41 b0 00 03 lbu r16,(r13+3)
8019900: 34 02 00 18 mvi r2,24
8019904: fb ff 9e f7 calli 80014e0 <__ashlsi3>
8019908: ba 01 60 00 or r12,r16,r1
801990c: 41 a1 00 01 lbu r1,(r13+1)
8019910: 34 02 00 10 mvi r2,16
8019914: fb ff 9e f3 calli 80014e0 <__ashlsi3>
8019918: b9 81 60 00 or r12,r12,r1
801991c: 41 a1 00 02 lbu r1,(r13+2)
8019920: 34 02 00 08 mvi r2,8
8019924: fb ff 9e ef calli 80014e0 <__ashlsi3>
8019928: b9 81 08 00 or r1,r12,r1
map->last_data_block = rtems_rfs_inode_get_last_data_block (inode);
801992c: 59 61 00 20 sw (r11+32),r1
rc = rtems_rfs_inode_unload (fs, inode, false);
8019930: b9 c0 10 00 mv r2,r14
8019934: b9 e0 08 00 mv r1,r15
8019938: 34 03 00 00 mvi r3,0
801993c: fb ff d5 5d calli 800eeb0 <rtems_rfs_inode_unload>
8019940: b8 20 60 00 mv r12,r1
return rc;
}
8019944: b9 80 08 00 mv r1,r12
8019948: 2b 9d 00 04 lw ra,(sp+4)
801994c: 2b 8b 00 24 lw r11,(sp+36)
8019950: 2b 8c 00 20 lw r12,(sp+32)
8019954: 2b 8d 00 1c lw r13,(sp+28)
8019958: 2b 8e 00 18 lw r14,(sp+24)
801995c: 2b 8f 00 14 lw r15,(sp+20)
8019960: 2b 90 00 10 lw r16,(sp+16)
8019964: 2b 91 00 0c lw r17,(sp+12)
8019968: 2b 92 00 08 lw r18,(sp+8)
801996c: 37 9c 00 24 addi sp,sp,36
8019970: c3 a0 00 00 ret
0801a320 <rtems_rfs_block_map_shrink>:
int
rtems_rfs_block_map_shrink (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
size_t blocks)
{
801a320: 37 9c ff c0 addi sp,sp,-64
801a324: 5b 8b 00 40 sw (sp+64),r11
801a328: 5b 8c 00 3c sw (sp+60),r12
801a32c: 5b 8d 00 38 sw (sp+56),r13
801a330: 5b 8e 00 34 sw (sp+52),r14
801a334: 5b 8f 00 30 sw (sp+48),r15
801a338: 5b 90 00 2c sw (sp+44),r16
801a33c: 5b 91 00 28 sw (sp+40),r17
801a340: 5b 92 00 24 sw (sp+36),r18
801a344: 5b 93 00 20 sw (sp+32),r19
801a348: 5b 94 00 1c sw (sp+28),r20
801a34c: 5b 95 00 18 sw (sp+24),r21
801a350: 5b 96 00 14 sw (sp+20),r22
801a354: 5b 97 00 10 sw (sp+16),r23
801a358: 5b 98 00 0c sw (sp+12),r24
801a35c: 5b 99 00 08 sw (sp+8),r25
801a360: 5b 9d 00 04 sw (sp+4),ra
801a364: b8 20 60 00 mv r12,r1
801a368: b8 40 58 00 mv r11,r2
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_SHRINK))
801a36c: 34 01 00 00 mvi r1,0
801a370: 34 02 40 00 mvi r2,16384
int
rtems_rfs_block_map_shrink (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
size_t blocks)
{
801a374: b8 60 68 00 mv r13,r3
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_SHRINK))
801a378: fb ff da 6c calli 8010d28 <rtems_rfs_trace>
801a37c: 44 20 00 06 be r1,r0,801a394 <rtems_rfs_block_map_shrink+0x74><== ALWAYS TAKEN
printf ("rtems-rfs: block-map-shrink: entry: blocks=%zd count=%" PRIu32 "\n",
801a380: 29 63 00 08 lw r3,(r11+8) <== NOT EXECUTED
801a384: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801a388: 38 21 7d 54 ori r1,r1,0x7d54 <== NOT EXECUTED
801a38c: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801a390: f8 00 20 b9 calli 8022674 <printf> <== NOT EXECUTED
blocks, map->size.count);
if (map->size.count == 0)
801a394: 29 61 00 08 lw r1,(r11+8)
return 0;
801a398: 34 06 00 00 mvi r6,0
{
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)
801a39c: 44 20 00 be be r1,r0,801a694 <rtems_rfs_block_map_shrink+0x374>
801a3a0: 50 2d 00 a0 bgeu r1,r13,801a620 <rtems_rfs_block_map_shrink+0x300><== ALWAYS TAKEN
801a3a4: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
801a3a8: e0 00 00 9e bi 801a620 <rtems_rfs_block_map_shrink+0x300> <== NOT EXECUTED
{
rtems_rfs_block_no block;
rtems_rfs_block_no block_to_free;
int rc;
block = map->size.count - 1;
801a3ac: 29 61 00 08 lw r1,(r11+8)
801a3b0: 34 2f ff ff addi r15,r1,-1
if (block < RTEMS_RFS_INODE_BLOCKS)
801a3b4: 55 f8 00 08 bgu r15,r24,801a3d4 <rtems_rfs_block_map_shrink+0xb4>
{
/*
* We have less than RTEMS_RFS_INODE_BLOCKS so they are held in the
* inode.
*/
block_to_free = map->blocks[block];
801a3b8: 34 21 00 07 addi r1,r1,7
801a3bc: 34 02 00 02 mvi r2,2
801a3c0: fb ff 9c 48 calli 80014e0 <__ashlsi3>
801a3c4: b5 61 08 00 add r1,r11,r1
801a3c8: 28 2f 00 04 lw r15,(r1+4)
map->blocks[block] = 0;
801a3cc: 58 20 00 04 sw (r1+4),r0
801a3d0: e0 00 00 86 bi 801a5e8 <rtems_rfs_block_map_shrink+0x2c8>
* table of block numbers.
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = block % fs->blocks_per_block;
801a3d4: 29 90 00 34 lw r16,(r12+52)
801a3d8: b9 e0 08 00 mv r1,r15
801a3dc: ba 00 10 00 mv r2,r16
801a3e0: f8 00 67 c9 calli 8034304 <__umodsi3>
singly = block / fs->blocks_per_block;
801a3e4: ba 00 10 00 mv r2,r16
* table of block numbers.
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = block % fs->blocks_per_block;
801a3e8: b8 20 70 00 mv r14,r1
singly = block / fs->blocks_per_block;
801a3ec: b9 e0 08 00 mv r1,r15
801a3f0: fb ff 9c 96 calli 8001648 <__udivsi3>
if (block < fs->block_map_singly_blocks)
801a3f4: 29 82 00 38 lw r2,(r12+56)
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = block % fs->blocks_per_block;
singly = block / fs->blocks_per_block;
801a3f8: b8 20 88 00 mv r17,r1
if (block < fs->block_map_singly_blocks)
801a3fc: 51 e2 00 2b bgeu r15,r2,801a4a8 <rtems_rfs_block_map_shrink+0x188><== NEVER TAKEN
{
/*
* Request the indirect block and then obtain the block number from the
* indirect block.
*/
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
801a400: 34 02 00 02 mvi r2,2
801a404: 34 21 00 08 addi r1,r1,8
801a408: fb ff 9c 36 calli 80014e0 <__ashlsi3>
801a40c: b5 61 20 00 add r4,r11,r1
801a410: 28 83 00 04 lw r3,(r4+4)
801a414: b9 80 08 00 mv r1,r12
801a418: ba 40 10 00 mv r2,r18
801a41c: 34 04 00 01 mvi r4,1
801a420: f8 00 01 9a calli 801aa88 <rtems_rfs_buffer_handle_request>
801a424: b8 20 30 00 mv r6,r1
map->blocks[singly], true);
if (rc > 0)
801a428: 48 20 00 9b bg r1,r0,801a694 <rtems_rfs_block_map_shrink+0x374><== NEVER TAKEN
return rc;
block_to_free = rtems_rfs_block_get_number (&map->singly_buffer,
801a42c: 29 61 00 40 lw r1,(r11+64)
801a430: 34 02 00 02 mvi r2,2
801a434: 28 2f 00 1c lw r15,(r1+28)
801a438: b9 c0 08 00 mv r1,r14
801a43c: fb ff 9c 29 calli 80014e0 <__ashlsi3>
801a440: b5 e1 28 00 add r5,r15,r1
801a444: 40 b9 00 00 lbu r25,(r5+0)
801a448: 40 b3 00 01 lbu r19,(r5+1)
801a44c: 40 b0 00 02 lbu r16,(r5+2)
801a450: 40 af 00 03 lbu r15,(r5+3)
direct);
rc = rtems_rfs_block_map_indirect_shrink (fs, map, &map->singly_buffer,
801a454: b9 80 08 00 mv r1,r12
801a458: b9 60 10 00 mv r2,r11
801a45c: ba a0 18 00 mv r3,r21
801a460: ba 20 20 00 mv r4,r17
801a464: b9 c0 28 00 mv r5,r14
801a468: fb ff fc 0d calli 801949c <rtems_rfs_block_map_indirect_shrink.clone.6>
801a46c: b8 20 30 00 mv r6,r1
singly, direct);
if (rc)
801a470: 5c 20 00 89 bne r1,r0,801a694 <rtems_rfs_block_map_shrink+0x374><== NEVER TAKEN
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,
801a474: 34 02 00 18 mvi r2,24
801a478: bb 20 08 00 mv r1,r25
801a47c: fb ff 9c 19 calli 80014e0 <__ashlsi3>
801a480: b9 e1 78 00 or r15,r15,r1
801a484: 34 02 00 10 mvi r2,16
801a488: ba 60 08 00 mv r1,r19
801a48c: fb ff 9c 15 calli 80014e0 <__ashlsi3>
801a490: b9 e1 78 00 or r15,r15,r1
801a494: 34 02 00 08 mvi r2,8
801a498: ba 00 08 00 mv r1,r16
801a49c: fb ff 9c 11 calli 80014e0 <__ashlsi3>
801a4a0: b9 e1 78 00 or r15,r15,r1
801a4a4: e0 00 00 51 bi 801a5e8 <rtems_rfs_block_map_shrink+0x2c8>
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)
801a4a8: 29 82 00 3c lw r2,(r12+60) <== NOT EXECUTED
801a4ac: 51 e2 00 64 bgeu r15,r2,801a63c <rtems_rfs_block_map_shrink+0x31c><== 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;
801a4b0: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
801a4b4: fb ff 9c 65 calli 8001648 <__udivsi3> <== NOT EXECUTED
doubly_singly = singly % fs->blocks_per_block;
rc = rtems_rfs_buffer_handle_request (fs, &map->doubly_buffer,
801a4b8: 34 02 00 02 mvi r2,2 <== 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;
801a4bc: b8 20 98 00 mv r19,r1 <== NOT EXECUTED
doubly_singly = singly % fs->blocks_per_block;
rc = rtems_rfs_buffer_handle_request (fs, &map->doubly_buffer,
801a4c0: 34 21 00 08 addi r1,r1,8 <== NOT EXECUTED
801a4c4: fb ff 9c 07 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a4c8: b5 61 20 00 add r4,r11,r1 <== NOT EXECUTED
801a4cc: 28 83 00 04 lw r3,(r4+4) <== NOT EXECUTED
801a4d0: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801a4d4: ba e0 10 00 mv r2,r23 <== NOT EXECUTED
801a4d8: 34 04 00 01 mvi r4,1 <== NOT EXECUTED
801a4dc: f8 00 01 6b calli 801aa88 <rtems_rfs_buffer_handle_request><== NOT EXECUTED
801a4e0: b8 20 30 00 mv r6,r1 <== NOT EXECUTED
map->blocks[doubly], true);
if (rc > 0)
801a4e4: 48 20 00 6c bg r1,r0,801a694 <rtems_rfs_block_map_shrink+0x374><== 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;
801a4e8: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
801a4ec: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
801a4f0: f8 00 67 85 calli 8034304 <__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,
801a4f4: 29 62 00 4c lw r2,(r11+76) <== 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;
801a4f8: b8 20 c8 00 mv r25,r1 <== 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,
801a4fc: 28 4f 00 1c lw r15,(r2+28) <== NOT EXECUTED
801a500: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801a504: fb ff 9b f7 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a508: b5 e1 78 00 add r15,r15,r1 <== NOT EXECUTED
801a50c: 41 e1 00 00 lbu r1,(r15+0) <== NOT EXECUTED
801a510: 41 f1 00 03 lbu r17,(r15+3) <== NOT EXECUTED
801a514: 34 02 00 18 mvi r2,24 <== NOT EXECUTED
801a518: fb ff 9b f2 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a51c: ba 21 88 00 or r17,r17,r1 <== NOT EXECUTED
801a520: 41 e1 00 01 lbu r1,(r15+1) <== NOT EXECUTED
801a524: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
801a528: fb ff 9b ee calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a52c: ba 21 88 00 or r17,r17,r1 <== NOT EXECUTED
801a530: 41 e1 00 02 lbu r1,(r15+2) <== NOT EXECUTED
801a534: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
801a538: fb ff 9b ea calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a53c: ba 21 88 00 or r17,r17,r1 <== NOT EXECUTED
doubly_singly);
/*
* Read the singly indirect table and get the block number.
*/
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
801a540: ba 40 10 00 mv r2,r18 <== NOT EXECUTED
801a544: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801a548: ba 20 18 00 mv r3,r17 <== NOT EXECUTED
801a54c: 34 04 00 01 mvi r4,1 <== NOT EXECUTED
801a550: f8 00 01 4e calli 801aa88 <rtems_rfs_buffer_handle_request><== NOT EXECUTED
801a554: b8 20 30 00 mv r6,r1 <== NOT EXECUTED
singly, true);
if (rc > 0)
801a558: 48 20 00 4f bg r1,r0,801a694 <rtems_rfs_block_map_shrink+0x374><== NOT EXECUTED
return rc;
block_to_free = rtems_rfs_block_get_number (&map->singly_buffer,
801a55c: 29 61 00 40 lw r1,(r11+64) <== NOT EXECUTED
801a560: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801a564: 28 30 00 1c lw r16,(r1+28) <== NOT EXECUTED
801a568: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
801a56c: fb ff 9b dd calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a570: b6 01 80 00 add r16,r16,r1 <== NOT EXECUTED
801a574: 42 01 00 00 lbu r1,(r16+0) <== NOT EXECUTED
801a578: 42 0f 00 03 lbu r15,(r16+3) <== NOT EXECUTED
801a57c: 34 02 00 18 mvi r2,24 <== NOT EXECUTED
801a580: fb ff 9b d8 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a584: b9 e1 78 00 or r15,r15,r1 <== NOT EXECUTED
801a588: 42 01 00 01 lbu r1,(r16+1) <== NOT EXECUTED
801a58c: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
801a590: fb ff 9b d4 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a594: b9 e1 78 00 or r15,r15,r1 <== NOT EXECUTED
801a598: 42 01 00 02 lbu r1,(r16+2) <== NOT EXECUTED
801a59c: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
801a5a0: fb ff 9b d0 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801a5a4: b9 e1 78 00 or r15,r15,r1 <== NOT EXECUTED
direct);
if (direct == 0)
801a5a8: 5d c0 00 10 bne r14,r0,801a5e8 <rtems_rfs_block_map_shrink+0x2c8><== NOT EXECUTED
{
rc = rtems_rfs_group_bitmap_free (fs, false, singly);
801a5ac: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801a5b0: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801a5b4: ba 20 18 00 mv r3,r17 <== NOT EXECUTED
801a5b8: fb ff d1 06 calli 800e9d0 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
801a5bc: b8 20 30 00 mv r6,r1 <== NOT EXECUTED
if (rc > 0)
801a5c0: 48 2e 00 35 bg r1,r14,801a694 <rtems_rfs_block_map_shrink+0x374><== NOT EXECUTED
return rc;
map->last_map_block = singly;
801a5c4: 59 71 00 1c sw (r11+28),r17 <== NOT EXECUTED
rc = rtems_rfs_block_map_indirect_shrink (fs, map, &map->doubly_buffer,
801a5c8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801a5cc: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801a5d0: ba c0 18 00 mv r3,r22 <== NOT EXECUTED
801a5d4: ba 60 20 00 mv r4,r19 <== NOT EXECUTED
801a5d8: bb 20 28 00 mv r5,r25 <== NOT EXECUTED
801a5dc: fb ff fb b0 calli 801949c <rtems_rfs_block_map_indirect_shrink.clone.6><== NOT EXECUTED
801a5e0: b8 20 30 00 mv r6,r1 <== NOT EXECUTED
doubly, doubly_singly);
if (rc)
801a5e4: 5c 20 00 2c bne r1,r0,801a694 <rtems_rfs_block_map_shrink+0x374><== NOT EXECUTED
{
rc = EIO;
break;
}
}
rc = rtems_rfs_group_bitmap_free (fs, false, block_to_free);
801a5e8: b9 80 08 00 mv r1,r12
801a5ec: 34 02 00 00 mvi r2,0
801a5f0: b9 e0 18 00 mv r3,r15
801a5f4: fb ff d0 f7 calli 800e9d0 <rtems_rfs_group_bitmap_free>
801a5f8: b8 20 30 00 mv r6,r1
if (rc > 0)
801a5fc: 48 20 00 26 bg r1,r0,801a694 <rtems_rfs_block_map_shrink+0x374><== NEVER TAKEN
return rc;
map->size.count--;
801a600: 29 61 00 08 lw r1,(r11+8)
map->size.offset = 0;
801a604: 59 60 00 0c sw (r11+12),r0
map->last_data_block = block_to_free;
801a608: 59 6f 00 20 sw (r11+32),r15
}
}
rc = rtems_rfs_group_bitmap_free (fs, false, block_to_free);
if (rc > 0)
return rc;
map->size.count--;
801a60c: 34 21 ff ff addi r1,r1,-1
801a610: 59 61 00 08 sw (r11+8),r1
map->size.offset = 0;
map->last_data_block = block_to_free;
map->dirty = true;
801a614: 31 74 00 00 sb (r11+0),r20
blocks--;
801a618: 35 ad ff ff addi r13,r13,-1
801a61c: e0 00 00 07 bi 801a638 <rtems_rfs_block_map_shrink+0x318>
rtems_rfs_block_no block_to_free;
int rc;
block = map->size.count - 1;
if (block < RTEMS_RFS_INODE_BLOCKS)
801a620: 34 18 00 04 mvi r24,4
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,
801a624: 35 77 00 44 addi r23,r11,68
doubly_singly);
/*
* Read the singly indirect table and get the block number.
*/
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
801a628: 35 72 00 38 addi r18,r11,56
int
rtems_rfs_block_map_free_all (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map)
{
return rtems_rfs_block_map_shrink (fs, map, map->size.count);
}
801a62c: 35 76 00 4c addi r22,r11,76
801a630: 35 75 00 40 addi r21,r11,64
if (rc > 0)
return rc;
map->size.count--;
map->size.offset = 0;
map->last_data_block = block_to_free;
map->dirty = true;
801a634: 34 14 00 01 mvi r20,1
return 0;
if (blocks > map->size.count)
blocks = map->size.count;
while (blocks)
801a638: 5d a0 ff 5d bne r13,r0,801a3ac <rtems_rfs_block_map_shrink+0x8c>
map->last_data_block = block_to_free;
map->dirty = true;
blocks--;
}
if (map->size.count == 0)
801a63c: 29 61 00 08 lw r1,(r11+8)
801a640: 5c 20 00 03 bne r1,r0,801a64c <rtems_rfs_block_map_shrink+0x32c>
{
map->last_map_block = 0;
801a644: 59 60 00 1c sw (r11+28),r0
map->last_data_block = 0;
801a648: 59 60 00 20 sw (r11+32),r0
}
/*
* Keep the position inside the map.
*/
if (rtems_rfs_block_pos_past_end (&map->bpos, &map->size))
801a64c: 29 62 00 10 lw r2,(r11+16)
801a650: 44 40 00 02 be r2,r0,801a658 <rtems_rfs_block_map_shrink+0x338>
801a654: 44 20 00 08 be r1,r0,801a674 <rtems_rfs_block_map_shrink+0x354><== ALWAYS TAKEN
801a658: 50 41 00 07 bgeu r2,r1,801a674 <rtems_rfs_block_map_shrink+0x354>
801a65c: 34 23 ff ff addi r3,r1,-1
rtems_rfs_block_size_get_bpos (&map->size, &map->bpos);
return 0;
801a660: 34 06 00 00 mvi r6,0
}
/*
* Keep the position inside the map.
*/
if (rtems_rfs_block_pos_past_end (&map->bpos, &map->size))
801a664: 5c 43 00 0c bne r2,r3,801a694 <rtems_rfs_block_map_shrink+0x374><== NEVER TAKEN
801a668: 29 62 00 14 lw r2,(r11+20)
801a66c: 29 63 00 0c lw r3,(r11+12)
801a670: 50 62 00 09 bgeu r3,r2,801a694 <rtems_rfs_block_map_shrink+0x374><== NEVER TAKEN
rtems_rfs_block_size_get_bpos (&map->size, &map->bpos);
801a674: 29 62 00 0c lw r2,(r11+12)
801a678: 59 61 00 10 sw (r11+16),r1
801a67c: 59 60 00 18 sw (r11+24),r0
801a680: 59 62 00 14 sw (r11+20),r2
return 0;
801a684: 34 06 00 00 mvi r6,0
/*
* Keep the position inside the map.
*/
if (rtems_rfs_block_pos_past_end (&map->bpos, &map->size))
rtems_rfs_block_size_get_bpos (&map->size, &map->bpos);
801a688: 44 40 00 03 be r2,r0,801a694 <rtems_rfs_block_map_shrink+0x374><== ALWAYS TAKEN
801a68c: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED
801a690: 59 61 00 10 sw (r11+16),r1 <== NOT EXECUTED
return 0;
}
801a694: b8 c0 08 00 mv r1,r6
801a698: 2b 9d 00 04 lw ra,(sp+4)
801a69c: 2b 8b 00 40 lw r11,(sp+64)
801a6a0: 2b 8c 00 3c lw r12,(sp+60)
801a6a4: 2b 8d 00 38 lw r13,(sp+56)
801a6a8: 2b 8e 00 34 lw r14,(sp+52)
801a6ac: 2b 8f 00 30 lw r15,(sp+48)
801a6b0: 2b 90 00 2c lw r16,(sp+44)
801a6b4: 2b 91 00 28 lw r17,(sp+40)
801a6b8: 2b 92 00 24 lw r18,(sp+36)
801a6bc: 2b 93 00 20 lw r19,(sp+32)
801a6c0: 2b 94 00 1c lw r20,(sp+28)
801a6c4: 2b 95 00 18 lw r21,(sp+24)
801a6c8: 2b 96 00 14 lw r22,(sp+20)
801a6cc: 2b 97 00 10 lw r23,(sp+16)
801a6d0: 2b 98 00 0c lw r24,(sp+12)
801a6d4: 2b 99 00 08 lw r25,(sp+8)
801a6d8: 37 9c 00 40 addi sp,sp,64
801a6dc: c3 a0 00 00 ret
080205dc <rtems_rfs_buffer_bdbuf_release>:
int
rtems_rfs_buffer_bdbuf_release (rtems_rfs_buffer* buffer,
bool modified)
{
80205dc: 37 9c ff f4 addi sp,sp,-12
80205e0: 5b 8b 00 0c sw (sp+12),r11
80205e4: 5b 8c 00 08 sw (sp+8),r12
80205e8: 5b 9d 00 04 sw (sp+4),ra
80205ec: b8 20 58 00 mv r11,r1
80205f0: 20 4c 00 ff andi r12,r2,0xff
rtems_status_code sc;
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_RELEASE))
80205f4: 34 01 00 00 mvi r1,0
80205f8: 34 02 00 40 mvi r2,64
80205fc: fb ff c1 cb calli 8010d28 <rtems_rfs_trace>
8020600: 44 20 00 0b be r1,r0,802062c <rtems_rfs_buffer_bdbuf_release+0x50><== ALWAYS TAKEN
printf ("rtems-rfs: bdbuf-release: block=%" PRIuPTR " bdbuf=%" PRIu32 " %s\n",
8020604: 78 04 08 03 mvhi r4,0x803 <== NOT EXECUTED
8020608: 29 62 00 34 lw r2,(r11+52) <== NOT EXECUTED
802060c: 29 63 00 18 lw r3,(r11+24) <== NOT EXECUTED
8020610: 38 84 70 b0 ori r4,r4,0x70b0 <== NOT EXECUTED
8020614: 45 80 00 03 be r12,r0,8020620 <rtems_rfs_buffer_bdbuf_release+0x44><== NOT EXECUTED
8020618: 78 04 08 03 mvhi r4,0x803 <== NOT EXECUTED
802061c: 38 84 92 f0 ori r4,r4,0x92f0 <== NOT EXECUTED
8020620: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8020624: 38 21 92 fc ori r1,r1,0x92fc <== NOT EXECUTED
8020628: f8 00 08 13 calli 8022674 <printf> <== NOT EXECUTED
((intptr_t) buffer->user),
buffer->block, modified ? "(modified)" : "");
if (modified)
802062c: 45 80 00 04 be r12,r0,802063c <rtems_rfs_buffer_bdbuf_release+0x60>
sc = rtems_bdbuf_release_modified (buffer);
8020630: b9 60 08 00 mv r1,r11
8020634: fb ff cc 07 calli 8013650 <rtems_bdbuf_release_modified>
8020638: e0 00 00 03 bi 8020644 <rtems_rfs_buffer_bdbuf_release+0x68>
else
sc = rtems_bdbuf_release (buffer);
802063c: b9 60 08 00 mv r1,r11
8020640: fb ff cb cf calli 801357c <rtems_bdbuf_release>
int
rtems_rfs_buffer_bdbuf_release (rtems_rfs_buffer* buffer,
bool modified)
{
rtems_status_code sc;
int rc = 0;
8020644: 7c 21 00 00 cmpnei r1,r1,0
8020648: c8 01 08 00 sub r1,r0,r1
#endif
rc = EIO;
}
return rc;
}
802064c: 20 21 00 05 andi r1,r1,0x5
8020650: 2b 9d 00 04 lw ra,(sp+4)
8020654: 2b 8b 00 0c lw r11,(sp+12)
8020658: 2b 8c 00 08 lw r12,(sp+8)
802065c: 37 9c 00 0c addi sp,sp,12
8020660: c3 a0 00 00 ret
0801b07c <rtems_rfs_buffer_close>:
return 0;
}
int
rtems_rfs_buffer_close (rtems_rfs_file_system* fs)
{
801b07c: 37 9c ff f4 addi sp,sp,-12
801b080: 5b 8b 00 0c sw (sp+12),r11
801b084: 5b 8c 00 08 sw (sp+8),r12
801b088: 5b 9d 00 04 sw (sp+4),ra
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
801b08c: 34 02 00 10 mvi r2,16
return 0;
}
int
rtems_rfs_buffer_close (rtems_rfs_file_system* fs)
{
801b090: b8 20 60 00 mv r12,r1
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
801b094: 34 01 00 00 mvi r1,0
801b098: fb ff d7 24 calli 8010d28 <rtems_rfs_trace>
801b09c: 44 20 00 04 be r1,r0,801b0ac <rtems_rfs_buffer_close+0x30> <== ALWAYS TAKEN
printf ("rtems-rfs: buffer-close: closing\n");
801b0a0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801b0a4: 38 21 81 f8 ori r1,r1,0x81f8 <== NOT EXECUTED
801b0a8: f8 00 1e 3b calli 8022994 <puts> <== NOT EXECUTED
/*
* 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));
801b0ac: 29 82 00 10 lw r2,(r12+16)
801b0b0: b9 80 08 00 mv r1,r12
801b0b4: 28 42 00 20 lw r2,(r2+32)
801b0b8: fb ff ff b6 calli 801af90 <rtems_rfs_buffer_setblksize>
801b0bc: b8 20 58 00 mv r11,r1
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
801b0c0: 4c 01 00 0c bge r0,r1,801b0f0 <rtems_rfs_buffer_close+0x74><== ALWAYS TAKEN
801b0c4: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801b0c8: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
801b0cc: fb ff d7 17 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801b0d0: 44 20 00 08 be r1,r0,801b0f0 <rtems_rfs_buffer_close+0x74> <== NOT EXECUTED
printf ("rtems-rfs: buffer-close: set media block size failed: %d: %s\n",
801b0d4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801b0d8: f8 00 22 22 calli 8023960 <strerror> <== NOT EXECUTED
801b0dc: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801b0e0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801b0e4: 38 21 82 1c ori r1,r1,0x821c <== NOT EXECUTED
801b0e8: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801b0ec: f8 00 1d 62 calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
if (close (fs->device) < 0)
801b0f0: 29 81 00 0c lw r1,(r12+12)
801b0f4: fb ff ac bb calli 80063e0 <close>
801b0f8: 4c 20 00 0e bge r1,r0,801b130 <rtems_rfs_buffer_close+0xb4><== ALWAYS TAKEN
{
rc = errno;
801b0fc: f8 00 17 03 calli 8020d08 <__errno> <== NOT EXECUTED
801b100: 28 2b 00 00 lw r11,(r1+0) <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
801b104: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
801b108: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801b10c: fb ff d7 07 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801b110: 44 20 00 08 be r1,r0,801b130 <rtems_rfs_buffer_close+0xb4> <== NOT EXECUTED
printf ("rtems-rfs: buffer-close: file close failed: %d: %s\n",
801b114: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801b118: f8 00 22 12 calli 8023960 <strerror> <== NOT EXECUTED
801b11c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801b120: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801b124: 38 21 82 5c ori r1,r1,0x825c <== NOT EXECUTED
801b128: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801b12c: f8 00 1d 52 calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
}
return rc;
}
801b130: b9 60 08 00 mv r1,r11
801b134: 2b 9d 00 04 lw ra,(sp+4)
801b138: 2b 8b 00 0c lw r11,(sp+12)
801b13c: 2b 8c 00 08 lw r12,(sp+8)
801b140: 37 9c 00 0c addi sp,sp,12
801b144: c3 a0 00 00 ret
0801a8cc <rtems_rfs_buffer_handle_release>:
}
int
rtems_rfs_buffer_handle_release (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
801a8cc: 37 9c ff ec addi sp,sp,-20
801a8d0: 5b 8b 00 14 sw (sp+20),r11
801a8d4: 5b 8c 00 10 sw (sp+16),r12
801a8d8: 5b 8d 00 0c sw (sp+12),r13
801a8dc: 5b 8e 00 08 sw (sp+8),r14
801a8e0: 5b 9d 00 04 sw (sp+4),ra
801a8e4: b8 20 58 00 mv r11,r1
int rc = 0;
if (rtems_rfs_buffer_handle_has_block (handle))
801a8e8: 28 41 00 08 lw r1,(r2+8)
}
int
rtems_rfs_buffer_handle_release (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
801a8ec: b8 40 60 00 mv r12,r2
int rc = 0;
801a8f0: 34 0d 00 00 mvi r13,0
if (rtems_rfs_buffer_handle_has_block (handle))
801a8f4: 44 20 00 5d be r1,r0,801aa68 <rtems_rfs_buffer_handle_release+0x19c>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_RELEASE))
801a8f8: 34 01 00 00 mvi r1,0
801a8fc: 34 02 02 00 mvi r2,512
801a900: fb ff d9 0a calli 8010d28 <rtems_rfs_trace>
801a904: 44 20 00 12 be r1,r0,801a94c <rtems_rfs_buffer_handle_release+0x80><== ALWAYS TAKEN
printf ("rtems-rfs: buffer-release: block=%" PRIu32 " %s refs=%d %s\n",
801a908: 41 81 00 00 lbu r1,(r12+0) <== NOT EXECUTED
801a90c: 78 03 08 03 mvhi r3,0x803 <== NOT EXECUTED
801a910: 29 82 00 04 lw r2,(r12+4) <== NOT EXECUTED
801a914: 38 63 70 b0 ori r3,r3,0x70b0 <== NOT EXECUTED
801a918: 44 20 00 03 be r1,r0,801a924 <rtems_rfs_buffer_handle_release+0x58><== NOT EXECUTED
801a91c: 78 03 08 03 mvhi r3,0x803 <== NOT EXECUTED
801a920: 38 63 7e 0c ori r3,r3,0x7e0c <== 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" : "");
801a924: 29 81 00 08 lw r1,(r12+8) <== 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",
801a928: 78 05 08 03 mvhi r5,0x803 <== NOT EXECUTED
801a92c: 38 a5 70 b0 ori r5,r5,0x70b0 <== 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" : "");
801a930: 28 24 00 30 lw r4,(r1+48) <== 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",
801a934: 5c 80 00 03 bne r4,r0,801a940 <rtems_rfs_buffer_handle_release+0x74><== NOT EXECUTED
801a938: 78 05 08 03 mvhi r5,0x803 <== NOT EXECUTED
801a93c: 38 a5 7e 14 ori r5,r5,0x7e14 <== NOT EXECUTED
801a940: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801a944: 38 21 7e 24 ori r1,r1,0x7e24 <== NOT EXECUTED
801a948: f8 00 1f 4b calli 8022674 <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)
801a94c: 29 81 00 08 lw r1,(r12+8)
801a950: 28 22 00 30 lw r2,(r1+48)
801a954: 4c 02 00 03 bge r0,r2,801a960 <rtems_rfs_buffer_handle_release+0x94><== NEVER TAKEN
rtems_rfs_buffer_refs_down (handle);
801a958: 34 42 ff ff addi r2,r2,-1
801a95c: 58 22 00 30 sw (r1+48),r2
if (rtems_rfs_buffer_refs (handle) == 0)
801a960: 28 22 00 30 lw r2,(r1+48)
int
rtems_rfs_buffer_handle_release (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
int rc = 0;
801a964: 34 0d 00 00 mvi r13,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)
801a968: 5c 40 00 3f bne r2,r0,801aa64 <rtems_rfs_buffer_handle_release+0x198>
801a96c: fb ff f1 2c calli 8016e1c <_Chain_Extract>
{
rtems_chain_extract (rtems_rfs_buffer_link (handle));
fs->buffers_count--;
801a970: 29 61 00 50 lw r1,(r11+80)
if (rtems_rfs_fs_no_local_cache (fs))
801a974: 29 6e 00 00 lw r14,(r11+0)
rtems_rfs_buffer_refs_down (handle);
if (rtems_rfs_buffer_refs (handle) == 0)
{
rtems_chain_extract (rtems_rfs_buffer_link (handle));
fs->buffers_count--;
801a978: 34 21 ff ff addi r1,r1,-1
801a97c: 59 61 00 50 sw (r11+80),r1
if (rtems_rfs_fs_no_local_cache (fs))
801a980: 21 ce 00 02 andi r14,r14,0x2
801a984: 45 cd 00 07 be r14,r13,801a9a0 <rtems_rfs_buffer_handle_release+0xd4>
{
handle->buffer->user = (void*) 0;
801a988: 29 81 00 08 lw r1,(r12+8)
rc = rtems_rfs_buffer_io_release (handle->buffer,
801a98c: 41 82 00 00 lbu r2,(r12+0)
rtems_chain_extract (rtems_rfs_buffer_link (handle));
fs->buffers_count--;
if (rtems_rfs_fs_no_local_cache (fs))
{
handle->buffer->user = (void*) 0;
801a990: 58 20 00 34 sw (r1+52),r0
rc = rtems_rfs_buffer_io_release (handle->buffer,
801a994: f8 00 17 12 calli 80205dc <rtems_rfs_buffer_bdbuf_release>
801a998: b8 20 68 00 mv r13,r1
801a99c: e0 00 00 32 bi 801aa64 <rtems_rfs_buffer_handle_release+0x198>
* 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 +
801a9a0: 29 62 00 70 lw r2,(r11+112)
801a9a4: 29 61 00 60 lw r1,(r11+96)
int
rtems_rfs_buffer_handle_release (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
int rc = 0;
801a9a8: b9 c0 68 00 mv r13,r14
* 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 +
801a9ac: b4 41 08 00 add r1,r2,r1
801a9b0: 29 62 00 40 lw r2,(r11+64)
801a9b4: 54 41 00 1e bgu r2,r1,801aa2c <rtems_rfs_buffer_handle_release+0x160>
fs->release_modified_count) >= fs->max_held_buffers)
{
rtems_rfs_buffer* buffer;
bool modified;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_RELEASE))
801a9b8: 34 01 00 00 mvi r1,0
801a9bc: 34 02 02 00 mvi r2,512
801a9c0: fb ff d8 da calli 8010d28 <rtems_rfs_trace>
801a9c4: 44 2e 00 07 be r1,r14,801a9e0 <rtems_rfs_buffer_handle_release+0x114><== ALWAYS TAKEN
printf ("rtems-rfs: buffer-release: local cache overflow:"
801a9c8: 29 63 00 70 lw r3,(r11+112) <== NOT EXECUTED
801a9cc: 29 62 00 60 lw r2,(r11+96) <== NOT EXECUTED
801a9d0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801a9d4: 38 21 7e 58 ori r1,r1,0x7e58 <== NOT EXECUTED
801a9d8: b4 62 10 00 add r2,r3,r2 <== NOT EXECUTED
801a9dc: f8 00 1f 26 calli 8022674 <printf> <== NOT EXECUTED
" %" PRIu32 "\n", fs->release_count + fs->release_modified_count);
if (fs->release_count > fs->release_modified_count)
801a9e0: 29 61 00 60 lw r1,(r11+96)
801a9e4: 29 62 00 70 lw r2,(r11+112)
801a9e8: 50 41 00 08 bgeu r2,r1,801aa08 <rtems_rfs_buffer_handle_release+0x13c>
*/
RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get(
rtems_chain_control *the_chain
)
{
return _Chain_Get( the_chain );
801a9ec: 35 61 00 54 addi r1,r11,84
801a9f0: fb ff bc e9 calli 8009d94 <_Chain_Get>
{
buffer = (rtems_rfs_buffer*) rtems_chain_get (&fs->release);
fs->release_count--;
801a9f4: 29 62 00 60 lw r2,(r11+96)
801a9f8: 34 42 ff ff addi r2,r2,-1
801a9fc: 59 62 00 60 sw (r11+96),r2
modified = false;
801aa00: 34 02 00 00 mvi r2,0
801aa04: e0 00 00 07 bi 801aa20 <rtems_rfs_buffer_handle_release+0x154>
801aa08: 35 61 00 64 addi r1,r11,100
801aa0c: fb ff bc e2 calli 8009d94 <_Chain_Get>
}
else
{
buffer =
(rtems_rfs_buffer*) rtems_chain_get (&fs->release_modified);
fs->release_modified_count--;
801aa10: 29 62 00 70 lw r2,(r11+112)
801aa14: 34 42 ff ff addi r2,r2,-1
801aa18: 59 62 00 70 sw (r11+112),r2
modified = true;
801aa1c: 34 02 00 01 mvi r2,1
}
buffer->user = (void*) 0;
801aa20: 58 20 00 34 sw (r1+52),r0
rc = rtems_rfs_buffer_io_release (buffer, modified);
801aa24: f8 00 16 ee calli 80205dc <rtems_rfs_buffer_bdbuf_release>
801aa28: b8 20 68 00 mv r13,r1
}
if (rtems_rfs_buffer_dirty (handle))
801aa2c: 41 81 00 00 lbu r1,(r12+0)
801aa30: 29 82 00 08 lw r2,(r12+8)
801aa34: 44 20 00 07 be r1,r0,801aa50 <rtems_rfs_buffer_handle_release+0x184>
RTEMS_INLINE_ROUTINE void rtems_chain_append(
rtems_chain_control *the_chain,
rtems_chain_node *the_node
)
{
_Chain_Append( the_chain, the_node );
801aa38: 35 61 00 64 addi r1,r11,100
801aa3c: fb ff bc ca calli 8009d64 <_Chain_Append>
{
rtems_chain_append (&fs->release_modified,
rtems_rfs_buffer_link (handle));
fs->release_modified_count++;
801aa40: 29 61 00 70 lw r1,(r11+112)
801aa44: 34 21 00 01 addi r1,r1,1
801aa48: 59 61 00 70 sw (r11+112),r1
801aa4c: e0 00 00 06 bi 801aa64 <rtems_rfs_buffer_handle_release+0x198>
801aa50: 35 61 00 54 addi r1,r11,84
801aa54: fb ff bc c4 calli 8009d64 <_Chain_Append>
}
else
{
rtems_chain_append (&fs->release, rtems_rfs_buffer_link (handle));
fs->release_count++;
801aa58: 29 61 00 60 lw r1,(r11+96)
801aa5c: 34 21 00 01 addi r1,r1,1
801aa60: 59 61 00 60 sw (r11+96),r1
}
}
}
handle->buffer = NULL;
801aa64: 59 80 00 08 sw (r12+8),r0
}
return rc;
}
801aa68: b9 a0 08 00 mv r1,r13
801aa6c: 2b 9d 00 04 lw ra,(sp+4)
801aa70: 2b 8b 00 14 lw r11,(sp+20)
801aa74: 2b 8c 00 10 lw r12,(sp+16)
801aa78: 2b 8d 00 0c lw r13,(sp+12)
801aa7c: 2b 8e 00 08 lw r14,(sp+8)
801aa80: 37 9c 00 14 addi sp,sp,20
801aa84: c3 a0 00 00 ret
0801aa88 <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)
{
801aa88: 37 9c ff e4 addi sp,sp,-28
801aa8c: 5b 8b 00 1c sw (sp+28),r11
801aa90: 5b 8c 00 18 sw (sp+24),r12
801aa94: 5b 8d 00 14 sw (sp+20),r13
801aa98: 5b 8e 00 10 sw (sp+16),r14
801aa9c: 5b 8f 00 0c sw (sp+12),r15
801aaa0: 5b 90 00 08 sw (sp+8),r16
801aaa4: 5b 9d 00 04 sw (sp+4),ra
801aaa8: b8 20 60 00 mv r12,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))
801aaac: 28 41 00 08 lw r1,(r2+8)
int
rtems_rfs_buffer_handle_request (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle,
rtems_rfs_buffer_block block,
bool read)
{
801aab0: b8 40 58 00 mv r11,r2
801aab4: b8 60 68 00 mv r13,r3
801aab8: 20 8f 00 ff andi r15,r4,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))
801aabc: 44 20 00 14 be r1,r0,801ab0c <rtems_rfs_buffer_handle_request+0x84>
{
/*
* Treat block 0 as special to handle the loading of the super block.
*/
if (block && (rtems_rfs_buffer_bnum (handle) == block))
801aac0: 44 60 00 04 be r3,r0,801aad0 <rtems_rfs_buffer_handle_request+0x48><== NEVER TAKEN
801aac4: 28 41 00 04 lw r1,(r2+4)
return 0;
801aac8: 34 0e 00 00 mvi r14,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))
801aacc: 44 23 00 7f be r1,r3,801acc8 <rtems_rfs_buffer_handle_request+0x240>
return 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
801aad0: 34 01 00 00 mvi r1,0
801aad4: 34 02 01 00 mvi r2,256
801aad8: fb ff d8 94 calli 8010d28 <rtems_rfs_trace>
801aadc: 44 20 00 05 be r1,r0,801aaf0 <rtems_rfs_buffer_handle_request+0x68><== ALWAYS TAKEN
printf ("rtems-rfs: buffer-request: handle has buffer: %" PRIu32 "\n",
801aae0: 29 62 00 04 lw r2,(r11+4) <== NOT EXECUTED
801aae4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801aae8: 38 21 7e 94 ori r1,r1,0x7e94 <== NOT EXECUTED
801aaec: f8 00 1e e2 calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_buffer_bnum (handle));
rc = rtems_rfs_buffer_handle_release (fs, handle);
801aaf0: b9 80 08 00 mv r1,r12
801aaf4: b9 60 10 00 mv r2,r11
801aaf8: fb ff ff 75 calli 801a8cc <rtems_rfs_buffer_handle_release>
801aafc: b8 20 70 00 mv r14,r1
if (rc > 0)
801ab00: 48 20 00 72 bg r1,r0,801acc8 <rtems_rfs_buffer_handle_request+0x240><== NEVER TAKEN
return rc;
handle->dirty = false;
801ab04: 31 60 00 00 sb (r11+0),r0
handle->bnum = 0;
801ab08: 59 60 00 04 sw (r11+4),r0
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
801ab0c: 34 01 00 00 mvi r1,0
801ab10: 34 02 01 00 mvi r2,256
801ab14: fb ff d8 85 calli 8010d28 <rtems_rfs_trace>
801ab18: 44 20 00 05 be r1,r0,801ab2c <rtems_rfs_buffer_handle_request+0xa4><== ALWAYS TAKEN
printf ("rtems-rfs: buffer-request: block=%" PRIu32 "\n", block);
801ab1c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ab20: 38 21 7e c8 ori r1,r1,0x7ec8 <== NOT EXECUTED
801ab24: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801ab28: f8 00 1e d3 calli 8022674 <printf> <== NOT EXECUTED
* 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)
801ab2c: 29 81 00 50 lw r1,(r12+80)
801ab30: 44 20 00 11 be r1,r0,801ab74 <rtems_rfs_buffer_handle_request+0xec>
{
/*
* Check the active buffer list for shared buffers.
*/
handle->buffer = rtems_rfs_scan_chain (&fs->buffers,
801ab34: 35 81 00 44 addi r1,r12,68
801ab38: 35 82 00 50 addi r2,r12,80
801ab3c: b9 a0 18 00 mv r3,r13
801ab40: fb ff ff 1c calli 801a7b0 <rtems_rfs_scan_chain>
801ab44: 59 61 00 08 sw (r11+8),r1
&fs->buffers_count,
block);
if (rtems_rfs_buffer_handle_has_block (handle) &&
801ab48: 44 20 00 0b be r1,r0,801ab74 <rtems_rfs_buffer_handle_request+0xec>
rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
801ab4c: 34 01 00 00 mvi r1,0
801ab50: 34 02 01 00 mvi r2,256
801ab54: fb ff d8 75 calli 8010d28 <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) &&
801ab58: 44 20 00 07 be r1,r0,801ab74 <rtems_rfs_buffer_handle_request+0xec><== ALWAYS TAKEN
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);
801ab5c: 29 61 00 08 lw r1,(r11+8) <== NOT EXECUTED
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",
801ab60: 28 22 00 30 lw r2,(r1+48) <== NOT EXECUTED
801ab64: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ab68: 38 21 7e f0 ori r1,r1,0x7ef0 <== NOT EXECUTED
801ab6c: 34 42 00 01 addi r2,r2,1 <== NOT EXECUTED
801ab70: f8 00 1e c1 calli 8022674 <printf> <== 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) &&
801ab74: 29 82 00 00 lw r2,(r12+0)
801ab78: 20 42 00 02 andi r2,r2,0x2
801ab7c: 5c 40 00 16 bne r2,r0,801abd4 <rtems_rfs_buffer_handle_request+0x14c>
801ab80: 29 61 00 08 lw r1,(r11+8)
801ab84: 5c 22 00 14 bne r1,r2,801abd4 <rtems_rfs_buffer_handle_request+0x14c>
!rtems_rfs_buffer_handle_has_block (handle))
{
/*
* Check the local cache of released buffers.
*/
if (fs->release_count)
801ab88: 29 82 00 60 lw r2,(r12+96)
801ab8c: 44 41 00 06 be r2,r1,801aba4 <rtems_rfs_buffer_handle_request+0x11c>
handle->buffer = rtems_rfs_scan_chain (&fs->release,
801ab90: 35 81 00 54 addi r1,r12,84
801ab94: 35 82 00 60 addi r2,r12,96
801ab98: b9 a0 18 00 mv r3,r13
801ab9c: fb ff ff 05 calli 801a7b0 <rtems_rfs_scan_chain>
801aba0: 59 61 00 08 sw (r11+8),r1
&fs->release_count,
block);
if (!rtems_rfs_buffer_handle_has_block (handle) &&
801aba4: 29 61 00 08 lw r1,(r11+8)
801aba8: 5c 20 00 0b bne r1,r0,801abd4 <rtems_rfs_buffer_handle_request+0x14c>
801abac: 29 82 00 70 lw r2,(r12+112)
801abb0: 44 41 00 09 be r2,r1,801abd4 <rtems_rfs_buffer_handle_request+0x14c>
fs->release_modified_count)
{
handle->buffer = rtems_rfs_scan_chain (&fs->release_modified,
801abb4: 35 81 00 64 addi r1,r12,100
801abb8: 35 82 00 70 addi r2,r12,112
801abbc: b9 a0 18 00 mv r3,r13
801abc0: fb ff fe fc calli 801a7b0 <rtems_rfs_scan_chain>
801abc4: 59 61 00 08 sw (r11+8),r1
&fs->release_modified_count,
block);
/*
* If we found a buffer retain the dirty buffer state.
*/
if (rtems_rfs_buffer_handle_has_block (handle))
801abc8: 44 20 00 03 be r1,r0,801abd4 <rtems_rfs_buffer_handle_request+0x14c>
rtems_rfs_buffer_mark_dirty (handle);
801abcc: 34 01 00 01 mvi r1,1
801abd0: 31 61 00 00 sb (r11+0),r1
}
/*
* If not located we request the buffer from the I/O layer.
*/
if (!rtems_rfs_buffer_handle_has_block (handle))
801abd4: 29 70 00 08 lw r16,(r11+8)
801abd8: 5e 00 00 1e bne r16,r0,801ac50 <rtems_rfs_buffer_handle_request+0x1c8>
{
rc = rtems_rfs_buffer_io_request (fs, block, read, &handle->buffer);
801abdc: b9 80 08 00 mv r1,r12
801abe0: b9 a0 10 00 mv r2,r13
801abe4: b9 e0 18 00 mv r3,r15
801abe8: 35 64 00 08 addi r4,r11,8
801abec: f8 00 16 6c calli 802059c <rtems_rfs_buffer_bdbuf_request>
801abf0: b8 20 70 00 mv r14,r1
if (rc > 0)
801abf4: 4e 01 00 14 bge r16,r1,801ac44 <rtems_rfs_buffer_handle_request+0x1bc><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
801abf8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801abfc: 34 02 01 00 mvi r2,256 <== NOT EXECUTED
801ac00: fb ff d8 4a calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801ac04: 44 20 00 31 be r1,r0,801acc8 <rtems_rfs_buffer_handle_request+0x240><== NOT EXECUTED
printf ("rtems-rfs: buffer-request: block=%" PRIu32 ": bdbuf-%s: %d: %s\n",
801ac08: 78 0b 08 03 mvhi r11,0x803 <== NOT EXECUTED
801ac0c: 39 6b 7e 90 ori r11,r11,0x7e90 <== NOT EXECUTED
801ac10: 45 e0 00 03 be r15,r0,801ac1c <rtems_rfs_buffer_handle_request+0x194><== NOT EXECUTED
801ac14: 78 0b 08 03 mvhi r11,0x803 <== NOT EXECUTED
801ac18: 39 6b 72 f4 ori r11,r11,0x72f4 <== NOT EXECUTED
801ac1c: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
801ac20: f8 00 23 50 calli 8023960 <strerror> <== NOT EXECUTED
801ac24: b8 20 28 00 mv r5,r1 <== NOT EXECUTED
801ac28: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ac2c: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801ac30: b9 60 18 00 mv r3,r11 <== NOT EXECUTED
801ac34: b9 c0 20 00 mv r4,r14 <== NOT EXECUTED
801ac38: 38 21 7f 24 ori r1,r1,0x7f24 <== NOT EXECUTED
801ac3c: f8 00 1e 8e calli 8022674 <printf> <== NOT EXECUTED
801ac40: e0 00 00 22 bi 801acc8 <rtems_rfs_buffer_handle_request+0x240><== NOT EXECUTED
block, read ? "read" : "get", rc, strerror (rc));
return rc;
}
rtems_chain_set_off_chain (rtems_rfs_buffer_link(handle));
801ac44: 29 61 00 08 lw r1,(r11+8)
801ac48: 58 20 00 04 sw (r1+4),r0
801ac4c: 58 20 00 00 sw (r1+0),r0
}
/*
* Increase the reference count of the buffer.
*/
rtems_rfs_buffer_refs_up (handle);
801ac50: 29 62 00 08 lw r2,(r11+8)
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
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;
801ac54: 34 0e 00 00 mvi r14,0
}
/*
* Increase the reference count of the buffer.
*/
rtems_rfs_buffer_refs_up (handle);
801ac58: 28 41 00 30 lw r1,(r2+48)
801ac5c: 34 21 00 01 addi r1,r1,1
801ac60: 58 41 00 30 sw (r2+48),r1
801ac64: 35 81 00 44 addi r1,r12,68
801ac68: fb ff bc 3f calli 8009d64 <_Chain_Append>
rtems_chain_append (&fs->buffers, rtems_rfs_buffer_link (handle));
fs->buffers_count++;
801ac6c: 29 81 00 50 lw r1,(r12+80)
handle->buffer->user = (void*) ((intptr_t) block);
handle->bnum = block;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
801ac70: 34 02 01 00 mvi r2,256
/*
* 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++;
801ac74: 34 21 00 01 addi r1,r1,1
801ac78: 59 81 00 50 sw (r12+80),r1
handle->buffer->user = (void*) ((intptr_t) block);
801ac7c: 29 61 00 08 lw r1,(r11+8)
801ac80: 58 2d 00 34 sw (r1+52),r13
handle->bnum = block;
801ac84: 59 6d 00 04 sw (r11+4),r13
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
801ac88: 34 01 00 00 mvi r1,0
801ac8c: fb ff d8 27 calli 8010d28 <rtems_rfs_trace>
801ac90: 44 20 00 0e be r1,r0,801acc8 <rtems_rfs_buffer_handle_request+0x240><== ALWAYS TAKEN
printf ("rtems-rfs: buffer-request: block=%" PRIu32 " bdbuf-%s=%" PRIu32 " refs=%d\n",
801ac94: 78 03 08 03 mvhi r3,0x803 <== NOT EXECUTED
801ac98: 38 63 7e 90 ori r3,r3,0x7e90 <== NOT EXECUTED
801ac9c: 45 e0 00 03 be r15,r0,801aca8 <rtems_rfs_buffer_handle_request+0x220><== NOT EXECUTED
801aca0: 78 03 08 03 mvhi r3,0x803 <== NOT EXECUTED
801aca4: 38 63 72 f4 ori r3,r3,0x72f4 <== NOT EXECUTED
block, read ? "read" : "get", handle->buffer->block,
801aca8: 29 65 00 08 lw r5,(r11+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",
801acac: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801acb0: 38 21 7f 5c ori r1,r1,0x7f5c <== NOT EXECUTED
801acb4: 28 a4 00 18 lw r4,(r5+24) <== NOT EXECUTED
801acb8: 28 a5 00 30 lw r5,(r5+48) <== NOT EXECUTED
801acbc: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
block, read ? "read" : "get", handle->buffer->block,
handle->buffer->references);
return 0;
801acc0: 34 0e 00 00 mvi r14,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",
801acc4: f8 00 1e 6c calli 8022674 <printf> <== NOT EXECUTED
block, read ? "read" : "get", handle->buffer->block,
handle->buffer->references);
return 0;
}
801acc8: b9 c0 08 00 mv r1,r14
801accc: 2b 9d 00 04 lw ra,(sp+4)
801acd0: 2b 8b 00 1c lw r11,(sp+28)
801acd4: 2b 8c 00 18 lw r12,(sp+24)
801acd8: 2b 8d 00 14 lw r13,(sp+20)
801acdc: 2b 8e 00 10 lw r14,(sp+16)
801ace0: 2b 8f 00 0c lw r15,(sp+12)
801ace4: 2b 90 00 08 lw r16,(sp+8)
801ace8: 37 9c 00 1c addi sp,sp,28
801acec: c3 a0 00 00 ret
0801acf0 <rtems_rfs_buffer_open>:
return rc;
}
int
rtems_rfs_buffer_open (const char* name, rtems_rfs_file_system* fs)
{
801acf0: 37 9c ff a8 addi sp,sp,-88
801acf4: 5b 8b 00 10 sw (sp+16),r11
801acf8: 5b 8c 00 0c sw (sp+12),r12
801acfc: 5b 8d 00 08 sw (sp+8),r13
801ad00: 5b 9d 00 04 sw (sp+4),ra
801ad04: b8 20 68 00 mv r13,r1
801ad08: b8 40 60 00 mv r12,r2
struct stat st;
#if RTEMS_RFS_USE_LIBBLOCK
int rv;
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
801ad0c: 34 01 00 00 mvi r1,0
801ad10: 34 02 00 20 mvi r2,32
801ad14: fb ff d8 05 calli 8010d28 <rtems_rfs_trace>
801ad18: 44 20 00 05 be r1,r0,801ad2c <rtems_rfs_buffer_open+0x3c> <== ALWAYS TAKEN
printf ("rtems-rfs: buffer-open: opening: %s\n", name);
801ad1c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ad20: 38 21 7f 98 ori r1,r1,0x7f98 <== NOT EXECUTED
801ad24: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801ad28: f8 00 1e 53 calli 8022674 <printf> <== NOT EXECUTED
fs->device = open (name, O_RDWR);
801ad2c: b9 a0 08 00 mv r1,r13
801ad30: 34 02 00 02 mvi r2,2
801ad34: fb ff b2 1f calli 80075b0 <open>
801ad38: 59 81 00 0c sw (r12+12),r1
if (fs->device < 0)
801ad3c: 4c 20 00 09 bge r1,r0,801ad60 <rtems_rfs_buffer_open+0x70> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
801ad40: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801ad44: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
801ad48: fb ff d7 f8 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: cannot open file\n");
return ENXIO;
801ad4c: 34 0b 00 06 mvi r11,6 <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: opening: %s\n", name);
fs->device = open (name, O_RDWR);
if (fs->device < 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
801ad50: 44 20 00 3c be r1,r0,801ae40 <rtems_rfs_buffer_open+0x150> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: cannot open file\n");
801ad54: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ad58: 38 21 7f c0 ori r1,r1,0x7fc0 <== NOT EXECUTED
801ad5c: e0 00 00 2d bi 801ae10 <rtems_rfs_buffer_open+0x120> <== NOT EXECUTED
return ENXIO;
}
if (fstat (fs->device, &st) < 0)
801ad60: 37 82 00 14 addi r2,sp,20
801ad64: fb ff ad f8 calli 8006544 <fstat>
801ad68: 4c 20 00 0e bge r1,r0,801ada0 <rtems_rfs_buffer_open+0xb0> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
801ad6c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801ad70: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
801ad74: fb ff d7 ed calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: stat '%s' failed: %s\n",
name, strerror (errno));
return ENXIO;
801ad78: 34 0b 00 06 mvi r11,6 <== NOT EXECUTED
return ENXIO;
}
if (fstat (fs->device, &st) < 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
801ad7c: 44 20 00 31 be r1,r0,801ae40 <rtems_rfs_buffer_open+0x150> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: stat '%s' failed: %s\n",
name, strerror (errno));
801ad80: f8 00 17 e2 calli 8020d08 <__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",
801ad84: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
801ad88: f8 00 22 f6 calli 8023960 <strerror> <== NOT EXECUTED
801ad8c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801ad90: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ad94: 38 21 7f ec ori r1,r1,0x7fec <== NOT EXECUTED
801ad98: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801ad9c: e0 00 00 28 bi 801ae3c <rtems_rfs_buffer_open+0x14c> <== NOT EXECUTED
#if RTEMS_RFS_USE_LIBBLOCK
/*
* Is the device a block device ?
*/
if (!S_ISBLK (st.st_mode))
801ada0: 2b 82 00 20 lw r2,(sp+32)
801ada4: 34 01 60 00 mvi r1,24576
801ada8: 20 42 f0 00 andi r2,r2,0xf000
801adac: 44 41 00 0b be r2,r1,801add8 <rtems_rfs_buffer_open+0xe8> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
801adb0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801adb4: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
801adb8: fb ff d7 dc calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: '%s' is not a block device\n", name);
return ENXIO;
801adbc: 34 0b 00 06 mvi r11,6 <== NOT EXECUTED
/*
* Is the device a block device ?
*/
if (!S_ISBLK (st.st_mode))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
801adc0: 44 20 00 20 be r1,r0,801ae40 <rtems_rfs_buffer_open+0x150> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: '%s' is not a block device\n", name);
801adc4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801adc8: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801adcc: 38 21 80 1c ori r1,r1,0x801c <== NOT EXECUTED
801add0: f8 00 1e 29 calli 8022674 <printf> <== NOT EXECUTED
801add4: e0 00 00 1b bi 801ae40 <rtems_rfs_buffer_open+0x150> <== 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);
801add8: 78 03 08 03 mvhi r3,0x803
801addc: 38 63 74 78 ori r3,r3,0x7478
801ade0: 28 62 00 00 lw r2,(r3+0)
801ade4: 29 81 00 0c lw r1,(r12+12)
801ade8: 35 83 00 10 addi r3,r12,16
801adec: fb ff ae 41 calli 80066f0 <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)
801adf0: 44 20 00 0a be r1,r0,801ae18 <rtems_rfs_buffer_open+0x128> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
801adf4: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801adf8: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
801adfc: fb ff d7 cb calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: cannot obtain the disk\n");
return ENXIO;
801ae00: 34 0b 00 06 mvi r11,6 <== NOT EXECUTED
* 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)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
801ae04: 44 20 00 0f be r1,r0,801ae40 <rtems_rfs_buffer_open+0x150> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: cannot obtain the disk\n");
801ae08: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ae0c: 38 21 80 50 ori r1,r1,0x8050 <== NOT EXECUTED
801ae10: f8 00 1e e1 calli 8022994 <puts> <== NOT EXECUTED
801ae14: e0 00 00 0b bi 801ae40 <rtems_rfs_buffer_open+0x150> <== NOT EXECUTED
#else
fs->media_size = st.st_size;
strcat (fs->name, name);
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
801ae18: 34 02 00 20 mvi r2,32
801ae1c: fb ff d7 c3 calli 8010d28 <rtems_rfs_trace>
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;
801ae20: 34 0b 00 00 mvi r11,0
#else
fs->media_size = st.st_size;
strcat (fs->name, name);
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
801ae24: 44 2b 00 07 be r1,r11,801ae40 <rtems_rfs_buffer_open+0x150><== ALWAYS TAKEN
printf ("rtems-rfs: buffer-open: blks=%" PRId32 ", blk-size=%" PRId32 "\n",
rtems_rfs_fs_media_blocks (fs),
801ae28: 29 83 00 10 lw r3,(r12+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",
801ae2c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ae30: 38 21 80 80 ori r1,r1,0x8080 <== NOT EXECUTED
801ae34: 28 62 00 1c lw r2,(r3+28) <== NOT EXECUTED
801ae38: 28 63 00 20 lw r3,(r3+32) <== NOT EXECUTED
801ae3c: f8 00 1e 0e calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_fs_media_blocks (fs),
rtems_rfs_fs_media_block_size (fs));
return 0;
}
801ae40: b9 60 08 00 mv r1,r11
801ae44: 2b 9d 00 04 lw ra,(sp+4)
801ae48: 2b 8b 00 10 lw r11,(sp+16)
801ae4c: 2b 8c 00 0c lw r12,(sp+12)
801ae50: 2b 8d 00 08 lw r13,(sp+8)
801ae54: 37 9c 00 58 addi sp,sp,88
801ae58: c3 a0 00 00 ret
0801af90 <rtems_rfs_buffer_setblksize>:
return result;
}
int
rtems_rfs_buffer_setblksize (rtems_rfs_file_system* fs, size_t size)
{
801af90: 37 9c ff f0 addi sp,sp,-16
801af94: 5b 8b 00 0c sw (sp+12),r11
801af98: 5b 8c 00 08 sw (sp+8),r12
801af9c: 5b 9d 00 04 sw (sp+4),ra
801afa0: b8 20 58 00 mv r11,r1
801afa4: 5b 82 00 10 sw (sp+16),r2
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SETBLKSIZE))
801afa8: 34 01 00 00 mvi r1,0
801afac: 34 02 04 00 mvi r2,1024
801afb0: fb ff d7 5e calli 8010d28 <rtems_rfs_trace>
801afb4: 44 20 00 05 be r1,r0,801afc8 <rtems_rfs_buffer_setblksize+0x38><== ALWAYS TAKEN
printf ("rtems-rfs: buffer-setblksize: block size: %zu\n", size);
801afb8: 2b 82 00 10 lw r2,(sp+16) <== NOT EXECUTED
801afbc: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801afc0: 38 21 81 4c ori r1,r1,0x814c <== NOT EXECUTED
801afc4: f8 00 1d ac calli 8022674 <printf> <== NOT EXECUTED
rc = rtems_rfs_buffers_release (fs);
801afc8: b9 60 08 00 mv r1,r11
801afcc: fb ff ff ca calli 801aef4 <rtems_rfs_buffers_release>
801afd0: b8 20 60 00 mv r12,r1
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SETBLKSIZE))
801afd4: 4c 01 00 0c bge r0,r1,801b004 <rtems_rfs_buffer_setblksize+0x74><== ALWAYS TAKEN
801afd8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801afdc: 34 02 04 00 mvi r2,1024 <== NOT EXECUTED
801afe0: fb ff d7 52 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801afe4: 44 20 00 08 be r1,r0,801b004 <rtems_rfs_buffer_setblksize+0x74><== NOT EXECUTED
printf ("rtems-rfs: buffer-setblksize: buffer release failed: %d: %s\n",
801afe8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801afec: f8 00 22 5d calli 8023960 <strerror> <== NOT EXECUTED
801aff0: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801aff4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801aff8: 38 21 81 7c ori r1,r1,0x817c <== NOT EXECUTED
801affc: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
801b000: f8 00 1d 9d calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
rc = rtems_rfs_buffer_sync (fs);
801b004: b9 60 08 00 mv r1,r11
801b008: fb ff ff 95 calli 801ae5c <rtems_rfs_buffer_sync>
801b00c: b8 20 60 00 mv r12,r1
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SETBLKSIZE))
801b010: 4c 01 00 0c bge r0,r1,801b040 <rtems_rfs_buffer_setblksize+0xb0><== ALWAYS TAKEN
801b014: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801b018: 34 02 04 00 mvi r2,1024 <== NOT EXECUTED
801b01c: fb ff d7 43 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801b020: 44 20 00 08 be r1,r0,801b040 <rtems_rfs_buffer_setblksize+0xb0><== NOT EXECUTED
printf ("rtems-rfs: buffer-setblksize: device sync failed: %d: %s\n",
801b024: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801b028: f8 00 22 4e calli 8023960 <strerror> <== NOT EXECUTED
801b02c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801b030: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801b034: 38 21 81 bc ori r1,r1,0x81bc <== NOT EXECUTED
801b038: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
801b03c: f8 00 1d 8e calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
#if RTEMS_RFS_USE_LIBBLOCK
rc = fs->disk->ioctl (fs->disk, RTEMS_BLKIO_SETBLKSIZE, &size);
801b040: 29 61 00 10 lw r1,(r11+16)
801b044: 78 03 08 03 mvhi r3,0x803
801b048: 38 63 74 84 ori r3,r3,0x7484
801b04c: 28 62 00 00 lw r2,(r3+0)
801b050: 28 24 00 38 lw r4,(r1+56)
801b054: 37 83 00 10 addi r3,sp,16
801b058: d8 80 00 00 call r4
if (rc < 0)
801b05c: 4c 20 00 03 bge r1,r0,801b068 <rtems_rfs_buffer_setblksize+0xd8><== ALWAYS TAKEN
rc = errno;
801b060: f8 00 17 2a calli 8020d08 <__errno> <== NOT EXECUTED
801b064: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
#endif
return rc;
}
801b068: 2b 9d 00 04 lw ra,(sp+4)
801b06c: 2b 8b 00 0c lw r11,(sp+12)
801b070: 2b 8c 00 08 lw r12,(sp+8)
801b074: 37 9c 00 10 addi sp,sp,16
801b078: c3 a0 00 00 ret
0801ae5c <rtems_rfs_buffer_sync>:
return rc;
}
int
rtems_rfs_buffer_sync (rtems_rfs_file_system* fs)
{
801ae5c: 37 9c ff f0 addi sp,sp,-16
801ae60: 5b 8b 00 10 sw (sp+16),r11
801ae64: 5b 8c 00 0c sw (sp+12),r12
801ae68: 5b 8d 00 08 sw (sp+8),r13
801ae6c: 5b 9d 00 04 sw (sp+4),ra
int result = 0;
#if RTEMS_RFS_USE_LIBBLOCK
rtems_status_code sc;
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
801ae70: 34 02 00 20 mvi r2,32
return rc;
}
int
rtems_rfs_buffer_sync (rtems_rfs_file_system* fs)
{
801ae74: b8 20 60 00 mv r12,r1
int result = 0;
#if RTEMS_RFS_USE_LIBBLOCK
rtems_status_code sc;
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
801ae78: 34 01 00 00 mvi r1,0
801ae7c: fb ff d7 ab calli 8010d28 <rtems_rfs_trace>
801ae80: 44 20 00 04 be r1,r0,801ae90 <rtems_rfs_buffer_sync+0x34> <== ALWAYS TAKEN
printf ("rtems-rfs: buffer-sync: syncing\n");
801ae84: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ae88: 38 21 80 b0 ori r1,r1,0x80b0 <== NOT EXECUTED
801ae8c: f8 00 1e c2 calli 8022994 <puts> <== NOT EXECUTED
/*
* @todo Split in the separate files for each type.
*/
#if RTEMS_RFS_USE_LIBBLOCK
sc = rtems_bdbuf_syncdev (rtems_rfs_fs_device (fs));
801ae90: 29 81 00 10 lw r1,(r12+16)
}
int
rtems_rfs_buffer_sync (rtems_rfs_file_system* fs)
{
int result = 0;
801ae94: 34 0b 00 00 mvi r11,0
/*
* @todo Split in the separate files for each type.
*/
#if RTEMS_RFS_USE_LIBBLOCK
sc = rtems_bdbuf_syncdev (rtems_rfs_fs_device (fs));
801ae98: fb ff e2 60 calli 8013818 <rtems_bdbuf_syncdev>
801ae9c: b8 20 68 00 mv r13,r1
if (sc != RTEMS_SUCCESSFUL)
801aea0: 44 20 00 0c be r1,r0,801aed0 <rtems_rfs_buffer_sync+0x74> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
801aea4: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801aea8: 34 02 00 20 mvi r2,32 <== NOT EXECUTED
801aeac: fb ff d7 9f calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
printf ("rtems-rfs: buffer-sync: device sync failed: %s\n",
rtems_status_text (sc));
result = EIO;
801aeb0: 34 0b 00 05 mvi r11,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))
801aeb4: 44 20 00 07 be r1,r0,801aed0 <rtems_rfs_buffer_sync+0x74> <== NOT EXECUTED
printf ("rtems-rfs: buffer-sync: device sync failed: %s\n",
801aeb8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
801aebc: fb ff e6 e5 calli 8014a50 <rtems_status_text> <== NOT EXECUTED
801aec0: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
801aec4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801aec8: 38 21 80 d0 ori r1,r1,0x80d0 <== NOT EXECUTED
801aecc: f8 00 1d ea calli 8022674 <printf> <== NOT EXECUTED
rtems_status_text (sc));
result = EIO;
}
rtems_disk_release (fs->disk);
801aed0: 29 81 00 10 lw r1,(r12+16)
801aed4: fb ff 9e 81 calli 80028d8 <rtems_disk_release>
printf ("rtems-rfs: buffer-sync: file sync failed: %d: %s\n",
result, strerror (result));
}
#endif
return result;
}
801aed8: b9 60 08 00 mv r1,r11
801aedc: 2b 9d 00 04 lw ra,(sp+4)
801aee0: 2b 8b 00 10 lw r11,(sp+16)
801aee4: 2b 8c 00 0c lw r12,(sp+12)
801aee8: 2b 8d 00 08 lw r13,(sp+8)
801aeec: 37 9c 00 10 addi sp,sp,16
801aef0: c3 a0 00 00 ret
0801aef4 <rtems_rfs_buffers_release>:
return rrc;
}
int
rtems_rfs_buffers_release (rtems_rfs_file_system* fs)
{
801aef4: 37 9c ff f4 addi sp,sp,-12
801aef8: 5b 8b 00 0c sw (sp+12),r11
801aefc: 5b 8c 00 08 sw (sp+8),r12
801af00: 5b 9d 00 04 sw (sp+4),ra
int rrc = 0;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_RELEASE))
801af04: 34 02 00 40 mvi r2,64
return rrc;
}
int
rtems_rfs_buffers_release (rtems_rfs_file_system* fs)
{
801af08: b8 20 58 00 mv r11,r1
int rrc = 0;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_RELEASE))
801af0c: 34 01 00 00 mvi r1,0
801af10: fb ff d7 86 calli 8010d28 <rtems_rfs_trace>
801af14: 44 20 00 07 be r1,r0,801af30 <rtems_rfs_buffers_release+0x3c><== ALWAYS TAKEN
printf ("rtems-rfs: buffers-release: active:%" PRIu32 " "
801af18: 29 62 00 50 lw r2,(r11+80) <== NOT EXECUTED
801af1c: 29 63 00 60 lw r3,(r11+96) <== NOT EXECUTED
801af20: 29 64 00 70 lw r4,(r11+112) <== NOT EXECUTED
801af24: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801af28: 38 21 81 00 ori r1,r1,0x8100 <== NOT EXECUTED
801af2c: f8 00 1d d2 calli 8022674 <printf> <== NOT EXECUTED
"release:%" PRIu32 " release-modified:%" PRIu32 "\n",
fs->buffers_count, fs->release_count, fs->release_modified_count);
rc = rtems_rfs_release_chain (&fs->release,
801af30: 34 03 00 00 mvi r3,0
801af34: 35 62 00 60 addi r2,r11,96
801af38: 35 61 00 54 addi r1,r11,84
801af3c: fb ff fd f0 calli 801a6fc <rtems_rfs_release_chain>
801af40: b8 20 60 00 mv r12,r1
801af44: 34 02 00 1f mvi r2,31
801af48: a4 20 08 00 not r1,r1
801af4c: f8 00 64 6e calli 8034104 <__ashrsi3>
801af50: a1 81 60 00 and r12,r12,r1
&fs->release_count,
false);
if ((rc > 0) && (rrc == 0))
rrc = rc;
rc = rtems_rfs_release_chain (&fs->release_modified,
801af54: 35 62 00 70 addi r2,r11,112
801af58: 34 03 00 01 mvi r3,1
801af5c: 35 61 00 64 addi r1,r11,100
801af60: fb ff fd e7 calli 801a6fc <rtems_rfs_release_chain>
&fs->release_modified_count,
true);
if ((rc > 0) && (rrc == 0))
801af64: 65 83 00 00 cmpei r3,r12,0
801af68: 68 22 00 00 cmpgi r2,r1,0
801af6c: a0 62 10 00 and r2,r3,r2
801af70: 44 40 00 02 be r2,r0,801af78 <rtems_rfs_buffers_release+0x84><== ALWAYS TAKEN
801af74: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
rrc = rc;
return rrc;
}
801af78: b9 80 08 00 mv r1,r12
801af7c: 2b 9d 00 04 lw ra,(sp+4)
801af80: 2b 8b 00 0c lw r11,(sp+12)
801af84: 2b 8c 00 08 lw r12,(sp+8)
801af88: 37 9c 00 0c addi sp,sp,12
801af8c: c3 a0 00 00 ret
0801b6c4 <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)
{
801b6c4: 37 9c ff 40 addi sp,sp,-192
801b6c8: 5b 8b 00 44 sw (sp+68),r11
801b6cc: 5b 8c 00 40 sw (sp+64),r12
801b6d0: 5b 8d 00 3c sw (sp+60),r13
801b6d4: 5b 8e 00 38 sw (sp+56),r14
801b6d8: 5b 8f 00 34 sw (sp+52),r15
801b6dc: 5b 90 00 30 sw (sp+48),r16
801b6e0: 5b 91 00 2c sw (sp+44),r17
801b6e4: 5b 92 00 28 sw (sp+40),r18
801b6e8: 5b 93 00 24 sw (sp+36),r19
801b6ec: 5b 94 00 20 sw (sp+32),r20
801b6f0: 5b 95 00 1c sw (sp+28),r21
801b6f4: 5b 96 00 18 sw (sp+24),r22
801b6f8: 5b 97 00 14 sw (sp+20),r23
801b6fc: 5b 98 00 10 sw (sp+16),r24
801b700: 5b 99 00 0c sw (sp+12),r25
801b704: 5b 9b 00 08 sw (sp+8),fp
801b708: 5b 9d 00 04 sw (sp+4),ra
801b70c: b8 20 60 00 mv r12,r1
801b710: b8 40 70 00 mv r14,r2
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))
801b714: 34 01 00 00 mvi r1,0
801b718: 78 02 20 00 mvhi r2,0x2000
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)
{
801b71c: b8 60 98 00 mv r19,r3
801b720: b8 80 78 00 mv r15,r4
801b724: b8 a0 88 00 mv r17,r5
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))
801b728: fb ff d5 80 calli 8010d28 <rtems_rfs_trace>
801b72c: 44 20 00 10 be r1,r0,801b76c <rtems_rfs_dir_add_entry+0xa8><== ALWAYS TAKEN
{
int c;
printf ("rtems-rfs: dir-add-entry: dir=%" PRId32 ", name=",
801b730: 29 c2 00 08 lw r2,(r14+8) <== NOT EXECUTED
801b734: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801b738: 38 21 85 48 ori r1,r1,0x8548 <== NOT EXECUTED
801b73c: f8 00 1b ce calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_inode_ino (dir));
for (c = 0; c < length; c++)
801b740: 34 0b 00 00 mvi r11,0 <== NOT EXECUTED
801b744: e0 00 00 05 bi 801b758 <rtems_rfs_dir_add_entry+0x94> <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
return rc;
}
int
rtems_rfs_dir_add_entry (rtems_rfs_file_system* fs,
801b748: b6 6b 08 00 add r1,r19,r11 <== NOT EXECUTED
{
int c;
printf ("rtems-rfs: dir-add-entry: dir=%" PRId32 ", name=",
rtems_rfs_inode_ino (dir));
for (c = 0; c < length; c++)
printf ("%c", name[c]);
801b74c: 40 21 00 00 lbu r1,(r1+0) <== 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++)
801b750: 35 6b 00 01 addi r11,r11,1 <== NOT EXECUTED
printf ("%c", name[c]);
801b754: f8 00 1c 4e calli 802288c <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++)
801b758: 55 eb ff fc bgu r15,r11,801b748 <rtems_rfs_dir_add_entry+0x84><== NOT EXECUTED
printf ("%c", name[c]);
printf (", len=%zd\n", length);
801b75c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801b760: 38 21 85 74 ori r1,r1,0x8574 <== NOT EXECUTED
801b764: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
801b768: f8 00 1b c3 calli 8022674 <printf> <== NOT EXECUTED
}
rc = rtems_rfs_block_map_open (fs, dir, &map);
801b76c: 37 94 00 58 addi r20,sp,88
801b770: b9 80 08 00 mv r1,r12
801b774: b9 c0 10 00 mv r2,r14
801b778: ba 80 18 00 mv r3,r20
801b77c: fb ff f7 f7 calli 8019758 <rtems_rfs_block_map_open>
801b780: b8 20 58 00 mv r11,r1
if (rc > 0)
801b784: 48 20 00 da bg r1,r0,801baec <rtems_rfs_dir_add_entry+0x428><== NEVER TAKEN
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) <
801b788: 35 e1 00 0a addi r1,r15,10
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
801b78c: 33 80 00 a8 sb (sp+168),r0
handle->bnum = 0;
801b790: 5b 80 00 ac sw (sp+172),r0
handle->buffer = NULL;
801b794: 5b 80 00 b0 sw (sp+176),r0
* @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;
801b798: 5b 80 00 b4 sw (sp+180),r0
bpos->boff = 0;
801b79c: 5b 80 00 b8 sw (sp+184),r0
bpos->block = 0;
801b7a0: 5b 80 00 bc sw (sp+188),r0
801b7a4: 5b 81 00 54 sw (sp+84),r1
/*
* 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);
801b7a8: b9 80 08 00 mv r1,r12
801b7ac: ba 80 10 00 mv r2,r20
801b7b0: 37 83 00 b4 addi r3,sp,180
801b7b4: 37 84 00 c0 addi r4,sp,192
801b7b8: fb ff f9 0d calli 8019bec <rtems_rfs_block_map_find>
801b7bc: b8 20 58 00 mv r11,r1
if (rc > 0)
801b7c0: 4c 01 00 23 bge r0,r1,801b84c <rtems_rfs_dir_add_entry+0x188>
{
if (rc != ENXIO)
801b7c4: 34 01 00 06 mvi r1,6
801b7c8: 45 61 00 0c be r11,r1,801b7f8 <rtems_rfs_dir_add_entry+0x134><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
801b7cc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801b7d0: 78 02 20 00 mvhi r2,0x2000 <== NOT EXECUTED
801b7d4: fb ff d5 55 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801b7d8: 44 20 00 bc be r1,r0,801bac8 <rtems_rfs_dir_add_entry+0x404><== NOT EXECUTED
printf ("rtems-rfs: dir-add-entry: "
801b7dc: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801b7e0: 29 cd 00 08 lw r13,(r14+8) <== NOT EXECUTED
801b7e4: f8 00 20 5f calli 8023960 <strerror> <== NOT EXECUTED
801b7e8: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
801b7ec: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801b7f0: 38 21 85 80 ori r1,r1,0x8580 <== NOT EXECUTED
801b7f4: e0 00 00 12 bi 801b83c <rtems_rfs_dir_add_entry+0x178> <== NOT EXECUTED
}
/*
* We have reached the end of the directory so add a block.
*/
rc = rtems_rfs_block_map_grow (fs, &map, 1, &block);
801b7f8: b9 80 08 00 mv r1,r12
801b7fc: ba 80 10 00 mv r2,r20
801b800: 34 03 00 01 mvi r3,1
801b804: 37 84 00 c0 addi r4,sp,192
801b808: fb ff f9 aa calli 8019eb0 <rtems_rfs_block_map_grow>
801b80c: b8 20 58 00 mv r11,r1
if (rc > 0)
801b810: 4c 01 00 11 bge r0,r1,801b854 <rtems_rfs_dir_add_entry+0x190><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
801b814: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801b818: 78 02 20 00 mvhi r2,0x2000 <== NOT EXECUTED
801b81c: fb ff d5 43 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801b820: 44 20 00 aa be r1,r0,801bac8 <rtems_rfs_dir_add_entry+0x404><== NOT EXECUTED
printf ("rtems-rfs: dir-add-entry: "
801b824: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801b828: 29 cd 00 08 lw r13,(r14+8) <== NOT EXECUTED
801b82c: f8 00 20 4d calli 8023960 <strerror> <== NOT EXECUTED
801b830: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
801b834: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801b838: 38 21 85 c8 ori r1,r1,0x85c8 <== NOT EXECUTED
801b83c: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801b840: b9 60 18 00 mv r3,r11 <== NOT EXECUTED
801b844: f8 00 1b 8c calli 8022674 <printf> <== NOT EXECUTED
801b848: e0 00 00 a0 bi 801bac8 <rtems_rfs_dir_add_entry+0x404> <== NOT EXECUTED
while (true)
{
rtems_rfs_block_no block;
uint8_t* entry;
int offset;
bool read = true;
801b84c: 34 0d 00 01 mvi r13,1
801b850: e0 00 00 02 bi 801b858 <rtems_rfs_dir_add_entry+0x194>
"block map grow failed for ino %" PRIu32 ": %d: %s\n",
rtems_rfs_inode_ino (dir), rc, strerror (rc));
break;
}
read = false;
801b854: 34 0d 00 00 mvi r13,0
}
bpos.bno++;
801b858: 2b 81 00 b4 lw r1,(sp+180)
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, read);
801b85c: 2b 83 00 c0 lw r3,(sp+192)
801b860: 37 82 00 a8 addi r2,sp,168
}
read = false;
}
bpos.bno++;
801b864: 34 21 00 01 addi r1,r1,1
801b868: 5b 81 00 b4 sw (sp+180),r1
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, read);
801b86c: b9 a0 20 00 mv r4,r13
801b870: b9 80 08 00 mv r1,r12
801b874: fb ff fc 85 calli 801aa88 <rtems_rfs_buffer_handle_request>
801b878: b8 20 58 00 mv r11,r1
if (rc > 0)
801b87c: 4c 01 00 0c bge r0,r1,801b8ac <rtems_rfs_dir_add_entry+0x1e8><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
801b880: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801b884: 78 02 20 00 mvhi r2,0x2000 <== NOT EXECUTED
801b888: fb ff d5 28 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801b88c: 44 20 00 8f be r1,r0,801bac8 <rtems_rfs_dir_add_entry+0x404><== NOT EXECUTED
printf ("rtems-rfs: dir-add-entry: "
801b890: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801b894: 29 cd 00 08 lw r13,(r14+8) <== NOT EXECUTED
801b898: f8 00 20 32 calli 8023960 <strerror> <== NOT EXECUTED
801b89c: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
801b8a0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801b8a4: 38 21 86 10 ori r1,r1,0x8610 <== NOT EXECUTED
801b8a8: e3 ff ff e5 bi 801b83c <rtems_rfs_dir_add_entry+0x178> <== NOT EXECUTED
"block buffer req failed for ino %" PRIu32 ": %d: %s\n",
rtems_rfs_inode_ino (dir), rc, strerror (rc));
break;
}
entry = rtems_rfs_buffer_data (&buffer);
801b8ac: 2b 81 00 b0 lw r1,(sp+176)
801b8b0: 28 2b 00 1c lw r11,(r1+28)
if (!read)
801b8b4: 5d a0 00 05 bne r13,r0,801b8c8 <rtems_rfs_dir_add_entry+0x204>
memset (entry, 0xff, rtems_rfs_fs_block_size (fs));
801b8b8: 29 83 00 08 lw r3,(r12+8)
801b8bc: b9 60 08 00 mv r1,r11
801b8c0: 34 02 00 ff mvi r2,255
801b8c4: f8 00 1a d0 calli 8022404 <memset>
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
801b8c8: 29 95 00 08 lw r21,(r12+8)
entry = rtems_rfs_buffer_data (&buffer);
if (!read)
memset (entry, 0xff, rtems_rfs_fs_block_size (fs));
offset = 0;
801b8cc: 34 10 00 00 mvi r16,0
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
801b8d0: 36 a1 ff f6 addi r1,r21,-10
801b8d4: 5b 81 00 50 sw (sp+80),r1
801b8d8: e0 00 00 79 bi 801babc <rtems_rfs_dir_add_entry+0x3f8>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
801b8dc: 41 61 00 08 lbu r1,(r11+8)
801b8e0: 34 02 00 08 mvi r2,8
801b8e4: 35 77 00 08 addi r23,r11,8
801b8e8: fb ff 96 fe calli 80014e0 <__ashlsi3>
801b8ec: 41 6d 00 09 lbu r13,(r11+9)
801b8f0: 35 76 00 09 addi r22,r11,9
eino = rtems_rfs_dir_entry_ino (entry);
801b8f4: 41 64 00 00 lbu r4,(r11+0)
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);
801b8f8: b8 2d 68 00 or r13,r1,r13
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
801b8fc: 38 01 ff ff mvu r1,0xffff
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
801b900: 35 7b 00 01 addi fp,r11,1
801b904: 41 65 00 01 lbu r5,(r11+1)
801b908: 35 79 00 02 addi r25,r11,2
801b90c: 41 63 00 02 lbu r3,(r11+2)
801b910: 35 78 00 03 addi r24,r11,3
801b914: 41 72 00 03 lbu r18,(r11+3)
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
801b918: 5d a1 00 38 bne r13,r1,801b9f8 <rtems_rfs_dir_add_entry+0x334>
{
if ((length + RTEMS_RFS_DIR_ENTRY_SIZE) <
801b91c: 2b 81 00 54 lw r1,(sp+84)
(rtems_rfs_fs_block_size (fs) - offset))
801b920: ca b0 80 00 sub r16,r21,r16
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) <
801b924: 50 30 ff a1 bgeu r1,r16,801b7a8 <rtems_rfs_dir_add_entry+0xe4><== NEVER TAKEN
(rtems_rfs_fs_block_size (fs) - offset))
{
uint32_t hash;
hash = rtems_rfs_dir_hash (name, length);
801b928: b9 e0 10 00 mv r2,r15
801b92c: ba 60 08 00 mv r1,r19
801b930: f8 00 13 4d calli 8020664 <rtems_rfs_dir_hash>
rtems_rfs_dir_set_entry_hash (entry, hash);
801b934: 34 02 00 18 mvi r2,24
{
if ((length + RTEMS_RFS_DIR_ENTRY_SIZE) <
(rtems_rfs_fs_block_size (fs) - offset))
{
uint32_t hash;
hash = rtems_rfs_dir_hash (name, length);
801b938: b8 20 68 00 mv r13,r1
rtems_rfs_dir_set_entry_hash (entry, hash);
801b93c: fb ff 97 10 calli 800157c <__lshrsi3>
801b940: 31 61 00 04 sb (r11+4),r1
801b944: 34 02 00 10 mvi r2,16
801b948: b9 a0 08 00 mv r1,r13
801b94c: fb ff 97 0c calli 800157c <__lshrsi3>
801b950: 31 61 00 05 sb (r11+5),r1
801b954: 34 02 00 08 mvi r2,8
801b958: b9 a0 08 00 mv r1,r13
801b95c: fb ff 97 08 calli 800157c <__lshrsi3>
801b960: 31 61 00 06 sb (r11+6),r1
801b964: 31 6d 00 07 sb (r11+7),r13
rtems_rfs_dir_set_entry_ino (entry, ino);
801b968: 34 02 00 18 mvi r2,24
801b96c: ba 20 08 00 mv r1,r17
801b970: fb ff 97 03 calli 800157c <__lshrsi3>
801b974: 31 61 00 00 sb (r11+0),r1
801b978: 34 02 00 10 mvi r2,16
801b97c: ba 20 08 00 mv r1,r17
801b980: fb ff 96 ff calli 800157c <__lshrsi3>
801b984: 33 61 00 00 sb (fp+0),r1
801b988: 34 02 00 08 mvi r2,8
801b98c: ba 20 08 00 mv r1,r17
801b990: fb ff 96 fb calli 800157c <__lshrsi3>
801b994: 33 21 00 00 sb (r25+0),r1
rtems_rfs_dir_set_entry_length (entry,
801b998: 35 ed 00 0a addi r13,r15,10
801b99c: 34 02 00 08 mvi r2,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);
801b9a0: 33 11 00 00 sb (r24+0),r17
rtems_rfs_dir_set_entry_length (entry,
801b9a4: 21 a1 ff ff andi r1,r13,0xffff
801b9a8: fb ff 96 f5 calli 800157c <__lshrsi3>
801b9ac: 32 e1 00 00 sb (r23+0),r1
RTEMS_RFS_DIR_ENTRY_SIZE + length);
memcpy (entry + RTEMS_RFS_DIR_ENTRY_SIZE, name, length);
801b9b0: b9 e0 18 00 mv r3,r15
801b9b4: 35 61 00 0a addi r1,r11,10
801b9b8: ba 60 10 00 mv r2,r19
{
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);
rtems_rfs_dir_set_entry_length (entry,
801b9bc: 32 cd 00 00 sb (r22+0),r13
RTEMS_RFS_DIR_ENTRY_SIZE + length);
memcpy (entry + RTEMS_RFS_DIR_ENTRY_SIZE, name, length);
801b9c0: f8 00 1a 03 calli 80221cc <memcpy>
rtems_rfs_buffer_mark_dirty (&buffer);
801b9c4: 34 01 00 01 mvi r1,1
801b9c8: 33 81 00 a8 sb (sp+168),r1
*/
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);
801b9cc: 37 82 00 a8 addi r2,sp,168
801b9d0: b9 80 08 00 mv r1,r12
801b9d4: fb ff fb be calli 801a8cc <rtems_rfs_buffer_handle_release>
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
801b9d8: b9 80 08 00 mv r1,r12
801b9dc: 37 82 00 58 addi r2,sp,88
handle->dirty = false;
801b9e0: 33 80 00 a8 sb (sp+168),r0
handle->bnum = 0;
801b9e4: 5b 80 00 ac sw (sp+172),r0
handle->buffer = NULL;
801b9e8: 5b 80 00 b0 sw (sp+176),r0
return 0;
801b9ec: 34 0b 00 00 mvi r11,0
rtems_rfs_dir_set_entry_length (entry,
RTEMS_RFS_DIR_ENTRY_SIZE + length);
memcpy (entry + RTEMS_RFS_DIR_ENTRY_SIZE, name, length);
rtems_rfs_buffer_mark_dirty (&buffer);
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
801b9f0: fb ff f7 e1 calli 8019974 <rtems_rfs_block_map_close>
return 0;
801b9f4: e0 00 00 3e bi 801baec <rtems_rfs_dir_add_entry+0x428>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
801b9f8: b8 80 08 00 mv r1,r4
801b9fc: 34 02 00 18 mvi r2,24
801ba00: 5b 83 00 48 sw (sp+72),r3
801ba04: 5b 85 00 4c sw (sp+76),r5
801ba08: fb ff 96 b6 calli 80014e0 <__ashlsi3>
801ba0c: 2b 85 00 4c lw r5,(sp+76)
801ba10: ba 41 90 00 or r18,r18,r1
801ba14: 34 02 00 10 mvi r2,16
801ba18: b8 a0 08 00 mv r1,r5
801ba1c: fb ff 96 b1 calli 80014e0 <__ashlsi3>
801ba20: 2b 83 00 48 lw r3,(sp+72)
801ba24: ba 41 90 00 or r18,r18,r1
801ba28: 34 02 00 08 mvi r2,8
801ba2c: b8 60 08 00 mv r1,r3
801ba30: fb ff 96 ac calli 80014e0 <__ashlsi3>
801ba34: ba 41 90 00 or r18,r18,r1
}
break;
}
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
801ba38: 34 01 00 0a mvi r1,10
801ba3c: 4c 2d 00 08 bge r1,r13,801ba5c <rtems_rfs_dir_add_entry+0x398><== NEVER TAKEN
801ba40: 29 81 00 1c lw r1,(r12+28)
801ba44: 66 42 00 00 cmpei r2,r18,0
801ba48: f1 a1 08 00 cmpgeu r1,r13,r1
801ba4c: b8 41 08 00 or r1,r2,r1
801ba50: 5c 20 00 03 bne r1,r0,801ba5c <rtems_rfs_dir_add_entry+0x398><== NEVER TAKEN
801ba54: 29 81 00 14 lw r1,(r12+20)
801ba58: 50 32 00 17 bgeu r1,r18,801bab4 <rtems_rfs_dir_add_entry+0x3f0><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
801ba5c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801ba60: 78 02 20 00 mvhi r2,0x2000 <== NOT EXECUTED
801ba64: fb ff d4 b1 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801ba68: 44 20 00 08 be r1,r0,801ba88 <rtems_rfs_dir_add_entry+0x3c4><== NOT EXECUTED
printf ("rtems-rfs: dir-add-entry: "
801ba6c: 29 c2 00 08 lw r2,(r14+8) <== NOT EXECUTED
801ba70: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ba74: 38 21 86 58 ori r1,r1,0x8658 <== NOT EXECUTED
801ba78: b9 a0 18 00 mv r3,r13 <== NOT EXECUTED
801ba7c: ba 40 20 00 mv r4,r18 <== NOT EXECUTED
801ba80: ba 00 28 00 mv r5,r16 <== NOT EXECUTED
801ba84: f8 00 1a fc calli 8022674 <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);
801ba88: 37 82 00 a8 addi r2,sp,168 <== NOT EXECUTED
801ba8c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801ba90: fb ff fb 8f calli 801a8cc <rtems_rfs_buffer_handle_release><== 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);
801ba94: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801ba98: 37 82 00 58 addi r2,sp,88 <== NOT EXECUTED
handle->dirty = false;
801ba9c: 33 80 00 a8 sb (sp+168),r0 <== NOT EXECUTED
handle->bnum = 0;
801baa0: 5b 80 00 ac sw (sp+172),r0 <== NOT EXECUTED
handle->buffer = NULL;
801baa4: 5b 80 00 b0 sw (sp+176),r0 <== NOT EXECUTED
return EIO;
801baa8: 34 0b 00 05 mvi r11,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);
801baac: fb ff f7 b2 calli 8019974 <rtems_rfs_block_map_close> <== NOT EXECUTED
return EIO;
801bab0: e0 00 00 0f bi 801baec <rtems_rfs_dir_add_entry+0x428> <== NOT EXECUTED
}
entry += elength;
801bab4: b5 6d 58 00 add r11,r11,r13
offset += elength;
801bab8: b6 0d 80 00 add r16,r16,r13
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))
801babc: 2b 81 00 50 lw r1,(sp+80)
801bac0: 54 30 ff 87 bgu r1,r16,801b8dc <rtems_rfs_dir_add_entry+0x218><== ALWAYS TAKEN
801bac4: e3 ff ff 39 bi 801b7a8 <rtems_rfs_dir_add_entry+0xe4> <== 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);
801bac8: 37 82 00 a8 addi r2,sp,168 <== NOT EXECUTED
801bacc: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801bad0: fb ff fb 7f calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
offset += elength;
}
}
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
801bad4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801bad8: 37 82 00 58 addi r2,sp,88 <== NOT EXECUTED
handle->dirty = false;
801badc: 33 80 00 a8 sb (sp+168),r0 <== NOT EXECUTED
handle->bnum = 0;
801bae0: 5b 80 00 ac sw (sp+172),r0 <== NOT EXECUTED
handle->buffer = NULL;
801bae4: 5b 80 00 b0 sw (sp+176),r0 <== NOT EXECUTED
801bae8: fb ff f7 a3 calli 8019974 <rtems_rfs_block_map_close> <== NOT EXECUTED
return rc;
}
801baec: b9 60 08 00 mv r1,r11
801baf0: 2b 9d 00 04 lw ra,(sp+4)
801baf4: 2b 8b 00 44 lw r11,(sp+68)
801baf8: 2b 8c 00 40 lw r12,(sp+64)
801bafc: 2b 8d 00 3c lw r13,(sp+60)
801bb00: 2b 8e 00 38 lw r14,(sp+56)
801bb04: 2b 8f 00 34 lw r15,(sp+52)
801bb08: 2b 90 00 30 lw r16,(sp+48)
801bb0c: 2b 91 00 2c lw r17,(sp+44)
801bb10: 2b 92 00 28 lw r18,(sp+40)
801bb14: 2b 93 00 24 lw r19,(sp+36)
801bb18: 2b 94 00 20 lw r20,(sp+32)
801bb1c: 2b 95 00 1c lw r21,(sp+28)
801bb20: 2b 96 00 18 lw r22,(sp+24)
801bb24: 2b 97 00 14 lw r23,(sp+20)
801bb28: 2b 98 00 10 lw r24,(sp+16)
801bb2c: 2b 99 00 0c lw r25,(sp+12)
801bb30: 2b 9b 00 08 lw fp,(sp+8)
801bb34: 37 9c 00 c0 addi sp,sp,192
801bb38: c3 a0 00 00 ret
0801bb3c <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)
{
801bb3c: 37 9c ff 50 addi sp,sp,-176
801bb40: 5b 8b 00 44 sw (sp+68),r11
801bb44: 5b 8c 00 40 sw (sp+64),r12
801bb48: 5b 8d 00 3c sw (sp+60),r13
801bb4c: 5b 8e 00 38 sw (sp+56),r14
801bb50: 5b 8f 00 34 sw (sp+52),r15
801bb54: 5b 90 00 30 sw (sp+48),r16
801bb58: 5b 91 00 2c sw (sp+44),r17
801bb5c: 5b 92 00 28 sw (sp+40),r18
801bb60: 5b 93 00 24 sw (sp+36),r19
801bb64: 5b 94 00 20 sw (sp+32),r20
801bb68: 5b 95 00 1c sw (sp+28),r21
801bb6c: 5b 96 00 18 sw (sp+24),r22
801bb70: 5b 97 00 14 sw (sp+20),r23
801bb74: 5b 98 00 10 sw (sp+16),r24
801bb78: 5b 99 00 0c sw (sp+12),r25
801bb7c: 5b 9b 00 08 sw (sp+8),fp
801bb80: 5b 9d 00 04 sw (sp+4),ra
801bb84: b8 20 60 00 mv r12,r1
801bb88: b8 40 88 00 mv r17,r2
rtems_rfs_block_no block;
rtems_rfs_buffer_handle buffer;
bool search;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
801bb8c: 34 01 00 00 mvi r1,0
801bb90: 78 02 40 00 mvhi r2,0x4000
int
rtems_rfs_dir_del_entry (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* dir,
rtems_rfs_ino ino,
uint32_t offset)
{
801bb94: b8 60 a0 00 mv r20,r3
801bb98: b8 80 90 00 mv r18,r4
rtems_rfs_block_no block;
rtems_rfs_buffer_handle buffer;
bool search;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
801bb9c: fb ff d4 63 calli 8010d28 <rtems_rfs_trace>
801bba0: 44 20 00 07 be r1,r0,801bbbc <rtems_rfs_dir_del_entry+0x80><== ALWAYS TAKEN
printf ("rtems-rfs: dir-del-entry: dir=%" PRId32 ", entry=%" PRId32 " offset=%" PRIu32 "\n",
801bba4: 2a 22 00 08 lw r2,(r17+8) <== NOT EXECUTED
801bba8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801bbac: 38 21 86 a0 ori r1,r1,0x86a0 <== NOT EXECUTED
801bbb0: ba 80 18 00 mv r3,r20 <== NOT EXECUTED
801bbb4: ba 40 20 00 mv r4,r18 <== NOT EXECUTED
801bbb8: f8 00 1a af calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_inode_ino (dir), ino, offset);
rc = rtems_rfs_block_map_open (fs, dir, &map);
801bbbc: 37 8d 00 54 addi r13,sp,84
801bbc0: b9 80 08 00 mv r1,r12
801bbc4: ba 20 10 00 mv r2,r17
801bbc8: b9 a0 18 00 mv r3,r13
801bbcc: fb ff f6 e3 calli 8019758 <rtems_rfs_block_map_open>
801bbd0: b8 20 58 00 mv r11,r1
if (rc > 0)
801bbd4: 48 20 00 d9 bg r1,r0,801bf38 <rtems_rfs_dir_del_entry+0x3fc><== NEVER TAKEN
return rc;
rc = rtems_rfs_block_map_seek (fs, &map, offset, &block);
801bbd8: b9 80 08 00 mv r1,r12
801bbdc: b9 a0 10 00 mv r2,r13
801bbe0: 34 03 00 00 mvi r3,0
801bbe4: ba 40 20 00 mv r4,r18
801bbe8: 37 85 00 b0 addi r5,sp,176
801bbec: fb ff f8 6f calli 8019da8 <rtems_rfs_block_map_seek>
801bbf0: b8 20 58 00 mv r11,r1
if (rc > 0)
801bbf4: 4c 01 00 05 bge r0,r1,801bc08 <rtems_rfs_dir_del_entry+0xcc><== ALWAYS TAKEN
{
if (rc == ENXIO)
801bbf8: 34 01 00 06 mvi r1,6 <== NOT EXECUTED
801bbfc: 5d 61 00 b0 bne r11,r1,801bebc <rtems_rfs_dir_del_entry+0x380><== NOT EXECUTED
rc = ENOENT;
801bc00: 34 0b 00 02 mvi r11,2 <== NOT EXECUTED
801bc04: e0 00 00 ae bi 801bebc <rtems_rfs_dir_del_entry+0x380> <== 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: "
801bc08: 78 15 08 03 mvhi r21,0x803
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
801bc0c: 33 80 00 a4 sb (sp+164),r0
handle->bnum = 0;
801bc10: 5b 80 00 a8 sw (sp+168),r0
handle->buffer = NULL;
801bc14: 5b 80 00 ac sw (sp+172),r0
}
/*
* Only search if the offset is 0 else we are at that position.
*/
search = offset ? false : true;
801bc18: 66 57 00 00 cmpei r23,r18,0
rc = ENOENT;
rtems_rfs_block_map_close (fs, &map);
return rc;
}
rc = rtems_rfs_buffer_handle_open (fs, &buffer);
801bc1c: 34 0b 00 00 mvi r11,0
}
if (rc == 0)
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
if (rc == ENXIO)
801bc20: 34 1b 00 06 mvi fp,6
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: "
801bc24: 3a b5 87 24 ori r21,r21,0x8724
/*
* Only search if the offset is 0 else we are at that position.
*/
search = offset ? false : true;
while (rc == 0)
801bc28: e0 00 00 b8 bi 801bf08 <rtems_rfs_dir_del_entry+0x3cc>
{
uint8_t* entry;
int eoffset;
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
801bc2c: 2b 83 00 b0 lw r3,(sp+176)
801bc30: b9 80 08 00 mv r1,r12
801bc34: 37 82 00 a4 addi r2,sp,164
801bc38: 34 04 00 01 mvi r4,1
801bc3c: fb ff fb 93 calli 801aa88 <rtems_rfs_buffer_handle_request>
801bc40: b8 20 80 00 mv r16,r1
if (rc > 0)
801bc44: 4d 61 00 0f bge r11,r1,801bc80 <rtems_rfs_dir_del_entry+0x144><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
801bc48: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801bc4c: 78 02 40 00 mvhi r2,0x4000 <== NOT EXECUTED
801bc50: fb ff d4 36 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801bc54: 44 20 00 af be r1,r0,801bf10 <rtems_rfs_dir_del_entry+0x3d4><== NOT EXECUTED
printf ("rtems-rfs: dir-del-entry: "
801bc58: 2a 2b 00 08 lw r11,(r17+8) <== NOT EXECUTED
801bc5c: ba 00 08 00 mv r1,r16 <== NOT EXECUTED
801bc60: f8 00 1f 40 calli 8023960 <strerror> <== NOT EXECUTED
801bc64: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
801bc68: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801bc6c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801bc70: ba 00 18 00 mv r3,r16 <== NOT EXECUTED
801bc74: 38 21 86 dc ori r1,r1,0x86dc <== NOT EXECUTED
801bc78: f8 00 1a 7f calli 8022674 <printf> <== NOT EXECUTED
801bc7c: e0 00 00 a5 bi 801bf10 <rtems_rfs_dir_del_entry+0x3d4> <== NOT EXECUTED
/*
* If we are searching start at the beginning of the block. If not searching
* skip to the offset in the block.
*/
if (search)
eoffset = 0;
801bc80: 34 0e 00 00 mvi r14,0
/*
* If we are searching start at the beginning of the block. If not searching
* skip to the offset in the block.
*/
if (search)
801bc84: 5e e0 00 05 bne r23,r0,801bc98 <rtems_rfs_dir_del_entry+0x15c><== NEVER TAKEN
eoffset = 0;
else
eoffset = offset % rtems_rfs_fs_block_size (fs);
801bc88: 29 82 00 08 lw r2,(r12+8)
801bc8c: ba 40 08 00 mv r1,r18
801bc90: f8 00 61 9d calli 8034304 <__umodsi3>
801bc94: b8 20 70 00 mv r14,r1
entry = rtems_rfs_buffer_data (&buffer) + eoffset;
801bc98: 2b 81 00 ac lw r1,(sp+172)
while (eoffset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
801bc9c: 29 96 00 08 lw r22,(r12+8)
if (search)
eoffset = 0;
else
eoffset = offset % rtems_rfs_fs_block_size (fs);
entry = rtems_rfs_buffer_data (&buffer) + eoffset;
801bca0: 28 2d 00 1c lw r13,(r1+28)
while (eoffset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
801bca4: 36 c1 ff f6 addi r1,r22,-10
801bca8: 5b 81 00 50 sw (sp+80),r1
if (search)
eoffset = 0;
else
eoffset = offset % rtems_rfs_fs_block_size (fs);
entry = rtems_rfs_buffer_data (&buffer) + eoffset;
801bcac: b5 ae 68 00 add r13,r13,r14
while (eoffset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
801bcb0: e0 00 00 8a bi 801bed8 <rtems_rfs_dir_del_entry+0x39c>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
801bcb4: 41 a1 00 08 lbu r1,(r13+8)
801bcb8: 34 02 00 08 mvi r2,8
801bcbc: 35 b9 00 08 addi r25,r13,8
801bcc0: fb ff 96 08 calli 80014e0 <__ashlsi3>
801bcc4: 41 af 00 09 lbu r15,(r13+9)
801bcc8: 35 b8 00 09 addi r24,r13,9
eino = rtems_rfs_dir_entry_ino (entry);
801bccc: 41 a3 00 00 lbu r3,(r13+0)
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);
801bcd0: b8 2f 78 00 or r15,r1,r15
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
801bcd4: 38 01 ff ff mvu r1,0xffff
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
801bcd8: 41 a5 00 01 lbu r5,(r13+1)
801bcdc: 41 a4 00 02 lbu r4,(r13+2)
801bce0: 41 b3 00 03 lbu r19,(r13+3)
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
801bce4: 45 e1 00 7f be r15,r1,801bee0 <rtems_rfs_dir_del_entry+0x3a4><== NEVER TAKEN
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
801bce8: b8 60 08 00 mv r1,r3
801bcec: 34 02 00 18 mvi r2,24
801bcf0: 5b 84 00 48 sw (sp+72),r4
801bcf4: 5b 85 00 4c sw (sp+76),r5
801bcf8: fb ff 95 fa calli 80014e0 <__ashlsi3>
801bcfc: 2b 85 00 4c lw r5,(sp+76)
801bd00: ba 61 98 00 or r19,r19,r1
801bd04: 34 02 00 10 mvi r2,16
801bd08: b8 a0 08 00 mv r1,r5
801bd0c: fb ff 95 f5 calli 80014e0 <__ashlsi3>
801bd10: 2b 84 00 48 lw r4,(sp+72)
801bd14: ba 61 98 00 or r19,r19,r1
801bd18: 34 02 00 08 mvi r2,8
801bd1c: b8 80 08 00 mv r1,r4
801bd20: fb ff 95 f0 calli 80014e0 <__ashlsi3>
801bd24: ba 61 98 00 or r19,r19,r1
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
801bd28: 34 01 00 0a mvi r1,10
801bd2c: 4c 2f 00 08 bge r1,r15,801bd4c <rtems_rfs_dir_del_entry+0x210><== NEVER TAKEN
801bd30: 29 81 00 1c lw r1,(r12+28)
801bd34: 66 62 00 00 cmpei r2,r19,0
801bd38: f1 e1 08 00 cmpgeu r1,r15,r1
801bd3c: b8 41 08 00 or r1,r2,r1
801bd40: 5c 20 00 03 bne r1,r0,801bd4c <rtems_rfs_dir_del_entry+0x210><== NEVER TAKEN
801bd44: 29 81 00 14 lw r1,(r12+20)
801bd48: 50 33 00 0d bgeu r1,r19,801bd7c <rtems_rfs_dir_del_entry+0x240><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
801bd4c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801bd50: 78 02 40 00 mvhi r2,0x4000 <== NOT EXECUTED
801bd54: fb ff d3 f5 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801bd58: 44 20 00 8c be r1,r0,801bf88 <rtems_rfs_dir_del_entry+0x44c><== NOT EXECUTED
printf ("rtems-rfs: dir-del-entry: "
801bd5c: 2a 22 00 08 lw r2,(r17+8) <== NOT EXECUTED
801bd60: 2b 85 00 b0 lw r5,(sp+176) <== NOT EXECUTED
801bd64: ba a0 08 00 mv r1,r21 <== NOT EXECUTED
801bd68: b9 e0 18 00 mv r3,r15 <== NOT EXECUTED
801bd6c: ba 60 20 00 mv r4,r19 <== NOT EXECUTED
801bd70: b9 c0 30 00 mv r6,r14 <== NOT EXECUTED
801bd74: f8 00 1a 40 calli 8022674 <printf> <== NOT EXECUTED
801bd78: e0 00 00 84 bi 801bf88 <rtems_rfs_dir_del_entry+0x44c> <== NOT EXECUTED
rtems_rfs_inode_ino (dir), elength, eino, block, eoffset);
rc = EIO;
break;
}
if (ino == rtems_rfs_dir_entry_ino (entry))
801bd7c: 5e 93 00 54 bne r20,r19,801becc <rtems_rfs_dir_del_entry+0x390><== NEVER TAKEN
{
uint32_t remaining;
remaining = rtems_rfs_fs_block_size (fs) - (eoffset + elength);
801bd80: b5 ee 80 00 add r16,r15,r14
801bd84: ca d0 80 00 sub r16,r22,r16
memmove (entry, entry + elength, remaining);
801bd88: b5 af 10 00 add r2,r13,r15
801bd8c: b9 a0 08 00 mv r1,r13
801bd90: ba 00 18 00 mv r3,r16
801bd94: f8 00 19 4f calli 80222d0 <memmove>
memset (entry + remaining, 0xff, elength);
801bd98: b5 b0 08 00 add r1,r13,r16
801bd9c: 34 02 00 ff mvi r2,255
801bda0: b9 e0 18 00 mv r3,r15
801bda4: f8 00 19 98 calli 8022404 <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);
801bda8: 43 21 00 00 lbu r1,(r25+0)
801bdac: 34 02 00 08 mvi r2,8
801bdb0: fb ff 95 cc calli 80014e0 <__ashlsi3>
801bdb4: 43 0d 00 00 lbu r13,(r24+0)
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
801bdb8: 78 02 40 00 mvhi r2,0x4000
* 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);
801bdbc: b8 2d 68 00 or r13,r1,r13
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
801bdc0: 34 01 00 00 mvi r1,0
801bdc4: fb ff d3 d9 calli 8010d28 <rtems_rfs_trace>
801bdc8: 44 20 00 16 be r1,r0,801be20 <rtems_rfs_dir_del_entry+0x2e4><== ALWAYS TAKEN
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");
801bdcc: 2b 82 00 64 lw r2,(sp+100) <== 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: "
801bdd0: 2b 84 00 b0 lw r4,(sp+176) <== NOT EXECUTED
801bdd4: 5c 40 00 05 bne r2,r0,801bde8 <rtems_rfs_dir_del_entry+0x2ac><== 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");
801bdd8: 2b 81 00 5c lw r1,(sp+92) <== 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: "
801bddc: 78 07 08 03 mvhi r7,0x803 <== NOT EXECUTED
801bde0: 38 e7 6d d8 ori r7,r7,0x6dd8 <== 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");
801bde4: 44 22 00 08 be r1,r2,801be04 <rtems_rfs_dir_del_entry+0x2c8><== NOT EXECUTED
801bde8: 2b 81 00 5c lw r1,(sp+92) <== 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: "
801bdec: 78 07 08 03 mvhi r7,0x803 <== NOT EXECUTED
801bdf0: 38 e7 72 78 ori r7,r7,0x7278 <== 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");
801bdf4: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED
801bdf8: 5c 41 00 03 bne r2,r1,801be04 <rtems_rfs_dir_del_entry+0x2c8><== 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: "
801bdfc: 78 07 08 03 mvhi r7,0x803 <== NOT EXECUTED
801be00: 38 e7 6d d8 ori r7,r7,0x6dd8 <== NOT EXECUTED
801be04: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801be08: 38 21 87 70 ori r1,r1,0x8770 <== NOT EXECUTED
801be0c: ba 80 10 00 mv r2,r20 <== NOT EXECUTED
801be10: b9 a0 18 00 mv r3,r13 <== NOT EXECUTED
801be14: b9 c0 28 00 mv r5,r14 <== NOT EXECUTED
801be18: b8 e0 30 00 mv r6,r7 <== NOT EXECUTED
801be1c: f8 00 1a 16 calli 8022674 <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) &&
801be20: 38 01 ff ff mvu r1,0xffff
801be24: e5 a1 68 00 cmpe r13,r13,r1
(eoffset == 0) && rtems_rfs_block_map_last (&map))
801be28: 65 ce 00 00 cmpei r14,r14,0
"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) &&
801be2c: a1 ae 68 00 and r13,r13,r14
801be30: 45 a0 00 1b be r13,r0,801be9c <rtems_rfs_dir_del_entry+0x360><== ALWAYS TAKEN
(eoffset == 0) && rtems_rfs_block_map_last (&map))
801be34: 2b 81 00 64 lw r1,(sp+100) <== NOT EXECUTED
801be38: 5c 20 00 03 bne r1,r0,801be44 <rtems_rfs_dir_del_entry+0x308><== NOT EXECUTED
801be3c: 2b 82 00 5c lw r2,(sp+92) <== NOT EXECUTED
801be40: 44 41 00 04 be r2,r1,801be50 <rtems_rfs_dir_del_entry+0x314><== NOT EXECUTED
801be44: 2b 82 00 5c lw r2,(sp+92) <== NOT EXECUTED
801be48: 34 42 ff ff addi r2,r2,-1 <== NOT EXECUTED
801be4c: 5c 22 00 14 bne r1,r2,801be9c <rtems_rfs_dir_del_entry+0x360><== NOT EXECUTED
{
rc = rtems_rfs_block_map_shrink (fs, &map, 1);
801be50: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801be54: 37 82 00 54 addi r2,sp,84 <== NOT EXECUTED
801be58: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
801be5c: fb ff f9 31 calli 801a320 <rtems_rfs_block_map_shrink> <== NOT EXECUTED
801be60: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
if (rc > 0)
801be64: 4c 01 00 0e bge r0,r1,801be9c <rtems_rfs_dir_del_entry+0x360><== NOT EXECUTED
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
801be68: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801be6c: 78 02 40 00 mvhi r2,0x4000 <== NOT EXECUTED
801be70: fb ff d3 ae calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801be74: 44 20 00 0a be r1,r0,801be9c <rtems_rfs_dir_del_entry+0x360><== NOT EXECUTED
printf ("rtems-rfs: dir-del-entry: "
801be78: 2a 2e 00 08 lw r14,(r17+8) <== NOT EXECUTED
801be7c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
801be80: f8 00 1e b8 calli 8023960 <strerror> <== NOT EXECUTED
801be84: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
801be88: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801be8c: 38 21 87 d0 ori r1,r1,0x87d0 <== NOT EXECUTED
801be90: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
801be94: b9 a0 18 00 mv r3,r13 <== NOT EXECUTED
801be98: f8 00 19 f7 calli 8022674 <printf> <== NOT EXECUTED
"block map shrink failed for ino %" PRIu32 ": %d: %s\n",
rtems_rfs_inode_ino (dir), rc, strerror (rc));
}
}
rtems_rfs_buffer_mark_dirty (&buffer);
801be9c: 34 01 00 01 mvi r1,1
801bea0: 33 81 00 a4 sb (sp+164),r1
*/
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);
801bea4: 37 82 00 a4 addi r2,sp,164
801bea8: b9 80 08 00 mv r1,r12
801beac: fb ff fa 88 calli 801a8cc <rtems_rfs_buffer_handle_release>
handle->dirty = false;
801beb0: 33 80 00 a4 sb (sp+164),r0
handle->bnum = 0;
801beb4: 5b 80 00 a8 sw (sp+168),r0
handle->buffer = NULL;
801beb8: 5b 80 00 ac sw (sp+172),r0
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
801bebc: b9 80 08 00 mv r1,r12
801bec0: 37 82 00 54 addi r2,sp,84
801bec4: fb ff f6 ac calli 8019974 <rtems_rfs_block_map_close>
return 0;
801bec8: e0 00 00 1c bi 801bf38 <rtems_rfs_dir_del_entry+0x3fc>
}
if (!search)
801becc: 46 e0 00 2f be r23,r0,801bf88 <rtems_rfs_dir_del_entry+0x44c><== NOT EXECUTED
{
rc = EIO;
break;
}
entry += elength;
801bed0: b5 af 68 00 add r13,r13,r15 <== NOT EXECUTED
eoffset += elength;
801bed4: b5 cf 70 00 add r14,r14,r15 <== 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))
801bed8: 2b 81 00 50 lw r1,(sp+80)
801bedc: 54 2e ff 76 bgu r1,r14,801bcb4 <rtems_rfs_dir_del_entry+0x178><== ALWAYS TAKEN
entry += elength;
eoffset += elength;
}
if (rc == 0)
801bee0: 5e 00 00 09 bne r16,r0,801bf04 <rtems_rfs_dir_del_entry+0x3c8><== NOT EXECUTED
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
801bee4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801bee8: 37 82 00 54 addi r2,sp,84 <== NOT EXECUTED
801beec: 37 83 00 b0 addi r3,sp,176 <== NOT EXECUTED
801bef0: fb ff f7 e3 calli 8019e7c <rtems_rfs_block_map_next_block> <== NOT EXECUTED
801bef4: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
if (rc == ENXIO)
801bef8: 5c 3b 00 04 bne r1,fp,801bf08 <rtems_rfs_dir_del_entry+0x3cc><== NOT EXECUTED
rc = ENOENT;
801befc: 34 0b 00 02 mvi r11,2 <== NOT EXECUTED
801bf00: e0 00 00 03 bi 801bf0c <rtems_rfs_dir_del_entry+0x3d0> <== NOT EXECUTED
rc = ENOENT;
rtems_rfs_block_map_close (fs, &map);
return rc;
}
rc = rtems_rfs_buffer_handle_open (fs, &buffer);
801bf04: ba 00 58 00 mv r11,r16 <== NOT EXECUTED
/*
* Only search if the offset is 0 else we are at that position.
*/
search = offset ? false : true;
while (rc == 0)
801bf08: 45 60 ff 49 be r11,r0,801bc2c <rtems_rfs_dir_del_entry+0xf0><== ALWAYS TAKEN
801bf0c: b9 60 80 00 mv r16,r11 <== 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);
801bf10: 37 82 00 a4 addi r2,sp,164 <== NOT EXECUTED
801bf14: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801bf18: fb ff fa 6d calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
rc = ENOENT;
}
}
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
801bf1c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801bf20: 37 82 00 54 addi r2,sp,84 <== NOT EXECUTED
handle->dirty = false;
801bf24: 33 80 00 a4 sb (sp+164),r0 <== NOT EXECUTED
handle->bnum = 0;
801bf28: 5b 80 00 a8 sw (sp+168),r0 <== NOT EXECUTED
handle->buffer = NULL;
801bf2c: 5b 80 00 ac sw (sp+172),r0 <== NOT EXECUTED
return rc;
801bf30: ba 00 58 00 mv r11,r16 <== NOT EXECUTED
rc = ENOENT;
}
}
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
801bf34: fb ff f6 90 calli 8019974 <rtems_rfs_block_map_close> <== NOT EXECUTED
return rc;
}
801bf38: b9 60 08 00 mv r1,r11
801bf3c: 2b 9d 00 04 lw ra,(sp+4)
801bf40: 2b 8b 00 44 lw r11,(sp+68)
801bf44: 2b 8c 00 40 lw r12,(sp+64)
801bf48: 2b 8d 00 3c lw r13,(sp+60)
801bf4c: 2b 8e 00 38 lw r14,(sp+56)
801bf50: 2b 8f 00 34 lw r15,(sp+52)
801bf54: 2b 90 00 30 lw r16,(sp+48)
801bf58: 2b 91 00 2c lw r17,(sp+44)
801bf5c: 2b 92 00 28 lw r18,(sp+40)
801bf60: 2b 93 00 24 lw r19,(sp+36)
801bf64: 2b 94 00 20 lw r20,(sp+32)
801bf68: 2b 95 00 1c lw r21,(sp+28)
801bf6c: 2b 96 00 18 lw r22,(sp+24)
801bf70: 2b 97 00 14 lw r23,(sp+20)
801bf74: 2b 98 00 10 lw r24,(sp+16)
801bf78: 2b 99 00 0c lw r25,(sp+12)
801bf7c: 2b 9b 00 08 lw fp,(sp+8)
801bf80: 37 9c 00 b0 addi sp,sp,176
801bf84: c3 a0 00 00 ret
rc = ENOENT;
rtems_rfs_block_map_close (fs, &map);
return rc;
}
rc = rtems_rfs_buffer_handle_open (fs, &buffer);
801bf88: 34 10 00 05 mvi r16,5 <== NOT EXECUTED
801bf8c: e3 ff ff de bi 801bf04 <rtems_rfs_dir_del_entry+0x3c8> <== NOT EXECUTED
0801c380 <rtems_rfs_dir_empty>:
int
rtems_rfs_dir_empty (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* dir)
{
801c380: 37 9c ff 54 addi sp,sp,-172
801c384: 5b 8b 00 44 sw (sp+68),r11
801c388: 5b 8c 00 40 sw (sp+64),r12
801c38c: 5b 8d 00 3c sw (sp+60),r13
801c390: 5b 8e 00 38 sw (sp+56),r14
801c394: 5b 8f 00 34 sw (sp+52),r15
801c398: 5b 90 00 30 sw (sp+48),r16
801c39c: 5b 91 00 2c sw (sp+44),r17
801c3a0: 5b 92 00 28 sw (sp+40),r18
801c3a4: 5b 93 00 24 sw (sp+36),r19
801c3a8: 5b 94 00 20 sw (sp+32),r20
801c3ac: 5b 95 00 1c sw (sp+28),r21
801c3b0: 5b 96 00 18 sw (sp+24),r22
801c3b4: 5b 97 00 14 sw (sp+20),r23
801c3b8: 5b 98 00 10 sw (sp+16),r24
801c3bc: 5b 99 00 0c sw (sp+12),r25
801c3c0: 5b 9b 00 08 sw (sp+8),fp
801c3c4: 5b 9d 00 04 sw (sp+4),ra
801c3c8: b8 20 60 00 mv r12,r1
801c3cc: b8 40 90 00 mv r18,r2
rtems_rfs_buffer_handle buffer;
rtems_rfs_block_no block;
bool empty;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
801c3d0: 34 01 00 00 mvi r1,0
801c3d4: 78 02 80 00 mvhi r2,0x8000
801c3d8: fb ff d2 54 calli 8010d28 <rtems_rfs_trace>
801c3dc: 44 20 00 05 be r1,r0,801c3f0 <rtems_rfs_dir_empty+0x70> <== ALWAYS TAKEN
printf ("rtems-rfs: dir-empty: dir=%" PRId32 "\n", rtems_rfs_inode_ino (dir));
801c3e0: 2a 42 00 08 lw r2,(r18+8) <== NOT EXECUTED
801c3e4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801c3e8: 38 21 88 f4 ori r1,r1,0x88f4 <== NOT EXECUTED
801c3ec: f8 00 18 a2 calli 8022674 <printf> <== NOT EXECUTED
empty = true;
rc = rtems_rfs_block_map_open (fs, dir, &map);
801c3f0: 37 8d 00 50 addi r13,sp,80
801c3f4: b9 80 08 00 mv r1,r12
801c3f8: ba 40 10 00 mv r2,r18
801c3fc: b9 a0 18 00 mv r3,r13
801c400: fb ff f4 d6 calli 8019758 <rtems_rfs_block_map_open>
801c404: b8 20 58 00 mv r11,r1
if (rc > 0)
801c408: 48 20 00 72 bg r1,r0,801c5d0 <rtems_rfs_dir_empty+0x250> <== NEVER TAKEN
return rc;
rc = rtems_rfs_block_map_seek (fs, &map, 0, &block);
801c40c: b9 80 08 00 mv r1,r12
801c410: b9 a0 10 00 mv r2,r13
801c414: 34 03 00 00 mvi r3,0
801c418: 34 04 00 00 mvi r4,0
801c41c: 37 85 00 ac addi r5,sp,172
801c420: fb ff f6 62 calli 8019da8 <rtems_rfs_block_map_seek>
801c424: b8 20 58 00 mv r11,r1
if (rc > 0)
801c428: 4c 01 00 04 bge r0,r1,801c438 <rtems_rfs_dir_empty+0xb8> <== ALWAYS TAKEN
{
rtems_rfs_block_map_close (fs, &map);
801c42c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801c430: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801c434: e0 00 00 66 bi 801c5cc <rtems_rfs_dir_empty+0x24c> <== NOT EXECUTED
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_EMPTY))
printf ("rtems-rfs: dir-empty: "
801c438: 78 10 08 03 mvhi r16,0x803
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
801c43c: 33 80 00 a0 sb (sp+160),r0
handle->bnum = 0;
801c440: 5b 80 00 a4 sw (sp+164),r0
handle->buffer = NULL;
801c444: 5b 80 00 a8 sw (sp+168),r0
while (empty)
{
uint8_t* entry;
int offset;
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
801c448: 37 99 00 a0 addi r25,sp,160
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
801c44c: 38 18 ff ff mvu r24,0xffff
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
801c450: 34 17 00 0a mvi r23,10
/*
* Ignore the current (.) and parent (..) entries. Anything else means
* the directory is not empty.
*/
if (((elength != (RTEMS_RFS_DIR_ENTRY_SIZE + 1)) ||
801c454: 34 16 00 0b mvi r22,11
(entry[RTEMS_RFS_DIR_ENTRY_SIZE] != '.')) &&
801c458: 34 15 00 0c mvi r21,12
((elength != (RTEMS_RFS_DIR_ENTRY_SIZE + 2)) ||
801c45c: 34 11 00 2e mvi r17,46
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_EMPTY))
printf ("rtems-rfs: dir-empty: "
801c460: 3a 10 89 14 ori r16,r16,0x8914
offset += elength;
}
if (empty)
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
801c464: b9 a0 a0 00 mv r20,r13
while (empty)
{
uint8_t* entry;
int offset;
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
801c468: 2b 83 00 ac lw r3,(sp+172)
801c46c: b9 80 08 00 mv r1,r12
801c470: bb 20 10 00 mv r2,r25
801c474: 34 04 00 01 mvi r4,1
801c478: fb ff f9 84 calli 801aa88 <rtems_rfs_buffer_handle_request>
801c47c: b8 20 58 00 mv r11,r1
if (rc > 0)
801c480: 48 20 00 4b bg r1,r0,801c5ac <rtems_rfs_dir_empty+0x22c> <== NEVER TAKEN
break;
entry = rtems_rfs_buffer_data (&buffer);
801c484: 2b 81 00 a8 lw r1,(sp+168)
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
801c488: 29 9b 00 08 lw fp,(r12+8)
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
if (rc > 0)
break;
entry = rtems_rfs_buffer_data (&buffer);
offset = 0;
801c48c: 34 0f 00 00 mvi r15,0
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
if (rc > 0)
break;
entry = rtems_rfs_buffer_data (&buffer);
801c490: 28 2d 00 1c lw r13,(r1+28)
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
801c494: 37 7b ff f6 addi fp,fp,-10
801c498: e0 00 00 38 bi 801c578 <rtems_rfs_dir_empty+0x1f8>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
801c49c: 41 a1 00 08 lbu r1,(r13+8)
801c4a0: 34 02 00 08 mvi r2,8
801c4a4: fb ff 94 0f calli 80014e0 <__ashlsi3>
801c4a8: 41 ae 00 09 lbu r14,(r13+9)
eino = rtems_rfs_dir_entry_ino (entry);
801c4ac: 41 a3 00 00 lbu r3,(r13+0)
801c4b0: 41 a5 00 01 lbu r5,(r13+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);
801c4b4: b8 2e 70 00 or r14,r1,r14
eino = rtems_rfs_dir_entry_ino (entry);
801c4b8: 41 a4 00 02 lbu r4,(r13+2)
801c4bc: 41 b3 00 03 lbu r19,(r13+3)
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
801c4c0: 45 d8 00 2f be r14,r24,801c57c <rtems_rfs_dir_empty+0x1fc>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
801c4c4: b8 60 08 00 mv r1,r3
801c4c8: 34 02 00 18 mvi r2,24
801c4cc: 5b 84 00 48 sw (sp+72),r4
801c4d0: 5b 85 00 4c sw (sp+76),r5
801c4d4: fb ff 94 03 calli 80014e0 <__ashlsi3>
801c4d8: 2b 85 00 4c lw r5,(sp+76)
801c4dc: ba 61 98 00 or r19,r19,r1
801c4e0: 34 02 00 10 mvi r2,16
801c4e4: b8 a0 08 00 mv r1,r5
801c4e8: fb ff 93 fe calli 80014e0 <__ashlsi3>
801c4ec: 2b 84 00 48 lw r4,(sp+72)
801c4f0: ba 61 98 00 or r19,r19,r1
801c4f4: 34 02 00 08 mvi r2,8
801c4f8: b8 80 08 00 mv r1,r4
801c4fc: fb ff 93 f9 calli 80014e0 <__ashlsi3>
801c500: ba 61 98 00 or r19,r19,r1
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
801c504: 4e ee 00 08 bge r23,r14,801c524 <rtems_rfs_dir_empty+0x1a4><== NEVER TAKEN
801c508: 29 81 00 1c lw r1,(r12+28)
801c50c: 66 62 00 00 cmpei r2,r19,0
801c510: f1 c1 08 00 cmpgeu r1,r14,r1
801c514: b8 41 08 00 or r1,r2,r1
801c518: 5c 20 00 03 bne r1,r0,801c524 <rtems_rfs_dir_empty+0x1a4> <== NEVER TAKEN
801c51c: 29 81 00 14 lw r1,(r12+20)
801c520: 50 33 00 0c bgeu r1,r19,801c550 <rtems_rfs_dir_empty+0x1d0><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_EMPTY))
801c524: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
801c528: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801c52c: fb ff d1 ff calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801c530: 44 20 00 13 be r1,r0,801c57c <rtems_rfs_dir_empty+0x1fc> <== NOT EXECUTED
printf ("rtems-rfs: dir-empty: "
801c534: 2a 42 00 08 lw r2,(r18+8) <== NOT EXECUTED
801c538: ba 00 08 00 mv r1,r16 <== NOT EXECUTED
801c53c: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
801c540: ba 60 20 00 mv r4,r19 <== NOT EXECUTED
801c544: b9 e0 28 00 mv r5,r15 <== NOT EXECUTED
801c548: f8 00 18 4b calli 8022674 <printf> <== NOT EXECUTED
801c54c: e0 00 00 0c bi 801c57c <rtems_rfs_dir_empty+0x1fc> <== NOT EXECUTED
/*
* Ignore the current (.) and parent (..) entries. Anything else means
* the directory is not empty.
*/
if (((elength != (RTEMS_RFS_DIR_ENTRY_SIZE + 1)) ||
801c550: 5d d6 00 03 bne r14,r22,801c55c <rtems_rfs_dir_empty+0x1dc>
801c554: 41 a1 00 0a lbu r1,(r13+10)
801c558: e0 00 00 05 bi 801c56c <rtems_rfs_dir_empty+0x1ec>
(entry[RTEMS_RFS_DIR_ENTRY_SIZE] != '.')) &&
801c55c: 5d d5 00 12 bne r14,r21,801c5a4 <rtems_rfs_dir_empty+0x224>
((elength != (RTEMS_RFS_DIR_ENTRY_SIZE + 2)) ||
801c560: 41 a1 00 0a lbu r1,(r13+10)
801c564: 5c 31 00 10 bne r1,r17,801c5a4 <rtems_rfs_dir_empty+0x224> <== NEVER TAKEN
(entry[RTEMS_RFS_DIR_ENTRY_SIZE] != '.') ||
801c568: 41 a1 00 0b lbu r1,(r13+11)
801c56c: 5c 31 00 0e bne r1,r17,801c5a4 <rtems_rfs_dir_empty+0x224> <== NEVER TAKEN
{
empty = false;
break;
}
entry += elength;
801c570: b5 ae 68 00 add r13,r13,r14
offset += elength;
801c574: b5 ee 78 00 add r15,r15,r14
break;
entry = rtems_rfs_buffer_data (&buffer);
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
801c578: 57 6f ff c9 bgu fp,r15,801c49c <rtems_rfs_dir_empty+0x11c> <== ALWAYS TAKEN
offset += elength;
}
if (empty)
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
801c57c: b9 80 08 00 mv r1,r12
801c580: ba 80 10 00 mv r2,r20
801c584: 37 83 00 ac addi r3,sp,172
801c588: fb ff f6 3d calli 8019e7c <rtems_rfs_block_map_next_block>
801c58c: b8 20 58 00 mv r11,r1
if (rc > 0)
801c590: 4c 01 ff b6 bge r0,r1,801c468 <rtems_rfs_dir_empty+0xe8> <== NEVER TAKEN
{
if (rc == ENXIO)
801c594: 7c 21 00 06 cmpnei r1,r1,6
801c598: c8 01 08 00 sub r1,r0,r1
801c59c: a1 61 58 00 and r11,r11,r1
801c5a0: e0 00 00 03 bi 801c5ac <rtems_rfs_dir_empty+0x22c>
break;
}
}
}
if ((rc == 0) && !empty)
801c5a4: 5d 60 00 02 bne r11,r0,801c5ac <rtems_rfs_dir_empty+0x22c> <== NEVER TAKEN
rc = ENOTEMPTY;
801c5a8: 34 0b 00 5a mvi r11,90
*/
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);
801c5ac: 37 82 00 a0 addi r2,sp,160
801c5b0: b9 80 08 00 mv r1,r12
801c5b4: fb ff f8 c6 calli 801a8cc <rtems_rfs_buffer_handle_release>
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
801c5b8: b9 80 08 00 mv r1,r12
handle->dirty = false;
801c5bc: 33 80 00 a0 sb (sp+160),r0
handle->bnum = 0;
801c5c0: 5b 80 00 a4 sw (sp+164),r0
handle->buffer = NULL;
801c5c4: 5b 80 00 a8 sw (sp+168),r0
801c5c8: 37 82 00 50 addi r2,sp,80
801c5cc: fb ff f4 ea calli 8019974 <rtems_rfs_block_map_close>
return rc;
}
801c5d0: b9 60 08 00 mv r1,r11
801c5d4: 2b 9d 00 04 lw ra,(sp+4)
801c5d8: 2b 8b 00 44 lw r11,(sp+68)
801c5dc: 2b 8c 00 40 lw r12,(sp+64)
801c5e0: 2b 8d 00 3c lw r13,(sp+60)
801c5e4: 2b 8e 00 38 lw r14,(sp+56)
801c5e8: 2b 8f 00 34 lw r15,(sp+52)
801c5ec: 2b 90 00 30 lw r16,(sp+48)
801c5f0: 2b 91 00 2c lw r17,(sp+44)
801c5f4: 2b 92 00 28 lw r18,(sp+40)
801c5f8: 2b 93 00 24 lw r19,(sp+36)
801c5fc: 2b 94 00 20 lw r20,(sp+32)
801c600: 2b 95 00 1c lw r21,(sp+28)
801c604: 2b 96 00 18 lw r22,(sp+24)
801c608: 2b 97 00 14 lw r23,(sp+20)
801c60c: 2b 98 00 10 lw r24,(sp+16)
801c610: 2b 99 00 0c lw r25,(sp+12)
801c614: 2b 9b 00 08 lw fp,(sp+8)
801c618: 37 9c 00 ac addi sp,sp,172
801c61c: c3 a0 00 00 ret
08020664 <rtems_rfs_dir_hash>:
*/
#define initval (20010928)
uint32_t
rtems_rfs_dir_hash (const void *key, size_t length)
{
8020664: 37 9c ff e0 addi sp,sp,-32
8020668: 5b 8b 00 20 sw (sp+32),r11
802066c: 5b 8c 00 1c sw (sp+28),r12
8020670: 5b 8d 00 18 sw (sp+24),r13
8020674: 5b 8e 00 14 sw (sp+20),r14
8020678: 5b 8f 00 10 sw (sp+16),r15
802067c: 5b 90 00 0c sw (sp+12),r16
8020680: 5b 91 00 08 sw (sp+8),r17
8020684: 5b 9d 00 04 sw (sp+4),ra
8020688: b8 40 78 00 mv r15,r2
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;
802068c: 78 02 08 03 mvhi r2,0x803
8020690: 38 42 93 30 ori r2,r2,0x9330
8020694: 28 4c 00 00 lw r12,(r2+0)
break;
case 0 : return c; /* zero length requires no mixing */
}
} else { /* need to read the key one byte at a time */
const uint8_t *k = (const uint8_t *)key;
8020698: b8 20 58 00 mv r11,r1
/*--------------- all but the last block: affect some 32 bits of (a,b,c) */
while (length > 12)
802069c: 34 10 00 0c mvi r16,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;
80206a0: b5 ec 60 00 add r12,r15,r12
80206a4: b9 80 68 00 mv r13,r12
80206a8: b9 80 70 00 mv r14,r12
} 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)
80206ac: e0 00 00 72 bi 8020874 <rtems_rfs_dir_hash+0x210>
{
a += k[0];
a += ((uint32_t)k[1])<<8;
80206b0: 41 61 00 01 lbu r1,(r11+1)
80206b4: 34 02 00 08 mvi r2,8
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);
length -= 12;
80206b8: 35 ef ff f4 addi r15,r15,-12
/*--------------- 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;
80206bc: fb ff 83 89 calli 80014e0 <__ashlsi3>
80206c0: b8 20 88 00 mv r17,r1
a += ((uint32_t)k[2])<<16;
80206c4: 41 61 00 02 lbu r1,(r11+2)
80206c8: 34 02 00 10 mvi r2,16
80206cc: fb ff 83 85 calli 80014e0 <__ashlsi3>
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];
80206d0: b6 21 08 00 add r1,r17,r1
80206d4: 41 71 00 00 lbu r17,(r11+0)
a += ((uint32_t)k[1])<<8;
a += ((uint32_t)k[2])<<16;
a += ((uint32_t)k[3])<<24;
80206d8: 34 02 00 18 mvi r2,24
/*--------------- 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;
80206dc: b4 31 88 00 add r17,r1,r17
a += ((uint32_t)k[2])<<16;
a += ((uint32_t)k[3])<<24;
80206e0: 41 61 00 03 lbu r1,(r11+3)
80206e4: fb ff 83 7f calli 80014e0 <__ashlsi3>
/*--------------- 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;
80206e8: b6 21 08 00 add r1,r17,r1
a += ((uint32_t)k[3])<<24;
80206ec: b4 2e 70 00 add r14,r1,r14
b += k[4];
b += ((uint32_t)k[5])<<8;
80206f0: 41 61 00 05 lbu r1,(r11+5)
80206f4: 34 02 00 08 mvi r2,8
80206f8: fb ff 83 7a calli 80014e0 <__ashlsi3>
80206fc: b8 20 88 00 mv r17,r1
b += ((uint32_t)k[6])<<16;
8020700: 41 61 00 06 lbu r1,(r11+6)
8020704: 34 02 00 10 mvi r2,16
8020708: fb ff 83 76 calli 80014e0 <__ashlsi3>
{
a += k[0];
a += ((uint32_t)k[1])<<8;
a += ((uint32_t)k[2])<<16;
a += ((uint32_t)k[3])<<24;
b += k[4];
802070c: b6 21 08 00 add r1,r17,r1
8020710: 41 71 00 04 lbu r17,(r11+4)
b += ((uint32_t)k[5])<<8;
b += ((uint32_t)k[6])<<16;
b += ((uint32_t)k[7])<<24;
8020714: 34 02 00 18 mvi r2,24
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;
8020718: b4 31 88 00 add r17,r1,r17
b += ((uint32_t)k[6])<<16;
b += ((uint32_t)k[7])<<24;
802071c: 41 61 00 07 lbu r1,(r11+7)
8020720: fb ff 83 70 calli 80014e0 <__ashlsi3>
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;
b += ((uint32_t)k[6])<<16;
8020724: b6 21 08 00 add r1,r17,r1
b += ((uint32_t)k[7])<<24;
8020728: b4 2d 68 00 add r13,r1,r13
c += k[8];
c += ((uint32_t)k[9])<<8;
802072c: 41 61 00 09 lbu r1,(r11+9)
8020730: 34 02 00 08 mvi r2,8
8020734: fb ff 83 6b calli 80014e0 <__ashlsi3>
8020738: b8 20 88 00 mv r17,r1
c += ((uint32_t)k[10])<<16;
802073c: 41 61 00 0a lbu r1,(r11+10)
8020740: 34 02 00 10 mvi r2,16
8020744: fb ff 83 67 calli 80014e0 <__ashlsi3>
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];
8020748: b6 21 08 00 add r1,r17,r1
802074c: 41 71 00 08 lbu r17,(r11+8)
c += ((uint32_t)k[9])<<8;
c += ((uint32_t)k[10])<<16;
c += ((uint32_t)k[11])<<24;
8020750: 34 02 00 18 mvi r2,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];
c += ((uint32_t)k[9])<<8;
8020754: b4 31 88 00 add r17,r1,r17
c += ((uint32_t)k[10])<<16;
c += ((uint32_t)k[11])<<24;
8020758: 41 61 00 0b lbu r1,(r11+11)
mix(a,b,c);
length -= 12;
k += 12;
802075c: 35 6b 00 0c addi r11,r11,12
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;
8020760: fb ff 83 60 calli 80014e0 <__ashlsi3>
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;
8020764: b6 21 08 00 add r1,r17,r1
c += ((uint32_t)k[11])<<24;
8020768: b4 2c 60 00 add r12,r1,r12
mix(a,b,c);
802076c: b9 80 08 00 mv r1,r12
8020770: 34 02 00 04 mvi r2,4
8020774: fb ff 83 5b calli 80014e0 <__ashlsi3>
8020778: b8 20 88 00 mv r17,r1
802077c: 34 02 00 1c mvi r2,28
8020780: b9 80 08 00 mv r1,r12
8020784: fb ff 83 7e calli 800157c <__lshrsi3>
8020788: ba 21 08 00 or r1,r17,r1
802078c: c9 cc 70 00 sub r14,r14,r12
8020790: 99 c1 70 00 xor r14,r14,r1
8020794: b9 c0 08 00 mv r1,r14
8020798: 34 02 00 06 mvi r2,6
802079c: fb ff 83 51 calli 80014e0 <__ashlsi3>
80207a0: b8 20 88 00 mv r17,r1
80207a4: 34 02 00 1a mvi r2,26
80207a8: b9 c0 08 00 mv r1,r14
80207ac: fb ff 83 74 calli 800157c <__lshrsi3>
80207b0: b5 8d 60 00 add r12,r12,r13
80207b4: ba 21 08 00 or r1,r17,r1
80207b8: c9 ae 68 00 sub r13,r13,r14
80207bc: 98 2d 68 00 xor r13,r1,r13
80207c0: b9 a0 08 00 mv r1,r13
80207c4: 34 02 00 08 mvi r2,8
80207c8: fb ff 83 46 calli 80014e0 <__ashlsi3>
80207cc: b8 20 88 00 mv r17,r1
80207d0: 34 02 00 18 mvi r2,24
80207d4: b9 a0 08 00 mv r1,r13
80207d8: fb ff 83 69 calli 800157c <__lshrsi3>
80207dc: b5 cc 70 00 add r14,r14,r12
80207e0: ba 21 08 00 or r1,r17,r1
80207e4: c9 8d 60 00 sub r12,r12,r13
80207e8: 98 2c 60 00 xor r12,r1,r12
80207ec: b9 80 08 00 mv r1,r12
80207f0: 34 02 00 10 mvi r2,16
80207f4: fb ff 83 3b calli 80014e0 <__ashlsi3>
80207f8: b8 20 88 00 mv r17,r1
80207fc: 34 02 00 10 mvi r2,16
8020800: b9 80 08 00 mv r1,r12
8020804: fb ff 83 5e calli 800157c <__lshrsi3>
8020808: b5 ae 68 00 add r13,r13,r14
802080c: ba 21 08 00 or r1,r17,r1
8020810: c9 cc 70 00 sub r14,r14,r12
8020814: 98 2e 70 00 xor r14,r1,r14
8020818: b9 c0 08 00 mv r1,r14
802081c: 34 02 00 13 mvi r2,19
8020820: fb ff 83 30 calli 80014e0 <__ashlsi3>
8020824: b8 20 88 00 mv r17,r1
8020828: 34 02 00 0d mvi r2,13
802082c: b9 c0 08 00 mv r1,r14
8020830: fb ff 83 53 calli 800157c <__lshrsi3>
8020834: b5 8d 60 00 add r12,r12,r13
8020838: ba 21 08 00 or r1,r17,r1
802083c: c9 ae 68 00 sub r13,r13,r14
8020840: 98 2d 68 00 xor r13,r1,r13
8020844: b9 a0 08 00 mv r1,r13
8020848: 34 02 00 04 mvi r2,4
802084c: fb ff 83 25 calli 80014e0 <__ashlsi3>
8020850: b8 20 88 00 mv r17,r1
8020854: 34 02 00 1c mvi r2,28
8020858: b9 a0 08 00 mv r1,r13
802085c: fb ff 83 48 calli 800157c <__lshrsi3>
8020860: b5 cc 70 00 add r14,r14,r12
8020864: ba 21 08 00 or r1,r17,r1
8020868: c9 8d 60 00 sub r12,r12,r13
802086c: 98 2c 60 00 xor r12,r1,r12
8020870: b5 ae 68 00 add r13,r13,r14
} 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)
8020874: 55 f0 ff 8f bgu r15,r16,80206b0 <rtems_rfs_dir_hash+0x4c>
length -= 12;
k += 12;
}
/*-------------------------------- last block: affect all 32 bits of (c) */
switch(length) /* all the case statements fall through */
8020878: 35 e1 ff ff addi r1,r15,-1
802087c: 34 02 00 0b mvi r2,11
8020880: 54 22 00 78 bgu r1,r2,8020a60 <rtems_rfs_dir_hash+0x3fc> <== NEVER TAKEN
8020884: 78 10 08 03 mvhi r16,0x803
8020888: 34 02 00 02 mvi r2,2
802088c: fb ff 83 15 calli 80014e0 <__ashlsi3>
8020890: 3a 10 93 34 ori r16,r16,0x9334
8020894: b6 01 08 00 add r1,r16,r1
8020898: 28 21 00 00 lw r1,(r1+0)
802089c: c0 20 00 00 b r1
{
case 12: c+=((uint32_t)k[11])<<24;
80208a0: 41 61 00 0b lbu r1,(r11+11)
80208a4: 34 02 00 18 mvi r2,24
80208a8: fb ff 83 0e calli 80014e0 <__ashlsi3>
80208ac: b4 2c 60 00 add r12,r1,r12
case 11: c+=((uint32_t)k[10])<<16;
80208b0: 41 61 00 0a lbu r1,(r11+10)
80208b4: 34 02 00 10 mvi r2,16
80208b8: fb ff 83 0a calli 80014e0 <__ashlsi3>
80208bc: b5 81 60 00 add r12,r12,r1
case 10: c+=((uint32_t)k[9])<<8;
80208c0: 41 61 00 09 lbu r1,(r11+9)
80208c4: 34 02 00 08 mvi r2,8
80208c8: fb ff 83 06 calli 80014e0 <__ashlsi3>
80208cc: b5 81 60 00 add r12,r12,r1
case 9 : c+=k[8];
80208d0: 41 61 00 08 lbu r1,(r11+8)
80208d4: b5 81 60 00 add r12,r12,r1
case 8 : b+=((uint32_t)k[7])<<24;
80208d8: 41 61 00 07 lbu r1,(r11+7)
80208dc: 34 02 00 18 mvi r2,24
80208e0: fb ff 83 00 calli 80014e0 <__ashlsi3>
80208e4: b4 2d 68 00 add r13,r1,r13
case 7 : b+=((uint32_t)k[6])<<16;
80208e8: 41 61 00 06 lbu r1,(r11+6)
80208ec: 34 02 00 10 mvi r2,16
80208f0: fb ff 82 fc calli 80014e0 <__ashlsi3>
80208f4: b5 a1 68 00 add r13,r13,r1
case 6 : b+=((uint32_t)k[5])<<8;
80208f8: 41 61 00 05 lbu r1,(r11+5)
80208fc: 34 02 00 08 mvi r2,8
8020900: fb ff 82 f8 calli 80014e0 <__ashlsi3>
8020904: b5 a1 68 00 add r13,r13,r1
case 5 : b+=k[4];
8020908: 41 61 00 04 lbu r1,(r11+4)
802090c: b5 a1 68 00 add r13,r13,r1
case 4 : a+=((uint32_t)k[3])<<24;
8020910: 41 61 00 03 lbu r1,(r11+3)
8020914: 34 02 00 18 mvi r2,24
8020918: fb ff 82 f2 calli 80014e0 <__ashlsi3>
802091c: b4 2e 70 00 add r14,r1,r14
case 3 : a+=((uint32_t)k[2])<<16;
8020920: 41 61 00 02 lbu r1,(r11+2)
8020924: 34 02 00 10 mvi r2,16
8020928: fb ff 82 ee calli 80014e0 <__ashlsi3>
802092c: b5 c1 70 00 add r14,r14,r1
case 2 : a+=((uint32_t)k[1])<<8;
8020930: 41 61 00 01 lbu r1,(r11+1)
8020934: 34 02 00 08 mvi r2,8
8020938: fb ff 82 ea calli 80014e0 <__ashlsi3>
802093c: b5 c1 70 00 add r14,r14,r1
case 1 : a+=k[0];
8020940: 41 61 00 00 lbu r1,(r11+0)
break;
case 0 : return c;
}
}
final(a,b,c);
8020944: 34 02 00 12 mvi r2,18
8020948: 99 8d 60 00 xor r12,r12,r13
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];
802094c: b5 c1 70 00 add r14,r14,r1
break;
case 0 : return c;
}
}
final(a,b,c);
8020950: b9 a0 08 00 mv r1,r13
8020954: fb ff 83 0a calli 800157c <__lshrsi3>
8020958: b8 20 58 00 mv r11,r1
802095c: 34 02 00 0e mvi r2,14
8020960: b9 a0 08 00 mv r1,r13
8020964: fb ff 82 df calli 80014e0 <__ashlsi3>
8020968: b9 61 08 00 or r1,r11,r1
802096c: c9 81 60 00 sub r12,r12,r1
8020970: b9 80 08 00 mv r1,r12
8020974: 34 02 00 0b mvi r2,11
8020978: fb ff 82 da calli 80014e0 <__ashlsi3>
802097c: b8 20 58 00 mv r11,r1
8020980: 34 02 00 15 mvi r2,21
8020984: b9 80 08 00 mv r1,r12
8020988: fb ff 82 fd calli 800157c <__lshrsi3>
802098c: b9 61 08 00 or r1,r11,r1
8020990: 99 8e 70 00 xor r14,r12,r14
8020994: c9 c1 70 00 sub r14,r14,r1
8020998: b9 c0 08 00 mv r1,r14
802099c: 34 02 00 19 mvi r2,25
80209a0: fb ff 82 d0 calli 80014e0 <__ashlsi3>
80209a4: b8 20 58 00 mv r11,r1
80209a8: 34 02 00 07 mvi r2,7
80209ac: b9 c0 08 00 mv r1,r14
80209b0: fb ff 82 f3 calli 800157c <__lshrsi3>
80209b4: b9 61 08 00 or r1,r11,r1
80209b8: 99 cd 68 00 xor r13,r14,r13
80209bc: c9 a1 68 00 sub r13,r13,r1
80209c0: b9 a0 08 00 mv r1,r13
80209c4: 34 02 00 10 mvi r2,16
80209c8: fb ff 82 c6 calli 80014e0 <__ashlsi3>
80209cc: b8 20 58 00 mv r11,r1
80209d0: 34 02 00 10 mvi r2,16
80209d4: b9 a0 08 00 mv r1,r13
80209d8: fb ff 82 e9 calli 800157c <__lshrsi3>
80209dc: b9 61 08 00 or r1,r11,r1
80209e0: 99 ac 60 00 xor r12,r13,r12
80209e4: c9 81 60 00 sub r12,r12,r1
80209e8: b9 80 08 00 mv r1,r12
80209ec: 34 02 00 04 mvi r2,4
80209f0: fb ff 82 bc calli 80014e0 <__ashlsi3>
80209f4: b8 20 58 00 mv r11,r1
80209f8: 34 02 00 1c mvi r2,28
80209fc: b9 80 08 00 mv r1,r12
8020a00: fb ff 82 df calli 800157c <__lshrsi3>
8020a04: b9 61 08 00 or r1,r11,r1
8020a08: 99 8e 70 00 xor r14,r12,r14
8020a0c: c9 c1 70 00 sub r14,r14,r1
8020a10: 34 02 00 0e mvi r2,14
8020a14: b9 c0 08 00 mv r1,r14
8020a18: fb ff 82 b2 calli 80014e0 <__ashlsi3>
8020a1c: b8 20 58 00 mv r11,r1
8020a20: 34 02 00 12 mvi r2,18
8020a24: b9 c0 08 00 mv r1,r14
8020a28: fb ff 82 d5 calli 800157c <__lshrsi3>
8020a2c: b9 61 08 00 or r1,r11,r1
8020a30: 99 cd 68 00 xor r13,r14,r13
8020a34: c9 a1 68 00 sub r13,r13,r1
8020a38: 34 02 00 18 mvi r2,24
8020a3c: b9 a0 08 00 mv r1,r13
8020a40: fb ff 82 a8 calli 80014e0 <__ashlsi3>
8020a44: b8 20 58 00 mv r11,r1
8020a48: 34 02 00 08 mvi r2,8
8020a4c: b9 a0 08 00 mv r1,r13
8020a50: fb ff 82 cb calli 800157c <__lshrsi3>
8020a54: 99 ac 60 00 xor r12,r13,r12
8020a58: b9 61 08 00 or r1,r11,r1
8020a5c: c9 81 60 00 sub r12,r12,r1
return c;
}
8020a60: b9 80 08 00 mv r1,r12
8020a64: 2b 9d 00 04 lw ra,(sp+4)
8020a68: 2b 8b 00 20 lw r11,(sp+32)
8020a6c: 2b 8c 00 1c lw r12,(sp+28)
8020a70: 2b 8d 00 18 lw r13,(sp+24)
8020a74: 2b 8e 00 14 lw r14,(sp+20)
8020a78: 2b 8f 00 10 lw r15,(sp+16)
8020a7c: 2b 90 00 0c lw r16,(sp+12)
8020a80: 2b 91 00 08 lw r17,(sp+8)
8020a84: 37 9c 00 20 addi sp,sp,32
8020a88: c3 a0 00 00 ret
0801b148 <rtems_rfs_dir_lookup_ino>:
rtems_rfs_inode_handle* inode,
const char* name,
int length,
rtems_rfs_ino* ino,
uint32_t* offset)
{
801b148: 37 9c ff 40 addi sp,sp,-192
801b14c: 5b 8b 00 44 sw (sp+68),r11
801b150: 5b 8c 00 40 sw (sp+64),r12
801b154: 5b 8d 00 3c sw (sp+60),r13
801b158: 5b 8e 00 38 sw (sp+56),r14
801b15c: 5b 8f 00 34 sw (sp+52),r15
801b160: 5b 90 00 30 sw (sp+48),r16
801b164: 5b 91 00 2c sw (sp+44),r17
801b168: 5b 92 00 28 sw (sp+40),r18
801b16c: 5b 93 00 24 sw (sp+36),r19
801b170: 5b 94 00 20 sw (sp+32),r20
801b174: 5b 95 00 1c sw (sp+28),r21
801b178: 5b 96 00 18 sw (sp+24),r22
801b17c: 5b 97 00 14 sw (sp+20),r23
801b180: 5b 98 00 10 sw (sp+16),r24
801b184: 5b 99 00 0c sw (sp+12),r25
801b188: 5b 9b 00 08 sw (sp+8),fp
801b18c: 5b 9d 00 04 sw (sp+4),ra
801b190: b8 20 b0 00 mv r22,r1
801b194: b8 40 b8 00 mv r23,r2
801b198: b8 a0 d8 00 mv fp,r5
rtems_rfs_block_map map;
rtems_rfs_buffer_handle entries;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
801b19c: 34 01 00 00 mvi r1,0
801b1a0: 78 02 04 00 mvhi r2,0x400
rtems_rfs_inode_handle* inode,
const char* name,
int length,
rtems_rfs_ino* ino,
uint32_t* offset)
{
801b1a4: 5b 83 00 48 sw (sp+72),r3
801b1a8: b8 80 c8 00 mv r25,r4
801b1ac: 5b 86 00 4c sw (sp+76),r6
rtems_rfs_block_map map;
rtems_rfs_buffer_handle entries;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
801b1b0: fb ff d6 de calli 8010d28 <rtems_rfs_trace>
801b1b4: 44 20 00 13 be r1,r0,801b200 <rtems_rfs_dir_lookup_ino+0xb8><== ALWAYS TAKEN
{
int c;
printf ("rtems-rfs: dir-lookup-ino: lookup ino: root=%" PRId32 ", path=",
801b1b8: 78 07 08 03 mvhi r7,0x803 <== NOT EXECUTED
801b1bc: 2a e2 00 08 lw r2,(r23+8) <== NOT EXECUTED
801b1c0: b8 e0 08 00 mv r1,r7 <== NOT EXECUTED
801b1c4: 38 21 82 90 ori r1,r1,0x8290 <== NOT EXECUTED
801b1c8: f8 00 1d 2b calli 8022674 <printf> <== NOT EXECUTED
inode->ino);
for (c = 0; c < length; c++)
801b1cc: 34 0b 00 00 mvi r11,0 <== NOT EXECUTED
801b1d0: e0 00 00 06 bi 801b1e8 <rtems_rfs_dir_lookup_ino+0xa0> <== NOT EXECUTED
#define rtems_rfs_dir_entry_valid(_f, _l, _i) \
(((_l) <= RTEMS_RFS_DIR_ENTRY_SIZE) || ((_l) >= rtems_rfs_fs_max_name (_f)) \
|| (_i < RTEMS_RFS_ROOT_INO) || (_i > rtems_rfs_fs_inodes (_f)))
int
rtems_rfs_dir_lookup_ino (rtems_rfs_file_system* fs,
801b1d4: 2b 82 00 48 lw r2,(sp+72) <== NOT EXECUTED
801b1d8: b4 4b 08 00 add r1,r2,r11 <== NOT EXECUTED
{
int c;
printf ("rtems-rfs: dir-lookup-ino: lookup ino: root=%" PRId32 ", path=",
inode->ino);
for (c = 0; c < length; c++)
printf ("%c", name[c]);
801b1dc: 40 21 00 00 lbu r1,(r1+0) <== 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++)
801b1e0: 35 6b 00 01 addi r11,r11,1 <== NOT EXECUTED
printf ("%c", name[c]);
801b1e4: f8 00 1d aa calli 802288c <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++)
801b1e8: 4b 2b ff fb bg r25,r11,801b1d4 <rtems_rfs_dir_lookup_ino+0x8c><== NOT EXECUTED
printf ("%c", name[c]);
printf (", len=%d\n", length);
801b1ec: 78 07 08 03 mvhi r7,0x803 <== NOT EXECUTED
801b1f0: b8 e0 08 00 mv r1,r7 <== NOT EXECUTED
801b1f4: 38 21 82 c8 ori r1,r1,0x82c8 <== NOT EXECUTED
801b1f8: bb 20 10 00 mv r2,r25 <== NOT EXECUTED
801b1fc: f8 00 1d 1e calli 8022674 <printf> <== NOT EXECUTED
}
*ino = RTEMS_RFS_EMPTY_INO;
*offset = 0;
801b200: 2b 85 00 4c lw r5,(sp+76)
for (c = 0; c < length; c++)
printf ("%c", name[c]);
printf (", len=%d\n", length);
}
*ino = RTEMS_RFS_EMPTY_INO;
801b204: 5b 60 00 00 sw (fp+0),r0
*offset = 0;
rc = rtems_rfs_block_map_open (fs, inode, &map);
801b208: 37 8b 00 64 addi r11,sp,100
printf ("%c", name[c]);
printf (", len=%d\n", length);
}
*ino = RTEMS_RFS_EMPTY_INO;
*offset = 0;
801b20c: 58 a0 00 00 sw (r5+0),r0
rc = rtems_rfs_block_map_open (fs, inode, &map);
801b210: ba c0 08 00 mv r1,r22
801b214: ba e0 10 00 mv r2,r23
801b218: b9 60 18 00 mv r3,r11
801b21c: fb ff f9 4f calli 8019758 <rtems_rfs_block_map_open>
801b220: b8 20 a8 00 mv r21,r1
if (rc > 0)
801b224: 4c 01 00 10 bge r0,r1,801b264 <rtems_rfs_dir_lookup_ino+0x11c><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
801b228: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801b22c: 78 02 04 00 mvhi r2,0x400 <== NOT EXECUTED
801b230: fb ff d6 be calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801b234: 44 20 01 09 be r1,r0,801b658 <rtems_rfs_dir_lookup_ino+0x510><== NOT EXECUTED
printf ("rtems-rfs: dir-lookup-ino: map open failed for ino %" PRIu32 ": %d: %s",
801b238: ba a0 08 00 mv r1,r21 <== NOT EXECUTED
801b23c: 2a eb 00 08 lw r11,(r23+8) <== NOT EXECUTED
801b240: f8 00 21 c8 calli 8023960 <strerror> <== NOT EXECUTED
801b244: 78 05 08 03 mvhi r5,0x803 <== NOT EXECUTED
801b248: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
801b24c: b8 a0 08 00 mv r1,r5 <== NOT EXECUTED
801b250: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801b254: ba a0 18 00 mv r3,r21 <== NOT EXECUTED
801b258: 38 21 82 d4 ori r1,r1,0x82d4 <== NOT EXECUTED
801b25c: f8 00 1d 06 calli 8022674 <printf> <== NOT EXECUTED
801b260: e0 00 00 fe bi 801b658 <rtems_rfs_dir_lookup_ino+0x510> <== NOT EXECUTED
uint32_t hash;
/*
* Calculate the hash of the look up string.
*/
hash = rtems_rfs_dir_hash (name, length);
801b264: 2b 81 00 48 lw r1,(sp+72)
801b268: bb 20 10 00 mv r2,r25
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
801b26c: 33 80 00 b4 sb (sp+180),r0
handle->bnum = 0;
801b270: 5b 80 00 b8 sw (sp+184),r0
handle->buffer = NULL;
801b274: 5b 80 00 bc sw (sp+188),r0
801b278: f8 00 14 fb calli 8020664 <rtems_rfs_dir_hash>
801b27c: 5b 81 00 60 sw (sp+96),r1
/*
* 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);
801b280: b9 60 10 00 mv r2,r11
801b284: ba c0 08 00 mv r1,r22
801b288: 34 03 00 00 mvi r3,0
801b28c: 34 04 00 00 mvi r4,0
801b290: 37 85 00 c0 addi r5,sp,192
801b294: fb ff fa c5 calli 8019da8 <rtems_rfs_block_map_seek>
801b298: b8 20 a8 00 mv r21,r1
if (rc > 0)
801b29c: 48 20 00 02 bg r1,r0,801b2a4 <rtems_rfs_dir_lookup_ino+0x15c><== NEVER TAKEN
801b2a0: e0 00 00 c7 bi 801b5bc <rtems_rfs_dir_lookup_ino+0x474>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
801b2a4: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801b2a8: 78 02 04 00 mvhi r2,0x400 <== NOT EXECUTED
801b2ac: fb ff d6 9f calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801b2b0: 44 20 00 09 be r1,r0,801b2d4 <rtems_rfs_dir_lookup_ino+0x18c><== NOT EXECUTED
printf ("rtems-rfs: dir-lookup-ino: block map find failed: %d: %s\n",
801b2b4: ba a0 08 00 mv r1,r21 <== NOT EXECUTED
801b2b8: f8 00 21 aa calli 8023960 <strerror> <== NOT EXECUTED
801b2bc: 78 04 08 03 mvhi r4,0x803 <== NOT EXECUTED
801b2c0: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801b2c4: b8 80 08 00 mv r1,r4 <== NOT EXECUTED
801b2c8: 38 21 83 14 ori r1,r1,0x8314 <== NOT EXECUTED
801b2cc: ba a0 10 00 mv r2,r21 <== NOT EXECUTED
801b2d0: f8 00 1c e9 calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
if (rc == ENXIO)
801b2d4: 34 04 00 06 mvi r4,6 <== NOT EXECUTED
801b2d8: 5e a4 00 d7 bne r21,r4,801b634 <rtems_rfs_dir_lookup_ino+0x4ec><== NOT EXECUTED
rc = ENOENT;
801b2dc: 34 15 00 02 mvi r21,2 <== NOT EXECUTED
801b2e0: e0 00 00 d5 bi 801b634 <rtems_rfs_dir_lookup_ino+0x4ec> <== NOT EXECUTED
while ((rc == 0) && block)
{
uint8_t* entry;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
801b2e4: 34 01 00 00 mvi r1,0
801b2e8: 78 02 04 00 mvhi r2,0x400
801b2ec: fb ff d6 8f calli 8010d28 <rtems_rfs_trace>
801b2f0: 44 20 00 05 be r1,r0,801b304 <rtems_rfs_dir_lookup_ino+0x1bc><== ALWAYS TAKEN
printf ("rtems-rfs: dir-lookup-ino: block read, ino=%" PRIu32 " bno=%" PRId32 "\n",
801b2f4: 2b 81 00 50 lw r1,(sp+80) <== NOT EXECUTED
801b2f8: 2a e2 00 08 lw r2,(r23+8) <== NOT EXECUTED
801b2fc: 2b 83 00 74 lw r3,(sp+116) <== NOT EXECUTED
801b300: f8 00 1c dd calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_inode_ino (inode), map.bpos.bno);
rc = rtems_rfs_buffer_handle_request (fs, &entries, block, true);
801b304: 2b 83 00 c0 lw r3,(sp+192)
801b308: ba c0 08 00 mv r1,r22
801b30c: 37 82 00 b4 addi r2,sp,180
801b310: 34 04 00 01 mvi r4,1
801b314: fb ff fd dd calli 801aa88 <rtems_rfs_buffer_handle_request>
801b318: b8 20 c0 00 mv r24,r1
if (rc > 0)
801b31c: 4c 01 00 12 bge r0,r1,801b364 <rtems_rfs_dir_lookup_ino+0x21c><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
801b320: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801b324: 78 02 04 00 mvhi r2,0x400 <== NOT EXECUTED
801b328: fb ff d6 80 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801b32c: 44 20 00 b5 be r1,r0,801b600 <rtems_rfs_dir_lookup_ino+0x4b8><== NOT EXECUTED
printf ("rtems-rfs: dir-lookup-ino: block read, ino=%" PRIu32 " block=%" PRId32 ": %d: %s\n",
801b330: bb 00 08 00 mv r1,r24 <== NOT EXECUTED
801b334: 2a ec 00 08 lw r12,(r23+8) <== NOT EXECUTED
801b338: 2b 8b 00 c0 lw r11,(sp+192) <== NOT EXECUTED
801b33c: f8 00 21 89 calli 8023960 <strerror> <== NOT EXECUTED
801b340: 78 06 08 03 mvhi r6,0x803 <== NOT EXECUTED
801b344: b8 20 28 00 mv r5,r1 <== NOT EXECUTED
801b348: b8 c0 08 00 mv r1,r6 <== NOT EXECUTED
801b34c: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
801b350: b9 60 18 00 mv r3,r11 <== NOT EXECUTED
801b354: bb 00 20 00 mv r4,r24 <== NOT EXECUTED
801b358: 38 21 83 88 ori r1,r1,0x8388 <== NOT EXECUTED
801b35c: f8 00 1c c6 calli 8022674 <printf> <== NOT EXECUTED
801b360: e0 00 00 a8 bi 801b600 <rtems_rfs_dir_lookup_ino+0x4b8> <== NOT EXECUTED
/*
* Search the block to see if the name matches. A hash of 0xffff or 0x0
* means the entry is empty.
*/
entry = rtems_rfs_buffer_data (&entries);
801b364: 2b 84 00 bc lw r4,(sp+188)
map.bpos.boff = 0;
801b368: 5b 80 00 78 sw (sp+120),r0
/*
* 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);
801b36c: 28 93 00 1c lw r19,(r4+28)
map.bpos.boff = 0;
while (map.bpos.boff < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
801b370: e0 00 00 72 bi 801b538 <rtems_rfs_dir_lookup_ino+0x3f0>
{
uint32_t ehash;
int elength;
ehash = rtems_rfs_dir_entry_hash (entry);
elength = rtems_rfs_dir_entry_length (entry);
801b374: 42 61 00 08 lbu r1,(r19+8)
801b378: 34 02 00 08 mvi r2,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);
801b37c: 42 6d 00 04 lbu r13,(r19+4)
elength = rtems_rfs_dir_entry_length (entry);
801b380: fb ff 98 58 calli 80014e0 <__ashlsi3>
801b384: 42 74 00 09 lbu r20,(r19+9)
*ino = rtems_rfs_dir_entry_ino (entry);
801b388: 42 6c 00 03 lbu r12,(r19+3)
801b38c: 34 02 00 18 mvi r2,24
{
uint32_t ehash;
int elength;
ehash = rtems_rfs_dir_entry_hash (entry);
elength = rtems_rfs_dir_entry_length (entry);
801b390: b8 34 a0 00 or r20,r1,r20
*ino = rtems_rfs_dir_entry_ino (entry);
801b394: 42 61 00 00 lbu r1,(r19+0)
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);
801b398: 42 6e 00 05 lbu r14,(r19+5)
801b39c: 42 72 00 06 lbu r18,(r19+6)
elength = rtems_rfs_dir_entry_length (entry);
*ino = rtems_rfs_dir_entry_ino (entry);
801b3a0: fb ff 98 50 calli 80014e0 <__ashlsi3>
801b3a4: b9 81 60 00 or r12,r12,r1
801b3a8: 42 61 00 01 lbu r1,(r19+1)
801b3ac: 34 02 00 10 mvi r2,16
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);
801b3b0: 42 6b 00 07 lbu r11,(r19+7)
elength = rtems_rfs_dir_entry_length (entry);
*ino = rtems_rfs_dir_entry_ino (entry);
801b3b4: fb ff 98 4b calli 80014e0 <__ashlsi3>
801b3b8: b9 81 60 00 or r12,r12,r1
801b3bc: 42 61 00 02 lbu r1,(r19+2)
801b3c0: 34 02 00 08 mvi r2,8
801b3c4: 36 70 00 01 addi r16,r19,1
801b3c8: fb ff 98 46 calli 80014e0 <__ashlsi3>
801b3cc: b9 81 38 00 or r7,r12,r1
801b3d0: 5b 67 00 00 sw (fp+0),r7
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
801b3d4: 38 01 ff ff mvu r1,0xffff
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);
801b3d8: 36 6f 00 02 addi r15,r19,2
801b3dc: 36 71 00 03 addi r17,r19,3
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
801b3e0: 46 81 00 5a be r20,r1,801b548 <rtems_rfs_dir_lookup_ino+0x400>
break;
if (rtems_rfs_dir_entry_valid (fs, elength, *ino))
801b3e4: 34 02 00 0a mvi r2,10
801b3e8: 4c 54 00 06 bge r2,r20,801b400 <rtems_rfs_dir_lookup_ino+0x2b8><== NEVER TAKEN
801b3ec: 2a c6 00 1c lw r6,(r22+28)
801b3f0: 52 86 00 04 bgeu r20,r6,801b400 <rtems_rfs_dir_lookup_ino+0x2b8><== NEVER TAKEN
801b3f4: 44 e0 00 03 be r7,r0,801b400 <rtems_rfs_dir_lookup_ino+0x2b8><== NEVER TAKEN
801b3f8: 2a c6 00 14 lw r6,(r22+20)
801b3fc: 50 c7 00 0c bgeu r6,r7,801b42c <rtems_rfs_dir_lookup_ino+0x2e4><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
801b400: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801b404: 78 02 04 00 mvhi r2,0x400 <== NOT EXECUTED
801b408: fb ff d6 48 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801b40c: 44 20 00 a7 be r1,r0,801b6a8 <rtems_rfs_dir_lookup_ino+0x560><== NOT EXECUTED
printf ("rtems-rfs: dir-lookup-ino: "
801b410: 2b 81 00 5c lw r1,(sp+92) <== NOT EXECUTED
801b414: 2a e2 00 08 lw r2,(r23+8) <== NOT EXECUTED
801b418: 2b 64 00 00 lw r4,(fp+0) <== NOT EXECUTED
801b41c: 2b 85 00 78 lw r5,(sp+120) <== NOT EXECUTED
801b420: ba 80 18 00 mv r3,r20 <== NOT EXECUTED
801b424: f8 00 1c 94 calli 8022674 <printf> <== NOT EXECUTED
801b428: e0 00 00 a0 bi 801b6a8 <rtems_rfs_dir_lookup_ino+0x560> <== NOT EXECUTED
while (map.bpos.boff < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
{
uint32_t ehash;
int elength;
ehash = rtems_rfs_dir_entry_hash (entry);
801b42c: 34 02 00 18 mvi r2,24
801b430: b9 a0 08 00 mv r1,r13
801b434: fb ff 98 2b calli 80014e0 <__ashlsi3>
801b438: b8 20 60 00 mv r12,r1
801b43c: 34 02 00 10 mvi r2,16
801b440: b9 c0 08 00 mv r1,r14
801b444: fb ff 98 27 calli 80014e0 <__ashlsi3>
801b448: b9 81 20 00 or r4,r12,r1
801b44c: 34 02 00 08 mvi r2,8
801b450: ba 40 08 00 mv r1,r18
801b454: b8 8b 58 00 or r11,r4,r11
801b458: fb ff 98 22 calli 80014e0 <__ashlsi3>
rtems_rfs_inode_ino (inode), elength, *ino, map.bpos.boff);
rc = EIO;
break;
}
if (ehash == hash)
801b45c: 2b 85 00 60 lw r5,(sp+96)
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);
801b460: b9 61 20 00 or r4,r11,r1
rtems_rfs_inode_ino (inode), elength, *ino, map.bpos.boff);
rc = EIO;
break;
}
if (ehash == hash)
801b464: 5c 85 00 31 bne r4,r5,801b528 <rtems_rfs_dir_lookup_ino+0x3e0>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
801b468: 34 01 00 00 mvi r1,0
801b46c: 78 02 08 00 mvhi r2,0x800
801b470: fb ff d6 2e calli 8010d28 <rtems_rfs_trace>
801b474: 44 20 00 15 be r1,r0,801b4c8 <rtems_rfs_dir_lookup_ino+0x380><== ALWAYS TAKEN
printf ("rtems-rfs: dir-lookup-ino: "
"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));
801b478: 42 61 00 00 lbu r1,(r19+0) <== NOT EXECUTED
801b47c: 42 2b 00 00 lbu r11,(r17+0) <== NOT EXECUTED
801b480: 34 02 00 18 mvi r2,24 <== NOT EXECUTED
801b484: fb ff 98 17 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801b488: b9 61 58 00 or r11,r11,r1 <== NOT EXECUTED
801b48c: 42 01 00 00 lbu r1,(r16+0) <== NOT EXECUTED
801b490: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
}
if (ehash == hash)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
printf ("rtems-rfs: dir-lookup-ino: "
801b494: 2a ec 00 08 lw r12,(r23+8) <== 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));
801b498: fb ff 98 12 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801b49c: b9 61 58 00 or r11,r11,r1 <== NOT EXECUTED
801b4a0: 41 e1 00 00 lbu r1,(r15+0) <== NOT EXECUTED
801b4a4: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
801b4a8: fb ff 98 0e calli 80014e0 <__ashlsi3> <== NOT EXECUTED
}
if (ehash == hash)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
printf ("rtems-rfs: dir-lookup-ino: "
801b4ac: b9 61 30 00 or r6,r11,r1 <== NOT EXECUTED
801b4b0: 2b 83 00 74 lw r3,(sp+116) <== NOT EXECUTED
801b4b4: 2b 81 00 54 lw r1,(sp+84) <== NOT EXECUTED
801b4b8: 2b 84 00 78 lw r4,(sp+120) <== NOT EXECUTED
801b4bc: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
801b4c0: ba 80 28 00 mv r5,r20 <== NOT EXECUTED
801b4c4: f8 00 1c 6c calli 8022674 <printf> <== NOT EXECUTED
"checking entry for ino %" PRId32 ": bno=%04" PRIx32 "/off=%04" PRIx32
" length:%d ino:%" PRId32 "\n",
rtems_rfs_inode_ino (inode), map.bpos.bno, map.bpos.boff,
elength, rtems_rfs_dir_entry_ino (entry));
if (memcmp (entry + RTEMS_RFS_DIR_ENTRY_SIZE, name, length) == 0)
801b4c8: 2b 82 00 48 lw r2,(sp+72)
801b4cc: 36 61 00 0a addi r1,r19,10
801b4d0: bb 20 18 00 mv r3,r25
801b4d4: f8 00 1b 1d calli 8022148 <memcmp>
801b4d8: b8 20 68 00 mv r13,r1
801b4dc: 5c 20 00 13 bne r1,r0,801b528 <rtems_rfs_dir_lookup_ino+0x3e0><== NEVER TAKEN
{
*offset = rtems_rfs_block_map_pos (fs, &map);
801b4e0: ba c0 08 00 mv r1,r22
801b4e4: 37 82 00 74 addi r2,sp,116
801b4e8: fb ff f8 53 calli 8019634 <rtems_rfs_block_get_pos>
801b4ec: 2b 81 00 4c lw r1,(sp+76)
801b4f0: 58 22 00 00 sw (r1+0),r2
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_FOUND))
801b4f4: 34 01 00 00 mvi r1,0
801b4f8: 78 02 10 00 mvhi r2,0x1000
801b4fc: fb ff d6 0b calli 8010d28 <rtems_rfs_trace>
801b500: 44 2d 00 4d be r1,r13,801b634 <rtems_rfs_dir_lookup_ino+0x4ec><== ALWAYS TAKEN
printf ("rtems-rfs: dir-lookup-ino: "
801b504: 2b 85 00 4c lw r5,(sp+76) <== NOT EXECUTED
801b508: 78 04 08 03 mvhi r4,0x803 <== NOT EXECUTED
801b50c: b8 80 08 00 mv r1,r4 <== NOT EXECUTED
801b510: 2a e2 00 08 lw r2,(r23+8) <== NOT EXECUTED
801b514: 2b 63 00 00 lw r3,(fp+0) <== NOT EXECUTED
801b518: 28 a4 00 00 lw r4,(r5+0) <== NOT EXECUTED
801b51c: 38 21 84 78 ori r1,r1,0x8478 <== NOT EXECUTED
801b520: f8 00 1c 55 calli 8022674 <printf> <== NOT EXECUTED
801b524: e0 00 00 44 bi 801b634 <rtems_rfs_dir_lookup_ino+0x4ec> <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
return 0;
}
}
map.bpos.boff += elength;
801b528: 2b 84 00 78 lw r4,(sp+120)
entry += elength;
801b52c: b6 74 98 00 add r19,r19,r20
rtems_rfs_block_map_close (fs, &map);
return 0;
}
}
map.bpos.boff += elength;
801b530: b4 94 20 00 add r4,r4,r20
801b534: 5b 84 00 78 sw (sp+120),r4
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))
801b538: 2a c4 00 08 lw r4,(r22+8)
801b53c: 2b 85 00 78 lw r5,(sp+120)
801b540: 34 84 ff f6 addi r4,r4,-10
801b544: 54 85 ff 8c bgu r4,r5,801b374 <rtems_rfs_dir_lookup_ino+0x22c><== ALWAYS TAKEN
map.bpos.boff += elength;
entry += elength;
}
if (rc == 0)
801b548: 5f 00 00 1b bne r24,r0,801b5b4 <rtems_rfs_dir_lookup_ino+0x46c><== NEVER TAKEN
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
801b54c: ba c0 08 00 mv r1,r22
801b550: 37 82 00 64 addi r2,sp,100
801b554: 37 83 00 c0 addi r3,sp,192
801b558: fb ff fa 49 calli 8019e7c <rtems_rfs_block_map_next_block>
if ((rc > 0) && (rc != ENXIO))
801b55c: 7c 25 00 06 cmpnei r5,r1,6
801b560: 68 24 00 00 cmpgi r4,r1,0
entry += elength;
}
if (rc == 0)
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
801b564: b8 20 a8 00 mv r21,r1
if ((rc > 0) && (rc != ENXIO))
801b568: a0 a4 20 00 and r4,r5,r4
801b56c: 44 98 00 0e be r4,r24,801b5a4 <rtems_rfs_dir_lookup_ino+0x45c><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
801b570: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801b574: 78 02 04 00 mvhi r2,0x400 <== NOT EXECUTED
801b578: fb ff d5 ec calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801b57c: 44 20 00 1c be r1,r0,801b5ec <rtems_rfs_dir_lookup_ino+0x4a4><== NOT EXECUTED
printf ("rtems-rfs: dir-lookup-ino: "
801b580: ba a0 08 00 mv r1,r21 <== NOT EXECUTED
801b584: 2a eb 00 08 lw r11,(r23+8) <== NOT EXECUTED
801b588: f8 00 20 f6 calli 8023960 <strerror> <== NOT EXECUTED
801b58c: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
801b590: 2b 81 00 58 lw r1,(sp+88) <== NOT EXECUTED
801b594: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801b598: ba a0 18 00 mv r3,r21 <== NOT EXECUTED
801b59c: f8 00 1c 36 calli 8022674 <printf> <== NOT EXECUTED
801b5a0: e0 00 00 13 bi 801b5ec <rtems_rfs_dir_lookup_ino+0x4a4> <== NOT EXECUTED
"block map next block failed in ino %" PRIu32 ": %d: %s\n",
rtems_rfs_inode_ino (inode), rc, strerror (rc));
}
if (rc == ENXIO)
801b5a4: 34 01 00 06 mvi r1,6
801b5a8: 5e a1 00 11 bne r21,r1,801b5ec <rtems_rfs_dir_lookup_ino+0x4a4><== NEVER TAKEN
rc = ENOENT;
801b5ac: 34 15 00 02 mvi r21,2
801b5b0: e0 00 00 13 bi 801b5fc <rtems_rfs_dir_lookup_ino+0x4b4>
801b5b4: bb 00 a8 00 mv r21,r24 <== NOT EXECUTED
801b5b8: e0 00 00 0d bi 801b5ec <rtems_rfs_dir_lookup_ino+0x4a4> <== 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",
801b5bc: 78 02 08 03 mvhi r2,0x803
801b5c0: 38 42 83 50 ori r2,r2,0x8350
801b5c4: 5b 82 00 50 sw (sp+80),r2
}
if (ehash == hash)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
printf ("rtems-rfs: dir-lookup-ino: "
801b5c8: 78 05 08 03 mvhi r5,0x803
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
if ((rc > 0) && (rc != ENXIO))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
printf ("rtems-rfs: dir-lookup-ino: "
801b5cc: 78 01 08 03 mvhi r1,0x803
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: "
801b5d0: 78 02 08 03 mvhi r2,0x803
}
if (ehash == hash)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
printf ("rtems-rfs: dir-lookup-ino: "
801b5d4: 38 a5 84 18 ori r5,r5,0x8418
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
if ((rc > 0) && (rc != ENXIO))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
printf ("rtems-rfs: dir-lookup-ino: "
801b5d8: 38 21 84 c0 ori r1,r1,0x84c0
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: "
801b5dc: 38 42 83 cc ori r2,r2,0x83cc
}
if (ehash == hash)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
printf ("rtems-rfs: dir-lookup-ino: "
801b5e0: 5b 85 00 54 sw (sp+84),r5
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
if ((rc > 0) && (rc != ENXIO))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
printf ("rtems-rfs: dir-lookup-ino: "
801b5e4: 5b 81 00 58 sw (sp+88),r1
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: "
801b5e8: 5b 82 00 5c sw (sp+92),r2
rtems_rfs_buffer_handle_close (fs, &entries);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
while ((rc == 0) && block)
801b5ec: 5e a0 00 04 bne r21,r0,801b5fc <rtems_rfs_dir_lookup_ino+0x4b4><== NEVER TAKEN
801b5f0: 2b 84 00 c0 lw r4,(sp+192)
801b5f4: 5c 95 ff 3c bne r4,r21,801b2e4 <rtems_rfs_dir_lookup_ino+0x19c><== ALWAYS TAKEN
801b5f8: e0 00 00 2e bi 801b6b0 <rtems_rfs_dir_lookup_ino+0x568> <== NOT EXECUTED
801b5fc: ba a0 c0 00 mv r24,r21
801b600: bb 00 a8 00 mv r21,r24
801b604: e0 00 00 0c bi 801b634 <rtems_rfs_dir_lookup_ino+0x4ec>
if ((rc == 0) && (block == 0))
{
rc = EIO;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
printf ("rtems-rfs: dir-lookup-ino: block is 0 in ino %" PRIu32 ": %d: %s\n",
801b608: 34 01 00 05 mvi r1,5 <== NOT EXECUTED
801b60c: 2a eb 00 08 lw r11,(r23+8) <== NOT EXECUTED
801b610: f8 00 20 d4 calli 8023960 <strerror> <== NOT EXECUTED
801b614: 78 03 08 03 mvhi r3,0x803 <== NOT EXECUTED
801b618: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
801b61c: b8 60 08 00 mv r1,r3 <== NOT EXECUTED
801b620: 38 21 85 0c ori r1,r1,0x850c <== NOT EXECUTED
801b624: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801b628: 34 03 00 05 mvi r3,5 <== NOT EXECUTED
801b62c: f8 00 1c 12 calli 8022674 <printf> <== NOT EXECUTED
}
}
if ((rc == 0) && (block == 0))
{
rc = EIO;
801b630: 34 15 00 05 mvi r21,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);
801b634: 37 82 00 b4 addi r2,sp,180
801b638: ba c0 08 00 mv r1,r22
801b63c: fb ff fc a4 calli 801a8cc <rtems_rfs_buffer_handle_release>
rtems_rfs_inode_ino (inode), rc, strerror (rc));
}
}
rtems_rfs_buffer_handle_close (fs, &entries);
rtems_rfs_block_map_close (fs, &map);
801b640: ba c0 08 00 mv r1,r22
801b644: 37 82 00 64 addi r2,sp,100
handle->dirty = false;
801b648: 33 80 00 b4 sb (sp+180),r0
handle->bnum = 0;
801b64c: 5b 80 00 b8 sw (sp+184),r0
handle->buffer = NULL;
801b650: 5b 80 00 bc sw (sp+188),r0
801b654: fb ff f8 c8 calli 8019974 <rtems_rfs_block_map_close>
return rc;
}
801b658: ba a0 08 00 mv r1,r21
801b65c: 2b 9d 00 04 lw ra,(sp+4)
801b660: 2b 8b 00 44 lw r11,(sp+68)
801b664: 2b 8c 00 40 lw r12,(sp+64)
801b668: 2b 8d 00 3c lw r13,(sp+60)
801b66c: 2b 8e 00 38 lw r14,(sp+56)
801b670: 2b 8f 00 34 lw r15,(sp+52)
801b674: 2b 90 00 30 lw r16,(sp+48)
801b678: 2b 91 00 2c lw r17,(sp+44)
801b67c: 2b 92 00 28 lw r18,(sp+40)
801b680: 2b 93 00 24 lw r19,(sp+36)
801b684: 2b 94 00 20 lw r20,(sp+32)
801b688: 2b 95 00 1c lw r21,(sp+28)
801b68c: 2b 96 00 18 lw r22,(sp+24)
801b690: 2b 97 00 14 lw r23,(sp+20)
801b694: 2b 98 00 10 lw r24,(sp+16)
801b698: 2b 99 00 0c lw r25,(sp+12)
801b69c: 2b 9b 00 08 lw fp,(sp+8)
801b6a0: 37 9c 00 c0 addi sp,sp,192
801b6a4: c3 a0 00 00 ret
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;
801b6a8: 34 18 00 05 mvi r24,5 <== NOT EXECUTED
801b6ac: e3 ff ff c2 bi 801b5b4 <rtems_rfs_dir_lookup_ino+0x46c> <== NOT EXECUTED
}
if ((rc == 0) && (block == 0))
{
rc = EIO;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
801b6b0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801b6b4: 78 02 04 00 mvhi r2,0x400 <== NOT EXECUTED
801b6b8: fb ff d5 9c calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801b6bc: 44 20 ff dd be r1,r0,801b630 <rtems_rfs_dir_lookup_ino+0x4e8><== NOT EXECUTED
801b6c0: e3 ff ff d2 bi 801b608 <rtems_rfs_dir_lookup_ino+0x4c0> <== NOT EXECUTED
0801bf90 <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)
{
801bf90: 37 9c ff 5c addi sp,sp,-164
801bf94: 5b 8b 00 44 sw (sp+68),r11
801bf98: 5b 8c 00 40 sw (sp+64),r12
801bf9c: 5b 8d 00 3c sw (sp+60),r13
801bfa0: 5b 8e 00 38 sw (sp+56),r14
801bfa4: 5b 8f 00 34 sw (sp+52),r15
801bfa8: 5b 90 00 30 sw (sp+48),r16
801bfac: 5b 91 00 2c sw (sp+44),r17
801bfb0: 5b 92 00 28 sw (sp+40),r18
801bfb4: 5b 93 00 24 sw (sp+36),r19
801bfb8: 5b 94 00 20 sw (sp+32),r20
801bfbc: 5b 95 00 1c sw (sp+28),r21
801bfc0: 5b 96 00 18 sw (sp+24),r22
801bfc4: 5b 97 00 14 sw (sp+20),r23
801bfc8: 5b 98 00 10 sw (sp+16),r24
801bfcc: 5b 99 00 0c sw (sp+12),r25
801bfd0: 5b 9b 00 08 sw (sp+8),fp
801bfd4: 5b 9d 00 04 sw (sp+4),ra
801bfd8: b8 20 58 00 mv r11,r1
801bfdc: b8 40 a8 00 mv r21,r2
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))
801bfe0: 34 01 00 00 mvi r1,0
801bfe4: 78 02 80 00 mvhi r2,0x8000
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)
{
801bfe8: b8 60 90 00 mv r18,r3
801bfec: b8 80 88 00 mv r17,r4
801bff0: b8 a0 78 00 mv r15,r5
801bff4: b8 c0 70 00 mv r14,r6
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))
801bff8: fb ff d3 4c calli 8010d28 <rtems_rfs_trace>
801bffc: 44 20 00 07 be r1,r0,801c018 <rtems_rfs_dir_read+0x88>
printf ("rtems-rfs: dir-read: dir=%" PRId32 " offset=%" PRId64 "\n",
801c000: 2a a2 00 08 lw r2,(r21+8) <== NOT EXECUTED
801c004: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801c008: 38 21 88 18 ori r1,r1,0x8818 <== NOT EXECUTED
801c00c: ba 40 18 00 mv r3,r18 <== NOT EXECUTED
801c010: ba 20 20 00 mv r4,r17 <== NOT EXECUTED
801c014: f8 00 19 98 calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_inode_ino (dir), offset);
*length = 0;
801c018: 59 c0 00 00 sw (r14+0),r0
rc = rtems_rfs_block_map_open (fs, dir, &map);
801c01c: b9 60 08 00 mv r1,r11
801c020: ba a0 10 00 mv r2,r21
801c024: 37 83 00 48 addi r3,sp,72
801c028: fb ff f5 cc calli 8019758 <rtems_rfs_block_map_open>
801c02c: b8 20 60 00 mv r12,r1
if (rc > 0)
801c030: 48 20 00 c0 bg r1,r0,801c330 <rtems_rfs_dir_read+0x3a0> <== NEVER TAKEN
return rc;
if (((rtems_rfs_fs_block_size (fs) -
(offset % rtems_rfs_fs_block_size (fs))) <= RTEMS_RFS_DIR_ENTRY_SIZE))
801c034: 29 6c 00 08 lw r12,(r11+8)
801c038: 34 03 00 00 mvi r3,0
801c03c: ba 40 08 00 mv r1,r18
801c040: ba 20 10 00 mv r2,r17
801c044: b9 80 20 00 mv r4,r12
801c048: f8 00 4d 7e calli 802f640 <__moddi3>
rc = rtems_rfs_block_map_open (fs, dir, &map);
if (rc > 0)
return rc;
if (((rtems_rfs_fs_block_size (fs) -
801c04c: c9 82 10 00 sub r2,r12,r2
801c050: f4 4c 18 00 cmpgu r3,r2,r12
801c054: c8 01 08 00 sub r1,r0,r1
801c058: c8 23 08 00 sub r1,r1,r3
801c05c: 48 20 00 12 bg r1,r0,801c0a4 <rtems_rfs_dir_read+0x114> <== NEVER TAKEN
801c060: 5c 20 00 03 bne r1,r0,801c06c <rtems_rfs_dir_read+0xdc> <== NEVER TAKEN
801c064: 34 01 00 0a mvi r1,10
801c068: 54 41 00 0f bgu r2,r1,801c0a4 <rtems_rfs_dir_read+0x114> <== ALWAYS TAKEN
(offset % rtems_rfs_fs_block_size (fs))) <= RTEMS_RFS_DIR_ENTRY_SIZE))
offset = (((offset / rtems_rfs_fs_block_size (fs)) + 1) *
801c06c: ba 40 08 00 mv r1,r18 <== NOT EXECUTED
801c070: ba 20 10 00 mv r2,r17 <== NOT EXECUTED
801c074: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
801c078: b9 80 20 00 mv r4,r12 <== NOT EXECUTED
801c07c: f8 00 4b 6f calli 802ee38 <__divdi3> <== NOT EXECUTED
801c080: 34 43 00 01 addi r3,r2,1 <== NOT EXECUTED
801c084: f4 43 10 00 cmpgu r2,r2,r3 <== NOT EXECUTED
801c088: b9 80 20 00 mv r4,r12 <== NOT EXECUTED
801c08c: b4 41 08 00 add r1,r2,r1 <== NOT EXECUTED
801c090: b8 60 10 00 mv r2,r3 <== NOT EXECUTED
801c094: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
801c098: f8 00 4a c4 calli 802eba8 <__muldi3> <== NOT EXECUTED
801c09c: b8 20 90 00 mv r18,r1 <== NOT EXECUTED
801c0a0: b8 40 88 00 mv r17,r2 <== NOT EXECUTED
rtems_rfs_fs_block_size (fs));
rc = rtems_rfs_block_map_seek (fs, &map, offset, &block);
801c0a4: 37 8d 00 48 addi r13,sp,72
801c0a8: b9 60 08 00 mv r1,r11
801c0ac: b9 a0 10 00 mv r2,r13
801c0b0: ba 40 18 00 mv r3,r18
801c0b4: ba 20 20 00 mv r4,r17
801c0b8: 37 85 00 a4 addi r5,sp,164
801c0bc: fb ff f7 3b calli 8019da8 <rtems_rfs_block_map_seek>
801c0c0: b8 20 60 00 mv r12,r1
if (rc > 0)
801c0c4: 4c 01 00 05 bge r0,r1,801c0d8 <rtems_rfs_dir_read+0x148> <== ALWAYS TAKEN
{
if (rc == ENXIO)
801c0c8: 34 01 00 06 mvi r1,6 <== NOT EXECUTED
801c0cc: 5d 81 00 96 bne r12,r1,801c324 <rtems_rfs_dir_read+0x394> <== NOT EXECUTED
rc = ENOENT;
801c0d0: 34 0c 00 02 mvi r12,2 <== NOT EXECUTED
801c0d4: e0 00 00 94 bi 801c324 <rtems_rfs_dir_read+0x394> <== 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",
801c0d8: 78 16 08 03 mvhi r22,0x803
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
801c0dc: 33 80 00 98 sb (sp+152),r0
handle->bnum = 0;
801c0e0: 5b 80 00 9c sw (sp+156),r0
handle->buffer = NULL;
801c0e4: 5b 80 00 a0 sw (sp+160),r0
uint8_t* entry;
rtems_rfs_ino eino;
int elength;
int remaining;
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
801c0e8: 37 97 00 98 addi r23,sp,152
}
*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",
801c0ec: 3a d6 88 bc ori r22,r22,0x88bc
uint8_t* entry;
rtems_rfs_ino eino;
int elength;
int remaining;
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
801c0f0: 2b 83 00 a4 lw r3,(sp+164)
801c0f4: b9 60 08 00 mv r1,r11
801c0f8: ba e0 10 00 mv r2,r23
801c0fc: 34 04 00 01 mvi r4,1
801c100: fb ff fa 62 calli 801aa88 <rtems_rfs_buffer_handle_request>
801c104: b8 20 60 00 mv r12,r1
if (rc > 0)
801c108: 4c 01 00 04 bge r0,r1,801c118 <rtems_rfs_dir_read+0x188> <== ALWAYS TAKEN
*/
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);
801c10c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801c110: ba e0 10 00 mv r2,r23 <== NOT EXECUTED
801c114: e0 00 00 80 bi 801c314 <rtems_rfs_dir_read+0x384> <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
entry = rtems_rfs_buffer_data (&buffer);
801c118: 2b 81 00 a0 lw r1,(sp+160)
entry += map.bpos.boff;
801c11c: 2b 93 00 5c lw r19,(sp+92)
elength = rtems_rfs_dir_entry_length (entry);
801c120: 34 02 00 08 mvi r2,8
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
entry = rtems_rfs_buffer_data (&buffer);
801c124: 28 2d 00 1c lw r13,(r1+28)
entry += map.bpos.boff;
801c128: b5 b3 68 00 add r13,r13,r19
elength = rtems_rfs_dir_entry_length (entry);
801c12c: 41 a1 00 08 lbu r1,(r13+8)
eino = rtems_rfs_dir_entry_ino (entry);
801c130: 35 b8 00 02 addi r24,r13,2
801c134: 35 b9 00 03 addi r25,r13,3
}
entry = rtems_rfs_buffer_data (&buffer);
entry += map.bpos.boff;
elength = rtems_rfs_dir_entry_length (entry);
801c138: fb ff 94 ea calli 80014e0 <__ashlsi3>
801c13c: 41 b0 00 09 lbu r16,(r13+9)
eino = rtems_rfs_dir_entry_ino (entry);
801c140: 41 b4 00 03 lbu r20,(r13+3)
801c144: 35 bb 00 01 addi fp,r13,1
}
entry = rtems_rfs_buffer_data (&buffer);
entry += map.bpos.boff;
elength = rtems_rfs_dir_entry_length (entry);
801c148: b8 30 80 00 or r16,r1,r16
eino = rtems_rfs_dir_entry_ino (entry);
801c14c: 41 a1 00 00 lbu r1,(r13+0)
801c150: 34 02 00 18 mvi r2,24
801c154: fb ff 94 e3 calli 80014e0 <__ashlsi3>
801c158: ba 81 a0 00 or r20,r20,r1
801c15c: 41 a1 00 01 lbu r1,(r13+1)
801c160: 34 02 00 10 mvi r2,16
801c164: fb ff 94 df calli 80014e0 <__ashlsi3>
801c168: ba 81 a0 00 or r20,r20,r1
801c16c: 41 a1 00 02 lbu r1,(r13+2)
801c170: 34 02 00 08 mvi r2,8
801c174: fb ff 94 db calli 80014e0 <__ashlsi3>
801c178: ba 81 a0 00 or r20,r20,r1
if (elength != RTEMS_RFS_DIR_ENTRY_EMPTY)
801c17c: 38 01 ff ff mvu r1,0xffff
801c180: 46 01 00 4b be r16,r1,801c2ac <rtems_rfs_dir_read+0x31c>
{
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
801c184: 34 12 00 0a mvi r18,10
801c188: 4e 50 00 08 bge r18,r16,801c1a8 <rtems_rfs_dir_read+0x218> <== NEVER TAKEN
801c18c: 29 61 00 1c lw r1,(r11+28)
801c190: 66 82 00 00 cmpei r2,r20,0
801c194: f2 01 08 00 cmpgeu r1,r16,r1
801c198: b8 22 08 00 or r1,r1,r2
801c19c: 5c 20 00 03 bne r1,r0,801c1a8 <rtems_rfs_dir_read+0x218> <== NEVER TAKEN
801c1a0: 29 61 00 14 lw r1,(r11+20)
801c1a4: 50 34 00 0e bgeu r1,r20,801c1dc <rtems_rfs_dir_read+0x24c> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
801c1a8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801c1ac: 78 02 80 00 mvhi r2,0x8000 <== NOT EXECUTED
801c1b0: fb ff d2 de calli 8010d28 <rtems_rfs_trace> <== 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;
801c1b4: 34 0c 00 05 mvi r12,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))
801c1b8: 44 20 00 55 be r1,r0,801c30c <rtems_rfs_dir_read+0x37c> <== NOT EXECUTED
printf ("rtems-rfs: dir-read: "
801c1bc: 2a a2 00 08 lw r2,(r21+8) <== NOT EXECUTED
801c1c0: 2b 85 00 5c lw r5,(sp+92) <== NOT EXECUTED
801c1c4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801c1c8: ba 00 18 00 mv r3,r16 <== NOT EXECUTED
801c1cc: ba 80 20 00 mv r4,r20 <== NOT EXECUTED
801c1d0: 38 21 88 44 ori r1,r1,0x8844 <== NOT EXECUTED
801c1d4: f8 00 19 28 calli 8022674 <printf> <== NOT EXECUTED
801c1d8: e0 00 00 4d bi 801c30c <rtems_rfs_dir_read+0x37c> <== NOT EXECUTED
rtems_rfs_inode_ino (dir), elength, eino, map.bpos.boff);
rc = EIO;
break;
}
memset (dirent, 0, sizeof (struct dirent));
801c1dc: 34 02 00 00 mvi r2,0
801c1e0: b9 e0 08 00 mv r1,r15
801c1e4: 34 03 01 0c mvi r3,268
801c1e8: f8 00 18 87 calli 8022404 <memset>
dirent->d_off = offset;
dirent->d_reclen = sizeof (struct dirent);
801c1ec: 34 01 01 0c mvi r1,268
801c1f0: 0d e1 00 08 sh (r15+8),r1
*length += elength;
801c1f4: 29 c1 00 00 lw r1,(r14+0)
rc = EIO;
break;
}
memset (dirent, 0, sizeof (struct dirent));
dirent->d_off = offset;
801c1f8: 59 f1 00 04 sw (r15+4),r17
dirent->d_reclen = sizeof (struct dirent);
*length += elength;
801c1fc: b6 01 08 00 add r1,r16,r1
801c200: 59 c1 00 00 sw (r14+0),r1
remaining = rtems_rfs_fs_block_size (fs) - (map.bpos.boff + elength);
801c204: 29 62 00 08 lw r2,(r11+8)
801c208: c8 53 98 00 sub r19,r2,r19
801c20c: ca 70 98 00 sub r19,r19,r16
if (remaining <= RTEMS_RFS_DIR_ENTRY_SIZE)
801c210: 4a 72 00 03 bg r19,r18,801c21c <rtems_rfs_dir_read+0x28c> <== ALWAYS TAKEN
*length += remaining;
801c214: b6 61 08 00 add r1,r19,r1 <== NOT EXECUTED
801c218: 59 c1 00 00 sw (r14+0),r1 <== NOT EXECUTED
elength -= RTEMS_RFS_DIR_ENTRY_SIZE;
801c21c: 36 10 ff f6 addi r16,r16,-10
801c220: 34 01 00 ff mvi r1,255
801c224: 4c 30 00 02 bge r1,r16,801c22c <rtems_rfs_dir_read+0x29c> <== ALWAYS TAKEN
801c228: 34 10 00 ff mvi r16,255 <== NOT EXECUTED
if (elength > NAME_MAX)
elength = NAME_MAX;
memcpy (dirent->d_name, entry + RTEMS_RFS_DIR_ENTRY_SIZE, elength);
801c22c: 35 ee 00 0c addi r14,r15,12
801c230: ba 00 18 00 mv r3,r16
801c234: 35 a2 00 0a addi r2,r13,10
801c238: b9 c0 08 00 mv r1,r14
801c23c: f8 00 17 e4 calli 80221cc <memcpy>
dirent->d_ino = rtems_rfs_dir_entry_ino (entry);
801c240: 41 a1 00 00 lbu r1,(r13+0)
801c244: 34 02 00 18 mvi r2,24
801c248: fb ff 94 a6 calli 80014e0 <__ashlsi3>
801c24c: b8 20 68 00 mv r13,r1
801c250: 43 61 00 00 lbu r1,(fp+0)
801c254: 34 02 00 10 mvi r2,16
801c258: fb ff 94 a2 calli 80014e0 <__ashlsi3>
801c25c: b9 a1 08 00 or r1,r13,r1
801c260: 43 2d 00 00 lbu r13,(r25+0)
801c264: 34 02 00 08 mvi r2,8
801c268: b8 2d 68 00 or r13,r1,r13
801c26c: 43 01 00 00 lbu r1,(r24+0)
801c270: fb ff 94 9c calli 80014e0 <__ashlsi3>
801c274: b9 a1 08 00 or r1,r13,r1
801c278: 59 e1 00 00 sw (r15+0),r1
dirent->d_namlen = elength;
801c27c: 0d f0 00 0a sh (r15+10),r16
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
801c280: 34 01 00 00 mvi r1,0
801c284: 78 02 80 00 mvhi r2,0x8000
801c288: fb ff d2 a8 calli 8010d28 <rtems_rfs_trace>
801c28c: 44 20 00 20 be r1,r0,801c30c <rtems_rfs_dir_read+0x37c> <== ALWAYS TAKEN
printf ("rtems-rfs: dir-read: found off:%" PRIooff_t " ino:%ld name=%s\n",
801c290: 29 e2 00 04 lw r2,(r15+4) <== NOT EXECUTED
801c294: 29 e3 00 00 lw r3,(r15+0) <== NOT EXECUTED
801c298: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801c29c: b9 c0 20 00 mv r4,r14 <== NOT EXECUTED
801c2a0: 38 21 88 88 ori r1,r1,0x8888 <== NOT EXECUTED
801c2a4: f8 00 18 f4 calli 8022674 <printf> <== NOT EXECUTED
801c2a8: e0 00 00 19 bi 801c30c <rtems_rfs_dir_read+0x37c> <== NOT EXECUTED
dirent->d_off, dirent->d_ino, dirent->d_name);
break;
}
*length += rtems_rfs_fs_block_size (fs) - map.bpos.boff;
801c2ac: 29 61 00 08 lw r1,(r11+8)
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
801c2b0: 78 02 80 00 mvhi r2,0x8000
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;
801c2b4: c8 33 98 00 sub r19,r1,r19
801c2b8: 29 c1 00 00 lw r1,(r14+0)
801c2bc: b4 33 98 00 add r19,r1,r19
801c2c0: 59 d3 00 00 sw (r14+0),r19
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
801c2c4: 34 01 00 00 mvi r1,0
801c2c8: fb ff d2 98 calli 8010d28 <rtems_rfs_trace>
801c2cc: 44 20 00 06 be r1,r0,801c2e4 <rtems_rfs_dir_read+0x354> <== ALWAYS TAKEN
printf ("rtems-rfs: dir-read: next block: off:%" PRId64 " length:%zd\n",
801c2d0: 29 c4 00 00 lw r4,(r14+0) <== NOT EXECUTED
801c2d4: ba c0 08 00 mv r1,r22 <== NOT EXECUTED
801c2d8: ba 40 10 00 mv r2,r18 <== NOT EXECUTED
801c2dc: ba 20 18 00 mv r3,r17 <== NOT EXECUTED
801c2e0: f8 00 18 e5 calli 8022674 <printf> <== NOT EXECUTED
offset, *length);
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
801c2e4: b9 60 08 00 mv r1,r11
801c2e8: 37 82 00 48 addi r2,sp,72
801c2ec: 37 83 00 a4 addi r3,sp,164
801c2f0: fb ff f6 e3 calli 8019e7c <rtems_rfs_block_map_next_block>
801c2f4: b8 20 60 00 mv r12,r1
if (rc == ENXIO)
801c2f8: 34 01 00 06 mvi r1,6
801c2fc: 45 81 00 03 be r12,r1,801c308 <rtems_rfs_dir_read+0x378> <== ALWAYS TAKEN
/*
* Look for an empty entry and if this is the last block that is the end of
* the directory.
*/
while (rc == 0)
801c300: 45 80 ff 7c be r12,r0,801c0f0 <rtems_rfs_dir_read+0x160> <== NOT EXECUTED
801c304: e0 00 00 02 bi 801c30c <rtems_rfs_dir_read+0x37c> <== NOT EXECUTED
printf ("rtems-rfs: dir-read: next block: off:%" PRId64 " length:%zd\n",
offset, *length);
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
if (rc == ENXIO)
rc = ENOENT;
801c308: 34 0c 00 02 mvi r12,2
801c30c: b9 60 08 00 mv r1,r11
801c310: 37 82 00 98 addi r2,sp,152
801c314: fb ff f9 6e calli 801a8cc <rtems_rfs_buffer_handle_release>
handle->dirty = false;
801c318: 33 80 00 98 sb (sp+152),r0
handle->bnum = 0;
801c31c: 5b 80 00 9c sw (sp+156),r0
handle->buffer = NULL;
801c320: 5b 80 00 a0 sw (sp+160),r0
}
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
801c324: b9 60 08 00 mv r1,r11
801c328: 37 82 00 48 addi r2,sp,72
801c32c: fb ff f5 92 calli 8019974 <rtems_rfs_block_map_close>
return rc;
}
801c330: b9 80 08 00 mv r1,r12
801c334: 2b 9d 00 04 lw ra,(sp+4)
801c338: 2b 8b 00 44 lw r11,(sp+68)
801c33c: 2b 8c 00 40 lw r12,(sp+64)
801c340: 2b 8d 00 3c lw r13,(sp+60)
801c344: 2b 8e 00 38 lw r14,(sp+56)
801c348: 2b 8f 00 34 lw r15,(sp+52)
801c34c: 2b 90 00 30 lw r16,(sp+48)
801c350: 2b 91 00 2c lw r17,(sp+44)
801c354: 2b 92 00 28 lw r18,(sp+40)
801c358: 2b 93 00 24 lw r19,(sp+36)
801c35c: 2b 94 00 20 lw r20,(sp+32)
801c360: 2b 95 00 1c lw r21,(sp+28)
801c364: 2b 96 00 18 lw r22,(sp+24)
801c368: 2b 97 00 14 lw r23,(sp+20)
801c36c: 2b 98 00 10 lw r24,(sp+16)
801c370: 2b 99 00 0c lw r25,(sp+12)
801c374: 2b 9b 00 08 lw fp,(sp+8)
801c378: 37 9c 00 a4 addi sp,sp,164
801c37c: c3 a0 00 00 ret
0801c620 <rtems_rfs_file_close>:
}
int
rtems_rfs_file_close (rtems_rfs_file_system* fs,
rtems_rfs_file_handle* handle)
{
801c620: 37 9c ff e4 addi sp,sp,-28
801c624: 5b 8b 00 1c sw (sp+28),r11
801c628: 5b 8c 00 18 sw (sp+24),r12
801c62c: 5b 8d 00 14 sw (sp+20),r13
801c630: 5b 8e 00 10 sw (sp+16),r14
801c634: 5b 8f 00 0c sw (sp+12),r15
801c638: 5b 90 00 08 sw (sp+8),r16
801c63c: 5b 9d 00 04 sw (sp+4),ra
801c640: b8 20 68 00 mv r13,r1
801c644: b8 40 58 00 mv r11,r2
int rrc;
int rc;
rrc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
801c648: 34 01 00 10 mvi r1,16
801c64c: 34 02 00 00 mvi r2,0
801c650: fb ff d1 b6 calli 8010d28 <rtems_rfs_trace>
801c654: 44 20 00 06 be r1,r0,801c66c <rtems_rfs_file_close+0x4c> <== ALWAYS TAKEN
printf ("rtems-rfs: file-close: entry: ino=%" PRId32 "\n",
handle->shared->inode.ino);
801c658: 29 62 00 1c lw r2,(r11+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",
801c65c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801c660: 38 21 89 58 ori r1,r1,0x8958 <== NOT EXECUTED
801c664: 28 42 00 14 lw r2,(r2+20) <== NOT EXECUTED
801c668: f8 00 18 03 calli 8022674 <printf> <== NOT EXECUTED
handle->shared->inode.ino);
if (handle->shared->references > 0)
801c66c: 29 62 00 1c lw r2,(r11+28)
801c670: 28 41 00 08 lw r1,(r2+8)
801c674: 4c 01 00 03 bge r0,r1,801c680 <rtems_rfs_file_close+0x60> <== NEVER TAKEN
handle->shared->references--;
801c678: 34 21 ff ff addi r1,r1,-1
801c67c: 58 41 00 08 sw (r2+8),r1
if (handle->shared->references == 0)
801c680: 28 41 00 08 lw r1,(r2+8)
rtems_rfs_file_handle* handle)
{
int rrc;
int rc;
rrc = 0;
801c684: 34 0c 00 00 mvi r12,0
handle->shared->inode.ino);
if (handle->shared->references > 0)
handle->shared->references--;
if (handle->shared->references == 0)
801c688: 5c 20 00 83 bne r1,r0,801c894 <rtems_rfs_file_close+0x274> <== NEVER TAKEN
{
if (!rtems_rfs_inode_is_loaded (&handle->shared->inode))
801c68c: 28 4e 00 18 lw r14,(r2+24)
801c690: 5d cc 00 06 bne r14,r12,801c6a8 <rtems_rfs_file_close+0x88><== NEVER TAKEN
rrc = rtems_rfs_inode_load (fs, &handle->shared->inode);
801c694: b9 a0 08 00 mv r1,r13
801c698: 34 42 00 0c addi r2,r2,12
801c69c: fb ff c9 8f calli 800ecd8 <rtems_rfs_inode_load>
801c6a0: b8 20 60 00 mv r12,r1
if (rrc == 0)
801c6a4: 5c 2e 00 4c bne r1,r14,801c7d4 <rtems_rfs_file_close+0x1b4><== NEVER TAKEN
{
/*
* @todo This could be clever and only update if different.
*/
rtems_rfs_inode_set_atime (&handle->shared->inode,
801c6a8: 29 6c 00 1c lw r12,(r11+28)
*/
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);
801c6ac: 34 02 00 18 mvi r2,24
801c6b0: 29 8e 00 8c lw r14,(r12+140)
801c6b4: 29 8f 00 18 lw r15,(r12+24)
801c6b8: b9 c0 08 00 mv r1,r14
801c6bc: fb ff 93 b0 calli 800157c <__lshrsi3>
801c6c0: 31 e1 00 10 sb (r15+16),r1
801c6c4: 29 8f 00 18 lw r15,(r12+24)
801c6c8: b9 c0 08 00 mv r1,r14
801c6cc: 34 02 00 10 mvi r2,16
801c6d0: fb ff 93 ab calli 800157c <__lshrsi3>
801c6d4: 31 e1 00 11 sb (r15+17),r1
801c6d8: 29 8f 00 18 lw r15,(r12+24)
801c6dc: b9 c0 08 00 mv r1,r14
801c6e0: 34 02 00 08 mvi r2,8
801c6e4: fb ff 93 a6 calli 800157c <__lshrsi3>
801c6e8: 31 e1 00 12 sb (r15+18),r1
801c6ec: 29 81 00 18 lw r1,(r12+24)
rtems_rfs_buffer_mark_dirty (&handle->buffer);
801c6f0: 34 0f 00 01 mvi r15,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);
801c6f4: 34 02 00 18 mvi 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);
801c6f8: 30 2e 00 13 sb (r1+19),r14
rtems_rfs_buffer_mark_dirty (&handle->buffer);
801c6fc: 31 8f 00 1c sb (r12+28),r15
handle->shared->atime);
rtems_rfs_inode_set_mtime (&handle->shared->inode,
801c700: 29 6c 00 1c lw r12,(r11+28)
801c704: 29 8e 00 90 lw r14,(r12+144)
*/
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);
801c708: 29 90 00 18 lw r16,(r12+24)
801c70c: b9 c0 08 00 mv r1,r14
801c710: fb ff 93 9b calli 800157c <__lshrsi3>
801c714: 32 01 00 14 sb (r16+20),r1
801c718: 29 90 00 18 lw r16,(r12+24)
801c71c: b9 c0 08 00 mv r1,r14
801c720: 34 02 00 10 mvi r2,16
801c724: fb ff 93 96 calli 800157c <__lshrsi3>
801c728: 32 01 00 15 sb (r16+21),r1
801c72c: 29 90 00 18 lw r16,(r12+24)
801c730: b9 c0 08 00 mv r1,r14
801c734: 34 02 00 08 mvi r2,8
801c738: fb ff 93 91 calli 800157c <__lshrsi3>
801c73c: 32 01 00 16 sb (r16+22),r1
801c740: 29 81 00 18 lw r1,(r12+24)
*/
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);
801c744: 34 02 00 18 mvi r2,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);
801c748: 30 2e 00 17 sb (r1+23),r14
rtems_rfs_buffer_mark_dirty (&handle->buffer);
801c74c: 31 8f 00 1c sb (r12+28),r15
handle->shared->mtime);
rtems_rfs_inode_set_ctime (&handle->shared->inode,
801c750: 29 6c 00 1c lw r12,(r11+28)
801c754: 29 8e 00 94 lw r14,(r12+148)
*/
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);
801c758: 29 90 00 18 lw r16,(r12+24)
801c75c: b9 c0 08 00 mv r1,r14
801c760: fb ff 93 87 calli 800157c <__lshrsi3>
801c764: 32 01 00 18 sb (r16+24),r1
801c768: 29 90 00 18 lw r16,(r12+24)
801c76c: 34 02 00 10 mvi r2,16
801c770: b9 c0 08 00 mv r1,r14
801c774: fb ff 93 82 calli 800157c <__lshrsi3>
801c778: 32 01 00 19 sb (r16+25),r1
801c77c: 29 90 00 18 lw r16,(r12+24)
801c780: 34 02 00 08 mvi r2,8
801c784: b9 c0 08 00 mv r1,r14
801c788: fb ff 93 7d calli 800157c <__lshrsi3>
801c78c: 32 01 00 1a sb (r16+26),r1
801c790: 29 81 00 18 lw r1,(r12+24)
801c794: 30 2e 00 1b sb (r1+27),r14
handle->shared->ctime);
if (!rtems_rfs_block_size_equal (&handle->shared->size,
801c798: 29 62 00 1c lw r2,(r11+28)
rtems_rfs_buffer_mark_dirty (&handle->buffer);
801c79c: 31 8f 00 1c sb (r12+28),r15
801c7a0: 28 41 00 84 lw r1,(r2+132)
801c7a4: 28 43 00 3c lw r3,(r2+60)
801c7a8: 5c 23 00 05 bne r1,r3,801c7bc <rtems_rfs_file_close+0x19c> <== NEVER TAKEN
801c7ac: 28 44 00 88 lw r4,(r2+136)
801c7b0: 28 43 00 40 lw r3,(r2+64)
801c7b4: 34 0c 00 00 mvi r12,0
801c7b8: 44 83 00 07 be r4,r3,801c7d4 <rtems_rfs_file_close+0x1b4> <== ALWAYS TAKEN
*/
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);
801c7bc: 58 41 00 3c sw (r2+60),r1 <== NOT EXECUTED
801c7c0: 28 41 00 88 lw r1,(r2+136) <== NOT EXECUTED
map->dirty = true;
801c7c4: 34 0c 00 00 mvi r12,0 <== 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);
801c7c8: 58 41 00 40 sw (r2+64),r1 <== NOT EXECUTED
map->dirty = true;
801c7cc: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
801c7d0: 30 41 00 34 sb (r2+52),r1 <== 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);
801c7d4: 29 62 00 1c lw r2,(r11+28)
801c7d8: b9 a0 08 00 mv r1,r13
801c7dc: 34 42 00 34 addi r2,r2,52
801c7e0: fb ff f4 65 calli 8019974 <rtems_rfs_block_map_close>
801c7e4: b8 20 70 00 mv r14,r1
if (rc > 0)
801c7e8: 4c 01 00 11 bge r0,r1,801c82c <rtems_rfs_file_close+0x20c> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
801c7ec: 34 01 00 10 mvi r1,16 <== NOT EXECUTED
801c7f0: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801c7f4: fb ff d1 4d calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801c7f8: 44 20 00 0b be r1,r0,801c824 <rtems_rfs_file_close+0x204> <== NOT EXECUTED
printf ("rtems-rfs: file-close: map close error: ino=%" PRId32 ": %d: %s\n",
handle->shared->inode.ino, rc, strerror (rc));
801c7fc: 29 61 00 1c lw r1,(r11+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",
801c800: 28 2f 00 14 lw r15,(r1+20) <== NOT EXECUTED
801c804: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
801c808: f8 00 1c 56 calli 8023960 <strerror> <== NOT EXECUTED
801c80c: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
801c810: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801c814: 38 21 89 80 ori r1,r1,0x8980 <== NOT EXECUTED
801c818: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
801c81c: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
801c820: f8 00 17 95 calli 8022674 <printf> <== NOT EXECUTED
handle->shared->inode.ino, rc, strerror (rc));
if (rrc == 0)
801c824: 5d 80 00 02 bne r12,r0,801c82c <rtems_rfs_file_close+0x20c><== NOT EXECUTED
801c828: b9 c0 60 00 mv r12,r14 <== NOT EXECUTED
rrc = rc;
}
rc = rtems_rfs_inode_close (fs, &handle->shared->inode);
801c82c: 29 62 00 1c lw r2,(r11+28)
801c830: b9 a0 08 00 mv r1,r13
801c834: 34 42 00 0c addi r2,r2,12
801c838: fb ff c9 e4 calli 800efc8 <rtems_rfs_inode_close>
801c83c: b8 20 70 00 mv r14,r1
if (rc > 0)
801c840: 4c 01 00 11 bge r0,r1,801c884 <rtems_rfs_file_close+0x264> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
801c844: 34 01 00 10 mvi r1,16 <== NOT EXECUTED
801c848: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801c84c: fb ff d1 37 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801c850: 44 20 00 0b be r1,r0,801c87c <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));
801c854: 29 61 00 1c lw r1,(r11+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",
801c858: 28 2f 00 14 lw r15,(r1+20) <== NOT EXECUTED
801c85c: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
801c860: f8 00 1c 40 calli 8023960 <strerror> <== NOT EXECUTED
801c864: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
801c868: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801c86c: 38 21 89 bc ori r1,r1,0x89bc <== NOT EXECUTED
801c870: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
801c874: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
801c878: f8 00 17 7f calli 8022674 <printf> <== NOT EXECUTED
handle->shared->inode.ino, rc, strerror (rc));
if (rrc == 0)
801c87c: 5d 80 00 02 bne r12,r0,801c884 <rtems_rfs_file_close+0x264><== NOT EXECUTED
801c880: b9 c0 60 00 mv r12,r14 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
801c884: 29 61 00 1c lw r1,(r11+28)
801c888: fb ff e9 65 calli 8016e1c <_Chain_Extract>
rrc = rc;
}
rtems_chain_extract (&handle->shared->link);
free (handle->shared);
801c88c: 29 61 00 1c lw r1,(r11+28)
801c890: fb ff a6 ff calli 800648c <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);
801c894: b9 a0 08 00 mv r1,r13
801c898: 35 62 00 04 addi r2,r11,4
801c89c: fb ff f8 0c calli 801a8cc <rtems_rfs_buffer_handle_release>
handle->dirty = false;
801c8a0: 31 60 00 04 sb (r11+4),r0
handle->bnum = 0;
801c8a4: 59 60 00 08 sw (r11+8),r0
handle->buffer = NULL;
801c8a8: 59 60 00 0c sw (r11+12),r0
rc = rtems_rfs_buffer_handle_close (fs, &handle->buffer);
if ((rrc == 0) && (rc > 0))
rrc = rc;
if (rrc > 0)
801c8ac: 4c 0c 00 0c bge r0,r12,801c8dc <rtems_rfs_file_close+0x2bc><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
801c8b0: 34 01 00 10 mvi r1,16 <== NOT EXECUTED
801c8b4: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801c8b8: fb ff d1 1c calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801c8bc: 44 20 00 08 be r1,r0,801c8dc <rtems_rfs_file_close+0x2bc> <== NOT EXECUTED
printf ("rtems-rfs: file-close: result: %d: %s\n", rrc, strerror (rrc));
801c8c0: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801c8c4: f8 00 1c 27 calli 8023960 <strerror> <== NOT EXECUTED
801c8c8: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801c8cc: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801c8d0: 38 21 89 f8 ori r1,r1,0x89f8 <== NOT EXECUTED
801c8d4: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
801c8d8: f8 00 17 67 calli 8022674 <printf> <== NOT EXECUTED
}
free (handle);
801c8dc: b9 60 08 00 mv r1,r11
801c8e0: fb ff a6 eb calli 800648c <free>
return rrc;
}
801c8e4: b9 80 08 00 mv r1,r12
801c8e8: 2b 9d 00 04 lw ra,(sp+4)
801c8ec: 2b 8b 00 1c lw r11,(sp+28)
801c8f0: 2b 8c 00 18 lw r12,(sp+24)
801c8f4: 2b 8d 00 14 lw r13,(sp+20)
801c8f8: 2b 8e 00 10 lw r14,(sp+16)
801c8fc: 2b 8f 00 0c lw r15,(sp+12)
801c900: 2b 90 00 08 lw r16,(sp+8)
801c904: 37 9c 00 1c addi sp,sp,28
801c908: c3 a0 00 00 ret
0801cb04 <rtems_rfs_file_io_end>:
int
rtems_rfs_file_io_end (rtems_rfs_file_handle* handle,
size_t size,
bool read)
{
801cb04: 37 9c ff e4 addi sp,sp,-28
801cb08: 5b 8b 00 1c sw (sp+28),r11
801cb0c: 5b 8c 00 18 sw (sp+24),r12
801cb10: 5b 8d 00 14 sw (sp+20),r13
801cb14: 5b 8e 00 10 sw (sp+16),r14
801cb18: 5b 8f 00 0c sw (sp+12),r15
801cb1c: 5b 90 00 08 sw (sp+8),r16
801cb20: 5b 9d 00 04 sw (sp+4),ra
801cb24: b8 20 58 00 mv r11,r1
801cb28: b8 40 70 00 mv r14,r2
bool atime;
bool mtime;
bool length;
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
801cb2c: 34 01 00 20 mvi r1,32
801cb30: 34 02 00 00 mvi r2,0
int
rtems_rfs_file_io_end (rtems_rfs_file_handle* handle,
size_t size,
bool read)
{
801cb34: 20 6c 00 ff andi r12,r3,0xff
bool atime;
bool mtime;
bool length;
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
801cb38: fb ff d0 7c calli 8010d28 <rtems_rfs_trace>
801cb3c: 44 20 00 0b be r1,r0,801cb68 <rtems_rfs_file_io_end+0x64> <== ALWAYS TAKEN
printf ("rtems-rfs: file-io: end: %s size=%zu\n",
801cb40: 78 04 08 03 mvhi r4,0x803 <== NOT EXECUTED
801cb44: 38 84 8a 20 ori r4,r4,0x8a20 <== NOT EXECUTED
801cb48: 45 80 00 03 be r12,r0,801cb54 <rtems_rfs_file_io_end+0x50> <== NOT EXECUTED
801cb4c: 78 04 08 03 mvhi r4,0x803 <== NOT EXECUTED
801cb50: 38 84 72 f4 ori r4,r4,0x72f4 <== NOT EXECUTED
801cb54: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801cb58: 38 21 8a dc ori r1,r1,0x8adc <== NOT EXECUTED
801cb5c: b8 80 10 00 mv r2,r4 <== NOT EXECUTED
801cb60: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
801cb64: f8 00 16 c4 calli 8022674 <printf> <== NOT EXECUTED
read ? "read" : "write", size);
if (rtems_rfs_buffer_handle_has_block (&handle->buffer))
801cb68: 29 61 00 0c lw r1,(r11+12)
801cb6c: 44 20 00 19 be r1,r0,801cbd0 <rtems_rfs_file_io_end+0xcc> <== NEVER TAKEN
{
if (!read)
801cb70: 5d 80 00 03 bne r12,r0,801cb7c <rtems_rfs_file_io_end+0x78>
rtems_rfs_buffer_mark_dirty (rtems_rfs_file_buffer (handle));
801cb74: 34 01 00 01 mvi r1,1
801cb78: 31 61 00 04 sb (r11+4),r1
rc = rtems_rfs_buffer_handle_release (rtems_rfs_file_fs (handle),
801cb7c: 29 61 00 1c lw r1,(r11+28)
801cb80: 35 62 00 04 addi r2,r11,4
801cb84: 28 21 00 98 lw r1,(r1+152)
801cb88: fb ff f7 51 calli 801a8cc <rtems_rfs_buffer_handle_release>
801cb8c: b8 20 68 00 mv r13,r1
rtems_rfs_file_buffer (handle));
if (rc > 0)
801cb90: 4c 01 00 11 bge r0,r1,801cbd4 <rtems_rfs_file_io_end+0xd0> <== ALWAYS TAKEN
{
printf (
801cb94: 78 0b 08 03 mvhi r11,0x803 <== NOT EXECUTED
801cb98: 39 6b 8a 20 ori r11,r11,0x8a20 <== NOT EXECUTED
801cb9c: 45 80 00 03 be r12,r0,801cba8 <rtems_rfs_file_io_end+0xa4> <== NOT EXECUTED
801cba0: 78 0b 08 03 mvhi r11,0x803 <== NOT EXECUTED
801cba4: 39 6b 72 f4 ori r11,r11,0x72f4 <== NOT EXECUTED
801cba8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
801cbac: f8 00 1b 6d calli 8023960 <strerror> <== NOT EXECUTED
801cbb0: b8 20 28 00 mv r5,r1 <== NOT EXECUTED
801cbb4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801cbb8: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801cbbc: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
801cbc0: b9 a0 20 00 mv r4,r13 <== NOT EXECUTED
801cbc4: 38 21 8b 04 ori r1,r1,0x8b04 <== NOT EXECUTED
801cbc8: f8 00 16 ab calli 8022674 <printf> <== NOT EXECUTED
"rtems-rfs: file-io: end: error on release: %s size=%zu: %d: %s\n",
read ? "read" : "write", size, rc, strerror (rc));
return rc;
801cbcc: e0 00 00 58 bi 801cd2c <rtems_rfs_file_io_end+0x228> <== NOT EXECUTED
bool read)
{
bool atime;
bool mtime;
bool length;
int rc = 0;
801cbd0: 34 0d 00 00 mvi r13,0 <== NOT EXECUTED
* 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)))
801cbd4: 29 65 00 1c lw r5,(r11+28)
* 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;
801cbd8: 29 63 00 14 lw r3,(r11+20)
if (handle->bpos.boff >=
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))
801cbdc: 28 a1 00 98 lw r1,(r5+152)
* 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;
801cbe0: b5 c3 18 00 add r3,r14,r3
801cbe4: 59 63 00 14 sw (r11+20),r3
if (handle->bpos.boff >=
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))
801cbe8: 28 21 00 08 lw r1,(r1+8)
* If we are the last block and the position is past the current size update
* the size with the new length. The map holds the block count.
*/
handle->bpos.boff += size;
if (handle->bpos.boff >=
801cbec: 54 23 00 06 bgu r1,r3,801cc04 <rtems_rfs_file_io_end+0x100>
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))
{
handle->bpos.bno++;
801cbf0: 29 62 00 10 lw r2,(r11+16)
handle->bpos.boff -= rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
801cbf4: c8 61 18 00 sub r3,r3,r1
801cbf8: 59 63 00 14 sw (r11+20),r3
handle->bpos.boff += size;
if (handle->bpos.boff >=
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))
{
handle->bpos.bno++;
801cbfc: 34 42 00 01 addi r2,r2,1
801cc00: 59 62 00 10 sw (r11+16),r2
handle->bpos.boff -= rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
}
length = false;
mtime = false;
801cc04: 34 01 00 00 mvi r1,0
if (!read &&
801cc08: 5d 80 00 12 bne r12,r0,801cc50 <rtems_rfs_file_io_end+0x14c>
rtems_rfs_block_map_past_end (rtems_rfs_file_map (handle),
801cc0c: 29 62 00 10 lw r2,(r11+16)
}
length = false;
mtime = false;
if (!read &&
801cc10: 44 4c 00 03 be r2,r12,801cc1c <rtems_rfs_file_io_end+0x118>
rtems_rfs_block_map_past_end (rtems_rfs_file_map (handle),
801cc14: 28 a1 00 3c lw r1,(r5+60)
801cc18: 44 20 00 09 be r1,r0,801cc3c <rtems_rfs_file_io_end+0x138> <== NEVER TAKEN
801cc1c: 28 a1 00 3c lw r1,(r5+60)
801cc20: 50 41 00 07 bgeu r2,r1,801cc3c <rtems_rfs_file_io_end+0x138>
801cc24: 34 23 ff ff addi r3,r1,-1
handle->bpos.bno++;
handle->bpos.boff -= rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
}
length = false;
mtime = false;
801cc28: 34 01 00 00 mvi r1,0
if (!read &&
rtems_rfs_block_map_past_end (rtems_rfs_file_map (handle),
801cc2c: 5c 43 00 09 bne r2,r3,801cc50 <rtems_rfs_file_io_end+0x14c>
801cc30: 29 62 00 14 lw r2,(r11+20)
801cc34: 28 a3 00 40 lw r3,(r5+64)
801cc38: 50 62 00 06 bgeu r3,r2,801cc50 <rtems_rfs_file_io_end+0x14c>
*/
static inline void
rtems_rfs_block_map_set_size_offset (rtems_rfs_block_map* map,
rtems_rfs_block_off offset)
{
map->size.offset = offset;
801cc3c: 29 61 00 14 lw r1,(r11+20)
801cc40: 58 a1 00 40 sw (r5+64),r1
map->dirty = true;
801cc44: 34 01 00 01 mvi r1,1
801cc48: 30 a1 00 34 sb (r5+52),r1
rtems_rfs_file_bpos (handle)))
{
rtems_rfs_block_map_set_size_offset (rtems_rfs_file_map (handle),
handle->bpos.boff);
length = true;
mtime = true;
801cc4c: 34 01 00 01 mvi r1,1
}
atime = rtems_rfs_file_update_atime (handle);
801cc50: 29 62 00 00 lw r2,(r11+0)
mtime = rtems_rfs_file_update_mtime (handle) && mtime;
801cc54: 34 0f 00 00 mvi r15,0
handle->bpos.boff);
length = true;
mtime = true;
}
atime = rtems_rfs_file_update_atime (handle);
801cc58: 20 4e 00 01 andi r14,r2,0x1
mtime = rtems_rfs_file_update_mtime (handle) && mtime;
801cc5c: 20 43 00 02 andi r3,r2,0x2
handle->bpos.boff);
length = true;
mtime = true;
}
atime = rtems_rfs_file_update_atime (handle);
801cc60: 19 ce 00 01 xori r14,r14,0x1
mtime = rtems_rfs_file_update_mtime (handle) && mtime;
801cc64: 5c 60 00 02 bne r3,r0,801cc6c <rtems_rfs_file_io_end+0x168><== NEVER TAKEN
801cc68: b8 20 78 00 mv r15,r1
length = rtems_rfs_file_update_length (handle) && length;
801cc6c: 20 42 00 04 andi r2,r2,0x4
length = true;
mtime = true;
}
atime = rtems_rfs_file_update_atime (handle);
mtime = rtems_rfs_file_update_mtime (handle) && mtime;
801cc70: 21 ef 00 ff andi r15,r15,0xff
length = rtems_rfs_file_update_length (handle) && length;
801cc74: 34 10 00 00 mvi r16,0
801cc78: 5c 40 00 02 bne r2,r0,801cc80 <rtems_rfs_file_io_end+0x17c><== NEVER TAKEN
801cc7c: b8 20 80 00 mv r16,r1
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
801cc80: 34 01 00 20 mvi r1,32
801cc84: 34 02 00 00 mvi r2,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;
801cc88: 22 10 00 ff andi r16,r16,0xff
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
801cc8c: fb ff d0 27 calli 8010d28 <rtems_rfs_trace>
801cc90: 44 20 00 15 be r1,r0,801cce4 <rtems_rfs_file_io_end+0x1e0> <== ALWAYS TAKEN
printf ("rtems-rfs: file-io: end: pos=%" PRIu32 ":%" PRIu32 " %c %c %c\n",
801cc94: 65 c4 00 00 cmpei r4,r14,0 <== NOT EXECUTED
801cc98: 65 e5 00 00 cmpei r5,r15,0 <== NOT EXECUTED
801cc9c: 34 01 ff ec mvi r1,-20 <== NOT EXECUTED
801cca0: c8 04 20 00 sub r4,r0,r4 <== NOT EXECUTED
801cca4: 66 06 00 00 cmpei r6,r16,0 <== NOT EXECUTED
801cca8: a0 81 20 00 and r4,r4,r1 <== NOT EXECUTED
801ccac: c8 05 28 00 sub r5,r0,r5 <== NOT EXECUTED
801ccb0: 34 01 ff e0 mvi r1,-32 <== NOT EXECUTED
801ccb4: a0 a1 28 00 and r5,r5,r1 <== NOT EXECUTED
801ccb8: c8 06 30 00 sub r6,r0,r6 <== NOT EXECUTED
801ccbc: 34 01 ff e1 mvi r1,-31 <== NOT EXECUTED
801ccc0: 29 62 00 10 lw r2,(r11+16) <== NOT EXECUTED
801ccc4: 29 63 00 14 lw r3,(r11+20) <== NOT EXECUTED
801ccc8: a0 c1 30 00 and r6,r6,r1 <== NOT EXECUTED
801cccc: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ccd0: 38 21 8b 48 ori r1,r1,0x8b48 <== NOT EXECUTED
801ccd4: 34 84 00 41 addi r4,r4,65 <== NOT EXECUTED
801ccd8: 34 a5 00 4d addi r5,r5,77 <== NOT EXECUTED
801ccdc: 34 c6 00 4c addi r6,r6,76 <== NOT EXECUTED
801cce0: f8 00 16 65 calli 8022674 <printf> <== NOT EXECUTED
handle->bpos.bno, handle->bpos.boff,
atime ? 'A' : '-', mtime ? 'M' : '-', length ? 'L' : '-');
if (atime || mtime)
801cce4: 5d c0 00 02 bne r14,r0,801ccec <rtems_rfs_file_io_end+0x1e8><== ALWAYS TAKEN
801cce8: 45 ee 00 0b be r15,r14,801cd14 <rtems_rfs_file_io_end+0x210><== NOT EXECUTED
{
time_t now = time (NULL);
801ccec: 34 01 00 00 mvi r1,0
801ccf0: f8 00 26 1d calli 8026564 <time>
if (read && atime)
801ccf4: 45 80 00 05 be r12,r0,801cd08 <rtems_rfs_file_io_end+0x204>
801ccf8: 45 c0 00 07 be r14,r0,801cd14 <rtems_rfs_file_io_end+0x210><== NEVER TAKEN
handle->shared->atime = now;
801ccfc: 29 62 00 1c lw r2,(r11+28)
801cd00: 58 41 00 8c sw (r2+140),r1
801cd04: e0 00 00 04 bi 801cd14 <rtems_rfs_file_io_end+0x210>
if (!read && mtime)
801cd08: 45 ec 00 03 be r15,r12,801cd14 <rtems_rfs_file_io_end+0x210>
handle->shared->mtime = now;
801cd0c: 29 62 00 1c lw r2,(r11+28)
801cd10: 58 41 00 90 sw (r2+144),r1
}
if (length)
801cd14: 46 00 00 06 be r16,r0,801cd2c <rtems_rfs_file_io_end+0x228>
{
handle->shared->size.count =
rtems_rfs_block_map_count (rtems_rfs_file_map (handle));
801cd18: 29 62 00 1c lw r2,(r11+28)
if (!read && mtime)
handle->shared->mtime = now;
}
if (length)
{
handle->shared->size.count =
801cd1c: 28 41 00 3c lw r1,(r2+60)
801cd20: 58 41 00 84 sw (r2+132),r1
rtems_rfs_block_map_count (rtems_rfs_file_map (handle));
handle->shared->size.offset =
801cd24: 28 41 00 40 lw r1,(r2+64)
801cd28: 58 41 00 88 sw (r2+136),r1
rtems_rfs_block_map_size_offset (rtems_rfs_file_map (handle));
}
return rc;
}
801cd2c: b9 a0 08 00 mv r1,r13
801cd30: 2b 9d 00 04 lw ra,(sp+4)
801cd34: 2b 8b 00 1c lw r11,(sp+28)
801cd38: 2b 8c 00 18 lw r12,(sp+24)
801cd3c: 2b 8d 00 14 lw r13,(sp+20)
801cd40: 2b 8e 00 10 lw r14,(sp+16)
801cd44: 2b 8f 00 0c lw r15,(sp+12)
801cd48: 2b 90 00 08 lw r16,(sp+8)
801cd4c: 37 9c 00 1c addi sp,sp,28
801cd50: c3 a0 00 00 ret
0801cd54 <rtems_rfs_file_io_release>:
int
rtems_rfs_file_io_release (rtems_rfs_file_handle* handle)
{
801cd54: 37 9c ff fc addi sp,sp,-4
801cd58: 5b 9d 00 04 sw (sp+4),ra
int rc = 0;
if (rtems_rfs_buffer_handle_has_block (&handle->buffer))
801cd5c: 28 23 00 0c lw r3,(r1+12)
return rc;
}
int
rtems_rfs_file_io_release (rtems_rfs_file_handle* handle)
{
801cd60: b8 20 10 00 mv r2,r1
int rc = 0;
801cd64: 34 01 00 00 mvi r1,0
if (rtems_rfs_buffer_handle_has_block (&handle->buffer))
801cd68: 44 60 00 05 be r3,r0,801cd7c <rtems_rfs_file_io_release+0x28><== ALWAYS TAKEN
rc = rtems_rfs_buffer_handle_release (rtems_rfs_file_fs (handle),
801cd6c: 28 41 00 1c lw r1,(r2+28) <== NOT EXECUTED
801cd70: 34 42 00 04 addi r2,r2,4 <== NOT EXECUTED
801cd74: 28 21 00 98 lw r1,(r1+152) <== NOT EXECUTED
801cd78: fb ff f6 d5 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
rtems_rfs_file_buffer (handle));
return rc;
}
801cd7c: 2b 9d 00 04 lw ra,(sp+4)
801cd80: 37 9c 00 04 addi sp,sp,4
801cd84: c3 a0 00 00 ret
0801c90c <rtems_rfs_file_io_start>:
int
rtems_rfs_file_io_start (rtems_rfs_file_handle* handle,
size_t* available,
bool read)
{
801c90c: 37 9c ff e4 addi sp,sp,-28
801c910: 5b 8b 00 18 sw (sp+24),r11
801c914: 5b 8c 00 14 sw (sp+20),r12
801c918: 5b 8d 00 10 sw (sp+16),r13
801c91c: 5b 8e 00 0c sw (sp+12),r14
801c920: 5b 8f 00 08 sw (sp+8),r15
801c924: 5b 9d 00 04 sw (sp+4),ra
801c928: b8 20 58 00 mv r11,r1
801c92c: b8 40 70 00 mv r14,r2
size_t size;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
801c930: 34 01 00 20 mvi r1,32
801c934: 34 02 00 00 mvi r2,0
int
rtems_rfs_file_io_start (rtems_rfs_file_handle* handle,
size_t* available,
bool read)
{
801c938: 20 6d 00 ff andi r13,r3,0xff
size_t size;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
801c93c: fb ff d0 fb calli 8010d28 <rtems_rfs_trace>
801c940: 44 20 00 0b be r1,r0,801c96c <rtems_rfs_file_io_start+0x60><== ALWAYS TAKEN
printf ("rtems-rfs: file-io: start: %s pos=%" PRIu32 ":%" PRIu32 "\n",
801c944: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
801c948: 38 42 8a 20 ori r2,r2,0x8a20 <== NOT EXECUTED
801c94c: 45 a0 00 03 be r13,r0,801c958 <rtems_rfs_file_io_start+0x4c><== NOT EXECUTED
801c950: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
801c954: 38 42 72 f4 ori r2,r2,0x72f4 <== NOT EXECUTED
801c958: 29 63 00 10 lw r3,(r11+16) <== NOT EXECUTED
801c95c: 29 64 00 14 lw r4,(r11+20) <== NOT EXECUTED
801c960: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801c964: 38 21 8a 28 ori r1,r1,0x8a28 <== NOT EXECUTED
801c968: f8 00 17 43 calli 8022674 <printf> <== NOT EXECUTED
read ? "read" : "write", handle->bpos.bno, handle->bpos.boff);
if (!rtems_rfs_buffer_handle_has_block (&handle->buffer))
801c96c: 29 6f 00 0c lw r15,(r11+12)
801c970: 5d e0 00 41 bne r15,r0,801ca74 <rtems_rfs_file_io_start+0x168>
bool request_read;
int rc;
request_read = read;
rc = rtems_rfs_block_map_find (rtems_rfs_file_fs (handle),
801c974: 29 62 00 1c lw r2,(r11+28)
801c978: 35 63 00 10 addi r3,r11,16
801c97c: 37 84 00 1c addi r4,sp,28
801c980: 28 41 00 98 lw r1,(r2+152)
801c984: 34 42 00 34 addi r2,r2,52
801c988: fb ff f4 99 calli 8019bec <rtems_rfs_block_map_find>
801c98c: b8 20 60 00 mv r12,r1
rtems_rfs_file_map (handle),
rtems_rfs_file_bpos (handle),
&block);
if (rc > 0)
801c990: 4d e1 00 1a bge r15,r1,801c9f8 <rtems_rfs_file_io_start+0xec>
{
/*
* Has the read reached the EOF ?
*/
if (read && (rc == ENXIO))
801c994: 45 a0 00 06 be r13,r0,801c9ac <rtems_rfs_file_io_start+0xa0><== ALWAYS TAKEN
801c998: 34 01 00 06 mvi r1,6 <== NOT EXECUTED
801c99c: 5d 81 00 51 bne r12,r1,801cae0 <rtems_rfs_file_io_start+0x1d4><== NOT EXECUTED
{
*available = 0;
801c9a0: 59 c0 00 00 sw (r14+0),r0 <== NOT EXECUTED
return 0;
801c9a4: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
801c9a8: e0 00 00 4e bi 801cae0 <rtems_rfs_file_io_start+0x1d4> <== NOT EXECUTED
}
if (rc != ENXIO)
801c9ac: 34 01 00 06 mvi r1,6
801c9b0: 5d 81 00 4c bne r12,r1,801cae0 <rtems_rfs_file_io_start+0x1d4><== NEVER TAKEN
return rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
801c9b4: 34 01 00 20 mvi r1,32
801c9b8: 34 02 00 00 mvi r2,0
801c9bc: fb ff d0 db calli 8010d28 <rtems_rfs_trace>
801c9c0: 44 20 00 04 be r1,r0,801c9d0 <rtems_rfs_file_io_start+0xc4><== ALWAYS TAKEN
printf ("rtems-rfs: file-io: start: grow\n");
801c9c4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801c9c8: 38 21 8a 54 ori r1,r1,0x8a54 <== NOT EXECUTED
801c9cc: f8 00 17 f2 calli 8022994 <puts> <== NOT EXECUTED
rc = rtems_rfs_block_map_grow (rtems_rfs_file_fs (handle),
801c9d0: 29 62 00 1c lw r2,(r11+28)
801c9d4: 34 03 00 01 mvi r3,1
801c9d8: 37 84 00 1c addi r4,sp,28
801c9dc: 28 41 00 98 lw r1,(r2+152)
801c9e0: 34 42 00 34 addi r2,r2,52
801c9e4: fb ff f5 33 calli 8019eb0 <rtems_rfs_block_map_grow>
801c9e8: b8 20 60 00 mv r12,r1
rtems_rfs_file_map (handle),
1, &block);
if (rc > 0)
801c9ec: 48 20 00 3d bg r1,r0,801cae0 <rtems_rfs_file_io_start+0x1d4>
return rc;
request_read = false;
801c9f0: 34 0c 00 00 mvi r12,0
801c9f4: e0 00 00 0b bi 801ca20 <rtems_rfs_file_io_start+0x114>
/*
* 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 &&
801c9f8: b9 a0 60 00 mv r12,r13
801c9fc: 5d a0 00 09 bne r13,r0,801ca20 <rtems_rfs_file_io_start+0x114>
801ca00: 29 61 00 14 lw r1,(r11+20)
(rtems_rfs_file_block_offset (handle) ||
(*available < rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))))
request_read = true;
801ca04: 34 0c 00 01 mvi r12,1
/*
* If this is a write check if the write starts within a block or the
* amount of data is less than a block size. If it is read the block
* rather than getting a block to fill.
*/
if (!read &&
801ca08: 5c 2d 00 06 bne r1,r13,801ca20 <rtems_rfs_file_io_start+0x114>
(rtems_rfs_file_block_offset (handle) ||
(*available < rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))))
801ca0c: 29 61 00 1c lw r1,(r11+28)
* 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) ||
801ca10: 29 cc 00 00 lw r12,(r14+0)
(*available < rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))))
801ca14: 28 21 00 98 lw r1,(r1+152)
* 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) ||
801ca18: 28 21 00 08 lw r1,(r1+8)
801ca1c: f4 2c 60 00 cmpgu r12,r1,r12
(*available < rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))))
request_read = true;
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
801ca20: 34 01 00 20 mvi r1,32
801ca24: 34 02 00 00 mvi r2,0
801ca28: fb ff d0 c0 calli 8010d28 <rtems_rfs_trace>
801ca2c: 44 20 00 0a be r1,r0,801ca54 <rtems_rfs_file_io_start+0x148><== ALWAYS TAKEN
printf ("rtems-rfs: file-io: start: block=%" PRIu32 " request-read=%s\n",
801ca30: 78 03 08 03 mvhi r3,0x803 <== NOT EXECUTED
801ca34: 2b 82 00 1c lw r2,(sp+28) <== NOT EXECUTED
801ca38: 38 63 72 78 ori r3,r3,0x7278 <== NOT EXECUTED
801ca3c: 45 80 00 03 be r12,r0,801ca48 <rtems_rfs_file_io_start+0x13c><== NOT EXECUTED
801ca40: 78 03 08 03 mvhi r3,0x803 <== NOT EXECUTED
801ca44: 38 63 6d d8 ori r3,r3,0x6dd8 <== NOT EXECUTED
801ca48: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ca4c: 38 21 8a 74 ori r1,r1,0x8a74 <== NOT EXECUTED
801ca50: f8 00 17 09 calli 8022674 <printf> <== NOT EXECUTED
block, request_read ? "yes" : "no");
rc = rtems_rfs_buffer_handle_request (rtems_rfs_file_fs (handle),
801ca54: 29 61 00 1c lw r1,(r11+28)
801ca58: 2b 83 00 1c lw r3,(sp+28)
801ca5c: b9 80 20 00 mv r4,r12
801ca60: 28 21 00 98 lw r1,(r1+152)
801ca64: 35 62 00 04 addi r2,r11,4
801ca68: fb ff f8 08 calli 801aa88 <rtems_rfs_buffer_handle_request>
801ca6c: b8 20 60 00 mv r12,r1
rtems_rfs_file_buffer (handle),
block, request_read);
if (rc > 0)
801ca70: 48 20 00 1c bg r1,r0,801cae0 <rtems_rfs_file_io_start+0x1d4><== NEVER TAKEN
return rc;
}
if (read
801ca74: 45 a0 00 0b be r13,r0,801caa0 <rtems_rfs_file_io_start+0x194>
&& rtems_rfs_block_map_last (rtems_rfs_file_map (handle))
801ca78: 29 61 00 1c lw r1,(r11+28)
801ca7c: 28 22 00 44 lw r2,(r1+68)
801ca80: 5c 40 00 03 bne r2,r0,801ca8c <rtems_rfs_file_io_start+0x180>
801ca84: 28 23 00 3c lw r3,(r1+60)
801ca88: 44 62 00 04 be r3,r2,801ca98 <rtems_rfs_file_io_start+0x18c><== NEVER TAKEN
801ca8c: 28 23 00 3c lw r3,(r1+60)
801ca90: 34 63 ff ff addi r3,r3,-1
801ca94: 5c 43 00 03 bne r2,r3,801caa0 <rtems_rfs_file_io_start+0x194>
&& rtems_rfs_block_map_size_offset (rtems_rfs_file_map (handle)))
801ca98: 28 2d 00 40 lw r13,(r1+64)
801ca9c: 5d a0 00 04 bne r13,r0,801caac <rtems_rfs_file_io_start+0x1a0>
size = rtems_rfs_block_map_size_offset (rtems_rfs_file_map (handle));
else
size = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
801caa0: 29 61 00 1c lw r1,(r11+28)
801caa4: 28 21 00 98 lw r1,(r1+152)
801caa8: 28 2d 00 08 lw r13,(r1+8)
*available = size - rtems_rfs_file_block_offset (handle);
801caac: 29 61 00 14 lw r1,(r11+20)
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
801cab0: 34 02 00 00 mvi r2,0
printf ("rtems-rfs: file-io: start: available=%zu (%zu)\n",
*available, size);
return 0;
801cab4: 34 0c 00 00 mvi r12,0
&& 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));
*available = size - rtems_rfs_file_block_offset (handle);
801cab8: c9 a1 08 00 sub r1,r13,r1
801cabc: 59 c1 00 00 sw (r14+0),r1
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
801cac0: 34 01 00 20 mvi r1,32
801cac4: fb ff d0 99 calli 8010d28 <rtems_rfs_trace>
801cac8: 44 20 00 06 be r1,r0,801cae0 <rtems_rfs_file_io_start+0x1d4><== ALWAYS TAKEN
printf ("rtems-rfs: file-io: start: available=%zu (%zu)\n",
801cacc: 29 c2 00 00 lw r2,(r14+0) <== NOT EXECUTED
801cad0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801cad4: 38 21 8a ac ori r1,r1,0x8aac <== NOT EXECUTED
801cad8: b9 a0 18 00 mv r3,r13 <== NOT EXECUTED
801cadc: f8 00 16 e6 calli 8022674 <printf> <== NOT EXECUTED
*available, size);
return 0;
}
801cae0: b9 80 08 00 mv r1,r12
801cae4: 2b 9d 00 04 lw ra,(sp+4)
801cae8: 2b 8b 00 18 lw r11,(sp+24)
801caec: 2b 8c 00 14 lw r12,(sp+20)
801caf0: 2b 8d 00 10 lw r13,(sp+16)
801caf4: 2b 8e 00 0c lw r14,(sp+12)
801caf8: 2b 8f 00 08 lw r15,(sp+8)
801cafc: 37 9c 00 1c addi sp,sp,28
801cb00: c3 a0 00 00 ret
0801d1d8 <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)
{
801d1d8: 37 9c ff d4 addi sp,sp,-44
801d1dc: 5b 8b 00 2c sw (sp+44),r11
801d1e0: 5b 8c 00 28 sw (sp+40),r12
801d1e4: 5b 8d 00 24 sw (sp+36),r13
801d1e8: 5b 8e 00 20 sw (sp+32),r14
801d1ec: 5b 8f 00 1c sw (sp+28),r15
801d1f0: 5b 90 00 18 sw (sp+24),r16
801d1f4: 5b 91 00 14 sw (sp+20),r17
801d1f8: 5b 92 00 10 sw (sp+16),r18
801d1fc: 5b 93 00 0c sw (sp+12),r19
801d200: 5b 94 00 08 sw (sp+8),r20
801d204: 5b 9d 00 04 sw (sp+4),ra
801d208: b8 20 70 00 mv r14,r1
801d20c: b8 40 80 00 mv r16,r2
rtems_rfs_file_handle* handle;
rtems_rfs_file_shared* shared;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
801d210: 34 01 00 08 mvi r1,8
801d214: 34 02 00 00 mvi r2,0
int
rtems_rfs_file_open (rtems_rfs_file_system* fs,
rtems_rfs_ino ino,
int oflag,
rtems_rfs_file_handle** file)
{
801d218: b8 60 98 00 mv r19,r3
801d21c: b8 80 90 00 mv r18,r4
rtems_rfs_file_handle* handle;
rtems_rfs_file_shared* shared;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
801d220: fb ff ce c2 calli 8010d28 <rtems_rfs_trace>
801d224: 44 20 00 05 be r1,r0,801d238 <rtems_rfs_file_open+0x60> <== ALWAYS TAKEN
printf ("rtems-rfs: file-open: ino=%" PRId32 "\n", ino);
801d228: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801d22c: 38 21 8b c4 ori r1,r1,0x8bc4 <== NOT EXECUTED
801d230: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
801d234: f8 00 15 10 calli 8022674 <printf> <== NOT EXECUTED
*file = NULL;
801d238: 5a 40 00 00 sw (r18+0),r0
/*
* 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));
801d23c: 34 01 00 20 mvi r1,32
801d240: fb ff a6 7e calli 8006c38 <malloc>
801d244: b8 20 58 00 mv r11,r1
if (!handle)
return ENOMEM;
801d248: 34 0d 00 0c mvi r13,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)
801d24c: 44 20 00 ac be r1,r0,801d4fc <rtems_rfs_file_open+0x324> <== NEVER TAKEN
return ENOMEM;
memset (handle, 0, sizeof (rtems_rfs_file_handle));
801d250: 34 02 00 00 mvi r2,0
801d254: 34 03 00 20 mvi r3,32
801d258: f8 00 14 6b calli 8022404 <memset>
/*
* Scan the file system data list of open files for this ino. If found up
* the reference count and return the pointer to the data.
*/
shared = rtems_rfs_file_get_shared (fs, ino);
801d25c: b9 c0 08 00 mv r1,r14
801d260: ba 00 10 00 mv r2,r16
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
801d264: 31 60 00 04 sb (r11+4),r0
handle->bnum = 0;
801d268: 59 60 00 08 sw (r11+8),r0
handle->buffer = NULL;
801d26c: 59 60 00 0c sw (r11+12),r0
801d270: fb ff ff d0 calli 801d1b0 <rtems_rfs_file_get_shared>
801d274: b8 20 60 00 mv r12,r1
if (shared)
801d278: 44 20 00 0b be r1,r0,801d2a4 <rtems_rfs_file_open+0xcc> <== ALWAYS TAKEN
{
shared->references++;
801d27c: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
801d280: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
* the reference count and return the pointer to the data.
*/
shared = rtems_rfs_file_get_shared (fs, ino);
if (shared)
{
shared->references++;
801d284: 34 21 00 01 addi r1,r1,1 <== NOT EXECUTED
801d288: 59 81 00 08 sw (r12+8),r1 <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
801d28c: 34 01 00 08 mvi r1,8 <== NOT EXECUTED
801d290: fb ff ce a6 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801d294: 44 20 00 96 be r1,r0,801d4ec <rtems_rfs_file_open+0x314> <== NOT EXECUTED
printf ("rtems-rfs: file-open: ino=%" PRId32 " shared\n", ino);
801d298: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801d29c: 38 21 8b e4 ori r1,r1,0x8be4 <== NOT EXECUTED
801d2a0: e0 00 00 91 bi 801d4e4 <rtems_rfs_file_open+0x30c> <== 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));
801d2a4: 34 01 00 9c mvi r1,156
801d2a8: fb ff a6 64 calli 8006c38 <malloc>
801d2ac: b8 20 78 00 mv r15,r1
801d2b0: b8 20 60 00 mv r12,r1
if (!shared)
801d2b4: 44 20 00 2e be r1,r0,801d36c <rtems_rfs_file_open+0x194> <== NEVER TAKEN
rtems_rfs_buffer_handle_close (fs, &handle->buffer);
free (handle);
return ENOMEM;
}
memset (shared, 0, sizeof (rtems_rfs_file_shared));
801d2b8: 34 02 00 00 mvi r2,0
801d2bc: 34 03 00 9c mvi r3,156
801d2c0: f8 00 14 51 calli 8022404 <memset>
rc = rtems_rfs_inode_open (fs, ino, &shared->inode, true);
801d2c4: 35 f1 00 0c addi r17,r15,12
801d2c8: b9 c0 08 00 mv r1,r14
801d2cc: ba 00 10 00 mv r2,r16
801d2d0: ba 20 18 00 mv r3,r17
801d2d4: 34 04 00 01 mvi r4,1
801d2d8: fb ff c6 b0 calli 800ed98 <rtems_rfs_inode_open>
801d2dc: b8 20 68 00 mv r13,r1
if (rc > 0)
801d2e0: 4c 01 00 0d bge r0,r1,801d314 <rtems_rfs_file_open+0x13c> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
801d2e4: 34 01 00 08 mvi r1,8 <== NOT EXECUTED
801d2e8: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801d2ec: fb ff ce 8f calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801d2f0: 44 20 00 1d be r1,r0,801d364 <rtems_rfs_file_open+0x18c> <== NOT EXECUTED
printf ("rtems-rfs: file-open: inode open failed: %d: %s\n",
801d2f4: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
801d2f8: f8 00 19 9a calli 8023960 <strerror> <== NOT EXECUTED
801d2fc: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801d300: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801d304: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801d308: 38 21 8c 0c ori r1,r1,0x8c0c <== NOT EXECUTED
801d30c: f8 00 14 da calli 8022674 <printf> <== NOT EXECUTED
801d310: e0 00 00 15 bi 801d364 <rtems_rfs_file_open+0x18c> <== 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);
801d314: b9 c0 08 00 mv r1,r14
801d318: ba 20 10 00 mv r2,r17
801d31c: 35 e3 00 34 addi r3,r15,52
801d320: fb ff f1 0e calli 8019758 <rtems_rfs_block_map_open>
801d324: b8 20 68 00 mv r13,r1
if (rc > 0)
801d328: 4c 01 00 1a bge r0,r1,801d390 <rtems_rfs_file_open+0x1b8> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
801d32c: 34 01 00 08 mvi r1,8 <== NOT EXECUTED
801d330: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801d334: fb ff ce 7d calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801d338: 44 20 00 08 be r1,r0,801d358 <rtems_rfs_file_open+0x180> <== NOT EXECUTED
printf ("rtems-rfs: file-open: block map open failed: %d: %s\n",
801d33c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
801d340: f8 00 19 88 calli 8023960 <strerror> <== NOT EXECUTED
801d344: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801d348: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801d34c: 38 21 8c 40 ori r1,r1,0x8c40 <== NOT EXECUTED
801d350: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801d354: f8 00 14 c8 calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_inode_close (fs, &shared->inode);
801d358: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
801d35c: ba 20 10 00 mv r2,r17 <== NOT EXECUTED
801d360: fb ff c7 1a calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
free (shared);
801d364: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
801d368: fb ff a4 49 calli 800648c <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);
801d36c: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
801d370: 35 62 00 04 addi r2,r11,4 <== NOT EXECUTED
801d374: fb ff f5 56 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &handle->buffer);
free (handle);
801d378: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
handle->dirty = false;
801d37c: 31 60 00 04 sb (r11+4),r0 <== NOT EXECUTED
handle->bnum = 0;
801d380: 59 60 00 08 sw (r11+8),r0 <== NOT EXECUTED
handle->buffer = NULL;
801d384: 59 60 00 0c sw (r11+12),r0 <== NOT EXECUTED
801d388: fb ff a4 41 calli 800648c <free> <== NOT EXECUTED
return rc;
801d38c: e0 00 00 5c bi 801d4fc <rtems_rfs_file_open+0x324> <== NOT EXECUTED
if (shared->inode.ino == ino)
return shared;
node = rtems_chain_next (node);
}
return NULL;
}
801d390: 29 ed 00 18 lw r13,(r15+24)
rtems_rfs_buffer_handle_close (fs, &handle->buffer);
free (handle);
return rc;
}
shared->references = 1;
801d394: 34 01 00 01 mvi r1,1
801d398: 59 e1 00 08 sw (r15+8),r1
* @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);
801d39c: 41 a1 00 0c lbu r1,(r13+12)
801d3a0: 35 af 00 0c addi r15,r13,12
801d3a4: 41 f4 00 03 lbu r20,(r15+3)
801d3a8: 34 02 00 18 mvi r2,24
801d3ac: fb ff 90 4d calli 80014e0 <__ashlsi3>
801d3b0: ba 81 a0 00 or r20,r20,r1
801d3b4: 41 e1 00 01 lbu r1,(r15+1)
801d3b8: 34 02 00 10 mvi r2,16
801d3bc: fb ff 90 49 calli 80014e0 <__ashlsi3>
801d3c0: ba 81 a0 00 or r20,r20,r1
801d3c4: 41 e1 00 02 lbu r1,(r15+2)
801d3c8: 34 02 00 08 mvi r2,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);
801d3cc: 35 af 00 0a addi r15,r13,10
* @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);
801d3d0: fb ff 90 44 calli 80014e0 <__ashlsi3>
801d3d4: ba 81 08 00 or r1,r20,r1
shared->size.count = rtems_rfs_inode_get_block_count (&shared->inode);
801d3d8: 59 81 00 84 sw (r12+132),r1
* @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);
801d3dc: 41 a1 00 0a lbu r1,(r13+10)
801d3e0: 34 02 00 08 mvi r2,8
801d3e4: fb ff 90 3f calli 80014e0 <__ashlsi3>
801d3e8: 41 e2 00 01 lbu r2,(r15+1)
* @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);
801d3ec: 35 af 00 10 addi r15,r13,16
* @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);
801d3f0: b8 22 08 00 or r1,r1,r2
shared->size.offset = rtems_rfs_inode_get_block_offset (&shared->inode);
801d3f4: 20 21 ff ff andi r1,r1,0xffff
801d3f8: 59 81 00 88 sw (r12+136),r1
* @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);
801d3fc: 41 a1 00 10 lbu r1,(r13+16)
801d400: 41 f4 00 03 lbu r20,(r15+3)
801d404: 34 02 00 18 mvi r2,24
801d408: fb ff 90 36 calli 80014e0 <__ashlsi3>
801d40c: ba 81 a0 00 or r20,r20,r1
801d410: 41 e1 00 01 lbu r1,(r15+1)
801d414: 34 02 00 10 mvi r2,16
801d418: fb ff 90 32 calli 80014e0 <__ashlsi3>
801d41c: ba 81 a0 00 or r20,r20,r1
801d420: 41 e1 00 02 lbu r1,(r15+2)
801d424: 34 02 00 08 mvi r2,8
* @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);
801d428: 35 af 00 14 addi r15,r13,20
* @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);
801d42c: fb ff 90 2d calli 80014e0 <__ashlsi3>
801d430: ba 81 08 00 or r1,r20,r1
shared->atime = rtems_rfs_inode_get_atime (&shared->inode);
801d434: 59 81 00 8c sw (r12+140),r1
* @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);
801d438: 41 a1 00 14 lbu r1,(r13+20)
801d43c: 41 f4 00 03 lbu r20,(r15+3)
801d440: 34 02 00 18 mvi r2,24
801d444: fb ff 90 27 calli 80014e0 <__ashlsi3>
801d448: ba 81 a0 00 or r20,r20,r1
801d44c: 41 e1 00 01 lbu r1,(r15+1)
801d450: 34 02 00 10 mvi r2,16
801d454: fb ff 90 23 calli 80014e0 <__ashlsi3>
801d458: ba 81 a0 00 or r20,r20,r1
801d45c: 41 e1 00 02 lbu r1,(r15+2)
801d460: 34 02 00 08 mvi r2,8
* @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);
801d464: 35 af 00 18 addi r15,r13,24
* @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);
801d468: fb ff 90 1e calli 80014e0 <__ashlsi3>
801d46c: ba 81 08 00 or r1,r20,r1
shared->mtime = rtems_rfs_inode_get_mtime (&shared->inode);
801d470: 59 81 00 90 sw (r12+144),r1
* @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);
801d474: 41 a1 00 18 lbu r1,(r13+24)
801d478: 41 f4 00 03 lbu r20,(r15+3)
801d47c: 34 02 00 18 mvi r2,24
801d480: fb ff 90 18 calli 80014e0 <__ashlsi3>
801d484: ba 81 68 00 or r13,r20,r1
801d488: 41 e1 00 01 lbu r1,(r15+1)
801d48c: 34 02 00 10 mvi r2,16
801d490: fb ff 90 14 calli 80014e0 <__ashlsi3>
801d494: b9 a1 68 00 or r13,r13,r1
801d498: 41 e1 00 02 lbu r1,(r15+2)
801d49c: 34 02 00 08 mvi r2,8
801d4a0: fb ff 90 10 calli 80014e0 <__ashlsi3>
801d4a4: b9 a1 08 00 or r1,r13,r1
shared->ctime = rtems_rfs_inode_get_ctime (&shared->inode);
801d4a8: 59 81 00 94 sw (r12+148),r1
RTEMS_INLINE_ROUTINE void rtems_chain_append(
rtems_chain_control *the_chain,
rtems_chain_node *the_node
)
{
_Chain_Append( the_chain, the_node );
801d4ac: b9 80 10 00 mv r2,r12
801d4b0: 35 c1 00 74 addi r1,r14,116
shared->fs = fs;
801d4b4: 59 8e 00 98 sw (r12+152),r14
801d4b8: fb ff b2 2b calli 8009d64 <_Chain_Append>
rtems_chain_append (&fs->file_shares, &shared->link);
rtems_rfs_inode_unload (fs, &shared->inode, false);
801d4bc: ba 20 10 00 mv r2,r17
801d4c0: b9 c0 08 00 mv r1,r14
801d4c4: 34 03 00 00 mvi r3,0
801d4c8: fb ff c6 7a calli 800eeb0 <rtems_rfs_inode_unload>
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
801d4cc: 34 01 00 08 mvi r1,8
801d4d0: 34 02 00 00 mvi r2,0
801d4d4: fb ff ce 15 calli 8010d28 <rtems_rfs_trace>
801d4d8: 44 20 00 05 be r1,r0,801d4ec <rtems_rfs_file_open+0x314> <== ALWAYS TAKEN
printf ("rtems-rfs: file-open: ino=%" PRId32 " share created\n", ino);
801d4dc: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801d4e0: 38 21 8c 78 ori r1,r1,0x8c78 <== NOT EXECUTED
801d4e4: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
801d4e8: f8 00 14 63 calli 8022674 <printf> <== NOT EXECUTED
}
handle->flags = oflag;
801d4ec: 59 73 00 00 sw (r11+0),r19
handle->shared = shared;
801d4f0: 59 6c 00 1c sw (r11+28),r12
*file = handle;
801d4f4: 5a 4b 00 00 sw (r18+0),r11
return 0;
801d4f8: 34 0d 00 00 mvi r13,0
}
801d4fc: b9 a0 08 00 mv r1,r13
801d500: 2b 9d 00 04 lw ra,(sp+4)
801d504: 2b 8b 00 2c lw r11,(sp+44)
801d508: 2b 8c 00 28 lw r12,(sp+40)
801d50c: 2b 8d 00 24 lw r13,(sp+36)
801d510: 2b 8e 00 20 lw r14,(sp+32)
801d514: 2b 8f 00 1c lw r15,(sp+28)
801d518: 2b 90 00 18 lw r16,(sp+24)
801d51c: 2b 91 00 14 lw r17,(sp+20)
801d520: 2b 92 00 10 lw r18,(sp+16)
801d524: 2b 93 00 0c lw r19,(sp+12)
801d528: 2b 94 00 08 lw r20,(sp+8)
801d52c: 37 9c 00 2c addi sp,sp,44
801d530: c3 a0 00 00 ret
0801cd88 <rtems_rfs_file_seek>:
int
rtems_rfs_file_seek (rtems_rfs_file_handle* handle,
rtems_rfs_pos pos,
rtems_rfs_pos* new_pos)
{
801cd88: 37 9c ff e4 addi sp,sp,-28
801cd8c: 5b 8b 00 18 sw (sp+24),r11
801cd90: 5b 8c 00 14 sw (sp+20),r12
801cd94: 5b 8d 00 10 sw (sp+16),r13
801cd98: 5b 8e 00 0c sw (sp+12),r14
801cd9c: 5b 8f 00 08 sw (sp+8),r15
801cda0: 5b 9d 00 04 sw (sp+4),ra
801cda4: b8 20 58 00 mv r11,r1
801cda8: b8 40 60 00 mv r12,r2
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
801cdac: 34 01 00 20 mvi r1,32
801cdb0: 34 02 00 00 mvi r2,0
int
rtems_rfs_file_seek (rtems_rfs_file_handle* handle,
rtems_rfs_pos pos,
rtems_rfs_pos* new_pos)
{
801cdb4: b8 60 68 00 mv r13,r3
801cdb8: b8 80 70 00 mv r14,r4
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
801cdbc: fb ff cf db calli 8010d28 <rtems_rfs_trace>
801cdc0: 44 20 00 06 be r1,r0,801cdd8 <rtems_rfs_file_seek+0x50> <== ALWAYS TAKEN
printf ("rtems-rfs: file-seek: new=%" PRIu64 "\n", pos);
801cdc4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801cdc8: 38 21 8b 7c ori r1,r1,0x8b7c <== NOT EXECUTED
801cdcc: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
801cdd0: b9 a0 18 00 mv r3,r13 <== NOT EXECUTED
801cdd4: f8 00 16 28 calli 8022674 <printf> <== NOT EXECUTED
* 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),
801cdd8: 29 62 00 1c lw r2,(r11+28)
801cddc: 28 41 00 98 lw r1,(r2+152)
801cde0: 34 42 00 84 addi r2,r2,132
801cde4: fb ff f2 45 calli 80196f8 <rtems_rfs_block_get_size>
801cde8: 55 81 00 1b bgu r12,r1,801ce54 <rtems_rfs_file_seek+0xcc> <== NEVER TAKEN
801cdec: 5d 81 00 02 bne r12,r1,801cdf4 <rtems_rfs_file_seek+0x6c> <== NEVER TAKEN
801cdf0: 55 a2 00 19 bgu r13,r2,801ce54 <rtems_rfs_file_seek+0xcc>
handle->shared))
{
rtems_rfs_file_set_bpos (handle, pos);
801cdf4: 29 61 00 1c lw r1,(r11+28)
801cdf8: 35 6f 00 10 addi r15,r11,16
801cdfc: b9 80 10 00 mv r2,r12
801ce00: 28 21 00 98 lw r1,(r1+152)
801ce04: b9 a0 18 00 mv r3,r13
801ce08: b9 e0 20 00 mv r4,r15
801ce0c: fb ff f1 ed calli 80195c0 <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))
801ce10: 29 61 00 0c lw r1,(r11+12)
801ce14: 44 20 00 13 be r1,r0,801ce60 <rtems_rfs_file_seek+0xd8>
{
rtems_rfs_buffer_block block;
int rc;
rc = rtems_rfs_block_map_find (rtems_rfs_file_fs (handle),
801ce18: 29 62 00 1c lw r2,(r11+28)
801ce1c: b9 e0 18 00 mv r3,r15
801ce20: 37 84 00 1c addi r4,sp,28
801ce24: 28 41 00 98 lw r1,(r2+152)
801ce28: 34 42 00 34 addi r2,r2,52
801ce2c: fb ff f3 70 calli 8019bec <rtems_rfs_block_map_find>
rtems_rfs_file_map (handle),
rtems_rfs_file_bpos (handle),
&block);
if (rc > 0)
801ce30: 48 20 00 0f bg r1,r0,801ce6c <rtems_rfs_file_seek+0xe4> <== NEVER TAKEN
return rc;
if (rtems_rfs_buffer_bnum (&handle->buffer) != block)
801ce34: 29 62 00 08 lw r2,(r11+8)
801ce38: 2b 81 00 1c lw r1,(sp+28)
801ce3c: 44 41 00 09 be r2,r1,801ce60 <rtems_rfs_file_seek+0xd8> <== ALWAYS TAKEN
{
rc = rtems_rfs_buffer_handle_release (rtems_rfs_file_fs (handle),
801ce40: 29 61 00 1c lw r1,(r11+28) <== NOT EXECUTED
801ce44: 35 62 00 04 addi r2,r11,4 <== NOT EXECUTED
801ce48: 28 21 00 98 lw r1,(r1+152) <== NOT EXECUTED
801ce4c: fb ff f6 a0 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
801ce50: e0 00 00 03 bi 801ce5c <rtems_rfs_file_seek+0xd4> <== NOT EXECUTED
{
/*
* The seek is outside the current file so release any buffer. A write will
* extend the file.
*/
int rc = rtems_rfs_file_io_release (handle);
801ce54: b9 60 08 00 mv r1,r11
801ce58: fb ff ff bf calli 801cd54 <rtems_rfs_file_io_release>
if (rc > 0)
801ce5c: 48 20 00 04 bg r1,r0,801ce6c <rtems_rfs_file_seek+0xe4> <== NEVER TAKEN
return rc;
}
*new_pos = pos;
801ce60: 59 cc 00 00 sw (r14+0),r12
801ce64: 59 cd 00 04 sw (r14+4),r13
return 0;
801ce68: 34 01 00 00 mvi r1,0
}
801ce6c: 2b 9d 00 04 lw ra,(sp+4)
801ce70: 2b 8b 00 18 lw r11,(sp+24)
801ce74: 2b 8c 00 14 lw r12,(sp+20)
801ce78: 2b 8d 00 10 lw r13,(sp+16)
801ce7c: 2b 8e 00 0c lw r14,(sp+12)
801ce80: 2b 8f 00 08 lw r15,(sp+8)
801ce84: 37 9c 00 1c addi sp,sp,28
801ce88: c3 a0 00 00 ret
0801ce8c <rtems_rfs_file_set_size>:
int
rtems_rfs_file_set_size (rtems_rfs_file_handle* handle,
rtems_rfs_pos new_size)
{
801ce8c: 37 9c ff bc addi sp,sp,-68
801ce90: 5b 8b 00 34 sw (sp+52),r11
801ce94: 5b 8c 00 30 sw (sp+48),r12
801ce98: 5b 8d 00 2c sw (sp+44),r13
801ce9c: 5b 8e 00 28 sw (sp+40),r14
801cea0: 5b 8f 00 24 sw (sp+36),r15
801cea4: 5b 90 00 20 sw (sp+32),r16
801cea8: 5b 91 00 1c sw (sp+28),r17
801ceac: 5b 92 00 18 sw (sp+24),r18
801ceb0: 5b 93 00 14 sw (sp+20),r19
801ceb4: 5b 94 00 10 sw (sp+16),r20
801ceb8: 5b 95 00 0c sw (sp+12),r21
801cebc: 5b 96 00 08 sw (sp+8),r22
801cec0: 5b 9d 00 04 sw (sp+4),ra
801cec4: b8 20 58 00 mv r11,r1
801cec8: b8 40 78 00 mv r15,r2
rtems_rfs_block_map* map = rtems_rfs_file_map (handle);
801cecc: 28 2d 00 1c lw r13,(r1+28)
rtems_rfs_pos size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
801ced0: 34 02 00 00 mvi r2,0
801ced4: 34 01 00 20 mvi r1,32
}
int
rtems_rfs_file_set_size (rtems_rfs_file_handle* handle,
rtems_rfs_pos new_size)
{
801ced8: b8 60 70 00 mv r14,r3
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))
801cedc: fb ff cf 93 calli 8010d28 <rtems_rfs_trace>
801cee0: 44 20 00 06 be r1,r0,801cef8 <rtems_rfs_file_set_size+0x6c><== ALWAYS TAKEN
printf ("rtems-rfs: file-set-size: size=%" PRIu64 "\n", new_size);
801cee4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801cee8: 38 21 8b 9c ori r1,r1,0x8b9c <== NOT EXECUTED
801ceec: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
801cef0: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
801cef4: f8 00 15 e0 calli 8022674 <printf> <== NOT EXECUTED
size = rtems_rfs_file_size (handle);
801cef8: 29 62 00 1c lw r2,(r11+28)
801cefc: 28 41 00 98 lw r1,(r2+152)
801cf00: 34 42 00 84 addi r2,r2,132
801cf04: fb ff f1 fd calli 80196f8 <rtems_rfs_block_get_size>
801cf08: b8 40 80 00 mv r16,r2
/*
* 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)
801cf0c: 5c 2f 00 03 bne r1,r15,801cf18 <rtems_rfs_file_set_size+0x8c><== NEVER TAKEN
if (rtems_rfs_file_update_mtime (handle))
handle->shared->mtime = time (NULL);
}
return 0;
801cf10: 34 0c 00 00 mvi r12,0
/*
* 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)
801cf14: 44 4e 00 97 be r2,r14,801d170 <rtems_rfs_file_set_size+0x2e4>
{
/*
* Short cut for the common truncate on open call.
*/
if (new_size == 0)
801cf18: b9 ee 88 00 or r17,r15,r14
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);
801cf1c: 35 b2 00 34 addi r18,r13,52
if (size != new_size)
{
/*
* Short cut for the common truncate on open call.
*/
if (new_size == 0)
801cf20: 5e 20 00 08 bne r17,r0,801cf40 <rtems_rfs_file_set_size+0xb4>
{
rc = rtems_rfs_block_map_free_all (rtems_rfs_file_fs (handle), map);
801cf24: 29 61 00 1c lw r1,(r11+28)
801cf28: ba 40 10 00 mv r2,r18
801cf2c: 28 21 00 98 lw r1,(r1+152)
801cf30: fb ff f5 ec calli 801a6e0 <rtems_rfs_block_map_free_all>
801cf34: b8 20 60 00 mv r12,r1
if (rc > 0)
801cf38: 48 31 00 8e bg r1,r17,801d170 <rtems_rfs_file_set_size+0x2e4><== NEVER TAKEN
801cf3c: e0 00 00 82 bi 801d144 <rtems_rfs_file_set_size+0x2b8>
return rc;
}
else
{
if (size < new_size)
801cf40: 55 e1 00 04 bgu r15,r1,801cf50 <rtems_rfs_file_set_size+0xc4><== NEVER TAKEN
801cf44: 5d e1 00 54 bne r15,r1,801d094 <rtems_rfs_file_set_size+0x208><== NEVER TAKEN
801cf48: 55 d0 00 02 bgu r14,r16,801cf50 <rtems_rfs_file_set_size+0xc4>
801cf4c: e0 00 00 52 bi 801d094 <rtems_rfs_file_set_size+0x208>
*/
rtems_rfs_pos count;
uint32_t length;
bool read_block;
count = new_size - size;
801cf50: c9 e1 78 00 sub r15,r15,r1
length = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
801cf54: 29 61 00 1c lw r1,(r11+28)
*/
rtems_rfs_pos count;
uint32_t length;
bool read_block;
count = new_size - size;
801cf58: c9 d0 80 00 sub r16,r14,r16
801cf5c: f6 0e 70 00 cmpgu r14,r16,r14
length = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
801cf60: 28 21 00 98 lw r1,(r1+152)
*/
rtems_rfs_pos count;
uint32_t length;
bool read_block;
count = new_size - size;
801cf64: c9 ee 70 00 sub r14,r15,r14
length = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
read_block = false;
801cf68: 34 14 00 00 mvi r20,0
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));
801cf6c: 28 31 00 08 lw r17,(r1+8)
* 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);
rc = rtems_rfs_block_map_find (rtems_rfs_file_fs (handle),
801cf70: 37 96 00 38 addi r22,sp,56
if (rc > 0)
{
/*
* Have we reached the EOF ?
*/
if (rc != ENXIO)
801cf74: 34 15 00 06 mvi r21,6
801cf78: 34 0f 00 01 mvi r15,1
}
/*
* Only read the block if the length is not the block size.
*/
rc = rtems_rfs_buffer_handle_request (rtems_rfs_file_fs (handle),
801cf7c: 35 73 00 04 addi r19,r11,4
count = new_size - size;
length = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
read_block = false;
while (count)
801cf80: e0 00 00 42 bi 801d088 <rtems_rfs_file_set_size+0x1fc>
/*
* 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);
801cf84: 29 a1 00 3c lw r1,(r13+60)
801cf88: 29 a2 00 40 lw r2,(r13+64)
801cf8c: 5b 80 00 40 sw (sp+64),r0
801cf90: 5b 81 00 38 sw (sp+56),r1
801cf94: 5b 82 00 3c sw (sp+60),r2
801cf98: 44 40 00 03 be r2,r0,801cfa4 <rtems_rfs_file_set_size+0x118>
801cf9c: 34 21 ff ff addi r1,r1,-1
801cfa0: 5b 81 00 38 sw (sp+56),r1
rc = rtems_rfs_block_map_find (rtems_rfs_file_fs (handle),
801cfa4: 29 61 00 1c lw r1,(r11+28)
801cfa8: ba 40 10 00 mv r2,r18
801cfac: ba c0 18 00 mv r3,r22
801cfb0: 28 21 00 98 lw r1,(r1+152)
801cfb4: 37 84 00 44 addi r4,sp,68
801cfb8: fb ff f3 0d calli 8019bec <rtems_rfs_block_map_find>
801cfbc: b8 20 60 00 mv r12,r1
map, &bpos, &block);
if (rc > 0)
801cfc0: 4c 01 00 0a bge r0,r1,801cfe8 <rtems_rfs_file_set_size+0x15c>
{
/*
* Have we reached the EOF ?
*/
if (rc != ENXIO)
801cfc4: 5c 35 00 6b bne r1,r21,801d170 <rtems_rfs_file_set_size+0x2e4><== NEVER TAKEN
return rc;
rc = rtems_rfs_block_map_grow (rtems_rfs_file_fs (handle),
801cfc8: 29 61 00 1c lw r1,(r11+28)
801cfcc: ba 40 10 00 mv r2,r18
801cfd0: 34 03 00 01 mvi r3,1
801cfd4: 28 21 00 98 lw r1,(r1+152)
801cfd8: 37 84 00 44 addi r4,sp,68
801cfdc: fb ff f3 b5 calli 8019eb0 <rtems_rfs_block_map_grow>
801cfe0: b8 20 60 00 mv r12,r1
map, 1, &block);
if (rc > 0)
801cfe4: 48 20 00 63 bg r1,r0,801d170 <rtems_rfs_file_set_size+0x2e4><== NEVER TAKEN
return rc;
}
if (count < (length - bpos.boff))
801cfe8: 2b 81 00 3c lw r1,(sp+60)
801cfec: ca 21 10 00 sub r2,r17,r1
801cff0: 5c 0e 00 08 bne r0,r14,801d010 <rtems_rfs_file_set_size+0x184><== NEVER TAKEN
801cff4: 54 50 00 02 bgu r2,r16,801cffc <rtems_rfs_file_set_size+0x170>
801cff8: e0 00 00 06 bi 801d010 <rtems_rfs_file_set_size+0x184>
{
length = count + bpos.boff;
801cffc: b4 30 88 00 add r17,r1,r16
*/
static inline void
rtems_rfs_block_map_set_size_offset (rtems_rfs_block_map* map,
rtems_rfs_block_off offset)
{
map->size.offset = offset;
801d000: 59 b1 00 40 sw (r13+64),r17
map->dirty = true;
801d004: 31 af 00 34 sb (r13+52),r15
read_block = true;
801d008: 34 14 00 01 mvi r20,1
801d00c: e0 00 00 03 bi 801d018 <rtems_rfs_file_set_size+0x18c>
*/
static inline void
rtems_rfs_block_map_set_size_offset (rtems_rfs_block_map* map,
rtems_rfs_block_off offset)
{
map->size.offset = offset;
801d010: 59 a0 00 40 sw (r13+64),r0
map->dirty = true;
801d014: 31 af 00 34 sb (r13+52),r15
}
/*
* Only read the block if the length is not the block size.
*/
rc = rtems_rfs_buffer_handle_request (rtems_rfs_file_fs (handle),
801d018: 29 61 00 1c lw r1,(r11+28)
801d01c: 2b 83 00 44 lw r3,(sp+68)
801d020: ba 60 10 00 mv r2,r19
801d024: 28 21 00 98 lw r1,(r1+152)
801d028: ba 80 20 00 mv r4,r20
801d02c: fb ff f6 97 calli 801aa88 <rtems_rfs_buffer_handle_request>
801d030: b8 20 60 00 mv r12,r1
rtems_rfs_file_buffer (handle),
block, read_block);
if (rc > 0)
801d034: 48 20 00 4f bg r1,r0,801d170 <rtems_rfs_file_set_size+0x2e4><== NEVER TAKEN
return rc;
dst = rtems_rfs_buffer_data (&handle->buffer);
801d038: 29 61 00 0c lw r1,(r11+12)
memset (dst + bpos.boff, 0, length - bpos.boff);
801d03c: 2b 84 00 3c lw r4,(sp+60)
801d040: 34 02 00 00 mvi r2,0
801d044: 28 21 00 1c lw r1,(r1+28)
801d048: ca 24 18 00 sub r3,r17,r4
801d04c: b4 24 08 00 add r1,r1,r4
801d050: f8 00 14 ed calli 8022404 <memset>
rtems_rfs_buffer_mark_dirty (rtems_rfs_file_buffer (handle));
rc = rtems_rfs_buffer_handle_release (rtems_rfs_file_fs (handle),
801d054: 29 61 00 1c lw r1,(r11+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));
801d058: 31 6f 00 04 sb (r11+4),r15
rc = rtems_rfs_buffer_handle_release (rtems_rfs_file_fs (handle),
801d05c: ba 60 10 00 mv r2,r19
801d060: 28 21 00 98 lw r1,(r1+152)
801d064: fb ff f6 1a calli 801a8cc <rtems_rfs_buffer_handle_release>
801d068: b8 20 60 00 mv r12,r1
rtems_rfs_file_buffer (handle));
if (rc > 0)
801d06c: 48 20 00 41 bg r1,r0,801d170 <rtems_rfs_file_set_size+0x2e4><== NEVER TAKEN
return rc;
count -= length - bpos.boff;
801d070: 2b 81 00 3c lw r1,(sp+60)
801d074: ca 21 08 00 sub r1,r17,r1
801d078: ca 01 08 00 sub r1,r16,r1
801d07c: f4 30 80 00 cmpgu r16,r1,r16
801d080: c9 d0 70 00 sub r14,r14,r16
801d084: b8 20 80 00 mv r16,r1
count = new_size - size;
length = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
read_block = false;
while (count)
801d088: b9 d0 08 00 or r1,r14,r16
801d08c: 5c 20 ff be bne r1,r0,801cf84 <rtems_rfs_file_set_size+0xf8>
801d090: e0 00 00 2d bi 801d144 <rtems_rfs_file_set_size+0x2b8>
uint32_t offset;
blocks =
rtems_rfs_block_map_count (map) -
(((new_size - 1) /
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle))) + 1);
801d094: 29 6c 00 1c lw r12,(r11+28)
rtems_rfs_block_no blocks;
uint32_t offset;
blocks =
rtems_rfs_block_map_count (map) -
(((new_size - 1) /
801d098: 35 c2 ff ff addi r2,r14,-1
801d09c: f5 c2 18 00 cmpgu r3,r14,r2
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle))) + 1);
801d0a0: 29 91 00 98 lw r17,(r12+152)
rtems_rfs_block_no blocks;
uint32_t offset;
blocks =
rtems_rfs_block_map_count (map) -
(((new_size - 1) /
801d0a4: 35 e1 ff ff addi r1,r15,-1
801d0a8: b4 61 08 00 add r1,r3,r1
801d0ac: 2a 30 00 08 lw r16,(r17+8)
801d0b0: 34 03 00 00 mvi r3,0
801d0b4: ba 00 20 00 mv r4,r16
801d0b8: f8 00 4b 5d calli 802fe2c <__udivdi3>
* Shrink
*/
rtems_rfs_block_no blocks;
uint32_t offset;
blocks =
801d0bc: 29 a3 00 3c lw r3,(r13+60)
801d0c0: a4 40 10 00 not r2,r2
801d0c4: b4 43 18 00 add r3,r2,r3
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)
801d0c8: 44 60 00 06 be r3,r0,801d0e0 <rtems_rfs_file_set_size+0x254>
{
int rc;
rc = rtems_rfs_block_map_shrink (rtems_rfs_file_fs (handle),
801d0cc: 35 82 00 34 addi r2,r12,52
801d0d0: ba 20 08 00 mv r1,r17
801d0d4: fb ff f4 93 calli 801a320 <rtems_rfs_block_map_shrink>
801d0d8: b8 20 60 00 mv r12,r1
rtems_rfs_file_map (handle),
blocks);
if (rc > 0)
801d0dc: 48 20 00 25 bg r1,r0,801d170 <rtems_rfs_file_set_size+0x2e4><== NEVER TAKEN
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));
801d0e0: b9 e0 08 00 mv r1,r15
801d0e4: b9 c0 10 00 mv r2,r14
801d0e8: 34 03 00 00 mvi r3,0
801d0ec: ba 00 20 00 mv r4,r16
801d0f0: f8 00 4d 3d calli 80305e4 <__umoddi3>
801d0f4: 34 01 00 01 mvi r1,1
801d0f8: 31 a1 00 34 sb (r13+52),r1
return rc;
}
rtems_rfs_block_map_set_size_offset (map, offset);
if (rtems_rfs_block_pos_past_end (rtems_rfs_file_bpos (handle),
801d0fc: 29 61 00 10 lw r1,(r11+16)
*/
static inline void
rtems_rfs_block_map_set_size_offset (rtems_rfs_block_map* map,
rtems_rfs_block_off offset)
{
map->size.offset = offset;
801d100: 59 a2 00 40 sw (r13+64),r2
801d104: 44 20 00 03 be r1,r0,801d110 <rtems_rfs_file_set_size+0x284>
801d108: 29 a3 00 3c lw r3,(r13+60)
801d10c: 44 60 00 07 be r3,r0,801d128 <rtems_rfs_file_set_size+0x29c><== NEVER TAKEN
801d110: 29 a3 00 3c lw r3,(r13+60)
801d114: 50 23 00 05 bgeu r1,r3,801d128 <rtems_rfs_file_set_size+0x29c><== NEVER TAKEN
801d118: 34 63 ff ff addi r3,r3,-1
801d11c: 5c 23 00 0a bne r1,r3,801d144 <rtems_rfs_file_set_size+0x2b8><== NEVER TAKEN
801d120: 29 61 00 14 lw r1,(r11+20)
801d124: 50 41 00 08 bgeu r2,r1,801d144 <rtems_rfs_file_set_size+0x2b8>
rtems_rfs_block_map_size (map)))
rtems_rfs_block_size_get_bpos (rtems_rfs_block_map_size (map),
801d128: 29 a1 00 3c lw r1,(r13+60)
801d12c: 59 62 00 14 sw (r11+20),r2
801d130: 59 60 00 18 sw (r11+24),r0
801d134: 59 61 00 10 sw (r11+16),r1
801d138: 44 40 00 03 be r2,r0,801d144 <rtems_rfs_file_set_size+0x2b8><== NEVER TAKEN
801d13c: 34 21 ff ff addi r1,r1,-1
801d140: 59 61 00 10 sw (r11+16),r1
rtems_rfs_file_bpos (handle));
}
}
handle->shared->size.count = rtems_rfs_block_map_count (map);
801d144: 29 6e 00 1c lw r14,(r11+28)
801d148: 29 a1 00 3c lw r1,(r13+60)
if (rtems_rfs_file_update_mtime (handle))
handle->shared->mtime = time (NULL);
}
return 0;
801d14c: 34 0c 00 00 mvi r12,0
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);
801d150: 59 c1 00 84 sw (r14+132),r1
handle->shared->size.offset = rtems_rfs_block_map_size_offset (map);
801d154: 29 a1 00 40 lw r1,(r13+64)
801d158: 59 c1 00 88 sw (r14+136),r1
if (rtems_rfs_file_update_mtime (handle))
801d15c: 29 61 00 00 lw r1,(r11+0)
801d160: 20 21 00 02 andi r1,r1,0x2
801d164: 5c 20 00 03 bne r1,r0,801d170 <rtems_rfs_file_set_size+0x2e4><== NEVER TAKEN
handle->shared->mtime = time (NULL);
801d168: f8 00 24 ff calli 8026564 <time>
801d16c: 59 c1 00 90 sw (r14+144),r1
}
return 0;
}
801d170: b9 80 08 00 mv r1,r12
801d174: 2b 9d 00 04 lw ra,(sp+4)
801d178: 2b 8b 00 34 lw r11,(sp+52)
801d17c: 2b 8c 00 30 lw r12,(sp+48)
801d180: 2b 8d 00 2c lw r13,(sp+44)
801d184: 2b 8e 00 28 lw r14,(sp+40)
801d188: 2b 8f 00 24 lw r15,(sp+36)
801d18c: 2b 90 00 20 lw r16,(sp+32)
801d190: 2b 91 00 1c lw r17,(sp+28)
801d194: 2b 92 00 18 lw r18,(sp+24)
801d198: 2b 93 00 14 lw r19,(sp+20)
801d19c: 2b 94 00 10 lw r20,(sp+16)
801d1a0: 2b 95 00 0c lw r21,(sp+12)
801d1a4: 2b 96 00 08 lw r22,(sp+8)
801d1a8: 37 9c 00 44 addi sp,sp,68
801d1ac: c3 a0 00 00 ret
0800d770 <rtems_rfs_format>:
return rc;
}
int
rtems_rfs_format (const char* name, const rtems_rfs_format_config* config)
{
800d770: 37 9c fe e0 addi sp,sp,-288
800d774: 5b 8b 00 44 sw (sp+68),r11
800d778: 5b 8c 00 40 sw (sp+64),r12
800d77c: 5b 8d 00 3c sw (sp+60),r13
800d780: 5b 8e 00 38 sw (sp+56),r14
800d784: 5b 8f 00 34 sw (sp+52),r15
800d788: 5b 90 00 30 sw (sp+48),r16
800d78c: 5b 91 00 2c sw (sp+44),r17
800d790: 5b 92 00 28 sw (sp+40),r18
800d794: 5b 93 00 24 sw (sp+36),r19
800d798: 5b 94 00 20 sw (sp+32),r20
800d79c: 5b 95 00 1c sw (sp+28),r21
800d7a0: 5b 96 00 18 sw (sp+24),r22
800d7a4: 5b 97 00 14 sw (sp+20),r23
800d7a8: 5b 98 00 10 sw (sp+16),r24
800d7ac: 5b 99 00 0c sw (sp+12),r25
800d7b0: 5b 9b 00 08 sw (sp+8),fp
800d7b4: 5b 9d 00 04 sw (sp+4),ra
800d7b8: b8 20 a0 00 mv r20,r1
rtems_rfs_file_system fs;
int group;
int rc;
if (config->verbose)
800d7bc: 40 41 00 15 lbu r1,(r2+21)
return rc;
}
int
rtems_rfs_format (const char* name, const rtems_rfs_format_config* config)
{
800d7c0: b8 40 60 00 mv r12,r2
rtems_rfs_file_system fs;
int group;
int rc;
if (config->verbose)
800d7c4: 44 20 00 05 be r1,r0,800d7d8 <rtems_rfs_format+0x68> <== ALWAYS TAKEN
printf ("rtems-rfs: format: %s\n", name);
800d7c8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800d7cc: 38 21 63 d4 ori r1,r1,0x63d4 <== NOT EXECUTED
800d7d0: ba 80 10 00 mv r2,r20 <== NOT EXECUTED
800d7d4: f8 00 53 a8 calli 8022674 <printf> <== NOT EXECUTED
memset (&fs, 0, sizeof (rtems_rfs_file_system));
800d7d8: 37 8d 00 4c addi r13,sp,76
800d7dc: 34 02 00 00 mvi r2,0
800d7e0: 34 03 00 84 mvi r3,132
800d7e4: b9 a0 08 00 mv r1,r13
800d7e8: f8 00 53 07 calli 8022404 <memset>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
800d7ec: 37 81 00 94 addi r1,sp,148
800d7f0: 5b 81 00 90 sw (sp+144),r1
head->previous = NULL;
tail->previous = head;
800d7f4: 37 81 00 90 addi r1,sp,144
800d7f8: 5b 81 00 98 sw (sp+152),r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
800d7fc: 37 81 00 a4 addi r1,sp,164
800d800: 5b 81 00 a0 sw (sp+160),r1
head->previous = NULL;
tail->previous = head;
800d804: 37 81 00 a0 addi r1,sp,160
800d808: 5b 81 00 a8 sw (sp+168),r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
800d80c: 37 81 00 b4 addi r1,sp,180
800d810: 5b 81 00 b0 sw (sp+176),r1
head->previous = NULL;
tail->previous = head;
800d814: 37 81 00 b0 addi r1,sp,176
800d818: 5b 81 00 b8 sw (sp+184),r1
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
800d81c: 37 81 00 c4 addi r1,sp,196
800d820: 5b 81 00 c0 sw (sp+192),r1
head->previous = NULL;
tail->previous = head;
800d824: 37 81 00 c0 addi r1,sp,192
800d828: 5b 81 00 c8 sw (sp+200),r1
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;
800d82c: 34 01 00 05 mvi r1,5
800d830: 5b 81 00 8c sw (sp+140),r1
fs.release_count = 0;
fs.release_modified_count = 0;
fs.flags = RTEMS_RFS_FS_NO_LOCAL_CACHE;
800d834: 34 01 00 02 mvi r1,2
800d838: 5b 81 00 4c sw (sp+76),r1
/*
* Open the buffer interface.
*/
rc = rtems_rfs_buffer_open (name, &fs);
800d83c: b9 a0 10 00 mv r2,r13
800d840: ba 80 08 00 mv r1,r20
800d844: f8 00 35 2b calli 801acf0 <rtems_rfs_buffer_open>
800d848: b8 20 58 00 mv r11,r1
if (rc > 0)
800d84c: 4c 01 00 06 bge r0,r1,800d864 <rtems_rfs_format+0xf4> <== ALWAYS TAKEN
{
printf ("rtems-rfs: format: buffer open failed: %d: %s\n",
800d850: f8 00 58 44 calli 8023960 <strerror> <== NOT EXECUTED
800d854: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800d858: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800d85c: 38 21 63 ec ori r1,r1,0x63ec <== NOT EXECUTED
800d860: e0 00 02 f5 bi 800e434 <rtems_rfs_format+0xcc4> <== NOT EXECUTED
}
/*
* Check the media.
*/
if (rtems_rfs_fs_media_block_size (&fs) == 0)
800d864: 2b 81 00 5c lw r1,(sp+92)
800d868: 28 21 00 20 lw r1,(r1+32)
800d86c: 5c 20 00 05 bne r1,r0,800d880 <rtems_rfs_format+0x110> <== ALWAYS TAKEN
{
printf ("rtems-rfs: media block is invalid: %" PRIu32 "\n",
800d870: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800d874: 38 21 64 1c ori r1,r1,0x641c <== NOT EXECUTED
800d878: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
800d87c: e0 00 01 9a bi 800dee4 <rtems_rfs_format+0x774> <== NOT EXECUTED
static bool
rtems_rfs_check_config (rtems_rfs_file_system* fs,
const rtems_rfs_format_config* config)
{
fs->block_size = config->block_size;
800d880: 29 8b 00 00 lw r11,(r12+0)
800d884: 5b 8b 00 54 sw (sp+84),r11
if (!fs->block_size)
800d888: 5d 60 00 26 bne r11,r0,800d920 <rtems_rfs_format+0x1b0>
{
uint64_t total_size = rtems_rfs_fs_media_size (fs);
800d88c: b9 a0 08 00 mv r1,r13
800d890: f8 00 3f 34 calli 801d560 <rtems_rfs_fs_media_size>
800d894: b8 40 18 00 mv r3,r2
if (total_size >= GIGS (1))
800d898: 5c 2b 00 06 bne r1,r11,800d8b0 <rtems_rfs_format+0x140> <== NEVER TAKEN
800d89c: 78 04 08 03 mvhi r4,0x803
800d8a0: 38 84 6b f0 ori r4,r4,0x6bf0
800d8a4: 28 82 00 00 lw r2,(r4+0)
800d8a8: 54 62 00 02 bgu r3,r2,800d8b0 <rtems_rfs_format+0x140> <== NEVER TAKEN
800d8ac: e0 00 00 14 bi 800d8fc <rtems_rfs_format+0x18c>
{
uint32_t gigs = (total_size + GIGS (1)) / GIGS (1);
800d8b0: 78 02 00 10 mvhi r2,0x10 <== NOT EXECUTED
800d8b4: b4 62 10 00 add r2,r3,r2 <== NOT EXECUTED
800d8b8: f4 62 18 00 cmpgu r3,r3,r2 <== NOT EXECUTED
int b;
for (b = 31; b > 0; b--)
800d8bc: 34 0b 00 1f mvi r11,31 <== NOT EXECUTED
{
uint64_t total_size = rtems_rfs_fs_media_size (fs);
if (total_size >= GIGS (1))
{
uint32_t gigs = (total_size + GIGS (1)) / GIGS (1);
800d8c0: b4 61 08 00 add r1,r3,r1 <== NOT EXECUTED
800d8c4: 34 03 00 14 mvi r3,20 <== NOT EXECUTED
800d8c8: f8 00 85 08 calli 802ece8 <__lshrdi3> <== NOT EXECUTED
800d8cc: b8 40 68 00 mv r13,r2 <== NOT EXECUTED
int b;
for (b = 31; b > 0; b--)
if ((gigs & (1 << b)) != 0)
800d8d0: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
800d8d4: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800d8d8: fb ff cf 02 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
800d8dc: a0 2d 08 00 and r1,r1,r13 <== NOT EXECUTED
800d8e0: 5c 20 00 03 bne r1,r0,800d8ec <rtems_rfs_format+0x17c> <== NOT EXECUTED
if (total_size >= GIGS (1))
{
uint32_t gigs = (total_size + GIGS (1)) / GIGS (1);
int b;
for (b = 31; b > 0; b--)
800d8e4: 35 6b ff ff addi r11,r11,-1 <== NOT EXECUTED
800d8e8: 5d 61 ff fa bne r11,r1,800d8d0 <rtems_rfs_format+0x160> <== NOT EXECUTED
if ((gigs & (1 << b)) != 0)
break;
fs->block_size = 1 << b;
800d8ec: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
800d8f0: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800d8f4: fb ff ce fb calli 80014e0 <__ashlsi3> <== NOT EXECUTED
800d8f8: 5b 81 00 54 sw (sp+84),r1 <== NOT EXECUTED
}
if (fs->block_size < 512)
800d8fc: 2b 82 00 54 lw r2,(sp+84)
800d900: 34 01 01 ff mvi r1,511
800d904: 54 41 00 03 bgu r2,r1,800d910 <rtems_rfs_format+0x1a0> <== NEVER TAKEN
fs->block_size = 512;
800d908: 34 01 02 00 mvi r1,512
800d90c: 5b 81 00 54 sw (sp+84),r1
if (fs->block_size > (4 * 1024))
800d910: 2b 82 00 54 lw r2,(sp+84)
800d914: 34 01 10 00 mvi r1,4096
800d918: 50 22 00 02 bgeu r1,r2,800d920 <rtems_rfs_format+0x1b0> <== ALWAYS TAKEN
fs->block_size = (4 * 1024);
800d91c: 5b 81 00 54 sw (sp+84),r1 <== NOT EXECUTED
}
if ((fs->block_size % rtems_rfs_fs_media_block_size (fs)) != 0)
800d920: 2b 81 00 5c lw r1,(sp+92)
800d924: 2b 8b 00 54 lw r11,(sp+84)
800d928: 28 2d 00 20 lw r13,(r1+32)
800d92c: b9 60 08 00 mv r1,r11
800d930: b9 a0 10 00 mv r2,r13
800d934: f8 00 9a 74 calli 8034304 <__umodsi3>
800d938: 44 20 00 06 be r1,r0,800d950 <rtems_rfs_format+0x1e0> <== ALWAYS TAKEN
{
printf ("block size (%zd) is not a multiple of media block size (%" PRId32 ")\n",
800d93c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800d940: 38 21 64 44 ori r1,r1,0x6444 <== NOT EXECUTED
800d944: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800d948: b9 a0 18 00 mv r3,r13 <== NOT EXECUTED
800d94c: e0 00 02 bb bi 800e438 <rtems_rfs_format+0xcc8> <== NOT EXECUTED
fs->block_size, rtems_rfs_fs_media_block_size (fs));
return false;
}
fs->group_blocks = config->group_blocks;
800d950: 29 82 00 04 lw r2,(r12+4)
800d954: 5b 82 00 74 sw (sp+116),r2
if (!fs->group_blocks)
800d958: 5c 41 00 05 bne r2,r1,800d96c <rtems_rfs_format+0x1fc> <== NEVER TAKEN
{
/*
* 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);
800d95c: b9 60 08 00 mv r1,r11
800d960: 34 02 00 03 mvi r2,3
800d964: fb ff ce df calli 80014e0 <__ashlsi3>
800d968: 5b 81 00 74 sw (sp+116),r1
}
if (fs->group_blocks > rtems_rfs_bitmap_numof_bits (fs->block_size))
800d96c: 34 02 00 03 mvi r2,3
800d970: b9 60 08 00 mv r1,r11
800d974: fb ff ce db calli 80014e0 <__ashlsi3>
800d978: 2b 82 00 74 lw r2,(sp+116)
800d97c: 50 22 00 04 bgeu r1,r2,800d98c <rtems_rfs_format+0x21c> <== ALWAYS TAKEN
{
printf ("group block count is higher than bits in block\n");
800d980: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800d984: 38 21 64 84 ori r1,r1,0x6484 <== NOT EXECUTED
800d988: e0 00 01 48 bi 800dea8 <rtems_rfs_format+0x738> <== NOT EXECUTED
return false;
}
fs->blocks = rtems_rfs_fs_media_size (fs) / fs->block_size;
800d98c: 37 81 00 4c addi r1,sp,76
800d990: f8 00 3e f4 calli 801d560 <rtems_rfs_fs_media_size>
800d994: 2b 8b 00 54 lw r11,(sp+84)
800d998: 34 03 00 00 mvi r3,0
800d99c: b9 60 20 00 mv r4,r11
800d9a0: f8 00 89 23 calli 802fe2c <__udivdi3>
800d9a4: b8 40 70 00 mv r14,r2
800d9a8: 5b 82 00 50 sw (sp+80),r2
* 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));
800d9ac: b9 60 08 00 mv r1,r11
800d9b0: 34 02 00 03 mvi r2,3
800d9b4: fb ff ce cb calli 80014e0 <__ashlsi3>
800d9b8: b8 20 68 00 mv r13,r1
/*
* 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),
800d9bc: b9 a0 10 00 mv r2,r13
800d9c0: b9 c0 08 00 mv r1,r14
800d9c4: fb ff ff 41 calli 800d6c8 <rtems_rfs_rup_quotient>
rtems_rfs_bits_per_block (fs));
fs->group_inodes = config->group_inodes;
800d9c8: 29 84 00 08 lw r4,(r12+8)
/*
* 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),
800d9cc: 5b 81 00 70 sw (sp+112),r1
800d9d0: b8 20 78 00 mv r15,r1
rtems_rfs_bits_per_block (fs));
fs->group_inodes = config->group_inodes;
800d9d4: 5b 84 00 78 sw (sp+120),r4
if (!fs->group_inodes)
800d9d8: 5c 80 00 13 bne r4,r0,800da24 <rtems_rfs_format+0x2b4> <== NEVER TAKEN
int inode_overhead = RTEMS_RFS_INODE_OVERHEAD_PERCENTAGE;
/*
* The number of inodes per group is set as a percentage.
*/
if (config->inode_overhead)
800d9dc: 29 83 00 0c lw r3,(r12+12)
800d9e0: 5c 64 00 02 bne r3,r4,800d9e8 <rtems_rfs_format+0x278> <== NEVER TAKEN
rtems_rfs_bits_per_block (fs));
fs->group_inodes = config->group_inodes;
if (!fs->group_inodes)
{
int inode_overhead = RTEMS_RFS_INODE_OVERHEAD_PERCENTAGE;
800d9e4: 34 03 00 01 mvi r3,1
rtems_rfs_inodes_from_percent (rtems_rfs_file_system* fs,
int percentage)
{
int blocks;
blocks = ((rtems_rfs_fs_blocks (fs) -
RTEMS_RFS_SUPERBLOCK_SIZE) * percentage) / 100;
800d9e8: b8 60 08 00 mv r1,r3
800d9ec: 35 c2 ff ff addi r2,r14,-1
800d9f0: fb ff cf 0a calli 8001618 <__mulsi3>
800d9f4: 34 02 00 64 mvi r2,100
800d9f8: fb ff cf 14 calli 8001648 <__udivsi3>
blocks = rtems_rfs_rup_quotient (blocks, fs->group_count);
800d9fc: b9 e0 10 00 mv r2,r15
800da00: fb ff ff 32 calli 800d6c8 <rtems_rfs_rup_quotient>
800da04: b8 20 70 00 mv r14,r1
return blocks * (rtems_rfs_fs_block_size (fs) / RTEMS_RFS_INODE_SIZE);
800da08: 34 02 00 38 mvi r2,56
800da0c: b9 60 08 00 mv r1,r11
800da10: fb ff cf 0e calli 8001648 <__udivsi3>
800da14: b8 20 10 00 mv r2,r1
800da18: b9 c0 08 00 mv r1,r14
800da1c: fb ff ce ff calli 8001618 <__mulsi3>
* The number of inodes per group is set as a percentage.
*/
if (config->inode_overhead)
inode_overhead = config->inode_overhead;
fs->group_inodes = rtems_rfs_inodes_from_percent (fs, inode_overhead);
800da20: 5b 81 00 78 sw (sp+120),r1
}
/*
* 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;
800da24: b9 60 08 00 mv r1,r11
800da28: 34 02 00 38 mvi r2,56
800da2c: fb ff cf 07 calli 8001648 <__udivsi3>
800da30: b8 20 58 00 mv r11,r1
800da34: 5b 81 00 7c sw (sp+124),r1
fs->group_inodes =
rtems_rfs_rup_quotient (fs->group_inodes,
800da38: 2b 81 00 78 lw r1,(sp+120)
800da3c: b9 60 10 00 mv r2,r11
800da40: fb ff ff 22 calli 800d6c8 <rtems_rfs_rup_quotient>
fs->inodes_per_block) * fs->inodes_per_block;
800da44: b9 60 10 00 mv r2,r11
800da48: fb ff ce f4 calli 8001618 <__mulsi3>
/*
* 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 =
800da4c: 5b 81 00 78 sw (sp+120),r1
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))
800da50: 51 a1 00 02 bgeu r13,r1,800da58 <rtems_rfs_format+0x2e8> <== ALWAYS TAKEN
fs->group_inodes = rtems_rfs_bitmap_numof_bits (fs->block_size);
800da54: 5b 8d 00 78 sw (sp+120),r13 <== NOT EXECUTED
fs->max_name_length = config->max_name_length;
800da58: 29 81 00 10 lw r1,(r12+16)
800da5c: 5b 81 00 68 sw (sp+104),r1
if (!fs->max_name_length)
800da60: 5c 20 02 8c bne r1,r0,800e490 <rtems_rfs_format+0xd20> <== NEVER TAKEN
{
fs->max_name_length = 512;
800da64: 34 01 02 00 mvi r1,512
800da68: 5b 81 00 68 sw (sp+104),r1
800da6c: e0 00 02 89 bi 800e490 <rtems_rfs_format+0xd20>
if (!rtems_rfs_check_config (&fs, config))
return -1;
if (config->verbose)
{
printf ("rtems-rfs: format: media size = %" PRIu64 "\n",
800da70: 37 8b 00 4c addi r11,sp,76 <== NOT EXECUTED
800da74: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800da78: f8 00 3e ba calli 801d560 <rtems_rfs_fs_media_size> <== NOT EXECUTED
800da7c: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
800da80: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800da84: b8 40 18 00 mv r3,r2 <== NOT EXECUTED
800da88: 38 21 64 b4 ori r1,r1,0x64b4 <== NOT EXECUTED
800da8c: b8 80 10 00 mv r2,r4 <== NOT EXECUTED
800da90: f8 00 52 f9 calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_fs_media_size (&fs));
printf ("rtems-rfs: format: media blocks = %" PRIu32 "\n",
800da94: 2b 82 00 5c lw r2,(sp+92) <== NOT EXECUTED
800da98: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800da9c: 38 21 64 dc ori r1,r1,0x64dc <== NOT EXECUTED
800daa0: 28 42 00 1c lw r2,(r2+28) <== NOT EXECUTED
rtems_rfs_fs_size (&fs));
printf ("rtems-rfs: format: blocks = %zu\n",
rtems_rfs_fs_blocks (&fs));
printf ("rtems-rfs: format: block size = %zu\n",
rtems_rfs_fs_block_size (&fs));
printf ("rtems-rfs: format: bits per block = %u\n",
800daa4: 78 0d 08 03 mvhi r13,0x803 <== NOT EXECUTED
800daa8: 39 ad 65 9c ori r13,r13,0x659c <== NOT EXECUTED
if (config->verbose)
{
printf ("rtems-rfs: format: media size = %" PRIu64 "\n",
rtems_rfs_fs_media_size (&fs));
printf ("rtems-rfs: format: media blocks = %" PRIu32 "\n",
800daac: f8 00 52 f2 calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_fs_media_blocks (&fs));
printf ("rtems-rfs: format: media block size = %" PRIu32 "\n",
800dab0: 2b 82 00 5c lw r2,(sp+92) <== NOT EXECUTED
800dab4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800dab8: 38 21 65 04 ori r1,r1,0x6504 <== NOT EXECUTED
800dabc: 28 42 00 20 lw r2,(r2+32) <== NOT EXECUTED
800dac0: f8 00 52 ed calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_fs_media_block_size (&fs));
printf ("rtems-rfs: format: size = %" PRIu64 "\n",
800dac4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800dac8: f8 00 3e 9b calli 801d534 <rtems_rfs_fs_size> <== NOT EXECUTED
800dacc: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
800dad0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800dad4: b8 40 18 00 mv r3,r2 <== NOT EXECUTED
800dad8: 38 21 65 30 ori r1,r1,0x6530 <== NOT EXECUTED
800dadc: b8 80 10 00 mv r2,r4 <== NOT EXECUTED
800dae0: f8 00 52 e5 calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_fs_size (&fs));
printf ("rtems-rfs: format: blocks = %zu\n",
800dae4: 2b 82 00 50 lw r2,(sp+80) <== NOT EXECUTED
800dae8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800daec: 38 21 65 50 ori r1,r1,0x6550 <== NOT EXECUTED
800daf0: f8 00 52 e1 calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_fs_blocks (&fs));
printf ("rtems-rfs: format: block size = %zu\n",
800daf4: 2b 82 00 54 lw r2,(sp+84) <== NOT EXECUTED
800daf8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800dafc: 38 21 65 74 ori r1,r1,0x6574 <== NOT EXECUTED
800db00: f8 00 52 dd calli 8022674 <printf> <== 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));
800db04: 2b 81 00 54 lw r1,(sp+84) <== NOT EXECUTED
800db08: 34 02 00 03 mvi r2,3 <== NOT EXECUTED
800db0c: fb ff ce 75 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
800db10: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
rtems_rfs_fs_size (&fs));
printf ("rtems-rfs: format: blocks = %zu\n",
rtems_rfs_fs_blocks (&fs));
printf ("rtems-rfs: format: block size = %zu\n",
rtems_rfs_fs_block_size (&fs));
printf ("rtems-rfs: format: bits per block = %u\n",
800db14: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800db18: f8 00 52 d7 calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_bits_per_block (&fs));
printf ("rtems-rfs: format: inode size = %zu\n", RTEMS_RFS_INODE_SIZE);
800db1c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800db20: 34 02 00 38 mvi r2,56 <== NOT EXECUTED
800db24: 38 21 65 c4 ori r1,r1,0x65c4 <== NOT EXECUTED
800db28: f8 00 52 d3 calli 8022674 <printf> <== NOT EXECUTED
printf ("rtems-rfs: format: inodes = %zu (%d.%d%%)\n",
fs.group_inodes * fs.group_count,
rtems_rfs_inode_overhead (&fs) / 10,
800db2c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800db30: fb ff fe f1 calli 800d6f4 <rtems_rfs_inode_overhead> <== NOT EXECUTED
800db34: b8 20 68 00 mv r13,r1 <== 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",
800db38: 2b 82 00 78 lw r2,(sp+120) <== NOT EXECUTED
800db3c: 2b 81 00 70 lw r1,(sp+112) <== NOT EXECUTED
800db40: 78 0b 08 03 mvhi r11,0x803 <== NOT EXECUTED
800db44: 39 6b 65 ec ori r11,r11,0x65ec <== NOT EXECUTED
800db48: fb ff ce b4 calli 8001618 <__mulsi3> <== NOT EXECUTED
800db4c: b8 20 78 00 mv r15,r1 <== NOT EXECUTED
800db50: 34 02 00 0a mvi r2,10 <== NOT EXECUTED
800db54: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800db58: f8 00 99 92 calli 80341a0 <__divsi3> <== NOT EXECUTED
800db5c: b8 20 70 00 mv r14,r1 <== NOT EXECUTED
800db60: 34 02 00 0a mvi r2,10 <== NOT EXECUTED
800db64: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800db68: f8 00 99 be calli 8034260 <__modsi3> <== NOT EXECUTED
800db6c: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
800db70: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
800db74: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
800db78: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800db7c: f8 00 52 be calli 8022674 <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);
800db80: 2b 82 00 70 lw r2,(sp+112) <== NOT EXECUTED
800db84: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800db88: 38 21 66 18 ori r1,r1,0x6618 <== NOT EXECUTED
800db8c: f8 00 52 ba calli 8022674 <printf> <== NOT EXECUTED
printf ("rtems-rfs: format: group blocks = %zu\n", fs.group_blocks);
800db90: 2b 82 00 74 lw r2,(sp+116) <== NOT EXECUTED
800db94: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800db98: 38 21 66 38 ori r1,r1,0x6638 <== NOT EXECUTED
800db9c: f8 00 52 b6 calli 8022674 <printf> <== NOT EXECUTED
printf ("rtems-rfs: format: group inodes = %zu\n", fs.group_inodes);
800dba0: 2b 82 00 78 lw r2,(sp+120) <== NOT EXECUTED
800dba4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800dba8: 38 21 66 60 ori r1,r1,0x6660 <== NOT EXECUTED
800dbac: f8 00 52 b2 calli 8022674 <printf> <== NOT EXECUTED
}
rc = rtems_rfs_buffer_setblksize (&fs, rtems_rfs_fs_block_size (&fs));
800dbb0: 2b 82 00 54 lw r2,(sp+84)
800dbb4: 37 8f 00 4c addi r15,sp,76
800dbb8: b9 e0 08 00 mv r1,r15
800dbbc: f8 00 34 f5 calli 801af90 <rtems_rfs_buffer_setblksize>
800dbc0: b8 20 58 00 mv r11,r1
if (rc > 0)
800dbc4: 4c 01 00 06 bge r0,r1,800dbdc <rtems_rfs_format+0x46c> <== ALWAYS TAKEN
{
printf ("rtems-rfs: format: setting block size failed: %d: %s\n",
800dbc8: f8 00 57 66 calli 8023960 <strerror> <== NOT EXECUTED
800dbcc: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800dbd0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800dbd4: 38 21 66 88 ori r1,r1,0x6688 <== NOT EXECUTED
800dbd8: e0 00 02 17 bi 800e434 <rtems_rfs_format+0xcc4> <== NOT EXECUTED
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);
800dbdc: 37 8e 01 10 addi r14,sp,272
800dbe0: b9 e0 08 00 mv r1,r15
800dbe4: b9 c0 10 00 mv r2,r14
800dbe8: 34 03 00 00 mvi r3,0
800dbec: 34 04 00 00 mvi r4,0
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
800dbf0: 33 80 01 10 sb (sp+272),r0
handle->bnum = 0;
800dbf4: 5b 80 01 14 sw (sp+276),r0
handle->buffer = NULL;
800dbf8: 5b 80 01 18 sw (sp+280),r0
800dbfc: f8 00 33 a3 calli 801aa88 <rtems_rfs_buffer_handle_request>
800dc00: b8 20 58 00 mv r11,r1
if (rc > 0)
800dc04: 4c 01 00 0d bge r0,r1,800dc38 <rtems_rfs_format+0x4c8> <== ALWAYS TAKEN
*/
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);
800dc08: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
800dc0c: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
800dc10: f8 00 33 2f calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("rtems-rfs: write-superblock: request failed: %d: %s\n",
800dc14: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
handle->dirty = false;
800dc18: 33 80 01 10 sb (sp+272),r0 <== NOT EXECUTED
handle->bnum = 0;
800dc1c: 5b 80 01 14 sw (sp+276),r0 <== NOT EXECUTED
handle->buffer = NULL;
800dc20: 5b 80 01 18 sw (sp+280),r0 <== NOT EXECUTED
800dc24: f8 00 57 4f calli 8023960 <strerror> <== NOT EXECUTED
800dc28: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800dc2c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800dc30: 38 21 66 c0 ori r1,r1,0x66c0 <== NOT EXECUTED
800dc34: e0 00 00 8b bi 800de60 <rtems_rfs_format+0x6f0> <== NOT EXECUTED
rc, strerror (rc));
return false;
}
sb = rtems_rfs_buffer_data (&handle);
800dc38: 2b 81 01 18 lw r1,(sp+280)
#define write_sb(_o, _d) rtems_rfs_write_u32(sb + (_o), _d)
memset (sb, 0xff, rtems_rfs_fs_block_size (fs));
800dc3c: 2b 83 00 54 lw r3,(sp+84)
800dc40: 34 02 00 ff mvi r2,255
printf ("rtems-rfs: write-superblock: request failed: %d: %s\n",
rc, strerror (rc));
return false;
}
sb = rtems_rfs_buffer_data (&handle);
800dc44: 28 2b 00 1c lw r11,(r1+28)
#define write_sb(_o, _d) rtems_rfs_write_u32(sb + (_o), _d)
memset (sb, 0xff, rtems_rfs_fs_block_size (fs));
write_sb (RTEMS_RFS_SB_OFFSET_MAGIC, RTEMS_RFS_SB_MAGIC);
800dc48: 34 0d 00 01 mvi r13,1
sb = rtems_rfs_buffer_data (&handle);
#define write_sb(_o, _d) rtems_rfs_write_u32(sb + (_o), _d)
memset (sb, 0xff, rtems_rfs_fs_block_size (fs));
800dc4c: b9 60 08 00 mv r1,r11
800dc50: f8 00 51 ed calli 8022404 <memset>
write_sb (RTEMS_RFS_SB_OFFSET_MAGIC, RTEMS_RFS_SB_MAGIC);
800dc54: 34 01 00 28 mvi r1,40
800dc58: 31 61 00 00 sb (r11+0),r1
800dc5c: 34 01 00 09 mvi r1,9
800dc60: 31 61 00 01 sb (r11+1),r1
800dc64: 34 01 00 20 mvi r1,32
800dc68: 31 61 00 02 sb (r11+2),r1
800dc6c: 31 6d 00 03 sb (r11+3),r13
write_sb (RTEMS_RFS_SB_OFFSET_VERSION, RTEMS_RFS_VERSION);
800dc70: 31 60 00 04 sb (r11+4),r0
800dc74: 31 60 00 05 sb (r11+5),r0
800dc78: 31 60 00 06 sb (r11+6),r0
800dc7c: 31 60 00 07 sb (r11+7),r0
write_sb (RTEMS_RFS_SB_OFFSET_BLOCKS, rtems_rfs_fs_blocks (fs));
800dc80: 2b 81 00 50 lw r1,(sp+80)
800dc84: 34 02 00 18 mvi r2,24
800dc88: fb ff ce 3d calli 800157c <__lshrsi3>
800dc8c: 31 61 00 0c sb (r11+12),r1
800dc90: 2b 81 00 50 lw r1,(sp+80)
800dc94: 34 02 00 10 mvi r2,16
800dc98: fb ff ce 39 calli 800157c <__lshrsi3>
800dc9c: 31 61 00 0d sb (r11+13),r1
800dca0: 2b 81 00 50 lw r1,(sp+80)
800dca4: 34 02 00 08 mvi r2,8
800dca8: fb ff ce 35 calli 800157c <__lshrsi3>
800dcac: 31 61 00 0e sb (r11+14),r1
800dcb0: 2b 81 00 50 lw r1,(sp+80)
write_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE, rtems_rfs_fs_block_size (fs));
800dcb4: 34 02 00 18 mvi r2,24
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));
800dcb8: 31 61 00 0f sb (r11+15),r1
write_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE, rtems_rfs_fs_block_size (fs));
800dcbc: 2b 81 00 54 lw r1,(sp+84)
800dcc0: fb ff ce 2f calli 800157c <__lshrsi3>
800dcc4: 31 61 00 08 sb (r11+8),r1
800dcc8: 2b 81 00 54 lw r1,(sp+84)
800dccc: 34 02 00 10 mvi r2,16
800dcd0: fb ff ce 2b calli 800157c <__lshrsi3>
800dcd4: 31 61 00 09 sb (r11+9),r1
800dcd8: 2b 81 00 54 lw r1,(sp+84)
800dcdc: 34 02 00 08 mvi r2,8
800dce0: fb ff ce 27 calli 800157c <__lshrsi3>
800dce4: 31 61 00 0a sb (r11+10),r1
800dce8: 2b 81 00 54 lw r1,(sp+84)
write_sb (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS, fs->bad_blocks);
800dcec: 34 02 00 18 mvi r2,24
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));
write_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE, rtems_rfs_fs_block_size (fs));
800dcf0: 31 61 00 0b sb (r11+11),r1
write_sb (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS, fs->bad_blocks);
800dcf4: 2b 81 00 64 lw r1,(sp+100)
800dcf8: fb ff ce 21 calli 800157c <__lshrsi3>
800dcfc: 31 61 00 10 sb (r11+16),r1
800dd00: 2b 81 00 64 lw r1,(sp+100)
800dd04: 34 02 00 10 mvi r2,16
800dd08: fb ff ce 1d calli 800157c <__lshrsi3>
800dd0c: 31 61 00 11 sb (r11+17),r1
800dd10: 2b 81 00 64 lw r1,(sp+100)
800dd14: 34 02 00 08 mvi r2,8
800dd18: fb ff ce 19 calli 800157c <__lshrsi3>
800dd1c: 31 61 00 12 sb (r11+18),r1
800dd20: 2b 81 00 64 lw r1,(sp+100)
write_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH, fs->max_name_length);
800dd24: 34 02 00 18 mvi r2,24
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));
write_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE, rtems_rfs_fs_block_size (fs));
write_sb (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS, fs->bad_blocks);
800dd28: 31 61 00 13 sb (r11+19),r1
write_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH, fs->max_name_length);
800dd2c: 2b 81 00 68 lw r1,(sp+104)
800dd30: fb ff ce 13 calli 800157c <__lshrsi3>
800dd34: 31 61 00 14 sb (r11+20),r1
800dd38: 2b 81 00 68 lw r1,(sp+104)
800dd3c: 34 02 00 10 mvi r2,16
800dd40: fb ff ce 0f calli 800157c <__lshrsi3>
800dd44: 31 61 00 15 sb (r11+21),r1
800dd48: 2b 81 00 68 lw r1,(sp+104)
800dd4c: 34 02 00 08 mvi r2,8
800dd50: fb ff ce 0b calli 800157c <__lshrsi3>
800dd54: 31 61 00 16 sb (r11+22),r1
800dd58: 2b 81 00 68 lw r1,(sp+104)
write_sb (RTEMS_RFS_SB_OFFSET_GROUPS, fs->group_count);
800dd5c: 34 02 00 18 mvi r2,24
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));
write_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE, rtems_rfs_fs_block_size (fs));
write_sb (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS, fs->bad_blocks);
write_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH, fs->max_name_length);
800dd60: 31 61 00 17 sb (r11+23),r1
write_sb (RTEMS_RFS_SB_OFFSET_GROUPS, fs->group_count);
800dd64: 2b 81 00 70 lw r1,(sp+112)
800dd68: fb ff ce 05 calli 800157c <__lshrsi3>
800dd6c: 31 61 00 18 sb (r11+24),r1
800dd70: 2b 81 00 70 lw r1,(sp+112)
800dd74: 34 02 00 10 mvi r2,16
800dd78: fb ff ce 01 calli 800157c <__lshrsi3>
800dd7c: 31 61 00 19 sb (r11+25),r1
800dd80: 2b 81 00 70 lw r1,(sp+112)
800dd84: 34 02 00 08 mvi r2,8
800dd88: fb ff cd fd calli 800157c <__lshrsi3>
800dd8c: 31 61 00 1a sb (r11+26),r1
800dd90: 2b 81 00 70 lw r1,(sp+112)
write_sb (RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS, fs->group_blocks);
800dd94: 34 02 00 18 mvi r2,24
write_sb (RTEMS_RFS_SB_OFFSET_VERSION, RTEMS_RFS_VERSION);
write_sb (RTEMS_RFS_SB_OFFSET_BLOCKS, rtems_rfs_fs_blocks (fs));
write_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE, rtems_rfs_fs_block_size (fs));
write_sb (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS, fs->bad_blocks);
write_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH, fs->max_name_length);
write_sb (RTEMS_RFS_SB_OFFSET_GROUPS, fs->group_count);
800dd98: 31 61 00 1b sb (r11+27),r1
write_sb (RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS, fs->group_blocks);
800dd9c: 2b 81 00 74 lw r1,(sp+116)
800dda0: fb ff cd f7 calli 800157c <__lshrsi3>
800dda4: 31 61 00 1c sb (r11+28),r1
800dda8: 2b 81 00 74 lw r1,(sp+116)
800ddac: 34 02 00 10 mvi r2,16
800ddb0: fb ff cd f3 calli 800157c <__lshrsi3>
800ddb4: 31 61 00 1d sb (r11+29),r1
800ddb8: 2b 81 00 74 lw r1,(sp+116)
800ddbc: 34 02 00 08 mvi r2,8
800ddc0: fb ff cd ef calli 800157c <__lshrsi3>
800ddc4: 31 61 00 1e sb (r11+30),r1
800ddc8: 2b 81 00 74 lw r1,(sp+116)
write_sb (RTEMS_RFS_SB_OFFSET_GROUP_INODES, fs->group_inodes);
800ddcc: 34 02 00 18 mvi r2,24
write_sb (RTEMS_RFS_SB_OFFSET_BLOCKS, rtems_rfs_fs_blocks (fs));
write_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE, rtems_rfs_fs_block_size (fs));
write_sb (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS, fs->bad_blocks);
write_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH, fs->max_name_length);
write_sb (RTEMS_RFS_SB_OFFSET_GROUPS, fs->group_count);
write_sb (RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS, fs->group_blocks);
800ddd0: 31 61 00 1f sb (r11+31),r1
write_sb (RTEMS_RFS_SB_OFFSET_GROUP_INODES, fs->group_inodes);
800ddd4: 2b 81 00 78 lw r1,(sp+120)
800ddd8: fb ff cd e9 calli 800157c <__lshrsi3>
800dddc: 31 61 00 20 sb (r11+32),r1
800dde0: 2b 81 00 78 lw r1,(sp+120)
800dde4: 34 02 00 10 mvi r2,16
800dde8: fb ff cd e5 calli 800157c <__lshrsi3>
800ddec: 31 61 00 21 sb (r11+33),r1
800ddf0: 2b 81 00 78 lw r1,(sp+120)
800ddf4: 34 02 00 08 mvi r2,8
800ddf8: fb ff cd e1 calli 800157c <__lshrsi3>
800ddfc: 31 61 00 22 sb (r11+34),r1
800de00: 2b 81 00 78 lw r1,(sp+120)
write_sb (RTEMS_RFS_SB_OFFSET_INODE_SIZE, RTEMS_RFS_INODE_SIZE);
rtems_rfs_buffer_mark_dirty (&handle);
rc = rtems_rfs_buffer_handle_release (fs, &handle);
800de04: b9 c0 10 00 mv r2,r14
write_sb (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS, fs->bad_blocks);
write_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH, fs->max_name_length);
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);
800de08: 31 60 00 24 sb (r11+36),r0
write_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE, rtems_rfs_fs_block_size (fs));
write_sb (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS, fs->bad_blocks);
write_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH, fs->max_name_length);
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);
800de0c: 31 61 00 23 sb (r11+35),r1
write_sb (RTEMS_RFS_SB_OFFSET_INODE_SIZE, RTEMS_RFS_INODE_SIZE);
800de10: 34 01 00 38 mvi r1,56
800de14: 31 61 00 27 sb (r11+39),r1
800de18: 31 60 00 25 sb (r11+37),r0
800de1c: 31 60 00 26 sb (r11+38),r0
rtems_rfs_buffer_mark_dirty (&handle);
rc = rtems_rfs_buffer_handle_release (fs, &handle);
800de20: b9 e0 08 00 mv r1,r15
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);
800de24: 33 8d 01 10 sb (sp+272),r13
rc = rtems_rfs_buffer_handle_release (fs, &handle);
800de28: f8 00 32 a9 calli 801a8cc <rtems_rfs_buffer_handle_release>
800de2c: b8 20 58 00 mv r11,r1
if (rc > 0)
800de30: 4c 01 00 11 bge r0,r1,800de74 <rtems_rfs_format+0x704> <== ALWAYS TAKEN
*/
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);
800de34: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
800de38: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
800de3c: f8 00 32 a4 calli 801a8cc <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",
800de40: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
handle->dirty = false;
800de44: 33 80 01 10 sb (sp+272),r0 <== NOT EXECUTED
handle->bnum = 0;
800de48: 5b 80 01 14 sw (sp+276),r0 <== NOT EXECUTED
handle->buffer = NULL;
800de4c: 5b 80 01 18 sw (sp+280),r0 <== NOT EXECUTED
800de50: f8 00 56 c4 calli 8023960 <strerror> <== NOT EXECUTED
800de54: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800de58: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800de5c: 38 21 66 f8 ori r1,r1,0x66f8 <== NOT EXECUTED
800de60: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800de64: f8 00 52 04 calli 8022674 <printf> <== NOT EXECUTED
return -1;
}
if (!rtems_rfs_write_superblock (&fs))
{
printf ("rtems-rfs: format: superblock write failed\n");
800de68: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800de6c: 38 21 67 34 ori r1,r1,0x6734 <== NOT EXECUTED
800de70: e0 00 00 0e bi 800dea8 <rtems_rfs_format+0x738> <== 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);
800de74: b9 e0 08 00 mv r1,r15
800de78: b9 c0 10 00 mv r2,r14
*/
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",
800de7c: 78 18 08 03 mvhi r24,0x803
rc, strerror (rc));
return false;
}
if (verbose)
printf (", blocks");
800de80: 78 17 08 03 mvhi r23,0x803
}
rtems_rfs_buffer_mark_dirty (&handle);
if (verbose)
printf (", inodes");
800de84: 78 15 08 03 mvhi r21,0x803
800de88: f8 00 32 91 calli 801a8cc <rtems_rfs_buffer_handle_release>
800de8c: 34 0b 00 00 mvi r11,0
*/
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",
800de90: 3b 18 67 9c ori r24,r24,0x679c
rc, strerror (rc));
return false;
}
if (verbose)
printf (", blocks");
800de94: 3a f7 67 d4 ori r23,r23,0x67d4
/*
* Open the block bitmap using the new buffer.
*/
rc = rtems_rfs_bitmap_open (&bitmap, fs, &handle, group_size,
800de98: 37 8d 00 f8 addi r13,sp,248
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);
800de9c: 34 16 00 01 mvi r22,1
if (verbose)
printf (", inodes");
800dea0: 3a b5 68 bc ori r21,r21,0x68bc
800dea4: e0 00 00 db bi 800e210 <rtems_rfs_format+0xaa0>
return -1;
}
if (!rtems_rfs_write_superblock (&fs))
{
printf ("rtems-rfs: format: superblock write failed\n");
800dea8: f8 00 52 bb calli 8022994 <puts> <== NOT EXECUTED
800deac: e0 00 01 64 bi 800e43c <rtems_rfs_format+0xccc> <== NOT EXECUTED
return -1;
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
800deb0: 41 81 00 14 lbu r1,(r12+20)
size_t group_size;
int blocks;
int b;
int rc;
group_base = rtems_rfs_fs_block (fs, group, 0);
800deb4: 2b 91 00 74 lw r17,(sp+116)
return -1;
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
800deb8: 5b 81 00 48 sw (sp+72),r1
size_t group_size;
int blocks;
int b;
int rc;
group_base = rtems_rfs_fs_block (fs, group, 0);
800debc: ba 20 10 00 mv r2,r17
800dec0: b9 60 08 00 mv r1,r11
800dec4: fb ff cd d5 calli 8001618 <__mulsi3>
if (group_base > rtems_rfs_fs_blocks (fs))
800dec8: 2b 82 00 50 lw r2,(sp+80)
size_t group_size;
int blocks;
int b;
int rc;
group_base = rtems_rfs_fs_block (fs, group, 0);
800decc: 34 30 00 01 addi r16,r1,1
800ded0: b8 20 c8 00 mv r25,r1
if (group_base > rtems_rfs_fs_blocks (fs))
800ded4: 50 50 00 06 bgeu r2,r16,800deec <rtems_rfs_format+0x77c> <== ALWAYS TAKEN
{
printf ("rtems-rfs: write-group: group %d base beyond disk limit\n",
800ded8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800dedc: 38 21 67 60 ori r1,r1,0x6760 <== NOT EXECUTED
800dee0: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800dee4: f8 00 51 e4 calli 8022674 <printf> <== NOT EXECUTED
800dee8: e0 00 01 55 bi 800e43c <rtems_rfs_format+0xccc> <== NOT EXECUTED
/*
* Be nice to strange sizes of disks. These are embedded systems after all
* and nice numbers do not always work out. Let the last block pick up the
* remainder of the blocks.
*/
if ((group_base + group_size) > rtems_rfs_fs_blocks (fs))
800deec: b6 11 08 00 add r1,r16,r17
800def0: 50 41 00 02 bgeu r2,r1,800def8 <rtems_rfs_format+0x788> <== NEVER TAKEN
group_size = rtems_rfs_fs_blocks (fs) - group_base;
800def4: c8 50 88 00 sub r17,r2,r16
if (verbose)
800def8: 46 40 00 06 be r18,r0,800df10 <rtems_rfs_format+0x7a0> <== ALWAYS TAKEN
printf ("\rrtems-rfs: format: group %3d: base = %" PRId32 ", size = %zd",
800defc: bb 00 08 00 mv r1,r24 <== NOT EXECUTED
800df00: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800df04: ba 00 18 00 mv r3,r16 <== NOT EXECUTED
800df08: ba 20 20 00 mv r4,r17 <== NOT EXECUTED
800df0c: f8 00 51 da calli 8022674 <printf> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
800df10: 33 80 01 10 sb (sp+272),r0
handle->bnum = 0;
800df14: 5b 80 01 14 sw (sp+276),r0
handle->buffer = NULL;
800df18: 5b 80 01 18 sw (sp+280),r0
printf ("\nrtems-rfs: write-group: handle open failed: %d: %s\n",
rc, strerror (rc));
return false;
}
if (verbose)
800df1c: 46 40 00 03 be r18,r0,800df28 <rtems_rfs_format+0x7b8> <== ALWAYS TAKEN
printf (", blocks");
800df20: ba e0 08 00 mv r1,r23 <== NOT EXECUTED
800df24: f8 00 51 d4 calli 8022674 <printf> <== NOT EXECUTED
/*
* Open the block bitmap using the new buffer.
*/
rc = rtems_rfs_bitmap_open (&bitmap, fs, &handle, group_size,
800df28: b9 a0 08 00 mv r1,r13
800df2c: b9 e0 10 00 mv r2,r15
800df30: b9 c0 18 00 mv r3,r14
800df34: ba 20 20 00 mv r4,r17
800df38: ba 00 28 00 mv r5,r16
800df3c: f8 00 2c 8f calli 8019178 <rtems_rfs_bitmap_open>
800df40: b8 20 98 00 mv r19,r1
group_base + RTEMS_RFS_GROUP_BLOCK_BITMAP_BLOCK);
if (rc > 0)
800df44: 4c 01 00 0d bge r0,r1,800df78 <rtems_rfs_format+0x808> <== ALWAYS TAKEN
*/
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);
800df48: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
800df4c: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
800df50: f8 00 32 5f calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("\nrtems-rfs: write-group: group %3d: open block bitmap failed: %d: %s\n",
800df54: ba 60 08 00 mv r1,r19 <== NOT EXECUTED
handle->dirty = false;
800df58: 33 80 01 10 sb (sp+272),r0 <== NOT EXECUTED
handle->bnum = 0;
800df5c: 5b 80 01 14 sw (sp+276),r0 <== NOT EXECUTED
handle->buffer = NULL;
800df60: 5b 80 01 18 sw (sp+280),r0 <== NOT EXECUTED
800df64: f8 00 56 7f calli 8023960 <strerror> <== NOT EXECUTED
800df68: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
800df6c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800df70: 38 21 67 e0 ori r1,r1,0x67e0 <== NOT EXECUTED
800df74: e0 00 00 17 bi 800dfd0 <rtems_rfs_format+0x860> <== 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));
800df78: 2b 81 01 18 lw r1,(sp+280)
800df7c: 2b 83 00 54 lw r3,(sp+84)
800df80: 34 02 00 ff mvi r2,255
800df84: 28 21 00 1c lw r1,(r1+28)
800df88: f8 00 51 1f calli 8022404 <memset>
/*
* Clear the bitmap.
*/
rc = rtems_rfs_bitmap_map_clear_all (&bitmap);
800df8c: b9 a0 08 00 mv r1,r13
800df90: f8 00 2b c2 calli 8018e98 <rtems_rfs_bitmap_map_clear_all>
800df94: b8 20 98 00 mv r19,r1
if (rc > 0)
800df98: 4c 01 00 12 bge r0,r1,800dfe0 <rtems_rfs_format+0x870> <== ALWAYS TAKEN
{
rtems_rfs_bitmap_close (&bitmap);
800df9c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800dfa0: f8 00 2c 91 calli 80191e4 <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);
800dfa4: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
800dfa8: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
800dfac: f8 00 32 48 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("\nrtems-rfs: write-group: group %3d: block bitmap clear all failed: %d: %s\n",
800dfb0: ba 60 08 00 mv r1,r19 <== NOT EXECUTED
handle->dirty = false;
800dfb4: 33 80 01 10 sb (sp+272),r0 <== NOT EXECUTED
handle->bnum = 0;
800dfb8: 5b 80 01 14 sw (sp+276),r0 <== NOT EXECUTED
handle->buffer = NULL;
800dfbc: 5b 80 01 18 sw (sp+280),r0 <== NOT EXECUTED
800dfc0: f8 00 56 68 calli 8023960 <strerror> <== NOT EXECUTED
800dfc4: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
800dfc8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800dfcc: 38 21 68 28 ori r1,r1,0x6828 <== NOT EXECUTED
800dfd0: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800dfd4: ba 60 18 00 mv r3,r19 <== NOT EXECUTED
800dfd8: f8 00 51 a7 calli 8022674 <printf> <== NOT EXECUTED
800dfdc: e0 00 01 18 bi 800e43c <rtems_rfs_format+0xccc> <== NOT EXECUTED
}
/*
* Forced allocation of the block bitmap.
*/
rtems_rfs_bitmap_map_set (&bitmap, RTEMS_RFS_GROUP_BLOCK_BITMAP_BLOCK);
800dfe0: 34 02 00 00 mvi r2,0
800dfe4: b9 a0 08 00 mv r1,r13
800dfe8: f8 00 2a ea calli 8018b90 <rtems_rfs_bitmap_map_set>
/*
* Forced allocation of the inode bitmap.
*/
rtems_rfs_bitmap_map_set (&bitmap, RTEMS_RFS_GROUP_INODE_BITMAP_BLOCK);
800dfec: 34 02 00 01 mvi r2,1
800dff0: b9 a0 08 00 mv r1,r13
800dff4: f8 00 2a e7 calli 8018b90 <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);
800dff8: 2b 81 00 78 lw r1,(sp+120)
800dffc: 2b 82 00 7c lw r2,(sp+124)
/*
* Forced allocation of the inode blocks which follow the block bitmap.
*/
for (b = 0; b < blocks; b++)
800e000: 34 13 00 00 mvi r19,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);
800e004: fb ff fd b1 calli 800d6c8 <rtems_rfs_rup_quotient>
800e008: b8 20 d8 00 mv fp,r1
800e00c: e0 00 00 05 bi 800e020 <rtems_rfs_format+0x8b0>
/*
* 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);
800e010: 36 62 00 02 addi r2,r19,2
800e014: b9 a0 08 00 mv r1,r13
800e018: f8 00 2a de calli 8018b90 <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++)
800e01c: 36 73 00 01 addi r19,r19,1
800e020: 4b 73 ff fc bg fp,r19,800e010 <rtems_rfs_format+0x8a0>
rtems_rfs_bitmap_map_set (&bitmap, b + RTEMS_RFS_GROUP_INODE_BLOCK);
/*
* Close the block bitmap.
*/
rc = rtems_rfs_bitmap_close (&bitmap);
800e024: b9 a0 08 00 mv r1,r13
800e028: f8 00 2c 6f calli 80191e4 <rtems_rfs_bitmap_close>
800e02c: b8 20 98 00 mv r19,r1
if (rc > 0)
800e030: 4c 01 00 0d bge r0,r1,800e064 <rtems_rfs_format+0x8f4> <== ALWAYS TAKEN
*/
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);
800e034: 37 82 01 10 addi r2,sp,272 <== NOT EXECUTED
800e038: 37 81 00 4c addi r1,sp,76 <== NOT EXECUTED
800e03c: f8 00 32 24 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("\nrtems-rfs: write-group: group %3d: close block bitmap failed: %d: %s\n",
800e040: ba 60 08 00 mv r1,r19 <== NOT EXECUTED
handle->dirty = false;
800e044: 33 80 01 10 sb (sp+272),r0 <== NOT EXECUTED
handle->bnum = 0;
800e048: 5b 80 01 14 sw (sp+276),r0 <== NOT EXECUTED
handle->buffer = NULL;
800e04c: 5b 80 01 18 sw (sp+280),r0 <== NOT EXECUTED
800e050: f8 00 56 44 calli 8023960 <strerror> <== NOT EXECUTED
800e054: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
800e058: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e05c: 38 21 68 74 ori r1,r1,0x6874 <== NOT EXECUTED
800e060: e3 ff ff dc bi 800dfd0 <rtems_rfs_format+0x860> <== NOT EXECUTED
group, rc, strerror (rc));
return false;
}
rtems_rfs_buffer_mark_dirty (&handle);
800e064: 33 96 01 10 sb (sp+272),r22
if (verbose)
800e068: 46 40 00 03 be r18,r0,800e074 <rtems_rfs_format+0x904> <== ALWAYS TAKEN
printf (", inodes");
800e06c: ba a0 08 00 mv r1,r21 <== NOT EXECUTED
800e070: f8 00 51 81 calli 8022674 <printf> <== NOT EXECUTED
/*
* Open the inode bitmap using the old buffer. Should release any changes.
*/
rc = rtems_rfs_bitmap_open (&bitmap, fs, &handle, group_size,
800e074: 36 05 00 01 addi r5,r16,1
800e078: b9 a0 08 00 mv r1,r13
800e07c: b9 e0 10 00 mv r2,r15
800e080: b9 c0 18 00 mv r3,r14
800e084: ba 20 20 00 mv r4,r17
800e088: f8 00 2c 3c calli 8019178 <rtems_rfs_bitmap_open>
800e08c: b8 20 80 00 mv r16,r1
group_base + RTEMS_RFS_GROUP_INODE_BITMAP_BLOCK);
if (rc > 0)
800e090: 4c 01 00 0d bge r0,r1,800e0c4 <rtems_rfs_format+0x954> <== ALWAYS TAKEN
*/
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);
800e094: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
800e098: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
800e09c: f8 00 32 0c calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("\nrtems-rfs: write-group: group %3d: open inode bitmap failed: %d: %s\n",
800e0a0: ba 00 08 00 mv r1,r16 <== NOT EXECUTED
handle->dirty = false;
800e0a4: 33 80 01 10 sb (sp+272),r0 <== NOT EXECUTED
handle->bnum = 0;
800e0a8: 5b 80 01 14 sw (sp+276),r0 <== NOT EXECUTED
handle->buffer = NULL;
800e0ac: 5b 80 01 18 sw (sp+280),r0 <== NOT EXECUTED
800e0b0: f8 00 56 2c calli 8023960 <strerror> <== NOT EXECUTED
800e0b4: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
800e0b8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e0bc: 38 21 68 c8 ori r1,r1,0x68c8 <== NOT EXECUTED
800e0c0: e0 00 00 17 bi 800e11c <rtems_rfs_format+0x9ac> <== 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));
800e0c4: 2b 81 01 18 lw r1,(sp+280)
800e0c8: 2b 83 00 54 lw r3,(sp+84)
800e0cc: 34 02 00 00 mvi r2,0
800e0d0: 28 21 00 1c lw r1,(r1+28)
800e0d4: f8 00 50 cc calli 8022404 <memset>
/*
* Clear the inode bitmap.
*/
rc = rtems_rfs_bitmap_map_clear_all (&bitmap);
800e0d8: b9 a0 08 00 mv r1,r13
800e0dc: f8 00 2b 6f calli 8018e98 <rtems_rfs_bitmap_map_clear_all>
800e0e0: b8 20 80 00 mv r16,r1
if (rc > 0)
800e0e4: 4c 01 00 11 bge r0,r1,800e128 <rtems_rfs_format+0x9b8> <== ALWAYS TAKEN
{
rtems_rfs_bitmap_close (&bitmap);
800e0e8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800e0ec: f8 00 2c 3e calli 80191e4 <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);
800e0f0: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
800e0f4: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
800e0f8: f8 00 31 f5 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("\nrtems-rfs: write-group: group %3d: inode bitmap" \
800e0fc: ba 00 08 00 mv r1,r16 <== NOT EXECUTED
handle->dirty = false;
800e100: 33 80 01 10 sb (sp+272),r0 <== NOT EXECUTED
handle->bnum = 0;
800e104: 5b 80 01 14 sw (sp+276),r0 <== NOT EXECUTED
handle->buffer = NULL;
800e108: 5b 80 01 18 sw (sp+280),r0 <== NOT EXECUTED
800e10c: f8 00 56 15 calli 8023960 <strerror> <== NOT EXECUTED
800e110: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
800e114: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e118: 38 21 69 10 ori r1,r1,0x6910 <== NOT EXECUTED
800e11c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800e120: ba 00 18 00 mv r3,r16 <== NOT EXECUTED
800e124: e3 ff ff ad bi 800dfd8 <rtems_rfs_format+0x868> <== NOT EXECUTED
}
/*
* Close the inode bitmap.
*/
rc = rtems_rfs_bitmap_close (&bitmap);
800e128: b9 a0 08 00 mv r1,r13
800e12c: f8 00 2c 2e calli 80191e4 <rtems_rfs_bitmap_close>
800e130: b8 20 80 00 mv r16,r1
if (rc > 0)
800e134: 4c 01 00 0d bge r0,r1,800e168 <rtems_rfs_format+0x9f8> <== ALWAYS TAKEN
*/
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);
800e138: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
800e13c: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
800e140: f8 00 31 e3 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("\nrtems-rfs: write-group: group %3d: close inode" \
800e144: ba 00 08 00 mv r1,r16 <== NOT EXECUTED
handle->dirty = false;
800e148: 33 80 01 10 sb (sp+272),r0 <== NOT EXECUTED
handle->bnum = 0;
800e14c: 5b 80 01 14 sw (sp+276),r0 <== NOT EXECUTED
handle->buffer = NULL;
800e150: 5b 80 01 18 sw (sp+280),r0 <== NOT EXECUTED
800e154: f8 00 56 03 calli 8023960 <strerror> <== NOT EXECUTED
800e158: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
800e15c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e160: 38 21 69 5c ori r1,r1,0x695c <== NOT EXECUTED
800e164: e3 ff ff ee bi 800e11c <rtems_rfs_format+0x9ac> <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (&handle);
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
800e168: 2b 84 00 48 lw r4,(sp+72)
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);
800e16c: 33 96 01 10 sb (sp+272),r22
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
800e170: 34 10 00 00 mvi r16,0
return rc;
}
int
rtems_rfs_format (const char* name, const rtems_rfs_format_config* config)
800e174: 37 39 00 03 addi r25,r25,3
rtems_rfs_buffer_mark_dirty (&handle);
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
800e178: 5c 80 00 21 bne r4,r0,800e1fc <rtems_rfs_format+0xa8c> <== NEVER TAKEN
800e17c: e0 00 00 21 bi 800e200 <rtems_rfs_format+0xa90>
800e180: b7 30 90 00 add r18,r25,r16 <== NOT EXECUTED
{
for (b = 0; b < blocks; b++)
{
rc = rtems_rfs_buffer_handle_request (fs, &handle,
800e184: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
800e188: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
800e18c: ba 40 18 00 mv r3,r18 <== NOT EXECUTED
800e190: 34 04 00 00 mvi r4,0 <== NOT EXECUTED
800e194: f8 00 32 3d calli 801aa88 <rtems_rfs_buffer_handle_request><== NOT EXECUTED
800e198: b8 20 88 00 mv r17,r1 <== NOT EXECUTED
group_base + b + RTEMS_RFS_GROUP_INODE_BLOCK,
false);
if (rc > 0)
800e19c: 4c 01 00 11 bge r0,r1,800e1e0 <rtems_rfs_format+0xa70> <== 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);
800e1a0: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
800e1a4: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
800e1a8: f8 00 31 c9 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("\nrtems-rfs: write-group: group %3d: block %" PRId32 " request failed: %d: %s\n",
800e1ac: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
handle->dirty = false;
800e1b0: 33 80 01 10 sb (sp+272),r0 <== NOT EXECUTED
handle->bnum = 0;
800e1b4: 5b 80 01 14 sw (sp+276),r0 <== NOT EXECUTED
handle->buffer = NULL;
800e1b8: 5b 80 01 18 sw (sp+280),r0 <== NOT EXECUTED
800e1bc: f8 00 55 e9 calli 8023960 <strerror> <== NOT EXECUTED
800e1c0: b8 20 28 00 mv r5,r1 <== NOT EXECUTED
800e1c4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e1c8: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800e1cc: ba 40 18 00 mv r3,r18 <== NOT EXECUTED
800e1d0: ba 20 20 00 mv r4,r17 <== NOT EXECUTED
800e1d4: 38 21 69 a4 ori r1,r1,0x69a4 <== NOT EXECUTED
800e1d8: f8 00 51 27 calli 8022674 <printf> <== NOT EXECUTED
800e1dc: e0 00 00 98 bi 800e43c <rtems_rfs_format+0xccc> <== 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));
800e1e0: 2b 81 01 18 lw r1,(sp+280) <== NOT EXECUTED
800e1e4: 2b 83 00 54 lw r3,(sp+84) <== NOT EXECUTED
800e1e8: 34 02 00 ff mvi r2,255 <== NOT EXECUTED
800e1ec: 28 21 00 1c lw r1,(r1+28) <== NOT EXECUTED
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
{
for (b = 0; b < blocks; b++)
800e1f0: 36 10 00 01 addi r16,r16,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));
800e1f4: f8 00 50 84 calli 8022404 <memset> <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (&handle);
800e1f8: 33 96 01 10 sb (sp+272),r22 <== NOT EXECUTED
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
{
for (b = 0; b < blocks; b++)
800e1fc: 4b 70 ff e1 bg fp,r16,800e180 <rtems_rfs_format+0xa10> <== 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);
800e200: b9 e0 08 00 mv r1,r15
800e204: b9 c0 10 00 mv r2,r14
800e208: f8 00 31 b1 calli 801a8cc <rtems_rfs_buffer_handle_release>
{
printf ("rtems-rfs: format: superblock write failed\n");
return -1;
}
for (group = 0; group < fs.group_count; group++)
800e20c: 35 6b 00 01 addi r11,r11,1
800e210: 2b 81 00 70 lw r1,(sp+112)
800e214: 41 92 00 15 lbu r18,(r12+21)
800e218: 48 2b ff 26 bg r1,r11,800deb0 <rtems_rfs_format+0x740>
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
return -1;
if (config->verbose)
800e21c: 46 40 00 03 be r18,r0,800e228 <rtems_rfs_format+0xab8> <== ALWAYS TAKEN
printf ("\n");
800e220: 34 01 00 0a mvi r1,10 <== NOT EXECUTED
800e224: f8 00 51 9a calli 802288c <putchar> <== NOT EXECUTED
rc = rtems_rfs_buffer_close (&fs);
800e228: 37 81 00 4c addi r1,sp,76
800e22c: f8 00 33 94 calli 801b07c <rtems_rfs_buffer_close>
800e230: b8 20 58 00 mv r11,r1
if (rc > 0)
800e234: 4c 01 00 06 bge r0,r1,800e24c <rtems_rfs_format+0xadc> <== ALWAYS TAKEN
{
printf ("rtems-rfs: format: buffer close failed: %d: %s\n",
800e238: f8 00 55 ca calli 8023960 <strerror> <== NOT EXECUTED
800e23c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800e240: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e244: 38 21 69 ec ori r1,r1,0x69ec <== NOT EXECUTED
800e248: e0 00 00 7b bi 800e434 <rtems_rfs_format+0xcc4> <== NOT EXECUTED
int rc;
/*
* External API so returns -1.
*/
rc = rtems_rfs_fs_open (name, NULL,
800e24c: ba 80 08 00 mv r1,r20
800e250: 34 02 00 00 mvi r2,0
800e254: 34 03 00 06 mvi r3,6
800e258: 34 04 00 00 mvi r4,0
800e25c: 37 85 01 20 addi r5,sp,288
800e260: f8 00 3c cb calli 801d58c <rtems_rfs_fs_open>
RTEMS_RFS_FS_FORCE_OPEN | RTEMS_RFS_FS_NO_LOCAL_CACHE,
0, &fs);
if (rc < 0)
800e264: 4c 20 00 0a bge r1,r0,800e28c <rtems_rfs_format+0xb1c> <== ALWAYS TAKEN
{
printf ("rtems-rfs: format: file system open failed: %d: %s\n",
errno, strerror (errno));
800e268: f8 00 4a a8 calli 8020d08 <__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",
800e26c: 28 2b 00 00 lw r11,(r1+0) <== NOT EXECUTED
errno, strerror (errno));
800e270: f8 00 4a a6 calli 8020d08 <__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",
800e274: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
800e278: f8 00 55 ba calli 8023960 <strerror> <== NOT EXECUTED
800e27c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800e280: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e284: 38 21 6a 1c ori r1,r1,0x6a1c <== NOT EXECUTED
800e288: e0 00 00 60 bi 800e408 <rtems_rfs_format+0xc98> <== NOT EXECUTED
errno, strerror (errno));
return -1;
}
rc = rtems_rfs_inode_alloc (fs, RTEMS_RFS_ROOT_INO, &ino);
800e28c: 2b 81 01 20 lw r1,(sp+288)
800e290: 34 02 00 01 mvi r2,1
800e294: 37 83 01 1c addi r3,sp,284
800e298: f8 00 02 7b calli 800ec84 <rtems_rfs_inode_alloc>
800e29c: b8 20 58 00 mv r11,r1
if (rc > 0)
800e2a0: 4c 01 00 08 bge r0,r1,800e2c0 <rtems_rfs_format+0xb50> <== ALWAYS TAKEN
{
printf ("rtems-rfs: format: inode allocation failed: %d: %s\n",
800e2a4: f8 00 55 af calli 8023960 <strerror> <== NOT EXECUTED
800e2a8: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800e2ac: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e2b0: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800e2b4: 38 21 6a 50 ori r1,r1,0x6a50 <== NOT EXECUTED
800e2b8: f8 00 50 ef calli 8022674 <printf> <== NOT EXECUTED
800e2bc: e0 00 00 1c bi 800e32c <rtems_rfs_format+0xbbc> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_fs_close (fs);
return rc;
}
if (ino != RTEMS_RFS_ROOT_INO)
800e2c0: 2b 82 01 1c lw r2,(sp+284)
800e2c4: 34 01 00 01 mvi r1,1
800e2c8: 44 41 00 07 be r2,r1,800e2e4 <rtems_rfs_format+0xb74> <== ALWAYS TAKEN
{
printf ("rtems-rfs: format: allocated inode not root ino: %" PRId32 "\n", ino);
800e2cc: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e2d0: 38 21 6a 84 ori r1,r1,0x6a84 <== NOT EXECUTED
800e2d4: f8 00 50 e8 calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_fs_close (fs);
800e2d8: 2b 81 01 20 lw r1,(sp+288) <== NOT EXECUTED
800e2dc: f8 00 3e d5 calli 801de30 <rtems_rfs_fs_close> <== NOT EXECUTED
800e2e0: e0 00 00 4c bi 800e410 <rtems_rfs_format+0xca0> <== NOT EXECUTED
return rc;
}
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
800e2e4: 2b 81 01 20 lw r1,(sp+288)
800e2e8: 37 8c 00 d0 addi r12,sp,208
800e2ec: 34 02 00 01 mvi r2,1
800e2f0: b9 80 18 00 mv r3,r12
800e2f4: 34 04 00 01 mvi r4,1
800e2f8: f8 00 02 a8 calli 800ed98 <rtems_rfs_inode_open>
800e2fc: b8 20 58 00 mv r11,r1
if (rc > 0)
800e300: 4c 01 00 0e bge r0,r1,800e338 <rtems_rfs_format+0xbc8> <== ALWAYS TAKEN
{
printf ("rtems-rfs: format: inode open failed: %d: %s\n",
800e304: f8 00 55 97 calli 8023960 <strerror> <== NOT EXECUTED
800e308: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800e30c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e310: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800e314: 38 21 6a bc ori r1,r1,0x6abc <== NOT EXECUTED
800e318: f8 00 50 d7 calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_group_bitmap_free (fs, true, ino);
800e31c: 2b 81 01 20 lw r1,(sp+288) <== NOT EXECUTED
800e320: 2b 83 01 1c lw r3,(sp+284) <== NOT EXECUTED
800e324: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
800e328: f8 00 01 aa calli 800e9d0 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
rtems_rfs_fs_close (fs);
800e32c: 2b 81 01 20 lw r1,(sp+288) <== NOT EXECUTED
800e330: f8 00 3e c0 calli 801de30 <rtems_rfs_fs_close> <== NOT EXECUTED
800e334: e0 00 00 3b bi 800e420 <rtems_rfs_format+0xcb0> <== NOT EXECUTED
return rc;
}
rc = rtems_rfs_inode_initialise (&inode, 0,
800e338: b9 80 08 00 mv r1,r12
800e33c: 34 02 00 00 mvi r2,0
800e340: 34 03 41 c9 mvi r3,16841
800e344: 34 04 00 00 mvi r4,0
800e348: 34 05 00 00 mvi r5,0
800e34c: f8 00 03 bf calli 800f248 <rtems_rfs_inode_initialise>
800e350: b8 20 58 00 mv r11,r1
(RTEMS_RFS_S_IFDIR | RTEMS_RFS_S_IRWXU |
RTEMS_RFS_S_IXGRP | RTEMS_RFS_S_IXOTH),
0, 0);
if (rc > 0)
800e354: 4c 01 00 07 bge r0,r1,800e370 <rtems_rfs_format+0xc00> <== ALWAYS TAKEN
printf ("rtems-rfs: format: inode initialise failed: %d: %s\n",
800e358: f8 00 55 82 calli 8023960 <strerror> <== NOT EXECUTED
800e35c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800e360: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e364: 38 21 6a ec ori r1,r1,0x6aec <== NOT EXECUTED
800e368: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800e36c: f8 00 50 c2 calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
rc = rtems_rfs_dir_add_entry (fs, &inode, ".", 1, ino);
800e370: 2b 81 01 20 lw r1,(sp+288)
800e374: 2b 85 01 1c lw r5,(sp+284)
800e378: 78 03 08 03 mvhi r3,0x803
800e37c: 37 82 00 d0 addi r2,sp,208
800e380: 38 63 50 6c ori r3,r3,0x506c
800e384: 34 04 00 01 mvi r4,1
800e388: f8 00 34 cf calli 801b6c4 <rtems_rfs_dir_add_entry>
800e38c: b8 20 58 00 mv r11,r1
if (rc > 0)
800e390: 4c 01 00 07 bge r0,r1,800e3ac <rtems_rfs_format+0xc3c> <== ALWAYS TAKEN
printf ("rtems-rfs: format: directory add failed: %d: %s\n",
800e394: f8 00 55 73 calli 8023960 <strerror> <== NOT EXECUTED
800e398: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800e39c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e3a0: 38 21 6b 20 ori r1,r1,0x6b20 <== NOT EXECUTED
800e3a4: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800e3a8: f8 00 50 b3 calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
rc = rtems_rfs_inode_close (fs, &inode);
800e3ac: 2b 81 01 20 lw r1,(sp+288)
800e3b0: 37 82 00 d0 addi r2,sp,208
800e3b4: f8 00 03 05 calli 800efc8 <rtems_rfs_inode_close>
800e3b8: b8 20 58 00 mv r11,r1
if (rc > 0)
800e3bc: 4c 01 00 07 bge r0,r1,800e3d8 <rtems_rfs_format+0xc68> <== ALWAYS TAKEN
printf ("rtems-rfs: format: inode close failed: %d: %s\n",
800e3c0: f8 00 55 68 calli 8023960 <strerror> <== NOT EXECUTED
800e3c4: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800e3c8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e3cc: 38 21 6b 54 ori r1,r1,0x6b54 <== NOT EXECUTED
800e3d0: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800e3d4: f8 00 50 a8 calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
rc = rtems_rfs_fs_close (fs);
800e3d8: 2b 81 01 20 lw r1,(sp+288)
800e3dc: f8 00 3e 95 calli 801de30 <rtems_rfs_fs_close>
800e3e0: b8 20 58 00 mv r11,r1
if (rc < 0)
800e3e4: 4c 20 00 0d bge r1,r0,800e418 <rtems_rfs_format+0xca8> <== ALWAYS TAKEN
printf ("rtems-rfs: format: file system close failed: %d: %s\n",
errno, strerror (errno));
800e3e8: f8 00 4a 48 calli 8020d08 <__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",
800e3ec: 28 2b 00 00 lw r11,(r1+0) <== NOT EXECUTED
errno, strerror (errno));
800e3f0: f8 00 4a 46 calli 8020d08 <__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",
800e3f4: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
800e3f8: f8 00 55 5a calli 8023960 <strerror> <== NOT EXECUTED
800e3fc: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800e400: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e404: 38 21 6b 84 ori r1,r1,0x6b84 <== NOT EXECUTED
800e408: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800e40c: f8 00 50 9a calli 8022674 <printf> <== NOT EXECUTED
printf ("rtems-rfs: format: writing root dir failed: %d: %s\n",
rc, strerror (rc));
return -1;
}
return 0;
800e410: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
800e414: e0 00 00 0b bi 800e440 <rtems_rfs_format+0xcd0> <== NOT EXECUTED
800e418: 34 03 00 00 mvi r3,0
rc, strerror (rc));
return -1;
}
rc = rtems_rfs_write_root_dir (name);
if (rc > 0)
800e41c: 4c 01 00 09 bge r0,r1,800e440 <rtems_rfs_format+0xcd0> <== ALWAYS TAKEN
{
printf ("rtems-rfs: format: writing root dir failed: %d: %s\n",
800e420: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800e424: f8 00 55 4f calli 8023960 <strerror> <== NOT EXECUTED
800e428: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800e42c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e430: 38 21 6b bc ori r1,r1,0x6bbc <== NOT EXECUTED
800e434: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800e438: f8 00 50 8f calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
return -1;
800e43c: 34 03 ff ff mvi r3,-1 <== NOT EXECUTED
}
return 0;
}
800e440: b8 60 08 00 mv r1,r3
800e444: 2b 9d 00 04 lw ra,(sp+4)
800e448: 2b 8b 00 44 lw r11,(sp+68)
800e44c: 2b 8c 00 40 lw r12,(sp+64)
800e450: 2b 8d 00 3c lw r13,(sp+60)
800e454: 2b 8e 00 38 lw r14,(sp+56)
800e458: 2b 8f 00 34 lw r15,(sp+52)
800e45c: 2b 90 00 30 lw r16,(sp+48)
800e460: 2b 91 00 2c lw r17,(sp+44)
800e464: 2b 92 00 28 lw r18,(sp+40)
800e468: 2b 93 00 24 lw r19,(sp+36)
800e46c: 2b 94 00 20 lw r20,(sp+32)
800e470: 2b 95 00 1c lw r21,(sp+28)
800e474: 2b 96 00 18 lw r22,(sp+24)
800e478: 2b 97 00 14 lw r23,(sp+20)
800e47c: 2b 98 00 10 lw r24,(sp+16)
800e480: 2b 99 00 0c lw r25,(sp+12)
800e484: 2b 9b 00 08 lw fp,(sp+8)
800e488: 37 9c 01 20 addi sp,sp,288
800e48c: c3 a0 00 00 ret
* Check the configuration data.
*/
if (!rtems_rfs_check_config (&fs, config))
return -1;
if (config->verbose)
800e490: 41 81 00 15 lbu r1,(r12+21)
800e494: 44 20 fd c7 be r1,r0,800dbb0 <rtems_rfs_format+0x440> <== ALWAYS TAKEN
800e498: e3 ff fd 76 bi 800da70 <rtems_rfs_format+0x300> <== NOT EXECUTED
0801de30 <rtems_rfs_fs_close>:
return 0;
}
int
rtems_rfs_fs_close (rtems_rfs_file_system* fs)
{
801de30: 37 9c ff f0 addi sp,sp,-16
801de34: 5b 8b 00 10 sw (sp+16),r11
801de38: 5b 8c 00 0c sw (sp+12),r12
801de3c: 5b 8d 00 08 sw (sp+8),r13
801de40: 5b 9d 00 04 sw (sp+4),ra
int group;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_CLOSE))
801de44: 34 02 00 02 mvi r2,2
return 0;
}
int
rtems_rfs_fs_close (rtems_rfs_file_system* fs)
{
801de48: b8 20 58 00 mv r11,r1
int group;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_CLOSE))
801de4c: 34 01 00 00 mvi r1,0
801de50: fb ff cb b6 calli 8010d28 <rtems_rfs_trace>
801de54: 44 20 00 04 be r1,r0,801de64 <rtems_rfs_fs_close+0x34> <== ALWAYS TAKEN
printf ("rtems-rfs: close\n");
801de58: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801de5c: 38 21 8f d0 ori r1,r1,0x8fd0 <== NOT EXECUTED
801de60: f8 00 12 cd calli 8022994 <puts> <== NOT EXECUTED
return 0;
}
int
rtems_rfs_fs_close (rtems_rfs_file_system* fs)
{
801de64: 34 0d 00 00 mvi r13,0
801de68: 34 0c 00 00 mvi r12,0
801de6c: e0 00 00 07 bi 801de88 <rtems_rfs_fs_close+0x58>
if (rtems_rfs_trace (RTEMS_RFS_TRACE_CLOSE))
printf ("rtems-rfs: close\n");
for (group = 0; group < fs->group_count; group++)
rtems_rfs_group_close (fs, &fs->groups[group]);
801de70: 29 62 00 20 lw r2,(r11+32)
801de74: b9 60 08 00 mv r1,r11
int group;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_CLOSE))
printf ("rtems-rfs: close\n");
for (group = 0; group < fs->group_count; group++)
801de78: 35 8c 00 01 addi r12,r12,1
rtems_rfs_group_close (fs, &fs->groups[group]);
801de7c: b4 4d 10 00 add r2,r2,r13
801de80: fb ff c2 0d calli 800e6b4 <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++)
801de84: 35 ad 00 50 addi r13,r13,80
801de88: 29 61 00 24 lw r1,(r11+36)
801de8c: 48 2c ff f9 bg r1,r12,801de70 <rtems_rfs_fs_close+0x40>
rtems_rfs_group_close (fs, &fs->groups[group]);
rtems_rfs_buffer_close (fs);
801de90: b9 60 08 00 mv r1,r11
801de94: fb ff f4 7a calli 801b07c <rtems_rfs_buffer_close>
free (fs);
801de98: b9 60 08 00 mv r1,r11
801de9c: fb ff a1 7c calli 800648c <free>
return 0;
}
801dea0: 34 01 00 00 mvi r1,0
801dea4: 2b 9d 00 04 lw ra,(sp+4)
801dea8: 2b 8b 00 10 lw r11,(sp+16)
801deac: 2b 8c 00 0c lw r12,(sp+12)
801deb0: 2b 8d 00 08 lw r13,(sp+8)
801deb4: 37 9c 00 10 addi sp,sp,16
801deb8: c3 a0 00 00 ret
0801d58c <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)
{
801d58c: 37 9c ff ac addi sp,sp,-84
801d590: 5b 8b 00 20 sw (sp+32),r11
801d594: 5b 8c 00 1c sw (sp+28),r12
801d598: 5b 8d 00 18 sw (sp+24),r13
801d59c: 5b 8e 00 14 sw (sp+20),r14
801d5a0: 5b 8f 00 10 sw (sp+16),r15
801d5a4: 5b 90 00 0c sw (sp+12),r16
801d5a8: 5b 91 00 08 sw (sp+8),r17
801d5ac: 5b 9d 00 04 sw (sp+4),ra
801d5b0: b8 20 60 00 mv r12,r1
801d5b4: b8 40 80 00 mv r16,r2
#endif
rtems_rfs_inode_handle inode;
uint16_t mode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
801d5b8: 34 01 00 00 mvi r1,0
801d5bc: 34 02 00 01 mvi r2,1
rtems_rfs_fs_open (const char* name,
void* user,
uint32_t flags,
uint32_t max_held_buffers,
rtems_rfs_file_system** fs)
{
801d5c0: b8 60 70 00 mv r14,r3
801d5c4: b8 80 78 00 mv r15,r4
801d5c8: b8 a0 68 00 mv r13,r5
#endif
rtems_rfs_inode_handle inode;
uint16_t mode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
801d5cc: fb ff cd d7 calli 8010d28 <rtems_rfs_trace>
801d5d0: 44 20 00 05 be r1,r0,801d5e4 <rtems_rfs_fs_open+0x58> <== ALWAYS TAKEN
printf ("rtems-rfs: open: %s\n", name);
801d5d4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801d5d8: 38 21 8c a8 ori r1,r1,0x8ca8 <== NOT EXECUTED
801d5dc: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
801d5e0: f8 00 14 25 calli 8022674 <printf> <== NOT EXECUTED
*fs = malloc (sizeof (rtems_rfs_file_system));
801d5e4: 34 01 00 84 mvi r1,132
801d5e8: fb ff a5 94 calli 8006c38 <malloc>
801d5ec: 59 a1 00 00 sw (r13+0),r1
801d5f0: b8 20 58 00 mv r11,r1
if (!*fs)
801d5f4: 5c 20 00 0a bne r1,r0,801d61c <rtems_rfs_fs_open+0x90> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
801d5f8: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
801d5fc: fb ff cd cb calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801d600: 45 61 00 04 be r11,r1,801d610 <rtems_rfs_fs_open+0x84> <== NOT EXECUTED
printf ("rtems-rfs: open: no memory for file system data\n");
801d604: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801d608: 38 21 8c c0 ori r1,r1,0x8cc0 <== NOT EXECUTED
801d60c: f8 00 14 e2 calli 8022994 <puts> <== NOT EXECUTED
errno = ENOMEM;
801d610: f8 00 0d be calli 8020d08 <__errno> <== NOT EXECUTED
801d614: 34 02 00 0c mvi r2,12 <== NOT EXECUTED
801d618: e0 00 01 dc bi 801dd88 <rtems_rfs_fs_open+0x7fc> <== NOT EXECUTED
return -1;
}
memset (*fs, 0, sizeof (rtems_rfs_file_system));
801d61c: 34 02 00 00 mvi r2,0
801d620: 34 03 00 84 mvi r3,132
801d624: f8 00 13 78 calli 8022404 <memset>
(*fs)->user = user;
801d628: 29 a6 00 00 lw r6,(r13+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 );
801d62c: 34 c1 00 48 addi r1,r6,72
head->next = tail;
801d630: 58 c1 00 44 sw (r6+68),r1
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
801d634: 34 c1 00 44 addi r1,r6,68
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
801d638: 58 c1 00 4c sw (r6+76),r1
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 );
801d63c: 34 c1 00 58 addi r1,r6,88
head->next = tail;
801d640: 58 c1 00 54 sw (r6+84),r1
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
801d644: 34 c1 00 54 addi r1,r6,84
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
801d648: 58 c1 00 5c sw (r6+92),r1
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 );
801d64c: 34 c1 00 68 addi r1,r6,104
head->next = tail;
801d650: 58 c1 00 64 sw (r6+100),r1
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
801d654: 34 c1 00 64 addi r1,r6,100
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
801d658: 58 c1 00 6c sw (r6+108),r1
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 );
801d65c: 34 c1 00 78 addi r1,r6,120
head->next = tail;
801d660: 58 c1 00 74 sw (r6+116),r1
*/
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
801d664: 34 c1 00 74 addi r1,r6,116
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
801d668: 58 c1 00 7c sw (r6+124),r1
801d66c: 58 d0 00 80 sw (r6+128),r16
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
801d670: 58 c0 00 48 sw (r6+72),r0
801d674: 58 c0 00 58 sw (r6+88),r0
801d678: 58 c0 00 68 sw (r6+104),r0
801d67c: 58 c0 00 78 sw (r6+120),r0
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;
801d680: 58 cf 00 40 sw (r6+64),r15
(*fs)->buffers_count = 0;
801d684: 58 c0 00 50 sw (r6+80),r0
(*fs)->release_count = 0;
801d688: 58 c0 00 60 sw (r6+96),r0
(*fs)->release_modified_count = 0;
801d68c: 58 c0 00 70 sw (r6+112),r0
(*fs)->flags = flags;
801d690: 58 ce 00 00 sw (r6+0),r14
#endif
/*
* Open the buffer interface.
*/
rc = rtems_rfs_buffer_open (name, *fs);
801d694: b9 80 08 00 mv r1,r12
801d698: b8 c0 10 00 mv r2,r6
801d69c: fb ff f5 95 calli 801acf0 <rtems_rfs_buffer_open>
801d6a0: b8 20 58 00 mv r11,r1
if (rc > 0)
801d6a4: 4c 01 00 12 bge r0,r1,801d6ec <rtems_rfs_fs_open+0x160> <== ALWAYS TAKEN
{
free (*fs);
801d6a8: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED
801d6ac: fb ff a3 78 calli 800648c <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
801d6b0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801d6b4: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
801d6b8: fb ff cd 9c calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801d6bc: 44 20 00 08 be r1,r0,801d6dc <rtems_rfs_fs_open+0x150> <== NOT EXECUTED
printf ("rtems-rfs: open: buffer open failed: %d: %s\n",
801d6c0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801d6c4: f8 00 18 a7 calli 8023960 <strerror> <== NOT EXECUTED
801d6c8: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801d6cc: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801d6d0: 38 21 8c f0 ori r1,r1,0x8cf0 <== NOT EXECUTED
801d6d4: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801d6d8: f8 00 13 e7 calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
errno = rc;
801d6dc: f8 00 0d 8b calli 8020d08 <__errno> <== NOT EXECUTED
801d6e0: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
return -1;
801d6e4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
801d6e8: e0 00 01 c0 bi 801dde8 <rtems_rfs_fs_open+0x85c> <== NOT EXECUTED
}
rc = rtems_rfs_fs_read_superblock (*fs);
801d6ec: 29 ac 00 00 lw r12,(r13+0)
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);
801d6f0: 37 82 00 4c addi r2,sp,76
801d6f4: 34 03 00 00 mvi r3,0
801d6f8: b9 80 08 00 mv r1,r12
801d6fc: 34 04 00 01 mvi r4,1
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
801d700: 33 80 00 4c sb (sp+76),r0
handle->bnum = 0;
801d704: 5b 80 00 50 sw (sp+80),r0
handle->buffer = NULL;
801d708: 5b 80 00 54 sw (sp+84),r0
801d70c: fb ff f4 df calli 801aa88 <rtems_rfs_buffer_handle_request>
801d710: b8 20 58 00 mv r11,r1
if (rc > 0)
801d714: 4c 01 00 0b bge r0,r1,801d740 <rtems_rfs_fs_open+0x1b4> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
801d718: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801d71c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
801d720: fb ff cd 82 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801d724: 44 20 01 5c be r1,r0,801dc94 <rtems_rfs_fs_open+0x708> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: request failed%d: %s\n",
801d728: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801d72c: f8 00 18 8d calli 8023960 <strerror> <== NOT EXECUTED
801d730: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801d734: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801d738: 38 21 8d 20 ori r1,r1,0x8d20 <== NOT EXECUTED
801d73c: e0 00 01 0f bi 801db78 <rtems_rfs_fs_open+0x5ec> <== NOT EXECUTED
rc, strerror (rc));
return rc;
}
sb = rtems_rfs_buffer_data (&handle);
801d740: 2b 81 00 54 lw r1,(sp+84)
#define read_sb(_o) rtems_rfs_read_u32 (sb + (_o))
if (read_sb (RTEMS_RFS_SB_OFFSET_MAGIC) != RTEMS_RFS_SB_MAGIC)
801d744: 34 02 00 18 mvi r2,24
printf ("rtems-rfs: read-superblock: request failed%d: %s\n",
rc, strerror (rc));
return rc;
}
sb = rtems_rfs_buffer_data (&handle);
801d748: 28 2b 00 1c lw r11,(r1+28)
#define read_sb(_o) rtems_rfs_read_u32 (sb + (_o))
if (read_sb (RTEMS_RFS_SB_OFFSET_MAGIC) != RTEMS_RFS_SB_MAGIC)
801d74c: 41 61 00 00 lbu r1,(r11+0)
801d750: 41 6e 00 03 lbu r14,(r11+3)
801d754: fb ff 8f 63 calli 80014e0 <__ashlsi3>
801d758: b9 c1 70 00 or r14,r14,r1
801d75c: 41 61 00 01 lbu r1,(r11+1)
801d760: 34 02 00 10 mvi r2,16
801d764: fb ff 8f 5f calli 80014e0 <__ashlsi3>
801d768: b9 c1 70 00 or r14,r14,r1
801d76c: 41 61 00 02 lbu r1,(r11+2)
801d770: 34 02 00 08 mvi r2,8
801d774: fb ff 8f 5b calli 80014e0 <__ashlsi3>
801d778: 78 03 08 03 mvhi r3,0x803
801d77c: 38 63 6f 50 ori r3,r3,0x6f50
801d780: 28 62 00 00 lw r2,(r3+0)
801d784: b9 c1 08 00 or r1,r14,r1
801d788: 44 22 00 08 be r1,r2,801d7a8 <rtems_rfs_fs_open+0x21c> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
801d78c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801d790: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
801d794: fb ff cd 65 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801d798: 44 20 00 62 be r1,r0,801d920 <rtems_rfs_fs_open+0x394> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: invalid superblock, bad magic\n");
801d79c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801d7a0: 38 21 8d 54 ori r1,r1,0x8d54 <== NOT EXECUTED
801d7a4: e0 00 00 36 bi 801d87c <rtems_rfs_fs_open+0x2f0> <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &handle);
return EIO;
}
fs->blocks = read_sb (RTEMS_RFS_SB_OFFSET_BLOCKS);
801d7a8: 41 61 00 0c lbu r1,(r11+12)
801d7ac: 34 02 00 18 mvi r2,24
801d7b0: fb ff 8f 4c calli 80014e0 <__ashlsi3>
801d7b4: b8 20 78 00 mv r15,r1
801d7b8: 41 61 00 0d lbu r1,(r11+13)
801d7bc: 34 02 00 10 mvi r2,16
801d7c0: fb ff 8f 48 calli 80014e0 <__ashlsi3>
801d7c4: b9 e1 08 00 or r1,r15,r1
801d7c8: 41 6f 00 0f lbu r15,(r11+15)
801d7cc: 34 02 00 08 mvi r2,8
801d7d0: b8 2f 78 00 or r15,r1,r15
801d7d4: 41 61 00 0e lbu r1,(r11+14)
801d7d8: fb ff 8f 42 calli 80014e0 <__ashlsi3>
801d7dc: b9 e1 78 00 or r15,r15,r1
801d7e0: 59 8f 00 04 sw (r12+4),r15
fs->block_size = read_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE);
801d7e4: 41 61 00 08 lbu r1,(r11+8)
801d7e8: 34 02 00 18 mvi r2,24
801d7ec: fb ff 8f 3d calli 80014e0 <__ashlsi3>
801d7f0: b8 20 70 00 mv r14,r1
801d7f4: 41 61 00 09 lbu r1,(r11+9)
801d7f8: 34 02 00 10 mvi r2,16
801d7fc: fb ff 8f 39 calli 80014e0 <__ashlsi3>
801d800: b9 c1 08 00 or r1,r14,r1
801d804: 41 6e 00 0b lbu r14,(r11+11)
801d808: 34 02 00 08 mvi r2,8
801d80c: b8 2e 70 00 or r14,r1,r14
801d810: 41 61 00 0a lbu r1,(r11+10)
801d814: fb ff 8f 33 calli 80014e0 <__ashlsi3>
801d818: b9 c1 70 00 or r14,r14,r1
}
uint64_t
rtems_rfs_fs_media_size (rtems_rfs_file_system* fs)
{
uint64_t media_blocks = (uint64_t) rtems_rfs_fs_media_blocks (fs);
801d81c: 29 91 00 10 lw r17,(r12+16)
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;
801d820: b9 e0 20 00 mv r4,r15
801d824: 34 03 00 00 mvi r3,0
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);
801d828: 59 8e 00 08 sw (r12+8),r14
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;
801d82c: 34 01 00 00 mvi r1,0
801d830: b9 c0 10 00 mv r2,r14
801d834: f8 00 44 dd calli 802eba8 <__muldi3>
801d838: b8 40 80 00 mv r16,r2
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;
801d83c: 2a 24 00 1c lw r4,(r17+28)
801d840: 2a 22 00 20 lw r2,(r17+32)
uint64_t
rtems_rfs_fs_size (rtems_rfs_file_system* fs)
{
uint64_t blocks = rtems_rfs_fs_blocks (fs);
uint64_t block_size = rtems_rfs_fs_block_size (fs);
return blocks * block_size;
801d844: b8 20 78 00 mv r15,r1
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;
801d848: 34 03 00 00 mvi r3,0
801d84c: 34 01 00 00 mvi r1,0
801d850: f8 00 44 d6 calli 802eba8 <__muldi3>
}
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))
801d854: 55 e1 00 04 bgu r15,r1,801d864 <rtems_rfs_fs_open+0x2d8> <== NEVER TAKEN
801d858: 5d e1 00 0b bne r15,r1,801d884 <rtems_rfs_fs_open+0x2f8> <== NEVER TAKEN
801d85c: 56 02 00 02 bgu r16,r2,801d864 <rtems_rfs_fs_open+0x2d8> <== NEVER TAKEN
801d860: e0 00 00 09 bi 801d884 <rtems_rfs_fs_open+0x2f8>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
801d864: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801d868: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
801d86c: fb ff cd 2f calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801d870: 44 20 00 2c be r1,r0,801d920 <rtems_rfs_fs_open+0x394> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: invalid superblock block/size count\n");
801d874: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801d878: 38 21 8d 90 ori r1,r1,0x8d90 <== NOT EXECUTED
801d87c: f8 00 14 46 calli 8022994 <puts> <== NOT EXECUTED
801d880: e0 00 00 28 bi 801d920 <rtems_rfs_fs_open+0x394> <== NOT EXECUTED
read_sb (RTEMS_RFS_SB_OFFSET_VERSION), RTEMS_RFS_VERSION_MASK);
rtems_rfs_buffer_handle_close (fs, &handle);
return EIO;
}
if (read_sb (RTEMS_RFS_SB_OFFSET_INODE_SIZE) != RTEMS_RFS_INODE_SIZE)
801d884: 41 61 00 24 lbu r1,(r11+36)
801d888: 34 02 00 18 mvi r2,24
801d88c: fb ff 8f 15 calli 80014e0 <__ashlsi3>
801d890: b8 20 78 00 mv r15,r1
801d894: 41 61 00 25 lbu r1,(r11+37)
801d898: 34 02 00 10 mvi r2,16
801d89c: fb ff 8f 11 calli 80014e0 <__ashlsi3>
801d8a0: b9 e1 08 00 or r1,r15,r1
801d8a4: 41 6f 00 27 lbu r15,(r11+39)
801d8a8: 34 02 00 08 mvi r2,8
801d8ac: b8 2f 78 00 or r15,r1,r15
801d8b0: 41 61 00 26 lbu r1,(r11+38)
801d8b4: fb ff 8f 0b calli 80014e0 <__ashlsi3>
801d8b8: b9 e1 08 00 or r1,r15,r1
801d8bc: 34 02 00 38 mvi r2,56
801d8c0: 44 22 00 1d be r1,r2,801d934 <rtems_rfs_fs_open+0x3a8> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
801d8c4: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801d8c8: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
801d8cc: fb ff cd 17 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801d8d0: 44 20 00 14 be r1,r0,801d920 <rtems_rfs_fs_open+0x394> <== 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);
801d8d4: 41 61 00 04 lbu r1,(r11+4) <== NOT EXECUTED
801d8d8: 34 02 00 18 mvi r2,24 <== 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",
801d8dc: 78 0e 08 03 mvhi r14,0x803 <== NOT EXECUTED
read_sb (RTEMS_RFS_SB_OFFSET_VERSION), RTEMS_RFS_VERSION_MASK);
801d8e0: fb ff 8f 00 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801d8e4: b8 20 78 00 mv r15,r1 <== NOT EXECUTED
801d8e8: 41 61 00 05 lbu r1,(r11+5) <== NOT EXECUTED
801d8ec: 34 02 00 10 mvi r2,16 <== 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",
801d8f0: 39 ce 8d d0 ori r14,r14,0x8dd0 <== NOT EXECUTED
read_sb (RTEMS_RFS_SB_OFFSET_VERSION), RTEMS_RFS_VERSION_MASK);
801d8f4: fb ff 8e fb calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801d8f8: b9 e1 08 00 or r1,r15,r1 <== NOT EXECUTED
801d8fc: 41 6f 00 07 lbu r15,(r11+7) <== NOT EXECUTED
801d900: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
801d904: b8 2f 78 00 or r15,r1,r15 <== NOT EXECUTED
801d908: 41 61 00 06 lbu r1,(r11+6) <== NOT EXECUTED
801d90c: fb ff 8e f5 calli 80014e0 <__ashlsi3> <== 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",
801d910: b9 e1 10 00 or r2,r15,r1 <== NOT EXECUTED
801d914: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
801d918: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
801d91c: f8 00 13 56 calli 8022674 <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);
801d920: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801d924: 37 82 00 4c addi r2,sp,76 <== NOT EXECUTED
801d928: fb ff f3 e9 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
read_sb (RTEMS_RFS_SB_OFFSET_VERSION), RTEMS_RFS_VERSION_MASK);
rtems_rfs_buffer_handle_close (fs, &handle);
return EIO;
801d92c: 34 0b 00 05 mvi r11,5 <== NOT EXECUTED
801d930: e0 00 00 d9 bi 801dc94 <rtems_rfs_fs_open+0x708> <== NOT EXECUTED
}
fs->bad_blocks = read_sb (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS);
801d934: 41 61 00 10 lbu r1,(r11+16)
801d938: 34 02 00 18 mvi r2,24
801d93c: fb ff 8e e9 calli 80014e0 <__ashlsi3>
801d940: b8 20 78 00 mv r15,r1
801d944: 41 61 00 11 lbu r1,(r11+17)
801d948: 34 02 00 10 mvi r2,16
801d94c: fb ff 8e e5 calli 80014e0 <__ashlsi3>
801d950: b9 e1 08 00 or r1,r15,r1
801d954: 41 6f 00 13 lbu r15,(r11+19)
801d958: 34 02 00 08 mvi r2,8
801d95c: b8 2f 78 00 or r15,r1,r15
801d960: 41 61 00 12 lbu r1,(r11+18)
801d964: fb ff 8e df calli 80014e0 <__ashlsi3>
801d968: b9 e1 08 00 or r1,r15,r1
801d96c: 59 81 00 18 sw (r12+24),r1
fs->max_name_length = read_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH);
801d970: 41 61 00 14 lbu r1,(r11+20)
801d974: 34 02 00 18 mvi r2,24
801d978: fb ff 8e da calli 80014e0 <__ashlsi3>
801d97c: b8 20 78 00 mv r15,r1
801d980: 41 61 00 15 lbu r1,(r11+21)
801d984: 34 02 00 10 mvi r2,16
801d988: fb ff 8e d6 calli 80014e0 <__ashlsi3>
801d98c: b9 e1 08 00 or r1,r15,r1
801d990: 41 6f 00 17 lbu r15,(r11+23)
801d994: 34 02 00 08 mvi r2,8
801d998: b8 2f 78 00 or r15,r1,r15
801d99c: 41 61 00 16 lbu r1,(r11+22)
801d9a0: fb ff 8e d0 calli 80014e0 <__ashlsi3>
801d9a4: b9 e1 08 00 or r1,r15,r1
801d9a8: 59 81 00 1c sw (r12+28),r1
fs->group_count = read_sb (RTEMS_RFS_SB_OFFSET_GROUPS);
801d9ac: 41 61 00 18 lbu r1,(r11+24)
801d9b0: 34 02 00 18 mvi r2,24
801d9b4: fb ff 8e cb calli 80014e0 <__ashlsi3>
801d9b8: b8 20 80 00 mv r16,r1
801d9bc: 41 61 00 19 lbu r1,(r11+25)
801d9c0: 34 02 00 10 mvi r2,16
801d9c4: fb ff 8e c7 calli 80014e0 <__ashlsi3>
801d9c8: ba 01 08 00 or r1,r16,r1
801d9cc: 41 70 00 1b lbu r16,(r11+27)
801d9d0: 34 02 00 08 mvi r2,8
801d9d4: b8 30 80 00 or r16,r1,r16
801d9d8: 41 61 00 1a lbu r1,(r11+26)
801d9dc: fb ff 8e c1 calli 80014e0 <__ashlsi3>
801d9e0: ba 01 80 00 or r16,r16,r1
801d9e4: 59 90 00 24 sw (r12+36),r16
fs->group_blocks = read_sb (RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS);
801d9e8: 41 61 00 1c lbu r1,(r11+28)
801d9ec: 34 02 00 18 mvi r2,24
801d9f0: fb ff 8e bc calli 80014e0 <__ashlsi3>
801d9f4: b8 20 78 00 mv r15,r1
801d9f8: 41 61 00 1d lbu r1,(r11+29)
801d9fc: 34 02 00 10 mvi r2,16
801da00: fb ff 8e b8 calli 80014e0 <__ashlsi3>
801da04: b9 e1 08 00 or r1,r15,r1
801da08: 41 6f 00 1f lbu r15,(r11+31)
801da0c: 34 02 00 08 mvi r2,8
801da10: b8 2f 78 00 or r15,r1,r15
801da14: 41 61 00 1e lbu r1,(r11+30)
801da18: fb ff 8e b2 calli 80014e0 <__ashlsi3>
801da1c: b9 e1 78 00 or r15,r15,r1
801da20: 59 8f 00 28 sw (r12+40),r15
fs->group_inodes = read_sb (RTEMS_RFS_SB_OFFSET_GROUP_INODES);
801da24: 41 61 00 20 lbu r1,(r11+32)
801da28: 34 02 00 18 mvi r2,24
801da2c: fb ff 8e ad calli 80014e0 <__ashlsi3>
801da30: b8 20 88 00 mv r17,r1
801da34: 41 61 00 21 lbu r1,(r11+33)
801da38: 34 02 00 10 mvi r2,16
801da3c: fb ff 8e a9 calli 80014e0 <__ashlsi3>
801da40: ba 21 08 00 or r1,r17,r1
801da44: 41 71 00 23 lbu r17,(r11+35)
801da48: 34 02 00 08 mvi r2,8
801da4c: b8 31 88 00 or r17,r1,r17
801da50: 41 61 00 22 lbu r1,(r11+34)
801da54: fb ff 8e a3 calli 80014e0 <__ashlsi3>
801da58: ba 21 88 00 or r17,r17,r1
fs->blocks_per_block =
rtems_rfs_fs_block_size (fs) / sizeof (rtems_rfs_inode_block);
801da5c: 34 02 00 02 mvi r2,2
801da60: b9 c0 08 00 mv r1,r14
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);
801da64: 59 91 00 2c sw (r12+44),r17
fs->blocks_per_block =
rtems_rfs_fs_block_size (fs) / sizeof (rtems_rfs_inode_block);
801da68: fb ff 8e c5 calli 800157c <__lshrsi3>
fs->block_map_singly_blocks =
fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
801da6c: 34 02 00 02 mvi r2,2
fs->max_name_length = read_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH);
fs->group_count = read_sb (RTEMS_RFS_SB_OFFSET_GROUPS);
fs->group_blocks = read_sb (RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS);
fs->group_inodes = read_sb (RTEMS_RFS_SB_OFFSET_GROUP_INODES);
fs->blocks_per_block =
801da70: 59 81 00 34 sw (r12+52),r1
rtems_rfs_fs_block_size (fs) / sizeof (rtems_rfs_inode_block);
801da74: b8 20 58 00 mv r11,r1
fs->block_map_singly_blocks =
fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
801da78: fb ff 8e 9a calli 80014e0 <__ashlsi3>
801da7c: b4 2b 08 00 add r1,r1,r11
fs->block_map_doubly_blocks =
fs->blocks_per_block * fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
801da80: b9 60 10 00 mv r2,r11
fs->group_inodes = read_sb (RTEMS_RFS_SB_OFFSET_GROUP_INODES);
fs->blocks_per_block =
rtems_rfs_fs_block_size (fs) / sizeof (rtems_rfs_inode_block);
fs->block_map_singly_blocks =
801da84: 59 81 00 38 sw (r12+56),r1
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;
801da88: b9 60 08 00 mv r1,r11
801da8c: fb ff 8e e3 calli 8001618 <__mulsi3>
801da90: 34 02 00 02 mvi r2,2
801da94: b8 20 58 00 mv r11,r1
801da98: fb ff 8e 92 calli 80014e0 <__ashlsi3>
801da9c: b4 2b 08 00 add r1,r1,r11
fs->blocks_per_block =
rtems_rfs_fs_block_size (fs) / sizeof (rtems_rfs_inode_block);
fs->block_map_singly_blocks =
fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
fs->block_map_doubly_blocks =
801daa0: 59 81 00 3c sw (r12+60),r1
fs->blocks_per_block * fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
fs->inodes = fs->group_count * fs->group_inodes;
801daa4: ba 00 10 00 mv r2,r16
801daa8: ba 20 08 00 mv r1,r17
801daac: fb ff 8e db calli 8001618 <__mulsi3>
801dab0: 59 81 00 14 sw (r12+20),r1
fs->inodes_per_block = fs->block_size / RTEMS_RFS_INODE_SIZE;
801dab4: 34 02 00 38 mvi r2,56
801dab8: b9 c0 08 00 mv r1,r14
801dabc: fb ff 8e e3 calli 8001648 <__udivsi3>
801dac0: 59 81 00 30 sw (r12+48),r1
if (fs->group_blocks >
rtems_rfs_bitmap_numof_bits (rtems_rfs_fs_block_size (fs)))
801dac4: 34 02 00 03 mvi r2,3
801dac8: b9 c0 08 00 mv r1,r14
801dacc: fb ff 8e 85 calli 80014e0 <__ashlsi3>
801dad0: 37 8e 00 4c addi r14,sp,76
fs->inodes = fs->group_count * fs->group_inodes;
fs->inodes_per_block = fs->block_size / RTEMS_RFS_INODE_SIZE;
if (fs->group_blocks >
801dad4: 50 2f 00 0f bgeu r1,r15,801db10 <rtems_rfs_fs_open+0x584> <== ALWAYS TAKEN
801dad8: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
801dadc: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801dae0: fb ff f3 7b calli 801a8cc <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))
801dae4: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801dae8: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
handle->dirty = false;
801daec: 33 80 00 4c sb (sp+76),r0 <== NOT EXECUTED
handle->bnum = 0;
801daf0: 5b 80 00 50 sw (sp+80),r0 <== NOT EXECUTED
handle->buffer = NULL;
801daf4: 5b 80 00 54 sw (sp+84),r0 <== NOT EXECUTED
801daf8: fb ff cc 8c calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: groups blocks larger than block bits\n");
return EIO;
801dafc: 34 0b 00 05 mvi r11,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))
801db00: 44 20 00 65 be r1,r0,801dc94 <rtems_rfs_fs_open+0x708> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: groups blocks larger than block bits\n");
801db04: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801db08: 38 21 8e 14 ori r1,r1,0x8e14 <== NOT EXECUTED
801db0c: e0 00 00 34 bi 801dbdc <rtems_rfs_fs_open+0x650> <== 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);
801db10: b9 c0 10 00 mv r2,r14
801db14: b9 80 08 00 mv r1,r12
801db18: fb ff f3 6d calli 801a8cc <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));
801db1c: 29 82 00 08 lw r2,(r12+8)
801db20: b9 80 08 00 mv r1,r12
handle->dirty = false;
801db24: 33 80 00 4c sb (sp+76),r0
handle->bnum = 0;
801db28: 5b 80 00 50 sw (sp+80),r0
handle->buffer = NULL;
801db2c: 5b 80 00 54 sw (sp+84),r0
801db30: fb ff f5 18 calli 801af90 <rtems_rfs_buffer_setblksize>
801db34: b8 20 58 00 mv r11,r1
if (rc > 0)
801db38: 4c 01 00 13 bge r0,r1,801db84 <rtems_rfs_fs_open+0x5f8> <== ALWAYS TAKEN
*/
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);
801db3c: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
801db40: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801db44: fb ff f3 62 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
801db48: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801db4c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
handle->dirty = false;
801db50: 33 80 00 4c sb (sp+76),r0 <== NOT EXECUTED
handle->bnum = 0;
801db54: 5b 80 00 50 sw (sp+80),r0 <== NOT EXECUTED
handle->buffer = NULL;
801db58: 5b 80 00 54 sw (sp+84),r0 <== NOT EXECUTED
801db5c: fb ff cc 73 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801db60: 44 20 00 4d be r1,r0,801dc94 <rtems_rfs_fs_open+0x708> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: invalid superblock block size%d: %s\n",
801db64: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801db68: f8 00 17 7e calli 8023960 <strerror> <== NOT EXECUTED
801db6c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801db70: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801db74: 38 21 8e 58 ori r1,r1,0x8e58 <== NOT EXECUTED
801db78: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801db7c: f8 00 12 be calli 8022674 <printf> <== NOT EXECUTED
801db80: e0 00 00 45 bi 801dc94 <rtems_rfs_fs_open+0x708> <== NOT EXECUTED
rc, strerror (rc));
return rc;
}
fs->groups = calloc (fs->group_count, sizeof (rtems_rfs_group));
801db84: 29 81 00 24 lw r1,(r12+36)
801db88: 34 02 00 50 mvi r2,80
801db8c: fb ff a1 c2 calli 8006294 <calloc>
801db90: 59 81 00 20 sw (r12+32),r1
801db94: b8 20 78 00 mv r15,r1
if (!fs->groups)
801db98: 44 20 00 04 be r1,r0,801dba8 <rtems_rfs_fs_open+0x61c> <== NEVER TAKEN
801db9c: 34 0f 00 00 mvi r15,0
801dba0: 34 0e 00 00 mvi r14,0
801dba4: e0 00 00 39 bi 801dc88 <rtems_rfs_fs_open+0x6fc>
*/
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);
801dba8: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
801dbac: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801dbb0: fb ff f3 47 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
801dbb4: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801dbb8: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
handle->dirty = false;
801dbbc: 33 80 00 4c sb (sp+76),r0 <== NOT EXECUTED
handle->bnum = 0;
801dbc0: 5b 80 00 50 sw (sp+80),r0 <== NOT EXECUTED
handle->buffer = NULL;
801dbc4: 5b 80 00 54 sw (sp+84),r0 <== NOT EXECUTED
801dbc8: fb ff cc 58 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: no memory for group table\n");
return ENOMEM;
801dbcc: 34 0b 00 0c mvi r11,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))
801dbd0: 45 e1 00 31 be r15,r1,801dc94 <rtems_rfs_fs_open+0x708> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: no memory for group table\n");
801dbd4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801dbd8: 38 21 8e 9c ori r1,r1,0x8e9c <== NOT EXECUTED
801dbdc: f8 00 13 6e calli 8022994 <puts> <== NOT EXECUTED
801dbe0: e0 00 00 2d bi 801dc94 <rtems_rfs_fs_open+0x708> <== NOT EXECUTED
* close everything.
*/
for (group = 0; group < fs->group_count; group++)
{
rc = rtems_rfs_group_open (fs,
rtems_rfs_fs_block (fs, group, 0),
801dbe4: 29 8b 00 28 lw r11,(r12+40)
801dbe8: b9 c0 08 00 mv r1,r14
801dbec: b9 60 10 00 mv r2,r11
801dbf0: fb ff 8e 8a calli 8001618 <__mulsi3>
* 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,
801dbf4: 29 85 00 20 lw r5,(r12+32)
801dbf8: 29 84 00 2c lw r4,(r12+44)
rtems_rfs_fs_block (fs, group, 0),
801dbfc: 34 22 00 01 addi r2,r1,1
* 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,
801dc00: b9 60 18 00 mv r3,r11
801dc04: b4 af 28 00 add r5,r5,r15
801dc08: b9 80 08 00 mv r1,r12
801dc0c: fb ff c2 24 calli 800e49c <rtems_rfs_group_open>
801dc10: b8 20 58 00 mv r11,r1
801dc14: 35 ef 00 50 addi r15,r15,80
rtems_rfs_fs_block (fs, group, 0),
fs->group_blocks,
fs->group_inodes,
&fs->groups[group]);
if (rc > 0)
801dc18: 4c 01 00 1b bge r0,r1,801dc84 <rtems_rfs_fs_open+0x6f8> <== ALWAYS TAKEN
801dc1c: 34 10 00 00 mvi r16,0 <== NOT EXECUTED
801dc20: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED
801dc24: e0 00 00 07 bi 801dc40 <rtems_rfs_fs_open+0x6b4> <== NOT EXECUTED
{
int g;
for (g = 0; g < group; g++)
rtems_rfs_group_close (fs, &fs->groups[g]);
801dc28: 29 82 00 20 lw r2,(r12+32) <== NOT EXECUTED
801dc2c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
fs->group_inodes,
&fs->groups[group]);
if (rc > 0)
{
int g;
for (g = 0; g < group; g++)
801dc30: 35 ef 00 01 addi r15,r15,1 <== NOT EXECUTED
rtems_rfs_group_close (fs, &fs->groups[g]);
801dc34: b4 50 10 00 add r2,r2,r16 <== NOT EXECUTED
801dc38: fb ff c2 9f calli 800e6b4 <rtems_rfs_group_close> <== NOT EXECUTED
fs->group_inodes,
&fs->groups[group]);
if (rc > 0)
{
int g;
for (g = 0; g < group; g++)
801dc3c: 36 10 00 50 addi r16,r16,80 <== NOT EXECUTED
801dc40: 49 cf ff fa bg r14,r15,801dc28 <rtems_rfs_fs_open+0x69c> <== 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);
801dc44: 37 82 00 4c addi r2,sp,76 <== NOT EXECUTED
801dc48: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801dc4c: fb ff f3 20 calli 801a8cc <rtems_rfs_buffer_handle_release><== 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))
801dc50: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801dc54: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
handle->dirty = false;
801dc58: 33 80 00 4c sb (sp+76),r0 <== NOT EXECUTED
handle->bnum = 0;
801dc5c: 5b 80 00 50 sw (sp+80),r0 <== NOT EXECUTED
handle->buffer = NULL;
801dc60: 5b 80 00 54 sw (sp+84),r0 <== NOT EXECUTED
801dc64: fb ff cc 31 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801dc68: 44 20 00 0b be r1,r0,801dc94 <rtems_rfs_fs_open+0x708> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: no memory for group table%d: %s\n",
801dc6c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801dc70: f8 00 17 3c calli 8023960 <strerror> <== NOT EXECUTED
801dc74: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801dc78: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801dc7c: 38 21 8e d4 ori r1,r1,0x8ed4 <== NOT EXECUTED
801dc80: e3 ff ff be bi 801db78 <rtems_rfs_fs_open+0x5ec> <== NOT EXECUTED
/*
* Perform each phase of group initialisation at the same time. This way we
* know how far the initialisation has gone if an error occurs and we need to
* close everything.
*/
for (group = 0; group < fs->group_count; group++)
801dc84: 35 ce 00 01 addi r14,r14,1
801dc88: 29 81 00 24 lw r1,(r12+36)
801dc8c: 48 2e ff d6 bg r1,r14,801dbe4 <rtems_rfs_fs_open+0x658>
801dc90: e0 00 00 60 bi 801de10 <rtems_rfs_fs_open+0x884>
}
rc = rtems_rfs_fs_read_superblock (*fs);
if (rc > 0)
{
rtems_rfs_buffer_close (*fs);
801dc94: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED
801dc98: fb ff f4 f9 calli 801b07c <rtems_rfs_buffer_close> <== NOT EXECUTED
free (*fs);
801dc9c: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED
801dca0: fb ff a1 fb calli 800648c <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
801dca4: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801dca8: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
801dcac: fb ff cc 1f calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801dcb0: 44 20 fe 8b be r1,r0,801d6dc <rtems_rfs_fs_open+0x150> <== NOT EXECUTED
printf ("rtems-rfs: open: reading superblock: %d: %s\n",
801dcb4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801dcb8: f8 00 17 2a calli 8023960 <strerror> <== NOT EXECUTED
801dcbc: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801dcc0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801dcc4: 38 21 8f 14 ori r1,r1,0x8f14 <== NOT EXECUTED
801dcc8: e3 ff fe 83 bi 801d6d4 <rtems_rfs_fs_open+0x148> <== NOT EXECUTED
}
rc = rtems_rfs_inode_open (*fs, RTEMS_RFS_ROOT_INO, &inode, true);
if (rc > 0)
{
rtems_rfs_buffer_close (*fs);
801dccc: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED
801dcd0: fb ff f4 eb calli 801b07c <rtems_rfs_buffer_close> <== NOT EXECUTED
free (*fs);
801dcd4: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED
801dcd8: fb ff a1 ed calli 800648c <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
801dcdc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801dce0: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
801dce4: fb ff cc 11 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801dce8: 44 20 fe 7d be r1,r0,801d6dc <rtems_rfs_fs_open+0x150> <== NOT EXECUTED
printf ("rtems-rfs: open: reading root inode: %d: %s\n",
801dcec: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801dcf0: f8 00 17 1c calli 8023960 <strerror> <== NOT EXECUTED
801dcf4: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801dcf8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801dcfc: 38 21 8f 44 ori r1,r1,0x8f44 <== NOT EXECUTED
801dd00: e3 ff fe 75 bi 801d6d4 <rtems_rfs_fs_open+0x148> <== NOT EXECUTED
rc, strerror (rc));
errno = rc;
return -1;
}
if (((*fs)->flags & RTEMS_RFS_FS_FORCE_OPEN) == 0)
801dd04: 29 ab 00 00 lw r11,(r13+0)
801dd08: 29 61 00 00 lw r1,(r11+0)
801dd0c: 20 21 00 04 andi r1,r1,0x4
801dd10: 5c 20 00 20 bne r1,r0,801dd90 <rtems_rfs_fs_open+0x804>
* @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);
801dd14: 2b 81 00 30 lw r1,(sp+48)
801dd18: 34 02 00 08 mvi r2,8
801dd1c: 34 2c 00 02 addi r12,r1,2
801dd20: 40 21 00 02 lbu r1,(r1+2)
801dd24: fb ff 8d ef calli 80014e0 <__ashlsi3>
801dd28: 41 82 00 01 lbu r2,(r12+1)
801dd2c: b8 22 08 00 or r1,r1,r2
801dd30: 20 21 ff ff andi r1,r1,0xffff
{
mode = rtems_rfs_inode_get_mode (&inode);
if ((mode == 0xffff) || !RTEMS_RFS_S_ISDIR (mode))
801dd34: 38 02 ff ff mvu r2,0xffff
801dd38: 44 22 00 04 be r1,r2,801dd48 <rtems_rfs_fs_open+0x7bc> <== NEVER TAKEN
801dd3c: 20 21 f0 00 andi r1,r1,0xf000
801dd40: 34 02 40 00 mvi r2,16384
801dd44: 44 22 00 13 be r1,r2,801dd90 <rtems_rfs_fs_open+0x804> <== ALWAYS TAKEN
{
rtems_rfs_inode_close (*fs, &inode);
801dd48: 37 82 00 24 addi r2,sp,36 <== NOT EXECUTED
801dd4c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801dd50: fb ff c4 9e calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
rtems_rfs_buffer_close (*fs);
801dd54: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED
801dd58: fb ff f4 c9 calli 801b07c <rtems_rfs_buffer_close> <== NOT EXECUTED
free (*fs);
801dd5c: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED
801dd60: fb ff a1 cb calli 800648c <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
801dd64: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801dd68: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
801dd6c: fb ff cb ef calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801dd70: 44 20 00 04 be r1,r0,801dd80 <rtems_rfs_fs_open+0x7f4> <== NOT EXECUTED
printf ("rtems-rfs: open: invalid root inode mode\n");
801dd74: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801dd78: 38 21 8f 74 ori r1,r1,0x8f74 <== NOT EXECUTED
801dd7c: f8 00 13 06 calli 8022994 <puts> <== NOT EXECUTED
errno = EIO;
801dd80: f8 00 0b e2 calli 8020d08 <__errno> <== NOT EXECUTED
801dd84: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
801dd88: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
801dd8c: e3 ff fe 56 bi 801d6e4 <rtems_rfs_fs_open+0x158> <== NOT EXECUTED
return -1;
}
}
rc = rtems_rfs_inode_close (*fs, &inode);
801dd90: b9 60 08 00 mv r1,r11
801dd94: 37 82 00 24 addi r2,sp,36
801dd98: fb ff c4 8c calli 800efc8 <rtems_rfs_inode_close>
801dd9c: b8 20 58 00 mv r11,r1
if (rc > 0)
801dda0: 4c 01 00 0f bge r0,r1,801dddc <rtems_rfs_fs_open+0x850> <== ALWAYS TAKEN
{
rtems_rfs_buffer_close (*fs);
801dda4: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED
801dda8: fb ff f4 b5 calli 801b07c <rtems_rfs_buffer_close> <== NOT EXECUTED
free (*fs);
801ddac: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED
801ddb0: fb ff a1 b7 calli 800648c <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
801ddb4: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801ddb8: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
801ddbc: fb ff cb db calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801ddc0: 44 20 fe 47 be r1,r0,801d6dc <rtems_rfs_fs_open+0x150> <== NOT EXECUTED
printf ("rtems-rfs: open: closing root inode: %d: %s\n", rc, strerror (rc));
801ddc4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801ddc8: f8 00 16 e6 calli 8023960 <strerror> <== NOT EXECUTED
801ddcc: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801ddd0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ddd4: 38 21 8f a0 ori r1,r1,0x8fa0 <== NOT EXECUTED
801ddd8: e3 ff fe 3f bi 801d6d4 <rtems_rfs_fs_open+0x148> <== NOT EXECUTED
errno = rc;
return -1;
}
errno = 0;
801dddc: f8 00 0b cb calli 8020d08 <__errno>
801dde0: 58 20 00 00 sw (r1+0),r0
return 0;
801dde4: 34 01 00 00 mvi r1,0
}
801dde8: 2b 9d 00 04 lw ra,(sp+4)
801ddec: 2b 8b 00 20 lw r11,(sp+32)
801ddf0: 2b 8c 00 1c lw r12,(sp+28)
801ddf4: 2b 8d 00 18 lw r13,(sp+24)
801ddf8: 2b 8e 00 14 lw r14,(sp+20)
801ddfc: 2b 8f 00 10 lw r15,(sp+16)
801de00: 2b 90 00 0c lw r16,(sp+12)
801de04: 2b 91 00 08 lw r17,(sp+8)
801de08: 37 9c 00 54 addi sp,sp,84
801de0c: c3 a0 00 00 ret
rc, strerror (rc));
errno = rc;
return -1;
}
rc = rtems_rfs_inode_open (*fs, RTEMS_RFS_ROOT_INO, &inode, true);
801de10: 29 a1 00 00 lw r1,(r13+0)
801de14: 34 02 00 01 mvi r2,1
801de18: 37 83 00 24 addi r3,sp,36
801de1c: 34 04 00 01 mvi r4,1
801de20: fb ff c3 de calli 800ed98 <rtems_rfs_inode_open>
801de24: b8 20 58 00 mv r11,r1
if (rc > 0)
801de28: 48 20 ff a9 bg r1,r0,801dccc <rtems_rfs_fs_open+0x740> <== NEVER TAKEN
801de2c: e3 ff ff b6 bi 801dd04 <rtems_rfs_fs_open+0x778>
0801d534 <rtems_rfs_fs_size>:
#include <rtems/rfs/rtems-rfs-inode.h>
#include <rtems/rfs/rtems-rfs-trace.h>
uint64_t
rtems_rfs_fs_size (rtems_rfs_file_system* fs)
{
801d534: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
801d538: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
801d53c: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
uint64_t blocks = rtems_rfs_fs_blocks (fs);
uint64_t block_size = rtems_rfs_fs_block_size (fs);
return blocks * block_size;
801d540: 28 82 00 08 lw r2,(r4+8) <== NOT EXECUTED
801d544: 28 84 00 04 lw r4,(r4+4) <== NOT EXECUTED
801d548: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
801d54c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801d550: f8 00 45 96 calli 802eba8 <__muldi3> <== NOT EXECUTED
}
801d554: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
801d558: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
801d55c: c3 a0 00 00 ret <== NOT EXECUTED
0800e770 <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)
{
800e770: 37 9c ff bc addi sp,sp,-68
800e774: 5b 8b 00 3c sw (sp+60),r11
800e778: 5b 8c 00 38 sw (sp+56),r12
800e77c: 5b 8d 00 34 sw (sp+52),r13
800e780: 5b 8e 00 30 sw (sp+48),r14
800e784: 5b 8f 00 2c sw (sp+44),r15
800e788: 5b 90 00 28 sw (sp+40),r16
800e78c: 5b 91 00 24 sw (sp+36),r17
800e790: 5b 92 00 20 sw (sp+32),r18
800e794: 5b 93 00 1c sw (sp+28),r19
800e798: 5b 94 00 18 sw (sp+24),r20
800e79c: 5b 95 00 14 sw (sp+20),r21
800e7a0: 5b 96 00 10 sw (sp+16),r22
800e7a4: 5b 97 00 0c sw (sp+12),r23
800e7a8: 5b 98 00 08 sw (sp+8),r24
800e7ac: 5b 9d 00 04 sw (sp+4),ra
800e7b0: 20 70 00 ff andi r16,r3,0xff
800e7b4: b8 20 58 00 mv r11,r1
800e7b8: b8 40 60 00 mv r12,r2
800e7bc: b8 80 98 00 mv r19,r4
rtems_rfs_bitmap_bit bit;
int offset;
bool updown;
int direction;
if (inode)
800e7c0: 46 00 00 04 be r16,r0,800e7d0 <rtems_rfs_group_bitmap_alloc+0x60>
{
size = fs->group_inodes;
800e7c4: 28 32 00 2c lw r18,(r1+44)
goal -= RTEMS_RFS_ROOT_INO;
800e7c8: 34 4c ff ff addi r12,r2,-1
800e7cc: e0 00 00 02 bi 800e7d4 <rtems_rfs_group_bitmap_alloc+0x64>
}
else
size = fs->group_blocks;
800e7d0: 28 32 00 28 lw r18,(r1+40)
group_start = goal / size;
800e7d4: b9 80 08 00 mv r1,r12
800e7d8: ba 40 10 00 mv r2,r18
800e7dc: fb ff cb 9b calli 8001648 <__udivsi3>
800e7e0: b8 20 c0 00 mv r24,r1
bit = (rtems_rfs_bitmap_bit) (goal % size);
800e7e4: ba 40 10 00 mv r2,r18
800e7e8: b9 80 08 00 mv r1,r12
800e7ec: f8 00 96 c6 calli 8034304 <__umodsi3>
800e7f0: 5b 81 00 40 sw (sp+64),r1
offset = 0;
updown = true;
direction = 1;
800e7f4: 34 0c 00 01 mvi r12,1
size = fs->group_blocks;
group_start = goal / size;
bit = (rtems_rfs_bitmap_bit) (goal % size);
offset = 0;
updown = true;
800e7f8: 34 0f 00 01 mvi r15,1
else
size = fs->group_blocks;
group_start = goal / size;
bit = (rtems_rfs_bitmap_bit) (goal % size);
offset = 0;
800e7fc: 34 11 00 00 mvi r17,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;
800e800: 34 15 00 01 mvi r21,1
if (inode)
bitmap = &fs->groups[group].inode_bitmap;
else
bitmap = &fs->groups[group].block_bitmap;
rc = rtems_rfs_bitmap_map_alloc (bitmap, bit, &allocated, &bit);
800e804: 37 97 00 47 addi r23,sp,71
800e808: 37 96 00 40 addi r22,sp,64
800e80c: e0 00 00 03 bi 800e818 <rtems_rfs_group_bitmap_alloc+0xa8>
*/
if ((group < 0) || (group >= fs->group_count))
{
if (!updown)
break;
direction = direction > 0 ? -1 : 1;
800e810: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
updown = false;
800e814: 34 0f 00 00 mvi r15,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);
800e818: b9 80 08 00 mv r1,r12
800e81c: ba 20 10 00 mv r2,r17
*/
while (true)
{
rtems_rfs_bitmap_control* bitmap;
int group;
bool allocated = false;
800e820: 33 80 00 47 sb (sp+71),r0
/*
* 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);
800e824: fb ff cb 7d calli 8001618 <__mulsi3>
800e828: b4 38 68 00 add r13,r1,r24
if (offset)
800e82c: 46 20 00 05 be r17,r0,800e840 <rtems_rfs_group_bitmap_alloc+0xd0>
bit = direction > 0 ? 0 : size - 1;
800e830: 34 02 00 00 mvi r2,0
800e834: 45 95 00 02 be r12,r21,800e83c <rtems_rfs_group_bitmap_alloc+0xcc>
800e838: 36 42 ff ff addi r2,r18,-1
800e83c: 5b 82 00 40 sw (sp+64),r2
/*
* 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))
800e840: 48 0d 00 03 bg r0,r13,800e84c <rtems_rfs_group_bitmap_alloc+0xdc>
800e844: 29 61 00 24 lw r1,(r11+36)
800e848: 48 2d 00 05 bg r1,r13,800e85c <rtems_rfs_group_bitmap_alloc+0xec>
{
if (!updown)
800e84c: 45 e0 00 47 be r15,r0,800e968 <rtems_rfs_group_bitmap_alloc+0x1f8>
break;
direction = direction > 0 ? -1 : 1;
800e850: 45 95 ff f0 be r12,r21,800e810 <rtems_rfs_group_bitmap_alloc+0xa0><== NEVER TAKEN
800e854: 34 0c 00 01 mvi r12,1
800e858: e3 ff ff ef bi 800e814 <rtems_rfs_group_bitmap_alloc+0xa4>
800e85c: 29 74 00 20 lw r20,(r11+32)
updown = false;
continue;
}
if (inode)
800e860: 46 00 00 07 be r16,r0,800e87c <rtems_rfs_group_bitmap_alloc+0x10c>
bitmap = &fs->groups[group].inode_bitmap;
800e864: b9 a0 08 00 mv r1,r13
800e868: 34 02 00 50 mvi r2,80
800e86c: fb ff cb 6b calli 8001618 <__mulsi3>
800e870: b6 81 a0 00 add r20,r20,r1
800e874: 36 94 00 2c addi r20,r20,44
800e878: e0 00 00 06 bi 800e890 <rtems_rfs_group_bitmap_alloc+0x120>
else
bitmap = &fs->groups[group].block_bitmap;
800e87c: b9 a0 08 00 mv r1,r13
800e880: 34 02 00 50 mvi r2,80
800e884: fb ff cb 65 calli 8001618 <__mulsi3>
800e888: b6 81 a0 00 add r20,r20,r1
800e88c: 36 94 00 08 addi r20,r20,8
rc = rtems_rfs_bitmap_map_alloc (bitmap, bit, &allocated, &bit);
800e890: 2b 82 00 40 lw r2,(sp+64)
800e894: ba 80 08 00 mv r1,r20
800e898: ba e0 18 00 mv r3,r23
800e89c: ba c0 20 00 mv r4,r22
800e8a0: f8 00 29 b7 calli 8018f7c <rtems_rfs_bitmap_map_alloc>
800e8a4: b8 20 70 00 mv r14,r1
if (rc > 0)
800e8a8: 48 20 00 38 bg r1,r0,800e988 <rtems_rfs_group_bitmap_alloc+0x218><== NEVER TAKEN
return rc;
if (rtems_rfs_fs_release_bitmaps (fs))
800e8ac: 29 61 00 00 lw r1,(r11+0)
800e8b0: 20 21 00 01 andi r1,r1,0x1
800e8b4: 5c 20 00 04 bne r1,r0,800e8c4 <rtems_rfs_group_bitmap_alloc+0x154><== NEVER TAKEN
rtems_rfs_bitmap_release_buffer (fs, bitmap);
800e8b8: 2a 82 00 00 lw r2,(r20+0)
800e8bc: b9 60 08 00 mv r1,r11
800e8c0: f8 00 30 03 calli 801a8cc <rtems_rfs_buffer_handle_release>
if (allocated)
800e8c4: 43 82 00 47 lbu r2,(sp+71)
800e8c8: 44 40 00 22 be r2,r0,800e950 <rtems_rfs_group_bitmap_alloc+0x1e0>
800e8cc: 2b 8c 00 40 lw r12,(sp+64)
{
if (inode)
800e8d0: 46 00 00 08 be r16,r0,800e8f0 <rtems_rfs_group_bitmap_alloc+0x180>
*result = rtems_rfs_group_inode (fs, group, bit);
800e8d4: 29 62 00 2c lw r2,(r11+44)
800e8d8: b9 a0 08 00 mv r1,r13
800e8dc: 35 8c 00 01 addi r12,r12,1
800e8e0: fb ff cb 4e calli 8001618 <__mulsi3>
800e8e4: b5 81 08 00 add r1,r12,r1
800e8e8: 5a 61 00 00 sw (r19+0),r1
800e8ec: e0 00 00 09 bi 800e910 <rtems_rfs_group_bitmap_alloc+0x1a0>
else
*result = rtems_rfs_group_block (&fs->groups[group], bit);
800e8f0: 29 6b 00 20 lw r11,(r11+32)
800e8f4: b9 a0 08 00 mv r1,r13
800e8f8: 34 02 00 50 mvi r2,80
800e8fc: fb ff cb 47 calli 8001618 <__mulsi3>
800e900: b5 61 08 00 add r1,r11,r1
800e904: 28 21 00 00 lw r1,(r1+0)
800e908: b5 81 60 00 add r12,r12,r1
800e90c: 5a 6c 00 00 sw (r19+0),r12
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
800e910: 34 01 00 00 mvi r1,0
800e914: 78 02 00 02 mvhi r2,0x2
800e918: f8 00 09 04 calli 8010d28 <rtems_rfs_trace>
printf ("rtems-rfs: group-bitmap-alloc: %s allocated: %" PRId32 "\n",
inode ? "inode" : "block", *result);
return 0;
800e91c: 34 0e 00 00 mvi r14,0
{
if (inode)
*result = rtems_rfs_group_inode (fs, group, bit);
else
*result = rtems_rfs_group_block (&fs->groups[group], bit);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
800e920: 44 20 00 1a be r1,r0,800e988 <rtems_rfs_group_bitmap_alloc+0x218><== ALWAYS TAKEN
printf ("rtems-rfs: group-bitmap-alloc: %s allocated: %" PRId32 "\n",
800e924: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
800e928: 38 42 6d 10 ori r2,r2,0x6d10 <== NOT EXECUTED
800e92c: 46 00 00 03 be r16,r0,800e938 <rtems_rfs_group_bitmap_alloc+0x1c8><== NOT EXECUTED
800e930: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
800e934: 38 42 6d 08 ori r2,r2,0x6d08 <== NOT EXECUTED
800e938: 2a 63 00 00 lw r3,(r19+0) <== NOT EXECUTED
800e93c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e940: 38 21 6d 18 ori r1,r1,0x6d18 <== NOT EXECUTED
800e944: f8 00 4f 4c calli 8022674 <printf> <== NOT EXECUTED
inode ? "inode" : "block", *result);
return 0;
800e948: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED
800e94c: e0 00 00 0f bi 800e988 <rtems_rfs_group_bitmap_alloc+0x218><== NOT EXECUTED
}
if (updown)
800e950: 45 e2 00 04 be r15,r2,800e960 <rtems_rfs_group_bitmap_alloc+0x1f0><== NEVER TAKEN
direction = direction > 0 ? -1 : 1;
800e954: 65 8c 00 01 cmpei r12,r12,1
800e958: c8 0c 60 00 sub r12,r0,r12
800e95c: 39 8c 00 01 ori r12,r12,0x1
offset++;
800e960: 36 31 00 01 addi r17,r17,1
800e964: e3 ff ff ad bi 800e818 <rtems_rfs_group_bitmap_alloc+0xa8>
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
800e968: 34 01 00 00 mvi r1,0
800e96c: 78 02 00 02 mvhi r2,0x2
800e970: f8 00 08 ee calli 8010d28 <rtems_rfs_trace>
printf ("rtems-rfs: group-bitmap-alloc: no blocks available\n");
return ENOSPC;
800e974: 34 0e 00 1c mvi r14,28
direction = direction > 0 ? -1 : 1;
offset++;
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
800e978: 44 2f 00 04 be r1,r15,800e988 <rtems_rfs_group_bitmap_alloc+0x218><== ALWAYS TAKEN
printf ("rtems-rfs: group-bitmap-alloc: no blocks available\n");
800e97c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e980: 38 21 6d 4c ori r1,r1,0x6d4c <== NOT EXECUTED
800e984: f8 00 50 04 calli 8022994 <puts> <== NOT EXECUTED
return ENOSPC;
}
800e988: b9 c0 08 00 mv r1,r14
800e98c: 2b 9d 00 04 lw ra,(sp+4)
800e990: 2b 8b 00 3c lw r11,(sp+60)
800e994: 2b 8c 00 38 lw r12,(sp+56)
800e998: 2b 8d 00 34 lw r13,(sp+52)
800e99c: 2b 8e 00 30 lw r14,(sp+48)
800e9a0: 2b 8f 00 2c lw r15,(sp+44)
800e9a4: 2b 90 00 28 lw r16,(sp+40)
800e9a8: 2b 91 00 24 lw r17,(sp+36)
800e9ac: 2b 92 00 20 lw r18,(sp+32)
800e9b0: 2b 93 00 1c lw r19,(sp+28)
800e9b4: 2b 94 00 18 lw r20,(sp+24)
800e9b8: 2b 95 00 14 lw r21,(sp+20)
800e9bc: 2b 96 00 10 lw r22,(sp+16)
800e9c0: 2b 97 00 0c lw r23,(sp+12)
800e9c4: 2b 98 00 08 lw r24,(sp+8)
800e9c8: 37 9c 00 44 addi sp,sp,68
800e9cc: c3 a0 00 00 ret
0800e9d0 <rtems_rfs_group_bitmap_free>:
int
rtems_rfs_group_bitmap_free (rtems_rfs_file_system* fs,
bool inode,
rtems_rfs_bitmap_bit no)
{
800e9d0: 37 9c ff e8 addi sp,sp,-24
800e9d4: 5b 8b 00 18 sw (sp+24),r11
800e9d8: 5b 8c 00 14 sw (sp+20),r12
800e9dc: 5b 8d 00 10 sw (sp+16),r13
800e9e0: 5b 8e 00 0c sw (sp+12),r14
800e9e4: 5b 8f 00 08 sw (sp+8),r15
800e9e8: 5b 9d 00 04 sw (sp+4),ra
800e9ec: b8 20 58 00 mv r11,r1
800e9f0: 20 4d 00 ff andi r13,r2,0xff
unsigned int group;
rtems_rfs_bitmap_bit bit;
size_t size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
800e9f4: 34 01 00 00 mvi r1,0
800e9f8: 78 02 00 02 mvhi r2,0x2
int
rtems_rfs_group_bitmap_free (rtems_rfs_file_system* fs,
bool inode,
rtems_rfs_bitmap_bit no)
{
800e9fc: b8 60 78 00 mv r15,r3
unsigned int group;
rtems_rfs_bitmap_bit bit;
size_t size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
800ea00: f8 00 08 ca calli 8010d28 <rtems_rfs_trace>
800ea04: 44 20 00 0a be r1,r0,800ea2c <rtems_rfs_group_bitmap_free+0x5c><== ALWAYS TAKEN
printf ("rtems-rfs: group-bitmap-free: %s free: %" PRId32 "\n",
800ea08: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
800ea0c: 38 42 6d 10 ori r2,r2,0x6d10 <== NOT EXECUTED
800ea10: 45 a0 00 03 be r13,r0,800ea1c <rtems_rfs_group_bitmap_free+0x4c><== NOT EXECUTED
800ea14: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
800ea18: 38 42 6d 08 ori r2,r2,0x6d08 <== NOT EXECUTED
800ea1c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800ea20: 38 21 6d 80 ori r1,r1,0x6d80 <== NOT EXECUTED
800ea24: b9 e0 18 00 mv r3,r15 <== NOT EXECUTED
800ea28: f8 00 4f 13 calli 8022674 <printf> <== NOT EXECUTED
800ea2c: 35 ef ff ff addi r15,r15,-1
inode ? "inode" : "block", no);
if (inode)
800ea30: 45 a0 00 03 be r13,r0,800ea3c <rtems_rfs_group_bitmap_free+0x6c>
{
no -= RTEMS_RFS_ROOT_INO;
size = fs->group_inodes;
800ea34: 29 6c 00 2c lw r12,(r11+44)
800ea38: e0 00 00 02 bi 800ea40 <rtems_rfs_group_bitmap_free+0x70>
}
else
{
no -= RTEMS_RFS_SUPERBLOCK_SIZE;
size = fs->group_blocks;
800ea3c: 29 6c 00 28 lw r12,(r11+40)
}
group = no / size;
800ea40: b9 80 10 00 mv r2,r12
800ea44: b9 e0 08 00 mv r1,r15
800ea48: fb ff cb 00 calli 8001648 <__udivsi3>
bit = (rtems_rfs_bitmap_bit) (no % size);
800ea4c: b9 80 10 00 mv r2,r12
{
no -= RTEMS_RFS_SUPERBLOCK_SIZE;
size = fs->group_blocks;
}
group = no / size;
800ea50: b8 20 70 00 mv r14,r1
bit = (rtems_rfs_bitmap_bit) (no % size);
800ea54: b9 e0 08 00 mv r1,r15
800ea58: f8 00 96 2b calli 8034304 <__umodsi3>
800ea5c: b8 20 78 00 mv r15,r1
800ea60: 29 6c 00 20 lw r12,(r11+32)
if (inode)
800ea64: 45 a0 00 07 be r13,r0,800ea80 <rtems_rfs_group_bitmap_free+0xb0>
bitmap = &fs->groups[group].inode_bitmap;
800ea68: b9 c0 08 00 mv r1,r14
800ea6c: 34 02 00 50 mvi r2,80
800ea70: fb ff ca ea calli 8001618 <__mulsi3>
800ea74: b5 81 60 00 add r12,r12,r1
800ea78: 35 8c 00 2c addi r12,r12,44
800ea7c: e0 00 00 06 bi 800ea94 <rtems_rfs_group_bitmap_free+0xc4>
else
bitmap = &fs->groups[group].block_bitmap;
800ea80: b9 c0 08 00 mv r1,r14
800ea84: 34 02 00 50 mvi r2,80
800ea88: fb ff ca e4 calli 8001618 <__mulsi3>
800ea8c: b5 81 60 00 add r12,r12,r1
800ea90: 35 8c 00 08 addi r12,r12,8
rc = rtems_rfs_bitmap_map_clear (bitmap, bit);
800ea94: b9 e0 10 00 mv r2,r15
800ea98: b9 80 08 00 mv r1,r12
800ea9c: f8 00 28 7b calli 8018c88 <rtems_rfs_bitmap_map_clear>
rtems_rfs_bitmap_release_buffer (fs, bitmap);
800eaa0: 29 82 00 00 lw r2,(r12+0)
if (inode)
bitmap = &fs->groups[group].inode_bitmap;
else
bitmap = &fs->groups[group].block_bitmap;
rc = rtems_rfs_bitmap_map_clear (bitmap, bit);
800eaa4: b8 20 68 00 mv r13,r1
rtems_rfs_bitmap_release_buffer (fs, bitmap);
800eaa8: b9 60 08 00 mv r1,r11
800eaac: f8 00 2f 88 calli 801a8cc <rtems_rfs_buffer_handle_release>
return rc;
}
800eab0: b9 a0 08 00 mv r1,r13
800eab4: 2b 9d 00 04 lw ra,(sp+4)
800eab8: 2b 8b 00 18 lw r11,(sp+24)
800eabc: 2b 8c 00 14 lw r12,(sp+20)
800eac0: 2b 8d 00 10 lw r13,(sp+16)
800eac4: 2b 8e 00 0c lw r14,(sp+12)
800eac8: 2b 8f 00 08 lw r15,(sp+8)
800eacc: 37 9c 00 18 addi sp,sp,24
800ead0: c3 a0 00 00 ret
0800ead4 <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)
{
800ead4: 37 9c ff e4 addi sp,sp,-28 <== NOT EXECUTED
800ead8: 5b 8b 00 1c sw (sp+28),r11 <== NOT EXECUTED
800eadc: 5b 8c 00 18 sw (sp+24),r12 <== NOT EXECUTED
800eae0: 5b 8d 00 14 sw (sp+20),r13 <== NOT EXECUTED
800eae4: 5b 8e 00 10 sw (sp+16),r14 <== NOT EXECUTED
800eae8: 5b 8f 00 0c sw (sp+12),r15 <== NOT EXECUTED
800eaec: 5b 90 00 08 sw (sp+8),r16 <== NOT EXECUTED
800eaf0: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
800eaf4: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
800eaf8: 20 4e 00 ff andi r14,r2,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))
800eafc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
800eb00: 78 02 00 02 mvhi r2,0x2 <== NOT EXECUTED
int
rtems_rfs_group_bitmap_test (rtems_rfs_file_system* fs,
bool inode,
rtems_rfs_bitmap_bit no,
bool* state)
{
800eb04: b8 60 58 00 mv r11,r3 <== NOT EXECUTED
800eb08: b8 80 80 00 mv r16,r4 <== NOT EXECUTED
unsigned int group;
rtems_rfs_bitmap_bit bit;
size_t size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
800eb0c: f8 00 08 87 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
800eb10: 44 20 00 0a be r1,r0,800eb38 <rtems_rfs_group_bitmap_test+0x64><== NOT EXECUTED
printf ("rtems-rfs: group-bitmap-test: %s test: %" PRId32 "\n",
800eb14: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
800eb18: 38 42 6d 10 ori r2,r2,0x6d10 <== NOT EXECUTED
800eb1c: 45 c0 00 03 be r14,r0,800eb28 <rtems_rfs_group_bitmap_test+0x54><== NOT EXECUTED
800eb20: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
800eb24: 38 42 6d 08 ori r2,r2,0x6d08 <== NOT EXECUTED
800eb28: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800eb2c: 38 21 6d ac ori r1,r1,0x6dac <== NOT EXECUTED
800eb30: b9 60 18 00 mv r3,r11 <== NOT EXECUTED
800eb34: f8 00 4e d0 calli 8022674 <printf> <== NOT EXECUTED
inode ? "inode" : "block", no);
if (inode)
800eb38: 45 c0 00 08 be r14,r0,800eb58 <rtems_rfs_group_bitmap_test+0x84><== NOT EXECUTED
{
if ((no < RTEMS_RFS_ROOT_INO) || (no > rtems_rfs_fs_inodes (fs)))
return EINVAL;
800eb3c: 34 0d 00 16 mvi r13,22 <== NOT EXECUTED
printf ("rtems-rfs: group-bitmap-test: %s test: %" PRId32 "\n",
inode ? "inode" : "block", no);
if (inode)
{
if ((no < RTEMS_RFS_ROOT_INO) || (no > rtems_rfs_fs_inodes (fs)))
800eb40: 4c 0b 00 27 bge r0,r11,800ebdc <rtems_rfs_group_bitmap_test+0x108><== NOT EXECUTED
800eb44: 29 81 00 14 lw r1,(r12+20) <== NOT EXECUTED
800eb48: 55 61 00 25 bgu r11,r1,800ebdc <rtems_rfs_group_bitmap_test+0x108><== NOT EXECUTED
return EINVAL;
no -= RTEMS_RFS_ROOT_INO;
800eb4c: 35 6b ff ff addi r11,r11,-1 <== NOT EXECUTED
size = fs->group_inodes;
800eb50: 29 8d 00 2c lw r13,(r12+44) <== NOT EXECUTED
800eb54: e0 00 00 05 bi 800eb68 <rtems_rfs_group_bitmap_test+0x94> <== NOT EXECUTED
}
else
{
if (no >= rtems_rfs_fs_blocks (fs))
800eb58: 29 81 00 04 lw r1,(r12+4) <== NOT EXECUTED
return EINVAL;
800eb5c: 34 0d 00 16 mvi r13,22 <== NOT EXECUTED
no -= RTEMS_RFS_ROOT_INO;
size = fs->group_inodes;
}
else
{
if (no >= rtems_rfs_fs_blocks (fs))
800eb60: 51 61 00 1f bgeu r11,r1,800ebdc <rtems_rfs_group_bitmap_test+0x108><== NOT EXECUTED
return EINVAL;
size = fs->group_blocks;
800eb64: 29 8d 00 28 lw r13,(r12+40) <== NOT EXECUTED
}
group = no / size;
800eb68: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
800eb6c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800eb70: fb ff ca b6 calli 8001648 <__udivsi3> <== NOT EXECUTED
bit = (rtems_rfs_bitmap_bit) (no % size);
800eb74: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
if (no >= rtems_rfs_fs_blocks (fs))
return EINVAL;
size = fs->group_blocks;
}
group = no / size;
800eb78: b8 20 78 00 mv r15,r1 <== NOT EXECUTED
bit = (rtems_rfs_bitmap_bit) (no % size);
800eb7c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800eb80: f8 00 95 e1 calli 8034304 <__umodsi3> <== NOT EXECUTED
800eb84: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
800eb88: 29 8b 00 20 lw r11,(r12+32) <== NOT EXECUTED
if (inode)
800eb8c: 45 c0 00 07 be r14,r0,800eba8 <rtems_rfs_group_bitmap_test+0xd4><== NOT EXECUTED
bitmap = &fs->groups[group].inode_bitmap;
800eb90: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
800eb94: 34 02 00 50 mvi r2,80 <== NOT EXECUTED
800eb98: fb ff ca a0 calli 8001618 <__mulsi3> <== NOT EXECUTED
800eb9c: b5 61 58 00 add r11,r11,r1 <== NOT EXECUTED
800eba0: 35 6b 00 2c addi r11,r11,44 <== NOT EXECUTED
800eba4: e0 00 00 06 bi 800ebbc <rtems_rfs_group_bitmap_test+0xe8> <== NOT EXECUTED
else
bitmap = &fs->groups[group].block_bitmap;
800eba8: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED
800ebac: 34 02 00 50 mvi r2,80 <== NOT EXECUTED
800ebb0: fb ff ca 9a calli 8001618 <__mulsi3> <== NOT EXECUTED
800ebb4: b5 61 58 00 add r11,r11,r1 <== NOT EXECUTED
800ebb8: 35 6b 00 08 addi r11,r11,8 <== NOT EXECUTED
rc = rtems_rfs_bitmap_map_test (bitmap, bit, state);
800ebbc: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
800ebc0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800ebc4: ba 00 18 00 mv r3,r16 <== NOT EXECUTED
800ebc8: f8 00 28 69 calli 8018d6c <rtems_rfs_bitmap_map_test> <== NOT EXECUTED
rtems_rfs_bitmap_release_buffer (fs, bitmap);
800ebcc: 29 62 00 00 lw r2,(r11+0) <== 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);
800ebd0: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
rtems_rfs_bitmap_release_buffer (fs, bitmap);
800ebd4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800ebd8: f8 00 2f 3d calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
return rc;
}
800ebdc: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800ebe0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
800ebe4: 2b 8b 00 1c lw r11,(sp+28) <== NOT EXECUTED
800ebe8: 2b 8c 00 18 lw r12,(sp+24) <== NOT EXECUTED
800ebec: 2b 8d 00 14 lw r13,(sp+20) <== NOT EXECUTED
800ebf0: 2b 8e 00 10 lw r14,(sp+16) <== NOT EXECUTED
800ebf4: 2b 8f 00 0c lw r15,(sp+12) <== NOT EXECUTED
800ebf8: 2b 90 00 08 lw r16,(sp+8) <== NOT EXECUTED
800ebfc: 37 9c 00 1c addi sp,sp,28 <== NOT EXECUTED
800ec00: c3 a0 00 00 ret <== NOT EXECUTED
0800e6b4 <rtems_rfs_group_close>:
int
rtems_rfs_group_close (rtems_rfs_file_system* fs, rtems_rfs_group* group)
{
800e6b4: 37 9c ff ec addi sp,sp,-20
800e6b8: 5b 8b 00 14 sw (sp+20),r11
800e6bc: 5b 8c 00 10 sw (sp+16),r12
800e6c0: 5b 8d 00 0c sw (sp+12),r13
800e6c4: 5b 8e 00 08 sw (sp+8),r14
800e6c8: 5b 9d 00 04 sw (sp+4),ra
800e6cc: b8 20 68 00 mv r13,r1
800e6d0: b8 40 58 00 mv r11,r2
int result = 0;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_CLOSE))
800e6d4: 34 01 00 00 mvi r1,0
800e6d8: 78 02 00 01 mvhi r2,0x1
800e6dc: f8 00 09 93 calli 8010d28 <rtems_rfs_trace>
800e6e0: 44 20 00 05 be r1,r0,800e6f4 <rtems_rfs_group_close+0x40> <== ALWAYS TAKEN
printf ("rtems-rfs: group-close: base=%" PRId32 "\n", group->base);
800e6e4: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED
800e6e8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e6ec: 38 21 6c e4 ori r1,r1,0x6ce4 <== NOT EXECUTED
800e6f0: f8 00 4f e1 calli 8022674 <printf> <== NOT EXECUTED
/*
* 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);
800e6f4: 35 61 00 2c addi r1,r11,44
800e6f8: f8 00 2a bb calli 80191e4 <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);
800e6fc: 35 62 00 44 addi r2,r11,68
800e700: b8 20 70 00 mv r14,r1
800e704: b9 a0 08 00 mv r1,r13
800e708: f8 00 30 71 calli 801a8cc <rtems_rfs_buffer_handle_release>
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);
800e70c: 35 61 00 08 addi r1,r11,8
handle->dirty = false;
800e710: 31 60 00 44 sb (r11+68),r0
handle->bnum = 0;
800e714: 59 60 00 48 sw (r11+72),r0
handle->buffer = NULL;
800e718: 59 60 00 4c sw (r11+76),r0
800e71c: f8 00 2a b2 calli 80191e4 <rtems_rfs_bitmap_close>
800e720: b8 20 60 00 mv r12,r1
if (rc > 0)
800e724: 48 20 00 05 bg r1,r0,800e738 <rtems_rfs_group_close+0x84> <== NEVER TAKEN
800e728: a5 c0 08 00 not r1,r14
800e72c: 34 02 00 1f mvi r2,31
800e730: f8 00 96 75 calli 8034104 <__ashrsi3>
800e734: a1 c1 60 00 and r12,r14,r1
*/
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);
800e738: b9 a0 08 00 mv r1,r13
800e73c: 35 62 00 20 addi r2,r11,32
800e740: f8 00 30 63 calli 801a8cc <rtems_rfs_buffer_handle_release>
rc = rtems_rfs_buffer_handle_close (fs, &group->block_bitmap_buffer);
if (rc > 0)
result = rc;
return result;
}
800e744: b9 80 08 00 mv r1,r12
handle->dirty = false;
800e748: 31 60 00 20 sb (r11+32),r0
handle->bnum = 0;
800e74c: 59 60 00 24 sw (r11+36),r0
handle->buffer = NULL;
800e750: 59 60 00 28 sw (r11+40),r0
800e754: 2b 9d 00 04 lw ra,(sp+4)
800e758: 2b 8b 00 14 lw r11,(sp+20)
800e75c: 2b 8c 00 10 lw r12,(sp+16)
800e760: 2b 8d 00 0c lw r13,(sp+12)
800e764: 2b 8e 00 08 lw r14,(sp+8)
800e768: 37 9c 00 14 addi sp,sp,20
800e76c: c3 a0 00 00 ret
0800e49c <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)
{
800e49c: 37 9c ff e0 addi sp,sp,-32
800e4a0: 5b 8b 00 20 sw (sp+32),r11
800e4a4: 5b 8c 00 1c sw (sp+28),r12
800e4a8: 5b 8d 00 18 sw (sp+24),r13
800e4ac: 5b 8e 00 14 sw (sp+20),r14
800e4b0: 5b 8f 00 10 sw (sp+16),r15
800e4b4: 5b 90 00 0c sw (sp+12),r16
800e4b8: 5b 91 00 08 sw (sp+8),r17
800e4bc: 5b 9d 00 04 sw (sp+4),ra
800e4c0: b8 20 68 00 mv r13,r1
int rc;
if (base >= rtems_rfs_fs_blocks (fs))
800e4c4: 28 21 00 04 lw r1,(r1+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)
{
800e4c8: b8 40 70 00 mv r14,r2
800e4cc: b8 60 60 00 mv r12,r3
800e4d0: b8 a0 58 00 mv r11,r5
int rc;
if (base >= rtems_rfs_fs_blocks (fs))
800e4d4: 54 22 00 0d bgu r1,r2,800e508 <rtems_rfs_group_open+0x6c> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
800e4d8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
800e4dc: 38 02 80 00 mvu r2,0x8000 <== NOT EXECUTED
800e4e0: f8 00 0a 12 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
printf ("rtems-rfs: group-open: base outside file system range: %d: %s\n",
EIO, strerror (EIO));
return EIO;
800e4e4: 34 0c 00 05 mvi r12,5 <== NOT EXECUTED
{
int rc;
if (base >= rtems_rfs_fs_blocks (fs))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
800e4e8: 44 20 00 68 be r1,r0,800e688 <rtems_rfs_group_open+0x1ec> <== NOT EXECUTED
printf ("rtems-rfs: group-open: base outside file system range: %d: %s\n",
800e4ec: 34 01 00 05 mvi r1,5 <== NOT EXECUTED
800e4f0: f8 00 55 1c calli 8023960 <strerror> <== NOT EXECUTED
800e4f4: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800e4f8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e4fc: 38 21 6b f4 ori r1,r1,0x6bf4 <== NOT EXECUTED
800e500: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
800e504: e0 00 00 30 bi 800e5c4 <rtems_rfs_group_open+0x128> <== NOT EXECUTED
EIO, strerror (EIO));
return EIO;
}
if ((base + size) >= rtems_rfs_fs_blocks (fs))
800e508: b4 62 10 00 add r2,r3,r2
800e50c: 54 22 00 02 bgu r1,r2,800e514 <rtems_rfs_group_open+0x78> <== NEVER TAKEN
size = rtems_rfs_fs_blocks (fs) - base;
800e510: c8 2e 60 00 sub r12,r1,r14
800e514: b9 80 80 00 mv r16,r12
800e518: 50 8c 00 02 bgeu r4,r12,800e520 <rtems_rfs_group_open+0x84><== NEVER TAKEN
800e51c: b8 80 80 00 mv r16,r4
* the format configuration needs reviewing.
*/
if (inodes > size)
inodes = size;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
800e520: 34 01 00 00 mvi r1,0
800e524: 38 02 80 00 mvu r2,0x8000
800e528: f8 00 0a 00 calli 8010d28 <rtems_rfs_trace>
800e52c: 44 20 00 07 be r1,r0,800e548 <rtems_rfs_group_open+0xac> <== ALWAYS TAKEN
printf ("rtems-rfs: group-open: base=%" PRId32 ", blocks=%zd inodes=%zd\n",
800e530: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e534: 38 21 6c 34 ori r1,r1,0x6c34 <== NOT EXECUTED
800e538: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
800e53c: b9 80 18 00 mv r3,r12 <== NOT EXECUTED
800e540: ba 00 20 00 mv r4,r16 <== NOT EXECUTED
800e544: f8 00 50 4c calli 8022674 <printf> <== NOT EXECUTED
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,
800e548: 35 71 00 08 addi r17,r11,8
800e54c: 35 6f 00 20 addi r15,r11,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;
800e550: 59 6c 00 04 sw (r11+4),r12
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,
800e554: b9 80 20 00 mv r4,r12
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;
800e558: 59 6e 00 00 sw (r11+0),r14
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
800e55c: 31 60 00 20 sb (r11+32),r0
handle->bnum = 0;
800e560: 59 60 00 24 sw (r11+36),r0
handle->buffer = NULL;
800e564: 59 60 00 28 sw (r11+40),r0
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,
800e568: ba 20 08 00 mv r1,r17
800e56c: b9 a0 10 00 mv r2,r13
800e570: b9 e0 18 00 mv r3,r15
800e574: b9 c0 28 00 mv r5,r14
800e578: f8 00 2b 00 calli 8019178 <rtems_rfs_bitmap_open>
800e57c: b8 20 60 00 mv r12,r1
&group->block_bitmap_buffer, size,
group->base + RTEMS_RFS_GROUP_BLOCK_BITMAP_BLOCK);
if (rc > 0)
800e580: 4c 01 00 13 bge r0,r1,800e5cc <rtems_rfs_group_open+0x130> <== ALWAYS TAKEN
*/
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);
800e584: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
800e588: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800e58c: f8 00 30 d0 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &group->block_bitmap_buffer);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
800e590: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
handle->dirty = false;
800e594: 31 60 00 20 sb (r11+32),r0 <== NOT EXECUTED
handle->bnum = 0;
800e598: 59 60 00 24 sw (r11+36),r0 <== NOT EXECUTED
handle->buffer = NULL;
800e59c: 59 60 00 28 sw (r11+40),r0 <== NOT EXECUTED
800e5a0: 38 02 80 00 mvu r2,0x8000 <== NOT EXECUTED
800e5a4: f8 00 09 e1 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
800e5a8: 44 20 00 38 be r1,r0,800e688 <rtems_rfs_group_open+0x1ec> <== NOT EXECUTED
printf ("rtems-rfs: group-open: could not open block bitmap: %d: %s\n",
800e5ac: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800e5b0: f8 00 54 ec calli 8023960 <strerror> <== NOT EXECUTED
800e5b4: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800e5b8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e5bc: 38 21 6c 6c ori r1,r1,0x6c6c <== NOT EXECUTED
800e5c0: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
800e5c4: f8 00 50 2c calli 8022674 <printf> <== NOT EXECUTED
800e5c8: e0 00 00 30 bi 800e688 <rtems_rfs_group_open+0x1ec> <== 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,
800e5cc: 29 65 00 00 lw r5,(r11+0)
800e5d0: 35 6e 00 44 addi r14,r11,68
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
800e5d4: 31 60 00 44 sb (r11+68),r0
handle->bnum = 0;
800e5d8: 59 60 00 48 sw (r11+72),r0
handle->buffer = NULL;
800e5dc: 59 60 00 4c sw (r11+76),r0
800e5e0: 35 61 00 2c addi r1,r11,44
800e5e4: b9 a0 10 00 mv r2,r13
800e5e8: b9 c0 18 00 mv r3,r14
800e5ec: ba 00 20 00 mv r4,r16
800e5f0: 34 a5 00 01 addi r5,r5,1
800e5f4: f8 00 2a e1 calli 8019178 <rtems_rfs_bitmap_open>
800e5f8: b8 20 60 00 mv r12,r1
&group->inode_bitmap_buffer, inodes,
group->base + RTEMS_RFS_GROUP_INODE_BITMAP_BLOCK);
if (rc > 0)
800e5fc: 4c 01 00 19 bge r0,r1,800e660 <rtems_rfs_group_open+0x1c4> <== ALWAYS TAKEN
*/
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);
800e600: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
800e604: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800e608: f8 00 30 b1 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &group->inode_bitmap_buffer);
rtems_rfs_bitmap_close (&group->block_bitmap);
800e60c: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
handle->dirty = false;
800e610: 31 60 00 44 sb (r11+68),r0 <== NOT EXECUTED
handle->bnum = 0;
800e614: 59 60 00 48 sw (r11+72),r0 <== NOT EXECUTED
handle->buffer = NULL;
800e618: 59 60 00 4c sw (r11+76),r0 <== NOT EXECUTED
800e61c: f8 00 2a f2 calli 80191e4 <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);
800e620: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
800e624: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800e628: f8 00 30 a9 calli 801a8cc <rtems_rfs_buffer_handle_release><== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &group->block_bitmap_buffer);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
800e62c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
handle->dirty = false;
800e630: 31 60 00 20 sb (r11+32),r0 <== NOT EXECUTED
handle->bnum = 0;
800e634: 59 60 00 24 sw (r11+36),r0 <== NOT EXECUTED
handle->buffer = NULL;
800e638: 59 60 00 28 sw (r11+40),r0 <== NOT EXECUTED
800e63c: 38 02 80 00 mvu r2,0x8000 <== NOT EXECUTED
800e640: f8 00 09 ba calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
800e644: 44 20 00 11 be r1,r0,800e688 <rtems_rfs_group_open+0x1ec> <== NOT EXECUTED
printf ("rtems-rfs: group-open: could not open inode bitmap: %d: %s\n",
800e648: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800e64c: f8 00 54 c5 calli 8023960 <strerror> <== NOT EXECUTED
800e650: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
800e654: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800e658: 38 21 6c a8 ori r1,r1,0x6ca8 <== NOT EXECUTED
800e65c: e3 ff ff d9 bi 800e5c0 <rtems_rfs_group_open+0x124> <== NOT EXECUTED
rc, strerror (rc));
return rc;
}
if (rtems_rfs_fs_release_bitmaps (fs))
800e660: 29 a1 00 00 lw r1,(r13+0)
{
rtems_rfs_bitmap_release_buffer (fs, &group->block_bitmap);
rtems_rfs_bitmap_release_buffer (fs, &group->inode_bitmap);
}
return 0;
800e664: 34 0c 00 00 mvi r12,0
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))
800e668: 20 21 00 01 andi r1,r1,0x1
800e66c: 5c 20 00 07 bne r1,r0,800e688 <rtems_rfs_group_open+0x1ec> <== NEVER TAKEN
{
rtems_rfs_bitmap_release_buffer (fs, &group->block_bitmap);
800e670: 29 62 00 08 lw r2,(r11+8)
800e674: b9 a0 08 00 mv r1,r13
800e678: f8 00 30 95 calli 801a8cc <rtems_rfs_buffer_handle_release>
rtems_rfs_bitmap_release_buffer (fs, &group->inode_bitmap);
800e67c: 29 62 00 2c lw r2,(r11+44)
800e680: b9 a0 08 00 mv r1,r13
800e684: f8 00 30 92 calli 801a8cc <rtems_rfs_buffer_handle_release>
}
return 0;
}
800e688: b9 80 08 00 mv r1,r12
800e68c: 2b 9d 00 04 lw ra,(sp+4)
800e690: 2b 8b 00 20 lw r11,(sp+32)
800e694: 2b 8c 00 1c lw r12,(sp+28)
800e698: 2b 8d 00 18 lw r13,(sp+24)
800e69c: 2b 8e 00 14 lw r14,(sp+20)
800e6a0: 2b 8f 00 10 lw r15,(sp+16)
800e6a4: 2b 90 00 0c lw r16,(sp+12)
800e6a8: 2b 91 00 08 lw r17,(sp+8)
800e6ac: 37 9c 00 20 addi sp,sp,32
800e6b0: c3 a0 00 00 ret
0800ec04 <rtems_rfs_group_usage>:
size_t* blocks,
size_t* inodes)
{
int g;
*blocks = 0;
800ec04: 58 40 00 00 sw (r2+0),r0 <== NOT EXECUTED
*inodes = 0;
800ec08: 58 60 00 00 sw (r3+0),r0 <== NOT EXECUTED
for (g = 0; g < fs->group_count; g++)
800ec0c: 34 06 00 00 mvi r6,0 <== NOT EXECUTED
800ec10: 34 05 00 00 mvi r5,0 <== NOT EXECUTED
800ec14: e0 00 00 10 bi 800ec54 <rtems_rfs_group_usage+0x50> <== NOT EXECUTED
{
rtems_rfs_group* group = &fs->groups[g];
800ec18: 28 24 00 20 lw r4,(r1+32) <== NOT EXECUTED
int g;
*blocks = 0;
*inodes = 0;
for (g = 0; g < fs->group_count; g++)
800ec1c: 34 a5 00 01 addi r5,r5,1 <== NOT EXECUTED
{
rtems_rfs_group* group = &fs->groups[g];
800ec20: b4 86 20 00 add r4,r4,r6 <== NOT EXECUTED
*blocks +=
rtems_rfs_bitmap_map_size(&group->block_bitmap) -
800ec24: 28 89 00 14 lw r9,(r4+20) <== NOT EXECUTED
800ec28: 28 88 00 18 lw r8,(r4+24) <== NOT EXECUTED
int g;
*blocks = 0;
*inodes = 0;
for (g = 0; g < fs->group_count; g++)
800ec2c: 34 c6 00 50 addi r6,r6,80 <== NOT EXECUTED
{
rtems_rfs_group* group = &fs->groups[g];
*blocks +=
rtems_rfs_bitmap_map_size(&group->block_bitmap) -
800ec30: c9 28 40 00 sub r8,r9,r8 <== NOT EXECUTED
*inodes = 0;
for (g = 0; g < fs->group_count; g++)
{
rtems_rfs_group* group = &fs->groups[g];
*blocks +=
800ec34: b4 e8 38 00 add r7,r7,r8 <== NOT EXECUTED
800ec38: 58 47 00 00 sw (r2+0),r7 <== 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) -
800ec3c: 28 87 00 38 lw r7,(r4+56) <== NOT EXECUTED
800ec40: 28 84 00 3c lw r4,(r4+60) <== NOT EXECUTED
800ec44: c8 e4 20 00 sub r4,r7,r4 <== 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 +=
800ec48: 28 67 00 00 lw r7,(r3+0) <== NOT EXECUTED
800ec4c: b4 e4 20 00 add r4,r7,r4 <== NOT EXECUTED
800ec50: 58 64 00 00 sw (r3+0),r4 <== NOT EXECUTED
int g;
*blocks = 0;
*inodes = 0;
for (g = 0; g < fs->group_count; g++)
800ec54: 28 24 00 24 lw r4,(r1+36) <== NOT EXECUTED
800ec58: 28 47 00 00 lw r7,(r2+0) <== NOT EXECUTED
800ec5c: 48 85 ff ef bg r4,r5,800ec18 <rtems_rfs_group_usage+0x14> <== 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))
800ec60: 28 24 00 04 lw r4,(r1+4) <== NOT EXECUTED
800ec64: 50 87 00 02 bgeu r4,r7,800ec6c <rtems_rfs_group_usage+0x68><== NOT EXECUTED
*blocks = rtems_rfs_fs_blocks (fs);
800ec68: 58 44 00 00 sw (r2+0),r4 <== NOT EXECUTED
if (*inodes > rtems_rfs_fs_inodes (fs))
800ec6c: 28 21 00 14 lw r1,(r1+20) <== NOT EXECUTED
800ec70: 28 62 00 00 lw r2,(r3+0) <== NOT EXECUTED
800ec74: 50 22 00 02 bgeu r1,r2,800ec7c <rtems_rfs_group_usage+0x78><== NOT EXECUTED
*inodes = rtems_rfs_fs_inodes (fs);
800ec78: 58 61 00 00 sw (r3+0),r1 <== NOT EXECUTED
return 0;
}
800ec7c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
800ec80: c3 a0 00 00 ret <== NOT EXECUTED
0800efc8 <rtems_rfs_inode_close>:
}
int
rtems_rfs_inode_close (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle)
{
800efc8: 37 9c ff f4 addi sp,sp,-12
800efcc: 5b 8b 00 0c sw (sp+12),r11
800efd0: 5b 8c 00 08 sw (sp+8),r12
800efd4: 5b 9d 00 04 sw (sp+4),ra
800efd8: b8 20 60 00 mv r12,r1
800efdc: b8 40 58 00 mv r11,r2
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CLOSE))
800efe0: 34 01 00 00 mvi r1,0
800efe4: 78 02 00 08 mvhi r2,0x8
800efe8: f8 00 07 50 calli 8010d28 <rtems_rfs_trace>
800efec: 44 20 00 06 be r1,r0,800f004 <rtems_rfs_inode_close+0x3c> <== ALWAYS TAKEN
printf ("rtems-rfs: inode-close: ino: %" PRIu32 "\n", handle->ino);
800eff0: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
800eff4: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
800eff8: 29 62 00 08 lw r2,(r11+8) <== NOT EXECUTED
800effc: 38 21 6e 6c ori r1,r1,0x6e6c <== NOT EXECUTED
800f000: f8 00 4d 9d calli 8022674 <printf> <== NOT EXECUTED
rc = rtems_rfs_inode_unload (fs, handle, true);
800f004: b9 80 08 00 mv r1,r12
800f008: b9 60 10 00 mv r2,r11
800f00c: 34 03 00 01 mvi r3,1
800f010: fb ff ff a8 calli 800eeb0 <rtems_rfs_inode_unload>
800f014: b8 20 60 00 mv r12,r1
if ((rc == 0) && (handle->loads > 0))
800f018: 5c 20 00 0b bne r1,r0,800f044 <rtems_rfs_inode_close+0x7c> <== NEVER TAKEN
800f01c: 29 62 00 24 lw r2,(r11+36)
800f020: 4c 22 00 09 bge r1,r2,800f044 <rtems_rfs_inode_close+0x7c> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CLOSE))
800f024: 78 02 00 08 mvhi r2,0x8 <== NOT EXECUTED
800f028: f8 00 07 40 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
printf ("rtems-rfs: inode-close: bad loads number: %d\n",
handle->loads);
rc = EIO;
800f02c: 34 0c 00 05 mvi r12,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))
800f030: 44 20 00 05 be r1,r0,800f044 <rtems_rfs_inode_close+0x7c> <== NOT EXECUTED
printf ("rtems-rfs: inode-close: bad loads number: %d\n",
800f034: 29 62 00 24 lw r2,(r11+36) <== NOT EXECUTED
800f038: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800f03c: 38 21 6e 90 ori r1,r1,0x6e90 <== NOT EXECUTED
800f040: f8 00 4d 8d calli 8022674 <printf> <== NOT EXECUTED
rc = EIO;
}
handle->ino = 0;
return rc;
}
800f044: b9 80 08 00 mv r1,r12
printf ("rtems-rfs: inode-close: bad loads number: %d\n",
handle->loads);
rc = EIO;
}
handle->ino = 0;
800f048: 59 60 00 08 sw (r11+8),r0
return rc;
}
800f04c: 2b 9d 00 04 lw ra,(sp+4)
800f050: 2b 8b 00 0c lw r11,(sp+12)
800f054: 2b 8c 00 08 lw r12,(sp+8)
800f058: 37 9c 00 0c addi sp,sp,12
800f05c: c3 a0 00 00 ret
0800f418 <rtems_rfs_inode_create>:
uint16_t mode,
uint16_t links,
uid_t uid,
gid_t gid,
rtems_rfs_ino* ino)
{
800f418: 37 9c ff 7c addi sp,sp,-132
800f41c: 5b 8b 00 34 sw (sp+52),r11
800f420: 5b 8c 00 30 sw (sp+48),r12
800f424: 5b 8d 00 2c sw (sp+44),r13
800f428: 5b 8e 00 28 sw (sp+40),r14
800f42c: 5b 8f 00 24 sw (sp+36),r15
800f430: 5b 90 00 20 sw (sp+32),r16
800f434: 5b 91 00 1c sw (sp+28),r17
800f438: 5b 92 00 18 sw (sp+24),r18
800f43c: 5b 93 00 14 sw (sp+20),r19
800f440: 5b 94 00 10 sw (sp+16),r20
800f444: 5b 95 00 0c sw (sp+12),r21
800f448: 5b 96 00 08 sw (sp+8),r22
800f44c: 5b 9d 00 04 sw (sp+4),ra
800f450: b8 20 58 00 mv r11,r1
800f454: b8 40 88 00 mv r17,r2
rtems_rfs_inode_handle parent_inode;
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CREATE))
800f458: 34 01 00 00 mvi r1,0
800f45c: 78 02 00 40 mvhi r2,0x40
uint16_t mode,
uint16_t links,
uid_t uid,
gid_t gid,
rtems_rfs_ino* ino)
{
800f460: b8 60 98 00 mv r19,r3
800f464: b8 80 90 00 mv r18,r4
800f468: 2b 8e 00 88 lw r14,(sp+136)
800f46c: 20 b0 ff ff andi r16,r5,0xffff
800f470: 20 d6 ff ff andi r22,r6,0xffff
800f474: 20 f5 ff ff andi r21,r7,0xffff
800f478: 21 14 ff ff andi r20,r8,0xffff
rtems_rfs_inode_handle parent_inode;
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CREATE))
800f47c: f8 00 06 2b calli 8010d28 <rtems_rfs_trace>
800f480: 44 20 00 29 be r1,r0,800f524 <rtems_rfs_inode_create+0x10c><== ALWAYS TAKEN
{
const char* type = "unknown";
int c;
if (RTEMS_RFS_S_ISDIR (mode))
type = "dir";
800f484: 78 0c 08 03 mvhi r12,0x803 <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CREATE))
{
const char* type = "unknown";
int c;
if (RTEMS_RFS_S_ISDIR (mode))
800f488: 22 01 f0 00 andi r1,r16,0xf000 <== NOT EXECUTED
800f48c: 34 02 40 00 mvi r2,16384 <== NOT EXECUTED
type = "dir";
800f490: 39 8c 6e ec ori r12,r12,0x6eec <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CREATE))
{
const char* type = "unknown";
int c;
if (RTEMS_RFS_S_ISDIR (mode))
800f494: 44 22 00 13 be r1,r2,800f4e0 <rtems_rfs_inode_create+0xc8> <== NOT EXECUTED
type = "dir";
else if (RTEMS_RFS_S_ISCHR (mode))
type = "char";
800f498: 78 0c 08 03 mvhi r12,0x803 <== NOT EXECUTED
{
const char* type = "unknown";
int c;
if (RTEMS_RFS_S_ISDIR (mode))
type = "dir";
else if (RTEMS_RFS_S_ISCHR (mode))
800f49c: 34 02 20 00 mvi r2,8192 <== NOT EXECUTED
type = "char";
800f4a0: 39 8c 6e f0 ori r12,r12,0x6ef0 <== NOT EXECUTED
{
const char* type = "unknown";
int c;
if (RTEMS_RFS_S_ISDIR (mode))
type = "dir";
else if (RTEMS_RFS_S_ISCHR (mode))
800f4a4: 44 22 00 0f be r1,r2,800f4e0 <rtems_rfs_inode_create+0xc8> <== NOT EXECUTED
type = "char";
else if (RTEMS_RFS_S_ISBLK (mode))
type = "block";
800f4a8: 78 0c 08 03 mvhi r12,0x803 <== 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))
800f4ac: 34 02 60 00 mvi r2,24576 <== NOT EXECUTED
type = "block";
800f4b0: 39 8c 6d 10 ori r12,r12,0x6d10 <== 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))
800f4b4: 44 22 00 0b be r1,r2,800f4e0 <rtems_rfs_inode_create+0xc8> <== NOT EXECUTED
type = "block";
else if (RTEMS_RFS_S_ISREG (mode))
type = "file";
800f4b8: 78 0c 08 03 mvhi r12,0x803 <== 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))
800f4bc: 34 42 20 00 addi r2,r2,8192 <== NOT EXECUTED
type = "file";
800f4c0: 39 8c 7f e4 ori r12,r12,0x7fe4 <== 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))
800f4c4: 44 22 00 07 be r1,r2,800f4e0 <rtems_rfs_inode_create+0xc8> <== NOT EXECUTED
type = "file";
else if (RTEMS_RFS_S_ISLNK (mode))
type = "link";
800f4c8: 78 0c 08 03 mvhi r12,0x803 <== NOT EXECUTED
type = "char";
else if (RTEMS_RFS_S_ISBLK (mode))
type = "block";
else if (RTEMS_RFS_S_ISREG (mode))
type = "file";
else if (RTEMS_RFS_S_ISLNK (mode))
800f4cc: 34 42 20 00 addi r2,r2,8192 <== NOT EXECUTED
type = "link";
800f4d0: 39 8c 6f 00 ori r12,r12,0x6f00 <== NOT EXECUTED
type = "char";
else if (RTEMS_RFS_S_ISBLK (mode))
type = "block";
else if (RTEMS_RFS_S_ISREG (mode))
type = "file";
else if (RTEMS_RFS_S_ISLNK (mode))
800f4d4: 44 22 00 03 be r1,r2,800f4e0 <rtems_rfs_inode_create+0xc8> <== NOT EXECUTED
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CREATE))
{
const char* type = "unknown";
800f4d8: 78 0c 08 03 mvhi r12,0x803 <== NOT EXECUTED
800f4dc: 39 8c 6e f8 ori r12,r12,0x6ef8 <== NOT EXECUTED
type = "block";
else if (RTEMS_RFS_S_ISREG (mode))
type = "file";
else if (RTEMS_RFS_S_ISLNK (mode))
type = "link";
printf("rtems-rfs: inode-create: parent:%" PRIu32 " name:", parent);
800f4e0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800f4e4: 38 21 6f 08 ori r1,r1,0x6f08 <== NOT EXECUTED
800f4e8: ba 20 10 00 mv r2,r17 <== NOT EXECUTED
800f4ec: f8 00 4c 62 calli 8022674 <printf> <== NOT EXECUTED
for (c = 0; c < length; c++)
800f4f0: 34 0d 00 00 mvi r13,0 <== NOT EXECUTED
800f4f4: e0 00 00 05 bi 800f508 <rtems_rfs_inode_create+0xf0> <== NOT EXECUTED
return rc;
}
int
rtems_rfs_inode_create (rtems_rfs_file_system* fs,
800f4f8: b6 6d 08 00 add r1,r19,r13 <== NOT EXECUTED
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++)
printf ("%c", name[c]);
800f4fc: 40 21 00 00 lbu r1,(r1+0) <== 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++)
800f500: 35 ad 00 01 addi r13,r13,1 <== NOT EXECUTED
printf ("%c", name[c]);
800f504: f8 00 4c e2 calli 802288c <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++)
800f508: 56 4d ff fc bgu r18,r13,800f4f8 <rtems_rfs_inode_create+0xe0><== NOT EXECUTED
printf ("%c", name[c]);
printf (" type:%s mode:%04x (%03o)\n", type, mode, mode & ((1 << 10) - 1));
800f50c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800f510: 38 21 6f 34 ori r1,r1,0x6f34 <== NOT EXECUTED
800f514: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
800f518: ba 00 18 00 mv r3,r16 <== NOT EXECUTED
800f51c: 22 04 03 ff andi r4,r16,0x3ff <== NOT EXECUTED
800f520: f8 00 4c 55 calli 8022674 <printf> <== NOT EXECUTED
}
/*
* The file type is field within the mode. Check we have a sane mode set.
*/
switch (mode & RTEMS_RFS_S_IFMT)
800f524: 22 0d f0 00 andi r13,r16,0xf000
800f528: 34 01 60 00 mvi r1,24576
800f52c: 45 a1 00 0b be r13,r1,800f558 <rtems_rfs_inode_create+0x140><== NEVER TAKEN
800f530: 49 a1 00 05 bg r13,r1,800f544 <rtems_rfs_inode_create+0x12c>
800f534: 34 01 20 00 mvi r1,8192
800f538: 45 a1 00 08 be r13,r1,800f558 <rtems_rfs_inode_create+0x140><== NEVER TAKEN
800f53c: 34 01 40 00 mvi r1,16384
800f540: e0 00 00 04 bi 800f550 <rtems_rfs_inode_create+0x138>
800f544: 38 01 80 00 mvu r1,0x8000
800f548: 45 a1 00 04 be r13,r1,800f558 <rtems_rfs_inode_create+0x140>
800f54c: 34 21 20 00 addi r1,r1,8192
case RTEMS_RFS_S_IFBLK:
case RTEMS_RFS_S_IFREG:
case RTEMS_RFS_S_IFLNK:
break;
default:
return EINVAL;
800f550: 34 0c 00 16 mvi r12,22
}
/*
* The file type is field within the mode. Check we have a sane mode set.
*/
switch (mode & RTEMS_RFS_S_IFMT)
800f554: 5d a1 00 7b bne r13,r1,800f740 <rtems_rfs_inode_create+0x328><== NEVER TAKEN
break;
default:
return EINVAL;
}
rc = rtems_rfs_inode_alloc (fs, parent, ino);
800f558: b9 60 08 00 mv r1,r11
800f55c: ba 20 10 00 mv r2,r17
800f560: b9 c0 18 00 mv r3,r14
800f564: fb ff fd c8 calli 800ec84 <rtems_rfs_inode_alloc>
800f568: b8 20 60 00 mv r12,r1
if (rc > 0)
800f56c: 48 20 00 75 bg r1,r0,800f740 <rtems_rfs_inode_create+0x328>
return rc;
rc = rtems_rfs_inode_open (fs, *ino, &inode, true);
800f570: 29 c2 00 00 lw r2,(r14+0)
800f574: 37 8f 00 38 addi r15,sp,56
800f578: b9 60 08 00 mv r1,r11
800f57c: b9 e0 18 00 mv r3,r15
800f580: 34 04 00 01 mvi r4,1
800f584: fb ff fe 05 calli 800ed98 <rtems_rfs_inode_open>
800f588: b8 20 60 00 mv r12,r1
if (rc > 0)
800f58c: 4c 01 00 02 bge r0,r1,800f594 <rtems_rfs_inode_create+0x17c><== ALWAYS TAKEN
800f590: e0 00 00 67 bi 800f72c <rtems_rfs_inode_create+0x314> <== NOT EXECUTED
{
rtems_rfs_inode_free (fs, *ino);
return rc;
}
rc = rtems_rfs_inode_initialise (&inode, links, mode, uid, gid);
800f594: b9 e0 08 00 mv r1,r15
800f598: ba c0 10 00 mv r2,r22
800f59c: ba 00 18 00 mv r3,r16
800f5a0: ba a0 20 00 mv r4,r21
800f5a4: ba 80 28 00 mv r5,r20
800f5a8: fb ff ff 28 calli 800f248 <rtems_rfs_inode_initialise>
800f5ac: b8 20 60 00 mv r12,r1
if (rc > 0)
800f5b0: 4c 01 00 05 bge r0,r1,800f5c4 <rtems_rfs_inode_create+0x1ac><== ALWAYS TAKEN
{
rtems_rfs_inode_close (fs, &inode);
800f5b4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800f5b8: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
800f5bc: fb ff fe 83 calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
800f5c0: e0 00 00 5b bi 800f72c <rtems_rfs_inode_create+0x314> <== NOT EXECUTED
/*
* Only handle the specifics of a directory. Let caller handle the others.
*
* The inode delete will free the inode.
*/
if (RTEMS_RFS_S_ISDIR (mode))
800f5c4: 34 01 40 00 mvi r1,16384
800f5c8: 5d a1 00 14 bne r13,r1,800f618 <rtems_rfs_inode_create+0x200>
{
rc = rtems_rfs_dir_add_entry (fs, &inode, ".", 1, *ino);
800f5cc: 29 c5 00 00 lw r5,(r14+0)
800f5d0: 78 03 08 03 mvhi r3,0x803
800f5d4: b9 60 08 00 mv r1,r11
800f5d8: b9 e0 10 00 mv r2,r15
800f5dc: 38 63 50 6c ori r3,r3,0x506c
800f5e0: 34 04 00 01 mvi r4,1
800f5e4: f8 00 30 38 calli 801b6c4 <rtems_rfs_dir_add_entry>
800f5e8: b8 20 60 00 mv r12,r1
if (rc == 0)
800f5ec: 5c 20 00 09 bne r1,r0,800f610 <rtems_rfs_inode_create+0x1f8><== NEVER TAKEN
rc = rtems_rfs_dir_add_entry (fs, &inode, "..", 2, parent);
800f5f0: 78 03 08 03 mvhi r3,0x803
800f5f4: b9 60 08 00 mv r1,r11
800f5f8: b9 e0 10 00 mv r2,r15
800f5fc: 38 63 50 70 ori r3,r3,0x5070
800f600: 34 04 00 02 mvi r4,2
800f604: ba 20 28 00 mv r5,r17
800f608: f8 00 30 2f calli 801b6c4 <rtems_rfs_dir_add_entry>
800f60c: b8 20 60 00 mv r12,r1
if (rc > 0)
800f610: 4c 0c 00 02 bge r0,r12,800f618 <rtems_rfs_inode_create+0x200><== ALWAYS TAKEN
800f614: e0 00 00 09 bi 800f638 <rtems_rfs_inode_create+0x220> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
return rc;
}
}
rc = rtems_rfs_inode_open (fs, parent, &parent_inode, true);
800f618: 37 8f 00 60 addi r15,sp,96
800f61c: b9 60 08 00 mv r1,r11
800f620: ba 20 10 00 mv r2,r17
800f624: b9 e0 18 00 mv r3,r15
800f628: 34 04 00 01 mvi r4,1
800f62c: fb ff fd db calli 800ed98 <rtems_rfs_inode_open>
800f630: b8 20 60 00 mv r12,r1
if (rc > 0)
800f634: 4c 01 00 03 bge r0,r1,800f640 <rtems_rfs_inode_create+0x228><== ALWAYS TAKEN
{
rtems_rfs_inode_delete (fs, &inode);
800f638: 37 8d 00 38 addi r13,sp,56 <== NOT EXECUTED
800f63c: e0 00 00 30 bi 800f6fc <rtems_rfs_inode_create+0x2e4> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_dir_add_entry (fs, &parent_inode, name, length, *ino);
800f640: 29 c5 00 00 lw r5,(r14+0)
800f644: b9 60 08 00 mv r1,r11
800f648: b9 e0 10 00 mv r2,r15
800f64c: ba 60 18 00 mv r3,r19
800f650: ba 40 20 00 mv r4,r18
800f654: f8 00 30 1c calli 801b6c4 <rtems_rfs_dir_add_entry>
800f658: b8 20 60 00 mv r12,r1
if (rc > 0)
800f65c: 4c 01 00 0b bge r0,r1,800f688 <rtems_rfs_inode_create+0x270><== ALWAYS TAKEN
{
rtems_rfs_inode_delete (fs, &inode);
800f660: 37 8d 00 38 addi r13,sp,56 <== NOT EXECUTED
800f664: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
800f668: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800f66c: fb ff fe 7d calli 800f060 <rtems_rfs_inode_delete> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
800f670: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
800f674: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800f678: fb ff fe 54 calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &parent_inode);
800f67c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800f680: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
800f684: e0 00 00 23 bi 800f710 <rtems_rfs_inode_create+0x2f8> <== NOT EXECUTED
/*
* If the node is a directory update the parent link count as the
* new directory has the '..' link that points to the parent.
*/
if (RTEMS_RFS_S_ISDIR (mode))
800f688: 34 01 40 00 mvi r1,16384
800f68c: 5d a1 00 16 bne r13,r1,800f6e4 <rtems_rfs_inode_create+0x2cc>
*/
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);
800f690: 2b 8c 00 6c lw r12,(sp+108)
800f694: 34 02 00 08 mvi r2,8
800f698: 41 81 00 00 lbu r1,(r12+0)
800f69c: fb ff c7 91 calli 80014e0 <__ashlsi3>
800f6a0: 41 82 00 01 lbu r2,(r12+1)
800f6a4: b8 22 08 00 or r1,r1,r2
800f6a8: 20 21 ff ff andi r1,r1,0xffff
if (links == 0xffff)
800f6ac: 38 02 ff ff mvu r2,0xffff
links = 0;
800f6b0: fc 22 10 00 cmpne r2,r1,r2
800f6b4: c8 02 10 00 sub r2,r0,r2
800f6b8: a0 22 08 00 and r1,r1,r2
rtems_rfs_inode_set_links (&parent_inode,
800f6bc: 34 21 00 01 addi r1,r1,1
800f6c0: 20 2d ff ff andi r13,r1,0xffff
* @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);
800f6c4: b9 a0 08 00 mv r1,r13
800f6c8: 34 02 00 08 mvi r2,8
800f6cc: fb ff c7 ac calli 800157c <__lshrsi3>
800f6d0: 31 81 00 00 sb (r12+0),r1
800f6d4: 2b 81 00 6c lw r1,(sp+108)
800f6d8: 30 2d 00 01 sb (r1+1),r13
rtems_rfs_buffer_mark_dirty (&handle->buffer);
800f6dc: 34 01 00 01 mvi r1,1
800f6e0: 33 81 00 70 sb (sp+112),r1
rtems_rfs_inode_get_links (&parent_inode) + 1);
rc = rtems_rfs_inode_close (fs, &parent_inode);
800f6e4: b9 60 08 00 mv r1,r11
800f6e8: 37 82 00 60 addi r2,sp,96
800f6ec: fb ff fe 37 calli 800efc8 <rtems_rfs_inode_close>
800f6f0: b8 20 60 00 mv r12,r1
800f6f4: 37 8d 00 38 addi r13,sp,56
if (rc > 0)
800f6f8: 4c 01 00 08 bge r0,r1,800f718 <rtems_rfs_inode_create+0x300><== ALWAYS TAKEN
{
rtems_rfs_inode_delete (fs, &inode);
800f6fc: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
800f700: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800f704: fb ff fe 57 calli 800f060 <rtems_rfs_inode_delete> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
800f708: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800f70c: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
800f710: fb ff fe 2e calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
800f714: e0 00 00 0b bi 800f740 <rtems_rfs_inode_create+0x328> <== NOT EXECUTED
}
rc = rtems_rfs_inode_close (fs, &inode);
800f718: b9 60 08 00 mv r1,r11
800f71c: b9 a0 10 00 mv r2,r13
800f720: fb ff fe 2a calli 800efc8 <rtems_rfs_inode_close>
800f724: b8 20 60 00 mv r12,r1
if (rc > 0)
800f728: 4c 01 00 05 bge r0,r1,800f73c <rtems_rfs_inode_create+0x324><== ALWAYS TAKEN
{
rtems_rfs_inode_free (fs, *ino);
800f72c: 29 c2 00 00 lw r2,(r14+0) <== NOT EXECUTED
800f730: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800f734: fb ff fd 61 calli 800ecb8 <rtems_rfs_inode_free> <== NOT EXECUTED
return rc;
800f738: e0 00 00 02 bi 800f740 <rtems_rfs_inode_create+0x328> <== NOT EXECUTED
}
return 0;
800f73c: 34 0c 00 00 mvi r12,0
}
800f740: b9 80 08 00 mv r1,r12
800f744: 2b 9d 00 04 lw ra,(sp+4)
800f748: 2b 8b 00 34 lw r11,(sp+52)
800f74c: 2b 8c 00 30 lw r12,(sp+48)
800f750: 2b 8d 00 2c lw r13,(sp+44)
800f754: 2b 8e 00 28 lw r14,(sp+40)
800f758: 2b 8f 00 24 lw r15,(sp+36)
800f75c: 2b 90 00 20 lw r16,(sp+32)
800f760: 2b 91 00 1c lw r17,(sp+28)
800f764: 2b 92 00 18 lw r18,(sp+24)
800f768: 2b 93 00 14 lw r19,(sp+20)
800f76c: 2b 94 00 10 lw r20,(sp+16)
800f770: 2b 95 00 0c lw r21,(sp+12)
800f774: 2b 96 00 08 lw r22,(sp+8)
800f778: 37 9c 00 84 addi sp,sp,132
800f77c: c3 a0 00 00 ret
0800f060 <rtems_rfs_inode_delete>:
}
int
rtems_rfs_inode_delete (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle)
{
800f060: 37 9c ff a0 addi sp,sp,-96
800f064: 5b 8b 00 10 sw (sp+16),r11
800f068: 5b 8c 00 0c sw (sp+12),r12
800f06c: 5b 8d 00 08 sw (sp+8),r13
800f070: 5b 9d 00 04 sw (sp+4),ra
800f074: b8 20 60 00 mv r12,r1
800f078: b8 40 58 00 mv r11,r2
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_DELETE))
800f07c: 34 01 00 00 mvi r1,0
800f080: 78 02 00 80 mvhi r2,0x80
800f084: f8 00 07 29 calli 8010d28 <rtems_rfs_trace>
800f088: 44 20 00 0b be r1,r0,800f0b4 <rtems_rfs_inode_delete+0x54> <== ALWAYS TAKEN
printf("rtems-rfs: inode-delete: ino:%" PRIu32 " loaded:%s\n",
800f08c: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED
800f090: 78 03 08 03 mvhi r3,0x803 <== NOT EXECUTED
800f094: 29 62 00 08 lw r2,(r11+8) <== NOT EXECUTED
800f098: 38 63 72 78 ori r3,r3,0x7278 <== NOT EXECUTED
800f09c: 44 20 00 03 be r1,r0,800f0a8 <rtems_rfs_inode_delete+0x48> <== NOT EXECUTED
800f0a0: 78 03 08 03 mvhi r3,0x803 <== NOT EXECUTED
800f0a4: 38 63 6d d8 ori r3,r3,0x6dd8 <== NOT EXECUTED
800f0a8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800f0ac: 38 21 6e c0 ori r1,r1,0x6ec0 <== NOT EXECUTED
800f0b0: f8 00 4d 71 calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_inode_ino (handle),
rtems_rfs_inode_is_loaded (handle) ? "yes" : "no");
if (rtems_rfs_inode_is_loaded (handle))
800f0b4: 29 62 00 0c lw r2,(r11+12)
int
rtems_rfs_inode_delete (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle)
{
int rc = 0;
800f0b8: 34 01 00 00 mvi r1,0
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_DELETE))
printf("rtems-rfs: inode-delete: ino:%" PRIu32 " loaded:%s\n",
rtems_rfs_inode_ino (handle),
rtems_rfs_inode_is_loaded (handle) ? "yes" : "no");
if (rtems_rfs_inode_is_loaded (handle))
800f0bc: 44 40 00 1c be r2,r0,800f12c <rtems_rfs_inode_delete+0xcc> <== NEVER TAKEN
rtems_rfs_block_map map;
/*
* Free the ino number.
*/
rc = rtems_rfs_inode_free (fs, handle->ino);
800f0c0: 29 62 00 08 lw r2,(r11+8)
800f0c4: b9 80 08 00 mv r1,r12
800f0c8: fb ff fe fc calli 800ecb8 <rtems_rfs_inode_free>
if (rc > 0)
800f0cc: 48 20 00 18 bg r1,r0,800f12c <rtems_rfs_inode_delete+0xcc> <== NEVER TAKEN
return rc;
/*
* Free the blocks the inode may have attached.
*/
rc = rtems_rfs_block_map_open (fs, handle, &map);
800f0d0: 37 8d 00 14 addi r13,sp,20
800f0d4: b9 80 08 00 mv r1,r12
800f0d8: b9 60 10 00 mv r2,r11
800f0dc: b9 a0 18 00 mv r3,r13
800f0e0: f8 00 29 9e calli 8019758 <rtems_rfs_block_map_open>
if (rc == 0)
800f0e4: 5c 20 00 12 bne r1,r0,800f12c <rtems_rfs_inode_delete+0xcc><== NEVER TAKEN
{
int rrc;
rrc = rtems_rfs_block_map_free_all (fs, &map);
800f0e8: b9 a0 10 00 mv r2,r13
800f0ec: b9 80 08 00 mv r1,r12
800f0f0: f8 00 2d 7c calli 801a6e0 <rtems_rfs_block_map_free_all>
rc = rtems_rfs_block_map_close (fs, &map);
800f0f4: b9 a0 10 00 mv r2,r13
800f0f8: b9 80 08 00 mv r1,r12
800f0fc: f8 00 2a 1e calli 8019974 <rtems_rfs_block_map_close>
if (rc > 0)
rrc = rc;
memset (handle->node, 0xff, RTEMS_RFS_INODE_SIZE);
800f100: 29 61 00 0c lw r1,(r11+12)
800f104: 34 02 00 ff mvi r2,255
800f108: 34 03 00 38 mvi r3,56
800f10c: f8 00 4c be calli 8022404 <memset>
rtems_rfs_buffer_mark_dirty (&handle->buffer);
800f110: 34 01 00 01 mvi r1,1
800f114: 31 61 00 10 sb (r11+16),r1
/*
* 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);
800f118: 35 62 00 10 addi r2,r11,16
800f11c: b9 80 08 00 mv r1,r12
800f120: f8 00 2d eb calli 801a8cc <rtems_rfs_buffer_handle_release>
handle->loads = 0;
800f124: 59 60 00 24 sw (r11+36),r0
handle->node = NULL;
800f128: 59 60 00 0c sw (r11+12),r0
}
}
return rc;
}
800f12c: 2b 9d 00 04 lw ra,(sp+4)
800f130: 2b 8b 00 10 lw r11,(sp+16)
800f134: 2b 8c 00 0c lw r12,(sp+12)
800f138: 2b 8d 00 08 lw r13,(sp+8)
800f13c: 37 9c 00 60 addi sp,sp,96
800f140: c3 a0 00 00 ret
0801eb60 <rtems_rfs_inode_get_block.clone.0>:
* @param handle The inode handle.
* @param block The block number to return.
* @return uint32_t The block number.
*/
static inline uint32_t
rtems_rfs_inode_get_block (rtems_rfs_inode_handle* handle, int block)
801eb60: 37 9c ff f4 addi sp,sp,-12 <== NOT EXECUTED
801eb64: 5b 8b 00 0c sw (sp+12),r11 <== NOT EXECUTED
801eb68: 5b 8c 00 08 sw (sp+8),r12 <== NOT EXECUTED
801eb6c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
{
return rtems_rfs_read_u32 (&handle->node->data.blocks[block]);
801eb70: 34 2b 00 1c addi r11,r1,28 <== NOT EXECUTED
801eb74: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
801eb78: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801eb7c: fb ff 8a 59 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801eb80: b5 61 58 00 add r11,r11,r1 <== NOT EXECUTED
801eb84: 41 61 00 00 lbu r1,(r11+0) <== NOT EXECUTED
801eb88: 41 6c 00 03 lbu r12,(r11+3) <== NOT EXECUTED
801eb8c: 34 02 00 18 mvi r2,24 <== NOT EXECUTED
801eb90: fb ff 8a 54 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801eb94: b9 81 60 00 or r12,r12,r1 <== NOT EXECUTED
801eb98: 41 61 00 01 lbu r1,(r11+1) <== NOT EXECUTED
801eb9c: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
801eba0: fb ff 8a 50 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
801eba4: b9 81 60 00 or r12,r12,r1 <== NOT EXECUTED
801eba8: 41 61 00 02 lbu r1,(r11+2) <== NOT EXECUTED
801ebac: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
801ebb0: fb ff 8a 4c calli 80014e0 <__ashlsi3> <== NOT EXECUTED
}
801ebb4: b9 81 08 00 or r1,r12,r1 <== NOT EXECUTED
801ebb8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
801ebbc: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED
801ebc0: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED
801ebc4: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED
801ebc8: c3 a0 00 00 ret <== NOT EXECUTED
08010324 <rtems_rfs_inode_get_block.clone.12>:
* @param handle The inode handle.
* @param block The block number to return.
* @return uint32_t The block number.
*/
static inline uint32_t
rtems_rfs_inode_get_block (rtems_rfs_inode_handle* handle, int block)
8010324: 37 9c ff f4 addi sp,sp,-12 <== NOT EXECUTED
8010328: 5b 8b 00 0c sw (sp+12),r11 <== NOT EXECUTED
801032c: 5b 8c 00 08 sw (sp+8),r12 <== NOT EXECUTED
8010330: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
{
return rtems_rfs_read_u32 (&handle->node->data.blocks[block]);
8010334: 34 2b 00 1c addi r11,r1,28 <== NOT EXECUTED
8010338: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
801033c: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
8010340: fb ff c4 68 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
8010344: b5 61 58 00 add r11,r11,r1 <== NOT EXECUTED
8010348: 41 61 00 00 lbu r1,(r11+0) <== NOT EXECUTED
801034c: 41 6c 00 03 lbu r12,(r11+3) <== NOT EXECUTED
8010350: 34 02 00 18 mvi r2,24 <== NOT EXECUTED
8010354: fb ff c4 63 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
8010358: b9 81 60 00 or r12,r12,r1 <== NOT EXECUTED
801035c: 41 61 00 01 lbu r1,(r11+1) <== NOT EXECUTED
8010360: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
8010364: fb ff c4 5f calli 80014e0 <__ashlsi3> <== NOT EXECUTED
8010368: b9 81 60 00 or r12,r12,r1 <== NOT EXECUTED
801036c: 41 61 00 02 lbu r1,(r11+2) <== NOT EXECUTED
8010370: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
8010374: fb ff c4 5b calli 80014e0 <__ashlsi3> <== NOT EXECUTED
}
8010378: b9 81 08 00 or r1,r12,r1 <== NOT EXECUTED
801037c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8010380: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED
8010384: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED
8010388: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED
801038c: c3 a0 00 00 ret <== NOT EXECUTED
0801e2c4 <rtems_rfs_inode_get_block.clone.5>:
* @param handle The inode handle.
* @param block The block number to return.
* @return uint32_t The block number.
*/
static inline uint32_t
rtems_rfs_inode_get_block (rtems_rfs_inode_handle* handle, int block)
801e2c4: 37 9c ff f4 addi sp,sp,-12 <== NOT EXECUTED
801e2c8: 5b 8b 00 0c sw (sp+12),r11 <== NOT EXECUTED
801e2cc: 5b 8c 00 08 sw (sp+8),r12 <== NOT EXECUTED
801e2d0: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
{
return rtems_rfs_read_u32 (&handle->node->data.blocks[block]);
801e2d4: 34 2b 00 1c addi r11,r1,28 <== NOT EXECUTED
801e2d8: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
801e2dc: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801e2e0: fb ff 87 c6 calli 80001f8 <__ashlsi3> <== NOT EXECUTED
801e2e4: b5 61 58 00 add r11,r11,r1 <== NOT EXECUTED
801e2e8: 41 61 00 00 lbu r1,(r11+0) <== NOT EXECUTED
801e2ec: 41 6c 00 03 lbu r12,(r11+3) <== NOT EXECUTED
801e2f0: 34 02 00 18 mvi r2,24 <== NOT EXECUTED
801e2f4: fb ff 87 c1 calli 80001f8 <__ashlsi3> <== NOT EXECUTED
801e2f8: b9 81 60 00 or r12,r12,r1 <== NOT EXECUTED
801e2fc: 41 61 00 01 lbu r1,(r11+1) <== NOT EXECUTED
801e300: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
801e304: fb ff 87 bd calli 80001f8 <__ashlsi3> <== NOT EXECUTED
801e308: b9 81 60 00 or r12,r12,r1 <== NOT EXECUTED
801e30c: 41 61 00 02 lbu r1,(r11+2) <== NOT EXECUTED
801e310: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
801e314: fb ff 87 b9 calli 80001f8 <__ashlsi3> <== NOT EXECUTED
}
801e318: b9 81 08 00 or r1,r12,r1 <== NOT EXECUTED
801e31c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
801e320: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED
801e324: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED
801e328: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED
801e32c: c3 a0 00 00 ret <== NOT EXECUTED
0800ecd8 <rtems_rfs_inode_load>:
}
int
rtems_rfs_inode_load (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle)
{
800ecd8: 37 9c ff f0 addi sp,sp,-16
800ecdc: 5b 8b 00 10 sw (sp+16),r11
800ece0: 5b 8c 00 0c sw (sp+12),r12
800ece4: 5b 8d 00 08 sw (sp+8),r13
800ece8: 5b 9d 00 04 sw (sp+4),ra
800ecec: b8 20 68 00 mv r13,r1
800ecf0: b8 40 58 00 mv r11,r2
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_LOAD))
800ecf4: 34 01 00 00 mvi r1,0
800ecf8: 78 02 00 10 mvhi r2,0x10
800ecfc: f8 00 08 0b calli 8010d28 <rtems_rfs_trace>
800ed00: 44 20 00 0d be r1,r0,800ed34 <rtems_rfs_inode_load+0x5c> <== ALWAYS TAKEN
printf ("rtems-rfs: inode-load: ino=%" PRIu32 " loads=%i loaded=%s\n",
800ed04: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED
800ed08: 78 04 08 03 mvhi r4,0x803 <== NOT EXECUTED
800ed0c: 29 62 00 08 lw r2,(r11+8) <== NOT EXECUTED
800ed10: 29 63 00 24 lw r3,(r11+36) <== NOT EXECUTED
800ed14: 38 84 72 78 ori r4,r4,0x7278 <== NOT EXECUTED
800ed18: 44 20 00 03 be r1,r0,800ed24 <rtems_rfs_inode_load+0x4c> <== NOT EXECUTED
800ed1c: 78 04 08 03 mvhi r4,0x803 <== NOT EXECUTED
800ed20: 38 84 6d d8 ori r4,r4,0x6dd8 <== NOT EXECUTED
800ed24: 78 05 08 03 mvhi r5,0x803 <== NOT EXECUTED
800ed28: b8 a0 08 00 mv r1,r5 <== NOT EXECUTED
800ed2c: 38 21 6d dc ori r1,r1,0x6ddc <== NOT EXECUTED
800ed30: f8 00 4e 51 calli 8022674 <printf> <== NOT EXECUTED
/*
* An inode does not move so once loaded no need to do again.
*/
if (!rtems_rfs_inode_is_loaded (handle))
800ed34: 29 6c 00 0c lw r12,(r11+12)
800ed38: 5d 80 00 0e bne r12,r0,800ed70 <rtems_rfs_inode_load+0x98>
{
int rc;
rc = rtems_rfs_buffer_handle_request (fs,&handle->buffer,
800ed3c: 29 63 00 1c lw r3,(r11+28)
800ed40: b9 a0 08 00 mv r1,r13
800ed44: 35 62 00 10 addi r2,r11,16
800ed48: 34 04 00 01 mvi r4,1
800ed4c: f8 00 2f 4f calli 801aa88 <rtems_rfs_buffer_handle_request>
handle->block, true);
if (rc > 0)
800ed50: 48 2c 00 0c bg r1,r12,800ed80 <rtems_rfs_inode_load+0xa8> <== NEVER TAKEN
return rc;
handle->node = rtems_rfs_buffer_data (&handle->buffer);
handle->node += handle->offset;
800ed54: 29 61 00 20 lw r1,(r11+32)
rc = rtems_rfs_buffer_handle_request (fs,&handle->buffer,
handle->block, true);
if (rc > 0)
return rc;
handle->node = rtems_rfs_buffer_data (&handle->buffer);
800ed58: 29 6c 00 18 lw r12,(r11+24)
handle->node += handle->offset;
800ed5c: 34 02 00 38 mvi r2,56
800ed60: fb ff ca 2e calli 8001618 <__mulsi3>
800ed64: 29 82 00 1c lw r2,(r12+28)
800ed68: b4 41 08 00 add r1,r2,r1
800ed6c: 59 61 00 0c sw (r11+12),r1
}
handle->loads++;
800ed70: 29 61 00 24 lw r1,(r11+36)
800ed74: 34 21 00 01 addi r1,r1,1
800ed78: 59 61 00 24 sw (r11+36),r1
return 0;
800ed7c: 34 01 00 00 mvi r1,0
}
800ed80: 2b 9d 00 04 lw ra,(sp+4)
800ed84: 2b 8b 00 10 lw r11,(sp+16)
800ed88: 2b 8c 00 0c lw r12,(sp+12)
800ed8c: 2b 8d 00 08 lw r13,(sp+8)
800ed90: 37 9c 00 10 addi sp,sp,16
800ed94: c3 a0 00 00 ret
0800ed98 <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)
{
800ed98: 37 9c ff e0 addi sp,sp,-32
800ed9c: 5b 8b 00 20 sw (sp+32),r11
800eda0: 5b 8c 00 1c sw (sp+28),r12
800eda4: 5b 8d 00 18 sw (sp+24),r13
800eda8: 5b 8e 00 14 sw (sp+20),r14
800edac: 5b 8f 00 10 sw (sp+16),r15
800edb0: 5b 90 00 0c sw (sp+12),r16
800edb4: 5b 91 00 08 sw (sp+8),r17
800edb8: 5b 9d 00 04 sw (sp+4),ra
800edbc: b8 20 60 00 mv r12,r1
800edc0: b8 40 68 00 mv r13,r2
int group;
int gino;
int index;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_OPEN))
800edc4: 34 01 00 00 mvi r1,0
800edc8: 78 02 00 04 mvhi r2,0x4
int
rtems_rfs_inode_open (rtems_rfs_file_system* fs,
rtems_rfs_ino ino,
rtems_rfs_inode_handle* handle,
bool load)
{
800edcc: b8 60 58 00 mv r11,r3
800edd0: 20 8f 00 ff andi r15,r4,0xff
int group;
int gino;
int index;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_OPEN))
800edd4: f8 00 07 d5 calli 8010d28 <rtems_rfs_trace>
800edd8: 44 20 00 05 be r1,r0,800edec <rtems_rfs_inode_open+0x54> <== ALWAYS TAKEN
printf ("rtems-rfs: inode-open: ino: %" PRIu32 "\n", ino);
800eddc: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800ede0: 38 21 6e 10 ori r1,r1,0x6e10 <== NOT EXECUTED
800ede4: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
800ede8: f8 00 4e 23 calli 8022674 <printf> <== NOT EXECUTED
if (ino == RTEMS_RFS_EMPTY_INO)
return EINVAL;
800edec: 34 01 00 16 mvi r1,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)
800edf0: 45 a0 00 26 be r13,r0,800ee88 <rtems_rfs_inode_open+0xf0> <== NEVER TAKEN
return EINVAL;
if ((ino - RTEMS_RFS_ROOT_INO) > rtems_rfs_fs_inodes (fs))
800edf4: 29 82 00 14 lw r2,(r12+20)
800edf8: 35 ae ff ff addi r14,r13,-1
800edfc: 55 c2 00 23 bgu r14,r2,800ee88 <rtems_rfs_inode_open+0xf0> <== NEVER TAKEN
return EINVAL;
handle->ino = ino;
800ee00: 59 6d 00 08 sw (r11+8),r13
handle->node = NULL;
handle->loads = 0;
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
800ee04: 29 8d 00 2c lw r13,(r12+44)
if ((ino - RTEMS_RFS_ROOT_INO) > rtems_rfs_fs_inodes (fs))
return EINVAL;
handle->ino = ino;
handle->node = NULL;
800ee08: 59 60 00 0c sw (r11+12),r0
handle->loads = 0;
800ee0c: 59 60 00 24 sw (r11+36),r0
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
gino = gino % fs->group_inodes;
800ee10: b9 a0 10 00 mv r2,r13
800ee14: b9 c0 08 00 mv r1,r14
800ee18: f8 00 95 3b calli 8034304 <__umodsi3>
index = (gino / fs->inodes_per_block) + RTEMS_RFS_GROUP_INODE_BLOCK;
800ee1c: 29 90 00 30 lw r16,(r12+48)
handle->node = NULL;
handle->loads = 0;
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
gino = gino % fs->group_inodes;
800ee20: b8 20 88 00 mv r17,r1
index = (gino / fs->inodes_per_block) + RTEMS_RFS_GROUP_INODE_BLOCK;
handle->offset = gino % fs->inodes_per_block;
800ee24: ba 00 10 00 mv r2,r16
800ee28: f8 00 95 37 calli 8034304 <__umodsi3>
handle->ino = ino;
handle->node = NULL;
handle->loads = 0;
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
800ee2c: b9 a0 10 00 mv r2,r13
gino = gino % fs->group_inodes;
index = (gino / fs->inodes_per_block) + RTEMS_RFS_GROUP_INODE_BLOCK;
handle->offset = gino % fs->inodes_per_block;
800ee30: 59 61 00 20 sw (r11+32),r1
handle->ino = ino;
handle->node = NULL;
handle->loads = 0;
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
800ee34: b9 c0 08 00 mv r1,r14
800ee38: fb ff ca 04 calli 8001648 <__udivsi3>
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);
800ee3c: 29 8d 00 20 lw r13,(r12+32)
800ee40: 34 02 00 50 mvi r2,80
800ee44: fb ff c9 f5 calli 8001618 <__mulsi3>
800ee48: b5 a1 18 00 add r3,r13,r1
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;
800ee4c: 28 6d 00 00 lw r13,(r3+0)
800ee50: ba 20 08 00 mv r1,r17
800ee54: ba 00 10 00 mv r2,r16
800ee58: fb ff c9 fc calli 8001648 <__udivsi3>
800ee5c: 35 ad 00 02 addi r13,r13,2
handle->offset = gino % fs->inodes_per_block;
handle->block = rtems_rfs_group_block (&fs->groups[group], index);
800ee60: b5 a1 08 00 add r1,r13,r1
800ee64: 59 61 00 1c sw (r11+28),r1
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
800ee68: 31 60 00 10 sb (r11+16),r0
handle->bnum = 0;
800ee6c: 59 60 00 14 sw (r11+20),r0
handle->buffer = NULL;
800ee70: 59 60 00 18 sw (r11+24),r0
rc = rtems_rfs_buffer_handle_open (fs, &handle->buffer);
800ee74: 34 01 00 00 mvi r1,0
if ((rc == 0) && load)
800ee78: 45 e0 00 04 be r15,r0,800ee88 <rtems_rfs_inode_open+0xf0> <== NEVER TAKEN
rc = rtems_rfs_inode_load (fs, handle);
800ee7c: b9 80 08 00 mv r1,r12
800ee80: b9 60 10 00 mv r2,r11
800ee84: fb ff ff 95 calli 800ecd8 <rtems_rfs_inode_load>
return rc;
}
800ee88: 2b 9d 00 04 lw ra,(sp+4)
800ee8c: 2b 8b 00 20 lw r11,(sp+32)
800ee90: 2b 8c 00 1c lw r12,(sp+28)
800ee94: 2b 8d 00 18 lw r13,(sp+24)
800ee98: 2b 8e 00 14 lw r14,(sp+20)
800ee9c: 2b 8f 00 10 lw r15,(sp+16)
800eea0: 2b 90 00 0c lw r16,(sp+12)
800eea4: 2b 91 00 08 lw r17,(sp+8)
800eea8: 37 9c 00 20 addi sp,sp,32
800eeac: c3 a0 00 00 ret
0800d6f4 <rtems_rfs_inode_overhead>:
/**
* Return the inode overhead given a number of inodes.
*/
static int
rtems_rfs_inode_overhead (rtems_rfs_file_system* fs)
{
800d6f4: 37 9c ff f0 addi sp,sp,-16 <== NOT EXECUTED
800d6f8: 5b 8b 00 10 sw (sp+16),r11 <== NOT EXECUTED
800d6fc: 5b 8c 00 0c sw (sp+12),r12 <== NOT EXECUTED
800d700: 5b 8d 00 08 sw (sp+8),r13 <== NOT EXECUTED
800d704: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
int blocks;
int bits_per_block;
blocks = rtems_rfs_rup_quotient(fs->group_inodes * RTEMS_RFS_INODE_SIZE,
rtems_rfs_fs_block_size (fs));
800d708: 28 2d 00 08 lw r13,(r1+8) <== NOT EXECUTED
/**
* Return the inode overhead given a number of inodes.
*/
static int
rtems_rfs_inode_overhead (rtems_rfs_file_system* fs)
{
800d70c: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
int blocks;
int bits_per_block;
blocks = rtems_rfs_rup_quotient(fs->group_inodes * RTEMS_RFS_INODE_SIZE,
800d710: 28 21 00 2c lw r1,(r1+44) <== NOT EXECUTED
800d714: 34 02 00 38 mvi r2,56 <== NOT EXECUTED
800d718: fb ff cf c0 calli 8001618 <__mulsi3> <== NOT EXECUTED
800d71c: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
800d720: fb ff ff ea calli 800d6c8 <rtems_rfs_rup_quotient> <== NOT EXECUTED
800d724: b8 20 60 00 mv r12,r1 <== 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));
800d728: 34 02 00 03 mvi r2,3 <== NOT EXECUTED
800d72c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
800d730: fb ff cf 6c calli 80014e0 <__ashlsi3> <== 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))
800d734: 29 6b 00 04 lw r11,(r11+4) <== NOT EXECUTED
800d738: 35 6b ff ff addi r11,r11,-1 <== NOT EXECUTED
800d73c: 54 2b 00 02 bgu r1,r11,800d744 <rtems_rfs_inode_overhead+0x50><== 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));
800d740: b8 20 58 00 mv r11,r1 <== 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;
800d744: 35 81 00 01 addi r1,r12,1 <== NOT EXECUTED
800d748: 34 02 03 e8 mvi r2,1000 <== NOT EXECUTED
800d74c: fb ff cf b3 calli 8001618 <__mulsi3> <== NOT EXECUTED
800d750: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
800d754: f8 00 9a 93 calli 80341a0 <__divsi3> <== NOT EXECUTED
}
800d758: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
800d75c: 2b 8b 00 10 lw r11,(sp+16) <== NOT EXECUTED
800d760: 2b 8c 00 0c lw r12,(sp+12) <== NOT EXECUTED
800d764: 2b 8d 00 08 lw r13,(sp+8) <== NOT EXECUTED
800d768: 37 9c 00 10 addi sp,sp,16 <== NOT EXECUTED
800d76c: c3 a0 00 00 ret <== NOT EXECUTED
0800f824 <rtems_rfs_inode_set_block>:
* @param block The block index.
* @param bno The block number.
*/
static inline void
rtems_rfs_inode_set_block (rtems_rfs_inode_handle* handle, int block, uint32_t bno)
{
800f824: 37 9c ff ec addi sp,sp,-20 <== NOT EXECUTED
800f828: 5b 8b 00 14 sw (sp+20),r11 <== NOT EXECUTED
800f82c: 5b 8c 00 10 sw (sp+16),r12 <== NOT EXECUTED
800f830: 5b 8d 00 0c sw (sp+12),r13 <== NOT EXECUTED
800f834: 5b 8e 00 08 sw (sp+8),r14 <== NOT EXECUTED
800f838: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
800f83c: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
rtems_rfs_write_u32 (&handle->node->data.blocks[block], bno);
800f840: b8 40 08 00 mv r1,r2 <== NOT EXECUTED
800f844: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
* @param block The block index.
* @param bno The block number.
*/
static inline void
rtems_rfs_inode_set_block (rtems_rfs_inode_handle* handle, int block, uint32_t bno)
{
800f848: b8 60 60 00 mv r12,r3 <== NOT EXECUTED
rtems_rfs_write_u32 (&handle->node->data.blocks[block], bno);
800f84c: fb ff c7 25 calli 80014e0 <__ashlsi3> <== NOT EXECUTED
800f850: 29 6e 00 0c lw r14,(r11+12) <== NOT EXECUTED
800f854: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
800f858: 34 02 00 18 mvi r2,24 <== NOT EXECUTED
800f85c: b5 c1 70 00 add r14,r14,r1 <== NOT EXECUTED
800f860: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800f864: fb ff c7 46 calli 800157c <__lshrsi3> <== NOT EXECUTED
800f868: 31 c1 00 1c sb (r14+28),r1 <== NOT EXECUTED
800f86c: 29 6e 00 0c lw r14,(r11+12) <== NOT EXECUTED
800f870: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800f874: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
800f878: fb ff c7 41 calli 800157c <__lshrsi3> <== NOT EXECUTED
800f87c: b5 cd 70 00 add r14,r14,r13 <== NOT EXECUTED
800f880: 31 c1 00 1d sb (r14+29),r1 <== NOT EXECUTED
800f884: 29 6e 00 0c lw r14,(r11+12) <== NOT EXECUTED
800f888: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800f88c: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
800f890: fb ff c7 3b calli 800157c <__lshrsi3> <== NOT EXECUTED
800f894: b5 cd 70 00 add r14,r14,r13 <== NOT EXECUTED
800f898: 31 c1 00 1e sb (r14+30),r1 <== NOT EXECUTED
800f89c: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED
800f8a0: b4 2d 68 00 add r13,r1,r13 <== NOT EXECUTED
800f8a4: 31 ac 00 1f sb (r13+31),r12 <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (&handle->buffer);
800f8a8: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
800f8ac: 31 61 00 10 sb (r11+16),r1 <== NOT EXECUTED
}
800f8b0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
800f8b4: 2b 8b 00 14 lw r11,(sp+20) <== NOT EXECUTED
800f8b8: 2b 8c 00 10 lw r12,(sp+16) <== NOT EXECUTED
800f8bc: 2b 8d 00 0c lw r13,(sp+12) <== NOT EXECUTED
800f8c0: 2b 8e 00 08 lw r14,(sp+8) <== NOT EXECUTED
800f8c4: 37 9c 00 14 addi sp,sp,20 <== NOT EXECUTED
800f8c8: c3 a0 00 00 ret <== NOT EXECUTED
0800f144 <rtems_rfs_inode_time_stamp_now>:
int
rtems_rfs_inode_time_stamp_now (rtems_rfs_inode_handle* handle,
bool atime,
bool mtime)
{
800f144: 37 9c ff e8 addi sp,sp,-24
800f148: 5b 8b 00 18 sw (sp+24),r11
800f14c: 5b 8c 00 14 sw (sp+20),r12
800f150: 5b 8d 00 10 sw (sp+16),r13
800f154: 5b 8e 00 0c sw (sp+12),r14
800f158: 5b 8f 00 08 sw (sp+8),r15
800f15c: 5b 9d 00 04 sw (sp+4),ra
800f160: b8 20 58 00 mv r11,r1
time_t now;
if (!rtems_rfs_inode_is_loaded (handle))
800f164: 28 21 00 0c lw r1,(r1+12)
int
rtems_rfs_inode_time_stamp_now (rtems_rfs_inode_handle* handle,
bool atime,
bool mtime)
{
800f168: 20 4f 00 ff andi r15,r2,0xff
800f16c: 20 6e 00 ff andi r14,r3,0xff
time_t now;
if (!rtems_rfs_inode_is_loaded (handle))
return ENXIO;
800f170: 34 0d 00 06 mvi r13,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))
800f174: 44 20 00 2c be r1,r0,800f224 <rtems_rfs_inode_time_stamp_now+0xe0><== NEVER TAKEN
return ENXIO;
now = time (NULL);
800f178: 34 01 00 00 mvi r1,0
800f17c: f8 00 5c fa calli 8026564 <time>
800f180: b8 20 60 00 mv r12,r1
if (atime)
800f184: 45 e0 00 13 be r15,r0,800f1d0 <rtems_rfs_inode_time_stamp_now+0x8c><== NEVER TAKEN
*/
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);
800f188: 29 6d 00 0c lw r13,(r11+12)
800f18c: 34 02 00 18 mvi r2,24
800f190: fb ff c8 fb calli 800157c <__lshrsi3>
800f194: 31 a1 00 10 sb (r13+16),r1
800f198: 29 6d 00 0c lw r13,(r11+12)
800f19c: 34 02 00 10 mvi r2,16
800f1a0: b9 80 08 00 mv r1,r12
800f1a4: fb ff c8 f6 calli 800157c <__lshrsi3>
800f1a8: 31 a1 00 11 sb (r13+17),r1
800f1ac: 29 6d 00 0c lw r13,(r11+12)
800f1b0: b9 80 08 00 mv r1,r12
800f1b4: 34 02 00 08 mvi r2,8
800f1b8: fb ff c8 f1 calli 800157c <__lshrsi3>
800f1bc: 31 a1 00 12 sb (r13+18),r1
800f1c0: 29 61 00 0c lw r1,(r11+12)
800f1c4: 30 2c 00 13 sb (r1+19),r12
rtems_rfs_buffer_mark_dirty (&handle->buffer);
800f1c8: 34 01 00 01 mvi r1,1
800f1cc: 31 61 00 10 sb (r11+16),r1
rtems_rfs_inode_set_atime (handle, now);
if (mtime)
rtems_rfs_inode_set_mtime (handle, now);
return 0;
800f1d0: 34 0d 00 00 mvi r13,0
if (!rtems_rfs_inode_is_loaded (handle))
return ENXIO;
now = time (NULL);
if (atime)
rtems_rfs_inode_set_atime (handle, now);
if (mtime)
800f1d4: 45 c0 00 14 be r14,r0,800f224 <rtems_rfs_inode_time_stamp_now+0xe0><== NEVER TAKEN
*/
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);
800f1d8: 29 6e 00 0c lw r14,(r11+12)
800f1dc: 34 02 00 18 mvi r2,24
800f1e0: b9 80 08 00 mv r1,r12
800f1e4: fb ff c8 e6 calli 800157c <__lshrsi3>
800f1e8: 31 c1 00 14 sb (r14+20),r1
800f1ec: 29 6e 00 0c lw r14,(r11+12)
800f1f0: 34 02 00 10 mvi r2,16
800f1f4: b9 80 08 00 mv r1,r12
800f1f8: fb ff c8 e1 calli 800157c <__lshrsi3>
800f1fc: 31 c1 00 15 sb (r14+21),r1
800f200: 29 6e 00 0c lw r14,(r11+12)
800f204: b9 80 08 00 mv r1,r12
800f208: 34 02 00 08 mvi r2,8
800f20c: fb ff c8 dc calli 800157c <__lshrsi3>
800f210: 31 c1 00 16 sb (r14+22),r1
800f214: 29 61 00 0c lw r1,(r11+12)
800f218: 30 2c 00 17 sb (r1+23),r12
rtems_rfs_buffer_mark_dirty (&handle->buffer);
800f21c: 34 01 00 01 mvi r1,1
800f220: 31 61 00 10 sb (r11+16),r1
rtems_rfs_inode_set_mtime (handle, now);
return 0;
}
800f224: b9 a0 08 00 mv r1,r13
800f228: 2b 9d 00 04 lw ra,(sp+4)
800f22c: 2b 8b 00 18 lw r11,(sp+24)
800f230: 2b 8c 00 14 lw r12,(sp+20)
800f234: 2b 8d 00 10 lw r13,(sp+16)
800f238: 2b 8e 00 0c lw r14,(sp+12)
800f23c: 2b 8f 00 08 lw r15,(sp+8)
800f240: 37 9c 00 18 addi sp,sp,24
800f244: c3 a0 00 00 ret
0800eeb0 <rtems_rfs_inode_unload>:
int
rtems_rfs_inode_unload (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle,
bool update_ctime)
{
800eeb0: 37 9c ff ec addi sp,sp,-20
800eeb4: 5b 8b 00 14 sw (sp+20),r11
800eeb8: 5b 8c 00 10 sw (sp+16),r12
800eebc: 5b 8d 00 0c sw (sp+12),r13
800eec0: 5b 8e 00 08 sw (sp+8),r14
800eec4: 5b 9d 00 04 sw (sp+4),ra
800eec8: b8 20 68 00 mv r13,r1
800eecc: b8 40 58 00 mv r11,r2
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_UNLOAD))
800eed0: 34 01 00 00 mvi r1,0
800eed4: 78 02 00 20 mvhi r2,0x20
int
rtems_rfs_inode_unload (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle,
bool update_ctime)
{
800eed8: 20 6c 00 ff andi r12,r3,0xff
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_UNLOAD))
800eedc: f8 00 07 93 calli 8010d28 <rtems_rfs_trace>
800eee0: 44 20 00 0d be r1,r0,800ef14 <rtems_rfs_inode_unload+0x64> <== ALWAYS TAKEN
printf ("rtems-rfs: inode-unload: ino=%" PRIu32 " loads=%i loaded=%s\n",
800eee4: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED
800eee8: 78 04 08 03 mvhi r4,0x803 <== NOT EXECUTED
800eeec: 29 62 00 08 lw r2,(r11+8) <== NOT EXECUTED
800eef0: 29 63 00 24 lw r3,(r11+36) <== NOT EXECUTED
800eef4: 38 84 72 78 ori r4,r4,0x7278 <== NOT EXECUTED
800eef8: 44 20 00 03 be r1,r0,800ef04 <rtems_rfs_inode_unload+0x54> <== NOT EXECUTED
800eefc: 78 04 08 03 mvhi r4,0x803 <== NOT EXECUTED
800ef00: 38 84 6d d8 ori r4,r4,0x6dd8 <== NOT EXECUTED
800ef04: 78 05 08 03 mvhi r5,0x803 <== NOT EXECUTED
800ef08: b8 a0 08 00 mv r1,r5 <== NOT EXECUTED
800ef0c: 38 21 6e 34 ori r1,r1,0x6e34 <== NOT EXECUTED
800ef10: f8 00 4d d9 calli 8022674 <printf> <== NOT EXECUTED
handle->ino, handle->loads,
rtems_rfs_inode_is_loaded (handle) ? "yes" : "no");
if (rtems_rfs_inode_is_loaded (handle))
800ef14: 29 62 00 0c lw r2,(r11+12)
int
rtems_rfs_inode_unload (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle,
bool update_ctime)
{
int rc = 0;
800ef18: 34 01 00 00 mvi r1,0
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_UNLOAD))
printf ("rtems-rfs: inode-unload: ino=%" PRIu32 " loads=%i loaded=%s\n",
handle->ino, handle->loads,
rtems_rfs_inode_is_loaded (handle) ? "yes" : "no");
if (rtems_rfs_inode_is_loaded (handle))
800ef1c: 44 40 00 24 be r2,r0,800efac <rtems_rfs_inode_unload+0xfc>
{
if (handle->loads == 0)
800ef20: 29 62 00 24 lw r2,(r11+36)
return EIO;
800ef24: 34 01 00 05 mvi r1,5
handle->ino, handle->loads,
rtems_rfs_inode_is_loaded (handle) ? "yes" : "no");
if (rtems_rfs_inode_is_loaded (handle))
{
if (handle->loads == 0)
800ef28: 44 40 00 21 be r2,r0,800efac <rtems_rfs_inode_unload+0xfc> <== NEVER TAKEN
return EIO;
handle->loads--;
800ef2c: 34 42 ff ff addi r2,r2,-1
800ef30: 59 62 00 24 sw (r11+36),r2
int
rtems_rfs_inode_unload (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle,
bool update_ctime)
{
int rc = 0;
800ef34: 34 01 00 00 mvi r1,0
if (handle->loads == 0)
return EIO;
handle->loads--;
if (handle->loads == 0)
800ef38: 5c 40 00 1d bne r2,r0,800efac <rtems_rfs_inode_unload+0xfc>
{
/*
* If the buffer is dirty it will be release. Also set the ctime.
*/
if (rtems_rfs_buffer_dirty (&handle->buffer) && update_ctime)
800ef3c: 41 61 00 10 lbu r1,(r11+16)
800ef40: 44 22 00 17 be r1,r2,800ef9c <rtems_rfs_inode_unload+0xec>
800ef44: 45 80 00 16 be r12,r0,800ef9c <rtems_rfs_inode_unload+0xec><== NEVER TAKEN
rtems_rfs_inode_set_ctime (handle, time (NULL));
800ef48: 34 01 00 00 mvi r1,0
800ef4c: f8 00 5d 86 calli 8026564 <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);
800ef50: 29 6e 00 0c lw r14,(r11+12)
800ef54: 34 02 00 18 mvi r2,24
800ef58: b8 20 60 00 mv r12,r1
800ef5c: fb ff c9 88 calli 800157c <__lshrsi3>
800ef60: 31 c1 00 18 sb (r14+24),r1
800ef64: 29 6e 00 0c lw r14,(r11+12)
800ef68: 34 02 00 10 mvi r2,16
800ef6c: b9 80 08 00 mv r1,r12
800ef70: fb ff c9 83 calli 800157c <__lshrsi3>
800ef74: 31 c1 00 19 sb (r14+25),r1
800ef78: 29 6e 00 0c lw r14,(r11+12)
800ef7c: b9 80 08 00 mv r1,r12
800ef80: 34 02 00 08 mvi r2,8
800ef84: fb ff c9 7e calli 800157c <__lshrsi3>
800ef88: 31 c1 00 1a sb (r14+26),r1
800ef8c: 29 61 00 0c lw r1,(r11+12)
800ef90: 30 2c 00 1b sb (r1+27),r12
rtems_rfs_buffer_mark_dirty (&handle->buffer);
800ef94: 34 01 00 01 mvi r1,1
800ef98: 31 61 00 10 sb (r11+16),r1
rc = rtems_rfs_buffer_handle_release (fs, &handle->buffer);
800ef9c: b9 a0 08 00 mv r1,r13
800efa0: 35 62 00 10 addi r2,r11,16
800efa4: f8 00 2e 4a calli 801a8cc <rtems_rfs_buffer_handle_release>
handle->node = NULL;
800efa8: 59 60 00 0c sw (r11+12),r0
}
}
return rc;
}
800efac: 2b 9d 00 04 lw ra,(sp+4)
800efb0: 2b 8b 00 14 lw r11,(sp+20)
800efb4: 2b 8c 00 10 lw r12,(sp+16)
800efb8: 2b 8d 00 0c lw r13,(sp+12)
800efbc: 2b 8e 00 08 lw r14,(sp+8)
800efc0: 37 9c 00 14 addi sp,sp,20
800efc4: c3 a0 00 00 ret
0801df3c <rtems_rfs_link>:
const char* name,
int length,
rtems_rfs_ino parent,
rtems_rfs_ino target,
bool link_dir)
{
801df3c: 37 9c ff 8c addi sp,sp,-116
801df40: 5b 8b 00 24 sw (sp+36),r11
801df44: 5b 8c 00 20 sw (sp+32),r12
801df48: 5b 8d 00 1c sw (sp+28),r13
801df4c: 5b 8e 00 18 sw (sp+24),r14
801df50: 5b 8f 00 14 sw (sp+20),r15
801df54: 5b 90 00 10 sw (sp+16),r16
801df58: 5b 91 00 0c sw (sp+12),r17
801df5c: 5b 92 00 08 sw (sp+8),r18
801df60: 5b 9d 00 04 sw (sp+4),ra
801df64: b8 20 60 00 mv r12,r1
801df68: b8 40 80 00 mv r16,r2
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))
801df6c: 34 01 00 00 mvi r1,0
801df70: 78 02 01 00 mvhi r2,0x100
const char* name,
int length,
rtems_rfs_ino parent,
rtems_rfs_ino target,
bool link_dir)
{
801df74: b8 60 78 00 mv r15,r3
801df78: b8 80 88 00 mv r17,r4
801df7c: b8 a0 70 00 mv r14,r5
801df80: 20 d2 00 ff andi r18,r6,0xff
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))
801df84: fb ff cb 69 calli 8010d28 <rtems_rfs_trace>
801df88: 44 20 00 10 be r1,r0,801dfc8 <rtems_rfs_link+0x8c> <== ALWAYS TAKEN
{
int c;
printf ("rtems-rfs: link: parent(%" PRIu32 ") -> ", parent);
801df8c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801df90: 38 21 8f e4 ori r1,r1,0x8fe4 <== NOT EXECUTED
801df94: ba 20 10 00 mv r2,r17 <== NOT EXECUTED
801df98: f8 00 11 b7 calli 8022674 <printf> <== NOT EXECUTED
for (c = 0; c < length; c++)
801df9c: 34 0b 00 00 mvi r11,0 <== NOT EXECUTED
801dfa0: e0 00 00 05 bi 801dfb4 <rtems_rfs_link+0x78> <== NOT EXECUTED
#include <rtems/rfs/rtems-rfs-dir.h>
#include <rtems/rfs/rtems-rfs-dir-hash.h>
#include <rtems/rfs/rtems-rfs-link.h>
int
rtems_rfs_link (rtems_rfs_file_system* fs,
801dfa4: b6 0b 08 00 add r1,r16,r11 <== 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++)
printf ("%c", name[c]);
801dfa8: 40 21 00 00 lbu r1,(r1+0) <== 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++)
801dfac: 35 6b 00 01 addi r11,r11,1 <== NOT EXECUTED
printf ("%c", name[c]);
801dfb0: f8 00 12 37 calli 802288c <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++)
801dfb4: 49 eb ff fc bg r15,r11,801dfa4 <rtems_rfs_link+0x68> <== NOT EXECUTED
printf ("%c", name[c]);
printf ("(%" PRIu32 ")\n", target);
801dfb8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801dfbc: 38 21 90 2c ori r1,r1,0x902c <== NOT EXECUTED
801dfc0: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
801dfc4: f8 00 11 ac calli 8022674 <printf> <== NOT EXECUTED
}
rc = rtems_rfs_inode_open (fs, target, &target_inode, true);
801dfc8: 37 8d 00 28 addi r13,sp,40
801dfcc: b9 80 08 00 mv r1,r12
801dfd0: b9 c0 10 00 mv r2,r14
801dfd4: b9 a0 18 00 mv r3,r13
801dfd8: 34 04 00 01 mvi r4,1
801dfdc: fb ff c3 6f calli 800ed98 <rtems_rfs_inode_open>
801dfe0: b8 20 58 00 mv r11,r1
if (rc)
801dfe4: 5c 20 00 42 bne r1,r0,801e0ec <rtems_rfs_link+0x1b0> <== NEVER TAKEN
/*
* 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)))
801dfe8: 5e 41 00 0b bne r18,r1,801e014 <rtems_rfs_link+0xd8> <== NEVER TAKEN
801dfec: 2b 81 00 34 lw r1,(sp+52)
801dff0: fb ff ff c5 calli 801df04 <rtems_rfs_inode_get_mode.clone.2>
801dff4: 20 21 f0 00 andi r1,r1,0xf000
801dff8: 34 02 40 00 mvi r2,16384
801dffc: 5c 22 00 06 bne r1,r2,801e014 <rtems_rfs_link+0xd8> <== ALWAYS TAKEN
{
rtems_rfs_inode_close (fs, &target_inode);
801e000: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801e004: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801e008: fb ff c3 f0 calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
return ENOTSUP;
801e00c: 34 0b 00 86 mvi r11,134 <== NOT EXECUTED
801e010: e0 00 00 37 bi 801e0ec <rtems_rfs_link+0x1b0> <== NOT EXECUTED
}
rc = rtems_rfs_inode_open (fs, parent, &parent_inode, true);
801e014: 37 8d 00 50 addi r13,sp,80
801e018: b9 80 08 00 mv r1,r12
801e01c: ba 20 10 00 mv r2,r17
801e020: b9 a0 18 00 mv r3,r13
801e024: 34 04 00 01 mvi r4,1
801e028: fb ff c3 5c calli 800ed98 <rtems_rfs_inode_open>
801e02c: b8 20 58 00 mv r11,r1
if (rc)
801e030: 5c 20 00 0c bne r1,r0,801e060 <rtems_rfs_link+0x124> <== NEVER TAKEN
{
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_dir_add_entry (fs, &parent_inode, name, length, target);
801e034: b9 80 08 00 mv r1,r12
801e038: b9 a0 10 00 mv r2,r13
801e03c: ba 00 18 00 mv r3,r16
801e040: b9 e0 20 00 mv r4,r15
801e044: b9 c0 28 00 mv r5,r14
801e048: fb ff f5 9f calli 801b6c4 <rtems_rfs_dir_add_entry>
801e04c: b8 20 58 00 mv r11,r1
if (rc > 0)
801e050: 4c 01 00 08 bge r0,r1,801e070 <rtems_rfs_link+0x134> <== ALWAYS TAKEN
{
rtems_rfs_inode_close (fs, &parent_inode);
801e054: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801e058: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801e05c: fb ff c3 db calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &target_inode);
801e060: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801e064: 37 82 00 28 addi r2,sp,40 <== NOT EXECUTED
801e068: fb ff c3 d8 calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
801e06c: e0 00 00 20 bi 801e0ec <rtems_rfs_link+0x1b0> <== NOT EXECUTED
}
rc = rtems_rfs_inode_close (fs, &inode);
return rc;
}
801e070: 2b 8e 00 34 lw r14,(sp+52)
rtems_rfs_inode_close (fs, &parent_inode);
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
links = rtems_rfs_inode_get_links (&target_inode) + 1;
801e074: b9 c0 08 00 mv r1,r14
801e078: fb ff ff 91 calli 801debc <rtems_rfs_inode_get_links.clone.1>
801e07c: 34 2b 00 01 addi r11,r1,1
801e080: 21 6b ff ff andi r11,r11,0xffff
* @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);
801e084: b9 60 08 00 mv r1,r11
801e088: 34 02 00 08 mvi r2,8
801e08c: fb ff 8d 3c calli 800157c <__lshrsi3>
801e090: 31 c1 00 00 sb (r14+0),r1
801e094: 2b 81 00 34 lw r1,(sp+52)
rtems_rfs_inode_set_links (&target_inode, links);
rc = rtems_rfs_inode_time_stamp_now (&parent_inode, true, true);
801e098: 34 02 00 01 mvi r2,1
801e09c: 34 03 00 01 mvi r3,1
801e0a0: 30 2b 00 01 sb (r1+1),r11
rtems_rfs_buffer_mark_dirty (&handle->buffer);
801e0a4: 34 01 00 01 mvi r1,1
801e0a8: 33 81 00 38 sb (sp+56),r1
801e0ac: b9 a0 08 00 mv r1,r13
801e0b0: fb ff c4 25 calli 800f144 <rtems_rfs_inode_time_stamp_now>
801e0b4: b8 20 58 00 mv r11,r1
if (rc > 0)
801e0b8: 4c 01 00 02 bge r0,r1,801e0c0 <rtems_rfs_link+0x184> <== ALWAYS TAKEN
801e0bc: e3 ff ff e6 bi 801e054 <rtems_rfs_link+0x118> <== 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);
801e0c0: b9 a0 10 00 mv r2,r13
801e0c4: b9 80 08 00 mv r1,r12
801e0c8: fb ff c3 c0 calli 800efc8 <rtems_rfs_inode_close>
801e0cc: b8 20 58 00 mv r11,r1
801e0d0: 37 82 00 28 addi r2,sp,40
if (rc > 0)
801e0d4: 4c 01 00 03 bge r0,r1,801e0e0 <rtems_rfs_link+0x1a4> <== ALWAYS TAKEN
{
rtems_rfs_inode_close (fs, &target_inode);
801e0d8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801e0dc: e3 ff ff e3 bi 801e068 <rtems_rfs_link+0x12c> <== NOT EXECUTED
return rc;
}
rc = rtems_rfs_inode_close (fs, &target_inode);
801e0e0: b9 80 08 00 mv r1,r12
801e0e4: fb ff c3 b9 calli 800efc8 <rtems_rfs_inode_close>
801e0e8: b8 20 58 00 mv r11,r1
return rc;
}
801e0ec: b9 60 08 00 mv r1,r11
801e0f0: 2b 9d 00 04 lw ra,(sp+4)
801e0f4: 2b 8b 00 24 lw r11,(sp+36)
801e0f8: 2b 8c 00 20 lw r12,(sp+32)
801e0fc: 2b 8d 00 1c lw r13,(sp+28)
801e100: 2b 8e 00 18 lw r14,(sp+24)
801e104: 2b 8f 00 14 lw r15,(sp+20)
801e108: 2b 90 00 10 lw r16,(sp+16)
801e10c: 2b 91 00 0c lw r17,(sp+12)
801e110: 2b 92 00 08 lw r18,(sp+8)
801e114: 37 9c 00 74 addi sp,sp,116
801e118: c3 a0 00 00 ret
0801e994 <rtems_rfs_mutex_create>:
RTEMS_INHERIT_PRIORITY | RTEMS_NO_PRIORITY_CEILING | RTEMS_LOCAL)
#endif
int
rtems_rfs_mutex_create (rtems_rfs_mutex* mutex)
{
801e994: 37 9c ff f4 addi sp,sp,-12
801e998: 5b 8b 00 0c sw (sp+12),r11
801e99c: 5b 8c 00 08 sw (sp+8),r12
801e9a0: 5b 9d 00 04 sw (sp+4),ra
#if __rtems__
rtems_status_code sc;
sc = rtems_semaphore_create (rtems_build_name ('R', 'F', 'S', 'm'),
801e9a4: 78 02 08 03 mvhi r2,0x803
801e9a8: 38 42 92 5c ori r2,r2,0x925c
RTEMS_INHERIT_PRIORITY | RTEMS_NO_PRIORITY_CEILING | RTEMS_LOCAL)
#endif
int
rtems_rfs_mutex_create (rtems_rfs_mutex* mutex)
{
801e9ac: b8 20 28 00 mv r5,r1
#if __rtems__
rtems_status_code sc;
sc = rtems_semaphore_create (rtems_build_name ('R', 'F', 'S', 'm'),
801e9b0: 28 41 00 00 lw r1,(r2+0)
801e9b4: 34 03 00 54 mvi r3,84
801e9b8: 34 02 00 01 mvi r2,1
801e9bc: 34 04 00 00 mvi r4,0
801e9c0: fb ff a9 af calli 800907c <rtems_semaphore_create>
801e9c4: b8 20 60 00 mv r12,r1
printf ("rtems-rfs: mutex: open failed: %s\n",
rtems_status_text (sc));
return EIO;
}
#endif
return 0;
801e9c8: 34 0b 00 00 mvi r11,0
#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)
801e9cc: 44 20 00 0c be r1,r0,801e9fc <rtems_rfs_mutex_create+0x68> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
801e9d0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801e9d4: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
801e9d8: fb ff c8 d4 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
printf ("rtems-rfs: mutex: open failed: %s\n",
rtems_status_text (sc));
return EIO;
801e9dc: 34 0b 00 05 mvi r11,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))
801e9e0: 44 20 00 07 be r1,r0,801e9fc <rtems_rfs_mutex_create+0x68> <== NOT EXECUTED
printf ("rtems-rfs: mutex: open failed: %s\n",
801e9e4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801e9e8: fb ff d8 1a calli 8014a50 <rtems_status_text> <== NOT EXECUTED
801e9ec: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
801e9f0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801e9f4: 38 21 92 14 ori r1,r1,0x9214 <== NOT EXECUTED
801e9f8: f8 00 0f 1f calli 8022674 <printf> <== NOT EXECUTED
rtems_status_text (sc));
return EIO;
}
#endif
return 0;
}
801e9fc: b9 60 08 00 mv r1,r11
801ea00: 2b 9d 00 04 lw ra,(sp+4)
801ea04: 2b 8b 00 0c lw r11,(sp+12)
801ea08: 2b 8c 00 08 lw r12,(sp+8)
801ea0c: 37 9c 00 0c addi sp,sp,12
801ea10: c3 a0 00 00 ret
0801ea14 <rtems_rfs_mutex_destroy>:
int
rtems_rfs_mutex_destroy (rtems_rfs_mutex* mutex)
{
801ea14: 37 9c ff f4 addi sp,sp,-12
801ea18: 5b 8b 00 0c sw (sp+12),r11
801ea1c: 5b 8c 00 08 sw (sp+8),r12
801ea20: 5b 9d 00 04 sw (sp+4),ra
#if __rtems__
rtems_status_code sc;
sc = rtems_semaphore_delete (*mutex);
801ea24: 28 21 00 00 lw r1,(r1+0)
printf ("rtems-rfs: mutex: close failed: %s\n",
rtems_status_text (sc));
return EIO;
}
#endif
return 0;
801ea28: 34 0b 00 00 mvi r11,0
int
rtems_rfs_mutex_destroy (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc;
sc = rtems_semaphore_delete (*mutex);
801ea2c: fb ff aa 11 calli 8009270 <rtems_semaphore_delete>
801ea30: b8 20 60 00 mv r12,r1
if (sc != RTEMS_SUCCESSFUL)
801ea34: 44 20 00 0c be r1,r0,801ea64 <rtems_rfs_mutex_destroy+0x50><== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
801ea38: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801ea3c: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
801ea40: fb ff c8 ba calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
printf ("rtems-rfs: mutex: close failed: %s\n",
rtems_status_text (sc));
return EIO;
801ea44: 34 0b 00 05 mvi r11,5 <== NOT EXECUTED
#if __rtems__
rtems_status_code sc;
sc = rtems_semaphore_delete (*mutex);
if (sc != RTEMS_SUCCESSFUL)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
801ea48: 44 20 00 07 be r1,r0,801ea64 <rtems_rfs_mutex_destroy+0x50><== NOT EXECUTED
printf ("rtems-rfs: mutex: close failed: %s\n",
801ea4c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801ea50: fb ff d8 00 calli 8014a50 <rtems_status_text> <== NOT EXECUTED
801ea54: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
801ea58: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ea5c: 38 21 92 38 ori r1,r1,0x9238 <== NOT EXECUTED
801ea60: f8 00 0f 05 calli 8022674 <printf> <== NOT EXECUTED
rtems_status_text (sc));
return EIO;
}
#endif
return 0;
}
801ea64: b9 60 08 00 mv r1,r11
801ea68: 2b 9d 00 04 lw ra,(sp+4)
801ea6c: 2b 8b 00 0c lw r11,(sp+12)
801ea70: 2b 8c 00 08 lw r12,(sp+8)
801ea74: 37 9c 00 0c addi sp,sp,12
801ea78: c3 a0 00 00 ret
080109a0 <rtems_rfs_mutex_lock.clone.21>:
* @param mutex The mutex to lock.
* @retval true The mutex is locked.
* @retval false The mutex could not be locked.
*/
static inline int
rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
80109a0: 37 9c ff f4 addi sp,sp,-12
80109a4: 5b 8b 00 0c sw (sp+12),r11
80109a8: 5b 8c 00 08 sw (sp+8),r12
80109ac: 5b 9d 00 04 sw (sp+4),ra
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
80109b0: 34 02 00 00 mvi r2,0
80109b4: 34 03 00 00 mvi r3,0
80109b8: fb ff e2 5d calli 800932c <rtems_semaphore_obtain>
80109bc: b8 20 60 00 mv r12,r1
rtems_status_text (sc));
#endif
return EIO;
}
#endif
return 0;
80109c0: 34 0b 00 00 mvi r11,0
static inline int
rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL)
80109c4: 44 20 00 0c be r1,r0,80109f4 <rtems_rfs_mutex_lock.clone.21+0x54><== ALWAYS TAKEN
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
80109c8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
80109cc: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
80109d0: f8 00 00 d6 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
rtems_status_text (sc));
#endif
return EIO;
80109d4: 34 0b 00 05 mvi r11,5 <== 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))
80109d8: 44 20 00 07 be r1,r0,80109f4 <rtems_rfs_mutex_lock.clone.21+0x54><== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
80109dc: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
80109e0: f8 00 10 1c calli 8014a50 <rtems_status_text> <== NOT EXECUTED
80109e4: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
80109e8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
80109ec: 38 21 6f 7c ori r1,r1,0x6f7c <== NOT EXECUTED
80109f0: f8 00 47 21 calli 8022674 <printf> <== NOT EXECUTED
#endif
return EIO;
}
#endif
return 0;
}
80109f4: b9 60 08 00 mv r1,r11
80109f8: 2b 9d 00 04 lw ra,(sp+4)
80109fc: 2b 8b 00 0c lw r11,(sp+12)
8010a00: 2b 8c 00 08 lw r12,(sp+8)
8010a04: 37 9c 00 0c addi sp,sp,12
8010a08: c3 a0 00 00 ret
0801a6fc <rtems_rfs_release_chain>:
static int
rtems_rfs_release_chain (rtems_chain_control* chain,
uint32_t* count,
bool modified)
{
801a6fc: 37 9c ff e8 addi sp,sp,-24
801a700: 5b 8b 00 18 sw (sp+24),r11
801a704: 5b 8c 00 14 sw (sp+20),r12
801a708: 5b 8d 00 10 sw (sp+16),r13
801a70c: 5b 8e 00 0c sw (sp+12),r14
801a710: 5b 8f 00 08 sw (sp+8),r15
801a714: 5b 9d 00 04 sw (sp+4),ra
801a718: b8 20 58 00 mv r11,r1
801a71c: b8 40 60 00 mv r12,r2
rtems_rfs_buffer* buffer;
int rrc = 0;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
801a720: 34 01 00 00 mvi r1,0
801a724: 34 02 00 80 mvi r2,128
static int
rtems_rfs_release_chain (rtems_chain_control* chain,
uint32_t* count,
bool modified)
{
801a728: b8 60 78 00 mv r15,r3
rtems_rfs_buffer* buffer;
int rrc = 0;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
801a72c: fb ff d9 7f calli 8010d28 <rtems_rfs_trace>
801a730: 44 20 00 05 be r1,r0,801a744 <rtems_rfs_release_chain+0x48><== ALWAYS TAKEN
printf ("rtems-rfs: release-chain: count=%" PRIu32 "\n", *count);
801a734: 29 82 00 00 lw r2,(r12+0) <== NOT EXECUTED
801a738: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801a73c: 38 21 7d 90 ori r1,r1,0x7d90 <== NOT EXECUTED
801a740: f8 00 1f cd calli 8022674 <printf> <== NOT EXECUTED
(*count)--;
buffer->user = (void*) 0;
rc = rtems_rfs_buffer_io_release (buffer, modified);
if ((rc > 0) && (rrc == 0))
801a744: 34 0d 00 00 mvi r13,0
801a748: 35 6e 00 04 addi r14,r11,4
801a74c: e0 00 00 0e bi 801a784 <rtems_rfs_release_chain+0x88>
*/
RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get(
rtems_chain_control *the_chain
)
{
return _Chain_Get( the_chain );
801a750: b9 60 08 00 mv r1,r11
801a754: fb ff bd 90 calli 8009d94 <_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)--;
801a758: 29 82 00 00 lw r2,(r12+0)
801a75c: 34 42 ff ff addi r2,r2,-1
801a760: 59 82 00 00 sw (r12+0),r2
buffer->user = (void*) 0;
801a764: 58 20 00 34 sw (r1+52),r0
rc = rtems_rfs_buffer_io_release (buffer, modified);
801a768: b9 e0 10 00 mv r2,r15
801a76c: f8 00 17 9c calli 80205dc <rtems_rfs_buffer_bdbuf_release>
if ((rc > 0) && (rrc == 0))
801a770: 68 23 00 00 cmpgi r3,r1,0
801a774: 65 a2 00 00 cmpei r2,r13,0
801a778: a0 62 10 00 and r2,r3,r2
801a77c: 44 40 00 02 be r2,r0,801a784 <rtems_rfs_release_chain+0x88><== ALWAYS TAKEN
801a780: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
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))
801a784: 29 61 00 00 lw r1,(r11+0)
801a788: 5c 2e ff f2 bne r1,r14,801a750 <rtems_rfs_release_chain+0x54>
rc = rtems_rfs_buffer_io_release (buffer, modified);
if ((rc > 0) && (rrc == 0))
rrc = rc;
}
return rrc;
}
801a78c: b9 a0 08 00 mv r1,r13
801a790: 2b 9d 00 04 lw ra,(sp+4)
801a794: 2b 8b 00 18 lw r11,(sp+24)
801a798: 2b 8c 00 14 lw r12,(sp+20)
801a79c: 2b 8d 00 10 lw r13,(sp+16)
801a7a0: 2b 8e 00 0c lw r14,(sp+12)
801a7a4: 2b 8f 00 08 lw r15,(sp+8)
801a7a8: 37 9c 00 18 addi sp,sp,24
801a7ac: c3 a0 00 00 ret
08010070 <rtems_rfs_rtems_chown>:
static int
rtems_rfs_rtems_chown (const rtems_filesystem_location_info_t *pathloc,
uid_t owner,
gid_t group)
{
8010070: 37 9c ff bc addi sp,sp,-68
8010074: 5b 8b 00 1c sw (sp+28),r11
8010078: 5b 8c 00 18 sw (sp+24),r12
801007c: 5b 8d 00 14 sw (sp+20),r13
8010080: 5b 8e 00 10 sw (sp+16),r14
8010084: 5b 8f 00 0c sw (sp+12),r15
8010088: 5b 90 00 08 sw (sp+8),r16
801008c: 5b 9d 00 04 sw (sp+4),ra
8010090: b8 20 20 00 mv r4,r1
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
8010094: 28 21 00 14 lw r1,(r1+20)
static int
rtems_rfs_rtems_chown (const rtems_filesystem_location_info_t *pathloc,
uid_t owner,
gid_t group)
{
8010098: 20 4d ff ff andi r13,r2,0xffff
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);
801009c: 28 82 00 08 lw r2,(r4+8)
static int
rtems_rfs_rtems_chown (const rtems_filesystem_location_info_t *pathloc,
uid_t owner,
gid_t group)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
80100a0: 28 2b 00 08 lw r11,(r1+8)
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);
80100a4: 37 8c 00 20 addi r12,sp,32
static int
rtems_rfs_rtems_chown (const rtems_filesystem_location_info_t *pathloc,
uid_t owner,
gid_t group)
{
80100a8: 20 70 ff ff andi r16,r3,0xffff
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);
80100ac: b9 60 08 00 mv r1,r11
80100b0: b9 80 18 00 mv r3,r12
80100b4: 34 04 00 01 mvi r4,1
80100b8: fb ff fb 38 calli 800ed98 <rtems_rfs_inode_open>
80100bc: b8 20 70 00 mv r14,r1
if (rc > 0)
80100c0: 4c 01 00 04 bge r0,r1,80100d0 <rtems_rfs_rtems_chown+0x60> <== ALWAYS TAKEN
{
return rtems_rfs_rtems_error ("chown: opening inode", rc);
80100c4: f8 00 43 11 calli 8020d08 <__errno> <== NOT EXECUTED
80100c8: 58 2e 00 00 sw (r1+0),r14 <== NOT EXECUTED
80100cc: e0 00 00 2d bi 8010180 <rtems_rfs_rtems_chown+0x110> <== NOT EXECUTED
/*
* Verify I am the owner of the node or the super user.
*/
#if defined (RTEMS_POSIX_API)
uid = geteuid();
80100d0: f8 00 13 54 calli 8014e20 <geteuid>
/* FIXME: Return value? */
rtems_rfs_fs_close(fs);
rtems_rfs_mutex_destroy (&rtems->access);
free (rtems);
}
80100d4: 2b 8e 00 2c lw r14,(sp+44)
/*
* Verify I am the owner of the node or the super user.
*/
#if defined (RTEMS_POSIX_API)
uid = geteuid();
80100d8: b8 20 78 00 mv r15,r1
if ((uid != rtems_rfs_inode_get_uid (&inode)) && (uid != 0))
80100dc: b9 c0 08 00 mv r1,r14
80100e0: fb ff ff d6 calli 8010038 <rtems_rfs_inode_get_uid.clone.5>
80100e4: 45 e1 00 09 be r15,r1,8010108 <rtems_rfs_rtems_chown+0x98> <== ALWAYS TAKEN
80100e8: 45 e0 00 08 be r15,r0,8010108 <rtems_rfs_rtems_chown+0x98> <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
80100ec: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
80100f0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
80100f4: fb ff fb b5 calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
return rtems_rfs_rtems_error ("chown: not able", EPERM);
80100f8: f8 00 43 04 calli 8020d08 <__errno> <== NOT EXECUTED
80100fc: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8010100: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
8010104: e0 00 00 1f bi 8010180 <rtems_rfs_rtems_chown+0x110> <== 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);
8010108: 34 02 00 10 mvi r2,16
801010c: ba 00 08 00 mv r1,r16
8010110: fb ff c4 f4 calli 80014e0 <__ashlsi3>
8010114: b8 2d 60 00 or r12,r1,r13
8010118: 34 02 00 18 mvi r2,24
801011c: b9 80 08 00 mv r1,r12
8010120: fb ff c5 17 calli 800157c <__lshrsi3>
8010124: 31 c1 00 04 sb (r14+4),r1
8010128: 34 02 00 10 mvi r2,16
801012c: b9 80 08 00 mv r1,r12
8010130: fb ff c5 13 calli 800157c <__lshrsi3>
8010134: 2b 82 00 2c lw r2,(sp+44)
8010138: 30 41 00 05 sb (r2+5),r1
801013c: 34 02 00 08 mvi r2,8
8010140: b9 80 08 00 mv r1,r12
8010144: fb ff c5 0e calli 800157c <__lshrsi3>
8010148: 2b 82 00 2c lw r2,(sp+44)
801014c: 30 41 00 06 sb (r2+6),r1
8010150: 2b 81 00 2c lw r1,(sp+44)
}
#endif
rtems_rfs_inode_set_uid_gid (&inode, owner, group);
rc = rtems_rfs_inode_close (fs, &inode);
8010154: 37 82 00 20 addi r2,sp,32
8010158: 30 2d 00 07 sb (r1+7),r13
rtems_rfs_buffer_mark_dirty (&handle->buffer);
801015c: 34 01 00 01 mvi r1,1
8010160: 33 81 00 30 sb (sp+48),r1
8010164: b9 60 08 00 mv r1,r11
8010168: fb ff fb 98 calli 800efc8 <rtems_rfs_inode_close>
801016c: b8 20 58 00 mv r11,r1
if (rc)
{
return rtems_rfs_rtems_error ("chown: closing inode", rc);
}
return 0;
8010170: 34 01 00 00 mvi r1,0
#endif
rtems_rfs_inode_set_uid_gid (&inode, owner, group);
rc = rtems_rfs_inode_close (fs, &inode);
if (rc)
8010174: 45 60 00 04 be r11,r0,8010184 <rtems_rfs_rtems_chown+0x114><== ALWAYS TAKEN
{
return rtems_rfs_rtems_error ("chown: closing inode", rc);
8010178: f8 00 42 e4 calli 8020d08 <__errno> <== NOT EXECUTED
801017c: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
8010180: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
}
return 0;
}
8010184: 2b 9d 00 04 lw ra,(sp+4)
8010188: 2b 8b 00 1c lw r11,(sp+28)
801018c: 2b 8c 00 18 lw r12,(sp+24)
8010190: 2b 8d 00 14 lw r13,(sp+20)
8010194: 2b 8e 00 10 lw r14,(sp+16)
8010198: 2b 8f 00 0c lw r15,(sp+12)
801019c: 2b 90 00 08 lw r16,(sp+8)
80101a0: 37 9c 00 44 addi sp,sp,68
80101a4: c3 a0 00 00 ret
0801eae4 <rtems_rfs_rtems_device_close>:
* @return int
*/
static int
rtems_rfs_rtems_device_close (rtems_libio_t* iop)
{
801eae4: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
801eae8: 5b 9d 00 04 sw (sp+4),ra <== 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_close (iop, major, minor);
801eaec: 28 22 00 24 lw r2,(r1+36) <== NOT EXECUTED
801eaf0: 28 23 00 28 lw r3,(r1+40) <== NOT EXECUTED
801eaf4: f8 00 03 f4 calli 801fac4 <rtems_deviceio_close> <== NOT EXECUTED
}
801eaf8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
801eafc: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
801eb00: c3 a0 00 00 ret <== NOT EXECUTED
0801ea7c <rtems_rfs_rtems_device_ftruncate>:
static int
rtems_rfs_rtems_device_ftruncate (rtems_libio_t* iop, off_t length)
{
return 0;
}
801ea7c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801ea80: c3 a0 00 00 ret <== NOT EXECUTED
0801ea84 <rtems_rfs_rtems_device_ioctl>:
static int
rtems_rfs_rtems_device_ioctl (rtems_libio_t* iop,
ioctl_command_t command,
void* buffer)
{
801ea84: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
801ea88: 5b 9d 00 04 sw (sp+4),ra <== 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);
801ea8c: 28 24 00 24 lw r4,(r1+36) <== NOT EXECUTED
801ea90: 28 25 00 28 lw r5,(r1+40) <== NOT EXECUTED
801ea94: f8 00 04 4f calli 801fbd0 <rtems_deviceio_control> <== NOT EXECUTED
}
801ea98: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
801ea9c: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
801eaa0: c3 a0 00 00 ret <== NOT EXECUTED
0801ebcc <rtems_rfs_rtems_device_open>:
static int
rtems_rfs_rtems_device_open ( rtems_libio_t *iop,
const char *pathname,
int oflag,
mode_t mode)
{
801ebcc: 37 9c ff b4 addi sp,sp,-76 <== NOT EXECUTED
801ebd0: 5b 8b 00 24 sw (sp+36),r11 <== NOT EXECUTED
801ebd4: 5b 8c 00 20 sw (sp+32),r12 <== NOT EXECUTED
801ebd8: 5b 8d 00 1c sw (sp+28),r13 <== NOT EXECUTED
801ebdc: 5b 8e 00 18 sw (sp+24),r14 <== NOT EXECUTED
801ebe0: 5b 8f 00 14 sw (sp+20),r15 <== NOT EXECUTED
801ebe4: 5b 90 00 10 sw (sp+16),r16 <== NOT EXECUTED
801ebe8: 5b 91 00 0c sw (sp+12),r17 <== NOT EXECUTED
801ebec: 5b 92 00 08 sw (sp+8),r18 <== NOT EXECUTED
801ebf0: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
801ebf4: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
801ebf8: 28 21 00 20 lw r1,(r1+32) <== NOT EXECUTED
static int
rtems_rfs_rtems_device_open ( rtems_libio_t *iop,
const char *pathname,
int oflag,
mode_t mode)
{
801ebfc: b8 40 90 00 mv r18,r2 <== NOT EXECUTED
801ec00: b8 60 88 00 mv r17,r3 <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
801ec04: 28 2b 00 08 lw r11,(r1+8) <== 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);
801ec08: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801ec0c: 34 03 00 00 mvi r3,0 <== 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
};
801ec10: 29 61 00 80 lw r1,(r11+128) <== NOT EXECUTED
static int
rtems_rfs_rtems_device_open ( rtems_libio_t *iop,
const char *pathname,
int oflag,
mode_t mode)
{
801ec14: b8 80 80 00 mv r16,r4 <== 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);
801ec18: 29 8e 00 14 lw r14,(r12+20) <== NOT EXECUTED
801ec1c: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
801ec20: fb ff a9 c3 calli 800932c <rtems_semaphore_obtain> <== NOT EXECUTED
801ec24: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
801ec28: 44 20 00 0c be r1,r0,801ec58 <rtems_rfs_rtems_device_open+0x8c><== NOT EXECUTED
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
801ec2c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801ec30: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
801ec34: fb ff c8 3d calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801ec38: 44 20 00 08 be r1,r0,801ec58 <rtems_rfs_rtems_device_open+0x8c><== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
801ec3c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
801ec40: fb ff d7 84 calli 8014a50 <rtems_status_text> <== NOT EXECUTED
801ec44: b8 20 28 00 mv r5,r1 <== NOT EXECUTED
801ec48: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801ec4c: 38 21 6f 7c ori r1,r1,0x6f7c <== NOT EXECUTED
801ec50: b8 a0 10 00 mv r2,r5 <== NOT EXECUTED
801ec54: f8 00 0e 88 calli 8022674 <printf> <== NOT EXECUTED
rtems_device_minor_number minor;
int rc;
rtems_rfs_rtems_lock (fs);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
801ec58: 37 8f 00 28 addi r15,sp,40 <== NOT EXECUTED
801ec5c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801ec60: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
801ec64: b9 e0 18 00 mv r3,r15 <== NOT EXECUTED
801ec68: 34 04 00 01 mvi r4,1 <== NOT EXECUTED
801ec6c: fb ff c0 4b calli 800ed98 <rtems_rfs_inode_open> <== NOT EXECUTED
801ec70: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
if (rc > 0)
801ec74: 4c 01 00 06 bge r0,r1,801ec8c <rtems_rfs_rtems_device_open+0xc0><== NOT EXECUTED
{
rtems_rfs_rtems_unlock (fs);
801ec78: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801ec7c: fb ff ff a2 calli 801eb04 <rtems_rfs_rtems_unlock> <== NOT EXECUTED
return rtems_rfs_rtems_error ("device_open: opening inode", rc);
801ec80: f8 00 08 22 calli 8020d08 <__errno> <== NOT EXECUTED
801ec84: 58 2d 00 00 sw (r1+0),r13 <== NOT EXECUTED
801ec88: e0 00 00 13 bi 801ecd4 <rtems_rfs_rtems_device_open+0x108> <== 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
};
801ec8c: 2b 8e 00 34 lw r14,(sp+52) <== NOT EXECUTED
{
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("device_open: opening inode", rc);
}
major = rtems_rfs_inode_get_block (&inode, 0);
801ec90: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801ec94: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
801ec98: fb ff ff b2 calli 801eb60 <rtems_rfs_inode_get_block.clone.0><== NOT EXECUTED
minor = rtems_rfs_inode_get_block (&inode, 1);
801ec9c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
{
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("device_open: opening inode", rc);
}
major = rtems_rfs_inode_get_block (&inode, 0);
801eca0: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
minor = rtems_rfs_inode_get_block (&inode, 1);
801eca4: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
801eca8: fb ff ff ae calli 801eb60 <rtems_rfs_inode_get_block.clone.0><== NOT EXECUTED
rc = rtems_rfs_inode_close (fs, &inode);
801ecac: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("device_open: opening inode", rc);
}
major = rtems_rfs_inode_get_block (&inode, 0);
minor = rtems_rfs_inode_get_block (&inode, 1);
801ecb0: b8 20 70 00 mv r14,r1 <== NOT EXECUTED
rc = rtems_rfs_inode_close (fs, &inode);
801ecb4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801ecb8: fb ff c0 c4 calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
801ecbc: b8 20 78 00 mv r15,r1 <== NOT EXECUTED
if (rc > 0)
801ecc0: 4c 01 00 07 bge r0,r1,801ecdc <rtems_rfs_rtems_device_open+0x110><== NOT EXECUTED
{
rtems_rfs_rtems_unlock (fs);
801ecc4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801ecc8: fb ff ff 8f calli 801eb04 <rtems_rfs_rtems_unlock> <== NOT EXECUTED
return rtems_rfs_rtems_error ("device_open: closing inode", rc);
801eccc: f8 00 08 0f calli 8020d08 <__errno> <== NOT EXECUTED
801ecd0: 58 2f 00 00 sw (r1+0),r15 <== NOT EXECUTED
801ecd4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
801ecd8: e0 00 00 0c bi 801ed08 <rtems_rfs_rtems_device_open+0x13c> <== NOT EXECUTED
}
rtems_rfs_rtems_unlock (fs);
801ecdc: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801ece0: fb ff ff 89 calli 801eb04 <rtems_rfs_rtems_unlock> <== NOT EXECUTED
iop->data0 = major;
iop->data1 = (void *) minor;
return rtems_deviceio_open (iop, pathname, oflag, mode, minor, major);
801ece4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
return rtems_rfs_rtems_error ("device_open: closing inode", rc);
}
rtems_rfs_rtems_unlock (fs);
iop->data0 = major;
801ece8: 59 8d 00 24 sw (r12+36),r13 <== NOT EXECUTED
iop->data1 = (void *) minor;
801ecec: 59 8e 00 28 sw (r12+40),r14 <== NOT EXECUTED
return rtems_deviceio_open (iop, pathname, oflag, mode, minor, major);
801ecf0: ba 40 10 00 mv r2,r18 <== NOT EXECUTED
801ecf4: ba 20 18 00 mv r3,r17 <== NOT EXECUTED
801ecf8: ba 00 20 00 mv r4,r16 <== NOT EXECUTED
801ecfc: b9 c0 28 00 mv r5,r14 <== NOT EXECUTED
801ed00: b9 a0 30 00 mv r6,r13 <== NOT EXECUTED
801ed04: f8 00 03 62 calli 801fa8c <rtems_deviceio_open> <== NOT EXECUTED
}
801ed08: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
801ed0c: 2b 8b 00 24 lw r11,(sp+36) <== NOT EXECUTED
801ed10: 2b 8c 00 20 lw r12,(sp+32) <== NOT EXECUTED
801ed14: 2b 8d 00 1c lw r13,(sp+28) <== NOT EXECUTED
801ed18: 2b 8e 00 18 lw r14,(sp+24) <== NOT EXECUTED
801ed1c: 2b 8f 00 14 lw r15,(sp+20) <== NOT EXECUTED
801ed20: 2b 90 00 10 lw r16,(sp+16) <== NOT EXECUTED
801ed24: 2b 91 00 0c lw r17,(sp+12) <== NOT EXECUTED
801ed28: 2b 92 00 08 lw r18,(sp+8) <== NOT EXECUTED
801ed2c: 37 9c 00 4c addi sp,sp,76 <== NOT EXECUTED
801ed30: c3 a0 00 00 ret <== NOT EXECUTED
0801eac4 <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)
{
801eac4: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
801eac8: 5b 9d 00 04 sw (sp+4),ra <== 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);
801eacc: 28 24 00 24 lw r4,(r1+36) <== NOT EXECUTED
801ead0: 28 25 00 28 lw r5,(r1+40) <== NOT EXECUTED
801ead4: f8 00 04 09 calli 801faf8 <rtems_deviceio_read> <== NOT EXECUTED
}
801ead8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
801eadc: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
801eae0: c3 a0 00 00 ret <== NOT EXECUTED
0801eaa4 <rtems_rfs_rtems_device_write>:
static ssize_t
rtems_rfs_rtems_device_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
{
801eaa4: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
801eaa8: 5b 9d 00 04 sw (sp+4),ra <== 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);
801eaac: 28 24 00 24 lw r4,(r1+36) <== NOT EXECUTED
801eab0: 28 25 00 28 lw r5,(r1+40) <== NOT EXECUTED
801eab4: f8 00 04 2c calli 801fb64 <rtems_deviceio_write> <== NOT EXECUTED
}
801eab8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
801eabc: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
801eac0: c3 a0 00 00 ret <== NOT EXECUTED
0801ef48 <rtems_rfs_rtems_dir_open>:
static int
rtems_rfs_rtems_dir_open (rtems_libio_t* iop,
const char* pathname,
int oflag,
mode_t mode)
{
801ef48: 37 9c ff c4 addi sp,sp,-60
801ef4c: 5b 8b 00 14 sw (sp+20),r11
801ef50: 5b 8c 00 10 sw (sp+16),r12
801ef54: 5b 8d 00 0c sw (sp+12),r13
801ef58: 5b 8e 00 08 sw (sp+8),r14
801ef5c: 5b 9d 00 04 sw (sp+4),ra
801ef60: b8 20 60 00 mv r12,r1
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
801ef64: 28 21 00 20 lw r1,(r1+32)
rtems_rfs_ino ino = rtems_rfs_rtems_get_iop_ino (iop);
801ef68: 29 8e 00 14 lw r14,(r12+20)
rtems_rfs_inode_handle inode;
int rc;
rtems_rfs_rtems_lock (fs);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
801ef6c: 37 8d 00 18 addi r13,sp,24
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);
801ef70: 28 2b 00 08 lw r11,(r1+8)
rtems_rfs_ino ino = rtems_rfs_rtems_get_iop_ino (iop);
rtems_rfs_inode_handle inode;
int rc;
rtems_rfs_rtems_lock (fs);
801ef74: 29 61 00 80 lw r1,(r11+128)
801ef78: fb ff ff 88 calli 801ed98 <rtems_rfs_rtems_lock.clone.2>
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
801ef7c: b9 c0 10 00 mv r2,r14
801ef80: b9 60 08 00 mv r1,r11
801ef84: b9 a0 18 00 mv r3,r13
801ef88: 34 04 00 01 mvi r4,1
801ef8c: fb ff bf 83 calli 800ed98 <rtems_rfs_inode_open>
801ef90: b8 20 70 00 mv r14,r1
if (rc)
801ef94: 44 20 00 06 be r1,r0,801efac <rtems_rfs_rtems_dir_open+0x64><== ALWAYS TAKEN
{
rtems_rfs_rtems_unlock (fs);
801ef98: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801ef9c: fb ff ff 68 calli 801ed3c <rtems_rfs_rtems_unlock> <== NOT EXECUTED
return rtems_rfs_rtems_error ("dir_open: opening inode", rc);
801efa0: f8 00 07 5a calli 8020d08 <__errno> <== NOT EXECUTED
801efa4: 58 2e 00 00 sw (r1+0),r14 <== NOT EXECUTED
801efa8: e0 00 00 10 bi 801efe8 <rtems_rfs_rtems_dir_open+0xa0> <== 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);
801efac: 2b 81 00 24 lw r1,(sp+36)
801efb0: 34 02 00 08 mvi r2,8
801efb4: 40 21 00 02 lbu r1,(r1+2)
801efb8: fb ff 89 4a calli 80014e0 <__ashlsi3>
}
if (!RTEMS_RFS_S_ISDIR (rtems_rfs_inode_get_mode (&inode)))
801efbc: 20 21 f0 00 andi r1,r1,0xf000
801efc0: 34 02 40 00 mvi r2,16384
801efc4: 44 22 00 0b be r1,r2,801eff0 <rtems_rfs_rtems_dir_open+0xa8><== ALWAYS TAKEN
{
rtems_rfs_inode_close (fs, &inode);
801efc8: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801efcc: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801efd0: fb ff bf fe calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
rtems_rfs_rtems_unlock (fs);
801efd4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801efd8: fb ff ff 59 calli 801ed3c <rtems_rfs_rtems_unlock> <== NOT EXECUTED
return rtems_rfs_rtems_error ("dir_open: not dir", ENOTDIR);
801efdc: f8 00 07 4b calli 8020d08 <__errno> <== NOT EXECUTED
801efe0: 34 02 00 14 mvi r2,20 <== NOT EXECUTED
801efe4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
801efe8: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
801efec: e0 00 00 08 bi 801f00c <rtems_rfs_rtems_dir_open+0xc4> <== NOT EXECUTED
}
iop->offset = 0;
rtems_rfs_inode_close (fs, &inode);
801eff0: b9 a0 10 00 mv r2,r13
rtems_rfs_inode_close (fs, &inode);
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("dir_open: not dir", ENOTDIR);
}
iop->offset = 0;
801eff4: 59 80 00 04 sw (r12+4),r0
rtems_rfs_inode_close (fs, &inode);
801eff8: b9 60 08 00 mv r1,r11
801effc: fb ff bf f3 calli 800efc8 <rtems_rfs_inode_close>
rtems_rfs_rtems_unlock (fs);
801f000: b9 60 08 00 mv r1,r11
801f004: fb ff ff 4e calli 801ed3c <rtems_rfs_rtems_unlock>
return 0;
801f008: 34 01 00 00 mvi r1,0
}
801f00c: 2b 9d 00 04 lw ra,(sp+4)
801f010: 2b 8b 00 14 lw r11,(sp+20)
801f014: 2b 8c 00 10 lw r12,(sp+16)
801f018: 2b 8d 00 0c lw r13,(sp+12)
801f01c: 2b 8e 00 08 lw r14,(sp+8)
801f020: 37 9c 00 3c addi sp,sp,60
801f024: c3 a0 00 00 ret
0801edf4 <rtems_rfs_rtems_dir_read>:
*/
static ssize_t
rtems_rfs_rtems_dir_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
801edf4: 37 9c ff a8 addi sp,sp,-88
801edf8: 5b 8b 00 2c sw (sp+44),r11
801edfc: 5b 8c 00 28 sw (sp+40),r12
801ee00: 5b 8d 00 24 sw (sp+36),r13
801ee04: 5b 8e 00 20 sw (sp+32),r14
801ee08: 5b 8f 00 1c sw (sp+28),r15
801ee0c: 5b 90 00 18 sw (sp+24),r16
801ee10: 5b 91 00 14 sw (sp+20),r17
801ee14: 5b 92 00 10 sw (sp+16),r18
801ee18: 5b 93 00 0c sw (sp+12),r19
801ee1c: 5b 94 00 08 sw (sp+8),r20
801ee20: 5b 9d 00 04 sw (sp+4),ra
801ee24: b8 20 58 00 mv r11,r1
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
801ee28: 28 21 00 20 lw r1,(r1+32)
*/
static ssize_t
rtems_rfs_rtems_dir_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
801ee2c: b8 40 98 00 mv r19,r2
struct dirent* dirent;
ssize_t bytes_transferred;
int d;
int rc;
count = count / sizeof (struct dirent);
801ee30: 34 02 01 0c mvi r2,268
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);
801ee34: 28 2d 00 08 lw r13,(r1+8)
struct dirent* dirent;
ssize_t bytes_transferred;
int d;
int rc;
count = count / sizeof (struct dirent);
801ee38: b8 60 08 00 mv r1,r3
801ee3c: fb ff 8a 03 calli 8001648 <__udivsi3>
801ee40: b8 20 90 00 mv r18,r1
dirent = buffer;
rtems_rfs_rtems_lock (fs);
801ee44: 29 a1 00 80 lw r1,(r13+128)
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);
rtems_rfs_ino ino = rtems_rfs_rtems_get_iop_ino (iop);
801ee48: 29 6c 00 14 lw r12,(r11+20)
count = count / sizeof (struct dirent);
dirent = buffer;
rtems_rfs_rtems_lock (fs);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
801ee4c: 37 90 00 30 addi r16,sp,48
int rc;
count = count / sizeof (struct dirent);
dirent = buffer;
rtems_rfs_rtems_lock (fs);
801ee50: fb ff ff d2 calli 801ed98 <rtems_rfs_rtems_lock.clone.2>
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
801ee54: b9 80 10 00 mv r2,r12
801ee58: b9 a0 08 00 mv r1,r13
801ee5c: ba 00 18 00 mv r3,r16
801ee60: 34 04 00 01 mvi r4,1
801ee64: fb ff bf cd calli 800ed98 <rtems_rfs_inode_open>
801ee68: b8 20 70 00 mv r14,r1
if (rc)
801ee6c: 34 0f 00 00 mvi r15,0
801ee70: 34 0c 00 00 mvi r12,0
for (d = 0; d < count; d++, dirent++)
{
size_t size;
rc = rtems_rfs_dir_read (fs, &inode, iop->offset, dirent, &size);
if (rc == ENOENT)
801ee74: 34 11 00 02 mvi r17,2
dirent = buffer;
rtems_rfs_rtems_lock (fs);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
if (rc)
801ee78: 44 20 00 1f be r1,r0,801eef4 <rtems_rfs_rtems_dir_read+0x100><== ALWAYS TAKEN
{
rtems_rfs_rtems_unlock (fs);
801ee7c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
801ee80: fb ff ff af calli 801ed3c <rtems_rfs_rtems_unlock> <== NOT EXECUTED
return rtems_rfs_rtems_error ("dir_read: read inode", rc);
801ee84: f8 00 07 a1 calli 8020d08 <__errno> <== NOT EXECUTED
801ee88: 58 2e 00 00 sw (r1+0),r14 <== NOT EXECUTED
801ee8c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
801ee90: e0 00 00 20 bi 801ef10 <rtems_rfs_rtems_dir_read+0x11c> <== NOT EXECUTED
bytes_transferred = 0;
for (d = 0; d < count; d++, dirent++)
{
size_t size;
rc = rtems_rfs_dir_read (fs, &inode, iop->offset, dirent, &size);
801ee94: 29 74 00 04 lw r20,(r11+4)
801ee98: 34 02 00 1f mvi r2,31
801ee9c: ba 80 08 00 mv r1,r20
801eea0: f8 00 54 99 calli 8034104 <__ashrsi3>
801eea4: b8 20 18 00 mv r3,r1
801eea8: b9 c0 28 00 mv r5,r14
801eeac: b9 a0 08 00 mv r1,r13
801eeb0: ba 00 10 00 mv r2,r16
801eeb4: ba 80 20 00 mv r4,r20
801eeb8: 37 86 00 58 addi r6,sp,88
801eebc: fb ff f4 35 calli 801bf90 <rtems_rfs_dir_read>
801eec0: b8 20 70 00 mv r14,r1
if (rc == ENOENT)
801eec4: 44 31 00 0e be r1,r17,801eefc <rtems_rfs_rtems_dir_read+0x108>
{
rc = 0;
break;
}
if (rc > 0)
801eec8: 4c 01 00 05 bge r0,r1,801eedc <rtems_rfs_rtems_dir_read+0xe8><== ALWAYS TAKEN
{
bytes_transferred = rtems_rfs_rtems_error ("dir_read: dir read", rc);
801eecc: f8 00 07 8f calli 8020d08 <__errno> <== NOT EXECUTED
801eed0: 58 2e 00 00 sw (r1+0),r14 <== NOT EXECUTED
801eed4: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
801eed8: e0 00 00 09 bi 801eefc <rtems_rfs_rtems_dir_read+0x108> <== NOT EXECUTED
break;
}
iop->offset += size;
801eedc: 29 62 00 04 lw r2,(r11+4)
801eee0: 2b 81 00 58 lw r1,(sp+88)
* 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,
801eee4: 35 8c 01 0c addi r12,r12,268
return rtems_rfs_rtems_error ("dir_read: read inode", rc);
}
bytes_transferred = 0;
for (d = 0; d < count; d++, dirent++)
801eee8: 35 ef 00 01 addi r15,r15,1
if (rc > 0)
{
bytes_transferred = rtems_rfs_rtems_error ("dir_read: dir read", rc);
break;
}
iop->offset += size;
801eeec: b4 41 08 00 add r1,r2,r1
801eef0: 59 61 00 04 sw (r11+4),r1
* 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,
801eef4: b6 6c 70 00 add r14,r19,r12
return rtems_rfs_rtems_error ("dir_read: read inode", rc);
}
bytes_transferred = 0;
for (d = 0; d < count; d++, dirent++)
801eef8: 56 4f ff e7 bgu r18,r15,801ee94 <rtems_rfs_rtems_dir_read+0xa0>
}
iop->offset += size;
bytes_transferred += sizeof (struct dirent);
}
rtems_rfs_inode_close (fs, &inode);
801eefc: b9 a0 08 00 mv r1,r13
801ef00: 37 82 00 30 addi r2,sp,48
801ef04: fb ff c0 31 calli 800efc8 <rtems_rfs_inode_close>
rtems_rfs_rtems_unlock (fs);
801ef08: b9 a0 08 00 mv r1,r13
801ef0c: fb ff ff 8c calli 801ed3c <rtems_rfs_rtems_unlock>
return bytes_transferred;
}
801ef10: b9 80 08 00 mv r1,r12
801ef14: 2b 9d 00 04 lw ra,(sp+4)
801ef18: 2b 8b 00 2c lw r11,(sp+44)
801ef1c: 2b 8c 00 28 lw r12,(sp+40)
801ef20: 2b 8d 00 24 lw r13,(sp+36)
801ef24: 2b 8e 00 20 lw r14,(sp+32)
801ef28: 2b 8f 00 1c lw r15,(sp+28)
801ef2c: 2b 90 00 18 lw r16,(sp+24)
801ef30: 2b 91 00 14 lw r17,(sp+20)
801ef34: 2b 92 00 10 lw r18,(sp+16)
801ef38: 2b 93 00 0c lw r19,(sp+12)
801ef3c: 2b 94 00 08 lw r20,(sp+8)
801ef40: 37 9c 00 58 addi sp,sp,88
801ef44: c3 a0 00 00 ret
0800fea4 <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)
{
800fea4: 37 9c ff c4 addi sp,sp,-60
800fea8: 5b 8b 00 14 sw (sp+20),r11
800feac: 5b 8c 00 10 sw (sp+16),r12
800feb0: 5b 8d 00 0c sw (sp+12),r13
800feb4: 5b 8e 00 08 sw (sp+8),r14
800feb8: 5b 9d 00 04 sw (sp+4),ra
800febc: b8 20 58 00 mv r11,r1
rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_get_currentloc (ctx);
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (currentloc);
800fec0: 28 21 00 2c lw r1,(r1+44)
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);
800fec4: 29 62 00 20 lw r2,(r11+32)
800fec8: 37 8d 00 18 addi r13,sp,24
static void
rtems_rfs_rtems_eval_path (rtems_filesystem_eval_path_context_t *ctx)
{
rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_get_currentloc (ctx);
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (currentloc);
800fecc: 28 2e 00 08 lw r14,(r1+8)
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);
800fed0: b9 a0 18 00 mv r3,r13
800fed4: 34 04 00 01 mvi r4,1
800fed8: b9 c0 08 00 mv r1,r14
800fedc: fb ff fb af calli 800ed98 <rtems_rfs_inode_open>
800fee0: b8 20 60 00 mv r12,r1
if (rc == 0) {
800fee4: 5c 20 00 0e bne r1,r0,800ff1c <rtems_rfs_rtems_eval_path+0x78><== NEVER TAKEN
rtems_filesystem_eval_path_generic (
800fee8: 78 03 08 03 mvhi r3,0x803
800feec: b9 a0 10 00 mv r2,r13
800fef0: b9 60 08 00 mv r1,r11
800fef4: 38 63 70 60 ori r3,r3,0x7060
800fef8: f8 00 15 2c calli 80153a8 <rtems_filesystem_eval_path_generic>
ctx,
&inode,
&rtems_rfs_rtems_eval_config
);
rc = rtems_rfs_inode_close (fs, &inode);
800fefc: b9 a0 10 00 mv r2,r13
800ff00: b9 c0 08 00 mv r1,r14
800ff04: fb ff fc 31 calli 800efc8 <rtems_rfs_inode_close>
800ff08: b8 20 68 00 mv r13,r1
if (rc != 0) {
800ff0c: 44 2c 00 09 be r1,r12,800ff30 <rtems_rfs_rtems_eval_path+0x8c><== ALWAYS TAKEN
rtems_filesystem_eval_path_error (
ctx,
rtems_rfs_rtems_error ("eval_path: closing inode", rc)
800ff10: f8 00 43 7e calli 8020d08 <__errno> <== NOT EXECUTED
800ff14: 58 2d 00 00 sw (r1+0),r13 <== NOT EXECUTED
800ff18: e0 00 00 03 bi 800ff24 <rtems_rfs_rtems_eval_path+0x80> <== NOT EXECUTED
);
}
} else {
rtems_filesystem_eval_path_error (
ctx,
rtems_rfs_rtems_error ("eval_path: opening inode", rc)
800ff1c: f8 00 43 7b calli 8020d08 <__errno> <== NOT EXECUTED
800ff20: 58 2c 00 00 sw (r1+0),r12 <== NOT EXECUTED
ctx,
rtems_rfs_rtems_error ("eval_path: closing inode", rc)
);
}
} else {
rtems_filesystem_eval_path_error (
800ff24: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800ff28: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED
800ff2c: fb ff df b6 calli 8007e04 <rtems_filesystem_eval_path_error><== NOT EXECUTED
ctx,
rtems_rfs_rtems_error ("eval_path: opening inode", rc)
);
}
}
800ff30: 2b 9d 00 04 lw ra,(sp+4)
800ff34: 2b 8b 00 14 lw r11,(sp+20)
800ff38: 2b 8c 00 10 lw r12,(sp+16)
800ff3c: 2b 8d 00 0c lw r13,(sp+12)
800ff40: 2b 8e 00 08 lw r14,(sp+8)
800ff44: 37 9c 00 3c addi sp,sp,60
800ff48: c3 a0 00 00 ret
08010788 <rtems_rfs_rtems_eval_token>:
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
8010788: 37 9c ff d4 addi sp,sp,-44
801078c: 5b 8b 00 20 sw (sp+32),r11
8010790: 5b 8c 00 1c sw (sp+28),r12
8010794: 5b 8d 00 18 sw (sp+24),r13
8010798: 5b 8e 00 14 sw (sp+20),r14
801079c: 5b 8f 00 10 sw (sp+16),r15
80107a0: 5b 90 00 0c sw (sp+12),r16
80107a4: 5b 91 00 08 sw (sp+8),r17
80107a8: 5b 9d 00 04 sw (sp+4),ra
/* FIXME: Return value? */
rtems_rfs_fs_close(fs);
rtems_rfs_mutex_destroy (&rtems->access);
free (rtems);
}
80107ac: 28 4d 00 0c lw r13,(r2+12)
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
80107b0: b8 20 58 00 mv r11,r1
80107b4: b8 40 60 00 mv r12,r2
rtems_rfs_inode_handle* inode)
{
return rtems_filesystem_eval_path_check_access(
ctx,
eval_flags,
rtems_rfs_inode_get_mode (inode),
80107b8: b9 a0 08 00 mv r1,r13
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
80107bc: b8 60 78 00 mv r15,r3
80107c0: b8 80 70 00 mv r14,r4
rtems_rfs_inode_handle* inode)
{
return rtems_filesystem_eval_path_check_access(
ctx,
eval_flags,
rtems_rfs_inode_get_mode (inode),
80107c4: fb ff fe 0f calli 8010000 <rtems_rfs_inode_get_mode.clone.4>
80107c8: b8 20 88 00 mv r17,r1
rtems_rfs_inode_get_uid (inode),
80107cc: b9 a0 08 00 mv r1,r13
80107d0: fb ff fe 1a calli 8010038 <rtems_rfs_inode_get_uid.clone.5>
80107d4: b8 20 80 00 mv r16,r1
rtems_rfs_inode_get_gid (inode)
80107d8: b9 a0 08 00 mv r1,r13
80107dc: fb ff fe b8 calli 80102bc <rtems_rfs_inode_get_gid.clone.6>
80107e0: b8 20 28 00 mv r5,r1
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(
80107e4: 34 02 00 01 mvi r2,1
80107e8: b9 60 08 00 mv r1,r11
80107ec: ba 20 18 00 mv r3,r17
80107f0: ba 00 20 00 mv r4,r16
80107f4: f8 00 12 d8 calli 8015354 <rtems_filesystem_eval_path_check_access>
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
80107f8: 34 05 00 01 mvi r5,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) {
80107fc: 44 20 00 40 be r1,r0,80108fc <rtems_rfs_rtems_eval_token+0x174>
static inline bool rtems_filesystem_is_current_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 1 && token [0] == '.';
8010800: 5d c5 00 4a bne r14,r5,8010928 <rtems_rfs_rtems_eval_token+0x1a0>
8010804: 41 e2 00 00 lbu r2,(r15+0)
8010808: 34 01 00 2e mvi r1,46
801080c: 5c 41 00 47 bne r2,r1,8010928 <rtems_rfs_rtems_eval_token+0x1a0>
static inline void rtems_filesystem_eval_path_clear_token(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->tokenlen = 0;
8010810: 59 60 00 0c sw (r11+12),r0
8010814: e0 00 00 3a bi 80108fc <rtems_rfs_rtems_eval_token+0x174>
&entry_ino,
&entry_doff
);
if (rc == 0) {
rc = rtems_rfs_inode_close (fs, inode);
8010818: b9 a0 08 00 mv r1,r13
801081c: b9 80 10 00 mv r2,r12
8010820: fb ff f9 ea calli 800efc8 <rtems_rfs_inode_close>
8010824: b8 20 78 00 mv r15,r1
if (rc == 0) {
8010828: 5c 2e 00 08 bne r1,r14,8010848 <rtems_rfs_rtems_eval_token+0xc0><== NEVER TAKEN
rc = rtems_rfs_inode_open (fs, entry_ino, inode, true);
801082c: 2b 82 00 2c lw r2,(sp+44)
8010830: b9 a0 08 00 mv r1,r13
8010834: b9 80 18 00 mv r3,r12
8010838: 34 04 00 01 mvi r4,1
801083c: fb ff f9 57 calli 800ed98 <rtems_rfs_inode_open>
8010840: b8 20 70 00 mv r14,r1
}
if (rc != 0) {
8010844: 44 2f 00 46 be r1,r15,801095c <rtems_rfs_rtems_eval_token+0x1d4><== ALWAYS TAKEN
/*
* This prevents the rtems_rfs_inode_close() from doing something in
* rtems_rfs_rtems_eval_path().
*/
memset (inode, 0, sizeof(*inode));
8010848: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801084c: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
8010850: 34 03 00 28 mvi r3,40 <== NOT EXECUTED
8010854: f8 00 46 ec calli 8022404 <memset> <== NOT EXECUTED
8010858: e0 00 00 50 bi 8010998 <rtems_rfs_rtems_eval_token+0x210> <== NOT EXECUTED
if (rc == 0) {
bool is_sym_link = rtems_rfs_rtems_node_type_by_inode (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;
801085c: 20 41 00 10 andi r1,r2,0x10
bool terminal = !rtems_filesystem_eval_path_has_path (ctx);
rtems_filesystem_eval_path_clear_token (ctx);
if (is_sym_link && (follow_sym_link || !terminal)) {
8010860: 5c 2e 00 02 bne r1,r14,8010868 <rtems_rfs_rtems_eval_token+0xe0>
8010864: 5d e1 00 1d bne r15,r1,80108d8 <rtems_rfs_rtems_eval_token+0x150>
rtems_filesystem_eval_path_context_t* ctx,
rtems_rfs_file_system* fs,
rtems_rfs_ino ino
)
{
size_t len = MAXPATHLEN;
8010868: 34 01 04 00 mvi r1,1024
801086c: 5b 81 00 24 sw (sp+36),r1
char *link = malloc(len + 1);
8010870: 34 01 04 01 mvi r1,1025
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);
8010874: 2b 8e 00 2c lw r14,(sp+44)
rtems_rfs_file_system* fs,
rtems_rfs_ino ino
)
{
size_t len = MAXPATHLEN;
char *link = malloc(len + 1);
8010878: fb ff d8 f0 calli 8006c38 <malloc>
801087c: b8 20 60 00 mv r12,r1
if (link != NULL) {
8010880: 44 20 00 13 be r1,r0,80108cc <rtems_rfs_rtems_eval_token+0x144><== NEVER TAKEN
int rc = rtems_rfs_symlink_read (fs, ino, link, len, &len);
8010884: b9 a0 08 00 mv r1,r13
8010888: b9 c0 10 00 mv r2,r14
801088c: b9 80 18 00 mv r3,r12
8010890: 34 04 04 00 mvi r4,1024
8010894: 37 85 00 24 addi r5,sp,36
8010898: f8 00 37 b4 calli 801e768 <rtems_rfs_symlink_read>
if (rc == 0) {
801089c: 5c 20 00 06 bne r1,r0,80108b4 <rtems_rfs_rtems_eval_token+0x12c><== NEVER TAKEN
rtems_filesystem_eval_path_recursive (ctx, link, len);
80108a0: 2b 83 00 24 lw r3,(sp+36)
80108a4: b9 60 08 00 mv r1,r11
80108a8: b9 80 10 00 mv r2,r12
80108ac: fb ff de ae calli 8008364 <rtems_filesystem_eval_path_recursive>
80108b0: e0 00 00 04 bi 80108c0 <rtems_rfs_rtems_eval_token+0x138>
} else {
rtems_filesystem_eval_path_error (ctx, 0);
80108b4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
80108b8: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
80108bc: fb ff dd 52 calli 8007e04 <rtems_filesystem_eval_path_error><== NOT EXECUTED
}
free(link);
80108c0: b9 80 08 00 mv r1,r12
80108c4: fb ff d6 f2 calli 800648c <free>
80108c8: e0 00 00 34 bi 8010998 <rtems_rfs_rtems_eval_token+0x210>
} else {
rtems_filesystem_eval_path_error (ctx, ENOMEM);
80108cc: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
80108d0: 34 02 00 0c mvi r2,12 <== NOT EXECUTED
80108d4: e0 00 00 30 bi 8010994 <rtems_rfs_rtems_eval_token+0x20c> <== NOT EXECUTED
rtems_filesystem_eval_path_clear_token (ctx);
if (is_sym_link && (follow_sym_link || !terminal)) {
rtems_rfs_rtems_follow_link (ctx, fs, entry_ino);
} else {
rc = rtems_rfs_rtems_set_handlers (currentloc, inode) ? 0 : EIO;
80108d8: 35 61 00 18 addi r1,r11,24
80108dc: b9 80 10 00 mv r2,r12
80108e0: f8 00 00 df calli 8010c5c <rtems_rfs_rtems_set_handlers>
80108e4: 44 20 00 27 be r1,r0,8010980 <rtems_rfs_rtems_eval_token+0x1f8><== NEVER TAKEN
if (rc == 0) {
rtems_rfs_rtems_set_pathloc_ino (currentloc, entry_ino);
80108e8: 2b 81 00 2c lw r1,(sp+44)
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
80108ec: b9 e0 28 00 mv r5,r15
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;
if (rc == 0) {
rtems_rfs_rtems_set_pathloc_ino (currentloc, entry_ino);
80108f0: 59 61 00 20 sw (r11+32),r1
rtems_rfs_rtems_set_pathloc_doff (currentloc, entry_doff);
80108f4: 2b 81 00 28 lw r1,(sp+40)
80108f8: 59 61 00 24 sw (r11+36),r1
}
}
}
return status;
}
80108fc: b8 a0 08 00 mv r1,r5
8010900: 2b 9d 00 04 lw ra,(sp+4)
8010904: 2b 8b 00 20 lw r11,(sp+32)
8010908: 2b 8c 00 1c lw r12,(sp+28)
801090c: 2b 8d 00 18 lw r13,(sp+24)
8010910: 2b 8e 00 14 lw r14,(sp+20)
8010914: 2b 8f 00 10 lw r15,(sp+16)
8010918: 2b 90 00 0c lw r16,(sp+12)
801091c: 2b 91 00 08 lw r17,(sp+8)
8010920: 37 9c 00 2c addi sp,sp,44
8010924: c3 a0 00 00 ret
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);
8010928: 29 61 00 2c lw r1,(r11+44)
rtems_rfs_ino entry_ino;
uint32_t entry_doff;
int rc = rtems_rfs_dir_lookup_ino (
801092c: b9 c0 20 00 mv r4,r14
8010930: 37 85 00 2c addi r5,sp,44
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);
8010934: 28 2d 00 08 lw r13,(r1+8)
rtems_rfs_ino entry_ino;
uint32_t entry_doff;
int rc = rtems_rfs_dir_lookup_ino (
8010938: b9 80 10 00 mv r2,r12
801093c: b9 e0 18 00 mv r3,r15
8010940: b9 a0 08 00 mv r1,r13
8010944: 37 86 00 28 addi r6,sp,40
8010948: f8 00 2a 00 calli 801b148 <rtems_rfs_dir_lookup_ino>
801094c: b8 20 70 00 mv r14,r1
* rtems_rfs_rtems_eval_path().
*/
memset (inode, 0, sizeof(*inode));
}
} else {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY;
8010950: 34 05 00 02 mvi r5,2
tokenlen,
&entry_ino,
&entry_doff
);
if (rc == 0) {
8010954: 5c 20 ff ea bne r1,r0,80108fc <rtems_rfs_rtems_eval_token+0x174>
8010958: e3 ff ff b0 bi 8010818 <rtems_rfs_rtems_eval_token+0x90>
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)
801095c: 29 81 00 0c lw r1,(r12+12)
8010960: fb ff ff 49 calli 8010684 <rtems_rfs_rtems_node_type_by_inode.clone.18>
== 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);
8010964: 29 6f 00 04 lw r15,(r11+4)
8010968: 59 60 00 0c sw (r11+12),r0
rtems_filesystem_eval_path_clear_token (ctx);
if (is_sym_link && (follow_sym_link || !terminal)) {
801096c: 34 03 00 03 mvi r3,3
/* FIXME: Return value? */
rtems_rfs_fs_close(fs);
rtems_rfs_mutex_destroy (&rtems->access);
free (rtems);
}
8010970: 29 62 00 10 lw r2,(r11+16)
if (rc == 0) {
bool is_sym_link = rtems_rfs_rtems_node_type_by_inode (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);
8010974: 65 ef 00 00 cmpei r15,r15,0
rtems_filesystem_eval_path_clear_token (ctx);
if (is_sym_link && (follow_sym_link || !terminal)) {
8010978: 5c 23 ff d8 bne r1,r3,80108d8 <rtems_rfs_rtems_eval_token+0x150>
801097c: e3 ff ff b8 bi 801085c <rtems_rfs_rtems_eval_token+0xd4>
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
}
} else {
rtems_filesystem_eval_path_error (
ctx,
rtems_rfs_rtems_error ("eval_path: set handlers", rc)
8010980: f8 00 40 e2 calli 8020d08 <__errno> <== NOT EXECUTED
8010984: 34 02 00 05 mvi r2,5 <== NOT EXECUTED
8010988: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
if (!terminal) {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
}
} else {
rtems_filesystem_eval_path_error (
801098c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8010990: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED
8010994: fb ff dd 1c calli 8007e04 <rtems_filesystem_eval_path_error><== NOT EXECUTED
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
8010998: 34 05 00 01 mvi r5,1
801099c: e3 ff ff d8 bi 80108fc <rtems_rfs_rtems_eval_token+0x174>
080101a8 <rtems_rfs_rtems_fchmod>:
}
static int
rtems_rfs_rtems_fchmod (const rtems_filesystem_location_info_t* pathloc,
mode_t mode)
{
80101a8: 37 9c ff bc addi sp,sp,-68
80101ac: 5b 8b 00 1c sw (sp+28),r11
80101b0: 5b 8c 00 18 sw (sp+24),r12
80101b4: 5b 8d 00 14 sw (sp+20),r13
80101b8: 5b 8e 00 10 sw (sp+16),r14
80101bc: 5b 8f 00 0c sw (sp+12),r15
80101c0: 5b 90 00 08 sw (sp+8),r16
80101c4: 5b 9d 00 04 sw (sp+4),ra
80101c8: b8 20 20 00 mv r4,r1
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
80101cc: 28 21 00 14 lw r1,(r1+20)
}
static int
rtems_rfs_rtems_fchmod (const rtems_filesystem_location_info_t* pathloc,
mode_t mode)
{
80101d0: b8 40 80 00 mv r16,r2
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);
80101d4: 28 82 00 08 lw r2,(r4+8)
static int
rtems_rfs_rtems_fchmod (const rtems_filesystem_location_info_t* pathloc,
mode_t mode)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
80101d8: 28 2b 00 08 lw r11,(r1+8)
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);
80101dc: 37 8e 00 20 addi r14,sp,32
80101e0: b9 c0 18 00 mv r3,r14
80101e4: b9 60 08 00 mv r1,r11
80101e8: 34 04 00 01 mvi r4,1
80101ec: fb ff fa eb calli 800ed98 <rtems_rfs_inode_open>
80101f0: b8 20 68 00 mv r13,r1
if (rc)
80101f4: 44 20 00 04 be r1,r0,8010204 <rtems_rfs_rtems_fchmod+0x5c> <== ALWAYS TAKEN
{
return rtems_rfs_rtems_error ("fchmod: opening inode", rc);
80101f8: f8 00 42 c4 calli 8020d08 <__errno> <== NOT EXECUTED
80101fc: 58 2d 00 00 sw (r1+0),r13 <== NOT EXECUTED
8010200: e0 00 00 25 bi 8010294 <rtems_rfs_rtems_fchmod+0xec> <== NOT EXECUTED
}
imode = rtems_rfs_inode_get_mode (&inode);
8010204: 2b 81 00 2c lw r1,(sp+44)
8010208: fb ff ff 7e calli 8010000 <rtems_rfs_inode_get_mode.clone.4>
801020c: b8 20 60 00 mv r12,r1
/*
* Verify I am the owner of the node or the super user.
*/
#if defined (RTEMS_POSIX_API)
uid = geteuid();
8010210: f8 00 13 04 calli 8014e20 <geteuid>
/* FIXME: Return value? */
rtems_rfs_fs_close(fs);
rtems_rfs_mutex_destroy (&rtems->access);
free (rtems);
}
8010214: 2b 8d 00 2c lw r13,(sp+44)
/*
* Verify I am the owner of the node or the super user.
*/
#if defined (RTEMS_POSIX_API)
uid = geteuid();
8010218: b8 20 78 00 mv r15,r1
if ((uid != rtems_rfs_inode_get_uid (&inode)) && (uid != 0))
801021c: b9 a0 08 00 mv r1,r13
8010220: fb ff ff 86 calli 8010038 <rtems_rfs_inode_get_uid.clone.5>
8010224: 45 e1 00 09 be r15,r1,8010248 <rtems_rfs_rtems_fchmod+0xa0><== ALWAYS TAKEN
8010228: 45 e0 00 08 be r15,r0,8010248 <rtems_rfs_rtems_fchmod+0xa0><== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
801022c: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
8010230: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8010234: fb ff fb 65 calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
return rtems_rfs_rtems_error ("fchmod: checking uid", EPERM);
8010238: f8 00 42 b4 calli 8020d08 <__errno> <== NOT EXECUTED
801023c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8010240: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
8010244: e0 00 00 14 bi 8010294 <rtems_rfs_rtems_fchmod+0xec> <== NOT EXECUTED
}
#endif
imode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX);
imode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX);
8010248: 22 02 0f ff andi r2,r16,0xfff
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);
801024c: 21 8c f0 00 andi r12,r12,0xf000
imode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX);
8010250: b9 82 60 00 or r12,r12,r2
* @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);
8010254: b9 80 08 00 mv r1,r12
8010258: 34 02 00 08 mvi r2,8
801025c: fb ff c4 c8 calli 800157c <__lshrsi3>
8010260: 31 a1 00 02 sb (r13+2),r1
8010264: 2b 81 00 2c lw r1,(sp+44)
rtems_rfs_inode_set_mode (&inode, imode);
rc = rtems_rfs_inode_close (fs, &inode);
8010268: 37 82 00 20 addi r2,sp,32
801026c: 30 2c 00 03 sb (r1+3),r12
rtems_rfs_buffer_mark_dirty (&handle->buffer);
8010270: 34 01 00 01 mvi r1,1
8010274: 33 81 00 30 sb (sp+48),r1
8010278: b9 60 08 00 mv r1,r11
801027c: fb ff fb 53 calli 800efc8 <rtems_rfs_inode_close>
8010280: b8 20 58 00 mv r11,r1
if (rc > 0)
{
return rtems_rfs_rtems_error ("fchmod: closing inode", rc);
}
return 0;
8010284: 34 01 00 00 mvi r1,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)
8010288: 4c 0b 00 04 bge r0,r11,8010298 <rtems_rfs_rtems_fchmod+0xf0><== ALWAYS TAKEN
{
return rtems_rfs_rtems_error ("fchmod: closing inode", rc);
801028c: f8 00 42 9f calli 8020d08 <__errno> <== NOT EXECUTED
8010290: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
8010294: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
}
return 0;
}
8010298: 2b 9d 00 04 lw ra,(sp+4)
801029c: 2b 8b 00 1c lw r11,(sp+28)
80102a0: 2b 8c 00 18 lw r12,(sp+24)
80102a4: 2b 8d 00 14 lw r13,(sp+20)
80102a8: 2b 8e 00 10 lw r14,(sp+16)
80102ac: 2b 8f 00 0c lw r15,(sp+12)
80102b0: 2b 90 00 08 lw r16,(sp+8)
80102b4: 37 9c 00 44 addi sp,sp,68
80102b8: c3 a0 00 00 ret
08010c1c <rtems_rfs_rtems_fdatasync>:
* @param iop
* @return int
*/
int
rtems_rfs_rtems_fdatasync (rtems_libio_t* iop)
{
8010c1c: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED
8010c20: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED
8010c24: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
int rc;
rc = rtems_rfs_buffer_sync (rtems_rfs_rtems_pathloc_dev (&iop->pathinfo));
8010c28: 28 21 00 20 lw r1,(r1+32) <== NOT EXECUTED
8010c2c: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED
8010c30: f8 00 28 8b calli 801ae5c <rtems_rfs_buffer_sync> <== NOT EXECUTED
8010c34: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
if (rc)
return rtems_rfs_rtems_error ("fdatasync: sync", rc);
return 0;
8010c38: 34 01 00 00 mvi r1,0 <== 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)
8010c3c: 45 60 00 04 be r11,r0,8010c4c <rtems_rfs_rtems_fdatasync+0x30><== NOT EXECUTED
return rtems_rfs_rtems_error ("fdatasync: sync", rc);
8010c40: f8 00 40 32 calli 8020d08 <__errno> <== NOT EXECUTED
8010c44: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
8010c48: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
return 0;
}
8010c4c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8010c50: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED
8010c54: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED
8010c58: c3 a0 00 00 ret <== NOT EXECUTED
0801f588 <rtems_rfs_rtems_file_close>:
* @param iop
* @return int
*/
static int
rtems_rfs_rtems_file_close (rtems_libio_t* iop)
{
801f588: 37 9c ff f4 addi sp,sp,-12
801f58c: 5b 8b 00 0c sw (sp+12),r11
801f590: 5b 8c 00 08 sw (sp+8),r12
801f594: 5b 9d 00 04 sw (sp+4),ra
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
801f598: 28 2b 00 18 lw r11,(r1+24)
rtems_rfs_file_system* fs = rtems_rfs_file_fs (file);
801f59c: 29 61 00 1c lw r1,(r11+28)
801f5a0: 28 2c 00 98 lw r12,(r1+152)
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_CLOSE))
printf("rtems-rfs: file-close: handle:%p\n", file);
rtems_rfs_rtems_lock (fs);
801f5a4: 29 81 00 80 lw r1,(r12+128)
801f5a8: fb ff fe b7 calli 801f084 <rtems_rfs_rtems_lock.clone.1>
rc = rtems_rfs_file_close (fs, file);
801f5ac: b9 60 10 00 mv r2,r11
801f5b0: b9 80 08 00 mv r1,r12
801f5b4: fb ff f4 1b calli 801c620 <rtems_rfs_file_close>
801f5b8: b8 20 58 00 mv r11,r1
if (rc > 0)
801f5bc: 4c 01 00 04 bge r0,r1,801f5cc <rtems_rfs_rtems_file_close+0x44><== ALWAYS TAKEN
rc = rtems_rfs_rtems_error ("file-close: file close", rc);
801f5c0: f8 00 05 d2 calli 8020d08 <__errno> <== NOT EXECUTED
801f5c4: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
801f5c8: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED
rtems_rfs_rtems_unlock (fs);
801f5cc: b9 80 08 00 mv r1,r12
801f5d0: fb ff fe 96 calli 801f028 <rtems_rfs_rtems_unlock>
return rc;
}
801f5d4: b9 60 08 00 mv r1,r11
801f5d8: 2b 9d 00 04 lw ra,(sp+4)
801f5dc: 2b 8b 00 0c lw r11,(sp+12)
801f5e0: 2b 8c 00 08 lw r12,(sp+8)
801f5e4: 37 9c 00 0c addi sp,sp,12
801f5e8: c3 a0 00 00 ret
0801f0e0 <rtems_rfs_rtems_file_ftruncate>:
* @return int
*/
static int
rtems_rfs_rtems_file_ftruncate (rtems_libio_t* iop,
off_t length)
{
801f0e0: 37 9c ff f4 addi sp,sp,-12
801f0e4: 5b 8b 00 0c sw (sp+12),r11
801f0e8: 5b 8c 00 08 sw (sp+8),r12
801f0ec: 5b 9d 00 04 sw (sp+4),ra
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
801f0f0: 28 2c 00 18 lw r12,(r1+24)
* @return int
*/
static int
rtems_rfs_rtems_file_ftruncate (rtems_libio_t* iop,
off_t length)
{
801f0f4: b8 40 58 00 mv r11,r2
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_FTRUNC))
printf("rtems-rfs: file-ftrunc: handle:%p length:%" PRIdoff_t "\n", file, length);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
801f0f8: 29 81 00 1c lw r1,(r12+28)
.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
};
801f0fc: 28 21 00 98 lw r1,(r1+152)
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));
801f100: 28 21 00 80 lw r1,(r1+128)
801f104: fb ff ff e0 calli 801f084 <rtems_rfs_rtems_lock.clone.1>
rc = rtems_rfs_file_set_size (file, length);
801f108: b9 60 08 00 mv r1,r11
801f10c: 34 02 00 1f mvi r2,31
801f110: f8 00 53 fd calli 8034104 <__ashrsi3>
801f114: b8 20 10 00 mv r2,r1
801f118: b9 60 18 00 mv r3,r11
801f11c: b9 80 08 00 mv r1,r12
801f120: fb ff f7 5b calli 801ce8c <rtems_rfs_file_set_size>
801f124: b8 20 58 00 mv r11,r1
if (rc)
801f128: 44 20 00 04 be r1,r0,801f138 <rtems_rfs_rtems_file_ftruncate+0x58><== ALWAYS TAKEN
rc = rtems_rfs_rtems_error ("file_ftruncate: set size", rc);
801f12c: f8 00 06 f7 calli 8020d08 <__errno> <== NOT EXECUTED
801f130: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
801f134: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
801f138: 29 81 00 1c lw r1,(r12+28)
801f13c: 28 21 00 98 lw r1,(r1+152)
801f140: fb ff ff ba calli 801f028 <rtems_rfs_rtems_unlock>
return rc;
}
801f144: b9 60 08 00 mv r1,r11
801f148: 2b 9d 00 04 lw ra,(sp+4)
801f14c: 2b 8b 00 0c lw r11,(sp+12)
801f150: 2b 8c 00 08 lw r12,(sp+8)
801f154: 37 9c 00 0c addi sp,sp,12
801f158: c3 a0 00 00 ret
0801f15c <rtems_rfs_rtems_file_lseek>:
*/
static off_t
rtems_rfs_rtems_file_lseek (rtems_libio_t* iop,
off_t offset,
int whence)
{
801f15c: 37 9c ff d8 addi sp,sp,-40
801f160: 5b 8b 00 18 sw (sp+24),r11
801f164: 5b 8c 00 14 sw (sp+20),r12
801f168: 5b 8d 00 10 sw (sp+16),r13
801f16c: 5b 8e 00 0c sw (sp+12),r14
801f170: 5b 8f 00 08 sw (sp+8),r15
801f174: 5b 9d 00 04 sw (sp+4),ra
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
801f178: 28 2c 00 18 lw r12,(r1+24)
*/
static off_t
rtems_rfs_rtems_file_lseek (rtems_libio_t* iop,
off_t offset,
int whence)
{
801f17c: b8 20 58 00 mv r11,r1
off_t new_offset;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_LSEEK))
printf("rtems-rfs: file-lseek: handle:%p offset:%" PRIdoff_t "\n", file, offset);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
801f180: 29 81 00 1c lw r1,(r12+28)
.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
};
801f184: 28 21 00 98 lw r1,(r1+152)
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));
801f188: 28 21 00 80 lw r1,(r1+128)
801f18c: 5b 82 00 20 sw (sp+32),r2
801f190: 5b 83 00 1c sw (sp+28),r3
801f194: fb ff ff bc calli 801f084 <rtems_rfs_rtems_lock.clone.1>
old_offset = iop->offset;
new_offset = rtems_filesystem_default_lseek_file (iop, offset, whence);
801f198: 2b 82 00 20 lw r2,(sp+32)
801f19c: 2b 83 00 1c lw r3,(sp+28)
801f1a0: b9 60 08 00 mv r1,r11
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;
801f1a4: 29 6f 00 04 lw r15,(r11+4)
new_offset = rtems_filesystem_default_lseek_file (iop, offset, whence);
801f1a8: f8 00 01 52 calli 801f6f0 <rtems_filesystem_default_lseek_file>
801f1ac: b8 20 68 00 mv r13,r1
if (new_offset != -1)
801f1b0: 34 01 ff ff mvi r1,-1
801f1b4: 45 a1 00 12 be r13,r1,801f1fc <rtems_rfs_rtems_file_lseek+0xa0>
{
rtems_rfs_pos pos = iop->offset;
801f1b8: 29 6e 00 04 lw r14,(r11+4)
801f1bc: 34 02 00 1f mvi r2,31
801f1c0: b9 c0 08 00 mv r1,r14
801f1c4: f8 00 53 d0 calli 8034104 <__ashrsi3>
801f1c8: b8 20 10 00 mv r2,r1
801f1cc: 5b 81 00 24 sw (sp+36),r1
int rc = rtems_rfs_file_seek (file, pos, &pos);
801f1d0: b9 c0 18 00 mv r3,r14
801f1d4: b9 80 08 00 mv r1,r12
801f1d8: 37 84 00 24 addi r4,sp,36
old_offset = iop->offset;
new_offset = rtems_filesystem_default_lseek_file (iop, offset, whence);
if (new_offset != -1)
{
rtems_rfs_pos pos = iop->offset;
801f1dc: 5b 8e 00 28 sw (sp+40),r14
int rc = rtems_rfs_file_seek (file, pos, &pos);
801f1e0: fb ff f6 ea calli 801cd88 <rtems_rfs_file_seek>
801f1e4: b8 20 70 00 mv r14,r1
if (rc)
801f1e8: 44 20 00 05 be r1,r0,801f1fc <rtems_rfs_rtems_file_lseek+0xa0><== ALWAYS TAKEN
{
rtems_rfs_rtems_error ("file_lseek: lseek", rc);
801f1ec: f8 00 06 c7 calli 8020d08 <__errno> <== NOT EXECUTED
801f1f0: 58 2e 00 00 sw (r1+0),r14 <== NOT EXECUTED
iop->offset = old_offset;
801f1f4: 59 6f 00 04 sw (r11+4),r15 <== NOT EXECUTED
new_offset = -1;
801f1f8: 34 0d ff ff mvi r13,-1 <== NOT EXECUTED
}
}
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
801f1fc: 29 81 00 1c lw r1,(r12+28)
801f200: 28 21 00 98 lw r1,(r1+152)
801f204: fb ff ff 89 calli 801f028 <rtems_rfs_rtems_unlock>
return new_offset;
}
801f208: b9 a0 08 00 mv r1,r13
801f20c: 2b 9d 00 04 lw ra,(sp+4)
801f210: 2b 8b 00 18 lw r11,(sp+24)
801f214: 2b 8c 00 14 lw r12,(sp+20)
801f218: 2b 8d 00 10 lw r13,(sp+16)
801f21c: 2b 8e 00 0c lw r14,(sp+12)
801f220: 2b 8f 00 08 lw r15,(sp+8)
801f224: 37 9c 00 28 addi sp,sp,40
801f228: c3 a0 00 00 ret
0801f5ec <rtems_rfs_rtems_file_open>:
static int
rtems_rfs_rtems_file_open (rtems_libio_t* iop,
const char* pathname,
int oflag,
mode_t mode)
{
801f5ec: 37 9c ff ec addi sp,sp,-20
801f5f0: 5b 8b 00 10 sw (sp+16),r11
801f5f4: 5b 8c 00 0c sw (sp+12),r12
801f5f8: 5b 8d 00 08 sw (sp+8),r13
801f5fc: 5b 9d 00 04 sw (sp+4),ra
801f600: b8 20 60 00 mv r12,r1
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
801f604: 28 21 00 20 lw r1,(r1+32)
801f608: 28 2b 00 08 lw r11,(r1+8)
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_OPEN))
printf("rtems-rfs: file-open: path:%s ino:%" PRId32 " flags:%04i mode:%04" PRIu32 "\n",
pathname, ino, flags, mode);
rtems_rfs_rtems_lock (fs);
801f60c: 29 61 00 80 lw r1,(r11+128)
801f610: fb ff fe 9d calli 801f084 <rtems_rfs_rtems_lock.clone.1>
ino = rtems_rfs_rtems_get_iop_ino (iop);
rc = rtems_rfs_file_open (fs, ino, flags, &file);
801f614: 29 82 00 14 lw r2,(r12+20)
801f618: b9 60 08 00 mv r1,r11
801f61c: 34 03 00 00 mvi r3,0
801f620: 37 84 00 14 addi r4,sp,20
801f624: fb ff f6 ed calli 801d1d8 <rtems_rfs_file_open>
801f628: b8 20 68 00 mv r13,r1
if (rc > 0)
801f62c: 4c 01 00 07 bge r0,r1,801f648 <rtems_rfs_rtems_file_open+0x5c><== ALWAYS TAKEN
{
rtems_rfs_rtems_unlock (fs);
801f630: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801f634: fb ff fe 7d calli 801f028 <rtems_rfs_rtems_unlock> <== NOT EXECUTED
return rtems_rfs_rtems_error ("file-open: open", rc);
801f638: f8 00 05 b4 calli 8020d08 <__errno> <== NOT EXECUTED
801f63c: 58 2d 00 00 sw (r1+0),r13 <== NOT EXECUTED
801f640: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
801f644: e0 00 00 06 bi 801f65c <rtems_rfs_rtems_file_open+0x70> <== 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);
801f648: 2b 81 00 14 lw r1,(sp+20)
801f64c: 59 81 00 18 sw (r12+24),r1
rtems_rfs_rtems_unlock (fs);
801f650: b9 60 08 00 mv r1,r11
801f654: fb ff fe 75 calli 801f028 <rtems_rfs_rtems_unlock>
return 0;
801f658: 34 01 00 00 mvi r1,0
}
801f65c: 2b 9d 00 04 lw ra,(sp+4)
801f660: 2b 8b 00 10 lw r11,(sp+16)
801f664: 2b 8c 00 0c lw r12,(sp+12)
801f668: 2b 8d 00 08 lw r13,(sp+8)
801f66c: 37 9c 00 14 addi sp,sp,20
801f670: c3 a0 00 00 ret
0801f428 <rtems_rfs_rtems_file_read>:
*/
static ssize_t
rtems_rfs_rtems_file_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
801f428: 37 9c ff d8 addi sp,sp,-40
801f42c: 5b 8b 00 24 sw (sp+36),r11
801f430: 5b 8c 00 20 sw (sp+32),r12
801f434: 5b 8d 00 1c sw (sp+28),r13
801f438: 5b 8e 00 18 sw (sp+24),r14
801f43c: 5b 8f 00 14 sw (sp+20),r15
801f440: 5b 90 00 10 sw (sp+16),r16
801f444: 5b 91 00 0c sw (sp+12),r17
801f448: 5b 92 00 08 sw (sp+8),r18
801f44c: 5b 9d 00 04 sw (sp+4),ra
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
801f450: 28 2b 00 18 lw r11,(r1+24)
*/
static ssize_t
rtems_rfs_rtems_file_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
801f454: b8 20 78 00 mv r15,r1
801f458: b8 60 68 00 mv r13,r3
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));
801f45c: 29 61 00 1c lw r1,(r11+28)
*/
static ssize_t
rtems_rfs_rtems_file_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
801f460: b8 40 88 00 mv r17,r2
.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
};
801f464: 28 21 00 98 lw r1,(r1+152)
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));
801f468: 28 21 00 80 lw r1,(r1+128)
801f46c: fb ff ff 06 calli 801f084 <rtems_rfs_rtems_lock.clone.1>
pos = iop->offset;
801f470: 29 f0 00 04 lw r16,(r15+4)
801f474: 34 02 00 1f mvi r2,31
801f478: ba 00 08 00 mv r1,r16
801f47c: f8 00 53 22 calli 8034104 <__ashrsi3>
if (pos < rtems_rfs_file_size (file))
801f480: 29 63 00 1c lw r3,(r11+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;
801f484: b8 20 60 00 mv r12,r1
801f488: 28 61 00 98 lw r1,(r3+152)
801f48c: 34 62 00 84 addi r2,r3,132
801f490: fb ff e8 9a calli 80196f8 <rtems_rfs_block_get_size>
if (pos < rtems_rfs_file_size (file))
801f494: 54 2c 00 27 bgu r1,r12,801f530 <rtems_rfs_rtems_file_read+0x108><== NEVER TAKEN
801f498: 5c 2c 00 02 bne r1,r12,801f4a0 <rtems_rfs_rtems_file_read+0x78><== NEVER TAKEN
801f49c: 54 50 00 25 bgu r2,r16,801f530 <rtems_rfs_rtems_file_read+0x108>
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;
801f4a0: 34 0c 00 00 mvi r12,0
801f4a4: e0 00 00 26 bi 801f53c <rtems_rfs_rtems_file_read+0x114>
{
while (count)
{
size_t size;
rc = rtems_rfs_file_io_start (file, &size, true);
801f4a8: b9 60 08 00 mv r1,r11
801f4ac: 37 82 00 28 addi r2,sp,40
801f4b0: 34 03 00 01 mvi r3,1
801f4b4: fb ff f5 16 calli 801c90c <rtems_rfs_file_io_start>
801f4b8: b8 20 70 00 mv r14,r1
if (rc > 0)
801f4bc: 4c 01 00 04 bge r0,r1,801f4cc <rtems_rfs_rtems_file_read+0xa4><== ALWAYS TAKEN
{
read = rtems_rfs_rtems_error ("file-read: read: io-start", rc);
801f4c0: f8 00 06 12 calli 8020d08 <__errno> <== NOT EXECUTED
801f4c4: 58 2e 00 00 sw (r1+0),r14 <== NOT EXECUTED
801f4c8: e0 00 00 2e bi 801f580 <rtems_rfs_rtems_file_read+0x158> <== NOT EXECUTED
break;
}
if (size == 0)
801f4cc: 2b 81 00 28 lw r1,(sp+40)
801f4d0: 44 20 00 1a be r1,r0,801f538 <rtems_rfs_rtems_file_read+0x110>
break;
if (size > count)
801f4d4: 51 a1 00 02 bgeu r13,r1,801f4dc <rtems_rfs_rtems_file_read+0xb4>
size = count;
801f4d8: 5b 8d 00 28 sw (sp+40),r13
memcpy (data, rtems_rfs_file_data (file), size);
801f4dc: 29 61 00 0c lw r1,(r11+12)
801f4e0: 2b 8e 00 28 lw r14,(sp+40)
801f4e4: 29 63 00 14 lw r3,(r11+20)
801f4e8: 28 22 00 1c lw r2,(r1+28)
801f4ec: ba 20 08 00 mv r1,r17
801f4f0: b4 43 10 00 add r2,r2,r3
801f4f4: b9 c0 18 00 mv r3,r14
801f4f8: f8 00 0b 35 calli 80221cc <memcpy>
data += size;
count -= size;
read += size;
rc = rtems_rfs_file_io_end (file, size, true);
801f4fc: b9 60 08 00 mv r1,r11
801f500: b9 c0 10 00 mv r2,r14
801f504: 34 03 00 01 mvi r3,1
801f508: fb ff f5 7f calli 801cb04 <rtems_rfs_file_io_end>
801f50c: b8 20 90 00 mv r18,r1
if (rc > 0)
801f510: 48 20 00 05 bg r1,r0,801f524 <rtems_rfs_rtems_file_read+0xfc><== NEVER TAKEN
if (size > count)
size = count;
memcpy (data, rtems_rfs_file_data (file), size);
data += size;
801f514: b6 2e 88 00 add r17,r17,r14
count -= size;
801f518: c9 ae 68 00 sub r13,r13,r14
read += size;
801f51c: b5 8e 60 00 add r12,r12,r14
801f520: e0 00 00 05 bi 801f534 <rtems_rfs_rtems_file_read+0x10c>
rc = rtems_rfs_file_io_end (file, size, true);
if (rc > 0)
{
read = rtems_rfs_rtems_error ("file-read: read: io-end", rc);
801f524: f8 00 05 f9 calli 8020d08 <__errno> <== NOT EXECUTED
801f528: 58 32 00 00 sw (r1+0),r18 <== NOT EXECUTED
801f52c: e0 00 00 15 bi 801f580 <rtems_rfs_rtems_file_read+0x158> <== NOT EXECUTED
void* buffer,
size_t count)
{
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
rtems_rfs_pos pos;
uint8_t* data = buffer;
801f530: 34 0c 00 00 mvi r12,0
pos = iop->offset;
if (pos < rtems_rfs_file_size (file))
{
while (count)
801f534: 5d a0 ff dd bne r13,r0,801f4a8 <rtems_rfs_rtems_file_read+0x80>
break;
}
}
}
if (read >= 0)
801f538: 48 0c 00 03 bg r0,r12,801f544 <rtems_rfs_rtems_file_read+0x11c><== NEVER TAKEN
iop->offset = pos + read;
801f53c: b5 90 80 00 add r16,r12,r16
801f540: 59 f0 00 04 sw (r15+4),r16
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
801f544: 29 61 00 1c lw r1,(r11+28)
801f548: 28 21 00 98 lw r1,(r1+152)
801f54c: fb ff fe b7 calli 801f028 <rtems_rfs_rtems_unlock>
return read;
}
801f550: b9 80 08 00 mv r1,r12
801f554: 2b 9d 00 04 lw ra,(sp+4)
801f558: 2b 8b 00 24 lw r11,(sp+36)
801f55c: 2b 8c 00 20 lw r12,(sp+32)
801f560: 2b 8d 00 1c lw r13,(sp+28)
801f564: 2b 8e 00 18 lw r14,(sp+24)
801f568: 2b 8f 00 14 lw r15,(sp+20)
801f56c: 2b 90 00 10 lw r16,(sp+16)
801f570: 2b 91 00 0c lw r17,(sp+12)
801f574: 2b 92 00 08 lw r18,(sp+8)
801f578: 37 9c 00 28 addi sp,sp,40
801f57c: c3 a0 00 00 ret
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;
801f580: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
801f584: e3 ff ff f0 bi 801f544 <rtems_rfs_rtems_file_read+0x11c> <== NOT EXECUTED
0801f22c <rtems_rfs_rtems_file_write>:
*/
static ssize_t
rtems_rfs_rtems_file_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
{
801f22c: 37 9c ff d4 addi sp,sp,-44
801f230: 5b 8b 00 20 sw (sp+32),r11
801f234: 5b 8c 00 1c sw (sp+28),r12
801f238: 5b 8d 00 18 sw (sp+24),r13
801f23c: 5b 8e 00 14 sw (sp+20),r14
801f240: 5b 8f 00 10 sw (sp+16),r15
801f244: 5b 90 00 0c sw (sp+12),r16
801f248: 5b 91 00 08 sw (sp+8),r17
801f24c: 5b 9d 00 04 sw (sp+4),ra
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
801f250: 28 2b 00 18 lw r11,(r1+24)
*/
static ssize_t
rtems_rfs_rtems_file_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
{
801f254: b8 20 70 00 mv r14,r1
801f258: b8 60 68 00 mv r13,r3
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));
801f25c: 29 61 00 1c lw r1,(r11+28)
*/
static ssize_t
rtems_rfs_rtems_file_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
{
801f260: b8 40 80 00 mv r16,r2
.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
};
801f264: 28 21 00 98 lw r1,(r1+152)
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));
801f268: 28 21 00 80 lw r1,(r1+128)
801f26c: fb ff ff 86 calli 801f084 <rtems_rfs_rtems_lock.clone.1>
pos = iop->offset;
801f270: 29 c1 00 04 lw r1,(r14+4)
801f274: 34 02 00 1f mvi r2,31
801f278: 5b 81 00 28 sw (sp+40),r1
801f27c: f8 00 53 a2 calli 8034104 <__ashrsi3>
file_size = rtems_rfs_file_size (file);
801f280: 29 63 00 1c lw r3,(r11+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;
801f284: 5b 81 00 24 sw (sp+36),r1
801f288: 28 61 00 98 lw r1,(r3+152)
801f28c: 34 62 00 84 addi r2,r3,132
801f290: fb ff e9 1a calli 80196f8 <rtems_rfs_block_get_size>
file_size = rtems_rfs_file_size (file);
if (pos > file_size)
801f294: 2b 85 00 24 lw r5,(sp+36)
801f298: b8 20 20 00 mv r4,r1
801f29c: b8 40 18 00 mv r3,r2
801f2a0: 2b 86 00 28 lw r6,(sp+40)
801f2a4: 54 a4 00 04 bgu r5,r4,801f2b4 <rtems_rfs_rtems_file_write+0x88><== NEVER TAKEN
801f2a8: 5c a4 00 12 bne r5,r4,801f2f0 <rtems_rfs_rtems_file_write+0xc4><== NEVER TAKEN
801f2ac: 54 c2 00 02 bgu r6,r2,801f2b4 <rtems_rfs_rtems_file_write+0x88>
801f2b0: e0 00 00 10 bi 801f2f0 <rtems_rfs_rtems_file_write+0xc4>
/*
* 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);
801f2b4: b8 c0 18 00 mv r3,r6
801f2b8: b9 60 08 00 mv r1,r11
801f2bc: b8 a0 10 00 mv r2,r5
801f2c0: fb ff f6 f3 calli 801ce8c <rtems_rfs_file_set_size>
801f2c4: b8 20 60 00 mv r12,r1
801f2c8: 29 63 00 1c lw r3,(r11+28)
if (rc)
801f2cc: 44 20 00 03 be r1,r0,801f2d8 <rtems_rfs_rtems_file_write+0xac><== ALWAYS TAKEN
{
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
801f2d0: 28 61 00 98 lw r1,(r3+152) <== NOT EXECUTED
801f2d4: e0 00 00 18 bi 801f334 <rtems_rfs_rtems_file_write+0x108> <== NOT EXECUTED
return rtems_rfs_rtems_error ("file-write: write extend", rc);
}
rtems_rfs_file_set_bpos (file, pos);
801f2d8: 28 61 00 98 lw r1,(r3+152)
801f2dc: 2b 82 00 24 lw r2,(sp+36)
801f2e0: 2b 83 00 28 lw r3,(sp+40)
801f2e4: 35 64 00 10 addi r4,r11,16
801f2e8: fb ff e8 b6 calli 80195c0 <rtems_rfs_block_get_bpos>
801f2ec: e0 00 00 39 bi 801f3d0 <rtems_rfs_rtems_file_write+0x1a4>
}
else if (pos < file_size && (iop->flags & LIBIO_FLAGS_APPEND) != 0)
801f2f0: 54 85 00 04 bgu r4,r5,801f300 <rtems_rfs_rtems_file_write+0xd4><== NEVER TAKEN
801f2f4: 5c 85 00 37 bne r4,r5,801f3d0 <rtems_rfs_rtems_file_write+0x1a4><== NEVER TAKEN
801f2f8: 54 66 00 02 bgu r3,r6,801f300 <rtems_rfs_rtems_file_write+0xd4>
801f2fc: e0 00 00 35 bi 801f3d0 <rtems_rfs_rtems_file_write+0x1a4>
801f300: 29 c1 00 08 lw r1,(r14+8)
801f304: 20 21 02 00 andi r1,r1,0x200
801f308: 44 20 00 32 be r1,r0,801f3d0 <rtems_rfs_rtems_file_write+0x1a4>
{
pos = file_size;
801f30c: 5b 84 00 24 sw (sp+36),r4
rc = rtems_rfs_file_seek (file, pos, &pos);
801f310: b8 80 10 00 mv r2,r4
801f314: b9 60 08 00 mv r1,r11
801f318: 37 84 00 24 addi r4,sp,36
rtems_rfs_file_set_bpos (file, pos);
}
else if (pos < file_size && (iop->flags & LIBIO_FLAGS_APPEND) != 0)
{
pos = file_size;
801f31c: 5b 83 00 28 sw (sp+40),r3
rc = rtems_rfs_file_seek (file, pos, &pos);
801f320: fb ff f6 9a calli 801cd88 <rtems_rfs_file_seek>
801f324: b8 20 60 00 mv r12,r1
if (rc)
801f328: 44 20 00 2a be r1,r0,801f3d0 <rtems_rfs_rtems_file_write+0x1a4><== ALWAYS TAKEN
{
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
801f32c: 29 61 00 1c lw r1,(r11+28) <== NOT EXECUTED
801f330: 28 21 00 98 lw r1,(r1+152) <== NOT EXECUTED
801f334: fb ff ff 3d calli 801f028 <rtems_rfs_rtems_unlock> <== NOT EXECUTED
return rtems_rfs_rtems_error ("file-write: write append seek", rc);
801f338: f8 00 06 74 calli 8020d08 <__errno> <== NOT EXECUTED
801f33c: 58 2c 00 00 sw (r1+0),r12 <== NOT EXECUTED
801f340: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
801f344: e0 00 00 2c bi 801f3f4 <rtems_rfs_rtems_file_write+0x1c8> <== NOT EXECUTED
while (count)
{
size_t size = count;
rc = rtems_rfs_file_io_start (file, &size, false);
801f348: b9 60 08 00 mv r1,r11
801f34c: 37 82 00 2c addi r2,sp,44
801f350: 34 03 00 00 mvi r3,0
}
}
while (count)
{
size_t size = count;
801f354: 5b 8d 00 2c sw (sp+44),r13
rc = rtems_rfs_file_io_start (file, &size, false);
801f358: fb ff f5 6d calli 801c90c <rtems_rfs_file_io_start>
801f35c: b8 20 78 00 mv r15,r1
if (rc)
801f360: 44 20 00 04 be r1,r0,801f370 <rtems_rfs_rtems_file_write+0x144>
{
write = rtems_rfs_rtems_error ("file-write: write open", rc);
801f364: f8 00 06 69 calli 8020d08 <__errno>
801f368: 58 2f 00 00 sw (r1+0),r15
801f36c: e0 00 00 2d bi 801f420 <rtems_rfs_rtems_file_write+0x1f4>
break;
}
if (size > count)
801f370: 2b 81 00 2c lw r1,(sp+44)
801f374: 51 a1 00 02 bgeu r13,r1,801f37c <rtems_rfs_rtems_file_write+0x150>
size = count;
801f378: 5b 8d 00 2c sw (sp+44),r13
memcpy (rtems_rfs_file_data (file), data, size);
801f37c: 29 61 00 0c lw r1,(r11+12)
801f380: 29 62 00 14 lw r2,(r11+20)
801f384: 2b 83 00 2c lw r3,(sp+44)
801f388: 28 21 00 1c lw r1,(r1+28)
801f38c: b4 22 08 00 add r1,r1,r2
801f390: ba 00 10 00 mv r2,r16
801f394: f8 00 0b 8e calli 80221cc <memcpy>
data += size;
801f398: 2b 8f 00 2c lw r15,(sp+44)
count -= size;
write += size;
rc = rtems_rfs_file_io_end (file, size, false);
801f39c: b9 60 08 00 mv r1,r11
801f3a0: 34 03 00 00 mvi r3,0
801f3a4: b9 e0 10 00 mv r2,r15
801f3a8: fb ff f5 d7 calli 801cb04 <rtems_rfs_file_io_end>
801f3ac: b8 20 88 00 mv r17,r1
if (rc)
801f3b0: 5c 20 00 05 bne r1,r0,801f3c4 <rtems_rfs_rtems_file_write+0x198><== NEVER TAKEN
if (size > count)
size = count;
memcpy (rtems_rfs_file_data (file), data, size);
data += size;
801f3b4: b6 0f 80 00 add r16,r16,r15
count -= size;
801f3b8: c9 af 68 00 sub r13,r13,r15
write += size;
801f3bc: b5 8f 60 00 add r12,r12,r15
801f3c0: e0 00 00 05 bi 801f3d4 <rtems_rfs_rtems_file_write+0x1a8>
rc = rtems_rfs_file_io_end (file, size, false);
if (rc)
{
write = rtems_rfs_rtems_error ("file-write: write close", rc);
801f3c4: f8 00 06 51 calli 8020d08 <__errno> <== NOT EXECUTED
801f3c8: 58 31 00 00 sw (r1+0),r17 <== NOT EXECUTED
801f3cc: e0 00 00 15 bi 801f420 <rtems_rfs_rtems_file_write+0x1f4> <== NOT EXECUTED
size_t count)
{
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
rtems_rfs_pos pos;
rtems_rfs_pos file_size;
const uint8_t* data = buffer;
801f3d0: 34 0c 00 00 mvi r12,0
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
return rtems_rfs_rtems_error ("file-write: write append seek", rc);
}
}
while (count)
801f3d4: 5d a0 ff dd bne r13,r0,801f348 <rtems_rfs_rtems_file_write+0x11c>
write = rtems_rfs_rtems_error ("file-write: write close", rc);
break;
}
}
if (write >= 0)
801f3d8: 49 ac 00 04 bg r13,r12,801f3e8 <rtems_rfs_rtems_file_write+0x1bc><== NEVER TAKEN
iop->offset = pos + write;
801f3dc: 2b 81 00 28 lw r1,(sp+40)
801f3e0: b5 81 08 00 add r1,r12,r1
801f3e4: 59 c1 00 04 sw (r14+4),r1
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
801f3e8: 29 61 00 1c lw r1,(r11+28)
801f3ec: 28 21 00 98 lw r1,(r1+152)
801f3f0: fb ff ff 0e calli 801f028 <rtems_rfs_rtems_unlock>
return write;
}
801f3f4: b9 80 08 00 mv r1,r12
801f3f8: 2b 9d 00 04 lw ra,(sp+4)
801f3fc: 2b 8b 00 20 lw r11,(sp+32)
801f400: 2b 8c 00 1c lw r12,(sp+28)
801f404: 2b 8d 00 18 lw r13,(sp+24)
801f408: 2b 8e 00 14 lw r14,(sp+20)
801f40c: 2b 8f 00 10 lw r15,(sp+16)
801f410: 2b 90 00 0c lw r16,(sp+12)
801f414: 2b 91 00 08 lw r17,(sp+8)
801f418: 37 9c 00 2c addi sp,sp,44
801f41c: c3 a0 00 00 ret
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
return rtems_rfs_rtems_error ("file-write: write append seek", rc);
}
}
while (count)
801f420: 34 0c ff ff mvi r12,-1
801f424: e3 ff ff f1 bi 801f3e8 <rtems_rfs_rtems_file_write+0x1bc>
08010390 <rtems_rfs_rtems_fstat>:
int
rtems_rfs_rtems_fstat (const rtems_filesystem_location_info_t* pathloc,
struct stat* buf)
{
8010390: 37 9c ff bc addi sp,sp,-68
8010394: 5b 8b 00 1c sw (sp+28),r11
8010398: 5b 8c 00 18 sw (sp+24),r12
801039c: 5b 8d 00 14 sw (sp+20),r13
80103a0: 5b 8e 00 10 sw (sp+16),r14
80103a4: 5b 8f 00 0c sw (sp+12),r15
80103a8: 5b 90 00 08 sw (sp+8),r16
80103ac: 5b 9d 00 04 sw (sp+4),ra
80103b0: b8 20 18 00 mv r3,r1
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
80103b4: 28 21 00 14 lw r1,(r1+20)
}
int
rtems_rfs_rtems_fstat (const rtems_filesystem_location_info_t* pathloc,
struct stat* buf)
{
80103b8: b8 40 58 00 mv r11,r2
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);
80103bc: 28 62 00 08 lw r2,(r3+8)
int
rtems_rfs_rtems_fstat (const rtems_filesystem_location_info_t* pathloc,
struct stat* buf)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
80103c0: 28 2d 00 08 lw r13,(r1+8)
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);
80103c4: 37 83 00 20 addi r3,sp,32
80103c8: 34 04 00 01 mvi r4,1
80103cc: b9 a0 08 00 mv r1,r13
80103d0: fb ff fa 72 calli 800ed98 <rtems_rfs_inode_open>
80103d4: b8 20 70 00 mv r14,r1
if (rc)
80103d8: 44 20 00 04 be r1,r0,80103e8 <rtems_rfs_rtems_fstat+0x58> <== ALWAYS TAKEN
{
return rtems_rfs_rtems_error ("stat: opening inode", rc);
80103dc: f8 00 42 4b calli 8020d08 <__errno> <== NOT EXECUTED
80103e0: 58 2e 00 00 sw (r1+0),r14 <== NOT EXECUTED
80103e4: e0 00 00 9e bi 801065c <rtems_rfs_rtems_fstat+0x2cc> <== NOT EXECUTED
/* FIXME: Return value? */
rtems_rfs_fs_close(fs);
rtems_rfs_mutex_destroy (&rtems->access);
free (rtems);
}
80103e8: 2b 8c 00 2c lw r12,(sp+44)
if (rc)
{
return rtems_rfs_rtems_error ("stat: opening inode", rc);
}
mode = rtems_rfs_inode_get_mode (&inode);
80103ec: b9 80 08 00 mv r1,r12
80103f0: fb ff ff 04 calli 8010000 <rtems_rfs_inode_get_mode.clone.4>
80103f4: b8 20 78 00 mv r15,r1
if (RTEMS_RFS_S_ISCHR (mode) || RTEMS_RFS_S_ISBLK (mode))
80103f8: 20 21 f0 00 andi r1,r1,0xf000
80103fc: 64 22 60 00 cmpei r2,r1,24576
8010400: 64 21 20 00 cmpei r1,r1,8192
8010404: b8 41 08 00 or r1,r2,r1
8010408: 44 2e 00 0a be r1,r14,8010430 <rtems_rfs_rtems_fstat+0xa0> <== ALWAYS TAKEN
{
buf->st_rdev =
rtems_filesystem_make_dev_t (rtems_rfs_inode_get_block (&inode, 0),
801040c: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
8010410: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8010414: fb ff ff c4 calli 8010324 <rtems_rfs_inode_get_block.clone.12><== NOT EXECUTED
8010418: b8 20 70 00 mv r14,r1 <== NOT EXECUTED
801041c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8010420: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8010424: fb ff ff c0 calli 8010324 <rtems_rfs_inode_get_block.clone.12><== NOT EXECUTED
mode = rtems_rfs_inode_get_mode (&inode);
if (RTEMS_RFS_S_ISCHR (mode) || RTEMS_RFS_S_ISBLK (mode))
{
buf->st_rdev =
8010428: 59 61 00 1c sw (r11+28),r1 <== NOT EXECUTED
801042c: 59 6e 00 18 sw (r11+24),r14 <== NOT EXECUTED
rtems_filesystem_make_dev_t (rtems_rfs_inode_get_block (&inode, 0),
rtems_rfs_inode_get_block (&inode, 1));
}
buf->st_dev = rtems_rfs_fs_device (fs);
8010430: 29 ac 00 10 lw r12,(r13+16)
8010434: 34 02 00 1f mvi r2,31
8010438: b9 80 08 00 mv r1,r12
801043c: f8 00 8f 32 calli 8034104 <__ashrsi3>
8010440: 59 61 00 00 sw (r11+0),r1
buf->st_ino = rtems_rfs_inode_ino (&inode);
8010444: 2b 81 00 28 lw r1,(sp+40)
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);
8010448: 59 6c 00 04 sw (r11+4),r12
buf->st_ino = rtems_rfs_inode_ino (&inode);
801044c: 59 61 00 08 sw (r11+8),r1
buf->st_mode = rtems_rfs_rtems_mode (mode);
8010450: b9 e0 08 00 mv r1,r15
8010454: f8 00 02 34 calli 8010d24 <rtems_rfs_rtems_mode>
/* FIXME: Return value? */
rtems_rfs_fs_close(fs);
rtems_rfs_mutex_destroy (&rtems->access);
free (rtems);
}
8010458: 2b 8c 00 2c lw r12,(sp+44)
rtems_rfs_inode_get_block (&inode, 1));
}
buf->st_dev = rtems_rfs_fs_device (fs);
buf->st_ino = rtems_rfs_inode_ino (&inode);
buf->st_mode = rtems_rfs_rtems_mode (mode);
801045c: 59 61 00 0c sw (r11+12),r1
*/
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);
8010460: 34 02 00 08 mvi r2,8
8010464: 41 81 00 00 lbu r1,(r12+0)
8010468: fb ff c4 1e calli 80014e0 <__ashlsi3>
801046c: 41 82 00 01 lbu r2,(r12+1)
8010470: b8 22 10 00 or r2,r1,r2
8010474: 20 42 ff ff andi r2,r2,0xffff
if (links == 0xffff)
8010478: 38 01 ff ff mvu r1,0xffff
links = 0;
801047c: fc 41 08 00 cmpne r1,r2,r1
8010480: c8 01 08 00 sub r1,r0,r1
8010484: a0 41 10 00 and r2,r2,r1
buf->st_nlink = rtems_rfs_inode_get_links (&inode);
8010488: 0d 62 00 10 sh (r11+16),r2
buf->st_uid = rtems_rfs_inode_get_uid (&inode);
801048c: b9 80 08 00 mv r1,r12
8010490: fb ff fe ea calli 8010038 <rtems_rfs_inode_get_uid.clone.5>
8010494: 0d 61 00 12 sh (r11+18),r1
buf->st_gid = rtems_rfs_inode_get_gid (&inode);
8010498: b9 80 08 00 mv r1,r12
801049c: fb ff ff 88 calli 80102bc <rtems_rfs_inode_get_gid.clone.6>
/*
* 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));
80104a0: 2b 82 00 28 lw r2,(sp+40)
buf->st_dev = rtems_rfs_fs_device (fs);
buf->st_ino = rtems_rfs_inode_ino (&inode);
buf->st_mode = rtems_rfs_rtems_mode (mode);
buf->st_nlink = rtems_rfs_inode_get_links (&inode);
buf->st_uid = rtems_rfs_inode_get_uid (&inode);
buf->st_gid = rtems_rfs_inode_get_gid (&inode);
80104a4: 0d 61 00 14 sh (r11+20),r1
/*
* 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));
80104a8: b9 a0 08 00 mv r1,r13
80104ac: f8 00 33 41 calli 801d1b0 <rtems_rfs_file_get_shared>
80104b0: b8 20 10 00 mv r2,r1
80104b4: 29 6f 00 0c lw r15,(r11+12)
if (shared)
80104b8: 44 20 00 12 be r1,r0,8010500 <rtems_rfs_rtems_fstat+0x170>
{
buf->st_atime = rtems_rfs_file_shared_get_atime (shared);
80104bc: 28 21 00 8c lw r1,(r1+140)
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))
80104c0: 21 ef f0 00 andi r15,r15,0xf000
*/
shared = rtems_rfs_file_get_shared (fs, rtems_rfs_inode_ino (&inode));
if (shared)
{
buf->st_atime = rtems_rfs_file_shared_get_atime (shared);
80104c4: 59 61 00 24 sw (r11+36),r1
buf->st_mtime = rtems_rfs_file_shared_get_mtime (shared);
80104c8: 28 41 00 90 lw r1,(r2+144)
80104cc: 59 61 00 2c sw (r11+44),r1
buf->st_ctime = rtems_rfs_file_shared_get_ctime (shared);
80104d0: 28 41 00 94 lw r1,(r2+148)
80104d4: 59 61 00 34 sw (r11+52),r1
buf->st_blocks = rtems_rfs_file_shared_get_block_count (shared);
80104d8: 28 41 00 84 lw r1,(r2+132)
80104dc: 59 61 00 40 sw (r11+64),r1
if (S_ISLNK (buf->st_mode))
80104e0: 38 01 a0 00 mvu r1,0xa000
80104e4: 5d e1 00 03 bne r15,r1,80104f0 <rtems_rfs_rtems_fstat+0x160><== ALWAYS TAKEN
buf->st_size = rtems_rfs_file_shared_get_block_offset (shared);
80104e8: 2c 41 00 8a lhu r1,(r2+138) <== NOT EXECUTED
80104ec: e0 00 00 4c bi 801061c <rtems_rfs_rtems_fstat+0x28c> <== NOT EXECUTED
*/
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);
80104f0: b9 a0 08 00 mv r1,r13
80104f4: 34 42 00 84 addi r2,r2,132
80104f8: f8 00 24 80 calli 80196f8 <rtems_rfs_block_get_size>
80104fc: e0 00 00 4d bi 8010630 <rtems_rfs_rtems_fstat+0x2a0>
/* FIXME: Return value? */
rtems_rfs_fs_close(fs);
rtems_rfs_mutex_destroy (&rtems->access);
free (rtems);
}
8010500: 2b 8c 00 2c lw r12,(sp+44)
* @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);
8010504: 34 02 00 18 mvi r2,24
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);
if (S_ISLNK (buf->st_mode))
8010508: 21 ef f0 00 andi r15,r15,0xf000
801050c: 41 81 00 10 lbu r1,(r12+16)
8010510: 35 8e 00 10 addi r14,r12,16
8010514: 41 d0 00 03 lbu r16,(r14+3)
8010518: fb ff c3 f2 calli 80014e0 <__ashlsi3>
801051c: 34 02 00 10 mvi r2,16
8010520: ba 01 80 00 or r16,r16,r1
8010524: 41 c1 00 01 lbu r1,(r14+1)
8010528: fb ff c3 ee calli 80014e0 <__ashlsi3>
801052c: ba 01 80 00 or r16,r16,r1
8010530: 41 c1 00 02 lbu r1,(r14+2)
8010534: 34 02 00 08 mvi r2,8
* @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);
8010538: 35 8e 00 14 addi r14,r12,20
* @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);
801053c: fb ff c3 e9 calli 80014e0 <__ashlsi3>
8010540: ba 01 08 00 or r1,r16,r1
else
buf->st_size = rtems_rfs_file_shared_get_size (fs, shared);
}
else
{
buf->st_atime = rtems_rfs_inode_get_atime (&inode);
8010544: 59 61 00 24 sw (r11+36),r1
* @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);
8010548: 41 81 00 14 lbu r1,(r12+20)
801054c: 41 d0 00 03 lbu r16,(r14+3)
8010550: 34 02 00 18 mvi r2,24
8010554: fb ff c3 e3 calli 80014e0 <__ashlsi3>
8010558: ba 01 80 00 or r16,r16,r1
801055c: 41 c1 00 01 lbu r1,(r14+1)
8010560: 34 02 00 10 mvi r2,16
8010564: fb ff c3 df calli 80014e0 <__ashlsi3>
8010568: ba 01 80 00 or r16,r16,r1
801056c: 41 c1 00 02 lbu r1,(r14+2)
8010570: 34 02 00 08 mvi r2,8
* @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);
8010574: 35 8e 00 18 addi r14,r12,24
* @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);
8010578: fb ff c3 da calli 80014e0 <__ashlsi3>
801057c: ba 01 08 00 or r1,r16,r1
buf->st_mtime = rtems_rfs_inode_get_mtime (&inode);
8010580: 59 61 00 2c sw (r11+44),r1
* @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);
8010584: 41 81 00 18 lbu r1,(r12+24)
8010588: 41 d0 00 03 lbu r16,(r14+3)
801058c: 34 02 00 18 mvi r2,24
8010590: fb ff c3 d4 calli 80014e0 <__ashlsi3>
8010594: ba 01 80 00 or r16,r16,r1
8010598: 41 c1 00 01 lbu r1,(r14+1)
801059c: 34 02 00 10 mvi r2,16
80105a0: fb ff c3 d0 calli 80014e0 <__ashlsi3>
80105a4: ba 01 80 00 or r16,r16,r1
80105a8: 41 c1 00 02 lbu r1,(r14+2)
80105ac: 34 02 00 08 mvi r2,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);
80105b0: 35 8e 00 0c addi r14,r12,12
* @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);
80105b4: fb ff c3 cb calli 80014e0 <__ashlsi3>
80105b8: ba 01 08 00 or r1,r16,r1
buf->st_ctime = rtems_rfs_inode_get_ctime (&inode);
80105bc: 59 61 00 34 sw (r11+52),r1
* @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);
80105c0: 41 81 00 0c lbu r1,(r12+12)
80105c4: 41 d0 00 03 lbu r16,(r14+3)
80105c8: 34 02 00 18 mvi r2,24
80105cc: fb ff c3 c5 calli 80014e0 <__ashlsi3>
80105d0: ba 01 80 00 or r16,r16,r1
80105d4: 41 c1 00 01 lbu r1,(r14+1)
80105d8: 34 02 00 10 mvi r2,16
80105dc: fb ff c3 c1 calli 80014e0 <__ashlsi3>
80105e0: ba 01 80 00 or r16,r16,r1
80105e4: 41 c1 00 02 lbu r1,(r14+2)
80105e8: 34 02 00 08 mvi r2,8
80105ec: fb ff c3 bd calli 80014e0 <__ashlsi3>
80105f0: ba 01 08 00 or r1,r16,r1
buf->st_blocks = rtems_rfs_inode_get_block_count (&inode);
80105f4: 59 61 00 40 sw (r11+64),r1
if (S_ISLNK (buf->st_mode))
80105f8: 38 01 a0 00 mvu r1,0xa000
80105fc: 5d e1 00 0a bne r15,r1,8010624 <rtems_rfs_rtems_fstat+0x294>
* @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);
8010600: 41 81 00 0a lbu r1,(r12+10)
8010604: 34 02 00 08 mvi r2,8
8010608: 35 8e 00 0a addi r14,r12,10
801060c: fb ff c3 b5 calli 80014e0 <__ashlsi3>
8010610: 41 c2 00 01 lbu r2,(r14+1)
8010614: b8 22 08 00 or r1,r1,r2
buf->st_size = rtems_rfs_inode_get_block_offset (&inode);
8010618: 20 21 ff ff andi r1,r1,0xffff
801061c: 59 61 00 20 sw (r11+32),r1
8010620: e0 00 00 05 bi 8010634 <rtems_rfs_rtems_fstat+0x2a4>
else
buf->st_size = rtems_rfs_inode_get_size (fs, &inode);
8010624: b9 a0 08 00 mv r1,r13
8010628: 37 82 00 20 addi r2,sp,32
801062c: fb ff fc 55 calli 800f780 <rtems_rfs_inode_get_size>
8010630: 59 62 00 20 sw (r11+32),r2
}
buf->st_blksize = rtems_rfs_fs_block_size (fs);
8010634: 29 a1 00 08 lw r1,(r13+8)
rc = rtems_rfs_inode_close (fs, &inode);
8010638: 37 82 00 20 addi r2,sp,32
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);
801063c: 59 61 00 3c sw (r11+60),r1
rc = rtems_rfs_inode_close (fs, &inode);
8010640: b9 a0 08 00 mv r1,r13
8010644: fb ff fa 61 calli 800efc8 <rtems_rfs_inode_close>
8010648: b8 20 58 00 mv r11,r1
if (rc > 0)
{
return rtems_rfs_rtems_error ("stat: closing inode", rc);
}
return 0;
801064c: 34 01 00 00 mvi r1,0
}
buf->st_blksize = rtems_rfs_fs_block_size (fs);
rc = rtems_rfs_inode_close (fs, &inode);
if (rc > 0)
8010650: 4c 0b 00 04 bge r0,r11,8010660 <rtems_rfs_rtems_fstat+0x2d0><== ALWAYS TAKEN
{
return rtems_rfs_rtems_error ("stat: closing inode", rc);
8010654: f8 00 41 ad calli 8020d08 <__errno> <== NOT EXECUTED
8010658: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
801065c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
}
return 0;
}
8010660: 2b 9d 00 04 lw ra,(sp+4)
8010664: 2b 8b 00 1c lw r11,(sp+28)
8010668: 2b 8c 00 18 lw r12,(sp+24)
801066c: 2b 8d 00 14 lw r13,(sp+20)
8010670: 2b 8e 00 10 lw r14,(sp+16)
8010674: 2b 8f 00 0c lw r15,(sp+12)
8010678: 2b 90 00 08 lw r16,(sp+8)
801067c: 37 9c 00 44 addi sp,sp,68
8010680: c3 a0 00 00 ret
08010a30 <rtems_rfs_rtems_initialise>:
*/
int
rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t* mt_entry,
const void* data)
{
8010a30: 37 9c ff d8 addi sp,sp,-40
8010a34: 5b 8b 00 24 sw (sp+36),r11
8010a38: 5b 8c 00 20 sw (sp+32),r12
8010a3c: 5b 8d 00 1c sw (sp+28),r13
8010a40: 5b 8e 00 18 sw (sp+24),r14
8010a44: 5b 8f 00 14 sw (sp+20),r15
8010a48: 5b 90 00 10 sw (sp+16),r16
8010a4c: 5b 91 00 0c sw (sp+12),r17
8010a50: 5b 92 00 08 sw (sp+8),r18
8010a54: 5b 9d 00 04 sw (sp+4),ra
/*
* Parse the options the user specifiies.
*/
while (options)
{
printf ("options=%s\n", options);
8010a58: 78 11 08 03 mvhi r17,0x803
if (strncmp (options, "hold-bitmaps",
8010a5c: 78 10 08 03 mvhi r16,0x803
sizeof ("hold-bitmaps") - 1) == 0)
flags |= RTEMS_RFS_FS_BITMAPS_HOLD;
else if (strncmp (options, "no-local-cache",
8010a60: 78 0f 08 03 mvhi r15,0x803
sizeof ("no-local-cache") - 1) == 0)
flags |= RTEMS_RFS_FS_NO_LOCAL_CACHE;
else if (strncmp (options, "max-held-bufs",
8010a64: 78 0c 08 03 mvhi r12,0x803
*/
int
rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t* mt_entry,
const void* data)
{
8010a68: b8 20 70 00 mv r14,r1
8010a6c: b8 40 58 00 mv r11,r2
rtems_rfs_rtems_private* rtems;
rtems_rfs_file_system* fs;
uint32_t flags = 0;
uint32_t max_held_buffers = RTEMS_RFS_FS_MAX_HELD_BUFFERS;
8010a70: 34 12 00 05 mvi r18,5
rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t* mt_entry,
const void* data)
{
rtems_rfs_rtems_private* rtems;
rtems_rfs_file_system* fs;
uint32_t flags = 0;
8010a74: 34 0d 00 00 mvi r13,0
/*
* Parse the options the user specifiies.
*/
while (options)
{
printf ("options=%s\n", options);
8010a78: 3a 31 6f a4 ori r17,r17,0x6fa4
if (strncmp (options, "hold-bitmaps",
8010a7c: 3a 10 6f b0 ori r16,r16,0x6fb0
sizeof ("hold-bitmaps") - 1) == 0)
flags |= RTEMS_RFS_FS_BITMAPS_HOLD;
else if (strncmp (options, "no-local-cache",
8010a80: 39 ef 6f c0 ori r15,r15,0x6fc0
sizeof ("no-local-cache") - 1) == 0)
flags |= RTEMS_RFS_FS_NO_LOCAL_CACHE;
else if (strncmp (options, "max-held-bufs",
8010a84: 39 8c 6f d0 ori r12,r12,0x6fd0
int rc;
/*
* Parse the options the user specifiies.
*/
while (options)
8010a88: e0 00 00 2a bi 8010b30 <rtems_rfs_rtems_initialise+0x100>
{
printf ("options=%s\n", options);
8010a8c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
8010a90: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
8010a94: f8 00 46 f8 calli 8022674 <printf> <== NOT EXECUTED
if (strncmp (options, "hold-bitmaps",
8010a98: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8010a9c: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
8010aa0: 34 03 00 0c mvi r3,12 <== NOT EXECUTED
8010aa4: f8 00 4b ff calli 8023aa0 <strncmp> <== NOT EXECUTED
8010aa8: 5c 20 00 03 bne r1,r0,8010ab4 <rtems_rfs_rtems_initialise+0x84><== NOT EXECUTED
sizeof ("hold-bitmaps") - 1) == 0)
flags |= RTEMS_RFS_FS_BITMAPS_HOLD;
8010aac: 39 ad 00 01 ori r13,r13,0x1 <== NOT EXECUTED
8010ab0: e0 00 00 16 bi 8010b08 <rtems_rfs_rtems_initialise+0xd8> <== NOT EXECUTED
else if (strncmp (options, "no-local-cache",
8010ab4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8010ab8: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
8010abc: 34 03 00 0e mvi r3,14 <== NOT EXECUTED
8010ac0: f8 00 4b f8 calli 8023aa0 <strncmp> <== NOT EXECUTED
8010ac4: 5c 20 00 03 bne r1,r0,8010ad0 <rtems_rfs_rtems_initialise+0xa0><== NOT EXECUTED
sizeof ("no-local-cache") - 1) == 0)
flags |= RTEMS_RFS_FS_NO_LOCAL_CACHE;
8010ac8: 39 ad 00 02 ori r13,r13,0x2 <== NOT EXECUTED
8010acc: e0 00 00 0f bi 8010b08 <rtems_rfs_rtems_initialise+0xd8> <== NOT EXECUTED
else if (strncmp (options, "max-held-bufs",
8010ad0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8010ad4: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
8010ad8: 34 03 00 0d mvi r3,13 <== NOT EXECUTED
8010adc: f8 00 4b f1 calli 8023aa0 <strncmp> <== NOT EXECUTED
8010ae0: 5c 20 00 07 bne r1,r0,8010afc <rtems_rfs_rtems_initialise+0xcc><== NOT EXECUTED
sizeof ("max-held-bufs") - 1) == 0)
{
max_held_buffers = strtoul (options + sizeof ("max-held-bufs"), 0, 0);
8010ae4: 35 61 00 0e addi r1,r11,14 <== NOT EXECUTED
8010ae8: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
8010aec: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
8010af0: f8 00 4c d2 calli 8023e38 <strtoul> <== NOT EXECUTED
8010af4: b8 20 90 00 mv r18,r1 <== NOT EXECUTED
8010af8: e0 00 00 04 bi 8010b08 <rtems_rfs_rtems_initialise+0xd8> <== NOT EXECUTED
}
else
return rtems_rfs_rtems_error ("initialise: invalid option", EINVAL);
8010afc: f8 00 40 83 calli 8020d08 <__errno> <== NOT EXECUTED
8010b00: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
8010b04: e0 00 00 12 bi 8010b4c <rtems_rfs_rtems_initialise+0x11c> <== NOT EXECUTED
options = strchr (options, ',');
8010b08: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8010b0c: 34 02 00 2c mvi r2,44 <== NOT EXECUTED
8010b10: f8 00 49 ab calli 80231bc <strchr> <== NOT EXECUTED
8010b14: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
if (options)
8010b18: 44 20 00 06 be r1,r0,8010b30 <rtems_rfs_rtems_initialise+0x100><== NOT EXECUTED
{
++options;
8010b1c: 34 2b 00 01 addi r11,r1,1 <== NOT EXECUTED
if (*options == '\0')
8010b20: 41 61 00 00 lbu r1,(r11+0) <== NOT EXECUTED
options = NULL;
8010b24: 7c 21 00 00 cmpnei r1,r1,0 <== NOT EXECUTED
8010b28: c8 01 08 00 sub r1,r0,r1 <== NOT EXECUTED
8010b2c: a1 61 58 00 and r11,r11,r1 <== NOT EXECUTED
int rc;
/*
* Parse the options the user specifiies.
*/
while (options)
8010b30: 5d 60 ff d7 bne r11,r0,8010a8c <rtems_rfs_rtems_initialise+0x5c><== NEVER TAKEN
if (*options == '\0')
options = NULL;
}
}
rtems = malloc (sizeof (rtems_rfs_rtems_private));
8010b34: 34 01 00 04 mvi r1,4
8010b38: fb ff d8 40 calli 8006c38 <malloc>
8010b3c: b8 20 60 00 mv r12,r1
if (!rtems)
8010b40: 5c 2b 00 06 bne r1,r11,8010b58 <rtems_rfs_rtems_initialise+0x128><== ALWAYS TAKEN
return rtems_rfs_rtems_error ("initialise: local data", ENOMEM);
8010b44: f8 00 40 71 calli 8020d08 <__errno> <== NOT EXECUTED
8010b48: 34 02 00 0c mvi r2,12 <== NOT EXECUTED
8010b4c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
8010b50: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
8010b54: e0 00 00 27 bi 8010bf0 <rtems_rfs_rtems_initialise+0x1c0> <== NOT EXECUTED
memset (rtems, 0, sizeof (rtems_rfs_rtems_private));
8010b58: 58 20 00 00 sw (r1+0),r0
rc = rtems_rfs_mutex_create (&rtems->access);
8010b5c: f8 00 37 8e calli 801e994 <rtems_rfs_mutex_create>
8010b60: b8 20 58 00 mv r11,r1
if (rc > 0)
8010b64: 4c 01 00 02 bge r0,r1,8010b6c <rtems_rfs_rtems_initialise+0x13c><== ALWAYS TAKEN
8010b68: e0 00 00 10 bi 8010ba8 <rtems_rfs_rtems_initialise+0x178> <== NOT EXECUTED
{
free (rtems);
return rtems_rfs_rtems_error ("initialise: cannot create mutex", rc);
}
rc = rtems_rfs_mutex_lock (&rtems->access);
8010b6c: 29 81 00 00 lw r1,(r12+0)
8010b70: fb ff ff 8c calli 80109a0 <rtems_rfs_mutex_lock.clone.21>
8010b74: b8 20 58 00 mv r11,r1
if (rc > 0)
8010b78: 4c 01 00 04 bge r0,r1,8010b88 <rtems_rfs_rtems_initialise+0x158><== ALWAYS TAKEN
{
rtems_rfs_mutex_destroy (&rtems->access);
8010b7c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8010b80: f8 00 37 a5 calli 801ea14 <rtems_rfs_mutex_destroy> <== NOT EXECUTED
8010b84: e0 00 00 09 bi 8010ba8 <rtems_rfs_rtems_initialise+0x178> <== NOT EXECUTED
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);
8010b88: 29 c1 00 38 lw r1,(r14+56)
8010b8c: b9 80 10 00 mv r2,r12
8010b90: b9 a0 18 00 mv r3,r13
8010b94: ba 40 20 00 mv r4,r18
8010b98: 37 85 00 28 addi r5,sp,40
8010b9c: f8 00 32 7c calli 801d58c <rtems_rfs_fs_open>
8010ba0: b8 20 58 00 mv r11,r1
if (rc)
8010ba4: 44 20 00 06 be r1,r0,8010bbc <rtems_rfs_rtems_initialise+0x18c><== ALWAYS TAKEN
{
free (rtems);
8010ba8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8010bac: fb ff d6 38 calli 800648c <free> <== NOT EXECUTED
return rtems_rfs_rtems_error ("initialise: open", rc);
8010bb0: f8 00 40 56 calli 8020d08 <__errno> <== NOT EXECUTED
8010bb4: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
8010bb8: e3 ff ff e6 bi 8010b50 <rtems_rfs_rtems_initialise+0x120> <== NOT EXECUTED
}
mt_entry->fs_info = fs;
8010bbc: 2b 81 00 28 lw r1,(sp+40)
mt_entry->ops = &rtems_rfs_ops;
mt_entry->mt_fs_root->location.node_access = (void*) RTEMS_RFS_ROOT_INO;
8010bc0: 29 c3 00 24 lw r3,(r14+36)
free (rtems);
return rtems_rfs_rtems_error ("initialise: open", rc);
}
mt_entry->fs_info = fs;
mt_entry->ops = &rtems_rfs_ops;
8010bc4: 78 02 08 03 mvhi r2,0x803
8010bc8: 38 42 70 0c ori r2,r2,0x700c
{
free (rtems);
return rtems_rfs_rtems_error ("initialise: open", rc);
}
mt_entry->fs_info = fs;
8010bcc: 59 c1 00 08 sw (r14+8),r1
mt_entry->ops = &rtems_rfs_ops;
8010bd0: 59 c2 00 0c sw (r14+12),r2
mt_entry->mt_fs_root->location.node_access = (void*) RTEMS_RFS_ROOT_INO;
8010bd4: 34 02 00 01 mvi r2,1
8010bd8: 58 62 00 08 sw (r3+8),r2
mt_entry->mt_fs_root->location.handlers = &rtems_rfs_rtems_dir_handlers;
8010bdc: 78 02 08 03 mvhi r2,0x803
8010be0: 38 42 92 8c ori r2,r2,0x928c
8010be4: 58 62 00 10 sw (r3+16),r2
rtems_rfs_rtems_unlock (fs);
8010be8: fb ff fc d9 calli 800ff4c <rtems_rfs_rtems_unlock>
return 0;
8010bec: 34 01 00 00 mvi r1,0
}
8010bf0: 2b 9d 00 04 lw ra,(sp+4)
8010bf4: 2b 8b 00 24 lw r11,(sp+36)
8010bf8: 2b 8c 00 20 lw r12,(sp+32)
8010bfc: 2b 8d 00 1c lw r13,(sp+28)
8010c00: 2b 8e 00 18 lw r14,(sp+24)
8010c04: 2b 8f 00 14 lw r15,(sp+20)
8010c08: 2b 90 00 10 lw r16,(sp+16)
8010c0c: 2b 91 00 0c lw r17,(sp+12)
8010c10: 2b 92 00 08 lw r18,(sp+8)
8010c14: 37 9c 00 28 addi sp,sp,40
8010c18: c3 a0 00 00 ret
0800f984 <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)
{
800f984: 37 9c ff f8 addi sp,sp,-8
800f988: 5b 8b 00 08 sw (sp+8),r11
800f98c: 5b 9d 00 04 sw (sp+4),ra
800f990: b8 40 28 00 mv r5,r2
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (targetloc);
800f994: 28 42 00 14 lw r2,(r2+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);
800f998: 28 26 00 08 lw r6,(r1+8)
800f99c: 28 a5 00 08 lw r5,(r5+8)
800f9a0: 28 41 00 08 lw r1,(r2+8)
800f9a4: b8 60 10 00 mv r2,r3
800f9a8: b8 80 18 00 mv r3,r4
800f9ac: b8 c0 20 00 mv r4,r6
800f9b0: 34 06 00 00 mvi r6,0
800f9b4: f8 00 39 62 calli 801df3c <rtems_rfs_link>
800f9b8: b8 20 58 00 mv r11,r1
{
return rtems_rfs_rtems_error ("link: linking", rc);
}
return 0;
800f9bc: 34 01 00 00 mvi r1,0
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)
800f9c0: 45 60 00 04 be r11,r0,800f9d0 <rtems_rfs_rtems_link+0x4c> <== ALWAYS TAKEN
{
return rtems_rfs_rtems_error ("link: linking", rc);
800f9c4: f8 00 44 d1 calli 8020d08 <__errno> <== NOT EXECUTED
800f9c8: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
800f9cc: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
}
return 0;
}
800f9d0: 2b 9d 00 04 lw ra,(sp+4)
800f9d4: 2b 8b 00 08 lw r11,(sp+8)
800f9d8: 37 9c 00 08 addi sp,sp,8
800f9dc: c3 a0 00 00 ret
0801f084 <rtems_rfs_rtems_lock.clone.1>:
/**
* Lock the RFS file system.
*/
static inline void
rtems_rfs_rtems_lock (rtems_rfs_file_system* fs)
801f084: 37 9c ff f8 addi sp,sp,-8
801f088: 5b 8b 00 08 sw (sp+8),r11
801f08c: 5b 9d 00 04 sw (sp+4),ra
*/
static inline int
rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
801f090: 28 21 00 00 lw r1,(r1+0)
801f094: 34 02 00 00 mvi r2,0
801f098: 34 03 00 00 mvi r3,0
801f09c: fb ff a8 a4 calli 800932c <rtems_semaphore_obtain>
801f0a0: b8 20 58 00 mv r11,r1
if (sc != RTEMS_SUCCESSFUL)
801f0a4: 44 20 00 0b be r1,r0,801f0d0 <rtems_rfs_rtems_lock.clone.1+0x4c><== ALWAYS TAKEN
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
801f0a8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801f0ac: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
801f0b0: fb ff c7 1e calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801f0b4: 44 20 00 07 be r1,r0,801f0d0 <rtems_rfs_rtems_lock.clone.1+0x4c><== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
801f0b8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801f0bc: fb ff d6 65 calli 8014a50 <rtems_status_text> <== NOT EXECUTED
801f0c0: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
801f0c4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801f0c8: 38 21 6f 7c ori r1,r1,0x6f7c <== NOT EXECUTED
801f0cc: f8 00 0d 6a calli 8022674 <printf> <== NOT EXECUTED
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
rtems_rfs_mutex_lock (&rtems->access);
}
801f0d0: 2b 9d 00 04 lw ra,(sp+4)
801f0d4: 2b 8b 00 08 lw r11,(sp+8)
801f0d8: 37 9c 00 08 addi sp,sp,8
801f0dc: c3 a0 00 00 ret
0801ed98 <rtems_rfs_rtems_lock.clone.2>:
/**
* Lock the RFS file system.
*/
static inline void
rtems_rfs_rtems_lock (rtems_rfs_file_system* fs)
801ed98: 37 9c ff f8 addi sp,sp,-8
801ed9c: 5b 8b 00 08 sw (sp+8),r11
801eda0: 5b 9d 00 04 sw (sp+4),ra
*/
static inline int
rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
801eda4: 28 21 00 00 lw r1,(r1+0)
801eda8: 34 02 00 00 mvi r2,0
801edac: 34 03 00 00 mvi r3,0
801edb0: fb ff a9 5f calli 800932c <rtems_semaphore_obtain>
801edb4: b8 20 58 00 mv r11,r1
if (sc != RTEMS_SUCCESSFUL)
801edb8: 44 20 00 0b be r1,r0,801ede4 <rtems_rfs_rtems_lock.clone.2+0x4c><== ALWAYS TAKEN
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
801edbc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801edc0: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
801edc4: fb ff c7 d9 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801edc8: 44 20 00 07 be r1,r0,801ede4 <rtems_rfs_rtems_lock.clone.2+0x4c><== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
801edcc: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801edd0: fb ff d7 20 calli 8014a50 <rtems_status_text> <== NOT EXECUTED
801edd4: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
801edd8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801eddc: 38 21 6f 7c ori r1,r1,0x6f7c <== NOT EXECUTED
801ede0: f8 00 0e 25 calli 8022674 <printf> <== NOT EXECUTED
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
rtems_rfs_mutex_lock (&rtems->access);
}
801ede4: 2b 9d 00 04 lw ra,(sp+4)
801ede8: 2b 8b 00 08 lw r11,(sp+8)
801edec: 37 9c 00 08 addi sp,sp,8
801edf0: c3 a0 00 00 ret
0800fd18 <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)
{
800fd18: 37 9c ff a8 addi sp,sp,-88
800fd1c: 5b 8b 00 2c sw (sp+44),r11
800fd20: 5b 8c 00 28 sw (sp+40),r12
800fd24: 5b 8d 00 24 sw (sp+36),r13
800fd28: 5b 8e 00 20 sw (sp+32),r14
800fd2c: 5b 8f 00 1c sw (sp+28),r15
800fd30: 5b 90 00 18 sw (sp+24),r16
800fd34: 5b 91 00 14 sw (sp+20),r17
800fd38: 5b 92 00 10 sw (sp+16),r18
800fd3c: 5b 93 00 0c sw (sp+12),r19
800fd40: 5b 9d 00 08 sw (sp+8),ra
800fd44: b8 40 90 00 mv r18,r2
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parentloc);
800fd48: 28 22 00 14 lw r2,(r1+20)
rtems_rfs_rtems_mknod (const rtems_filesystem_location_info_t *parentloc,
const char *name,
size_t namelen,
mode_t mode,
dev_t dev)
{
800fd4c: b8 60 88 00 mv r17,r3
800fd50: b8 80 68 00 mv r13,r4
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parentloc);
800fd54: 28 4b 00 08 lw r11,(r2+8)
rtems_rfs_rtems_mknod (const rtems_filesystem_location_info_t *parentloc,
const char *name,
size_t namelen,
mode_t mode,
dev_t dev)
{
800fd58: b8 a0 80 00 mv r16,r5
800fd5c: b8 c0 78 00 mv r15,r6
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parentloc);
rtems_rfs_ino parent = rtems_rfs_rtems_get_pathloc_ino (parentloc);
800fd60: 28 33 00 08 lw r19,(r1+8)
uid_t uid;
gid_t gid;
int rc;
#if defined(RTEMS_POSIX_API)
uid = geteuid ();
800fd64: f8 00 14 2f calli 8014e20 <geteuid>
800fd68: b8 20 70 00 mv r14,r1
gid = getegid ();
800fd6c: f8 00 14 28 calli 8014e0c <getegid>
800fd70: b8 20 60 00 mv r12,r1
uid = 0;
gid = 0;
#endif
rc = rtems_rfs_inode_create (fs, parent, name, namelen,
rtems_rfs_rtems_imode (mode),
800fd74: b9 a0 08 00 mv r1,r13
800fd78: f8 00 03 e9 calli 8010d1c <rtems_rfs_rtems_imode>
800fd7c: b8 20 28 00 mv r5,r1
#else
uid = 0;
gid = 0;
#endif
rc = rtems_rfs_inode_create (fs, parent, name, namelen,
800fd80: 37 81 00 58 addi r1,sp,88
800fd84: 5b 81 00 04 sw (sp+4),r1
800fd88: b9 80 40 00 mv r8,r12
800fd8c: b9 60 08 00 mv r1,r11
800fd90: ba 60 10 00 mv r2,r19
800fd94: ba 40 18 00 mv r3,r18
800fd98: ba 20 20 00 mv r4,r17
800fd9c: 34 06 00 01 mvi r6,1
800fda0: b9 c0 38 00 mv r7,r14
800fda4: fb ff fd 9d calli 800f418 <rtems_rfs_inode_create>
800fda8: b8 20 60 00 mv r12,r1
rtems_rfs_rtems_imode (mode),
1, uid, gid, &ino);
if (rc > 0)
800fdac: 4c 01 00 04 bge r0,r1,800fdbc <rtems_rfs_rtems_mknod+0xa4>
{
return rtems_rfs_rtems_error ("mknod: inode create", rc);
800fdb0: f8 00 43 d6 calli 8020d08 <__errno>
800fdb4: 58 2c 00 00 sw (r1+0),r12
800fdb8: e0 00 00 2e bi 800fe70 <rtems_rfs_rtems_mknod+0x158>
}
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
800fdbc: 2b 82 00 58 lw r2,(sp+88)
800fdc0: 37 8c 00 30 addi r12,sp,48
800fdc4: b9 60 08 00 mv r1,r11
800fdc8: b9 80 18 00 mv r3,r12
800fdcc: 34 04 00 01 mvi r4,1
800fdd0: fb ff fb f2 calli 800ed98 <rtems_rfs_inode_open>
800fdd4: b8 20 70 00 mv r14,r1
if (rc > 0)
800fdd8: 4c 01 00 04 bge r0,r1,800fde8 <rtems_rfs_rtems_mknod+0xd0> <== ALWAYS TAKEN
{
return rtems_rfs_rtems_error ("mknod: inode open", rc);
800fddc: f8 00 43 cb calli 8020d08 <__errno> <== NOT EXECUTED
800fde0: 58 2e 00 00 sw (r1+0),r14 <== NOT EXECUTED
800fde4: e0 00 00 23 bi 800fe70 <rtems_rfs_rtems_mknod+0x158> <== NOT EXECUTED
}
if (S_ISDIR(mode) || S_ISREG(mode))
800fde8: 21 a4 f0 00 andi r4,r13,0xf000
800fdec: 38 01 80 00 mvu r1,0x8000
800fdf0: e4 81 08 00 cmpe r1,r4,r1
800fdf4: 64 82 40 00 cmpei r2,r4,16384
800fdf8: b8 22 08 00 or r1,r1,r2
800fdfc: 5c 20 00 15 bne r1,r0,800fe50 <rtems_rfs_rtems_mknod+0x138><== ALWAYS TAKEN
{
}
else if (S_ISCHR (mode) || S_ISBLK (mode))
800fe00: 64 82 60 00 cmpei r2,r4,24576 <== NOT EXECUTED
800fe04: 64 84 20 00 cmpei r4,r4,8192 <== NOT EXECUTED
800fe08: b8 44 20 00 or r4,r2,r4 <== NOT EXECUTED
800fe0c: 44 81 00 0a be r4,r1,800fe34 <rtems_rfs_rtems_mknod+0x11c> <== NOT EXECUTED
{
int major;
int minor;
rtems_filesystem_split_dev_t (dev, major, minor);
rtems_rfs_inode_set_block (&inode, 0, major);
800fe10: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800fe14: ba 00 18 00 mv r3,r16 <== NOT EXECUTED
800fe18: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
800fe1c: fb ff fe 82 calli 800f824 <rtems_rfs_inode_set_block> <== NOT EXECUTED
rtems_rfs_inode_set_block (&inode, 1, minor);
800fe20: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800fe24: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
800fe28: b9 e0 18 00 mv r3,r15 <== NOT EXECUTED
800fe2c: fb ff fe 7e calli 800f824 <rtems_rfs_inode_set_block> <== NOT EXECUTED
800fe30: e0 00 00 08 bi 800fe50 <rtems_rfs_rtems_mknod+0x138> <== NOT EXECUTED
}
else
{
rtems_rfs_inode_close (fs, &inode);
800fe34: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
800fe38: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800fe3c: fb ff fc 63 calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
return rtems_rfs_rtems_error ("mknod: bad mode", EINVAL);
800fe40: f8 00 43 b2 calli 8020d08 <__errno> <== NOT EXECUTED
800fe44: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
800fe48: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
800fe4c: e0 00 00 09 bi 800fe70 <rtems_rfs_rtems_mknod+0x158> <== NOT EXECUTED
}
rc = rtems_rfs_inode_close (fs, &inode);
800fe50: b9 60 08 00 mv r1,r11
800fe54: 37 82 00 30 addi r2,sp,48
800fe58: fb ff fc 5c calli 800efc8 <rtems_rfs_inode_close>
800fe5c: b8 20 58 00 mv r11,r1
if (rc > 0)
{
return rtems_rfs_rtems_error ("mknod: closing inode", rc);
}
return 0;
800fe60: 34 01 00 00 mvi r1,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)
800fe64: 4c 0b 00 04 bge r0,r11,800fe74 <rtems_rfs_rtems_mknod+0x15c><== ALWAYS TAKEN
{
return rtems_rfs_rtems_error ("mknod: closing inode", rc);
800fe68: f8 00 43 a8 calli 8020d08 <__errno> <== NOT EXECUTED
800fe6c: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
800fe70: 34 01 ff ff mvi r1,-1
}
return 0;
}
800fe74: 2b 9d 00 08 lw ra,(sp+8)
800fe78: 2b 8b 00 2c lw r11,(sp+44)
800fe7c: 2b 8c 00 28 lw r12,(sp+40)
800fe80: 2b 8d 00 24 lw r13,(sp+36)
800fe84: 2b 8e 00 20 lw r14,(sp+32)
800fe88: 2b 8f 00 1c lw r15,(sp+28)
800fe8c: 2b 90 00 18 lw r16,(sp+24)
800fe90: 2b 91 00 14 lw r17,(sp+20)
800fe94: 2b 92 00 10 lw r18,(sp+16)
800fe98: 2b 93 00 0c lw r19,(sp+12)
800fe9c: 37 9c 00 58 addi sp,sp,88
800fea0: c3 a0 00 00 ret
080106f4 <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)
{
80106f4: 37 9c ff c8 addi sp,sp,-56
80106f8: 5b 8b 00 10 sw (sp+16),r11
80106fc: 5b 8c 00 0c sw (sp+12),r12
8010700: 5b 8d 00 08 sw (sp+8),r13
8010704: 5b 9d 00 04 sw (sp+4),ra
8010708: b8 20 20 00 mv r4,r1
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
801070c: 28 21 00 14 lw r1,(r1+20)
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);
8010710: 28 82 00 08 lw r2,(r4+8)
8010714: 37 8c 00 14 addi r12,sp,20
*/
static rtems_filesystem_node_types_t
rtems_rfs_rtems_node_type (const rtems_filesystem_location_info_t* pathloc)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
8010718: 28 2d 00 08 lw r13,(r1+8)
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);
801071c: b9 80 18 00 mv r3,r12
8010720: 34 04 00 01 mvi r4,1
8010724: b9 a0 08 00 mv r1,r13
8010728: fb ff f9 9c calli 800ed98 <rtems_rfs_inode_open>
801072c: b8 20 58 00 mv r11,r1
if (rc > 0)
8010730: 4c 01 00 04 bge r0,r1,8010740 <rtems_rfs_rtems_node_type+0x4c><== ALWAYS TAKEN
{
return rtems_rfs_rtems_error ("node_type: opening inode", rc);
8010734: f8 00 41 75 calli 8020d08 <__errno> <== NOT EXECUTED
8010738: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
801073c: e0 00 00 0b bi 8010768 <rtems_rfs_rtems_node_type+0x74> <== NOT EXECUTED
}
type = rtems_rfs_rtems_node_type_by_inode (&inode);
8010740: 2b 81 00 20 lw r1,(sp+32)
8010744: fb ff ff d0 calli 8010684 <rtems_rfs_rtems_node_type_by_inode.clone.18>
rc = rtems_rfs_inode_close (fs, &inode);
8010748: b9 80 10 00 mv r2,r12
if (rc > 0)
{
return rtems_rfs_rtems_error ("node_type: opening inode", rc);
}
type = rtems_rfs_rtems_node_type_by_inode (&inode);
801074c: b8 20 58 00 mv r11,r1
rc = rtems_rfs_inode_close (fs, &inode);
8010750: b9 a0 08 00 mv r1,r13
8010754: fb ff fa 1d calli 800efc8 <rtems_rfs_inode_close>
8010758: b8 20 60 00 mv r12,r1
if (rc > 0)
801075c: 4c 01 00 04 bge r0,r1,801076c <rtems_rfs_rtems_node_type+0x78><== ALWAYS TAKEN
{
return rtems_rfs_rtems_error ("node_type: closing inode", rc);
8010760: f8 00 41 6a calli 8020d08 <__errno> <== NOT EXECUTED
8010764: 58 2c 00 00 sw (r1+0),r12 <== NOT EXECUTED
8010768: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED
}
return type;
}
801076c: b9 60 08 00 mv r1,r11
8010770: 2b 9d 00 04 lw ra,(sp+4)
8010774: 2b 8b 00 10 lw r11,(sp+16)
8010778: 2b 8c 00 0c lw r12,(sp+12)
801077c: 2b 8d 00 08 lw r13,(sp+8)
8010780: 37 9c 00 38 addi sp,sp,56
8010784: c3 a0 00 00 ret
0800fae8 <rtems_rfs_rtems_readlink>:
static ssize_t
rtems_rfs_rtems_readlink (const rtems_filesystem_location_info_t* pathloc,
char* buf,
size_t bufsize)
{
800fae8: 37 9c ff f4 addi sp,sp,-12
800faec: 5b 8b 00 08 sw (sp+8),r11
800faf0: 5b 9d 00 04 sw (sp+4),ra
800faf4: b8 20 28 00 mv r5,r1
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
800faf8: 28 21 00 14 lw r1,(r1+20)
static ssize_t
rtems_rfs_rtems_readlink (const rtems_filesystem_location_info_t* pathloc,
char* buf,
size_t bufsize)
{
800fafc: b8 40 30 00 mv r6,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);
800fb00: 28 a2 00 08 lw r2,(r5+8)
800fb04: 28 21 00 08 lw r1,(r1+8)
static ssize_t
rtems_rfs_rtems_readlink (const rtems_filesystem_location_info_t* pathloc,
char* buf,
size_t bufsize)
{
800fb08: b8 60 20 00 mv r4,r3
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);
800fb0c: 37 85 00 0c addi r5,sp,12
800fb10: b8 c0 18 00 mv r3,r6
800fb14: f8 00 3b 15 calli 801e768 <rtems_rfs_symlink_read>
800fb18: b8 20 58 00 mv r11,r1
if (rc)
800fb1c: 44 20 00 05 be r1,r0,800fb30 <rtems_rfs_rtems_readlink+0x48><== ALWAYS TAKEN
{
return rtems_rfs_rtems_error ("readlink: reading link", rc);
800fb20: f8 00 44 7a calli 8020d08 <__errno> <== NOT EXECUTED
800fb24: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
800fb28: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
800fb2c: e0 00 00 02 bi 800fb34 <rtems_rfs_rtems_readlink+0x4c> <== NOT EXECUTED
}
return (ssize_t) length;
800fb30: 2b 81 00 0c lw r1,(sp+12)
}
800fb34: 2b 9d 00 04 lw ra,(sp+4)
800fb38: 2b 8b 00 08 lw r11,(sp+8)
800fb3c: 37 9c 00 0c addi sp,sp,12
800fb40: c3 a0 00 00 ret
0800f9e0 <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)
{
800f9e0: 37 9c ff e8 addi sp,sp,-24 <== NOT EXECUTED
800f9e4: 5b 8b 00 18 sw (sp+24),r11 <== NOT EXECUTED
800f9e8: 5b 8c 00 14 sw (sp+20),r12 <== NOT EXECUTED
800f9ec: 5b 8d 00 10 sw (sp+16),r13 <== NOT EXECUTED
800f9f0: 5b 8e 00 0c sw (sp+12),r14 <== NOT EXECUTED
800f9f4: 5b 8f 00 08 sw (sp+8),r15 <== NOT EXECUTED
800f9f8: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (old_loc);
800f9fc: 28 46 00 14 lw r6,(r2+20) <== 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);
800fa00: 28 4b 00 08 lw r11,(r2+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);
800fa04: 28 2f 00 08 lw r15,(r1+8) <== NOT EXECUTED
const rtems_filesystem_location_info_t* old_loc,
const rtems_filesystem_location_info_t* new_parent_loc,
const char* new_name,
size_t new_name_len)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (old_loc);
800fa08: 28 cc 00 08 lw r12,(r6+8) <== NOT EXECUTED
/*
* Link to the inode before unlinking so the inode is not erased when
* unlinked.
*/
rc = rtems_rfs_link (fs, new_name, new_name_len, new_parent, ino, true);
800fa0c: 28 66 00 08 lw r6,(r3+8) <== NOT EXECUTED
old_parent = rtems_rfs_rtems_get_pathloc_ino (old_parent_loc);
new_parent = rtems_rfs_rtems_get_pathloc_ino (new_parent_loc);
ino = rtems_rfs_rtems_get_pathloc_ino (old_loc);
doff = rtems_rfs_rtems_get_pathloc_doff (old_loc);
800fa10: 28 4e 00 0c lw r14,(r2+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);
800fa14: b8 a0 18 00 mv r3,r5 <== NOT EXECUTED
800fa18: b8 80 10 00 mv r2,r4 <== NOT EXECUTED
800fa1c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800fa20: b8 c0 20 00 mv r4,r6 <== NOT EXECUTED
800fa24: b9 60 28 00 mv r5,r11 <== NOT EXECUTED
800fa28: 34 06 00 01 mvi r6,1 <== NOT EXECUTED
800fa2c: f8 00 39 44 calli 801df3c <rtems_rfs_link> <== NOT EXECUTED
800fa30: b8 20 68 00 mv r13,r1 <== NOT EXECUTED
if (rc)
800fa34: 44 20 00 04 be r1,r0,800fa44 <rtems_rfs_rtems_rename+0x64> <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("rename: linking", rc);
800fa38: f8 00 44 b4 calli 8020d08 <__errno> <== NOT EXECUTED
800fa3c: 58 2d 00 00 sw (r1+0),r13 <== NOT EXECUTED
800fa40: e0 00 00 0c bi 800fa70 <rtems_rfs_rtems_rename+0x90> <== 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,
800fa44: b9 60 18 00 mv r3,r11 <== NOT EXECUTED
800fa48: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800fa4c: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
800fa50: b9 c0 20 00 mv r4,r14 <== NOT EXECUTED
800fa54: 34 05 00 02 mvi r5,2 <== NOT EXECUTED
800fa58: f8 00 39 b1 calli 801e11c <rtems_rfs_unlink> <== NOT EXECUTED
800fa5c: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
if (rc)
{
return rtems_rfs_rtems_error ("rename: unlinking", rc);
}
return 0;
800fa60: 34 01 00 00 mvi r1,0 <== 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)
800fa64: 45 61 00 04 be r11,r1,800fa74 <rtems_rfs_rtems_rename+0x94><== NOT EXECUTED
{
return rtems_rfs_rtems_error ("rename: unlinking", rc);
800fa68: f8 00 44 a8 calli 8020d08 <__errno> <== NOT EXECUTED
800fa6c: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
800fa70: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
}
return 0;
}
800fa74: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
800fa78: 2b 8b 00 18 lw r11,(sp+24) <== NOT EXECUTED
800fa7c: 2b 8c 00 14 lw r12,(sp+20) <== NOT EXECUTED
800fa80: 2b 8d 00 10 lw r13,(sp+16) <== NOT EXECUTED
800fa84: 2b 8e 00 0c lw r14,(sp+12) <== NOT EXECUTED
800fa88: 2b 8f 00 08 lw r15,(sp+8) <== NOT EXECUTED
800fa8c: 37 9c 00 18 addi sp,sp,24 <== NOT EXECUTED
800fa90: c3 a0 00 00 ret <== NOT EXECUTED
08010c5c <rtems_rfs_rtems_set_handlers>:
*/
bool
rtems_rfs_rtems_set_handlers (rtems_filesystem_location_info_t* loc,
rtems_rfs_inode_handle* inode)
{
8010c5c: 37 9c ff f4 addi sp,sp,-12
8010c60: 5b 8b 00 0c sw (sp+12),r11
8010c64: 5b 8c 00 08 sw (sp+8),r12
8010c68: 5b 9d 00 04 sw (sp+4),ra
8010c6c: b8 20 58 00 mv r11,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);
8010c70: 28 41 00 0c lw r1,(r2+12)
8010c74: 34 02 00 08 mvi r2,8
8010c78: 34 2c 00 02 addi r12,r1,2
8010c7c: 40 21 00 02 lbu r1,(r1+2)
8010c80: fb ff c2 18 calli 80014e0 <__ashlsi3>
8010c84: 41 82 00 01 lbu r2,(r12+1)
uint16_t mode = rtems_rfs_inode_get_mode (inode);
loc->handlers = NULL;
8010c88: 59 60 00 10 sw (r11+16),r0
8010c8c: b8 22 10 00 or r2,r1,r2
8010c90: 20 42 ff ff andi r2,r2,0xffff
if (RTEMS_RFS_S_ISDIR (mode))
8010c94: 20 43 f0 00 andi r3,r2,0xf000
8010c98: 34 01 40 00 mvi r1,16384
8010c9c: 5c 61 00 04 bne r3,r1,8010cac <rtems_rfs_rtems_set_handlers+0x50>
loc->handlers = rtems_rfs_rtems_handlers (dir);
8010ca0: 78 01 08 03 mvhi r1,0x803
8010ca4: 38 21 92 8c ori r1,r1,0x928c
8010ca8: e0 00 00 07 bi 8010cc4 <rtems_rfs_rtems_set_handlers+0x68>
else if (RTEMS_RFS_S_ISCHR (mode) || RTEMS_RFS_S_ISBLK(mode))
8010cac: 64 64 60 00 cmpei r4,r3,24576
8010cb0: 64 61 20 00 cmpei r1,r3,8192
8010cb4: b8 81 08 00 or r1,r4,r1
8010cb8: 44 20 00 06 be r1,r0,8010cd0 <rtems_rfs_rtems_set_handlers+0x74><== ALWAYS TAKEN
loc->handlers = rtems_rfs_rtems_handlers (device);
8010cbc: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8010cc0: 38 21 92 60 ori r1,r1,0x9260 <== NOT EXECUTED
8010cc4: 59 61 00 10 sw (r11+16),r1
else
{
printf ("rtems-rfs: mode type unknown: %04x\n", mode);
return false;
}
return true;
8010cc8: 34 01 00 01 mvi r1,1
8010ccc: e0 00 00 0f bi 8010d08 <rtems_rfs_rtems_set_handlers+0xac>
loc->handlers = NULL;
if (RTEMS_RFS_S_ISDIR (mode))
loc->handlers = rtems_rfs_rtems_handlers (dir);
else if (RTEMS_RFS_S_ISCHR (mode) || RTEMS_RFS_S_ISBLK(mode))
loc->handlers = rtems_rfs_rtems_handlers (device);
else if (RTEMS_RFS_S_ISLNK (mode))
8010cd0: 38 01 a0 00 mvu r1,0xa000
8010cd4: 5c 61 00 04 bne r3,r1,8010ce4 <rtems_rfs_rtems_set_handlers+0x88>
loc->handlers = rtems_rfs_rtems_handlers (link);
8010cd8: 78 01 08 03 mvhi r1,0x803
8010cdc: 38 21 6f e0 ori r1,r1,0x6fe0
8010ce0: e3 ff ff f9 bi 8010cc4 <rtems_rfs_rtems_set_handlers+0x68>
else if (RTEMS_RFS_S_ISREG (mode))
8010ce4: 38 01 80 00 mvu r1,0x8000
8010ce8: 5c 61 00 04 bne r3,r1,8010cf8 <rtems_rfs_rtems_set_handlers+0x9c><== NEVER TAKEN
loc->handlers = rtems_rfs_rtems_handlers (file);
8010cec: 78 01 08 03 mvhi r1,0x803
8010cf0: 38 21 92 b8 ori r1,r1,0x92b8
8010cf4: e3 ff ff f4 bi 8010cc4 <rtems_rfs_rtems_set_handlers+0x68>
else
{
printf ("rtems-rfs: mode type unknown: %04x\n", mode);
8010cf8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8010cfc: 38 21 70 68 ori r1,r1,0x7068 <== NOT EXECUTED
8010d00: f8 00 46 5d calli 8022674 <printf> <== NOT EXECUTED
return false;
8010d04: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
}
return true;
}
8010d08: 2b 9d 00 04 lw ra,(sp+4)
8010d0c: 2b 8b 00 0c lw r11,(sp+12)
8010d10: 2b 8c 00 08 lw r12,(sp+8)
8010d14: 37 9c 00 0c addi sp,sp,12
8010d18: c3 a0 00 00 ret
0800f8cc <rtems_rfs_rtems_statvfs>:
* @return int
*/
static int
rtems_rfs_rtems_statvfs (const rtems_filesystem_location_info_t* pathloc,
struct statvfs* sb)
{
800f8cc: 37 9c ff ec addi sp,sp,-20 <== NOT EXECUTED
800f8d0: 5b 8b 00 0c sw (sp+12),r11 <== NOT EXECUTED
800f8d4: 5b 8c 00 08 sw (sp+8),r12 <== NOT EXECUTED
800f8d8: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
800f8dc: 28 21 00 14 lw r1,(r1+20) <== NOT EXECUTED
* @return int
*/
static int
rtems_rfs_rtems_statvfs (const rtems_filesystem_location_info_t* pathloc,
struct statvfs* sb)
{
800f8e0: b8 40 58 00 mv r11,r2 <== 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);
800f8e4: 37 83 00 10 addi r3,sp,16 <== NOT EXECUTED
*/
static int
rtems_rfs_rtems_statvfs (const rtems_filesystem_location_info_t* pathloc,
struct statvfs* sb)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
800f8e8: 28 2c 00 08 lw r12,(r1+8) <== NOT EXECUTED
size_t blocks;
size_t inodes;
rtems_rfs_group_usage (fs, &blocks, &inodes);
800f8ec: 37 82 00 14 addi r2,sp,20 <== NOT EXECUTED
800f8f0: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800f8f4: fb ff fc c4 calli 800ec04 <rtems_rfs_group_usage> <== NOT EXECUTED
sb->f_bsize = rtems_rfs_fs_block_size (fs);
800f8f8: 29 81 00 08 lw r1,(r12+8) <== NOT EXECUTED
800f8fc: 59 61 00 00 sw (r11+0),r1 <== NOT EXECUTED
sb->f_frsize = rtems_rfs_fs_media_block_size (fs);
800f900: 29 81 00 10 lw r1,(r12+16) <== NOT EXECUTED
800f904: 28 22 00 20 lw r2,(r1+32) <== NOT EXECUTED
sb->f_blocks = rtems_rfs_fs_media_blocks (fs);
800f908: 28 21 00 1c lw r1,(r1+28) <== NOT EXECUTED
800f90c: 59 60 00 08 sw (r11+8),r0 <== NOT EXECUTED
size_t inodes;
rtems_rfs_group_usage (fs, &blocks, &inodes);
sb->f_bsize = rtems_rfs_fs_block_size (fs);
sb->f_frsize = rtems_rfs_fs_media_block_size (fs);
800f910: 59 62 00 04 sw (r11+4),r2 <== NOT EXECUTED
sb->f_blocks = rtems_rfs_fs_media_blocks (fs);
800f914: 59 61 00 0c sw (r11+12),r1 <== NOT EXECUTED
sb->f_bfree = rtems_rfs_fs_blocks (fs) - blocks;
800f918: 29 82 00 04 lw r2,(r12+4) <== NOT EXECUTED
800f91c: 2b 81 00 14 lw r1,(sp+20) <== NOT EXECUTED
800f920: 59 60 00 10 sw (r11+16),r0 <== NOT EXECUTED
sb->f_bavail = sb->f_bfree;
800f924: 59 60 00 18 sw (r11+24),r0 <== 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;
800f928: c8 41 08 00 sub r1,r2,r1 <== NOT EXECUTED
800f92c: 59 61 00 14 sw (r11+20),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;
800f930: 2b 82 00 10 lw r2,(sp+16) <== NOT EXECUTED
sb->f_bsize = rtems_rfs_fs_block_size (fs);
sb->f_frsize = rtems_rfs_fs_media_block_size (fs);
sb->f_blocks = rtems_rfs_fs_media_blocks (fs);
sb->f_bfree = rtems_rfs_fs_blocks (fs) - blocks;
sb->f_bavail = sb->f_bfree;
800f934: 59 61 00 1c sw (r11+28),r1 <== NOT EXECUTED
sb->f_files = rtems_rfs_fs_inodes (fs);
800f938: 29 81 00 14 lw r1,(r12+20) <== NOT EXECUTED
800f93c: 59 61 00 20 sw (r11+32),r1 <== NOT EXECUTED
sb->f_ffree = rtems_rfs_fs_inodes (fs) - inodes;
800f940: c8 22 08 00 sub r1,r1,r2 <== NOT EXECUTED
sb->f_favail = sb->f_ffree;
sb->f_fsid = RTEMS_RFS_SB_MAGIC;
800f944: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
800f948: 38 42 6f 50 ori r2,r2,0x6f50 <== 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;
800f94c: 59 61 00 24 sw (r11+36),r1 <== NOT EXECUTED
sb->f_favail = sb->f_ffree;
800f950: 59 61 00 28 sw (r11+40),r1 <== NOT EXECUTED
sb->f_fsid = RTEMS_RFS_SB_MAGIC;
800f954: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED
800f958: 59 61 00 2c sw (r11+44),r1 <== NOT EXECUTED
sb->f_flag = rtems_rfs_fs_flags (fs);
800f95c: 29 81 00 00 lw r1,(r12+0) <== NOT EXECUTED
800f960: 59 61 00 30 sw (r11+48),r1 <== NOT EXECUTED
sb->f_namemax = rtems_rfs_fs_max_name (fs);
800f964: 29 81 00 1c lw r1,(r12+28) <== NOT EXECUTED
800f968: 59 61 00 34 sw (r11+52),r1 <== NOT EXECUTED
return 0;
}
800f96c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
800f970: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
800f974: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED
800f978: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED
800f97c: 37 9c 00 14 addi sp,sp,20 <== NOT EXECUTED
800f980: c3 a0 00 00 ret <== NOT EXECUTED
0800fb44 <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)
{
800fb44: 37 9c ff e0 addi sp,sp,-32
800fb48: 5b 8b 00 14 sw (sp+20),r11
800fb4c: 5b 8c 00 10 sw (sp+16),r12
800fb50: 5b 8d 00 0c sw (sp+12),r13
800fb54: 5b 8e 00 08 sw (sp+8),r14
800fb58: 5b 9d 00 04 sw (sp+4),ra
800fb5c: b8 20 28 00 mv r5,r1
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parent_loc);
800fb60: 28 21 00 14 lw r1,(r1+20)
rtems_rfs_ino parent = rtems_rfs_rtems_get_pathloc_ino (parent_loc);
800fb64: 28 ab 00 08 lw r11,(r5+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);
800fb68: 28 2e 00 08 lw r14,(r1+8)
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),
800fb6c: b8 80 08 00 mv r1,r4
800fb70: 5b 82 00 20 sw (sp+32),r2
800fb74: 5b 83 00 1c sw (sp+28),r3
800fb78: 5b 84 00 18 sw (sp+24),r4
800fb7c: f8 00 4f 9a calli 80239e4 <strlen>
800fb80: b8 20 68 00 mv r13,r1
geteuid(), getegid(), parent);
800fb84: f8 00 14 a7 calli 8014e20 <geteuid>
800fb88: b8 20 60 00 mv r12,r1
800fb8c: f8 00 14 a0 calli 8014e0c <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,
800fb90: 2b 82 00 20 lw r2,(sp+32)
800fb94: 2b 83 00 1c lw r3,(sp+28)
800fb98: 2b 84 00 18 lw r4,(sp+24)
target, strlen (target),
geteuid(), getegid(), parent);
800fb9c: b8 20 38 00 mv r7,r1
{
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,
800fba0: b9 60 40 00 mv r8,r11
800fba4: b9 c0 08 00 mv r1,r14
800fba8: b9 a0 28 00 mv r5,r13
800fbac: b9 80 30 00 mv r6,r12
800fbb0: f8 00 3a 40 calli 801e4b0 <rtems_rfs_symlink>
800fbb4: b8 20 58 00 mv r11,r1
if (rc)
{
return rtems_rfs_rtems_error ("symlink: linking", rc);
}
return 0;
800fbb8: 34 01 00 00 mvi r1,0
int rc;
rc = rtems_rfs_symlink (fs, node_name, node_name_len,
target, strlen (target),
geteuid(), getegid(), parent);
if (rc)
800fbbc: 45 60 00 04 be r11,r0,800fbcc <rtems_rfs_rtems_symlink+0x88><== ALWAYS TAKEN
{
return rtems_rfs_rtems_error ("symlink: linking", rc);
800fbc0: f8 00 44 52 calli 8020d08 <__errno> <== NOT EXECUTED
800fbc4: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
800fbc8: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
}
return 0;
}
800fbcc: 2b 9d 00 04 lw ra,(sp+4)
800fbd0: 2b 8b 00 14 lw r11,(sp+20)
800fbd4: 2b 8c 00 10 lw r12,(sp+16)
800fbd8: 2b 8d 00 0c lw r13,(sp+12)
800fbdc: 2b 8e 00 08 lw r14,(sp+8)
800fbe0: 37 9c 00 20 addi sp,sp,32
800fbe4: c3 a0 00 00 ret
0800ff4c <rtems_rfs_rtems_unlock>:
/**
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
800ff4c: 37 9c ff f8 addi sp,sp,-8
800ff50: 5b 8b 00 08 sw (sp+8),r11
800ff54: 5b 9d 00 04 sw (sp+4),ra
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
800ff58: 28 2b 00 80 lw r11,(r1+128)
rtems_rfs_buffers_release (fs);
800ff5c: f8 00 2b e6 calli 801aef4 <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);
800ff60: 29 61 00 00 lw r1,(r11+0)
800ff64: fb ff e5 42 calli 800946c <rtems_semaphore_release>
800ff68: b8 20 58 00 mv r11,r1
if (sc != RTEMS_SUCCESSFUL)
800ff6c: 44 20 00 0b be r1,r0,800ff98 <rtems_rfs_rtems_unlock+0x4c> <== ALWAYS TAKEN
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
800ff70: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
800ff74: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
800ff78: f8 00 03 6c calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
800ff7c: 44 20 00 07 be r1,r0,800ff98 <rtems_rfs_rtems_unlock+0x4c> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
800ff80: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800ff84: f8 00 12 b3 calli 8014a50 <rtems_status_text> <== NOT EXECUTED
800ff88: b8 20 10 00 mv r2,r1 <== NOT EXECUTED
800ff8c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
800ff90: 38 21 6f 54 ori r1,r1,0x6f54 <== NOT EXECUTED
800ff94: f8 00 49 b8 calli 8022674 <printf> <== NOT EXECUTED
rtems_rfs_mutex_unlock (&rtems->access);
}
800ff98: 2b 9d 00 04 lw ra,(sp+4)
800ff9c: 2b 8b 00 08 lw r11,(sp+8)
800ffa0: 37 9c 00 08 addi sp,sp,8
800ffa4: c3 a0 00 00 ret
0800fbe8 <rtems_rfs_rtems_utime>:
static int
rtems_rfs_rtems_utime(const rtems_filesystem_location_info_t* pathloc,
time_t atime,
time_t mtime)
{
800fbe8: 37 9c ff c0 addi sp,sp,-64 <== NOT EXECUTED
800fbec: 5b 8b 00 18 sw (sp+24),r11 <== NOT EXECUTED
800fbf0: 5b 8c 00 14 sw (sp+20),r12 <== NOT EXECUTED
800fbf4: 5b 8d 00 10 sw (sp+16),r13 <== NOT EXECUTED
800fbf8: 5b 8e 00 0c sw (sp+12),r14 <== NOT EXECUTED
800fbfc: 5b 8f 00 08 sw (sp+8),r15 <== NOT EXECUTED
800fc00: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
800fc04: b8 20 20 00 mv r4,r1 <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
800fc08: 28 21 00 14 lw r1,(r1+20) <== NOT EXECUTED
static int
rtems_rfs_rtems_utime(const rtems_filesystem_location_info_t* pathloc,
time_t atime,
time_t mtime)
{
800fc0c: b8 40 60 00 mv r12,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);
800fc10: 28 82 00 08 lw r2,(r4+8) <== NOT EXECUTED
static int
rtems_rfs_rtems_utime(const rtems_filesystem_location_info_t* pathloc,
time_t atime,
time_t mtime)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
800fc14: 28 2e 00 08 lw r14,(r1+8) <== NOT EXECUTED
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);
800fc18: 37 8d 00 1c addi r13,sp,28 <== NOT EXECUTED
static int
rtems_rfs_rtems_utime(const rtems_filesystem_location_info_t* pathloc,
time_t atime,
time_t mtime)
{
800fc1c: b8 60 58 00 mv r11,r3 <== 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);
800fc20: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
800fc24: b9 a0 18 00 mv r3,r13 <== NOT EXECUTED
800fc28: 34 04 00 01 mvi r4,1 <== NOT EXECUTED
800fc2c: fb ff fc 5b calli 800ed98 <rtems_rfs_inode_open> <== NOT EXECUTED
800fc30: b8 20 78 00 mv r15,r1 <== NOT EXECUTED
if (rc)
800fc34: 44 20 00 04 be r1,r0,800fc44 <rtems_rfs_rtems_utime+0x5c> <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("utime: read inode", rc);
800fc38: f8 00 44 34 calli 8020d08 <__errno> <== NOT EXECUTED
800fc3c: 58 2f 00 00 sw (r1+0),r15 <== NOT EXECUTED
800fc40: e0 00 00 2d bi 800fcf4 <rtems_rfs_rtems_utime+0x10c> <== 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);
800fc44: 34 02 00 18 mvi r2,24 <== NOT EXECUTED
800fc48: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800fc4c: fb ff c6 4c calli 800157c <__lshrsi3> <== NOT EXECUTED
800fc50: 2b 82 00 28 lw r2,(sp+40) <== NOT EXECUTED
800fc54: 30 41 00 10 sb (r2+16),r1 <== NOT EXECUTED
800fc58: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
800fc5c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800fc60: fb ff c6 47 calli 800157c <__lshrsi3> <== NOT EXECUTED
800fc64: 2b 82 00 28 lw r2,(sp+40) <== NOT EXECUTED
800fc68: 30 41 00 11 sb (r2+17),r1 <== NOT EXECUTED
800fc6c: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
800fc70: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
800fc74: fb ff c6 42 calli 800157c <__lshrsi3> <== NOT EXECUTED
800fc78: 2b 82 00 28 lw r2,(sp+40) <== NOT EXECUTED
800fc7c: 30 41 00 12 sb (r2+18),r1 <== NOT EXECUTED
800fc80: 2b 81 00 28 lw r1,(sp+40) <== 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);
800fc84: 34 02 00 18 mvi r2,24 <== 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);
800fc88: 30 2c 00 13 sb (r1+19),r12 <== 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);
800fc8c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800fc90: fb ff c6 3b calli 800157c <__lshrsi3> <== NOT EXECUTED
800fc94: 2b 82 00 28 lw r2,(sp+40) <== NOT EXECUTED
800fc98: 30 41 00 14 sb (r2+20),r1 <== NOT EXECUTED
800fc9c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800fca0: 34 02 00 10 mvi r2,16 <== NOT EXECUTED
800fca4: fb ff c6 36 calli 800157c <__lshrsi3> <== NOT EXECUTED
800fca8: 2b 82 00 28 lw r2,(sp+40) <== NOT EXECUTED
800fcac: 30 41 00 15 sb (r2+21),r1 <== NOT EXECUTED
800fcb0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
800fcb4: 34 02 00 08 mvi r2,8 <== NOT EXECUTED
800fcb8: fb ff c6 31 calli 800157c <__lshrsi3> <== NOT EXECUTED
800fcbc: 2b 82 00 28 lw r2,(sp+40) <== NOT EXECUTED
800fcc0: 30 41 00 16 sb (r2+22),r1 <== NOT EXECUTED
800fcc4: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED
}
rtems_rfs_inode_set_atime (&inode, atime);
rtems_rfs_inode_set_mtime (&inode, mtime);
rc = rtems_rfs_inode_close (fs, &inode);
800fcc8: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
800fccc: 30 2b 00 17 sb (r1+23),r11 <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (&handle->buffer);
800fcd0: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
800fcd4: 33 81 00 2c sb (sp+44),r1 <== NOT EXECUTED
800fcd8: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
800fcdc: fb ff fc bb calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
800fce0: b8 20 58 00 mv r11,r1 <== NOT EXECUTED
if (rc)
{
return rtems_rfs_rtems_error ("utime: closing inode", rc);
}
return 0;
800fce4: 34 01 00 00 mvi r1,0 <== 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)
800fce8: 45 61 00 04 be r11,r1,800fcf8 <rtems_rfs_rtems_utime+0x110><== NOT EXECUTED
{
return rtems_rfs_rtems_error ("utime: closing inode", rc);
800fcec: f8 00 44 07 calli 8020d08 <__errno> <== NOT EXECUTED
800fcf0: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED
800fcf4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
}
return 0;
}
800fcf8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
800fcfc: 2b 8b 00 18 lw r11,(sp+24) <== NOT EXECUTED
800fd00: 2b 8c 00 14 lw r12,(sp+20) <== NOT EXECUTED
800fd04: 2b 8d 00 10 lw r13,(sp+16) <== NOT EXECUTED
800fd08: 2b 8e 00 0c lw r14,(sp+12) <== NOT EXECUTED
800fd0c: 2b 8f 00 08 lw r15,(sp+8) <== NOT EXECUTED
800fd10: 37 9c 00 40 addi sp,sp,64 <== NOT EXECUTED
800fd14: c3 a0 00 00 ret <== NOT EXECUTED
0801a7b0 <rtems_rfs_scan_chain>:
*/
static rtems_rfs_buffer*
rtems_rfs_scan_chain (rtems_chain_control* chain,
uint32_t* count,
rtems_rfs_buffer_block block)
{
801a7b0: 37 9c ff e4 addi sp,sp,-28
801a7b4: 5b 8b 00 1c sw (sp+28),r11
801a7b8: 5b 8c 00 18 sw (sp+24),r12
801a7bc: 5b 8d 00 14 sw (sp+20),r13
801a7c0: 5b 8e 00 10 sw (sp+16),r14
801a7c4: 5b 8f 00 0c sw (sp+12),r15
801a7c8: 5b 90 00 08 sw (sp+8),r16
801a7cc: 5b 9d 00 04 sw (sp+4),ra
801a7d0: b8 20 78 00 mv r15,r1
801a7d4: b8 40 60 00 mv r12,r2
true);
if ((rc > 0) && (rrc == 0))
rrc = rc;
return rrc;
}
801a7d8: 28 2b 00 08 lw r11,(r1+8)
rtems_rfs_buffer* buffer;
rtems_chain_node* node;
node = rtems_chain_last (chain);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
801a7dc: 34 02 00 80 mvi r2,128
801a7e0: 34 01 00 00 mvi r1,0
*/
static rtems_rfs_buffer*
rtems_rfs_scan_chain (rtems_chain_control* chain,
uint32_t* count,
rtems_rfs_buffer_block block)
{
801a7e4: b8 60 80 00 mv r16,r3
rtems_rfs_buffer* buffer;
rtems_chain_node* node;
node = rtems_chain_last (chain);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
801a7e8: fb ff d9 50 calli 8010d28 <rtems_rfs_trace>
801a7ec: 44 20 00 23 be r1,r0,801a878 <rtems_rfs_scan_chain+0xc8> <== ALWAYS TAKEN
printf ("rtems-rfs: buffer-scan: count=%" PRIu32 ", block=%" PRIu32 ": ", *count, block);
801a7f0: 29 82 00 00 lw r2,(r12+0) <== NOT EXECUTED
801a7f4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801a7f8: ba 00 18 00 mv r3,r16 <== NOT EXECUTED
801a7fc: 38 21 7d b8 ori r1,r1,0x7db8 <== NOT EXECUTED
801a800: f8 00 1f 9d calli 8022674 <printf> <== NOT EXECUTED
801a804: e0 00 00 1d bi 801a878 <rtems_rfs_scan_chain+0xc8> <== NOT EXECUTED
while (!rtems_chain_is_head (chain, node))
{
buffer = (rtems_rfs_buffer*) node;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
801a808: 34 01 00 00 mvi r1,0
801a80c: 34 02 00 80 mvi r2,128
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))
{
buffer = (rtems_rfs_buffer*) node;
801a810: b9 60 70 00 mv r14,r11
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
801a814: fb ff d9 45 calli 8010d28 <rtems_rfs_trace>
801a818: 44 20 00 04 be r1,r0,801a828 <rtems_rfs_scan_chain+0x78> <== ALWAYS TAKEN
printf ("%" PRIuPTR " ", ((intptr_t) buffer->user));
801a81c: 29 62 00 34 lw r2,(r11+52) <== NOT EXECUTED
801a820: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
801a824: f8 00 1f 94 calli 8022674 <printf> <== NOT EXECUTED
if (((rtems_rfs_buffer_block) ((intptr_t)(buffer->user))) == block)
801a828: 29 61 00 34 lw r1,(r11+52)
801a82c: 5c 30 00 11 bne r1,r16,801a870 <rtems_rfs_scan_chain+0xc0>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
801a830: 34 01 00 00 mvi r1,0
801a834: 34 02 00 80 mvi r2,128
801a838: fb ff d9 3c calli 8010d28 <rtems_rfs_trace>
801a83c: 44 20 00 05 be r1,r0,801a850 <rtems_rfs_scan_chain+0xa0> <== ALWAYS TAKEN
printf (": found block=%" PRIuPTR "\n",
801a840: 29 62 00 34 lw r2,(r11+52) <== NOT EXECUTED
801a844: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801a848: 38 21 7d ec ori r1,r1,0x7dec <== NOT EXECUTED
801a84c: f8 00 1f 8a calli 8022674 <printf> <== NOT EXECUTED
((intptr_t)(buffer->user)));
(*count)--;
801a850: 29 81 00 00 lw r1,(r12+0)
801a854: 34 21 ff ff addi r1,r1,-1
801a858: 59 81 00 00 sw (r12+0),r1
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
801a85c: b9 60 08 00 mv r1,r11
801a860: fb ff f1 6f calli 8016e1c <_Chain_Extract>
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
801a864: 59 60 00 04 sw (r11+4),r0
801a868: 59 60 00 00 sw (r11+0),r0
rtems_chain_extract (node);
rtems_chain_set_off_chain (node);
return buffer;
801a86c: e0 00 00 0e bi 801a8a4 <rtems_rfs_scan_chain+0xf4>
true);
if ((rc > 0) && (rrc == 0))
rrc = rc;
return rrc;
}
801a870: 29 6b 00 04 lw r11,(r11+4)
801a874: e0 00 00 03 bi 801a880 <rtems_rfs_scan_chain+0xd0>
while (!rtems_chain_is_head (chain, node))
{
buffer = (rtems_rfs_buffer*) node;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
printf ("%" PRIuPTR " ", ((intptr_t) buffer->user));
801a878: 78 0d 08 03 mvhi r13,0x803
801a87c: 39 ad 7d e8 ori r13,r13,0x7de8
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))
801a880: 5d 6f ff e2 bne r11,r15,801a808 <rtems_rfs_scan_chain+0x58>
return buffer;
}
node = rtems_chain_previous (node);
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
801a884: 34 01 00 00 mvi r1,0
801a888: 34 02 00 80 mvi r2,128
801a88c: fb ff d9 27 calli 8010d28 <rtems_rfs_trace>
printf (": not found\n");
return NULL;
801a890: 34 0e 00 00 mvi r14,0
return buffer;
}
node = rtems_chain_previous (node);
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
801a894: 44 20 00 04 be r1,r0,801a8a4 <rtems_rfs_scan_chain+0xf4> <== ALWAYS TAKEN
printf (": not found\n");
801a898: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801a89c: 38 21 7e 00 ori r1,r1,0x7e00 <== NOT EXECUTED
801a8a0: f8 00 20 3d calli 8022994 <puts> <== NOT EXECUTED
return NULL;
}
801a8a4: b9 c0 08 00 mv r1,r14
801a8a8: 2b 9d 00 04 lw ra,(sp+4)
801a8ac: 2b 8b 00 1c lw r11,(sp+28)
801a8b0: 2b 8c 00 18 lw r12,(sp+24)
801a8b4: 2b 8d 00 14 lw r13,(sp+20)
801a8b8: 2b 8e 00 10 lw r14,(sp+16)
801a8bc: 2b 8f 00 0c lw r15,(sp+12)
801a8c0: 2b 90 00 08 lw r16,(sp+8)
801a8c4: 37 9c 00 1c addi sp,sp,28
801a8c8: c3 a0 00 00 ret
08018828 <rtems_rfs_search_map_for_clear_bit.clone.0>:
return 0;
}
static int
rtems_rfs_search_map_for_clear_bit (rtems_rfs_bitmap_control* control,
8018828: 37 9c ff ac addi sp,sp,-84
801882c: 5b 8b 00 44 sw (sp+68),r11
8018830: 5b 8c 00 40 sw (sp+64),r12
8018834: 5b 8d 00 3c sw (sp+60),r13
8018838: 5b 8e 00 38 sw (sp+56),r14
801883c: 5b 8f 00 34 sw (sp+52),r15
8018840: 5b 90 00 30 sw (sp+48),r16
8018844: 5b 91 00 2c sw (sp+44),r17
8018848: 5b 92 00 28 sw (sp+40),r18
801884c: 5b 93 00 24 sw (sp+36),r19
8018850: 5b 94 00 20 sw (sp+32),r20
8018854: 5b 95 00 1c sw (sp+28),r21
8018858: 5b 96 00 18 sw (sp+24),r22
801885c: 5b 97 00 14 sw (sp+20),r23
8018860: 5b 98 00 10 sw (sp+16),r24
8018864: 5b 99 00 0c sw (sp+12),r25
8018868: 5b 9b 00 08 sw (sp+8),fp
801886c: 5b 9d 00 04 sw (sp+4),ra
8018870: b8 40 b8 00 mv r23,r2
rtems_rfs_bitmap_element* map_bits;
int map_index;
int map_offset;
int rc;
*found = false;
8018874: 30 60 00 00 sb (r3+0),r0
/*
* Load the bitmap.
*/
rc = rtems_rfs_bitmap_load_map (control, &map);
8018878: 37 82 00 54 addi r2,sp,84
return 0;
}
static int
rtems_rfs_search_map_for_clear_bit (rtems_rfs_bitmap_control* control,
801887c: b8 20 88 00 mv r17,r1
8018880: b8 60 b0 00 mv r22,r3
8018884: b8 80 60 00 mv r12,r4
*found = false;
/*
* Load the bitmap.
*/
rc = rtems_rfs_bitmap_load_map (control, &map);
8018888: fb ff ff d0 calli 80187c8 <rtems_rfs_bitmap_load_map>
if (rc > 0)
801888c: 48 20 00 95 bg r1,r0,8018ae0 <rtems_rfs_search_map_for_clear_bit.clone.0+0x2b8><== NEVER TAKEN
return rc;
/*
* Calculate the bit we are testing plus the end point we search over.
*/
test_bit = *bit;
8018890: 2a eb 00 00 lw r11,(r23+0)
end_bit = test_bit + (window * direction);
8018894: b9 80 08 00 mv r1,r12
8018898: 34 02 00 0b mvi r2,11
801889c: fb ff a3 11 calli 80014e0 <__ashlsi3>
80188a0: b4 2b 70 00 add r14,r1,r11
if (end_bit < 0)
80188a4: 48 0e 00 05 bg r0,r14,80188b8 <rtems_rfs_search_map_for_clear_bit.clone.0+0x90>
end_bit = 0;
else if (end_bit >= control->size)
80188a8: 2a 21 00 0c lw r1,(r17+12)
80188ac: 54 2e 00 04 bgu r1,r14,80188bc <rtems_rfs_search_map_for_clear_bit.clone.0+0x94>
end_bit = control->size - 1;
80188b0: 34 2e ff ff addi r14,r1,-1
80188b4: e0 00 00 02 bi 80188bc <rtems_rfs_search_map_for_clear_bit.clone.0+0x94>
*/
test_bit = *bit;
end_bit = test_bit + (window * direction);
if (end_bit < 0)
end_bit = 0;
80188b8: 34 0e 00 00 mvi r14,0
else if (end_bit >= control->size)
end_bit = control->size - 1;
map_index = rtems_rfs_bitmap_map_index (test_bit);
80188bc: 34 02 00 05 mvi r2,5
80188c0: b9 60 08 00 mv r1,r11
80188c4: f8 00 6e 10 calli 8034104 <__ashrsi3>
map_offset = rtems_rfs_bitmap_map_offset (test_bit);
search_index = rtems_rfs_bitmap_map_index (map_index);
80188c8: 34 02 00 05 mvi r2,5
if (end_bit < 0)
end_bit = 0;
else if (end_bit >= control->size)
end_bit = control->size - 1;
map_index = rtems_rfs_bitmap_map_index (test_bit);
80188cc: b8 20 78 00 mv r15,r1
map_offset = rtems_rfs_bitmap_map_offset (test_bit);
search_index = rtems_rfs_bitmap_map_index (map_index);
search_offset = rtems_rfs_bitmap_map_offset (map_index);
80188d0: 20 2d 00 1f andi r13,r1,0x1f
else if (end_bit >= control->size)
end_bit = control->size - 1;
map_index = rtems_rfs_bitmap_map_index (test_bit);
map_offset = rtems_rfs_bitmap_map_offset (test_bit);
search_index = rtems_rfs_bitmap_map_index (map_index);
80188d4: f8 00 6e 0c calli 8034104 <__ashrsi3>
search_offset = rtems_rfs_bitmap_map_offset (map_index);
search_bits = &control->search_bits[search_index];
80188d8: 34 02 00 02 mvi r2,2
80188dc: fb ff a3 01 calli 80014e0 <__ashlsi3>
80188e0: 2a 32 00 14 lw r18,(r17+20)
map_bits = &map[map_index];
80188e4: 34 02 00 02 mvi r2,2
end_bit = 0;
else if (end_bit >= control->size)
end_bit = control->size - 1;
map_index = rtems_rfs_bitmap_map_index (test_bit);
map_offset = rtems_rfs_bitmap_map_offset (test_bit);
80188e8: 21 70 00 1f andi r16,r11,0x1f
search_index = rtems_rfs_bitmap_map_index (map_index);
search_offset = rtems_rfs_bitmap_map_offset (map_index);
search_bits = &control->search_bits[search_index];
80188ec: b6 41 90 00 add r18,r18,r1
map_bits = &map[map_index];
80188f0: b9 e0 08 00 mv r1,r15
80188f4: fb ff a2 fb calli 80014e0 <__ashlsi3>
80188f8: 2b 93 00 54 lw r19,(sp+84)
map_offset += direction;
test_bit += direction;
}
}
map_bits += direction;
80188fc: 34 02 00 02 mvi r2,2
map_offset = rtems_rfs_bitmap_map_offset (test_bit);
search_index = rtems_rfs_bitmap_map_index (map_index);
search_offset = rtems_rfs_bitmap_map_offset (map_index);
search_bits = &control->search_bits[search_index];
map_bits = &map[map_index];
8018900: b6 61 98 00 add r19,r19,r1
map_offset += direction;
test_bit += direction;
}
}
map_bits += direction;
8018904: b9 80 08 00 mv r1,r12
8018908: fb ff a2 f6 calli 80014e0 <__ashlsi3>
801890c: 5b 81 00 48 sw (sp+72),r1
map_index += direction;
map_offset = direction > 0 ? 0 : rtems_rfs_bitmap_element_bits () - 1;
8018910: ec 0c 08 00 cmpge r1,r0,r12
test_bit = (map_index * rtems_rfs_bitmap_element_bits ()) + map_offset;
search_offset += direction;
if (((direction < 0) && (test_bit <= end_bit))
|| ((direction > 0) && (test_bit >= end_bit)))
8018914: 69 9b 00 00 cmpgi fp,r12,0
}
}
map_bits += direction;
map_index += direction;
map_offset = direction > 0 ? 0 : rtems_rfs_bitmap_element_bits () - 1;
8018918: c8 01 08 00 sub r1,r0,r1
801891c: 20 21 00 1f andi r1,r1,0x1f
8018920: 5b 81 00 4c sw (sp+76),r1
8018924: e0 00 00 03 bi 8018930 <rtems_rfs_search_map_for_clear_bit.clone.0+0x108>
}
map_bits += direction * bits_skipped;
map_index += direction * bits_skipped;
}
search_bits += direction;
8018928: 2b 81 00 48 lw r1,(sp+72)
801892c: b6 41 90 00 add r18,r18,r1
/*
* If any bit is clear find that bit and then search the map element. If
* all bits are set there are no map bits so move to the next search
* element.
*/
if (!rtems_rfs_bitmap_match (*search_bits, RTEMS_RFS_BITMAP_ELEMENT_SET))
8018930: 2a 54 00 00 lw r20,(r18+0)
8018934: 46 80 00 42 be r20,r0,8018a3c <rtems_rfs_search_map_for_clear_bit.clone.0+0x214><== NEVER TAKEN
return 0;
}
static int
rtems_rfs_search_map_for_clear_bit (rtems_rfs_bitmap_control* control,
8018938: 34 02 00 05 mvi r2,5
801893c: b9 80 08 00 mv r1,r12
8018940: fb ff a2 e8 calli 80014e0 <__ashlsi3>
8018944: 5b 81 00 50 sw (sp+80),r1
8018948: 34 02 00 05 mvi r2,5
801894c: b5 ec 08 00 add r1,r15,r12
8018950: fb ff a2 e4 calli 80014e0 <__ashlsi3>
8018954: b8 20 a8 00 mv r21,r1
8018958: e0 00 00 36 bi 8018a30 <rtems_rfs_search_map_for_clear_bit.clone.0+0x208>
*/
static bool
rtems_rfs_bitmap_test (rtems_rfs_bitmap_element target,
rtems_rfs_bitmap_bit bit)
{
return RTEMS_RFS_BITMAP_TEST_BIT (target, bit);
801895c: 34 01 00 01 mvi r1,1
8018960: b9 a0 10 00 mv r2,r13
8018964: fb ff a2 df calli 80014e0 <__ashlsi3>
8018968: b8 20 c0 00 mv r24,r1
801896c: a0 34 08 00 and r1,r1,r20
if (!rtems_rfs_bitmap_match (*search_bits, RTEMS_RFS_BITMAP_ELEMENT_SET))
{
while ((search_offset >= 0)
&& (search_offset < rtems_rfs_bitmap_element_bits ()))
{
if (!rtems_rfs_bitmap_test (*search_bits, search_offset))
8018970: 44 20 00 1f be r1,r0,80189ec <rtems_rfs_search_map_for_clear_bit.clone.0+0x1c4>
8018974: e0 00 00 1c bi 80189e4 <rtems_rfs_search_map_for_clear_bit.clone.0+0x1bc>
* found. We may find none are spare if searching up from the seed.
*/
while ((map_offset >= 0)
&& (map_offset < rtems_rfs_bitmap_element_bits ()))
{
if (!rtems_rfs_bitmap_test (*map_bits, map_offset))
8018978: 2a 79 00 00 lw r25,(r19+0)
*/
static bool
rtems_rfs_bitmap_test (rtems_rfs_bitmap_element target,
rtems_rfs_bitmap_bit bit)
{
return RTEMS_RFS_BITMAP_TEST_BIT (target, bit);
801897c: 34 01 00 01 mvi r1,1
8018980: ba 00 10 00 mv r2,r16
8018984: fb ff a2 d7 calli 80014e0 <__ashlsi3>
8018988: b8 20 20 00 mv r4,r1
801898c: a0 39 08 00 and r1,r1,r25
* found. We may find none are spare if searching up from the seed.
*/
while ((map_offset >= 0)
&& (map_offset < rtems_rfs_bitmap_element_bits ()))
{
if (!rtems_rfs_bitmap_test (*map_bits, map_offset))
8018990: 44 20 00 12 be r1,r0,80189d8 <rtems_rfs_search_map_for_clear_bit.clone.0+0x1b0>
*/
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);
8018994: a4 80 20 00 not r4,r4
8018998: a0 99 20 00 and r4,r4,r25
while ((map_offset >= 0)
&& (map_offset < rtems_rfs_bitmap_element_bits ()))
{
if (!rtems_rfs_bitmap_test (*map_bits, map_offset))
{
*map_bits = rtems_rfs_bitmap_set (*map_bits, 1 << map_offset);
801899c: 5a 64 00 00 sw (r19+0),r4
if (rtems_rfs_bitmap_match(*map_bits,
80189a0: 5c 80 00 05 bne r4,r0,80189b4 <rtems_rfs_search_map_for_clear_bit.clone.0+0x18c>
*/
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);
80189a4: 2a 41 00 00 lw r1,(r18+0)
80189a8: a7 00 c0 00 not r24,r24
80189ac: a0 38 c0 00 and r24,r1,r24
if (!rtems_rfs_bitmap_test (*map_bits, map_offset))
{
*map_bits = rtems_rfs_bitmap_set (*map_bits, 1 << map_offset);
if (rtems_rfs_bitmap_match(*map_bits,
RTEMS_RFS_BITMAP_ELEMENT_SET))
*search_bits = rtems_rfs_bitmap_set (*search_bits,
80189b0: 5a 58 00 00 sw (r18+0),r24
1 << search_offset);
control->free--;
80189b4: 2a 21 00 10 lw r1,(r17+16)
*bit = test_bit;
*found = true;
rtems_rfs_buffer_mark_dirty (control->buffer);
80189b8: 2a 22 00 00 lw r2,(r17+0)
*map_bits = rtems_rfs_bitmap_set (*map_bits, 1 << map_offset);
if (rtems_rfs_bitmap_match(*map_bits,
RTEMS_RFS_BITMAP_ELEMENT_SET))
*search_bits = rtems_rfs_bitmap_set (*search_bits,
1 << search_offset);
control->free--;
80189bc: 34 21 ff ff addi r1,r1,-1
80189c0: 5a 21 00 10 sw (r17+16),r1
*bit = test_bit;
80189c4: 5a eb 00 00 sw (r23+0),r11
*found = true;
80189c8: 34 01 00 01 mvi r1,1
80189cc: 32 c1 00 00 sb (r22+0),r1
rtems_rfs_buffer_mark_dirty (control->buffer);
80189d0: 30 41 00 00 sb (r2+0),r1
80189d4: e0 00 00 42 bi 8018adc <rtems_rfs_search_map_for_clear_bit.clone.0+0x2b4>
return 0;
}
if (test_bit == end_bit)
80189d8: 45 6e 00 05 be r11,r14,80189ec <rtems_rfs_search_map_for_clear_bit.clone.0+0x1c4>
return 0;
}
static int
rtems_rfs_search_map_for_clear_bit (rtems_rfs_bitmap_control* control,
80189dc: b6 0c 80 00 add r16,r16,r12
80189e0: b5 6c 58 00 add r11,r11,r12
{
/*
* Find the clear bit in the map. Update the search map and map if
* found. We may find none are spare if searching up from the seed.
*/
while ((map_offset >= 0)
80189e4: 34 01 00 1f mvi r1,31
80189e8: 50 30 ff e4 bgeu r1,r16,8018978 <rtems_rfs_search_map_for_clear_bit.clone.0+0x150><== ALWAYS TAKEN
}
}
map_bits += direction;
map_index += direction;
map_offset = direction > 0 ? 0 : rtems_rfs_bitmap_element_bits () - 1;
80189ec: 2b 90 00 4c lw r16,(sp+76)
map_offset += direction;
test_bit += direction;
}
}
map_bits += direction;
80189f0: 2b 81 00 48 lw r1,(sp+72)
test_bit = (map_index * rtems_rfs_bitmap_element_bits ()) + map_offset;
search_offset += direction;
if (((direction < 0) && (test_bit <= end_bit))
80189f4: 34 02 00 1f mvi r2,31
map_bits += direction;
map_index += direction;
map_offset = direction > 0 ? 0 : rtems_rfs_bitmap_element_bits () - 1;
test_bit = (map_index * rtems_rfs_bitmap_element_bits ()) + map_offset;
80189f8: b6 15 58 00 add r11,r16,r21
map_offset += direction;
test_bit += direction;
}
}
map_bits += direction;
80189fc: b6 61 98 00 add r19,r19,r1
test_bit = (map_index * rtems_rfs_bitmap_element_bits ()) + map_offset;
search_offset += direction;
if (((direction < 0) && (test_bit <= end_bit))
8018a00: ed cb c0 00 cmpge r24,r14,r11
8018a04: b9 80 08 00 mv r1,r12
8018a08: fb ff a2 dd calli 800157c <__lshrsi3>
8018a0c: a3 01 20 00 and r4,r24,r1
return 0;
}
static int
rtems_rfs_search_map_for_clear_bit (rtems_rfs_bitmap_control* control,
8018a10: b5 ec 78 00 add r15,r15,r12
test_bit = (map_index * rtems_rfs_bitmap_element_bits ()) + map_offset;
search_offset += direction;
if (((direction < 0) && (test_bit <= end_bit))
8018a14: 5c 80 00 28 bne r4,r0,8018ab4 <rtems_rfs_search_map_for_clear_bit.clone.0+0x28c>
8018a18: 2b 81 00 50 lw r1,(sp+80)
8018a1c: b6 a1 a8 00 add r21,r21,r1
|| ((direction > 0) && (test_bit >= end_bit)))
8018a20: ed 6e 08 00 cmpge r1,r11,r14
8018a24: a0 3b 08 00 and r1,r1,fp
8018a28: 5c 24 00 21 bne r1,r4,8018aac <rtems_rfs_search_map_for_clear_bit.clone.0+0x284>
return 0;
}
static int
rtems_rfs_search_map_for_clear_bit (rtems_rfs_bitmap_control* control,
8018a2c: b5 ac 68 00 add r13,r13,r12
* all bits are set there are no map bits so move to the next search
* element.
*/
if (!rtems_rfs_bitmap_match (*search_bits, RTEMS_RFS_BITMAP_ELEMENT_SET))
{
while ((search_offset >= 0)
8018a30: 34 01 00 1f mvi r1,31
8018a34: 50 2d ff ca bgeu r1,r13,801895c <rtems_rfs_search_map_for_clear_bit.clone.0+0x134>
8018a38: e0 00 00 1b bi 8018aa4 <rtems_rfs_search_map_for_clear_bit.clone.0+0x27c>
*
* Align test_bit either up or down depending on the direction to next 32
* bit boundary.
*/
rtems_rfs_bitmap_bit bits_skipped;
test_bit &= ~((1 << RTEMS_RFS_ELEMENT_BITS_POWER_2) - 1);
8018a3c: 34 01 ff e0 mvi r1,-32
8018a40: a1 61 58 00 and r11,r11,r1
if (direction > 0)
8018a44: 4e 8c 00 09 bge r20,r12,8018a68 <rtems_rfs_search_map_for_clear_bit.clone.0+0x240>
{
bits_skipped = rtems_rfs_bitmap_element_bits () - search_offset;
8018a48: 34 01 00 20 mvi r1,32
8018a4c: c8 2d a0 00 sub r20,r1,r13
test_bit += bits_skipped * rtems_rfs_bitmap_element_bits ();
8018a50: ba 80 08 00 mv r1,r20
8018a54: 34 02 00 05 mvi r2,5
8018a58: fb ff a2 a2 calli 80014e0 <__ashlsi3>
8018a5c: b4 2b 58 00 add r11,r1,r11
map_offset = 0;
8018a60: 34 10 00 00 mvi r16,0
8018a64: e0 00 00 08 bi 8018a84 <rtems_rfs_search_map_for_clear_bit.clone.0+0x25c>
bits_skipped = search_offset + 1;
/*
* Need to remove 1 for the rounding up. The above rounds down and
* adds 1. Remember the logic is for subtraction.
*/
test_bit -= ((bits_skipped - 1) * rtems_rfs_bitmap_element_bits ()) + 1;
8018a68: b9 a0 08 00 mv r1,r13
8018a6c: 34 02 00 05 mvi r2,5
8018a70: fb ff a2 9c calli 80014e0 <__ashlsi3>
8018a74: a4 20 08 00 not r1,r1
test_bit += bits_skipped * rtems_rfs_bitmap_element_bits ();
map_offset = 0;
}
else
{
bits_skipped = search_offset + 1;
8018a78: 35 b4 00 01 addi r20,r13,1
/*
* Need to remove 1 for the rounding up. The above rounds down and
* adds 1. Remember the logic is for subtraction.
*/
test_bit -= ((bits_skipped - 1) * rtems_rfs_bitmap_element_bits ()) + 1;
8018a7c: b4 2b 58 00 add r11,r1,r11
map_offset = rtems_rfs_bitmap_element_bits () - 1;
8018a80: 34 10 00 1f mvi r16,31
}
map_bits += direction * bits_skipped;
8018a84: b9 80 10 00 mv r2,r12
8018a88: ba 80 08 00 mv r1,r20
8018a8c: fb ff a2 e3 calli 8001618 <__mulsi3>
8018a90: 34 02 00 02 mvi r2,2
8018a94: b8 20 68 00 mv r13,r1
8018a98: fb ff a2 92 calli 80014e0 <__ashlsi3>
8018a9c: b6 61 98 00 add r19,r19,r1
map_index += direction * bits_skipped;
8018aa0: b5 ed 78 00 add r15,r15,r13
}
search_bits += direction;
search_offset = direction > 0 ? 0 : rtems_rfs_bitmap_element_bits () - 1;
8018aa4: 34 0d 00 1f mvi r13,31
8018aa8: 4c 0c 00 04 bge r0,r12,8018ab8 <rtems_rfs_search_map_for_clear_bit.clone.0+0x290>
8018aac: 34 0d 00 00 mvi r13,0
8018ab0: e0 00 00 02 bi 8018ab8 <rtems_rfs_search_map_for_clear_bit.clone.0+0x290>
8018ab4: 34 0d 00 1f mvi r13,31
}
while (((direction < 0) && (test_bit >= end_bit))
8018ab8: ed 6e a0 00 cmpge r20,r11,r14
8018abc: b9 80 08 00 mv r1,r12
8018ac0: 34 02 00 1f mvi r2,31
8018ac4: fb ff a2 ae calli 800157c <__lshrsi3>
|| ((direction > 0) && (test_bit <= end_bit)));
8018ac8: a2 81 20 00 and r4,r20,r1
8018acc: 5c 80 ff 97 bne r4,r0,8018928 <rtems_rfs_search_map_for_clear_bit.clone.0+0x100><== NEVER TAKEN
8018ad0: ed cb 08 00 cmpge r1,r14,r11
8018ad4: a0 3b 08 00 and r1,r1,fp
8018ad8: 5c 24 ff 94 bne r1,r4,8018928 <rtems_rfs_search_map_for_clear_bit.clone.0+0x100><== NEVER TAKEN
return 0;
8018adc: 34 01 00 00 mvi r1,0
}
8018ae0: 2b 9d 00 04 lw ra,(sp+4)
8018ae4: 2b 8b 00 44 lw r11,(sp+68)
8018ae8: 2b 8c 00 40 lw r12,(sp+64)
8018aec: 2b 8d 00 3c lw r13,(sp+60)
8018af0: 2b 8e 00 38 lw r14,(sp+56)
8018af4: 2b 8f 00 34 lw r15,(sp+52)
8018af8: 2b 90 00 30 lw r16,(sp+48)
8018afc: 2b 91 00 2c lw r17,(sp+44)
8018b00: 2b 92 00 28 lw r18,(sp+40)
8018b04: 2b 93 00 24 lw r19,(sp+36)
8018b08: 2b 94 00 20 lw r20,(sp+32)
8018b0c: 2b 95 00 1c lw r21,(sp+28)
8018b10: 2b 96 00 18 lw r22,(sp+24)
8018b14: 2b 97 00 14 lw r23,(sp+20)
8018b18: 2b 98 00 10 lw r24,(sp+16)
8018b1c: 2b 99 00 0c lw r25,(sp+12)
8018b20: 2b 9b 00 08 lw fp,(sp+8)
8018b24: 37 9c 00 54 addi sp,sp,84
8018b28: c3 a0 00 00 ret
0801e4b0 <rtems_rfs_symlink>:
const char* link,
int link_length,
uid_t uid,
gid_t gid,
rtems_rfs_ino parent)
{
801e4b0: 37 9c ff 48 addi sp,sp,-184
801e4b4: 5b 8b 00 2c sw (sp+44),r11
801e4b8: 5b 8c 00 28 sw (sp+40),r12
801e4bc: 5b 8d 00 24 sw (sp+36),r13
801e4c0: 5b 8e 00 20 sw (sp+32),r14
801e4c4: 5b 8f 00 1c sw (sp+28),r15
801e4c8: 5b 90 00 18 sw (sp+24),r16
801e4cc: 5b 91 00 14 sw (sp+20),r17
801e4d0: 5b 92 00 10 sw (sp+16),r18
801e4d4: 5b 93 00 0c sw (sp+12),r19
801e4d8: 5b 9d 00 08 sw (sp+8),ra
801e4dc: b8 20 58 00 mv r11,r1
801e4e0: b8 40 70 00 mv r14,r2
rtems_rfs_inode_handle inode;
rtems_rfs_ino ino;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK))
801e4e4: 34 01 00 02 mvi r1,2
801e4e8: 34 02 00 00 mvi r2,0
const char* link,
int link_length,
uid_t uid,
gid_t gid,
rtems_rfs_ino parent)
{
801e4ec: b8 60 98 00 mv r19,r3
801e4f0: b8 80 80 00 mv r16,r4
801e4f4: b8 a0 68 00 mv r13,r5
801e4f8: b9 00 78 00 mv r15,r8
801e4fc: 20 d2 ff ff andi r18,r6,0xffff
801e500: 20 f1 ff ff andi r17,r7,0xffff
rtems_rfs_inode_handle inode;
rtems_rfs_ino ino;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK))
801e504: fb ff ca 09 calli 8010d28 <rtems_rfs_trace>
801e508: 44 20 00 16 be r1,r0,801e560 <rtems_rfs_symlink+0xb0> <== ALWAYS TAKEN
{
int c;
printf ("rtems-rfs: symlink: parent:%" PRIu32 " name:", parent);
801e50c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801e510: 38 21 91 c0 ori r1,r1,0x91c0 <== NOT EXECUTED
801e514: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
801e518: f8 00 10 57 calli 8022674 <printf> <== NOT EXECUTED
for (c = 0; c < length; c++)
801e51c: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
801e520: e0 00 00 05 bi 801e534 <rtems_rfs_symlink+0x84> <== NOT EXECUTED
return rc;
}
int
rtems_rfs_symlink (rtems_rfs_file_system* fs,
801e524: b5 cc 08 00 add r1,r14,r12 <== 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++)
printf ("%c", name[c]);
801e528: 40 21 00 00 lbu r1,(r1+0) <== 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++)
801e52c: 35 8c 00 01 addi r12,r12,1 <== NOT EXECUTED
printf ("%c", name[c]);
801e530: f8 00 10 d7 calli 802288c <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++)
801e534: 4a 6c ff fc bg r19,r12,801e524 <rtems_rfs_symlink+0x74> <== NOT EXECUTED
printf ("%c", name[c]);
printf (" link:");
801e538: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801e53c: 38 21 91 e8 ori r1,r1,0x91e8 <== NOT EXECUTED
801e540: f8 00 10 4d calli 8022674 <printf> <== NOT EXECUTED
for (c = 0; c < link_length; c++)
801e544: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
801e548: e0 00 00 05 bi 801e55c <rtems_rfs_symlink+0xac> <== NOT EXECUTED
return rc;
}
int
rtems_rfs_symlink (rtems_rfs_file_system* fs,
801e54c: b6 0c 08 00 add r1,r16,r12 <== NOT EXECUTED
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++)
printf ("%c", link[c]);
801e550: 40 21 00 00 lbu r1,(r1+0) <== 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++)
801e554: 35 8c 00 01 addi r12,r12,1 <== NOT EXECUTED
printf ("%c", link[c]);
801e558: f8 00 10 cd calli 802288c <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++)
801e55c: 49 ac ff fc bg r13,r12,801e54c <rtems_rfs_symlink+0x9c> <== NOT EXECUTED
printf ("%c", link[c]);
}
if (link_length >= rtems_rfs_fs_block_size (fs))
801e560: 29 61 00 08 lw r1,(r11+8)
return ENAMETOOLONG;
801e564: 34 0c 00 5b mvi r12,91
printf (" link:");
for (c = 0; c < link_length; c++)
printf ("%c", link[c]);
}
if (link_length >= rtems_rfs_fs_block_size (fs))
801e568: 51 a1 00 73 bgeu r13,r1,801e734 <rtems_rfs_symlink+0x284> <== NEVER TAKEN
return ENAMETOOLONG;
rc = rtems_rfs_inode_create (fs, parent, name, strlen (name),
801e56c: b9 c0 08 00 mv r1,r14
801e570: f8 00 15 1d calli 80239e4 <strlen>
801e574: b8 20 20 00 mv r4,r1
801e578: 37 81 00 b8 addi r1,sp,184
801e57c: 5b 81 00 04 sw (sp+4),r1
801e580: b9 e0 10 00 mv r2,r15
801e584: b9 60 08 00 mv r1,r11
801e588: b9 c0 18 00 mv r3,r14
801e58c: 38 05 a1 ff mvu r5,0xa1ff
801e590: 34 06 00 01 mvi r6,1
801e594: ba 40 38 00 mv r7,r18
801e598: ba 20 40 00 mv r8,r17
801e59c: fb ff c3 9f calli 800f418 <rtems_rfs_inode_create>
801e5a0: b8 20 60 00 mv r12,r1
RTEMS_RFS_S_SYMLINK,
1, uid, gid, &ino);
if (rc > 0)
801e5a4: 48 20 00 64 bg r1,r0,801e734 <rtems_rfs_symlink+0x284> <== NEVER TAKEN
return rc;
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
801e5a8: 2b 82 00 b8 lw r2,(sp+184)
801e5ac: 37 8e 00 80 addi r14,sp,128
801e5b0: b9 60 08 00 mv r1,r11
801e5b4: b9 c0 18 00 mv r3,r14
801e5b8: 34 04 00 01 mvi r4,1
801e5bc: fb ff c1 f7 calli 800ed98 <rtems_rfs_inode_open>
801e5c0: b8 20 60 00 mv r12,r1
if (rc > 0)
801e5c4: 48 20 00 5c bg r1,r0,801e734 <rtems_rfs_symlink+0x284> <== NEVER TAKEN
/*
* 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)
801e5c8: 34 01 00 13 mvi r1,19
801e5cc: 55 a1 00 14 bgu r13,r1,801e61c <rtems_rfs_symlink+0x16c> <== NEVER TAKEN
{
memset (inode.node->data.name, 0, RTEMS_RFS_INODE_DATA_NAME_SIZE);
801e5d0: 2b 81 00 8c lw r1,(sp+140)
801e5d4: 34 02 00 00 mvi r2,0
801e5d8: 34 03 00 14 mvi r3,20
801e5dc: 34 21 00 1c addi r1,r1,28
801e5e0: f8 00 0f 89 calli 8022404 <memset>
memcpy (inode.node->data.name, link, link_length);
801e5e4: 2b 81 00 8c lw r1,(sp+140)
801e5e8: ba 00 10 00 mv r2,r16
801e5ec: b9 a0 18 00 mv r3,r13
801e5f0: 34 21 00 1c addi r1,r1,28
801e5f4: f8 00 0e f6 calli 80221cc <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);
801e5f8: 2b 81 00 8c lw r1,(sp+140)
801e5fc: 30 20 00 0c sb (r1+12),r0
801e600: 2b 81 00 8c lw r1,(sp+140)
801e604: 30 20 00 0d sb (r1+13),r0
801e608: 2b 81 00 8c lw r1,(sp+140)
801e60c: 30 20 00 0e sb (r1+14),r0
801e610: 2b 81 00 8c lw r1,(sp+140)
801e614: 30 20 00 0f sb (r1+15),r0
801e618: e0 00 00 39 bi 801e6fc <rtems_rfs_symlink+0x24c>
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);
801e61c: 37 8f 00 30 addi r15,sp,48 <== NOT EXECUTED
801e620: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e624: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
801e628: b9 e0 18 00 mv r3,r15 <== NOT EXECUTED
801e62c: fb ff ec 4b calli 8019758 <rtems_rfs_block_map_open> <== NOT EXECUTED
801e630: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
if (rc > 0)
801e634: 4c 01 00 02 bge r0,r1,801e63c <rtems_rfs_symlink+0x18c> <== NOT EXECUTED
801e638: e0 00 00 17 bi 801e694 <rtems_rfs_symlink+0x1e4> <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_block_map_grow (fs, &map, 1, &block);
801e63c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e640: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
801e644: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
801e648: 37 84 00 b4 addi r4,sp,180 <== NOT EXECUTED
801e64c: fb ff ee 19 calli 8019eb0 <rtems_rfs_block_map_grow> <== NOT EXECUTED
801e650: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
if (rc > 0)
801e654: 4c 01 00 02 bge r0,r1,801e65c <rtems_rfs_symlink+0x1ac> <== NOT EXECUTED
801e658: e0 00 00 0c bi 801e688 <rtems_rfs_symlink+0x1d8> <== 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);
801e65c: 2b 83 00 b4 lw r3,(sp+180) <== NOT EXECUTED
801e660: 37 91 00 a8 addi r17,sp,168 <== NOT EXECUTED
801e664: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e668: ba 20 10 00 mv r2,r17 <== NOT EXECUTED
801e66c: 34 04 00 00 mvi r4,0 <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
801e670: 33 80 00 a8 sb (sp+168),r0 <== NOT EXECUTED
handle->bnum = 0;
801e674: 5b 80 00 ac sw (sp+172),r0 <== NOT EXECUTED
handle->buffer = NULL;
801e678: 5b 80 00 b0 sw (sp+176),r0 <== NOT EXECUTED
801e67c: fb ff f1 03 calli 801aa88 <rtems_rfs_buffer_handle_request><== NOT EXECUTED
801e680: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
if (rc > 0)
801e684: 4c 01 00 08 bge r0,r1,801e6a4 <rtems_rfs_symlink+0x1f4> <== NOT EXECUTED
{
rtems_rfs_block_map_close (fs, &map);
801e688: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e68c: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
801e690: fb ff ec b9 calli 8019974 <rtems_rfs_block_map_close> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
801e694: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e698: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
801e69c: fb ff c2 4b calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
801e6a0: e0 00 00 25 bi 801e734 <rtems_rfs_symlink+0x284> <== NOT EXECUTED
}
data = rtems_rfs_buffer_data (&buffer);
801e6a4: 2b 81 00 b0 lw r1,(sp+176) <== NOT EXECUTED
memset (data, 0xff, rtems_rfs_fs_block_size (fs));
801e6a8: 29 63 00 08 lw r3,(r11+8) <== NOT EXECUTED
801e6ac: 34 02 00 ff mvi r2,255 <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
rtems_rfs_inode_close (fs, &inode);
return rc;
}
data = rtems_rfs_buffer_data (&buffer);
801e6b0: 28 2c 00 1c lw r12,(r1+28) <== NOT EXECUTED
memset (data, 0xff, rtems_rfs_fs_block_size (fs));
801e6b4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801e6b8: f8 00 0f 53 calli 8022404 <memset> <== NOT EXECUTED
memcpy (data, link, link_length);
801e6bc: b9 a0 18 00 mv r3,r13 <== NOT EXECUTED
801e6c0: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801e6c4: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
801e6c8: f8 00 0e c1 calli 80221cc <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);
801e6cc: ba 20 10 00 mv r2,r17 <== NOT EXECUTED
801e6d0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e6d4: fb ff f0 7e calli 801a8cc <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);
801e6d8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e6dc: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
handle->dirty = false;
801e6e0: 33 80 00 a8 sb (sp+168),r0 <== NOT EXECUTED
handle->bnum = 0;
801e6e4: 5b 80 00 ac sw (sp+172),r0 <== NOT EXECUTED
handle->buffer = NULL;
801e6e8: 5b 80 00 b0 sw (sp+176),r0 <== NOT EXECUTED
801e6ec: fb ff ec a2 calli 8019974 <rtems_rfs_block_map_close> <== NOT EXECUTED
801e6f0: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
if (rc > 0)
801e6f4: 4c 01 00 02 bge r0,r1,801e6fc <rtems_rfs_symlink+0x24c> <== NOT EXECUTED
801e6f8: e3 ff ff e7 bi 801e694 <rtems_rfs_symlink+0x1e4> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
return rc;
}
}
rtems_rfs_inode_set_block_offset (&inode, link_length);
801e6fc: 21 ad ff ff andi r13,r13,0xffff
*/
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);
801e700: 34 02 00 08 mvi r2,8
801e704: b9 a0 08 00 mv r1,r13
801e708: fb ff 8b 9d calli 800157c <__lshrsi3>
801e70c: 2b 82 00 8c lw r2,(sp+140)
801e710: 30 41 00 0a sb (r2+10),r1
801e714: 2b 81 00 8c lw r1,(sp+140)
rc = rtems_rfs_inode_close (fs, &inode);
801e718: 37 82 00 80 addi r2,sp,128
801e71c: 30 2d 00 0b sb (r1+11),r13
rtems_rfs_buffer_mark_dirty (&handle->buffer);
801e720: 34 01 00 01 mvi r1,1
801e724: 33 81 00 90 sb (sp+144),r1
801e728: b9 60 08 00 mv r1,r11
801e72c: fb ff c2 27 calli 800efc8 <rtems_rfs_inode_close>
801e730: b8 20 60 00 mv r12,r1
return rc;
}
801e734: b9 80 08 00 mv r1,r12
801e738: 2b 9d 00 08 lw ra,(sp+8)
801e73c: 2b 8b 00 2c lw r11,(sp+44)
801e740: 2b 8c 00 28 lw r12,(sp+40)
801e744: 2b 8d 00 24 lw r13,(sp+36)
801e748: 2b 8e 00 20 lw r14,(sp+32)
801e74c: 2b 8f 00 1c lw r15,(sp+28)
801e750: 2b 90 00 18 lw r16,(sp+24)
801e754: 2b 91 00 14 lw r17,(sp+20)
801e758: 2b 92 00 10 lw r18,(sp+16)
801e75c: 2b 93 00 0c lw r19,(sp+12)
801e760: 37 9c 00 b8 addi sp,sp,184
801e764: c3 a0 00 00 ret
0801e768 <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)
{
801e768: 37 9c ff 58 addi sp,sp,-168
801e76c: 5b 8b 00 20 sw (sp+32),r11
801e770: 5b 8c 00 1c sw (sp+28),r12
801e774: 5b 8d 00 18 sw (sp+24),r13
801e778: 5b 8e 00 14 sw (sp+20),r14
801e77c: 5b 8f 00 10 sw (sp+16),r15
801e780: 5b 90 00 0c sw (sp+12),r16
801e784: 5b 91 00 08 sw (sp+8),r17
801e788: 5b 9d 00 04 sw (sp+4),ra
801e78c: b8 20 58 00 mv r11,r1
801e790: b8 40 60 00 mv r12,r2
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK_READ))
801e794: 34 01 00 04 mvi r1,4
801e798: 34 02 00 00 mvi r2,0
rtems_rfs_symlink_read (rtems_rfs_file_system* fs,
rtems_rfs_ino link,
char* path,
size_t size,
size_t* length)
{
801e79c: b8 60 88 00 mv r17,r3
801e7a0: b8 80 68 00 mv r13,r4
801e7a4: b8 a0 78 00 mv r15,r5
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK_READ))
801e7a8: fb ff c9 60 calli 8010d28 <rtems_rfs_trace>
801e7ac: 44 20 00 05 be r1,r0,801e7c0 <rtems_rfs_symlink_read+0x58> <== ALWAYS TAKEN
printf ("rtems-rfs: symlink-read: link:%" PRIu32 "\n", link);
801e7b0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801e7b4: 38 21 91 f0 ori r1,r1,0x91f0 <== NOT EXECUTED
801e7b8: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
801e7bc: f8 00 0f ae calli 8022674 <printf> <== NOT EXECUTED
rc = rtems_rfs_inode_open (fs, link, &inode, true);
801e7c0: 37 8e 00 74 addi r14,sp,116
801e7c4: b9 80 10 00 mv r2,r12
801e7c8: b9 60 08 00 mv r1,r11
801e7cc: b9 c0 18 00 mv r3,r14
801e7d0: 34 04 00 01 mvi r4,1
801e7d4: fb ff c1 71 calli 800ed98 <rtems_rfs_inode_open>
801e7d8: b8 20 60 00 mv r12,r1
if (rc)
801e7dc: 5c 20 00 63 bne r1,r0,801e968 <rtems_rfs_symlink_read+0x200><== NEVER TAKEN
}
rc = rtems_rfs_inode_close (fs, &inode);
return rc;
}
801e7e0: 2b 8c 00 80 lw r12,(sp+128)
rc = rtems_rfs_inode_open (fs, link, &inode, true);
if (rc)
return rc;
if (!RTEMS_RFS_S_ISLNK (rtems_rfs_inode_get_mode (&inode)))
801e7e4: b9 80 08 00 mv r1,r12
801e7e8: fb ff fd c7 calli 801df04 <rtems_rfs_inode_get_mode.clone.2>
801e7ec: 20 21 f0 00 andi r1,r1,0xf000
801e7f0: 38 02 a0 00 mvu r2,0xa000
801e7f4: 44 22 00 06 be r1,r2,801e80c <rtems_rfs_symlink_read+0xa4> <== ALWAYS TAKEN
{
rtems_rfs_inode_close (fs, &inode);
801e7f8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e7fc: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
801e800: fb ff c1 f2 calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
return EINVAL;
801e804: 34 0c 00 16 mvi r12,22 <== NOT EXECUTED
801e808: e0 00 00 58 bi 801e968 <rtems_rfs_symlink_read+0x200> <== 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);
801e80c: 41 81 00 0a lbu r1,(r12+10)
801e810: 34 02 00 08 mvi r2,8
801e814: 35 8e 00 0a addi r14,r12,10
801e818: fb ff 8b 32 calli 80014e0 <__ashlsi3>
801e81c: 41 c2 00 01 lbu r2,(r14+1)
801e820: b8 22 08 00 or r1,r1,r2
}
*length = rtems_rfs_inode_get_block_offset (&inode);
801e824: 20 21 ff ff andi r1,r1,0xffff
801e828: 59 e1 00 00 sw (r15+0),r1
if (size < *length)
801e82c: 51 a1 00 02 bgeu r13,r1,801e834 <rtems_rfs_symlink_read+0xcc>
{
*length = size;
801e830: 59 ed 00 00 sw (r15+0),r13
* @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);
801e834: 35 8d 00 0c addi r13,r12,12
801e838: 41 81 00 0c lbu r1,(r12+12)
801e83c: 41 ae 00 03 lbu r14,(r13+3)
801e840: 34 02 00 18 mvi r2,24
801e844: fb ff 8b 27 calli 80014e0 <__ashlsi3>
801e848: b9 c1 70 00 or r14,r14,r1
801e84c: 41 a1 00 01 lbu r1,(r13+1)
801e850: 34 02 00 10 mvi r2,16
801e854: fb ff 8b 23 calli 80014e0 <__ashlsi3>
801e858: b9 c1 70 00 or r14,r14,r1
801e85c: 41 a1 00 02 lbu r1,(r13+2)
801e860: 34 02 00 08 mvi r2,8
801e864: fb ff 8b 1f calli 80014e0 <__ashlsi3>
801e868: b9 c1 08 00 or r1,r14,r1
}
if (rtems_rfs_inode_get_block_count (&inode) == 0)
801e86c: 5c 20 00 06 bne r1,r0,801e884 <rtems_rfs_symlink_read+0x11c><== NEVER TAKEN
{
memcpy (path, inode.node->data.name, *length);
801e870: 29 e3 00 00 lw r3,(r15+0)
801e874: ba 20 08 00 mv r1,r17
801e878: 35 82 00 1c addi r2,r12,28
801e87c: f8 00 0e 54 calli 80221cc <memcpy>
801e880: e0 00 00 36 bi 801e958 <rtems_rfs_symlink_read+0x1f0>
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);
801e884: 37 8d 00 74 addi r13,sp,116 <== NOT EXECUTED
801e888: 37 8e 00 24 addi r14,sp,36 <== NOT EXECUTED
801e88c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e890: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801e894: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
801e898: fb ff eb b0 calli 8019758 <rtems_rfs_block_map_open> <== NOT EXECUTED
801e89c: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
if (rc > 0)
801e8a0: 4c 01 00 02 bge r0,r1,801e8a8 <rtems_rfs_symlink_read+0x140><== NOT EXECUTED
801e8a4: e0 00 00 29 bi 801e948 <rtems_rfs_symlink_read+0x1e0> <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_block_map_seek (fs, &map, 0, &block);
801e8a8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e8ac: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
801e8b0: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
801e8b4: 34 04 00 00 mvi r4,0 <== NOT EXECUTED
801e8b8: 37 85 00 a8 addi r5,sp,168 <== NOT EXECUTED
801e8bc: fb ff ed 3b calli 8019da8 <rtems_rfs_block_map_seek> <== NOT EXECUTED
801e8c0: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
if (rc > 0)
801e8c4: 4c 01 00 02 bge r0,r1,801e8cc <rtems_rfs_symlink_read+0x164><== NOT EXECUTED
801e8c8: e0 00 00 0c bi 801e8f8 <rtems_rfs_symlink_read+0x190> <== 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);
801e8cc: 2b 83 00 a8 lw r3,(sp+168) <== NOT EXECUTED
801e8d0: 37 90 00 9c addi r16,sp,156 <== NOT EXECUTED
801e8d4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e8d8: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
801e8dc: 34 04 00 00 mvi r4,0 <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
801e8e0: 33 80 00 9c sb (sp+156),r0 <== NOT EXECUTED
handle->bnum = 0;
801e8e4: 5b 80 00 a0 sw (sp+160),r0 <== NOT EXECUTED
handle->buffer = NULL;
801e8e8: 5b 80 00 a4 sw (sp+164),r0 <== NOT EXECUTED
801e8ec: fb ff f0 67 calli 801aa88 <rtems_rfs_buffer_handle_request><== NOT EXECUTED
801e8f0: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
if (rc > 0)
801e8f4: 4c 01 00 05 bge r0,r1,801e908 <rtems_rfs_symlink_read+0x1a0><== NOT EXECUTED
{
rtems_rfs_block_map_close (fs, &map);
801e8f8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e8fc: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
801e900: fb ff ec 1d calli 8019974 <rtems_rfs_block_map_close> <== NOT EXECUTED
801e904: e0 00 00 11 bi 801e948 <rtems_rfs_symlink_read+0x1e0> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
return rc;
}
data = rtems_rfs_buffer_data (&buffer);
memcpy (path, data, *length);
801e908: 2b 82 00 a4 lw r2,(sp+164) <== NOT EXECUTED
801e90c: 29 e3 00 00 lw r3,(r15+0) <== NOT EXECUTED
801e910: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
801e914: 28 42 00 1c lw r2,(r2+28) <== NOT EXECUTED
801e918: f8 00 0e 2d calli 80221cc <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);
801e91c: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
801e920: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e924: fb ff ef ea calli 801a8cc <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);
801e928: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e92c: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED
handle->dirty = false;
801e930: 33 80 00 9c sb (sp+156),r0 <== NOT EXECUTED
handle->bnum = 0;
801e934: 5b 80 00 a0 sw (sp+160),r0 <== NOT EXECUTED
handle->buffer = NULL;
801e938: 5b 80 00 a4 sw (sp+164),r0 <== NOT EXECUTED
801e93c: fb ff ec 0e calli 8019974 <rtems_rfs_block_map_close> <== NOT EXECUTED
801e940: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
if (rc > 0)
801e944: 4c 01 00 05 bge r0,r1,801e958 <rtems_rfs_symlink_read+0x1f0><== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
801e948: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e94c: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801e950: fb ff c1 9e calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
801e954: e0 00 00 05 bi 801e968 <rtems_rfs_symlink_read+0x200> <== NOT EXECUTED
}
}
rc = rtems_rfs_inode_close (fs, &inode);
801e958: b9 60 08 00 mv r1,r11
801e95c: 37 82 00 74 addi r2,sp,116
801e960: fb ff c1 9a calli 800efc8 <rtems_rfs_inode_close>
801e964: b8 20 60 00 mv r12,r1
return rc;
}
801e968: b9 80 08 00 mv r1,r12
801e96c: 2b 9d 00 04 lw ra,(sp+4)
801e970: 2b 8b 00 20 lw r11,(sp+32)
801e974: 2b 8c 00 1c lw r12,(sp+28)
801e978: 2b 8d 00 18 lw r13,(sp+24)
801e97c: 2b 8e 00 14 lw r14,(sp+20)
801e980: 2b 8f 00 10 lw r15,(sp+16)
801e984: 2b 90 00 0c lw r16,(sp+12)
801e988: 2b 91 00 08 lw r17,(sp+8)
801e98c: 37 9c 00 a8 addi sp,sp,168
801e990: c3 a0 00 00 ret
08010d78 <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;
8010d78: 78 03 08 04 mvhi r3,0x804 <== NOT EXECUTED
8010d7c: 38 63 b7 f8 ori r3,r3,0xb7f8 <== NOT EXECUTED
8010d80: 28 65 00 00 lw r5,(r3+0) <== NOT EXECUTED
8010d84: 28 64 00 04 lw r4,(r3+4) <== NOT EXECUTED
rtems_rfs_trace_flags &= ~mask;
8010d88: a4 20 08 00 not r1,r1 <== NOT EXECUTED
8010d8c: a4 40 10 00 not r2,r2 <== NOT EXECUTED
8010d90: a0 25 08 00 and r1,r1,r5 <== NOT EXECUTED
8010d94: a0 44 10 00 and r2,r2,r4 <== NOT EXECUTED
8010d98: 58 61 00 00 sw (r3+0),r1 <== NOT EXECUTED
8010d9c: 58 62 00 04 sw (r3+4),r2 <== NOT EXECUTED
return state;
}
8010da0: b8 a0 08 00 mv r1,r5 <== NOT EXECUTED
8010da4: b8 80 10 00 mv r2,r4 <== NOT EXECUTED
8010da8: c3 a0 00 00 ret <== NOT EXECUTED
08010d4c <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;
8010d4c: 78 03 08 04 mvhi r3,0x804 <== NOT EXECUTED
8010d50: 38 63 b7 f8 ori r3,r3,0xb7f8 <== NOT EXECUTED
8010d54: 28 65 00 00 lw r5,(r3+0) <== NOT EXECUTED
8010d58: 28 64 00 04 lw r4,(r3+4) <== NOT EXECUTED
rtems_rfs_trace_flags |= mask;
8010d5c: b8 25 08 00 or r1,r1,r5 <== NOT EXECUTED
8010d60: b8 44 10 00 or r2,r2,r4 <== NOT EXECUTED
8010d64: 58 61 00 00 sw (r3+0),r1 <== NOT EXECUTED
8010d68: 58 62 00 04 sw (r3+4),r2 <== NOT EXECUTED
return state;
}
8010d6c: b8 a0 08 00 mv r1,r5 <== NOT EXECUTED
8010d70: b8 80 10 00 mv r2,r4 <== NOT EXECUTED
8010d74: c3 a0 00 00 ret <== NOT EXECUTED
08010dac <rtems_rfs_trace_shell_command>:
int
rtems_rfs_trace_shell_command (int argc, char *argv[])
{
8010dac: 37 9c ff 18 addi sp,sp,-232 <== NOT EXECUTED
8010db0: 5b 8b 00 44 sw (sp+68),r11 <== NOT EXECUTED
8010db4: 5b 8c 00 40 sw (sp+64),r12 <== NOT EXECUTED
8010db8: 5b 8d 00 3c sw (sp+60),r13 <== NOT EXECUTED
8010dbc: 5b 8e 00 38 sw (sp+56),r14 <== NOT EXECUTED
8010dc0: 5b 8f 00 34 sw (sp+52),r15 <== NOT EXECUTED
8010dc4: 5b 90 00 30 sw (sp+48),r16 <== NOT EXECUTED
8010dc8: 5b 91 00 2c sw (sp+44),r17 <== NOT EXECUTED
8010dcc: 5b 92 00 28 sw (sp+40),r18 <== NOT EXECUTED
8010dd0: 5b 93 00 24 sw (sp+36),r19 <== NOT EXECUTED
8010dd4: 5b 94 00 20 sw (sp+32),r20 <== NOT EXECUTED
8010dd8: 5b 95 00 1c sw (sp+28),r21 <== NOT EXECUTED
8010ddc: 5b 96 00 18 sw (sp+24),r22 <== NOT EXECUTED
8010de0: 5b 97 00 14 sw (sp+20),r23 <== NOT EXECUTED
8010de4: 5b 98 00 10 sw (sp+16),r24 <== NOT EXECUTED
8010de8: 5b 99 00 0c sw (sp+12),r25 <== NOT EXECUTED
8010dec: 5b 9b 00 08 sw (sp+8),fp <== NOT EXECUTED
8010df0: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
8010df4: b8 40 70 00 mv r14,r2 <== NOT EXECUTED
const char* table[] =
8010df8: 78 02 08 03 mvhi r2,0x803 <== NOT EXECUTED
return state;
}
int
rtems_rfs_trace_shell_command (int argc, char *argv[])
{
8010dfc: 5b 81 00 4c sw (sp+76),r1 <== NOT EXECUTED
const char* table[] =
8010e00: 38 42 73 28 ori r2,r2,0x7328 <== NOT EXECUTED
8010e04: 37 81 00 50 addi r1,sp,80 <== NOT EXECUTED
8010e08: 34 03 00 9c mvi r3,156 <== NOT EXECUTED
return 1;
}
}
else
{
if (strcmp (argv[arg], "set") == 0)
8010e0c: 78 11 08 03 mvhi r17,0x803 <== NOT EXECUTED
set = true;
if (strcmp (argv[arg], "clear") == 0)
8010e10: 78 10 08 03 mvhi r16,0x803 <== NOT EXECUTED
set = false;
else if (strcmp (argv[arg], "all") == 0)
8010e14: 78 0f 08 03 mvhi r15,0x803 <== NOT EXECUTED
}
}
}
rtems_rfs_trace_flags |= set_value;
rtems_rfs_trace_flags &= ~clear_value;
8010e18: 78 0b 08 04 mvhi r11,0x804 <== NOT EXECUTED
}
int
rtems_rfs_trace_shell_command (int argc, char *argv[])
{
const char* table[] =
8010e1c: f8 00 44 ec calli 80221cc <memcpy> <== NOT EXECUTED
8010e20: b9 c0 b8 00 mv r23,r14 <== NOT EXECUTED
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
int arg;
int t;
for (arg = 1; arg < argc; arg++)
8010e24: 34 16 00 01 mvi r22,1 <== NOT EXECUTED
"file-set"
};
rtems_rfs_trace_mask set_value = 0;
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
8010e28: 34 0d 00 01 mvi r13,1 <== NOT EXECUTED
"file-io",
"file-set"
};
rtems_rfs_trace_mask set_value = 0;
rtems_rfs_trace_mask clear_value = 0;
8010e2c: 34 15 00 00 mvi r21,0 <== NOT EXECUTED
8010e30: 34 14 00 00 mvi r20,0 <== NOT EXECUTED
"file-close",
"file-io",
"file-set"
};
rtems_rfs_trace_mask set_value = 0;
8010e34: 34 13 00 00 mvi r19,0 <== NOT EXECUTED
8010e38: 34 12 00 00 mvi r18,0 <== NOT EXECUTED
int arg;
int t;
for (arg = 1; arg < argc; arg++)
{
if (argv[arg][0] == '-')
8010e3c: 34 1b 00 2d mvi fp,45 <== NOT EXECUTED
return 1;
}
}
else
{
if (strcmp (argv[arg], "set") == 0)
8010e40: 3a 31 55 88 ori r17,r17,0x5588 <== NOT EXECUTED
set = true;
if (strcmp (argv[arg], "clear") == 0)
8010e44: 3a 10 70 fc ori r16,r16,0x70fc <== NOT EXECUTED
set = false;
else if (strcmp (argv[arg], "all") == 0)
8010e48: 39 ef 94 38 ori r15,r15,0x9438 <== NOT EXECUTED
else
clear_value = RTEMS_RFS_TRACE_ALL;
}
else
{
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
8010e4c: 34 19 00 27 mvi r25,39 <== NOT EXECUTED
}
}
}
rtems_rfs_trace_flags |= set_value;
rtems_rfs_trace_flags &= ~clear_value;
8010e50: 39 6b b7 f8 ori r11,r11,0xb7f8 <== NOT EXECUTED
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
int arg;
int t;
for (arg = 1; arg < argc; arg++)
8010e54: e0 00 00 5b bi 8010fc0 <rtems_rfs_trace_shell_command+0x214><== NOT EXECUTED
{
if (argv[arg][0] == '-')
8010e58: 2a ec 00 04 lw r12,(r23+4) <== NOT EXECUTED
8010e5c: 41 81 00 00 lbu r1,(r12+0) <== NOT EXECUTED
8010e60: 5c 3b 00 20 bne r1,fp,8010ee0 <rtems_rfs_trace_shell_command+0x134><== NOT EXECUTED
{
switch (argv[arg][1])
8010e64: 41 81 00 01 lbu r1,(r12+1) <== NOT EXECUTED
8010e68: 34 02 00 68 mvi r2,104 <== NOT EXECUTED
8010e6c: 44 22 00 04 be r1,r2,8010e7c <rtems_rfs_trace_shell_command+0xd0><== NOT EXECUTED
8010e70: 34 02 00 6c mvi r2,108 <== NOT EXECUTED
8010e74: 5c 22 00 16 bne r1,r2,8010ecc <rtems_rfs_trace_shell_command+0x120><== NOT EXECUTED
8010e78: e0 00 00 06 bi 8010e90 <rtems_rfs_trace_shell_command+0xe4><== NOT EXECUTED
{
case 'h':
printf ("usage: %s [-hl] [set/clear] [flags]\n", argv[0]);
8010e7c: 29 c2 00 00 lw r2,(r14+0) <== NOT EXECUTED
8010e80: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8010e84: 38 21 70 8c ori r1,r1,0x708c <== NOT EXECUTED
8010e88: f8 00 45 fb calli 8022674 <printf> <== NOT EXECUTED
8010e8c: e0 00 00 4f bi 8010fc8 <rtems_rfs_trace_shell_command+0x21c><== NOT EXECUTED
return 0;
case 'l':
printf ("%s: valid flags to set or clear are:\n", argv[0]);
8010e90: 29 c2 00 00 lw r2,(r14+0) <== NOT EXECUTED
8010e94: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8010e98: 38 21 70 b4 ori r1,r1,0x70b4 <== NOT EXECUTED
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
printf (" %s\n", table[t]);
8010e9c: 78 0c 08 03 mvhi r12,0x803 <== 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]);
8010ea0: f8 00 45 f5 calli 8022674 <printf> <== NOT EXECUTED
8010ea4: 37 8b 00 50 addi r11,sp,80 <== NOT EXECUTED
rtems_rfs_trace_flags &= ~mask;
return state;
}
int
rtems_rfs_trace_shell_command (int argc, char *argv[])
8010ea8: 37 8d 00 ec addi r13,sp,236 <== 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]);
8010eac: 39 8c 70 dc ori r12,r12,0x70dc <== 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++)
8010eb0: e0 00 00 05 bi 8010ec4 <rtems_rfs_trace_shell_command+0x118><== NOT EXECUTED
printf (" %s\n", table[t]);
8010eb4: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED
8010eb8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8010ebc: 35 6b 00 04 addi r11,r11,4 <== NOT EXECUTED
8010ec0: f8 00 45 ed calli 8022674 <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++)
8010ec4: 5d 6d ff fc bne r11,r13,8010eb4 <rtems_rfs_trace_shell_command+0x108><== NOT EXECUTED
8010ec8: e0 00 00 40 bi 8010fc8 <rtems_rfs_trace_shell_command+0x21c><== NOT EXECUTED
printf (" %s\n", table[t]);
return 0;
default:
printf ("error: unknown option\n");
8010ecc: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
8010ed0: 38 21 70 e4 ori r1,r1,0x70e4 <== NOT EXECUTED
8010ed4: f8 00 46 b0 calli 8022994 <puts> <== NOT EXECUTED
return 1;
8010ed8: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
8010edc: e0 00 00 3c bi 8010fcc <rtems_rfs_trace_shell_command+0x220><== NOT EXECUTED
}
}
else
{
if (strcmp (argv[arg], "set") == 0)
8010ee0: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8010ee4: ba 20 10 00 mv r2,r17 <== NOT EXECUTED
8010ee8: f8 00 49 31 calli 80233ac <strcmp> <== NOT EXECUTED
8010eec: 5c 20 00 02 bne r1,r0,8010ef4 <rtems_rfs_trace_shell_command+0x148><== NOT EXECUTED
set = true;
8010ef0: 34 0d 00 01 mvi r13,1 <== NOT EXECUTED
if (strcmp (argv[arg], "clear") == 0)
8010ef4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8010ef8: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
8010efc: f8 00 49 2c calli 80233ac <strcmp> <== NOT EXECUTED
8010f00: 44 20 00 20 be r1,r0,8010f80 <rtems_rfs_trace_shell_command+0x1d4><== NOT EXECUTED
set = false;
else if (strcmp (argv[arg], "all") == 0)
8010f04: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8010f08: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED
8010f0c: f8 00 49 28 calli 80233ac <strcmp> <== NOT EXECUTED
8010f10: 37 98 00 50 addi r24,sp,80 <== NOT EXECUTED
8010f14: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
8010f18: 5c 20 00 05 bne r1,r0,8010f2c <rtems_rfs_trace_shell_command+0x180><== NOT EXECUTED
{
if (set)
8010f1c: 45 a1 00 1b be r13,r1,8010f88 <rtems_rfs_trace_shell_command+0x1dc><== NOT EXECUTED
set_value = RTEMS_RFS_TRACE_ALL;
8010f20: 34 13 ff ff mvi r19,-1 <== NOT EXECUTED
8010f24: 34 12 ff ff mvi r18,-1 <== NOT EXECUTED
8010f28: e0 00 00 1a bi 8010f90 <rtems_rfs_trace_shell_command+0x1e4><== NOT EXECUTED
}
else
{
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
{
if (strcmp (argv[arg], table[t]) == 0)
8010f2c: 2b 02 00 00 lw r2,(r24+0) <== NOT EXECUTED
8010f30: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
8010f34: 5b 83 00 48 sw (sp+72),r3 <== NOT EXECUTED
8010f38: f8 00 49 1d calli 80233ac <strcmp> <== NOT EXECUTED
8010f3c: 37 18 00 04 addi r24,r24,4 <== NOT EXECUTED
8010f40: 2b 83 00 48 lw r3,(sp+72) <== NOT EXECUTED
8010f44: 5c 20 00 0c bne r1,r0,8010f74 <rtems_rfs_trace_shell_command+0x1c8><== NOT EXECUTED
{
if (set)
8010f48: 45 a1 00 06 be r13,r1,8010f60 <rtems_rfs_trace_shell_command+0x1b4><== NOT EXECUTED
set_value = 1ULL << t;
8010f4c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8010f50: f8 00 77 8f calli 802ed8c <__ashldi3> <== NOT EXECUTED
8010f54: b8 20 98 00 mv r19,r1 <== NOT EXECUTED
8010f58: b8 40 90 00 mv r18,r2 <== NOT EXECUTED
8010f5c: e0 00 00 0d bi 8010f90 <rtems_rfs_trace_shell_command+0x1e4><== NOT EXECUTED
else
clear_value = 1ULL << t;
8010f60: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8010f64: f8 00 77 8a calli 802ed8c <__ashldi3> <== NOT EXECUTED
8010f68: b8 20 a8 00 mv r21,r1 <== NOT EXECUTED
8010f6c: b8 40 a0 00 mv r20,r2 <== NOT EXECUTED
8010f70: e0 00 00 08 bi 8010f90 <rtems_rfs_trace_shell_command+0x1e4><== NOT EXECUTED
else
clear_value = RTEMS_RFS_TRACE_ALL;
}
else
{
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
8010f74: 34 63 00 01 addi r3,r3,1 <== NOT EXECUTED
8010f78: 5c 79 ff ed bne r3,r25,8010f2c <rtems_rfs_trace_shell_command+0x180><== NOT EXECUTED
8010f7c: e0 00 00 05 bi 8010f90 <rtems_rfs_trace_shell_command+0x1e4><== NOT EXECUTED
else
{
if (strcmp (argv[arg], "set") == 0)
set = true;
if (strcmp (argv[arg], "clear") == 0)
set = false;
8010f80: 34 0d 00 00 mvi r13,0 <== NOT EXECUTED
8010f84: e0 00 00 03 bi 8010f90 <rtems_rfs_trace_shell_command+0x1e4><== NOT EXECUTED
else if (strcmp (argv[arg], "all") == 0)
{
if (set)
set_value = RTEMS_RFS_TRACE_ALL;
else
clear_value = RTEMS_RFS_TRACE_ALL;
8010f88: 34 15 ff ff mvi r21,-1 <== NOT EXECUTED
8010f8c: 34 14 ff ff mvi r20,-1 <== NOT EXECUTED
break;
}
}
}
rtems_rfs_trace_flags |= set_value;
8010f90: 29 63 00 00 lw r3,(r11+0) <== NOT EXECUTED
8010f94: 29 61 00 04 lw r1,(r11+4) <== NOT EXECUTED
rtems_rfs_trace_flags &= ~clear_value;
8010f98: a6 a0 20 00 not r4,r21 <== NOT EXECUTED
8010f9c: a6 80 10 00 not r2,r20 <== NOT EXECUTED
break;
}
}
}
rtems_rfs_trace_flags |= set_value;
8010fa0: b8 73 18 00 or r3,r3,r19 <== NOT EXECUTED
8010fa4: b8 32 08 00 or r1,r1,r18 <== NOT EXECUTED
rtems_rfs_trace_flags &= ~clear_value;
8010fa8: a0 83 18 00 and r3,r4,r3 <== NOT EXECUTED
8010fac: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED
8010fb0: 59 63 00 00 sw (r11+0),r3 <== NOT EXECUTED
8010fb4: 59 61 00 04 sw (r11+4),r1 <== NOT EXECUTED
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
int arg;
int t;
for (arg = 1; arg < argc; arg++)
8010fb8: 36 d6 00 01 addi r22,r22,1 <== NOT EXECUTED
8010fbc: 36 f7 00 04 addi r23,r23,4 <== NOT EXECUTED
8010fc0: 2b 81 00 4c lw r1,(sp+76) <== NOT EXECUTED
8010fc4: 48 36 ff a5 bg r1,r22,8010e58 <rtems_rfs_trace_shell_command+0xac><== NOT EXECUTED
rtems_rfs_trace_flags |= set_value;
rtems_rfs_trace_flags &= ~clear_value;
}
}
return 0;
8010fc8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
}
8010fcc: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8010fd0: 2b 8b 00 44 lw r11,(sp+68) <== NOT EXECUTED
8010fd4: 2b 8c 00 40 lw r12,(sp+64) <== NOT EXECUTED
8010fd8: 2b 8d 00 3c lw r13,(sp+60) <== NOT EXECUTED
8010fdc: 2b 8e 00 38 lw r14,(sp+56) <== NOT EXECUTED
8010fe0: 2b 8f 00 34 lw r15,(sp+52) <== NOT EXECUTED
8010fe4: 2b 90 00 30 lw r16,(sp+48) <== NOT EXECUTED
8010fe8: 2b 91 00 2c lw r17,(sp+44) <== NOT EXECUTED
8010fec: 2b 92 00 28 lw r18,(sp+40) <== NOT EXECUTED
8010ff0: 2b 93 00 24 lw r19,(sp+36) <== NOT EXECUTED
8010ff4: 2b 94 00 20 lw r20,(sp+32) <== NOT EXECUTED
8010ff8: 2b 95 00 1c lw r21,(sp+28) <== NOT EXECUTED
8010ffc: 2b 96 00 18 lw r22,(sp+24) <== NOT EXECUTED
8011000: 2b 97 00 14 lw r23,(sp+20) <== NOT EXECUTED
8011004: 2b 98 00 10 lw r24,(sp+16) <== NOT EXECUTED
8011008: 2b 99 00 0c lw r25,(sp+12) <== NOT EXECUTED
801100c: 2b 9b 00 08 lw fp,(sp+8) <== NOT EXECUTED
8011010: 37 9c 00 e8 addi sp,sp,232 <== NOT EXECUTED
8011014: c3 a0 00 00 ret <== NOT EXECUTED
0801e11c <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)
{
801e11c: 37 9c ff 8c addi sp,sp,-116
801e120: 5b 8b 00 24 sw (sp+36),r11
801e124: 5b 8c 00 20 sw (sp+32),r12
801e128: 5b 8d 00 1c sw (sp+28),r13
801e12c: 5b 8e 00 18 sw (sp+24),r14
801e130: 5b 8f 00 14 sw (sp+20),r15
801e134: 5b 90 00 10 sw (sp+16),r16
801e138: 5b 91 00 0c sw (sp+12),r17
801e13c: 5b 92 00 08 sw (sp+8),r18
801e140: 5b 9d 00 04 sw (sp+4),ra
801e144: b8 20 60 00 mv r12,r1
801e148: b8 40 80 00 mv r16,r2
rtems_rfs_inode_handle target_inode;
uint16_t links;
bool dir;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
801e14c: 34 01 00 00 mvi r1,0
801e150: 78 02 02 00 mvhi r2,0x200
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)
{
801e154: b8 60 68 00 mv r13,r3
801e158: b8 80 90 00 mv r18,r4
801e15c: b8 a0 70 00 mv r14,r5
rtems_rfs_inode_handle target_inode;
uint16_t links;
bool dir;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
801e160: fb ff ca f2 calli 8010d28 <rtems_rfs_trace>
801e164: 44 20 00 06 be r1,r0,801e17c <rtems_rfs_unlink+0x60> <== ALWAYS TAKEN
printf ("rtems-rfs: unlink: parent(%" PRIu32 ") -X-> (%" PRIu32 ")\n", parent, target);
801e168: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801e16c: 38 21 90 08 ori r1,r1,0x9008 <== NOT EXECUTED
801e170: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
801e174: b9 a0 18 00 mv r3,r13 <== NOT EXECUTED
801e178: f8 00 11 3f calli 8022674 <printf> <== NOT EXECUTED
rc = rtems_rfs_inode_open (fs, target, &target_inode, true);
801e17c: 37 91 00 28 addi r17,sp,40
801e180: b9 80 08 00 mv r1,r12
801e184: b9 a0 10 00 mv r2,r13
801e188: ba 20 18 00 mv r3,r17
801e18c: 34 04 00 01 mvi r4,1
801e190: fb ff c3 02 calli 800ed98 <rtems_rfs_inode_open>
801e194: b8 20 58 00 mv r11,r1
if (rc)
801e198: 5c 20 00 ba bne r1,r0,801e480 <rtems_rfs_unlink+0x364> <== NEVER TAKEN
/*
* If a directory process the unlink mode.
*/
dir = RTEMS_RFS_S_ISDIR (rtems_rfs_inode_get_mode (&target_inode));
801e19c: 2b 81 00 34 lw r1,(sp+52)
801e1a0: fb ff ff 59 calli 801df04 <rtems_rfs_inode_get_mode.clone.2>
801e1a4: 20 21 f0 00 andi r1,r1,0xf000
801e1a8: 64 2f 40 00 cmpei r15,r1,16384
if (dir)
801e1ac: 45 eb 00 20 be r15,r11,801e22c <rtems_rfs_unlink+0x110>
{
switch (dir_mode)
801e1b0: 45 c0 00 04 be r14,r0,801e1c0 <rtems_rfs_unlink+0xa4> <== NEVER TAKEN
801e1b4: 34 01 00 01 mvi r1,1
801e1b8: 5d c1 00 1d bne r14,r1,801e22c <rtems_rfs_unlink+0x110> <== NEVER TAKEN
801e1bc: e0 00 00 0d bi 801e1f0 <rtems_rfs_unlink+0xd4>
{
case rtems_rfs_unlink_dir_denied:
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
801e1c0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801e1c4: 78 02 02 00 mvhi r2,0x200 <== NOT EXECUTED
801e1c8: fb ff ca d8 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801e1cc: 44 2e 00 04 be r1,r14,801e1dc <rtems_rfs_unlink+0xc0> <== NOT EXECUTED
printf ("rtems-rfs: link is a directory\n");
801e1d0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801e1d4: 38 21 90 34 ori r1,r1,0x9034 <== NOT EXECUTED
801e1d8: f8 00 11 ef calli 8022994 <puts> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &target_inode);
801e1dc: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801e1e0: 37 82 00 28 addi r2,sp,40 <== NOT EXECUTED
801e1e4: fb ff c3 79 calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
return EISDIR;
801e1e8: 34 0b 00 15 mvi r11,21 <== NOT EXECUTED
801e1ec: e0 00 00 a5 bi 801e480 <rtems_rfs_unlink+0x364> <== NOT EXECUTED
case rtems_rfs_unlink_dir_if_empty:
rc = rtems_rfs_dir_empty (fs, &target_inode);
801e1f0: b9 80 08 00 mv r1,r12
801e1f4: ba 20 10 00 mv r2,r17
801e1f8: fb ff f8 62 calli 801c380 <rtems_rfs_dir_empty>
801e1fc: b8 20 58 00 mv r11,r1
if (rc > 0)
801e200: 4c 01 00 0b bge r0,r1,801e22c <rtems_rfs_unlink+0x110>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
801e204: 34 01 00 00 mvi r1,0
801e208: 78 02 02 00 mvhi r2,0x200
801e20c: fb ff ca c7 calli 8010d28 <rtems_rfs_trace>
801e210: 44 20 00 88 be r1,r0,801e430 <rtems_rfs_unlink+0x314> <== ALWAYS TAKEN
printf ("rtems-rfs: dir-empty: %d: %s\n", rc, strerror (rc));
801e214: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e218: f8 00 15 d2 calli 8023960 <strerror> <== NOT EXECUTED
801e21c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801e220: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801e224: 38 21 90 54 ori r1,r1,0x9054 <== NOT EXECUTED
801e228: e0 00 00 80 bi 801e428 <rtems_rfs_unlink+0x30c> <== NOT EXECUTED
default:
break;
}
}
rc = rtems_rfs_inode_open (fs, parent, &parent_inode, true);
801e22c: 37 8e 00 50 addi r14,sp,80
801e230: b9 80 08 00 mv r1,r12
801e234: ba 00 10 00 mv r2,r16
801e238: b9 c0 18 00 mv r3,r14
801e23c: 34 04 00 01 mvi r4,1
801e240: fb ff c2 d6 calli 800ed98 <rtems_rfs_inode_open>
801e244: b8 20 58 00 mv r11,r1
if (rc)
801e248: 44 20 00 0b be r1,r0,801e274 <rtems_rfs_unlink+0x158> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
801e24c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801e250: 78 02 02 00 mvhi r2,0x200 <== NOT EXECUTED
801e254: fb ff ca b5 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801e258: 44 20 00 76 be r1,r0,801e430 <rtems_rfs_unlink+0x314> <== NOT EXECUTED
printf ("rtems-rfs: link: inode-open failed: %d: %s\n",
801e25c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e260: f8 00 15 c0 calli 8023960 <strerror> <== NOT EXECUTED
801e264: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801e268: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801e26c: 38 21 90 74 ori r1,r1,0x9074 <== NOT EXECUTED
801e270: e0 00 00 6e bi 801e428 <rtems_rfs_unlink+0x30c> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_dir_del_entry (fs, &parent_inode, target, doff);
801e274: b9 80 08 00 mv r1,r12
801e278: b9 c0 10 00 mv r2,r14
801e27c: b9 a0 18 00 mv r3,r13
801e280: ba 40 20 00 mv r4,r18
801e284: fb ff f6 2e calli 801bb3c <rtems_rfs_dir_del_entry>
801e288: b8 20 58 00 mv r11,r1
if (rc > 0)
801e28c: 4c 01 00 0b bge r0,r1,801e2b8 <rtems_rfs_unlink+0x19c> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
801e290: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801e294: 78 02 02 00 mvhi r2,0x200 <== NOT EXECUTED
801e298: fb ff ca a4 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801e29c: 44 20 00 51 be r1,r0,801e3e0 <rtems_rfs_unlink+0x2c4> <== NOT EXECUTED
printf ("rtems-rfs: unlink: dir-del failed: %d: %s\n",
801e2a0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e2a4: f8 00 15 af calli 8023960 <strerror> <== NOT EXECUTED
801e2a8: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801e2ac: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801e2b0: 38 21 90 a0 ori r1,r1,0x90a0 <== NOT EXECUTED
801e2b4: e0 00 00 49 bi 801e3d8 <rtems_rfs_unlink+0x2bc> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &parent_inode);
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
links = rtems_rfs_inode_get_links (&target_inode);
801e2b8: 2b 81 00 34 lw r1,(sp+52)
801e2bc: fb ff ff 00 calli 801debc <rtems_rfs_inode_get_links.clone.1>
801e2c0: b8 20 58 00 mv r11,r1
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
801e2c4: 78 02 02 00 mvhi r2,0x200
801e2c8: 34 01 00 00 mvi r1,0
801e2cc: fb ff ca 97 calli 8010d28 <rtems_rfs_trace>
801e2d0: 44 20 00 06 be r1,r0,801e2e8 <rtems_rfs_unlink+0x1cc> <== ALWAYS TAKEN
printf ("rtems-rfs: unlink: target:%" PRIu32 " links:%u\n", target, links);
801e2d4: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801e2d8: 38 21 90 cc ori r1,r1,0x90cc <== NOT EXECUTED
801e2dc: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED
801e2e0: b9 60 18 00 mv r3,r11 <== NOT EXECUTED
801e2e4: f8 00 10 e4 calli 8022674 <printf> <== NOT EXECUTED
if (links > 1)
801e2e8: 34 0d 00 01 mvi r13,1
801e2ec: 51 ab 00 0c bgeu r13,r11,801e31c <rtems_rfs_unlink+0x200>
{
links--;
801e2f0: 35 6b ff ff addi r11,r11,-1
801e2f4: 21 6b ff ff andi r11,r11,0xffff
* @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);
801e2f8: 34 02 00 08 mvi r2,8
801e2fc: b9 60 08 00 mv r1,r11
801e300: fb ff 8c 9f calli 800157c <__lshrsi3>
801e304: 2b 82 00 34 lw r2,(sp+52)
801e308: 30 41 00 00 sb (r2+0),r1
801e30c: 2b 81 00 34 lw r1,(sp+52)
801e310: 30 2b 00 01 sb (r1+1),r11
rtems_rfs_buffer_mark_dirty (&handle->buffer);
801e314: 33 8d 00 38 sb (sp+56),r13
801e318: e0 00 00 20 bi 801e398 <rtems_rfs_unlink+0x27c>
else
{
/*
* Erasing the inode releases all blocks attached to it.
*/
rc = rtems_rfs_inode_delete (fs, &target_inode);
801e31c: b9 80 08 00 mv r1,r12
801e320: 37 82 00 28 addi r2,sp,40
801e324: fb ff c3 4f calli 800f060 <rtems_rfs_inode_delete>
801e328: b8 20 58 00 mv r11,r1
if (rc > 0)
801e32c: 4c 01 00 0b bge r0,r1,801e358 <rtems_rfs_unlink+0x23c> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
801e330: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801e334: 78 02 02 00 mvhi r2,0x200 <== NOT EXECUTED
801e338: fb ff ca 7c calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801e33c: 44 20 00 29 be r1,r0,801e3e0 <rtems_rfs_unlink+0x2c4> <== NOT EXECUTED
printf ("rtems-rfs: unlink: inode-del failed: %d: %s\n",
801e340: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e344: f8 00 15 87 calli 8023960 <strerror> <== NOT EXECUTED
801e348: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801e34c: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801e350: 38 21 90 f4 ori r1,r1,0x90f4 <== NOT EXECUTED
801e354: e0 00 00 21 bi 801e3d8 <rtems_rfs_unlink+0x2bc> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &parent_inode);
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
if (dir)
801e358: 45 e0 00 10 be r15,r0,801e398 <rtems_rfs_unlink+0x27c>
}
rc = rtems_rfs_inode_close (fs, &inode);
return rc;
}
801e35c: 2b 8e 00 5c lw r14,(sp+92)
return rc;
}
if (dir)
{
links = rtems_rfs_inode_get_links (&parent_inode);
801e360: b9 c0 08 00 mv r1,r14
801e364: fb ff fe d6 calli 801debc <rtems_rfs_inode_get_links.clone.1>
801e368: b8 20 58 00 mv r11,r1
if (links > 1)
801e36c: 51 a1 00 03 bgeu r13,r1,801e378 <rtems_rfs_unlink+0x25c>
links--;
801e370: 34 2b ff ff addi r11,r1,-1
801e374: 21 6b ff ff andi r11,r11,0xffff
* @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);
801e378: b9 60 08 00 mv r1,r11
801e37c: 34 02 00 08 mvi r2,8
801e380: fb ff 8c 7f calli 800157c <__lshrsi3>
801e384: 31 c1 00 00 sb (r14+0),r1
801e388: 2b 81 00 5c lw r1,(sp+92)
801e38c: 30 2b 00 01 sb (r1+1),r11
rtems_rfs_buffer_mark_dirty (&handle->buffer);
801e390: 34 01 00 01 mvi r1,1
801e394: 33 81 00 60 sb (sp+96),r1
rtems_rfs_inode_set_links (&parent_inode, links);
}
}
rc = rtems_rfs_inode_time_stamp_now (&parent_inode, true, true);
801e398: 37 8d 00 50 addi r13,sp,80
801e39c: b9 a0 08 00 mv r1,r13
801e3a0: 34 02 00 01 mvi r2,1
801e3a4: 34 03 00 01 mvi r3,1
801e3a8: fb ff c3 67 calli 800f144 <rtems_rfs_inode_time_stamp_now>
801e3ac: b8 20 58 00 mv r11,r1
if (rc > 0)
801e3b0: 4c 01 00 10 bge r0,r1,801e3f0 <rtems_rfs_unlink+0x2d4> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
801e3b4: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801e3b8: 78 02 02 00 mvhi r2,0x200 <== NOT EXECUTED
801e3bc: fb ff ca 5b calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801e3c0: 44 20 00 08 be r1,r0,801e3e0 <rtems_rfs_unlink+0x2c4> <== NOT EXECUTED
printf ("rtems-rfs: link: inode-time-stamp failed: %d: %s\n",
801e3c4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e3c8: f8 00 15 66 calli 8023960 <strerror> <== NOT EXECUTED
801e3cc: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801e3d0: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801e3d4: 38 21 91 24 ori r1,r1,0x9124 <== NOT EXECUTED
801e3d8: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801e3dc: f8 00 10 a6 calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_inode_close (fs, &parent_inode);
801e3e0: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801e3e4: 37 82 00 50 addi r2,sp,80 <== NOT EXECUTED
801e3e8: fb ff c2 f8 calli 800efc8 <rtems_rfs_inode_close> <== NOT EXECUTED
801e3ec: e0 00 00 11 bi 801e430 <rtems_rfs_unlink+0x314> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_inode_close (fs, &parent_inode);
801e3f0: b9 80 08 00 mv r1,r12
801e3f4: b9 a0 10 00 mv r2,r13
801e3f8: fb ff c2 f4 calli 800efc8 <rtems_rfs_inode_close>
801e3fc: b8 20 58 00 mv r11,r1
if (rc > 0)
801e400: 4c 01 00 10 bge r0,r1,801e440 <rtems_rfs_unlink+0x324> <== ALWAYS TAKEN
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
801e404: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801e408: 78 02 02 00 mvhi r2,0x200 <== NOT EXECUTED
801e40c: fb ff ca 47 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801e410: 44 20 00 08 be r1,r0,801e430 <rtems_rfs_unlink+0x314> <== NOT EXECUTED
printf ("rtems-rfs: link: parent inode-close failed: %d: %s\n",
801e414: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e418: f8 00 15 52 calli 8023960 <strerror> <== NOT EXECUTED
801e41c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801e420: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801e424: 38 21 91 58 ori r1,r1,0x9158 <== NOT EXECUTED
801e428: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801e42c: f8 00 10 92 calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_inode_close (fs, &target_inode);
801e430: b9 80 08 00 mv r1,r12
801e434: 37 82 00 28 addi r2,sp,40
801e438: fb ff c2 e4 calli 800efc8 <rtems_rfs_inode_close>
return rc;
801e43c: e0 00 00 11 bi 801e480 <rtems_rfs_unlink+0x364>
}
rc = rtems_rfs_inode_close (fs, &target_inode);
801e440: b9 80 08 00 mv r1,r12
801e444: 37 82 00 28 addi r2,sp,40
801e448: fb ff c2 e0 calli 800efc8 <rtems_rfs_inode_close>
801e44c: b8 20 58 00 mv r11,r1
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
801e450: 4c 01 00 0c bge r0,r1,801e480 <rtems_rfs_unlink+0x364> <== ALWAYS TAKEN
801e454: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
801e458: 78 02 02 00 mvhi r2,0x200 <== NOT EXECUTED
801e45c: fb ff ca 33 calli 8010d28 <rtems_rfs_trace> <== NOT EXECUTED
801e460: 44 20 00 08 be r1,r0,801e480 <rtems_rfs_unlink+0x364> <== NOT EXECUTED
printf ("rtems-rfs: link: target inode-close failed: %d: %s\n",
801e464: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801e468: f8 00 15 3e calli 8023960 <strerror> <== NOT EXECUTED
801e46c: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801e470: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED
801e474: 38 21 91 8c ori r1,r1,0x918c <== NOT EXECUTED
801e478: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
801e47c: f8 00 10 7e calli 8022674 <printf> <== NOT EXECUTED
rc, strerror (rc));
return rc;
}
801e480: b9 60 08 00 mv r1,r11
801e484: 2b 9d 00 04 lw ra,(sp+4)
801e488: 2b 8b 00 24 lw r11,(sp+36)
801e48c: 2b 8c 00 20 lw r12,(sp+32)
801e490: 2b 8d 00 1c lw r13,(sp+28)
801e494: 2b 8e 00 18 lw r14,(sp+24)
801e498: 2b 8f 00 14 lw r15,(sp+20)
801e49c: 2b 90 00 10 lw r16,(sp+16)
801e4a0: 2b 91 00 0c lw r17,(sp+12)
801e4a4: 2b 92 00 08 lw r18,(sp+8)
801e4a8: 37 9c 00 74 addi sp,sp,116
801e4ac: c3 a0 00 00 ret
0801f444 <rtems_shell_rfs_format>:
int
rtems_shell_rfs_format (int argc, char* argv[])
{
801f444: 37 9c ff b4 addi sp,sp,-76 <== NOT EXECUTED
801f448: 5b 8b 00 34 sw (sp+52),r11 <== NOT EXECUTED
801f44c: 5b 8c 00 30 sw (sp+48),r12 <== NOT EXECUTED
801f450: 5b 8d 00 2c sw (sp+44),r13 <== NOT EXECUTED
801f454: 5b 8e 00 28 sw (sp+40),r14 <== NOT EXECUTED
801f458: 5b 8f 00 24 sw (sp+36),r15 <== NOT EXECUTED
801f45c: 5b 90 00 20 sw (sp+32),r16 <== NOT EXECUTED
801f460: 5b 91 00 1c sw (sp+28),r17 <== NOT EXECUTED
801f464: 5b 92 00 18 sw (sp+24),r18 <== NOT EXECUTED
801f468: 5b 93 00 14 sw (sp+20),r19 <== NOT EXECUTED
801f46c: 5b 94 00 10 sw (sp+16),r20 <== NOT EXECUTED
801f470: 5b 95 00 0c sw (sp+12),r21 <== NOT EXECUTED
801f474: 5b 96 00 08 sw (sp+8),r22 <== NOT EXECUTED
801f478: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
rtems_rfs_format_config config;
const char* driver = NULL;
int arg;
memset (&config, 0, sizeof (rtems_rfs_format_config));
801f47c: 34 03 00 18 mvi r3,24 <== NOT EXECUTED
return 1;
}
int
rtems_shell_rfs_format (int argc, char* argv[])
{
801f480: b8 20 70 00 mv r14,r1 <== NOT EXECUTED
801f484: b8 40 68 00 mv r13,r2 <== NOT EXECUTED
rtems_rfs_format_config config;
const char* driver = NULL;
int arg;
memset (&config, 0, sizeof (rtems_rfs_format_config));
801f488: 37 81 00 38 addi r1,sp,56 <== NOT EXECUTED
801f48c: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801f490: f8 00 75 ee calli 803cc48 <memset> <== NOT EXECUTED
for (arg = 1; arg < argc; arg++)
801f494: 34 0b 00 01 mvi r11,1 <== NOT EXECUTED
int
rtems_shell_rfs_format (int argc, char* argv[])
{
rtems_rfs_format_config config;
const char* driver = NULL;
801f498: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
memset (&config, 0, sizeof (rtems_rfs_format_config));
for (arg = 1; arg < argc; arg++)
{
if (argv[arg][0] == '-')
801f49c: 34 16 00 2d mvi r22,45 <== NOT EXECUTED
{
switch (argv[arg][1])
801f4a0: 34 10 00 69 mvi r16,105 <== NOT EXECUTED
801f4a4: 34 15 00 73 mvi r21,115 <== NOT EXECUTED
801f4a8: 34 14 00 76 mvi r20,118 <== NOT EXECUTED
{
case 'v':
config.verbose = true;
801f4ac: 34 0f 00 01 mvi r15,1 <== NOT EXECUTED
for (arg = 1; arg < argc; arg++)
{
if (argv[arg][0] == '-')
{
switch (argv[arg][1])
801f4b0: 34 13 00 6f mvi r19,111 <== NOT EXECUTED
801f4b4: 34 12 00 49 mvi r18,73 <== NOT EXECUTED
801f4b8: 34 11 00 62 mvi r17,98 <== NOT EXECUTED
const char* driver = NULL;
int arg;
memset (&config, 0, sizeof (rtems_rfs_format_config));
for (arg = 1; arg < argc; arg++)
801f4bc: e0 00 00 5c bi 801f62c <rtems_shell_rfs_format+0x1e8> <== NOT EXECUTED
{
if (argv[arg][0] == '-')
801f4c0: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801f4c4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801f4c8: fb ff 83 4c calli 80001f8 <__ashlsi3> <== NOT EXECUTED
801f4cc: b5 a1 08 00 add r1,r13,r1 <== NOT EXECUTED
801f4d0: 28 22 00 00 lw r2,(r1+0) <== NOT EXECUTED
801f4d4: 40 41 00 00 lbu r1,(r2+0) <== NOT EXECUTED
801f4d8: 5c 36 00 4e bne r1,r22,801f610 <rtems_shell_rfs_format+0x1cc><== NOT EXECUTED
{
switch (argv[arg][1])
801f4dc: 40 43 00 01 lbu r3,(r2+1) <== NOT EXECUTED
801f4e0: 44 70 00 29 be r3,r16,801f584 <rtems_shell_rfs_format+0x140><== NOT EXECUTED
801f4e4: 54 70 00 04 bgu r3,r16,801f4f4 <rtems_shell_rfs_format+0xb0><== NOT EXECUTED
801f4e8: 44 72 00 36 be r3,r18,801f5c0 <rtems_shell_rfs_format+0x17c><== NOT EXECUTED
801f4ec: 5c 71 00 46 bne r3,r17,801f604 <rtems_shell_rfs_format+0x1c0><== NOT EXECUTED
801f4f0: e0 00 00 16 bi 801f548 <rtems_shell_rfs_format+0x104> <== NOT EXECUTED
801f4f4: 44 75 00 06 be r3,r21,801f50c <rtems_shell_rfs_format+0xc8><== NOT EXECUTED
801f4f8: 44 74 00 03 be r3,r20,801f504 <rtems_shell_rfs_format+0xc0><== NOT EXECUTED
801f4fc: 5c 73 00 42 bne r3,r19,801f604 <rtems_shell_rfs_format+0x1c0><== NOT EXECUTED
801f500: e0 00 00 32 bi 801f5c8 <rtems_shell_rfs_format+0x184> <== NOT EXECUTED
{
case 'v':
config.verbose = true;
801f504: 33 8f 00 4d sb (sp+77),r15 <== NOT EXECUTED
break;
801f508: e0 00 00 48 bi 801f628 <rtems_shell_rfs_format+0x1e4> <== NOT EXECUTED
case 's':
arg++;
801f50c: 35 6b 00 01 addi r11,r11,1 <== NOT EXECUTED
if (arg >= argc)
801f510: 49 cb 00 04 bg r14,r11,801f520 <rtems_shell_rfs_format+0xdc><== NOT EXECUTED
{
printf ("error: block size needs an argument\n");
801f514: 78 01 08 05 mvhi r1,0x805 <== NOT EXECUTED
801f518: 38 21 e3 10 ori r1,r1,0xe310 <== NOT EXECUTED
801f51c: e0 00 00 48 bi 801f63c <rtems_shell_rfs_format+0x1f8> <== NOT EXECUTED
return 1;
}
config.block_size = strtoul (argv[arg], 0, 0);
801f520: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801f524: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801f528: fb ff 83 34 calli 80001f8 <__ashlsi3> <== NOT EXECUTED
801f52c: b5 a1 08 00 add r1,r13,r1 <== NOT EXECUTED
801f530: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
801f534: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801f538: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
801f53c: f8 00 8a ec calli 80420ec <strtoul> <== NOT EXECUTED
801f540: 5b 81 00 38 sw (sp+56),r1 <== NOT EXECUTED
break;
801f544: e0 00 00 39 bi 801f628 <rtems_shell_rfs_format+0x1e4> <== NOT EXECUTED
case 'b':
arg++;
801f548: 35 6b 00 01 addi r11,r11,1 <== NOT EXECUTED
if (arg >= argc)
801f54c: 49 cb 00 04 bg r14,r11,801f55c <rtems_shell_rfs_format+0x118><== NOT EXECUTED
{
printf ("error: group block count needs an argument\n");
801f550: 78 01 08 05 mvhi r1,0x805 <== NOT EXECUTED
801f554: 38 21 e3 34 ori r1,r1,0xe334 <== NOT EXECUTED
801f558: e0 00 00 39 bi 801f63c <rtems_shell_rfs_format+0x1f8> <== NOT EXECUTED
return 1;
}
config.group_blocks = strtoul (argv[arg], 0, 0);
801f55c: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801f560: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801f564: fb ff 83 25 calli 80001f8 <__ashlsi3> <== NOT EXECUTED
801f568: b5 a1 08 00 add r1,r13,r1 <== NOT EXECUTED
801f56c: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
801f570: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801f574: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
801f578: f8 00 8a dd calli 80420ec <strtoul> <== NOT EXECUTED
801f57c: 5b 81 00 3c sw (sp+60),r1 <== NOT EXECUTED
break;
801f580: e0 00 00 2a bi 801f628 <rtems_shell_rfs_format+0x1e4> <== NOT EXECUTED
case 'i':
arg++;
801f584: 35 6b 00 01 addi r11,r11,1 <== NOT EXECUTED
if (arg >= argc)
801f588: 49 cb 00 04 bg r14,r11,801f598 <rtems_shell_rfs_format+0x154><== NOT EXECUTED
{
printf ("error: group inode count needs an argument\n");
801f58c: 78 01 08 05 mvhi r1,0x805 <== NOT EXECUTED
801f590: 38 21 e3 60 ori r1,r1,0xe360 <== NOT EXECUTED
801f594: e0 00 00 2a bi 801f63c <rtems_shell_rfs_format+0x1f8> <== NOT EXECUTED
return 1;
}
config.group_inodes = strtoul (argv[arg], 0, 0);
801f598: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801f59c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801f5a0: fb ff 83 16 calli 80001f8 <__ashlsi3> <== NOT EXECUTED
801f5a4: b5 a1 08 00 add r1,r13,r1 <== NOT EXECUTED
801f5a8: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
801f5ac: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801f5b0: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
801f5b4: f8 00 8a ce calli 80420ec <strtoul> <== NOT EXECUTED
801f5b8: 5b 81 00 40 sw (sp+64),r1 <== NOT EXECUTED
break;
801f5bc: e0 00 00 1b bi 801f628 <rtems_shell_rfs_format+0x1e4> <== NOT EXECUTED
case 'I':
config.initialise_inodes = true;
801f5c0: 33 8f 00 4c sb (sp+76),r15 <== NOT EXECUTED
break;
801f5c4: e0 00 00 19 bi 801f628 <rtems_shell_rfs_format+0x1e4> <== NOT EXECUTED
case 'o':
arg++;
801f5c8: 35 6b 00 01 addi r11,r11,1 <== NOT EXECUTED
if (arg >= argc)
801f5cc: 49 cb 00 04 bg r14,r11,801f5dc <rtems_shell_rfs_format+0x198><== NOT EXECUTED
{
printf ("error: inode percentage overhead needs an argument\n");
801f5d0: 78 01 08 05 mvhi r1,0x805 <== NOT EXECUTED
801f5d4: 38 21 e3 8c ori r1,r1,0xe38c <== NOT EXECUTED
801f5d8: e0 00 00 19 bi 801f63c <rtems_shell_rfs_format+0x1f8> <== NOT EXECUTED
return 1;
}
config.inode_overhead = strtoul (argv[arg], 0, 0);
801f5dc: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
801f5e0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
801f5e4: fb ff 83 05 calli 80001f8 <__ashlsi3> <== NOT EXECUTED
801f5e8: b5 a1 08 00 add r1,r13,r1 <== NOT EXECUTED
801f5ec: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
801f5f0: 34 02 00 00 mvi r2,0 <== NOT EXECUTED
801f5f4: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
801f5f8: f8 00 8a bd calli 80420ec <strtoul> <== NOT EXECUTED
801f5fc: 5b 81 00 44 sw (sp+68),r1 <== NOT EXECUTED
break;
801f600: e0 00 00 0a bi 801f628 <rtems_shell_rfs_format+0x1e4> <== NOT EXECUTED
default:
printf ("error: invalid option: %s\n", argv[arg]);
801f604: 78 01 08 05 mvhi r1,0x805 <== NOT EXECUTED
801f608: 38 21 c7 7c ori r1,r1,0xc77c <== NOT EXECUTED
801f60c: e0 00 00 04 bi 801f61c <rtems_shell_rfs_format+0x1d8> <== NOT EXECUTED
return 1;
}
}
else
{
if (!driver)
801f610: 45 80 00 05 be r12,r0,801f624 <rtems_shell_rfs_format+0x1e0><== NOT EXECUTED
driver = argv[arg];
else
{
printf ("error: only one driver name allowed: %s\n", argv[arg]);
801f614: 78 01 08 05 mvhi r1,0x805 <== NOT EXECUTED
801f618: 38 21 e3 c0 ori r1,r1,0xe3c0 <== NOT EXECUTED
801f61c: f8 00 7a 24 calli 803deac <printf> <== NOT EXECUTED
801f620: e0 00 00 16 bi 801f678 <rtems_shell_rfs_format+0x234> <== NOT EXECUTED
return 1;
}
}
else
{
if (!driver)
801f624: b8 40 60 00 mv r12,r2 <== NOT EXECUTED
const char* driver = NULL;
int arg;
memset (&config, 0, sizeof (rtems_rfs_format_config));
for (arg = 1; arg < argc; arg++)
801f628: 35 6b 00 01 addi r11,r11,1 <== NOT EXECUTED
801f62c: 49 cb ff a5 bg r14,r11,801f4c0 <rtems_shell_rfs_format+0x7c><== NOT EXECUTED
return 1;
}
}
}
if (!driver) {
801f630: 5d 80 00 05 bne r12,r0,801f644 <rtems_shell_rfs_format+0x200><== NOT EXECUTED
printf ("error: no driver name provided\n");
801f634: 78 01 08 05 mvhi r1,0x805 <== NOT EXECUTED
801f638: 38 21 e3 ec ori r1,r1,0xe3ec <== NOT EXECUTED
801f63c: f8 00 7a e4 calli 803e1cc <puts> <== NOT EXECUTED
801f640: e0 00 00 0e bi 801f678 <rtems_shell_rfs_format+0x234> <== NOT EXECUTED
return 1;
}
if (rtems_rfs_format (driver, &config) < 0)
801f644: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
801f648: 37 82 00 38 addi r2,sp,56 <== NOT EXECUTED
801f64c: f8 00 3d 45 calli 802eb60 <rtems_rfs_format> <== NOT EXECUTED
printf ("error: format of %s failed: %s\n",
driver, strerror (errno));
return 1;
}
return 0;
801f650: 34 03 00 00 mvi r3,0 <== NOT EXECUTED
if (!driver) {
printf ("error: no driver name provided\n");
return 1;
}
if (rtems_rfs_format (driver, &config) < 0)
801f654: 4c 20 00 0a bge r1,r0,801f67c <rtems_shell_rfs_format+0x238><== NOT EXECUTED
{
printf ("error: format of %s failed: %s\n",
driver, strerror (errno));
801f658: f8 00 65 cd calli 8038d8c <__errno> <== NOT EXECUTED
return 1;
}
if (rtems_rfs_format (driver, &config) < 0)
{
printf ("error: format of %s failed: %s\n",
801f65c: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED
801f660: f8 00 84 36 calli 8040738 <strerror> <== NOT EXECUTED
801f664: b8 20 18 00 mv r3,r1 <== NOT EXECUTED
801f668: 78 01 08 05 mvhi r1,0x805 <== NOT EXECUTED
801f66c: 38 21 e4 0c ori r1,r1,0xe40c <== NOT EXECUTED
801f670: b9 80 10 00 mv r2,r12 <== NOT EXECUTED
801f674: f8 00 7a 0e calli 803deac <printf> <== NOT EXECUTED
driver, strerror (errno));
return 1;
801f678: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
}
return 0;
}
801f67c: b8 60 08 00 mv r1,r3 <== NOT EXECUTED
801f680: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
801f684: 2b 8b 00 34 lw r11,(sp+52) <== NOT EXECUTED
801f688: 2b 8c 00 30 lw r12,(sp+48) <== NOT EXECUTED
801f68c: 2b 8d 00 2c lw r13,(sp+44) <== NOT EXECUTED
801f690: 2b 8e 00 28 lw r14,(sp+40) <== NOT EXECUTED
801f694: 2b 8f 00 24 lw r15,(sp+36) <== NOT EXECUTED
801f698: 2b 90 00 20 lw r16,(sp+32) <== NOT EXECUTED
801f69c: 2b 91 00 1c lw r17,(sp+28) <== NOT EXECUTED
801f6a0: 2b 92 00 18 lw r18,(sp+24) <== NOT EXECUTED
801f6a4: 2b 93 00 14 lw r19,(sp+20) <== NOT EXECUTED
801f6a8: 2b 94 00 10 lw r20,(sp+16) <== NOT EXECUTED
801f6ac: 2b 95 00 0c lw r21,(sp+12) <== NOT EXECUTED
801f6b0: 2b 96 00 08 lw r22,(sp+8) <== NOT EXECUTED
801f6b4: 37 9c 00 4c addi sp,sp,76 <== NOT EXECUTED
801f6b8: c3 a0 00 00 ret <== NOT EXECUTED
080141fc <rtems_signal_send>:
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
80141fc: 37 9c ff f4 addi sp,sp,-12
8014200: 5b 8b 00 08 sw (sp+8),r11
8014204: 5b 9d 00 04 sw (sp+4),ra
Objects_Locations location;
RTEMS_API_Control *api;
ASR_Information *asr;
if ( !signal_set )
return RTEMS_INVALID_NUMBER;
8014208: 34 03 00 0a mvi r3,10
rtems_status_code rtems_signal_send(
rtems_id id,
rtems_signal_set signal_set
)
{
801420c: b8 40 58 00 mv r11,r2
register Thread_Control *the_thread;
Objects_Locations location;
RTEMS_API_Control *api;
ASR_Information *asr;
if ( !signal_set )
8014210: 44 40 00 29 be r2,r0,80142b4 <rtems_signal_send+0xb8>
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
8014214: 37 82 00 0c addi r2,sp,12
8014218: f8 00 16 71 calli 8019bdc <_Thread_Get>
switch ( location ) {
801421c: 2b 82 00 0c lw r2,(sp+12)
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8014220: 34 03 00 04 mvi r3,4
if ( !signal_set )
return RTEMS_INVALID_NUMBER;
the_thread = _Thread_Get( id, &location );
switch ( location ) {
8014224: 5c 40 00 24 bne r2,r0,80142b4 <rtems_signal_send+0xb8>
case OBJECTS_LOCAL:
api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
8014228: 28 23 01 18 lw r3,(r1+280)
asr = &api->Signal;
if ( ! _ASR_Is_null_handler( asr->handler ) ) {
801422c: 28 64 00 0c lw r4,(r3+12)
8014230: 44 82 00 1f be r4,r2,80142ac <rtems_signal_send+0xb0>
if ( asr->is_enabled ) {
8014234: 40 62 00 08 lbu r2,(r3+8)
8014238: 44 40 00 12 be r2,r0,8014280 <rtems_signal_send+0x84>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
801423c: 90 00 10 00 rcsr r2,IE
8014240: 34 04 ff fe mvi r4,-2
8014244: a0 44 20 00 and r4,r2,r4
8014248: d0 04 00 00 wcsr IE,r4
*signal_set |= signals;
801424c: 28 64 00 14 lw r4,(r3+20)
8014250: b8 8b 58 00 or r11,r4,r11
8014254: 58 6b 00 14 sw (r3+20),r11
_ISR_Enable( _level );
8014258: d0 02 00 00 wcsr IE,r2
_ASR_Post_signals( signal_set, &asr->signals_posted );
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
801425c: 78 02 08 04 mvhi r2,0x804
8014260: 38 42 01 e0 ori r2,r2,0x1e0
8014264: 28 43 00 08 lw r3,(r2+8)
8014268: 44 60 00 0e be r3,r0,80142a0 <rtems_signal_send+0xa4>
801426c: 28 43 00 10 lw r3,(r2+16)
8014270: 5c 23 00 0c bne r1,r3,80142a0 <rtems_signal_send+0xa4> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
8014274: 34 01 00 01 mvi r1,1
8014278: 30 41 00 0c sb (r2+12),r1
801427c: e0 00 00 09 bi 80142a0 <rtems_signal_send+0xa4>
rtems_signal_set *signal_set
)
{
ISR_Level _level;
_ISR_Disable( _level );
8014280: 90 00 08 00 rcsr r1,IE
8014284: 34 02 ff fe mvi r2,-2
8014288: a0 22 10 00 and r2,r1,r2
801428c: d0 02 00 00 wcsr IE,r2
*signal_set |= signals;
8014290: 28 62 00 18 lw r2,(r3+24)
8014294: b8 4b 58 00 or r11,r2,r11
8014298: 58 6b 00 18 sw (r3+24),r11
_ISR_Enable( _level );
801429c: d0 01 00 00 wcsr IE,r1
} else {
_ASR_Post_signals( signal_set, &asr->signals_pending );
}
_Thread_Enable_dispatch();
80142a0: f8 00 16 43 calli 8019bac <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
80142a4: 34 03 00 00 mvi r3,0
80142a8: e0 00 00 03 bi 80142b4 <rtems_signal_send+0xb8>
}
_Thread_Enable_dispatch();
80142ac: f8 00 16 40 calli 8019bac <_Thread_Enable_dispatch>
return RTEMS_NOT_DEFINED;
80142b0: 34 03 00 0b mvi r3,11
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
}
80142b4: b8 60 08 00 mv r1,r3
80142b8: 2b 9d 00 04 lw ra,(sp+4)
80142bc: 2b 8b 00 08 lw r11,(sp+8)
80142c0: 37 9c 00 0c addi sp,sp,12
80142c4: c3 a0 00 00 ret
0800b6b4 <rtems_sparse_disk_create_and_register>:
const char *device_file_name,
uint32_t media_block_size,
rtems_blkdev_bnum blocks_with_buffer,
rtems_blkdev_bnum media_block_count,
uint8_t fill_pattern )
{
800b6b4: 37 9c ff e8 addi sp,sp,-24
800b6b8: 5b 8b 00 18 sw (sp+24),r11
800b6bc: 5b 8c 00 14 sw (sp+20),r12
800b6c0: 5b 8d 00 10 sw (sp+16),r13
800b6c4: 5b 8e 00 0c sw (sp+12),r14
800b6c8: 5b 8f 00 08 sw (sp+8),r15
800b6cc: 5b 9d 00 04 sw (sp+4),ra
800b6d0: b8 20 78 00 mv r15,r1
800b6d4: b8 40 60 00 mv r12,r2
const rtems_blkdev_bnum blocks_with_buffer )
{
size_t const key_table_size = blocks_with_buffer
* sizeof( rtems_sparse_disk_key );
size_t const data_size = blocks_with_buffer * media_block_size;
size_t const alloc_size = sizeof( rtems_sparse_disk )
800b6d8: 34 41 00 08 addi r1,r2,8
800b6dc: b8 60 10 00 mv r2,r3
const char *device_file_name,
uint32_t media_block_size,
rtems_blkdev_bnum blocks_with_buffer,
rtems_blkdev_bnum media_block_count,
uint8_t fill_pattern )
{
800b6e0: b8 60 58 00 mv r11,r3
800b6e4: b8 80 70 00 mv r14,r4
800b6e8: 20 ad 00 ff andi r13,r5,0xff
const rtems_blkdev_bnum blocks_with_buffer )
{
size_t const key_table_size = blocks_with_buffer
* sizeof( rtems_sparse_disk_key );
size_t const data_size = blocks_with_buffer * media_block_size;
size_t const alloc_size = sizeof( rtems_sparse_disk )
800b6ec: fb ff d7 0d calli 8001320 <__mulsi3>
+ key_table_size + data_size;
rtems_sparse_disk *const sd = (rtems_sparse_disk *) malloc(
800b6f0: 34 21 00 1c addi r1,r1,28
800b6f4: fb ff df cc calli 8003624 <malloc>
800b6f8: b8 20 40 00 mv r8,r1
media_block_count,
fill_pattern,
rtems_sparse_disk_free
);
} else {
sc = RTEMS_NO_MEMORY;
800b6fc: 34 07 00 1a mvi r7,26
rtems_sparse_disk *sparse_disk = sparse_disk_allocate(
media_block_size,
blocks_with_buffer
);
if ( sparse_disk != NULL ) {
800b700: 44 20 00 0b be r1,r0,800b72c <rtems_sparse_disk_create_and_register+0x78><== NEVER TAKEN
sc = rtems_sparse_disk_register(
800b704: 78 07 08 00 mvhi r7,0x800
800b708: 38 e7 b5 4c ori r7,r7,0xb54c
800b70c: b9 e0 08 00 mv r1,r15
800b710: b9 00 10 00 mv r2,r8
800b714: b9 80 18 00 mv r3,r12
800b718: b9 60 20 00 mv r4,r11
800b71c: b9 c0 28 00 mv r5,r14
800b720: b9 a0 30 00 mv r6,r13
800b724: fb ff ff 90 calli 800b564 <rtems_sparse_disk_register>
800b728: b8 20 38 00 mv r7,r1
} else {
sc = RTEMS_NO_MEMORY;
}
return sc;
}
800b72c: b8 e0 08 00 mv r1,r7
800b730: 2b 9d 00 04 lw ra,(sp+4)
800b734: 2b 8b 00 18 lw r11,(sp+24)
800b738: 2b 8c 00 14 lw r12,(sp+20)
800b73c: 2b 8d 00 10 lw r13,(sp+16)
800b740: 2b 8e 00 0c lw r14,(sp+12)
800b744: 2b 8f 00 08 lw r15,(sp+8)
800b748: 37 9c 00 18 addi sp,sp,24
800b74c: c3 a0 00 00 ret
0800b564 <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 )
{
800b564: 37 9c ff d8 addi sp,sp,-40
800b568: 5b 8b 00 28 sw (sp+40),r11
800b56c: 5b 8c 00 24 sw (sp+36),r12
800b570: 5b 8d 00 20 sw (sp+32),r13
800b574: 5b 8e 00 1c sw (sp+28),r14
800b578: 5b 8f 00 18 sw (sp+24),r15
800b57c: 5b 90 00 14 sw (sp+20),r16
800b580: 5b 91 00 10 sw (sp+16),r17
800b584: 5b 92 00 0c sw (sp+12),r18
800b588: 5b 93 00 08 sw (sp+8),r19
800b58c: 5b 9d 00 04 sw (sp+4),ra
sparse_disk_ioctl,
sparse_disk
);
}
} else {
sc = RTEMS_INVALID_NUMBER;
800b590: 34 08 00 0a mvi r8,10
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 )
{
800b594: b8 20 90 00 mv r18,r1
800b598: b8 40 58 00 mv r11,r2
800b59c: b8 60 68 00 mv r13,r3
800b5a0: b8 80 60 00 mv r12,r4
800b5a4: b8 a0 70 00 mv r14,r5
800b5a8: b8 e0 98 00 mv r19,r7
800b5ac: 20 d0 00 ff andi r16,r6,0xff
rtems_status_code sc;
if ( blocks_with_buffer <= media_block_count ) {
800b5b0: 54 85 00 34 bgu r4,r5,800b680 <rtems_sparse_disk_register+0x11c><== NEVER TAKEN
{
rtems_status_code sc;
rtems_blkdev_bnum i;
if ( NULL == sd )
return RTEMS_INVALID_ADDRESS;
800b5b4: 34 08 00 09 mvi r8,9
const uint8_t fill_pattern )
{
rtems_status_code sc;
rtems_blkdev_bnum i;
if ( NULL == sd )
800b5b8: 44 40 00 32 be r2,r0,800b680 <rtems_sparse_disk_register+0x11c><== NEVER TAKEN
return RTEMS_INVALID_ADDRESS;
uint8_t *data = (uint8_t *) sd;
size_t const key_table_size = blocks_with_buffer
800b5bc: b8 80 08 00 mv r1,r4
800b5c0: 34 02 00 03 mvi r2,3
800b5c4: fb ff d7 09 calli 80011e8 <__ashlsi3>
* 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 );
800b5c8: 34 31 00 1c addi r17,r1,28
800b5cc: ba 20 18 00 mv r3,r17
800b5d0: 34 02 00 00 mvi r2,0
if ( NULL == sd )
return RTEMS_INVALID_ADDRESS;
uint8_t *data = (uint8_t *) sd;
size_t const key_table_size = blocks_with_buffer
800b5d4: b8 20 78 00 mv r15,r1
* 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 );
800b5d8: b9 60 08 00 mv r1,r11
800b5dc: f8 00 41 2d calli 801ba90 <memset>
return RTEMS_INVALID_ADDRESS;
uint8_t *data = (uint8_t *) sd;
size_t const key_table_size = blocks_with_buffer
* sizeof( rtems_sparse_disk_key );
size_t const data_size = blocks_with_buffer * media_block_size;
800b5e0: b9 a0 10 00 mv r2,r13
memset( data, 0, sizeof( rtems_sparse_disk ) + key_table_size );
sd->fill_pattern = fill_pattern;
800b5e4: 31 70 00 14 sb (r11+20),r16
return RTEMS_INVALID_ADDRESS;
uint8_t *data = (uint8_t *) sd;
size_t const key_table_size = blocks_with_buffer
* sizeof( rtems_sparse_disk_key );
size_t const data_size = blocks_with_buffer * media_block_size;
800b5e8: b9 80 08 00 mv r1,r12
800b5ec: fb ff d7 4d calli 8001320 <__mulsi3>
800b5f0: b8 20 18 00 mv r3,r1
memset( data, 0, sizeof( rtems_sparse_disk ) + key_table_size );
sd->fill_pattern = fill_pattern;
memset( (uint8_t *) ( data + sizeof( rtems_sparse_disk ) + key_table_size ),
800b5f4: ba 00 10 00 mv r2,r16
800b5f8: b5 71 08 00 add r1,r11,r17
800b5fc: f8 00 41 25 calli 801ba90 <memset>
sd->fill_pattern,
data_size );
sd->delete_handler = sparse_disk_delete;
sc = rtems_semaphore_create(
800b600: 78 02 08 02 mvhi r2,0x802
800b604: 38 42 e5 d0 ori r2,r2,0xe5d0
800b608: 28 41 00 00 lw r1,(r2+0)
sd->fill_pattern = fill_pattern;
memset( (uint8_t *) ( data + sizeof( rtems_sparse_disk ) + key_table_size ),
sd->fill_pattern,
data_size );
sd->delete_handler = sparse_disk_delete;
800b60c: 59 73 00 10 sw (r11+16),r19
sc = rtems_semaphore_create(
800b610: 34 02 00 01 mvi r2,1
800b614: 34 03 00 54 mvi r3,84
800b618: 34 04 00 00 mvi r4,0
800b61c: b9 60 28 00 mv r5,r11
800b620: fb ff e7 e9 calli 80055c4 <rtems_semaphore_create>
800b624: b8 20 40 00 mv r8,r1
RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY,
0,
&sd->mutex
);
if ( sc != RTEMS_SUCCESSFUL ) {
800b628: 5c 20 00 16 bne r1,r0,800b680 <rtems_sparse_disk_register+0x11c><== NEVER TAKEN
return sc;
}
data += sizeof( rtems_sparse_disk );
800b62c: 35 66 00 1c addi r6,r11,28
sd->blocks_with_buffer = blocks_with_buffer;
sd->key_table = (rtems_sparse_disk_key *) data;
800b630: 59 66 00 18 sw (r11+24),r6
return sc;
}
data += sizeof( rtems_sparse_disk );
sd->blocks_with_buffer = blocks_with_buffer;
800b634: 59 6c 00 04 sw (r11+4),r12
sd->key_table = (rtems_sparse_disk_key *) data;
data += key_table_size;
800b638: b4 cf 30 00 add r6,r6,r15
800b63c: b9 60 20 00 mv r4,r11
for ( i = 0; i < blocks_with_buffer; ++i, data += media_block_size ) {
800b640: 34 02 00 00 mvi r2,0
800b644: e0 00 00 04 bi 800b654 <rtems_sparse_disk_register+0xf0>
sd->key_table[i].data = data;
800b648: 58 86 00 18 sw (r4+24),r6
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 ) {
800b64c: 34 42 00 01 addi r2,r2,1
800b650: b4 cd 30 00 add r6,r6,r13
800b654: 34 84 00 08 addi r4,r4,8
800b658: 55 82 ff fc bgu r12,r2,800b648 <rtems_sparse_disk_register+0xe4>
sparse_disk_delete,
fill_pattern
);
if ( RTEMS_SUCCESSFUL == sc ) {
sc = rtems_blkdev_create(
800b65c: 78 04 08 00 mvhi r4,0x800
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;
800b660: 59 6d 00 0c sw (r11+12),r13
sparse_disk_delete,
fill_pattern
);
if ( RTEMS_SUCCESSFUL == sc ) {
sc = rtems_blkdev_create(
800b664: ba 40 08 00 mv r1,r18
800b668: b9 a0 10 00 mv r2,r13
800b66c: b9 c0 18 00 mv r3,r14
800b670: 38 84 b2 70 ori r4,r4,0xb270
800b674: b9 60 28 00 mv r5,r11
800b678: f8 00 0c 35 calli 800e74c <rtems_blkdev_create>
800b67c: b8 20 40 00 mv r8,r1
} else {
sc = RTEMS_INVALID_NUMBER;
}
return sc;
}
800b680: b9 00 08 00 mv r1,r8
800b684: 2b 9d 00 04 lw ra,(sp+4)
800b688: 2b 8b 00 28 lw r11,(sp+40)
800b68c: 2b 8c 00 24 lw r12,(sp+36)
800b690: 2b 8d 00 20 lw r13,(sp+32)
800b694: 2b 8e 00 1c lw r14,(sp+28)
800b698: 2b 8f 00 18 lw r15,(sp+24)
800b69c: 2b 90 00 14 lw r16,(sp+20)
800b6a0: 2b 91 00 10 lw r17,(sp+16)
800b6a4: 2b 92 00 0c lw r18,(sp+12)
800b6a8: 2b 93 00 08 lw r19,(sp+8)
800b6ac: 37 9c 00 28 addi sp,sp,40
800b6b0: c3 a0 00 00 ret
08021288 <rtems_stack_checker_begin_extension>:
Thread_Control *the_thread
)
{
Stack_check_Control *the_pattern;
if ( the_thread->Object.id == 0 ) /* skip system tasks */
8021288: 28 22 00 08 lw r2,(r1+8)
802128c: 44 40 00 0c be r2,r0,80212bc <rtems_stack_checker_begin_extension+0x34><== NEVER TAKEN
return;
the_pattern = Stack_check_Get_pattern_area(&the_thread->Start.Initial_stack);
*the_pattern = Stack_check_Pattern;
8021290: 28 22 00 b8 lw r2,(r1+184)
8021294: 78 01 08 06 mvhi r1,0x806
8021298: 38 21 aa 94 ori r1,r1,0xaa94
802129c: 28 25 00 00 lw r5,(r1+0)
80212a0: 28 24 00 04 lw r4,(r1+4)
80212a4: 28 23 00 08 lw r3,(r1+8)
80212a8: 28 21 00 0c lw r1,(r1+12)
80212ac: 58 45 00 08 sw (r2+8),r5
80212b0: 58 44 00 0c sw (r2+12),r4
80212b4: 58 43 00 10 sw (r2+16),r3
80212b8: 58 41 00 14 sw (r2+20),r1
80212bc: c3 a0 00 00 ret
080211b4 <rtems_stack_checker_create_extension>:
*/
bool rtems_stack_checker_create_extension(
Thread_Control *running __attribute__((unused)),
Thread_Control *the_thread
)
{
80211b4: 37 9c ff f8 addi sp,sp,-8
80211b8: 5b 8b 00 08 sw (sp+8),r11
80211bc: 5b 9d 00 04 sw (sp+4),ra
static uint32_t pattern[ 4 ] = {
0xFEEDF00D, 0x0BAD0D06, /* FEED FOOD to BAD DOG */
0xDEADF00D, 0x600D0D06 /* DEAD FOOD but GOOD DOG */
};
if ( Stack_check_Initialized )
80211c0: 78 01 08 06 mvhi r1,0x806
80211c4: 38 21 9a 78 ori r1,r1,0x9a78
*/
bool rtems_stack_checker_create_extension(
Thread_Control *running __attribute__((unused)),
Thread_Control *the_thread
)
{
80211c8: b8 40 58 00 mv r11,r2
static uint32_t pattern[ 4 ] = {
0xFEEDF00D, 0x0BAD0D06, /* FEED FOOD to BAD DOG */
0xDEADF00D, 0x600D0D06 /* DEAD FOOD but GOOD DOG */
};
if ( Stack_check_Initialized )
80211cc: 28 22 00 00 lw r2,(r1+0)
80211d0: 5c 40 00 24 bne r2,r0,8021260 <rtems_stack_checker_create_extension+0xac>
/*
* Dope the pattern and fill areas
*/
p = Stack_check_Pattern.pattern;
for ( i = 0; i < PATTERN_SIZE_WORDS; i++ ) {
p[i] = pattern[ i%4 ];
80211d4: 78 04 08 05 mvhi r4,0x805
80211d8: 38 84 ee cc ori r4,r4,0xeecc
80211dc: 28 83 00 00 lw r3,(r4+0)
80211e0: 78 01 08 06 mvhi r1,0x806
80211e4: 78 04 08 05 mvhi r4,0x805
80211e8: 38 21 aa 94 ori r1,r1,0xaa94
80211ec: 38 84 ee d0 ori r4,r4,0xeed0
80211f0: 58 23 00 00 sw (r1+0),r3
80211f4: 28 83 00 00 lw r3,(r4+0)
80211f8: 78 04 08 05 mvhi r4,0x805
80211fc: 38 84 ee d4 ori r4,r4,0xeed4
8021200: 58 23 00 04 sw (r1+4),r3
8021204: 28 83 00 00 lw r3,(r4+0)
8021208: 78 04 08 05 mvhi r4,0x805
802120c: 38 84 ee d8 ori r4,r4,0xeed8
8021210: 58 23 00 08 sw (r1+8),r3
8021214: 28 83 00 00 lw r3,(r4+0)
8021218: 58 23 00 0c sw (r1+12),r3
/*
* If appropriate, setup the interrupt stack for high water testing
* also.
*/
#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
if (_CPU_Interrupt_stack_low && _CPU_Interrupt_stack_high) {
802121c: 78 03 08 06 mvhi r3,0x806
8021220: 38 63 a5 00 ori r3,r3,0xa500
8021224: 28 61 00 00 lw r1,(r3+0)
8021228: 44 22 00 0a be r1,r2,8021250 <rtems_stack_checker_create_extension+0x9c><== NEVER TAKEN
802122c: 28 63 00 04 lw r3,(r3+4)
8021230: 44 60 00 08 be r3,r0,8021250 <rtems_stack_checker_create_extension+0x9c><== NEVER TAKEN
Stack_check_Interrupt_stack.area = _CPU_Interrupt_stack_low;
8021234: 78 04 08 06 mvhi r4,0x806
8021238: 38 84 aa a4 ori r4,r4,0xaaa4
Stack_check_Interrupt_stack.size = (char *) _CPU_Interrupt_stack_high -
802123c: c8 61 18 00 sub r3,r3,r1
* If appropriate, setup the interrupt stack for high water testing
* also.
*/
#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
if (_CPU_Interrupt_stack_low && _CPU_Interrupt_stack_high) {
Stack_check_Interrupt_stack.area = _CPU_Interrupt_stack_low;
8021240: 58 81 00 04 sw (r4+4),r1
Stack_check_Interrupt_stack.size = (char *) _CPU_Interrupt_stack_high -
8021244: 58 83 00 00 sw (r4+0),r3
(char *) _CPU_Interrupt_stack_low;
Stack_check_Dope_stack(&Stack_check_Interrupt_stack);
8021248: 34 02 00 a5 mvi r2,165
802124c: f8 00 6e 7f calli 803cc48 <memset>
}
#endif
Stack_check_Initialized = 1;
8021250: 78 01 08 06 mvhi r1,0x806
8021254: 38 21 9a 78 ori r1,r1,0x9a78
8021258: 34 02 00 01 mvi r2,1
802125c: 58 22 00 00 sw (r1+0),r2
Thread_Control *the_thread
)
{
Stack_check_Initialize();
if (the_thread)
8021260: 45 60 00 05 be r11,r0,8021274 <rtems_stack_checker_create_extension+0xc0><== NEVER TAKEN
Stack_check_Dope_stack(&the_thread->Start.Initial_stack);
8021264: 29 61 00 b8 lw r1,(r11+184)
8021268: 29 63 00 b4 lw r3,(r11+180)
802126c: 34 02 00 a5 mvi r2,165
8021270: f8 00 6e 76 calli 803cc48 <memset>
return true;
}
8021274: 34 01 00 01 mvi r1,1
8021278: 2b 9d 00 04 lw ra,(sp+4)
802127c: 2b 8b 00 08 lw r11,(sp+8)
8021280: 37 9c 00 08 addi sp,sp,8
8021284: c3 a0 00 00 ret
080213f4 <rtems_stack_checker_is_blown>:
/*
* Check if blown
*/
bool rtems_stack_checker_is_blown( void )
{
80213f4: 37 9c ff f4 addi sp,sp,-12
80213f8: 5b 9b 00 08 sw (sp+8),fp
80213fc: 34 1b 00 0c mvi fp,12
8021400: b7 7c d8 00 add fp,fp,sp
8021404: 5b 8b 00 0c sw (sp+12),r11
8021408: 5b 9d 00 04 sw (sp+4),ra
Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack;
802140c: 78 01 08 06 mvhi r1,0x806
8021410: 38 21 a5 00 ori r1,r1,0xa500
8021414: 28 22 00 10 lw r2,(r1+16)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
return false;
8021418: 34 0b 00 00 mvi r11,0
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
802141c: 28 41 00 b8 lw r1,(r2+184)
8021420: 54 3b 00 04 bgu r1,fp,8021430 <rtems_stack_checker_is_blown+0x3c><== NEVER TAKEN
return false;
}
if ( sp > (the_stack->area + the_stack->size) ) {
8021424: 28 4b 00 b4 lw r11,(r2+180)
}
/*
* Check if blown
*/
bool rtems_stack_checker_is_blown( void )
8021428: b4 2b 58 00 add r11,r1,r11
802142c: f1 7b 58 00 cmpgeu r11,r11,fp
/*
* The stack checker must be initialized before the pattern is there
* to check.
*/
if ( Stack_check_Initialized ) {
8021430: 78 02 08 06 mvhi r2,0x806
8021434: 38 42 9a 78 ori r2,r2,0x9a78
8021438: 28 43 00 00 lw r3,(r2+0)
*/
bool rtems_stack_checker_is_blown( void )
{
Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack;
bool sp_ok;
bool pattern_ok = true;
802143c: 34 02 00 01 mvi r2,1
/*
* The stack checker must be initialized before the pattern is there
* to check.
*/
if ( Stack_check_Initialized ) {
8021440: 44 60 00 07 be r3,r0,802145c <rtems_stack_checker_is_blown+0x68><== NEVER TAKEN
pattern_ok = (!memcmp(
8021444: 78 02 08 06 mvhi r2,0x806
8021448: 38 42 aa 94 ori r2,r2,0xaa94
802144c: 34 21 00 08 addi r1,r1,8
8021450: 34 03 00 10 mvi r3,16
8021454: f8 00 6d 4e calli 803c98c <memcmp>
8021458: 64 22 00 00 cmpei r2,r1,0
/*
* Let's report as much as we can.
*/
if ( !sp_ok || !pattern_ok ) {
802145c: 45 60 00 02 be r11,r0,8021464 <rtems_stack_checker_is_blown+0x70><== NEVER TAKEN
8021460: 5c 40 00 05 bne r2,r0,8021474 <rtems_stack_checker_is_blown+0x80><== ALWAYS TAKEN
Stack_check_report_blown_task( _Thread_Executing, pattern_ok );
8021464: 78 01 08 06 mvhi r1,0x806 <== NOT EXECUTED
8021468: 38 21 a5 00 ori r1,r1,0xa500 <== NOT EXECUTED
802146c: 28 21 00 10 lw r1,(r1+16) <== NOT EXECUTED
8021470: fb ff ff 94 calli 80212c0 <Stack_check_report_blown_task> <== NOT EXECUTED
/*
* The Stack Pointer and the Pattern Area are OK so return false.
*/
return false;
}
8021474: 34 01 00 00 mvi r1,0
8021478: 2b 9d 00 04 lw ra,(sp+4)
802147c: 2b 8b 00 0c lw r11,(sp+12)
8021480: 2b 9b 00 08 lw fp,(sp+8)
8021484: 37 9c 00 0c addi sp,sp,12
8021488: c3 a0 00 00 ret
0802148c <rtems_stack_checker_report_usage_with_plugin>:
void rtems_stack_checker_report_usage_with_plugin(
void *context,
rtems_printk_plugin_t print
)
{
802148c: 37 9c ff ec addi sp,sp,-20
8021490: 5b 8b 00 14 sw (sp+20),r11
8021494: 5b 8c 00 10 sw (sp+16),r12
8021498: 5b 8d 00 0c sw (sp+12),r13
802149c: 5b 8e 00 08 sw (sp+8),r14
80214a0: 5b 9d 00 04 sw (sp+4),ra
80214a4: b8 20 70 00 mv r14,r1
80214a8: b8 40 68 00 mv r13,r2
if ( !print )
80214ac: 44 40 00 15 be r2,r0,8021500 <rtems_stack_checker_report_usage_with_plugin+0x74><== NEVER TAKEN
return;
print_context = context;
print_handler = print;
80214b0: 78 0b 08 06 mvhi r11,0x806
80214b4: 39 6b 9a 74 ori r11,r11,0x9a74
)
{
if ( !print )
return;
print_context = context;
80214b8: 78 0c 08 06 mvhi r12,0x806
80214bc: 39 8c 9a 70 ori r12,r12,0x9a70
print_handler = print;
80214c0: 59 62 00 00 sw (r11+0),r2
(*print)( context, "Stack usage by thread\n");
80214c4: 78 02 08 05 mvhi r2,0x805
80214c8: 38 42 ee 64 ori r2,r2,0xee64
)
{
if ( !print )
return;
print_context = context;
80214cc: 59 81 00 00 sw (r12+0),r1
print_handler = print;
(*print)( context, "Stack usage by thread\n");
80214d0: d9 a0 00 00 call r13
(*print)( context,
80214d4: 78 02 08 05 mvhi r2,0x805
80214d8: 38 42 ee 7c ori r2,r2,0xee7c
80214dc: b9 c0 08 00 mv r1,r14
80214e0: d9 a0 00 00 call r13
" ID NAME LOW HIGH CURRENT AVAILABLE USED\n"
);
/* iterate over all threads and dump the usage */
rtems_iterate_over_all_threads( Stack_check_Dump_threads_usage );
80214e4: 78 01 08 02 mvhi r1,0x802
80214e8: 38 21 0f ec ori r1,r1,0xfec
80214ec: f8 00 16 44 calli 8026dfc <rtems_iterate_over_all_threads>
#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
/* dump interrupt stack info if any */
Stack_check_Dump_threads_usage((Thread_Control *) -1);
80214f0: 34 01 ff ff mvi r1,-1
80214f4: fb ff fe be calli 8020fec <Stack_check_Dump_threads_usage>
#endif
print_context = NULL;
80214f8: 59 80 00 00 sw (r12+0),r0
print_handler = NULL;
80214fc: 59 60 00 00 sw (r11+0),r0
}
8021500: 2b 9d 00 04 lw ra,(sp+4)
8021504: 2b 8b 00 14 lw r11,(sp+20)
8021508: 2b 8c 00 10 lw r12,(sp+16)
802150c: 2b 8d 00 0c lw r13,(sp+12)
8021510: 2b 8e 00 08 lw r14,(sp+8)
8021514: 37 9c 00 14 addi sp,sp,20
8021518: c3 a0 00 00 ret
0802137c <rtems_stack_checker_switch_extension>:
*/
void rtems_stack_checker_switch_extension(
Thread_Control *running __attribute__((unused)),
Thread_Control *heir __attribute__((unused))
)
{
802137c: 37 9c ff f0 addi sp,sp,-16
8021380: 5b 9b 00 08 sw (sp+8),fp
8021384: 34 1b 00 10 mvi fp,16
8021388: b7 7c d8 00 add fp,fp,sp
802138c: 5b 8b 00 10 sw (sp+16),r11
8021390: 5b 8c 00 0c sw (sp+12),r12
8021394: 5b 9d 00 04 sw (sp+4),ra
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);
8021398: 28 22 00 b8 lw r2,(r1+184)
*/
void rtems_stack_checker_switch_extension(
Thread_Control *running __attribute__((unused)),
Thread_Control *heir __attribute__((unused))
)
{
802139c: b8 20 58 00 mv r11,r1
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
return false;
80213a0: 34 0c 00 00 mvi r12,0
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);
80213a4: 34 41 00 08 addi r1,r2,8
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
80213a8: 54 5b 00 04 bgu r2,fp,80213b8 <rtems_stack_checker_switch_extension+0x3c><== NEVER TAKEN
return false;
}
if ( sp > (the_stack->area + the_stack->size) ) {
80213ac: 29 6c 00 b4 lw r12,(r11+180)
}
/*
* rtems_stack_checker_switch_extension
*/
void rtems_stack_checker_switch_extension(
80213b0: b4 4c 10 00 add r2,r2,r12
80213b4: f0 5b 60 00 cmpgeu r12,r2,fp
/*
* 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,
80213b8: 78 02 08 06 mvhi r2,0x806
80213bc: 38 42 aa 94 ori r2,r2,0xaa94
80213c0: 34 03 00 10 mvi r3,16
80213c4: f8 00 6d 72 calli 803c98c <memcmp>
80213c8: 64 22 00 00 cmpei r2,r1,0
(void *) Stack_check_Pattern.pattern, PATTERN_SIZE_BYTES));
if ( !sp_ok || !pattern_ok ) {
80213cc: 45 80 00 02 be r12,r0,80213d4 <rtems_stack_checker_switch_extension+0x58><== NEVER TAKEN
80213d0: 5c 40 00 03 bne r2,r0,80213dc <rtems_stack_checker_switch_extension+0x60>
Stack_check_report_blown_task( running, pattern_ok );
80213d4: b9 60 08 00 mv r1,r11
80213d8: fb ff ff ba calli 80212c0 <Stack_check_report_blown_task>
}
}
80213dc: 2b 9d 00 04 lw ra,(sp+4)
80213e0: 2b 8b 00 10 lw r11,(sp+16)
80213e4: 2b 8c 00 0c lw r12,(sp+12)
80213e8: 2b 9b 00 08 lw fp,(sp+8)
80213ec: 37 9c 00 10 addi sp,sp,16
80213f0: c3 a0 00 00 ret
08009d28 <rtems_string_to_double>:
rtems_status_code rtems_string_to_double (
const char *s,
double *n,
char **endptr
)
{
8009d28: 37 9c ff e0 addi sp,sp,-32
8009d2c: 5b 8b 00 1c sw (sp+28),r11
8009d30: 5b 8c 00 18 sw (sp+24),r12
8009d34: 5b 8d 00 14 sw (sp+20),r13
8009d38: 5b 8e 00 10 sw (sp+16),r14
8009d3c: 5b 8f 00 0c sw (sp+12),r15
8009d40: 5b 90 00 08 sw (sp+8),r16
8009d44: 5b 9d 00 04 sw (sp+4),ra
double result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
8009d48: 34 0c 00 09 mvi r12,9
rtems_status_code rtems_string_to_double (
const char *s,
double *n,
char **endptr
)
{
8009d4c: b8 20 78 00 mv r15,r1
8009d50: b8 40 58 00 mv r11,r2
8009d54: b8 60 80 00 mv r16,r3
double result;
char *end;
if ( !n )
8009d58: 44 40 00 2e be r2,r0,8009e10 <rtems_string_to_double+0xe8>
return RTEMS_INVALID_ADDRESS;
errno = 0;
8009d5c: f8 00 10 4e calli 800de94 <__errno>
8009d60: 58 20 00 00 sw (r1+0),r0
*n = 0;
8009d64: 59 60 00 00 sw (r11+0),r0
8009d68: 59 60 00 04 sw (r11+4),r0
result = strtod( s, &end );
8009d6c: b9 e0 08 00 mv r1,r15
8009d70: 37 82 00 20 addi r2,sp,32
8009d74: f8 00 1b 5e calli 8010aec <strtod>
8009d78: b8 20 70 00 mv r14,r1
8009d7c: b8 40 68 00 mv r13,r2
if ( endptr )
8009d80: 46 00 00 03 be r16,r0,8009d8c <rtems_string_to_double+0x64>
*endptr = end;
8009d84: 2b 81 00 20 lw r1,(sp+32)
8009d88: 5a 01 00 00 sw (r16+0),r1
if ( end == s )
8009d8c: 2b 81 00 20 lw r1,(sp+32)
return RTEMS_NOT_DEFINED;
8009d90: 34 0c 00 0b mvi r12,11
result = strtod( s, &end );
if ( endptr )
*endptr = end;
if ( end == s )
8009d94: 44 2f 00 1f be r1,r15,8009e10 <rtems_string_to_double+0xe8>
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
8009d98: f8 00 10 3f calli 800de94 <__errno>
8009d9c: 28 22 00 00 lw r2,(r1+0)
8009da0: 34 01 00 22 mvi r1,34
8009da4: 5c 41 00 18 bne r2,r1,8009e04 <rtems_string_to_double+0xdc>
8009da8: b9 c0 08 00 mv r1,r14
8009dac: b9 a0 10 00 mv r2,r13
8009db0: 34 03 00 00 mvi r3,0
8009db4: 34 04 00 00 mvi r4,0
8009db8: fb ff e4 d6 calli 8003110 <__eqdf2>
(( result == 0 ) || ( result == HUGE_VAL ) || ( result == -HUGE_VAL )))
return RTEMS_INVALID_NUMBER;
8009dbc: 34 0c 00 0a mvi r12,10
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
8009dc0: 44 20 00 14 be r1,r0,8009e10 <rtems_string_to_double+0xe8> <== NEVER TAKEN
(( result == 0 ) || ( result == HUGE_VAL ) || ( result == -HUGE_VAL )))
8009dc4: 78 04 08 02 mvhi r4,0x802
8009dc8: 38 84 1d a0 ori r4,r4,0x1da0
8009dcc: 28 83 00 00 lw r3,(r4+0)
8009dd0: b9 c0 08 00 mv r1,r14
8009dd4: b9 a0 10 00 mv r2,r13
8009dd8: 34 04 ff ff mvi r4,-1
8009ddc: f8 00 4b 17 calli 801ca38 <__gedf2>
8009de0: 48 20 00 0c bg r1,r0,8009e10 <rtems_string_to_double+0xe8>
8009de4: 78 04 08 02 mvhi r4,0x802
8009de8: 38 84 1d a4 ori r4,r4,0x1da4
8009dec: 28 83 00 00 lw r3,(r4+0)
8009df0: b9 c0 08 00 mv r1,r14
8009df4: b9 a0 10 00 mv r2,r13
8009df8: 34 04 ff ff mvi r4,-1
8009dfc: f8 00 4b 78 calli 801cbdc <__ledf2>
8009e00: 48 01 00 04 bg r0,r1,8009e10 <rtems_string_to_double+0xe8> <== ALWAYS TAKEN
return RTEMS_INVALID_NUMBER;
*n = result;
8009e04: 59 6e 00 00 sw (r11+0),r14
8009e08: 59 6d 00 04 sw (r11+4),r13
return RTEMS_SUCCESSFUL;
8009e0c: 34 0c 00 00 mvi r12,0
}
8009e10: b9 80 08 00 mv r1,r12
8009e14: 2b 9d 00 04 lw ra,(sp+4)
8009e18: 2b 8b 00 1c lw r11,(sp+28)
8009e1c: 2b 8c 00 18 lw r12,(sp+24)
8009e20: 2b 8d 00 14 lw r13,(sp+20)
8009e24: 2b 8e 00 10 lw r14,(sp+16)
8009e28: 2b 8f 00 0c lw r15,(sp+12)
8009e2c: 2b 90 00 08 lw r16,(sp+8)
8009e30: 37 9c 00 20 addi sp,sp,32
8009e34: c3 a0 00 00 ret
08009e38 <rtems_string_to_float>:
rtems_status_code rtems_string_to_float (
const char *s,
float *n,
char **endptr
)
{
8009e38: 37 9c ff e4 addi sp,sp,-28
8009e3c: 5b 8b 00 18 sw (sp+24),r11
8009e40: 5b 8c 00 14 sw (sp+20),r12
8009e44: 5b 8d 00 10 sw (sp+16),r13
8009e48: 5b 8e 00 0c sw (sp+12),r14
8009e4c: 5b 8f 00 08 sw (sp+8),r15
8009e50: 5b 9d 00 04 sw (sp+4),ra
float result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
8009e54: 34 0b 00 09 mvi r11,9
rtems_status_code rtems_string_to_float (
const char *s,
float *n,
char **endptr
)
{
8009e58: b8 20 70 00 mv r14,r1
8009e5c: b8 40 68 00 mv r13,r2
8009e60: b8 60 78 00 mv r15,r3
float result;
char *end;
if ( !n )
8009e64: 44 40 00 25 be r2,r0,8009ef8 <rtems_string_to_float+0xc0>
return RTEMS_INVALID_ADDRESS;
errno = 0;
8009e68: f8 00 10 0b calli 800de94 <__errno>
8009e6c: 58 20 00 00 sw (r1+0),r0
*n = 0;
8009e70: 59 a0 00 00 sw (r13+0),r0
result = strtof( s, &end );
8009e74: b9 c0 08 00 mv r1,r14
8009e78: 37 82 00 1c addi r2,sp,28
8009e7c: f8 00 1b 28 calli 8010b1c <strtof>
8009e80: b8 20 60 00 mv r12,r1
if ( endptr )
8009e84: 45 e0 00 03 be r15,r0,8009e90 <rtems_string_to_float+0x58>
*endptr = end;
8009e88: 2b 81 00 1c lw r1,(sp+28)
8009e8c: 59 e1 00 00 sw (r15+0),r1
if ( end == s )
8009e90: 2b 81 00 1c lw r1,(sp+28)
return RTEMS_NOT_DEFINED;
8009e94: 34 0b 00 0b mvi r11,11
result = strtof( s, &end );
if ( endptr )
*endptr = end;
if ( end == s )
8009e98: 44 2e 00 18 be r1,r14,8009ef8 <rtems_string_to_float+0xc0>
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
8009e9c: f8 00 0f fe calli 800de94 <__errno>
8009ea0: 28 22 00 00 lw r2,(r1+0)
8009ea4: 34 01 00 22 mvi r1,34
8009ea8: 5c 41 00 12 bne r2,r1,8009ef0 <rtems_string_to_float+0xb8>
8009eac: b9 80 08 00 mv r1,r12
8009eb0: 34 02 00 00 mvi r2,0
8009eb4: fb ff e4 5f calli 8003030 <__eqsf2>
(( result == 0 ) || ( result == HUGE_VALF ) || ( result == -HUGE_VALF )))
return RTEMS_INVALID_NUMBER;
8009eb8: 34 0b 00 0a mvi r11,10
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
8009ebc: 44 20 00 0f be r1,r0,8009ef8 <rtems_string_to_float+0xc0> <== NEVER TAKEN
(( result == 0 ) || ( result == HUGE_VALF ) || ( result == -HUGE_VALF )))
8009ec0: 78 03 08 02 mvhi r3,0x802
8009ec4: 38 63 1d a8 ori r3,r3,0x1da8
8009ec8: 28 62 00 00 lw r2,(r3+0)
8009ecc: b9 80 08 00 mv r1,r12
8009ed0: f8 00 44 8f calli 801b10c <__gesf2>
8009ed4: 48 20 00 09 bg r1,r0,8009ef8 <rtems_string_to_float+0xc0>
8009ed8: 78 03 08 02 mvhi r3,0x802
8009edc: 38 63 1d ac ori r3,r3,0x1dac
8009ee0: 28 62 00 00 lw r2,(r3+0)
8009ee4: b9 80 08 00 mv r1,r12
8009ee8: f8 00 44 db calli 801b254 <__lesf2>
8009eec: 48 01 00 03 bg r0,r1,8009ef8 <rtems_string_to_float+0xc0> <== ALWAYS TAKEN
return RTEMS_INVALID_NUMBER;
*n = result;
8009ef0: 59 ac 00 00 sw (r13+0),r12
return RTEMS_SUCCESSFUL;
8009ef4: 34 0b 00 00 mvi r11,0
}
8009ef8: b9 60 08 00 mv r1,r11
8009efc: 2b 9d 00 04 lw ra,(sp+4)
8009f00: 2b 8b 00 18 lw r11,(sp+24)
8009f04: 2b 8c 00 14 lw r12,(sp+20)
8009f08: 2b 8d 00 10 lw r13,(sp+16)
8009f0c: 2b 8e 00 0c lw r14,(sp+12)
8009f10: 2b 8f 00 08 lw r15,(sp+8)
8009f14: 37 9c 00 1c addi sp,sp,28
8009f18: c3 a0 00 00 ret
0801b75c <rtems_string_to_int>:
const char *s,
int *n,
char **endptr,
int base
)
{
801b75c: 37 9c ff e8 addi sp,sp,-24
801b760: 5b 8b 00 14 sw (sp+20),r11
801b764: 5b 8c 00 10 sw (sp+16),r12
801b768: 5b 8d 00 0c sw (sp+12),r13
801b76c: 5b 8e 00 08 sw (sp+8),r14
801b770: 5b 9d 00 04 sw (sp+4),ra
long result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
801b774: 34 05 00 09 mvi r5,9
const char *s,
int *n,
char **endptr,
int base
)
{
801b778: b8 20 68 00 mv r13,r1
801b77c: b8 40 60 00 mv r12,r2
801b780: b8 60 70 00 mv r14,r3
801b784: b8 80 58 00 mv r11,r4
long result;
char *end;
if ( !n )
801b788: 44 40 00 1f be r2,r0,801b804 <rtems_string_to_int+0xa8>
return RTEMS_INVALID_ADDRESS;
errno = 0;
801b78c: f8 00 75 80 calli 8038d8c <__errno>
801b790: 58 20 00 00 sw (r1+0),r0
*n = 0;
result = strtol( s, &end, base );
801b794: b9 60 18 00 mv r3,r11
if ( !n )
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
801b798: 59 80 00 00 sw (r12+0),r0
result = strtol( s, &end, base );
801b79c: b9 a0 08 00 mv r1,r13
801b7a0: 37 82 00 18 addi r2,sp,24
801b7a4: f8 00 98 d9 calli 8041b08 <strtol>
801b7a8: b8 20 58 00 mv r11,r1
if ( endptr )
801b7ac: 45 c0 00 03 be r14,r0,801b7b8 <rtems_string_to_int+0x5c>
*endptr = end;
801b7b0: 2b 81 00 18 lw r1,(sp+24)
801b7b4: 59 c1 00 00 sw (r14+0),r1
if ( end == s )
801b7b8: 2b 81 00 18 lw r1,(sp+24)
return RTEMS_NOT_DEFINED;
801b7bc: 34 05 00 0b mvi r5,11
result = strtol( s, &end, base );
if ( endptr )
*endptr = end;
if ( end == s )
801b7c0: 44 2d 00 11 be r1,r13,801b804 <rtems_string_to_int+0xa8>
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
801b7c4: f8 00 75 72 calli 8038d8c <__errno>
801b7c8: 28 22 00 00 lw r2,(r1+0)
801b7cc: 34 01 00 22 mvi r1,34
801b7d0: 5c 41 00 0b bne r2,r1,801b7fc <rtems_string_to_int+0xa0>
(( result == 0 ) || ( result == LONG_MAX ) || ( result == LONG_MIN )))
801b7d4: 78 02 08 05 mvhi r2,0x805
801b7d8: 38 42 d7 d8 ori r2,r2,0xd7d8
801b7dc: 28 41 00 00 lw r1,(r2+0)
801b7e0: 65 62 00 00 cmpei r2,r11,0
return RTEMS_INVALID_NUMBER;
801b7e4: 34 05 00 0a mvi r5,10
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
(( result == 0 ) || ( result == LONG_MAX ) || ( result == LONG_MIN )))
801b7e8: e5 61 08 00 cmpe r1,r11,r1
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
801b7ec: b8 22 08 00 or r1,r1,r2
801b7f0: 5c 20 00 05 bne r1,r0,801b804 <rtems_string_to_int+0xa8>
(( result == 0 ) || ( result == LONG_MAX ) || ( result == LONG_MIN )))
801b7f4: 78 01 80 00 mvhi r1,0x8000
801b7f8: 45 61 00 03 be r11,r1,801b804 <rtems_string_to_int+0xa8> <== ALWAYS TAKEN
errno = ERANGE;
return RTEMS_INVALID_NUMBER;
}
#endif
*n = result;
801b7fc: 59 8b 00 00 sw (r12+0),r11
return RTEMS_SUCCESSFUL;
801b800: 34 05 00 00 mvi r5,0
}
801b804: b8 a0 08 00 mv r1,r5
801b808: 2b 9d 00 04 lw ra,(sp+4)
801b80c: 2b 8b 00 14 lw r11,(sp+20)
801b810: 2b 8c 00 10 lw r12,(sp+16)
801b814: 2b 8d 00 0c lw r13,(sp+12)
801b818: 2b 8e 00 08 lw r14,(sp+8)
801b81c: 37 9c 00 18 addi sp,sp,24
801b820: c3 a0 00 00 ret
0800a0d4 <rtems_string_to_long>:
const char *s,
long *n,
char **endptr,
int base
)
{
800a0d4: 37 9c ff e8 addi sp,sp,-24
800a0d8: 5b 8b 00 14 sw (sp+20),r11
800a0dc: 5b 8c 00 10 sw (sp+16),r12
800a0e0: 5b 8d 00 0c sw (sp+12),r13
800a0e4: 5b 8e 00 08 sw (sp+8),r14
800a0e8: 5b 9d 00 04 sw (sp+4),ra
long result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
800a0ec: 34 05 00 09 mvi r5,9
const char *s,
long *n,
char **endptr,
int base
)
{
800a0f0: b8 20 68 00 mv r13,r1
800a0f4: b8 40 60 00 mv r12,r2
800a0f8: b8 60 70 00 mv r14,r3
800a0fc: b8 80 58 00 mv r11,r4
long result;
char *end;
if ( !n )
800a100: 44 40 00 1f be r2,r0,800a17c <rtems_string_to_long+0xa8>
return RTEMS_INVALID_ADDRESS;
errno = 0;
800a104: f8 00 0f 64 calli 800de94 <__errno>
800a108: 58 20 00 00 sw (r1+0),r0
*n = 0;
result = strtol( s, &end, base );
800a10c: b9 60 18 00 mv r3,r11
if ( !n )
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
800a110: 59 80 00 00 sw (r12+0),r0
result = strtol( s, &end, base );
800a114: b9 a0 08 00 mv r1,r13
800a118: 37 82 00 18 addi r2,sp,24
800a11c: f8 00 1b 33 calli 8010de8 <strtol>
800a120: b8 20 58 00 mv r11,r1
if ( endptr )
800a124: 45 c0 00 03 be r14,r0,800a130 <rtems_string_to_long+0x5c>
*endptr = end;
800a128: 2b 81 00 18 lw r1,(sp+24)
800a12c: 59 c1 00 00 sw (r14+0),r1
if ( end == s )
800a130: 2b 81 00 18 lw r1,(sp+24)
return RTEMS_NOT_DEFINED;
800a134: 34 05 00 0b mvi r5,11
result = strtol( s, &end, base );
if ( endptr )
*endptr = end;
if ( end == s )
800a138: 44 2d 00 11 be r1,r13,800a17c <rtems_string_to_long+0xa8>
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
800a13c: f8 00 0f 56 calli 800de94 <__errno>
800a140: 28 22 00 00 lw r2,(r1+0)
800a144: 34 01 00 22 mvi r1,34
800a148: 5c 41 00 0b bne r2,r1,800a174 <rtems_string_to_long+0xa0>
(( result == 0 ) || ( result == LONG_MAX ) || ( result == LONG_MIN )))
800a14c: 78 02 08 02 mvhi r2,0x802
800a150: 38 42 14 d8 ori r2,r2,0x14d8
800a154: 28 41 00 00 lw r1,(r2+0)
800a158: 65 62 00 00 cmpei r2,r11,0
return RTEMS_INVALID_NUMBER;
800a15c: 34 05 00 0a mvi r5,10
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
(( result == 0 ) || ( result == LONG_MAX ) || ( result == LONG_MIN )))
800a160: e5 61 08 00 cmpe r1,r11,r1
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
800a164: b8 22 08 00 or r1,r1,r2
800a168: 5c 20 00 05 bne r1,r0,800a17c <rtems_string_to_long+0xa8>
(( result == 0 ) || ( result == LONG_MAX ) || ( result == LONG_MIN )))
800a16c: 78 01 80 00 mvhi r1,0x8000
800a170: 45 61 00 03 be r11,r1,800a17c <rtems_string_to_long+0xa8> <== ALWAYS TAKEN
return RTEMS_INVALID_NUMBER;
*n = result;
800a174: 59 8b 00 00 sw (r12+0),r11
return RTEMS_SUCCESSFUL;
800a178: 34 05 00 00 mvi r5,0
}
800a17c: b8 a0 08 00 mv r1,r5
800a180: 2b 9d 00 04 lw ra,(sp+4)
800a184: 2b 8b 00 14 lw r11,(sp+20)
800a188: 2b 8c 00 10 lw r12,(sp+16)
800a18c: 2b 8d 00 0c lw r13,(sp+12)
800a190: 2b 8e 00 08 lw r14,(sp+8)
800a194: 37 9c 00 18 addi sp,sp,24
800a198: c3 a0 00 00 ret
08009fe4 <rtems_string_to_long_long>:
const char *s,
long long *n,
char **endptr,
int base
)
{
8009fe4: 37 9c ff e4 addi sp,sp,-28
8009fe8: 5b 8b 00 18 sw (sp+24),r11
8009fec: 5b 8c 00 14 sw (sp+20),r12
8009ff0: 5b 8d 00 10 sw (sp+16),r13
8009ff4: 5b 8e 00 0c sw (sp+12),r14
8009ff8: 5b 8f 00 08 sw (sp+8),r15
8009ffc: 5b 9d 00 04 sw (sp+4),ra
long long result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
800a000: 34 05 00 09 mvi r5,9
const char *s,
long long *n,
char **endptr,
int base
)
{
800a004: b8 20 70 00 mv r14,r1
800a008: b8 40 58 00 mv r11,r2
800a00c: b8 60 78 00 mv r15,r3
800a010: b8 80 60 00 mv r12,r4
long long result;
char *end;
if ( !n )
800a014: 44 40 00 27 be r2,r0,800a0b0 <rtems_string_to_long_long+0xcc>
return RTEMS_INVALID_ADDRESS;
errno = 0;
800a018: f8 00 0f 9f calli 800de94 <__errno>
800a01c: 58 20 00 00 sw (r1+0),r0
*n = 0;
result = strtoll( s, &end, base );
800a020: b9 80 18 00 mv r3,r12
if ( !n )
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
800a024: 59 60 00 00 sw (r11+0),r0
800a028: 59 60 00 04 sw (r11+4),r0
result = strtoll( s, &end, base );
800a02c: b9 c0 08 00 mv r1,r14
800a030: 37 82 00 1c addi r2,sp,28
800a034: f8 00 1b 7b calli 8010e20 <strtoll>
800a038: b8 20 68 00 mv r13,r1
800a03c: b8 40 60 00 mv r12,r2
if ( endptr )
800a040: 45 e0 00 03 be r15,r0,800a04c <rtems_string_to_long_long+0x68>
*endptr = end;
800a044: 2b 81 00 1c lw r1,(sp+28)
800a048: 59 e1 00 00 sw (r15+0),r1
if ( end == s )
800a04c: 2b 81 00 1c lw r1,(sp+28)
return RTEMS_NOT_DEFINED;
800a050: 34 05 00 0b mvi r5,11
result = strtoll( s, &end, base );
if ( endptr )
*endptr = end;
if ( end == s )
800a054: 44 2e 00 17 be r1,r14,800a0b0 <rtems_string_to_long_long+0xcc>
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
800a058: f8 00 0f 8f calli 800de94 <__errno>
800a05c: 28 22 00 00 lw r2,(r1+0)
800a060: 34 01 00 22 mvi r1,34
800a064: 5c 41 00 10 bne r2,r1,800a0a4 <rtems_string_to_long_long+0xc0>
(( result == 0 ) || ( result == LONG_LONG_MAX ) || ( result == LONG_LONG_MIN )))
800a068: 78 02 08 02 mvhi r2,0x802
800a06c: 38 42 14 d8 ori r2,r2,0x14d8
800a070: 28 41 00 00 lw r1,(r2+0)
800a074: a5 80 10 00 not r2,r12
return RTEMS_INVALID_NUMBER;
800a078: 34 05 00 0a mvi r5,10
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
(( result == 0 ) || ( result == LONG_LONG_MAX ) || ( result == LONG_LONG_MIN )))
800a07c: 99 a1 08 00 xor r1,r13,r1
800a080: b8 22 08 00 or r1,r1,r2
800a084: b9 ac 10 00 or r2,r13,r12
800a088: 64 21 00 00 cmpei r1,r1,0
800a08c: 64 42 00 00 cmpei r2,r2,0
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
800a090: b8 22 08 00 or r1,r1,r2
800a094: 5c 20 00 07 bne r1,r0,800a0b0 <rtems_string_to_long_long+0xcc>
(( result == 0 ) || ( result == LONG_LONG_MAX ) || ( result == LONG_LONG_MIN )))
800a098: 78 01 80 00 mvhi r1,0x8000
800a09c: 5d a1 00 02 bne r13,r1,800a0a4 <rtems_string_to_long_long+0xc0><== NEVER TAKEN
800a0a0: 45 80 00 04 be r12,r0,800a0b0 <rtems_string_to_long_long+0xcc><== ALWAYS TAKEN
return RTEMS_INVALID_NUMBER;
*n = result;
800a0a4: 59 6d 00 00 sw (r11+0),r13
800a0a8: 59 6c 00 04 sw (r11+4),r12
return RTEMS_SUCCESSFUL;
800a0ac: 34 05 00 00 mvi r5,0
}
800a0b0: b8 a0 08 00 mv r1,r5
800a0b4: 2b 9d 00 04 lw ra,(sp+4)
800a0b8: 2b 8b 00 18 lw r11,(sp+24)
800a0bc: 2b 8c 00 14 lw r12,(sp+20)
800a0c0: 2b 8d 00 10 lw r13,(sp+16)
800a0c4: 2b 8e 00 0c lw r14,(sp+12)
800a0c8: 2b 8f 00 08 lw r15,(sp+8)
800a0cc: 37 9c 00 1c addi sp,sp,28
800a0d0: c3 a0 00 00 ret
0801b840 <rtems_string_to_unsigned_char>:
const char *s,
unsigned char *n,
char **endptr,
int base
)
{
801b840: 37 9c ff e8 addi sp,sp,-24
801b844: 5b 8b 00 14 sw (sp+20),r11
801b848: 5b 8c 00 10 sw (sp+16),r12
801b84c: 5b 8d 00 0c sw (sp+12),r13
801b850: 5b 8e 00 08 sw (sp+8),r14
801b854: 5b 9d 00 04 sw (sp+4),ra
unsigned long result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
801b858: 34 05 00 09 mvi r5,9
const char *s,
unsigned char *n,
char **endptr,
int base
)
{
801b85c: b8 20 68 00 mv r13,r1
801b860: b8 40 58 00 mv r11,r2
801b864: b8 60 70 00 mv r14,r3
801b868: b8 80 60 00 mv r12,r4
unsigned long result;
char *end;
if ( !n )
801b86c: 44 40 00 20 be r2,r0,801b8ec <rtems_string_to_unsigned_char+0xac>
return RTEMS_INVALID_ADDRESS;
errno = 0;
801b870: f8 00 75 47 calli 8038d8c <__errno>
801b874: 58 20 00 00 sw (r1+0),r0
*n = 0;
result = strtoul( s, &end, base );
801b878: b9 80 18 00 mv r3,r12
if ( !n )
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
801b87c: 31 60 00 00 sb (r11+0),r0
result = strtoul( s, &end, base );
801b880: b9 a0 08 00 mv r1,r13
801b884: 37 82 00 18 addi r2,sp,24
801b888: f8 00 9a 19 calli 80420ec <strtoul>
801b88c: b8 20 60 00 mv r12,r1
if ( endptr )
801b890: 45 c0 00 03 be r14,r0,801b89c <rtems_string_to_unsigned_char+0x5c>
*endptr = end;
801b894: 2b 81 00 18 lw r1,(sp+24)
801b898: 59 c1 00 00 sw (r14+0),r1
if ( end == s )
801b89c: 2b 81 00 18 lw r1,(sp+24)
return RTEMS_NOT_DEFINED;
801b8a0: 34 05 00 0b mvi r5,11
result = strtoul( s, &end, base );
if ( endptr )
*endptr = end;
if ( end == s )
801b8a4: 44 2d 00 12 be r1,r13,801b8ec <rtems_string_to_unsigned_char+0xac>
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
801b8a8: f8 00 75 39 calli 8038d8c <__errno>
801b8ac: 28 22 00 00 lw r2,(r1+0)
801b8b0: 34 01 00 22 mvi r1,34
801b8b4: 5c 41 00 05 bne r2,r1,801b8c8 <rtems_string_to_unsigned_char+0x88>
(( result == 0 ) || ( result == ULONG_MAX )))
801b8b8: 35 82 ff ff addi r2,r12,-1
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
801b8bc: 34 01 ff fd mvi r1,-3
(( result == 0 ) || ( result == ULONG_MAX )))
return RTEMS_INVALID_NUMBER;
801b8c0: 34 05 00 0a mvi r5,10
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
801b8c4: 54 41 00 0a bgu r2,r1,801b8ec <rtems_string_to_unsigned_char+0xac><== ALWAYS TAKEN
(( result == 0 ) || ( result == ULONG_MAX )))
return RTEMS_INVALID_NUMBER;
#if (UCHAR_MAX < ULONG_MAX)
if ( result > UCHAR_MAX ) {
801b8c8: 34 01 00 ff mvi r1,255
801b8cc: 50 2c 00 06 bgeu r1,r12,801b8e4 <rtems_string_to_unsigned_char+0xa4>
errno = ERANGE;
801b8d0: f8 00 75 2f calli 8038d8c <__errno>
801b8d4: 34 02 00 22 mvi r2,34
801b8d8: 58 22 00 00 sw (r1+0),r2
return RTEMS_INVALID_NUMBER;
801b8dc: 34 05 00 0a mvi r5,10
801b8e0: e0 00 00 03 bi 801b8ec <rtems_string_to_unsigned_char+0xac>
}
#endif
*n = result;
801b8e4: 31 6c 00 00 sb (r11+0),r12
return RTEMS_SUCCESSFUL;
801b8e8: 34 05 00 00 mvi r5,0
}
801b8ec: b8 a0 08 00 mv r1,r5
801b8f0: 2b 9d 00 04 lw ra,(sp+4)
801b8f4: 2b 8b 00 14 lw r11,(sp+20)
801b8f8: 2b 8c 00 10 lw r12,(sp+16)
801b8fc: 2b 8d 00 0c lw r13,(sp+12)
801b900: 2b 8e 00 08 lw r14,(sp+8)
801b904: 37 9c 00 18 addi sp,sp,24
801b908: c3 a0 00 00 ret
0800a284 <rtems_string_to_unsigned_int>:
const char *s,
unsigned int *n,
char **endptr,
int base
)
{
800a284: 37 9c ff e8 addi sp,sp,-24
800a288: 5b 8b 00 14 sw (sp+20),r11
800a28c: 5b 8c 00 10 sw (sp+16),r12
800a290: 5b 8d 00 0c sw (sp+12),r13
800a294: 5b 8e 00 08 sw (sp+8),r14
800a298: 5b 9d 00 04 sw (sp+4),ra
unsigned long result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
800a29c: 34 05 00 09 mvi r5,9
const char *s,
unsigned int *n,
char **endptr,
int base
)
{
800a2a0: b8 20 68 00 mv r13,r1
800a2a4: b8 40 58 00 mv r11,r2
800a2a8: b8 60 70 00 mv r14,r3
800a2ac: b8 80 60 00 mv r12,r4
unsigned long result;
char *end;
if ( !n )
800a2b0: 44 40 00 19 be r2,r0,800a314 <rtems_string_to_unsigned_int+0x90>
return RTEMS_INVALID_ADDRESS;
errno = 0;
800a2b4: f8 00 0e f8 calli 800de94 <__errno>
800a2b8: 58 20 00 00 sw (r1+0),r0
*n = 0;
result = strtoul( s, &end, base );
800a2bc: b9 80 18 00 mv r3,r12
if ( !n )
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
800a2c0: 59 60 00 00 sw (r11+0),r0
result = strtoul( s, &end, base );
800a2c4: b9 a0 08 00 mv r1,r13
800a2c8: 37 82 00 18 addi r2,sp,24
800a2cc: f8 00 1c 40 calli 80113cc <strtoul>
800a2d0: b8 20 60 00 mv r12,r1
if ( endptr )
800a2d4: 45 c0 00 03 be r14,r0,800a2e0 <rtems_string_to_unsigned_int+0x5c>
*endptr = end;
800a2d8: 2b 81 00 18 lw r1,(sp+24)
800a2dc: 59 c1 00 00 sw (r14+0),r1
if ( end == s )
800a2e0: 2b 81 00 18 lw r1,(sp+24)
return RTEMS_NOT_DEFINED;
800a2e4: 34 05 00 0b mvi r5,11
result = strtoul( s, &end, base );
if ( endptr )
*endptr = end;
if ( end == s )
800a2e8: 44 2d 00 0b be r1,r13,800a314 <rtems_string_to_unsigned_int+0x90>
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
800a2ec: f8 00 0e ea calli 800de94 <__errno>
800a2f0: 28 22 00 00 lw r2,(r1+0)
800a2f4: 34 01 00 22 mvi r1,34
800a2f8: 5c 41 00 05 bne r2,r1,800a30c <rtems_string_to_unsigned_int+0x88>
(( result == 0 ) || ( result == ULONG_MAX )))
800a2fc: 35 82 ff ff addi r2,r12,-1
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
800a300: 34 01 ff fd mvi r1,-3
(( result == 0 ) || ( result == ULONG_MAX )))
return RTEMS_INVALID_NUMBER;
800a304: 34 05 00 0a mvi r5,10
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
800a308: 54 41 00 03 bgu r2,r1,800a314 <rtems_string_to_unsigned_int+0x90><== ALWAYS TAKEN
errno = ERANGE;
return RTEMS_INVALID_NUMBER;
}
#endif
*n = result;
800a30c: 59 6c 00 00 sw (r11+0),r12
return RTEMS_SUCCESSFUL;
800a310: 34 05 00 00 mvi r5,0
}
800a314: b8 a0 08 00 mv r1,r5
800a318: 2b 9d 00 04 lw ra,(sp+4)
800a31c: 2b 8b 00 14 lw r11,(sp+20)
800a320: 2b 8c 00 10 lw r12,(sp+16)
800a324: 2b 8d 00 0c lw r13,(sp+12)
800a328: 2b 8e 00 08 lw r14,(sp+8)
800a32c: 37 9c 00 18 addi sp,sp,24
800a330: c3 a0 00 00 ret
08007db0 <rtems_string_to_unsigned_long>:
const char *s,
unsigned long *n,
char **endptr,
int base
)
{
8007db0: 37 9c ff e8 addi sp,sp,-24
8007db4: 5b 8b 00 14 sw (sp+20),r11
8007db8: 5b 8c 00 10 sw (sp+16),r12
8007dbc: 5b 8d 00 0c sw (sp+12),r13
8007dc0: 5b 8e 00 08 sw (sp+8),r14
8007dc4: 5b 9d 00 04 sw (sp+4),ra
unsigned long result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
8007dc8: 34 05 00 09 mvi r5,9
const char *s,
unsigned long *n,
char **endptr,
int base
)
{
8007dcc: b8 20 68 00 mv r13,r1
8007dd0: b8 40 58 00 mv r11,r2
8007dd4: b8 60 70 00 mv r14,r3
8007dd8: b8 80 60 00 mv r12,r4
unsigned long result;
char *end;
if ( !n )
8007ddc: 44 40 00 19 be r2,r0,8007e40 <rtems_string_to_unsigned_long+0x90>
return RTEMS_INVALID_ADDRESS;
errno = 0;
8007de0: f8 00 c3 eb calli 8038d8c <__errno>
8007de4: 58 20 00 00 sw (r1+0),r0
*n = 0;
result = strtoul( s, &end, base );
8007de8: b9 80 18 00 mv r3,r12
if ( !n )
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
8007dec: 59 60 00 00 sw (r11+0),r0
result = strtoul( s, &end, base );
8007df0: b9 a0 08 00 mv r1,r13
8007df4: 37 82 00 18 addi r2,sp,24
8007df8: f8 00 e8 bd calli 80420ec <strtoul>
8007dfc: b8 20 60 00 mv r12,r1
if ( endptr )
8007e00: 45 c0 00 03 be r14,r0,8007e0c <rtems_string_to_unsigned_long+0x5c>
*endptr = end;
8007e04: 2b 81 00 18 lw r1,(sp+24)
8007e08: 59 c1 00 00 sw (r14+0),r1
if ( end == s )
8007e0c: 2b 81 00 18 lw r1,(sp+24)
return RTEMS_NOT_DEFINED;
8007e10: 34 05 00 0b mvi r5,11
result = strtoul( s, &end, base );
if ( endptr )
*endptr = end;
if ( end == s )
8007e14: 44 2d 00 0b be r1,r13,8007e40 <rtems_string_to_unsigned_long+0x90>
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
8007e18: f8 00 c3 dd calli 8038d8c <__errno>
8007e1c: 28 22 00 00 lw r2,(r1+0)
8007e20: 34 01 00 22 mvi r1,34
8007e24: 5c 41 00 05 bne r2,r1,8007e38 <rtems_string_to_unsigned_long+0x88>
(( result == 0 ) || ( result == ULONG_MAX )))
8007e28: 35 82 ff ff addi r2,r12,-1
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
8007e2c: 34 01 ff fd mvi r1,-3
(( result == 0 ) || ( result == ULONG_MAX )))
return RTEMS_INVALID_NUMBER;
8007e30: 34 05 00 0a mvi r5,10
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
8007e34: 54 41 00 03 bgu r2,r1,8007e40 <rtems_string_to_unsigned_long+0x90><== ALWAYS TAKEN
(( result == 0 ) || ( result == ULONG_MAX )))
return RTEMS_INVALID_NUMBER;
*n = result;
8007e38: 59 6c 00 00 sw (r11+0),r12
return RTEMS_SUCCESSFUL;
8007e3c: 34 05 00 00 mvi r5,0
}
8007e40: b8 a0 08 00 mv r1,r5
8007e44: 2b 9d 00 04 lw ra,(sp+4)
8007e48: 2b 8b 00 14 lw r11,(sp+20)
8007e4c: 2b 8c 00 10 lw r12,(sp+16)
8007e50: 2b 8d 00 0c lw r13,(sp+12)
8007e54: 2b 8e 00 08 lw r14,(sp+8)
8007e58: 37 9c 00 18 addi sp,sp,24
8007e5c: c3 a0 00 00 ret
0800a334 <rtems_string_to_unsigned_long_long>:
const char *s,
unsigned long long *n,
char **endptr,
int base
)
{
800a334: 37 9c ff e4 addi sp,sp,-28
800a338: 5b 8b 00 18 sw (sp+24),r11
800a33c: 5b 8c 00 14 sw (sp+20),r12
800a340: 5b 8d 00 10 sw (sp+16),r13
800a344: 5b 8e 00 0c sw (sp+12),r14
800a348: 5b 8f 00 08 sw (sp+8),r15
800a34c: 5b 9d 00 04 sw (sp+4),ra
unsigned long long result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
800a350: 34 05 00 09 mvi r5,9
const char *s,
unsigned long long *n,
char **endptr,
int base
)
{
800a354: b8 20 70 00 mv r14,r1
800a358: b8 40 58 00 mv r11,r2
800a35c: b8 60 78 00 mv r15,r3
800a360: b8 80 60 00 mv r12,r4
unsigned long long result;
char *end;
if ( !n )
800a364: 44 40 00 1f be r2,r0,800a3e0 <rtems_string_to_unsigned_long_long+0xac>
return RTEMS_INVALID_ADDRESS;
errno = 0;
800a368: f8 00 0e cb calli 800de94 <__errno>
800a36c: 58 20 00 00 sw (r1+0),r0
*n = 0;
result = strtoull( s, &end, base );
800a370: b9 80 18 00 mv r3,r12
if ( !n )
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
800a374: 59 60 00 00 sw (r11+0),r0
800a378: 59 60 00 04 sw (r11+4),r0
result = strtoull( s, &end, base );
800a37c: b9 c0 08 00 mv r1,r14
800a380: 37 82 00 1c addi r2,sp,28
800a384: f8 00 1c 20 calli 8011404 <strtoull>
800a388: b8 20 68 00 mv r13,r1
800a38c: b8 40 60 00 mv r12,r2
if ( endptr )
800a390: 45 e0 00 03 be r15,r0,800a39c <rtems_string_to_unsigned_long_long+0x68>
*endptr = end;
800a394: 2b 81 00 1c lw r1,(sp+28)
800a398: 59 e1 00 00 sw (r15+0),r1
if ( end == s )
800a39c: 2b 81 00 1c lw r1,(sp+28)
return RTEMS_NOT_DEFINED;
800a3a0: 34 05 00 0b mvi r5,11
result = strtoull( s, &end, base );
if ( endptr )
*endptr = end;
if ( end == s )
800a3a4: 44 2e 00 0f be r1,r14,800a3e0 <rtems_string_to_unsigned_long_long+0xac>
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
800a3a8: f8 00 0e bb calli 800de94 <__errno>
800a3ac: 28 22 00 00 lw r2,(r1+0)
800a3b0: 34 01 00 22 mvi r1,34
800a3b4: 5c 41 00 08 bne r2,r1,800a3d4 <rtems_string_to_unsigned_long_long+0xa0>
(( result == 0 ) || ( result == ULONG_LONG_MAX )))
800a3b8: 35 81 ff ff addi r1,r12,-1
800a3bc: f5 81 18 00 cmpgu r3,r12,r1
800a3c0: c8 0d 10 00 sub r2,r0,r13
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
800a3c4: 5c 62 00 04 bne r3,r2,800a3d4 <rtems_string_to_unsigned_long_long+0xa0><== NEVER TAKEN
800a3c8: 34 02 ff fd mvi r2,-3
(( result == 0 ) || ( result == ULONG_LONG_MAX )))
return RTEMS_INVALID_NUMBER;
800a3cc: 34 05 00 0a mvi r5,10
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
800a3d0: 54 22 00 04 bgu r1,r2,800a3e0 <rtems_string_to_unsigned_long_long+0xac><== ALWAYS TAKEN
(( result == 0 ) || ( result == ULONG_LONG_MAX )))
return RTEMS_INVALID_NUMBER;
*n = result;
800a3d4: 59 6d 00 00 sw (r11+0),r13
800a3d8: 59 6c 00 04 sw (r11+4),r12
return RTEMS_SUCCESSFUL;
800a3dc: 34 05 00 00 mvi r5,0
}
800a3e0: b8 a0 08 00 mv r1,r5
800a3e4: 2b 9d 00 04 lw ra,(sp+4)
800a3e8: 2b 8b 00 18 lw r11,(sp+24)
800a3ec: 2b 8c 00 14 lw r12,(sp+20)
800a3f0: 2b 8d 00 10 lw r13,(sp+16)
800a3f4: 2b 8e 00 0c lw r14,(sp+12)
800a3f8: 2b 8f 00 08 lw r15,(sp+8)
800a3fc: 37 9c 00 1c addi sp,sp,28
800a400: c3 a0 00 00 ret
08000e90 <rtems_tarfs_load>:
int rtems_tarfs_load(
const char *mountpoint,
uint8_t *tar_image,
size_t tar_size
)
{
8000e90: 37 9c fd fc addi sp,sp,-516
8000e94: 5b 8b 00 44 sw (sp+68),r11
8000e98: 5b 8c 00 40 sw (sp+64),r12
8000e9c: 5b 8d 00 3c sw (sp+60),r13
8000ea0: 5b 8e 00 38 sw (sp+56),r14
8000ea4: 5b 8f 00 34 sw (sp+52),r15
8000ea8: 5b 90 00 30 sw (sp+48),r16
8000eac: 5b 91 00 2c sw (sp+44),r17
8000eb0: 5b 92 00 28 sw (sp+40),r18
8000eb4: 5b 93 00 24 sw (sp+36),r19
8000eb8: 5b 94 00 20 sw (sp+32),r20
8000ebc: 5b 95 00 1c sw (sp+28),r21
8000ec0: 5b 96 00 18 sw (sp+24),r22
8000ec4: 5b 97 00 14 sw (sp+20),r23
8000ec8: 5b 98 00 10 sw (sp+16),r24
8000ecc: 5b 99 00 0c sw (sp+12),r25
8000ed0: 5b 9b 00 08 sw (sp+8),fp
8000ed4: 5b 9d 00 04 sw (sp+4),ra
8000ed8: b8 20 98 00 mv r19,r1
8000edc: 5b 83 00 50 sw (sp+80),r3
8000ee0: b8 40 a0 00 mv r20,r2
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 =
8000ee4: 34 03 00 18 mvi r3,24
8000ee8: ba 60 10 00 mv r2,r19
8000eec: 37 81 01 b8 addi r1,sp,440
8000ef0: f8 00 08 e4 calli 8003280 <rtems_filesystem_eval_path_start>
8000ef4: b8 20 60 00 mv r12,r1
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(
8000ef8: 37 82 01 d0 addi r2,sp,464
8000efc: 37 81 01 f0 addi r1,sp,496
8000f00: f8 00 0a 10 calli 8003740 <rtems_filesystem_location_copy_and_detach>
static inline void rtems_filesystem_eval_path_set_flags(
rtems_filesystem_eval_path_context_t *ctx,
int flags
)
{
ctx->flags = flags;
8000f04: 34 01 00 60 mvi r1,96
8000f08: 5b 81 01 c8 sw (sp+456),r1
&ctx,
RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE
);
if (
rootloc.mt_entry->ops != &IMFS_ops
8000f0c: 2b 81 02 04 lw r1,(sp+516)
rtems_filesystem_eval_path_set_flags(
&ctx,
RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE
);
if (
8000f10: 78 04 08 02 mvhi r4,0x802
8000f14: 38 84 19 4c ori r4,r4,0x194c
rootloc.mt_entry->ops != &IMFS_ops
8000f18: 28 21 00 0c lw r1,(r1+12)
rtems_filesystem_eval_path_set_flags(
&ctx,
RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE
);
if (
8000f1c: 44 24 00 05 be r1,r4,8000f30 <rtems_tarfs_load+0xa0>
rootloc.mt_entry->ops != &IMFS_ops
&& rootloc.mt_entry->ops != &fifoIMFS_ops
8000f20: 78 04 08 02 mvhi r4,0x802
8000f24: 38 84 22 48 ori r4,r4,0x2248
) {
rv = -1;
8000f28: 34 0b ff ff mvi r11,-1
RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE
);
if (
rootloc.mt_entry->ops != &IMFS_ops
&& rootloc.mt_entry->ops != &fifoIMFS_ops
8000f2c: 5c 24 00 6a bne r1,r4,80010d4 <rtems_tarfs_load+0x244> <== ALWAYS TAKEN
/*
* Read a header.
*/
hdr_ptr = (char *) &tar_image[offset];
offset += 512;
if (strncmp(&hdr_ptr[257], "ustar", 5))
8000f30: 78 12 08 02 mvhi r18,0x802
filename,
strlen( filename )
);
rtems_filesystem_eval_path_continue( &ctx );
if ( !rtems_filesystem_location_is_null( currentloc ) ) {
8000f34: 78 11 08 02 mvhi r17,0x802
* - For files, create a file node with special tarfs properties.
*/
if (linkflag == DIRTYPE) {
strcpy(full_filename, mountpoint);
if (full_filename[strlen(full_filename)-1] != '/')
strcat(full_filename, "/");
8000f38: 78 10 08 01 mvhi r16,0x801
rtems_filesystem_eval_path_set_flags(
&ctx,
RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE
);
if (
8000f3c: 34 0b 00 00 mvi r11,0
/*
* Read a header.
*/
hdr_ptr = (char *) &tar_image[offset];
offset += 512;
if (strncmp(&hdr_ptr[257], "ustar", 5))
8000f40: 3a 52 19 d0 ori r18,r18,0x19d0
break;
strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE);
8000f44: 37 8f 01 54 addi r15,sp,340
rtems_filesystem_eval_path_set_path(
&ctx,
filename,
strlen( filename )
);
rtems_filesystem_eval_path_continue( &ctx );
8000f48: 37 9b 01 b8 addi fp,sp,440
if ( !rtems_filesystem_location_is_null( currentloc ) ) {
8000f4c: 3a 31 1f b8 ori r17,r17,0x1fb8
);
node->info.linearfile.size = file_size;
node->info.linearfile.direct = &tar_image[offset];
}
nblocks = (((file_size) + 511) & ~511) / 512;
8000f50: 34 19 fe 00 mvi r25,-512
* - 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);
8000f54: 37 8d 00 54 addi r13,sp,84
if (full_filename[strlen(full_filename)-1] != '/')
8000f58: 37 98 00 53 addi r24,sp,83
8000f5c: 34 17 00 2f mvi r23,47
strcat(full_filename, "/");
8000f60: 3a 10 ed 9c ori r16,r16,0xed9c
/*
* Create an IMFS node structure pointing to tar image memory.
*/
offset = 0;
while ( rv == 0 ) {
if (offset + 512 > tar_size)
8000f64: 2b 81 00 50 lw r1,(sp+80)
8000f68: 35 6e 02 00 addi r14,r11,512
8000f6c: 55 c1 00 59 bgu r14,r1,80010d0 <rtems_tarfs_load+0x240> <== NEVER TAKEN
break;
/*
* Read a header.
*/
hdr_ptr = (char *) &tar_image[offset];
8000f70: b6 8b 58 00 add r11,r20,r11
offset += 512;
if (strncmp(&hdr_ptr[257], "ustar", 5))
8000f74: 35 61 01 01 addi r1,r11,257
8000f78: ba 40 10 00 mv r2,r18
8000f7c: 34 03 00 05 mvi r3,5
8000f80: f8 00 43 1c calli 8011bf0 <strncmp>
8000f84: 5c 20 00 53 bne r1,r0,80010d0 <rtems_tarfs_load+0x240> <== NEVER TAKEN
break;
strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE);
8000f88: 34 03 00 63 mvi r3,99
8000f8c: b9 60 10 00 mv r2,r11
8000f90: b9 e0 08 00 mv r1,r15
8000f94: f8 00 43 64 calli 8011d24 <strncpy>
filename[MAX_NAME_FIELD_SIZE] = '\0';
linkflag = hdr_ptr[156];
file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8);
8000f98: 34 02 00 08 mvi r2,8
offset += 512;
if (strncmp(&hdr_ptr[257], "ustar", 5))
break;
strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE);
filename[MAX_NAME_FIELD_SIZE] = '\0';
8000f9c: 33 80 01 b7 sb (sp+439),r0
linkflag = hdr_ptr[156];
file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8);
8000fa0: 35 61 00 64 addi r1,r11,100
break;
strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE);
filename[MAX_NAME_FIELD_SIZE] = '\0';
linkflag = hdr_ptr[156];
8000fa4: 41 76 00 9c lbu r22,(r11+156)
file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8);
8000fa8: f8 00 1b 5a calli 8007d10 <_rtems_octal2ulong>
8000fac: 5b 81 00 4c sw (sp+76),r1
file_size = _rtems_octal2ulong(&hdr_ptr[124], 12);
8000fb0: 34 02 00 0c mvi r2,12
8000fb4: 35 61 00 7c addi r1,r11,124
8000fb8: f8 00 1b 56 calli 8007d10 <_rtems_octal2ulong>
hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8);
8000fbc: 34 02 00 08 mvi r2,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);
8000fc0: b8 20 a8 00 mv r21,r1
hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8);
8000fc4: 35 61 00 94 addi r1,r11,148
8000fc8: f8 00 1b 52 calli 8007d10 <_rtems_octal2ulong>
8000fcc: b8 20 10 00 mv r2,r1
if (_rtems_tar_header_checksum(hdr_ptr) != hdr_chksum)
8000fd0: b9 60 08 00 mv r1,r11
8000fd4: 5b 82 00 48 sw (sp+72),r2
8000fd8: f8 00 1b 6d calli 8007d8c <_rtems_tar_header_checksum>
8000fdc: 2b 82 00 48 lw r2,(sp+72)
8000fe0: 5c 22 00 3c bne r1,r2,80010d0 <rtems_tarfs_load+0x240> <== NEVER TAKEN
* 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) {
8000fe4: 34 01 00 35 mvi r1,53
8000fe8: 5e c1 00 13 bne r22,r1,8001034 <rtems_tarfs_load+0x1a4> <== NEVER TAKEN
strcpy(full_filename, mountpoint);
8000fec: ba 60 10 00 mv r2,r19
8000ff0: b9 a0 08 00 mv r1,r13
8000ff4: f8 00 41 87 calli 8011610 <strcpy>
if (full_filename[strlen(full_filename)-1] != '/')
8000ff8: b9 a0 08 00 mv r1,r13
8000ffc: f8 00 42 ce calli 8011b34 <strlen>
8001000: b7 01 20 00 add r4,r24,r1
8001004: 40 81 00 00 lbu r1,(r4+0)
8001008: 44 37 00 04 be r1,r23,8001018 <rtems_tarfs_load+0x188> <== ALWAYS TAKEN
strcat(full_filename, "/");
800100c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED
8001010: ba 00 10 00 mv r2,r16 <== NOT EXECUTED
8001014: f8 00 41 28 calli 80114b4 <strcat> <== NOT EXECUTED
strcat(full_filename, filename);
8001018: b9 e0 10 00 mv r2,r15
800101c: b9 a0 08 00 mv r1,r13
8001020: f8 00 41 25 calli 80114b4 <strcat>
mkdir(full_filename, S_IRWXU | S_IRWXG | S_IRWXO);
8001024: b9 a0 08 00 mv r1,r13
8001028: 34 02 01 ff mvi r2,511
800102c: f8 00 04 86 calli 8002244 <mkdir>
8001030: e0 00 00 26 bi 80010c8 <rtems_tarfs_load+0x238>
}
/*
* Create a LINEAR_FILE node
*/
else if (linkflag == REGTYPE) {
8001034: 34 01 00 30 mvi r1,48
8001038: 5e c1 00 24 bne r22,r1,80010c8 <rtems_tarfs_load+0x238>
rtems_filesystem_location_free( currentloc );
800103c: b9 80 08 00 mv r1,r12
8001040: f8 00 02 9a calli 8001aa8 <rtems_filesystem_location_free>
rtems_filesystem_location_clone( currentloc, &rootloc );
8001044: 37 82 01 f0 addi r2,sp,496
8001048: b9 80 08 00 mv r1,r12
800104c: f8 00 01 a7 calli 80016e8 <rtems_filesystem_location_clone>
rtems_filesystem_eval_path_set_path(
8001050: b9 e0 08 00 mv r1,r15
8001054: f8 00 42 b8 calli 8011b34 <strlen>
const char *path,
size_t pathlen
)
{
ctx->path = path;
ctx->pathlen = pathlen;
8001058: 5b 81 01 bc sw (sp+444),r1
&ctx,
filename,
strlen( filename )
);
rtems_filesystem_eval_path_continue( &ctx );
800105c: bb 60 08 00 mv r1,fp
rtems_filesystem_eval_path_context_t *ctx,
const char *path,
size_t pathlen
)
{
ctx->path = path;
8001060: 5b 8f 01 b8 sw (sp+440),r15
8001064: f8 00 08 01 calli 8003068 <rtems_filesystem_eval_path_continue>
if ( !rtems_filesystem_location_is_null( currentloc ) ) {
8001068: 29 81 00 10 lw r1,(r12+16)
800106c: 44 31 00 10 be r1,r17,80010ac <rtems_tarfs_load+0x21c> <== NEVER TAKEN
mode_t mode,
const IMFS_types_union *info
)
{
const IMFS_fs_info_t *fs_info =
(const IMFS_fs_info_t *) parentloc->mt_entry->fs_info;
8001070: 29 81 00 14 lw r1,(r12+20)
return IMFS_create_node_with_control(
8001074: 2b 84 01 c4 lw r4,(sp+452)
8001078: 2b 83 01 c0 lw r3,(sp+448)
800107c: 28 22 00 08 lw r2,(r1+8)
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,
8001080: 2b 81 00 4c lw r1,(sp+76)
8001084: 34 06 00 00 mvi r6,0
8001088: 28 42 00 1c lw r2,(r2+28)
800108c: 20 25 01 ff andi r5,r1,0x1ff
8001090: 38 a5 80 00 ori r5,r5,0x8000
8001094: b9 80 08 00 mv r1,r12
8001098: f8 00 1d 48 calli 80085b8 <IMFS_create_node_with_control>
800109c: b8 20 20 00 mv r4,r1
NULL
);
node->info.linearfile.size = file_size;
80010a0: 58 35 00 50 sw (r1+80),r21
node->info.linearfile.direct = &tar_image[offset];
80010a4: b6 8e 08 00 add r1,r20,r14
80010a8: 58 81 00 54 sw (r4+84),r1
}
nblocks = (((file_size) + 511) & ~511) / 512;
80010ac: 36 b5 01 ff addi r21,r21,511
80010b0: 34 02 00 09 mvi r2,9
80010b4: a2 b9 08 00 and r1,r21,r25
80010b8: f8 00 74 9b calli 801e324 <__lshrsi3>
offset += 512 * nblocks;
80010bc: 34 02 00 09 mvi r2,9
80010c0: f8 00 74 4b calli 801e1ec <__ashlsi3>
80010c4: b4 2e 70 00 add r14,r1,r14
rtems_filesystem_eval_path_set_flags(
&ctx,
RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE
);
if (
80010c8: b9 c0 58 00 mv r11,r14
80010cc: e3 ff ff a6 bi 8000f64 <rtems_tarfs_load+0xd4>
linkflag = hdr_ptr[156];
file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8);
file_size = _rtems_octal2ulong(&hdr_ptr[124], 12);
hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8);
if (_rtems_tar_header_checksum(hdr_ptr) != hdr_chksum)
80010d0: 34 0b 00 00 mvi r11,0
nblocks = (((file_size) + 511) & ~511) / 512;
offset += 512 * nblocks;
}
}
rtems_filesystem_location_free( &rootloc );
80010d4: 37 81 01 f0 addi r1,sp,496
80010d8: f8 00 02 74 calli 8001aa8 <rtems_filesystem_location_free>
rtems_filesystem_eval_path_cleanup( &ctx );
80010dc: 37 81 01 b8 addi r1,sp,440
80010e0: f8 00 08 b5 calli 80033b4 <rtems_filesystem_eval_path_cleanup>
return rv;
}
80010e4: b9 60 08 00 mv r1,r11
80010e8: 2b 9d 00 04 lw ra,(sp+4)
80010ec: 2b 8b 00 44 lw r11,(sp+68)
80010f0: 2b 8c 00 40 lw r12,(sp+64)
80010f4: 2b 8d 00 3c lw r13,(sp+60)
80010f8: 2b 8e 00 38 lw r14,(sp+56)
80010fc: 2b 8f 00 34 lw r15,(sp+52)
8001100: 2b 90 00 30 lw r16,(sp+48)
8001104: 2b 91 00 2c lw r17,(sp+44)
8001108: 2b 92 00 28 lw r18,(sp+40)
800110c: 2b 93 00 24 lw r19,(sp+36)
8001110: 2b 94 00 20 lw r20,(sp+32)
8001114: 2b 95 00 1c lw r21,(sp+28)
8001118: 2b 96 00 18 lw r22,(sp+24)
800111c: 2b 97 00 14 lw r23,(sp+20)
8001120: 2b 98 00 10 lw r24,(sp+16)
8001124: 2b 99 00 0c lw r25,(sp+12)
8001128: 2b 9b 00 08 lw fp,(sp+8)
800112c: 37 9c 02 04 addi sp,sp,516
8001130: c3 a0 00 00 ret
0800eb90 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
800eb90: 37 9c ff e0 addi sp,sp,-32
800eb94: 5b 8b 00 20 sw (sp+32),r11
800eb98: 5b 8c 00 1c sw (sp+28),r12
800eb9c: 5b 8d 00 18 sw (sp+24),r13
800eba0: 5b 8e 00 14 sw (sp+20),r14
800eba4: 5b 8f 00 10 sw (sp+16),r15
800eba8: 5b 90 00 0c sw (sp+12),r16
800ebac: 5b 91 00 08 sw (sp+8),r17
800ebb0: 5b 9d 00 04 sw (sp+4),ra
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
800ebb4: 34 04 00 09 mvi r4,9
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
800ebb8: b8 20 68 00 mv r13,r1
800ebbc: b8 40 70 00 mv r14,r2
800ebc0: b8 60 80 00 mv r16,r3
ASR_Information *asr;
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
800ebc4: 44 60 00 51 be r3,r0,800ed08 <rtems_task_mode+0x178>
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
800ebc8: 78 01 08 01 mvhi r1,0x801
800ebcc: 38 21 ae 00 ori r1,r1,0xae00
800ebd0: 28 2c 00 10 lw r12,(r1+16)
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
800ebd4: 41 8f 00 70 lbu r15,(r12+112)
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
800ebd8: 29 81 00 78 lw r1,(r12+120)
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
800ebdc: 29 8b 01 18 lw r11,(r12+280)
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
800ebe0: 65 ef 00 00 cmpei r15,r15,0
800ebe4: c8 0f 78 00 sub r15,r0,r15
800ebe8: 21 ef 01 00 andi r15,r15,0x100
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
800ebec: 44 20 00 02 be r1,r0,800ebf4 <rtems_task_mode+0x64>
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
800ebf0: 39 ef 02 00 ori r15,r15,0x200
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
800ebf4: 41 71 00 08 lbu r17,(r11+8)
old_mode |= _ISR_Get_level();
800ebf8: fb ff e8 9f calli 8008e74 <_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;
800ebfc: 66 31 00 00 cmpei r17,r17,0
800ec00: c8 11 88 00 sub r17,r0,r17
800ec04: 22 31 04 00 andi r17,r17,0x400
800ec08: ba 21 08 00 or r1,r17,r1
old_mode |= _ISR_Get_level();
800ec0c: b8 2f 78 00 or r15,r1,r15
*previous_mode_set = old_mode;
800ec10: 5a 0f 00 00 sw (r16+0),r15
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
800ec14: 21 c1 01 00 andi r1,r14,0x100
800ec18: 44 20 00 04 be r1,r0,800ec28 <rtems_task_mode+0x98>
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;
800ec1c: 21 a1 01 00 andi r1,r13,0x100
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
800ec20: 64 21 00 00 cmpei r1,r1,0
800ec24: 31 81 00 70 sb (r12+112),r1
if ( mask & RTEMS_TIMESLICE_MASK ) {
800ec28: 21 c1 02 00 andi r1,r14,0x200
800ec2c: 44 20 00 0b be r1,r0,800ec58 <rtems_task_mode+0xc8>
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;
800ec30: 21 a1 02 00 andi r1,r13,0x200
if ( _Modes_Is_timeslice(mode_set) ) {
800ec34: 44 20 00 08 be r1,r0,800ec54 <rtems_task_mode+0xc4>
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
800ec38: 34 01 00 01 mvi r1,1
800ec3c: 59 81 00 78 sw (r12+120),r1
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
800ec40: 78 01 08 01 mvhi r1,0x801
800ec44: 38 21 a9 10 ori r1,r1,0xa910
800ec48: 28 21 00 00 lw r1,(r1+0)
800ec4c: 59 81 00 74 sw (r12+116),r1
800ec50: e0 00 00 02 bi 800ec58 <rtems_task_mode+0xc8>
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
800ec54: 59 80 00 78 sw (r12+120),r0
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
800ec58: 21 c1 00 01 andi r1,r14,0x1
800ec5c: 44 20 00 04 be r1,r0,800ec6c <rtems_task_mode+0xdc>
*/
RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (
Modes_Control mode_set
)
{
return ( mode_set & RTEMS_INTERRUPT_MASK );
800ec60: 21 a1 00 01 andi r1,r13,0x1
*/
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
Modes_Control mode_set
)
{
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
800ec64: 64 21 00 00 cmpei r1,r1,0
800ec68: d0 01 00 00 wcsr IE,r1
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
800ec6c: 21 ce 04 00 andi r14,r14,0x400
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
800ec70: 34 03 00 00 mvi r3,0
if ( mask & RTEMS_ASR_MASK ) {
800ec74: 45 c0 00 11 be r14,r0,800ecb8 <rtems_task_mode+0x128>
*/
RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled (
Modes_Control mode_set
)
{
return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR;
800ec78: 21 ad 04 00 andi r13,r13,0x400
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
800ec7c: 41 61 00 08 lbu r1,(r11+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(
800ec80: 65 ad 00 00 cmpei r13,r13,0
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 ) {
800ec84: 44 2d 00 0d be r1,r13,800ecb8 <rtems_task_mode+0x128>
asr->is_enabled = is_asr_enabled;
800ec88: 31 6d 00 08 sb (r11+8),r13
)
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
800ec8c: 90 00 08 00 rcsr r1,IE
800ec90: 34 02 ff fe mvi r2,-2
800ec94: a0 22 10 00 and r2,r1,r2
800ec98: d0 02 00 00 wcsr IE,r2
_signals = information->signals_pending;
800ec9c: 29 62 00 18 lw r2,(r11+24)
information->signals_pending = information->signals_posted;
800eca0: 29 63 00 14 lw r3,(r11+20)
information->signals_posted = _signals;
800eca4: 59 62 00 14 sw (r11+20),r2
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
information->signals_pending = information->signals_posted;
800eca8: 59 63 00 18 sw (r11+24),r3
information->signals_posted = _signals;
_ISR_Enable( _level );
800ecac: d0 01 00 00 wcsr IE,r1
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
800ecb0: 29 63 00 14 lw r3,(r11+20)
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
800ecb4: 7c 63 00 00 cmpnei r3,r3,0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
800ecb8: 78 01 08 01 mvhi r1,0x801
800ecbc: 38 21 ad f8 ori r1,r1,0xadf8
800ecc0: 28 22 00 00 lw r2,(r1+0)
800ecc4: 34 01 00 03 mvi r1,3
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
800ecc8: 34 04 00 00 mvi r4,0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
800eccc: 5c 41 00 0f bne r2,r1,800ed08 <rtems_task_mode+0x178>
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
800ecd0: 78 01 08 01 mvhi r1,0x801
800ecd4: 38 21 ae 00 ori r1,r1,0xae00
800ecd8: 28 22 00 10 lw r2,(r1+16)
if ( are_signals_pending ||
800ecdc: 5c 60 00 05 bne r3,r0,800ecf0 <rtems_task_mode+0x160>
800ece0: 28 21 00 14 lw r1,(r1+20)
800ece4: 44 41 00 09 be r2,r1,800ed08 <rtems_task_mode+0x178>
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
800ece8: 40 41 00 70 lbu r1,(r2+112)
800ecec: 44 20 00 07 be r1,r0,800ed08 <rtems_task_mode+0x178> <== NEVER TAKEN
_Thread_Dispatch_necessary = true;
800ecf0: 78 01 08 01 mvhi r1,0x801
800ecf4: 38 21 ae 00 ori r1,r1,0xae00
800ecf8: 34 02 00 01 mvi r2,1
800ecfc: 30 22 00 0c sb (r1+12),r2
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
800ed00: f8 00 03 75 calli 800fad4 <_Thread_Dispatch>
}
return RTEMS_SUCCESSFUL;
800ed04: 34 04 00 00 mvi r4,0
}
800ed08: b8 80 08 00 mv r1,r4
800ed0c: 2b 9d 00 04 lw ra,(sp+4)
800ed10: 2b 8b 00 20 lw r11,(sp+32)
800ed14: 2b 8c 00 1c lw r12,(sp+28)
800ed18: 2b 8d 00 18 lw r13,(sp+24)
800ed1c: 2b 8e 00 14 lw r14,(sp+20)
800ed20: 2b 8f 00 10 lw r15,(sp+16)
800ed24: 2b 90 00 0c lw r16,(sp+12)
800ed28: 2b 91 00 08 lw r17,(sp+8)
800ed2c: 37 9c 00 20 addi sp,sp,32
800ed30: c3 a0 00 00 ret
08008e30 <rtems_task_set_priority>:
rtems_status_code rtems_task_set_priority(
rtems_id id,
rtems_task_priority new_priority,
rtems_task_priority *old_priority
)
{
8008e30: 37 9c ff f0 addi sp,sp,-16
8008e34: 5b 8b 00 0c sw (sp+12),r11
8008e38: 5b 8c 00 08 sw (sp+8),r12
8008e3c: 5b 9d 00 04 sw (sp+4),ra
8008e40: b8 40 58 00 mv r11,r2
8008e44: b8 60 60 00 mv r12,r3
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
8008e48: 44 40 00 06 be r2,r0,8008e60 <rtems_task_set_priority+0x30>
RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid (
rtems_task_priority the_priority
)
{
return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) &&
( the_priority <= RTEMS_MAXIMUM_PRIORITY ) );
8008e4c: 78 02 08 01 mvhi r2,0x801
8008e50: 38 42 a0 d8 ori r2,r2,0xa0d8
8008e54: 40 43 00 00 lbu r3,(r2+0)
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
8008e58: 34 02 00 13 mvi r2,19
)
{
register Thread_Control *the_thread;
Objects_Locations location;
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
8008e5c: 55 63 00 16 bgu r11,r3,8008eb4 <rtems_task_set_priority+0x84>
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
return RTEMS_INVALID_ADDRESS;
8008e60: 34 02 00 09 mvi r2,9
if ( new_priority != RTEMS_CURRENT_PRIORITY &&
!_RTEMS_tasks_Priority_is_valid( new_priority ) )
return RTEMS_INVALID_PRIORITY;
if ( !old_priority )
8008e64: 45 80 00 14 be r12,r0,8008eb4 <rtems_task_set_priority+0x84>
return RTEMS_INVALID_ADDRESS;
the_thread = _Thread_Get( id, &location );
8008e68: 37 82 00 10 addi r2,sp,16
8008e6c: f8 00 0b 4e calli 800bba4 <_Thread_Get>
switch ( location ) {
8008e70: 2b 82 00 10 lw r2,(sp+16)
8008e74: 5c 40 00 0f bne r2,r0,8008eb0 <rtems_task_set_priority+0x80>
case OBJECTS_LOCAL:
/* XXX need helper to "convert" from core priority */
*old_priority = the_thread->current_priority;
8008e78: 28 23 00 14 lw r3,(r1+20)
8008e7c: 59 83 00 00 sw (r12+0),r3
if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
8008e80: 45 62 00 09 be r11,r2,8008ea4 <rtems_task_set_priority+0x74>
the_thread->real_priority = new_priority;
if ( the_thread->resource_count == 0 ||
8008e84: 28 22 00 1c lw r2,(r1+28)
case OBJECTS_LOCAL:
/* XXX need helper to "convert" from core priority */
*old_priority = the_thread->current_priority;
if ( new_priority != RTEMS_CURRENT_PRIORITY ) {
the_thread->real_priority = new_priority;
8008e88: 58 2b 00 18 sw (r1+24),r11
if ( the_thread->resource_count == 0 ||
8008e8c: 44 40 00 03 be r2,r0,8008e98 <rtems_task_set_priority+0x68>
8008e90: 28 22 00 14 lw r2,(r1+20)
8008e94: 51 62 00 04 bgeu r11,r2,8008ea4 <rtems_task_set_priority+0x74><== ALWAYS TAKEN
the_thread->current_priority > new_priority )
_Thread_Change_priority( the_thread, new_priority, false );
8008e98: b9 60 10 00 mv r2,r11
8008e9c: 34 03 00 00 mvi r3,0
8008ea0: f8 00 09 e4 calli 800b630 <_Thread_Change_priority>
}
_Thread_Enable_dispatch();
8008ea4: f8 00 0b 34 calli 800bb74 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8008ea8: 34 02 00 00 mvi r2,0
8008eac: e0 00 00 02 bi 8008eb4 <rtems_task_set_priority+0x84>
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8008eb0: 34 02 00 04 mvi r2,4
}
8008eb4: b8 40 08 00 mv r1,r2
8008eb8: 2b 9d 00 04 lw ra,(sp+4)
8008ebc: 2b 8b 00 0c lw r11,(sp+12)
8008ec0: 2b 8c 00 08 lw r12,(sp+8)
8008ec4: 37 9c 00 10 addi sp,sp,16
8008ec8: c3 a0 00 00 ret
0800479c <rtems_termios_baud_to_index>:
#include <rtems/termiostypes.h>
int rtems_termios_baud_to_index(
rtems_termios_baud_t termios_baud
)
{
800479c: b8 20 10 00 mv r2,r1
case B134: baud_index = 4; break;
case B150: baud_index = 5; break;
case B200: baud_index = 6; break;
case B300: baud_index = 7; break;
case B600: baud_index = 8; break;
case B1200: baud_index = 9; break;
80047a0: 34 01 00 09 mvi r1,9
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
80047a4: 44 41 00 36 be r2,r1,800487c <rtems_termios_baud_to_index+0xe0>
80047a8: 54 41 00 17 bgu r2,r1,8004804 <rtems_termios_baud_to_index+0x68>
case B0: baud_index = 0; break;
case B50: baud_index = 1; break;
case B75: baud_index = 2; break;
case B110: baud_index = 3; break;
case B134: baud_index = 4; break;
80047ac: 34 01 00 04 mvi r1,4
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
80047b0: 44 41 00 33 be r2,r1,800487c <rtems_termios_baud_to_index+0xe0>
80047b4: 54 41 00 0a bgu r2,r1,80047dc <rtems_termios_baud_to_index+0x40>
case B0: baud_index = 0; break;
case B50: baud_index = 1; break;
80047b8: 34 01 00 01 mvi r1,1
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
80047bc: 44 41 00 30 be r2,r1,800487c <rtems_termios_baud_to_index+0xe0>
case B0: baud_index = 0; break;
80047c0: 34 01 00 00 mvi r1,0
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
80047c4: 44 40 00 2e be r2,r0,800487c <rtems_termios_baud_to_index+0xe0>
case B0: baud_index = 0; break;
case B50: baud_index = 1; break;
case B75: baud_index = 2; break;
80047c8: 34 01 00 02 mvi r1,2
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
80047cc: 44 41 00 2c be r2,r1,800487c <rtems_termios_baud_to_index+0xe0>
case B0: baud_index = 0; break;
case B50: baud_index = 1; break;
case B75: baud_index = 2; break;
case B110: baud_index = 3; break;
80047d0: 34 01 00 03 mvi r1,3
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
80047d4: 5c 41 00 29 bne r2,r1,8004878 <rtems_termios_baud_to_index+0xdc><== NEVER TAKEN
80047d8: c3 a0 00 00 ret
case B50: baud_index = 1; break;
case B75: baud_index = 2; break;
case B110: baud_index = 3; break;
case B134: baud_index = 4; break;
case B150: baud_index = 5; break;
case B200: baud_index = 6; break;
80047dc: 34 01 00 06 mvi r1,6
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
80047e0: 44 41 00 27 be r2,r1,800487c <rtems_termios_baud_to_index+0xe0>
80047e4: 34 03 00 06 mvi r3,6
case B0: baud_index = 0; break;
case B50: baud_index = 1; break;
case B75: baud_index = 2; break;
case B110: baud_index = 3; break;
case B134: baud_index = 4; break;
case B150: baud_index = 5; break;
80047e8: 34 01 00 05 mvi r1,5
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
80047ec: 54 62 00 24 bgu r3,r2,800487c <rtems_termios_baud_to_index+0xe0>
case B75: baud_index = 2; break;
case B110: baud_index = 3; break;
case B134: baud_index = 4; break;
case B150: baud_index = 5; break;
case B200: baud_index = 6; break;
case B300: baud_index = 7; break;
80047f0: 34 01 00 07 mvi r1,7
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
80047f4: 44 41 00 22 be r2,r1,800487c <rtems_termios_baud_to_index+0xe0>
case B110: baud_index = 3; break;
case B134: baud_index = 4; break;
case B150: baud_index = 5; break;
case B200: baud_index = 6; break;
case B300: baud_index = 7; break;
case B600: baud_index = 8; break;
80047f8: 34 01 00 08 mvi r1,8
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
80047fc: 5c 41 00 1f bne r2,r1,8004878 <rtems_termios_baud_to_index+0xdc><== NEVER TAKEN
8004800: c3 a0 00 00 ret
case B1200: baud_index = 9; break;
case B1800: baud_index = 10; break;
case B2400: baud_index = 11; break;
case B4800: baud_index = 12; break;
case B9600: baud_index = 13; break;
case B19200: baud_index = 14; break;
8004804: 34 01 00 0e mvi r1,14
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
8004808: 44 41 00 1d be r2,r1,800487c <rtems_termios_baud_to_index+0xe0>
800480c: 54 41 00 0b bgu r2,r1,8004838 <rtems_termios_baud_to_index+0x9c>
case B200: baud_index = 6; break;
case B300: baud_index = 7; break;
case B600: baud_index = 8; break;
case B1200: baud_index = 9; break;
case B1800: baud_index = 10; break;
case B2400: baud_index = 11; break;
8004810: 34 01 00 0b mvi r1,11
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
8004814: 44 41 00 1a be r2,r1,800487c <rtems_termios_baud_to_index+0xe0>
8004818: 34 03 00 0b mvi r3,11
case B150: baud_index = 5; break;
case B200: baud_index = 6; break;
case B300: baud_index = 7; break;
case B600: baud_index = 8; break;
case B1200: baud_index = 9; break;
case B1800: baud_index = 10; break;
800481c: 34 01 00 0a mvi r1,10
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
8004820: 54 62 00 17 bgu r3,r2,800487c <rtems_termios_baud_to_index+0xe0>
case B300: baud_index = 7; break;
case B600: baud_index = 8; break;
case B1200: baud_index = 9; break;
case B1800: baud_index = 10; break;
case B2400: baud_index = 11; break;
case B4800: baud_index = 12; break;
8004824: 34 01 00 0c mvi r1,12
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
8004828: 44 41 00 15 be r2,r1,800487c <rtems_termios_baud_to_index+0xe0>
case B600: baud_index = 8; break;
case B1200: baud_index = 9; break;
case B1800: baud_index = 10; break;
case B2400: baud_index = 11; break;
case B4800: baud_index = 12; break;
case B9600: baud_index = 13; break;
800482c: 34 01 00 0d mvi r1,13
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
8004830: 5c 41 00 12 bne r2,r1,8004878 <rtems_termios_baud_to_index+0xdc><== NEVER TAKEN
8004834: c3 a0 00 00 ret
8004838: 34 03 10 02 mvi r3,4098
case B4800: baud_index = 12; break;
case B9600: baud_index = 13; break;
case B19200: baud_index = 14; break;
case B38400: baud_index = 15; break;
case B57600: baud_index = 16; break;
case B115200: baud_index = 17; break;
800483c: 34 01 00 11 mvi r1,17
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
8004840: 44 43 00 0f be r2,r3,800487c <rtems_termios_baud_to_index+0xe0>
8004844: 54 43 00 07 bgu r2,r3,8004860 <rtems_termios_baud_to_index+0xc4>
case B1800: baud_index = 10; break;
case B2400: baud_index = 11; break;
case B4800: baud_index = 12; break;
case B9600: baud_index = 13; break;
case B19200: baud_index = 14; break;
case B38400: baud_index = 15; break;
8004848: 34 01 00 0f mvi r1,15
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
800484c: 44 41 00 0c be r2,r1,800487c <rtems_termios_baud_to_index+0xe0>
8004850: 34 03 10 01 mvi r3,4097
case B2400: baud_index = 11; break;
case B4800: baud_index = 12; break;
case B9600: baud_index = 13; break;
case B19200: baud_index = 14; break;
case B38400: baud_index = 15; break;
case B57600: baud_index = 16; break;
8004854: 34 01 00 10 mvi r1,16
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
8004858: 5c 43 00 08 bne r2,r3,8004878 <rtems_termios_baud_to_index+0xdc><== NEVER TAKEN
800485c: c3 a0 00 00 ret
8004860: 34 03 10 03 mvi r3,4099
case B9600: baud_index = 13; break;
case B19200: baud_index = 14; break;
case B38400: baud_index = 15; break;
case B57600: baud_index = 16; break;
case B115200: baud_index = 17; break;
case B230400: baud_index = 18; break;
8004864: 34 01 00 12 mvi r1,18
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
8004868: 44 43 00 05 be r2,r3,800487c <rtems_termios_baud_to_index+0xe0>
800486c: 34 03 10 04 mvi r3,4100
case B19200: baud_index = 14; break;
case B38400: baud_index = 15; break;
case B57600: baud_index = 16; break;
case B115200: baud_index = 17; break;
case B230400: baud_index = 18; break;
case B460800: baud_index = 19; break;
8004870: 34 01 00 13 mvi r1,19
rtems_termios_baud_t termios_baud
)
{
int baud_index;
switch (termios_baud) {
8004874: 44 43 00 02 be r2,r3,800487c <rtems_termios_baud_to_index+0xe0>
case B38400: baud_index = 15; break;
case B57600: baud_index = 16; break;
case B115200: baud_index = 17; break;
case B230400: baud_index = 18; break;
case B460800: baud_index = 19; break;
default: baud_index = -1; break;
8004878: 34 01 ff ff mvi r1,-1
}
return baud_index;
}
800487c: c3 a0 00 00 ret
080043fc <rtems_termios_close>:
rtems_interrupt_enable (level);
}
rtems_status_code
rtems_termios_close (void *arg)
{
80043fc: 37 9c ff ec addi sp,sp,-20
8004400: 5b 8b 00 14 sw (sp+20),r11
8004404: 5b 8c 00 10 sw (sp+16),r12
8004408: 5b 8d 00 0c sw (sp+12),r13
800440c: 5b 8e 00 08 sw (sp+8),r14
8004410: 5b 9d 00 04 sw (sp+4),ra
8004414: b8 20 70 00 mv r14,r1
rtems_libio_open_close_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
8004418: 28 21 00 00 lw r1,(r1+0)
rtems_status_code sc;
sc = rtems_semaphore_obtain(
800441c: 78 02 08 02 mvhi r2,0x802
8004420: 38 42 8e 30 ori r2,r2,0x8e30
rtems_status_code
rtems_termios_close (void *arg)
{
rtems_libio_open_close_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
8004424: 28 2b 00 28 lw r11,(r1+40)
rtems_status_code sc;
sc = rtems_semaphore_obtain(
8004428: 28 41 00 00 lw r1,(r2+0)
800442c: 34 03 00 00 mvi r3,0
8004430: 34 02 00 00 mvi r2,0
8004434: f8 00 08 42 calli 800653c <rtems_semaphore_obtain>
rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
8004438: 5c 20 00 25 bne r1,r0,80044cc <rtems_termios_close+0xd0> <== NEVER TAKEN
rtems_fatal_error_occurred (sc);
if (--tty->refcount == 0) {
800443c: 29 6d 00 08 lw r13,(r11+8)
8004440: 35 ad ff ff addi r13,r13,-1
8004444: 59 6d 00 08 sw (r11+8),r13
8004448: 5d a1 00 51 bne r13,r1,800458c <rtems_termios_close+0x190> <== NEVER TAKEN
if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
800444c: 29 61 00 cc lw r1,(r11+204)
8004450: 78 0c 08 02 mvhi r12,0x802
8004454: 34 02 00 05 mvi r2,5
8004458: 39 8c 88 30 ori r12,r12,0x8830
800445c: fb ff f1 72 calli 8000a24 <__ashlsi3>
8004460: b5 81 08 00 add r1,r12,r1
8004464: 28 2c 00 04 lw r12,(r1+4)
8004468: 45 8d 00 04 be r12,r13,8004478 <rtems_termios_close+0x7c>
/*
* call discipline-specific close
*/
sc = rtems_termios_linesw[tty->t_line].l_close(tty);
800446c: b9 60 08 00 mv r1,r11
8004470: d9 80 00 00 call r12
8004474: e0 00 00 0a bi 800449c <rtems_termios_close+0xa0>
} else {
/*
* default: just flush output buffer
*/
sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
8004478: 29 61 00 18 lw r1,(r11+24)
800447c: 34 02 00 00 mvi r2,0
8004480: 34 03 00 00 mvi r3,0
8004484: f8 00 08 2e calli 800653c <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL) {
8004488: 5d 81 00 11 bne r12,r1,80044cc <rtems_termios_close+0xd0> <== NEVER TAKEN
rtems_fatal_error_occurred (sc);
}
drainOutput (tty);
800448c: b9 60 08 00 mv r1,r11
8004490: fb ff fe 6c calli 8003e40 <drainOutput>
rtems_semaphore_release (tty->osem);
8004494: 29 61 00 18 lw r1,(r11+24)
8004498: f8 00 08 79 calli 800667c <rtems_semaphore_release>
}
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
800449c: 29 62 00 b4 lw r2,(r11+180)
80044a0: 34 01 00 02 mvi r1,2
80044a4: 5c 41 00 0b bne r2,r1,80044d0 <rtems_termios_close+0xd4>
/*
* send "terminate" to I/O tasks
*/
sc = rtems_event_send( tty->rxTaskId, TERMIOS_RX_TERMINATE_EVENT );
80044a8: 29 61 00 c4 lw r1,(r11+196)
80044ac: 34 02 00 01 mvi r2,1
80044b0: f8 00 06 e0 calli 8006030 <rtems_event_send>
80044b4: b8 20 60 00 mv r12,r1
if (sc != RTEMS_SUCCESSFUL)
80044b8: 5c 20 00 05 bne r1,r0,80044cc <rtems_termios_close+0xd0> <== NEVER TAKEN
rtems_fatal_error_occurred (sc);
sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT );
80044bc: 29 61 00 c8 lw r1,(r11+200)
80044c0: 34 02 00 01 mvi r2,1
80044c4: f8 00 06 db calli 8006030 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
80044c8: 44 2c 00 02 be r1,r12,80044d0 <rtems_termios_close+0xd4> <== ALWAYS TAKEN
rtems_fatal_error_occurred (sc);
80044cc: f8 00 0a 90 calli 8006f0c <rtems_fatal_error_occurred> <== NOT EXECUTED
}
if (tty->device.lastClose)
80044d0: 29 64 00 9c lw r4,(r11+156)
80044d4: 44 80 00 05 be r4,r0,80044e8 <rtems_termios_close+0xec> <== ALWAYS TAKEN
(*tty->device.lastClose)(tty->major, tty->minor, arg);
80044d8: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED
80044dc: 29 62 00 10 lw r2,(r11+16) <== NOT EXECUTED
80044e0: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED
80044e4: d8 80 00 00 call r4 <== NOT EXECUTED
if (tty->forw == NULL) {
80044e8: 29 62 00 00 lw r2,(r11+0)
80044ec: 29 61 00 04 lw r1,(r11+4)
80044f0: 5c 40 00 07 bne r2,r0,800450c <rtems_termios_close+0x110> <== NEVER TAKEN
rtems_termios_ttyTail = tty->back;
80044f4: 78 03 08 02 mvhi r3,0x802
80044f8: 38 63 8e 34 ori r3,r3,0x8e34
80044fc: 58 61 00 00 sw (r3+0),r1
if ( rtems_termios_ttyTail != NULL ) {
8004500: 44 22 00 04 be r1,r2,8004510 <rtems_termios_close+0x114> <== ALWAYS TAKEN
rtems_termios_ttyTail->forw = NULL;
8004504: 58 20 00 00 sw (r1+0),r0 <== NOT EXECUTED
8004508: e0 00 00 02 bi 8004510 <rtems_termios_close+0x114> <== NOT EXECUTED
}
} else {
tty->forw->back = tty->back;
800450c: 58 41 00 04 sw (r2+4),r1 <== NOT EXECUTED
}
if (tty->back == NULL) {
8004510: 29 62 00 04 lw r2,(r11+4)
8004514: 29 61 00 00 lw r1,(r11+0)
8004518: 5c 40 00 07 bne r2,r0,8004534 <rtems_termios_close+0x138> <== NEVER TAKEN
rtems_termios_ttyHead = tty->forw;
800451c: 78 03 08 02 mvhi r3,0x802
8004520: 38 63 8e 38 ori r3,r3,0x8e38
8004524: 58 61 00 00 sw (r3+0),r1
if ( rtems_termios_ttyHead != NULL ) {
8004528: 44 22 00 04 be r1,r2,8004538 <rtems_termios_close+0x13c> <== ALWAYS TAKEN
rtems_termios_ttyHead->back = NULL;
800452c: 58 20 00 04 sw (r1+4),r0 <== NOT EXECUTED
8004530: e0 00 00 02 bi 8004538 <rtems_termios_close+0x13c> <== NOT EXECUTED
}
} else {
tty->back->forw = tty->forw;
8004534: 58 41 00 00 sw (r2+0),r1 <== NOT EXECUTED
}
rtems_semaphore_delete (tty->isem);
8004538: 29 61 00 14 lw r1,(r11+20)
800453c: f8 00 07 d1 calli 8006480 <rtems_semaphore_delete>
rtems_semaphore_delete (tty->osem);
8004540: 29 61 00 18 lw r1,(r11+24)
8004544: f8 00 07 cf calli 8006480 <rtems_semaphore_delete>
rtems_semaphore_delete (tty->rawOutBuf.Semaphore);
8004548: 29 61 00 8c lw r1,(r11+140)
800454c: f8 00 07 cd calli 8006480 <rtems_semaphore_delete>
if ((tty->device.pollRead == NULL) ||
8004550: 29 61 00 a0 lw r1,(r11+160)
8004554: 44 20 00 04 be r1,r0,8004564 <rtems_termios_close+0x168>
8004558: 29 62 00 b4 lw r2,(r11+180)
800455c: 34 01 00 02 mvi r1,2
8004560: 5c 41 00 03 bne r2,r1,800456c <rtems_termios_close+0x170>
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN))
rtems_semaphore_delete (tty->rawInBuf.Semaphore);
8004564: 29 61 00 68 lw r1,(r11+104)
8004568: f8 00 07 c6 calli 8006480 <rtems_semaphore_delete>
free (tty->rawInBuf.theBuf);
800456c: 29 61 00 58 lw r1,(r11+88)
8004570: fb ff f6 34 calli 8001e40 <free>
free (tty->rawOutBuf.theBuf);
8004574: 29 61 00 7c lw r1,(r11+124)
8004578: fb ff f6 32 calli 8001e40 <free>
free (tty->cbuf);
800457c: 29 61 00 1c lw r1,(r11+28)
8004580: fb ff f6 30 calli 8001e40 <free>
free (tty);
8004584: b9 60 08 00 mv r1,r11
8004588: fb ff f6 2e calli 8001e40 <free>
}
rtems_semaphore_release (rtems_termios_ttyMutex);
800458c: 78 01 08 02 mvhi r1,0x802
8004590: 38 21 8e 30 ori r1,r1,0x8e30
8004594: 28 21 00 00 lw r1,(r1+0)
8004598: f8 00 08 39 calli 800667c <rtems_semaphore_release>
return RTEMS_SUCCESSFUL;
}
800459c: 34 01 00 00 mvi r1,0
80045a0: 2b 9d 00 04 lw ra,(sp+4)
80045a4: 2b 8b 00 14 lw r11,(sp+20)
80045a8: 2b 8c 00 10 lw r12,(sp+16)
80045ac: 2b 8d 00 0c lw r13,(sp+12)
80045b0: 2b 8e 00 08 lw r14,(sp+8)
80045b4: 37 9c 00 14 addi sp,sp,20
80045b8: c3 a0 00 00 ret
080059c8 <rtems_termios_dequeue_characters>:
* for each transmitted character.
* It returns number of characters left to transmit
*/
int
rtems_termios_dequeue_characters (void *ttyp, int len)
{
80059c8: 37 9c ff f8 addi sp,sp,-8
80059cc: 5b 8b 00 08 sw (sp+8),r11
80059d0: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc;
/*
* sum up character count already sent
*/
tty->t_dqlen += len;
80059d4: 28 24 00 90 lw r4,(r1+144)
80059d8: b4 82 10 00 add r2,r4,r2
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
80059dc: 28 24 00 b4 lw r4,(r1+180)
rtems_status_code sc;
/*
* sum up character count already sent
*/
tty->t_dqlen += len;
80059e0: 58 22 00 90 sw (r1+144),r2
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
80059e4: 34 02 00 02 mvi r2,2
80059e8: 5c 82 00 06 bne r4,r2,8005a00 <rtems_termios_dequeue_characters+0x38>
/*
* send wake up to transmitter task
*/
sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT);
80059ec: 28 21 00 c8 lw r1,(r1+200)
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
return 0; /* nothing to output in IRQ... */
80059f0: 34 0b 00 00 mvi r11,0
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
/*
* send wake up to transmitter task
*/
sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT);
80059f4: f8 00 01 8f calli 8006030 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
80059f8: 44 20 00 0e be r1,r0,8005a30 <rtems_termios_dequeue_characters+0x68><== ALWAYS TAKEN
rtems_fatal_error_occurred (sc);
80059fc: f8 00 05 44 calli 8006f0c <rtems_fatal_error_occurred> <== NOT EXECUTED
return 0; /* nothing to output in IRQ... */
}
if (tty->t_line == PPPDISC ) {
8005a00: 28 23 00 cc lw r3,(r1+204)
8005a04: 34 02 00 05 mvi r2,5
8005a08: 5c 62 00 08 bne r3,r2,8005a28 <rtems_termios_dequeue_characters+0x60>
/*
* call any line discipline start function
*/
if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
8005a0c: 78 02 08 02 mvhi r2,0x802
8005a10: 38 42 88 30 ori r2,r2,0x8830
8005a14: 28 42 00 b4 lw r2,(r2+180)
rtems_termios_linesw[tty->t_line].l_start(tty);
}
return 0; /* nothing to output in IRQ... */
8005a18: 34 0b 00 00 mvi r11,0
if (tty->t_line == PPPDISC ) {
/*
* call any line discipline start function
*/
if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
8005a1c: 44 40 00 05 be r2,r0,8005a30 <rtems_termios_dequeue_characters+0x68><== NEVER TAKEN
rtems_termios_linesw[tty->t_line].l_start(tty);
8005a20: d8 40 00 00 call r2
8005a24: e0 00 00 03 bi 8005a30 <rtems_termios_dequeue_characters+0x68>
}
return 0; /* nothing to output in IRQ... */
}
return rtems_termios_refill_transmitter(tty);
8005a28: fb ff f8 87 calli 8003c44 <rtems_termios_refill_transmitter>
8005a2c: b8 20 58 00 mv r11,r1
}
8005a30: b9 60 08 00 mv r1,r11
8005a34: 2b 9d 00 04 lw ra,(sp+4)
8005a38: 2b 8b 00 08 lw r11,(sp+8)
8005a3c: 37 9c 00 08 addi sp,sp,8
8005a40: c3 a0 00 00 ret
08005628 <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)
{
8005628: 37 9c ff bc addi sp,sp,-68
800562c: 5b 8b 00 44 sw (sp+68),r11
8005630: 5b 8c 00 40 sw (sp+64),r12
8005634: 5b 8d 00 3c sw (sp+60),r13
8005638: 5b 8e 00 38 sw (sp+56),r14
800563c: 5b 8f 00 34 sw (sp+52),r15
8005640: 5b 90 00 30 sw (sp+48),r16
8005644: 5b 91 00 2c sw (sp+44),r17
8005648: 5b 92 00 28 sw (sp+40),r18
800564c: 5b 93 00 24 sw (sp+36),r19
8005650: 5b 94 00 20 sw (sp+32),r20
8005654: 5b 95 00 1c sw (sp+28),r21
8005658: 5b 96 00 18 sw (sp+24),r22
800565c: 5b 97 00 14 sw (sp+20),r23
8005660: 5b 98 00 10 sw (sp+16),r24
8005664: 5b 99 00 0c sw (sp+12),r25
8005668: 5b 9b 00 08 sw (sp+8),fp
800566c: 5b 9d 00 04 sw (sp+4),ra
8005670: b8 20 58 00 mv r11,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) {
8005674: 28 21 00 cc lw r1,(r1+204)
* 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)
{
8005678: b8 40 68 00 mv r13,r2
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) {
800567c: 78 0c 08 02 mvhi r12,0x802
8005680: 34 02 00 05 mvi r2,5
* 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)
{
8005684: b8 60 78 00 mv r15,r3
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) {
8005688: 39 8c 88 30 ori r12,r12,0x8830
800568c: fb ff ec e6 calli 8000a24 <__ashlsi3>
8005690: b5 81 08 00 add r1,r12,r1
8005694: 28 21 00 10 lw r1,(r1+16)
8005698: b9 e0 70 00 mv r14,r15
800569c: 5c 20 00 17 bne r1,r0,80056f8 <rtems_termios_enqueue_raw_characters+0xd0>
80056a0: 34 12 00 00 mvi r18,0
80056a4: 34 0c 00 00 mvi r12,0
flow_rcv = true;
}
}
if (flow_rcv) {
/* restart output according to FL_ORCVXOF flag */
if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) {
80056a8: 34 1b 00 20 mvi fp,32
/* disable interrupts */
rtems_interrupt_disable(level);
80056ac: 34 11 ff fe mvi r17,-2
tty->flow_ctrl &= ~FL_OSTOP;
80056b0: 34 19 ff df mvi r25,-33
/*
* 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);
80056b4: 35 78 00 30 addi r24,r11,48
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))
80056b8: 34 17 04 00 mvi r23,1024
/* 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) ) {
80056bc: 34 16 01 00 mvi r22,256
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,
80056c0: 35 75 00 4a addi r21,r11,74
flow_rcv = true;
}
else if (c == tty->termios.c_cc[VSTART]) {
/* VSTART received */
/* restart output */
tty->flow_ctrl &= ~FL_ORCVXOF;
80056c4: 34 14 ff ef mvi r20,-17
80056c8: e0 00 00 87 bi 80058e4 <rtems_termios_enqueue_raw_characters+0x2bc>
rtems_interrupt_level level;
if (rtems_termios_linesw[tty->t_line].l_rint != NULL) {
while (len--) {
c = *buf++;
rtems_termios_linesw[tty->t_line].l_rint(c,tty);
80056cc: 29 61 00 cc lw r1,(r11+204)
80056d0: 34 02 00 05 mvi r2,5
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--) {
c = *buf++;
80056d4: 41 af 00 00 lbu r15,(r13+0)
rtems_termios_linesw[tty->t_line].l_rint(c,tty);
80056d8: fb ff ec d3 calli 8000a24 <__ashlsi3>
80056dc: b5 81 10 00 add r2,r12,r1
80056e0: 28 43 00 10 lw r3,(r2+16)
80056e4: b9 e0 08 00 mv r1,r15
80056e8: b9 60 10 00 mv r2,r11
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--) {
c = *buf++;
80056ec: 35 ad 00 01 addi r13,r13,1
rtems_termios_linesw[tty->t_line].l_rint(c,tty);
80056f0: d8 60 00 00 call r3
80056f4: 35 ce ff ff addi r14,r14,-1
int dropped = 0;
bool flow_rcv = false; /* true, if flow control char received */
rtems_interrupt_level level;
if (rtems_termios_linesw[tty->t_line].l_rint != NULL) {
while (len--) {
80056f8: 5d c0 ff f5 bne r14,r0,80056cc <rtems_termios_enqueue_raw_characters+0xa4>
}
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
80056fc: 29 61 00 e4 lw r1,(r11+228)
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
tty->tty_rcvwakeup = 1;
}
return 0;
8005700: 34 0c 00 00 mvi r12,0
}
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
8005704: 5c 2c 00 7e bne r1,r12,80058fc <rtems_termios_enqueue_raw_characters+0x2d4><== NEVER TAKEN
8005708: 29 63 00 dc lw r3,(r11+220)
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
tty->tty_rcvwakeup = 1;
}
return 0;
800570c: b9 c0 60 00 mv r12,r14
}
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
8005710: 44 60 00 7b be r3,r0,80058fc <rtems_termios_enqueue_raw_characters+0x2d4>
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
8005714: 29 62 00 e0 lw r2,(r11+224)
8005718: 35 61 00 30 addi r1,r11,48
800571c: d8 60 00 00 call r3
tty->tty_rcvwakeup = 1;
8005720: 34 01 00 01 mvi r1,1
8005724: 59 61 00 e4 sw (r11+228),r1
8005728: e0 00 00 75 bi 80058fc <rtems_termios_enqueue_raw_characters+0x2d4>
while (len--) {
c = *buf++;
/* FIXME: implement IXANY: any character restarts output */
/* if incoming XON/XOFF controls outgoing stream: */
if (tty->flow_ctrl & FL_MDXON) {
800572c: 29 61 00 b8 lw r1,(r11+184)
}
return 0;
}
while (len--) {
c = *buf++;
8005730: 41 b0 00 00 lbu r16,(r13+0)
8005734: 35 ad 00 01 addi r13,r13,1
/* FIXME: implement IXANY: any character restarts output */
/* if incoming XON/XOFF controls outgoing stream: */
if (tty->flow_ctrl & FL_MDXON) {
8005738: 20 21 02 00 andi r1,r1,0x200
800573c: 44 20 00 11 be r1,r0,8005780 <rtems_termios_enqueue_raw_characters+0x158>
/* if received char is V_STOP and V_START (both are equal value) */
if (c == tty->termios.c_cc[VSTOP]) {
8005740: 41 64 00 4a lbu r4,(r11+74)
8005744: 41 63 00 49 lbu r3,(r11+73)
8005748: 5c 90 00 0a bne r4,r16,8005770 <rtems_termios_enqueue_raw_characters+0x148>
if (c == tty->termios.c_cc[VSTART]) {
800574c: 5c 64 00 04 bne r3,r4,800575c <rtems_termios_enqueue_raw_characters+0x134><== ALWAYS TAKEN
/* received VSTOP and VSTART==VSTOP? */
/* then toggle "stop output" status */
tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF;
8005750: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED
8005754: 18 21 00 10 xori r1,r1,0x10 <== NOT EXECUTED
8005758: e0 00 00 03 bi 8005764 <rtems_termios_enqueue_raw_characters+0x13c><== NOT EXECUTED
}
else {
/* VSTOP received (other code than VSTART) */
/* stop output */
tty->flow_ctrl |= FL_ORCVXOF;
800575c: 29 61 00 b8 lw r1,(r11+184)
8005760: 38 21 00 10 ori r1,r1,0x10
8005764: 59 61 00 b8 sw (r11+184),r1
* 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)
{
8005768: 34 12 00 01 mvi r18,1
800576c: e0 00 00 06 bi 8005784 <rtems_termios_enqueue_raw_characters+0x15c>
/* stop output */
tty->flow_ctrl |= FL_ORCVXOF;
}
flow_rcv = true;
}
else if (c == tty->termios.c_cc[VSTART]) {
8005770: 5c 70 00 04 bne r3,r16,8005780 <rtems_termios_enqueue_raw_characters+0x158><== ALWAYS TAKEN
/* VSTART received */
/* restart output */
tty->flow_ctrl &= ~FL_ORCVXOF;
8005774: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED
8005778: a0 34 08 00 and r1,r1,r20 <== NOT EXECUTED
800577c: e3 ff ff fa bi 8005764 <rtems_termios_enqueue_raw_characters+0x13c><== NOT EXECUTED
flow_rcv = true;
}
}
if (flow_rcv) {
8005780: 46 40 00 15 be r18,r0,80057d4 <rtems_termios_enqueue_raw_characters+0x1ac><== ALWAYS TAKEN
/* restart output according to FL_ORCVXOF flag */
if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) {
8005784: 29 61 00 b8 lw r1,(r11+184)
8005788: 20 21 00 30 andi r1,r1,0x30
800578c: 5c 3b 00 55 bne r1,fp,80058e0 <rtems_termios_enqueue_raw_characters+0x2b8><== ALWAYS TAKEN
/* disable interrupts */
rtems_interrupt_disable(level);
8005790: 90 00 70 00 rcsr r14,IE <== NOT EXECUTED
8005794: a1 d1 08 00 and r1,r14,r17 <== NOT EXECUTED
8005798: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED
tty->flow_ctrl &= ~FL_OSTOP;
800579c: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED
80057a0: a0 39 08 00 and r1,r1,r25 <== NOT EXECUTED
80057a4: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
80057a8: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED
80057ac: 44 20 00 08 be r1,r0,80057cc <rtems_termios_enqueue_raw_characters+0x1a4><== NOT EXECUTED
/* if chars available, call write function... */
(*tty->device.write)(
tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1);
80057b0: 29 63 00 84 lw r3,(r11+132) <== 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)(
80057b4: 29 62 00 7c lw r2,(r11+124) <== NOT EXECUTED
80057b8: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED
80057bc: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED
80057c0: b4 43 10 00 add r2,r2,r3 <== NOT EXECUTED
80057c4: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
80057c8: d8 80 00 00 call r4 <== NOT EXECUTED
tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1);
}
/* reenable interrupts */
rtems_interrupt_enable(level);
80057cc: d0 0e 00 00 wcsr IE,r14 <== NOT EXECUTED
80057d0: e0 00 00 44 bi 80058e0 <rtems_termios_enqueue_raw_characters+0x2b8><== NOT EXECUTED
}
} else {
newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size;
80057d4: 29 63 00 60 lw r3,(r11+96)
80057d8: 29 62 00 64 lw r2,(r11+100)
80057dc: 34 61 00 01 addi r1,r3,1
80057e0: f8 00 78 0e calli 8023818 <__umodsi3>
80057e4: b8 20 70 00 mv r14,r1
/* if chars_in_buffer > highwater */
rtems_interrupt_disable(level);
80057e8: 90 00 98 00 rcsr r19,IE
80057ec: a2 71 08 00 and r1,r19,r17
80057f0: d0 01 00 00 wcsr IE,r1
if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size)
80057f4: 29 61 00 5c lw r1,(r11+92)
80057f8: 29 63 00 64 lw r3,(r11+100)
% tty->rawInBuf.Size) > tty->highwater) &&
80057fc: 29 62 00 64 lw r2,(r11+100)
}
} 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)
8005800: c8 61 18 00 sub r3,r3,r1
% tty->rawInBuf.Size) > tty->highwater) &&
8005804: b4 6e 08 00 add r1,r3,r14
8005808: f8 00 78 04 calli 8023818 <__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)
800580c: 29 62 00 c0 lw r2,(r11+192)
8005810: 50 41 00 22 bgeu r2,r1,8005898 <rtems_termios_enqueue_raw_characters+0x270><== ALWAYS TAKEN
% tty->rawInBuf.Size) > tty->highwater) &&
!(tty->flow_ctrl & FL_IREQXOF)) {
8005814: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED
8005818: 20 21 00 01 andi r1,r1,0x1 <== 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) &&
800581c: 5c 20 00 1f bne r1,r0,8005898 <rtems_termios_enqueue_raw_characters+0x270><== NOT EXECUTED
!(tty->flow_ctrl & FL_IREQXOF)) {
/* incoming data stream should be stopped */
tty->flow_ctrl |= FL_IREQXOF;
8005820: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED
8005824: 38 21 00 01 ori r1,r1,0x1 <== NOT EXECUTED
8005828: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED
if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF))
800582c: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED
8005830: 20 21 04 02 andi r1,r1,0x402 <== NOT EXECUTED
8005834: 5c 37 00 0f bne r1,r23,8005870 <rtems_termios_enqueue_raw_characters+0x248><== NOT EXECUTED
== (FL_MDXOF ) ) {
if ((tty->flow_ctrl & FL_OSTOP) ||
8005838: 29 63 00 b8 lw r3,(r11+184) <== NOT EXECUTED
800583c: 20 63 00 20 andi r3,r3,0x20 <== NOT EXECUTED
8005840: 5c 60 00 03 bne r3,r0,800584c <rtems_termios_enqueue_raw_characters+0x224><== NOT EXECUTED
8005844: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED
8005848: 5c 23 00 14 bne r1,r3,8005898 <rtems_termios_enqueue_raw_characters+0x270><== 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;
800584c: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED
(*tty->device.write)(tty->minor,
8005850: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED
8005854: ba a0 10 00 mv r2,r21 <== NOT EXECUTED
== (FL_MDXOF ) ) {
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;
8005858: 38 21 00 02 ori r1,r1,0x2 <== NOT EXECUTED
800585c: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED
(*tty->device.write)(tty->minor,
8005860: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED
8005864: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
8005868: d8 80 00 00 call r4 <== NOT EXECUTED
800586c: e0 00 00 0b bi 8005898 <rtems_termios_enqueue_raw_characters+0x270><== NOT EXECUTED
(void *)&(tty->termios.c_cc[VSTOP]), 1);
}
} else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
8005870: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED
8005874: 20 21 01 04 andi r1,r1,0x104 <== NOT EXECUTED
8005878: 5c 36 00 08 bne r1,r22,8005898 <rtems_termios_enqueue_raw_characters+0x270><== NOT EXECUTED
tty->flow_ctrl |= FL_IRTSOFF;
800587c: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED
/* deactivate RTS line */
if (tty->device.stopRemoteTx != NULL) {
8005880: 29 63 00 ac lw r3,(r11+172) <== 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;
8005884: 38 21 00 04 ori r1,r1,0x4 <== NOT EXECUTED
8005888: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED
/* deactivate RTS line */
if (tty->device.stopRemoteTx != NULL) {
800588c: 44 60 00 03 be r3,r0,8005898 <rtems_termios_enqueue_raw_characters+0x270><== NOT EXECUTED
tty->device.stopRemoteTx(tty->minor);
8005890: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED
8005894: d8 60 00 00 call r3 <== NOT EXECUTED
}
}
}
/* reenable interrupts */
rtems_interrupt_enable(level);
8005898: d0 13 00 00 wcsr IE,r19
if (newTail == tty->rawInBuf.Head) {
800589c: 29 61 00 5c lw r1,(r11+92)
80058a0: 5d c1 00 03 bne r14,r1,80058ac <rtems_termios_enqueue_raw_characters+0x284><== ALWAYS TAKEN
dropped++;
80058a4: 35 8c 00 01 addi r12,r12,1 <== NOT EXECUTED
80058a8: e0 00 00 0e bi 80058e0 <rtems_termios_enqueue_raw_characters+0x2b8><== NOT EXECUTED
} else {
tty->rawInBuf.theBuf[newTail] = c;
80058ac: 29 61 00 58 lw r1,(r11+88)
80058b0: b4 2e 08 00 add r1,r1,r14
80058b4: 30 30 00 00 sb (r1+0),r16
tty->rawInBuf.Tail = newTail;
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
80058b8: 29 64 00 e4 lw r4,(r11+228)
if (newTail == tty->rawInBuf.Head) {
dropped++;
} else {
tty->rawInBuf.theBuf[newTail] = c;
tty->rawInBuf.Tail = newTail;
80058bc: 59 6e 00 60 sw (r11+96),r14
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
80058c0: 5c 80 00 08 bne r4,r0,80058e0 <rtems_termios_enqueue_raw_characters+0x2b8><== NEVER TAKEN
80058c4: 29 63 00 dc lw r3,(r11+220)
80058c8: 44 64 00 06 be r3,r4,80058e0 <rtems_termios_enqueue_raw_characters+0x2b8><== ALWAYS TAKEN
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
80058cc: 29 62 00 e0 lw r2,(r11+224) <== NOT EXECUTED
80058d0: bb 00 08 00 mv r1,r24 <== NOT EXECUTED
80058d4: d8 60 00 00 call r3 <== NOT EXECUTED
tty->tty_rcvwakeup = 1;
80058d8: 34 01 00 01 mvi r1,1 <== NOT EXECUTED
80058dc: 59 61 00 e4 sw (r11+228),r1 <== NOT EXECUTED
80058e0: 35 ef ff ff addi r15,r15,-1
tty->tty_rcvwakeup = 1;
}
return 0;
}
while (len--) {
80058e4: 5d e0 ff 92 bne r15,r0,800572c <rtems_termios_enqueue_raw_characters+0x104>
}
}
}
}
tty->rawInBufDropped += dropped;
80058e8: 29 61 00 78 lw r1,(r11+120)
80058ec: b4 2c 08 00 add r1,r1,r12
80058f0: 59 61 00 78 sw (r11+120),r1
rtems_semaphore_release (tty->rawInBuf.Semaphore);
80058f4: 29 61 00 68 lw r1,(r11+104)
80058f8: f8 00 03 61 calli 800667c <rtems_semaphore_release>
return dropped;
}
80058fc: b9 80 08 00 mv r1,r12
8005900: 2b 9d 00 04 lw ra,(sp+4)
8005904: 2b 8b 00 44 lw r11,(sp+68)
8005908: 2b 8c 00 40 lw r12,(sp+64)
800590c: 2b 8d 00 3c lw r13,(sp+60)
8005910: 2b 8e 00 38 lw r14,(sp+56)
8005914: 2b 8f 00 34 lw r15,(sp+52)
8005918: 2b 90 00 30 lw r16,(sp+48)
800591c: 2b 91 00 2c lw r17,(sp+44)
8005920: 2b 92 00 28 lw r18,(sp+40)
8005924: 2b 93 00 24 lw r19,(sp+36)
8005928: 2b 94 00 20 lw r20,(sp+32)
800592c: 2b 95 00 1c lw r21,(sp+28)
8005930: 2b 96 00 18 lw r22,(sp+24)
8005934: 2b 97 00 14 lw r23,(sp+20)
8005938: 2b 98 00 10 lw r24,(sp+16)
800593c: 2b 99 00 0c lw r25,(sp+12)
8005940: 2b 9b 00 08 lw fp,(sp+8)
8005944: 37 9c 00 44 addi sp,sp,68
8005948: c3 a0 00 00 ret
08003bf4 <rtems_termios_initialize>:
struct rtems_termios_tty *rtems_termios_ttyTail;
rtems_id rtems_termios_ttyMutex;
void
rtems_termios_initialize (void)
{
8003bf4: 37 9c ff f8 addi sp,sp,-8
8003bf8: 5b 8b 00 08 sw (sp+8),r11
8003bfc: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc;
/*
* Create the mutex semaphore for the tty list
*/
if (!rtems_termios_ttyMutex) {
8003c00: 78 05 08 02 mvhi r5,0x802
8003c04: 38 a5 8e 30 ori r5,r5,0x8e30
8003c08: 28 ab 00 00 lw r11,(r5+0)
8003c0c: 5d 60 00 0a bne r11,r0,8003c34 <rtems_termios_initialize+0x40><== NEVER TAKEN
sc = rtems_semaphore_create (
8003c10: 78 02 08 02 mvhi r2,0x802
8003c14: 38 42 54 40 ori r2,r2,0x5440
8003c18: 28 41 00 00 lw r1,(r2+0)
8003c1c: 34 03 00 54 mvi r3,84
8003c20: 34 02 00 01 mvi r2,1
8003c24: 34 04 00 00 mvi r4,0
8003c28: f8 00 09 99 calli 800628c <rtems_semaphore_create>
rtems_build_name ('T', 'R', 'm', 'i'),
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&rtems_termios_ttyMutex);
if (sc != RTEMS_SUCCESSFUL)
8003c2c: 44 2b 00 02 be r1,r11,8003c34 <rtems_termios_initialize+0x40><== ALWAYS TAKEN
rtems_fatal_error_occurred (sc);
8003c30: f8 00 0c b7 calli 8006f0c <rtems_fatal_error_occurred> <== NOT EXECUTED
}
}
8003c34: 2b 9d 00 04 lw ra,(sp+4)
8003c38: 2b 8b 00 08 lw r11,(sp+8)
8003c3c: 37 9c 00 08 addi sp,sp,8
8003c40: c3 a0 00 00 ret
080045e8 <rtems_termios_ioctl>:
}
}
rtems_status_code
rtems_termios_ioctl (void *arg)
{
80045e8: 37 9c ff ec addi sp,sp,-20
80045ec: 5b 8b 00 14 sw (sp+20),r11
80045f0: 5b 8c 00 10 sw (sp+16),r12
80045f4: 5b 8d 00 0c sw (sp+12),r13
80045f8: 5b 8e 00 08 sw (sp+8),r14
80045fc: 5b 9d 00 04 sw (sp+4),ra
8004600: b8 20 60 00 mv r12,r1
rtems_libio_ioctl_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
8004604: 28 21 00 00 lw r1,(r1+0)
struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer;
rtems_status_code sc;
args->ioctl_return = 0;
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
8004608: 34 02 00 00 mvi r2,0
800460c: 34 03 00 00 mvi r3,0
rtems_status_code
rtems_termios_ioctl (void *arg)
{
rtems_libio_ioctl_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
8004610: 28 2b 00 28 lw r11,(r1+40)
struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer;
rtems_status_code sc;
args->ioctl_return = 0;
8004614: 59 80 00 0c sw (r12+12),r0
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;
8004618: 29 8e 00 08 lw r14,(r12+8)
rtems_status_code sc;
args->ioctl_return = 0;
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
800461c: 29 61 00 18 lw r1,(r11+24)
8004620: f8 00 07 c7 calli 800653c <rtems_semaphore_obtain>
8004624: b8 20 68 00 mv r13,r1
if (sc != RTEMS_SUCCESSFUL) {
8004628: 5c 20 01 00 bne r1,r0,8004a28 <rtems_termios_ioctl+0x440> <== NEVER TAKEN
return sc;
}
switch (args->command) {
800462c: 29 82 00 04 lw r2,(r12+4)
8004630: 34 01 00 05 mvi r1,5
8004634: 44 41 00 c5 be r2,r1,8004948 <rtems_termios_ioctl+0x360> <== NEVER TAKEN
8004638: 54 41 00 0c bgu r2,r1,8004668 <rtems_termios_ioctl+0x80>
800463c: 34 01 00 02 mvi r1,2
8004640: 44 41 00 2c be r2,r1,80046f0 <rtems_termios_ioctl+0x108>
8004644: 54 41 00 04 bgu r2,r1,8004654 <rtems_termios_ioctl+0x6c>
8004648: 34 01 00 01 mvi r1,1
800464c: 5c 41 00 17 bne r2,r1,80046a8 <rtems_termios_ioctl+0xc0> <== NEVER TAKEN
8004650: e0 00 00 23 bi 80046dc <rtems_termios_ioctl+0xf4>
8004654: 34 01 00 03 mvi r1,3
8004658: 44 41 00 9a be r2,r1,80048c0 <rtems_termios_ioctl+0x2d8>
800465c: 34 01 00 04 mvi r1,4
8004660: 5c 41 00 12 bne r2,r1,80046a8 <rtems_termios_ioctl+0xc0> <== NEVER TAKEN
8004664: e0 00 00 be bi 800495c <rtems_termios_ioctl+0x374>
8004668: 78 03 08 02 mvhi r3,0x802
800466c: 38 63 54 5c ori r3,r3,0x545c
8004670: 28 61 00 00 lw r1,(r3+0)
8004674: 44 41 00 dd be r2,r1,80049e8 <rtems_termios_ioctl+0x400> <== NEVER TAKEN
8004678: 54 41 00 04 bgu r2,r1,8004688 <rtems_termios_ioctl+0xa0>
800467c: 34 01 00 06 mvi r1,6
8004680: 5c 41 00 0a bne r2,r1,80046a8 <rtems_termios_ioctl+0xc0> <== ALWAYS TAKEN
8004684: e0 00 00 92 bi 80048cc <rtems_termios_ioctl+0x2e4> <== NOT EXECUTED
8004688: 78 03 08 02 mvhi r3,0x802
800468c: 38 63 54 60 ori r3,r3,0x5460
8004690: 28 61 00 00 lw r1,(r3+0)
8004694: 44 41 00 d1 be r2,r1,80049d8 <rtems_termios_ioctl+0x3f0> <== NEVER TAKEN
8004698: 78 03 08 02 mvhi r3,0x802
800469c: 38 63 54 64 ori r3,r3,0x5464
80046a0: 28 61 00 00 lw r1,(r3+0)
80046a4: 44 41 00 b3 be r2,r1,8004970 <rtems_termios_ioctl+0x388> <== ALWAYS TAKEN
default:
if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) {
80046a8: 29 61 00 cc lw r1,(r11+204)
80046ac: 78 0d 08 02 mvhi r13,0x802
80046b0: 34 02 00 05 mvi r2,5
80046b4: 39 ad 88 30 ori r13,r13,0x8830
80046b8: fb ff f0 db calli 8000a24 <__ashlsi3>
80046bc: b5 a1 08 00 add r1,r13,r1
80046c0: 28 23 00 18 lw r3,(r1+24)
sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args);
}
else {
sc = RTEMS_INVALID_NUMBER;
80046c4: 34 0d 00 0a mvi r13,10
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
switch (args->command) {
default:
if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) {
80046c8: 44 60 00 d6 be r3,r0,8004a20 <rtems_termios_ioctl+0x438> <== NEVER TAKEN
sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args);
80046cc: b9 60 08 00 mv r1,r11
80046d0: b9 80 10 00 mv r2,r12
80046d4: d8 60 00 00 call r3
80046d8: e0 00 00 be bi 80049d0 <rtems_termios_ioctl+0x3e8>
sc = RTEMS_INVALID_NUMBER;
}
break;
case RTEMS_IO_GET_ATTRIBUTES:
*(struct termios *)args->buffer = tty->termios;
80046dc: 29 81 00 08 lw r1,(r12+8)
80046e0: 35 62 00 30 addi r2,r11,48
80046e4: 34 03 00 24 mvi r3,36
80046e8: f8 00 35 12 calli 8011b30 <memcpy>
break;
80046ec: e0 00 00 cd bi 8004a20 <rtems_termios_ioctl+0x438>
case RTEMS_IO_SET_ATTRIBUTES:
tty->termios = *(struct termios *)args->buffer;
80046f0: 29 82 00 08 lw r2,(r12+8)
80046f4: 35 61 00 30 addi r1,r11,48
80046f8: 34 03 00 24 mvi r3,36
80046fc: f8 00 35 0d calli 8011b30 <memcpy>
/*
* check for flow control options to be switched off
*/
/* check for outgoing XON/XOFF flow control switched off */
if (( tty->flow_ctrl & FL_MDXON) &&
8004700: 29 61 00 b8 lw r1,(r11+184)
8004704: 20 21 02 00 andi r1,r1,0x200
8004708: 44 20 00 1d be r1,r0,800477c <rtems_termios_ioctl+0x194>
!(tty->termios.c_iflag & IXON)) {
800470c: 29 61 00 30 lw r1,(r11+48)
8004710: 20 21 04 00 andi r1,r1,0x400
/*
* check for flow control options to be switched off
*/
/* check for outgoing XON/XOFF flow control switched off */
if (( tty->flow_ctrl & FL_MDXON) &&
8004714: 5c 20 00 1a bne r1,r0,800477c <rtems_termios_ioctl+0x194>
!(tty->termios.c_iflag & IXON)) {
/* clear related flags in flow_ctrl */
tty->flow_ctrl &= ~(FL_MDXON | FL_ORCVXOF);
8004718: 29 62 00 b8 lw r2,(r11+184)
800471c: 34 01 fd ef mvi r1,-529
8004720: a0 41 08 00 and r1,r2,r1
8004724: 59 61 00 b8 sw (r11+184),r1
/* has output been stopped due to received XOFF? */
if (tty->flow_ctrl & FL_OSTOP) {
8004728: 29 61 00 b8 lw r1,(r11+184)
800472c: 20 21 00 20 andi r1,r1,0x20
8004730: 44 20 00 13 be r1,r0,800477c <rtems_termios_ioctl+0x194> <== ALWAYS TAKEN
/* disable interrupts */
rtems_interrupt_disable(level);
8004734: 90 00 60 00 rcsr r12,IE <== NOT EXECUTED
8004738: 34 01 ff fe mvi r1,-2 <== NOT EXECUTED
800473c: a1 81 08 00 and r1,r12,r1 <== NOT EXECUTED
8004740: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED
tty->flow_ctrl &= ~FL_OSTOP;
8004744: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED
8004748: 34 01 ff df mvi r1,-33 <== NOT EXECUTED
800474c: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED
8004750: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
8004754: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED
8004758: 44 20 00 08 be r1,r0,8004778 <rtems_termios_ioctl+0x190> <== NOT EXECUTED
/* if chars available, call write function... */
(*tty->device.write)(
800475c: 29 63 00 7c lw r3,(r11+124) <== NOT EXECUTED
tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
8004760: 29 62 00 84 lw r2,(r11+132) <== 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)(
8004764: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED
8004768: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED
800476c: b4 62 10 00 add r2,r3,r2 <== NOT EXECUTED
8004770: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
8004774: d8 80 00 00 call r4 <== NOT EXECUTED
tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
}
/* reenable interrupts */
rtems_interrupt_enable(level);
8004778: d0 0c 00 00 wcsr IE,r12 <== NOT EXECUTED
}
}
/* check for incoming XON/XOFF flow control switched off */
if (( tty->flow_ctrl & FL_MDXOF) && !(tty->termios.c_iflag & IXOFF)) {
800477c: 29 61 00 b8 lw r1,(r11+184)
8004780: 20 21 04 00 andi r1,r1,0x400
8004784: 44 20 00 0c be r1,r0,80047b4 <rtems_termios_ioctl+0x1cc>
8004788: 29 61 00 30 lw r1,(r11+48)
800478c: 20 21 10 00 andi r1,r1,0x1000
8004790: 5c 20 00 09 bne r1,r0,80047b4 <rtems_termios_ioctl+0x1cc> <== NEVER TAKEN
/* clear related flags in flow_ctrl */
tty->flow_ctrl &= ~(FL_MDXOF);
8004794: 29 62 00 b8 lw r2,(r11+184)
8004798: 34 01 fb ff mvi r1,-1025
800479c: a0 41 08 00 and r1,r2,r1
80047a0: 59 61 00 b8 sw (r11+184),r1
/* FIXME: what happens, if we had sent XOFF but not yet XON? */
tty->flow_ctrl &= ~(FL_ISNTXOF);
80047a4: 29 62 00 b8 lw r2,(r11+184)
80047a8: 34 01 ff fd mvi r1,-3
80047ac: a0 41 08 00 and r1,r2,r1
80047b0: 59 61 00 b8 sw (r11+184),r1
}
/* check for incoming RTS/CTS flow control switched off */
if (( tty->flow_ctrl & FL_MDRTS) && !(tty->termios.c_cflag & CRTSCTS)) {
80047b4: 29 61 00 b8 lw r1,(r11+184)
80047b8: 20 21 01 00 andi r1,r1,0x100
80047bc: 44 20 00 12 be r1,r0,8004804 <rtems_termios_ioctl+0x21c>
80047c0: 29 61 00 38 lw r1,(r11+56)
80047c4: 48 01 00 10 bg r0,r1,8004804 <rtems_termios_ioctl+0x21c> <== ALWAYS TAKEN
/* clear related flags in flow_ctrl */
tty->flow_ctrl &= ~(FL_MDRTS);
80047c8: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED
80047cc: 34 01 fe ff mvi r1,-257 <== NOT EXECUTED
80047d0: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED
80047d4: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED
/* restart remote Tx, if it was stopped */
if ((tty->flow_ctrl & FL_IRTSOFF) && (tty->device.startRemoteTx != NULL)) {
80047d8: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED
80047dc: 20 21 00 04 andi r1,r1,0x4 <== NOT EXECUTED
80047e0: 44 20 00 05 be r1,r0,80047f4 <rtems_termios_ioctl+0x20c> <== NOT EXECUTED
80047e4: 29 62 00 b0 lw r2,(r11+176) <== NOT EXECUTED
80047e8: 44 40 00 03 be r2,r0,80047f4 <rtems_termios_ioctl+0x20c> <== NOT EXECUTED
tty->device.startRemoteTx(tty->minor);
80047ec: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED
80047f0: d8 40 00 00 call r2 <== NOT EXECUTED
}
tty->flow_ctrl &= ~(FL_IRTSOFF);
80047f4: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED
80047f8: 34 01 ff fb mvi r1,-5 <== NOT EXECUTED
80047fc: a0 41 08 00 and r1,r2,r1 <== NOT EXECUTED
8004800: 59 61 00 b8 sw (r11+184),r1 <== 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) {
8004804: 29 61 00 38 lw r1,(r11+56)
8004808: 4c 20 00 04 bge r1,r0,8004818 <rtems_termios_ioctl+0x230>
tty->flow_ctrl |= FL_MDRTS;
800480c: 29 61 00 b8 lw r1,(r11+184)
8004810: 38 21 01 00 ori r1,r1,0x100
8004814: 59 61 00 b8 sw (r11+184),r1
}
/* check for incoming XON/XOF flow control switched on */
if (tty->termios.c_iflag & IXOFF) {
8004818: 29 61 00 30 lw r1,(r11+48)
800481c: 20 22 10 00 andi r2,r1,0x1000
8004820: 44 40 00 04 be r2,r0,8004830 <rtems_termios_ioctl+0x248>
tty->flow_ctrl |= FL_MDXOF;
8004824: 29 62 00 b8 lw r2,(r11+184)
8004828: 38 42 04 00 ori r2,r2,0x400
800482c: 59 62 00 b8 sw (r11+184),r2
}
/* check for outgoing XON/XOF flow control switched on */
if (tty->termios.c_iflag & IXON) {
8004830: 20 21 04 00 andi r1,r1,0x400
8004834: 44 20 00 04 be r1,r0,8004844 <rtems_termios_ioctl+0x25c>
tty->flow_ctrl |= FL_MDXON;
8004838: 29 61 00 b8 lw r1,(r11+184)
800483c: 38 21 02 00 ori r1,r1,0x200
8004840: 59 61 00 b8 sw (r11+184),r1
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) {
8004844: 29 6c 00 3c lw r12,(r11+60)
8004848: 21 8c 00 02 andi r12,r12,0x2
800484c: 5d 80 00 11 bne r12,r0,8004890 <rtems_termios_ioctl+0x2a8>
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
} else {
tty->vtimeTicks = tty->termios.c_cc[VTIME] *
8004850: 41 6e 00 46 lbu r14,(r11+70)
rtems_clock_get_ticks_per_second() / 10;
8004854: f8 00 05 69 calli 8005df8 <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] *
8004858: b9 c0 10 00 mv r2,r14
800485c: f8 00 7b 7a calli 8023644 <__mulsi3>
rtems_clock_get_ticks_per_second() / 10;
8004860: 34 02 00 0a mvi r2,10
8004864: f8 00 7b dd calli 80237d8 <__udivsi3>
if (tty->termios.c_cc[VTIME]) {
8004868: 41 62 00 46 lbu r2,(r11+70)
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] *
800486c: 59 61 00 54 sw (r11+84),r1
8004870: 41 63 00 47 lbu r3,(r11+71)
rtems_clock_get_ticks_per_second() / 10;
if (tty->termios.c_cc[VTIME]) {
8004874: 44 4c 00 06 be r2,r12,800488c <rtems_termios_ioctl+0x2a4>
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
8004878: 59 60 00 6c sw (r11+108),r0
tty->rawInBufSemaphoreTimeout = tty->vtimeTicks;
800487c: 59 61 00 70 sw (r11+112),r1
if (tty->termios.c_cc[VMIN])
8004880: 5c 60 00 06 bne r3,r0,8004898 <rtems_termios_ioctl+0x2b0>
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
else
tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
8004884: 59 61 00 74 sw (r11+116),r1
8004888: e0 00 00 08 bi 80048a8 <rtems_termios_ioctl+0x2c0>
} else {
if (tty->termios.c_cc[VMIN]) {
800488c: 44 62 00 05 be r3,r2,80048a0 <rtems_termios_ioctl+0x2b8> <== ALWAYS TAKEN
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
8004890: 59 60 00 6c sw (r11+108),r0
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
8004894: 59 60 00 70 sw (r11+112),r0
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
8004898: 59 60 00 74 sw (r11+116),r0
800489c: e0 00 00 03 bi 80048a8 <rtems_termios_ioctl+0x2c0>
} else {
tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
80048a0: 34 01 00 01 mvi r1,1
80048a4: 59 61 00 6c sw (r11+108),r1
}
}
}
if (tty->device.setAttributes)
80048a8: 29 63 00 a8 lw r3,(r11+168)
80048ac: 44 60 00 5d be r3,r0,8004a20 <rtems_termios_ioctl+0x438> <== NEVER TAKEN
(*tty->device.setAttributes)(tty->minor, &tty->termios);
80048b0: 29 61 00 10 lw r1,(r11+16)
80048b4: 35 62 00 30 addi r2,r11,48
80048b8: d8 60 00 00 call r3
80048bc: e0 00 00 59 bi 8004a20 <rtems_termios_ioctl+0x438>
break;
case RTEMS_IO_TCDRAIN:
drainOutput (tty);
80048c0: b9 60 08 00 mv r1,r11
80048c4: fb ff fd 5f calli 8003e40 <drainOutput>
break;
80048c8: e0 00 00 56 bi 8004a20 <rtems_termios_ioctl+0x438>
case RTEMS_IO_TCFLUSH:
switch ((intptr_t) args->buffer) {
80048cc: 29 81 00 08 lw r1,(r12+8) <== NOT EXECUTED
80048d0: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
80048d4: 44 22 00 05 be r1,r2,80048e8 <rtems_termios_ioctl+0x300> <== NOT EXECUTED
80048d8: 34 02 00 02 mvi r2,2 <== NOT EXECUTED
80048dc: 44 22 00 0b be r1,r2,8004908 <rtems_termios_ioctl+0x320> <== NOT EXECUTED
80048e0: 5c 20 00 4f bne r1,r0,8004a1c <rtems_termios_ioctl+0x434> <== NOT EXECUTED
80048e4: e0 00 00 11 bi 8004928 <rtems_termios_ioctl+0x340> <== NOT EXECUTED
static void
flushOutput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
80048e8: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED
80048ec: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED
80048f0: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED
80048f4: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED
tty->rawOutBuf.Tail = 0;
80048f8: 59 60 00 84 sw (r11+132),r0 <== NOT EXECUTED
tty->rawOutBuf.Head = 0;
80048fc: 59 60 00 80 sw (r11+128),r0 <== NOT EXECUTED
tty->rawOutBufState = rob_idle;
8004900: 59 60 00 94 sw (r11+148),r0 <== NOT EXECUTED
8004904: e0 00 00 0f bi 8004940 <rtems_termios_ioctl+0x358> <== NOT EXECUTED
static void
flushOutput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
8004908: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED
800490c: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED
8004910: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED
8004914: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED
tty->rawOutBuf.Tail = 0;
8004918: 59 60 00 84 sw (r11+132),r0 <== NOT EXECUTED
tty->rawOutBuf.Head = 0;
800491c: 59 60 00 80 sw (r11+128),r0 <== NOT EXECUTED
tty->rawOutBufState = rob_idle;
8004920: 59 60 00 94 sw (r11+148),r0 <== NOT EXECUTED
rtems_interrupt_enable (level);
8004924: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED
static void
flushInput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
8004928: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED
800492c: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED
8004930: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED
8004934: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED
tty->rawInBuf.Tail = 0;
8004938: 59 60 00 60 sw (r11+96),r0 <== NOT EXECUTED
tty->rawInBuf.Head = 0;
800493c: 59 60 00 5c sw (r11+92),r0 <== NOT EXECUTED
rtems_interrupt_enable (level);
8004940: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED
flushOutput (tty);
break;
case TCIOFLUSH:
flushOutput (tty);
flushInput (tty);
break;
8004944: e0 00 00 37 bi 8004a20 <rtems_termios_ioctl+0x438> <== NOT EXECUTED
break;
}
break;
case RTEMS_IO_SNDWAKEUP:
tty->tty_snd = *wakeup;
8004948: 29 c1 00 00 lw r1,(r14+0)
800494c: 59 61 00 d4 sw (r11+212),r1
8004950: 29 c1 00 04 lw r1,(r14+4)
8004954: 59 61 00 d8 sw (r11+216),r1
break;
8004958: e0 00 00 32 bi 8004a20 <rtems_termios_ioctl+0x438>
case RTEMS_IO_RCVWAKEUP:
tty->tty_rcv = *wakeup;
800495c: 29 c1 00 00 lw r1,(r14+0)
8004960: 59 61 00 dc sw (r11+220),r1
8004964: 29 c1 00 04 lw r1,(r14+4)
8004968: 59 61 00 e0 sw (r11+224),r1
break;
800496c: e0 00 00 2d bi 8004a20 <rtems_termios_ioctl+0x438>
#if 1 /* FIXME */
case TIOCSETD:
/*
* close old line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
8004970: 29 61 00 cc lw r1,(r11+204)
8004974: 34 02 00 05 mvi r2,5
8004978: 78 0e 08 02 mvhi r14,0x802
800497c: fb ff f0 2a calli 8000a24 <__ashlsi3>
8004980: 39 ce 88 30 ori r14,r14,0x8830
8004984: b5 c1 08 00 add r1,r14,r1
8004988: 28 22 00 04 lw r2,(r1+4)
800498c: 44 40 00 04 be r2,r0,800499c <rtems_termios_ioctl+0x3b4>
sc = rtems_termios_linesw[tty->t_line].l_close(tty);
8004990: b9 60 08 00 mv r1,r11
8004994: d8 40 00 00 call r2
8004998: b8 20 68 00 mv r13,r1
}
tty->t_line=*(int*)(args->buffer);
800499c: 29 81 00 08 lw r1,(r12+8)
tty->t_sc = NULL; /* ensure that no more valid data */
/*
* open new line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_open != NULL) {
80049a0: 34 02 00 05 mvi r2,5
80049a4: 78 0c 08 02 mvhi r12,0x802
* 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);
80049a8: 28 21 00 00 lw r1,(r1+0)
tty->t_sc = NULL; /* ensure that no more valid data */
80049ac: 59 60 00 d0 sw (r11+208),r0
/*
* open new line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_open != NULL) {
80049b0: 39 8c 88 30 ori r12,r12,0x8830
* 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);
80049b4: 59 61 00 cc sw (r11+204),r1
tty->t_sc = NULL; /* ensure that no more valid data */
/*
* open new line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_open != NULL) {
80049b8: fb ff f0 1b calli 8000a24 <__ashlsi3>
80049bc: b5 81 08 00 add r1,r12,r1
80049c0: 28 22 00 00 lw r2,(r1+0)
80049c4: 44 40 00 17 be r2,r0,8004a20 <rtems_termios_ioctl+0x438>
sc = rtems_termios_linesw[tty->t_line].l_open(tty);
80049c8: b9 60 08 00 mv r1,r11
80049cc: d8 40 00 00 call r2
80049d0: b8 20 68 00 mv r13,r1
80049d4: e0 00 00 13 bi 8004a20 <rtems_termios_ioctl+0x438>
}
break;
case TIOCGETD:
*(int*)(args->buffer)=tty->t_line;
80049d8: 29 81 00 08 lw r1,(r12+8)
80049dc: 29 62 00 cc lw r2,(r11+204)
80049e0: 58 22 00 00 sw (r1+0),r2
break;
80049e4: e0 00 00 0f bi 8004a20 <rtems_termios_ioctl+0x438>
#endif
case FIONREAD: {
int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head;
80049e8: 29 62 00 60 lw r2,(r11+96) <== NOT EXECUTED
80049ec: 29 61 00 5c lw r1,(r11+92) <== NOT EXECUTED
80049f0: c8 41 08 00 sub r1,r2,r1 <== NOT EXECUTED
if ( rawnc < 0 )
80049f4: 4c 20 00 03 bge r1,r0,8004a00 <rtems_termios_ioctl+0x418> <== NOT EXECUTED
rawnc += tty->rawInBuf.Size;
80049f8: 29 62 00 64 lw r2,(r11+100) <== NOT EXECUTED
80049fc: b4 22 08 00 add r1,r1,r2 <== NOT EXECUTED
/* Half guess that this is the right operation */
*(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
8004a00: 29 64 00 20 lw r4,(r11+32) <== NOT EXECUTED
8004a04: 29 63 00 24 lw r3,(r11+36) <== NOT EXECUTED
8004a08: 29 82 00 08 lw r2,(r12+8) <== NOT EXECUTED
8004a0c: c8 83 18 00 sub r3,r4,r3 <== NOT EXECUTED
8004a10: b4 61 08 00 add r1,r3,r1 <== NOT EXECUTED
8004a14: 58 41 00 00 sw (r2+0),r1 <== NOT EXECUTED
}
break;
8004a18: e0 00 00 02 bi 8004a20 <rtems_termios_ioctl+0x438> <== NOT EXECUTED
case TCIOFLUSH:
flushOutput (tty);
flushInput (tty);
break;
default:
sc = RTEMS_INVALID_NAME;
8004a1c: 34 0d 00 03 mvi r13,3 <== NOT EXECUTED
*(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
}
break;
}
rtems_semaphore_release (tty->osem);
8004a20: 29 61 00 18 lw r1,(r11+24)
8004a24: f8 00 07 16 calli 800667c <rtems_semaphore_release>
return sc;
}
8004a28: b9 a0 08 00 mv r1,r13
8004a2c: 2b 9d 00 04 lw ra,(sp+4)
8004a30: 2b 8b 00 14 lw r11,(sp+20)
8004a34: 2b 8c 00 10 lw r12,(sp+16)
8004a38: 2b 8d 00 0c lw r13,(sp+12)
8004a3c: 2b 8e 00 08 lw r14,(sp+8)
8004a40: 37 9c 00 14 addi sp,sp,20
8004a44: c3 a0 00 00 ret
08003f44 <rtems_termios_open>:
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg,
const rtems_termios_callbacks *callbacks
)
{
8003f44: 37 9c ff d4 addi sp,sp,-44
8003f48: 5b 8b 00 2c sw (sp+44),r11
8003f4c: 5b 8c 00 28 sw (sp+40),r12
8003f50: 5b 8d 00 24 sw (sp+36),r13
8003f54: 5b 8e 00 20 sw (sp+32),r14
8003f58: 5b 8f 00 1c sw (sp+28),r15
8003f5c: 5b 90 00 18 sw (sp+24),r16
8003f60: 5b 91 00 14 sw (sp+20),r17
8003f64: 5b 92 00 10 sw (sp+16),r18
8003f68: 5b 93 00 0c sw (sp+12),r19
8003f6c: 5b 94 00 08 sw (sp+8),r20
8003f70: 5b 9d 00 04 sw (sp+4),ra
8003f74: b8 20 88 00 mv r17,r1
struct rtems_termios_tty *tty;
/*
* See if the device has already been opened
*/
sc = rtems_semaphore_obtain(
8003f78: 78 01 08 02 mvhi r1,0x802
8003f7c: 38 21 8e 30 ori r1,r1,0x8e30
8003f80: 28 21 00 00 lw r1,(r1+0)
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg,
const rtems_termios_callbacks *callbacks
)
{
8003f84: b8 40 90 00 mv r18,r2
8003f88: b8 60 a0 00 mv r20,r3
struct rtems_termios_tty *tty;
/*
* See if the device has already been opened
*/
sc = rtems_semaphore_obtain(
8003f8c: 34 02 00 00 mvi r2,0
8003f90: 34 03 00 00 mvi r3,0
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg,
const rtems_termios_callbacks *callbacks
)
{
8003f94: b8 80 68 00 mv r13,r4
struct rtems_termios_tty *tty;
/*
* See if the device has already been opened
*/
sc = rtems_semaphore_obtain(
8003f98: f8 00 09 69 calli 800653c <rtems_semaphore_obtain>
8003f9c: b8 20 78 00 mv r15,r1
rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
8003fa0: 5c 20 01 02 bne r1,r0,80043a8 <rtems_termios_open+0x464> <== NEVER TAKEN
return sc;
for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) {
8003fa4: 78 01 08 02 mvhi r1,0x802
8003fa8: 38 21 8e 38 ori r1,r1,0x8e38
8003fac: 28 2e 00 00 lw r14,(r1+0)
8003fb0: b9 c0 60 00 mv r12,r14
8003fb4: e0 00 00 06 bi 8003fcc <rtems_termios_open+0x88>
if ((tty->major == major) && (tty->minor == minor))
8003fb8: 29 81 00 0c lw r1,(r12+12) <== NOT EXECUTED
8003fbc: 5c 31 00 03 bne r1,r17,8003fc8 <rtems_termios_open+0x84> <== NOT EXECUTED
8003fc0: 29 81 00 10 lw r1,(r12+16) <== NOT EXECUTED
8003fc4: 44 32 00 d8 be r1,r18,8004324 <rtems_termios_open+0x3e0> <== NOT EXECUTED
sc = rtems_semaphore_obtain(
rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
return sc;
for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) {
8003fc8: 29 8c 00 00 lw r12,(r12+0) <== NOT EXECUTED
8003fcc: 5d 80 ff fb bne r12,r0,8003fb8 <rtems_termios_open+0x74> <== NEVER TAKEN
8003fd0: e0 00 01 04 bi 80043e0 <rtems_termios_open+0x49c>
return RTEMS_NO_MEMORY;
}
/*
* allocate raw input buffer
*/
tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE;
8003fd4: 78 01 08 02 mvhi r1,0x802
8003fd8: 38 21 81 44 ori r1,r1,0x8144
8003fdc: 28 21 00 00 lw r1,(r1+0)
8003fe0: 59 81 00 64 sw (r12+100),r1
tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size);
8003fe4: 29 81 00 64 lw r1,(r12+100)
8003fe8: fb ff f8 fb calli 80023d4 <malloc>
8003fec: 59 81 00 58 sw (r12+88),r1
8003ff0: b8 20 80 00 mv r16,r1
if (tty->rawInBuf.theBuf == NULL) {
8003ff4: 5c 20 00 09 bne r1,r0,8004018 <rtems_termios_open+0xd4>
free(tty);
8003ff8: b9 80 08 00 mv r1,r12
8003ffc: fb ff f7 91 calli 8001e40 <free>
rtems_semaphore_release (rtems_termios_ttyMutex);
8004000: 78 01 08 02 mvhi r1,0x802
8004004: 38 21 8e 30 ori r1,r1,0x8e30
8004008: 28 21 00 00 lw r1,(r1+0)
return RTEMS_NO_MEMORY;
800400c: 34 0f 00 1a mvi r15,26
*/
tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE;
tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size);
if (tty->rawInBuf.theBuf == NULL) {
free(tty);
rtems_semaphore_release (rtems_termios_ttyMutex);
8004010: f8 00 09 9b calli 800667c <rtems_semaphore_release>
return RTEMS_NO_MEMORY;
8004014: e0 00 00 e5 bi 80043a8 <rtems_termios_open+0x464>
}
/*
* allocate raw output buffer
*/
tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE;
8004018: 78 01 08 02 mvhi r1,0x802
800401c: 38 21 81 48 ori r1,r1,0x8148
8004020: 28 21 00 00 lw r1,(r1+0)
8004024: 59 81 00 88 sw (r12+136),r1
tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size);
8004028: 29 81 00 88 lw r1,(r12+136)
800402c: fb ff f8 ea calli 80023d4 <malloc>
8004030: 59 81 00 7c sw (r12+124),r1
8004034: b8 20 98 00 mv r19,r1
if (tty->rawOutBuf.theBuf == NULL) {
8004038: 44 20 00 09 be r1,r0,800405c <rtems_termios_open+0x118>
return RTEMS_NO_MEMORY;
}
/*
* allocate cooked buffer
*/
tty->cbuf = malloc (CBUFSIZE);
800403c: 78 01 08 02 mvhi r1,0x802
8004040: 38 21 81 40 ori r1,r1,0x8140
8004044: 28 21 00 00 lw r1,(r1+0)
8004048: fb ff f8 e3 calli 80023d4 <malloc>
800404c: 59 81 00 1c sw (r12+28),r1
if (tty->cbuf == NULL) {
8004050: 5c 20 00 06 bne r1,r0,8004068 <rtems_termios_open+0x124>
free((void *)(tty->rawOutBuf.theBuf));
8004054: ba 60 08 00 mv r1,r19
8004058: fb ff f7 7a calli 8001e40 <free>
free((void *)(tty->rawInBuf.theBuf));
800405c: ba 00 08 00 mv r1,r16
8004060: fb ff f7 78 calli 8001e40 <free>
8004064: e3 ff ff e5 bi 8003ff8 <rtems_termios_open+0xb4>
return RTEMS_NO_MEMORY;
}
/*
* Initialize wakeup callbacks
*/
tty->tty_snd.sw_pfn = NULL;
8004068: 59 80 00 d4 sw (r12+212),r0
tty->tty_snd.sw_arg = NULL;
800406c: 59 80 00 d8 sw (r12+216),r0
tty->tty_rcv.sw_pfn = NULL;
8004070: 59 80 00 dc sw (r12+220),r0
tty->tty_rcv.sw_arg = NULL;
8004074: 59 80 00 e0 sw (r12+224),r0
tty->tty_rcvwakeup = 0;
8004078: 59 80 00 e4 sw (r12+228),r0
/*
* link tty
*/
tty->forw = rtems_termios_ttyHead;
800407c: 59 8e 00 00 sw (r12+0),r14
tty->back = NULL;
8004080: 59 80 00 04 sw (r12+4),r0
if (rtems_termios_ttyHead != NULL)
8004084: 45 c0 00 02 be r14,r0,800408c <rtems_termios_open+0x148> <== ALWAYS TAKEN
rtems_termios_ttyHead->back = tty;
8004088: 59 cc 00 04 sw (r14+4),r12 <== NOT EXECUTED
rtems_termios_ttyHead = tty;
800408c: 78 01 08 02 mvhi r1,0x802
if (rtems_termios_ttyTail == NULL)
8004090: 78 04 08 02 mvhi r4,0x802
*/
tty->forw = rtems_termios_ttyHead;
tty->back = NULL;
if (rtems_termios_ttyHead != NULL)
rtems_termios_ttyHead->back = tty;
rtems_termios_ttyHead = tty;
8004094: 38 21 8e 38 ori r1,r1,0x8e38
if (rtems_termios_ttyTail == NULL)
8004098: 38 84 8e 34 ori r4,r4,0x8e34
*/
tty->forw = rtems_termios_ttyHead;
tty->back = NULL;
if (rtems_termios_ttyHead != NULL)
rtems_termios_ttyHead->back = tty;
rtems_termios_ttyHead = tty;
800409c: 58 2b 00 00 sw (r1+0),r11
if (rtems_termios_ttyTail == NULL)
80040a0: 28 81 00 00 lw r1,(r4+0)
80040a4: 5c 20 00 02 bne r1,r0,80040ac <rtems_termios_open+0x168> <== NEVER TAKEN
rtems_termios_ttyTail = tty;
80040a8: 58 8b 00 00 sw (r4+0),r11
/*
* Set up mutex semaphores
*/
sc = rtems_semaphore_create (
rtems_build_name ('T', 'R', 'i', c),
80040ac: 78 0e 08 02 mvhi r14,0x802
tty->major = major;
/*
* Set up mutex semaphores
*/
sc = rtems_semaphore_create (
80040b0: 78 03 08 02 mvhi r3,0x802
80040b4: 38 63 54 44 ori r3,r3,0x5444
rtems_build_name ('T', 'R', 'i', c),
80040b8: 39 ce 81 4c ori r14,r14,0x814c
80040bc: 41 c2 00 00 lbu r2,(r14+0)
tty->major = major;
/*
* Set up mutex semaphores
*/
sc = rtems_semaphore_create (
80040c0: 28 61 00 00 lw r1,(r3+0)
rtems_termios_ttyHead->back = tty;
rtems_termios_ttyHead = tty;
if (rtems_termios_ttyTail == NULL)
rtems_termios_ttyTail = tty;
tty->minor = minor;
80040c4: 59 72 00 10 sw (r11+16),r18
tty->major = major;
80040c8: 59 71 00 0c sw (r11+12),r17
/*
* Set up mutex semaphores
*/
sc = rtems_semaphore_create (
80040cc: b8 41 08 00 or r1,r2,r1
80040d0: 34 03 00 54 mvi r3,84
80040d4: 34 02 00 01 mvi r2,1
80040d8: 34 04 00 00 mvi r4,0
80040dc: 35 65 00 14 addi r5,r11,20
80040e0: f8 00 08 6b calli 800628c <rtems_semaphore_create>
80040e4: b8 20 80 00 mv r16,r1
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)
80040e8: 5c 20 00 ab bne r1,r0,8004394 <rtems_termios_open+0x450> <== NEVER TAKEN
rtems_fatal_error_occurred (sc);
sc = rtems_semaphore_create (
80040ec: 78 03 08 02 mvhi r3,0x802
80040f0: 38 63 54 48 ori r3,r3,0x5448
rtems_build_name ('T', 'R', 'o', c),
80040f4: 41 c2 00 00 lbu r2,(r14+0)
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 (
80040f8: 28 61 00 00 lw r1,(r3+0)
80040fc: 34 04 00 00 mvi r4,0
8004100: 34 03 00 54 mvi r3,84
8004104: b8 41 08 00 or r1,r2,r1
8004108: 35 65 00 18 addi r5,r11,24
800410c: 34 02 00 01 mvi r2,1
8004110: f8 00 08 5f calli 800628c <rtems_semaphore_create>
8004114: b8 20 98 00 mv r19,r1
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)
8004118: 5c 30 00 9f bne r1,r16,8004394 <rtems_termios_open+0x450> <== NEVER TAKEN
rtems_fatal_error_occurred (sc);
sc = rtems_semaphore_create (
800411c: 78 03 08 02 mvhi r3,0x802
8004120: 38 63 54 4c ori r3,r3,0x544c
rtems_build_name ('T', 'R', 'x', c),
8004124: 41 c2 00 00 lbu r2,(r14+0)
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 (
8004128: 28 61 00 00 lw r1,(r3+0)
800412c: 34 04 00 00 mvi r4,0
8004130: 34 03 00 20 mvi r3,32
8004134: b8 41 08 00 or r1,r2,r1
8004138: 35 65 00 8c addi r5,r11,140
800413c: 34 02 00 00 mvi r2,0
8004140: f8 00 08 53 calli 800628c <rtems_semaphore_create>
8004144: b8 20 80 00 mv r16,r1
rtems_build_name ('T', 'R', 'x', c),
0,
RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO,
RTEMS_NO_PRIORITY,
&tty->rawOutBuf.Semaphore);
if (sc != RTEMS_SUCCESSFUL)
8004148: 5c 33 00 93 bne r1,r19,8004394 <rtems_termios_open+0x450> <== NEVER TAKEN
tty->rawOutBufState = rob_idle;
/*
* Set callbacks
*/
tty->device = *callbacks;
800414c: 29 a2 00 18 lw r2,(r13+24)
8004150: 29 a8 00 00 lw r8,(r13+0)
8004154: 29 a7 00 04 lw r7,(r13+4)
8004158: 29 a6 00 08 lw r6,(r13+8)
800415c: 29 a5 00 0c lw r5,(r13+12)
8004160: 29 a4 00 10 lw r4,(r13+16)
8004164: 29 a3 00 14 lw r3,(r13+20)
8004168: 29 a1 00 1c lw r1,(r13+28)
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;
800416c: 59 60 00 94 sw (r11+148),r0
/*
* Set callbacks
*/
tty->device = *callbacks;
8004170: 59 62 00 b0 sw (r11+176),r2
8004174: 59 68 00 98 sw (r11+152),r8
8004178: 59 67 00 9c sw (r11+156),r7
800417c: 59 66 00 a0 sw (r11+160),r6
8004180: 59 65 00 a4 sw (r11+164),r5
8004184: 59 64 00 a8 sw (r11+168),r4
8004188: 59 63 00 ac sw (r11+172),r3
800418c: 59 61 00 b4 sw (r11+180),r1
/*
* Create I/O tasks
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
8004190: 34 02 00 02 mvi r2,2
8004194: 5c 22 00 1a bne r1,r2,80041fc <rtems_termios_open+0x2b8>
sc = rtems_task_create (
8004198: 78 03 08 02 mvhi r3,0x802
800419c: 38 63 54 50 ori r3,r3,0x5450
rtems_build_name ('T', 'x', 'T', c),
80041a0: 41 c2 00 00 lbu r2,(r14+0)
/*
* Create I/O tasks
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
sc = rtems_task_create (
80041a4: 28 61 00 00 lw r1,(r3+0)
80041a8: 34 04 05 00 mvi r4,1280
80041ac: 34 03 04 00 mvi r3,1024
80041b0: b8 41 08 00 or r1,r2,r1
80041b4: 34 05 00 00 mvi r5,0
80041b8: 34 02 00 0a mvi r2,10
80041bc: 35 66 00 c8 addi r6,r11,200
80041c0: f8 00 09 84 calli 80067d0 <rtems_task_create>
80041c4: b8 20 68 00 mv r13,r1
TERMIOS_TXTASK_STACKSIZE,
RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE |
RTEMS_NO_ASR,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
&tty->txTaskId);
if (sc != RTEMS_SUCCESSFUL)
80041c8: 5c 30 00 73 bne r1,r16,8004394 <rtems_termios_open+0x450> <== NEVER TAKEN
rtems_fatal_error_occurred (sc);
sc = rtems_task_create (
80041cc: 78 03 08 02 mvhi r3,0x802
80041d0: 38 63 54 54 ori r3,r3,0x5454
rtems_build_name ('R', 'x', 'T', c),
80041d4: 41 c2 00 00 lbu r2,(r14+0)
RTEMS_NO_ASR,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
&tty->txTaskId);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
sc = rtems_task_create (
80041d8: 28 61 00 00 lw r1,(r3+0)
80041dc: 34 04 05 00 mvi r4,1280
80041e0: 34 03 04 00 mvi r3,1024
80041e4: b8 41 08 00 or r1,r2,r1
80041e8: 34 05 00 00 mvi r5,0
80041ec: 34 02 00 09 mvi r2,9
80041f0: 35 66 00 c4 addi r6,r11,196
80041f4: f8 00 09 77 calli 80067d0 <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)
80041f8: 5c 2d 00 67 bne r1,r13,8004394 <rtems_termios_open+0x450> <== NEVER TAKEN
rtems_fatal_error_occurred (sc);
}
if ((tty->device.pollRead == NULL) ||
80041fc: 29 61 00 a0 lw r1,(r11+160)
8004200: 44 20 00 04 be r1,r0,8004210 <rtems_termios_open+0x2cc>
8004204: 29 62 00 b4 lw r2,(r11+180)
8004208: 34 01 00 02 mvi r1,2
800420c: 5c 41 00 0e bne r2,r1,8004244 <rtems_termios_open+0x300>
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){
sc = rtems_semaphore_create (
rtems_build_name ('T', 'R', 'r', c),
8004210: 78 01 08 02 mvhi r1,0x802
rtems_fatal_error_occurred (sc);
}
if ((tty->device.pollRead == NULL) ||
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){
sc = rtems_semaphore_create (
8004214: 78 03 08 02 mvhi r3,0x802
rtems_build_name ('T', 'R', 'r', c),
8004218: 38 21 81 4c ori r1,r1,0x814c
rtems_fatal_error_occurred (sc);
}
if ((tty->device.pollRead == NULL) ||
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){
sc = rtems_semaphore_create (
800421c: 38 63 54 58 ori r3,r3,0x5458
rtems_build_name ('T', 'R', 'r', c),
8004220: 40 22 00 00 lbu r2,(r1+0)
rtems_fatal_error_occurred (sc);
}
if ((tty->device.pollRead == NULL) ||
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){
sc = rtems_semaphore_create (
8004224: 28 61 00 00 lw r1,(r3+0)
8004228: 34 04 00 00 mvi r4,0
800422c: 34 03 00 24 mvi r3,36
8004230: b8 41 08 00 or r1,r2,r1
8004234: 35 65 00 68 addi r5,r11,104
8004238: 34 02 00 00 mvi r2,0
800423c: f8 00 08 14 calli 800628c <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)
8004240: 5c 20 00 55 bne r1,r0,8004394 <rtems_termios_open+0x450> <== NEVER TAKEN
}
/*
* Set default parameters
*/
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
8004244: 34 01 25 02 mvi r1,9474
8004248: 59 61 00 30 sw (r11+48),r1
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
800424c: 34 01 18 05 mvi r1,6149
8004250: 59 61 00 34 sw (r11+52),r1
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
8004254: 34 01 08 bd mvi r1,2237
8004258: 59 61 00 38 sw (r11+56),r1
tty->termios.c_lflag =
800425c: 34 21 79 7e addi r1,r1,31102
8004260: 59 61 00 3c sw (r11+60),r1
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
8004264: 34 01 00 03 mvi r1,3
8004268: 31 61 00 41 sb (r11+65),r1
tty->termios.c_cc[VQUIT] = '\034';
800426c: 34 01 00 1c mvi r1,28
8004270: 31 61 00 42 sb (r11+66),r1
tty->termios.c_cc[VERASE] = '\177';
8004274: 34 01 00 7f mvi r1,127
8004278: 31 61 00 43 sb (r11+67),r1
tty->termios.c_cc[VKILL] = '\025';
800427c: 34 01 00 15 mvi r1,21
8004280: 31 61 00 44 sb (r11+68),r1
tty->termios.c_cc[VEOF] = '\004';
8004284: 34 01 00 04 mvi r1,4
8004288: 31 61 00 45 sb (r11+69),r1
tty->termios.c_cc[VEOL] = '\000';
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
800428c: 34 01 00 11 mvi r1,17
8004290: 31 61 00 49 sb (r11+73),r1
tty->termios.c_cc[VSTOP] = '\023';
8004294: 34 01 00 13 mvi r1,19
8004298: 31 61 00 4a sb (r11+74),r1
tty->termios.c_cc[VSUSP] = '\032';
800429c: 34 01 00 1a mvi r1,26
80042a0: 31 61 00 4b sb (r11+75),r1
tty->termios.c_cc[VREPRINT] = '\022';
80042a4: 34 01 00 12 mvi r1,18
80042a8: 31 61 00 4d sb (r11+77),r1
tty->termios.c_cc[VDISCARD] = '\017';
80042ac: 34 01 00 0f mvi r1,15
80042b0: 31 61 00 4e sb (r11+78),r1
tty->termios.c_cc[VWERASE] = '\027';
80042b4: 34 01 00 17 mvi r1,23
80042b8: 31 61 00 4f sb (r11+79),r1
tty->termios.c_cc[VLNEXT] = '\026';
/* start with no flow control, clear flow control flags */
tty->flow_ctrl = 0;
80042bc: 59 60 00 b8 sw (r11+184),r0
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';
80042c0: 34 01 00 16 mvi r1,22
80042c4: 31 61 00 50 sb (r11+80),r1
/* 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;
80042c8: 29 61 00 64 lw r1,(r11+100)
80042cc: 34 02 00 01 mvi r2,1
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';
80042d0: 31 60 00 4c sb (r11+76),r0
tty->termios.c_cc[VEOL2] = '\000';
80042d4: 31 60 00 51 sb (r11+81),r0
/* 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;
80042d8: f8 00 7c b4 calli 80235a8 <__lshrsi3>
tty->highwater = tty->rawInBuf.Size * 3/4;
80042dc: 29 6d 00 64 lw r13,(r11+100)
/* 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;
80042e0: 59 61 00 bc sw (r11+188),r1
tty->highwater = tty->rawInBuf.Size * 3/4;
80042e4: 34 02 00 01 mvi r2,1
80042e8: b9 a0 08 00 mv r1,r13
80042ec: fb ff f1 ce calli 8000a24 <__ashlsi3>
80042f0: 34 02 00 02 mvi r2,2
80042f4: b4 2d 08 00 add r1,r1,r13
80042f8: f8 00 7c ac calli 80235a8 <__lshrsi3>
/*
* Bump name characer
*/
if (c++ == 'z')
80042fc: 78 04 08 02 mvhi r4,0x802
8004300: 38 84 81 4c ori r4,r4,0x814c
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;
8004304: 59 61 00 c0 sw (r11+192),r1
/*
* Bump name characer
*/
if (c++ == 'z')
8004308: 40 81 00 00 lbu r1,(r4+0)
800430c: 34 22 00 01 addi r2,r1,1
8004310: 30 82 00 00 sb (r4+0),r2
8004314: 34 02 00 7a mvi r2,122
8004318: 5c 22 00 03 bne r1,r2,8004324 <rtems_termios_open+0x3e0>
c = 'a';
800431c: 34 01 00 61 mvi r1,97
8004320: 30 81 00 00 sb (r4+0),r1
}
args->iop->data1 = tty;
8004324: 2a 81 00 00 lw r1,(r20+0)
if (!tty->refcount++) {
8004328: 29 82 00 08 lw r2,(r12+8)
*/
if (c++ == 'z')
c = 'a';
}
args->iop->data1 = tty;
800432c: 58 2c 00 28 sw (r1+40),r12
if (!tty->refcount++) {
8004330: 34 41 00 01 addi r1,r2,1
8004334: 59 81 00 08 sw (r12+8),r1
8004338: 5c 40 00 18 bne r2,r0,8004398 <rtems_termios_open+0x454> <== NEVER TAKEN
if (tty->device.firstOpen)
800433c: 29 84 00 98 lw r4,(r12+152)
8004340: 44 82 00 05 be r4,r2,8004354 <rtems_termios_open+0x410> <== ALWAYS TAKEN
(*tty->device.firstOpen)(major, minor, arg);
8004344: ba 20 08 00 mv r1,r17 <== NOT EXECUTED
8004348: ba 40 10 00 mv r2,r18 <== NOT EXECUTED
800434c: ba 80 18 00 mv r3,r20 <== NOT EXECUTED
8004350: d8 80 00 00 call r4 <== NOT EXECUTED
/*
* start I/O tasks, if needed
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
8004354: 29 82 00 b4 lw r2,(r12+180)
8004358: 34 01 00 02 mvi r1,2
800435c: 5c 41 00 0f bne r2,r1,8004398 <rtems_termios_open+0x454>
sc = rtems_task_start(
8004360: 29 81 00 c4 lw r1,(r12+196)
8004364: 78 02 08 00 mvhi r2,0x800
8004368: 38 42 59 4c ori r2,r2,0x594c
800436c: b9 80 18 00 mv r3,r12
8004370: f8 00 09 c0 calli 8006a70 <rtems_task_start>
8004374: b8 20 58 00 mv r11,r1
tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty);
if (sc != RTEMS_SUCCESSFUL)
8004378: 5c 20 00 07 bne r1,r0,8004394 <rtems_termios_open+0x450> <== NEVER TAKEN
rtems_fatal_error_occurred (sc);
sc = rtems_task_start(
800437c: 29 81 00 c8 lw r1,(r12+200)
8004380: 78 02 08 00 mvhi r2,0x800
8004384: 38 42 3e d0 ori r2,r2,0x3ed0
8004388: b9 80 18 00 mv r3,r12
800438c: f8 00 09 b9 calli 8006a70 <rtems_task_start>
tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty);
if (sc != RTEMS_SUCCESSFUL)
8004390: 44 2b 00 02 be r1,r11,8004398 <rtems_termios_open+0x454> <== ALWAYS TAKEN
rtems_fatal_error_occurred (sc);
8004394: f8 00 0a de calli 8006f0c <rtems_fatal_error_occurred> <== NOT EXECUTED
}
}
rtems_semaphore_release (rtems_termios_ttyMutex);
8004398: 78 01 08 02 mvhi r1,0x802
800439c: 38 21 8e 30 ori r1,r1,0x8e30
80043a0: 28 21 00 00 lw r1,(r1+0)
80043a4: f8 00 08 b6 calli 800667c <rtems_semaphore_release>
return RTEMS_SUCCESSFUL;
}
80043a8: b9 e0 08 00 mv r1,r15
80043ac: 2b 9d 00 04 lw ra,(sp+4)
80043b0: 2b 8b 00 2c lw r11,(sp+44)
80043b4: 2b 8c 00 28 lw r12,(sp+40)
80043b8: 2b 8d 00 24 lw r13,(sp+36)
80043bc: 2b 8e 00 20 lw r14,(sp+32)
80043c0: 2b 8f 00 1c lw r15,(sp+28)
80043c4: 2b 90 00 18 lw r16,(sp+24)
80043c8: 2b 91 00 14 lw r17,(sp+20)
80043cc: 2b 92 00 10 lw r18,(sp+16)
80043d0: 2b 93 00 0c lw r19,(sp+12)
80043d4: 2b 94 00 08 lw r20,(sp+8)
80043d8: 37 9c 00 2c addi sp,sp,44
80043dc: c3 a0 00 00 ret
static char c = 'a';
/*
* Create a new device
*/
tty = calloc (1, sizeof (struct rtems_termios_tty));
80043e0: 34 01 00 01 mvi r1,1
80043e4: 34 02 00 e8 mvi r2,232
80043e8: fb ff f5 9b calli 8001a54 <calloc>
80043ec: b8 20 60 00 mv r12,r1
80043f0: b8 20 58 00 mv r11,r1
if (tty == NULL) {
80043f4: 5c 20 fe f8 bne r1,r0,8003fd4 <rtems_termios_open+0x90>
80043f8: e3 ff ff 02 bi 8004000 <rtems_termios_open+0xbc>
08004a48 <rtems_termios_puts>:
* Send characters to device-specific code
*/
void
rtems_termios_puts (
const void *_buf, size_t len, struct rtems_termios_tty *tty)
{
8004a48: 37 9c ff dc addi sp,sp,-36
8004a4c: 5b 8b 00 24 sw (sp+36),r11
8004a50: 5b 8c 00 20 sw (sp+32),r12
8004a54: 5b 8d 00 1c sw (sp+28),r13
8004a58: 5b 8e 00 18 sw (sp+24),r14
8004a5c: 5b 8f 00 14 sw (sp+20),r15
8004a60: 5b 90 00 10 sw (sp+16),r16
8004a64: 5b 91 00 0c sw (sp+12),r17
8004a68: 5b 92 00 08 sw (sp+8),r18
8004a6c: 5b 9d 00 04 sw (sp+4),ra
8004a70: b8 20 20 00 mv r4,r1
const unsigned char *buf = _buf;
8004a74: b8 20 68 00 mv r13,r1
unsigned int newHead;
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) {
8004a78: 28 61 00 b4 lw r1,(r3+180)
* Send characters to device-specific code
*/
void
rtems_termios_puts (
const void *_buf, size_t len, struct rtems_termios_tty *tty)
{
8004a7c: b8 40 70 00 mv r14,r2
8004a80: b8 60 58 00 mv r11,r3
const unsigned char *buf = _buf;
unsigned int newHead;
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) {
8004a84: 5c 20 00 07 bne r1,r0,8004aa0 <rtems_termios_puts+0x58>
(*tty->device.write)(tty->minor, buf, len);
8004a88: 28 65 00 a4 lw r5,(r3+164)
8004a8c: 28 61 00 10 lw r1,(r3+16)
8004a90: b8 80 10 00 mv r2,r4
8004a94: b9 c0 18 00 mv r3,r14
8004a98: d8 a0 00 00 call r5
return;
8004a9c: e0 00 00 33 bi 8004b68 <rtems_termios_puts+0x120>
}
newHead = tty->rawOutBuf.Head;
8004aa0: 28 6c 00 80 lw r12,(r3+128)
*
* To minimize latency, the memcpy should be done
* with interrupts enabled.
*/
newHead = (newHead + 1) % tty->rawOutBuf.Size;
rtems_interrupt_disable (level);
8004aa4: 34 10 ff fe mvi r16,-2
while (newHead == tty->rawOutBuf.Tail) {
tty->rawOutBufState = rob_wait;
8004aa8: 34 12 00 02 mvi r18,2
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;
}
tty->rawOutBufState = rob_busy;
8004aac: 34 11 00 01 mvi r17,1
if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) {
(*tty->device.write)(tty->minor, buf, len);
return;
}
newHead = tty->rawOutBuf.Head;
while (len) {
8004ab0: e0 00 00 2d bi 8004b64 <rtems_termios_puts+0x11c>
* len -= ncopy
*
* To minimize latency, the memcpy should be done
* with interrupts enabled.
*/
newHead = (newHead + 1) % tty->rawOutBuf.Size;
8004ab4: 29 62 00 88 lw r2,(r11+136)
8004ab8: 35 81 00 01 addi r1,r12,1
8004abc: f8 00 7b 57 calli 8023818 <__umodsi3>
8004ac0: b8 20 60 00 mv r12,r1
8004ac4: e0 00 00 09 bi 8004ae8 <rtems_termios_puts+0xa0>
rtems_interrupt_disable (level);
while (newHead == tty->rawOutBuf.Tail) {
tty->rawOutBufState = rob_wait;
8004ac8: 59 72 00 94 sw (r11+148),r18
rtems_interrupt_enable (level);
8004acc: d0 0f 00 00 wcsr IE,r15
sc = rtems_semaphore_obtain(
8004ad0: 29 61 00 8c lw r1,(r11+140)
8004ad4: 34 02 00 00 mvi r2,0
8004ad8: 34 03 00 00 mvi r3,0
8004adc: f8 00 06 98 calli 800653c <rtems_semaphore_obtain>
tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
8004ae0: 44 20 00 02 be r1,r0,8004ae8 <rtems_termios_puts+0xa0> <== ALWAYS TAKEN
rtems_fatal_error_occurred (sc);
8004ae4: f8 00 09 0a calli 8006f0c <rtems_fatal_error_occurred> <== NOT EXECUTED
rtems_interrupt_disable (level);
8004ae8: 90 00 78 00 rcsr r15,IE
8004aec: a1 f0 08 00 and r1,r15,r16
8004af0: d0 01 00 00 wcsr IE,r1
* 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) {
8004af4: 29 61 00 84 lw r1,(r11+132)
8004af8: 45 81 ff f4 be r12,r1,8004ac8 <rtems_termios_puts+0x80>
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++;
8004afc: 29 61 00 80 lw r1,(r11+128)
8004b00: 29 62 00 7c lw r2,(r11+124)
8004b04: b4 41 08 00 add r1,r2,r1
8004b08: 41 a2 00 00 lbu r2,(r13+0)
8004b0c: 35 ad 00 01 addi r13,r13,1
8004b10: 30 22 00 00 sb (r1+0),r2
tty->rawOutBuf.Head = newHead;
if (tty->rawOutBufState == rob_idle) {
8004b14: 29 61 00 94 lw r1,(r11+148)
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
rtems_interrupt_disable (level);
}
tty->rawOutBuf.theBuf[tty->rawOutBuf.Head] = *buf++;
tty->rawOutBuf.Head = newHead;
8004b18: 59 6c 00 80 sw (r11+128),r12
if (tty->rawOutBufState == rob_idle) {
8004b1c: 5c 20 00 10 bne r1,r0,8004b5c <rtems_termios_puts+0x114>
/* check, whether XOFF has been received */
if (!(tty->flow_ctrl & FL_ORCVXOF)) {
8004b20: 29 62 00 b8 lw r2,(r11+184)
8004b24: 20 42 00 10 andi r2,r2,0x10
8004b28: 5c 41 00 09 bne r2,r1,8004b4c <rtems_termios_puts+0x104> <== NEVER TAKEN
(*tty->device.write)(
8004b2c: 29 63 00 7c lw r3,(r11+124)
tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
8004b30: 29 62 00 84 lw r2,(r11+132)
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)(
8004b34: 29 64 00 a4 lw r4,(r11+164)
8004b38: 29 61 00 10 lw r1,(r11+16)
8004b3c: b4 62 10 00 add r2,r3,r2
8004b40: 34 03 00 01 mvi r3,1
8004b44: d8 80 00 00 call r4
8004b48: e0 00 00 04 bi 8004b58 <rtems_termios_puts+0x110>
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;
8004b4c: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED
8004b50: 38 21 00 20 ori r1,r1,0x20 <== NOT EXECUTED
8004b54: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED
}
tty->rawOutBufState = rob_busy;
8004b58: 59 71 00 94 sw (r11+148),r17
}
rtems_interrupt_enable (level);
8004b5c: d0 0f 00 00 wcsr IE,r15
len--;
8004b60: 35 ce ff ff addi r14,r14,-1
if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) {
(*tty->device.write)(tty->minor, buf, len);
return;
}
newHead = tty->rawOutBuf.Head;
while (len) {
8004b64: 5d c0 ff d4 bne r14,r0,8004ab4 <rtems_termios_puts+0x6c>
tty->rawOutBufState = rob_busy;
}
rtems_interrupt_enable (level);
len--;
}
}
8004b68: 2b 9d 00 04 lw ra,(sp+4)
8004b6c: 2b 8b 00 24 lw r11,(sp+36)
8004b70: 2b 8c 00 20 lw r12,(sp+32)
8004b74: 2b 8d 00 1c lw r13,(sp+28)
8004b78: 2b 8e 00 18 lw r14,(sp+24)
8004b7c: 2b 8f 00 14 lw r15,(sp+20)
8004b80: 2b 90 00 10 lw r16,(sp+16)
8004b84: 2b 91 00 0c lw r17,(sp+12)
8004b88: 2b 92 00 08 lw r18,(sp+8)
8004b8c: 37 9c 00 24 addi sp,sp,36
8004b90: c3 a0 00 00 ret
080052b4 <rtems_termios_read>:
return RTEMS_SUCCESSFUL;
}
rtems_status_code
rtems_termios_read (void *arg)
{
80052b4: 37 9c ff cc addi sp,sp,-52
80052b8: 5b 8b 00 34 sw (sp+52),r11
80052bc: 5b 8c 00 30 sw (sp+48),r12
80052c0: 5b 8d 00 2c sw (sp+44),r13
80052c4: 5b 8e 00 28 sw (sp+40),r14
80052c8: 5b 8f 00 24 sw (sp+36),r15
80052cc: 5b 90 00 20 sw (sp+32),r16
80052d0: 5b 91 00 1c sw (sp+28),r17
80052d4: 5b 92 00 18 sw (sp+24),r18
80052d8: 5b 93 00 14 sw (sp+20),r19
80052dc: 5b 94 00 10 sw (sp+16),r20
80052e0: 5b 95 00 0c sw (sp+12),r21
80052e4: 5b 96 00 08 sw (sp+8),r22
80052e8: 5b 9d 00 04 sw (sp+4),ra
80052ec: b8 20 60 00 mv r12,r1
rtems_libio_rw_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
80052f0: 28 21 00 00 lw r1,(r1+0)
uint32_t count = args->count;
char *buffer = args->buffer;
rtems_status_code sc;
sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
80052f4: 34 02 00 00 mvi r2,0
80052f8: 34 03 00 00 mvi r3,0
rtems_status_code
rtems_termios_read (void *arg)
{
rtems_libio_rw_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
80052fc: 28 2b 00 28 lw r11,(r1+40)
uint32_t count = args->count;
8005300: 29 8f 00 0c lw r15,(r12+12)
char *buffer = args->buffer;
8005304: 29 91 00 08 lw r17,(r12+8)
rtems_status_code sc;
sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
8005308: 29 61 00 14 lw r1,(r11+20)
800530c: f8 00 04 8c calli 800653c <rtems_semaphore_obtain>
8005310: b8 20 70 00 mv r14,r1
if (sc != RTEMS_SUCCESSFUL)
8005314: 5c 20 00 ad bne r1,r0,80055c8 <rtems_termios_read+0x314> <== NEVER TAKEN
return sc;
if (rtems_termios_linesw[tty->t_line].l_read != NULL) {
8005318: 29 61 00 cc lw r1,(r11+204)
800531c: 78 0d 08 02 mvhi r13,0x802
8005320: 34 02 00 05 mvi r2,5
8005324: fb ff ed c0 calli 8000a24 <__ashlsi3>
8005328: 39 ad 88 30 ori r13,r13,0x8830
800532c: b5 a1 08 00 add r1,r13,r1
8005330: 28 23 00 08 lw r3,(r1+8)
8005334: 44 6e 00 06 be r3,r14,800534c <rtems_termios_read+0x98>
sc = rtems_termios_linesw[tty->t_line].l_read(tty,args);
8005338: b9 60 08 00 mv r1,r11
800533c: b9 80 10 00 mv r2,r12
8005340: d8 60 00 00 call r3
8005344: b8 20 70 00 mv r14,r1
8005348: e0 00 00 9d bi 80055bc <rtems_termios_read+0x308>
tty->tty_rcvwakeup = 0;
rtems_semaphore_release (tty->isem);
return sc;
}
if (tty->cindex == tty->ccount) {
800534c: 29 62 00 24 lw r2,(r11+36)
8005350: 29 61 00 20 lw r1,(r11+32)
8005354: 5c 41 00 93 bne r2,r1,80055a0 <rtems_termios_read+0x2ec> <== NEVER TAKEN
tty->cindex = tty->ccount = 0;
tty->read_start_column = tty->column;
8005358: 29 61 00 28 lw r1,(r11+40)
rtems_semaphore_release (tty->isem);
return sc;
}
if (tty->cindex == tty->ccount) {
tty->cindex = tty->ccount = 0;
800535c: 59 60 00 20 sw (r11+32),r0
8005360: 59 60 00 24 sw (r11+36),r0
tty->read_start_column = tty->column;
8005364: 59 61 00 2c sw (r11+44),r1
if (tty->device.pollRead != NULL &&
8005368: 29 61 00 a0 lw r1,(r11+160)
800536c: 44 20 00 31 be r1,r0,8005430 <rtems_termios_read+0x17c>
8005370: 29 61 00 b4 lw r1,(r11+180)
8005374: 5c 20 00 2f bne r1,r0,8005430 <rtems_termios_read+0x17c>
static rtems_status_code
fillBufferPoll (struct rtems_termios_tty *tty)
{
int n;
if (tty->termios.c_lflag & ICANON) {
8005378: 29 61 00 3c lw r1,(r11+60)
800537c: 20 21 00 02 andi r1,r1,0x2
8005380: 44 20 00 0d be r1,r0,80053b4 <rtems_termios_read+0x100>
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
8005384: 29 62 00 a0 lw r2,(r11+160)
8005388: 29 61 00 10 lw r1,(r11+16)
800538c: d8 40 00 00 call r2
if (n < 0) {
8005390: 4c 20 00 04 bge r1,r0,80053a0 <rtems_termios_read+0xec>
rtems_task_wake_after (1);
8005394: 34 01 00 01 mvi r1,1
8005398: f8 00 05 d6 calli 8006af0 <rtems_task_wake_after>
800539c: e3 ff ff fa bi 8005384 <rtems_termios_read+0xd0>
} else {
if (siproc (n, tty))
80053a0: 20 21 00 ff andi r1,r1,0xff
80053a4: b9 60 10 00 mv r2,r11
80053a8: fb ff ff 6b calli 8005154 <siproc>
80053ac: 44 20 ff f6 be r1,r0,8005384 <rtems_termios_read+0xd0>
80053b0: e0 00 00 7c bi 80055a0 <rtems_termios_read+0x2ec>
}
}
} else {
rtems_interval then, now;
then = rtems_clock_get_ticks_since_boot();
80053b4: f8 00 02 9d calli 8005e28 <rtems_clock_get_ticks_since_boot>
80053b8: b8 20 68 00 mv r13,r1
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
80053bc: 29 62 00 a0 lw r2,(r11+160)
80053c0: 29 61 00 10 lw r1,(r11+16)
80053c4: d8 40 00 00 call r2
if (n < 0) {
80053c8: 4c 20 00 10 bge r1,r0,8005408 <rtems_termios_read+0x154>
if (tty->termios.c_cc[VMIN]) {
80053cc: 41 61 00 47 lbu r1,(r11+71)
80053d0: 41 62 00 46 lbu r2,(r11+70)
80053d4: 44 20 00 05 be r1,r0,80053e8 <rtems_termios_read+0x134> <== NEVER TAKEN
if (tty->termios.c_cc[VTIME] && tty->ccount) {
80053d8: 44 40 00 09 be r2,r0,80053fc <rtems_termios_read+0x148> <== NEVER TAKEN
80053dc: 29 61 00 20 lw r1,(r11+32)
80053e0: 44 20 00 07 be r1,r0,80053fc <rtems_termios_read+0x148>
80053e4: e0 00 00 02 bi 80053ec <rtems_termios_read+0x138>
if ((now - then) > tty->vtimeTicks) {
break;
}
}
} else {
if (!tty->termios.c_cc[VTIME])
80053e8: 44 41 00 6e be r2,r1,80055a0 <rtems_termios_read+0x2ec> <== NOT EXECUTED
break;
now = rtems_clock_get_ticks_since_boot();
80053ec: f8 00 02 8f calli 8005e28 <rtems_clock_get_ticks_since_boot>
if ((now - then) > tty->vtimeTicks) {
80053f0: 29 62 00 54 lw r2,(r11+84)
80053f4: c8 2d 08 00 sub r1,r1,r13
80053f8: 54 22 00 6a bgu r1,r2,80055a0 <rtems_termios_read+0x2ec>
break;
}
}
rtems_task_wake_after (1);
80053fc: 34 01 00 01 mvi r1,1
8005400: f8 00 05 bc calli 8006af0 <rtems_task_wake_after>
8005404: e3 ff ff ee bi 80053bc <rtems_termios_read+0x108>
} else {
siproc (n, tty);
8005408: b9 60 10 00 mv r2,r11
800540c: 20 21 00 ff andi r1,r1,0xff
8005410: fb ff ff 51 calli 8005154 <siproc>
if (tty->ccount >= tty->termios.c_cc[VMIN])
8005414: 41 61 00 47 lbu r1,(r11+71)
8005418: 29 62 00 20 lw r2,(r11+32)
800541c: 4c 41 00 61 bge r2,r1,80055a0 <rtems_termios_read+0x2ec>
break;
if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
8005420: 44 20 ff e7 be r1,r0,80053bc <rtems_termios_read+0x108> <== NEVER TAKEN
8005424: 41 61 00 46 lbu r1,(r11+70)
8005428: 44 20 ff e5 be r1,r0,80053bc <rtems_termios_read+0x108> <== NEVER TAKEN
800542c: e3 ff ff e2 bi 80053b4 <rtems_termios_read+0x100>
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
(tty->ccount < (CBUFSIZE-1))) {
8005430: 78 10 08 02 mvhi r16,0x802
* Fill the input buffer from the raw input queue
*/
static rtems_status_code
fillBufferQueue (struct rtems_termios_tty *tty)
{
rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout;
8005434: 29 72 00 74 lw r18,(r11+116)
rtems_status_code sc;
int wait = 1;
8005438: 34 0d 00 01 mvi r13,1
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
(tty->ccount < (CBUFSIZE-1))) {
800543c: 3a 10 81 40 ori r16,r16,0x8140
c = tty->rawInBuf.theBuf[newHead];
tty->rawInBuf.Head = newHead;
if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size)
% tty->rawInBuf.Size)
< tty->lowwater) {
tty->flow_ctrl &= ~FL_IREQXOF;
8005440: 34 16 ff fe mvi r22,-2
/* if tx stopped and XON should be sent... */
if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF))
8005444: 34 15 02 02 mvi r21,514
|| (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;
8005448: 34 14 ff fb mvi r20,-5
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)(
800544c: 35 73 00 49 addi r19,r11,73
8005450: e0 00 00 3e bi 8005548 <rtems_termios_read+0x294>
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
(tty->ccount < (CBUFSIZE-1))) {
unsigned char c;
unsigned int newHead;
newHead = (tty->rawInBuf.Head + 1) % tty->rawInBuf.Size;
8005454: 29 61 00 5c lw r1,(r11+92)
8005458: 29 62 00 64 lw r2,(r11+100)
800545c: 34 21 00 01 addi r1,r1,1
8005460: f8 00 78 ee calli 8023818 <__umodsi3>
8005464: b8 20 18 00 mv r3,r1
c = tty->rawInBuf.theBuf[newHead];
8005468: 29 61 00 58 lw r1,(r11+88)
800546c: b4 23 08 00 add r1,r1,r3
8005470: 40 32 00 00 lbu r18,(r1+0)
tty->rawInBuf.Head = newHead;
8005474: 59 63 00 5c sw (r11+92),r3
if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size)
8005478: 29 61 00 60 lw r1,(r11+96)
800547c: 29 64 00 64 lw r4,(r11+100)
% tty->rawInBuf.Size)
8005480: 29 62 00 64 lw r2,(r11+100)
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)
8005484: b4 81 08 00 add r1,r4,r1
% tty->rawInBuf.Size)
8005488: c8 23 08 00 sub r1,r1,r3
800548c: f8 00 78 e3 calli 8023818 <__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)
8005490: 29 62 00 bc lw r2,(r11+188)
8005494: 50 22 00 1c bgeu r1,r2,8005504 <rtems_termios_read+0x250> <== NEVER TAKEN
% tty->rawInBuf.Size)
< tty->lowwater) {
tty->flow_ctrl &= ~FL_IREQXOF;
8005498: 29 61 00 b8 lw r1,(r11+184)
800549c: a0 36 08 00 and r1,r1,r22
80054a0: 59 61 00 b8 sw (r11+184),r1
/* if tx stopped and XON should be sent... */
if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF))
80054a4: 29 61 00 b8 lw r1,(r11+184)
80054a8: 20 21 02 02 andi r1,r1,0x202
80054ac: 5c 35 00 0c bne r1,r21,80054dc <rtems_termios_read+0x228> <== ALWAYS TAKEN
== (FL_MDXON | FL_ISNTXOF))
&& ((tty->rawOutBufState == rob_idle)
80054b0: 29 61 00 94 lw r1,(r11+148) <== NOT EXECUTED
80054b4: 44 20 00 04 be r1,r0,80054c4 <rtems_termios_read+0x210> <== NOT EXECUTED
|| (tty->flow_ctrl & FL_OSTOP))) {
80054b8: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED
80054bc: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED
80054c0: 44 20 00 07 be r1,r0,80054dc <rtems_termios_read+0x228> <== NOT EXECUTED
/* XON should be sent now... */
(*tty->device.write)(
80054c4: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED
80054c8: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED
80054cc: ba 60 10 00 mv r2,r19 <== NOT EXECUTED
80054d0: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
80054d4: d8 80 00 00 call r4 <== NOT EXECUTED
80054d8: e0 00 00 0b bi 8005504 <rtems_termios_read+0x250> <== NOT EXECUTED
tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
} else if (tty->flow_ctrl & FL_MDRTS) {
80054dc: 29 61 00 b8 lw r1,(r11+184)
80054e0: 20 21 01 00 andi r1,r1,0x100
80054e4: 44 20 00 08 be r1,r0,8005504 <rtems_termios_read+0x250> <== ALWAYS TAKEN
tty->flow_ctrl &= ~FL_IRTSOFF;
80054e8: 29 61 00 b8 lw r1,(r11+184) <== NOT EXECUTED
/* activate RTS line */
if (tty->device.startRemoteTx != NULL) {
80054ec: 29 63 00 b0 lw r3,(r11+176) <== 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;
80054f0: a0 34 08 00 and r1,r1,r20 <== NOT EXECUTED
80054f4: 59 61 00 b8 sw (r11+184),r1 <== NOT EXECUTED
/* activate RTS line */
if (tty->device.startRemoteTx != NULL) {
80054f8: 44 60 00 03 be r3,r0,8005504 <rtems_termios_read+0x250> <== NOT EXECUTED
tty->device.startRemoteTx(tty->minor);
80054fc: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED
8005500: d8 60 00 00 call r3 <== NOT EXECUTED
}
}
}
/* continue processing new character */
if (tty->termios.c_lflag & ICANON) {
8005504: 29 61 00 3c lw r1,(r11+60)
8005508: 20 21 00 02 andi r1,r1,0x2
800550c: 44 20 00 06 be r1,r0,8005524 <rtems_termios_read+0x270> <== NEVER TAKEN
if (siproc (c, tty))
8005510: ba 40 08 00 mv r1,r18
8005514: b9 60 10 00 mv r2,r11
8005518: fb ff ff 0f calli 8005154 <siproc>
wait = 0;
800551c: 64 21 00 00 cmpei r1,r1,0
8005520: e0 00 00 07 bi 800553c <rtems_termios_read+0x288>
} else {
siproc (c, tty);
8005524: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
8005528: ba 40 08 00 mv r1,r18 <== NOT EXECUTED
800552c: fb ff ff 0a calli 8005154 <siproc> <== NOT EXECUTED
if (tty->ccount >= tty->termios.c_cc[VMIN])
8005530: 41 61 00 47 lbu r1,(r11+71) <== NOT EXECUTED
8005534: 29 62 00 20 lw r2,(r11+32) <== NOT EXECUTED
wait = 0;
8005538: e8 22 08 00 cmpg r1,r1,r2 <== NOT EXECUTED
}
timeout = tty->rawInBufSemaphoreTimeout;
800553c: 29 72 00 70 lw r18,(r11+112)
if (siproc (c, tty))
wait = 0;
} else {
siproc (c, tty);
if (tty->ccount >= tty->termios.c_cc[VMIN])
wait = 0;
8005540: c8 01 08 00 sub r1,r0,r1
8005544: a1 a1 68 00 and r13,r13,r1
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
8005548: 29 62 00 5c lw r2,(r11+92)
800554c: 29 61 00 60 lw r1,(r11+96)
8005550: 44 41 00 05 be r2,r1,8005564 <rtems_termios_read+0x2b0>
(tty->ccount < (CBUFSIZE-1))) {
8005554: 2a 01 00 00 lw r1,(r16+0)
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
8005558: 29 62 00 20 lw r2,(r11+32)
(tty->ccount < (CBUFSIZE-1))) {
800555c: 34 21 ff ff addi r1,r1,-1
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
8005560: 54 22 ff bd bgu r1,r2,8005454 <rtems_termios_read+0x1a0> <== ALWAYS TAKEN
}
/*
* Wait for characters
*/
if ( wait ) {
8005564: 45 a0 00 0f be r13,r0,80055a0 <rtems_termios_read+0x2ec>
sc = rtems_semaphore_obtain(
8005568: 29 61 00 68 lw r1,(r11+104)
800556c: 29 62 00 6c lw r2,(r11+108)
8005570: ba 40 18 00 mv r3,r18
8005574: f8 00 03 f2 calli 800653c <rtems_semaphore_obtain>
tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout);
if (sc != RTEMS_SUCCESSFUL)
8005578: 44 20 ff f4 be r1,r0,8005548 <rtems_termios_read+0x294> <== ALWAYS TAKEN
800557c: e0 00 00 09 bi 80055a0 <rtems_termios_read+0x2ec> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
tty->cindex = tty->ccount = 0;
}
while (count && (tty->cindex < tty->ccount)) {
*buffer++ = tty->cbuf[tty->cindex++];
8005580: 29 62 00 1c lw r2,(r11+28)
count--;
8005584: 35 ef ff ff addi r15,r15,-1
if (sc != RTEMS_SUCCESSFUL)
tty->cindex = tty->ccount = 0;
}
while (count && (tty->cindex < tty->ccount)) {
*buffer++ = tty->cbuf[tty->cindex++];
8005588: b4 41 10 00 add r2,r2,r1
800558c: 40 42 00 00 lbu r2,(r2+0)
8005590: 34 21 00 01 addi r1,r1,1
8005594: 32 22 00 00 sb (r17+0),r2
8005598: 59 61 00 24 sw (r11+36),r1
800559c: 36 31 00 01 addi r17,r17,1
sc = fillBufferQueue (tty);
if (sc != RTEMS_SUCCESSFUL)
tty->cindex = tty->ccount = 0;
}
while (count && (tty->cindex < tty->ccount)) {
80055a0: 45 e0 00 04 be r15,r0,80055b0 <rtems_termios_read+0x2fc>
80055a4: 29 61 00 24 lw r1,(r11+36)
80055a8: 29 62 00 20 lw r2,(r11+32)
80055ac: 48 41 ff f5 bg r2,r1,8005580 <rtems_termios_read+0x2cc>
*buffer++ = tty->cbuf[tty->cindex++];
count--;
}
args->bytes_moved = args->count - count;
80055b0: 29 81 00 0c lw r1,(r12+12)
80055b4: c8 2f 78 00 sub r15,r1,r15
80055b8: 59 8f 00 14 sw (r12+20),r15
tty->tty_rcvwakeup = 0;
rtems_semaphore_release (tty->isem);
80055bc: 29 61 00 14 lw r1,(r11+20)
while (count && (tty->cindex < tty->ccount)) {
*buffer++ = tty->cbuf[tty->cindex++];
count--;
}
args->bytes_moved = args->count - count;
tty->tty_rcvwakeup = 0;
80055c0: 59 60 00 e4 sw (r11+228),r0
rtems_semaphore_release (tty->isem);
80055c4: f8 00 04 2e calli 800667c <rtems_semaphore_release>
return sc;
}
80055c8: b9 c0 08 00 mv r1,r14
80055cc: 2b 9d 00 04 lw ra,(sp+4)
80055d0: 2b 8b 00 34 lw r11,(sp+52)
80055d4: 2b 8c 00 30 lw r12,(sp+48)
80055d8: 2b 8d 00 2c lw r13,(sp+44)
80055dc: 2b 8e 00 28 lw r14,(sp+40)
80055e0: 2b 8f 00 24 lw r15,(sp+36)
80055e4: 2b 90 00 20 lw r16,(sp+32)
80055e8: 2b 91 00 1c lw r17,(sp+28)
80055ec: 2b 92 00 18 lw r18,(sp+24)
80055f0: 2b 93 00 14 lw r19,(sp+20)
80055f4: 2b 94 00 10 lw r20,(sp+16)
80055f8: 2b 95 00 0c lw r21,(sp+12)
80055fc: 2b 96 00 08 lw r22,(sp+8)
8005600: 37 9c 00 34 addi sp,sp,52
8005604: c3 a0 00 00 ret
08003c44 <rtems_termios_refill_transmitter>:
* 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)
{
8003c44: 37 9c ff f0 addi sp,sp,-16
8003c48: 5b 8b 00 10 sw (sp+16),r11
8003c4c: 5b 8c 00 0c sw (sp+12),r12
8003c50: 5b 8d 00 08 sw (sp+8),r13
8003c54: 5b 9d 00 04 sw (sp+4),ra
int nToSend;
rtems_interrupt_level level;
int len;
/* check for XOF/XON to send */
if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF))
8003c58: 28 22 00 b8 lw r2,(r1+184)
* 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)
{
8003c5c: b8 20 58 00 mv r11,r1
int nToSend;
rtems_interrupt_level level;
int len;
/* check for XOF/XON to send */
if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF))
8003c60: 34 01 04 01 mvi r1,1025
8003c64: 20 42 04 03 andi r2,r2,0x403
8003c68: 5c 41 00 10 bne r2,r1,8003ca8 <rtems_termios_refill_transmitter+0x64><== ALWAYS TAKEN
== (FL_MDXOF | FL_IREQXOF)) {
/* XOFF should be sent now... */
(*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1);
8003c6c: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED
8003c70: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED
8003c74: 35 62 00 4a addi r2,r11,74 <== NOT EXECUTED
8003c78: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
8003c7c: d8 80 00 00 call r4 <== NOT EXECUTED
rtems_interrupt_disable(level);
8003c80: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED
8003c84: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED
8003c88: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED
8003c8c: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED
tty->t_dqlen--;
8003c90: 29 62 00 90 lw r2,(r11+144) <== NOT EXECUTED
8003c94: 34 42 ff ff addi r2,r2,-1 <== NOT EXECUTED
8003c98: 59 62 00 90 sw (r11+144),r2 <== NOT EXECUTED
tty->flow_ctrl |= FL_ISNTXOF;
8003c9c: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED
8003ca0: 38 42 00 02 ori r2,r2,0x2 <== NOT EXECUTED
8003ca4: e0 00 00 14 bi 8003cf4 <rtems_termios_refill_transmitter+0xb0><== NOT EXECUTED
rtems_interrupt_enable(level);
nToSend = 1;
} else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) {
8003ca8: 29 62 00 b8 lw r2,(r11+184)
8003cac: 34 01 00 02 mvi r1,2
8003cb0: 20 42 00 03 andi r2,r2,0x3
8003cb4: 5c 41 00 14 bne r2,r1,8003d04 <rtems_termios_refill_transmitter+0xc0><== ALWAYS TAKEN
* 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);
8003cb8: 29 64 00 a4 lw r4,(r11+164) <== NOT EXECUTED
8003cbc: 29 61 00 10 lw r1,(r11+16) <== NOT EXECUTED
8003cc0: 35 62 00 49 addi r2,r11,73 <== NOT EXECUTED
8003cc4: 34 03 00 01 mvi r3,1 <== NOT EXECUTED
8003cc8: d8 80 00 00 call r4 <== NOT EXECUTED
rtems_interrupt_disable(level);
8003ccc: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED
8003cd0: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED
8003cd4: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED
8003cd8: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED
tty->t_dqlen--;
8003cdc: 29 62 00 90 lw r2,(r11+144) <== NOT EXECUTED
tty->flow_ctrl &= ~FL_ISNTXOF;
8003ce0: 29 63 00 b8 lw r3,(r11+184) <== 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--;
8003ce4: 34 42 ff ff addi r2,r2,-1 <== NOT EXECUTED
8003ce8: 59 62 00 90 sw (r11+144),r2 <== NOT EXECUTED
tty->flow_ctrl &= ~FL_ISNTXOF;
8003cec: 34 02 ff fd mvi r2,-3 <== NOT EXECUTED
8003cf0: a0 62 10 00 and r2,r3,r2 <== NOT EXECUTED
8003cf4: 59 62 00 b8 sw (r11+184),r2 <== NOT EXECUTED
rtems_interrupt_enable(level);
8003cf8: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED
nToSend = 1;
8003cfc: 34 0c 00 01 mvi r12,1 <== NOT EXECUTED
8003d00: e0 00 00 49 bi 8003e24 <rtems_termios_refill_transmitter+0x1e0><== NOT EXECUTED
} else {
if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) {
8003d04: 29 63 00 80 lw r3,(r11+128)
8003d08: 29 62 00 84 lw r2,(r11+132)
8003d0c: 5c 62 00 07 bne r3,r2,8003d28 <rtems_termios_refill_transmitter+0xe4>
/*
* buffer was empty
*/
if (tty->rawOutBufState == rob_wait) {
8003d10: 29 62 00 94 lw r2,(r11+148)
/*
* this should never happen...
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
}
return 0;
8003d14: 34 0c 00 00 mvi r12,0
} else {
if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) {
/*
* buffer was empty
*/
if (tty->rawOutBufState == rob_wait) {
8003d18: 5c 41 00 43 bne r2,r1,8003e24 <rtems_termios_refill_transmitter+0x1e0><== ALWAYS TAKEN
/*
* this should never happen...
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
8003d1c: 29 61 00 8c lw r1,(r11+140) <== NOT EXECUTED
8003d20: f8 00 0a 57 calli 800667c <rtems_semaphore_release> <== NOT EXECUTED
8003d24: e0 00 00 40 bi 8003e24 <rtems_termios_refill_transmitter+0x1e0><== NOT EXECUTED
}
return 0;
}
rtems_interrupt_disable(level);
8003d28: 90 00 10 00 rcsr r2,IE
8003d2c: 34 01 ff fe mvi r1,-2
8003d30: a0 41 08 00 and r1,r2,r1
8003d34: d0 01 00 00 wcsr IE,r1
len = tty->t_dqlen;
8003d38: 29 63 00 90 lw r3,(r11+144)
tty->t_dqlen = 0;
8003d3c: 59 60 00 90 sw (r11+144),r0
rtems_interrupt_enable(level);
8003d40: d0 02 00 00 wcsr IE,r2
newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size;
8003d44: 29 61 00 84 lw r1,(r11+132)
8003d48: 29 62 00 88 lw r2,(r11+136)
8003d4c: b4 61 08 00 add r1,r3,r1
8003d50: f8 00 7e b2 calli 8023818 <__umodsi3>
tty->rawOutBuf.Tail = newTail;
if (tty->rawOutBufState == rob_wait) {
8003d54: 29 62 00 94 lw r2,(r11+148)
rtems_interrupt_disable(level);
len = tty->t_dqlen;
tty->t_dqlen = 0;
rtems_interrupt_enable(level);
newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size;
8003d58: b8 20 68 00 mv r13,r1
tty->rawOutBuf.Tail = newTail;
8003d5c: 59 61 00 84 sw (r11+132),r1
if (tty->rawOutBufState == rob_wait) {
8003d60: 34 01 00 02 mvi r1,2
8003d64: 5c 41 00 03 bne r2,r1,8003d70 <rtems_termios_refill_transmitter+0x12c>
/*
* wake up any pending writer task
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
8003d68: 29 61 00 8c lw r1,(r11+140)
8003d6c: f8 00 0a 44 calli 800667c <rtems_semaphore_release>
}
if (newTail == tty->rawOutBuf.Head) {
8003d70: 29 61 00 80 lw r1,(r11+128)
8003d74: 5d a1 00 09 bne r13,r1,8003d98 <rtems_termios_refill_transmitter+0x154>
nToSend = 0;
/*
* check to see if snd wakeup callback was set
*/
if ( tty->tty_snd.sw_pfn != NULL) {
8003d78: 29 63 00 d4 lw r3,(r11+212)
if (newTail == tty->rawOutBuf.Head) {
/*
* Buffer has become empty
*/
tty->rawOutBufState = rob_idle;
8003d7c: 59 60 00 94 sw (r11+148),r0
nToSend = 0;
8003d80: 34 0c 00 00 mvi r12,0
/*
* check to see if snd wakeup callback was set
*/
if ( tty->tty_snd.sw_pfn != NULL) {
8003d84: 44 60 00 27 be r3,r0,8003e20 <rtems_termios_refill_transmitter+0x1dc><== ALWAYS TAKEN
(*tty->tty_snd.sw_pfn)(&tty->termios, tty->tty_snd.sw_arg);
8003d88: 29 62 00 d8 lw r2,(r11+216) <== NOT EXECUTED
8003d8c: 35 61 00 30 addi r1,r11,48 <== NOT EXECUTED
8003d90: d8 60 00 00 call r3 <== NOT EXECUTED
8003d94: e0 00 00 23 bi 8003e20 <rtems_termios_refill_transmitter+0x1dc><== NOT EXECUTED
}
}
/* check, whether output should stop due to received XOFF */
else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF))
8003d98: 29 62 00 b8 lw r2,(r11+184)
8003d9c: 34 01 02 10 mvi r1,528
8003da0: 20 42 02 10 andi r2,r2,0x210
8003da4: 5c 41 00 0d bne r2,r1,8003dd8 <rtems_termios_refill_transmitter+0x194><== ALWAYS TAKEN
== (FL_MDXON | FL_ORCVXOF)) {
/* Buffer not empty, but output stops due to XOFF */
/* set flag, that output has been stopped */
rtems_interrupt_disable(level);
8003da8: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED
8003dac: 34 02 ff fe mvi r2,-2 <== NOT EXECUTED
8003db0: a0 22 10 00 and r2,r1,r2 <== NOT EXECUTED
8003db4: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED
tty->flow_ctrl |= FL_OSTOP;
8003db8: 29 62 00 b8 lw r2,(r11+184) <== NOT EXECUTED
8003dbc: 38 42 00 20 ori r2,r2,0x20 <== NOT EXECUTED
8003dc0: 59 62 00 b8 sw (r11+184),r2 <== NOT EXECUTED
tty->rawOutBufState = rob_busy; /*apm*/
8003dc4: 34 02 00 01 mvi r2,1 <== NOT EXECUTED
8003dc8: 59 62 00 94 sw (r11+148),r2 <== NOT EXECUTED
rtems_interrupt_enable(level);
8003dcc: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED
nToSend = 0;
8003dd0: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED
8003dd4: e0 00 00 13 bi 8003e20 <rtems_termios_refill_transmitter+0x1dc><== NOT EXECUTED
} else {
/*
* Buffer not empty, start tranmitter
*/
if (newTail > tty->rawOutBuf.Head)
8003dd8: 29 61 00 80 lw r1,(r11+128)
8003ddc: 50 2d 00 03 bgeu r1,r13,8003de8 <rtems_termios_refill_transmitter+0x1a4>
nToSend = tty->rawOutBuf.Size - newTail;
8003de0: 29 6c 00 88 lw r12,(r11+136)
8003de4: e0 00 00 02 bi 8003dec <rtems_termios_refill_transmitter+0x1a8>
else
nToSend = tty->rawOutBuf.Head - newTail;
8003de8: 29 6c 00 80 lw r12,(r11+128)
/* 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)) {
8003dec: 29 61 00 b8 lw r1,(r11+184)
* Buffer not empty, start tranmitter
*/
if (newTail > tty->rawOutBuf.Head)
nToSend = tty->rawOutBuf.Size - newTail;
else
nToSend = tty->rawOutBuf.Head - newTail;
8003df0: c9 8d 60 00 sub r12,r12,r13
/* 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)) {
8003df4: 20 21 06 00 andi r1,r1,0x600
8003df8: 44 20 00 02 be r1,r0,8003e00 <rtems_termios_refill_transmitter+0x1bc>
nToSend = 1;
8003dfc: 34 0c 00 01 mvi r12,1
}
tty->rawOutBufState = rob_busy; /*apm*/
8003e00: 34 01 00 01 mvi r1,1
(*tty->device.write)(
8003e04: 29 62 00 7c lw r2,(r11+124)
/* 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*/
8003e08: 59 61 00 94 sw (r11+148),r1
(*tty->device.write)(
8003e0c: 29 64 00 a4 lw r4,(r11+164)
8003e10: 29 61 00 10 lw r1,(r11+16)
8003e14: b4 4d 10 00 add r2,r2,r13
8003e18: b9 80 18 00 mv r3,r12
8003e1c: d8 80 00 00 call r4
tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend);
}
tty->rawOutBuf.Tail = newTail; /*apm*/
8003e20: 59 6d 00 84 sw (r11+132),r13
}
return nToSend;
}
8003e24: b9 80 08 00 mv r1,r12
8003e28: 2b 9d 00 04 lw ra,(sp+4)
8003e2c: 2b 8b 00 10 lw r11,(sp+16)
8003e30: 2b 8c 00 0c lw r12,(sp+12)
8003e34: 2b 8d 00 08 lw r13,(sp+8)
8003e38: 37 9c 00 10 addi sp,sp,16
8003e3c: c3 a0 00 00 ret
0800594c <rtems_termios_rxdaemon>:
/*
* this task actually processes any receive events
*/
static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument)
{
800594c: 37 9c ff e4 addi sp,sp,-28
8005950: 5b 8b 00 14 sw (sp+20),r11
8005954: 5b 8c 00 10 sw (sp+16),r12
8005958: 5b 8d 00 0c sw (sp+12),r13
800595c: 5b 8e 00 08 sw (sp+8),r14
8005960: 5b 9d 00 04 sw (sp+4),ra
/*
* do something
*/
c = tty->device.pollRead(tty->minor);
if (c != EOF) {
8005964: 34 0d ff ff mvi r13,-1
/*
* this task actually processes any receive events
*/
static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument)
{
8005968: b8 20 58 00 mv r11,r1
while (1) {
/*
* wait for rtems event
*/
rtems_event_receive(
800596c: 37 8e 00 18 addi r14,sp,24
if (c != EOF) {
/*
* pollRead did call enqueue on its own
*/
c_buf = c;
rtems_termios_enqueue_raw_characters ( tty,&c_buf,1);
8005970: 37 8c 00 1f addi r12,sp,31
while (1) {
/*
* wait for rtems event
*/
rtems_event_receive(
8005974: 34 01 00 03 mvi r1,3
8005978: 34 02 00 02 mvi r2,2
800597c: 34 03 00 00 mvi r3,0
8005980: b9 c0 20 00 mv r4,r14
8005984: f8 00 01 45 calli 8005e98 <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) {
8005988: 2b 81 00 18 lw r1,(sp+24)
800598c: 20 21 00 01 andi r1,r1,0x1
8005990: 44 20 00 04 be r1,r0,80059a0 <rtems_termios_rxdaemon+0x54> <== ALWAYS TAKEN
tty->rxTaskId = 0;
8005994: 59 60 00 c4 sw (r11+196),r0 <== NOT EXECUTED
rtems_task_delete(RTEMS_SELF);
8005998: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
800599c: f8 00 03 e4 calli 800692c <rtems_task_delete> <== NOT EXECUTED
}
/*
* do something
*/
c = tty->device.pollRead(tty->minor);
80059a0: 29 62 00 a0 lw r2,(r11+160)
80059a4: 29 61 00 10 lw r1,(r11+16)
80059a8: d8 40 00 00 call r2
if (c != EOF) {
80059ac: 44 2d ff f2 be r1,r13,8005974 <rtems_termios_rxdaemon+0x28>
/*
* pollRead did call enqueue on its own
*/
c_buf = c;
80059b0: 33 81 00 1f sb (sp+31),r1
rtems_termios_enqueue_raw_characters ( tty,&c_buf,1);
80059b4: b9 80 10 00 mv r2,r12
80059b8: b9 60 08 00 mv r1,r11
80059bc: 34 03 00 01 mvi r3,1
80059c0: fb ff ff 1a calli 8005628 <rtems_termios_enqueue_raw_characters>
80059c4: e3 ff ff ec bi 8005974 <rtems_termios_rxdaemon+0x28>
08003ed0 <rtems_termios_txdaemon>:
/*
* this task actually processes any transmit events
*/
static rtems_task rtems_termios_txdaemon(rtems_task_argument argument)
{
8003ed0: 37 9c ff f0 addi sp,sp,-16
8003ed4: 5b 8b 00 0c sw (sp+12),r11
8003ed8: 5b 8c 00 08 sw (sp+8),r12
8003edc: 5b 9d 00 04 sw (sp+4),ra
}
/*
* call any line discipline start function
*/
if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
8003ee0: 78 0c 08 02 mvhi r12,0x802
/*
* this task actually processes any transmit events
*/
static rtems_task rtems_termios_txdaemon(rtems_task_argument argument)
{
8003ee4: b8 20 58 00 mv r11,r1
}
/*
* call any line discipline start function
*/
if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
8003ee8: 39 8c 88 30 ori r12,r12,0x8830
while (1) {
/*
* wait for rtems event
*/
rtems_event_receive(
8003eec: 34 01 00 03 mvi r1,3
8003ef0: 34 02 00 02 mvi r2,2
8003ef4: 34 03 00 00 mvi r3,0
8003ef8: 37 84 00 10 addi r4,sp,16
8003efc: f8 00 07 e7 calli 8005e98 <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) {
8003f00: 2b 81 00 10 lw r1,(sp+16)
8003f04: 20 21 00 01 andi r1,r1,0x1
8003f08: 44 20 00 04 be r1,r0,8003f18 <rtems_termios_txdaemon+0x48> <== ALWAYS TAKEN
tty->txTaskId = 0;
8003f0c: 59 60 00 c8 sw (r11+200),r0 <== NOT EXECUTED
rtems_task_delete(RTEMS_SELF);
8003f10: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
8003f14: f8 00 0a 86 calli 800692c <rtems_task_delete> <== NOT EXECUTED
}
/*
* call any line discipline start function
*/
if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
8003f18: 29 61 00 cc lw r1,(r11+204)
8003f1c: 34 02 00 05 mvi r2,5
8003f20: fb ff f2 c1 calli 8000a24 <__ashlsi3>
8003f24: b5 81 08 00 add r1,r12,r1
8003f28: 28 22 00 14 lw r2,(r1+20)
8003f2c: 44 40 00 03 be r2,r0,8003f38 <rtems_termios_txdaemon+0x68> <== ALWAYS TAKEN
rtems_termios_linesw[tty->t_line].l_start(tty);
8003f30: b9 60 08 00 mv r1,r11 <== NOT EXECUTED
8003f34: d8 40 00 00 call r2 <== NOT EXECUTED
}
/*
* try to push further characters to device
*/
rtems_termios_refill_transmitter(tty);
8003f38: b9 60 08 00 mv r1,r11
8003f3c: fb ff ff 42 calli 8003c44 <rtems_termios_refill_transmitter>
}
8003f40: e3 ff ff eb bi 8003eec <rtems_termios_txdaemon+0x1c>
080051c8 <rtems_termios_write>:
rtems_termios_puts (&c, 1, tty);
}
rtems_status_code
rtems_termios_write (void *arg)
{
80051c8: 37 9c ff e8 addi sp,sp,-24
80051cc: 5b 8b 00 18 sw (sp+24),r11
80051d0: 5b 8c 00 14 sw (sp+20),r12
80051d4: 5b 8d 00 10 sw (sp+16),r13
80051d8: 5b 8e 00 0c sw (sp+12),r14
80051dc: 5b 8f 00 08 sw (sp+8),r15
80051e0: 5b 9d 00 04 sw (sp+4),ra
80051e4: b8 20 58 00 mv r11,r1
rtems_libio_rw_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
80051e8: 28 21 00 00 lw r1,(r1+0)
rtems_status_code sc;
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
80051ec: 34 02 00 00 mvi r2,0
80051f0: 34 03 00 00 mvi r3,0
rtems_status_code
rtems_termios_write (void *arg)
{
rtems_libio_rw_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
80051f4: 28 2c 00 28 lw r12,(r1+40)
rtems_status_code sc;
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
80051f8: 29 81 00 18 lw r1,(r12+24)
80051fc: f8 00 04 d0 calli 800653c <rtems_semaphore_obtain>
8005200: b8 20 68 00 mv r13,r1
if (sc != RTEMS_SUCCESSFUL)
8005204: 5c 20 00 23 bne r1,r0,8005290 <rtems_termios_write+0xc8> <== NEVER TAKEN
return sc;
if (rtems_termios_linesw[tty->t_line].l_write != NULL) {
8005208: 29 81 00 cc lw r1,(r12+204)
800520c: 78 0e 08 02 mvhi r14,0x802
8005210: 34 02 00 05 mvi r2,5
8005214: fb ff ee 04 calli 8000a24 <__ashlsi3>
8005218: 39 ce 88 30 ori r14,r14,0x8830
800521c: b5 c1 08 00 add r1,r14,r1
8005220: 28 23 00 0c lw r3,(r1+12)
8005224: 44 6d 00 06 be r3,r13,800523c <rtems_termios_write+0x74>
sc = rtems_termios_linesw[tty->t_line].l_write(tty,args);
8005228: b9 80 08 00 mv r1,r12
800522c: b9 60 10 00 mv r2,r11
8005230: d8 60 00 00 call r3
8005234: b8 20 68 00 mv r13,r1
8005238: e0 00 00 14 bi 8005288 <rtems_termios_write+0xc0>
rtems_semaphore_release (tty->osem);
return sc;
}
if (tty->termios.c_oflag & OPOST) {
800523c: 29 83 00 34 lw r3,(r12+52)
8005240: 29 62 00 0c lw r2,(r11+12)
8005244: 29 61 00 08 lw r1,(r11+8)
8005248: 20 63 00 01 andi r3,r3,0x1
uint32_t count = args->count;
800524c: b8 40 78 00 mv r15,r2
char *buffer = args->buffer;
8005250: b8 20 70 00 mv r14,r1
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) {
8005254: 5c 60 00 07 bne r3,r0,8005270 <rtems_termios_write+0xa8> <== ALWAYS TAKEN
8005258: e0 00 00 08 bi 8005278 <rtems_termios_write+0xb0> <== NOT EXECUTED
uint32_t count = args->count;
char *buffer = args->buffer;
while (count--)
oproc (*buffer++, tty);
800525c: 41 c1 00 00 lbu r1,(r14+0)
8005260: b9 80 10 00 mv r2,r12
8005264: 35 ce 00 01 addi r14,r14,1
8005268: fb ff fe 4b calli 8004b94 <oproc>
800526c: 35 ef ff ff addi r15,r15,-1
return sc;
}
if (tty->termios.c_oflag & OPOST) {
uint32_t count = args->count;
char *buffer = args->buffer;
while (count--)
8005270: 5d e0 ff fb bne r15,r0,800525c <rtems_termios_write+0x94>
8005274: e0 00 00 03 bi 8005280 <rtems_termios_write+0xb8>
oproc (*buffer++, tty);
args->bytes_moved = args->count;
} else {
rtems_termios_puts (args->buffer, args->count, tty);
8005278: b9 80 18 00 mv r3,r12 <== NOT EXECUTED
800527c: fb ff fd f3 calli 8004a48 <rtems_termios_puts> <== NOT EXECUTED
args->bytes_moved = args->count;
8005280: 29 61 00 0c lw r1,(r11+12)
8005284: 59 61 00 14 sw (r11+20),r1
}
rtems_semaphore_release (tty->osem);
8005288: 29 81 00 18 lw r1,(r12+24)
800528c: f8 00 04 fc calli 800667c <rtems_semaphore_release>
return sc;
}
8005290: b9 a0 08 00 mv r1,r13
8005294: 2b 9d 00 04 lw ra,(sp+4)
8005298: 2b 8b 00 18 lw r11,(sp+24)
800529c: 2b 8c 00 14 lw r12,(sp+20)
80052a0: 2b 8d 00 10 lw r13,(sp+16)
80052a4: 2b 8e 00 0c lw r14,(sp+12)
80052a8: 2b 8f 00 08 lw r15,(sp+8)
80052ac: 37 9c 00 18 addi sp,sp,24
80052b0: c3 a0 00 00 ret
08014db4 <rtems_timer_cancel>:
*/
rtems_status_code rtems_timer_cancel(
rtems_id id
)
{
8014db4: 37 9c ff f8 addi sp,sp,-8
8014db8: 5b 9d 00 04 sw (sp+4),ra
8014dbc: b8 20 10 00 mv r2,r1
Objects_Id id,
Objects_Locations *location
)
{
return (Timer_Control *)
_Objects_Get( &_Timer_Information, id, location );
8014dc0: 78 01 08 04 mvhi r1,0x804
8014dc4: 38 21 06 50 ori r1,r1,0x650
8014dc8: 37 83 00 08 addi r3,sp,8
8014dcc: f8 00 0f 08 calli 80189ec <_Objects_Get>
Timer_Control *the_timer;
Objects_Locations location;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
8014dd0: 2b 82 00 08 lw r2,(sp+8)
8014dd4: 5c 40 00 09 bne r2,r0,8014df8 <rtems_timer_cancel+0x44>
case OBJECTS_LOCAL:
if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
8014dd8: 28 23 00 38 lw r3,(r1+56)
8014ddc: 34 02 00 04 mvi r2,4
8014de0: 44 62 00 03 be r3,r2,8014dec <rtems_timer_cancel+0x38> <== NEVER TAKEN
(void) _Watchdog_Remove( &the_timer->Ticker );
8014de4: 34 21 00 10 addi r1,r1,16
8014de8: f8 00 18 21 calli 801ae6c <_Watchdog_Remove>
_Thread_Enable_dispatch();
8014dec: f8 00 13 70 calli 8019bac <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8014df0: 34 01 00 00 mvi r1,0
8014df4: e0 00 00 02 bi 8014dfc <rtems_timer_cancel+0x48>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8014df8: 34 01 00 04 mvi r1,4
}
8014dfc: 2b 9d 00 04 lw ra,(sp+4)
8014e00: 37 9c 00 08 addi sp,sp,8
8014e04: c3 a0 00 00 ret
08003ce4 <rtems_timer_fire_after>:
rtems_id id,
rtems_interval ticks,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
8003ce4: 37 9c ff e0 addi sp,sp,-32
8003ce8: 5b 8b 00 1c sw (sp+28),r11
8003cec: 5b 8c 00 18 sw (sp+24),r12
8003cf0: 5b 8d 00 14 sw (sp+20),r13
8003cf4: 5b 8e 00 10 sw (sp+16),r14
8003cf8: 5b 8f 00 0c sw (sp+12),r15
8003cfc: 5b 90 00 08 sw (sp+8),r16
8003d00: 5b 9d 00 04 sw (sp+4),ra
8003d04: b8 20 70 00 mv r14,r1
8003d08: b8 40 68 00 mv r13,r2
8003d0c: b8 60 78 00 mv r15,r3
8003d10: b8 80 80 00 mv r16,r4
Timer_Control *the_timer;
Objects_Locations location;
ISR_Level level;
if ( ticks == 0 )
return RTEMS_INVALID_NUMBER;
8003d14: 34 01 00 0a mvi r1,10
{
Timer_Control *the_timer;
Objects_Locations location;
ISR_Level level;
if ( ticks == 0 )
8003d18: 44 40 00 25 be r2,r0,8003dac <rtems_timer_fire_after+0xc8> <== NEVER TAKEN
return RTEMS_INVALID_NUMBER;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
8003d1c: 34 01 00 09 mvi r1,9
ISR_Level level;
if ( ticks == 0 )
return RTEMS_INVALID_NUMBER;
if ( !routine )
8003d20: 44 60 00 23 be r3,r0,8003dac <rtems_timer_fire_after+0xc8> <== NEVER TAKEN
Objects_Id id,
Objects_Locations *location
)
{
return (Timer_Control *)
_Objects_Get( &_Timer_Information, id, location );
8003d24: 78 01 08 02 mvhi r1,0x802
8003d28: 38 21 01 f0 ori r1,r1,0x1f0
8003d2c: b9 c0 10 00 mv r2,r14
8003d30: 37 83 00 20 addi r3,sp,32
8003d34: f8 00 05 d9 calli 8005498 <_Objects_Get>
8003d38: b8 20 58 00 mv r11,r1
return RTEMS_INVALID_ADDRESS;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
8003d3c: 2b 81 00 20 lw r1,(sp+32)
8003d40: 5c 20 00 1a bne r1,r0,8003da8 <rtems_timer_fire_after+0xc4><== NEVER TAKEN
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
8003d44: 35 6c 00 10 addi r12,r11,16
8003d48: b9 80 08 00 mv r1,r12
8003d4c: f8 00 0d c1 calli 8007450 <_Watchdog_Remove>
_ISR_Disable( level );
8003d50: 90 00 28 00 rcsr r5,IE
8003d54: 34 01 ff fe mvi r1,-2
8003d58: a0 a1 08 00 and r1,r5,r1
8003d5c: d0 01 00 00 wcsr IE,r1
/*
* Check to see if the watchdog has just been inserted by a
* higher priority interrupt. If so, abandon this insert.
*/
if ( the_timer->Ticker.state != WATCHDOG_INACTIVE ) {
8003d60: 29 61 00 18 lw r1,(r11+24)
8003d64: 44 20 00 03 be r1,r0,8003d70 <rtems_timer_fire_after+0x8c>
_ISR_Enable( level );
8003d68: d0 05 00 00 wcsr IE,r5
8003d6c: e0 00 00 0c bi 8003d9c <rtems_timer_fire_after+0xb8>
/*
* OK. Now we now the timer was not rescheduled by an interrupt
* so we can atomically initialize it as in use.
*/
the_timer->the_class = TIMER_INTERVAL;
8003d70: 59 60 00 38 sw (r11+56),r0
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8003d74: 59 61 00 18 sw (r11+24),r1
the_watchdog->routine = routine;
8003d78: 59 6f 00 2c sw (r11+44),r15
the_watchdog->id = id;
8003d7c: 59 6e 00 30 sw (r11+48),r14
the_watchdog->user_data = user_data;
8003d80: 59 70 00 34 sw (r11+52),r16
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
_ISR_Enable( level );
8003d84: d0 05 00 00 wcsr IE,r5
)
{
the_watchdog->initial = units;
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8003d88: 78 01 08 01 mvhi r1,0x801
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8003d8c: 59 6d 00 1c sw (r11+28),r13
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8003d90: 38 21 f9 b8 ori r1,r1,0xf9b8
8003d94: b9 80 10 00 mv r2,r12
8003d98: f8 00 0d 51 calli 80072dc <_Watchdog_Insert>
_Watchdog_Insert_ticks( &the_timer->Ticker, ticks );
_Thread_Enable_dispatch();
8003d9c: f8 00 09 9a calli 8006404 <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8003da0: 34 01 00 00 mvi r1,0
8003da4: e0 00 00 02 bi 8003dac <rtems_timer_fire_after+0xc8>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8003da8: 34 01 00 04 mvi r1,4
}
8003dac: 2b 9d 00 04 lw ra,(sp+4)
8003db0: 2b 8b 00 1c lw r11,(sp+28)
8003db4: 2b 8c 00 18 lw r12,(sp+24)
8003db8: 2b 8d 00 14 lw r13,(sp+20)
8003dbc: 2b 8e 00 10 lw r14,(sp+16)
8003dc0: 2b 8f 00 0c lw r15,(sp+12)
8003dc4: 2b 90 00 08 lw r16,(sp+8)
8003dc8: 37 9c 00 20 addi sp,sp,32
8003dcc: c3 a0 00 00 ret
080153f8 <rtems_timer_server_fire_when>:
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
80153f8: 37 9c ff dc addi sp,sp,-36
80153fc: 5b 8b 00 20 sw (sp+32),r11
8015400: 5b 8c 00 1c sw (sp+28),r12
8015404: 5b 8d 00 18 sw (sp+24),r13
8015408: 5b 8e 00 14 sw (sp+20),r14
801540c: 5b 8f 00 10 sw (sp+16),r15
8015410: 5b 90 00 0c sw (sp+12),r16
8015414: 5b 91 00 08 sw (sp+8),r17
8015418: 5b 9d 00 04 sw (sp+4),ra
Timer_Control *the_timer;
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
801541c: 78 05 08 04 mvhi r5,0x804
8015420: 38 a5 06 90 ori r5,r5,0x690
8015424: 28 ad 00 00 lw r13,(r5+0)
rtems_id id,
rtems_time_of_day *wall_time,
rtems_timer_service_routine_entry routine,
void *user_data
)
{
8015428: b8 20 78 00 mv r15,r1
801542c: b8 40 70 00 mv r14,r2
8015430: b8 60 80 00 mv r16,r3
8015434: b8 80 88 00 mv r17,r4
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
if ( !timer_server )
return RTEMS_INCORRECT_STATE;
8015438: 34 0b 00 0e mvi r11,14
Timer_Control *the_timer;
Objects_Locations location;
rtems_interval seconds;
Timer_server_Control *timer_server = _Timer_server;
if ( !timer_server )
801543c: 45 a0 00 38 be r13,r0,801551c <rtems_timer_server_fire_when+0x124>
return RTEMS_INCORRECT_STATE;
if ( !_TOD.is_set )
8015440: 78 0c 08 03 mvhi r12,0x803
8015444: 39 8c fc d0 ori r12,r12,0xfcd0
8015448: 41 81 00 14 lbu r1,(r12+20)
return RTEMS_NOT_DEFINED;
801544c: 34 0b 00 0b mvi r11,11
Timer_server_Control *timer_server = _Timer_server;
if ( !timer_server )
return RTEMS_INCORRECT_STATE;
if ( !_TOD.is_set )
8015450: 44 20 00 33 be r1,r0,801551c <rtems_timer_server_fire_when+0x124><== NEVER TAKEN
return RTEMS_NOT_DEFINED;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
8015454: 34 0b 00 09 mvi r11,9
return RTEMS_INCORRECT_STATE;
if ( !_TOD.is_set )
return RTEMS_NOT_DEFINED;
if ( !routine )
8015458: 44 60 00 31 be r3,r0,801551c <rtems_timer_server_fire_when+0x124>
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
801545c: b8 40 08 00 mv r1,r2
8015460: fb ff f0 f6 calli 8011838 <_TOD_Validate>
return RTEMS_INVALID_CLOCK;
8015464: 34 0b 00 14 mvi r11,20
return RTEMS_NOT_DEFINED;
if ( !routine )
return RTEMS_INVALID_ADDRESS;
if ( !_TOD_Validate( wall_time ) )
8015468: 44 20 00 2d be r1,r0,801551c <rtems_timer_server_fire_when+0x124>
return RTEMS_INVALID_CLOCK;
seconds = _TOD_To_seconds( wall_time );
801546c: b9 c0 08 00 mv r1,r14
8015470: fb ff f0 aa calli 8011718 <_TOD_To_seconds>
8015474: 78 05 08 03 mvhi r5,0x803
8015478: 38 a5 88 cc ori r5,r5,0x88cc
801547c: b8 20 70 00 mv r14,r1
8015480: 29 82 00 04 lw r2,(r12+4)
8015484: 29 81 00 00 lw r1,(r12+0)
8015488: 28 a4 00 00 lw r4,(r5+0)
801548c: 34 03 00 00 mvi r3,0
8015490: f8 00 56 a9 calli 802af34 <__divdi3>
if ( seconds <= _TOD_Seconds_since_epoch() )
8015494: 50 4e 00 22 bgeu r2,r14,801551c <rtems_timer_server_fire_when+0x124>
8015498: 78 01 08 04 mvhi r1,0x804
801549c: 38 21 06 50 ori r1,r1,0x650
80154a0: b9 e0 10 00 mv r2,r15
80154a4: 37 83 00 24 addi r3,sp,36
80154a8: f8 00 0d 51 calli 80189ec <_Objects_Get>
80154ac: b8 20 58 00 mv r11,r1
return RTEMS_INVALID_CLOCK;
the_timer = _Timer_Get( id, &location );
switch ( location ) {
80154b0: 2b 81 00 24 lw r1,(sp+36)
80154b4: 5c 20 00 19 bne r1,r0,8015518 <rtems_timer_server_fire_when+0x120>
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
80154b8: 35 61 00 10 addi r1,r11,16
80154bc: f8 00 16 6c calli 801ae6c <_Watchdog_Remove>
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
80154c0: 34 01 00 03 mvi r1,3
80154c4: 78 05 08 03 mvhi r5,0x803
80154c8: 59 61 00 38 sw (r11+56),r1
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
80154cc: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
80154d0: 59 70 00 2c sw (r11+44),r16
the_watchdog->id = id;
80154d4: 59 6f 00 30 sw (r11+48),r15
the_watchdog->user_data = user_data;
80154d8: 59 71 00 34 sw (r11+52),r17
80154dc: 38 a5 88 cc ori r5,r5,0x88cc
80154e0: 29 81 00 00 lw r1,(r12+0)
80154e4: 29 82 00 04 lw r2,(r12+4)
80154e8: 28 a4 00 00 lw r4,(r5+0)
80154ec: 34 03 00 00 mvi r3,0
80154f0: f8 00 56 91 calli 802af34 <__divdi3>
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
(*timer_server->schedule_operation)( timer_server, the_timer );
80154f4: 29 a3 00 04 lw r3,(r13+4)
case OBJECTS_LOCAL:
(void) _Watchdog_Remove( &the_timer->Ticker );
the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK;
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
80154f8: c9 c2 10 00 sub r2,r14,r2
80154fc: 59 62 00 1c sw (r11+28),r2
(*timer_server->schedule_operation)( timer_server, the_timer );
8015500: b9 a0 08 00 mv r1,r13
8015504: b9 60 10 00 mv r2,r11
8015508: d8 60 00 00 call r3
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
801550c: 34 0b 00 00 mvi r11,0
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch();
(*timer_server->schedule_operation)( timer_server, the_timer );
_Thread_Enable_dispatch();
8015510: f8 00 11 a7 calli 8019bac <_Thread_Enable_dispatch>
return RTEMS_SUCCESSFUL;
8015514: e0 00 00 02 bi 801551c <rtems_timer_server_fire_when+0x124>
#endif
case OBJECTS_ERROR:
break;
}
return RTEMS_INVALID_ID;
8015518: 34 0b 00 04 mvi r11,4
}
801551c: b9 60 08 00 mv r1,r11
8015520: 2b 9d 00 04 lw ra,(sp+4)
8015524: 2b 8b 00 20 lw r11,(sp+32)
8015528: 2b 8c 00 1c lw r12,(sp+28)
801552c: 2b 8d 00 18 lw r13,(sp+24)
8015530: 2b 8e 00 14 lw r14,(sp+20)
8015534: 2b 8f 00 10 lw r15,(sp+16)
8015538: 2b 90 00 0c lw r16,(sp+12)
801553c: 2b 91 00 08 lw r17,(sp+8)
8015540: 37 9c 00 24 addi sp,sp,36
8015544: c3 a0 00 00 ret
080068c0 <rtems_verror>:
static int rtems_verror(
rtems_error_code_t error_flag,
const char *printf_format,
va_list arglist
)
{
80068c0: 37 9c ff e4 addi sp,sp,-28
80068c4: 5b 8b 00 1c sw (sp+28),r11
80068c8: 5b 8c 00 18 sw (sp+24),r12
80068cc: 5b 8d 00 14 sw (sp+20),r13
80068d0: 5b 8e 00 10 sw (sp+16),r14
80068d4: 5b 8f 00 0c sw (sp+12),r15
80068d8: 5b 90 00 08 sw (sp+8),r16
80068dc: 5b 9d 00 04 sw (sp+4),ra
80068e0: b8 20 60 00 mv r12,r1
int local_errno = 0;
int chars_written = 0;
rtems_status_code status;
if (error_flag & RTEMS_ERROR_PANIC) {
80068e4: 78 01 20 00 mvhi r1,0x2000
80068e8: a1 81 08 00 and r1,r12,r1
static int rtems_verror(
rtems_error_code_t error_flag,
const char *printf_format,
va_list arglist
)
{
80068ec: b8 40 80 00 mv r16,r2
80068f0: b8 60 78 00 mv r15,r3
int local_errno = 0;
int chars_written = 0;
rtems_status_code status;
if (error_flag & RTEMS_ERROR_PANIC) {
80068f4: 44 20 00 12 be r1,r0,800693c <rtems_verror+0x7c>
if (rtems_panic_in_progress++)
80068f8: 78 04 08 02 mvhi r4,0x802
80068fc: 38 84 99 38 ori r4,r4,0x9938
8006900: 28 81 00 00 lw r1,(r4+0)
8006904: 34 22 00 01 addi r2,r1,1
8006908: 58 82 00 00 sw (r4+0),r2
800690c: 44 20 00 06 be r1,r0,8006924 <rtems_verror+0x64> <== ALWAYS TAKEN
*
* 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;
8006910: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED
8006914: 38 84 9a 78 ori r4,r4,0x9a78 <== NOT EXECUTED
8006918: 28 81 00 00 lw r1,(r4+0) <== NOT EXECUTED
++level;
800691c: 34 21 00 01 addi r1,r1,1 <== NOT EXECUTED
_Thread_Dispatch_disable_level = level;
8006920: 58 81 00 00 sw (r4+0),r1 <== NOT EXECUTED
_Thread_Disable_dispatch(); /* disable task switches */
/* don't aggravate things */
if (rtems_panic_in_progress > 2)
8006924: 78 01 08 02 mvhi r1,0x802
8006928: 38 21 99 38 ori r1,r1,0x9938
800692c: 28 22 00 00 lw r2,(r1+0)
8006930: 34 01 00 02 mvi r1,2
return 0;
8006934: 34 0b 00 00 mvi r11,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)
8006938: 48 41 00 48 bg r2,r1,8006a58 <rtems_verror+0x198> <== NEVER TAKEN
return 0;
}
(void) fflush(stdout); /* in case stdout/stderr same */
800693c: 78 01 08 02 mvhi r1,0x802
8006940: 38 21 92 88 ori r1,r1,0x9288
8006944: 28 21 00 00 lw r1,(r1+0)
8006948: 28 21 00 08 lw r1,(r1+8)
800694c: f8 00 32 d3 calli 8013498 <fflush>
status = error_flag & ~RTEMS_ERROR_MASK;
8006950: 78 01 08 02 mvhi r1,0x802
8006954: 38 21 73 c8 ori r1,r1,0x73c8
8006958: 28 2e 00 00 lw r14,(r1+0)
if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
800695c: 78 01 40 00 mvhi r1,0x4000
8006960: a1 81 08 00 and r1,r12,r1
return 0;
}
(void) fflush(stdout); /* in case stdout/stderr same */
status = error_flag & ~RTEMS_ERROR_MASK;
8006964: a1 8e 70 00 and r14,r12,r14
rtems_error_code_t error_flag,
const char *printf_format,
va_list arglist
)
{
int local_errno = 0;
8006968: 34 0c 00 00 mvi r12,0
}
(void) fflush(stdout); /* in case stdout/stderr same */
status = error_flag & ~RTEMS_ERROR_MASK;
if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
800696c: 44 20 00 03 be r1,r0,8006978 <rtems_verror+0xb8>
local_errno = errno;
8006970: f8 00 31 ba calli 8013058 <__errno>
8006974: 28 2c 00 00 lw r12,(r1+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);
8006978: 78 0d 08 02 mvhi r13,0x802
800697c: 39 ad 92 88 ori r13,r13,0x9288
8006980: 29 a1 00 00 lw r1,(r13+0)
8006984: ba 00 10 00 mv r2,r16
8006988: b9 e0 18 00 mv r3,r15
800698c: 28 21 00 0c lw r1,(r1+12)
8006990: f8 00 4b fc calli 8019980 <vfprintf>
8006994: b8 20 58 00 mv r11,r1
if (status)
8006998: 45 c0 00 0b be r14,r0,80069c4 <rtems_verror+0x104>
chars_written +=
fprintf(stderr, " (status: %s)", rtems_status_text(status));
800699c: 29 a1 00 00 lw r1,(r13+0)
80069a0: 28 2d 00 0c lw r13,(r1+12)
80069a4: b9 c0 08 00 mv r1,r14
80069a8: fb ff ff bd calli 800689c <rtems_status_text>
80069ac: 78 02 08 02 mvhi r2,0x802
80069b0: b8 20 18 00 mv r3,r1
80069b4: 38 42 70 84 ori r2,r2,0x7084
80069b8: b9 a0 08 00 mv r1,r13
80069bc: f8 00 33 fc calli 80139ac <fprintf>
#endif
chars_written += vfprintf(stderr, printf_format, arglist);
if (status)
chars_written +=
80069c0: b5 61 58 00 add r11,r11,r1
fprintf(stderr, " (status: %s)", rtems_status_text(status));
if (local_errno) {
80069c4: 45 80 00 1a be r12,r0,8006a2c <rtems_verror+0x16c>
if ((local_errno > 0) && *strerror(local_errno))
80069c8: 4c 0c 00 10 bge r0,r12,8006a08 <rtems_verror+0x148>
80069cc: b9 80 08 00 mv r1,r12
80069d0: f8 00 38 93 calli 8014c1c <strerror>
80069d4: 40 21 00 00 lbu r1,(r1+0)
80069d8: 44 20 00 0c be r1,r0,8006a08 <rtems_verror+0x148> <== NEVER TAKEN
chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
80069dc: 78 01 08 02 mvhi r1,0x802
80069e0: 38 21 92 88 ori r1,r1,0x9288
80069e4: 28 21 00 00 lw r1,(r1+0)
80069e8: 28 2d 00 0c lw r13,(r1+12)
80069ec: b9 80 08 00 mv r1,r12
80069f0: f8 00 38 8b calli 8014c1c <strerror>
80069f4: 78 02 08 02 mvhi r2,0x802
80069f8: b8 20 18 00 mv r3,r1
80069fc: 38 42 70 94 ori r2,r2,0x7094
8006a00: b9 a0 08 00 mv r1,r13
8006a04: e0 00 00 08 bi 8006a24 <rtems_verror+0x164>
else
chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
8006a08: 78 01 08 02 mvhi r1,0x802
8006a0c: 38 21 92 88 ori r1,r1,0x9288
8006a10: 28 21 00 00 lw r1,(r1+0)
8006a14: 78 02 08 02 mvhi r2,0x802
8006a18: 38 42 70 a4 ori r2,r2,0x70a4
8006a1c: 28 21 00 0c lw r1,(r1+12)
8006a20: b9 80 18 00 mv r3,r12
8006a24: f8 00 33 e2 calli 80139ac <fprintf>
8006a28: b5 61 58 00 add r11,r11,r1
}
chars_written += fprintf(stderr, "\n");
8006a2c: 78 0c 08 02 mvhi r12,0x802
8006a30: 39 8c 92 88 ori r12,r12,0x9288
8006a34: 29 81 00 00 lw r1,(r12+0)
8006a38: 78 02 08 02 mvhi r2,0x802
8006a3c: 38 42 69 44 ori r2,r2,0x6944
8006a40: 28 21 00 0c lw r1,(r1+12)
8006a44: f8 00 33 da calli 80139ac <fprintf>
8006a48: b4 2b 58 00 add r11,r1,r11
(void) fflush(stderr);
8006a4c: 29 81 00 00 lw r1,(r12+0)
8006a50: 28 21 00 0c lw r1,(r1+12)
8006a54: f8 00 32 91 calli 8013498 <fflush>
return chars_written;
}
8006a58: b9 60 08 00 mv r1,r11
8006a5c: 2b 9d 00 04 lw ra,(sp+4)
8006a60: 2b 8b 00 1c lw r11,(sp+28)
8006a64: 2b 8c 00 18 lw r12,(sp+24)
8006a68: 2b 8d 00 14 lw r13,(sp+20)
8006a6c: 2b 8e 00 10 lw r14,(sp+16)
8006a70: 2b 8f 00 0c lw r15,(sp+12)
8006a74: 2b 90 00 08 lw r16,(sp+8)
8006a78: 37 9c 00 1c addi sp,sp,28
8006a7c: c3 a0 00 00 ret
08023340 <scanInt>:
/**
* Extract an integer value from the database
*/
static int
scanInt(FILE *fp, int *val)
{
8023340: 37 9c ff d4 addi sp,sp,-44
8023344: 5b 8b 00 2c sw (sp+44),r11
8023348: 5b 8c 00 28 sw (sp+40),r12
802334c: 5b 8d 00 24 sw (sp+36),r13
8023350: 5b 8e 00 20 sw (sp+32),r14
8023354: 5b 8f 00 1c sw (sp+28),r15
8023358: 5b 90 00 18 sw (sp+24),r16
802335c: 5b 91 00 14 sw (sp+20),r17
8023360: 5b 92 00 10 sw (sp+16),r18
8023364: 5b 93 00 0c sw (sp+12),r19
8023368: 5b 94 00 08 sw (sp+8),r20
802336c: 5b 9d 00 04 sw (sp+4),ra
8023370: b8 20 58 00 mv r11,r1
int c;
unsigned int i = 0;
unsigned int limit = INT_MAX;
8023374: 78 01 08 05 mvhi r1,0x805
8023378: 38 21 d7 d8 ori r1,r1,0xd7d8
802337c: 28 2e 00 00 lw r14,(r1+0)
int sign = 0;
int d;
for (;;) {
c = getc(fp);
8023380: 78 11 08 06 mvhi r17,0x806
limit++;
continue;
}
sign = 1;
}
if (!isdigit(c))
8023384: 78 10 08 06 mvhi r16,0x806
/**
* Extract an integer value from the database
*/
static int
scanInt(FILE *fp, int *val)
{
8023388: b8 40 90 00 mv r18,r2
int c;
unsigned int i = 0;
unsigned int limit = INT_MAX;
int sign = 0;
802338c: 34 0d 00 00 mvi r13,0
*/
static int
scanInt(FILE *fp, int *val)
{
int c;
unsigned int i = 0;
8023390: 34 0c 00 00 mvi r12,0
unsigned int limit = INT_MAX;
int sign = 0;
int d;
for (;;) {
c = getc(fp);
8023394: 3a 31 6a 58 ori r17,r17,0x6a58
if (c == ':')
8023398: 34 14 00 3a mvi r20,58
limit++;
continue;
}
sign = 1;
}
if (!isdigit(c))
802339c: 3a 10 6a 48 ori r16,r16,0x6a48
for (;;) {
c = getc(fp);
if (c == ':')
break;
if (sign == 0) {
if (c == '-') {
80233a0: 34 13 00 2d mvi r19,45
unsigned int limit = INT_MAX;
int sign = 0;
int d;
for (;;) {
c = getc(fp);
80233a4: 29 61 00 04 lw r1,(r11+4)
80233a8: 34 21 ff ff addi r1,r1,-1
80233ac: 59 61 00 04 sw (r11+4),r1
80233b0: 4c 20 00 06 bge r1,r0,80233c8 <scanInt+0x88> <== ALWAYS TAKEN
80233b4: 2a 21 00 00 lw r1,(r17+0) <== NOT EXECUTED
80233b8: b9 60 10 00 mv r2,r11 <== NOT EXECUTED
80233bc: f8 00 6f 3e calli 803f0b4 <__srget_r> <== NOT EXECUTED
80233c0: b8 20 78 00 mv r15,r1 <== NOT EXECUTED
80233c4: e0 00 00 05 bi 80233d8 <scanInt+0x98> <== NOT EXECUTED
80233c8: 29 61 00 00 lw r1,(r11+0)
80233cc: 40 2f 00 00 lbu r15,(r1+0)
80233d0: 34 21 00 01 addi r1,r1,1
80233d4: 59 61 00 00 sw (r11+0),r1
if (c == ':')
80233d8: 45 f4 00 1f be r15,r20,8023454 <scanInt+0x114>
break;
if (sign == 0) {
80233dc: 5d a0 00 06 bne r13,r0,80233f4 <scanInt+0xb4>
if (c == '-') {
sign = -1;
limit++;
continue;
}
sign = 1;
80233e0: 34 0d 00 01 mvi r13,1
for (;;) {
c = getc(fp);
if (c == ':')
break;
if (sign == 0) {
if (c == '-') {
80233e4: 5d f3 00 04 bne r15,r19,80233f4 <scanInt+0xb4>
sign = -1;
limit++;
80233e8: 35 ce 00 01 addi r14,r14,1
c = getc(fp);
if (c == ':')
break;
if (sign == 0) {
if (c == '-') {
sign = -1;
80233ec: 34 0d ff ff mvi r13,-1
limit++;
continue;
80233f0: e3 ff ff ed bi 80233a4 <scanInt+0x64>
}
sign = 1;
}
if (!isdigit(c))
80233f4: 2a 01 00 00 lw r1,(r16+0)
80233f8: b4 2f 08 00 add r1,r1,r15
80233fc: 40 21 00 01 lbu r1,(r1+1)
8023400: 20 21 00 04 andi r1,r1,0x4
8023404: 44 20 00 1c be r1,r0,8023474 <scanInt+0x134>
return 0;
d = c - '0';
if ((i > (limit / 10))
8023408: b9 c0 08 00 mv r1,r14
802340c: 34 02 00 0a mvi r2,10
8023410: f8 00 d5 0b calli 805883c <__udivsi3>
8023414: 55 81 00 18 bgu r12,r1,8023474 <scanInt+0x134>
}
sign = 1;
}
if (!isdigit(c))
return 0;
d = c - '0';
8023418: 35 ef ff d0 addi r15,r15,-48
if ((i > (limit / 10))
|| ((i == (limit / 10)) && (d > (limit % 10))))
802341c: 5d 81 00 05 bne r12,r1,8023430 <scanInt+0xf0>
8023420: b9 c0 08 00 mv r1,r14
8023424: 34 02 00 0a mvi r2,10
8023428: f8 00 d5 15 calli 805887c <__umodsi3>
802342c: 55 e1 00 12 bgu r15,r1,8023474 <scanInt+0x134> <== ALWAYS TAKEN
return 0;
i = i * 10 + d;
8023430: b9 80 08 00 mv r1,r12
8023434: 34 02 00 01 mvi r2,1
8023438: fb ff 73 70 calli 80001f8 <__ashlsi3>
802343c: 34 02 00 02 mvi r2,2
8023440: b8 20 60 00 mv r12,r1
8023444: fb ff 73 6d calli 80001f8 <__ashlsi3>
8023448: b5 81 08 00 add r1,r12,r1
802344c: b5 e1 60 00 add r12,r15,r1
8023450: e3 ff ff d5 bi 80233a4 <scanInt+0x64>
}
if (sign == 0)
return 0;
8023454: 34 03 00 00 mvi r3,0
if ((i > (limit / 10))
|| ((i == (limit / 10)) && (d > (limit % 10))))
return 0;
i = i * 10 + d;
}
if (sign == 0)
8023458: 45 a0 00 08 be r13,r0,8023478 <scanInt+0x138> <== NEVER TAKEN
return 0;
*val = i * sign;
802345c: b9 a0 08 00 mv r1,r13
8023460: b9 80 10 00 mv r2,r12
8023464: f8 00 d4 91 calli 80586a8 <__mulsi3>
8023468: 5a 41 00 00 sw (r18+0),r1
return 1;
802346c: 34 03 00 01 mvi r3,1
8023470: e0 00 00 02 bi 8023478 <scanInt+0x138>
if (!isdigit(c))
return 0;
d = c - '0';
if ((i > (limit / 10))
|| ((i == (limit / 10)) && (d > (limit % 10))))
return 0;
8023474: 34 03 00 00 mvi r3,0
}
if (sign == 0)
return 0;
*val = i * sign;
return 1;
}
8023478: b8 60 08 00 mv r1,r3
802347c: 2b 9d 00 04 lw ra,(sp+4)
8023480: 2b 8b 00 2c lw r11,(sp+44)
8023484: 2b 8c 00 28 lw r12,(sp+40)
8023488: 2b 8d 00 24 lw r13,(sp+36)
802348c: 2b 8e 00 20 lw r14,(sp+32)
8023490: 2b 8f 00 1c lw r15,(sp+28)
8023494: 2b 90 00 18 lw r16,(sp+24)
8023498: 2b 91 00 14 lw r17,(sp+20)
802349c: 2b 92 00 10 lw r18,(sp+16)
80234a0: 2b 93 00 0c lw r19,(sp+12)
80234a4: 2b 94 00 08 lw r20,(sp+8)
80234a8: 37 9c 00 2c addi sp,sp,44
80234ac: c3 a0 00 00 ret
080235e8 <scangr>:
FILE *fp,
struct group *grp,
char *buffer,
size_t bufsize
)
{
80235e8: 37 9c ff d8 addi sp,sp,-40
80235ec: 5b 8b 00 18 sw (sp+24),r11
80235f0: 5b 8c 00 14 sw (sp+20),r12
80235f4: 5b 8d 00 10 sw (sp+16),r13
80235f8: 5b 8e 00 0c sw (sp+12),r14
80235fc: 5b 8f 00 08 sw (sp+8),r15
8023600: 5b 9d 00 04 sw (sp+4),ra
int grgid;
char *grmem, *cp;
int memcount;
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
8023604: 37 8e 00 20 addi r14,sp,32
8023608: 37 8d 00 1c addi r13,sp,28
FILE *fp,
struct group *grp,
char *buffer,
size_t bufsize
)
{
802360c: 5b 83 00 20 sw (sp+32),r3
8023610: 5b 84 00 1c sw (sp+28),r4
int grgid;
char *grmem, *cp;
int memcount;
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
8023614: b9 c0 18 00 mv r3,r14
8023618: b9 a0 20 00 mv r4,r13
802361c: 34 05 00 00 mvi r5,0
FILE *fp,
struct group *grp,
char *buffer,
size_t bufsize
)
{
8023620: b8 20 78 00 mv r15,r1
8023624: b8 40 58 00 mv r11,r2
int grgid;
char *grmem, *cp;
int memcount;
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
8023628: fb ff ff a2 calli 80234b0 <scanString>
|| !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0)
|| !scanInt(fp, &grgid)
|| !scanString(fp, &grmem, &buffer, &bufsize, 1))
return 0;
802362c: 34 0c 00 00 mvi r12,0
{
int grgid;
char *grmem, *cp;
int memcount;
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
8023630: 44 20 00 43 be r1,r0,802373c <scangr+0x154>
|| !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0)
8023634: b9 e0 08 00 mv r1,r15
8023638: 35 62 00 04 addi r2,r11,4
802363c: b9 c0 18 00 mv r3,r14
8023640: b9 a0 20 00 mv r4,r13
8023644: 34 05 00 00 mvi r5,0
8023648: fb ff ff 9a calli 80234b0 <scanString>
802364c: 44 20 00 3c be r1,r0,802373c <scangr+0x154> <== NEVER TAKEN
|| !scanInt(fp, &grgid)
8023650: b9 e0 08 00 mv r1,r15
8023654: 37 82 00 28 addi r2,sp,40
8023658: fb ff ff 3a calli 8023340 <scanInt>
802365c: 44 20 00 38 be r1,r0,802373c <scangr+0x154> <== NEVER TAKEN
|| !scanString(fp, &grmem, &buffer, &bufsize, 1))
8023660: b9 e0 08 00 mv r1,r15
8023664: 37 82 00 24 addi r2,sp,36
8023668: b9 c0 18 00 mv r3,r14
802366c: b9 a0 20 00 mv r4,r13
8023670: 34 05 00 01 mvi r5,1
8023674: fb ff ff 8f calli 80234b0 <scanString>
8023678: 44 20 00 31 be r1,r0,802373c <scangr+0x154> <== NEVER TAKEN
return 0;
grp->gr_gid = grgid;
802367c: 2b 81 00 28 lw r1,(sp+40)
/*
* Determine number of members
*/
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
8023680: 2b 8d 00 24 lw r13,(sp+36)
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;
8023684: 0d 61 00 08 sh (r11+8),r1
/*
* Determine number of members
*/
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
8023688: b9 a0 10 00 mv r2,r13
802368c: 34 01 00 01 mvi r1,1
8023690: e0 00 00 04 bi 80236a0 <scangr+0xb8>
if(*cp == ',')
memcount++;
8023694: 64 63 00 2c cmpei r3,r3,44
grp->gr_gid = grgid;
/*
* Determine number of members
*/
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
8023698: 34 42 00 01 addi r2,r2,1
if(*cp == ',')
memcount++;
802369c: b4 23 08 00 add r1,r1,r3
grp->gr_gid = grgid;
/*
* Determine number of members
*/
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
80236a0: 40 43 00 00 lbu r3,(r2+0)
80236a4: 5c 60 ff fc bne r3,r0,8023694 <scangr+0xac>
}
/*
* Hack to produce (hopefully) a suitably-aligned array of pointers
*/
if (bufsize < (((memcount+1)*sizeof(char *)) + 15))
80236a8: 34 02 00 02 mvi r2,2
80236ac: 34 21 00 01 addi r1,r1,1
80236b0: fb ff 72 d2 calli 80001f8 <__ashlsi3>
80236b4: 2b 82 00 1c lw r2,(sp+28)
80236b8: 34 21 00 0f addi r1,r1,15
return 0;
80236bc: 34 0c 00 00 mvi r12,0
}
/*
* Hack to produce (hopefully) a suitably-aligned array of pointers
*/
if (bufsize < (((memcount+1)*sizeof(char *)) + 15))
80236c0: 54 22 00 1f bgu r1,r2,802373c <scangr+0x154> <== NEVER TAKEN
return 0;
grp->gr_mem = (char **)(((uintptr_t)buffer + 15) & ~15);
80236c4: 2b 81 00 20 lw r1,(sp+32)
80236c8: 34 02 ff f0 mvi r2,-16
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
if(*cp == ',') {
80236cc: 34 0e 00 2c mvi r14,44
/*
* Hack to produce (hopefully) a suitably-aligned array of pointers
*/
if (bufsize < (((memcount+1)*sizeof(char *)) + 15))
return 0;
grp->gr_mem = (char **)(((uintptr_t)buffer + 15) & ~15);
80236d0: 34 21 00 0f addi r1,r1,15
80236d4: a0 22 08 00 and r1,r1,r2
80236d8: 59 61 00 0c sw (r11+12),r1
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
80236dc: 58 2d 00 00 sw (r1+0),r13
}
/**
* Extract a single group record from the database
*/
static int scangr(
80236e0: 2b 8c 00 24 lw r12,(sp+36)
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
80236e4: 34 0d 00 01 mvi r13,1
}
/**
* Extract a single group record from the database
*/
static int scangr(
80236e8: 35 8c 00 01 addi r12,r12,1
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
80236ec: e0 00 00 0b bi 8023718 <scangr+0x130>
if(*cp == ',') {
80236f0: 5c 2e 00 09 bne r1,r14,8023714 <scangr+0x12c>
*cp = '\0';
80236f4: 31 80 ff ff sb (r12+-1),r0
grp->gr_mem[memcount++] = cp + 1;
80236f8: 29 6f 00 0c lw r15,(r11+12)
80236fc: b9 a0 08 00 mv r1,r13
8023700: 34 02 00 02 mvi r2,2
8023704: fb ff 72 bd calli 80001f8 <__ashlsi3>
8023708: b5 e1 08 00 add r1,r15,r1
802370c: 58 2c 00 00 sw (r1+0),r12
8023710: 35 ad 00 01 addi r13,r13,1
8023714: 35 8c 00 01 addi r12,r12,1
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
8023718: 41 81 ff ff lbu r1,(r12+-1)
802371c: 5c 20 ff f5 bne r1,r0,80236f0 <scangr+0x108>
if(*cp == ',') {
*cp = '\0';
grp->gr_mem[memcount++] = cp + 1;
}
}
grp->gr_mem[memcount] = NULL;
8023720: 29 6b 00 0c lw r11,(r11+12)
8023724: b9 a0 08 00 mv r1,r13
8023728: 34 02 00 02 mvi r2,2
802372c: fb ff 72 b3 calli 80001f8 <__ashlsi3>
8023730: b5 61 08 00 add r1,r11,r1
8023734: 58 20 00 00 sw (r1+0),r0
return 1;
8023738: 34 0c 00 01 mvi r12,1
}
802373c: b9 80 08 00 mv r1,r12
8023740: 2b 9d 00 04 lw ra,(sp+4)
8023744: 2b 8b 00 18 lw r11,(sp+24)
8023748: 2b 8c 00 14 lw r12,(sp+20)
802374c: 2b 8d 00 10 lw r13,(sp+16)
8023750: 2b 8e 00 0c lw r14,(sp+12)
8023754: 2b 8f 00 08 lw r15,(sp+8)
8023758: 37 9c 00 28 addi sp,sp,40
802375c: c3 a0 00 00 ret
08023760 <scanpw>:
FILE *fp,
struct passwd *pwd,
char *buffer,
size_t bufsize
)
{
8023760: 37 9c ff d8 addi sp,sp,-40
8023764: 5b 8b 00 18 sw (sp+24),r11
8023768: 5b 8c 00 14 sw (sp+20),r12
802376c: 5b 8d 00 10 sw (sp+16),r13
8023770: 5b 8e 00 0c sw (sp+12),r14
8023774: 5b 8f 00 08 sw (sp+8),r15
8023778: 5b 9d 00 04 sw (sp+4),ra
int pwuid, pwgid;
if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0)
802377c: 37 8e 00 20 addi r14,sp,32
8023780: 37 8d 00 1c addi r13,sp,28
FILE *fp,
struct passwd *pwd,
char *buffer,
size_t bufsize
)
{
8023784: 5b 83 00 20 sw (sp+32),r3
8023788: 5b 84 00 1c sw (sp+28),r4
int pwuid, pwgid;
if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0)
802378c: b9 c0 18 00 mv r3,r14
8023790: b9 a0 20 00 mv r4,r13
8023794: 34 05 00 00 mvi r5,0
FILE *fp,
struct passwd *pwd,
char *buffer,
size_t bufsize
)
{
8023798: b8 20 60 00 mv r12,r1
802379c: b8 40 58 00 mv r11,r2
int pwuid, pwgid;
if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0)
80237a0: fb ff ff 44 calli 80234b0 <scanString>
|| !scanInt(fp, &pwgid)
|| !scanString(fp, &pwd->pw_comment, &buffer, &bufsize, 0)
|| !scanString(fp, &pwd->pw_gecos, &buffer, &bufsize, 0)
|| !scanString(fp, &pwd->pw_dir, &buffer, &bufsize, 0)
|| !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1))
return 0;
80237a4: 34 0f 00 00 mvi r15,0
size_t bufsize
)
{
int pwuid, pwgid;
if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0)
80237a8: 44 20 00 31 be r1,r0,802386c <scanpw+0x10c>
|| !scanString(fp, &pwd->pw_passwd, &buffer, &bufsize, 0)
80237ac: b9 80 08 00 mv r1,r12
80237b0: 35 62 00 04 addi r2,r11,4
80237b4: b9 c0 18 00 mv r3,r14
80237b8: b9 a0 20 00 mv r4,r13
80237bc: 34 05 00 00 mvi r5,0
80237c0: fb ff ff 3c calli 80234b0 <scanString>
80237c4: 44 20 00 2a be r1,r0,802386c <scanpw+0x10c> <== NEVER TAKEN
|| !scanInt(fp, &pwuid)
80237c8: b9 80 08 00 mv r1,r12
80237cc: 37 82 00 28 addi r2,sp,40
80237d0: fb ff fe dc calli 8023340 <scanInt>
80237d4: 44 20 00 26 be r1,r0,802386c <scanpw+0x10c>
|| !scanInt(fp, &pwgid)
80237d8: b9 80 08 00 mv r1,r12
80237dc: 37 82 00 24 addi r2,sp,36
80237e0: fb ff fe d8 calli 8023340 <scanInt>
80237e4: 44 20 00 22 be r1,r0,802386c <scanpw+0x10c>
|| !scanString(fp, &pwd->pw_comment, &buffer, &bufsize, 0)
80237e8: b9 80 08 00 mv r1,r12
80237ec: 35 62 00 0c addi r2,r11,12
80237f0: b9 c0 18 00 mv r3,r14
80237f4: b9 a0 20 00 mv r4,r13
80237f8: 34 05 00 00 mvi r5,0
80237fc: fb ff ff 2d calli 80234b0 <scanString>
8023800: 44 20 00 1b be r1,r0,802386c <scanpw+0x10c> <== NEVER TAKEN
|| !scanString(fp, &pwd->pw_gecos, &buffer, &bufsize, 0)
8023804: b9 80 08 00 mv r1,r12
8023808: 35 62 00 10 addi r2,r11,16
802380c: b9 c0 18 00 mv r3,r14
8023810: b9 a0 20 00 mv r4,r13
8023814: 34 05 00 00 mvi r5,0
8023818: fb ff ff 26 calli 80234b0 <scanString>
802381c: 44 20 00 14 be r1,r0,802386c <scanpw+0x10c> <== NEVER TAKEN
|| !scanString(fp, &pwd->pw_dir, &buffer, &bufsize, 0)
8023820: b9 80 08 00 mv r1,r12
8023824: 35 62 00 14 addi r2,r11,20
8023828: b9 c0 18 00 mv r3,r14
802382c: b9 a0 20 00 mv r4,r13
8023830: 34 05 00 00 mvi r5,0
8023834: fb ff ff 1f calli 80234b0 <scanString>
8023838: 44 20 00 0d be r1,r0,802386c <scanpw+0x10c> <== NEVER TAKEN
|| !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1))
802383c: b9 80 08 00 mv r1,r12
8023840: 35 62 00 18 addi r2,r11,24
8023844: b9 c0 18 00 mv r3,r14
8023848: b9 a0 20 00 mv r4,r13
802384c: 34 05 00 01 mvi r5,1
8023850: fb ff ff 18 calli 80234b0 <scanString>
8023854: 44 20 00 06 be r1,r0,802386c <scanpw+0x10c>
return 0;
pwd->pw_uid = pwuid;
8023858: 2b 81 00 28 lw r1,(sp+40)
pwd->pw_gid = pwgid;
return 1;
802385c: 34 0f 00 01 mvi r15,1
|| !scanString(fp, &pwd->pw_comment, &buffer, &bufsize, 0)
|| !scanString(fp, &pwd->pw_gecos, &buffer, &bufsize, 0)
|| !scanString(fp, &pwd->pw_dir, &buffer, &bufsize, 0)
|| !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1))
return 0;
pwd->pw_uid = pwuid;
8023860: 0d 61 00 08 sh (r11+8),r1
pwd->pw_gid = pwgid;
8023864: 2b 81 00 24 lw r1,(sp+36)
8023868: 0d 61 00 0a sh (r11+10),r1
return 1;
}
802386c: b9 e0 08 00 mv r1,r15
8023870: 2b 9d 00 04 lw ra,(sp+4)
8023874: 2b 8b 00 18 lw r11,(sp+24)
8023878: 2b 8c 00 14 lw r12,(sp+20)
802387c: 2b 8d 00 10 lw r13,(sp+16)
8023880: 2b 8e 00 0c lw r14,(sp+12)
8023884: 2b 8f 00 08 lw r15,(sp+8)
8023888: 37 9c 00 28 addi sp,sp,40
802388c: c3 a0 00 00 ret
080041dc <sched_get_priority_max>:
#include <rtems/posix/priority.h>
int sched_get_priority_max(
int policy
)
{
80041dc: 37 9c ff fc addi sp,sp,-4
80041e0: 5b 9d 00 04 sw (sp+4),ra
switch ( policy ) {
80041e4: 48 01 00 05 bg r0,r1,80041f8 <sched_get_priority_max+0x1c>
80041e8: 34 02 00 02 mvi r2,2
80041ec: 4c 41 00 08 bge r2,r1,800420c <sched_get_priority_max+0x30>
80041f0: 34 02 00 04 mvi r2,4
80041f4: 44 22 00 06 be r1,r2,800420c <sched_get_priority_max+0x30> <== ALWAYS TAKEN
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
80041f8: f8 00 24 1a calli 800d260 <__errno>
80041fc: 34 02 00 16 mvi r2,22
8004200: 58 22 00 00 sw (r1+0),r2
8004204: 34 01 ff ff mvi r1,-1
8004208: e0 00 00 05 bi 800421c <sched_get_priority_max+0x40>
}
return POSIX_SCHEDULER_MAXIMUM_PRIORITY;
800420c: 78 01 08 02 mvhi r1,0x802
8004210: 38 21 00 fc ori r1,r1,0xfc
8004214: 40 21 00 00 lbu r1,(r1+0)
8004218: 34 21 ff ff addi r1,r1,-1
}
800421c: 2b 9d 00 04 lw ra,(sp+4)
8004220: 37 9c 00 04 addi sp,sp,4
8004224: c3 a0 00 00 ret
08004228 <sched_get_priority_min>:
* 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258
*/
int sched_get_priority_min(
int policy
)
{
8004228: 37 9c ff fc addi sp,sp,-4
800422c: 5b 9d 00 04 sw (sp+4),ra
switch ( policy ) {
8004230: 48 01 00 05 bg r0,r1,8004244 <sched_get_priority_min+0x1c>
8004234: 34 02 00 02 mvi r2,2
8004238: 4c 41 00 08 bge r2,r1,8004258 <sched_get_priority_min+0x30><== ALWAYS TAKEN
800423c: 34 02 00 04 mvi r2,4 <== NOT EXECUTED
8004240: 44 22 00 06 be r1,r2,8004258 <sched_get_priority_min+0x30> <== NOT EXECUTED
case SCHED_RR:
case SCHED_SPORADIC:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
8004244: f8 00 24 07 calli 800d260 <__errno>
8004248: 34 02 00 16 mvi r2,22
800424c: 58 22 00 00 sw (r1+0),r2
8004250: 34 01 ff ff mvi r1,-1
8004254: e0 00 00 02 bi 800425c <sched_get_priority_min+0x34>
}
return POSIX_SCHEDULER_MINIMUM_PRIORITY;
8004258: 34 01 00 01 mvi r1,1
}
800425c: 2b 9d 00 04 lw ra,(sp+4)
8004260: 37 9c 00 04 addi sp,sp,4
8004264: c3 a0 00 00 ret
08004268 <sched_rr_get_interval>:
int sched_rr_get_interval(
pid_t pid,
struct timespec *interval
)
{
8004268: 37 9c ff f4 addi sp,sp,-12
800426c: 5b 8b 00 08 sw (sp+8),r11
8004270: 5b 9d 00 04 sw (sp+4),ra
8004274: b8 20 58 00 mv r11,r1
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid && pid != getpid() )
8004278: 44 20 00 08 be r1,r0,8004298 <sched_rr_get_interval+0x30> <== NEVER TAKEN
800427c: 5b 82 00 0c sw (sp+12),r2
8004280: fb ff f5 c6 calli 8001998 <getpid>
8004284: 2b 82 00 0c lw r2,(sp+12)
8004288: 45 61 00 04 be r11,r1,8004298 <sched_rr_get_interval+0x30>
rtems_set_errno_and_return_minus_one( ESRCH );
800428c: f8 00 23 f5 calli 800d260 <__errno>
8004290: 34 02 00 03 mvi r2,3
8004294: e0 00 00 04 bi 80042a4 <sched_rr_get_interval+0x3c>
if ( !interval )
8004298: 5c 40 00 06 bne r2,r0,80042b0 <sched_rr_get_interval+0x48>
rtems_set_errno_and_return_minus_one( EINVAL );
800429c: f8 00 23 f1 calli 800d260 <__errno>
80042a0: 34 02 00 16 mvi r2,22
80042a4: 58 22 00 00 sw (r1+0),r2
80042a8: 34 01 ff ff mvi r1,-1
80042ac: e0 00 00 06 bi 80042c4 <sched_rr_get_interval+0x5c>
_Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval );
80042b0: 78 01 08 02 mvhi r1,0x802
80042b4: 38 21 08 80 ori r1,r1,0x880
80042b8: 28 21 00 00 lw r1,(r1+0)
80042bc: f8 00 0e ee calli 8007e74 <_Timespec_From_ticks>
return 0;
80042c0: 34 01 00 00 mvi r1,0
}
80042c4: 2b 9d 00 04 lw ra,(sp+4)
80042c8: 2b 8b 00 08 lw r11,(sp+8)
80042cc: 37 9c 00 0c addi sp,sp,12
80042d0: c3 a0 00 00 ret
08004d0c <sem_open>:
int oflag,
...
/* mode_t mode, */
/* unsigned int value */
)
{
8004d0c: 37 9c ff b8 addi sp,sp,-72
8004d10: 5b 8b 00 1c sw (sp+28),r11
8004d14: 5b 8c 00 18 sw (sp+24),r12
8004d18: 5b 8d 00 14 sw (sp+20),r13
8004d1c: 5b 8e 00 10 sw (sp+16),r14
8004d20: 5b 8f 00 0c sw (sp+12),r15
8004d24: 5b 90 00 08 sw (sp+8),r16
8004d28: 5b 9d 00 04 sw (sp+4),ra
8004d2c: 5b 83 00 34 sw (sp+52),r3
*
* 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;
8004d30: 78 03 08 02 mvhi r3,0x802
8004d34: 5b 82 00 30 sw (sp+48),r2
8004d38: 5b 84 00 38 sw (sp+56),r4
8004d3c: 5b 85 00 3c sw (sp+60),r5
8004d40: 5b 86 00 40 sw (sp+64),r6
8004d44: 5b 87 00 44 sw (sp+68),r7
8004d48: 5b 88 00 48 sw (sp+72),r8
8004d4c: 38 63 43 28 ori r3,r3,0x4328
8004d50: b8 20 70 00 mv r14,r1
8004d54: 28 61 00 00 lw r1,(r3+0)
8004d58: b8 40 78 00 mv r15,r2
++level;
8004d5c: 34 21 00 01 addi r1,r1,1
_Thread_Dispatch_disable_level = level;
8004d60: 58 61 00 00 sw (r3+0),r1
Objects_Locations location;
size_t name_len;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
8004d64: 20 50 02 00 andi r16,r2,0x200
/* unsigned int value */
)
{
va_list arg;
mode_t mode;
unsigned int value = 0;
8004d68: 34 0d 00 00 mvi r13,0
Objects_Locations location;
size_t name_len;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
8004d6c: 46 00 00 02 be r16,r0,8004d74 <sem_open+0x68>
va_start(arg, oflag);
mode = va_arg( arg, mode_t );
value = va_arg( arg, unsigned int );
8004d70: 2b 8d 00 38 lw r13,(sp+56)
const char *name,
Objects_Id *id,
size_t *len
)
{
return _POSIX_Name_to_id( &_POSIX_Semaphore_Information, name, id, len );
8004d74: 78 0b 08 02 mvhi r11,0x802
8004d78: 39 6b 45 64 ori r11,r11,0x4564
8004d7c: b9 60 08 00 mv r1,r11
8004d80: b9 c0 10 00 mv r2,r14
8004d84: 37 83 00 2c addi r3,sp,44
8004d88: 37 84 00 20 addi r4,sp,32
8004d8c: fb ff fe 09 calli 80045b0 <_POSIX_Name_to_id>
8004d90: b8 20 60 00 mv r12,r1
* 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 ) {
8004d94: 44 20 00 08 be r1,r0,8004db4 <sem_open+0xa8>
/*
* 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) ) ) {
8004d98: 34 01 00 02 mvi r1,2
8004d9c: 5d 81 00 02 bne r12,r1,8004da4 <sem_open+0x98>
8004da0: 5e 00 00 19 bne r16,r0,8004e04 <sem_open+0xf8>
_Thread_Enable_dispatch();
8004da4: f8 00 0e 6c calli 8008754 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( status, sem_t * );
8004da8: f8 00 28 4e calli 800eee0 <__errno>
8004dac: 58 2c 00 00 sw (r1+0),r12
8004db0: e0 00 00 08 bi 8004dd0 <sem_open+0xc4>
/*
* Check for existence with creation.
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
8004db4: 21 ef 0a 00 andi r15,r15,0xa00
8004db8: 34 01 0a 00 mvi r1,2560
8004dbc: 5d e1 00 07 bne r15,r1,8004dd8 <sem_open+0xcc>
_Thread_Enable_dispatch();
8004dc0: f8 00 0e 65 calli 8008754 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
8004dc4: f8 00 28 47 calli 800eee0 <__errno>
8004dc8: 34 02 00 11 mvi r2,17
8004dcc: 58 22 00 00 sw (r1+0),r2
8004dd0: 34 01 ff ff mvi r1,-1
8004dd4: e0 00 00 18 bi 8004e34 <sem_open+0x128>
sem_t *id,
Objects_Locations *location
)
{
return (POSIX_Semaphore_Control *)
_Objects_Get( &_POSIX_Semaphore_Information, (Objects_Id)*id, location );
8004dd8: 2b 82 00 2c lw r2,(sp+44)
8004ddc: 37 83 00 24 addi r3,sp,36
8004de0: b9 60 08 00 mv r1,r11
8004de4: f8 00 0a 48 calli 8007704 <_Objects_Get>
}
the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location );
the_semaphore->open_count += 1;
8004de8: 28 22 00 18 lw r2,(r1+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 );
8004dec: 5b 81 00 28 sw (sp+40),r1
the_semaphore->open_count += 1;
8004df0: 34 42 00 01 addi r2,r2,1
8004df4: 58 22 00 18 sw (r1+24),r2
_Thread_Enable_dispatch();
8004df8: f8 00 0e 57 calli 8008754 <_Thread_Enable_dispatch>
_Thread_Enable_dispatch();
8004dfc: f8 00 0e 56 calli 8008754 <_Thread_Enable_dispatch>
goto return_id;
8004e00: e0 00 00 0b bi 8004e2c <sem_open+0x120>
/*
* 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(
8004e04: 2b 82 00 20 lw r2,(sp+32)
8004e08: 34 03 00 00 mvi r3,0
8004e0c: b9 a0 20 00 mv r4,r13
8004e10: 37 85 00 28 addi r5,sp,40
8004e14: b9 c0 08 00 mv r1,r14
8004e18: f8 00 1c 35 calli 800beec <_POSIX_Semaphore_Create_support>
8004e1c: b8 20 58 00 mv r11,r1
/*
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
8004e20: f8 00 0e 4d calli 8008754 <_Thread_Enable_dispatch>
if ( status == -1 )
return SEM_FAILED;
8004e24: 34 01 ff ff mvi r1,-1
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
if ( status == -1 )
8004e28: 45 61 00 03 be r11,r1,8004e34 <sem_open+0x128> <== NEVER TAKEN
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;
8004e2c: 2b 81 00 28 lw r1,(sp+40)
8004e30: 34 21 00 08 addi r1,r1,8
#endif
}
8004e34: 2b 9d 00 04 lw ra,(sp+4)
8004e38: 2b 8b 00 1c lw r11,(sp+28)
8004e3c: 2b 8c 00 18 lw r12,(sp+24)
8004e40: 2b 8d 00 14 lw r13,(sp+20)
8004e44: 2b 8e 00 10 lw r14,(sp+16)
8004e48: 2b 8f 00 0c lw r15,(sp+12)
8004e4c: 2b 90 00 08 lw r16,(sp+8)
8004e50: 37 9c 00 48 addi sp,sp,72
8004e54: c3 a0 00 00 ret
08004140 <sigaction>:
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
8004140: 37 9c ff ec addi sp,sp,-20
8004144: 5b 8b 00 14 sw (sp+20),r11
8004148: 5b 8c 00 10 sw (sp+16),r12
800414c: 5b 8d 00 0c sw (sp+12),r13
8004150: 5b 8e 00 08 sw (sp+8),r14
8004154: 5b 9d 00 04 sw (sp+4),ra
8004158: b8 20 58 00 mv r11,r1
800415c: b8 40 60 00 mv r12,r2
8004160: b8 60 68 00 mv r13,r3
ISR_Level level;
if ( oact )
8004164: 44 60 00 0f be r3,r0,80041a0 <sigaction+0x60>
*oact = _POSIX_signals_Vectors[ sig ];
8004168: 34 02 00 01 mvi r2,1
800416c: f8 00 46 0b calli 8015998 <__ashlsi3>
8004170: 34 02 00 02 mvi r2,2
8004174: 78 0e 08 01 mvhi r14,0x801
8004178: b4 2b 08 00 add r1,r1,r11
800417c: f8 00 46 07 calli 8015998 <__ashlsi3>
8004180: 39 ce 8e 48 ori r14,r14,0x8e48
8004184: b5 c1 08 00 add r1,r14,r1
8004188: 28 23 00 00 lw r3,(r1+0)
800418c: 28 22 00 04 lw r2,(r1+4)
8004190: 28 21 00 08 lw r1,(r1+8)
8004194: 59 a3 00 00 sw (r13+0),r3
8004198: 59 a2 00 04 sw (r13+4),r2
800419c: 59 a1 00 08 sw (r13+8),r1
if ( !sig )
80041a0: 45 60 00 07 be r11,r0,80041bc <sigaction+0x7c>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
80041a4: 35 61 ff ff addi r1,r11,-1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
80041a8: 34 02 00 1f mvi r2,31
80041ac: 50 41 00 02 bgeu r2,r1,80041b4 <sigaction+0x74>
80041b0: e0 00 00 03 bi 80041bc <sigaction+0x7c>
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
80041b4: 34 01 00 09 mvi r1,9
80041b8: 5d 61 00 06 bne r11,r1,80041d0 <sigaction+0x90>
rtems_set_errno_and_return_minus_one( EINVAL );
80041bc: f8 00 25 80 calli 800d7bc <__errno>
80041c0: 34 02 00 16 mvi r2,22
80041c4: 58 22 00 00 sw (r1+0),r2
80041c8: 34 01 ff ff mvi r1,-1
80041cc: e0 00 00 31 bi 8004290 <sigaction+0x150>
* 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;
80041d0: 34 01 00 00 mvi r1,0
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
80041d4: 45 80 00 2f be r12,r0,8004290 <sigaction+0x150> <== NEVER TAKEN
/*
* Unless the user is installing the default signal actions, then
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
80041d8: 90 00 70 00 rcsr r14,IE
80041dc: 34 01 ff fe mvi r1,-2
80041e0: a1 c1 08 00 and r1,r14,r1
80041e4: d0 01 00 00 wcsr IE,r1
if ( act->sa_handler == SIG_DFL ) {
80041e8: 29 81 00 08 lw r1,(r12+8)
80041ec: 78 0d 08 01 mvhi r13,0x801
80041f0: 39 ad 8e 48 ori r13,r13,0x8e48
80041f4: 5c 20 00 16 bne r1,r0,800424c <sigaction+0x10c>
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
80041f8: b9 60 08 00 mv r1,r11
80041fc: 34 02 00 01 mvi r2,1
8004200: f8 00 45 e6 calli 8015998 <__ashlsi3>
8004204: b4 2b 58 00 add r11,r1,r11
8004208: 34 02 00 02 mvi r2,2
800420c: b9 60 08 00 mv r1,r11
8004210: f8 00 45 e2 calli 8015998 <__ashlsi3>
8004214: b5 a1 68 00 add r13,r13,r1
8004218: 34 02 00 02 mvi r2,2
800421c: 78 0c 08 01 mvhi r12,0x801
8004220: b9 60 08 00 mv r1,r11
8004224: f8 00 45 dd calli 8015998 <__ashlsi3>
8004228: 39 8c 73 58 ori r12,r12,0x7358
800422c: b5 81 08 00 add r1,r12,r1
8004230: 28 23 00 00 lw r3,(r1+0)
8004234: 28 22 00 04 lw r2,(r1+4)
8004238: 28 21 00 08 lw r1,(r1+8)
800423c: 59 a3 00 00 sw (r13+0),r3
8004240: 59 a2 00 04 sw (r13+4),r2
8004244: 59 a1 00 08 sw (r13+8),r1
8004248: e0 00 00 10 bi 8004288 <sigaction+0x148>
} else {
_POSIX_signals_Clear_process_signals( sig );
800424c: b9 60 08 00 mv r1,r11
8004250: f8 00 17 b9 calli 800a134 <_POSIX_signals_Clear_process_signals>
_POSIX_signals_Vectors[ sig ] = *act;
8004254: 34 02 00 01 mvi r2,1
8004258: b9 60 08 00 mv r1,r11
800425c: f8 00 45 cf calli 8015998 <__ashlsi3>
8004260: 34 02 00 02 mvi r2,2
8004264: b4 2b 08 00 add r1,r1,r11
8004268: f8 00 45 cc calli 8015998 <__ashlsi3>
800426c: 29 83 00 00 lw r3,(r12+0)
8004270: 29 82 00 04 lw r2,(r12+4)
8004274: 29 84 00 08 lw r4,(r12+8)
8004278: b5 a1 08 00 add r1,r13,r1
800427c: 58 23 00 00 sw (r1+0),r3
8004280: 58 22 00 04 sw (r1+4),r2
8004284: 58 24 00 08 sw (r1+8),r4
}
_ISR_Enable( level );
8004288: d0 0e 00 00 wcsr IE,r14
* 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;
800428c: 34 01 00 00 mvi r1,0
}
8004290: 2b 9d 00 04 lw ra,(sp+4)
8004294: 2b 8b 00 14 lw r11,(sp+20)
8004298: 2b 8c 00 10 lw r12,(sp+16)
800429c: 2b 8d 00 0c lw r13,(sp+12)
80042a0: 2b 8e 00 08 lw r14,(sp+8)
80042a4: 37 9c 00 14 addi sp,sp,20
80042a8: c3 a0 00 00 ret
080047b8 <sigtimedwait>:
int sigtimedwait(
const sigset_t *set,
siginfo_t *info,
const struct timespec *timeout
)
{
80047b8: 37 9c ff dc addi sp,sp,-36
80047bc: 5b 8b 00 18 sw (sp+24),r11
80047c0: 5b 8c 00 14 sw (sp+20),r12
80047c4: 5b 8d 00 10 sw (sp+16),r13
80047c8: 5b 8e 00 0c sw (sp+12),r14
80047cc: 5b 8f 00 08 sw (sp+8),r15
80047d0: 5b 9d 00 04 sw (sp+4),ra
80047d4: b8 20 68 00 mv r13,r1
80047d8: b8 40 58 00 mv r11,r2
80047dc: b8 60 60 00 mv r12,r3
ISR_Level level;
/*
* Error check parameters before disabling interrupts.
*/
if ( !set )
80047e0: 44 20 00 09 be r1,r0,8004804 <sigtimedwait+0x4c>
/* NOTE: This is very specifically a RELATIVE not ABSOLUTE time
* in the Open Group specification.
*/
interval = 0;
if ( timeout ) {
80047e4: 44 60 00 0b be r3,r0,8004810 <sigtimedwait+0x58>
if ( !_Timespec_Is_valid( timeout ) )
80047e8: b8 60 08 00 mv r1,r3
80047ec: f8 00 0f 47 calli 8008508 <_Timespec_Is_valid>
80047f0: 44 20 00 05 be r1,r0,8004804 <sigtimedwait+0x4c>
rtems_set_errno_and_return_minus_one( EINVAL );
interval = _Timespec_To_ticks( timeout );
80047f4: b9 80 08 00 mv r1,r12
80047f8: f8 00 0f 50 calli 8008538 <_Timespec_To_ticks>
80047fc: b8 20 10 00 mv r2,r1
if ( !interval )
8004800: 5c 20 00 05 bne r1,r0,8004814 <sigtimedwait+0x5c> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
8004804: f8 00 25 bd calli 800def8 <__errno>
8004808: 34 02 00 16 mvi r2,22
800480c: e0 00 00 61 bi 8004990 <sigtimedwait+0x1d8>
/* NOTE: This is very specifically a RELATIVE not ABSOLUTE time
* in the Open Group specification.
*/
interval = 0;
8004810: 34 02 00 00 mvi r2,0
/*
* Initialize local variables.
*/
the_info = ( info ) ? info : &signal_information;
8004814: 5d 60 00 02 bne r11,r0,800481c <sigtimedwait+0x64>
8004818: 37 8b 00 1c addi r11,sp,28
the_thread = _Thread_Executing;
800481c: 78 01 08 01 mvhi r1,0x801
8004820: 38 21 9d c0 ori r1,r1,0x9dc0
8004824: 28 23 00 10 lw r3,(r1+16)
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
8004828: 28 6e 01 1c lw r14,(r3+284)
* What if they are already pending?
*/
/* API signals pending? */
_ISR_Disable( level );
800482c: 90 00 78 00 rcsr r15,IE
8004830: 34 01 ff fe mvi r1,-2
8004834: a1 e1 08 00 and r1,r15,r1
8004838: d0 01 00 00 wcsr IE,r1
if ( *set & api->signals_pending ) {
800483c: 29 a5 00 00 lw r5,(r13+0)
8004840: 29 c1 00 d4 lw r1,(r14+212)
8004844: a0 a1 20 00 and r4,r5,r1
8004848: 44 80 00 0f be r4,r0,8004884 <sigtimedwait+0xcc>
/* XXX real info later */
the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending );
800484c: fb ff ff bc calli 800473c <_POSIX_signals_Get_lowest>
8004850: b8 20 10 00 mv r2,r1
8004854: 59 61 00 00 sw (r11+0),r1
_POSIX_signals_Clear_signals(
8004858: b9 60 18 00 mv r3,r11
800485c: b9 c0 08 00 mv r1,r14
8004860: 34 04 00 00 mvi r4,0
8004864: 34 05 00 00 mvi r5,0
8004868: f8 00 18 fa calli 800ac50 <_POSIX_signals_Clear_signals>
the_info->si_signo,
the_info,
false,
false
);
_ISR_Enable( level );
800486c: d0 0f 00 00 wcsr IE,r15
the_info->si_code = SI_USER;
8004870: 34 01 00 01 mvi r1,1
8004874: 59 61 00 04 sw (r11+4),r1
the_info->si_value.sival_int = 0;
8004878: 59 60 00 08 sw (r11+8),r0
return the_info->si_signo;
800487c: 29 6c 00 00 lw r12,(r11+0)
8004880: e0 00 00 46 bi 8004998 <sigtimedwait+0x1e0>
}
/* Process pending signals? */
if ( *set & _POSIX_signals_Pending ) {
8004884: 78 01 08 01 mvhi r1,0x801
8004888: 38 21 a0 3c ori r1,r1,0xa03c
800488c: 28 21 00 00 lw r1,(r1+0)
8004890: a0 a1 28 00 and r5,r5,r1
8004894: 44 a4 00 0f be r5,r4,80048d0 <sigtimedwait+0x118>
signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending );
8004898: fb ff ff a9 calli 800473c <_POSIX_signals_Get_lowest>
800489c: b8 20 60 00 mv r12,r1
_POSIX_signals_Clear_signals( api, signo, the_info, true, false );
80048a0: b9 80 10 00 mv r2,r12
80048a4: b9 c0 08 00 mv r1,r14
80048a8: b9 60 18 00 mv r3,r11
80048ac: 34 04 00 01 mvi r4,1
80048b0: 34 05 00 00 mvi r5,0
80048b4: f8 00 18 e7 calli 800ac50 <_POSIX_signals_Clear_signals>
_ISR_Enable( level );
80048b8: d0 0f 00 00 wcsr IE,r15
the_info->si_signo = signo;
the_info->si_code = SI_USER;
80048bc: 34 01 00 01 mvi r1,1
if ( *set & _POSIX_signals_Pending ) {
signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending );
_POSIX_signals_Clear_signals( api, signo, the_info, true, false );
_ISR_Enable( level );
the_info->si_signo = signo;
80048c0: 59 6c 00 00 sw (r11+0),r12
the_info->si_code = SI_USER;
80048c4: 59 61 00 04 sw (r11+4),r1
the_info->si_value.sival_int = 0;
80048c8: 59 60 00 08 sw (r11+8),r0
return signo;
80048cc: e0 00 00 33 bi 8004998 <sigtimedwait+0x1e0>
}
the_info->si_signo = -1;
80048d0: 34 01 ff ff mvi r1,-1
80048d4: 59 61 00 00 sw (r11+0),r1
*
* 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;
80048d8: 78 01 08 01 mvhi r1,0x801
80048dc: 38 21 99 38 ori r1,r1,0x9938
80048e0: 28 24 00 00 lw r4,(r1+0)
++level;
80048e4: 34 84 00 01 addi r4,r4,1
_Thread_Dispatch_disable_level = level;
80048e8: 58 24 00 00 sw (r1+0),r4
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
the_thread->Wait.return_code = EINTR;
80048ec: 34 04 00 04 mvi r4,4
80048f0: 58 64 00 34 sw (r3+52),r4
the_thread->Wait.option = *set;
80048f4: 29 a4 00 00 lw r4,(r13+0)
}
the_info->si_signo = -1;
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
80048f8: 78 01 08 01 mvhi r1,0x801
80048fc: 38 21 9f d4 ori r1,r1,0x9fd4
the_thread->Wait.return_code = EINTR;
the_thread->Wait.option = *set;
8004900: 58 64 00 30 sw (r3+48),r4
the_thread->Wait.return_argument = the_info;
8004904: 58 6b 00 28 sw (r3+40),r11
}
the_info->si_signo = -1;
_Thread_Disable_dispatch();
the_thread->Wait.queue = &_POSIX_signals_Wait_queue;
8004908: 58 61 00 44 sw (r3+68),r1
RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section (
Thread_queue_Control *the_thread_queue
)
{
the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED;
800490c: 34 03 00 01 mvi r3,1
8004910: 58 23 00 30 sw (r1+48),r3
the_thread->Wait.return_code = EINTR;
the_thread->Wait.option = *set;
the_thread->Wait.return_argument = the_info;
_Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue );
_ISR_Enable( level );
8004914: d0 0f 00 00 wcsr IE,r15
_Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval );
8004918: 78 01 08 01 mvhi r1,0x801
800491c: 78 03 08 00 mvhi r3,0x800
8004920: 38 21 9f d4 ori r1,r1,0x9fd4
8004924: 38 63 82 bc ori r3,r3,0x82bc
8004928: f8 00 0d 3f calli 8007e24 <_Thread_queue_Enqueue_with_handler>
_Thread_Enable_dispatch();
800492c: f8 00 0b cb calli 8007858 <_Thread_Enable_dispatch>
/*
* When the thread is set free by a signal, it is need to eliminate
* the signal.
*/
_POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false );
8004930: 29 62 00 00 lw r2,(r11+0)
8004934: b9 c0 08 00 mv r1,r14
8004938: b9 60 18 00 mv r3,r11
800493c: 34 04 00 00 mvi r4,0
8004940: 34 05 00 00 mvi r5,0
8004944: f8 00 18 c3 calli 800ac50 <_POSIX_signals_Clear_signals>
/* Set errno only if return code is not EINTR or
* if EINTR was caused by a signal being caught, which
* was not in our set.
*/
if ( (_Thread_Executing->Wait.return_code != EINTR)
8004948: 78 01 08 01 mvhi r1,0x801
800494c: 38 21 9d c0 ori r1,r1,0x9dc0
8004950: 28 21 00 10 lw r1,(r1+16)
8004954: 28 22 00 34 lw r2,(r1+52)
8004958: 34 01 00 04 mvi r1,4
800495c: 5c 41 00 08 bne r2,r1,800497c <sigtimedwait+0x1c4>
|| !(*set & signo_to_mask( the_info->si_signo )) ) {
8004960: 29 6c 00 00 lw r12,(r11+0)
8004964: 34 01 00 01 mvi r1,1
8004968: 35 82 ff ff addi r2,r12,-1
800496c: f8 00 45 c3 calli 8016078 <__ashlsi3>
8004970: 29 a2 00 00 lw r2,(r13+0)
8004974: a0 22 08 00 and r1,r1,r2
8004978: 5c 20 00 08 bne r1,r0,8004998 <sigtimedwait+0x1e0>
errno = _Thread_Executing->Wait.return_code;
800497c: f8 00 25 5f calli 800def8 <__errno>
8004980: 78 02 08 01 mvhi r2,0x801
8004984: 38 42 9d c0 ori r2,r2,0x9dc0
8004988: 28 42 00 10 lw r2,(r2+16)
800498c: 28 42 00 34 lw r2,(r2+52)
8004990: 58 22 00 00 sw (r1+0),r2
return -1;
8004994: 34 0c ff ff mvi r12,-1
}
return the_info->si_signo;
}
8004998: b9 80 08 00 mv r1,r12
800499c: 2b 9d 00 04 lw ra,(sp+4)
80049a0: 2b 8b 00 18 lw r11,(sp+24)
80049a4: 2b 8c 00 14 lw r12,(sp+20)
80049a8: 2b 8d 00 10 lw r13,(sp+16)
80049ac: 2b 8e 00 0c lw r14,(sp+12)
80049b0: 2b 8f 00 08 lw r15,(sp+8)
80049b4: 37 9c 00 24 addi sp,sp,36
80049b8: c3 a0 00 00 ret
08006bb4 <sigwait>:
int sigwait(
const sigset_t *set,
int *sig
)
{
8006bb4: 37 9c ff f8 addi sp,sp,-8
8006bb8: 5b 8b 00 08 sw (sp+8),r11
8006bbc: 5b 9d 00 04 sw (sp+4),ra
int status;
status = sigtimedwait( set, NULL, NULL );
8006bc0: 34 03 00 00 mvi r3,0
int sigwait(
const sigset_t *set,
int *sig
)
{
8006bc4: b8 40 58 00 mv r11,r2
int status;
status = sigtimedwait( set, NULL, NULL );
8006bc8: 34 02 00 00 mvi r2,0
8006bcc: fb ff ff 72 calli 8006994 <sigtimedwait>
8006bd0: b8 20 18 00 mv r3,r1
if ( status != -1 ) {
8006bd4: 34 01 ff ff mvi r1,-1
8006bd8: 44 61 00 05 be r3,r1,8006bec <sigwait+0x38>
if ( sig )
*sig = status;
return 0;
8006bdc: 34 01 00 00 mvi r1,0
int status;
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
8006be0: 45 60 00 05 be r11,r0,8006bf4 <sigwait+0x40> <== NEVER TAKEN
*sig = status;
8006be4: 59 63 00 00 sw (r11+0),r3
8006be8: e0 00 00 03 bi 8006bf4 <sigwait+0x40>
return 0;
}
return errno;
8006bec: f8 00 24 09 calli 800fc10 <__errno>
8006bf0: 28 21 00 00 lw r1,(r1+0)
}
8006bf4: 2b 9d 00 04 lw ra,(sp+4)
8006bf8: 2b 8b 00 08 lw r11,(sp+8)
8006bfc: 37 9c 00 08 addi sp,sp,8
8006c00: c3 a0 00 00 ret
08005154 <siproc>:
/*
* Process input character, with semaphore.
*/
static int
siproc (unsigned char c, struct rtems_termios_tty *tty)
{
8005154: 37 9c ff f4 addi sp,sp,-12
8005158: 5b 8b 00 0c sw (sp+12),r11
800515c: 5b 8c 00 08 sw (sp+8),r12
8005160: 5b 9d 00 04 sw (sp+4),ra
8005164: b8 20 60 00 mv r12,r1
int i;
/*
* Obtain output semaphore if character will be echoed
*/
if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) {
8005168: 28 41 00 3c lw r1,(r2+60)
/*
* Process input character, with semaphore.
*/
static int
siproc (unsigned char c, struct rtems_termios_tty *tty)
{
800516c: b8 40 58 00 mv r11,r2
int i;
/*
* Obtain output semaphore if character will be echoed
*/
if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) {
8005170: 20 21 0e 78 andi r1,r1,0xe78
8005174: 44 20 00 0c be r1,r0,80051a4 <siproc+0x50> <== NEVER TAKEN
rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
8005178: 28 41 00 18 lw r1,(r2+24)
800517c: 34 03 00 00 mvi r3,0
8005180: 34 02 00 00 mvi r2,0
8005184: f8 00 04 ee calli 800653c <rtems_semaphore_obtain>
i = iproc (c, tty);
8005188: b9 80 08 00 mv r1,r12
800518c: b9 60 10 00 mv r2,r11
8005190: fb ff ff 84 calli 8004fa0 <iproc>
8005194: b8 20 60 00 mv r12,r1
rtems_semaphore_release (tty->osem);
8005198: 29 61 00 18 lw r1,(r11+24)
800519c: f8 00 05 38 calli 800667c <rtems_semaphore_release>
80051a0: e0 00 00 04 bi 80051b0 <siproc+0x5c>
}
else {
i = iproc (c, tty);
80051a4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED
80051a8: fb ff ff 7e calli 8004fa0 <iproc> <== NOT EXECUTED
80051ac: b8 20 60 00 mv r12,r1 <== NOT EXECUTED
}
return i;
}
80051b0: b9 80 08 00 mv r1,r12
80051b4: 2b 9d 00 04 lw ra,(sp+4)
80051b8: 2b 8b 00 0c lw r11,(sp+12)
80051bc: 2b 8c 00 08 lw r12,(sp+8)
80051c0: 37 9c 00 0c addi sp,sp,12
80051c4: c3 a0 00 00 ret
0800b270 <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 )
{
800b270: 37 9c ff b4 addi sp,sp,-76
800b274: 5b 8b 00 44 sw (sp+68),r11
800b278: 5b 8c 00 40 sw (sp+64),r12
800b27c: 5b 8d 00 3c sw (sp+60),r13
800b280: 5b 8e 00 38 sw (sp+56),r14
800b284: 5b 8f 00 34 sw (sp+52),r15
800b288: 5b 90 00 30 sw (sp+48),r16
800b28c: 5b 91 00 2c sw (sp+44),r17
800b290: 5b 92 00 28 sw (sp+40),r18
800b294: 5b 93 00 24 sw (sp+36),r19
800b298: 5b 94 00 20 sw (sp+32),r20
800b29c: 5b 95 00 1c sw (sp+28),r21
800b2a0: 5b 96 00 18 sw (sp+24),r22
800b2a4: 5b 97 00 14 sw (sp+20),r23
800b2a8: 5b 98 00 10 sw (sp+16),r24
800b2ac: 5b 99 00 0c sw (sp+12),r25
800b2b0: 5b 9b 00 08 sw (sp+8),fp
800b2b4: 5b 9d 00 04 sw (sp+4),ra
rtems_status_code sc;
rtems_sparse_disk *sd = rtems_disk_get_driver_data( dd );
if ( RTEMS_BLKIO_REQUEST == req ) {
800b2b8: 78 06 08 02 mvhi r6,0x802
800b2bc: 38 c6 e5 cc ori r6,r6,0xe5cc
800b2c0: 28 c5 00 00 lw r5,(r6+0)
/*
* ioctl handler to be passed to the block device handler
*/
static int sparse_disk_ioctl( rtems_disk_device *dd, uint32_t req, void *argp )
{
800b2c4: b8 60 70 00 mv r14,r3
rtems_status_code sc;
rtems_sparse_disk *sd = rtems_disk_get_driver_data( dd );
800b2c8: 28 2b 00 3c lw r11,(r1+60)
if ( RTEMS_BLKIO_REQUEST == req ) {
800b2cc: 5c 45 00 73 bne r2,r5,800b498 <sparse_disk_ioctl+0x228>
rtems_blkdev_request *r = argp;
switch ( r->req ) {
800b2d0: 28 78 00 00 lw r24,(r3+0)
800b2d4: 34 01 00 01 mvi r1,1
800b2d8: 57 01 00 85 bgu r24,r1,800b4ec <sparse_disk_ioctl+0x27c> <== NEVER TAKEN
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 );
800b2dc: 29 61 00 00 lw r1,(r11+0)
800b2e0: 34 02 00 00 mvi r2,0
800b2e4: 34 03 00 00 mvi r3,0
/* 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(
800b2e8: 78 0f 08 00 mvhi r15,0x800
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 );
800b2ec: fb ff e9 62 calli 8005874 <rtems_semaphore_obtain>
800b2f0: b9 c0 80 00 mv r16,r14
static int sparse_disk_read_write(
rtems_sparse_disk *sparse_disk,
rtems_blkdev_request *req,
const bool read )
{
int rv = 0;
800b2f4: 34 0c 00 00 mvi r12,0
size_t buff_size;
unsigned int bytes_handled;
rtems_semaphore_obtain( sparse_disk->mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
for ( req_buffer = 0;
800b2f8: 34 14 00 00 mvi r20,0
/* 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(
800b2fc: 37 97 00 48 addi r23,sp,72
800b300: 39 ef b2 58 ori r15,r15,0xb258
800b304: e0 00 00 58 bi 800b464 <sparse_disk_ioctl+0x1f4>
( 0 <= rv ) && ( req_buffer < req->bufnum );
++req_buffer ) {
scatter_gather = &req->bufs[req_buffer];
bytes_handled = 0;
buff = (uint8_t *) scatter_gather->buffer;
800b308: 2a 19 00 20 lw r25,(r16+32)
block = scatter_gather->block;
800b30c: 2a 11 00 18 lw r17,(r16+24)
buff_size = scatter_gather->length;
800b310: 2a 0d 00 1c lw r13,(r16+28)
for ( req_buffer = 0;
( 0 <= rv ) && ( req_buffer < req->bufnum );
++req_buffer ) {
scatter_gather = &req->bufs[req_buffer];
bytes_handled = 0;
800b314: 34 15 00 00 mvi r21,0
800b318: e0 00 00 4a bi 800b440 <sparse_disk_ioctl+0x1d0>
800b31c: b7 35 98 00 add r19,r25,r21
buff = (uint8_t *) scatter_gather->buffer;
block = scatter_gather->block;
buff_size = scatter_gather->length;
while ( ( 0 <= rv ) && ( 0 < buff_size ) ) {
if ( read )
800b320: 5f 00 00 19 bne r24,r0,800b384 <sparse_disk_ioctl+0x114>
const rtems_blkdev_bnum block,
uint8_t *buffer,
const size_t buffer_size )
{
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
800b324: 5b 91 00 48 sw (sp+72),r17
.block = block,
.data = NULL
};
size_t bytes_to_copy = sparse_disk->media_block_size;
800b328: 29 61 00 0c lw r1,(r11+12)
const rtems_blkdev_bnum block,
uint8_t *buffer,
const size_t buffer_size )
{
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
800b32c: 5b 80 00 4c sw (sp+76),r0
.block = block,
.data = NULL
};
size_t bytes_to_copy = sparse_disk->media_block_size;
800b330: b9 a0 60 00 mv r12,r13
800b334: 50 2d 00 02 bgeu r1,r13,800b33c <sparse_disk_ioctl+0xcc>
800b338: b8 20 60 00 mv r12,r1
if ( buffer_size < bytes_to_copy )
bytes_to_copy = buffer_size;
key = bsearch(
800b33c: 29 62 00 18 lw r2,(r11+24)
800b340: 29 63 00 08 lw r3,(r11+8)
800b344: ba e0 08 00 mv r1,r23
800b348: 34 04 00 08 mvi r4,8
800b34c: b9 e0 28 00 mv r5,r15
800b350: f8 00 3e 0e calli 801ab88 <bsearch>
800b354: b8 20 10 00 mv r2,r1
sparse_disk->used_count,
sizeof( rtems_sparse_disk_key ),
sparse_disk_compare
);
if ( NULL != key )
800b358: 44 20 00 06 be r1,r0,800b370 <sparse_disk_ioctl+0x100>
memcpy( buffer, key->data, bytes_to_copy );
800b35c: 28 42 00 04 lw r2,(r2+4)
800b360: ba 60 08 00 mv r1,r19
800b364: b9 80 18 00 mv r3,r12
800b368: f8 00 41 89 calli 801b98c <memcpy>
800b36c: e0 00 00 32 bi 800b434 <sparse_disk_ioctl+0x1c4>
else
memset( buffer, sparse_disk->fill_pattern, buffer_size );
800b370: 41 62 00 14 lbu r2,(r11+20)
800b374: ba 60 08 00 mv r1,r19
800b378: b9 a0 18 00 mv r3,r13
800b37c: f8 00 41 c5 calli 801ba90 <memset>
800b380: e0 00 00 2d bi 800b434 <sparse_disk_ioctl+0x1c4>
const size_t buffer_size )
{
unsigned int i;
bool block_needs_writing = false;
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
800b384: 5b 91 00 48 sw (sp+72),r17
.block = block,
.data = NULL
};
size_t bytes_to_copy = sparse_disk->media_block_size;
800b388: 29 61 00 0c lw r1,(r11+12)
const size_t buffer_size )
{
unsigned int i;
bool block_needs_writing = false;
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
800b38c: 5b 80 00 4c sw (sp+76),r0
.block = block,
.data = NULL
};
size_t bytes_to_copy = sparse_disk->media_block_size;
800b390: b9 a0 90 00 mv r18,r13
800b394: 50 2d 00 02 bgeu r1,r13,800b39c <sparse_disk_ioctl+0x12c>
800b398: b8 20 90 00 mv r18,r1
/* 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(
800b39c: 29 62 00 18 lw r2,(r11+24)
800b3a0: 29 63 00 08 lw r3,(r11+8)
800b3a4: ba e0 08 00 mv r1,r23
800b3a8: 34 04 00 08 mvi r4,8
800b3ac: b9 e0 28 00 mv r5,r15
800b3b0: f8 00 3d f6 calli 801ab88 <bsearch>
800b3b4: b8 20 60 00 mv r12,r1
sparse_disk->used_count,
sizeof( rtems_sparse_disk_key ),
sparse_disk_compare
);
if ( NULL == key ) {
800b3b8: 34 02 00 00 mvi r2,0
800b3bc: 5c 20 00 19 bne r1,r0,800b420 <sparse_disk_ioctl+0x1b0>
800b3c0: e0 00 00 06 bi 800b3d8 <sparse_disk_ioctl+0x168>
}
/*
* ioctl handler to be passed to the block device handler
*/
static int sparse_disk_ioctl( rtems_disk_device *dd, uint32_t req, void *argp )
800b3c4: b6 62 08 00 add r1,r19,r2
sizeof( rtems_sparse_disk_key ),
sparse_disk_compare
);
if ( NULL == key ) {
for ( i = 0; ( !block_needs_writing ) && ( i < bytes_to_copy ); ++i ) {
800b3c8: 40 23 00 00 lbu r3,(r1+0)
800b3cc: 41 61 00 14 lbu r1,(r11+20)
800b3d0: 5c 61 00 04 bne r3,r1,800b3e0 <sparse_disk_ioctl+0x170>
800b3d4: 34 42 00 01 addi r2,r2,1
800b3d8: 56 42 ff fb bgu r18,r2,800b3c4 <sparse_disk_ioctl+0x154>
800b3dc: e0 00 00 15 bi 800b430 <sparse_disk_ioctl+0x1c0>
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 ) {
800b3e0: 29 76 00 08 lw r22,(r11+8)
800b3e4: 29 61 00 04 lw r1,(r11+4)
}
if ( NULL != key )
memcpy( key->data, buffer, bytes_to_copy );
else if ( block_needs_writing )
return -1;
800b3e8: 34 0c ff ff mvi r12,-1
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 ) {
800b3ec: 52 c1 00 12 bgeu r22,r1,800b434 <sparse_disk_ioctl+0x1c4> <== NEVER TAKEN
key = &sparse_disk->key_table[sparse_disk->used_count];
800b3f0: 29 7b 00 18 lw fp,(r11+24)
800b3f4: 34 02 00 03 mvi r2,3
800b3f8: ba c0 08 00 mv r1,r22
800b3fc: fb ff d7 7b calli 80011e8 <__ashlsi3>
800b400: b7 61 60 00 add r12,fp,r1
key->block = block;
800b404: 59 91 00 00 sw (r12+0),r17
++sparse_disk->used_count;
800b408: 36 c2 00 01 addi r2,r22,1
800b40c: 59 62 00 08 sw (r11+8),r2
qsort( sparse_disk->key_table, sparse_disk->used_count,
800b410: bb 60 08 00 mv r1,fp
800b414: 34 03 00 08 mvi r3,8
800b418: b9 e0 20 00 mv r4,r15
800b41c: f8 00 42 00 calli 801bc1c <qsort>
key = sparse_disk_get_new_block( sparse_disk, block );
}
}
if ( NULL != key )
memcpy( key->data, buffer, bytes_to_copy );
800b420: 29 81 00 04 lw r1,(r12+4)
800b424: ba 60 10 00 mv r2,r19
800b428: ba 40 18 00 mv r3,r18
800b42c: f8 00 41 58 calli 801b98c <memcpy>
else if ( block_needs_writing )
return -1;
return bytes_to_copy;
800b430: ba 40 60 00 mv r12,r18
rv = sparse_disk_write_block( sparse_disk,
block,
&buff[bytes_handled],
buff_size );
++block;
800b434: 36 31 00 01 addi r17,r17,1
bytes_handled += rv;
800b438: b6 ac a8 00 add r21,r21,r12
buff_size -= rv;
800b43c: c9 ac 68 00 sub r13,r13,r12
bytes_handled = 0;
buff = (uint8_t *) scatter_gather->buffer;
block = scatter_gather->block;
buff_size = scatter_gather->length;
while ( ( 0 <= rv ) && ( 0 < buff_size ) ) {
800b440: 34 02 00 1f mvi r2,31
800b444: 7d b2 00 00 cmpnei r18,r13,0
800b448: a5 80 08 00 not r1,r12
800b44c: f8 00 88 03 calli 802d458 <__lshrsi3>
800b450: a2 41 10 00 and r2,r18,r1
800b454: 5c 40 ff b2 bne r2,r0,800b31c <sparse_disk_ioctl+0xac>
800b458: 36 10 00 10 addi r16,r16,16
size_t buff_size;
unsigned int bytes_handled;
rtems_semaphore_obtain( sparse_disk->mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
for ( req_buffer = 0;
800b45c: 48 4c 00 04 bg r2,r12,800b46c <sparse_disk_ioctl+0x1fc> <== NEVER TAKEN
( 0 <= rv ) && ( req_buffer < req->bufnum );
++req_buffer ) {
800b460: 36 94 00 01 addi r20,r20,1
unsigned int bytes_handled;
rtems_semaphore_obtain( sparse_disk->mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
for ( req_buffer = 0;
( 0 <= rv ) && ( req_buffer < req->bufnum );
800b464: 29 c1 00 10 lw r1,(r14+16)
800b468: 54 34 ff a8 bgu r1,r20,800b308 <sparse_disk_ioctl+0x98>
bytes_handled += rv;
buff_size -= rv;
}
}
rtems_semaphore_release( sparse_disk->mutex );
800b46c: 29 61 00 00 lw r1,(r11+0)
800b470: fb ff e9 51 calli 80059b4 <rtems_semaphore_release>
800b474: 29 c3 00 04 lw r3,(r14+4)
static inline void rtems_blkdev_request_done(
rtems_blkdev_request *req,
rtems_status_code status
)
{
(*req->done)(req, status);
800b478: b9 c0 08 00 mv r1,r14
800b47c: 34 02 00 00 mvi r2,0
if ( 0 > rv )
800b480: 4d 80 00 03 bge r12,r0,800b48c <sparse_disk_ioctl+0x21c> <== ALWAYS TAKEN
800b484: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED
800b488: 34 02 00 1b mvi r2,27 <== NOT EXECUTED
800b48c: d8 60 00 00 call r3
rtems_blkdev_request *r = argp;
switch ( r->req ) {
case RTEMS_BLKDEV_REQ_READ:
case RTEMS_BLKDEV_REQ_WRITE:
return sparse_disk_read_write( sd, r, r->req == RTEMS_BLKDEV_REQ_READ );
800b490: 34 0c 00 00 mvi r12,0
800b494: e0 00 00 1a bi 800b4fc <sparse_disk_ioctl+0x28c>
default:
break;
}
} else if ( RTEMS_BLKIO_DELETED == req ) {
800b498: 78 06 08 02 mvhi r6,0x802
800b49c: 38 c6 e0 28 ori r6,r6,0xe028
800b4a0: 28 c5 00 00 lw r5,(r6+0)
800b4a4: 5c 45 00 0f bne r2,r5,800b4e0 <sparse_disk_ioctl+0x270>
sc = rtems_semaphore_delete( sd->mutex );
800b4a8: 29 61 00 00 lw r1,(r11+0)
800b4ac: fb ff e8 c3 calli 80057b8 <rtems_semaphore_delete>
if ( RTEMS_SUCCESSFUL != sc )
800b4b0: 44 20 00 05 be r1,r0,800b4c4 <sparse_disk_ioctl+0x254> <== ALWAYS TAKEN
rtems_fatal_error_occurred( 0xdeadbeef );
800b4b4: 78 02 08 02 mvhi r2,0x802 <== NOT EXECUTED
800b4b8: 38 42 e0 2c ori r2,r2,0xe02c <== NOT EXECUTED
800b4bc: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED
800b4c0: fb ff ea 5f calli 8005e3c <rtems_fatal_error_occurred> <== NOT EXECUTED
sd->mutex = RTEMS_ID_NONE;
if ( NULL != sd->delete_handler )
800b4c4: 29 62 00 10 lw r2,(r11+16)
sc = rtems_semaphore_delete( sd->mutex );
if ( RTEMS_SUCCESSFUL != sc )
rtems_fatal_error_occurred( 0xdeadbeef );
sd->mutex = RTEMS_ID_NONE;
800b4c8: 59 60 00 00 sw (r11+0),r0
if ( NULL != sd->delete_handler )
( *sd->delete_handler )( sd );
return 0;
800b4cc: 34 0c 00 00 mvi r12,0
if ( RTEMS_SUCCESSFUL != sc )
rtems_fatal_error_occurred( 0xdeadbeef );
sd->mutex = RTEMS_ID_NONE;
if ( NULL != sd->delete_handler )
800b4d0: 44 4c 00 0b be r2,r12,800b4fc <sparse_disk_ioctl+0x28c> <== NEVER TAKEN
( *sd->delete_handler )( sd );
800b4d4: b9 60 08 00 mv r1,r11
800b4d8: d8 40 00 00 call r2
800b4dc: e0 00 00 08 bi 800b4fc <sparse_disk_ioctl+0x28c>
return 0;
} else {
return rtems_blkdev_ioctl( dd, req, argp );
800b4e0: f8 00 0d 11 calli 800e924 <rtems_blkdev_ioctl>
800b4e4: b8 20 60 00 mv r12,r1
800b4e8: e0 00 00 05 bi 800b4fc <sparse_disk_ioctl+0x28c>
}
errno = EINVAL;
800b4ec: f8 00 3d da calli 801ac54 <__errno> <== NOT EXECUTED
800b4f0: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
800b4f4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
return -1;
800b4f8: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED
}
800b4fc: b9 80 08 00 mv r1,r12
800b500: 2b 9d 00 04 lw ra,(sp+4)
800b504: 2b 8b 00 44 lw r11,(sp+68)
800b508: 2b 8c 00 40 lw r12,(sp+64)
800b50c: 2b 8d 00 3c lw r13,(sp+60)
800b510: 2b 8e 00 38 lw r14,(sp+56)
800b514: 2b 8f 00 34 lw r15,(sp+52)
800b518: 2b 90 00 30 lw r16,(sp+48)
800b51c: 2b 91 00 2c lw r17,(sp+44)
800b520: 2b 92 00 28 lw r18,(sp+40)
800b524: 2b 93 00 24 lw r19,(sp+36)
800b528: 2b 94 00 20 lw r20,(sp+32)
800b52c: 2b 95 00 1c lw r21,(sp+28)
800b530: 2b 96 00 18 lw r22,(sp+24)
800b534: 2b 97 00 14 lw r23,(sp+20)
800b538: 2b 98 00 10 lw r24,(sp+16)
800b53c: 2b 99 00 0c lw r25,(sp+12)
800b540: 2b 9b 00 08 lw fp,(sp+8)
800b544: 37 9c 00 4c addi sp,sp,76
800b548: c3 a0 00 00 ret
08003e80 <sync_per_thread>:
fdatasync(fn);
}
/* iterate over all FILE *'s for this thread */
static void sync_per_thread(Thread_Control *t)
{
8003e80: 37 9c ff f4 addi sp,sp,-12
8003e84: 5b 8b 00 0c sw (sp+12),r11
8003e88: 5b 8c 00 08 sw (sp+8),r12
8003e8c: 5b 9d 00 04 sw (sp+4),ra
/*
* The sync_wrapper() function will operate on the current thread's
* reent structure so we will temporarily use that.
*/
this_reent = t->libc_reent;
8003e90: 28 22 01 14 lw r2,(r1+276)
if ( this_reent ) {
8003e94: 44 40 00 0c be r2,r0,8003ec4 <sync_per_thread+0x44> <== NEVER TAKEN
current_reent = _Thread_Executing->libc_reent;
8003e98: 78 0b 08 01 mvhi r11,0x801
8003e9c: 39 6b 6d 80 ori r11,r11,0x6d80
8003ea0: 29 63 00 10 lw r3,(r11+16)
8003ea4: 28 6c 01 14 lw r12,(r3+276)
_Thread_Executing->libc_reent = this_reent;
8003ea8: 58 62 01 14 sw (r3+276),r2
_fwalk (t->libc_reent, sync_wrapper);
8003eac: 28 21 01 14 lw r1,(r1+276)
8003eb0: 78 02 08 00 mvhi r2,0x800
8003eb4: 38 42 3e d8 ori r2,r2,0x3ed8
8003eb8: f8 00 29 d3 calli 800e604 <_fwalk>
_Thread_Executing->libc_reent = current_reent;
8003ebc: 29 61 00 10 lw r1,(r11+16)
8003ec0: 58 2c 01 14 sw (r1+276),r12
}
}
8003ec4: 2b 9d 00 04 lw ra,(sp+4)
8003ec8: 2b 8b 00 0c lw r11,(sp+12)
8003ecc: 2b 8c 00 08 lw r12,(sp+8)
8003ed0: 37 9c 00 0c addi sp,sp,12
8003ed4: c3 a0 00 00 ret
08003194 <sysconf>:
*/
long sysconf(
int name
)
{
8003194: 37 9c ff fc addi sp,sp,-4
8003198: 5b 9d 00 04 sw (sp+4),ra
800319c: b8 20 10 00 mv r2,r1
if ( name == _SC_CLK_TCK )
80031a0: 34 01 00 02 mvi r1,2
80031a4: 5c 41 00 09 bne r2,r1,80031c8 <sysconf+0x34>
return (TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick());
80031a8: 78 02 08 01 mvhi r2,0x801
long sysconf(
int name
)
{
if ( name == _SC_CLK_TCK )
return (TOD_MICROSECONDS_PER_SECOND /
80031ac: 78 03 08 01 mvhi r3,0x801
80031b0: 38 63 3b 24 ori r3,r3,0x3b24
rtems_configuration_get_microseconds_per_tick());
80031b4: 38 42 3a 94 ori r2,r2,0x3a94
long sysconf(
int name
)
{
if ( name == _SC_CLK_TCK )
return (TOD_MICROSECONDS_PER_SECOND /
80031b8: 28 61 00 00 lw r1,(r3+0)
80031bc: 28 42 00 0c lw r2,(r2+12)
80031c0: f8 00 3e 52 calli 8012b08 <__udivsi3>
80031c4: e0 00 00 14 bi 8003214 <sysconf+0x80>
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
80031c8: 34 01 00 04 mvi r1,4
80031cc: 5c 41 00 05 bne r2,r1,80031e0 <sysconf+0x4c>
return rtems_libio_number_iops;
80031d0: 78 01 08 01 mvhi r1,0x801
80031d4: 38 21 50 10 ori r1,r1,0x5010
80031d8: 28 21 00 00 lw r1,(r1+0)
80031dc: e0 00 00 0e bi 8003214 <sysconf+0x80>
if ( name == _SC_GETPW_R_SIZE_MAX )
80031e0: 34 03 00 33 mvi r3,51
return 1024;
80031e4: 34 01 04 00 mvi r1,1024
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
80031e8: 44 43 00 0b be r2,r3,8003214 <sysconf+0x80>
return 1024;
if ( name == _SC_PAGESIZE )
80031ec: 34 03 00 08 mvi r3,8
return PAGE_SIZE;
80031f0: 34 01 10 00 mvi r1,4096
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
return 1024;
if ( name == _SC_PAGESIZE )
80031f4: 44 43 00 08 be r2,r3,8003214 <sysconf+0x80>
return PAGE_SIZE;
if ( name == _SC_SYMLOOP_MAX )
80031f8: 34 03 00 4f mvi r3,79
return RTEMS_FILESYSTEM_SYMLOOP_MAX;
80031fc: 34 01 00 20 mvi r1,32
return 1024;
if ( name == _SC_PAGESIZE )
return PAGE_SIZE;
if ( name == _SC_SYMLOOP_MAX )
8003200: 44 43 00 05 be r2,r3,8003214 <sysconf+0x80> <== NEVER TAKEN
#if defined(__sparc__)
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
8003204: f8 00 25 45 calli 800c718 <__errno>
8003208: 34 02 00 16 mvi r2,22
800320c: 58 22 00 00 sw (r1+0),r2
8003210: 34 01 ff ff mvi r1,-1
}
8003214: 2b 9d 00 04 lw ra,(sp+4)
8003218: 37 9c 00 04 addi sp,sp,4
800321c: c3 a0 00 00 ret
08002c48 <tcflow>:
int tcflow (
int fd __attribute__((unused)),
int action
)
{
8002c48: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
8002c4c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
switch (action) {
8002c50: 34 01 00 03 mvi r1,3 <== NOT EXECUTED
8002c54: 54 41 00 02 bgu r2,r1,8002c5c <tcflow+0x14> <== NOT EXECUTED
8002c58: e0 00 00 04 bi 8002c68 <tcflow+0x20> <== NOT EXECUTED
case TCOON:
case TCIOFF:
case TCION:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
8002c5c: f8 00 1f 9d calli 800aad0 <__errno> <== NOT EXECUTED
8002c60: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
8002c64: e0 00 00 03 bi 8002c70 <tcflow+0x28> <== NOT EXECUTED
}
/* fd is not validated */
/* When this is supported, implement it here */
rtems_set_errno_and_return_minus_one( ENOTSUP );
8002c68: f8 00 1f 9a calli 800aad0 <__errno> <== NOT EXECUTED
8002c6c: 34 02 00 86 mvi r2,134 <== NOT EXECUTED
8002c70: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED
}
8002c74: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED
8002c78: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8002c7c: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
8002c80: c3 a0 00 00 ret <== NOT EXECUTED
08002c84 <tcflush>:
#include <termios.h>
#include <stdint.h>
#include <sys/ioccom.h>
int tcflush( int fd, int queue )
{
8002c84: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
8002c88: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
8002c8c: b8 40 18 00 mv r3,r2 <== NOT EXECUTED
return ioctl( fd, RTEMS_IO_TCFLUSH, (intptr_t) queue );
8002c90: 34 02 00 06 mvi r2,6 <== NOT EXECUTED
8002c94: f8 00 13 0b calli 80078c0 <ioctl> <== NOT EXECUTED
}
8002c98: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8002c9c: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
8002ca0: c3 a0 00 00 ret <== NOT EXECUTED
08002ca4 <tcgetpgrp>:
/**
* POSIX 1003.1b 7.2.3 - Get Foreground Process Group ID
*/
pid_t tcgetpgrp(int fd __attribute__((unused)))
{
8002ca4: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED
8002ca8: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED
return getpid();
8002cac: fb ff f9 29 calli 8001150 <getpid> <== NOT EXECUTED
}
8002cb0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED
8002cb4: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED
8002cb8: c3 a0 00 00 ret <== NOT EXECUTED
08002cbc <tcsendbreak>:
int tcsendbreak (
int fd __attribute__((unused)),
int duration __attribute__((unused)) )
{
return 0;
}
8002cbc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
8002cc0: c3 a0 00 00 ret <== NOT EXECUTED
08011258 <tcsetattr>:
int tcsetattr(
int fd,
int opt,
struct termios *tp
)
{
8011258: 37 9c ff f4 addi sp,sp,-12
801125c: 5b 8b 00 0c sw (sp+12),r11
8011260: 5b 8c 00 08 sw (sp+8),r12
8011264: 5b 9d 00 04 sw (sp+4),ra
8011268: b8 20 60 00 mv r12,r1
801126c: b8 60 58 00 mv r11,r3
switch (opt) {
8011270: 44 40 00 0d be r2,r0,80112a4 <tcsetattr+0x4c>
8011274: 34 03 00 01 mvi r3,1
8011278: 44 43 00 06 be r2,r3,8011290 <tcsetattr+0x38>
default:
rtems_set_errno_and_return_minus_one( ENOTSUP );
801127c: f8 00 14 8e calli 80164b4 <__errno>
8011280: 34 02 00 86 mvi r2,134
8011284: 58 22 00 00 sw (r1+0),r2
8011288: 34 02 ff ff mvi r2,-1
801128c: e0 00 00 0b bi 80112b8 <tcsetattr+0x60>
case TCSADRAIN:
if (ioctl( fd, RTEMS_IO_TCDRAIN, NULL ) < 0)
8011290: 34 02 00 03 mvi r2,3
8011294: 34 03 00 00 mvi r3,0
8011298: f8 00 10 43 calli 80153a4 <ioctl>
return -1;
801129c: 34 02 ff ff mvi r2,-1
switch (opt) {
default:
rtems_set_errno_and_return_minus_one( ENOTSUP );
case TCSADRAIN:
if (ioctl( fd, RTEMS_IO_TCDRAIN, NULL ) < 0)
80112a0: 48 01 00 06 bg r0,r1,80112b8 <tcsetattr+0x60> <== NEVER TAKEN
return -1;
/*
* Fall through to....
*/
case TCSANOW:
return ioctl( fd, RTEMS_IO_SET_ATTRIBUTES, tp );
80112a4: 34 02 00 02 mvi r2,2
80112a8: b9 80 08 00 mv r1,r12
80112ac: b9 60 18 00 mv r3,r11
80112b0: f8 00 10 3d calli 80153a4 <ioctl>
80112b4: b8 20 10 00 mv r2,r1
}
}
80112b8: b8 40 08 00 mv r1,r2
80112bc: 2b 9d 00 04 lw ra,(sp+4)
80112c0: 2b 8b 00 0c lw r11,(sp+12)
80112c4: 2b 8c 00 08 lw r12,(sp+8)
80112c8: 37 9c 00 0c addi sp,sp,12
80112cc: c3 a0 00 00 ret
08002cc4 <tcsetpgrp>:
int tcsetpgrp(
int fd __attribute__((unused)),
pid_t pid __attribute__((unused)) )
{
return 0;
}
8002cc4: 34 01 00 00 mvi r1,0 <== NOT EXECUTED
8002cc8: c3 a0 00 00 ret <== NOT EXECUTED
08004e58 <timer_create>:
int timer_create(
clockid_t clock_id,
struct sigevent *evp,
timer_t *timerid
)
{
8004e58: 37 9c ff ec addi sp,sp,-20
8004e5c: 5b 8b 00 14 sw (sp+20),r11
8004e60: 5b 8c 00 10 sw (sp+16),r12
8004e64: 5b 8d 00 0c sw (sp+12),r13
8004e68: 5b 8e 00 08 sw (sp+8),r14
8004e6c: 5b 9d 00 04 sw (sp+4),ra
8004e70: b8 40 60 00 mv r12,r2
POSIX_Timer_Control *ptimer;
if ( clock_id != CLOCK_REALTIME )
8004e74: 34 02 00 01 mvi r2,1
int timer_create(
clockid_t clock_id,
struct sigevent *evp,
timer_t *timerid
)
{
8004e78: b8 60 68 00 mv r13,r3
POSIX_Timer_Control *ptimer;
if ( clock_id != CLOCK_REALTIME )
8004e7c: 5c 22 00 0c bne r1,r2,8004eac <timer_create+0x54>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !timerid )
8004e80: 44 60 00 0b be r3,r0,8004eac <timer_create+0x54>
/*
* The data of the structure evp are checked in order to verify if they
* are coherent.
*/
if (evp != NULL) {
8004e84: 45 80 00 0d be r12,r0,8004eb8 <timer_create+0x60>
/* The structure has data */
if ( ( evp->sigev_notify != SIGEV_NONE ) &&
8004e88: 29 82 00 00 lw r2,(r12+0)
8004e8c: 34 42 ff ff addi r2,r2,-1
8004e90: 50 22 00 02 bgeu r1,r2,8004e98 <timer_create+0x40> <== ALWAYS TAKEN
8004e94: e0 00 00 06 bi 8004eac <timer_create+0x54> <== NOT EXECUTED
( evp->sigev_notify != SIGEV_SIGNAL ) ) {
/* The value of the field sigev_notify is not valid */
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( !evp->sigev_signo )
8004e98: 29 81 00 04 lw r1,(r12+4)
8004e9c: 44 20 00 04 be r1,r0,8004eac <timer_create+0x54> <== NEVER TAKEN
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
8004ea0: 34 21 ff ff addi r1,r1,-1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(evp->sigev_signo) )
8004ea4: 34 02 00 1f mvi r2,31
8004ea8: 50 41 00 04 bgeu r2,r1,8004eb8 <timer_create+0x60> <== ALWAYS TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
8004eac: f8 00 28 0d calli 800eee0 <__errno>
8004eb0: 34 02 00 16 mvi r2,22
8004eb4: e0 00 00 0e bi 8004eec <timer_create+0x94>
*
* 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;
8004eb8: 78 01 08 02 mvhi r1,0x802
8004ebc: 38 21 43 28 ori r1,r1,0x4328
8004ec0: 28 22 00 00 lw r2,(r1+0)
++level;
8004ec4: 34 42 00 01 addi r2,r2,1
_Thread_Dispatch_disable_level = level;
8004ec8: 58 22 00 00 sw (r1+0),r2
* the inactive chain of free timer control blocks.
*/
RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void )
{
return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information );
8004ecc: 78 01 08 02 mvhi r1,0x802
8004ed0: 38 21 45 a4 ori r1,r1,0x45a4
8004ed4: f8 00 08 7f calli 80070d0 <_Objects_Allocate>
8004ed8: b8 20 58 00 mv r11,r1
/*
* Allocate a timer
*/
ptimer = _POSIX_Timer_Allocate();
if ( !ptimer ) {
8004edc: 5c 20 00 07 bne r1,r0,8004ef8 <timer_create+0xa0>
_Thread_Enable_dispatch();
8004ee0: f8 00 0e 1d calli 8008754 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
8004ee4: f8 00 27 ff calli 800eee0 <__errno>
8004ee8: 34 02 00 0b mvi r2,11
8004eec: 58 22 00 00 sw (r1+0),r2
8004ef0: 34 01 ff ff mvi r1,-1
8004ef4: e0 00 00 25 bi 8004f88 <timer_create+0x130>
}
/* The data of the created timer are stored to use them later */
ptimer->state = POSIX_TIMER_STATE_CREATE_NEW;
8004ef8: 34 01 00 02 mvi r1,2
8004efc: 31 61 00 3c sb (r11+60),r1
ptimer->thread_id = _Thread_Executing->Object.id;
8004f00: 78 01 08 02 mvhi r1,0x802
8004f04: 38 21 48 00 ori r1,r1,0x4800
8004f08: 28 21 00 10 lw r1,(r1+16)
8004f0c: 28 21 00 08 lw r1,(r1+8)
8004f10: 59 61 00 38 sw (r11+56),r1
if ( evp != NULL ) {
8004f14: 45 80 00 07 be r12,r0,8004f30 <timer_create+0xd8>
ptimer->inf.sigev_notify = evp->sigev_notify;
8004f18: 29 81 00 00 lw r1,(r12+0)
8004f1c: 59 61 00 40 sw (r11+64),r1
ptimer->inf.sigev_signo = evp->sigev_signo;
8004f20: 29 81 00 04 lw r1,(r12+4)
8004f24: 59 61 00 44 sw (r11+68),r1
ptimer->inf.sigev_value = evp->sigev_value;
8004f28: 29 81 00 08 lw r1,(r12+8)
8004f2c: 59 61 00 48 sw (r11+72),r1
uint32_t name
)
{
_Objects_Set_local_object(
information,
_Objects_Get_index( the_object->id ),
8004f30: 29 6c 00 08 lw r12,(r11+8)
_Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0);
*timerid = ptimer->Object.id;
_Thread_Enable_dispatch();
return 0;
}
8004f34: 78 01 08 02 mvhi r1,0x802
8004f38: 38 21 45 a4 ori r1,r1,0x45a4
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
8004f3c: 28 2e 00 1c lw r14,(r1+28)
8004f40: 34 02 00 02 mvi r2,2
ptimer->inf.sigev_notify = evp->sigev_notify;
ptimer->inf.sigev_signo = evp->sigev_signo;
ptimer->inf.sigev_value = evp->sigev_value;
}
ptimer->overrun = 0;
8004f44: 59 60 00 68 sw (r11+104),r0
ptimer->timer_data.it_value.tv_sec = 0;
8004f48: 59 60 00 5c sw (r11+92),r0
ptimer->timer_data.it_value.tv_nsec = 0;
8004f4c: 59 60 00 60 sw (r11+96),r0
ptimer->timer_data.it_interval.tv_sec = 0;
8004f50: 59 60 00 54 sw (r11+84),r0
ptimer->timer_data.it_interval.tv_nsec = 0;
8004f54: 59 60 00 58 sw (r11+88),r0
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
8004f58: 59 60 00 18 sw (r11+24),r0
the_watchdog->routine = routine;
8004f5c: 59 60 00 2c sw (r11+44),r0
the_watchdog->id = id;
8004f60: 59 60 00 30 sw (r11+48),r0
the_watchdog->user_data = user_data;
8004f64: 59 60 00 34 sw (r11+52),r0
8004f68: 21 81 ff ff andi r1,r12,0xffff
8004f6c: fb ff ef 2c calli 8000c1c <__ashlsi3>
8004f70: b5 c1 08 00 add r1,r14,r1
8004f74: 58 2b 00 00 sw (r1+0),r11
_Objects_Get_index( the_object->id ),
the_object
);
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
8004f78: 59 60 00 0c sw (r11+12),r0
_Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL );
_Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0);
*timerid = ptimer->Object.id;
8004f7c: 59 ac 00 00 sw (r13+0),r12
_Thread_Enable_dispatch();
8004f80: f8 00 0d f5 calli 8008754 <_Thread_Enable_dispatch>
return 0;
8004f84: 34 01 00 00 mvi r1,0
}
8004f88: 2b 9d 00 04 lw ra,(sp+4)
8004f8c: 2b 8b 00 14 lw r11,(sp+20)
8004f90: 2b 8c 00 10 lw r12,(sp+16)
8004f94: 2b 8d 00 0c lw r13,(sp+12)
8004f98: 2b 8e 00 08 lw r14,(sp+8)
8004f9c: 37 9c 00 14 addi sp,sp,20
8004fa0: c3 a0 00 00 ret
08003824 <timer_settime>:
timer_t timerid,
int flags,
const struct itimerspec *value,
struct itimerspec *ovalue
)
{
8003824: 37 9c ff cc addi sp,sp,-52
8003828: 5b 8b 00 18 sw (sp+24),r11
800382c: 5b 8c 00 14 sw (sp+20),r12
8003830: 5b 8d 00 10 sw (sp+16),r13
8003834: 5b 8e 00 0c sw (sp+12),r14
8003838: 5b 8f 00 08 sw (sp+8),r15
800383c: 5b 9d 00 04 sw (sp+4),ra
8003840: b8 20 78 00 mv r15,r1
8003844: b8 40 58 00 mv r11,r2
8003848: b8 60 60 00 mv r12,r3
800384c: b8 80 68 00 mv r13,r4
Objects_Locations location;
bool activated;
uint32_t initial_period;
struct itimerspec normalize;
if ( !value )
8003850: 44 60 00 69 be r3,r0,80039f4 <timer_settime+0x1d0> <== NEVER TAKEN
/*
* First, it verifies if the structure "value" is correct
* if the number of nanoseconds is not correct return EINVAL
*/
if ( !_Timespec_Is_valid( &(value->it_value) ) ) {
8003854: 34 61 00 08 addi r1,r3,8
8003858: f8 00 0f 53 calli 80075a4 <_Timespec_Is_valid>
800385c: 44 20 00 66 be r1,r0,80039f4 <timer_settime+0x1d0> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( !_Timespec_Is_valid( &(value->it_interval) ) ) {
8003860: b9 80 08 00 mv r1,r12
8003864: f8 00 0f 50 calli 80075a4 <_Timespec_Is_valid>
8003868: 44 20 00 63 be r1,r0,80039f4 <timer_settime+0x1d0> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) {
800386c: 7d 62 00 00 cmpnei r2,r11,0
8003870: 7d 61 00 04 cmpnei r1,r11,4
8003874: a0 41 08 00 and r1,r2,r1
8003878: 5c 20 00 5f bne r1,r0,80039f4 <timer_settime+0x1d0> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
}
normalize = *value;
800387c: 29 81 00 0c lw r1,(r12+12)
8003880: 29 84 00 00 lw r4,(r12+0)
8003884: 29 83 00 04 lw r3,(r12+4)
8003888: 29 82 00 08 lw r2,(r12+8)
800388c: 5b 81 00 28 sw (sp+40),r1
8003890: 5b 84 00 1c sw (sp+28),r4
8003894: 5b 83 00 20 sw (sp+32),r3
8003898: 5b 82 00 24 sw (sp+36),r2
/* Convert absolute to relative time */
if (flags == TIMER_ABSTIME) {
800389c: 34 01 00 04 mvi r1,4
80038a0: 5d 61 00 0d bne r11,r1,80038d4 <timer_settime+0xb0>
struct timespec now;
_TOD_Get( &now );
80038a4: 37 8b 00 2c addi r11,sp,44
80038a8: b9 60 08 00 mv r1,r11
80038ac: fb ff ff bc calli 800379c <_TOD_Get>
/* Check for seconds in the past */
if ( _Timespec_Greater_than( &now, &normalize.it_value ) )
80038b0: 37 8e 00 24 addi r14,sp,36
80038b4: b9 c0 08 00 mv r1,r14
80038b8: b9 60 10 00 mv r2,r11
80038bc: f8 00 0f 46 calli 80075d4 <_Timespec_Less_than>
80038c0: 5c 20 00 4d bne r1,r0,80039f4 <timer_settime+0x1d0> <== NEVER TAKEN
rtems_set_errno_and_return_minus_one( EINVAL );
_Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value );
80038c4: b9 60 08 00 mv r1,r11
80038c8: b9 c0 10 00 mv r2,r14
80038cc: b9 c0 18 00 mv r3,r14
80038d0: f8 00 0f 4c calli 8007600 <_Timespec_Subtract>
timer_t id,
Objects_Locations *location
)
{
return (POSIX_Timer_Control *)
_Objects_Get( &_POSIX_Timer_Information, (Objects_Id) id, location );
80038d4: 78 03 08 02 mvhi r3,0x802
80038d8: b8 60 08 00 mv r1,r3
80038dc: b9 e0 10 00 mv r2,r15
80038e0: 38 21 0b 84 ori r1,r1,0xb84
80038e4: 37 83 00 34 addi r3,sp,52
80038e8: f8 00 08 4a calli 8005a10 <_Objects_Get>
* something with the structure of times of the timer: to stop, start
* or start it again
*/
ptimer = _POSIX_Timer_Get( timerid, &location );
switch ( location ) {
80038ec: 2b 82 00 34 lw r2,(sp+52)
80038f0: b8 20 58 00 mv r11,r1
80038f4: 5c 40 00 40 bne r2,r0,80039f4 <timer_settime+0x1d0> <== NEVER TAKEN
case OBJECTS_LOCAL:
/* First, it verifies if the timer must be stopped */
if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) {
80038f8: 2b 81 00 24 lw r1,(sp+36)
80038fc: 5c 22 00 19 bne r1,r2,8003960 <timer_settime+0x13c>
8003900: 2b 8e 00 28 lw r14,(sp+40)
8003904: 5d c1 00 17 bne r14,r1,8003960 <timer_settime+0x13c>
/* Stop the timer */
(void) _Watchdog_Remove( &ptimer->Timer );
8003908: 35 61 00 10 addi r1,r11,16
800390c: f8 00 10 69 calli 8007ab0 <_Watchdog_Remove>
/* The old data of the timer are returned */
if ( ovalue )
8003910: 45 ae 00 09 be r13,r14,8003934 <timer_settime+0x110>
*ovalue = ptimer->timer_data;
8003914: 29 64 00 54 lw r4,(r11+84)
8003918: 29 63 00 58 lw r3,(r11+88)
800391c: 29 62 00 5c lw r2,(r11+92)
8003920: 29 61 00 60 lw r1,(r11+96)
8003924: 59 a4 00 00 sw (r13+0),r4
8003928: 59 a3 00 04 sw (r13+4),r3
800392c: 59 a2 00 08 sw (r13+8),r2
8003930: 59 a1 00 0c sw (r13+12),r1
/* The new data are set */
ptimer->timer_data = normalize;
8003934: 2b 81 00 1c lw r1,(sp+28)
8003938: 59 61 00 54 sw (r11+84),r1
800393c: 2b 81 00 20 lw r1,(sp+32)
8003940: 59 61 00 58 sw (r11+88),r1
8003944: 2b 81 00 24 lw r1,(sp+36)
8003948: 59 61 00 5c sw (r11+92),r1
800394c: 2b 81 00 28 lw r1,(sp+40)
8003950: 59 61 00 60 sw (r11+96),r1
/* Indicates that the timer is created and stopped */
ptimer->state = POSIX_TIMER_STATE_CREATE_STOP;
8003954: 34 01 00 04 mvi r1,4
8003958: 31 61 00 3c sb (r11+60),r1
800395c: e0 00 00 23 bi 80039e8 <timer_settime+0x1c4>
_Thread_Enable_dispatch();
return 0;
}
/* Convert from seconds and nanoseconds to ticks */
ptimer->ticks = _Timespec_To_ticks( &value->it_interval );
8003960: b9 80 08 00 mv r1,r12
8003964: f8 00 0f 39 calli 8007648 <_Timespec_To_ticks>
8003968: 59 61 00 64 sw (r11+100),r1
initial_period = _Timespec_To_ticks( &normalize.it_value );
800396c: 37 81 00 24 addi r1,sp,36
8003970: f8 00 0f 36 calli 8007648 <_Timespec_To_ticks>
activated = _POSIX_Timer_Insert_helper(
8003974: 29 63 00 08 lw r3,(r11+8)
8003978: 78 04 08 00 mvhi r4,0x800
return 0;
}
/* Convert from seconds and nanoseconds to ticks */
ptimer->ticks = _Timespec_To_ticks( &value->it_interval );
initial_period = _Timespec_To_ticks( &normalize.it_value );
800397c: b8 20 10 00 mv r2,r1
activated = _POSIX_Timer_Insert_helper(
8003980: 38 84 3a 24 ori r4,r4,0x3a24
8003984: 35 61 00 10 addi r1,r11,16
8003988: b9 60 28 00 mv r5,r11
800398c: f8 00 19 ca calli 800a0b4 <_POSIX_Timer_Insert_helper>
initial_period,
ptimer->Object.id,
_POSIX_Timer_TSR,
ptimer
);
if ( !activated ) {
8003990: 44 20 00 16 be r1,r0,80039e8 <timer_settime+0x1c4>
/*
* The timer has been started and is running. So we return the
* old ones in "ovalue"
*/
if ( ovalue )
8003994: 45 a0 00 09 be r13,r0,80039b8 <timer_settime+0x194>
*ovalue = ptimer->timer_data;
8003998: 29 64 00 54 lw r4,(r11+84)
800399c: 29 63 00 58 lw r3,(r11+88)
80039a0: 29 62 00 5c lw r2,(r11+92)
80039a4: 29 61 00 60 lw r1,(r11+96)
80039a8: 59 a4 00 00 sw (r13+0),r4
80039ac: 59 a3 00 04 sw (r13+4),r3
80039b0: 59 a2 00 08 sw (r13+8),r2
80039b4: 59 a1 00 0c sw (r13+12),r1
ptimer->timer_data = normalize;
80039b8: 2b 81 00 1c lw r1,(sp+28)
80039bc: 59 61 00 54 sw (r11+84),r1
80039c0: 2b 81 00 20 lw r1,(sp+32)
80039c4: 59 61 00 58 sw (r11+88),r1
80039c8: 2b 81 00 24 lw r1,(sp+36)
80039cc: 59 61 00 5c sw (r11+92),r1
80039d0: 2b 81 00 28 lw r1,(sp+40)
80039d4: 59 61 00 60 sw (r11+96),r1
/* Indicate that the time is running */
ptimer->state = POSIX_TIMER_STATE_CREATE_RUN;
80039d8: 34 01 00 03 mvi r1,3
80039dc: 31 61 00 3c sb (r11+60),r1
_TOD_Get( &ptimer->time );
80039e0: 35 61 00 6c addi r1,r11,108
80039e4: fb ff ff 6e calli 800379c <_TOD_Get>
_Thread_Enable_dispatch();
80039e8: f8 00 0b d3 calli 8006934 <_Thread_Enable_dispatch>
return 0;
80039ec: 34 01 00 00 mvi r1,0
80039f0: e0 00 00 05 bi 8003a04 <timer_settime+0x1e0>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( EINVAL );
80039f4: f8 00 26 9b calli 800d460 <__errno>
80039f8: 34 02 00 16 mvi r2,22
80039fc: 58 22 00 00 sw (r1+0),r2
8003a00: 34 01 ff ff mvi r1,-1
}
8003a04: 2b 9d 00 04 lw ra,(sp+4)
8003a08: 2b 8b 00 18 lw r11,(sp+24)
8003a0c: 2b 8c 00 14 lw r12,(sp+20)
8003a10: 2b 8d 00 10 lw r13,(sp+16)
8003a14: 2b 8e 00 0c lw r14,(sp+12)
8003a18: 2b 8f 00 08 lw r15,(sp+8)
8003a1c: 37 9c 00 34 addi sp,sp,52
8003a20: c3 a0 00 00 ret
08003674 <ualarm>:
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
8003674: 37 9c ff e8 addi sp,sp,-24
8003678: 5b 8b 00 10 sw (sp+16),r11
800367c: 5b 8c 00 0c sw (sp+12),r12
8003680: 5b 8d 00 08 sw (sp+8),r13
8003684: 5b 9d 00 04 sw (sp+4),ra
/*
* Initialize the timer used to implement alarm().
*/
if ( !the_timer->routine ) {
8003688: 78 0b 08 01 mvhi r11,0x801
800368c: 39 6b 81 e0 ori r11,r11,0x81e0
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
8003690: b8 20 68 00 mv r13,r1
/*
* Initialize the timer used to implement alarm().
*/
if ( !the_timer->routine ) {
8003694: 29 61 00 1c lw r1,(r11+28)
8003698: 5c 20 00 09 bne r1,r0,80036bc <ualarm+0x48>
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
the_watchdog->routine = routine;
800369c: 78 01 08 00 mvhi r1,0x800
80036a0: 38 21 36 2c ori r1,r1,0x362c
Watchdog_Service_routine_entry routine,
Objects_Id id,
void *user_data
)
{
the_watchdog->state = WATCHDOG_INACTIVE;
80036a4: 59 60 00 08 sw (r11+8),r0
the_watchdog->routine = routine;
80036a8: 59 61 00 1c sw (r11+28),r1
the_watchdog->id = id;
80036ac: 59 60 00 20 sw (r11+32),r0
the_watchdog->user_data = user_data;
80036b0: 59 60 00 24 sw (r11+36),r0
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
useconds_t remaining = 0;
80036b4: 34 0c 00 00 mvi r12,0
80036b8: e0 00 00 18 bi 8003718 <ualarm+0xa4>
if ( !the_timer->routine ) {
_Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL );
} else {
Watchdog_States state;
state = _Watchdog_Remove( the_timer );
80036bc: b9 60 08 00 mv r1,r11
80036c0: f8 00 0f b4 calli 8007590 <_Watchdog_Remove>
if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) {
80036c4: 34 21 ff fe addi r1,r1,-2
80036c8: 34 02 00 01 mvi r2,1
useconds_t ualarm(
useconds_t useconds,
useconds_t interval
)
{
useconds_t remaining = 0;
80036cc: 34 0c 00 00 mvi r12,0
_Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL );
} else {
Watchdog_States state;
state = _Watchdog_Remove( the_timer );
if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) {
80036d0: 54 22 00 12 bgu r1,r2,8003718 <ualarm+0xa4> <== NEVER TAKEN
* boot. Since alarm() is dealing in seconds, we must account for
* this.
*/
ticks = the_timer->initial;
ticks -= (the_timer->stop_time - the_timer->start_time);
80036d4: 29 61 00 0c lw r1,(r11+12)
80036d8: 29 62 00 14 lw r2,(r11+20)
80036dc: b4 41 10 00 add r2,r2,r1
80036e0: 29 61 00 18 lw r1,(r11+24)
/* remaining is now in ticks */
_Timespec_From_ticks( ticks, &tp );
80036e4: c8 41 08 00 sub r1,r2,r1
80036e8: 37 82 00 14 addi r2,sp,20
80036ec: f8 00 0e 3c calli 8006fdc <_Timespec_From_ticks>
remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND;
80036f0: 78 03 08 01 mvhi r3,0x801
80036f4: 38 63 57 b4 ori r3,r3,0x57b4
80036f8: 28 62 00 00 lw r2,(r3+0)
80036fc: 2b 81 00 14 lw r1,(sp+20)
8003700: f8 00 43 82 calli 8014508 <__mulsi3>
8003704: b8 20 60 00 mv r12,r1
remaining += tp.tv_nsec / 1000;
8003708: 2b 81 00 18 lw r1,(sp+24)
800370c: 34 02 03 e8 mvi r2,1000
8003710: f8 00 43 8a calli 8014538 <__divsi3>
8003714: b4 2c 60 00 add r12,r1,r12
/*
* If useconds is non-zero, then the caller wants to schedule
* the alarm repeatedly at that interval. If the interval is
* less than a single clock tick, then fudge it to a clock tick.
*/
if ( useconds ) {
8003718: 45 a0 00 1a be r13,r0,8003780 <ualarm+0x10c>
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
800371c: 78 03 08 01 mvhi r3,0x801
8003720: 38 63 57 b4 ori r3,r3,0x57b4
8003724: 28 62 00 00 lw r2,(r3+0)
8003728: b9 a0 08 00 mv r1,r13
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
ticks = _Timespec_To_ticks( &tp );
800372c: 37 8b 00 14 addi r11,sp,20
* less than a single clock tick, then fudge it to a clock tick.
*/
if ( useconds ) {
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
8003730: f8 00 43 db calli 801469c <__udivsi3>
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
8003734: 78 03 08 01 mvhi r3,0x801
8003738: 38 63 57 b4 ori r3,r3,0x57b4
800373c: 28 62 00 00 lw r2,(r3+0)
* less than a single clock tick, then fudge it to a clock tick.
*/
if ( useconds ) {
Watchdog_Interval ticks;
tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND;
8003740: 5b 81 00 14 sw (sp+20),r1
tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000;
8003744: b9 a0 08 00 mv r1,r13
8003748: f8 00 43 e5 calli 80146dc <__umodsi3>
800374c: 34 02 03 e8 mvi r2,1000
8003750: f8 00 43 6e calli 8014508 <__mulsi3>
8003754: 5b 81 00 18 sw (sp+24),r1
ticks = _Timespec_To_ticks( &tp );
8003758: b9 60 08 00 mv r1,r11
800375c: f8 00 0e 3c calli 800704c <_Timespec_To_ticks>
if ( ticks == 0 )
ticks = 1;
_Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) );
8003760: b9 60 08 00 mv r1,r11
8003764: f8 00 0e 3a calli 800704c <_Timespec_To_ticks>
Watchdog_Control *the_watchdog,
Watchdog_Interval units
)
{
the_watchdog->initial = units;
8003768: 78 02 08 01 mvhi r2,0x801
800376c: 38 42 81 e0 ori r2,r2,0x81e0
8003770: 58 41 00 0c sw (r2+12),r1
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
8003774: 78 01 08 01 mvhi r1,0x801
8003778: 38 21 79 e0 ori r1,r1,0x79e0
800377c: f8 00 0f 28 calli 800741c <_Watchdog_Insert>
}
return remaining;
}
8003780: b9 80 08 00 mv r1,r12
8003784: 2b 9d 00 04 lw ra,(sp+4)
8003788: 2b 8b 00 10 lw r11,(sp+16)
800378c: 2b 8c 00 0c lw r12,(sp+12)
8003790: 2b 8d 00 08 lw r13,(sp+8)
8003794: 37 9c 00 18 addi sp,sp,24
8003798: c3 a0 00 00 ret
080031ec <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 )
{
80031ec: 37 9c ff b4 addi sp,sp,-76
80031f0: 5b 8b 00 10 sw (sp+16),r11
80031f4: 5b 8c 00 0c sw (sp+12),r12
80031f8: 5b 8d 00 08 sw (sp+8),r13
80031fc: 5b 9d 00 04 sw (sp+4),ra
int rv = 0;
rtems_filesystem_eval_path_context_t ctx;
int eval_flags = RTEMS_FS_FOLLOW_LINK;
const rtems_filesystem_location_info_t *currentloc =
8003200: 34 03 00 18 mvi r3,24
* 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 )
{
8003204: b8 20 10 00 mv r2,r1
int rv = 0;
rtems_filesystem_eval_path_context_t ctx;
int eval_flags = RTEMS_FS_FOLLOW_LINK;
const rtems_filesystem_location_info_t *currentloc =
8003208: 37 81 00 14 addi r1,sp,20
800320c: fb ff fe 09 calli 8002a30 <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;
8003210: 28 2b 00 14 lw r11,(r1+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)(
8003214: 29 62 00 0c lw r2,(r11+12)
8003218: 28 43 00 10 lw r3,(r2+16)
800321c: 29 62 00 24 lw r2,(r11+36)
8003220: d8 60 00 00 call r3
if ( rtems_filesystem_location_is_instance_root( currentloc ) ) {
8003224: 44 20 00 20 be r1,r0,80032a4 <unmount+0xb8>
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;
8003228: 78 01 08 01 mvhi r1,0x801
800322c: 38 21 51 90 ori r1,r1,0x5190
8003230: 28 21 00 00 lw r1,(r1+0)
const rtems_filesystem_location_info_t *current =
&rtems_filesystem_current->location;
return mt_entry == root->mt_entry || mt_entry == current->mt_entry;
8003234: 34 0d 00 01 mvi r13,1
)
{
const rtems_filesystem_location_info_t *root =
&rtems_filesystem_root->location;
const rtems_filesystem_location_info_t *current =
&rtems_filesystem_current->location;
8003238: 28 22 00 00 lw r2,(r1+0)
return mt_entry == root->mt_entry || mt_entry == current->mt_entry;
800323c: 28 21 00 04 lw r1,(r1+4)
8003240: 28 21 00 14 lw r1,(r1+20)
8003244: 45 61 00 03 be r11,r1,8003250 <unmount+0x64>
8003248: 28 4d 00 14 lw r13,(r2+20)
800324c: e5 6d 68 00 cmpe r13,r11,r13
const rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
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 ) ) {
8003250: 5d a0 00 12 bne r13,r0,8003298 <unmount+0xac>
const rtems_filesystem_operations_table *mt_point_ops =
mt_entry->mt_point_node->location.mt_entry->ops;
8003254: 29 61 00 20 lw r1,(r11+32)
8003258: 28 21 00 14 lw r1,(r1+20)
rv = (*mt_point_ops->unmount_h)( mt_entry );
800325c: 28 21 00 0c lw r1,(r1+12)
8003260: 28 22 00 38 lw r2,(r1+56)
8003264: b9 60 08 00 mv r1,r11
8003268: d8 40 00 00 call r2
800326c: b8 20 60 00 mv r12,r1
if ( rv == 0 ) {
8003270: 5c 2d 00 11 bne r1,r13,80032b4 <unmount+0xc8>
rtems_id self_task_id = rtems_task_self();
8003274: f8 00 02 a9 calli 8003d18 <rtems_task_self>
rtems_filesystem_mt_entry_declare_lock_context( lock_context );
rtems_filesystem_mt_entry_lock( lock_context );
8003278: 90 00 10 00 rcsr r2,IE
800327c: 34 03 ff fe mvi r3,-2
8003280: a0 43 18 00 and r3,r2,r3
8003284: d0 03 00 00 wcsr IE,r3
mt_entry->unmount_task = self_task_id;
8003288: 59 61 00 3c sw (r11+60),r1
mt_entry->mounted = false;
800328c: 31 60 00 28 sb (r11+40),r0
rtems_filesystem_mt_entry_unlock( lock_context );
8003290: d0 02 00 00 wcsr IE,r2
8003294: e0 00 00 08 bi 80032b4 <unmount+0xc8>
}
} else {
errno = EBUSY;
8003298: f8 00 26 87 calli 800ccb4 <__errno>
800329c: 34 02 00 10 mvi r2,16
80032a0: e0 00 00 03 bi 80032ac <unmount+0xc0>
rv = -1;
}
} else {
errno = EACCES;
80032a4: f8 00 26 84 calli 800ccb4 <__errno>
80032a8: 34 02 00 0d mvi r2,13
80032ac: 58 22 00 00 sw (r1+0),r2
rv = -1;
80032b0: 34 0c ff ff mvi r12,-1
}
rtems_filesystem_eval_path_cleanup( &ctx );
80032b4: 37 81 00 14 addi r1,sp,20
80032b8: fb ff fe 2b calli 8002b64 <rtems_filesystem_eval_path_cleanup>
if ( rv == 0 ) {
80032bc: 5d 80 00 0b bne r12,r0,80032e8 <unmount+0xfc>
rtems_interval ticks
)
{
rtems_event_set event_out;
return rtems_event_system_receive(
80032c0: 78 01 80 00 mvhi r1,0x8000
80032c4: 34 02 00 00 mvi r2,0
80032c8: 34 03 00 00 mvi r3,0
80032cc: 37 84 00 4c addi r4,sp,76
80032d0: f8 00 02 2e calli 8003b88 <rtems_event_system_receive>
rtems_status_code sc = rtems_event_transient_receive(
RTEMS_WAIT,
RTEMS_NO_TIMEOUT
);
if ( sc != RTEMS_SUCCESSFUL ) {
80032d4: 44 2c 00 05 be r1,r12,80032e8 <unmount+0xfc> <== ALWAYS TAKEN
rtems_fatal_error_occurred( 0xdeadbeef );
80032d8: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED
80032dc: 38 42 3e e0 ori r2,r2,0x3ee0 <== NOT EXECUTED
80032e0: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED
80032e4: f8 00 03 0d calli 8003f18 <rtems_fatal_error_occurred> <== NOT EXECUTED
}
}
return rv;
}
80032e8: b9 80 08 00 mv r1,r12
80032ec: 2b 9d 00 04 lw ra,(sp+4)
80032f0: 2b 8b 00 10 lw r11,(sp+16)
80032f4: 2b 8c 00 0c lw r12,(sp+12)
80032f8: 2b 8d 00 08 lw r13,(sp+8)
80032fc: 37 9c 00 4c addi sp,sp,76
8003300: c3 a0 00 00 ret
08018170 <write>:
ssize_t write(
int fd,
const void *buffer,
size_t count
)
{
8018170: 37 9c ff f0 addi sp,sp,-16
8018174: 5b 8b 00 0c sw (sp+12),r11
8018178: 5b 8c 00 08 sw (sp+8),r12
801817c: 5b 9d 00 04 sw (sp+4),ra
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
8018180: 78 04 08 01 mvhi r4,0x801
8018184: 38 84 a0 10 ori r4,r4,0xa010
ssize_t write(
int fd,
const void *buffer,
size_t count
)
{
8018188: b8 40 60 00 mv r12,r2
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
801818c: 28 82 00 00 lw r2,(r4+0)
8018190: 54 41 00 02 bgu r2,r1,8018198 <write+0x28>
8018194: e0 00 00 14 bi 80181e4 <write+0x74>
iop = rtems_libio_iop( fd );
8018198: 34 02 00 2c mvi r2,44
801819c: 78 0b 08 01 mvhi r11,0x801
80181a0: 5b 83 00 10 sw (sp+16),r3
80181a4: 39 6b a8 7c ori r11,r11,0xa87c
80181a8: fb ff fe 5b calli 8017b14 <__mulsi3>
80181ac: 29 64 00 00 lw r4,(r11+0)
rtems_libio_check_is_open( iop );
80181b0: 2b 83 00 10 lw r3,(sp+16)
)
{
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
80181b4: b4 81 20 00 add r4,r4,r1
rtems_libio_check_is_open( iop );
80181b8: 28 82 00 08 lw r2,(r4+8)
80181bc: 20 41 01 00 andi r1,r2,0x100
80181c0: 44 20 00 09 be r1,r0,80181e4 <write+0x74>
rtems_libio_check_buffer( buffer );
80181c4: 5d 80 00 04 bne r12,r0,80181d4 <write+0x64> <== ALWAYS TAKEN
80181c8: fb ff e6 c1 calli 8011ccc <__errno> <== NOT EXECUTED
80181cc: 34 02 00 16 mvi r2,22 <== NOT EXECUTED
80181d0: e0 00 00 07 bi 80181ec <write+0x7c> <== NOT EXECUTED
rtems_libio_check_count( count );
80181d4: 34 01 00 00 mvi r1,0
80181d8: 44 60 00 0d be r3,r0,801820c <write+0x9c>
rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF );
80181dc: 20 42 00 04 andi r2,r2,0x4
80181e0: 5c 40 00 06 bne r2,r0,80181f8 <write+0x88>
80181e4: fb ff e6 ba calli 8011ccc <__errno>
80181e8: 34 02 00 09 mvi r2,9
80181ec: 58 22 00 00 sw (r1+0),r2
80181f0: 34 01 ff ff mvi r1,-1
80181f4: e0 00 00 06 bi 801820c <write+0x9c>
/*
* Now process the write() request.
*/
return (*iop->pathinfo.handlers->write_h)( iop, buffer, count );
80181f8: 28 81 00 1c lw r1,(r4+28)
80181fc: b9 80 10 00 mv r2,r12
8018200: 28 25 00 0c lw r5,(r1+12)
8018204: b8 80 08 00 mv r1,r4
8018208: d8 a0 00 00 call r5
}
801820c: 2b 9d 00 04 lw ra,(sp+4)
8018210: 2b 8b 00 0c lw r11,(sp+12)
8018214: 2b 8c 00 08 lw r12,(sp+8)
8018218: 37 9c 00 10 addi sp,sp,16
801821c: c3 a0 00 00 ret
08004208 <writev>:
ssize_t writev(
int fd,
const struct iovec *iov,
int iovcnt
)
{
8004208: 37 9c ff dc addi sp,sp,-36
800420c: 5b 8b 00 24 sw (sp+36),r11
8004210: 5b 8c 00 20 sw (sp+32),r12
8004214: 5b 8d 00 1c sw (sp+28),r13
8004218: 5b 8e 00 18 sw (sp+24),r14
800421c: 5b 8f 00 14 sw (sp+20),r15
8004220: 5b 90 00 10 sw (sp+16),r16
8004224: 5b 91 00 0c sw (sp+12),r17
8004228: 5b 92 00 08 sw (sp+8),r18
800422c: 5b 9d 00 04 sw (sp+4),ra
8004230: b8 60 70 00 mv r14,r3
int bytes;
rtems_libio_t *iop;
ssize_t old;
bool all_zeros;
rtems_libio_check_fd( fd );
8004234: 78 03 08 01 mvhi r3,0x801
8004238: 38 63 60 10 ori r3,r3,0x6010
ssize_t writev(
int fd,
const struct iovec *iov,
int iovcnt
)
{
800423c: b8 40 60 00 mv r12,r2
int bytes;
rtems_libio_t *iop;
ssize_t old;
bool all_zeros;
rtems_libio_check_fd( fd );
8004240: 28 62 00 00 lw r2,(r3+0)
8004244: 54 41 00 02 bgu r2,r1,800424c <writev+0x44>
8004248: e0 00 00 0c bi 8004278 <writev+0x70>
iop = rtems_libio_iop( fd );
800424c: 78 0b 08 01 mvhi r11,0x801
8004250: 34 02 00 2c mvi r2,44
8004254: 39 6b 67 f8 ori r11,r11,0x67f8
8004258: f8 00 3c f8 calli 8013638 <__mulsi3>
800425c: 29 6d 00 00 lw r13,(r11+0)
8004260: b5 a1 68 00 add r13,r13,r1
rtems_libio_check_is_open( iop );
8004264: 29 a1 00 08 lw r1,(r13+8)
8004268: 20 22 01 00 andi r2,r1,0x100
800426c: 44 40 00 03 be r2,r0,8004278 <writev+0x70>
rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF );
8004270: 20 21 00 04 andi r1,r1,0x4
8004274: 5c 20 00 04 bne r1,r0,8004284 <writev+0x7c> <== ALWAYS TAKEN
8004278: f8 00 24 59 calli 800d3dc <__errno>
800427c: 34 02 00 09 mvi r2,9
8004280: e0 00 00 1d bi 80042f4 <writev+0xec>
/*
* Argument validation on IO vector
*/
if ( !iov )
8004284: 45 80 00 1a be r12,r0,80042ec <writev+0xe4>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt <= 0 )
8004288: 49 c0 00 02 bg r14,r0,8004290 <writev+0x88>
800428c: e0 00 00 18 bi 80042ec <writev+0xe4>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt > IOV_MAX )
8004290: 34 01 04 00 mvi r1,1024
8004294: 4c 2e 00 02 bge r1,r14,800429c <writev+0x94> <== ALWAYS TAKEN
8004298: e0 00 00 15 bi 80042ec <writev+0xe4> <== NOT EXECUTED
800429c: b9 80 58 00 mv r11,r12
80042a0: 34 0f 00 01 mvi r15,1
80042a4: 34 11 00 00 mvi r17,0
80042a8: 34 10 00 00 mvi r16,0
80042ac: e0 00 00 02 bi 80042b4 <writev+0xac>
if ( iov[v].iov_len )
all_zeros = false;
/* check for wrap */
old = total;
total += iov[v].iov_len;
80042b0: ba 40 80 00 mv r16,r18
/*
* 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 )
80042b4: 29 61 00 00 lw r1,(r11+0)
80042b8: 44 20 00 0d be r1,r0,80042ec <writev+0xe4>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iov[v].iov_len )
80042bc: 29 72 00 04 lw r18,(r11+4)
all_zeros = false;
/* check for wrap */
old = total;
total += iov[v].iov_len;
if ( total < old || total > SSIZE_MAX )
80042c0: 34 02 00 1f mvi r2,31
*/
if ( iov[v].iov_base == 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iov[v].iov_len )
all_zeros = false;
80042c4: 66 41 00 00 cmpei r1,r18,0
/* check for wrap */
old = total;
total += iov[v].iov_len;
80042c8: b6 12 90 00 add r18,r16,r18
*/
if ( iov[v].iov_base == 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iov[v].iov_len )
all_zeros = false;
80042cc: c8 01 08 00 sub r1,r0,r1
80042d0: a1 e1 78 00 and r15,r15,r1
/* check for wrap */
old = total;
total += iov[v].iov_len;
if ( total < old || total > SSIZE_MAX )
80042d4: ea 12 80 00 cmpg r16,r16,r18
80042d8: ba 40 08 00 mv r1,r18
80042dc: f8 00 3c b0 calli 801359c <__lshrsi3>
80042e0: b8 30 08 00 or r1,r1,r16
80042e4: 20 21 00 ff andi r1,r1,0xff
80042e8: 44 20 00 05 be r1,r0,80042fc <writev+0xf4>
rtems_set_errno_and_return_minus_one( EINVAL );
80042ec: f8 00 24 3c calli 800d3dc <__errno>
80042f0: 34 02 00 16 mvi r2,22
80042f4: 58 22 00 00 sw (r1+0),r2
80042f8: e0 00 00 16 bi 8004350 <writev+0x148>
* 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++ ) {
80042fc: 36 31 00 01 addi r17,r17,1
8004300: 35 6b 00 08 addi r11,r11,8
8004304: 49 d1 ff eb bg r14,r17,80042b0 <writev+0xa8>
/*
* A writev with all zeros is supposed to have no effect per OpenGroup.
*/
if ( all_zeros == true ) {
return 0;
8004308: 34 0b 00 00 mvi r11,0
}
/*
* A writev with all zeros is supposed to have no effect per OpenGroup.
*/
if ( all_zeros == true ) {
800430c: 5d e0 00 12 bne r15,r0,8004354 <writev+0x14c>
/*
* Now process the writev().
*/
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
/* all zero lengths has no effect */
if ( iov[v].iov_len == 0 )
8004310: 29 83 00 04 lw r3,(r12+4)
8004314: 44 60 00 0b be r3,r0,8004340 <writev+0x138> <== NEVER TAKEN
continue;
bytes = (*iop->pathinfo.handlers->write_h)(
8004318: 29 a1 00 1c lw r1,(r13+28)
800431c: 29 82 00 00 lw r2,(r12+0)
8004320: 28 24 00 0c lw r4,(r1+12)
8004324: b9 a0 08 00 mv r1,r13
8004328: d8 80 00 00 call r4
iop,
iov[v].iov_base,
iov[v].iov_len
);
if ( bytes < 0 )
800432c: 48 01 00 09 bg r0,r1,8004350 <writev+0x148> <== NEVER TAKEN
return -1;
if ( bytes > 0 ) {
8004330: 44 20 00 02 be r1,r0,8004338 <writev+0x130> <== NEVER TAKEN
total += bytes;
8004334: b5 61 58 00 add r11,r11,r1
}
if (bytes != iov[ v ].iov_len)
8004338: 29 82 00 04 lw r2,(r12+4)
800433c: 5c 22 00 06 bne r1,r2,8004354 <writev+0x14c> <== NEVER TAKEN
}
/*
* Now process the writev().
*/
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
8004340: 35 ef 00 01 addi r15,r15,1
8004344: 35 8c 00 08 addi r12,r12,8
8004348: 49 cf ff f2 bg r14,r15,8004310 <writev+0x108>
800434c: e0 00 00 02 bi 8004354 <writev+0x14c>
iov[v].iov_base,
iov[v].iov_len
);
if ( bytes < 0 )
return -1;
8004350: 34 0b ff ff mvi r11,-1
if (bytes != iov[ v ].iov_len)
break;
}
return total;
}
8004354: b9 60 08 00 mv r1,r11
8004358: 2b 9d 00 04 lw ra,(sp+4)
800435c: 2b 8b 00 24 lw r11,(sp+36)
8004360: 2b 8c 00 20 lw r12,(sp+32)
8004364: 2b 8d 00 1c lw r13,(sp+28)
8004368: 2b 8e 00 18 lw r14,(sp+24)
800436c: 2b 8f 00 14 lw r15,(sp+20)
8004370: 2b 90 00 10 lw r16,(sp+16)
8004374: 2b 91 00 0c lw r17,(sp+12)
8004378: 2b 92 00 08 lw r18,(sp+8)
800437c: 37 9c 00 24 addi sp,sp,36
8004380: c3 a0 00 00 ret