=============================================================================== 080037e0 : */ 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 52 28 ori r11,r11,0x5228 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 29 1c ori r21,r21,0x291c 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 29 7c ori r20,r20,0x297c ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { 8003868: 3a 73 2a 00 ori r19,r19,0x2a00 default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); 800386c: 3a 52 24 ec ori r18,r18,0x24ec case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 8003870: 3a 31 29 68 ori r17,r17,0x2968 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 8003874: 39 ad 29 54 ori r13,r13,0x2954 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 29 48 ori r16,r16,0x2948 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 29 38 ori r15,r15,0x2938 case IMFS_DIRECTORY: fprintf(stdout, "/" ); break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 8003880: 39 ce 29 24 ori r14,r14,0x2924 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 !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 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 32 cb calli 80103cc !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_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 32 c6 calli 80103cc 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 <== NEVER TAKEN 80038c8: b8 60 08 00 mv r1,r3 80038cc: 34 02 00 02 mvi r2,2 80038d0: f8 00 75 07 calli 8020cec <__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 32 74 calli 80102bc 80038f0: e0 00 00 1f bi 800396c 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 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 32 42 calli 8010220 800391c: e0 00 00 14 bi 800396c 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 32 3c calli 8010220 8003934: e0 00 00 0e bi 800396c 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 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 32 9f calli 80103cc 8003954: e0 00 00 08 bi 8003974 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 32 2f calli 8010220 <== NOT EXECUTED 8003968: e0 00 00 03 bi 8003974 <== NOT EXECUTED return; } puts(""); 800396c: ba 40 08 00 mv r1,r18 8003970: f8 00 3a 26 calli 8012208 } 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( 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 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 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 =============================================================================== 0800806c : rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 800806c: 37 9c ff e0 addi sp,sp,-32 8008070: 5b 8b 00 20 sw (sp+32),r11 8008074: 5b 8c 00 1c sw (sp+28),r12 8008078: 5b 8d 00 18 sw (sp+24),r13 800807c: 5b 8e 00 14 sw (sp+20),r14 8008080: 5b 8f 00 10 sw (sp+16),r15 8008084: 5b 90 00 0c sw (sp+12),r16 8008088: 5b 91 00 08 sw (sp+8),r17 800808c: 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; 8008090: 28 2d 00 20 lw r13,(r1+32) rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 8008094: b8 60 78 00 mv r15,r3 8008098: 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( 800809c: 29 a3 00 30 lw r3,(r13+48) 80080a0: 2d a4 00 3c lhu r4,(r13+60) 80080a4: 2d a5 00 3e lhu r5,(r13+62) 80080a8: 34 02 00 01 mvi r2,1 rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 80080ac: 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( 80080b0: f8 00 03 43 calli 8008dbc void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 80080b4: 34 0e 00 01 mvi r14,1 dir->st_mode, dir->st_uid, dir->st_gid ); if ( access_ok ) { 80080b8: 44 20 00 46 be r1,r0,80081d0 static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; 80080bc: 5e 0e 00 50 bne r16,r14,80081fc 80080c0: 41 e2 00 00 lbu r2,(r15+0) 80080c4: 34 01 00 2e mvi r1,46 80080c8: 5c 41 00 4f bne r2,r1,8008204 80080cc: e0 00 00 15 bi 8008120 static inline bool rtems_filesystem_is_parent_directory( const char *token, size_t tokenlen ) { return tokenlen == 2 && token [0] == '.' && token [1] == '.'; 80080d0: 41 e1 00 00 lbu r1,(r15+0) 80080d4: 34 02 00 2e mvi r2,46 80080d8: 5c 22 00 4b bne r1,r2,8008204 80080dc: 41 e2 00 01 lbu r2,(r15+1) 80080e0: 5c 41 00 49 bne r2,r1,8008204 <== NEVER TAKEN { if ( rtems_filesystem_is_current_directory( token, tokenlen ) ) { return dir; } else { if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { return dir->Parent; 80080e4: 29 ab 00 08 lw r11,(r13+8) 80080e8: e0 00 00 0f bi 8008124 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 80080ec: 35 c1 00 0c addi r1,r14,12 80080f0: b9 e0 10 00 mv r2,r15 80080f4: 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; 80080f8: b9 c0 58 00 mv r11,r14 bool match = strncmp( entry->name, token, tokenlen ) == 0 80080fc: f8 00 14 38 calli 800d1dc && entry->name [tokenlen] == '\0'; 8008100: 5c 20 00 44 bne r1,r0,8008210 8008104: b5 d0 10 00 add r2,r14,r16 8008108: 40 42 00 0c lbu r2,(r2+12) 800810c: 44 41 00 06 be r2,r1,8008124 8008110: e0 00 00 40 bi 8008210 } 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 ) { 8008114: 5d d1 ff f6 bne r14,r17,80080ec rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; 8008118: 34 0e 00 02 mvi r14,2 800811c: e0 00 00 2d bi 80081d0 static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; 8008120: b9 a0 58 00 mv r11,r13 8008124: 34 0e 00 02 mvi r14,2 ); if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { 8008128: 45 60 00 2a be r11,r0,80081d0 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 800812c: 29 61 00 4c lw r1,(r11+76) bool terminal = !rtems_filesystem_eval_path_has_path( ctx ); 8008130: 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 ); } 8008134: 29 82 00 10 lw r2,(r12+16) 8008138: 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; 800813c: 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 ); 8008140: 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)) { 8008144: 5c 2e 00 06 bne r1,r14,800815c 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; 8008148: 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)) { 800814c: 5c 40 00 02 bne r2,r0,8008154 8008150: 5c 62 00 32 bne r3,r2,8008218 <== ALWAYS TAKEN entry = entry->info.hard_link.link_node; 8008154: 29 6b 00 50 lw r11,(r11+80) 8008158: e0 00 00 30 bi 8008218 } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 800815c: 34 04 00 03 mvi r4,3 8008160: 5c 24 00 0d bne r1,r4,8008194 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; 8008164: 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)) { 8008168: 5c 20 00 02 bne r1,r0,8008170 800816c: 5c 61 00 2b bne r3,r1,8008218 const char *target = entry->info.sym_link.name; 8008170: 29 6b 00 50 lw r11,(r11+80) void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 8008174: 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 ) ); 8008178: b9 60 08 00 mv r1,r11 800817c: f8 00 13 e9 calli 800d120 8008180: b8 20 18 00 mv r3,r1 8008184: b9 60 10 00 mv r2,r11 8008188: b9 80 08 00 mv r1,r12 800818c: fb ff ea 97 calli 8002be8 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)) { 8008190: e0 00 00 10 bi 80081d0 IMFS_jnode_types_t type ) { rtems_filesystem_global_location_t **fs_root_ptr = NULL; if ( type == IMFS_DIRECTORY ) { 8008194: 5c 20 00 21 bne r1,r0,8008218 if ( node->info.directory.mt_fs != NULL ) { 8008198: 29 62 00 5c lw r2,(r11+92) 800819c: 44 41 00 1f be r2,r1,8008218 if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( 80081a0: 29 63 00 30 lw r3,(r11+48) 80081a4: 2d 64 00 3c lhu r4,(r11+60) 80081a8: 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; 80081ac: 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( 80081b0: b9 80 08 00 mv r1,r12 80081b4: 34 02 00 01 mvi r2,1 80081b8: f8 00 03 01 calli 8008dbc void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 80081bc: 34 0e 00 01 mvi r14,1 RTEMS_FS_PERMS_EXEC, entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { 80081c0: 44 20 00 04 be r1,r0,80081d0 <== NEVER TAKEN rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); 80081c4: b9 80 08 00 mv r1,r12 80081c8: b9 a0 10 00 mv r2,r13 80081cc: fb ff ea 63 calli 8002b58 status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } 80081d0: b9 c0 08 00 mv r1,r14 80081d4: 2b 9d 00 04 lw ra,(sp+4) 80081d8: 2b 8b 00 20 lw r11,(sp+32) 80081dc: 2b 8c 00 1c lw r12,(sp+28) 80081e0: 2b 8d 00 18 lw r13,(sp+24) 80081e4: 2b 8e 00 14 lw r14,(sp+20) 80081e8: 2b 8f 00 10 lw r15,(sp+16) 80081ec: 2b 90 00 0c lw r16,(sp+12) 80081f0: 2b 91 00 08 lw r17,(sp+8) 80081f4: 37 9c 00 20 addi sp,sp,32 80081f8: 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] == '.'; 80081fc: 34 01 00 02 mvi r1,2 8008200: 46 01 ff b4 be r16,r1,80080d0 }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 8008204: 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 ); 8008208: 35 b1 00 54 addi r17,r13,84 800820c: e3 ff ff c2 bi 8008114 }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 8008210: 29 ce 00 00 lw r14,(r14+0) 8008214: e3 ff ff c0 bi 8008114 } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; 8008218: 2d a1 00 34 lhu r1,(r13+52) void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 800821c: 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; 8008220: 34 21 ff ff addi r1,r1,-1 8008224: 0d a1 00 34 sh (r13+52),r1 ++entry->reference_count; 8008228: 2d 61 00 34 lhu r1,(r11+52) 800822c: 34 21 00 01 addi r1,r1,1 8008230: 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; 8008234: 29 61 00 4c lw r1,(r11+76) currentloc->node_access = entry; 8008238: 59 8b 00 20 sw (r12+32),r11 800823c: 28 21 00 04 lw r1,(r1+4) 8008240: 59 81 00 28 sw (r12+40),r1 8008244: e3 ff ff e3 bi 80081d0 =============================================================================== 08001790 : static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 8001790: 37 9c ff ec addi sp,sp,-20 8001794: 5b 8b 00 0c sw (sp+12),r11 8001798: 5b 8c 00 08 sw (sp+8),r12 800179c: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode = iop->pathinfo.node_access; 80017a0: 28 2c 00 14 lw r12,(r1+20) static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 80017a4: b8 20 20 00 mv r4,r1 IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 80017a8: 29 81 00 50 lw r1,(r12+80) 80017ac: f8 00 23 cf calli 800a6e8 80017b0: b8 20 58 00 mv r11,r1 if (err > 0) { 80017b4: 4c 01 00 08 bge r0,r1,80017d4 IMFS_mtime_ctime_update(jnode); 80017b8: 37 81 00 10 addi r1,sp,16 80017bc: 34 02 00 00 mvi r2,0 80017c0: f8 00 03 d6 calli 8002718 80017c4: 2b 81 00 10 lw r1,(sp+16) 80017c8: 59 81 00 44 sw (r12+68),r1 80017cc: 59 81 00 48 sw (r12+72),r1 80017d0: e0 00 00 06 bi 80017e8 } IMFS_FIFO_RETURN(err); 80017d4: 44 20 00 05 be r1,r0,80017e8 <== NEVER TAKEN 80017d8: c8 0b 58 00 sub r11,r0,r11 80017dc: f8 00 2e 46 calli 800d0f4 <__errno> 80017e0: 58 2b 00 00 sw (r1+0),r11 80017e4: 34 0b ff ff mvi r11,-1 } 80017e8: b9 60 08 00 mv r1,r11 80017ec: 2b 9d 00 04 lw ra,(sp+4) 80017f0: 2b 8b 00 0c lw r11,(sp+12) 80017f4: 2b 8c 00 08 lw r12,(sp+8) 80017f8: 37 9c 00 14 addi sp,sp,20 80017fc: c3 a0 00 00 ret =============================================================================== 080082bc : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 80082bc: 37 9c ff d8 addi sp,sp,-40 80082c0: 5b 8b 00 10 sw (sp+16),r11 80082c4: 5b 8c 00 0c sw (sp+12),r12 80082c8: 5b 8d 00 08 sw (sp+8),r13 80082cc: 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; 80082d0: 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 ); 80082d4: 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; 80082d8: 28 2b 00 08 lw r11,(r1+8) 80082dc: 28 26 00 00 lw r6,(r1+0) 80082e0: 28 25 00 04 lw r5,(r1+4) 80082e4: 28 24 00 0c lw r4,(r1+12) 80082e8: 28 23 00 10 lw r3,(r1+16) 80082ec: 28 22 00 14 lw r2,(r1+20) 80082f0: 5b 86 00 14 sw (sp+20),r6 80082f4: 5b 85 00 18 sw (sp+24),r5 80082f8: 5b 8b 00 1c sw (sp+28),r11 80082fc: 5b 84 00 20 sw (sp+32),r4 8008300: 5b 83 00 24 sw (sp+36),r3 8008304: 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; 8008308: 58 20 00 08 sw (r1+8),r0 800830c: 29 61 00 4c lw r1,(r11+76) do { next = jnode->Parent; 8008310: 29 6d 00 08 lw r13,(r11+8) loc.node_access = (void *)jnode; 8008314: 5b 8b 00 1c sw (sp+28),r11 8008318: 28 22 00 04 lw r2,(r1+4) IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { 800831c: 28 21 00 00 lw r1,(r1+0) 8008320: 5b 82 00 24 sw (sp+36),r2 8008324: 5c 20 00 04 bne r1,r0,8008334 8008328: 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 ); 800832c: 35 61 00 54 addi r1,r11,84 8008330: 5c 41 00 0c bne r2,r1,8008360 result = IMFS_rmnod( NULL, &loc ); 8008334: 34 01 00 00 mvi r1,0 8008338: b9 80 10 00 mv r2,r12 800833c: fb ff e3 0e calli 8000f74 if ( result != 0 ) 8008340: 44 20 00 05 be r1,r0,8008354 <== ALWAYS TAKEN rtems_fatal_error_occurred( 0xdeadbeef ); 8008344: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8008348: 38 42 b9 84 ori r2,r2,0xb984 <== NOT EXECUTED 800834c: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 8008350: fb ff ef 12 calli 8003f98 <== NOT EXECUTED IMFS_node_destroy( jnode ); 8008354: b9 60 08 00 mv r1,r11 8008358: fb ff e2 24 calli 8000be8 jnode = next; 800835c: b9 a0 58 00 mv r11,r13 } if ( jnode != NULL ) { 8008360: 45 60 00 09 be r11,r0,8008384 return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 8008364: 29 61 00 4c lw r1,(r11+76) if ( IMFS_is_directory( jnode ) ) { 8008368: 28 21 00 00 lw r1,(r1+0) 800836c: 5c 20 ff e8 bne r1,r0,800830c <== NEVER TAKEN if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); } 8008370: 29 61 00 50 lw r1,(r11+80) 8008374: 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 ) ) 8008378: 44 22 ff e5 be r1,r2,800830c jnode = jnode_get_first_child( jnode ); 800837c: b8 20 58 00 mv r11,r1 } } } while (jnode != NULL); 8008380: 5c 20 ff e3 bne r1,r0,800830c <== ALWAYS TAKEN } 8008384: 2b 9d 00 04 lw ra,(sp+4) 8008388: 2b 8b 00 10 lw r11,(sp+16) 800838c: 2b 8c 00 0c lw r12,(sp+12) 8008390: 2b 8d 00 08 lw r13,(sp+8) 8008394: 37 9c 00 28 addi sp,sp,40 8008398: c3 a0 00 00 ret =============================================================================== 08000a8c : 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] ) { 8000a8c: 37 9c ff ec addi sp,sp,-20 8000a90: 5b 8b 00 14 sw (sp+20),r11 8000a94: 5b 8c 00 10 sw (sp+16),r12 8000a98: 5b 8d 00 0c sw (sp+12),r13 8000a9c: 5b 8e 00 08 sw (sp+8),r14 8000aa0: 5b 9d 00 04 sw (sp+4),ra 8000aa4: b8 20 68 00 mv r13,r1 8000aa8: 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 ) ); 8000aac: 34 01 00 01 mvi r1,1 8000ab0: 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] ) { 8000ab4: 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 ) ); 8000ab8: f8 00 01 d7 calli 8001214 8000abc: b8 20 60 00 mv r12,r1 if ( fs_info != NULL ) { 8000ac0: 44 20 00 2d be r1,r0,8000b74 IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 8000ac4: 78 03 08 01 mvhi r3,0x801 8000ac8: 38 63 d7 18 ori r3,r3,0xd718 8000acc: 28 62 00 00 lw r2,(r3+0) 8000ad0: 58 22 00 00 sw (r1+0),r2 8000ad4: 34 42 00 01 addi r2,r2,1 8000ad8: 58 62 00 00 sw (r3+0),r2 memcpy( 8000adc: 29 62 00 00 lw r2,(r11+0) 8000ae0: 29 66 00 10 lw r6,(r11+16) 8000ae4: 29 65 00 14 lw r5,(r11+20) 8000ae8: 29 64 00 18 lw r4,(r11+24) 8000aec: 29 69 00 04 lw r9,(r11+4) 8000af0: 29 68 00 08 lw r8,(r11+8) 8000af4: 29 67 00 0c lw r7,(r11+12) fs_info->node_controls, 8000af8: 34 23 00 08 addi r3,r1,8 if ( fs_info != NULL ) { IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; memcpy( 8000afc: 58 22 00 08 sw (r1+8),r2 8000b00: 58 66 00 10 sw (r3+16),r6 8000b04: 58 65 00 14 sw (r3+20),r5 8000b08: 58 64 00 18 sw (r3+24),r4 8000b0c: 58 69 00 04 sw (r3+4),r9 8000b10: 58 68 00 08 sw (r3+8),r8 8000b14: 58 67 00 0c sw (r3+12),r7 fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( 8000b18: 78 03 08 01 mvhi r3,0x801 8000b1c: 38 63 b3 2c ori r3,r3,0xb32c 8000b20: 34 04 00 00 mvi r4,0 8000b24: 34 05 41 ed mvi r5,16877 8000b28: 34 06 00 00 mvi r6,0 8000b2c: f8 00 1c f3 calli 8007ef8 "", 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { 8000b30: 44 20 00 11 be r1,r0,8000b74 <== NEVER TAKEN mt_entry->fs_info = fs_info; mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; 8000b34: 78 02 08 01 mvhi r2,0x801 8000b38: 38 42 bb dc ori r2,r2,0xbbdc 8000b3c: 59 a2 00 2c sw (r13+44),r2 mt_entry->mt_fs_root->location.node_access = root_node; 8000b40: 29 a2 00 24 lw r2,(r13+36) 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; 8000b44: 59 ac 00 08 sw (r13+8),r12 mt_entry->ops = op_table; 8000b48: 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; 8000b4c: 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; 8000b50: 28 21 00 4c lw r1,(r1+76) errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 8000b54: 34 0c 00 06 mvi r12,6 8000b58: 28 21 00 04 lw r1,(r1+4) 8000b5c: 58 41 00 10 sw (r2+16),r1 8000b60: 78 01 08 01 mvhi r1,0x801 8000b64: 38 21 d0 14 ori r1,r1,0xd014 8000b68: 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) { 8000b6c: 34 01 00 10 mvi r1,16 8000b70: e0 00 00 06 bi 8000b88 } else { errno = ENOMEM; rv = -1; } } else { errno = ENOMEM; 8000b74: f8 00 2b 26 calli 800b80c <__errno> 8000b78: 34 02 00 0c mvi r2,12 8000b7c: 58 22 00 00 sw (r1+0),r2 8000b80: 34 01 ff ff mvi r1,-1 8000b84: e0 00 00 0c bi 8000bb4 /* * 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) { 8000b88: 44 2b 00 07 be r1,r11,8000ba4 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) 8000b8c: 48 2b 00 05 bg r1,r11,8000ba0 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 8000b90: 34 02 00 01 mvi r2,1 8000b94: 35 8c ff ff addi r12,r12,-1 8000b98: f8 00 65 a8 calli 801a238 <__ashlsi3> 8000b9c: 5d 80 ff fb bne r12,r0,8000b88 <== ALWAYS TAKEN if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); 8000ba0: 34 0b 00 80 mvi r11,128 break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) 8000ba4: 78 01 08 01 mvhi r1,0x801 8000ba8: 38 21 d7 14 ori r1,r1,0xd714 8000bac: 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; 8000bb0: 34 01 00 00 mvi r1,0 IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK ); } return rv; } 8000bb4: 2b 9d 00 04 lw ra,(sp+4) 8000bb8: 2b 8b 00 14 lw r11,(sp+20) 8000bbc: 2b 8c 00 10 lw r12,(sp+16) 8000bc0: 2b 8d 00 0c lw r13,(sp+12) 8000bc4: 2b 8e 00 08 lw r14,(sp+8) 8000bc8: 37 9c 00 14 addi sp,sp,20 8000bcc: c3 a0 00 00 ret =============================================================================== 08002cf8 : 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 91 7c ori r5,r5,0x917c 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 8002d44: 54 c1 00 03 bgu r6,r1,8002d50 <== ALWAYS TAKEN 8002d48: 34 01 10 00 mvi r1,4096 <== NOT EXECUTED 8002d4c: e0 00 00 04 bi 8002d5c <== NOT EXECUTED 8002d50: 34 01 60 00 mvi r1,24576 8002d54: 44 c1 00 03 be r6,r1,8002d60 8002d58: 34 21 20 00 addi r1,r1,8192 8002d5c: 5c c1 00 2b bne r6,r1,8002e08 <== 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 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 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 8002d88: 44 20 00 19 be r1,r0,8002dec 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 28 c3 calli 800d0b4 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_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 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 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 } 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 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 8002e04: e0 00 00 05 bi 8002e18 } else { errno = EINVAL; 8002e08: f8 00 39 12 calli 8011250 <__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 =============================================================================== 0800a8a4 : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 800a8a4: 37 9c ff d0 addi sp,sp,-48 800a8a8: 5b 8b 00 28 sw (sp+40),r11 800a8ac: 5b 8c 00 24 sw (sp+36),r12 800a8b0: 5b 8d 00 20 sw (sp+32),r13 800a8b4: 5b 8e 00 1c sw (sp+28),r14 800a8b8: 5b 8f 00 18 sw (sp+24),r15 800a8bc: 5b 90 00 14 sw (sp+20),r16 800a8c0: 5b 91 00 10 sw (sp+16),r17 800a8c4: 5b 92 00 0c sw (sp+12),r18 800a8c8: 5b 93 00 08 sw (sp+8),r19 800a8cc: 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 ) 800a8d0: 78 0e 08 01 mvhi r14,0x801 800a8d4: 39 ce d7 14 ori r14,r14,0xd714 800a8d8: 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 ) { 800a8dc: b8 20 60 00 mv r12,r1 800a8e0: 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 ) 800a8e4: b9 60 08 00 mv r1,r11 800a8e8: 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 ) { 800a8ec: 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 ) 800a8f0: f8 00 3e a0 calli 801a370 <__lshrsi3> 800a8f4: b8 20 78 00 mv r15,r1 800a8f8: b9 e0 10 00 mv r2,r15 800a8fc: 34 21 00 01 addi r1,r1,1 800a900: f8 00 3e c3 calli 801a40c <__mulsi3> 800a904: b9 e0 10 00 mv r2,r15 800a908: 34 21 00 01 addi r1,r1,1 800a90c: f8 00 3e c0 calli 801a40c <__mulsi3> 800a910: 34 21 ff ff addi r1,r1,-1 800a914: b9 60 10 00 mv r2,r11 800a918: f8 00 3e bd calli 801a40c <__mulsi3> 800a91c: 54 2d 00 04 bgu r1,r13,800a92c rtems_set_errno_and_return_minus_one( EFBIG ); 800a920: f8 00 03 bb calli 800b80c <__errno> 800a924: 34 02 00 1b mvi r2,27 800a928: e0 00 00 2a bi 800a9d0 /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) 800a92c: 29 8f 00 50 lw r15,(r12+80) return 0; 800a930: 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 ) 800a934: 4d ed 00 39 bge r15,r13,800aa18 <== NEVER TAKEN return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 800a938: b9 60 10 00 mv r2,r11 800a93c: b9 a0 08 00 mv r1,r13 800a940: f8 00 3e bf calli 801a43c <__divsi3> old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 800a944: 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; 800a948: b8 20 88 00 mv r17,r1 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 800a94c: b9 e0 08 00 mv r1,r15 800a950: f8 00 3e bb calli 801a43c <__divsi3> offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK; 800a954: 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; 800a958: b8 20 80 00 mv r16,r1 offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK; 800a95c: f8 00 3e ac calli 801a40c <__mulsi3> 800a960: c9 e1 78 00 sub r15,r15,r1 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 800a964: ba 00 58 00 mv r11,r16 800a968: e0 00 00 1e bi 800a9e0 if ( !IMFS_memfile_addblock( the_jnode, block ) ) { 800a96c: b9 80 08 00 mv r1,r12 800a970: b9 60 10 00 mv r2,r11 800a974: fb ff ff 29 calli 800a618 800a978: b8 20 18 00 mv r3,r1 800a97c: 5c 20 00 12 bne r1,r0,800a9c4 if ( zero_fill ) { 800a980: 46 41 00 17 be r18,r1,800a9dc size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; block_p *block_ptr = 800a984: b9 60 10 00 mv r2,r11 800a988: 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; 800a98c: 29 d3 00 00 lw r19,(r14+0) block_p *block_ptr = 800a990: fb ff fd fa calli 800a178 IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 800a994: 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; 800a998: 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); 800a99c: 34 02 00 00 mvi r2,0 800a9a0: b4 8f 08 00 add r1,r4,r15 800a9a4: ba 60 18 00 mv r3,r19 800a9a8: f8 00 06 d4 calli 800c4f8 offset = 0; 800a9ac: 34 0f 00 00 mvi r15,0 800a9b0: e0 00 00 0b bi 800a9dc } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); 800a9b4: b9 60 10 00 mv r2,r11 800a9b8: b9 80 08 00 mv r1,r12 800a9bc: fb ff ff ae calli 800a874 memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 800a9c0: 35 6b ff ff addi r11,r11,-1 800a9c4: 51 70 ff fc bgeu r11,r16,800a9b4 IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 800a9c8: f8 00 03 91 calli 800b80c <__errno> 800a9cc: 34 02 00 1c mvi r2,28 800a9d0: 58 22 00 00 sw (r1+0),r2 800a9d4: 34 04 ff ff mvi r4,-1 800a9d8: e0 00 00 10 bi 800aa18 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++ ) { 800a9dc: 35 6b 00 01 addi r11,r11,1 800a9e0: 52 2b ff e3 bgeu r17,r11,800a96c /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); 800a9e4: 37 8b 00 2c addi r11,sp,44 800a9e8: 34 02 00 00 mvi r2,0 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; 800a9ec: 59 8d 00 50 sw (r12+80),r13 IMFS_update_ctime(the_jnode); 800a9f0: b9 60 08 00 mv r1,r11 800a9f4: fb ff db 06 calli 800160c 800a9f8: 2b 81 00 2c lw r1,(sp+44) IMFS_update_mtime(the_jnode); 800a9fc: 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); 800aa00: 59 81 00 48 sw (r12+72),r1 IMFS_update_mtime(the_jnode); 800aa04: b9 60 08 00 mv r1,r11 800aa08: fb ff db 01 calli 800160c 800aa0c: 2b 81 00 2c lw r1,(sp+44) return 0; 800aa10: 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); 800aa14: 59 81 00 44 sw (r12+68),r1 return 0; } 800aa18: b8 80 08 00 mv r1,r4 800aa1c: 2b 9d 00 04 lw ra,(sp+4) 800aa20: 2b 8b 00 28 lw r11,(sp+40) 800aa24: 2b 8c 00 24 lw r12,(sp+36) 800aa28: 2b 8d 00 20 lw r13,(sp+32) 800aa2c: 2b 8e 00 1c lw r14,(sp+28) 800aa30: 2b 8f 00 18 lw r15,(sp+24) 800aa34: 2b 90 00 14 lw r16,(sp+20) 800aa38: 2b 91 00 10 lw r17,(sp+16) 800aa3c: 2b 92 00 0c lw r18,(sp+12) 800aa40: 2b 93 00 08 lw r19,(sp+8) 800aa44: 37 9c 00 30 addi sp,sp,48 800aa48: c3 a0 00 00 ret =============================================================================== 0800a178 : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 800a178: 37 9c ff e0 addi sp,sp,-32 800a17c: 5b 8b 00 20 sw (sp+32),r11 800a180: 5b 8c 00 1c sw (sp+28),r12 800a184: 5b 8d 00 18 sw (sp+24),r13 800a188: 5b 8e 00 14 sw (sp+20),r14 800a18c: 5b 8f 00 10 sw (sp+16),r15 800a190: 5b 90 00 0c sw (sp+12),r16 800a194: 5b 91 00 08 sw (sp+8),r17 800a198: 5b 9d 00 04 sw (sp+4),ra 800a19c: b8 20 68 00 mv r13,r1 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 800a1a0: 78 01 08 01 mvhi r1,0x801 800a1a4: 38 21 d7 14 ori r1,r1,0xd714 800a1a8: 28 21 00 00 lw r1,(r1+0) #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 800a1ac: b8 40 70 00 mv r14,r2 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 800a1b0: 34 02 00 02 mvi r2,2 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 800a1b4: b8 60 78 00 mv r15,r3 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 800a1b8: f8 00 40 6e calli 801a370 <__lshrsi3> 800a1bc: b8 20 60 00 mv r12,r1 800a1c0: 34 21 ff ff addi r1,r1,-1 800a1c4: 55 c1 00 12 bgu r14,r1,800a20c p = info->indirect; 800a1c8: 29 ac 00 54 lw r12,(r13+84) if ( malloc_it ) { 800a1cc: 45 e0 00 0c be r15,r0,800a1fc if ( !p ) { 800a1d0: 5d 80 00 05 bne r12,r0,800a1e4 p = memfile_alloc_block(); 800a1d4: fb ff ff d9 calli 800a138 if ( !p ) return 0; 800a1d8: 34 0b 00 00 mvi r11,0 if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) 800a1dc: 44 2c 00 81 be r1,r12,800a3e0 <== NEVER TAKEN return 0; info->indirect = p; 800a1e0: 59 a1 00 54 sw (r13+84),r1 } return &info->indirect[ my_block ]; 800a1e4: b9 c0 08 00 mv r1,r14 800a1e8: 34 02 00 02 mvi r2,2 800a1ec: f8 00 40 13 calli 801a238 <__ashlsi3> 800a1f0: 29 ab 00 54 lw r11,(r13+84) 800a1f4: b5 61 58 00 add r11,r11,r1 800a1f8: e0 00 00 7a bi 800a3e0 } if ( !p ) return 0; 800a1fc: 34 0b 00 00 mvi r11,0 return &info->indirect[ my_block ]; 800a200: b9 c0 08 00 mv r1,r14 info->indirect = p; } return &info->indirect[ my_block ]; } if ( !p ) 800a204: 5d 8b 00 74 bne r12,r11,800a3d4 <== ALWAYS TAKEN 800a208: e0 00 00 76 bi 800a3e0 <== NOT EXECUTED /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 800a20c: 35 81 00 01 addi r1,r12,1 800a210: b9 80 10 00 mv r2,r12 800a214: f8 00 40 7e calli 801a40c <__mulsi3> 800a218: b8 20 80 00 mv r16,r1 800a21c: 34 21 ff ff addi r1,r1,-1 800a220: 55 c1 00 2b bgu r14,r1,800a2cc my_block -= FIRST_DOUBLY_INDIRECT; 800a224: c9 cc 70 00 sub r14,r14,r12 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 800a228: b9 80 10 00 mv r2,r12 800a22c: b9 c0 08 00 mv r1,r14 800a230: f8 00 40 ec calli 801a5e0 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800a234: 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; 800a238: b8 20 80 00 mv r16,r1 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800a23c: b9 c0 08 00 mv r1,r14 800a240: f8 00 40 d8 calli 801a5a0 <__udivsi3> 800a244: b8 20 70 00 mv r14,r1 p = info->doubly_indirect; 800a248: 29 ac 00 58 lw r12,(r13+88) if ( malloc_it ) { 800a24c: 45 e0 00 17 be r15,r0,800a2a8 if ( !p ) { 800a250: 5d 80 00 06 bne r12,r0,800a268 p = memfile_alloc_block(); 800a254: fb ff ff b9 calli 800a138 800a258: b8 20 60 00 mv r12,r1 if ( !p ) return 0; 800a25c: 34 0b 00 00 mvi r11,0 p = info->doubly_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) 800a260: 44 20 00 60 be r1,r0,800a3e0 <== NEVER TAKEN return 0; info->doubly_indirect = p; 800a264: 59 a1 00 58 sw (r13+88),r1 } p1 = (block_p *)p[ doubly ]; 800a268: b9 c0 08 00 mv r1,r14 800a26c: 34 02 00 02 mvi r2,2 800a270: f8 00 3f f2 calli 801a238 <__ashlsi3> 800a274: b5 81 60 00 add r12,r12,r1 800a278: 29 8d 00 00 lw r13,(r12+0) if ( !p1 ) { 800a27c: 5d a0 00 06 bne r13,r0,800a294 p1 = memfile_alloc_block(); 800a280: fb ff ff ae calli 800a138 800a284: b8 20 68 00 mv r13,r1 if ( !p1 ) return 0; 800a288: 34 0b 00 00 mvi r11,0 } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) 800a28c: 44 20 00 55 be r1,r0,800a3e0 <== NEVER TAKEN return 0; p[ doubly ] = (block_p) p1; 800a290: 59 81 00 00 sw (r12+0),r1 } return (block_p *)&p1[ singly ]; 800a294: ba 00 08 00 mv r1,r16 800a298: 34 02 00 02 mvi r2,2 800a29c: f8 00 3f e7 calli 801a238 <__ashlsi3> 800a2a0: b5 a1 58 00 add r11,r13,r1 800a2a4: e0 00 00 4f bi 800a3e0 } if ( !p ) return 0; 800a2a8: 34 0b 00 00 mvi r11,0 } return (block_p *)&p1[ singly ]; } if ( !p ) 800a2ac: 45 8b 00 4d be r12,r11,800a3e0 <== NEVER TAKEN return 0; p = (block_p *)p[ doubly ]; 800a2b0: 34 02 00 02 mvi r2,2 800a2b4: f8 00 3f e1 calli 801a238 <__ashlsi3> 800a2b8: b5 81 08 00 add r1,r12,r1 800a2bc: 28 2c 00 00 lw r12,(r1+0) if ( !p ) return 0; return (block_p *)&p[ singly ]; 800a2c0: ba 00 08 00 mv r1,r16 if ( !p ) return 0; p = (block_p *)p[ doubly ]; if ( !p ) 800a2c4: 5d 80 00 44 bne r12,r0,800a3d4 <== ALWAYS TAKEN 800a2c8: e0 00 00 46 bi 800a3e0 <== NOT EXECUTED } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 800a2cc: 36 01 00 01 addi r1,r16,1 800a2d0: b9 80 10 00 mv r2,r12 800a2d4: f8 00 40 4e calli 801a40c <__mulsi3> 800a2d8: 34 21 ff ff addi r1,r1,-1 } /* * This means the requested block number is out of range. */ return 0; 800a2dc: 34 0b 00 00 mvi r11,0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 800a2e0: 55 c1 00 40 bgu r14,r1,800a3e0 <== NEVER TAKEN my_block -= FIRST_TRIPLY_INDIRECT; 800a2e4: c9 d0 70 00 sub r14,r14,r16 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 800a2e8: b9 80 10 00 mv r2,r12 800a2ec: b9 c0 08 00 mv r1,r14 800a2f0: f8 00 40 bc calli 801a5e0 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800a2f4: 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; 800a2f8: b8 20 88 00 mv r17,r1 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800a2fc: b9 c0 08 00 mv r1,r14 800a300: f8 00 40 a8 calli 801a5a0 <__udivsi3> triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 800a304: 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; 800a308: b8 20 70 00 mv r14,r1 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 800a30c: f8 00 40 a5 calli 801a5a0 <__udivsi3> doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 800a310: 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; 800a314: b8 20 80 00 mv r16,r1 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 800a318: b9 c0 08 00 mv r1,r14 800a31c: f8 00 40 b1 calli 801a5e0 <__umodsi3> 800a320: b8 20 70 00 mv r14,r1 p = info->triply_indirect; 800a324: 29 ac 00 5c lw r12,(r13+92) if ( malloc_it ) { 800a328: 45 e0 00 1d be r15,r0,800a39c if ( !p ) { 800a32c: 5d 80 00 05 bne r12,r0,800a340 p = memfile_alloc_block(); 800a330: fb ff ff 82 calli 800a138 800a334: b8 20 60 00 mv r12,r1 if ( !p ) 800a338: 44 20 00 2a be r1,r0,800a3e0 <== NEVER TAKEN return 0; info->triply_indirect = p; 800a33c: 59 a1 00 5c sw (r13+92),r1 } p1 = (block_p *) p[ triply ]; 800a340: ba 00 08 00 mv r1,r16 800a344: 34 02 00 02 mvi r2,2 800a348: f8 00 3f bc calli 801a238 <__ashlsi3> 800a34c: b5 81 60 00 add r12,r12,r1 800a350: 29 8d 00 00 lw r13,(r12+0) if ( !p1 ) { 800a354: 5d a0 00 06 bne r13,r0,800a36c p1 = memfile_alloc_block(); 800a358: fb ff ff 78 calli 800a138 800a35c: b8 20 68 00 mv r13,r1 if ( !p1 ) return 0; 800a360: 34 0b 00 00 mvi r11,0 } p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) 800a364: 44 20 00 1f be r1,r0,800a3e0 <== NEVER TAKEN return 0; p[ triply ] = (block_p) p1; 800a368: 59 81 00 00 sw (r12+0),r1 } p2 = (block_p *)p1[ doubly ]; 800a36c: b9 c0 08 00 mv r1,r14 800a370: 34 02 00 02 mvi r2,2 800a374: f8 00 3f b1 calli 801a238 <__ashlsi3> 800a378: b5 a1 68 00 add r13,r13,r1 800a37c: 29 ac 00 00 lw r12,(r13+0) if ( !p2 ) { 800a380: 5d 80 00 14 bne r12,r0,800a3d0 p2 = memfile_alloc_block(); 800a384: fb ff ff 6d calli 800a138 800a388: b8 20 60 00 mv r12,r1 if ( !p2 ) return 0; 800a38c: 34 0b 00 00 mvi r11,0 } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); if ( !p2 ) 800a390: 44 20 00 14 be r1,r0,800a3e0 <== NEVER TAKEN return 0; p1[ doubly ] = (block_p) p2; 800a394: 59 a1 00 00 sw (r13+0),r1 800a398: e0 00 00 0e bi 800a3d0 } return (block_p *)&p2[ singly ]; } if ( !p ) 800a39c: 45 8b 00 11 be r12,r11,800a3e0 <== NEVER TAKEN return 0; p1 = (block_p *) p[ triply ]; 800a3a0: ba 00 08 00 mv r1,r16 800a3a4: 34 02 00 02 mvi r2,2 800a3a8: f8 00 3f a4 calli 801a238 <__ashlsi3> 800a3ac: b5 81 08 00 add r1,r12,r1 800a3b0: 28 2c 00 00 lw r12,(r1+0) if ( !p1 ) 800a3b4: 45 80 00 0b be r12,r0,800a3e0 <== NEVER TAKEN return 0; p2 = (block_p *)p1[ doubly ]; 800a3b8: b9 c0 08 00 mv r1,r14 800a3bc: 34 02 00 02 mvi r2,2 800a3c0: f8 00 3f 9e calli 801a238 <__ashlsi3> 800a3c4: b5 81 08 00 add r1,r12,r1 800a3c8: 28 2c 00 00 lw r12,(r1+0) if ( !p2 ) 800a3cc: 45 80 00 05 be r12,r0,800a3e0 <== NEVER TAKEN return 0; return (block_p *)&p2[ singly ]; 800a3d0: ba 20 08 00 mv r1,r17 800a3d4: 34 02 00 02 mvi r2,2 800a3d8: f8 00 3f 98 calli 801a238 <__ashlsi3> 800a3dc: b5 81 58 00 add r11,r12,r1 /* * This means the requested block number is out of range. */ return 0; } 800a3e0: b9 60 08 00 mv r1,r11 800a3e4: 2b 9d 00 04 lw ra,(sp+4) 800a3e8: 2b 8b 00 20 lw r11,(sp+32) 800a3ec: 2b 8c 00 1c lw r12,(sp+28) 800a3f0: 2b 8d 00 18 lw r13,(sp+24) 800a3f4: 2b 8e 00 14 lw r14,(sp+20) 800a3f8: 2b 8f 00 10 lw r15,(sp+16) 800a3fc: 2b 90 00 0c lw r16,(sp+12) 800a400: 2b 91 00 08 lw r17,(sp+8) 800a404: 37 9c 00 20 addi sp,sp,32 800a408: c3 a0 00 00 ret =============================================================================== 0800a40c : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 800a40c: 37 9c ff d4 addi sp,sp,-44 800a410: 5b 8b 00 24 sw (sp+36),r11 800a414: 5b 8c 00 20 sw (sp+32),r12 800a418: 5b 8d 00 1c sw (sp+28),r13 800a41c: 5b 8e 00 18 sw (sp+24),r14 800a420: 5b 8f 00 14 sw (sp+20),r15 800a424: 5b 90 00 10 sw (sp+16),r16 800a428: 5b 91 00 0c sw (sp+12),r17 800a42c: 5b 92 00 08 sw (sp+8),r18 800a430: 5b 9d 00 04 sw (sp+4),ra 800a434: 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; 800a438: 28 21 00 4c lw r1,(r1+76) 800a43c: b8 40 70 00 mv r14,r2 800a440: 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 ) { 800a444: 28 22 00 00 lw r2,(r1+0) 800a448: 34 01 00 05 mvi r1,5 800a44c: 5c 41 00 0b bne r2,r1,800a478 unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) 800a450: 29 6d 00 50 lw r13,(r11+80) 800a454: 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 ) { 800a458: 50 8d 00 02 bgeu r4,r13,800a460 <== ALWAYS TAKEN 800a45c: 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); 800a460: 29 62 00 54 lw r2,(r11+84) 800a464: ba 00 08 00 mv r1,r16 800a468: b9 a0 18 00 mv r3,r13 800a46c: b4 4e 10 00 add r2,r2,r14 800a470: f8 00 07 e1 calli 800c3f4 800a474: e0 00 00 46 bi 800a58c /* * 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 ) 800a478: 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; 800a47c: b4 8e 10 00 add r2,r4,r14 if ( last_byte > the_jnode->info.file.size ) 800a480: b8 80 60 00 mv r12,r4 800a484: 50 22 00 02 bgeu r1,r2,800a48c my_length = the_jnode->info.file.size - start; 800a488: 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; 800a48c: 78 01 08 01 mvhi r1,0x801 800a490: 38 21 d7 14 ori r1,r1,0xd714 800a494: 28 32 00 00 lw r18,(r1+0) 800a498: b9 c0 08 00 mv r1,r14 unsigned int last_byte; unsigned int copied; unsigned int start_offset; unsigned char *dest; dest = destination; 800a49c: ba 00 78 00 mv r15,r16 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800a4a0: ba 40 10 00 mv r2,r18 800a4a4: f8 00 40 16 calli 801a4fc <__modsi3> 800a4a8: b8 20 88 00 mv r17,r1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 800a4ac: ba 40 10 00 mv r2,r18 800a4b0: b9 c0 08 00 mv r1,r14 800a4b4: f8 00 3f e2 calli 801a43c <__divsi3> 800a4b8: 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; 800a4bc: 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 ) { 800a4c0: 46 20 00 12 be r17,r0,800a508 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 ); 800a4c4: b9 60 08 00 mv r1,r11 800a4c8: b9 c0 10 00 mv r2,r14 800a4cc: 34 03 00 00 mvi r3,0 800a4d0: fb ff ff 2a calli 800a178 if ( !block_ptr ) 800a4d4: 44 20 00 33 be r1,r0,800a5a0 <== 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; 800a4d8: ca 51 90 00 sub r18,r18,r17 800a4dc: b9 80 68 00 mv r13,r12 800a4e0: 52 4c 00 02 bgeu r18,r12,800a4e8 800a4e4: 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 ); 800a4e8: 28 22 00 00 lw r2,(r1+0) 800a4ec: b9 a0 18 00 mv r3,r13 800a4f0: ba 00 08 00 mv r1,r16 800a4f4: b4 51 10 00 add r2,r2,r17 800a4f8: f8 00 07 bf calli 800c3f4 dest += to_copy; 800a4fc: b6 0d 78 00 add r15,r16,r13 block++; 800a500: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 800a504: c9 8d 60 00 sub r12,r12,r13 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 800a508: 78 01 08 01 mvhi r1,0x801 800a50c: 38 21 d7 14 ori r1,r1,0xd714 800a510: 28 30 00 00 lw r16,(r1+0) while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800a514: b8 20 88 00 mv r17,r1 800a518: e0 00 00 0f bi 800a554 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800a51c: b9 c0 10 00 mv r2,r14 800a520: b9 60 08 00 mv r1,r11 800a524: 34 03 00 00 mvi r3,0 800a528: fb ff ff 14 calli 800a178 800a52c: b8 20 10 00 mv r2,r1 if ( !block_ptr ) 800a530: 44 20 00 1c be r1,r0,800a5a0 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 800a534: 28 42 00 00 lw r2,(r2+0) 800a538: b9 e0 08 00 mv r1,r15 800a53c: ba 00 18 00 mv r3,r16 800a540: f8 00 07 ad calli 800c3f4 dest += to_copy; 800a544: b5 f0 78 00 add r15,r15,r16 block++; 800a548: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 800a54c: c9 90 60 00 sub r12,r12,r16 copied += to_copy; 800a550: 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 ) { 800a554: 2a 21 00 00 lw r1,(r17+0) 800a558: 51 81 ff f1 bgeu r12,r1,800a51c /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { 800a55c: 45 80 00 0c be r12,r0,800a58c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800a560: b9 c0 10 00 mv r2,r14 800a564: b9 60 08 00 mv r1,r11 800a568: 34 03 00 00 mvi r3,0 800a56c: fb ff ff 03 calli 800a178 800a570: b8 20 10 00 mv r2,r1 if ( !block_ptr ) 800a574: 44 20 00 0b be r1,r0,800a5a0 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 800a578: 28 42 00 00 lw r2,(r2+0) 800a57c: b9 e0 08 00 mv r1,r15 800a580: b9 80 18 00 mv r3,r12 800a584: f8 00 07 9c calli 800c3f4 copied += my_length; 800a588: b5 8d 68 00 add r13,r12,r13 } IMFS_update_atime( the_jnode ); 800a58c: 37 81 00 28 addi r1,sp,40 800a590: 34 02 00 00 mvi r2,0 800a594: fb ff dc 1e calli 800160c 800a598: 2b 81 00 28 lw r1,(sp+40) 800a59c: 59 61 00 40 sw (r11+64),r1 return copied; } 800a5a0: b9 a0 08 00 mv r1,r13 800a5a4: 2b 9d 00 04 lw ra,(sp+4) 800a5a8: 2b 8b 00 24 lw r11,(sp+36) 800a5ac: 2b 8c 00 20 lw r12,(sp+32) 800a5b0: 2b 8d 00 1c lw r13,(sp+28) 800a5b4: 2b 8e 00 18 lw r14,(sp+24) 800a5b8: 2b 8f 00 14 lw r15,(sp+20) 800a5bc: 2b 90 00 10 lw r16,(sp+16) 800a5c0: 2b 91 00 0c lw r17,(sp+12) 800a5c4: 2b 92 00 08 lw r18,(sp+8) 800a5c8: 37 9c 00 2c addi sp,sp,44 800a5cc: c3 a0 00 00 ret =============================================================================== 0800a708 : * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 800a708: 37 9c ff e0 addi sp,sp,-32 800a70c: 5b 8b 00 20 sw (sp+32),r11 800a710: 5b 8c 00 1c sw (sp+28),r12 800a714: 5b 8d 00 18 sw (sp+24),r13 800a718: 5b 8e 00 14 sw (sp+20),r14 800a71c: 5b 8f 00 10 sw (sp+16),r15 800a720: 5b 90 00 0c sw (sp+12),r16 800a724: 5b 91 00 08 sw (sp+8),r17 800a728: 5b 9d 00 04 sw (sp+4),ra 800a72c: 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; 800a730: 78 01 08 01 mvhi r1,0x801 800a734: 38 21 d7 14 ori r1,r1,0xd714 800a738: 28 21 00 00 lw r1,(r1+0) 800a73c: 34 02 00 02 mvi r2,2 800a740: f8 00 3f 0c calli 801a370 <__lshrsi3> 800a744: b8 20 60 00 mv r12,r1 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 800a748: 29 61 00 54 lw r1,(r11+84) 800a74c: 44 20 00 04 be r1,r0,800a75c memfile_free_blocks_in_table( &info->indirect, to_free ); 800a750: 35 61 00 54 addi r1,r11,84 800a754: b9 80 10 00 mv r2,r12 800a758: fb ff ff d0 calli 800a698 } if ( info->doubly_indirect ) { 800a75c: 29 61 00 58 lw r1,(r11+88) 800a760: 44 20 00 15 be r1,r0,800a7b4 for ( i=0 ; iindirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { 800a768: 34 0f 00 00 mvi r15,0 800a76c: 34 0e 00 00 mvi r14,0 for ( i=0 ; i if ( info->doubly_indirect[i] ) { 800a778: 29 61 00 58 lw r1,(r11+88) 800a77c: b4 2f 08 00 add r1,r1,r15 800a780: 28 22 00 00 lw r2,(r1+0) 800a784: 44 40 00 03 be r2,r0,800a790 <== NEVER TAKEN memfile_free_blocks_in_table( 800a788: b9 80 10 00 mv r2,r12 800a78c: fb ff ff c3 calli 800a698 if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i 800a7a4: 54 2e ff f5 bgu r1,r14,800a778 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 ); 800a7a8: 35 61 00 58 addi r1,r11,88 800a7ac: b9 80 10 00 mv r2,r12 800a7b0: fb ff ff ba calli 800a698 } if ( info->triply_indirect ) { 800a7b4: 29 61 00 5c lw r1,(r11+92) 800a7b8: 44 20 00 24 be r1,r0,800a848 for ( i=0 ; idoubly_indirect, to_free ); } if ( info->triply_indirect ) { 800a7c0: 34 0f 00 00 mvi r15,0 800a7c4: 34 10 00 00 mvi r16,0 for ( i=0 ; i p = (block_p *) info->triply_indirect[i]; 800a7d0: 29 61 00 5c lw r1,(r11+92) 800a7d4: b4 2f 08 00 add r1,r1,r15 800a7d8: 28 2d 00 00 lw r13,(r1+0) if ( !p ) /* ensure we have a valid pointer */ 800a7dc: 45 a0 00 18 be r13,r0,800a83c <== NEVER TAKEN 800a7e0: 34 11 00 00 mvi r17,0 800a7e4: e0 00 00 08 bi 800a804 break; for ( j=0 ; j <== NEVER TAKEN memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 800a7f0: b9 a0 08 00 mv r1,r13 800a7f4: b9 80 10 00 mv r2,r12 800a7f8: fb ff ff a8 calli 800a698 if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j 800a810: 54 31 ff f6 bgu r1,r17,800a7e8 if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( 800a814: 29 61 00 5c lw r1,(r11+92) 800a818: 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 memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i 800a838: 54 30 ff e6 bgu r1,r16,800a7d0 } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( 800a83c: 35 61 00 5c addi r1,r11,92 800a840: b9 80 10 00 mv r2,r12 800a844: fb ff ff 95 calli 800a698 (block_p **)&info->triply_indirect, to_free ); } return the_jnode; } 800a848: b9 60 08 00 mv r1,r11 800a84c: 2b 9d 00 04 lw ra,(sp+4) 800a850: 2b 8b 00 20 lw r11,(sp+32) 800a854: 2b 8c 00 1c lw r12,(sp+28) 800a858: 2b 8d 00 18 lw r13,(sp+24) 800a85c: 2b 8e 00 14 lw r14,(sp+20) 800a860: 2b 8f 00 10 lw r15,(sp+16) 800a864: 2b 90 00 0c lw r16,(sp+12) 800a868: 2b 91 00 08 lw r17,(sp+8) 800a86c: 37 9c 00 20 addi sp,sp,32 800a870: c3 a0 00 00 ret =============================================================================== 0800aa4c : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 800aa4c: 37 9c ff d0 addi sp,sp,-48 800aa50: 5b 8b 00 28 sw (sp+40),r11 800aa54: 5b 8c 00 24 sw (sp+36),r12 800aa58: 5b 8d 00 20 sw (sp+32),r13 800aa5c: 5b 8e 00 1c sw (sp+28),r14 800aa60: 5b 8f 00 18 sw (sp+24),r15 800aa64: 5b 90 00 14 sw (sp+20),r16 800aa68: 5b 91 00 10 sw (sp+16),r17 800aa6c: 5b 92 00 0c sw (sp+12),r18 800aa70: 5b 93 00 08 sw (sp+8),r19 800aa74: 5b 9d 00 04 sw (sp+4),ra 800aa78: b8 40 60 00 mv r12,r2 800aa7c: 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; 800aa80: b4 82 18 00 add r3,r4,r2 if ( last_byte > the_jnode->info.file.size ) { 800aa84: 28 22 00 50 lw r2,(r1+80) IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 800aa88: b8 20 70 00 mv r14,r1 800aa8c: 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 ) { 800aa90: 50 43 00 05 bgeu r2,r3,800aaa4 bool zero_fill = start > the_jnode->info.file.size; status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); 800aa94: e9 82 10 00 cmpg r2,r12,r2 800aa98: fb ff ff 83 calli 800a8a4 800aa9c: b8 20 28 00 mv r5,r1 if ( status ) 800aaa0: 5c 20 00 48 bne r1,r0,800abc0 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800aaa4: 78 01 08 01 mvhi r1,0x801 800aaa8: 38 21 d7 14 ori r1,r1,0xd714 800aaac: 28 33 00 00 lw r19,(r1+0) 800aab0: b9 80 08 00 mv r1,r12 unsigned int last_byte; unsigned int start_offset; int copied; const unsigned char *src; src = source; 800aab4: ba 20 78 00 mv r15,r17 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800aab8: ba 60 10 00 mv r2,r19 800aabc: f8 00 3e 90 calli 801a4fc <__modsi3> 800aac0: b8 20 90 00 mv r18,r1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 800aac4: ba 60 10 00 mv r2,r19 800aac8: b9 80 08 00 mv r1,r12 800aacc: f8 00 3e 5c calli 801a43c <__divsi3> 800aad0: b8 20 68 00 mv r13,r1 if ( start_offset ) { 800aad4: ba 00 60 00 mv r12,r16 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); if ( status ) return status; } copied = 0; 800aad8: 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 ) { 800aadc: 46 40 00 12 be r18,r0,800ab24 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 ); 800aae0: b9 c0 08 00 mv r1,r14 800aae4: b9 a0 10 00 mv r2,r13 800aae8: 34 03 00 00 mvi r3,0 800aaec: fb ff fd a3 calli 800a178 if ( !block_ptr ) return copied; 800aaf0: 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 ) 800aaf4: 44 20 00 33 be r1,r0,800abc0 <== 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; 800aaf8: ca 72 58 00 sub r11,r19,r18 800aafc: 52 0b 00 02 bgeu r16,r11,800ab04 800ab00: ba 00 58 00 mv r11,r16 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 800ab04: 28 21 00 00 lw r1,(r1+0) 800ab08: ba 20 10 00 mv r2,r17 800ab0c: b9 60 18 00 mv r3,r11 800ab10: b4 32 08 00 add r1,r1,r18 800ab14: f8 00 06 38 calli 800c3f4 src += to_copy; 800ab18: b6 2b 78 00 add r15,r17,r11 block++; 800ab1c: 35 ad 00 01 addi r13,r13,1 my_length -= to_copy; 800ab20: ca 0b 60 00 sub r12,r16,r11 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 800ab24: 78 01 08 01 mvhi r1,0x801 800ab28: 38 21 d7 14 ori r1,r1,0xd714 800ab2c: 28 30 00 00 lw r16,(r1+0) while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800ab30: b8 20 88 00 mv r17,r1 800ab34: e0 00 00 0e bi 800ab6c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800ab38: b9 c0 08 00 mv r1,r14 800ab3c: b9 a0 10 00 mv r2,r13 800ab40: 34 03 00 00 mvi r3,0 800ab44: fb ff fd 8d calli 800a178 if ( !block_ptr ) 800ab48: 44 20 00 1d be r1,r0,800abbc <== 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 ); 800ab4c: 28 21 00 00 lw r1,(r1+0) 800ab50: b9 e0 10 00 mv r2,r15 800ab54: ba 00 18 00 mv r3,r16 800ab58: f8 00 06 27 calli 800c3f4 src += to_copy; 800ab5c: b5 f0 78 00 add r15,r15,r16 block++; 800ab60: 35 ad 00 01 addi r13,r13,1 my_length -= to_copy; 800ab64: 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( 800ab68: 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 ) { 800ab6c: 2a 21 00 00 lw r1,(r17+0) 800ab70: 51 81 ff f2 bgeu r12,r1,800ab38 * 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 ) { 800ab74: 45 80 00 0c be r12,r0,800aba4 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800ab78: b9 c0 08 00 mv r1,r14 800ab7c: b9 a0 10 00 mv r2,r13 800ab80: 34 03 00 00 mvi r3,0 800ab84: fb ff fd 7d calli 800a178 if ( !block_ptr ) 800ab88: b9 60 28 00 mv r5,r11 800ab8c: 44 20 00 0d be r1,r0,800abc0 <== 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 ); 800ab90: 28 21 00 00 lw r1,(r1+0) 800ab94: b9 e0 10 00 mv r2,r15 800ab98: b9 80 18 00 mv r3,r12 800ab9c: f8 00 06 16 calli 800c3f4 my_length = 0; copied += to_copy; 800aba0: b5 6c 58 00 add r11,r11,r12 } IMFS_mtime_ctime_update( the_jnode ); 800aba4: 37 81 00 2c addi r1,sp,44 800aba8: 34 02 00 00 mvi r2,0 800abac: fb ff da 98 calli 800160c 800abb0: 2b 81 00 2c lw r1,(sp+44) 800abb4: 59 c1 00 44 sw (r14+68),r1 800abb8: 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 ) 800abbc: b9 60 28 00 mv r5,r11 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 800abc0: b8 a0 08 00 mv r1,r5 800abc4: 2b 9d 00 04 lw ra,(sp+4) 800abc8: 2b 8b 00 28 lw r11,(sp+40) 800abcc: 2b 8c 00 24 lw r12,(sp+36) 800abd0: 2b 8d 00 20 lw r13,(sp+32) 800abd4: 2b 8e 00 1c lw r14,(sp+28) 800abd8: 2b 8f 00 18 lw r15,(sp+24) 800abdc: 2b 90 00 14 lw r16,(sp+20) 800abe0: 2b 91 00 10 lw r17,(sp+16) 800abe4: 2b 92 00 0c lw r18,(sp+12) 800abe8: 2b 93 00 08 lw r19,(sp+8) 800abec: 37 9c 00 30 addi sp,sp,48 800abf0: c3 a0 00 00 ret =============================================================================== 08000cdc : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 8000cdc: 37 9c ff d0 addi sp,sp,-48 8000ce0: 5b 8b 00 18 sw (sp+24),r11 8000ce4: 5b 8c 00 14 sw (sp+20),r12 8000ce8: 5b 8d 00 10 sw (sp+16),r13 8000cec: 5b 8e 00 0c sw (sp+12),r14 8000cf0: 5b 8f 00 08 sw (sp+8),r15 8000cf4: 5b 9d 00 04 sw (sp+4),ra 8000cf8: b8 20 58 00 mv r11,r1 dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 8000cfc: 20 87 f0 00 andi r7,r4,0xf000 8000d00: 34 01 40 00 mvi r1,16384 const char *name, size_t namelen, mode_t mode, dev_t dev ) { 8000d04: b8 40 70 00 mv r14,r2 8000d08: b8 60 68 00 mv r13,r3 8000d0c: b8 80 60 00 mv r12,r4 IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; 8000d10: 34 08 00 00 mvi r8,0 dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 8000d14: 44 e1 00 11 be r7,r1,8000d58 *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { 8000d18: 34 21 40 00 addi r1,r1,16384 8000d1c: 44 e1 00 0c be r7,r1,8000d4c *type = IMFS_MEMORY_FILE; } else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) { 8000d20: 64 e2 20 00 cmpei r2,r7,8192 8000d24: 64 e1 60 00 cmpei r1,r7,24576 8000d28: b8 41 08 00 or r1,r2,r1 8000d2c: 44 20 00 05 be r1,r0,8000d40 *type = IMFS_DEVICE; rtems_filesystem_split_dev_t( 8000d30: 5b 85 00 1c sw (sp+28),r5 8000d34: 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; 8000d38: 34 08 00 01 mvi r8,1 8000d3c: e0 00 00 07 bi 8000d58 rtems_filesystem_split_dev_t( dev, info->device.major, info->device.minor ); } else if (S_ISFIFO( mode )) { 8000d40: 34 01 10 00 mvi r1,4096 8000d44: 5c e1 00 05 bne r7,r1,8000d58 <== NEVER TAKEN 8000d48: e0 00 00 03 bi 8000d54 ) { if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { *type = IMFS_MEMORY_FILE; 8000d4c: 34 08 00 04 mvi r8,4 8000d50: e0 00 00 02 bi 8000d58 dev, info->device.major, info->device.minor ); } else if (S_ISFIFO( mode )) { *type = IMFS_FIFO; 8000d54: 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; 8000d58: 29 61 00 14 lw r1,(r11+20) return IMFS_create_node_with_control( 8000d5c: 34 02 00 02 mvi r2,2 8000d60: 28 2f 00 08 lw r15,(r1+8) 8000d64: 35 01 00 02 addi r1,r8,2 8000d68: f8 00 65 34 calli 801a238 <__ashlsi3> 8000d6c: b5 e1 28 00 add r5,r15,r1 8000d70: 28 a2 00 00 lw r2,(r5+0) 8000d74: b9 60 08 00 mv r1,r11 8000d78: b9 c0 18 00 mv r3,r14 8000d7c: b9 a0 20 00 mv r4,r13 8000d80: b9 80 28 00 mv r5,r12 8000d84: 37 86 00 1c addi r6,sp,28 8000d88: f8 00 1c a0 calli 8008008 IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); } else { rv = -1; 8000d8c: 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 ) { 8000d90: 44 20 00 0e be r1,r0,8000dc8 IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); 8000d94: 37 8c 00 2c addi r12,sp,44 8000d98: 34 02 00 00 mvi r2,0 8000d9c: 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; 8000da0: 29 6b 00 08 lw r11,(r11+8) IMFS_update_ctime( parent ); 8000da4: f8 00 02 1a calli 800160c 8000da8: 2b 81 00 2c lw r1,(sp+44) IMFS_update_mtime( parent ); 8000dac: 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 ); 8000db0: 59 61 00 48 sw (r11+72),r1 IMFS_update_mtime( parent ); 8000db4: b9 80 08 00 mv r1,r12 8000db8: f8 00 02 15 calli 800160c 8000dbc: 2b 81 00 2c lw r1,(sp+44) size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 8000dc0: 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 ); 8000dc4: 59 61 00 44 sw (r11+68),r1 } else { rv = -1; } return rv; } 8000dc8: b8 40 08 00 mv r1,r2 8000dcc: 2b 9d 00 04 lw ra,(sp+4) 8000dd0: 2b 8b 00 18 lw r11,(sp+24) 8000dd4: 2b 8c 00 14 lw r12,(sp+20) 8000dd8: 2b 8d 00 10 lw r13,(sp+16) 8000ddc: 2b 8e 00 0c lw r14,(sp+12) 8000de0: 2b 8f 00 08 lw r15,(sp+8) 8000de4: 37 9c 00 30 addi sp,sp,48 8000de8: c3 a0 00 00 ret =============================================================================== 08000dec : #endif #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 8000dec: 37 9c ff fc addi sp,sp,-4 8000df0: 5b 9d 00 04 sw (sp+4),ra int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 8000df4: 28 22 00 20 lw r2,(r1+32) 8000df8: 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; 8000dfc: 28 43 00 4c lw r3,(r2+76) if ( IMFS_is_directory( node ) ) { 8000e00: 28 63 00 00 lw r3,(r3+0) 8000e04: 5c 60 00 09 bne r3,r0,8000e28 if ( node->info.directory.mt_fs == NULL ) { 8000e08: 28 44 00 5c lw r4,(r2+92) 8000e0c: 5c 83 00 04 bne r4,r3,8000e1c <== NEVER TAKEN node->info.directory.mt_fs = mt_entry; 8000e10: 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; 8000e14: 34 01 00 00 mvi r1,0 8000e18: e0 00 00 08 bi 8000e38 if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == NULL ) { node->info.directory.mt_fs = mt_entry; } else { errno = EBUSY; 8000e1c: f8 00 2a 7c calli 800b80c <__errno> <== NOT EXECUTED 8000e20: 34 02 00 10 mvi r2,16 <== NOT EXECUTED 8000e24: e0 00 00 03 bi 8000e30 <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; 8000e28: f8 00 2a 79 calli 800b80c <__errno> 8000e2c: 34 02 00 14 mvi r2,20 8000e30: 58 22 00 00 sw (r1+0),r2 rv = -1; 8000e34: 34 01 ff ff mvi r1,-1 } return rv; } 8000e38: 2b 9d 00 04 lw ra,(sp+4) 8000e3c: 37 9c 00 04 addi sp,sp,4 8000e40: c3 a0 00 00 ret =============================================================================== 08008430 : } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { 8008430: 37 9c ff fc addi sp,sp,-4 8008434: 5b 9d 00 04 sw (sp+4),ra if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 8008438: 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 ); 800843c: 34 22 00 54 addi r2,r1,84 8008440: 44 62 00 04 be r3,r2,8008450 errno = ENOTEMPTY; 8008444: f8 00 0c f2 calli 800b80c <__errno> 8008448: 34 02 00 5a mvi r2,90 800844c: e0 00 00 05 bi 8008460 node = NULL; } else if ( IMFS_is_mount_point( node ) ) { 8008450: 28 22 00 5c lw r2,(r1+92) 8008454: 44 40 00 05 be r2,r0,8008468 <== ALWAYS TAKEN errno = EBUSY; 8008458: f8 00 0c ed calli 800b80c <__errno> <== NOT EXECUTED 800845c: 34 02 00 10 mvi r2,16 <== NOT EXECUTED 8008460: 58 22 00 00 sw (r1+0),r2 node = NULL; 8008464: 34 01 00 00 mvi r1,0 } return node; } 8008468: 2b 9d 00 04 lw ra,(sp+4) 800846c: 37 9c 00 04 addi sp,sp,4 8008470: c3 a0 00 00 ret =============================================================================== 08000e44 : rtems_filesystem_node_types_t IMFS_node_type( const rtems_filesystem_location_info_t *loc ) { const IMFS_jnode_t *node = loc->node_access; 8000e44: 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 ) { 8000e48: 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; 8000e4c: 28 22 00 4c lw r2,(r1+76) 8000e50: 28 42 00 00 lw r2,(r2+0) 8000e54: 44 43 00 05 be r2,r3,8000e68 8000e58: 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; 8000e5c: 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 ) { 8000e60: 5c 43 00 06 bne r2,r3,8000e78 <== ALWAYS TAKEN 8000e64: c3 a0 00 00 ret <== NOT EXECUTED type = imfs_type; break; } return type; } 8000e68: 28 21 00 50 lw r1,(r1+80) 8000e6c: 28 21 00 4c lw r1,(r1+76) 8000e70: 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; 8000e74: c3 a0 00 00 ret 8000e78: b8 40 08 00 mv r1,r2 type = imfs_type; break; } return type; } 8000e7c: c3 a0 00 00 ret =============================================================================== 08000eb0 : const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 8000eb0: 37 9c ff e8 addi sp,sp,-24 8000eb4: 5b 8b 00 10 sw (sp+16),r11 8000eb8: 5b 8c 00 0c sw (sp+12),r12 8000ebc: 5b 8d 00 08 sw (sp+8),r13 8000ec0: 5b 9d 00 04 sw (sp+4),ra int rv = 0; IMFS_jnode_t *node = oldloc->node_access; 8000ec4: 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 ) { 8000ec8: 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; 8000ecc: 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 ) { 8000ed0: 29 61 00 08 lw r1,(r11+8) 8000ed4: 44 20 00 1e be r1,r0,8000f4c <== NEVER TAKEN if ( namelen < IMFS_NAME_MAX ) { 8000ed8: 34 01 00 1f mvi r1,31 8000edc: 54 a1 00 19 bgu r5,r1,8000f40 <== NEVER TAKEN memcpy( node->name, name, namelen ); 8000ee0: b8 80 10 00 mv r2,r4 8000ee4: b8 a0 18 00 mv r3,r5 8000ee8: 35 61 00 0c addi r1,r11,12 8000eec: f8 00 2d 42 calli 800c3f4 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 8000ef0: 29 62 00 00 lw r2,(r11+0) previous = the_node->previous; 8000ef4: 29 61 00 04 lw r1,(r11+4) node->name [namelen] = '\0'; 8000ef8: b5 6d 68 00 add r13,r11,r13 8000efc: 31 a0 00 0c sb (r13+12),r0 next->previous = previous; 8000f00: 58 41 00 04 sw (r2+4),r1 previous->next = next; 8000f04: 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; 8000f08: 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 ); 8000f0c: 35 82 00 54 addi r2,r12,84 Chain_Node *old_last = tail->previous; the_node->next = tail; 8000f10: 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; 8000f14: 59 6c 00 08 sw (r11+8),r12 tail->previous = the_node; old_last->next = the_node; 8000f18: 58 2b 00 00 sw (r1+0),r11 the_node->previous = old_last; 8000f1c: 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; 8000f20: 59 8b 00 58 sw (r12+88),r11 IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); 8000f24: 37 81 00 14 addi r1,sp,20 8000f28: 34 02 00 00 mvi r2,0 8000f2c: f8 00 01 b8 calli 800160c 8000f30: 2b 81 00 14 lw r1,(sp+20) 8000f34: 59 61 00 48 sw (r11+72),r1 const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { int rv = 0; 8000f38: 34 01 00 00 mvi r1,0 8000f3c: e0 00 00 08 bi 8000f5c IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); } else { errno = ENAMETOOLONG; 8000f40: f8 00 2a 33 calli 800b80c <__errno> <== NOT EXECUTED 8000f44: 34 02 00 5b mvi r2,91 <== NOT EXECUTED 8000f48: e0 00 00 03 bi 8000f54 <== NOT EXECUTED rv = -1; } } else { errno = EINVAL; 8000f4c: f8 00 2a 30 calli 800b80c <__errno> <== NOT EXECUTED 8000f50: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8000f54: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8000f58: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED } return rv; } 8000f5c: 2b 9d 00 04 lw ra,(sp+4) 8000f60: 2b 8b 00 10 lw r11,(sp+16) 8000f64: 2b 8c 00 0c lw r12,(sp+12) 8000f68: 2b 8d 00 08 lw r13,(sp+8) 8000f6c: 37 9c 00 18 addi sp,sp,24 8000f70: c3 a0 00 00 ret =============================================================================== 0800106c : #endif #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 800106c: 37 9c ff fc addi sp,sp,-4 8001070: 5b 9d 00 04 sw (sp+4),ra int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 8001074: 28 22 00 20 lw r2,(r1+32) 8001078: 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; 800107c: 28 43 00 4c lw r3,(r2+76) if ( IMFS_is_directory( node ) ) { 8001080: 28 63 00 00 lw r3,(r3+0) 8001084: 5c 60 00 09 bne r3,r0,80010a8 <== NEVER TAKEN if ( node->info.directory.mt_fs == mt_entry ) { 8001088: 28 43 00 5c lw r3,(r2+92) 800108c: 5c 61 00 04 bne r3,r1,800109c <== NEVER TAKEN node->info.directory.mt_fs = NULL; 8001090: 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; 8001094: 34 01 00 00 mvi r1,0 8001098: e0 00 00 08 bi 80010b8 if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == mt_entry ) { node->info.directory.mt_fs = NULL; } else { errno = EINVAL; 800109c: f8 00 29 dc calli 800b80c <__errno> <== NOT EXECUTED 80010a0: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 80010a4: e0 00 00 03 bi 80010b0 <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; 80010a8: f8 00 29 d9 calli 800b80c <__errno> <== NOT EXECUTED 80010ac: 34 02 00 14 mvi r2,20 <== NOT EXECUTED 80010b0: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 80010b4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED } return rv; } 80010b8: 2b 9d 00 04 lw ra,(sp+4) 80010bc: 37 9c 00 04 addi sp,sp,4 80010c0: c3 a0 00 00 ret =============================================================================== 08001850 : void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8001850: 37 9c ff e4 addi sp,sp,-28 8001854: 5b 8b 00 1c sw (sp+28),r11 8001858: 5b 8c 00 18 sw (sp+24),r12 800185c: 5b 8d 00 14 sw (sp+20),r13 8001860: 5b 8e 00 10 sw (sp+16),r14 8001864: 5b 8f 00 0c sw (sp+12),r15 8001868: 5b 90 00 08 sw (sp+8),r16 800186c: 5b 9d 00 04 sw (sp+4),ra Heap_Control *heap = RTEMS_Malloc_Heap; 8001870: 78 04 08 01 mvhi r4,0x801 8001874: 38 84 d0 54 ori r4,r4,0xd054 8001878: 28 8e 00 00 lw r14,(r4+0) if ( !rtems_configuration_get_unified_work_area() ) { 800187c: 78 04 08 01 mvhi r4,0x801 8001880: 38 84 b2 0c ori r4,r4,0xb20c void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8001884: b8 40 78 00 mv r15,r2 Heap_Control *heap = RTEMS_Malloc_Heap; if ( !rtems_configuration_get_unified_work_area() ) { 8001888: 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 ) { 800188c: b8 60 80 00 mv r16,r3 Heap_Control *heap = RTEMS_Malloc_Heap; if ( !rtems_configuration_get_unified_work_area() ) { 8001890: 5c 40 00 17 bne r2,r0,80018ec 8001894: 78 0b 08 00 mvhi r11,0x800 8001898: b8 20 60 00 mv r12,r1 800189c: 34 0d 00 00 mvi r13,0 80018a0: 39 6b 4b d0 ori r11,r11,0x4bd0 80018a4: e0 00 00 0a bi 80018cc 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)( 80018a8: 29 82 00 00 lw r2,(r12+0) 80018ac: 29 83 00 04 lw r3,(r12+4) 80018b0: b9 c0 08 00 mv r1,r14 80018b4: 34 04 00 04 mvi r4,4 80018b8: d9 60 00 00 call r11 area->begin, area->size, page_size ); if ( space_available > 0 ) { 80018bc: 44 20 00 02 be r1,r0,80018c4 <== NEVER TAKEN init_or_extend = extend; 80018c0: 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) { 80018c4: 35 ad 00 01 addi r13,r13,1 80018c8: 35 8c 00 08 addi r12,r12,8 80018cc: 55 ed ff f7 bgu r15,r13,80018a8 if ( space_available > 0 ) { init_or_extend = extend; } } if ( init_or_extend == _Heap_Initialize ) { 80018d0: 78 02 08 00 mvhi r2,0x800 80018d4: 38 42 4b d0 ori r2,r2,0x4bd0 80018d8: 5d 62 00 05 bne r11,r2,80018ec _Internal_error_Occurred( 80018dc: 34 01 00 00 mvi r1,0 80018e0: 34 02 00 01 mvi r2,1 80018e4: 34 03 00 17 mvi r3,23 80018e8: f8 00 0d 6a calli 8004e90 <_Internal_error_Occurred> } /* * If configured, initialize the statistics support */ if ( rtems_malloc_statistics_helpers != NULL ) { 80018ec: 78 02 08 01 mvhi r2,0x801 80018f0: 38 42 d7 0c ori r2,r2,0xd70c 80018f4: 28 41 00 00 lw r1,(r2+0) 80018f8: 44 20 00 03 be r1,r0,8001904 (*rtems_malloc_statistics_helpers->initialize)(); 80018fc: 28 21 00 00 lw r1,(r1+0) 8001900: d8 20 00 00 call r1 } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); 8001904: 78 0b 08 01 mvhi r11,0x801 8001908: 39 6b d7 b0 ori r11,r11,0xd7b0 800190c: 29 6c 00 00 lw r12,(r11+0) 8001910: b9 c0 08 00 mv r1,r14 8001914: f8 00 10 29 calli 80059b8 <_Protected_heap_Get_size> 8001918: b4 2c 08 00 add r1,r1,r12 800191c: 59 61 00 00 sw (r11+0),r1 } 8001920: 2b 9d 00 04 lw ra,(sp+4) 8001924: 2b 8b 00 1c lw r11,(sp+28) 8001928: 2b 8c 00 18 lw r12,(sp+24) 800192c: 2b 8d 00 14 lw r13,(sp+20) 8001930: 2b 8e 00 10 lw r14,(sp+16) 8001934: 2b 8f 00 0c lw r15,(sp+12) 8001938: 2b 90 00 08 lw r16,(sp+8) 800193c: 37 9c 00 1c addi sp,sp,28 8001940: c3 a0 00 00 ret =============================================================================== 080203ec : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 80203ec: 37 9c ff d4 addi sp,sp,-44 80203f0: 5b 8b 00 24 sw (sp+36),r11 80203f4: 5b 8c 00 20 sw (sp+32),r12 80203f8: 5b 8d 00 1c sw (sp+28),r13 80203fc: 5b 8e 00 18 sw (sp+24),r14 8020400: 5b 8f 00 14 sw (sp+20),r15 8020404: 5b 90 00 10 sw (sp+16),r16 8020408: 5b 91 00 0c sw (sp+12),r17 802040c: 5b 92 00 08 sw (sp+8),r18 8020410: 5b 9d 00 04 sw (sp+4),ra 8020414: b8 20 68 00 mv r13,r1 /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { 8020418: 34 01 ff ff mvi r1,-1 802041c: 5d a1 00 08 bne r13,r1,802043c if (!Stack_check_Interrupt_stack.area) 8020420: 78 0c 08 06 mvhi r12,0x806 8020424: 39 8c 83 44 ori r12,r12,0x8344 8020428: 29 81 00 04 lw r1,(r12+4) return; stack = &Stack_check_Interrupt_stack; the_thread = 0; current = 0; 802042c: 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; 8020430: 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) 8020434: 5c 20 00 04 bne r1,r0,8020444 <== ALWAYS TAKEN 8020438: e0 00 00 54 bi 8020588 <== NOT EXECUTED current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); 802043c: 29 b0 01 00 lw r16,(r13+256) the_thread = 0; current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; 8020440: 35 ac 00 b0 addi r12,r13,176 current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); 8020444: 29 8f 00 00 lw r15,(r12+0) { const uint32_t *base, *ebase; uint32_t length; base = s; length = n/4; 8020448: 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); 802044c: 29 8b 00 04 lw r11,(r12+4) size = Stack_check_usable_stack_size(stack); 8020450: 35 ef ff f0 addi r15,r15,-16 { const uint32_t *base, *ebase; uint32_t length; base = s; length = n/4; 8020454: b9 e0 08 00 mv r1,r15 8020458: f8 00 db ff calli 8057454 <__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++) 802045c: 34 02 00 02 mvi r2,2 8020460: fb ff 7f 66 calli 80001f8 <__ashlsi3> if (*base != U32_PATTERN) 8020464: 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); 8020468: 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) 802046c: 38 63 d4 b0 ori r3,r3,0xd4b0 /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 8020470: 35 6b 00 20 addi r11,r11,32 for (ebase = base + length; base < ebase; base++) 8020474: b5 61 08 00 add r1,r11,r1 if (*base != U32_PATTERN) 8020478: 28 62 00 00 lw r2,(r3+0) 802047c: e0 00 00 04 bi 802048c 8020480: 29 63 00 00 lw r3,(r11+0) 8020484: 5c 62 00 05 bne r3,r2,8020498 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 8020488: 35 6b 00 04 addi r11,r11,4 802048c: 54 2b ff fd bgu r1,r11,8020480 <== 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; 8020490: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED 8020494: e0 00 00 05 bi 80204a8 <== NOT EXECUTED 8020498: 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 ) 802049c: 45 60 00 03 be r11,r0,80204a8 <== NEVER TAKEN used = Stack_check_Calculate_used( low, size, high_water_mark ); 80204a0: b6 2f 70 00 add r14,r17,r15 80204a4: c9 cb 70 00 sub r14,r14,r11 80204a8: 78 04 08 06 mvhi r4,0x806 80204ac: 78 02 08 06 mvhi r2,0x806 80204b0: 38 84 79 d4 ori r4,r4,0x79d4 80204b4: 38 42 79 d0 ori r2,r2,0x79d0 else used = 0; #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 80204b8: 45 a0 00 0f be r13,r0,80204f4 #endif { (*print_handler)( 80204bc: 29 ab 00 08 lw r11,(r13+8) 80204c0: 28 52 00 00 lw r18,(r2+0) 80204c4: 37 83 00 28 addi r3,sp,40 80204c8: b9 60 08 00 mv r1,r11 80204cc: 34 02 00 05 mvi r2,5 80204d0: 28 91 00 00 lw r17,(r4+0) 80204d4: fb ff ac 9a calli 800b73c 80204d8: 78 02 08 05 mvhi r2,0x805 80204dc: b8 20 20 00 mv r4,r1 80204e0: 38 42 d3 24 ori r2,r2,0xd324 80204e4: ba 40 08 00 mv r1,r18 80204e8: b9 60 18 00 mv r3,r11 80204ec: da 20 00 00 call r17 80204f0: e0 00 00 07 bi 802050c 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 ); 80204f4: 28 41 00 00 lw r1,(r2+0) 80204f8: 28 84 00 00 lw r4,(r4+0) 80204fc: 78 02 08 05 mvhi r2,0x805 8020500: 38 42 d3 34 ori r2,r2,0xd334 8020504: 34 03 ff ff mvi r3,-1 8020508: d8 80 00 00 call r4 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 802050c: 29 84 00 00 lw r4,(r12+0) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 8020510: 78 0b 08 06 mvhi r11,0x806 8020514: 78 0d 08 06 mvhi r13,0x806 print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 8020518: 29 83 00 04 lw r3,(r12+4) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 802051c: 39 6b 79 d4 ori r11,r11,0x79d4 8020520: 39 ad 79 d0 ori r13,r13,0x79d0 8020524: 29 67 00 00 lw r7,(r11+0) 8020528: 29 a1 00 00 lw r1,(r13+0) print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 802052c: 34 84 ff ff addi r4,r4,-1 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 8020530: 78 02 08 05 mvhi r2,0x805 8020534: 38 42 d3 44 ori r2,r2,0xd344 8020538: b4 64 20 00 add r4,r3,r4 802053c: ba 00 28 00 mv r5,r16 8020540: b9 e0 30 00 mv r6,r15 8020544: d8 e0 00 00 call r7 stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 8020548: 78 01 08 06 mvhi r1,0x806 802054c: 38 21 79 d8 ori r1,r1,0x79d8 8020550: 28 21 00 00 lw r1,(r1+0) 8020554: 5c 20 00 07 bne r1,r0,8020570 <== ALWAYS TAKEN (*print_handler)( print_context, "Unavailable\n" ); 8020558: 29 63 00 00 lw r3,(r11+0) <== NOT EXECUTED 802055c: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED 8020560: 78 02 08 05 mvhi r2,0x805 <== NOT EXECUTED 8020564: 38 42 d3 64 ori r2,r2,0xd364 <== NOT EXECUTED 8020568: d8 60 00 00 call r3 <== NOT EXECUTED 802056c: e0 00 00 07 bi 8020588 <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 8020570: 29 64 00 00 lw r4,(r11+0) 8020574: 29 a1 00 00 lw r1,(r13+0) 8020578: 78 02 08 05 mvhi r2,0x805 802057c: 38 42 d3 74 ori r2,r2,0xd374 8020580: b9 c0 18 00 mv r3,r14 8020584: d8 80 00 00 call r4 } } 8020588: 2b 9d 00 04 lw ra,(sp+4) 802058c: 2b 8b 00 24 lw r11,(sp+36) 8020590: 2b 8c 00 20 lw r12,(sp+32) 8020594: 2b 8d 00 1c lw r13,(sp+28) 8020598: 2b 8e 00 18 lw r14,(sp+24) 802059c: 2b 8f 00 14 lw r15,(sp+20) 80205a0: 2b 90 00 10 lw r16,(sp+16) 80205a4: 2b 91 00 0c lw r17,(sp+12) 80205a8: 2b 92 00 08 lw r18,(sp+8) 80205ac: 37 9c 00 2c addi sp,sp,44 80205b0: c3 a0 00 00 ret =============================================================================== 080206c0 : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 80206c0: 37 9c ff d0 addi sp,sp,-48 80206c4: 5b 8b 00 10 sw (sp+16),r11 80206c8: 5b 8c 00 0c sw (sp+12),r12 80206cc: 5b 8d 00 08 sw (sp+8),r13 80206d0: 5b 9d 00 04 sw (sp+4),ra 80206d4: b8 20 58 00 mv r11,r1 Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); 80206d8: 28 2c 00 b4 lw r12,(r1+180) char name[32]; printk("BLOWN STACK!!!\n"); 80206dc: 78 01 08 05 mvhi r1,0x805 80206e0: 38 21 d3 7c ori r1,r1,0xd37c Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 80206e4: 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"); 80206e8: fb ff 86 49 calli 800200c printk("task control block: 0x%08" PRIxPTR "\n", running); 80206ec: 78 01 08 05 mvhi r1,0x805 80206f0: 38 21 d3 8c ori r1,r1,0xd38c 80206f4: b9 60 10 00 mv r2,r11 80206f8: fb ff 86 45 calli 800200c printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); 80206fc: 29 62 00 08 lw r2,(r11+8) 8020700: 78 01 08 05 mvhi r1,0x805 8020704: 38 21 d3 a8 ori r1,r1,0xd3a8 8020708: fb ff 86 41 calli 800200c printk( 802070c: 29 62 00 0c lw r2,(r11+12) 8020710: 78 01 08 05 mvhi r1,0x805 8020714: 38 21 d3 bc ori r1,r1,0xd3bc 8020718: fb ff 86 3d calli 800200c "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( 802071c: 29 61 00 08 lw r1,(r11+8) 8020720: 37 83 00 14 addi r3,sp,20 8020724: 34 02 00 20 mvi r2,32 8020728: fb ff ac 05 calli 800b73c 802072c: b8 20 10 00 mv r2,r1 8020730: 78 01 08 05 mvhi r1,0x805 8020734: 38 21 d3 d0 ori r1,r1,0xd3d0 8020738: fb ff 86 35 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) 802073c: 29 63 00 b4 lw r3,(r11+180) 8020740: 29 62 00 b0 lw r2,(r11+176) ); printk( "task name string: %s\n", rtems_object_get_name(running->Object.id, sizeof(name), name) ); printk( 8020744: 78 01 08 05 mvhi r1,0x805 8020748: 38 21 d3 e8 ori r1,r1,0xd3e8 802074c: b4 62 20 00 add r4,r3,r2 8020750: fb ff 86 2f calli 800200c "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) { 8020754: 5d a0 00 07 bne r13,r0,8020770 <== NEVER TAKEN printk( 8020758: 78 01 08 05 mvhi r1,0x805 802075c: 38 21 d4 18 ori r1,r1,0xd418 8020760: 34 02 00 10 mvi r2,16 8020764: 35 83 00 08 addi r3,r12,8 8020768: 35 84 00 18 addi r4,r12,24 802076c: fb ff 86 28 calli 800200c rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal( 8020770: 29 62 00 0c lw r2,(r11+12) 8020774: 34 01 00 09 mvi r1,9 8020778: fb ff 8c 04 calli 8003788 =============================================================================== 080041c8 <_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); 80041c8: 28 22 00 00 lw r2,(r1+0) 80041cc: 5c 40 00 0c bne r2,r0,80041fc <_API_extensions_Add_post_switch+0x34> 80041d0: 28 23 00 04 lw r3,(r1+4) 80041d4: 5c 62 00 0a bne r3,r2,80041fc <_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; 80041d8: 78 02 08 01 mvhi r2,0x801 80041dc: 38 42 d9 50 ori r2,r2,0xd950 80041e0: 28 44 00 08 lw r4,(r2+8) the_node->next = tail; 80041e4: 78 03 08 01 mvhi r3,0x801 80041e8: 38 63 d9 54 ori r3,r3,0xd954 80041ec: 58 23 00 00 sw (r1+0),r3 tail->previous = the_node; 80041f0: 58 41 00 08 sw (r2+8),r1 old_last->next = the_node; 80041f4: 58 81 00 00 sw (r4+0),r1 the_node->previous = old_last; 80041f8: 58 24 00 04 sw (r1+4),r4 80041fc: c3 a0 00 00 ret =============================================================================== 0800e1d0 <_CORE_message_queue_Initialize>: CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 800e1d0: 37 9c ff e8 addi sp,sp,-24 800e1d4: 5b 8b 00 18 sw (sp+24),r11 800e1d8: 5b 8c 00 14 sw (sp+20),r12 800e1dc: 5b 8d 00 10 sw (sp+16),r13 800e1e0: 5b 8e 00 0c sw (sp+12),r14 800e1e4: 5b 8f 00 08 sw (sp+8),r15 800e1e8: 5b 9d 00 04 sw (sp+4),ra 800e1ec: b8 20 58 00 mv r11,r1 size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; the_message_queue->number_of_pending_messages = 0; 800e1f0: 58 20 00 48 sw (r1+72),r0 the_message_queue->maximum_message_size = maximum_message_size; 800e1f4: 58 24 00 4c sw (r1+76),r4 ) { size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 800e1f8: 59 63 00 44 sw (r11+68),r3 /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 800e1fc: 20 81 00 03 andi r1,r4,0x3 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 800e200: b8 40 78 00 mv r15,r2 800e204: b8 60 68 00 mv r13,r3 /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 800e208: b8 80 28 00 mv r5,r4 800e20c: 44 20 00 06 be r1,r0,800e224 <_CORE_message_queue_Initialize+0x54> allocated_message_size += sizeof(uintptr_t); 800e210: 34 85 00 04 addi r5,r4,4 allocated_message_size &= ~(sizeof(uintptr_t) - 1); 800e214: 34 01 ff fc mvi r1,-4 800e218: a0 a1 28 00 and r5,r5,r1 /* * Check for an overflow. It can occur while increasing allocated_message_size * to multiplicity of uintptr_t above. */ if (allocated_message_size < maximum_message_size) return false; 800e21c: 34 0c 00 00 mvi r12,0 /* * Check for an overflow. It can occur while increasing allocated_message_size * to multiplicity of uintptr_t above. */ if (allocated_message_size < maximum_message_size) 800e220: 54 85 00 1f bgu r4,r5,800e29c <_CORE_message_queue_Initialize+0xcc> /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ if ( !size_t_mult32_with_overflow( 800e224: 34 ae 00 10 addi r14,r5,16 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 800e228: 34 01 00 00 mvi r1,0 800e22c: b9 c0 10 00 mv r2,r14 800e230: 34 03 00 00 mvi r3,0 800e234: b9 a0 20 00 mv r4,r13 800e238: f8 00 42 8e calli 801ec70 <__muldi3> */ if ( !size_t_mult32_with_overflow( (size_t) maximum_pending_messages, allocated_message_size + sizeof(CORE_message_queue_Buffer_control), &message_buffering_required ) ) return false; 800e23c: 34 0c 00 00 mvi r12,0 size_t *c ) { long long x = (long long)a*b; if ( x > SIZE_MAX ) 800e240: 48 20 00 17 bg r1,r0,800e29c <_CORE_message_queue_Initialize+0xcc> /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 800e244: b8 40 08 00 mv r1,r2 800e248: f8 00 0e 70 calli 8011c08 <_Workspace_Allocate> return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 800e24c: 59 61 00 5c sw (r11+92),r1 _Workspace_Allocate( message_buffering_required ); 800e250: b8 20 28 00 mv r5,r1 if (the_message_queue->message_buffers == 0) 800e254: 44 20 00 12 be r1,r0,800e29c <_CORE_message_queue_Initialize+0xcc><== NEVER TAKEN /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 800e258: b8 a0 10 00 mv r2,r5 800e25c: 35 61 00 60 addi r1,r11,96 800e260: b9 a0 18 00 mv r3,r13 800e264: b9 c0 20 00 mv r4,r14 800e268: fb ff ff cd calli 800e19c <_Chain_Initialize> 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 ); 800e26c: 35 61 00 54 addi r1,r11,84 head->next = tail; 800e270: 59 61 00 50 sw (r11+80),r1 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 800e274: 35 61 00 50 addi r1,r11,80 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; tail->previous = head; 800e278: 59 61 00 58 sw (r11+88),r1 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 800e27c: 59 60 00 54 sw (r11+84),r0 allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 800e280: 29 e2 00 00 lw r2,(r15+0) 800e284: b9 60 08 00 mv r1,r11 800e288: 34 03 00 80 mvi r3,128 800e28c: 64 42 00 01 cmpei r2,r2,1 800e290: 34 04 00 06 mvi r4,6 800e294: f8 00 0b d0 calli 80111d4 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 800e298: 34 0c 00 01 mvi r12,1 } 800e29c: b9 80 08 00 mv r1,r12 800e2a0: 2b 9d 00 04 lw ra,(sp+4) 800e2a4: 2b 8b 00 18 lw r11,(sp+24) 800e2a8: 2b 8c 00 14 lw r12,(sp+20) 800e2ac: 2b 8d 00 10 lw r13,(sp+16) 800e2b0: 2b 8e 00 0c lw r14,(sp+12) 800e2b4: 2b 8f 00 08 lw r15,(sp+8) 800e2b8: 37 9c 00 18 addi sp,sp,24 800e2bc: c3 a0 00 00 ret =============================================================================== 0800e2c0 <_CORE_message_queue_Seize>: void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800e2c0: 37 9c ff f4 addi sp,sp,-12 800e2c4: 5b 8b 00 0c sw (sp+12),r11 800e2c8: 5b 8c 00 08 sw (sp+8),r12 800e2cc: 5b 9d 00 04 sw (sp+4),ra ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 800e2d0: 78 07 08 02 mvhi r7,0x802 800e2d4: 38 e7 7b 80 ori r7,r7,0x7b80 800e2d8: 28 e7 00 10 lw r7,(r7+16) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800e2dc: b8 20 58 00 mv r11,r1 800e2e0: 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; 800e2e4: 58 e0 00 34 sw (r7+52),r0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800e2e8: 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 ); 800e2ec: 90 00 40 00 rcsr r8,IE 800e2f0: 34 03 ff fe mvi r3,-2 800e2f4: a1 03 18 00 and r3,r8,r3 800e2f8: 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 ); } 800e2fc: 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 ); 800e300: 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)) 800e304: 45 83 00 07 be r12,r3,800e320 <_CORE_message_queue_Seize+0x60> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 800e308: 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 ); 800e30c: 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; 800e310: 59 63 00 50 sw (r11+80),r3 new_first->previous = head; 800e314: 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 ) { 800e318: 5d 80 00 04 bne r12,r0,800e328 <_CORE_message_queue_Seize+0x68><== ALWAYS TAKEN 800e31c: e0 00 00 13 bi 800e368 <_CORE_message_queue_Seize+0xa8> <== NOT EXECUTED ) { if ( !_Chain_Is_empty(the_chain)) return _Chain_Get_first_unprotected(the_chain); else return NULL; 800e320: 34 0c 00 00 mvi r12,0 800e324: e0 00 00 11 bi 800e368 <_CORE_message_queue_Seize+0xa8> the_message_queue->number_of_pending_messages -= 1; 800e328: 29 62 00 48 lw r2,(r11+72) 800e32c: 34 42 ff ff addi r2,r2,-1 800e330: 59 62 00 48 sw (r11+72),r2 _ISR_Enable( level ); 800e334: d0 08 00 00 wcsr IE,r8 *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 800e338: 78 02 08 02 mvhi r2,0x802 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; 800e33c: 29 83 00 08 lw r3,(r12+8) _Thread_Executing->Wait.count = 800e340: 38 42 7b 80 ori r2,r2,0x7b80 800e344: 28 42 00 10 lw r2,(r2+16) 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; 800e348: 58 83 00 00 sw (r4+0),r3 _Thread_Executing->Wait.count = 800e34c: 58 40 00 24 sw (r2+36),r0 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 800e350: 35 82 00 0c addi r2,r12,12 800e354: f8 00 20 cf calli 8016690 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 ); 800e358: 35 61 00 60 addi r1,r11,96 800e35c: b9 80 10 00 mv r2,r12 800e360: fb ff ff 74 calli 800e130 <_Chain_Append> /* * There is not an API with blocking sends enabled. * So return immediately. */ _CORE_message_queue_Free_message_buffer(the_message_queue, the_message); return; 800e364: e0 00 00 12 bi 800e3ac <_CORE_message_queue_Seize+0xec> return; } #endif } if ( !wait ) { 800e368: 5c ac 00 05 bne r5,r12,800e37c <_CORE_message_queue_Seize+0xbc> _ISR_Enable( level ); 800e36c: d0 08 00 00 wcsr IE,r8 executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 800e370: 34 01 00 04 mvi r1,4 800e374: 58 e1 00 34 sw (r7+52),r1 return; 800e378: e0 00 00 0d bi 800e3ac <_CORE_message_queue_Seize+0xec> 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; 800e37c: 34 03 00 01 mvi r3,1 800e380: 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; 800e384: 58 eb 00 44 sw (r7+68),r11 executing->Wait.id = id; 800e388: 58 e2 00 20 sw (r7+32),r2 executing->Wait.return_argument_second.mutable_object = buffer; 800e38c: 58 e1 00 2c sw (r7+44),r1 executing->Wait.return_argument = size_p; 800e390: 58 e4 00 28 sw (r7+40),r4 /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 800e394: d0 08 00 00 wcsr IE,r8 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 800e398: 78 03 08 01 mvhi r3,0x801 800e39c: b9 60 08 00 mv r1,r11 800e3a0: b8 c0 10 00 mv r2,r6 800e3a4: 38 63 13 14 ori r3,r3,0x1314 800e3a8: f8 00 0a a4 calli 8010e38 <_Thread_queue_Enqueue_with_handler> } 800e3ac: 2b 9d 00 04 lw ra,(sp+4) 800e3b0: 2b 8b 00 0c lw r11,(sp+12) 800e3b4: 2b 8c 00 08 lw r12,(sp+8) 800e3b8: 37 9c 00 0c addi sp,sp,12 800e3bc: c3 a0 00 00 ret =============================================================================== 080047e0 <_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 ) { 80047e0: 37 9c ff f8 addi sp,sp,-8 80047e4: 5b 8b 00 08 sw (sp+8),r11 80047e8: 5b 9d 00 04 sw (sp+4),ra 80047ec: 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)) ) { 80047f0: f8 00 08 80 calli 80069f0 <_Thread_queue_Dequeue> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 80047f4: 34 02 00 00 mvi r2,0 if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 80047f8: 5c 20 00 0d bne r1,r0,800482c <_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 ); 80047fc: 90 00 08 00 rcsr r1,IE 8004800: 34 02 ff fe mvi r2,-2 8004804: a0 22 10 00 and r2,r1,r2 8004808: d0 02 00 00 wcsr IE,r2 if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 800480c: 29 63 00 48 lw r3,(r11+72) 8004810: 29 64 00 40 lw r4,(r11+64) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 8004814: 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 ) 8004818: 50 64 00 04 bgeu r3,r4,8004828 <_CORE_semaphore_Surrender+0x48><== NEVER TAKEN the_semaphore->count += 1; 800481c: 34 63 00 01 addi r3,r3,1 8004820: 59 63 00 48 sw (r11+72),r3 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 8004824: 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 ); 8004828: d0 01 00 00 wcsr IE,r1 } return status; } 800482c: b8 40 08 00 mv r1,r2 8004830: 2b 9d 00 04 lw ra,(sp+4) 8004834: 2b 8b 00 08 lw r11,(sp+8) 8004838: 37 9c 00 08 addi sp,sp,8 800483c: c3 a0 00 00 ret =============================================================================== 08009174 <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 8009174: 37 9c ff f4 addi sp,sp,-12 8009178: 5b 8b 00 0c sw (sp+12),r11 800917c: 5b 8c 00 08 sw (sp+8),r12 8009180: 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; 8009184: 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 ) { 8009188: 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 ); 800918c: 90 00 08 00 rcsr r1,IE 8009190: 34 09 ff fe mvi r9,-2 8009194: a0 29 48 00 and r9,r1,r9 8009198: 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; 800919c: 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; 80091a0: 29 68 00 24 lw r8,(r11+36) 80091a4: b8 46 10 00 or r2,r2,r6 80091a8: 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 ); 80091ac: 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 ) ) { 80091b0: 44 c0 00 35 be r6,r0,8009284 <_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() && 80091b4: 78 07 08 01 mvhi r7,0x801 80091b8: 38 e7 da 60 ori r7,r7,0xda60 80091bc: 28 ec 00 08 lw r12,(r7+8) 80091c0: 45 80 00 13 be r12,r0,800920c <_Event_Surrender+0x98> 80091c4: 28 e7 00 10 lw r7,(r7+16) 80091c8: 5d 67 00 11 bne r11,r7,800920c <_Event_Surrender+0x98> _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 80091cc: 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 ) && 80091d0: 34 07 00 01 mvi r7,1 ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 80091d4: 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 ) && 80091d8: 55 87 00 0d bgu r12,r7,800920c <_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) ) { 80091dc: 44 c8 00 03 be r6,r8,80091e8 <_Event_Surrender+0x74> */ RTEMS_INLINE_ROUTINE bool _Options_Is_any ( rtems_option option_set ) { return (option_set & RTEMS_EVENT_ANY) ? true : false; 80091e0: 21 4a 00 02 andi r10,r10,0x2 80091e4: 45 40 00 28 be r10,r0,8009284 <_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) ); 80091e8: a4 c0 28 00 not r5,r6 80091ec: a0 a2 10 00 and r2,r5,r2 event->pending_events = _Event_sets_Clear( 80091f0: 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; 80091f4: 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; 80091f8: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 80091fc: 58 46 00 00 sw (r2+0),r6 *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 8009200: 34 02 00 03 mvi r2,3 8009204: 58 82 00 00 sw (r4+0),r2 8009208: e0 00 00 1f bi 8009284 <_Event_Surrender+0x110> RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 800920c: 29 64 00 10 lw r4,(r11+16) 8009210: 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 ) ) { 8009214: 44 a0 00 1c be r5,r0,8009284 <_Event_Surrender+0x110> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 8009218: 44 c8 00 03 be r6,r8,8009224 <_Event_Surrender+0xb0> 800921c: 21 4a 00 02 andi r10,r10,0x2 8009220: 45 40 00 19 be r10,r0,8009284 <_Event_Surrender+0x110> <== NEVER TAKEN 8009224: a4 c0 20 00 not r4,r6 8009228: a0 82 10 00 and r2,r4,r2 event->pending_events = _Event_sets_Clear( 800922c: 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; 8009230: 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; 8009234: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 8009238: 58 46 00 00 sw (r2+0),r6 _ISR_Flash( level ); 800923c: d0 01 00 00 wcsr IE,r1 8009240: d0 09 00 00 wcsr IE,r9 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 8009244: 29 63 00 50 lw r3,(r11+80) 8009248: 34 02 00 02 mvi r2,2 800924c: 44 62 00 03 be r3,r2,8009258 <_Event_Surrender+0xe4> _ISR_Enable( level ); 8009250: d0 01 00 00 wcsr IE,r1 8009254: e0 00 00 06 bi 800926c <_Event_Surrender+0xf8> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 8009258: 34 02 00 03 mvi r2,3 800925c: 59 62 00 50 sw (r11+80),r2 _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 8009260: d0 01 00 00 wcsr IE,r1 (void) _Watchdog_Remove( &the_thread->Timer ); 8009264: 35 61 00 48 addi r1,r11,72 8009268: fb ff f9 03 calli 8007674 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800926c: 78 03 08 01 mvhi r3,0x801 8009270: 38 63 bb ac ori r3,r3,0xbbac 8009274: 28 62 00 00 lw r2,(r3+0) 8009278: b9 60 08 00 mv r1,r11 800927c: f8 00 02 c6 calli 8009d94 <_Thread_Clear_state> 8009280: e0 00 00 02 bi 8009288 <_Event_Surrender+0x114> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 8009284: d0 01 00 00 wcsr IE,r1 } 8009288: 2b 9d 00 04 lw ra,(sp+4) 800928c: 2b 8b 00 0c lw r11,(sp+12) 8009290: 2b 8c 00 08 lw r12,(sp+8) 8009294: 37 9c 00 0c addi sp,sp,12 8009298: c3 a0 00 00 ret =============================================================================== 0800db2c <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 800db2c: 37 9c ff f4 addi sp,sp,-12 800db30: 5b 8b 00 08 sw (sp+8),r11 800db34: 5b 9d 00 04 sw (sp+4),ra 800db38: 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 ); 800db3c: 37 82 00 0c addi r2,sp,12 800db40: fb ff e7 89 calli 8007964 <_Thread_Get> switch ( location ) { 800db44: 2b 82 00 0c lw r2,(sp+12) 800db48: 5c 40 00 1b bne r2,r0,800dbb4 <_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 ); 800db4c: 90 00 10 00 rcsr r2,IE 800db50: 34 03 ff fe mvi r3,-2 800db54: a0 43 18 00 and r3,r2,r3 800db58: d0 03 00 00 wcsr IE,r3 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800db5c: 78 03 08 01 mvhi r3,0x801 800db60: 38 63 9a 80 ori r3,r3,0x9a80 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 800db64: 28 63 00 10 lw r3,(r3+16) _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 800db68: 58 20 00 24 sw (r1+36),r0 if ( _Thread_Is_executing( the_thread ) ) { 800db6c: 5c 23 00 06 bne r1,r3,800db84 <_Event_Timeout+0x58> if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800db70: 29 64 00 00 lw r4,(r11+0) 800db74: 34 03 00 01 mvi r3,1 800db78: 5c 83 00 03 bne r4,r3,800db84 <_Event_Timeout+0x58> *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800db7c: 34 03 00 02 mvi r3,2 800db80: 59 63 00 00 sw (r11+0),r3 } the_thread->Wait.return_code = RTEMS_TIMEOUT; 800db84: 34 03 00 06 mvi r3,6 800db88: 58 23 00 34 sw (r1+52),r3 _ISR_Enable( level ); 800db8c: d0 02 00 00 wcsr IE,r2 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800db90: 78 03 08 01 mvhi r3,0x801 800db94: 38 63 7a 40 ori r3,r3,0x7a40 800db98: 28 62 00 00 lw r2,(r3+0) 800db9c: f8 00 04 a0 calli 800ee1c <_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; 800dba0: 78 01 08 01 mvhi r1,0x801 800dba4: 38 21 99 00 ori r1,r1,0x9900 800dba8: 28 22 00 00 lw r2,(r1+0) --level; 800dbac: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 800dbb0: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800dbb4: 2b 9d 00 04 lw ra,(sp+4) 800dbb8: 2b 8b 00 08 lw r11,(sp+8) 800dbbc: 37 9c 00 0c addi sp,sp,12 800dbc0: c3 a0 00 00 ret =============================================================================== 08009a94 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 8009a94: 37 9c ff f4 addi sp,sp,-12 8009a98: 5b 8b 00 0c sw (sp+12),r11 8009a9c: 5b 8c 00 08 sw (sp+8),r12 8009aa0: 5b 9d 00 04 sw (sp+4),ra 8009aa4: 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; 8009aa8: 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 ) { 8009aac: 44 40 00 73 be r2,r0,8009c78 <_Heap_Free+0x1e4> 8009ab0: 34 4c ff f8 addi r12,r2,-8 8009ab4: b8 40 08 00 mv r1,r2 8009ab8: 29 62 00 10 lw r2,(r11+16) 8009abc: f8 00 42 c9 calli 801a5e0 <__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 8009ac0: 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); 8009ac4: 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; 8009ac8: 34 01 00 00 mvi r1,0 8009acc: 54 e3 00 03 bgu r7,r3,8009ad8 <_Heap_Free+0x44> 8009ad0: 29 61 00 24 lw r1,(r11+36) 8009ad4: 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 ) ) { 8009ad8: b8 20 10 00 mv r2,r1 return false; 8009adc: 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 ) ) { 8009ae0: 44 40 00 66 be r2,r0,8009c78 <_Heap_Free+0x1e4> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 8009ae4: 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; 8009ae8: 34 04 ff fe mvi r4,-2 8009aec: 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); 8009af0: 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; 8009af4: 54 e2 00 03 bgu r7,r2,8009b00 <_Heap_Free+0x6c> <== NEVER TAKEN 8009af8: 29 61 00 24 lw r1,(r11+36) 8009afc: 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 ) ) { 8009b00: b8 20 28 00 mv r5,r1 return false; 8009b04: 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 ) ) { 8009b08: 44 a0 00 5c be r5,r0,8009c78 <_Heap_Free+0x1e4> <== NEVER TAKEN --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 8009b0c: 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; 8009b10: 20 a8 00 01 andi r8,r5,0x1 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 8009b14: 45 00 00 59 be r8,r0,8009c78 <_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 8009b18: 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; 8009b1c: 34 01 ff fe mvi r1,-2 8009b20: a0 a1 28 00 and r5,r5,r1 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 8009b24: 34 08 00 00 mvi r8,0 8009b28: 45 22 00 05 be r9,r2,8009b3c <_Heap_Free+0xa8> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 8009b2c: 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; 8009b30: 28 28 00 04 lw r8,(r1+4) 8009b34: 21 08 00 01 andi r8,r8,0x1 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 8009b38: 65 08 00 00 cmpei r8,r8,0 8009b3c: 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 8009b40: 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 ) ) { 8009b44: 5c c0 00 24 bne r6,r0,8009bd4 <_Heap_Free+0x140> uintptr_t const prev_size = block->prev_size; 8009b48: 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; 8009b4c: 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); 8009b50: 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; 8009b54: 54 e3 00 02 bgu r7,r3,8009b5c <_Heap_Free+0xc8> <== NEVER TAKEN 8009b58: 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 ) ) { 8009b5c: b8 20 38 00 mv r7,r1 _HAssert( false ); return( false ); 8009b60: 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 ) ) { 8009b64: 44 e0 00 45 be r7,r0,8009c78 <_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; 8009b68: 28 67 00 04 lw r7,(r3+4) 8009b6c: 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) ) { 8009b70: 44 e0 00 42 be r7,r0,8009c78 <_Heap_Free+0x1e4> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 8009b74: 45 00 00 0f be r8,r0,8009bb0 <_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; 8009b78: 28 41 00 08 lw r1,(r2+8) Heap_Block *prev = block->prev; 8009b7c: 28 42 00 0c lw r2,(r2+12) uintptr_t const size = block_size + prev_size + next_block_size; 8009b80: b4 85 28 00 add r5,r4,r5 8009b84: b4 a6 30 00 add r6,r5,r6 prev->next = next; 8009b88: 58 41 00 08 sw (r2+8),r1 next->prev = prev; 8009b8c: 58 22 00 0c sw (r1+12),r2 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 8009b90: 29 61 00 38 lw r1,(r11+56) 8009b94: 34 21 ff ff addi r1,r1,-1 8009b98: 59 61 00 38 sw (r11+56),r1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 8009b9c: 38 c1 00 01 ori r1,r6,0x1 8009ba0: 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; 8009ba4: b4 66 18 00 add r3,r3,r6 8009ba8: 58 66 00 00 sw (r3+0),r6 8009bac: e0 00 00 29 bi 8009c50 <_Heap_Free+0x1bc> } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 8009bb0: b4 86 30 00 add r6,r4,r6 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 8009bb4: 38 c1 00 01 ori r1,r6,0x1 8009bb8: 58 61 00 04 sw (r3+4),r1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 8009bbc: 28 43 00 04 lw r3,(r2+4) 8009bc0: 34 01 ff fe mvi r1,-2 next_block->prev_size = size; 8009bc4: 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; 8009bc8: a0 61 08 00 and r1,r3,r1 8009bcc: 58 41 00 04 sw (r2+4),r1 8009bd0: e0 00 00 20 bi 8009c50 <_Heap_Free+0x1bc> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 8009bd4: 45 00 00 0d be r8,r0,8009c08 <_Heap_Free+0x174> uintptr_t const size = block_size + next_block_size; 8009bd8: 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; 8009bdc: 28 45 00 08 lw r5,(r2+8) Heap_Block *prev = old_block->prev; 8009be0: 28 42 00 0c lw r2,(r2+12) new_block->next = next; 8009be4: 58 65 00 08 sw (r3+8),r5 new_block->prev = prev; 8009be8: 58 62 00 0c sw (r3+12),r2 next->prev = new_block; prev->next = new_block; 8009bec: 58 43 00 08 sw (r2+8),r3 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 8009bf0: 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; 8009bf4: 58 a3 00 0c sw (r5+12),r3 8009bf8: 58 62 00 04 sw (r3+4),r2 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 8009bfc: b4 61 18 00 add r3,r3,r1 8009c00: 58 61 00 00 sw (r3+0),r1 8009c04: e0 00 00 13 bi 8009c50 <_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; 8009c08: 29 61 00 08 lw r1,(r11+8) new_block->next = next; new_block->prev = block_before; 8009c0c: 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; 8009c10: 58 44 00 00 sw (r2+0),r4 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 8009c14: 58 61 00 08 sw (r3+8),r1 new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 8009c18: 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; 8009c1c: 38 81 00 01 ori r1,r4,0x1 8009c20: 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; 8009c24: 59 63 00 08 sw (r11+8),r3 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 8009c28: 28 43 00 04 lw r3,(r2+4) 8009c2c: 34 01 ff fe mvi r1,-2 8009c30: a0 61 08 00 and r1,r3,r1 8009c34: 58 41 00 04 sw (r2+4),r1 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 8009c38: 29 61 00 38 lw r1,(r11+56) if ( stats->max_free_blocks < stats->free_blocks ) { 8009c3c: 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; 8009c40: 34 21 00 01 addi r1,r1,1 8009c44: 59 61 00 38 sw (r11+56),r1 if ( stats->max_free_blocks < stats->free_blocks ) { 8009c48: 50 41 00 02 bgeu r2,r1,8009c50 <_Heap_Free+0x1bc> stats->max_free_blocks = stats->free_blocks; 8009c4c: 59 61 00 3c sw (r11+60),r1 } } /* Statistics */ --stats->used_blocks; 8009c50: 29 61 00 40 lw r1,(r11+64) 8009c54: 34 21 ff ff addi r1,r1,-1 8009c58: 59 61 00 40 sw (r11+64),r1 ++stats->frees; 8009c5c: 29 61 00 50 lw r1,(r11+80) 8009c60: 34 21 00 01 addi r1,r1,1 8009c64: 59 61 00 50 sw (r11+80),r1 stats->free_size += block_size; 8009c68: 29 61 00 30 lw r1,(r11+48) 8009c6c: b4 24 20 00 add r4,r1,r4 8009c70: 59 64 00 30 sw (r11+48),r4 return( true ); 8009c74: 34 01 00 01 mvi r1,1 } 8009c78: 2b 9d 00 04 lw ra,(sp+4) 8009c7c: 2b 8b 00 0c lw r11,(sp+12) 8009c80: 2b 8c 00 08 lw r12,(sp+8) 8009c84: 37 9c 00 0c addi sp,sp,12 8009c88: c3 a0 00 00 ret =============================================================================== 08006d84 <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 8006d84: 37 9c ff e4 addi sp,sp,-28 8006d88: 5b 8b 00 1c sw (sp+28),r11 8006d8c: 5b 8c 00 18 sw (sp+24),r12 8006d90: 5b 8d 00 14 sw (sp+20),r13 8006d94: 5b 8e 00 10 sw (sp+16),r14 8006d98: 5b 8f 00 0c sw (sp+12),r15 8006d9c: 5b 90 00 08 sw (sp+8),r16 8006da0: 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) { 8006da4: 34 0b 00 00 mvi r11,0 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 8006da8: b8 20 68 00 mv r13,r1 8006dac: b8 60 78 00 mv r15,r3 Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 8006db0: b8 40 70 00 mv r14,r2 Heap_Block *allocated_blocks = NULL; 8006db4: 34 0c 00 00 mvi r12,0 Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 8006db8: e0 00 00 0f bi 8006df4 <_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 ); 8006dbc: 29 c2 00 00 lw r2,(r14+0) 8006dc0: b9 a0 08 00 mv r1,r13 8006dc4: 34 03 00 00 mvi r3,0 8006dc8: 34 04 00 00 mvi r4,0 8006dcc: f8 00 20 66 calli 800ef64 <_Heap_Allocate_aligned_with_boundary> void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 8006dd0: 44 20 00 07 be r1,r0,8006dec <_Heap_Greedy_allocate+0x68> <== NEVER TAKEN RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8006dd4: 29 a2 00 10 lw r2,(r13+16) 8006dd8: 34 30 ff f8 addi r16,r1,-8 8006ddc: f8 00 41 79 calli 80173c0 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 8006de0: 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; 8006de4: 58 2c 00 08 sw (r1+8),r12 8006de8: 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) { 8006dec: 35 6b 00 01 addi r11,r11,1 8006df0: 35 ce 00 04 addi r14,r14,4 8006df4: 55 eb ff f2 bgu r15,r11,8006dbc <_Heap_Greedy_allocate+0x38> 8006df8: 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; 8006dfc: 34 0f ff fe mvi r15,-2 8006e00: e0 00 00 0a bi 8006e28 <_Heap_Greedy_allocate+0xa4> 8006e04: 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( 8006e08: b9 a0 08 00 mv r1,r13 8006e0c: b9 60 10 00 mv r2,r11 8006e10: a1 e4 20 00 and r4,r15,r4 8006e14: 35 63 00 08 addi r3,r11,8 8006e18: 34 84 ff f8 addi r4,r4,-8 8006e1c: f8 00 01 09 calli 8007240 <_Heap_Block_allocate> current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 8006e20: 59 6e 00 08 sw (r11+8),r14 8006e24: b9 60 70 00 mv r14,r11 Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 8006e28: 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 ) { 8006e2c: 5d 6d ff f6 bne r11,r13,8006e04 <_Heap_Greedy_allocate+0x80> 8006e30: e0 00 00 06 bi 8006e48 <_Heap_Greedy_allocate+0xc4> blocks = current; } while ( allocated_blocks != NULL ) { current = allocated_blocks; allocated_blocks = allocated_blocks->next; 8006e34: 29 8b 00 08 lw r11,(r12+8) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 8006e38: 35 82 00 08 addi r2,r12,8 8006e3c: b9 a0 08 00 mv r1,r13 8006e40: f8 00 20 cf calli 800f17c <_Heap_Free> blocks = current; } while ( allocated_blocks != NULL ) { current = allocated_blocks; allocated_blocks = allocated_blocks->next; 8006e44: b9 60 60 00 mv r12,r11 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 8006e48: 5d 80 ff fb bne r12,r0,8006e34 <_Heap_Greedy_allocate+0xb0> allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 8006e4c: b9 c0 08 00 mv r1,r14 8006e50: 2b 9d 00 04 lw ra,(sp+4) 8006e54: 2b 8b 00 1c lw r11,(sp+28) 8006e58: 2b 8c 00 18 lw r12,(sp+24) 8006e5c: 2b 8d 00 14 lw r13,(sp+20) 8006e60: 2b 8e 00 10 lw r14,(sp+16) 8006e64: 2b 8f 00 0c lw r15,(sp+12) 8006e68: 2b 90 00 08 lw r16,(sp+8) 8006e6c: 37 9c 00 1c addi sp,sp,28 8006e70: c3 a0 00 00 ret =============================================================================== 0800f974 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 800f974: 37 9c ff e8 addi sp,sp,-24 800f978: 5b 8b 00 18 sw (sp+24),r11 800f97c: 5b 8c 00 14 sw (sp+20),r12 800f980: 5b 8d 00 10 sw (sp+16),r13 800f984: 5b 8e 00 0c sw (sp+12),r14 800f988: 5b 8f 00 08 sw (sp+8),r15 800f98c: 5b 9d 00 04 sw (sp+4),ra 800f990: b8 20 28 00 mv r5,r1 800f994: b8 40 78 00 mv r15,r2 800f998: b8 60 70 00 mv r14,r3 Heap_Block *current = heap->first_block; 800f99c: 28 21 00 20 lw r1,(r1+32) Heap_Block *end = heap->last_block; 800f9a0: 28 ad 00 24 lw r13,(r5+36) 800f9a4: 34 0c ff fe mvi r12,-2 800f9a8: e0 00 00 0a bi 800f9d0 <_Heap_Iterate+0x5c> 800f9ac: 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 ); 800f9b0: b9 c0 20 00 mv r4,r14 800f9b4: 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); 800f9b8: 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; 800f9bc: 29 63 00 04 lw r3,(r11+4) 800f9c0: 20 63 00 01 andi r3,r3,0x1 800f9c4: 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 ) { 800f9c8: 5c 20 00 03 bne r1,r0,800f9d4 <_Heap_Iterate+0x60> <== NEVER TAKEN 800f9cc: b9 60 08 00 mv r1,r11 800f9d0: 5c 2d ff f7 bne r1,r13,800f9ac <_Heap_Iterate+0x38> stop = (*visitor)( current, size, used, visitor_arg ); current = next; } } 800f9d4: 2b 9d 00 04 lw ra,(sp+4) 800f9d8: 2b 8b 00 18 lw r11,(sp+24) 800f9dc: 2b 8c 00 14 lw r12,(sp+20) 800f9e0: 2b 8d 00 10 lw r13,(sp+16) 800f9e4: 2b 8e 00 0c lw r14,(sp+12) 800f9e8: 2b 8f 00 08 lw r15,(sp+8) 800f9ec: 37 9c 00 18 addi sp,sp,24 800f9f0: c3 a0 00 00 ret =============================================================================== 0801aefc <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 801aefc: 37 9c ff ec addi sp,sp,-20 801af00: 5b 8b 00 14 sw (sp+20),r11 801af04: 5b 8c 00 10 sw (sp+16),r12 801af08: 5b 8d 00 0c sw (sp+12),r13 801af0c: 5b 8e 00 08 sw (sp+8),r14 801af10: 5b 9d 00 04 sw (sp+4),ra 801af14: 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); 801af18: 34 4e ff f8 addi r14,r2,-8 801af1c: b8 40 08 00 mv r1,r2 801af20: b8 40 60 00 mv r12,r2 801af24: 29 62 00 10 lw r2,(r11+16) 801af28: b8 60 68 00 mv r13,r3 801af2c: fb ff fd ad calli 801a5e0 <__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 801af30: 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); 801af34: 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; 801af38: 34 01 00 00 mvi r1,0 801af3c: 54 44 00 03 bgu r2,r4,801af48 <_Heap_Size_of_alloc_area+0x4c> 801af40: 29 61 00 24 lw r1,(r11+36) 801af44: 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 ) ) { 801af48: b8 20 18 00 mv r3,r1 return false; 801af4c: 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 ) ) { 801af50: 44 60 00 13 be r3,r0,801af9c <_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; 801af54: 28 83 00 04 lw r3,(r4+4) 801af58: 34 01 ff fe mvi r1,-2 801af5c: 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); 801af60: 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; 801af64: 34 01 00 00 mvi r1,0 801af68: 54 44 00 03 bgu r2,r4,801af74 <_Heap_Size_of_alloc_area+0x78><== NEVER TAKEN 801af6c: 29 61 00 24 lw r1,(r11+36) 801af70: f0 24 08 00 cmpgeu r1,r1,r4 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 801af74: b8 20 10 00 mv r2,r1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 801af78: 34 01 00 00 mvi r1,0 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 801af7c: 44 40 00 08 be r2,r0,801af9c <_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; 801af80: 28 82 00 04 lw r2,(r4+4) 801af84: 20 42 00 01 andi r2,r2,0x1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 801af88: 44 40 00 05 be r2,r0,801af9c <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 801af8c: c8 8c 20 00 sub r4,r4,r12 801af90: 34 84 00 04 addi r4,r4,4 801af94: 59 a4 00 00 sw (r13+0),r4 return true; 801af98: 34 01 00 01 mvi r1,1 } 801af9c: 2b 9d 00 04 lw ra,(sp+4) 801afa0: 2b 8b 00 14 lw r11,(sp+20) 801afa4: 2b 8c 00 10 lw r12,(sp+16) 801afa8: 2b 8d 00 0c lw r13,(sp+12) 801afac: 2b 8e 00 08 lw r14,(sp+8) 801afb0: 37 9c 00 14 addi sp,sp,20 801afb4: c3 a0 00 00 ret =============================================================================== 08005484 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8005484: 37 9c ff a0 addi sp,sp,-96 8005488: 5b 8b 00 50 sw (sp+80),r11 800548c: 5b 8c 00 4c sw (sp+76),r12 8005490: 5b 8d 00 48 sw (sp+72),r13 8005494: 5b 8e 00 44 sw (sp+68),r14 8005498: 5b 8f 00 40 sw (sp+64),r15 800549c: 5b 90 00 3c sw (sp+60),r16 80054a0: 5b 91 00 38 sw (sp+56),r17 80054a4: 5b 92 00 34 sw (sp+52),r18 80054a8: 5b 93 00 30 sw (sp+48),r19 80054ac: 5b 94 00 2c sw (sp+44),r20 80054b0: 5b 95 00 28 sw (sp+40),r21 80054b4: 5b 96 00 24 sw (sp+36),r22 80054b8: 5b 97 00 20 sw (sp+32),r23 80054bc: 5b 98 00 1c sw (sp+28),r24 80054c0: 5b 99 00 18 sw (sp+24),r25 80054c4: 5b 9b 00 14 sw (sp+20),fp 80054c8: 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; 80054cc: 78 0d 08 00 mvhi r13,0x800 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 80054d0: 20 63 00 ff andi r3,r3,0xff 80054d4: b8 20 60 00 mv r12,r1 80054d8: b8 40 70 00 mv r14,r2 uintptr_t const page_size = heap->page_size; 80054dc: 28 33 00 10 lw r19,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 80054e0: 28 35 00 14 lw r21,(r1+20) Heap_Block *const first_block = heap->first_block; 80054e4: 28 34 00 20 lw r20,(r1+32) Heap_Block *const last_block = heap->last_block; 80054e8: 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; 80054ec: 39 ad 53 ec ori r13,r13,0x53ec 80054f0: 44 60 00 03 be r3,r0,80054fc <_Heap_Walk+0x78> 80054f4: 78 0d 08 00 mvhi r13,0x800 80054f8: 39 ad 54 10 ori r13,r13,0x5410 if ( !_System_state_Is_up( _System_state_Get() ) ) { 80054fc: 78 03 08 01 mvhi r3,0x801 8005500: 38 63 5a 74 ori r3,r3,0x5a74 8005504: 28 67 00 00 lw r7,(r3+0) 8005508: 34 02 00 03 mvi r2,3 return true; 800550c: 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() ) ) { 8005510: 5c e2 01 08 bne r7,r2,8005930 <_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)( 8005514: 29 81 00 08 lw r1,(r12+8) 8005518: 29 86 00 18 lw r6,(r12+24) 800551c: 29 87 00 1c lw r7,(r12+28) 8005520: 5b 81 00 08 sw (sp+8),r1 8005524: 29 81 00 0c lw r1,(r12+12) 8005528: 78 03 08 01 mvhi r3,0x801 800552c: 5b 96 00 04 sw (sp+4),r22 8005530: 5b 81 00 0c sw (sp+12),r1 8005534: 34 02 00 00 mvi r2,0 8005538: b9 c0 08 00 mv r1,r14 800553c: 38 63 34 78 ori r3,r3,0x3478 8005540: ba 60 20 00 mv r4,r19 8005544: ba a0 28 00 mv r5,r21 8005548: ba 80 40 00 mv r8,r20 800554c: 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 ) { 8005550: 5e 60 00 06 bne r19,r0,8005568 <_Heap_Walk+0xe4> (*printer)( source, true, "page size is zero\n" ); 8005554: 78 03 08 01 mvhi r3,0x801 8005558: b9 c0 08 00 mv r1,r14 800555c: 34 02 00 01 mvi r2,1 8005560: 38 63 35 0c ori r3,r3,0x350c 8005564: e0 00 00 25 bi 80055f8 <_Heap_Walk+0x174> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 8005568: 22 6f 00 03 andi r15,r19,0x3 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 800556c: 45 e0 00 07 be r15,r0,8005588 <_Heap_Walk+0x104> (*printer)( 8005570: 78 03 08 01 mvhi r3,0x801 8005574: b9 c0 08 00 mv r1,r14 8005578: 34 02 00 01 mvi r2,1 800557c: 38 63 35 20 ori r3,r3,0x3520 8005580: ba 60 20 00 mv r4,r19 8005584: e0 00 01 04 bi 8005994 <_Heap_Walk+0x510> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005588: ba a0 08 00 mv r1,r21 800558c: ba 60 10 00 mv r2,r19 8005590: fb ff ed 86 calli 8000ba8 <__umodsi3> 8005594: b8 20 58 00 mv r11,r1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 8005598: 44 2f 00 07 be r1,r15,80055b4 <_Heap_Walk+0x130> (*printer)( 800559c: 78 03 08 01 mvhi r3,0x801 80055a0: b9 c0 08 00 mv r1,r14 80055a4: 34 02 00 01 mvi r2,1 80055a8: 38 63 35 40 ori r3,r3,0x3540 80055ac: ba a0 20 00 mv r4,r21 80055b0: e0 00 00 f9 bi 8005994 <_Heap_Walk+0x510> 80055b4: 36 81 00 08 addi r1,r20,8 80055b8: ba 60 10 00 mv r2,r19 80055bc: fb ff ed 7b calli 8000ba8 <__umodsi3> ); return false; } if ( 80055c0: 44 2b 00 07 be r1,r11,80055dc <_Heap_Walk+0x158> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 80055c4: 78 03 08 01 mvhi r3,0x801 80055c8: b9 c0 08 00 mv r1,r14 80055cc: 34 02 00 01 mvi r2,1 80055d0: 38 63 35 64 ori r3,r3,0x3564 80055d4: ba 80 20 00 mv r4,r20 80055d8: e0 00 00 ef bi 8005994 <_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; 80055dc: 2a 82 00 04 lw r2,(r20+4) 80055e0: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 80055e4: 5c 41 00 07 bne r2,r1,8005600 <_Heap_Walk+0x17c> (*printer)( 80055e8: 78 03 08 01 mvhi r3,0x801 80055ec: b9 c0 08 00 mv r1,r14 80055f0: 34 02 00 01 mvi r2,1 80055f4: 38 63 35 98 ori r3,r3,0x3598 80055f8: d9 a0 00 00 call r13 80055fc: e0 00 00 40 bi 80056fc <_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; 8005600: 2a cf 00 04 lw r15,(r22+4) 8005604: 34 02 ff fe mvi r2,-2 8005608: 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); 800560c: 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; 8005610: 29 e2 00 04 lw r2,(r15+4) 8005614: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( _Heap_Is_free( last_block ) ) { 8005618: 5c 41 00 06 bne r2,r1,8005630 <_Heap_Walk+0x1ac> (*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 35 c8 ori r3,r3,0x35c8 800562c: e3 ff ff f3 bi 80055f8 <_Heap_Walk+0x174> ); return false; } if ( 8005630: 45 f4 00 06 be r15,r20,8005648 <_Heap_Walk+0x1c4> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 8005634: 78 03 08 01 mvhi r3,0x801 8005638: b9 c0 08 00 mv r1,r14 800563c: 34 02 00 01 mvi r2,1 8005640: 38 63 35 e0 ori r3,r3,0x35e0 8005644: e3 ff ff ed bi 80055f8 <_Heap_Walk+0x174> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 8005648: 29 92 00 10 lw r18,(r12+16) block = next_block; } while ( block != first_block ); return true; } 800564c: 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 ); 8005650: 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; 8005654: 34 11 ff fe mvi r17,-2 8005658: e0 00 00 2d bi 800570c <_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; 800565c: 29 83 00 20 lw r3,(r12+32) 8005660: 34 01 00 00 mvi r1,0 8005664: 54 6b 00 03 bgu r3,r11,8005670 <_Heap_Walk+0x1ec> 8005668: 29 81 00 24 lw r1,(r12+36) 800566c: 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 ) ) { 8005670: 5c 20 00 06 bne r1,r0,8005688 <_Heap_Walk+0x204> (*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 36 10 ori r3,r3,0x3610 8005684: e0 00 00 14 bi 80056d4 <_Heap_Walk+0x250> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005688: 35 61 00 08 addi r1,r11,8 800568c: ba 40 10 00 mv r2,r18 8005690: fb ff ed 46 calli 8000ba8 <__umodsi3> ); return false; } if ( 8005694: 44 20 00 06 be r1,r0,80056ac <_Heap_Walk+0x228> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 8005698: 78 03 08 01 mvhi r3,0x801 800569c: b9 c0 08 00 mv r1,r14 80056a0: 34 02 00 01 mvi r2,1 80056a4: 38 63 36 30 ori r3,r3,0x3630 80056a8: e0 00 00 0b bi 80056d4 <_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; 80056ac: 29 63 00 04 lw r3,(r11+4) 80056b0: a2 23 18 00 and r3,r17,r3 block = next_block; } while ( block != first_block ); return true; } 80056b4: 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; 80056b8: 28 63 00 04 lw r3,(r3+4) 80056bc: 20 63 00 01 andi r3,r3,0x1 ); return false; } if ( _Heap_Is_used( free_block ) ) { 80056c0: 44 61 00 07 be r3,r1,80056dc <_Heap_Walk+0x258> (*printer)( 80056c4: 78 03 08 01 mvhi r3,0x801 80056c8: b9 c0 08 00 mv r1,r14 80056cc: 34 02 00 01 mvi r2,1 80056d0: 38 63 36 60 ori r3,r3,0x3660 80056d4: b9 60 20 00 mv r4,r11 80056d8: e0 00 00 af bi 8005994 <_Heap_Walk+0x510> ); return false; } if ( free_block->prev != prev_block ) { 80056dc: 29 65 00 0c lw r5,(r11+12) 80056e0: 44 b0 00 09 be r5,r16,8005704 <_Heap_Walk+0x280> (*printer)( 80056e4: 78 03 08 01 mvhi r3,0x801 80056e8: b9 c0 08 00 mv r1,r14 80056ec: 34 02 00 01 mvi r2,1 80056f0: 38 63 36 7c ori r3,r3,0x367c 80056f4: b9 60 20 00 mv r4,r11 80056f8: 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; 80056fc: 34 03 00 00 mvi r3,0 8005700: e0 00 00 8c bi 8005930 <_Heap_Walk+0x4ac> return false; } prev_block = free_block; free_block = free_block->next; 8005704: b9 60 80 00 mv r16,r11 8005708: 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 ) { 800570c: 5d 6c ff d4 bne r11,r12,800565c <_Heap_Walk+0x1d8> 8005710: e0 00 00 03 bi 800571c <_Heap_Walk+0x298> block->prev_size ); } block = next_block; } while ( block != first_block ); 8005714: ba 20 78 00 mv r15,r17 8005718: e0 00 00 15 bi 800576c <_Heap_Walk+0x2e8> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 800571c: 78 01 08 01 mvhi r1,0x801 8005720: 38 21 38 2c ori r1,r1,0x382c 8005724: 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)( 8005728: 78 01 08 01 mvhi r1,0x801 800572c: 38 21 38 14 ori r1,r1,0x3814 8005730: 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)( 8005734: 78 01 08 01 mvhi r1,0x801 8005738: 38 21 34 40 ori r1,r1,0x3440 800573c: 5b 81 00 5c sw (sp+92),r1 8005740: 78 01 08 01 mvhi r1,0x801 8005744: 38 21 34 5c ori r1,r1,0x345c 8005748: 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)" : "") 800574c: 78 17 08 01 mvhi r23,0x801 8005750: 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)" : ""), 8005754: 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)( 8005758: 5b 81 00 60 sw (sp+96),r1 800575c: 3b 7b 37 70 ori fp,fp,0x3770 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005760: 3a f7 37 e0 ori r23,r23,0x37e0 8005764: 3b 39 34 6c ori r25,r25,0x346c block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005768: 3b 18 34 50 ori r24,r24,0x3450 block = next_block; } while ( block != first_block ); return true; } 800576c: 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; 8005770: 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; 8005774: 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; 8005778: 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); 800577c: 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; 8005780: 34 06 00 00 mvi r6,0 8005784: 54 91 00 03 bgu r4,r17,8005790 <_Heap_Walk+0x30c> <== NEVER TAKEN 8005788: 29 86 00 24 lw r6,(r12+36) 800578c: 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 ) ) { 8005790: 5c c0 00 06 bne r6,r0,80057a8 <_Heap_Walk+0x324> (*printer)( 8005794: 78 03 08 01 mvhi r3,0x801 8005798: b9 c0 08 00 mv r1,r14 800579c: 34 02 00 01 mvi r2,1 80057a0: 38 63 36 b0 ori r3,r3,0x36b0 80057a4: e0 00 00 1f bi 8005820 <_Heap_Walk+0x39c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 80057a8: ba 00 08 00 mv r1,r16 80057ac: 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; 80057b0: fd f6 58 00 cmpne r11,r15,r22 80057b4: fb ff ec fd calli 8000ba8 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 80057b8: 44 20 00 09 be r1,r0,80057dc <_Heap_Walk+0x358> 80057bc: 45 60 00 08 be r11,r0,80057dc <_Heap_Walk+0x358> (*printer)( 80057c0: 78 03 08 01 mvhi r3,0x801 80057c4: b9 c0 08 00 mv r1,r14 80057c8: 34 02 00 01 mvi r2,1 80057cc: 38 63 36 e0 ori r3,r3,0x36e0 80057d0: b9 e0 20 00 mv r4,r15 80057d4: ba 00 28 00 mv r5,r16 80057d8: e3 ff ff c8 bi 80056f8 <_Heap_Walk+0x274> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 80057dc: 52 15 00 0b bgeu r16,r21,8005808 <_Heap_Walk+0x384> 80057e0: 45 60 00 0a be r11,r0,8005808 <_Heap_Walk+0x384> <== NEVER TAKEN (*printer)( 80057e4: 78 03 08 01 mvhi r3,0x801 80057e8: b9 c0 08 00 mv r1,r14 80057ec: 34 02 00 01 mvi r2,1 80057f0: 38 63 37 10 ori r3,r3,0x3710 80057f4: b9 e0 20 00 mv r4,r15 80057f8: ba 00 28 00 mv r5,r16 80057fc: ba a0 30 00 mv r6,r21 8005800: d9 a0 00 00 call r13 8005804: e3 ff ff be bi 80056fc <_Heap_Walk+0x278> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 8005808: 56 2f 00 09 bgu r17,r15,800582c <_Heap_Walk+0x3a8> 800580c: 45 60 00 08 be r11,r0,800582c <_Heap_Walk+0x3a8> (*printer)( 8005810: 78 03 08 01 mvhi r3,0x801 8005814: b9 c0 08 00 mv r1,r14 8005818: 34 02 00 01 mvi r2,1 800581c: 38 63 37 3c ori r3,r3,0x373c 8005820: b9 e0 20 00 mv r4,r15 8005824: ba 20 28 00 mv r5,r17 8005828: e3 ff ff b4 bi 80056f8 <_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; 800582c: 2a 24 00 04 lw r4,(r17+4) 8005830: 22 52 00 01 andi r18,r18,0x1 8005834: 20 84 00 01 andi r4,r4,0x1 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 8005838: 5c 80 00 2d bne r4,r0,80058ec <_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 ? 800583c: 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)( 8005840: 29 85 00 08 lw r5,(r12+8) block = next_block; } while ( block != first_block ); return true; } 8005844: 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)( 8005848: 2b 87 00 5c lw r7,(sp+92) 800584c: 44 c5 00 04 be r6,r5,800585c <_Heap_Walk+0x3d8> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005850: ba e0 38 00 mv r7,r23 8005854: 5c cc 00 02 bne r6,r12,800585c <_Heap_Walk+0x3d8> 8005858: bb 00 38 00 mv r7,r24 block->next, block->next == last_free_block ? 800585c: 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)( 8005860: 2b 89 00 60 lw r9,(sp+96) 8005864: 45 04 00 04 be r8,r4,8005874 <_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)" : "") 8005868: ba e0 48 00 mv r9,r23 800586c: 5d 0c 00 02 bne r8,r12,8005874 <_Heap_Walk+0x3f0> 8005870: 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)( 8005874: 5b 89 00 04 sw (sp+4),r9 8005878: b9 c0 08 00 mv r1,r14 800587c: 34 02 00 00 mvi r2,0 8005880: bb 60 18 00 mv r3,fp 8005884: b9 e0 20 00 mv r4,r15 8005888: ba 00 28 00 mv r5,r16 800588c: 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 ) { 8005890: 2a 26 00 00 lw r6,(r17+0) 8005894: 46 06 00 0a be r16,r6,80058bc <_Heap_Walk+0x438> (*printer)( 8005898: 78 03 08 01 mvhi r3,0x801 800589c: b9 c0 08 00 mv r1,r14 80058a0: 34 02 00 01 mvi r2,1 80058a4: 38 63 37 a8 ori r3,r3,0x37a8 80058a8: b9 e0 20 00 mv r4,r15 80058ac: ba 00 28 00 mv r5,r16 80058b0: ba 20 38 00 mv r7,r17 80058b4: d9 a0 00 00 call r13 80058b8: e3 ff ff 91 bi 80056fc <_Heap_Walk+0x278> ); return false; } if ( !prev_used ) { 80058bc: 5e 40 00 06 bne r18,r0,80058d4 <_Heap_Walk+0x450> (*printer)( 80058c0: 78 03 08 01 mvhi r3,0x801 80058c4: b9 c0 08 00 mv r1,r14 80058c8: 34 02 00 01 mvi r2,1 80058cc: 38 63 37 e4 ori r3,r3,0x37e4 80058d0: e0 00 00 30 bi 8005990 <_Heap_Walk+0x50c> block = next_block; } while ( block != first_block ); return true; } 80058d4: 29 85 00 08 lw r5,(r12+8) 80058d8: e0 00 00 03 bi 80058e4 <_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 ) { 80058dc: 44 af 00 13 be r5,r15,8005928 <_Heap_Walk+0x4a4> return true; } free_block = free_block->next; 80058e0: 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 ) { 80058e4: 5c ac ff fe bne r5,r12,80058dc <_Heap_Walk+0x458> 80058e8: e0 00 00 26 bi 8005980 <_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) { 80058ec: 46 40 00 08 be r18,r0,800590c <_Heap_Walk+0x488> (*printer)( 80058f0: 2b 83 00 58 lw r3,(sp+88) 80058f4: b9 c0 08 00 mv r1,r14 80058f8: 34 02 00 00 mvi r2,0 80058fc: b9 e0 20 00 mv r4,r15 8005900: ba 00 28 00 mv r5,r16 8005904: d9 a0 00 00 call r13 8005908: e0 00 00 08 bi 8005928 <_Heap_Walk+0x4a4> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 800590c: 2b 83 00 54 lw r3,(sp+84) 8005910: 29 e6 00 00 lw r6,(r15+0) 8005914: b9 c0 08 00 mv r1,r14 8005918: 34 02 00 00 mvi r2,0 800591c: b9 e0 20 00 mv r4,r15 8005920: ba 00 28 00 mv r5,r16 8005924: d9 a0 00 00 call r13 block->prev_size ); } block = next_block; } while ( block != first_block ); 8005928: 5e 91 ff 7b bne r20,r17,8005714 <_Heap_Walk+0x290> return true; 800592c: 34 03 00 01 mvi r3,1 } 8005930: b8 60 08 00 mv r1,r3 8005934: 2b 9d 00 10 lw ra,(sp+16) 8005938: 2b 8b 00 50 lw r11,(sp+80) 800593c: 2b 8c 00 4c lw r12,(sp+76) 8005940: 2b 8d 00 48 lw r13,(sp+72) 8005944: 2b 8e 00 44 lw r14,(sp+68) 8005948: 2b 8f 00 40 lw r15,(sp+64) 800594c: 2b 90 00 3c lw r16,(sp+60) 8005950: 2b 91 00 38 lw r17,(sp+56) 8005954: 2b 92 00 34 lw r18,(sp+52) 8005958: 2b 93 00 30 lw r19,(sp+48) 800595c: 2b 94 00 2c lw r20,(sp+44) 8005960: 2b 95 00 28 lw r21,(sp+40) 8005964: 2b 96 00 24 lw r22,(sp+36) 8005968: 2b 97 00 20 lw r23,(sp+32) 800596c: 2b 98 00 1c lw r24,(sp+28) 8005970: 2b 99 00 18 lw r25,(sp+24) 8005974: 2b 9b 00 14 lw fp,(sp+20) 8005978: 37 9c 00 60 addi sp,sp,96 800597c: c3 a0 00 00 ret return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 8005980: 78 03 08 01 mvhi r3,0x801 8005984: b9 c0 08 00 mv r1,r14 8005988: 34 02 00 01 mvi r2,1 800598c: 38 63 38 54 ori r3,r3,0x3854 8005990: b9 e0 20 00 mv r4,r15 8005994: d9 a0 00 00 call r13 8005998: e3 ff ff 59 bi 80056fc <_Heap_Walk+0x278> =============================================================================== 08003fb0 <_IO_Manager_initialization>: #include #include void _IO_Manager_initialization(void) { 8003fb0: 37 9c ff e8 addi sp,sp,-24 8003fb4: 5b 8b 00 18 sw (sp+24),r11 8003fb8: 5b 8c 00 14 sw (sp+20),r12 8003fbc: 5b 8d 00 10 sw (sp+16),r13 8003fc0: 5b 8e 00 0c sw (sp+12),r14 8003fc4: 5b 8f 00 08 sw (sp+8),r15 8003fc8: 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(); 8003fcc: 78 01 08 01 mvhi r1,0x801 8003fd0: 38 21 b2 0c ori r1,r1,0xb20c drivers_in_table = rtems_configuration_get_number_of_device_drivers(); 8003fd4: 28 2d 00 38 lw r13,(r1+56) number_of_drivers = rtems_configuration_get_maximum_drivers(); 8003fd8: 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(); 8003fdc: 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 ) 8003fe0: 51 ab 00 03 bgeu r13,r11,8003fec <_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 ) { 8003fe4: 5d 6d 00 0a bne r11,r13,800400c <_IO_Manager_initialization+0x5c><== ALWAYS TAKEN 8003fe8: e0 00 00 02 bi 8003ff0 <_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 ) 8003fec: 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; 8003ff0: 78 01 08 01 mvhi r1,0x801 8003ff4: 38 21 db 34 ori r1,r1,0xdb34 8003ff8: 58 2e 00 00 sw (r1+0),r14 _IO_Number_of_drivers = number_of_drivers; 8003ffc: 78 01 08 01 mvhi r1,0x801 8004000: 38 21 db 30 ori r1,r1,0xdb30 8004004: 58 2b 00 00 sw (r1+0),r11 return; 8004008: e0 00 00 27 bi 80040a4 <_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 ) 800400c: 34 02 00 01 mvi r2,1 8004010: b9 60 08 00 mv r1,r11 8004014: f8 00 58 89 calli 801a238 <__ashlsi3> 8004018: 34 02 00 03 mvi r2,3 800401c: b4 2b 08 00 add r1,r1,r11 8004020: f8 00 58 86 calli 801a238 <__ashlsi3> 8004024: 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( 8004028: f8 00 0e 5c calli 8007998 <_Workspace_Allocate_or_fatal_error> sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 800402c: 78 02 08 01 mvhi r2,0x801 8004030: 38 42 db 30 ori r2,r2,0xdb30 /* * 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 *) 8004034: 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; 8004038: 58 4b 00 00 sw (r2+0),r11 memset( 800403c: 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 *) 8004040: 39 8c db 34 ori r12,r12,0xdb34 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 8004044: 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 *) 8004048: 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( 800404c: f8 00 21 2b calli 800c4f8 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8004050: 34 03 00 00 mvi r3,0 8004054: 34 04 00 00 mvi r4,0 8004058: e0 00 00 12 bi 80040a0 <_IO_Manager_initialization+0xf0> _IO_Driver_address_table[index] = driver_table[index]; 800405c: 29 82 00 00 lw r2,(r12+0) #include #include #include void _IO_Manager_initialization(void) 8004060: 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]; 8004064: 28 29 00 00 lw r9,(r1+0) 8004068: 28 28 00 04 lw r8,(r1+4) 800406c: 28 27 00 08 lw r7,(r1+8) 8004070: 28 26 00 0c lw r6,(r1+12) 8004074: 28 25 00 10 lw r5,(r1+16) 8004078: 28 21 00 14 lw r1,(r1+20) 800407c: b4 43 10 00 add r2,r2,r3 8004080: 58 49 00 00 sw (r2+0),r9 8004084: 58 48 00 04 sw (r2+4),r8 8004088: 58 47 00 08 sw (r2+8),r7 800408c: 58 46 00 0c sw (r2+12),r6 8004090: 58 45 00 10 sw (r2+16),r5 8004094: 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++ ) 8004098: 34 84 00 01 addi r4,r4,1 800409c: 34 63 00 18 addi r3,r3,24 80040a0: 55 a4 ff ef bgu r13,r4,800405c <_IO_Manager_initialization+0xac> _IO_Driver_address_table[index] = driver_table[index]; } 80040a4: 2b 9d 00 04 lw ra,(sp+4) 80040a8: 2b 8b 00 18 lw r11,(sp+24) 80040ac: 2b 8c 00 14 lw r12,(sp+20) 80040b0: 2b 8d 00 10 lw r13,(sp+16) 80040b4: 2b 8e 00 0c lw r14,(sp+12) 80040b8: 2b 8f 00 08 lw r15,(sp+8) 80040bc: 37 9c 00 18 addi sp,sp,24 80040c0: c3 a0 00 00 ret =============================================================================== 08004f80 <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 8004f80: 37 9c ff ec addi sp,sp,-20 8004f84: 5b 8b 00 14 sw (sp+20),r11 8004f88: 5b 8c 00 10 sw (sp+16),r12 8004f8c: 5b 8d 00 0c sw (sp+12),r13 8004f90: 5b 8e 00 08 sw (sp+8),r14 8004f94: 5b 9d 00 04 sw (sp+4),ra 8004f98: 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 ) 8004f9c: 28 21 00 18 lw r1,(r1+24) return NULL; 8004fa0: 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 ) 8004fa4: 44 20 00 1e be r1,r0,800501c <_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 ); 8004fa8: 35 6d 00 20 addi r13,r11,32 8004fac: b9 a0 08 00 mv r1,r13 8004fb0: fb ff fd 03 calli 80043bc <_Chain_Get> 8004fb4: b8 20 60 00 mv r12,r1 8004fb8: b8 20 70 00 mv r14,r1 if ( information->auto_extend ) { 8004fbc: 41 61 00 12 lbu r1,(r11+18) 8004fc0: 44 20 00 17 be r1,r0,800501c <_Objects_Allocate+0x9c> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 8004fc4: 5d 80 00 07 bne r12,r0,8004fe0 <_Objects_Allocate+0x60> _Objects_Extend_information( information ); 8004fc8: b9 60 08 00 mv r1,r11 8004fcc: f8 00 00 1c calli 800503c <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 8004fd0: b9 a0 08 00 mv r1,r13 8004fd4: fb ff fc fa calli 80043bc <_Chain_Get> 8004fd8: b8 20 60 00 mv r12,r1 } if ( the_object ) { 8004fdc: 44 2e 00 10 be r1,r14,800501c <_Objects_Allocate+0x9c> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 8004fe0: 2d 82 00 0a lhu r2,(r12+10) 8004fe4: 2d 61 00 0a lhu r1,(r11+10) _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 8004fe8: c8 41 08 00 sub r1,r2,r1 8004fec: 2d 62 00 14 lhu r2,(r11+20) 8004ff0: f8 00 55 6c calli 801a5a0 <__udivsi3> information->inactive_per_block[ block ]--; 8004ff4: 34 02 00 02 mvi r2,2 8004ff8: f8 00 54 90 calli 801a238 <__ashlsi3> 8004ffc: 29 62 00 30 lw r2,(r11+48) 8005000: b4 41 08 00 add r1,r2,r1 8005004: 28 22 00 00 lw r2,(r1+0) 8005008: 34 42 ff ff addi r2,r2,-1 800500c: 58 22 00 00 sw (r1+0),r2 information->inactive--; 8005010: 2d 61 00 2c lhu r1,(r11+44) 8005014: 34 21 ff ff addi r1,r1,-1 8005018: 0d 61 00 2c sh (r11+44),r1 ); } #endif return the_object; } 800501c: b9 80 08 00 mv r1,r12 8005020: 2b 9d 00 04 lw ra,(sp+4) 8005024: 2b 8b 00 14 lw r11,(sp+20) 8005028: 2b 8c 00 10 lw r12,(sp+16) 800502c: 2b 8d 00 0c lw r13,(sp+12) 8005030: 2b 8e 00 08 lw r14,(sp+8) 8005034: 37 9c 00 14 addi sp,sp,20 8005038: c3 a0 00 00 ret =============================================================================== 08005470 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 8005470: 37 9c ff ec addi sp,sp,-20 8005474: 5b 8b 00 14 sw (sp+20),r11 8005478: 5b 8c 00 10 sw (sp+16),r12 800547c: 5b 8d 00 0c sw (sp+12),r13 8005480: 5b 8e 00 08 sw (sp+8),r14 8005484: 5b 9d 00 04 sw (sp+4),ra 8005488: 20 4c ff ff andi r12,r2,0xffff 800548c: b8 20 70 00 mv r14,r1 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) return NULL; 8005490: 34 0b 00 00 mvi r11,0 ) { Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 8005494: 45 80 00 16 be r12,r0,80054ec <_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 ); 8005498: f8 00 11 fd calli 8009c8c <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 800549c: 44 20 00 14 be r1,r0,80054ec <_Objects_Get_information+0x7c> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 80054a0: 55 81 00 13 bgu r12,r1,80054ec <_Objects_Get_information+0x7c> return NULL; if ( !_Objects_Information_table[ the_api ] ) 80054a4: 78 0d 08 01 mvhi r13,0x801 80054a8: b9 c0 08 00 mv r1,r14 80054ac: 34 02 00 02 mvi r2,2 80054b0: 39 ad d8 7c ori r13,r13,0xd87c 80054b4: f8 00 53 61 calli 801a238 <__ashlsi3> 80054b8: b5 a1 08 00 add r1,r13,r1 80054bc: 28 2d 00 00 lw r13,(r1+0) 80054c0: 45 a0 00 0b be r13,r0,80054ec <_Objects_Get_information+0x7c><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 80054c4: b9 80 08 00 mv r1,r12 80054c8: 34 02 00 02 mvi r2,2 80054cc: f8 00 53 5b calli 801a238 <__ashlsi3> 80054d0: b5 a1 08 00 add r1,r13,r1 80054d4: 28 2b 00 00 lw r11,(r1+0) if ( !info ) 80054d8: 45 60 00 05 be r11,r0,80054ec <_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 ) 80054dc: 2d 61 00 10 lhu r1,(r11+16) return NULL; 80054e0: 7c 21 00 00 cmpnei r1,r1,0 80054e4: c8 01 08 00 sub r1,r0,r1 80054e8: a1 61 58 00 and r11,r11,r1 #endif return info; } 80054ec: b9 60 08 00 mv r1,r11 80054f0: 2b 9d 00 04 lw ra,(sp+4) 80054f4: 2b 8b 00 14 lw r11,(sp+20) 80054f8: 2b 8c 00 10 lw r12,(sp+16) 80054fc: 2b 8d 00 0c lw r13,(sp+12) 8005500: 2b 8e 00 08 lw r14,(sp+8) 8005504: 37 9c 00 14 addi sp,sp,20 8005508: c3 a0 00 00 ret =============================================================================== 08018840 <_Objects_Get_no_protection>: Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 8018840: 37 9c ff f4 addi sp,sp,-12 8018844: 5b 8b 00 0c sw (sp+12),r11 8018848: 5b 8c 00 08 sw (sp+8),r12 801884c: 5b 9d 00 04 sw (sp+4),ra 8018850: 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; 8018854: 28 21 00 08 lw r1,(r1+8) Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 8018858: 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; 801885c: c8 41 08 00 sub r1,r2,r1 if ( information->maximum >= index ) { 8018860: 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; 8018864: 34 21 00 01 addi r1,r1,1 if ( information->maximum >= index ) { 8018868: 54 22 00 09 bgu r1,r2,801888c <_Objects_Get_no_protection+0x4c> if ( (the_object = information->local_table[ index ]) != NULL ) { 801886c: 28 8c 00 1c lw r12,(r4+28) 8018870: 34 02 00 02 mvi r2,2 8018874: fb ff d6 33 calli 800e140 <__ashlsi3> 8018878: b5 81 08 00 add r1,r12,r1 801887c: 28 21 00 00 lw r1,(r1+0) 8018880: 44 20 00 03 be r1,r0,801888c <_Objects_Get_no_protection+0x4c><== NEVER TAKEN *location = OBJECTS_LOCAL; 8018884: 59 60 00 00 sw (r11+0),r0 return the_object; 8018888: e0 00 00 04 bi 8018898 <_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; 801888c: 34 01 00 01 mvi r1,1 8018890: 59 61 00 00 sw (r11+0),r1 return NULL; 8018894: 34 01 00 00 mvi r1,0 } 8018898: 2b 9d 00 04 lw ra,(sp+4) 801889c: 2b 8b 00 0c lw r11,(sp+12) 80188a0: 2b 8c 00 08 lw r12,(sp+8) 80188a4: 37 9c 00 0c addi sp,sp,12 80188a8: c3 a0 00 00 ret =============================================================================== 0800a404 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 800a404: 37 9c ff e8 addi sp,sp,-24 800a408: 5b 8b 00 14 sw (sp+20),r11 800a40c: 5b 8c 00 10 sw (sp+16),r12 800a410: 5b 8d 00 0c sw (sp+12),r13 800a414: 5b 8e 00 08 sw (sp+8),r14 800a418: 5b 9d 00 04 sw (sp+4),ra 800a41c: b8 40 70 00 mv r14,r2 /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 800a420: b8 20 58 00 mv r11,r1 800a424: 5c 20 00 05 bne r1,r0,800a438 <_Objects_Id_to_name+0x34> 800a428: 78 01 08 03 mvhi r1,0x803 800a42c: 38 21 03 80 ori r1,r1,0x380 800a430: 28 21 00 10 lw r1,(r1+16) 800a434: 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); 800a438: 34 02 00 18 mvi r2,24 800a43c: b9 60 08 00 mv r1,r11 800a440: f8 00 7b ee calli 80293f8 <__lshrsi3> 800a444: 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 ) 800a448: 34 23 ff ff addi r3,r1,-1 800a44c: 34 02 00 02 mvi r2,2 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 800a450: 34 0d 00 03 mvi r13,3 800a454: 54 62 00 12 bgu r3,r2,800a49c <_Objects_Id_to_name+0x98> 800a458: e0 00 00 19 bi 800a4bc <_Objects_Id_to_name+0xb8> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 800a45c: 34 02 00 1b mvi r2,27 800a460: b9 60 08 00 mv r1,r11 800a464: f8 00 7b e5 calli 80293f8 <__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 ]; 800a468: 34 02 00 02 mvi r2,2 800a46c: f8 00 7b 95 calli 80292c0 <__ashlsi3> 800a470: b5 81 08 00 add r1,r12,r1 800a474: 28 21 00 00 lw r1,(r1+0) if ( !information ) 800a478: 44 20 00 09 be r1,r0,800a49c <_Objects_Id_to_name+0x98> <== NEVER TAKEN #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 800a47c: b9 60 10 00 mv r2,r11 800a480: 37 83 00 18 addi r3,sp,24 800a484: fb ff ff ba calli 800a36c <_Objects_Get> if ( !the_object ) 800a488: 44 20 00 05 be r1,r0,800a49c <_Objects_Id_to_name+0x98> return OBJECTS_INVALID_ID; *name = the_object->name; 800a48c: 28 21 00 0c lw r1,(r1+12) _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 800a490: 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; 800a494: 59 c1 00 00 sw (r14+0),r1 _Thread_Enable_dispatch(); 800a498: f8 00 04 4e calli 800b5d0 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 800a49c: b9 a0 08 00 mv r1,r13 800a4a0: 2b 9d 00 04 lw ra,(sp+4) 800a4a4: 2b 8b 00 14 lw r11,(sp+20) 800a4a8: 2b 8c 00 10 lw r12,(sp+16) 800a4ac: 2b 8d 00 0c lw r13,(sp+12) 800a4b0: 2b 8e 00 08 lw r14,(sp+8) 800a4b4: 37 9c 00 18 addi sp,sp,24 800a4b8: 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 ] ) 800a4bc: 78 0c 08 03 mvhi r12,0x803 800a4c0: 34 02 00 02 mvi r2,2 800a4c4: 39 8c 01 54 ori r12,r12,0x154 800a4c8: f8 00 7b 7e calli 80292c0 <__ashlsi3> 800a4cc: b5 81 08 00 add r1,r12,r1 800a4d0: 28 2c 00 00 lw r12,(r1+0) 800a4d4: 5d 80 ff e2 bne r12,r0,800a45c <_Objects_Id_to_name+0x58> 800a4d8: e3 ff ff f1 bi 800a49c <_Objects_Id_to_name+0x98> =============================================================================== 08006310 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 8006310: 37 9c ff e4 addi sp,sp,-28 8006314: 5b 8b 00 1c sw (sp+28),r11 8006318: 5b 8c 00 18 sw (sp+24),r12 800631c: 5b 8d 00 14 sw (sp+20),r13 8006320: 5b 8e 00 10 sw (sp+16),r14 8006324: 5b 8f 00 0c sw (sp+12),r15 8006328: 5b 90 00 08 sw (sp+8),r16 800632c: 5b 9d 00 04 sw (sp+4),ra 8006330: b8 20 70 00 mv r14,r1 8006334: b8 40 58 00 mv r11,r2 RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 8006338: 44 40 00 53 be r2,r0,8006484 <_RBTree_Extract_unprotected+0x174> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 800633c: 28 21 00 08 lw r1,(r1+8) 8006340: 5c 41 00 05 bne r2,r1,8006354 <_RBTree_Extract_unprotected+0x44> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); 8006344: b8 40 08 00 mv r1,r2 8006348: 34 02 00 01 mvi r2,1 800634c: f8 00 01 36 calli 8006824 <_RBTree_Next_unprotected> RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 8006350: 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]) { 8006354: 29 c1 00 0c lw r1,(r14+12) 8006358: 5d 61 00 05 bne r11,r1,800636c <_RBTree_Extract_unprotected+0x5c> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); 800635c: b9 60 08 00 mv r1,r11 8006360: 34 02 00 00 mvi r2,0 8006364: f8 00 01 30 calli 8006824 <_RBTree_Next_unprotected> RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 8006368: 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]) { 800636c: 29 6c 00 04 lw r12,(r11+4) 8006370: 29 6d 00 08 lw r13,(r11+8) 8006374: 45 80 00 2b be r12,r0,8006420 <_RBTree_Extract_unprotected+0x110> 8006378: 5d a0 00 03 bne r13,r0,8006384 <_RBTree_Extract_unprotected+0x74> 800637c: e0 00 00 2b bi 8006428 <_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]; 8006380: b8 20 60 00 mv r12,r1 8006384: 29 81 00 08 lw r1,(r12+8) 8006388: 5c 20 ff fe bne r1,r0,8006380 <_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]; 800638c: 29 8d 00 04 lw r13,(r12+4) if(leaf) { 8006390: 45 a1 00 04 be r13,r1,80063a0 <_RBTree_Extract_unprotected+0x90> leaf->parent = target->parent; 8006394: 29 81 00 00 lw r1,(r12+0) 8006398: 59 a1 00 00 sw (r13+0),r1 800639c: e0 00 00 03 bi 80063a8 <_RBTree_Extract_unprotected+0x98> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 80063a0: b9 80 08 00 mv r1,r12 80063a4: fb ff ff 70 calli 8006164 <_RBTree_Extract_validate_unprotected> } victim_color = target->color; dir = target != target->parent->child[0]; 80063a8: 29 90 00 00 lw r16,(r12+0) target->parent->child[dir] = leaf; 80063ac: 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; 80063b0: 29 8f 00 0c lw r15,(r12+12) dir = target != target->parent->child[0]; 80063b4: 2a 01 00 04 lw r1,(r16+4) target->parent->child[dir] = leaf; 80063b8: fd 81 08 00 cmpne r1,r12,r1 80063bc: fb ff ea 52 calli 8000d04 <__ashlsi3> 80063c0: b6 01 08 00 add r1,r16,r1 /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 80063c4: 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; 80063c8: 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; 80063cc: 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]; 80063d0: 2a 01 00 04 lw r1,(r16+4) the_node->parent->child[dir] = target; 80063d4: fd 61 08 00 cmpne r1,r11,r1 80063d8: fb ff ea 4b calli 8000d04 <__ashlsi3> 80063dc: b6 01 08 00 add r1,r16,r1 80063e0: 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]; 80063e4: 29 61 00 08 lw r1,(r11+8) 80063e8: 59 81 00 08 sw (r12+8),r1 if (the_node->child[RBT_RIGHT]) 80063ec: 29 61 00 08 lw r1,(r11+8) 80063f0: 44 20 00 02 be r1,r0,80063f8 <_RBTree_Extract_unprotected+0xe8><== NEVER TAKEN the_node->child[RBT_RIGHT]->parent = target; 80063f4: 58 2c 00 00 sw (r1+0),r12 target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 80063f8: 29 61 00 04 lw r1,(r11+4) 80063fc: 59 81 00 04 sw (r12+4),r1 if (the_node->child[RBT_LEFT]) 8006400: 29 61 00 04 lw r1,(r11+4) 8006404: 44 20 00 02 be r1,r0,800640c <_RBTree_Extract_unprotected+0xfc> the_node->child[RBT_LEFT]->parent = target; 8006408: 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; 800640c: 29 61 00 00 lw r1,(r11+0) 8006410: 59 81 00 00 sw (r12+0),r1 target->color = the_node->color; 8006414: 29 61 00 0c lw r1,(r11+12) 8006418: 59 81 00 0c sw (r12+12),r1 800641c: e0 00 00 11 bi 8006460 <_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 ) { 8006420: 5d ac 00 03 bne r13,r12,800642c <_RBTree_Extract_unprotected+0x11c> 8006424: e0 00 00 05 bi 8006438 <_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]) { 8006428: 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; 800642c: 29 61 00 00 lw r1,(r11+0) 8006430: 59 a1 00 00 sw (r13+0),r1 8006434: e0 00 00 03 bi 8006440 <_RBTree_Extract_unprotected+0x130> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 8006438: b9 60 08 00 mv r1,r11 800643c: fb ff ff 4a calli 8006164 <_RBTree_Extract_validate_unprotected> } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 8006440: 29 6c 00 00 lw r12,(r11+0) the_node->parent->child[dir] = leaf; 8006444: 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; 8006448: 29 6f 00 0c lw r15,(r11+12) /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 800644c: 29 81 00 04 lw r1,(r12+4) the_node->parent->child[dir] = leaf; 8006450: fd 61 08 00 cmpne r1,r11,r1 8006454: fb ff ea 2c calli 8000d04 <__ashlsi3> 8006458: b5 81 08 00 add r1,r12,r1 800645c: 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 */ 8006460: 5d e0 00 03 bne r15,r0,800646c <_RBTree_Extract_unprotected+0x15c> if (leaf) { 8006464: 45 af 00 02 be r13,r15,800646c <_RBTree_Extract_unprotected+0x15c> leaf->color = RBT_BLACK; /* case 2 */ 8006468: 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; 800646c: 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; 8006470: 59 60 00 08 sw (r11+8),r0 8006474: 59 60 00 04 sw (r11+4),r0 8006478: 59 60 00 00 sw (r11+0),r0 800647c: 44 20 00 02 be r1,r0,8006484 <_RBTree_Extract_unprotected+0x174> 8006480: 58 20 00 0c sw (r1+12),r0 } 8006484: 2b 9d 00 04 lw ra,(sp+4) 8006488: 2b 8b 00 1c lw r11,(sp+28) 800648c: 2b 8c 00 18 lw r12,(sp+24) 8006490: 2b 8d 00 14 lw r13,(sp+20) 8006494: 2b 8e 00 10 lw r14,(sp+16) 8006498: 2b 8f 00 0c lw r15,(sp+12) 800649c: 2b 90 00 08 lw r16,(sp+8) 80064a0: 37 9c 00 1c addi sp,sp,28 80064a4: c3 a0 00 00 ret =============================================================================== 08006f44 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 8006f44: 37 9c ff ec addi sp,sp,-20 8006f48: 5b 8b 00 14 sw (sp+20),r11 8006f4c: 5b 8c 00 10 sw (sp+16),r12 8006f50: 5b 8d 00 0c sw (sp+12),r13 8006f54: 5b 8e 00 08 sw (sp+8),r14 8006f58: 5b 9d 00 04 sw (sp+4),ra 8006f5c: b8 20 58 00 mv r11,r1 8006f60: b8 80 68 00 mv r13,r4 8006f64: b8 a0 70 00 mv r14,r5 8006f68: 20 c6 00 ff andi r6,r6,0xff size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 8006f6c: 44 20 00 0f be r1,r0,8006fa8 <_RBTree_Initialize+0x64> <== NEVER TAKEN RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 8006f70: 58 20 00 00 sw (r1+0),r0 the_rbtree->root = NULL; 8006f74: 58 20 00 04 sw (r1+4),r0 the_rbtree->first[0] = NULL; 8006f78: 58 20 00 08 sw (r1+8),r0 the_rbtree->first[1] = NULL; 8006f7c: 58 20 00 0c sw (r1+12),r0 the_rbtree->compare_function = compare_function; 8006f80: 58 22 00 10 sw (r1+16),r2 the_rbtree->is_unique = is_unique; 8006f84: 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; 8006f88: b8 60 60 00 mv r12,r3 while ( count-- ) { 8006f8c: e0 00 00 06 bi 8006fa4 <_RBTree_Initialize+0x60> _RBTree_Insert_unprotected(the_rbtree, next); 8006f90: b9 80 10 00 mv r2,r12 8006f94: b9 60 08 00 mv r1,r11 8006f98: fb ff ff 22 calli 8006c20 <_RBTree_Insert_unprotected> #include #include #include #include void _RBTree_Initialize( 8006f9c: b5 8e 60 00 add r12,r12,r14 8006fa0: 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-- ) { 8006fa4: 5d a0 ff fb bne r13,r0,8006f90 <_RBTree_Initialize+0x4c> _RBTree_Insert_unprotected(the_rbtree, next); next = (RBTree_Node *) _Addresses_Add_offset( (void *) next, node_size ); } } 8006fa8: 2b 9d 00 04 lw ra,(sp+4) 8006fac: 2b 8b 00 14 lw r11,(sp+20) 8006fb0: 2b 8c 00 10 lw r12,(sp+16) 8006fb4: 2b 8d 00 0c lw r13,(sp+12) 8006fb8: 2b 8e 00 08 lw r14,(sp+8) 8006fbc: 37 9c 00 14 addi sp,sp,20 8006fc0: c3 a0 00 00 ret =============================================================================== 08006590 <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 8006590: 37 9c ff e8 addi sp,sp,-24 8006594: 5b 8b 00 18 sw (sp+24),r11 8006598: 5b 8c 00 14 sw (sp+20),r12 800659c: 5b 8d 00 10 sw (sp+16),r13 80065a0: 5b 8e 00 0c sw (sp+12),r14 80065a4: 5b 8f 00 08 sw (sp+8),r15 80065a8: 5b 9d 00 04 sw (sp+4),ra if(!the_node) return (RBTree_Node*)-1; 80065ac: 34 0d ff ff mvi r13,-1 */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 80065b0: b8 20 60 00 mv r12,r1 80065b4: b8 40 58 00 mv r11,r2 if(!the_node) return (RBTree_Node*)-1; 80065b8: 44 40 00 5a be r2,r0,8006720 <_RBTree_Insert_unprotected+0x190> RBTree_Node *iter_node = the_rbtree->root; 80065bc: 28 2d 00 04 lw r13,(r1+4) int compare_result; if (!iter_node) { /* special case: first node inserted */ 80065c0: b9 a0 78 00 mv r15,r13 80065c4: 5d a0 00 2d bne r13,r0,8006678 <_RBTree_Insert_unprotected+0xe8> the_node->color = RBT_BLACK; 80065c8: 58 40 00 0c sw (r2+12),r0 the_rbtree->root = the_node; 80065cc: 59 82 00 04 sw (r12+4),r2 the_rbtree->first[0] = the_rbtree->first[1] = the_node; 80065d0: 59 82 00 0c sw (r12+12),r2 80065d4: 59 82 00 08 sw (r12+8),r2 the_node->parent = (RBTree_Node *) the_rbtree; 80065d8: 59 61 00 00 sw (r11+0),r1 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 80065dc: 58 40 00 08 sw (r2+8),r0 80065e0: 58 40 00 04 sw (r2+4),r0 80065e4: e0 00 00 4f bi 8006720 <_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 ) ) 80065e8: 44 20 00 4e be r1,r0,8006720 <_RBTree_Insert_unprotected+0x190> return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 80065ec: 34 02 00 1f mvi r2,31 80065f0: a4 20 08 00 not r1,r1 80065f4: fb ff e9 eb calli 8000da0 <__lshrsi3> if (!iter_node->child[dir]) { 80065f8: 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 ); 80065fc: b8 20 70 00 mv r14,r1 if (!iter_node->child[dir]) { 8006600: fb ff e9 c1 calli 8000d04 <__ashlsi3> 8006604: b5 a1 08 00 add r1,r13,r1 8006608: 28 2d 00 04 lw r13,(r1+4) 800660c: 34 22 00 04 addi r2,r1,4 8006610: 5d a0 00 19 bne r13,r0,8006674 <_RBTree_Insert_unprotected+0xe4> the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 8006614: 59 60 00 08 sw (r11+8),r0 8006618: 59 60 00 04 sw (r11+4),r0 the_node->color = RBT_RED; 800661c: 34 01 00 01 mvi r1,1 8006620: 59 61 00 0c sw (r11+12),r1 iter_node->child[dir] = the_node; 8006624: 58 4b 00 00 sw (r2+0),r11 the_node->parent = iter_node; 8006628: 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]; 800662c: 34 02 00 02 mvi r2,2 8006630: 35 c1 00 02 addi r1,r14,2 8006634: fb ff e9 b4 calli 8000d04 <__ashlsi3> 8006638: b5 81 10 00 add r2,r12,r1 /* update min/max */ compare_result = the_rbtree->compare_function( 800663c: 29 83 00 10 lw r3,(r12+16) 8006640: 28 42 00 00 lw r2,(r2+0) 8006644: b9 60 08 00 mv r1,r11 8006648: d8 60 00 00 call r3 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 800664c: 5d cd 00 03 bne r14,r13,8006658 <_RBTree_Insert_unprotected+0xc8> 8006650: 49 a1 00 03 bg r13,r1,800665c <_RBTree_Insert_unprotected+0xcc> 8006654: e0 00 00 2b bi 8006700 <_RBTree_Insert_unprotected+0x170> (dir && _RBTree_Is_greater(compare_result)) ) { 8006658: 4c 01 00 2a bge r0,r1,8006700 <_RBTree_Insert_unprotected+0x170> the_rbtree->first[dir] = the_node; 800665c: 35 c1 00 02 addi r1,r14,2 8006660: 34 02 00 02 mvi r2,2 8006664: fb ff e9 a8 calli 8000d04 <__ashlsi3> 8006668: b5 81 08 00 add r1,r12,r1 800666c: 58 2b 00 00 sw (r1+0),r11 8006670: e0 00 00 24 bi 8006700 <_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]) { 8006674: 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); 8006678: 29 83 00 10 lw r3,(r12+16) 800667c: b9 a0 10 00 mv r2,r13 8006680: b9 60 08 00 mv r1,r11 8006684: d8 60 00 00 call r3 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 8006688: 41 82 00 14 lbu r2,(r12+20) 800668c: 5c 40 ff d7 bne r2,r0,80065e8 <_RBTree_Insert_unprotected+0x58> 8006690: e3 ff ff d7 bi 80065ec <_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; 8006694: 29 82 00 00 lw r2,(r12+0) 8006698: 44 40 00 2b be r2,r0,8006744 <_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]) 800669c: 29 82 00 04 lw r2,(r12+4) 80066a0: 5c 22 00 02 bne r1,r2,80066a8 <_RBTree_Insert_unprotected+0x118> return the_node->parent->child[RBT_RIGHT]; 80066a4: 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); 80066a8: 44 40 00 27 be r2,r0,8006744 <_RBTree_Insert_unprotected+0x1b4> 80066ac: 28 43 00 0c lw r3,(r2+12) 80066b0: 5c 6e 00 25 bne r3,r14,8006744 <_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; 80066b4: 58 20 00 0c sw (r1+12),r0 u->color = RBT_BLACK; 80066b8: 58 40 00 0c sw (r2+12),r0 g->color = RBT_RED; 80066bc: 59 8e 00 0c sw (r12+12),r14 80066c0: b9 80 58 00 mv r11,r12 80066c4: e0 00 00 10 bi 8006704 <_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); 80066c8: b9 e0 10 00 mv r2,r15 80066cc: fb ff ff 84 calli 80064dc <_RBTree_Rotate> the_node = the_node->child[pdir]; 80066d0: b9 e0 08 00 mv r1,r15 80066d4: 34 02 00 02 mvi r2,2 80066d8: fb ff e9 8b calli 8000d04 <__ashlsi3> 80066dc: b5 61 08 00 add r1,r11,r1 80066e0: 28 2b 00 04 lw r11,(r1+4) } the_node->parent->color = RBT_BLACK; 80066e4: 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)); 80066e8: 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; 80066ec: 58 20 00 0c sw (r1+12),r0 g->color = RBT_RED; 80066f0: 59 8e 00 0c sw (r12+12),r14 /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 80066f4: b9 80 08 00 mv r1,r12 80066f8: fb ff ff 79 calli 80064dc <_RBTree_Rotate> 80066fc: e0 00 00 02 bi 8006704 <_RBTree_Insert_unprotected+0x174> 8006700: 34 0e 00 01 mvi r14,1 _ISR_Disable( level ); return_node = _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); return return_node; } 8006704: 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; 8006708: 28 2c 00 00 lw r12,(r1+0) 800670c: 45 80 00 04 be r12,r0,800671c <_RBTree_Insert_unprotected+0x18c> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8006710: 28 22 00 0c lw r2,(r1+12) 8006714: 5c 4e 00 03 bne r2,r14,8006720 <_RBTree_Insert_unprotected+0x190> 8006718: e3 ff ff df bi 8006694 <_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; 800671c: 59 60 00 0c sw (r11+12),r0 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 8006720: b9 a0 08 00 mv r1,r13 8006724: 2b 9d 00 04 lw ra,(sp+4) 8006728: 2b 8b 00 18 lw r11,(sp+24) 800672c: 2b 8c 00 14 lw r12,(sp+20) 8006730: 2b 8d 00 10 lw r13,(sp+16) 8006734: 2b 8e 00 0c lw r14,(sp+12) 8006738: 2b 8f 00 08 lw r15,(sp+8) 800673c: 37 9c 00 18 addi sp,sp,24 8006740: 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]; 8006744: 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]; 8006748: 28 22 00 04 lw r2,(r1+4) RBTree_Direction pdir = the_node->parent != g->child[0]; 800674c: 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]; 8006750: 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) { 8006754: 5c 4f ff dd bne r2,r15,80066c8 <_RBTree_Insert_unprotected+0x138> 8006758: e3 ff ff e3 bi 80066e4 <_RBTree_Insert_unprotected+0x154> =============================================================================== 08006790 <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 8006790: 37 9c ff e8 addi sp,sp,-24 8006794: 5b 8b 00 18 sw (sp+24),r11 8006798: 5b 8c 00 14 sw (sp+20),r12 800679c: 5b 8d 00 10 sw (sp+16),r13 80067a0: 5b 8e 00 0c sw (sp+12),r14 80067a4: 5b 8f 00 08 sw (sp+8),r15 80067a8: 5b 9d 00 04 sw (sp+4),ra 80067ac: 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); 80067b0: 64 42 00 00 cmpei r2,r2,0 80067b4: 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]; 80067b8: 34 41 00 02 addi r1,r2,2 80067bc: 34 02 00 02 mvi r2,2 80067c0: b8 60 70 00 mv r14,r3 80067c4: b8 80 68 00 mv r13,r4 80067c8: fb ff e9 4f calli 8000d04 <__ashlsi3> 80067cc: b5 61 08 00 add r1,r11,r1 80067d0: 28 2b 00 00 lw r11,(r1+0) 80067d4: e0 00 00 0b bi 8006800 <_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 ); 80067d8: b9 60 08 00 mv r1,r11 80067dc: b9 80 10 00 mv r2,r12 80067e0: b9 a0 18 00 mv r3,r13 80067e4: d9 c0 00 00 call r14 80067e8: b8 20 78 00 mv r15,r1 current = _RBTree_Next_unprotected( current, dir ); 80067ec: b9 80 10 00 mv r2,r12 80067f0: b9 60 08 00 mv r1,r11 80067f4: f8 00 00 0c calli 8006824 <_RBTree_Next_unprotected> 80067f8: 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 ) { 80067fc: 5d e0 00 02 bne r15,r0,8006804 <_RBTree_Iterate_unprotected+0x74><== NEVER TAKEN 8006800: 5d 60 ff f6 bne r11,r0,80067d8 <_RBTree_Iterate_unprotected+0x48> stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); } } 8006804: 2b 9d 00 04 lw ra,(sp+4) 8006808: 2b 8b 00 18 lw r11,(sp+24) 800680c: 2b 8c 00 14 lw r12,(sp+20) 8006810: 2b 8d 00 10 lw r13,(sp+16) 8006814: 2b 8e 00 0c lw r14,(sp+12) 8006818: 2b 8f 00 08 lw r15,(sp+8) 800681c: 37 9c 00 18 addi sp,sp,24 8006820: c3 a0 00 00 ret =============================================================================== 08006084 <_RBTree_Sibling>: * exists, and NULL if not. */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { 8006084: b8 20 18 00 mv r3,r1 if(!the_node) return NULL; 8006088: 34 01 00 00 mvi r1,0 800608c: 44 60 00 08 be r3,r0,80060ac <_RBTree_Sibling+0x28> if(!(the_node->parent)) return NULL; 8006090: 28 62 00 00 lw r2,(r3+0) 8006094: 44 40 00 06 be r2,r0,80060ac <_RBTree_Sibling+0x28> <== NEVER TAKEN if(!(the_node->parent->parent)) return NULL; 8006098: 28 44 00 00 lw r4,(r2+0) 800609c: 44 80 00 04 be r4,r0,80060ac <_RBTree_Sibling+0x28> if(the_node == the_node->parent->child[RBT_LEFT]) 80060a0: 28 41 00 04 lw r1,(r2+4) 80060a4: 5c 61 00 02 bne r3,r1,80060ac <_RBTree_Sibling+0x28> return the_node->parent->child[RBT_RIGHT]; 80060a8: 28 41 00 08 lw r1,(r2+8) else return the_node->parent->child[RBT_LEFT]; } 80060ac: c3 a0 00 00 ret =============================================================================== 08004afc <_RTEMS_signal_Post_switch_hook>: #include #include #include 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 14 lw r11,(r1+276) 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 (*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 } 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 =============================================================================== 08033188 <_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 ) { 8033188: 37 9c ff e4 addi sp,sp,-28 803318c: 5b 8b 00 14 sw (sp+20),r11 8033190: 5b 8c 00 10 sw (sp+16),r12 8033194: 5b 8d 00 0c sw (sp+12),r13 8033198: 5b 8e 00 08 sw (sp+8),r14 803319c: 5b 9d 00 04 sw (sp+4),ra 80331a0: b8 40 70 00 mv r14,r2 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 80331a4: 78 02 08 06 mvhi r2,0x806 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 80331a8: 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 ) { 80331ac: b8 20 58 00 mv r11,r1 80331b0: 38 42 7f 48 ori r2,r2,0x7f48 80331b4: 37 81 00 18 addi r1,sp,24 80331b8: b8 60 68 00 mv r13,r3 80331bc: fb ff 43 83 calli 8003fc8 <_TOD_Get_with_nanoseconds> const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 80331c0: 29 61 00 54 lw r1,(r11+84) case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80331c4: 2b 85 00 1c lw r5,(sp+28) 80331c8: 29 62 00 50 lw r2,(r11+80) 80331cc: 2b 83 00 18 lw r3,(sp+24) 80331d0: c8 a1 08 00 sub r1,r5,r1 80331d4: f4 25 20 00 cmpgu r4,r1,r5 80331d8: c8 62 10 00 sub r2,r3,r2 80331dc: c8 44 10 00 sub r2,r2,r4 80331e0: 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) { 80331e4: 78 02 08 06 mvhi r2,0x806 80331e8: 38 42 81 40 ori r2,r2,0x8140 80331ec: 28 47 00 10 lw r7,(r2+16) 80331f0: 59 c1 00 04 sw (r14+4),r1 #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 80331f4: 29 86 00 80 lw r6,(r12+128) 80331f8: 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; 80331fc: 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) { 8033200: 5d 87 00 19 bne r12,r7,8033264 <_Rate_monotonic_Get_status+0xdc> static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8033204: 28 41 00 24 lw r1,(r2+36) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8033208: b4 85 28 00 add r5,r4,r5 803320c: b4 c3 18 00 add r3,r6,r3 8033210: f4 85 20 00 cmpgu r4,r4,r5 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8033214: 28 46 00 20 lw r6,(r2+32) 8033218: c8 a1 08 00 sub r1,r5,r1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 803321c: b4 83 20 00 add r4,r4,r3 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8033220: f4 25 28 00 cmpgu r5,r1,r5 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8033224: 29 62 00 48 lw r2,(r11+72) 8033228: c8 86 20 00 sub r4,r4,r6 803322c: c8 85 20 00 sub r4,r4,r5 8033230: 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)) 8033234: 48 44 00 0b bg r2,r4,8033260 <_Rate_monotonic_Get_status+0xd8><== NEVER TAKEN 8033238: 5c 44 00 02 bne r2,r4,8033240 <_Rate_monotonic_Get_status+0xb8> 803323c: 54 61 00 09 bgu r3,r1,8033260 <_Rate_monotonic_Get_status+0xd8> const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8033240: c8 23 18 00 sub r3,r1,r3 8033244: f4 61 08 00 cmpgu r1,r3,r1 8033248: c8 82 10 00 sub r2,r4,r2 803324c: c8 41 08 00 sub r1,r2,r1 8033250: 59 a1 00 00 sw (r13+0),r1 8033254: 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; 8033258: 34 01 00 01 mvi r1,1 803325c: e0 00 00 02 bi 8033264 <_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; 8033260: 34 01 00 00 mvi r1,0 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 8033264: 2b 9d 00 04 lw ra,(sp+4) 8033268: 2b 8b 00 14 lw r11,(sp+20) 803326c: 2b 8c 00 10 lw r12,(sp+16) 8033270: 2b 8d 00 0c lw r13,(sp+12) 8033274: 2b 8e 00 08 lw r14,(sp+8) 8033278: 37 9c 00 1c addi sp,sp,28 803327c: c3 a0 00 00 ret =============================================================================== 08033650 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 8033650: 37 9c ff f4 addi sp,sp,-12 8033654: 5b 8b 00 08 sw (sp+8),r11 8033658: 5b 9d 00 04 sw (sp+4),ra 803365c: b8 20 10 00 mv r2,r1 8033660: 78 01 08 06 mvhi r1,0x806 8033664: 38 21 83 d0 ori r1,r1,0x83d0 8033668: 37 83 00 0c addi r3,sp,12 803366c: fb ff 45 7a calli 8004c54 <_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 ) { 8033670: 2b 82 00 0c lw r2,(sp+12) 8033674: b8 20 58 00 mv r11,r1 8033678: 5c 40 00 22 bne r2,r0,8033700 <_Rate_monotonic_Timeout+0xb0><== NEVER TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 803367c: 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); 8033680: 28 23 00 10 lw r3,(r1+16) 8033684: 20 63 40 00 andi r3,r3,0x4000 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 8033688: 44 62 00 09 be r3,r2,80336ac <_Rate_monotonic_Timeout+0x5c> 803368c: 28 23 00 20 lw r3,(r1+32) 8033690: 29 62 00 08 lw r2,(r11+8) 8033694: 5c 62 00 06 bne r3,r2,80336ac <_Rate_monotonic_Timeout+0x5c> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 8033698: 78 03 08 05 mvhi r3,0x805 803369c: 38 63 7f 7c ori r3,r3,0x7f7c 80336a0: 28 62 00 00 lw r2,(r3+0) 80336a4: fb ff 63 a7 calli 800c540 <_Thread_Clear_state> 80336a8: e0 00 00 06 bi 80336c0 <_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 ) { 80336ac: 29 62 00 38 lw r2,(r11+56) 80336b0: 34 01 00 01 mvi r1,1 80336b4: 5c 41 00 0c bne r2,r1,80336e4 <_Rate_monotonic_Timeout+0x94> the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 80336b8: 34 01 00 03 mvi r1,3 80336bc: 59 61 00 38 sw (r11+56),r1 _Rate_monotonic_Initiate_statistics( the_period ); 80336c0: b9 60 08 00 mv r1,r11 80336c4: fb ff ff 39 calli 80333a8 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 80336c8: 29 61 00 3c lw r1,(r11+60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 80336cc: 35 62 00 10 addi r2,r11,16 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 80336d0: 59 61 00 1c sw (r11+28),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 80336d4: 78 01 08 06 mvhi r1,0x806 80336d8: 38 21 80 58 ori r1,r1,0x8058 80336dc: fb ff 4c c8 calli 80069fc <_Watchdog_Insert> 80336e0: e0 00 00 03 bi 80336ec <_Rate_monotonic_Timeout+0x9c> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 80336e4: 34 01 00 04 mvi r1,4 80336e8: 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; 80336ec: 78 01 08 06 mvhi r1,0x806 80336f0: 38 21 7f c0 ori r1,r1,0x7fc0 80336f4: 28 22 00 00 lw r2,(r1+0) --level; 80336f8: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 80336fc: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 8033700: 2b 9d 00 04 lw ra,(sp+4) 8033704: 2b 8b 00 08 lw r11,(sp+8) 8033708: 37 9c 00 0c addi sp,sp,12 803370c: c3 a0 00 00 ret =============================================================================== 08033280 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 8033280: 37 9c ff e8 addi sp,sp,-24 8033284: 5b 8b 00 08 sw (sp+8),r11 8033288: 5b 9d 00 04 sw (sp+4),ra 803328c: b8 20 58 00 mv r11,r1 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8033290: 28 21 00 58 lw r1,(r1+88) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 8033294: 29 62 00 38 lw r2,(r11+56) /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8033298: 34 21 00 01 addi r1,r1,1 803329c: 59 61 00 58 sw (r11+88),r1 if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 80332a0: 34 01 00 04 mvi r1,4 80332a4: 5c 41 00 04 bne r2,r1,80332b4 <_Rate_monotonic_Update_statistics+0x34> stats->missed_count++; 80332a8: 29 61 00 5c lw r1,(r11+92) 80332ac: 34 21 00 01 addi r1,r1,1 80332b0: 59 61 00 5c sw (r11+92),r1 /* * Grab status for time statistics. */ valid_status = 80332b4: b9 60 08 00 mv r1,r11 80332b8: 37 82 00 0c addi r2,sp,12 80332bc: 37 83 00 14 addi r3,sp,20 80332c0: fb ff ff b2 calli 8033188 <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 80332c4: 44 20 00 35 be r1,r0,8033398 <_Rate_monotonic_Update_statistics+0x118><== NEVER TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80332c8: 2b 82 00 18 lw r2,(sp+24) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 80332cc: 29 63 00 74 lw r3,(r11+116) 80332d0: 29 64 00 70 lw r4,(r11+112) 80332d4: 2b 81 00 14 lw r1,(sp+20) 80332d8: b4 43 18 00 add r3,r2,r3 80332dc: f4 43 28 00 cmpgu r5,r2,r3 80332e0: b4 24 20 00 add r4,r1,r4 80332e4: 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 ) ) 80332e8: 29 63 00 60 lw r3,(r11+96) 80332ec: b4 a4 20 00 add r4,r5,r4 80332f0: 59 64 00 70 sw (r11+112),r4 80332f4: 48 61 00 05 bg r3,r1,8033308 <_Rate_monotonic_Update_statistics+0x88> 80332f8: 5c 61 00 06 bne r3,r1,8033310 <_Rate_monotonic_Update_statistics+0x90><== NEVER TAKEN 80332fc: 29 63 00 64 lw r3,(r11+100) 8033300: 54 62 00 02 bgu r3,r2,8033308 <_Rate_monotonic_Update_statistics+0x88> 8033304: e0 00 00 03 bi 8033310 <_Rate_monotonic_Update_statistics+0x90> stats->min_cpu_time = executed; 8033308: 59 61 00 60 sw (r11+96),r1 803330c: 59 62 00 64 sw (r11+100),r2 if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 8033310: 29 63 00 68 lw r3,(r11+104) 8033314: 48 23 00 05 bg r1,r3,8033328 <_Rate_monotonic_Update_statistics+0xa8><== NEVER TAKEN 8033318: 5c 61 00 06 bne r3,r1,8033330 <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN 803331c: 29 63 00 6c lw r3,(r11+108) 8033320: 54 43 00 02 bgu r2,r3,8033328 <_Rate_monotonic_Update_statistics+0xa8> 8033324: e0 00 00 03 bi 8033330 <_Rate_monotonic_Update_statistics+0xb0> stats->max_cpu_time = executed; 8033328: 59 61 00 68 sw (r11+104),r1 803332c: 59 62 00 6c sw (r11+108),r2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8033330: 2b 82 00 10 lw r2,(sp+16) 8033334: 29 63 00 8c lw r3,(r11+140) 8033338: 29 64 00 88 lw r4,(r11+136) 803333c: 2b 81 00 0c lw r1,(sp+12) 8033340: b4 43 18 00 add r3,r2,r3 8033344: f4 43 28 00 cmpgu r5,r2,r3 8033348: b4 24 20 00 add r4,r1,r4 803334c: 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 ) ) 8033350: 29 63 00 78 lw r3,(r11+120) 8033354: b4 a4 20 00 add r4,r5,r4 8033358: 59 64 00 88 sw (r11+136),r4 803335c: 48 61 00 05 bg r3,r1,8033370 <_Rate_monotonic_Update_statistics+0xf0> 8033360: 5c 61 00 06 bne r3,r1,8033378 <_Rate_monotonic_Update_statistics+0xf8><== NEVER TAKEN 8033364: 29 63 00 7c lw r3,(r11+124) 8033368: 54 62 00 02 bgu r3,r2,8033370 <_Rate_monotonic_Update_statistics+0xf0> 803336c: e0 00 00 03 bi 8033378 <_Rate_monotonic_Update_statistics+0xf8> stats->min_wall_time = since_last_period; 8033370: 59 61 00 78 sw (r11+120),r1 8033374: 59 62 00 7c sw (r11+124),r2 if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 8033378: 29 63 00 80 lw r3,(r11+128) 803337c: 48 23 00 05 bg r1,r3,8033390 <_Rate_monotonic_Update_statistics+0x110><== NEVER TAKEN 8033380: 5c 61 00 06 bne r3,r1,8033398 <_Rate_monotonic_Update_statistics+0x118><== NEVER TAKEN 8033384: 29 63 00 84 lw r3,(r11+132) 8033388: 54 43 00 02 bgu r2,r3,8033390 <_Rate_monotonic_Update_statistics+0x110> 803338c: e0 00 00 03 bi 8033398 <_Rate_monotonic_Update_statistics+0x118> stats->max_wall_time = since_last_period; 8033390: 59 61 00 80 sw (r11+128),r1 8033394: 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 } 8033398: 2b 9d 00 04 lw ra,(sp+4) 803339c: 2b 8b 00 08 lw r11,(sp+8) 80333a0: 37 9c 00 18 addi sp,sp,24 80333a4: c3 a0 00 00 ret =============================================================================== 08006720 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 8006720: 37 9c ff f8 addi sp,sp,-8 8006724: 5b 8b 00 08 sw (sp+8),r11 8006728: 5b 9d 00 04 sw (sp+4),ra 800672c: b8 20 58 00 mv r11,r1 void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 8006730: 34 01 00 1c mvi r1,28 8006734: f8 00 07 ac calli 80085e4 <_Workspace_Allocate> if ( sched ) { 8006738: 44 20 00 06 be r1,r0,8006750 <_Scheduler_CBS_Allocate+0x30><== NEVER TAKEN the_thread->scheduler_info = sched; 800673c: 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; 8006740: 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; 8006744: 58 2b 00 00 sw (r1+0),r11 schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 8006748: 58 22 00 14 sw (r1+20),r2 schinfo->cbs_server = NULL; 800674c: 58 20 00 18 sw (r1+24),r0 } return sched; } 8006750: 2b 9d 00 04 lw ra,(sp+4) 8006754: 2b 8b 00 08 lw r11,(sp+8) 8006758: 37 9c 00 08 addi sp,sp,8 800675c: c3 a0 00 00 ret =============================================================================== 08007e80 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 8007e80: 37 9c ff f4 addi sp,sp,-12 8007e84: 5b 8b 00 08 sw (sp+8),r11 8007e88: 5b 9d 00 04 sw (sp+4),ra 8007e8c: 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; 8007e90: 28 22 00 ac lw r2,(r1+172) if ( the_thread->real_priority != new_priority ) 8007e94: 28 21 00 18 lw r1,(r1+24) 8007e98: 44 22 00 02 be r1,r2,8007ea0 <_Scheduler_CBS_Budget_callout+0x20><== NEVER TAKEN the_thread->real_priority = new_priority; 8007e9c: 59 62 00 18 sw (r11+24),r2 if ( the_thread->current_priority != new_priority ) 8007ea0: 29 61 00 14 lw r1,(r11+20) 8007ea4: 44 22 00 04 be r1,r2,8007eb4 <_Scheduler_CBS_Budget_callout+0x34><== NEVER TAKEN _Thread_Change_priority(the_thread, new_priority, true); 8007ea8: b9 60 08 00 mv r1,r11 8007eac: 34 03 00 01 mvi r3,1 8007eb0: f8 00 01 a7 calli 800854c <_Thread_Change_priority> /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 8007eb4: 29 6b 00 88 lw r11,(r11+136) if ( sched_info->cbs_server->cbs_budget_overrun ) { 8007eb8: 29 61 00 18 lw r1,(r11+24) 8007ebc: 28 22 00 0c lw r2,(r1+12) 8007ec0: 44 40 00 08 be r2,r0,8007ee0 <_Scheduler_CBS_Budget_callout+0x60><== NEVER TAKEN _Scheduler_CBS_Get_server_id( 8007ec4: 28 21 00 00 lw r1,(r1+0) 8007ec8: 37 82 00 0c addi r2,sp,12 8007ecc: fb ff ff d9 calli 8007e30 <_Scheduler_CBS_Get_server_id> sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); 8007ed0: 29 61 00 18 lw r1,(r11+24) 8007ed4: 28 22 00 0c lw r2,(r1+12) 8007ed8: 2b 81 00 0c lw r1,(sp+12) 8007edc: d8 40 00 00 call r2 } } 8007ee0: 2b 9d 00 04 lw ra,(sp+4) 8007ee4: 2b 8b 00 08 lw r11,(sp+8) 8007ee8: 37 9c 00 0c addi sp,sp,12 8007eec: c3 a0 00 00 ret =============================================================================== 08007950 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 8007950: 37 9c ff e8 addi sp,sp,-24 8007954: 5b 8b 00 18 sw (sp+24),r11 8007958: 5b 8c 00 14 sw (sp+20),r12 800795c: 5b 8d 00 10 sw (sp+16),r13 8007960: 5b 8e 00 0c sw (sp+12),r14 8007964: 5b 8f 00 08 sw (sp+8),r15 8007968: 5b 9d 00 04 sw (sp+4),ra 800796c: b8 20 58 00 mv r11,r1 unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 8007970: 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 ) { 8007974: b8 40 70 00 mv r14,r2 8007978: 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; 800797c: 34 04 ff ee mvi r4,-18 ) { unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 8007980: 4c 01 00 2c bge r0,r1,8007a30 <_Scheduler_CBS_Create_server+0xe0> 8007984: 29 61 00 00 lw r1,(r11+0) 8007988: 4c 01 00 2a bge r0,r1,8007a30 <_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++ ) { 800798c: 78 01 08 02 mvhi r1,0x802 8007990: 38 21 10 18 ori r1,r1,0x1018 8007994: 28 23 00 00 lw r3,(r1+0) 8007998: 78 01 08 02 mvhi r1,0x802 800799c: 38 21 1b 28 ori r1,r1,0x1b28 80079a0: 28 24 00 00 lw r4,(r1+0) if ( !_Scheduler_CBS_Server_list[i] ) 80079a4: 34 01 00 00 mvi r1,0 80079a8: e0 00 00 05 bi 80079bc <_Scheduler_CBS_Create_server+0x6c> 80079ac: 28 82 00 00 lw r2,(r4+0) 80079b0: 34 84 00 04 addi r4,r4,4 80079b4: 44 40 00 03 be r2,r0,80079c0 <_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++ ) { 80079b8: 34 21 00 01 addi r1,r1,1 80079bc: 54 61 ff fc bgu r3,r1,80079ac <_Scheduler_CBS_Create_server+0x5c> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 80079c0: 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 ) 80079c4: 44 23 00 1b be r1,r3,8007a30 <_Scheduler_CBS_Create_server+0xe0> return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 80079c8: 78 0c 08 02 mvhi r12,0x802 80079cc: 34 02 00 02 mvi r2,2 80079d0: 39 8c 1b 28 ori r12,r12,0x1b28 } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 80079d4: 59 a1 00 00 sw (r13+0),r1 _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 80079d8: fb ff e7 71 calli 800179c <__ashlsi3> 80079dc: 29 8f 00 00 lw r15,(r12+0) 80079e0: b5 e1 78 00 add r15,r15,r1 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 80079e4: 34 01 00 10 mvi r1,16 80079e8: f8 00 09 01 calli 8009dec <_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 *) 80079ec: 59 e1 00 00 sw (r15+0),r1 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 80079f0: 29 a1 00 00 lw r1,(r13+0) 80079f4: 29 8c 00 00 lw r12,(r12+0) 80079f8: 34 02 00 02 mvi r2,2 80079fc: fb ff e7 68 calli 800179c <__ashlsi3> 8007a00: b5 81 08 00 add r1,r12,r1 8007a04: 28 21 00 00 lw r1,(r1+0) if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 8007a08: 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 ) 8007a0c: 44 20 00 09 be r1,r0,8007a30 <_Scheduler_CBS_Create_server+0xe0><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 8007a10: 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; 8007a14: 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; 8007a18: 58 22 00 04 sw (r1+4),r2 8007a1c: 29 62 00 04 lw r2,(r11+4) the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; 8007a20: 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; 8007a24: 58 22 00 08 sw (r1+8),r2 the_server->task_id = -1; 8007a28: 34 02 ff ff mvi r2,-1 8007a2c: 58 22 00 00 sw (r1+0),r2 the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 8007a30: b8 80 08 00 mv r1,r4 8007a34: 2b 9d 00 04 lw ra,(sp+4) 8007a38: 2b 8b 00 18 lw r11,(sp+24) 8007a3c: 2b 8c 00 14 lw r12,(sp+20) 8007a40: 2b 8d 00 10 lw r13,(sp+16) 8007a44: 2b 8e 00 0c lw r14,(sp+12) 8007a48: 2b 8f 00 08 lw r15,(sp+8) 8007a4c: 37 9c 00 18 addi sp,sp,24 8007a50: c3 a0 00 00 ret =============================================================================== 08007b04 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 8007b04: 37 9c ff e8 addi sp,sp,-24 8007b08: 5b 8b 00 14 sw (sp+20),r11 8007b0c: 5b 8c 00 10 sw (sp+16),r12 8007b10: 5b 8d 00 0c sw (sp+12),r13 8007b14: 5b 8e 00 08 sw (sp+8),r14 8007b18: 5b 9d 00 04 sw (sp+4),ra 8007b1c: b8 20 68 00 mv r13,r1 8007b20: 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); 8007b24: b8 40 08 00 mv r1,r2 8007b28: 37 82 00 18 addi r2,sp,24 8007b2c: f8 00 03 f7 calli 8008b08 <_Thread_Get> 8007b30: b8 20 58 00 mv r11,r1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 8007b34: 44 20 00 02 be r1,r0,8007b3c <_Scheduler_CBS_Detach_thread+0x38> _Thread_Enable_dispatch(); 8007b38: f8 00 03 e8 calli 8008ad8 <_Thread_Enable_dispatch> } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 8007b3c: 78 03 08 02 mvhi r3,0x802 8007b40: 38 63 10 18 ori r3,r3,0x1018 8007b44: 28 61 00 00 lw r1,(r3+0) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 8007b48: 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 ) 8007b4c: 51 a1 00 1a bgeu r13,r1,8007bb4 <_Scheduler_CBS_Detach_thread+0xb0> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 8007b50: 45 60 00 19 be r11,r0,8007bb4 <_Scheduler_CBS_Detach_thread+0xb0> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 8007b54: 78 03 08 02 mvhi r3,0x802 8007b58: 38 63 1b 28 ori r3,r3,0x1b28 8007b5c: 28 6e 00 00 lw r14,(r3+0) 8007b60: b9 a0 08 00 mv r1,r13 8007b64: 34 02 00 02 mvi r2,2 8007b68: fb ff e7 0d calli 800179c <__ashlsi3> 8007b6c: b5 c1 08 00 add r1,r14,r1 8007b70: 28 24 00 00 lw r4,(r1+0) return SCHEDULER_CBS_ERROR_NOSERVER; 8007b74: 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] ) 8007b78: 44 80 00 0f be r4,r0,8007bb4 <_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 ) 8007b7c: 28 81 00 00 lw r1,(r4+0) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 8007b80: 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 ) 8007b84: 5c 2c 00 0c bne r1,r12,8007bb4 <_Scheduler_CBS_Detach_thread+0xb0><== NEVER TAKEN return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 8007b88: 34 01 ff ff mvi r1,-1 8007b8c: 58 81 00 00 sw (r4+0),r1 sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 8007b90: 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; 8007b94: 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; 8007b98: 58 20 00 18 sw (r1+24),r0 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 8007b9c: 29 61 00 a0 lw r1,(r11+160) 8007ba0: 59 61 00 78 sw (r11+120),r1 the_thread->budget_callout = the_thread->Start.budget_callout; 8007ba4: 29 61 00 a4 lw r1,(r11+164) 8007ba8: 59 61 00 7c sw (r11+124),r1 the_thread->is_preemptible = the_thread->Start.is_preemptible; 8007bac: 41 61 00 9c lbu r1,(r11+156) 8007bb0: 31 61 00 70 sb (r11+112),r1 return SCHEDULER_CBS_OK; } 8007bb4: b8 60 08 00 mv r1,r3 8007bb8: 2b 9d 00 04 lw ra,(sp+4) 8007bbc: 2b 8b 00 14 lw r11,(sp+20) 8007bc0: 2b 8c 00 10 lw r12,(sp+16) 8007bc4: 2b 8d 00 0c lw r13,(sp+12) 8007bc8: 2b 8e 00 08 lw r14,(sp+8) 8007bcc: 37 9c 00 18 addi sp,sp,24 8007bd0: c3 a0 00 00 ret =============================================================================== 08007ef0 <_Scheduler_CBS_Initialize>: int _Scheduler_CBS_Initialize(void) { 8007ef0: 37 9c ff f8 addi sp,sp,-8 8007ef4: 5b 8b 00 08 sw (sp+8),r11 8007ef8: 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*) ); 8007efc: 78 0b 08 02 mvhi r11,0x802 8007f00: 39 6b 10 18 ori r11,r11,0x1018 8007f04: 29 61 00 00 lw r1,(r11+0) 8007f08: 34 02 00 02 mvi r2,2 8007f0c: fb ff e6 24 calli 800179c <__ashlsi3> } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 8007f10: f8 00 07 b7 calli 8009dec <_Workspace_Allocate> 8007f14: 78 02 08 02 mvhi r2,0x802 8007f18: 38 42 1b 28 ori r2,r2,0x1b28 8007f1c: 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; 8007f20: 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 ) 8007f24: 44 20 00 09 be r1,r0,8007f48 <_Scheduler_CBS_Initialize+0x58><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 8007f28: 29 63 00 00 lw r3,(r11+0) 8007f2c: 34 02 00 00 mvi r2,0 8007f30: e0 00 00 04 bi 8007f40 <_Scheduler_CBS_Initialize+0x50> _Scheduler_CBS_Server_list[i] = NULL; 8007f34: 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++) { 8007f38: 34 42 00 01 addi r2,r2,1 8007f3c: 34 21 00 04 addi r1,r1,4 8007f40: 54 62 ff fd bgu r3,r2,8007f34 <_Scheduler_CBS_Initialize+0x44> _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 8007f44: 34 02 00 00 mvi r2,0 } 8007f48: b8 40 08 00 mv r1,r2 8007f4c: 2b 9d 00 04 lw ra,(sp+4) 8007f50: 2b 8b 00 08 lw r11,(sp+8) 8007f54: 37 9c 00 08 addi sp,sp,8 8007f58: c3 a0 00 00 ret =============================================================================== 08006760 <_Scheduler_CBS_Release_job>: void _Scheduler_CBS_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 8006760: 37 9c ff fc addi sp,sp,-4 8006764: 5b 9d 00 04 sw (sp+4),ra 8006768: 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; 800676c: 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 = 8006770: 28 43 00 18 lw r3,(r2+24) (Scheduler_CBS_Server *) sched_info->cbs_server; if (deadline) { 8006774: 44 80 00 13 be r4,r0,80067c0 <_Scheduler_CBS_Release_job+0x60> 8006778: 78 02 08 01 mvhi r2,0x801 800677c: 38 42 fa 30 ori r2,r2,0xfa30 /* Initializing or shifting deadline. */ if (serv_info) 8006780: 44 60 00 09 be r3,r0,80067a4 <_Scheduler_CBS_Release_job+0x44> new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 8006784: 28 64 00 04 lw r4,(r3+4) 8006788: 28 42 00 00 lw r2,(r2+0) 800678c: 78 05 08 01 mvhi r5,0x801 8006790: 38 a5 d9 a0 ori r5,r5,0xd9a0 8006794: b4 44 10 00 add r2,r2,r4 8006798: 28 a4 00 00 lw r4,(r5+0) 800679c: a0 44 10 00 and r2,r2,r4 80067a0: e0 00 00 0a bi 80067c8 <_Scheduler_CBS_Release_job+0x68> & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 80067a4: 28 42 00 00 lw r2,(r2+0) 80067a8: b4 82 10 00 add r2,r4,r2 80067ac: 78 04 08 01 mvhi r4,0x801 80067b0: 38 84 d9 a0 ori r4,r4,0xd9a0 80067b4: 28 83 00 00 lw r3,(r4+0) 80067b8: a0 43 10 00 and r2,r2,r3 80067bc: e0 00 00 05 bi 80067d0 <_Scheduler_CBS_Release_job+0x70> & ~SCHEDULER_EDF_PRIO_MSB; } else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; 80067c0: 28 22 00 ac lw r2,(r1+172) } /* Budget replenishment for the next job. */ if (serv_info) 80067c4: 44 64 00 03 be r3,r4,80067d0 <_Scheduler_CBS_Release_job+0x70><== NEVER TAKEN the_thread->cpu_time_budget = serv_info->parameters.budget; 80067c8: 28 63 00 08 lw r3,(r3+8) 80067cc: 58 23 00 74 sw (r1+116),r3 the_thread->real_priority = new_priority; 80067d0: 58 22 00 18 sw (r1+24),r2 _Thread_Change_priority(the_thread, new_priority, true); 80067d4: 34 03 00 01 mvi r3,1 80067d8: f8 00 01 3b calli 8006cc4 <_Thread_Change_priority> } 80067dc: 2b 9d 00 04 lw ra,(sp+4) 80067e0: 37 9c 00 04 addi sp,sp,4 80067e4: c3 a0 00 00 ret =============================================================================== 080067e8 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 80067e8: 37 9c ff ec addi sp,sp,-20 80067ec: 5b 8b 00 14 sw (sp+20),r11 80067f0: 5b 8c 00 10 sw (sp+16),r12 80067f4: 5b 8d 00 0c sw (sp+12),r13 80067f8: 5b 8e 00 08 sw (sp+8),r14 80067fc: 5b 9d 00 04 sw (sp+4),ra 8006800: 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); 8006804: f8 00 00 4d calli 8006938 <_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; 8006808: 29 61 00 88 lw r1,(r11+136) 800680c: 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) { 8006810: 45 80 00 15 be r12,r0,8006864 <_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 - 8006814: 78 01 08 01 mvhi r1,0x801 8006818: 38 21 fa 30 ori r1,r1,0xfa30 800681c: 28 21 00 00 lw r1,(r1+0) 8006820: 29 6d 00 18 lw r13,(r11+24) _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 8006824: 29 82 00 04 lw r2,(r12+4) 8006828: c9 a1 08 00 sub r1,r13,r1 800682c: fb ff e8 e9 calli 8000bd0 <__mulsi3> 8006830: b8 20 70 00 mv r14,r1 8006834: 29 82 00 08 lw r2,(r12+8) 8006838: 29 61 00 74 lw r1,(r11+116) 800683c: fb ff e8 e5 calli 8000bd0 <__mulsi3> 8006840: 4c 2e 00 09 bge r1,r14,8006864 <_Scheduler_CBS_Unblock+0x7c> /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 8006844: 29 62 00 ac lw r2,(r11+172) if ( the_thread->real_priority != new_priority ) 8006848: 45 a2 00 02 be r13,r2,8006850 <_Scheduler_CBS_Unblock+0x68> the_thread->real_priority = new_priority; 800684c: 59 62 00 18 sw (r11+24),r2 if ( the_thread->current_priority != new_priority ) 8006850: 29 61 00 14 lw r1,(r11+20) 8006854: 44 22 00 04 be r1,r2,8006864 <_Scheduler_CBS_Unblock+0x7c> _Thread_Change_priority(the_thread, new_priority, true); 8006858: b9 60 08 00 mv r1,r11 800685c: 34 03 00 01 mvi r3,1 8006860: f8 00 01 19 calli 8006cc4 <_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, 8006864: 78 0c 08 01 mvhi r12,0x801 8006868: 39 8c fa c0 ori r12,r12,0xfac0 800686c: 29 82 00 14 lw r2,(r12+20) 8006870: 78 01 08 01 mvhi r1,0x801 8006874: 38 21 f0 1c ori r1,r1,0xf01c 8006878: 28 23 00 30 lw r3,(r1+48) 800687c: 28 42 00 14 lw r2,(r2+20) 8006880: 29 61 00 14 lw r1,(r11+20) 8006884: d8 60 00 00 call r3 8006888: 4c 01 00 0b bge r0,r1,80068b4 <_Scheduler_CBS_Unblock+0xcc> _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 800688c: 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; 8006890: 59 8b 00 14 sw (r12+20),r11 if ( _Thread_Executing->is_preemptible || 8006894: 40 21 00 70 lbu r1,(r1+112) 8006898: 5c 20 00 03 bne r1,r0,80068a4 <_Scheduler_CBS_Unblock+0xbc> 800689c: 29 62 00 14 lw r2,(r11+20) 80068a0: 5c 41 00 05 bne r2,r1,80068b4 <_Scheduler_CBS_Unblock+0xcc><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 80068a4: 78 01 08 01 mvhi r1,0x801 80068a8: 38 21 fa c0 ori r1,r1,0xfac0 80068ac: 34 02 00 01 mvi r2,1 80068b0: 30 22 00 0c sb (r1+12),r2 } } 80068b4: 2b 9d 00 04 lw ra,(sp+4) 80068b8: 2b 8b 00 14 lw r11,(sp+20) 80068bc: 2b 8c 00 10 lw r12,(sp+16) 80068c0: 2b 8d 00 0c lw r13,(sp+12) 80068c4: 2b 8e 00 08 lw r14,(sp+8) 80068c8: 37 9c 00 14 addi sp,sp,20 80068cc: c3 a0 00 00 ret =============================================================================== 08006720 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 8006720: 37 9c ff f8 addi sp,sp,-8 8006724: 5b 8b 00 08 sw (sp+8),r11 8006728: 5b 9d 00 04 sw (sp+4),ra 800672c: b8 20 58 00 mv r11,r1 void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 8006730: 34 01 00 18 mvi r1,24 8006734: f8 00 07 81 calli 8008538 <_Workspace_Allocate> if ( sched ) { 8006738: 44 20 00 05 be r1,r0,800674c <_Scheduler_EDF_Allocate+0x2c><== NEVER TAKEN the_thread->scheduler_info = sched; 800673c: 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; 8006740: 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; 8006744: 58 2b 00 00 sw (r1+0),r11 schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 8006748: 58 22 00 14 sw (r1+20),r2 } return sched; } 800674c: 2b 9d 00 04 lw ra,(sp+4) 8006750: 2b 8b 00 08 lw r11,(sp+8) 8006754: 37 9c 00 08 addi sp,sp,8 8006758: c3 a0 00 00 ret =============================================================================== 08006968 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 8006968: 37 9c ff f4 addi sp,sp,-12 800696c: 5b 8b 00 0c sw (sp+12),r11 8006970: 5b 8c 00 08 sw (sp+8),r12 8006974: 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( 8006978: 78 0b 08 01 mvhi r11,0x801 #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 800697c: 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( 8006980: 39 6b fa c0 ori r11,r11,0xfac0 void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { _Scheduler_EDF_Enqueue(the_thread); 8006984: fb ff ff 90 calli 80067c4 <_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( 8006988: 29 62 00 14 lw r2,(r11+20) 800698c: 78 01 08 01 mvhi r1,0x801 8006990: 38 21 f0 18 ori r1,r1,0xf018 8006994: 28 23 00 30 lw r3,(r1+48) 8006998: 28 41 00 14 lw r1,(r2+20) 800699c: 29 82 00 14 lw r2,(r12+20) 80069a0: d8 60 00 00 call r3 80069a4: 4c 20 00 0b bge r1,r0,80069d0 <_Scheduler_EDF_Unblock+0x68> _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 80069a8: 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; 80069ac: 59 6c 00 14 sw (r11+20),r12 if ( _Thread_Executing->is_preemptible || 80069b0: 40 21 00 70 lbu r1,(r1+112) 80069b4: 5c 20 00 03 bne r1,r0,80069c0 <_Scheduler_EDF_Unblock+0x58> 80069b8: 29 82 00 14 lw r2,(r12+20) 80069bc: 5c 41 00 05 bne r2,r1,80069d0 <_Scheduler_EDF_Unblock+0x68><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 80069c0: 78 01 08 01 mvhi r1,0x801 80069c4: 38 21 fa c0 ori r1,r1,0xfac0 80069c8: 34 02 00 01 mvi r2,1 80069cc: 30 22 00 0c sb (r1+12),r2 } } 80069d0: 2b 9d 00 04 lw ra,(sp+4) 80069d4: 2b 8b 00 0c lw r11,(sp+12) 80069d8: 2b 8c 00 08 lw r12,(sp+8) 80069dc: 37 9c 00 0c addi sp,sp,12 80069e0: c3 a0 00 00 ret =============================================================================== 08005a10 <_Scheduler_priority_Block>: #include void _Scheduler_priority_Block( Thread_Control *the_thread ) { 8005a10: 37 9c ff ec addi sp,sp,-20 8005a14: 5b 8b 00 14 sw (sp+20),r11 8005a18: 5b 8c 00 10 sw (sp+16),r12 8005a1c: 5b 8d 00 0c sw (sp+12),r13 8005a20: 5b 8e 00 08 sw (sp+8),r14 8005a24: 5b 9d 00 04 sw (sp+4),ra 8005a28: 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; 8005a2c: 28 21 00 88 lw r1,(r1+136) ready = sched_info->ready_chain; 8005a30: 28 22 00 00 lw r2,(r1+0) if ( _Chain_Has_only_one_node( ready ) ) { 8005a34: 28 44 00 00 lw r4,(r2+0) 8005a38: 28 43 00 08 lw r3,(r2+8) 8005a3c: 5c 83 00 12 bne r4,r3,8005a84 <_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 ); 8005a40: 34 43 00 04 addi r3,r2,4 head->next = tail; 8005a44: 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; 8005a48: 28 23 00 04 lw r3,(r1+4) head->previous = NULL; 8005a4c: 58 40 00 04 sw (r2+4),r0 tail->previous = head; 8005a50: 58 42 00 08 sw (r2+8),r2 8005a54: 2c 24 00 0e lhu r4,(r1+14) 8005a58: 2c 62 00 00 lhu r2,(r3+0) 8005a5c: a0 44 10 00 and r2,r2,r4 8005a60: 0c 62 00 00 sh (r3+0),r2 if ( *the_priority_map->minor == 0 ) 8005a64: 5c 40 00 0c bne r2,r0,8005a94 <_Scheduler_priority_Block+0x84> _Priority_Major_bit_map &= the_priority_map->block_major; 8005a68: 78 02 08 01 mvhi r2,0x801 8005a6c: 38 42 da a0 ori r2,r2,0xdaa0 8005a70: 2c 43 00 00 lhu r3,(r2+0) 8005a74: 2c 21 00 0c lhu r1,(r1+12) 8005a78: a0 23 08 00 and r1,r1,r3 8005a7c: 0c 41 00 00 sh (r2+0),r1 8005a80: e0 00 00 05 bi 8005a94 <_Scheduler_priority_Block+0x84> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 8005a84: 29 82 00 00 lw r2,(r12+0) previous = the_node->previous; 8005a88: 29 81 00 04 lw r1,(r12+4) next->previous = previous; 8005a8c: 58 41 00 04 sw (r2+4),r1 previous->next = next; 8005a90: 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 ); 8005a94: 78 01 08 01 mvhi r1,0x801 8005a98: 38 21 da 60 ori r1,r1,0xda60 _Scheduler_priority_Ready_queue_extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) 8005a9c: 28 21 00 14 lw r1,(r1+20) 8005aa0: 5d 81 00 3b bne r12,r1,8005b8c <_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 8005aa4: 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 ); 8005aa8: 78 02 08 01 mvhi r2,0x801 8005aac: 38 21 d0 18 ori r1,r1,0xd018 8005ab0: 38 42 da a0 ori r2,r2,0xdaa0 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 8005ab4: 28 2e 00 00 lw r14,(r1+0) 8005ab8: 2c 41 00 00 lhu r1,(r2+0) 8005abc: 78 0b 08 01 mvhi r11,0x801 8005ac0: 34 02 00 ff mvi r2,255 8005ac4: 20 21 ff ff andi r1,r1,0xffff 8005ac8: 39 6b ba 48 ori r11,r11,0xba48 8005acc: 54 22 00 05 bgu r1,r2,8005ae0 <_Scheduler_priority_Block+0xd0> 8005ad0: b5 61 58 00 add r11,r11,r1 8005ad4: 41 6d 00 00 lbu r13,(r11+0) 8005ad8: 35 ad 00 08 addi r13,r13,8 8005adc: e0 00 00 05 bi 8005af0 <_Scheduler_priority_Block+0xe0> 8005ae0: 34 02 00 08 mvi r2,8 8005ae4: f8 00 52 23 calli 801a370 <__lshrsi3> 8005ae8: b5 61 58 00 add r11,r11,r1 8005aec: 41 6d 00 00 lbu r13,(r11+0) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8005af0: 34 02 00 01 mvi r2,1 8005af4: 78 0b 08 01 mvhi r11,0x801 8005af8: b9 a0 08 00 mv r1,r13 8005afc: f8 00 51 cf calli 801a238 <__ashlsi3> 8005b00: 39 6b da c0 ori r11,r11,0xdac0 8005b04: b5 61 58 00 add r11,r11,r1 8005b08: 2d 62 00 00 lhu r2,(r11+0) 8005b0c: 34 01 00 ff mvi r1,255 8005b10: 78 0b 08 01 mvhi r11,0x801 8005b14: 39 6b ba 48 ori r11,r11,0xba48 8005b18: 54 41 00 05 bgu r2,r1,8005b2c <_Scheduler_priority_Block+0x11c> 8005b1c: b5 62 58 00 add r11,r11,r2 8005b20: 41 6b 00 00 lbu r11,(r11+0) 8005b24: 35 6b 00 08 addi r11,r11,8 8005b28: e0 00 00 06 bi 8005b40 <_Scheduler_priority_Block+0x130> 8005b2c: b8 40 08 00 mv r1,r2 8005b30: 34 02 00 08 mvi r2,8 8005b34: f8 00 52 0f calli 801a370 <__lshrsi3> 8005b38: b5 61 58 00 add r11,r11,r1 8005b3c: 41 6b 00 00 lbu r11,(r11+0) return (_Priority_Bits_index( major ) << 4) + 8005b40: 34 02 00 04 mvi r2,4 8005b44: b9 a0 08 00 mv r1,r13 8005b48: f8 00 51 bc calli 801a238 <__ashlsi3> 8005b4c: 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 ] ) ) 8005b50: 34 02 00 01 mvi r2,1 8005b54: b9 60 08 00 mv r1,r11 8005b58: f8 00 51 b8 calli 801a238 <__ashlsi3> 8005b5c: 34 02 00 02 mvi r2,2 8005b60: b4 2b 08 00 add r1,r1,r11 8005b64: f8 00 51 b5 calli 801a238 <__ashlsi3> 8005b68: b5 c1 08 00 add r1,r14,r1 _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } 8005b6c: 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 ); 8005b70: 34 21 00 04 addi r1,r1,4 return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 8005b74: 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 ] ) ) 8005b78: 44 61 00 02 be r3,r1,8005b80 <_Scheduler_priority_Block+0x170><== NEVER TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); 8005b7c: 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( 8005b80: 78 01 08 01 mvhi r1,0x801 8005b84: 38 21 da 60 ori r1,r1,0xda60 8005b88: 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 ); 8005b8c: 78 01 08 01 mvhi r1,0x801 8005b90: 38 21 da 60 ori r1,r1,0xda60 /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) 8005b94: 28 22 00 10 lw r2,(r1+16) 8005b98: 5d 82 00 03 bne r12,r2,8005ba4 <_Scheduler_priority_Block+0x194> _Thread_Dispatch_necessary = true; 8005b9c: 34 02 00 01 mvi r2,1 8005ba0: 30 22 00 0c sb (r1+12),r2 } 8005ba4: 2b 9d 00 04 lw ra,(sp+4) 8005ba8: 2b 8b 00 14 lw r11,(sp+20) 8005bac: 2b 8c 00 10 lw r12,(sp+16) 8005bb0: 2b 8d 00 0c lw r13,(sp+12) 8005bb4: 2b 8e 00 08 lw r14,(sp+8) 8005bb8: 37 9c 00 14 addi sp,sp,20 8005bbc: c3 a0 00 00 ret =============================================================================== 08005da0 <_Scheduler_priority_Schedule>: #include #include #include void _Scheduler_priority_Schedule(void) { 8005da0: 37 9c ff f0 addi sp,sp,-16 8005da4: 5b 8b 00 10 sw (sp+16),r11 8005da8: 5b 8c 00 0c sw (sp+12),r12 8005dac: 5b 8d 00 08 sw (sp+8),r13 8005db0: 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 8005db4: 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 ); 8005db8: 78 02 08 01 mvhi r2,0x801 8005dbc: 38 21 d0 18 ori r1,r1,0xd018 8005dc0: 38 42 da a0 ori r2,r2,0xdaa0 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 8005dc4: 28 2d 00 00 lw r13,(r1+0) 8005dc8: 2c 41 00 00 lhu r1,(r2+0) 8005dcc: 78 0b 08 01 mvhi r11,0x801 8005dd0: 34 02 00 ff mvi r2,255 8005dd4: 20 21 ff ff andi r1,r1,0xffff 8005dd8: 39 6b ba 48 ori r11,r11,0xba48 8005ddc: 54 22 00 05 bgu r1,r2,8005df0 <_Scheduler_priority_Schedule+0x50> 8005de0: b5 61 58 00 add r11,r11,r1 8005de4: 41 6c 00 00 lbu r12,(r11+0) 8005de8: 35 8c 00 08 addi r12,r12,8 8005dec: e0 00 00 05 bi 8005e00 <_Scheduler_priority_Schedule+0x60> 8005df0: 34 02 00 08 mvi r2,8 8005df4: f8 00 51 5f calli 801a370 <__lshrsi3> 8005df8: b5 61 58 00 add r11,r11,r1 8005dfc: 41 6c 00 00 lbu r12,(r11+0) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8005e00: 34 02 00 01 mvi r2,1 8005e04: 78 0b 08 01 mvhi r11,0x801 8005e08: b9 80 08 00 mv r1,r12 8005e0c: f8 00 51 0b calli 801a238 <__ashlsi3> 8005e10: 39 6b da c0 ori r11,r11,0xdac0 8005e14: b5 61 58 00 add r11,r11,r1 8005e18: 2d 62 00 00 lhu r2,(r11+0) 8005e1c: 34 01 00 ff mvi r1,255 8005e20: 78 0b 08 01 mvhi r11,0x801 8005e24: 39 6b ba 48 ori r11,r11,0xba48 8005e28: 54 41 00 05 bgu r2,r1,8005e3c <_Scheduler_priority_Schedule+0x9c> 8005e2c: b5 62 58 00 add r11,r11,r2 8005e30: 41 6b 00 00 lbu r11,(r11+0) 8005e34: 35 6b 00 08 addi r11,r11,8 8005e38: e0 00 00 06 bi 8005e50 <_Scheduler_priority_Schedule+0xb0> 8005e3c: b8 40 08 00 mv r1,r2 8005e40: 34 02 00 08 mvi r2,8 8005e44: f8 00 51 4b calli 801a370 <__lshrsi3> 8005e48: b5 61 58 00 add r11,r11,r1 8005e4c: 41 6b 00 00 lbu r11,(r11+0) return (_Priority_Bits_index( major ) << 4) + 8005e50: 34 02 00 04 mvi r2,4 8005e54: b9 80 08 00 mv r1,r12 8005e58: f8 00 50 f8 calli 801a238 <__ashlsi3> 8005e5c: 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 ] ) ) 8005e60: 34 02 00 01 mvi r2,1 8005e64: b9 60 08 00 mv r1,r11 8005e68: f8 00 50 f4 calli 801a238 <__ashlsi3> 8005e6c: 34 02 00 02 mvi r2,2 8005e70: b4 2b 08 00 add r1,r1,r11 8005e74: f8 00 50 f1 calli 801a238 <__ashlsi3> 8005e78: b5 a1 08 00 add r1,r13,r1 _Scheduler_priority_Schedule_body(); } 8005e7c: 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 ); 8005e80: 34 21 00 04 addi r1,r1,4 return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 8005e84: 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 ] ) ) 8005e88: 44 61 00 02 be r3,r1,8005e90 <_Scheduler_priority_Schedule+0xf0><== NEVER TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); 8005e8c: 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( 8005e90: 78 01 08 01 mvhi r1,0x801 8005e94: 38 21 da 60 ori r1,r1,0xda60 8005e98: 58 22 00 14 sw (r1+20),r2 8005e9c: 2b 9d 00 04 lw ra,(sp+4) 8005ea0: 2b 8b 00 10 lw r11,(sp+16) 8005ea4: 2b 8c 00 0c lw r12,(sp+12) 8005ea8: 2b 8d 00 08 lw r13,(sp+8) 8005eac: 37 9c 00 10 addi sp,sp,16 8005eb0: c3 a0 00 00 ret =============================================================================== 08004c04 <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 8004c04: 37 9c ff f0 addi sp,sp,-16 8004c08: 5b 8b 00 10 sw (sp+16),r11 8004c0c: 5b 8c 00 0c sw (sp+12),r12 8004c10: 5b 8d 00 08 sw (sp+8),r13 8004c14: 5b 9d 00 04 sw (sp+4),ra 8004c18: 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(); 8004c1c: 78 01 08 01 mvhi r1,0x801 8004c20: 38 21 d6 90 ori r1,r1,0xd690 8004c24: 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; 8004c28: 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) || 8004c2c: 45 60 00 22 be r11,r0,8004cb4 <_TOD_Validate+0xb0> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 8004c30: 78 03 08 01 mvhi r3,0x801 8004c34: 38 63 da 10 ori r3,r3,0xda10 8004c38: 28 61 00 00 lw r1,(r3+0) 8004c3c: f8 00 5f 4f calli 801c978 <__udivsi3> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 8004c40: 29 62 00 18 lw r2,(r11+24) 8004c44: 50 41 00 1c bgeu r2,r1,8004cb4 <_TOD_Validate+0xb0> (the_tod->ticks >= ticks_per_second) || 8004c48: 29 62 00 14 lw r2,(r11+20) 8004c4c: 34 01 00 3b mvi r1,59 8004c50: 54 41 00 19 bgu r2,r1,8004cb4 <_TOD_Validate+0xb0> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 8004c54: 29 62 00 10 lw r2,(r11+16) 8004c58: 54 41 00 17 bgu r2,r1,8004cb4 <_TOD_Validate+0xb0> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 8004c5c: 29 62 00 0c lw r2,(r11+12) 8004c60: 34 01 00 17 mvi r1,23 8004c64: 54 41 00 14 bgu r2,r1,8004cb4 <_TOD_Validate+0xb0> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 8004c68: 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) || 8004c6c: 44 20 00 12 be r1,r0,8004cb4 <_TOD_Validate+0xb0> <== NEVER TAKEN (the_tod->month == 0) || 8004c70: 34 02 00 0c mvi r2,12 8004c74: 54 22 00 10 bgu r1,r2,8004cb4 <_TOD_Validate+0xb0> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 8004c78: 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) || 8004c7c: 34 03 07 c3 mvi r3,1987 8004c80: 50 62 00 0d bgeu r3,r2,8004cb4 <_TOD_Validate+0xb0> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 8004c84: 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) || 8004c88: 45 a0 00 0b be r13,r0,8004cb4 <_TOD_Validate+0xb0> <== NEVER TAKEN 8004c8c: 78 0b 08 01 mvhi r11,0x801 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 8004c90: 20 42 00 03 andi r2,r2,0x3 8004c94: 39 6b e3 98 ori r11,r11,0xe398 8004c98: 5c 40 00 02 bne r2,r0,8004ca0 <_TOD_Validate+0x9c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 8004c9c: 34 21 00 0d addi r1,r1,13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 8004ca0: 34 02 00 02 mvi r2,2 8004ca4: fb ff f1 7b calli 8001290 <__ashlsi3> 8004ca8: b5 61 08 00 add r1,r11,r1 8004cac: 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( 8004cb0: f1 8d 60 00 cmpgeu r12,r12,r13 if ( the_tod->day > days_in_month ) return false; return true; } 8004cb4: b9 80 08 00 mv r1,r12 8004cb8: 2b 9d 00 04 lw ra,(sp+4) 8004cbc: 2b 8b 00 10 lw r11,(sp+16) 8004cc0: 2b 8c 00 0c lw r12,(sp+12) 8004cc4: 2b 8d 00 08 lw r13,(sp+8) 8004cc8: 37 9c 00 10 addi sp,sp,16 8004ccc: c3 a0 00 00 ret =============================================================================== 0800614c <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 800614c: 37 9c ff e8 addi sp,sp,-24 8006150: 5b 8b 00 18 sw (sp+24),r11 8006154: 5b 8c 00 14 sw (sp+20),r12 8006158: 5b 8d 00 10 sw (sp+16),r13 800615c: 5b 8e 00 0c sw (sp+12),r14 8006160: 5b 8f 00 08 sw (sp+8),r15 8006164: 5b 9d 00 04 sw (sp+4),ra 8006168: b8 20 58 00 mv r11,r1 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 800616c: 28 2f 00 10 lw r15,(r1+16) void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 8006170: b8 40 60 00 mv r12,r2 8006174: 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 ); 8006178: f8 00 03 e6 calli 8007110 <_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 ) 800617c: 29 61 00 14 lw r1,(r11+20) 8006180: 44 2c 00 04 be r1,r12,8006190 <_Thread_Change_priority+0x44> _Thread_Set_priority( the_thread, new_priority ); 8006184: b9 60 08 00 mv r1,r11 8006188: b9 80 10 00 mv r2,r12 800618c: f8 00 03 c1 calli 8007090 <_Thread_Set_priority> _ISR_Disable( level ); 8006190: 90 00 60 00 rcsr r12,IE 8006194: 34 0d ff fe mvi r13,-2 8006198: a1 8d 68 00 and r13,r12,r13 800619c: 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; 80061a0: 29 61 00 10 lw r1,(r11+16) if ( state != STATES_TRANSIENT ) { 80061a4: 34 03 00 04 mvi r3,4 80061a8: 21 e2 00 04 andi r2,r15,0x4 80061ac: 44 23 00 0f be r1,r3,80061e8 <_Thread_Change_priority+0x9c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 80061b0: 5c 40 00 04 bne r2,r0,80061c0 <_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); 80061b4: 34 02 ff fb mvi r2,-5 80061b8: a0 22 10 00 and r2,r1,r2 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 80061bc: 59 62 00 10 sw (r11+16),r2 _ISR_Enable( level ); 80061c0: 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); 80061c4: 78 03 08 01 mvhi r3,0x801 80061c8: 38 63 bb a4 ori r3,r3,0xbba4 80061cc: 28 62 00 00 lw r2,(r3+0) 80061d0: a0 22 08 00 and r1,r1,r2 if ( _States_Is_waiting_on_thread_queue( state ) ) { 80061d4: 44 20 00 1f be r1,r0,8006250 <_Thread_Change_priority+0x104> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 80061d8: 29 61 00 44 lw r1,(r11+68) 80061dc: b9 60 10 00 mv r2,r11 80061e0: f8 00 03 77 calli 8006fbc <_Thread_queue_Requeue> 80061e4: e0 00 00 1b bi 8006250 <_Thread_Change_priority+0x104> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 80061e8: 5c 40 00 0a bne r2,r0,8006210 <_Thread_Change_priority+0xc4><== NEVER TAKEN 80061ec: 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 ); 80061f0: 59 60 00 10 sw (r11+16),r0 80061f4: 38 21 d0 18 ori r1,r1,0xd018 if ( prepend_it ) 80061f8: 45 c2 00 03 be r14,r2,8006204 <_Thread_Change_priority+0xb8> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 80061fc: 28 22 00 28 lw r2,(r1+40) 8006200: e0 00 00 02 bi 8006208 <_Thread_Change_priority+0xbc> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 8006204: 28 22 00 24 lw r2,(r1+36) 8006208: b9 60 08 00 mv r1,r11 800620c: d8 40 00 00 call r2 _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 8006210: d0 0c 00 00 wcsr IE,r12 8006214: 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(); 8006218: 78 01 08 01 mvhi r1,0x801 800621c: 38 21 d0 18 ori r1,r1,0xd018 8006220: 28 21 00 08 lw r1,(r1+8) 8006224: 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 ); 8006228: 78 01 08 01 mvhi r1,0x801 800622c: 38 21 da 60 ori r1,r1,0xda60 8006230: 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() && 8006234: 28 23 00 14 lw r3,(r1+20) 8006238: 44 43 00 05 be r2,r3,800624c <_Thread_Change_priority+0x100> 800623c: 40 42 00 70 lbu r2,(r2+112) 8006240: 44 40 00 03 be r2,r0,800624c <_Thread_Change_priority+0x100> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 8006244: 34 02 00 01 mvi r2,1 8006248: 30 22 00 0c sb (r1+12),r2 _ISR_Enable( level ); 800624c: d0 0c 00 00 wcsr IE,r12 } 8006250: 2b 9d 00 04 lw ra,(sp+4) 8006254: 2b 8b 00 18 lw r11,(sp+24) 8006258: 2b 8c 00 14 lw r12,(sp+20) 800625c: 2b 8d 00 10 lw r13,(sp+16) 8006260: 2b 8e 00 0c lw r14,(sp+12) 8006264: 2b 8f 00 08 lw r15,(sp+8) 8006268: 37 9c 00 18 addi sp,sp,24 800626c: c3 a0 00 00 ret =============================================================================== 0800c8a4 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 800c8a4: 37 9c ff f8 addi sp,sp,-8 800c8a8: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 800c8ac: 37 82 00 08 addi r2,sp,8 800c8b0: f8 00 00 99 calli 800cb14 <_Thread_Get> switch ( location ) { 800c8b4: 2b 82 00 08 lw r2,(sp+8) 800c8b8: 5c 40 00 0a bne r2,r0,800c8e0 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 800c8bc: 78 03 08 02 mvhi r3,0x802 800c8c0: 38 63 5f d0 ori r3,r3,0x5fd0 800c8c4: 28 62 00 00 lw r2,(r3+0) 800c8c8: fb ff ff 6d calli 800c67c <_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; 800c8cc: 78 01 08 02 mvhi r1,0x802 800c8d0: 38 21 8a 00 ori r1,r1,0x8a00 800c8d4: 28 22 00 00 lw r2,(r1+0) --level; 800c8d8: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 800c8dc: 58 22 00 00 sw (r1+0),r2 | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 800c8e0: 2b 9d 00 04 lw ra,(sp+4) 800c8e4: 37 9c 00 08 addi sp,sp,8 800c8e8: c3 a0 00 00 ret =============================================================================== 0800643c <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 800643c: 37 9c ff c0 addi sp,sp,-64 8006440: 5b 8b 00 38 sw (sp+56),r11 8006444: 5b 8c 00 34 sw (sp+52),r12 8006448: 5b 8d 00 30 sw (sp+48),r13 800644c: 5b 8e 00 2c sw (sp+44),r14 8006450: 5b 8f 00 28 sw (sp+40),r15 8006454: 5b 90 00 24 sw (sp+36),r16 8006458: 5b 91 00 20 sw (sp+32),r17 800645c: 5b 92 00 1c sw (sp+28),r18 8006460: 5b 93 00 18 sw (sp+24),r19 8006464: 5b 94 00 14 sw (sp+20),r20 8006468: 5b 95 00 10 sw (sp+16),r21 800646c: 5b 96 00 0c sw (sp+12),r22 8006470: 5b 97 00 08 sw (sp+8),r23 8006474: 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; 8006478: 78 01 08 01 mvhi r1,0x801 800647c: 38 21 da 60 ori r1,r1,0xda60 8006480: 28 2c 00 10 lw r12,(r1+16) _ISR_Disable( level ); 8006484: 90 00 18 00 rcsr r3,IE 8006488: 34 01 ff fe mvi r1,-2 800648c: a0 61 08 00 and r1,r3,r1 8006490: d0 01 00 00 wcsr IE,r1 while ( _Thread_Dispatch_necessary == true ) { 8006494: 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; 8006498: 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; 800649c: 78 0f 08 01 mvhi r15,0x801 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 80064a0: 78 13 08 01 mvhi r19,0x801 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 80064a4: 78 12 08 01 mvhi r18,0x801 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 80064a8: 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 ) { 80064ac: 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 ) { 80064b0: 39 6b da 60 ori r11,r11,0xda60 80064b4: 3a 94 d8 e0 ori r20,r20,0xd8e0 80064b8: 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; 80064bc: 39 ef d8 78 ori r15,r15,0xd878 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 80064c0: 37 97 00 3c addi r23,sp,60 80064c4: 3a 73 d8 68 ori r19,r19,0xd868 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 80064c8: 3a 52 d9 4c ori r18,r18,0xd94c #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 80064cc: 3a 31 d1 a0 ori r17,r17,0xd1a0 80064d0: 3a 10 d1 a4 ori r16,r16,0xd1a4 #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 80064d4: 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 ) { 80064d8: e0 00 00 35 bi 80065ac <_Thread_Dispatch+0x170> heir = _Thread_Heir; 80064dc: 29 6d 00 14 lw r13,(r11+20) 80064e0: 5a 95 00 00 sw (r20+0),r21 #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 80064e4: 31 60 00 0c sb (r11+12),r0 _Thread_Executing = heir; 80064e8: 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 ) 80064ec: 45 ac 00 33 be r13,r12,80065b8 <_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 ) 80064f0: 29 a1 00 78 lw r1,(r13+120) 80064f4: 5c 35 00 03 bne r1,r21,8006500 <_Thread_Dispatch+0xc4> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 80064f8: 29 e1 00 00 lw r1,(r15+0) 80064fc: 59 a1 00 74 sw (r13+116),r1 _ISR_Enable( level ); 8006500: d0 03 00 00 wcsr IE,r3 8006504: ba 60 10 00 mv r2,r19 8006508: ba e0 08 00 mv r1,r23 800650c: fb ff f8 cd calli 8004840 <_TOD_Get_with_nanoseconds> #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 8006510: 2b 83 00 40 lw r3,(sp+64) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006514: 29 82 00 84 lw r2,(r12+132) 8006518: 29 85 00 80 lw r5,(r12+128) 800651c: 2b 81 00 3c lw r1,(sp+60) 8006520: b4 62 10 00 add r2,r3,r2 8006524: f4 62 20 00 cmpgu r4,r3,r2 8006528: b4 25 28 00 add r5,r1,r5 800652c: b4 85 28 00 add r5,r4,r5 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006530: 29 64 00 24 lw r4,(r11+36) 8006534: 29 66 00 20 lw r6,(r11+32) 8006538: c8 44 20 00 sub r4,r2,r4 800653c: f4 82 10 00 cmpgu r2,r4,r2 8006540: c8 a6 28 00 sub r5,r5,r6 8006544: c8 a2 10 00 sub r2,r5,r2 8006548: 59 82 00 80 sw (r12+128),r2 800654c: 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; 8006550: 59 63 00 24 sw (r11+36),r3 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8006554: 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; 8006558: 59 61 00 20 sw (r11+32),r1 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 800655c: 44 60 00 05 be r3,r0,8006570 <_Thread_Dispatch+0x134> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 8006560: 28 61 00 00 lw r1,(r3+0) 8006564: 59 81 01 10 sw (r12+272),r1 *_Thread_libc_reent = heir->libc_reent; 8006568: 29 a1 01 10 lw r1,(r13+272) 800656c: 58 61 00 00 sw (r3+0),r1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 8006570: 2a 2e 00 00 lw r14,(r17+0) 8006574: e0 00 00 06 bi 800658c <_Thread_Dispatch+0x150> const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 8006578: 29 c3 00 08 lw r3,(r14+8) 800657c: b9 80 08 00 mv r1,r12 8006580: b9 a0 10 00 mv r2,r13 8006584: d8 60 00 00 call r3 8006588: 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 ) { 800658c: 5d d0 ff fb bne r14,r16,8006578 <_Thread_Dispatch+0x13c> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 8006590: 35 81 00 bc addi r1,r12,188 8006594: 35 a2 00 bc addi r2,r13,188 8006598: f8 00 05 0f calli 80079d4 <_CPU_Context_switch> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 800659c: 29 6c 00 10 lw r12,(r11+16) _ISR_Disable( level ); 80065a0: 90 00 18 00 rcsr r3,IE 80065a4: a0 76 08 00 and r1,r3,r22 80065a8: 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 ) { 80065ac: 41 61 00 0c lbu r1,(r11+12) 80065b0: 20 21 00 ff andi r1,r1,0xff 80065b4: 5c 20 ff ca bne r1,r0,80064dc <_Thread_Dispatch+0xa0> 80065b8: 78 01 08 01 mvhi r1,0x801 80065bc: 38 21 d8 e0 ori r1,r1,0xd8e0 80065c0: 58 20 00 00 sw (r1+0),r0 post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 80065c4: d0 03 00 00 wcsr IE,r3 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 80065c8: 78 01 08 01 mvhi r1,0x801 80065cc: 38 21 d9 50 ori r1,r1,0xd950 { 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 ) { 80065d0: 78 0d 08 01 mvhi r13,0x801 80065d4: 28 2b 00 00 lw r11,(r1+0) 80065d8: 39 ad d9 54 ori r13,r13,0xd954 80065dc: e0 00 00 05 bi 80065f0 <_Thread_Dispatch+0x1b4> const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 80065e0: 29 62 00 08 lw r2,(r11+8) 80065e4: b9 80 08 00 mv r1,r12 80065e8: d8 40 00 00 call r2 80065ec: 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 ) { 80065f0: 5d 6d ff fc bne r11,r13,80065e0 <_Thread_Dispatch+0x1a4> 80065f4: 2b 9d 00 04 lw ra,(sp+4) 80065f8: 2b 8b 00 38 lw r11,(sp+56) 80065fc: 2b 8c 00 34 lw r12,(sp+52) 8006600: 2b 8d 00 30 lw r13,(sp+48) 8006604: 2b 8e 00 2c lw r14,(sp+44) 8006608: 2b 8f 00 28 lw r15,(sp+40) 800660c: 2b 90 00 24 lw r16,(sp+36) 8006610: 2b 91 00 20 lw r17,(sp+32) 8006614: 2b 92 00 1c lw r18,(sp+28) 8006618: 2b 93 00 18 lw r19,(sp+24) 800661c: 2b 94 00 14 lw r20,(sp+20) 8006620: 2b 95 00 10 lw r21,(sp+16) 8006624: 2b 96 00 0c lw r22,(sp+12) 8006628: 2b 97 00 08 lw r23,(sp+8) 800662c: 37 9c 00 40 addi sp,sp,64 8006630: c3 a0 00 00 ret =============================================================================== 0800b644 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 800b644: 37 9c ff f4 addi sp,sp,-12 800b648: 5b 8b 00 0c sw (sp+12),r11 800b64c: 5b 8c 00 08 sw (sp+8),r12 800b650: 5b 9d 00 04 sw (sp+4),ra #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 800b654: 78 01 08 01 mvhi r1,0x801 800b658: 38 21 da 60 ori r1,r1,0xda60 800b65c: 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; 800b660: 29 61 00 a8 lw r1,(r11+168) _ISR_Set_level(level); 800b664: 64 21 00 00 cmpei r1,r1,0 800b668: 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; 800b66c: 78 01 08 01 mvhi r1,0x801 800b670: 38 21 d7 2c ori r1,r1,0xd72c 800b674: 40 2c 00 00 lbu r12,(r1+0) doneConstructors = true; 800b678: 34 02 00 01 mvi r2,1 800b67c: 30 22 00 00 sb (r1+0),r2 ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 800b680: 78 02 08 00 mvhi r2,0x800 800b684: b9 60 08 00 mv r1,r11 800b688: 38 42 73 3c ori r2,r2,0x733c 800b68c: fb ff ef 48 calli 80073ac <_User_extensions_Iterate> _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 800b690: fb ff eb e9 calli 8006634 <_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) */ { 800b694: 5d 80 00 02 bne r12,r0,800b69c <_Thread_Handler+0x58> INIT_NAME (); 800b698: fb ff d2 5a calli 8000000 _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 800b69c: 29 61 00 90 lw r1,(r11+144) 800b6a0: 5c 20 00 05 bne r1,r0,800b6b4 <_Thread_Handler+0x70> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 800b6a4: 29 62 00 8c lw r2,(r11+140) 800b6a8: 29 61 00 98 lw r1,(r11+152) 800b6ac: d8 40 00 00 call r2 #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 800b6b0: 59 61 00 28 sw (r11+40),r1 } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 800b6b4: 78 02 08 00 mvhi r2,0x800 800b6b8: b9 60 08 00 mv r1,r11 800b6bc: 38 42 73 5c ori r2,r2,0x735c 800b6c0: fb ff ef 3b calli 80073ac <_User_extensions_Iterate> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 800b6c4: 34 01 00 00 mvi r1,0 800b6c8: 34 02 00 01 mvi r2,1 800b6cc: 34 03 00 05 mvi r3,5 800b6d0: fb ff e5 f0 calli 8004e90 <_Internal_error_Occurred> =============================================================================== 0800693c <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 800693c: 37 9c ff f4 addi sp,sp,-12 8006940: 5b 8b 00 0c sw (sp+12),r11 8006944: 5b 8c 00 08 sw (sp+8),r12 8006948: 5b 9d 00 04 sw (sp+4),ra uint32_t ticks_per_timeslice = 800694c: 78 01 08 01 mvhi r1,0x801 8006950: 38 21 b2 0c ori r1,r1,0xb20c #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 8006954: 28 23 00 28 lw r3,(r1+40) #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = 8006958: 28 2b 00 14 lw r11,(r1+20) rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 800695c: 28 2c 00 08 lw r12,(r1+8) rtems_configuration_get_maximum_extensions(); rtems_stack_allocate_init_hook stack_allocate_init_hook = 8006960: 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 || 8006964: 44 60 00 03 be r3,r0,8006970 <_Thread_Handler_initialization+0x34><== NEVER TAKEN 8006968: 28 23 00 2c lw r3,(r1+44) 800696c: 5c 60 00 05 bne r3,r0,8006980 <_Thread_Handler_initialization+0x44> rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 8006970: 34 01 00 00 mvi r1,0 8006974: 34 02 00 01 mvi r2,1 8006978: 34 03 00 0e mvi r3,14 800697c: fb ff f9 45 calli 8004e90 <_Internal_error_Occurred> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 8006980: 44 40 00 03 be r2,r0,800698c <_Thread_Handler_initialization+0x50> (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 8006984: 28 21 00 04 lw r1,(r1+4) 8006988: d8 40 00 00 call r2 _Thread_Dispatch_necessary = false; 800698c: 78 01 08 01 mvhi r1,0x801 8006990: 38 21 da 60 ori r1,r1,0xda60 8006994: 30 20 00 0c sb (r1+12),r0 _Thread_Executing = NULL; 8006998: 58 20 00 10 sw (r1+16),r0 _Thread_Heir = NULL; 800699c: 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; 80069a0: 78 01 08 01 mvhi r1,0x801 80069a4: 38 21 d9 5c ori r1,r1,0xd95c 80069a8: 58 2c 00 00 sw (r1+0),r12 _Thread_Ticks_per_timeslice = ticks_per_timeslice; 80069ac: 78 01 08 01 mvhi r1,0x801 80069b0: 38 21 d8 78 ori r1,r1,0xd878 80069b4: 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( 80069b8: 78 01 08 01 mvhi r1,0x801 80069bc: 38 21 d9 d0 ori r1,r1,0xd9d0 80069c0: 34 02 00 01 mvi r2,1 80069c4: 34 03 00 01 mvi r3,1 80069c8: 34 04 00 01 mvi r4,1 80069cc: 34 05 01 28 mvi r5,296 80069d0: 34 06 00 00 mvi r6,0 80069d4: 34 07 00 08 mvi r7,8 80069d8: fb ff fb 1d calli 800564c <_Objects_Initialize_information> false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 80069dc: 2b 9d 00 04 lw ra,(sp+4) 80069e0: 2b 8b 00 0c lw r11,(sp+12) 80069e4: 2b 8c 00 08 lw r12,(sp+8) 80069e8: 37 9c 00 0c addi sp,sp,12 80069ec: c3 a0 00 00 ret =============================================================================== 08006c80 <_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 ) { 8006c80: 37 9c ff cc addi sp,sp,-52 8006c84: 5b 8b 00 34 sw (sp+52),r11 8006c88: 5b 8c 00 30 sw (sp+48),r12 8006c8c: 5b 8d 00 2c sw (sp+44),r13 8006c90: 5b 8e 00 28 sw (sp+40),r14 8006c94: 5b 8f 00 24 sw (sp+36),r15 8006c98: 5b 90 00 20 sw (sp+32),r16 8006c9c: 5b 91 00 1c sw (sp+28),r17 8006ca0: 5b 92 00 18 sw (sp+24),r18 8006ca4: 5b 93 00 14 sw (sp+20),r19 8006ca8: 5b 94 00 10 sw (sp+16),r20 8006cac: 5b 95 00 0c sw (sp+12),r21 8006cb0: 5b 96 00 08 sw (sp+8),r22 8006cb4: 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; 8006cb8: 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 ) { 8006cbc: 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 ); 8006cc0: 34 41 00 3c addi r1,r2,60 head->next = tail; 8006cc4: 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 ); 8006cc8: 34 41 00 38 addi r1,r2,56 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; tail->previous = head; 8006ccc: 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; 8006cd0: 58 40 00 3c sw (r2+60),r0 8006cd4: 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); 8006cd8: ba 00 08 00 mv r1,r16 8006cdc: 34 02 00 06 mvi r2,6 8006ce0: b8 60 a8 00 mv r21,r3 8006ce4: f8 00 4d a3 calli 801a370 <__lshrsi3> 8006ce8: 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; 8006cec: 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 ); 8006cf0: 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; 8006cf4: 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; 8006cf8: 3a 52 d0 d8 ori r18,r18,0xd0d8 _ISR_Disable( level ); 8006cfc: 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 ) ) 8006d00: 5c 20 00 2e bne r1,r0,8006db8 <_Thread_queue_Enqueue_priority+0x138> goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 8006d04: 34 14 ff fe mvi r20,-2 8006d08: 90 00 78 00 rcsr r15,IE 8006d0c: a1 f4 90 00 and r18,r15,r20 8006d10: d0 12 00 00 wcsr IE,r18 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8006d14: 34 02 00 01 mvi r2,1 8006d18: b9 c0 08 00 mv r1,r14 8006d1c: f8 00 4d 47 calli 801a238 <__ashlsi3> 8006d20: b4 2e 08 00 add r1,r1,r14 8006d24: 34 02 00 02 mvi r2,2 8006d28: f8 00 4d 44 calli 801a238 <__ashlsi3> 8006d2c: 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 ); 8006d30: 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; 8006d34: 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 ) ) { 8006d38: e0 00 00 0b bi 8006d64 <_Thread_queue_Enqueue_priority+0xe4> search_priority = search_thread->current_priority; 8006d3c: 29 71 00 14 lw r17,(r11+20) if ( priority <= search_priority ) 8006d40: 52 30 00 12 bgeu r17,r16,8006d88 <_Thread_queue_Enqueue_priority+0x108> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 8006d44: d0 0f 00 00 wcsr IE,r15 8006d48: 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); 8006d4c: 29 61 00 10 lw r1,(r11+16) 8006d50: a2 61 08 00 and r1,r19,r1 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8006d54: 5c 20 00 03 bne r1,r0,8006d60 <_Thread_queue_Enqueue_priority+0xe0><== ALWAYS TAKEN _ISR_Enable( level ); 8006d58: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED goto restart_forward_search; 8006d5c: e3 ff ff eb bi 8006d08 <_Thread_queue_Enqueue_priority+0x88><== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 8006d60: 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 )); 8006d64: 34 02 00 01 mvi r2,1 8006d68: b9 c0 08 00 mv r1,r14 8006d6c: f8 00 4d 33 calli 801a238 <__ashlsi3> 8006d70: b4 2e 08 00 add r1,r1,r14 8006d74: 34 02 00 02 mvi r2,2 8006d78: f8 00 4d 30 calli 801a238 <__ashlsi3> 8006d7c: b5 a1 08 00 add r1,r13,r1 8006d80: 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 ) ) { 8006d84: 5d 61 ff ee bne r11,r1,8006d3c <_Thread_queue_Enqueue_priority+0xbc> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 8006d88: 29 a3 00 30 lw r3,(r13+48) 8006d8c: 34 02 00 01 mvi r2,1 8006d90: b9 e0 08 00 mv r1,r15 8006d94: 5c 62 00 3f bne r3,r2,8006e90 <_Thread_queue_Enqueue_priority+0x210><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8006d98: 59 a0 00 30 sw (r13+48),r0 if ( priority == search_priority ) 8006d9c: 46 11 00 36 be r16,r17,8006e74 <_Thread_queue_Enqueue_priority+0x1f4> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 8006da0: 29 61 00 04 lw r1,(r11+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8006da4: 59 8b 00 00 sw (r12+0),r11 the_node->previous = previous_node; 8006da8: 59 81 00 04 sw (r12+4),r1 previous_node->next = the_node; 8006dac: 58 2c 00 00 sw (r1+0),r12 search_node->previous = the_node; 8006db0: 59 6c 00 04 sw (r11+4),r12 8006db4: e0 00 00 2c bi 8006e64 <_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; 8006db8: 42 51 00 00 lbu r17,(r18+0) 8006dbc: 36 31 00 01 addi r17,r17,1 _ISR_Disable( level ); 8006dc0: 90 00 78 00 rcsr r15,IE 8006dc4: a1 f6 a0 00 and r20,r15,r22 8006dc8: d0 14 00 00 wcsr IE,r20 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8006dcc: 34 02 00 01 mvi r2,1 8006dd0: b9 c0 08 00 mv r1,r14 8006dd4: f8 00 4d 19 calli 801a238 <__ashlsi3> 8006dd8: b4 2e 08 00 add r1,r1,r14 8006ddc: 34 02 00 02 mvi r2,2 8006de0: f8 00 4d 16 calli 801a238 <__ashlsi3> 8006de4: 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 ); 8006de8: 28 2b 00 08 lw r11,(r1+8) while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8006dec: e0 00 00 0b bi 8006e18 <_Thread_queue_Enqueue_priority+0x198> search_priority = search_thread->current_priority; 8006df0: 29 71 00 14 lw r17,(r11+20) if ( priority >= search_priority ) 8006df4: 52 11 00 11 bgeu r16,r17,8006e38 <_Thread_queue_Enqueue_priority+0x1b8> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 8006df8: d0 0f 00 00 wcsr IE,r15 8006dfc: d0 14 00 00 wcsr IE,r20 8006e00: 29 61 00 10 lw r1,(r11+16) 8006e04: a2 61 08 00 and r1,r19,r1 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8006e08: 5c 20 00 03 bne r1,r0,8006e14 <_Thread_queue_Enqueue_priority+0x194> _ISR_Enable( level ); 8006e0c: d0 0f 00 00 wcsr IE,r15 goto restart_reverse_search; 8006e10: e3 ff ff ea bi 8006db8 <_Thread_queue_Enqueue_priority+0x138> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; 8006e14: 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 )); 8006e18: 34 02 00 01 mvi r2,1 8006e1c: b9 c0 08 00 mv r1,r14 8006e20: f8 00 4d 06 calli 801a238 <__ashlsi3> 8006e24: b4 2e 08 00 add r1,r1,r14 8006e28: 34 02 00 02 mvi r2,2 8006e2c: f8 00 4d 03 calli 801a238 <__ashlsi3> 8006e30: 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 ) ) { 8006e34: 5d 61 ff ef bne r11,r1,8006df0 <_Thread_queue_Enqueue_priority+0x170> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 8006e38: 29 a3 00 30 lw r3,(r13+48) 8006e3c: 34 02 00 01 mvi r2,1 8006e40: b9 e0 08 00 mv r1,r15 8006e44: 5c 62 00 13 bne r3,r2,8006e90 <_Thread_queue_Enqueue_priority+0x210><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8006e48: 59 a0 00 30 sw (r13+48),r0 if ( priority == search_priority ) 8006e4c: 46 11 00 0a be r16,r17,8006e74 <_Thread_queue_Enqueue_priority+0x1f4> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 8006e50: 29 61 00 00 lw r1,(r11+0) the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 8006e54: 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; 8006e58: 59 81 00 00 sw (r12+0),r1 the_node->previous = search_node; search_node->next = the_node; 8006e5c: 59 6c 00 00 sw (r11+0),r12 next_node->previous = the_node; 8006e60: 58 2c 00 04 sw (r1+4),r12 the_thread->Wait.queue = the_thread_queue; 8006e64: 59 8d 00 44 sw (r12+68),r13 _ISR_Enable( level ); 8006e68: d0 0f 00 00 wcsr IE,r15 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8006e6c: 34 01 00 01 mvi r1,1 8006e70: e0 00 00 0a bi 8006e98 <_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; 8006e74: 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 ); 8006e78: 35 62 00 3c addi r2,r11,60 previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8006e7c: 59 82 00 00 sw (r12+0),r2 the_node->previous = previous_node; 8006e80: 59 81 00 04 sw (r12+4),r1 previous_node->next = the_node; 8006e84: 58 2c 00 00 sw (r1+0),r12 search_node->previous = the_node; 8006e88: 59 6c 00 40 sw (r11+64),r12 8006e8c: e3 ff ff f6 bi 8006e64 <_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; 8006e90: 5a a1 00 00 sw (r21+0),r1 <== NOT EXECUTED return the_thread_queue->sync_state; 8006e94: 29 a1 00 30 lw r1,(r13+48) <== NOT EXECUTED } 8006e98: 2b 9d 00 04 lw ra,(sp+4) 8006e9c: 2b 8b 00 34 lw r11,(sp+52) 8006ea0: 2b 8c 00 30 lw r12,(sp+48) 8006ea4: 2b 8d 00 2c lw r13,(sp+44) 8006ea8: 2b 8e 00 28 lw r14,(sp+40) 8006eac: 2b 8f 00 24 lw r15,(sp+36) 8006eb0: 2b 90 00 20 lw r16,(sp+32) 8006eb4: 2b 91 00 1c lw r17,(sp+28) 8006eb8: 2b 92 00 18 lw r18,(sp+24) 8006ebc: 2b 93 00 14 lw r19,(sp+20) 8006ec0: 2b 94 00 10 lw r20,(sp+16) 8006ec4: 2b 95 00 0c lw r21,(sp+12) 8006ec8: 2b 96 00 08 lw r22,(sp+8) 8006ecc: 37 9c 00 34 addi sp,sp,52 8006ed0: c3 a0 00 00 ret =============================================================================== 08006fbc <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 8006fbc: 37 9c ff ec addi sp,sp,-20 8006fc0: 5b 8b 00 10 sw (sp+16),r11 8006fc4: 5b 8c 00 0c sw (sp+12),r12 8006fc8: 5b 8d 00 08 sw (sp+8),r13 8006fcc: 5b 9d 00 04 sw (sp+4),ra 8006fd0: b8 20 58 00 mv r11,r1 8006fd4: 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 ) 8006fd8: 44 20 00 19 be r1,r0,800703c <_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 ) { 8006fdc: 28 22 00 34 lw r2,(r1+52) 8006fe0: 34 01 00 01 mvi r1,1 8006fe4: 5c 41 00 16 bne r2,r1,800703c <_Thread_queue_Requeue+0x80> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 8006fe8: 90 00 68 00 rcsr r13,IE 8006fec: 34 01 ff fe mvi r1,-2 8006ff0: a1 a1 08 00 and r1,r13,r1 8006ff4: d0 01 00 00 wcsr IE,r1 8006ff8: 78 03 08 01 mvhi r3,0x801 8006ffc: 38 63 bb a4 ori r3,r3,0xbba4 8007000: 29 82 00 10 lw r2,(r12+16) 8007004: 28 61 00 00 lw r1,(r3+0) 8007008: a0 41 08 00 and r1,r2,r1 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 800700c: 44 20 00 0b be r1,r0,8007038 <_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; 8007010: 34 01 00 01 mvi r1,1 8007014: 59 61 00 30 sw (r11+48),r1 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 8007018: b9 80 10 00 mv r2,r12 800701c: b9 60 08 00 mv r1,r11 8007020: 34 03 00 01 mvi r3,1 8007024: f8 00 0b ce calli 8009f5c <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 8007028: b9 60 08 00 mv r1,r11 800702c: b9 80 10 00 mv r2,r12 8007030: 37 83 00 14 addi r3,sp,20 8007034: fb ff ff 13 calli 8006c80 <_Thread_queue_Enqueue_priority> } _ISR_Enable( level ); 8007038: d0 0d 00 00 wcsr IE,r13 } } 800703c: 2b 9d 00 04 lw ra,(sp+4) 8007040: 2b 8b 00 10 lw r11,(sp+16) 8007044: 2b 8c 00 0c lw r12,(sp+12) 8007048: 2b 8d 00 08 lw r13,(sp+8) 800704c: 37 9c 00 14 addi sp,sp,20 8007050: c3 a0 00 00 ret =============================================================================== 08007054 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 8007054: 37 9c ff f8 addi sp,sp,-8 8007058: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 800705c: 37 82 00 08 addi r2,sp,8 8007060: fb ff fd 81 calli 8006664 <_Thread_Get> switch ( location ) { 8007064: 2b 82 00 08 lw r2,(sp+8) 8007068: 5c 40 00 07 bne r2,r0,8007084 <_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 ); 800706c: f8 00 0b f8 calli 800a04c <_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; 8007070: 78 01 08 01 mvhi r1,0x801 8007074: 38 21 d8 e0 ori r1,r1,0xd8e0 8007078: 28 22 00 00 lw r2,(r1+0) --level; 800707c: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 8007080: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 8007084: 2b 9d 00 04 lw ra,(sp+4) 8007088: 37 9c 00 08 addi sp,sp,8 800708c: 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 dd b8 ori r16,r16,0xddb8 */ 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 dc 50 ori r13,r13,0xdc50 /* * 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 14 ea calli 801aab0 <_Watchdog_Adjust_to_chain> 801570c: 78 05 08 03 mvhi r5,0x803 8015710: 38 a5 6f 2c ori r5,r5,0x6f2c 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 51 0c calli 8029b54 <__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 14 dc calli 801aab0 <_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 14 9f calli 801a9d4 <_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 74 calli 801653c <_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> <== ALWAYS TAKEN 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) <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 801577c: ba 60 08 00 mv r1,r19 <== NOT EXECUTED 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> <== NOT EXECUTED _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> <== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8015788: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 801578c: 34 42 00 10 addi r2,r2,16 <== NOT EXECUTED 8015790: f8 00 14 ea calli 801ab38 <_Watchdog_Insert> <== NOT EXECUTED 8015794: e3 ff ff f4 bi 8015764 <_Timer_server_Body+0x11c> <== NOT EXECUTED * 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 5b calli 801a58c <_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 81 calli 8019a38 <_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 1b calli 801acac <_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 19 calli 801acac <_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><== NEVER TAKEN * 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 dd b8 ori r1,r1,0xddb8 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><== NEVER TAKEN 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 14 98 calli 801ab38 <_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 dc 50 ori r3,r3,0xdc50 8015918: 38 a5 6f 2c ori r5,r5,0x6f2c 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 50 8a calli 8029b54 <__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 71 calli 801ab38 <_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><== NEVER TAKEN _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 2b calli 8019a38 <_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) <== NOT EXECUTED 8015998: f8 00 02 dd calli 801650c <_Chain_Append> <== NOT EXECUTED } } 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 =============================================================================== 080074a4 <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 80074a4: 37 9c ff f4 addi sp,sp,-12 80074a8: 5b 8b 00 08 sw (sp+8),r11 80074ac: 5b 9d 00 04 sw (sp+4),ra uint32_t number_of_initial_extensions = 80074b0: 78 01 08 01 mvhi r1,0x801 80074b4: 38 21 b2 0c ori r1,r1,0xb20c 80074b8: 28 2b 00 40 lw r11,(r1+64) rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 80074bc: 45 60 00 0d be r11,r0,80074f0 <_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 ) 80074c0: 34 02 00 01 mvi r2,1 80074c4: b9 60 08 00 mv r1,r11 80074c8: f8 00 4b 5c calli 801a238 <__ashlsi3> 80074cc: 34 02 00 02 mvi r2,2 80074d0: b4 2b 08 00 add r1,r1,r11 80074d4: f8 00 4b 59 calli 801a238 <__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( 80074d8: f8 00 01 30 calli 8007998 <_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 ); 80074dc: 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 }; 80074e0: 5b 81 00 0c sw (sp+12),r1 _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 80074e4: 38 42 74 64 ori r2,r2,0x7464 80074e8: 37 81 00 0c addi r1,sp,12 80074ec: fb ff ff b0 calli 80073ac <_User_extensions_Iterate> } } 80074f0: 2b 9d 00 04 lw ra,(sp+4) 80074f4: 2b 8b 00 08 lw r11,(sp+8) 80074f8: 37 9c 00 0c addi sp,sp,12 80074fc: c3 a0 00 00 ret =============================================================================== 08009130 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 8009130: 37 9c ff e4 addi sp,sp,-28 8009134: 5b 8b 00 1c sw (sp+28),r11 8009138: 5b 8c 00 18 sw (sp+24),r12 800913c: 5b 8d 00 14 sw (sp+20),r13 8009140: 5b 8e 00 10 sw (sp+16),r14 8009144: 5b 8f 00 0c sw (sp+12),r15 8009148: 5b 90 00 08 sw (sp+8),r16 800914c: 5b 9d 00 04 sw (sp+4),ra 8009150: b8 20 60 00 mv r12,r1 8009154: b8 60 58 00 mv r11,r3 ISR_Level level; _ISR_Disable( level ); 8009158: 90 00 08 00 rcsr r1,IE 800915c: 34 03 ff fe mvi r3,-2 8009160: a0 23 18 00 and r3,r1,r3 8009164: d0 03 00 00 wcsr IE,r3 } } _ISR_Enable( level ); } 8009168: 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 ); 800916c: 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 ) ) { 8009170: 44 6e 00 1d be r3,r14,80091e4 <_Watchdog_Adjust+0xb4> switch ( direction ) { 8009174: 44 40 00 04 be r2,r0,8009184 <_Watchdog_Adjust+0x54> 8009178: 34 04 00 01 mvi r4,1 800917c: 5c 44 00 1a bne r2,r4,80091e4 <_Watchdog_Adjust+0xb4> <== NEVER TAKEN 8009180: e0 00 00 04 bi 8009190 <_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; 8009184: 34 10 00 01 mvi r16,1 _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8009188: 34 0f ff fe mvi r15,-2 800918c: e0 00 00 15 bi 80091e0 <_Watchdog_Adjust+0xb0> * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 8009190: 28 62 00 10 lw r2,(r3+16) 8009194: b4 4b 58 00 add r11,r2,r11 8009198: 58 6b 00 10 sw (r3+16),r11 break; 800919c: e0 00 00 12 bi 80091e4 <_Watchdog_Adjust+0xb4> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) _Chain_First( header ) ); 80091a0: 29 82 00 00 lw r2,(r12+0) case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 80091a4: 28 4d 00 10 lw r13,(r2+16) 80091a8: 51 6d 00 04 bgeu r11,r13,80091b8 <_Watchdog_Adjust+0x88> _Watchdog_First( header )->delta_interval -= units; 80091ac: c9 ab 58 00 sub r11,r13,r11 80091b0: 58 4b 00 10 sw (r2+16),r11 break; 80091b4: e0 00 00 0c bi 80091e4 <_Watchdog_Adjust+0xb4> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 80091b8: 58 50 00 10 sw (r2+16),r16 _ISR_Enable( level ); 80091bc: d0 01 00 00 wcsr IE,r1 _Watchdog_Tickle( header ); 80091c0: b9 80 08 00 mv r1,r12 80091c4: f8 00 00 98 calli 8009424 <_Watchdog_Tickle> _ISR_Disable( level ); 80091c8: 90 00 08 00 rcsr r1,IE 80091cc: a0 2f 10 00 and r2,r1,r15 80091d0: d0 02 00 00 wcsr IE,r2 if ( _Chain_Is_empty( header ) ) 80091d4: 29 82 00 00 lw r2,(r12+0) 80091d8: 44 4e 00 03 be r2,r14,80091e4 <_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; 80091dc: 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 ) { 80091e0: 5d 60 ff f0 bne r11,r0,80091a0 <_Watchdog_Adjust+0x70> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 80091e4: d0 01 00 00 wcsr IE,r1 } 80091e8: 2b 9d 00 04 lw ra,(sp+4) 80091ec: 2b 8b 00 1c lw r11,(sp+28) 80091f0: 2b 8c 00 18 lw r12,(sp+24) 80091f4: 2b 8d 00 14 lw r13,(sp+20) 80091f8: 2b 8e 00 10 lw r14,(sp+16) 80091fc: 2b 8f 00 0c lw r15,(sp+12) 8009200: 2b 90 00 08 lw r16,(sp+8) 8009204: 37 9c 00 1c addi sp,sp,28 8009208: c3 a0 00 00 ret =============================================================================== 08007674 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 8007674: 90 00 28 00 rcsr r5,IE 8007678: 34 02 ff fe mvi r2,-2 800767c: a0 a2 10 00 and r2,r5,r2 8007680: d0 02 00 00 wcsr IE,r2 previous_state = the_watchdog->state; 8007684: 28 23 00 08 lw r3,(r1+8) switch ( previous_state ) { 8007688: 34 02 00 01 mvi r2,1 800768c: 44 62 00 05 be r3,r2,80076a0 <_Watchdog_Remove+0x2c> 8007690: 44 60 00 1b be r3,r0,80076fc <_Watchdog_Remove+0x88> 8007694: 34 02 00 03 mvi r2,3 8007698: 54 62 00 19 bgu r3,r2,80076fc <_Watchdog_Remove+0x88> <== NEVER TAKEN 800769c: e0 00 00 03 bi 80076a8 <_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; 80076a0: 58 20 00 08 sw (r1+8),r0 break; 80076a4: e0 00 00 16 bi 80076fc <_Watchdog_Remove+0x88> } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 80076a8: 28 22 00 00 lw r2,(r1+0) break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 80076ac: 58 20 00 08 sw (r1+8),r0 next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 80076b0: 28 44 00 00 lw r4,(r2+0) 80076b4: 44 80 00 05 be r4,r0,80076c8 <_Watchdog_Remove+0x54> next_watchdog->delta_interval += the_watchdog->delta_interval; 80076b8: 28 46 00 10 lw r6,(r2+16) 80076bc: 28 24 00 10 lw r4,(r1+16) 80076c0: b4 c4 20 00 add r4,r6,r4 80076c4: 58 44 00 10 sw (r2+16),r4 if ( _Watchdog_Sync_count ) 80076c8: 78 04 08 01 mvhi r4,0x801 80076cc: 38 84 d9 c4 ori r4,r4,0xd9c4 80076d0: 28 84 00 00 lw r4,(r4+0) 80076d4: 44 80 00 07 be r4,r0,80076f0 <_Watchdog_Remove+0x7c> _Watchdog_Sync_level = _ISR_Nest_level; 80076d8: 78 04 08 01 mvhi r4,0x801 80076dc: 38 84 da 60 ori r4,r4,0xda60 80076e0: 28 86 00 08 lw r6,(r4+8) 80076e4: 78 04 08 01 mvhi r4,0x801 80076e8: 38 84 d9 64 ori r4,r4,0xd964 80076ec: 58 86 00 00 sw (r4+0),r6 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 80076f0: 28 24 00 04 lw r4,(r1+4) next->previous = previous; 80076f4: 58 44 00 04 sw (r2+4),r4 previous->next = next; 80076f8: 58 82 00 00 sw (r4+0),r2 _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 80076fc: 78 02 08 01 mvhi r2,0x801 8007700: 38 42 d9 c8 ori r2,r2,0xd9c8 8007704: 28 42 00 00 lw r2,(r2+0) 8007708: 58 22 00 18 sw (r1+24),r2 _ISR_Enable( level ); 800770c: d0 05 00 00 wcsr IE,r5 return( previous_state ); } 8007710: b8 60 08 00 mv r1,r3 8007714: c3 a0 00 00 ret =============================================================================== 08008d34 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 8008d34: 37 9c ff ec addi sp,sp,-20 8008d38: 5b 8b 00 14 sw (sp+20),r11 8008d3c: 5b 8c 00 10 sw (sp+16),r12 8008d40: 5b 8d 00 0c sw (sp+12),r13 8008d44: 5b 8e 00 08 sw (sp+8),r14 8008d48: 5b 9d 00 04 sw (sp+4),ra 8008d4c: b8 20 70 00 mv r14,r1 8008d50: b8 40 60 00 mv r12,r2 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 8008d54: 90 00 68 00 rcsr r13,IE 8008d58: 34 01 ff fe mvi r1,-2 8008d5c: a1 a1 08 00 and r1,r13,r1 8008d60: d0 01 00 00 wcsr IE,r1 printk( "Watchdog Chain: %s %p\n", name, header ); 8008d64: 78 01 08 01 mvhi r1,0x801 8008d68: b9 80 18 00 mv r3,r12 8008d6c: 38 21 de 60 ori r1,r1,0xde60 8008d70: b9 c0 10 00 mv r2,r14 8008d74: fb ff e8 c9 calli 8003098 printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); } 8008d78: 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 ); 8008d7c: 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 ) ) { 8008d80: 45 6c 00 0b be r11,r12,8008dac <_Watchdog_Report_chain+0x78> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 8008d84: b9 60 10 00 mv r2,r11 8008d88: 34 01 00 00 mvi r1,0 8008d8c: f8 00 00 13 calli 8008dd8 <_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 ) 8008d90: 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 ) ; 8008d94: 5d 6c ff fc bne r11,r12,8008d84 <_Watchdog_Report_chain+0x50><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 8008d98: 78 01 08 01 mvhi r1,0x801 8008d9c: 38 21 de 78 ori r1,r1,0xde78 8008da0: b9 c0 10 00 mv r2,r14 8008da4: fb ff e8 bd calli 8003098 8008da8: e0 00 00 04 bi 8008db8 <_Watchdog_Report_chain+0x84> } else { printk( "Chain is empty\n" ); 8008dac: 78 01 08 01 mvhi r1,0x801 8008db0: 38 21 de 88 ori r1,r1,0xde88 8008db4: fb ff e8 b9 calli 8003098 } _ISR_Enable( level ); 8008db8: d0 0d 00 00 wcsr IE,r13 } 8008dbc: 2b 9d 00 04 lw ra,(sp+4) 8008dc0: 2b 8b 00 14 lw r11,(sp+20) 8008dc4: 2b 8c 00 10 lw r12,(sp+16) 8008dc8: 2b 8d 00 0c lw r13,(sp+12) 8008dcc: 2b 8e 00 08 lw r14,(sp+8) 8008dd0: 37 9c 00 14 addi sp,sp,20 8008dd4: c3 a0 00 00 ret =============================================================================== 08007718 <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 8007718: 37 9c ff e4 addi sp,sp,-28 800771c: 5b 8b 00 1c sw (sp+28),r11 8007720: 5b 8c 00 18 sw (sp+24),r12 8007724: 5b 8d 00 14 sw (sp+20),r13 8007728: 5b 8e 00 10 sw (sp+16),r14 800772c: 5b 8f 00 0c sw (sp+12),r15 8007730: 5b 90 00 08 sw (sp+8),r16 8007734: 5b 9d 00 04 sw (sp+4),ra 8007738: 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 ); 800773c: 90 00 18 00 rcsr r3,IE 8007740: 34 01 ff fe mvi r1,-2 8007744: a0 61 08 00 and r1,r3,r1 8007748: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 800774c: 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 ); 8007750: 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 ); 8007754: b8 60 10 00 mv r2,r3 if ( _Chain_Is_empty( header ) ) 8007758: 45 6e 00 1a be r11,r14,80077c0 <_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) { 800775c: 29 61 00 10 lw r1,(r11+16) 8007760: 44 20 00 04 be r1,r0,8007770 <_Watchdog_Tickle+0x58> <== NEVER TAKEN the_watchdog->delta_interval--; 8007764: 34 21 ff ff addi r1,r1,-1 8007768: 59 61 00 10 sw (r11+16),r1 if ( the_watchdog->delta_interval != 0 ) 800776c: 5c 20 00 15 bne r1,r0,80077c0 <_Watchdog_Tickle+0xa8> #include void _Watchdog_Tickle( Chain_Control *header ) { 8007770: b8 60 68 00 mv r13,r3 do { watchdog_state = _Watchdog_Remove( the_watchdog ); _ISR_Enable( level ); switch( watchdog_state ) { 8007774: 34 10 00 02 mvi r16,2 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8007778: 34 0f ff fe mvi r15,-2 800777c: e0 00 00 02 bi 8007784 <_Watchdog_Tickle+0x6c> 8007780: b8 40 68 00 mv r13,r2 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 8007784: b9 60 08 00 mv r1,r11 8007788: fb ff ff bb calli 8007674 <_Watchdog_Remove> _ISR_Enable( level ); 800778c: d0 0d 00 00 wcsr IE,r13 switch( watchdog_state ) { 8007790: 5c 30 00 05 bne r1,r16,80077a4 <_Watchdog_Tickle+0x8c> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 8007794: 29 63 00 1c lw r3,(r11+28) 8007798: 29 61 00 20 lw r1,(r11+32) 800779c: 29 62 00 24 lw r2,(r11+36) 80077a0: d8 60 00 00 call r3 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 80077a4: 90 00 10 00 rcsr r2,IE 80077a8: a0 4f 08 00 and r1,r2,r15 80077ac: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 80077b0: 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) ); 80077b4: 45 6e 00 03 be r11,r14,80077c0 <_Watchdog_Tickle+0xa8> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 80077b8: 29 61 00 10 lw r1,(r11+16) 80077bc: 44 20 ff f1 be r1,r0,8007780 <_Watchdog_Tickle+0x68> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 80077c0: d0 02 00 00 wcsr IE,r2 } 80077c4: 2b 9d 00 04 lw ra,(sp+4) 80077c8: 2b 8b 00 1c lw r11,(sp+28) 80077cc: 2b 8c 00 18 lw r12,(sp+24) 80077d0: 2b 8d 00 14 lw r13,(sp+20) 80077d4: 2b 8e 00 10 lw r14,(sp+16) 80077d8: 2b 8f 00 0c lw r15,(sp+12) 80077dc: 2b 90 00 08 lw r16,(sp+8) 80077e0: 37 9c 00 1c addi sp,sp,28 80077e4: c3 a0 00 00 ret =============================================================================== 080077e8 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 80077e8: 37 9c ff d0 addi sp,sp,-48 80077ec: 5b 8b 00 30 sw (sp+48),r11 80077f0: 5b 8c 00 2c sw (sp+44),r12 80077f4: 5b 8d 00 28 sw (sp+40),r13 80077f8: 5b 8e 00 24 sw (sp+36),r14 80077fc: 5b 8f 00 20 sw (sp+32),r15 8007800: 5b 90 00 1c sw (sp+28),r16 8007804: 5b 91 00 18 sw (sp+24),r17 8007808: 5b 92 00 14 sw (sp+20),r18 800780c: 5b 93 00 10 sw (sp+16),r19 8007810: 5b 94 00 0c sw (sp+12),r20 8007814: 5b 95 00 08 sw (sp+8),r21 8007818: 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(); 800781c: 78 04 08 01 mvhi r4,0x801 8007820: 38 84 b2 0c ori r4,r4,0xb20c void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8007824: 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(); 8007828: 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 ) { 800782c: 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(); 8007830: 28 8c 00 00 lw r12,(r4+0) 8007834: 34 05 00 00 mvi r5,0 8007838: 5c 40 00 02 bne r2,r0,8007840 <_Workspace_Handler_initialization+0x58> 800783c: 28 85 00 04 lw r5,(r4+4) bool do_zero = rtems_configuration_get_do_zero_of_workspace(); 8007840: 78 04 08 01 mvhi r4,0x801 8007844: 38 84 b2 0c ori r4,r4,0xb20c Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 8007848: 78 0e 08 00 mvhi r14,0x800 } else { size = 0; } } space_available = (*init_or_extend)( 800784c: 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(); 8007850: b4 ac 60 00 add r12,r5,r12 bool do_zero = rtems_configuration_get_do_zero_of_workspace(); 8007854: 40 94 00 30 lbu r20,(r4+48) bool unified = rtems_configuration_get_unified_work_area(); 8007858: 40 91 00 31 lbu r17,(r4+49) 800785c: 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) { 8007860: 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; 8007864: 39 ce 4b d0 ori r14,r14,0x4bd0 if ( do_zero ) { memset( area->begin, 0, area->size ); } if ( area->size > overhead ) { 8007868: 34 13 00 0e mvi r19,14 } else { size = 0; } } space_available = (*init_or_extend)( 800786c: 39 ef d8 f0 ori r15,r15,0xd8f0 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) { 8007870: e0 00 00 22 bi 80078f8 <_Workspace_Handler_initialization+0x110> Heap_Area *area = &areas [i]; if ( do_zero ) { 8007874: 46 80 00 05 be r20,r0,8007888 <_Workspace_Handler_initialization+0xa0> memset( area->begin, 0, area->size ); 8007878: 29 61 00 00 lw r1,(r11+0) 800787c: 29 63 00 04 lw r3,(r11+4) 8007880: 34 02 00 00 mvi r2,0 8007884: f8 00 13 1d calli 800c4f8 } if ( area->size > overhead ) { 8007888: 29 6d 00 04 lw r13,(r11+4) 800788c: 52 6d 00 19 bgeu r19,r13,80078f0 <_Workspace_Handler_initialization+0x108> uintptr_t space_available; uintptr_t size; if ( unified ) { 8007890: 5e 20 00 07 bne r17,r0,80078ac <_Workspace_Handler_initialization+0xc4> size = area->size; } else { if ( remaining > 0 ) { 8007894: 45 91 00 05 be r12,r17,80078a8 <_Workspace_Handler_initialization+0xc0><== NEVER TAKEN size = remaining < area->size - overhead ? 8007898: 35 a1 ff f2 addi r1,r13,-14 remaining + overhead : area->size; 800789c: 51 81 00 04 bgeu r12,r1,80078ac <_Workspace_Handler_initialization+0xc4><== NEVER TAKEN 80078a0: 35 8d 00 0e addi r13,r12,14 80078a4: e0 00 00 02 bi 80078ac <_Workspace_Handler_initialization+0xc4> } else { size = 0; 80078a8: 34 0d 00 00 mvi r13,0 <== NOT EXECUTED } } space_available = (*init_or_extend)( 80078ac: 29 62 00 00 lw r2,(r11+0) 80078b0: b9 a0 18 00 mv r3,r13 80078b4: b9 e0 08 00 mv r1,r15 80078b8: 34 04 00 04 mvi r4,4 80078bc: d9 c0 00 00 call r14 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 80078c0: 29 62 00 00 lw r2,(r11+0) 80078c4: b4 4d 10 00 add r2,r2,r13 80078c8: 59 62 00 00 sw (r11+0),r2 area->size -= size; 80078cc: 29 62 00 04 lw r2,(r11+4) 80078d0: c8 4d 68 00 sub r13,r2,r13 80078d4: 59 6d 00 04 sw (r11+4),r13 if ( space_available < remaining ) { 80078d8: 50 2c 00 04 bgeu r1,r12,80078e8 <_Workspace_Handler_initialization+0x100><== ALWAYS TAKEN remaining -= space_available; 80078dc: c9 81 60 00 sub r12,r12,r1 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 80078e0: ba 40 70 00 mv r14,r18 <== NOT EXECUTED 80078e4: e0 00 00 03 bi 80078f0 <_Workspace_Handler_initialization+0x108><== NOT EXECUTED 80078e8: ba 40 70 00 mv r14,r18 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 80078ec: 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) { 80078f0: 36 10 00 01 addi r16,r16,1 80078f4: 35 6b 00 08 addi r11,r11,8 80078f8: 56 b0 ff df bgu r21,r16,8007874 <_Workspace_Handler_initialization+0x8c> init_or_extend = extend; } } if ( remaining > 0 ) { 80078fc: 45 80 00 05 be r12,r0,8007910 <_Workspace_Handler_initialization+0x128> _Internal_error_Occurred( 8007900: 34 01 00 00 mvi r1,0 8007904: 34 02 00 01 mvi r2,1 8007908: 34 03 00 02 mvi r3,2 800790c: fb ff f5 61 calli 8004e90 <_Internal_error_Occurred> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } } 8007910: 2b 9d 00 04 lw ra,(sp+4) 8007914: 2b 8b 00 30 lw r11,(sp+48) 8007918: 2b 8c 00 2c lw r12,(sp+44) 800791c: 2b 8d 00 28 lw r13,(sp+40) 8007920: 2b 8e 00 24 lw r14,(sp+36) 8007924: 2b 8f 00 20 lw r15,(sp+32) 8007928: 2b 90 00 1c lw r16,(sp+28) 800792c: 2b 91 00 18 lw r17,(sp+24) 8007930: 2b 92 00 14 lw r18,(sp+20) 8007934: 2b 93 00 10 lw r19,(sp+16) 8007938: 2b 94 00 0c lw r20,(sp+12) 800793c: 2b 95 00 08 lw r21,(sp+8) 8007940: 37 9c 00 30 addi sp,sp,48 8007944: c3 a0 00 00 ret =============================================================================== 08006f7c <_Workspace_String_duplicate>: char *_Workspace_String_duplicate( const char *string, size_t len ) { 8006f7c: 37 9c ff f0 addi sp,sp,-16 8006f80: 5b 8b 00 10 sw (sp+16),r11 8006f84: 5b 8c 00 0c sw (sp+12),r12 8006f88: 5b 8d 00 08 sw (sp+8),r13 8006f8c: 5b 9d 00 04 sw (sp+4),ra 8006f90: b8 20 68 00 mv r13,r1 char *dup = _Workspace_Allocate(len + 1); 8006f94: 34 41 00 01 addi r1,r2,1 char *_Workspace_String_duplicate( const char *string, size_t len ) { 8006f98: b8 40 60 00 mv r12,r2 char *dup = _Workspace_Allocate(len + 1); 8006f9c: fb ff ff d5 calli 8006ef0 <_Workspace_Allocate> 8006fa0: b8 20 58 00 mv r11,r1 if (dup != NULL) { 8006fa4: 44 20 00 06 be r1,r0,8006fbc <_Workspace_String_duplicate+0x40><== NEVER TAKEN dup [len] = '\0'; 8006fa8: b4 2c 10 00 add r2,r1,r12 8006fac: 30 40 00 00 sb (r2+0),r0 memcpy(dup, string, len); 8006fb0: b9 80 18 00 mv r3,r12 8006fb4: b9 a0 10 00 mv r2,r13 8006fb8: f8 00 13 87 calli 800bdd4 } return dup; } 8006fbc: b9 60 08 00 mv r1,r11 8006fc0: 2b 9d 00 04 lw ra,(sp+4) 8006fc4: 2b 8b 00 10 lw r11,(sp+16) 8006fc8: 2b 8c 00 0c lw r12,(sp+12) 8006fcc: 2b 8d 00 08 lw r13,(sp+8) 8006fd0: 37 9c 00 10 addi sp,sp,16 8006fd4: c3 a0 00 00 ret =============================================================================== 0801a8f8 <__kill>: #endif int __kill( pid_t pid, int sig ) { return 0; } 801a8f8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 801a8fc: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080100ac <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 80100ac: 37 9c ff dc addi sp,sp,-36 80100b0: 5b 8b 00 20 sw (sp+32),r11 80100b4: 5b 8c 00 1c sw (sp+28),r12 80100b8: 5b 8d 00 18 sw (sp+24),r13 80100bc: 5b 8e 00 14 sw (sp+20),r14 80100c0: 5b 8f 00 10 sw (sp+16),r15 80100c4: 5b 90 00 0c sw (sp+12),r16 80100c8: 5b 91 00 08 sw (sp+8),r17 80100cc: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; ssize_t cmpltd = 0; 80100d0: 34 0b 00 00 mvi r11,0 uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 80100d4: b8 20 80 00 mv r16,r1 80100d8: b8 80 60 00 mv r12,r4 80100dc: b8 a0 88 00 mv r17,r5 int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; uint32_t ofs = offset; 80100e0: b8 60 78 00 mv r15,r3 void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; 80100e4: b8 40 70 00 mv r14,r2 uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 80100e8: e0 00 00 14 bi 8010138 <_fat_block_read+0x8c> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 80100ec: ba 00 08 00 mv r1,r16 80100f0: b9 c0 10 00 mv r2,r14 80100f4: 34 03 00 01 mvi r3,1 80100f8: 37 84 00 24 addi r4,sp,36 80100fc: fb ff ff aa calli 800ffa4 if (rc != RC_OK) 8010100: 5c 20 00 10 bne r1,r0,8010140 <_fat_block_read+0x94> <== NEVER TAKEN return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 8010104: 2e 0d 00 00 lhu r13,(r16+0) 8010108: c9 af 68 00 sub r13,r13,r15 801010c: 51 8d 00 02 bgeu r12,r13,8010114 <_fat_block_read+0x68> 8010110: b9 80 68 00 mv r13,r12 memcpy((buff + cmpltd), (sec_buf + ofs), c); 8010114: 2b 82 00 24 lw r2,(sp+36) 8010118: b6 2b 08 00 add r1,r17,r11 801011c: b9 a0 18 00 mv r3,r13 8010120: b4 4f 10 00 add r2,r2,r15 8010124: f8 00 29 88 calli 801a744 count -= c; 8010128: c9 8d 60 00 sub r12,r12,r13 cmpltd += c; 801012c: b5 ab 58 00 add r11,r13,r11 sec_num++; 8010130: 35 ce 00 01 addi r14,r14,1 ofs = 0; 8010134: 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) 8010138: 5d 80 ff ed bne r12,r0,80100ec <_fat_block_read+0x40> 801013c: e0 00 00 02 bi 8010144 <_fat_block_read+0x98> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; 8010140: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } 8010144: b9 60 08 00 mv r1,r11 8010148: 2b 9d 00 04 lw ra,(sp+4) 801014c: 2b 8b 00 20 lw r11,(sp+32) 8010150: 2b 8c 00 1c lw r12,(sp+28) 8010154: 2b 8d 00 18 lw r13,(sp+24) 8010158: 2b 8e 00 14 lw r14,(sp+20) 801015c: 2b 8f 00 10 lw r15,(sp+16) 8010160: 2b 90 00 0c lw r16,(sp+12) 8010164: 2b 91 00 08 lw r17,(sp+8) 8010168: 37 9c 00 24 addi sp,sp,36 801016c: c3 a0 00 00 ret =============================================================================== 080016dc <_gettimeofday>: */ int _gettimeofday( struct timeval *tp, struct timezone *tzp ) { 80016dc: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 80016e0: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return gettimeofday( tp, tzp ); 80016e4: fb ff ff ca calli 800160c <== NOT EXECUTED } 80016e8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80016ec: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 80016f0: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 0800ef18 <_hash_search>: rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { 800ef18: 37 9c ff e4 addi sp,sp,-28 800ef1c: 5b 8b 00 1c sw (sp+28),r11 800ef20: 5b 8c 00 18 sw (sp+24),r12 800ef24: 5b 8d 00 14 sw (sp+20),r13 800ef28: 5b 8e 00 10 sw (sp+16),r14 800ef2c: 5b 8f 00 0c sw (sp+12),r15 800ef30: 5b 90 00 08 sw (sp+8),r16 800ef34: 5b 9d 00 04 sw (sp+4),ra uint32_t mod = (key1) % FAT_HASH_MODULE; 800ef38: 20 6b 00 01 andi r11,r3,0x1 rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { 800ef3c: b8 40 78 00 mv r15,r2 800ef40: b8 20 80 00 mv r16,r1 uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); 800ef44: 34 02 00 01 mvi r2,1 800ef48: b9 60 08 00 mv r1,r11 rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { 800ef4c: b8 60 60 00 mv r12,r3 800ef50: b8 80 68 00 mv r13,r4 800ef54: b8 a0 70 00 mv r14,r5 uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); 800ef58: fb ff c8 a4 calli 80011e8 <__ashlsi3> 800ef5c: b4 2b 08 00 add r1,r1,r11 800ef60: 34 02 00 02 mvi r2,2 800ef64: fb ff c8 a1 calli 80011e8 <__ashlsi3> 800ef68: b5 e1 10 00 add r2,r15,r1 fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } 800ef6c: 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 )); 800ef70: 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) ; ) 800ef74: e0 00 00 0c bi 800efa4 <_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); 800ef78: ba 00 08 00 mv r1,r16 800ef7c: 35 62 00 20 addi r2,r11,32 800ef80: fb ff ff ba calli 800ee68 if ( (key1) == ck) 800ef84: 5d 81 00 07 bne r12,r1,800efa0 <_hash_search+0x88> { if ( ((key2) == 0) || ((key2) == ffd->ino) ) 800ef88: 45 a0 00 03 be r13,r0,800ef94 <_hash_search+0x7c> <== ALWAYS TAKEN 800ef8c: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED 800ef90: 5d a1 00 04 bne r13,r1,800efa0 <_hash_search+0x88> <== NOT EXECUTED { *ret = (void *)the_node; 800ef94: 59 cb 00 00 sw (r14+0),r11 return 0; 800ef98: 34 01 00 00 mvi r1,0 800ef9c: e0 00 00 04 bi 800efac <_hash_search+0x94> } } the_node = the_node->next; 800efa0: 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) ; ) 800efa4: 5d 6f ff f5 bne r11,r15,800ef78 <_hash_search+0x60> return 0; } } the_node = the_node->next; } return -1; 800efa8: 34 01 ff ff mvi r1,-1 } 800efac: 2b 9d 00 04 lw ra,(sp+4) 800efb0: 2b 8b 00 1c lw r11,(sp+28) 800efb4: 2b 8c 00 18 lw r12,(sp+24) 800efb8: 2b 8d 00 14 lw r13,(sp+20) 800efbc: 2b 8e 00 10 lw r14,(sp+16) 800efc0: 2b 8f 00 0c lw r15,(sp+12) 800efc4: 2b 90 00 08 lw r16,(sp+8) 800efc8: 37 9c 00 1c addi sp,sp,28 800efcc: 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 <== 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 =============================================================================== 08002614 <_stat_r>: int _STAT_R_NAME( struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { 8002614: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 8002618: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return _STAT_NAME( path, buf ); 800261c: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 8002620: b8 60 10 00 mv r2,r3 <== NOT EXECUTED 8002624: fb ff ff dc calli 8002594 <== NOT EXECUTED } 8002628: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800262c: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 8002630: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08001f10 : #include #include 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 #include 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 21 20 ori r4,r4,0x2120 8001f38: 38 a5 21 1c ori r5,r5,0x211c 8001f3c: 37 81 00 14 addi r1,sp,20 8001f40: f8 00 05 11 calli 8003384 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 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 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 17 54 ori r12,r12,0x1754 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 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( &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 sc = rtems_libio_set_private_env(); 8001f98: f8 00 02 fd calli 8002b8c if (sc == RTEMS_SUCCESSFUL) { 8001f9c: 5c 2d 00 0c bne r1,r13,8001fcc rtems_filesystem_global_location_assign( 8001fa0: 78 0c 08 01 mvhi r12,0x801 8001fa4: 39 8c 21 48 ori r12,r12,0x2148 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_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 8001fc8: e0 00 00 0e bi 8002000 &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 <== NEVER TAKEN errno = ENOMEM; 8001fd4: f8 00 21 41 calli 800a4d8 <__errno> 8001fd8: 34 02 00 0c mvi r2,12 8001fdc: e0 00 00 05 bi 8001ff0 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 <== NEVER TAKEN errno = eno; 8001fe8: f8 00 21 3c calli 800a4d8 <__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 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 if ( rv != 0 ) { 8002008: 45 60 00 03 be r11,r0,8002014 rtems_filesystem_global_location_release( new_current_loc ); 800200c: 2b 81 00 64 lw r1,(sp+100) 8002010: f8 00 06 78 calli 80039f0 } 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 =============================================================================== 0800155c : 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 96 d8 ori r2,r2,0x96d8 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 rtems_disk_device_table *table = disktab; 80015b0: 78 02 08 01 mvhi r2,0x801 80015b4: 38 42 96 d4 ori r2,r2,0x96d4 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 54 4d calli 80166f8 <__ashlsi3> 80015c8: b8 20 60 00 mv r12,r1 if (major >= new_size) { 80015cc: 54 2e 00 02 bgu r1,r14,80015d4 <== 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 54 47 calli 80166f8 <__ashlsi3> 80015e0: b8 20 10 00 mv r2,r1 80015e4: b9 60 08 00 mv r1,r11 80015e8: f8 00 09 40 calli 8003ae8 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 <== 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 54 3e calli 80166f8 <__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 54 3a calli 80166f8 <__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 40 32 calli 80116e8 <== NOT EXECUTED disktab = table; 8001624: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8001628: 38 42 96 d4 ori r2,r2,0x96d4 <== 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 96 d8 ori r2,r2,0x96d8 <== 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 54 2d calli 80166f8 <__ashlsi3> 8001648: 78 02 08 01 mvhi r2,0x801 800164c: 38 42 96 d4 ori r2,r2,0x96d4 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 8001664: 28 41 00 04 lw r1,(r2+4) 8001668: 54 2d 00 24 bgu r1,r13,80016f8 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 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 54 1e calli 80166f8 <__ashlsi3> 8001684: b8 20 60 00 mv r12,r1 } if (minor >= new_size) { 8001688: 55 8d 00 02 bgu r12,r13,8001690 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 54 18 calli 80166f8 <__ashlsi3> 800169c: b8 20 10 00 mv r2,r1 80016a0: b9 60 08 00 mv r1,r11 80016a4: f8 00 09 11 calli 8003ae8 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 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 54 0f calli 80166f8 <__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 54 0b calli 80166f8 <__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 40 03 calli 80116e8 disktab [major].minor = table; 80016e0: 78 02 08 01 mvhi r2,0x801 80016e4: 38 42 96 d4 ori r2,r2,0x96d4 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 96 d4 ori r2,r2,0x96d4 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 53 f9 calli 80166f8 <__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 <== 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 return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); 8001730: 34 01 00 78 mvi r1,120 8001734: f8 00 06 05 calli 8002f48 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 <== NEVER TAKEN return RTEMS_NO_MEMORY; } if (name != NULL) { 8001744: 46 40 00 0f be r18,r0,8001780 alloc_name = strdup(name); 8001748: ba 40 08 00 mv r1,r18 800174c: f8 00 41 2e calli 8011c04 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 <== ALWAYS TAKEN free(dd); 800175c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8001760: f8 00 04 6c calli 8002910 <== NOT EXECUTED return RTEMS_NO_MEMORY; 8001764: e0 00 00 0c bi 8001794 <== 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 <== NOT EXECUTED free(dd); 8001770: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8001774: f8 00 04 67 calli 8002910 <== NOT EXECUTED return RTEMS_UNSATISFIED; 8001778: 34 0b 00 0d mvi r11,13 <== NOT EXECUTED 800177c: e0 00 00 06 bi 8001794 <== 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 80017dc: 48 01 ff e3 bg r0,r1,8001768 <== NEVER TAKEN 80017e0: e3 ff ff e9 bi 8001784 =============================================================================== 08001114 : * 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 00 mvhi r2,0x800 <== NOT EXECUTED 8001124: b8 20 58 00 mv r11,r1 <== NOT EXECUTED 8001128: 38 42 f5 38 ori r2,r2,0xf538 <== NOT EXECUTED if ( !s ) 800112c: 44 20 00 03 be r1,r0,8001138 <== 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 25 f5 calli 800a904 <== NOT EXECUTED return s; 8001134: e0 00 00 02 bi 800113c <== 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 : * 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 <== 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 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 <== 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 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 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 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 52 9c ori r1,r1,0x529c 800314c: b9 a0 10 00 mv r2,r13 8003150: 34 03 00 06 mvi r3,6 8003154: f8 00 3f 63 calli 8012ee0 * 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 ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { 800315c: 45 80 00 03 be r12,r0,8003168 <== NEVER TAKEN *new_part_desc = part_desc; 8003160: 59 cb 00 00 sw (r14+0),r11 8003164: e0 00 00 03 bi 8003170 } else { /* empty partition */ free(part_desc); 8003168: b9 60 08 00 mv r1,r11 800316c: f8 00 03 8b calli 8003f98 } 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 : #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 01 80 ori r1,r1,0x180 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 00 mvhi r1,0x800 8000900: 38 21 ee 98 ori r1,r1,0xee98 8000904: 28 43 00 0c lw r3,(r2+12) 8000908: 5c 61 00 21 bne r3,r1,800098c <== 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 00 mvhi r15,0x800 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); 8000914: 78 0e 08 00 mvhi r14,0x800 } printk( 8000918: 78 0d 08 00 mvhi r13,0x800 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 ef 18 ori r15,r15,0xef18 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); 800092c: 39 ce ef 1c ori r14,r14,0xef1c } printk( 8000930: 39 ad ef 20 ori r13,r13,0xef20 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_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 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 for (j = 0; j < m; ++j) { 8000950: e0 00 00 07 bi 800096c 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 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 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 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 (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 =============================================================================== 08009bd8 : } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { 8009bd8: 37 9c ff dc addi sp,sp,-36 8009bdc: 5b 8b 00 24 sw (sp+36),r11 8009be0: 5b 8c 00 20 sw (sp+32),r12 8009be4: 5b 8d 00 1c sw (sp+28),r13 8009be8: 5b 8e 00 18 sw (sp+24),r14 8009bec: 5b 8f 00 14 sw (sp+20),r15 8009bf0: 5b 90 00 10 sw (sp+16),r16 8009bf4: 5b 91 00 0c sw (sp+12),r17 8009bf8: 5b 92 00 08 sw (sp+8),r18 8009bfc: 5b 9d 00 04 sw (sp+4),ra 8009c00: 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; 8009c04: 28 21 00 2c lw r1,(r1+44) } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } 8009c08: 29 71 00 00 lw r17,(r11+0) 8009c0c: 29 6f 00 04 lw r15,(r11+4) 8009c10: 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; 8009c14: 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; 8009c18: 34 0e 00 00 mvi r14,0 size_t pathlen, devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; 8009c1c: 28 32 00 04 lw r18,(r1+4) 8009c20: 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) { 8009c24: 34 10 00 00 mvi r16,0 8009c28: e0 00 00 0f bi 8009c64 devFS_node *current = nodes + i; if (current->name != NULL) { 8009c2c: 29 81 00 00 lw r1,(r12+0) 8009c30: 44 20 00 08 be r1,r0,8009c50 if ( 8009c34: 29 82 00 04 lw r2,(r12+4) 8009c38: 5c 4f 00 09 bne r2,r15,8009c5c current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 8009c3c: ba 20 10 00 mv r2,r17 8009c40: b9 e0 18 00 mv r3,r15 8009c44: f8 00 0d 30 calli 800d104 8009c48: 44 20 00 04 be r1,r0,8009c58 8009c4c: e0 00 00 04 bi 8009c5c 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) { 8009c50: b9 80 68 00 mv r13,r12 8009c54: e0 00 00 02 bi 8009c5c if ( current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 8009c58: 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) { 8009c5c: 36 10 00 01 addi r16,r16,1 8009c60: 35 8c 00 14 addi r12,r12,20 8009c64: 65 c2 00 00 cmpei r2,r14,0 8009c68: 65 a1 00 00 cmpei r1,r13,0 8009c6c: b8 41 08 00 or r1,r2,r1 8009c70: 44 20 00 02 be r1,r0,8009c78 8009c74: 56 50 ff ee bgu r18,r16,8009c2c } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } 8009c78: 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) { 8009c7c: 45 c0 00 08 be r14,r0,8009c9c if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { 8009c80: 20 21 00 40 andi r1,r1,0x40 8009c84: 5c 20 00 03 bne r1,r0,8009c90 currentloc->node_access = node; 8009c88: 59 6e 00 20 sw (r11+32),r14 8009c8c: e0 00 00 0c bi 8009cbc rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); 8009c90: b9 60 08 00 mv r1,r11 8009c94: 34 02 00 11 mvi r2,17 8009c98: e0 00 00 10 bi 8009cd8 } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { 8009c9c: 20 21 00 20 andi r1,r1,0x20 8009ca0: 44 2e 00 0c be r1,r14,8009cd0 <== NEVER TAKEN if (free_node != NULL) { 8009ca4: 45 a0 00 08 be r13,r0,8009cc4 free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; 8009ca8: 34 01 01 ff mvi r1,511 8009cac: 59 a1 00 10 sw (r13+16),r1 currentloc->node_access = free_node; 8009cb0: 59 6d 00 20 sw (r11+32),r13 rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; 8009cb4: 59 71 00 08 sw (r11+8),r17 ctx->tokenlen = tokenlen; 8009cb8: 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; 8009cbc: 59 60 00 04 sw (r11+4),r0 8009cc0: e0 00 00 07 bi 8009cdc 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); 8009cc4: b9 60 08 00 mv r1,r11 8009cc8: 34 02 00 1c mvi r2,28 8009ccc: e0 00 00 03 bi 8009cd8 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); 8009cd0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8009cd4: 34 02 00 02 mvi r2,2 <== NOT EXECUTED 8009cd8: fb ff eb 22 calli 8004960 } } } 8009cdc: 2b 9d 00 04 lw ra,(sp+4) 8009ce0: 2b 8b 00 24 lw r11,(sp+36) 8009ce4: 2b 8c 00 20 lw r12,(sp+32) 8009ce8: 2b 8d 00 1c lw r13,(sp+28) 8009cec: 2b 8e 00 18 lw r14,(sp+24) 8009cf0: 2b 8f 00 14 lw r15,(sp+20) 8009cf4: 2b 90 00 10 lw r16,(sp+16) 8009cf8: 2b 91 00 0c lw r17,(sp+12) 8009cfc: 2b 92 00 08 lw r18,(sp+8) 8009d00: 37 9c 00 24 addi sp,sp,36 8009d04: c3 a0 00 00 ret =============================================================================== 08003690 : 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 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 <== 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 <== 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 <== 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 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 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_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 26 97 calli 800d188 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 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 21 c9 calli 800be5c <__errno> 800373c: 34 02 00 0c mvi r2,12 8003740: e0 00 00 07 bi 800375c } 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 <== ALWAYS TAKEN errno = ENOTSUP; 8003754: f8 00 21 c2 calli 800be5c <__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 : */ 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 96 dc ori r1,r1,0x96dc 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 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 <== NEVER TAKEN diskdevs_protected = true; 80014f4: 78 01 08 01 mvhi r1,0x801 80014f8: 34 02 00 01 mvi r2,1 80014fc: 38 21 96 e0 ori r1,r1,0x96e0 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 : 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 96 e0 ori r1,r1,0x96e0 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 96 dc ori r1,r1,0x96dc 8001534: 28 21 00 00 lw r1,(r1+0) 8001538: f8 00 0e cd calli 800506c if (sc != RTEMS_SUCCESSFUL) { 800153c: 44 20 00 05 be r1,r0,8001550 <== ALWAYS TAKEN /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); 8001540: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8001544: 38 42 76 6c ori r2,r2,0x766c <== NOT EXECUTED 8001548: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 800154c: f8 00 0f c4 calli 800545c <== 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 : /* * 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 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 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 <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 8003e94: 44 20 00 02 be r1,r0,8003e9c <== NOT EXECUTED rtems_fatal_error_occurred (sc); 8003e98: f8 00 0c 1c calli 8006f08 <== 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 <== 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 : */ 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 if ( status == -1 ) 8001ae0: 44 2b 00 0a be r1,r11,8001b08 /* * 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 if ( status == -1 ) 8001af0: 44 2b 00 06 be r1,r11,8001b08 <== 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 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 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 <== NEVER TAKEN iscntrl(c) && (c != '\t') && (c != '\n')) { 8004d20: 78 02 08 02 mvhi r2,0x802 8004d24: 38 42 62 94 ori r2,r2,0x6294 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 8004d48: 34 02 00 0a mvi r2,10 8004d4c: 44 22 00 0d be r1,r2,8004d80 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 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 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 } } 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 =============================================================================== 080232f8 : void endgrent(void) { 80232f8: 37 9c ff fc addi sp,sp,-4 80232fc: 5b 9d 00 04 sw (sp+4),ra if (group_fp != NULL) 8023300: 78 01 08 06 mvhi r1,0x806 8023304: 38 21 79 ec ori r1,r1,0x79ec 8023308: 28 21 00 00 lw r1,(r1+0) 802330c: 44 20 00 02 be r1,r0,8023314 <== NEVER TAKEN fclose(group_fp); 8023310: f8 00 52 89 calli 8037d34 } 8023314: 2b 9d 00 04 lw ra,(sp+4) 8023318: 37 9c 00 04 addi sp,sp,4 802331c: c3 a0 00 00 ret =============================================================================== 08023130 : void endpwent(void) { 8023130: 37 9c ff fc addi sp,sp,-4 8023134: 5b 9d 00 04 sw (sp+4),ra if (passwd_fp != NULL) 8023138: 78 01 08 06 mvhi r1,0x806 802313c: 38 21 7a c8 ori r1,r1,0x7ac8 8023140: 28 21 00 00 lw r1,(r1+0) 8023144: 44 20 00 02 be r1,r0,802314c <== NEVER TAKEN fclose(passwd_fp); 8023148: f8 00 52 fb calli 8037d34 } 802314c: 2b 9d 00 04 lw ra,(sp+4) 8023150: 37 9c 00 04 addi sp,sp,4 8023154: c3 a0 00 00 ret =============================================================================== 08004d98 : * 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 return; if (lineFlag) { 8004dcc: 44 40 00 62 be r2,r0,8004f54 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 <== ALWAYS TAKEN tty->ccount = 0; 8004ddc: 59 60 00 20 sw (r11+32),r0 <== NOT EXECUTED return; 8004de0: e0 00 00 66 bi 8004f78 <== 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 <== 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 <== 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 <== NOT EXECUTED echo ('\n', tty); 8004e08: 34 01 00 0a mvi r1,10 <== NOT EXECUTED 8004e0c: e0 00 00 0d bi 8004e40 <== 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 <== NEVER TAKEN if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 8004e30: 5d e0 00 07 bne r15,r0,8004e4c 8004e34: 20 43 00 10 andi r3,r2,0x10 8004e38: 5c 6f 00 05 bne r3,r15,8004e4c <== 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 <== NOT EXECUTED 8004e48: e0 00 00 4c bi 8004f78 <== NOT EXECUTED } else if (c == '\t') { 8004e4c: 5d 91 00 20 bne r12,r17,8004ecc 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 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 col = (col | 7) + 1; 8004e74: 39 8c 00 07 ori r12,r12,0x7 8004e78: e0 00 00 08 bi 8004e98 } 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 <== ALWAYS TAKEN if (tty->termios.c_lflag & ECHOCTL) 8004e8c: 44 40 00 04 be r2,r0,8004e9c <== NOT EXECUTED col += 2; 8004e90: 35 8c 00 02 addi r12,r12,2 <== NOT EXECUTED 8004e94: e0 00 00 02 bi 8004e9c <== 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 8004ea0: e0 00 00 08 bi 8004ec0 /* * 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 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 8004ec8: e0 00 00 21 bi 8004f4c 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 <== ALWAYS TAKEN 8004ee4: 20 42 02 00 andi r2,r2,0x200 <== NOT EXECUTED 8004ee8: 44 40 00 09 be r2,r0,8004f0c <== 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 <== 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 <== 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 <== 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 <== 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 if (tty->column) 8004f3c: 29 61 00 28 lw r1,(r11+40) 8004f40: 44 20 00 03 be r1,r0,8004f4c <== 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 8004f50: e0 00 00 0a bi 8004f78 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 62 94 ori r13,r13,0x6294 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 3b 8c ori r14,r14,0x3b8c /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 8004f6c: 3a 10 3b 88 ori r16,r16,0x3b88 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 } } 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 =============================================================================== 0800ffa4 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 800ffa4: 37 9c ff e0 addi sp,sp,-32 800ffa8: 5b 8b 00 20 sw (sp+32),r11 800ffac: 5b 8c 00 1c sw (sp+28),r12 800ffb0: 5b 8d 00 18 sw (sp+24),r13 800ffb4: 5b 8e 00 14 sw (sp+20),r14 800ffb8: 5b 8f 00 10 sw (sp+16),r15 800ffbc: 5b 90 00 0c sw (sp+12),r16 800ffc0: 5b 91 00 08 sw (sp+8),r17 800ffc4: 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); 800ffc8: 40 2e 00 02 lbu r14,(r1+2) 800ffcc: 40 2f 00 0c lbu r15,(r1+12) 800ffd0: b8 20 58 00 mv r11,r1 800ffd4: b8 40 60 00 mv r12,r2 800ffd8: c9 ee 78 00 sub r15,r15,r14 800ffdc: b8 40 08 00 mv r1,r2 800ffe0: b9 e0 10 00 mv r2,r15 800ffe4: b8 60 88 00 mv r17,r3 800ffe8: b8 80 80 00 mv r16,r4 800ffec: f8 00 70 89 calli 802c210 <__lshrsi3> 800fff0: 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) 800fff4: 41 61 00 89 lbu r1,(r11+137) 800fff8: 44 20 00 03 be r1,r0,8010004 800fffc: 29 61 00 84 lw r1,(r11+132) 8010000: 44 2c 00 16 be r1,r12,8010058 { fat_buf_release(fs_info); 8010004: b9 60 08 00 mv r1,r11 8010008: fb ff ff 69 calli 800fdac if (op_type == FAT_OP_TYPE_READ) 801000c: 34 02 00 01 mvi r2,1 8010010: 29 61 00 64 lw r1,(r11+100) 8010014: 35 63 00 8c addi r3,r11,140 8010018: 5e 22 00 04 bne r17,r2,8010028 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 801001c: b9 a0 10 00 mv r2,r13 8010020: fb ff f6 65 calli 800d9b4 8010024: e0 00 00 03 bi 8010030 else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); 8010028: b9 a0 10 00 mv r2,r13 801002c: fb ff f6 23 calli 800d8b8 if (sc != RTEMS_SUCCESSFUL) 8010030: 44 20 00 06 be r1,r0,8010048 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EIO); 8010034: f8 00 26 76 calli 8019a0c <__errno> <== NOT EXECUTED 8010038: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 801003c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8010040: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8010044: e0 00 00 10 bi 8010084 <== NOT EXECUTED fs_info->c.blk_num = sec_num; fs_info->c.modified = 0; fs_info->c.state = FAT_CACHE_ACTUAL; 8010048: 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; 801004c: 59 6c 00 84 sw (r11+132),r12 fs_info->c.modified = 0; 8010050: 31 60 00 88 sb (r11+136),r0 fs_info->c.state = FAT_CACHE_ACTUAL; 8010054: 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); 8010058: b9 e0 10 00 mv r2,r15 801005c: b9 a0 08 00 mv r1,r13 8010060: fb ff c4 62 calli 80011e8 <__ashlsi3> } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 8010064: 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); 8010068: b9 c0 10 00 mv r2,r14 801006c: c9 81 08 00 sub r1,r12,r1 8010070: fb ff c4 5e calli 80011e8 <__ashlsi3> 8010074: 29 62 00 1c lw r2,(r11+28) 8010078: b4 41 08 00 add r1,r2,r1 801007c: 5a 01 00 00 sw (r16+0),r1 return RC_OK; 8010080: 34 01 00 00 mvi r1,0 } 8010084: 2b 9d 00 04 lw ra,(sp+4) 8010088: 2b 8b 00 20 lw r11,(sp+32) 801008c: 2b 8c 00 1c lw r12,(sp+28) 8010090: 2b 8d 00 18 lw r13,(sp+24) 8010094: 2b 8e 00 14 lw r14,(sp+20) 8010098: 2b 8f 00 10 lw r15,(sp+16) 801009c: 2b 90 00 0c lw r16,(sp+12) 80100a0: 2b 91 00 08 lw r17,(sp+8) 80100a4: 37 9c 00 20 addi sp,sp,32 80100a8: c3 a0 00 00 ret =============================================================================== 0800fdac : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 800fdac: 37 9c ff d8 addi sp,sp,-40 800fdb0: 5b 8b 00 24 sw (sp+36),r11 800fdb4: 5b 8c 00 20 sw (sp+32),r12 800fdb8: 5b 8d 00 1c sw (sp+28),r13 800fdbc: 5b 8e 00 18 sw (sp+24),r14 800fdc0: 5b 8f 00 14 sw (sp+20),r15 800fdc4: 5b 90 00 10 sw (sp+16),r16 800fdc8: 5b 91 00 0c sw (sp+12),r17 800fdcc: 5b 92 00 08 sw (sp+8),r18 800fdd0: 5b 9d 00 04 sw (sp+4),ra 800fdd4: b8 20 58 00 mv r11,r1 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 800fdd8: 40 21 00 89 lbu r1,(r1+137) return RC_OK; 800fddc: 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) 800fde0: 44 20 00 65 be r1,r0,800ff74 return RC_OK; if (fs_info->c.modified) 800fde4: 41 61 00 88 lbu r1,(r11+136) 800fde8: 44 20 00 5b be r1,r0,800ff54 { uint32_t sec_num = fs_info->c.blk_num; 800fdec: 29 6c 00 84 lw r12,(r11+132) bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 800fdf0: 2d 61 00 18 lhu r1,(r11+24) 800fdf4: 34 0d 00 00 mvi r13,0 800fdf8: 54 2c 00 03 bgu r1,r12,800fe04 800fdfc: 29 6d 00 20 lw r13,(r11+32) 800fe00: f5 ac 68 00 cmpgu r13,r13,r12 800fe04: 21 ad 00 ff andi r13,r13,0xff uint32_t ino ) { return (ino >= fs_info->uino_base); } 800fe08: 41 6e 00 02 lbu r14,(r11+2) 800fe0c: 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) 800fe10: 45 a0 00 14 be r13,r0,800fe60 800fe14: 41 61 00 54 lbu r1,(r11+84) 800fe18: 5c 20 00 12 bne r1,r0,800fe60 <== 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); 800fe1c: c9 ee 78 00 sub r15,r15,r14 800fe20: b9 e0 10 00 mv r2,r15 800fe24: b9 80 08 00 mv r1,r12 800fe28: f8 00 70 fa calli 802c210 <__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); 800fe2c: b9 e0 10 00 mv r2,r15 800fe30: fb ff c4 ee calli 80011e8 <__ashlsi3> memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, 800fe34: 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); 800fe38: b9 c0 10 00 mv r2,r14 800fe3c: c9 81 08 00 sub r1,r12,r1 800fe40: fb ff c4 ea 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, 800fe44: 29 71 00 90 lw r17,(r11+144) 800fe48: 2d 70 00 00 lhu r16,(r11+0) 800fe4c: 2a 42 00 1c lw r2,(r18+28) 800fe50: ba 00 18 00 mv r3,r16 800fe54: b4 41 10 00 add r2,r2,r1 800fe58: ba 20 08 00 mv r1,r17 800fe5c: f8 00 2a 3a calli 801a744 fs_info->c.buf->buffer + blk_ofs, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(fs_info->c.buf); 800fe60: 29 61 00 8c lw r1,(r11+140) 800fe64: fb ff f7 93 calli 800dcb0 if (sc != RTEMS_SUCCESSFUL) 800fe68: 5c 20 00 3e bne r1,r0,800ff60 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; 800fe6c: 31 60 00 88 sb (r11+136),r0 if (sec_of_fat && !fs_info->vol.mirror) 800fe70: 45 a1 00 3f be r13,r1,800ff6c 800fe74: 41 61 00 54 lbu r1,(r11+84) 800fe78: 34 0c 00 01 mvi r12,1 800fe7c: 44 20 00 33 be r1,r0,800ff48 <== ALWAYS TAKEN 800fe80: e0 00 00 3b bi 800ff6c <== 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, 800fe84: 29 62 00 1c lw r2,(r11+28) 800fe88: b9 80 08 00 mv r1,r12 800fe8c: fb ff c5 25 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); 800fe90: 41 6e 00 02 lbu r14,(r11+2) 800fe94: 29 6f 00 84 lw r15,(r11+132) 800fe98: 41 70 00 0c lbu r16,(r11+12) 800fe9c: b4 2f 78 00 add r15,r1,r15 800fea0: ca 0e 80 00 sub r16,r16,r14 800fea4: ba 00 10 00 mv r2,r16 800fea8: b9 e0 08 00 mv r1,r15 800feac: f8 00 70 d9 calli 802c210 <__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); 800feb0: 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); 800feb4: 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); 800feb8: fb ff c4 cc 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); 800febc: b9 c0 10 00 mv r2,r14 800fec0: c9 e1 08 00 sub r1,r15,r1 800fec4: fb ff c4 c9 calli 80011e8 <__ashlsi3> 800fec8: 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 800fecc: 5c 20 00 09 bne r1,r0,800fef0 && fs_info->vol.bps == fs_info->vol.bytes_per_block) 800fed0: 2d 62 00 00 lhu r2,(r11+0) 800fed4: 2d 61 00 0a lhu r1,(r11+10) 800fed8: 5c 41 00 06 bne r2,r1,800fef0 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 800fedc: 29 61 00 64 lw r1,(r11+100) 800fee0: b9 a0 10 00 mv r2,r13 800fee4: 37 83 00 28 addi r3,sp,40 800fee8: fb ff f6 74 calli 800d8b8 800feec: e0 00 00 05 bi 800ff00 } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); 800fef0: 29 61 00 64 lw r1,(r11+100) 800fef4: b9 a0 10 00 mv r2,r13 800fef8: 37 83 00 28 addi r3,sp,40 800fefc: fb ff f6 ae calli 800d9b4 800ff00: b8 20 68 00 mv r13,r1 } if ( sc != RTEMS_SUCCESSFUL) 800ff04: 44 20 00 06 be r1,r0,800ff1c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENOMEM); 800ff08: f8 00 26 c1 calli 8019a0c <__errno> <== NOT EXECUTED 800ff0c: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 800ff10: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800ff14: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 800ff18: e0 00 00 17 bi 800ff74 <== NOT EXECUTED memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 800ff1c: 2b 81 00 28 lw r1,(sp+40) 800ff20: 29 62 00 90 lw r2,(r11+144) 800ff24: 2d 63 00 00 lhu r3,(r11+0) 800ff28: 28 21 00 1c lw r1,(r1+28) 800ff2c: b4 2e 08 00 add r1,r1,r14 800ff30: f8 00 2a 05 calli 801a744 sc = rtems_bdbuf_release_modified(bd); 800ff34: 2b 81 00 28 lw r1,(sp+40) 800ff38: fb ff f7 5e calli 800dcb0 if ( sc != RTEMS_SUCCESSFUL) 800ff3c: 5c 2d ff f3 bne r1,r13,800ff08 <== NEVER TAKEN if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 800ff40: 35 8c 00 01 addi r12,r12,1 800ff44: 21 8c 00 ff andi r12,r12,0xff 800ff48: 41 61 00 0d lbu r1,(r11+13) 800ff4c: 54 2c ff ce bgu r1,r12,800fe84 800ff50: e0 00 00 07 bi 800ff6c } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 800ff54: 29 61 00 8c lw r1,(r11+140) 800ff58: fb ff f7 21 calli 800dbdc if (sc != RTEMS_SUCCESSFUL) 800ff5c: 44 2c 00 04 be r1,r12,800ff6c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EIO); 800ff60: f8 00 26 ab calli 8019a0c <__errno> <== NOT EXECUTED 800ff64: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 800ff68: e3 ff ff ea bi 800ff10 <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; 800ff6c: 31 60 00 89 sb (r11+137),r0 return RC_OK; 800ff70: 34 0c 00 00 mvi r12,0 } 800ff74: b9 80 08 00 mv r1,r12 800ff78: 2b 9d 00 04 lw ra,(sp+4) 800ff7c: 2b 8b 00 24 lw r11,(sp+36) 800ff80: 2b 8c 00 20 lw r12,(sp+32) 800ff84: 2b 8d 00 1c lw r13,(sp+28) 800ff88: 2b 8e 00 18 lw r14,(sp+24) 800ff8c: 2b 8f 00 14 lw r15,(sp+20) 800ff90: 2b 90 00 10 lw r16,(sp+16) 800ff94: 2b 91 00 0c lw r17,(sp+12) 800ff98: 2b 92 00 08 lw r18,(sp+8) 800ff9c: 37 9c 00 28 addi sp,sp,40 800ffa0: c3 a0 00 00 ret =============================================================================== 0801583c : static inline uint32_t fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { 801583c: 37 9c ff f8 addi sp,sp,-8 8015840: 5b 8b 00 08 sw (sp+8),r11 8015844: 5b 9d 00 04 sw (sp+4),ra 8015848: b8 20 58 00 mv r11,r1 if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 801584c: 5c 40 00 06 bne r2,r0,8015864 8015850: 40 21 00 0e lbu r1,(r1+14) 8015854: 20 21 00 03 andi r1,r1,0x3 8015858: 44 22 00 03 be r1,r2,8015864 <== NEVER TAKEN return fs_info->vol.rdir_loc; 801585c: 29 61 00 20 lw r1,(r11+32) 8015860: e0 00 00 06 bi 8015878 return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 8015864: 34 41 ff fe addi r1,r2,-2 8015868: 41 62 00 05 lbu r2,(r11+5) 801586c: fb ff ae 5f calli 80011e8 <__ashlsi3> 8015870: 29 62 00 34 lw r2,(r11+52) 8015874: b4 22 08 00 add r1,r1,r2 fs_info->vol.data_fsec); } 8015878: 2b 9d 00 04 lw ra,(sp+4) 801587c: 2b 8b 00 08 lw r11,(sp+8) 8015880: 37 9c 00 08 addi sp,sp,8 8015884: c3 a0 00 00 ret =============================================================================== 0801025c : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 801025c: 37 9c ff d0 addi sp,sp,-48 8010260: 5b 8b 00 2c sw (sp+44),r11 8010264: 5b 8c 00 28 sw (sp+40),r12 8010268: 5b 8d 00 24 sw (sp+36),r13 801026c: 5b 8e 00 20 sw (sp+32),r14 8010270: 5b 8f 00 1c sw (sp+28),r15 8010274: 5b 90 00 18 sw (sp+24),r16 8010278: 5b 91 00 14 sw (sp+20),r17 801027c: 5b 92 00 10 sw (sp+16),r18 8010280: 5b 93 00 0c sw (sp+12),r19 8010284: 5b 94 00 08 sw (sp+8),r20 8010288: 5b 9d 00 04 sw (sp+4),ra 801028c: b8 20 58 00 mv r11,r1 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8010290: 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) { 8010294: b8 60 88 00 mv r17,r3 8010298: 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)); 801029c: c8 23 08 00 sub r1,r1,r3 80102a0: b8 80 60 00 mv r12,r4 80102a4: 50 24 00 02 bgeu r1,r4,80102ac <== ALWAYS TAKEN 80102a8: 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)) ) 80102ac: 5c 40 00 0b bne r2,r0,80102d8 <== ALWAYS TAKEN 80102b0: 41 61 00 0e lbu r1,(r11+14) <== NOT EXECUTED 80102b4: 20 21 00 03 andi r1,r1,0x3 <== NOT EXECUTED 80102b8: 44 22 00 08 be r1,r2,80102d8 <== 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); 80102bc: 41 64 00 0c lbu r4,(r11+12) <== NOT EXECUTED 80102c0: 41 63 00 02 lbu r3,(r11+2) <== NOT EXECUTED 80102c4: 29 61 00 20 lw r1,(r11+32) <== NOT EXECUTED 80102c8: c8 83 10 00 sub r2,r4,r3 <== NOT EXECUTED 80102cc: f8 00 6f d1 calli 802c210 <__lshrsi3> <== NOT EXECUTED 80102d0: b8 20 80 00 mv r16,r1 <== NOT EXECUTED 80102d4: e0 00 00 0c bi 8010304 <== 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); 80102d8: 41 63 00 08 lbu r3,(r11+8) 80102dc: 41 6d 00 0c lbu r13,(r11+12) 80102e0: 34 41 ff fe addi r1,r2,-2 80102e4: c8 6d 10 00 sub r2,r3,r13 80102e8: fb ff c3 c0 calli 80011e8 <__ashlsi3> 80102ec: 41 63 00 02 lbu r3,(r11+2) 80102f0: b8 20 80 00 mv r16,r1 80102f4: 29 61 00 34 lw r1,(r11+52) 80102f8: c9 a3 10 00 sub r2,r13,r3 80102fc: f8 00 6f c5 calli 802c210 <__lshrsi3> blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); 8010300: 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; 8010304: 41 6d 00 0c lbu r13,(r11+12) 8010308: 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; 801030c: 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; 8010310: b9 a0 10 00 mv r2,r13 8010314: f8 00 6f bf calli 802c210 <__lshrsi3> uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 8010318: 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; 801031c: b8 20 70 00 mv r14,r1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 8010320: fb ff c3 b2 calli 80011e8 <__ashlsi3> 8010324: ca 21 88 00 sub r17,r17,r1 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; 8010328: 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; 801032c: 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; 8010330: 34 13 00 01 mvi r19,1 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 8010334: e0 00 00 26 bi 80103cc && (0 < bytes_to_write)) { uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 8010338: 2d 72 00 0a lhu r18,(r11+10) 801033c: ca 51 20 00 sub r4,r18,r17 8010340: b8 80 68 00 mv r13,r4 8010344: 51 84 00 02 bgeu r12,r4,801034c <== ALWAYS TAKEN 8010348: 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)); 801034c: b9 a0 70 00 mv r14,r13 8010350: 50 8d 00 02 bgeu r4,r13,8010358 <== ALWAYS TAKEN 8010354: b8 80 70 00 mv r14,r4 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 8010358: 41 63 00 02 lbu r3,(r11+2) 801035c: 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) 8010360: 45 c0 00 13 be r14,r0,80103ac <== 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); 8010364: c8 83 10 00 sub r2,r4,r3 8010368: ba 00 08 00 mv r1,r16 801036c: fb ff c3 9f calli 80011e8 <__ashlsi3> 8010370: 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); 8010374: 34 03 00 02 mvi r3,2 8010378: 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) 801037c: 45 d2 00 03 be r14,r18,8010388 { 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); 8010380: b9 60 08 00 mv r1,r11 8010384: 34 03 00 01 mvi r3,1 8010388: 37 84 00 30 addi r4,sp,48 801038c: fb ff ff 06 calli 800ffa4 if (RC_OK == rc) 8010390: 5c 20 00 08 bne r1,r0,80103b0 <== NEVER TAKEN { memset(blk_buf + offset, pattern, bytes_to_write); 8010394: 2b 81 00 30 lw r1,(sp+48) 8010398: ba 80 10 00 mv r2,r20 801039c: b9 c0 18 00 mv r3,r14 80103a0: b4 31 08 00 add r1,r1,r17 80103a4: f8 00 29 29 calli 801a848 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 80103a8: 31 73 00 88 sb (r11+136),r19 } } if (RC_OK != rc) return rc; else return bytes_to_write; 80103ac: b9 c0 08 00 mv r1,r14 cur_blk, ofs_blk, c, pattern); if (c != ret) rc = -1; 80103b0: 34 04 ff ff mvi r4,-1 fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) 80103b4: 5d a1 00 05 bne r13,r1,80103c8 <== NEVER TAKEN rc = -1; else { bytes_to_write -= ret; 80103b8: c9 8d 60 00 sub r12,r12,r13 bytes_written += ret; 80103bc: b5 ed 78 00 add r15,r15,r13 ++cur_blk; 80103c0: 36 10 00 01 addi r16,r16,1 80103c4: 34 04 00 00 mvi r4,0 80103c8: 34 11 00 00 mvi r17,0 ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) 80103cc: 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) 80103d0: 64 81 00 00 cmpei r1,r4,0 80103d4: a0 41 08 00 and r1,r2,r1 80103d8: 5c 20 ff d8 bne r1,r0,8010338 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 80103dc: 5c 81 00 02 bne r4,r1,80103e4 <== NEVER TAKEN 80103e0: b9 e0 20 00 mv r4,r15 return rc; else return bytes_written; } 80103e4: b8 80 08 00 mv r1,r4 80103e8: 2b 9d 00 04 lw ra,(sp+4) 80103ec: 2b 8b 00 2c lw r11,(sp+44) 80103f0: 2b 8c 00 28 lw r12,(sp+40) 80103f4: 2b 8d 00 24 lw r13,(sp+36) 80103f8: 2b 8e 00 20 lw r14,(sp+32) 80103fc: 2b 8f 00 1c lw r15,(sp+28) 8010400: 2b 90 00 18 lw r16,(sp+24) 8010404: 2b 91 00 14 lw r17,(sp+20) 8010408: 2b 92 00 10 lw r18,(sp+16) 801040c: 2b 93 00 0c lw r19,(sp+12) 8010410: 2b 94 00 08 lw r20,(sp+8) 8010414: 37 9c 00 30 addi sp,sp,48 8010418: c3 a0 00 00 ret =============================================================================== 0801041c : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 801041c: 37 9c ff cc addi sp,sp,-52 8010420: 5b 8b 00 30 sw (sp+48),r11 8010424: 5b 8c 00 2c sw (sp+44),r12 8010428: 5b 8d 00 28 sw (sp+40),r13 801042c: 5b 8e 00 24 sw (sp+36),r14 8010430: 5b 8f 00 20 sw (sp+32),r15 8010434: 5b 90 00 1c sw (sp+28),r16 8010438: 5b 91 00 18 sw (sp+24),r17 801043c: 5b 92 00 14 sw (sp+20),r18 8010440: 5b 93 00 10 sw (sp+16),r19 8010444: 5b 94 00 0c sw (sp+12),r20 8010448: 5b 95 00 08 sw (sp+8),r21 801044c: 5b 9d 00 04 sw (sp+4),ra 8010450: b8 20 58 00 mv r11,r1 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8010454: 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) { 8010458: b8 60 88 00 mv r17,r3 801045c: b8 a0 a0 00 mv r20,r5 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8010460: 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) { 8010464: 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)); 8010468: b8 80 60 00 mv r12,r4 801046c: 50 24 00 02 bgeu r1,r4,8010474 <== ALWAYS TAKEN 8010470: 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)) ) 8010474: 5c 40 00 0b bne r2,r0,80104a0 8010478: 41 61 00 0e lbu r1,(r11+14) 801047c: 20 21 00 03 andi r1,r1,0x3 8010480: 44 22 00 08 be r1,r2,80104a0 <== 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); 8010484: 41 63 00 0c lbu r3,(r11+12) 8010488: 41 62 00 02 lbu r2,(r11+2) 801048c: 29 61 00 20 lw r1,(r11+32) 8010490: c8 62 10 00 sub r2,r3,r2 8010494: f8 00 6f 5f calli 802c210 <__lshrsi3> 8010498: b8 20 80 00 mv r16,r1 801049c: e0 00 00 0c bi 80104cc 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); 80104a0: 41 63 00 08 lbu r3,(r11+8) 80104a4: 41 6d 00 0c lbu r13,(r11+12) 80104a8: 34 41 ff fe addi r1,r2,-2 80104ac: c8 6d 10 00 sub r2,r3,r13 80104b0: fb ff c3 4e calli 80011e8 <__ashlsi3> 80104b4: 41 62 00 02 lbu r2,(r11+2) 80104b8: b8 20 80 00 mv r16,r1 80104bc: 29 61 00 34 lw r1,(r11+52) 80104c0: c9 a2 10 00 sub r2,r13,r2 80104c4: f8 00 6f 53 calli 802c210 <__lshrsi3> blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); 80104c8: 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); 80104cc: 41 6d 00 0c lbu r13,(r11+12) 80104d0: 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; 80104d4: 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); 80104d8: b9 a0 10 00 mv r2,r13 80104dc: f8 00 6f 4d calli 802c210 <__lshrsi3> uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 80104e0: 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); 80104e4: b8 20 70 00 mv r14,r1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 80104e8: fb ff c3 40 calli 80011e8 <__ashlsi3> 80104ec: 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; 80104f0: 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; 80104f4: 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; 80104f8: 34 13 00 01 mvi r19,1 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 80104fc: e0 00 00 27 bi 8010598 && (0 < bytes_to_write)) { c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 8010500: 2d 72 00 0a lhu r18,(r11+10) 8010504: ca 51 10 00 sub r2,r18,r17 8010508: b8 40 68 00 mv r13,r2 801050c: 51 82 00 02 bgeu r12,r2,8010514 8010510: 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)); 8010514: b9 a0 70 00 mv r14,r13 8010518: 50 4d 00 02 bgeu r2,r13,8010520 <== ALWAYS TAKEN 801051c: b8 40 70 00 mv r14,r2 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 8010520: 41 62 00 02 lbu r2,(r11+2) 8010524: 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) 8010528: 45 c0 00 14 be r14,r0,8010578 <== 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); 801052c: c8 62 10 00 sub r2,r3,r2 8010530: ba 00 08 00 mv r1,r16 8010534: fb ff c3 2d calli 80011e8 <__ashlsi3> 8010538: b8 20 10 00 mv r2,r1 { if ( overwrite_block 801053c: 5e a0 00 04 bne r21,r0,801054c || (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); 8010540: b9 60 08 00 mv r1,r11 8010544: 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)) 8010548: 5d d2 00 03 bne r14,r18,8010554 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 801054c: b9 60 08 00 mv r1,r11 8010550: 34 03 00 02 mvi r3,2 } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 8010554: 37 84 00 34 addi r4,sp,52 8010558: fb ff fe 93 calli 800ffa4 if (RC_OK == rc) 801055c: 5c 20 00 08 bne r1,r0,801057c <== NEVER TAKEN { memcpy(blk_buf + offset, buf, bytes_to_write); 8010560: 2b 81 00 34 lw r1,(sp+52) 8010564: b6 8f 10 00 add r2,r20,r15 8010568: b9 c0 18 00 mv r3,r14 801056c: b4 31 08 00 add r1,r1,r17 8010570: f8 00 28 75 calli 801a744 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 8010574: 31 73 00 88 sb (r11+136),r19 } } if (RC_OK != rc) return rc; else return bytes_to_write; 8010578: b9 c0 08 00 mv r1,r14 ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) rc = -1; 801057c: 34 02 ff ff mvi r2,-1 cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) 8010580: 5d a1 00 05 bne r13,r1,8010594 <== NEVER TAKEN rc = -1; else { bytes_to_write -= ret; 8010584: c9 8d 60 00 sub r12,r12,r13 bytes_written += ret; 8010588: b5 ed 78 00 add r15,r15,r13 ++cur_blk; 801058c: 36 10 00 01 addi r16,r16,1 8010590: 34 02 00 00 mvi r2,0 8010594: 34 11 00 00 mvi r17,0 uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) 8010598: 7d 83 00 00 cmpnei r3,r12,0 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 801059c: 64 41 00 00 cmpei r1,r2,0 80105a0: a0 61 08 00 and r1,r3,r1 80105a4: 5c 20 ff d7 bne r1,r0,8010500 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 80105a8: 5c 41 00 02 bne r2,r1,80105b0 <== NEVER TAKEN 80105ac: b9 e0 10 00 mv r2,r15 return rc; else return bytes_written; } 80105b0: b8 40 08 00 mv r1,r2 80105b4: 2b 9d 00 04 lw ra,(sp+4) 80105b8: 2b 8b 00 30 lw r11,(sp+48) 80105bc: 2b 8c 00 2c lw r12,(sp+44) 80105c0: 2b 8d 00 28 lw r13,(sp+40) 80105c4: 2b 8e 00 24 lw r14,(sp+36) 80105c8: 2b 8f 00 20 lw r15,(sp+32) 80105cc: 2b 90 00 1c lw r16,(sp+28) 80105d0: 2b 91 00 18 lw r17,(sp+24) 80105d4: 2b 92 00 14 lw r18,(sp+20) 80105d8: 2b 93 00 10 lw r19,(sp+16) 80105dc: 2b 94 00 0c lw r20,(sp+12) 80105e0: 2b 95 00 08 lw r21,(sp+8) 80105e4: 37 9c 00 34 addi sp,sp,52 80105e8: c3 a0 00 00 ret =============================================================================== 0800ee68 : */ static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { 800ee68: 37 9c ff f0 addi sp,sp,-16 800ee6c: 5b 8b 00 10 sw (sp+16),r11 800ee70: 5b 8c 00 0c sw (sp+12),r12 800ee74: 5b 8d 00 08 sw (sp+8),r13 800ee78: 5b 9d 00 04 sw (sp+4),ra return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800ee7c: 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) { 800ee80: 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) 800ee84: 34 01 00 01 mvi r1,1 800ee88: b8 40 68 00 mv r13,r2 return 1; 800ee8c: 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) 800ee90: 44 61 00 0f be r3,r1,800eecc 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)) ) 800ee94: 5c 60 00 06 bne r3,r0,800eeac 800ee98: 41 61 00 0e lbu r1,(r11+14) 800ee9c: 20 21 00 03 andi r1,r1,0x3 800eea0: 44 23 00 03 be r1,r3,800eeac <== NEVER TAKEN return fs_info->vol.rdir_loc; 800eea4: 29 61 00 20 lw r1,(r11+32) 800eea8: e0 00 00 06 bi 800eec0 return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800eeac: 41 62 00 05 lbu r2,(r11+5) 800eeb0: 34 61 ff fe addi r1,r3,-2 800eeb4: fb ff c8 cd calli 80011e8 <__ashlsi3> 800eeb8: 29 62 00 34 lw r2,(r11+52) 800eebc: b4 22 08 00 add r1,r1,r2 ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 800eec0: 41 62 00 03 lbu r2,(r11+3) 800eec4: fb ff c8 c9 calli 80011e8 <__ashlsi3> 800eec8: b8 20 60 00 mv r12,r1 return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800eecc: 29 ab 00 04 lw r11,(r13+4) 800eed0: 34 02 00 09 mvi r2,9 800eed4: b9 60 08 00 mv r1,r11 800eed8: f8 00 74 ce calli 802c210 <__lshrsi3> 800eedc: b5 81 08 00 add r1,r12,r1 800eee0: 34 02 00 04 mvi r2,4 800eee4: fb ff c8 c1 calli 80011e8 <__ashlsi3> 800eee8: b8 20 60 00 mv r12,r1 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800eeec: 34 02 00 05 mvi r2,5 800eef0: b9 60 08 00 mv r1,r11 800eef4: f8 00 74 c7 calli 802c210 <__lshrsi3> 800eef8: 20 22 00 0f andi r2,r1,0xf } 800eefc: b5 82 08 00 add r1,r12,r2 800ef00: 2b 9d 00 04 lw ra,(sp+4) 800ef04: 2b 8b 00 10 lw r11,(sp+16) 800ef08: 2b 8c 00 0c lw r12,(sp+12) 800ef0c: 2b 8d 00 08 lw r13,(sp+8) 800ef10: 37 9c 00 10 addi sp,sp,16 800ef14: c3 a0 00 00 ret =============================================================================== 0800f570 : int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 800f570: 37 9c ff f0 addi sp,sp,-16 800f574: 5b 8b 00 10 sw (sp+16),r11 800f578: 5b 8c 00 0c sw (sp+12),r12 800f57c: 5b 8d 00 08 sw (sp+8),r13 800f580: 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) 800f584: 28 43 00 08 lw r3,(r2+8) 800f588: 34 04 00 01 mvi r4,1 int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 800f58c: b8 20 68 00 mv r13,r1 800f590: 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) 800f594: 50 83 00 05 bgeu r4,r3,800f5a8 { fat_fd->links_num--; 800f598: 34 63 ff ff addi r3,r3,-1 800f59c: 58 43 00 08 sw (r2+8),r3 return rc; 800f5a0: 34 0c 00 00 mvi r12,0 800f5a4: e0 00 00 1e bi 800f61c } key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); if (fat_fd->flags & FAT_FILE_REMOVED) 800f5a8: 40 4c 00 30 lbu r12,(r2+48) 800f5ac: 21 8c 00 01 andi r12,r12,0x1 800f5b0: 45 80 00 0f be r12,r0,800f5ec { rc = fat_file_truncate(fs_info, fat_fd, 0); 800f5b4: 34 03 00 00 mvi r3,0 800f5b8: fb ff ff a1 calli 800f43c 800f5bc: b8 20 60 00 mv r12,r1 if ( rc != RC_OK ) 800f5c0: 5c 20 00 17 bne r1,r0,800f61c <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 800f5c4: b9 60 08 00 mv r1,r11 800f5c8: f8 00 10 25 calli 801365c <_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) ) 800f5cc: 29 62 00 0c lw r2,(r11+12) 800f5d0: b9 a0 08 00 mv r1,r13 800f5d4: f8 00 07 21 calli 8011258 800f5d8: 44 2c 00 0c be r1,r12,800f608 <== ALWAYS TAKEN fat_free_unique_ino(fs_info, fat_fd->ino); 800f5dc: 29 62 00 0c lw r2,(r11+12) <== NOT EXECUTED 800f5e0: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 800f5e4: f8 00 07 05 calli 80111f8 <== NOT EXECUTED 800f5e8: e0 00 00 08 bi 800f608 <== NOT EXECUTED free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 800f5ec: 28 42 00 0c lw r2,(r2+12) 800f5f0: f8 00 07 1a calli 8011258 800f5f4: 44 2c 00 03 be r1,r12,800f600 { fat_fd->links_num = 0; 800f5f8: 59 60 00 08 sw (r11+8),r0 800f5fc: e0 00 00 05 bi 800f610 800f600: b9 60 08 00 mv r1,r11 800f604: f8 00 10 16 calli 801365c <_Chain_Extract> } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 800f608: b9 60 08 00 mv r1,r11 800f60c: fb ff ce 70 calli 8002fcc } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 800f610: b9 a0 08 00 mv r1,r13 800f614: f8 00 01 e6 calli 800fdac 800f618: b8 20 60 00 mv r12,r1 return rc; } 800f61c: b9 80 08 00 mv r1,r12 800f620: 2b 9d 00 04 lw ra,(sp+4) 800f624: 2b 8b 00 10 lw r11,(sp+16) 800f628: 2b 8c 00 0c lw r12,(sp+12) 800f62c: 2b 8d 00 08 lw r13,(sp+8) 800f630: 37 9c 00 10 addi sp,sp,16 800f634: c3 a0 00 00 ret =============================================================================== 0800f710 : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 800f710: 37 9c ff c4 addi sp,sp,-60 800f714: 5b 8b 00 28 sw (sp+40),r11 800f718: 5b 8c 00 24 sw (sp+36),r12 800f71c: 5b 8d 00 20 sw (sp+32),r13 800f720: 5b 8e 00 1c sw (sp+28),r14 800f724: 5b 8f 00 18 sw (sp+24),r15 800f728: 5b 90 00 14 sw (sp+20),r16 800f72c: 5b 91 00 10 sw (sp+16),r17 800f730: 5b 92 00 0c sw (sp+12),r18 800f734: 5b 93 00 08 sw (sp+8),r19 800f738: 5b 9d 00 04 sw (sp+4),ra 800f73c: 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; 800f740: 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 ) { 800f744: 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) 800f748: 28 41 00 18 lw r1,(r2+24) uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; 800f74c: 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; 800f750: 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 ) { 800f754: b8 40 60 00 mv r12,r2 800f758: b8 80 70 00 mv r14,r4 800f75c: 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; 800f760: 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) 800f764: 50 24 00 73 bgeu r1,r4,800f930 return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 800f768: 28 43 00 20 lw r3,(r2+32) 800f76c: 34 02 00 01 mvi r2,1 800f770: 5c 62 00 06 bne r3,r2,800f788 800f774: 29 82 00 24 lw r2,(r12+36) 800f778: 5c 40 00 04 bne r2,r0,800f788 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 800f77c: 41 62 00 0e lbu r2,(r11+14) 800f780: 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)) && 800f784: 5c 4d 00 2f bne r2,r13,800f840 <== ALWAYS TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - 800f788: 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; 800f78c: 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))) & 800f790: 35 e2 ff ff addi r2,r15,-1 800f794: 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 - 800f798: c9 f1 78 00 sub r15,r15,r17 800f79c: 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; 800f7a0: c9 c1 10 00 sub r2,r14,r1 if (bytes2add > bytes_remain) 800f7a4: 51 e2 00 02 bgeu r15,r2,800f7ac bytes2add -= bytes_remain; 800f7a8: c8 4f 80 00 sub r16,r2,r15 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { 800f7ac: 46 60 00 13 be r19,r0,800f7f8 800f7b0: 45 e0 00 12 be r15,r0,800f7f8 uint32_t start = fat_fd->fat_file_size; uint32_t cl_start = start >> fs_info->vol.bpc_log2; 800f7b4: 41 62 00 08 lbu r2,(r11+8) 800f7b8: f8 00 72 96 calli 802c210 <__lshrsi3> 800f7bc: 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); 800f7c0: b9 80 10 00 mv r2,r12 800f7c4: b9 60 08 00 mv r1,r11 800f7c8: 37 84 00 2c addi r4,sp,44 800f7cc: fb ff fe 01 calli 800efd0 800f7d0: b8 20 68 00 mv r13,r1 if (rc != RC_OK) 800f7d4: 5c 20 00 57 bne r1,r0,800f930 <== NEVER TAKEN return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 800f7d8: 2b 82 00 2c lw r2,(sp+44) 800f7dc: b9 60 08 00 mv r1,r11 800f7e0: ba 20 18 00 mv r3,r17 800f7e4: b9 e0 20 00 mv r4,r15 800f7e8: 34 05 00 00 mvi r5,0 800f7ec: f8 00 02 9c calli 801025c if (bytes_remain != bytes_written) return -1; 800f7f0: 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) 800f7f4: 5d e1 00 4f bne r15,r1,800f930 <== 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; 800f7f8: 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) 800f7fc: 46 00 00 4d be r16,r0,800f930 return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 800f800: 41 62 00 08 lbu r2,(r11+8) 800f804: 36 01 ff ff addi r1,r16,-1 800f808: f8 00 72 82 calli 802c210 <__lshrsi3> 800f80c: 34 31 00 01 addi r17,r1,1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 800f810: 37 82 00 3c addi r2,sp,60 800f814: b9 60 08 00 mv r1,r11 800f818: ba 20 18 00 mv r3,r17 800f81c: 37 84 00 30 addi r4,sp,48 800f820: 37 85 00 34 addi r5,sp,52 800f824: ba 60 30 00 mv r6,r19 800f828: f8 00 21 eb calli 8017fd4 800f82c: 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) 800f830: 5c 20 00 40 bne r1,r0,800f930 <== NEVER TAKEN return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) 800f834: 2b 82 00 30 lw r2,(sp+48) 800f838: b9 e2 78 00 or r15,r15,r2 800f83c: 5d e1 00 06 bne r15,r1,800f854 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENOSPC); 800f840: f8 00 28 73 calli 8019a0c <__errno> 800f844: 34 02 00 1c mvi r2,28 800f848: 58 22 00 00 sw (r1+0),r2 800f84c: 34 0d ff ff mvi r13,-1 800f850: e0 00 00 38 bi 800f930 /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 800f854: 46 22 00 09 be r17,r2,800f878 <== ALWAYS TAKEN { new_length -= bytes2add & (fs_info->vol.bpc - 1); 800f858: 2d 61 00 06 lhu r1,(r11+6) <== NOT EXECUTED 800f85c: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED 800f860: a2 01 80 00 and r16,r16,r1 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 800f864: ca 22 08 00 sub r1,r17,r2 <== NOT EXECUTED 800f868: 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); 800f86c: c9 d0 70 00 sub r14,r14,r16 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 800f870: fb ff c6 5e calli 80011e8 <__ashlsi3> <== NOT EXECUTED 800f874: 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 ) 800f878: 29 84 00 18 lw r4,(r12+24) 800f87c: 5c 80 00 06 bne r4,r0,800f894 { fat_fd->map.disk_cln = fat_fd->cln = chain; 800f880: 2b 81 00 3c lw r1,(sp+60) fat_fd->map.file_cln = 0; 800f884: 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; 800f888: 59 81 00 1c sw (r12+28),r1 800f88c: 59 81 00 38 sw (r12+56),r1 800f890: e0 00 00 16 bi 800f8e8 fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 800f894: 29 81 00 3c lw r1,(r12+60) 800f898: 34 02 ff ff mvi r2,-1 800f89c: 44 22 00 03 be r1,r2,800f8a8 <== NEVER TAKEN { old_last_cl = fat_fd->map.last_cln; 800f8a0: 5b 81 00 38 sw (sp+56),r1 800f8a4: e0 00 00 09 bi 800f8c8 } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 800f8a8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800f8ac: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 800f8b0: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 800f8b4: 34 84 ff ff addi r4,r4,-1 <== NOT EXECUTED 800f8b8: 37 85 00 38 addi r5,sp,56 <== NOT EXECUTED 800f8bc: fb ff ff 5f calli 800f638 <== NOT EXECUTED 800f8c0: b8 20 78 00 mv r15,r1 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 800f8c4: 5c 20 00 14 bne r1,r0,800f914 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, chain); return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); 800f8c8: 2b 82 00 38 lw r2,(sp+56) 800f8cc: 2b 83 00 3c lw r3,(sp+60) 800f8d0: b9 60 08 00 mv r1,r11 800f8d4: f8 00 20 b2 calli 8017b9c 800f8d8: b8 20 78 00 mv r15,r1 if ( rc != RC_OK ) 800f8dc: 5c 20 00 0e bne r1,r0,800f914 <== NEVER TAKEN { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); 800f8e0: b9 60 08 00 mv r1,r11 800f8e4: f8 00 01 32 calli 800fdac } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 800f8e8: 2b 81 00 30 lw r1,(sp+48) 800f8ec: 44 20 00 0f be r1,r0,800f928 <== NEVER TAKEN { fat_fd->map.last_cln = last_cl; 800f8f0: 2b 81 00 34 lw r1,(sp+52) if (fat_fd->fat_file_type == FAT_DIRECTORY) 800f8f4: 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; 800f8f8: 59 81 00 3c sw (r12+60),r1 if (fat_fd->fat_file_type == FAT_DIRECTORY) 800f8fc: 5e 00 00 0b bne r16,r0,800f928 { rc = fat_init_clusters_chain(fs_info, chain); 800f900: 2b 82 00 3c lw r2,(sp+60) 800f904: b9 60 08 00 mv r1,r11 800f908: f8 00 05 d6 calli 8011060 800f90c: b8 20 78 00 mv r15,r1 if ( rc != RC_OK ) 800f910: 44 30 00 06 be r1,r16,800f928 <== ALWAYS TAKEN { fat_free_fat_clusters_chain(fs_info, chain); 800f914: 2b 82 00 3c lw r2,(sp+60) <== NOT EXECUTED 800f918: b9 60 08 00 mv r1,r11 <== NOT EXECUTED return rc; 800f91c: 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); 800f920: f8 00 21 71 calli 8017ee4 <== NOT EXECUTED return rc; 800f924: e0 00 00 03 bi 800f930 <== NOT EXECUTED } } } *a_length = new_length; 800f928: 5a 4e 00 00 sw (r18+0),r14 fat_fd->fat_file_size = new_length; 800f92c: 59 8e 00 18 sw (r12+24),r14 return RC_OK; } 800f930: b9 a0 08 00 mv r1,r13 800f934: 2b 9d 00 04 lw ra,(sp+4) 800f938: 2b 8b 00 28 lw r11,(sp+40) 800f93c: 2b 8c 00 24 lw r12,(sp+36) 800f940: 2b 8d 00 20 lw r13,(sp+32) 800f944: 2b 8e 00 1c lw r14,(sp+28) 800f948: 2b 8f 00 18 lw r15,(sp+24) 800f94c: 2b 90 00 14 lw r16,(sp+20) 800f950: 2b 91 00 10 lw r17,(sp+16) 800f954: 2b 92 00 0c lw r18,(sp+12) 800f958: 2b 93 00 08 lw r19,(sp+8) 800f95c: 37 9c 00 3c addi sp,sp,60 800f960: c3 a0 00 00 ret =============================================================================== 0800f638 : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 800f638: 37 9c ff d4 addi sp,sp,-44 800f63c: 5b 8b 00 10 sw (sp+16),r11 800f640: 5b 8c 00 0c sw (sp+12),r12 800f644: 5b 8d 00 08 sw (sp+8),r13 800f648: 5b 9d 00 04 sw (sp+4),ra 800f64c: b8 20 60 00 mv r12,r1 800f650: 5b 83 00 18 sw (sp+24),r3 800f654: 5b 84 00 1c sw (sp+28),r4 800f658: 5b 85 00 20 sw (sp+32),r5 800f65c: 5b 86 00 24 sw (sp+36),r6 800f660: 5b 87 00 28 sw (sp+40),r7 800f664: 5b 88 00 2c sw (sp+44),r8 int rc = RC_OK; uint32_t cur_cln = 0; 800f668: 5b 80 00 14 sw (sp+20),r0 uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 800f66c: 34 01 00 01 mvi r1,1 fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 800f670: b8 40 58 00 mv r11,r2 uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 800f674: 5c 61 00 1d bne r3,r1,800f6e8 <== 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 ) { 800f678: 28 42 00 18 lw r2,(r2+24) va_start(ap, cmd); switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); 800f67c: b8 80 08 00 mv r1,r4 ret = va_arg(ap, uint32_t *); 800f680: b8 a0 68 00 mv r13,r5 /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 800f684: 54 44 00 04 bgu r2,r4,800f694 <== ALWAYS TAKEN va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); 800f688: f8 00 28 e1 calli 8019a0c <__errno> <== NOT EXECUTED 800f68c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 800f690: e0 00 00 18 bi 800f6f0 <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 800f694: 29 62 00 20 lw r2,(r11+32) 800f698: 5c 43 00 09 bne r2,r3,800f6bc 800f69c: 29 62 00 24 lw r2,(r11+36) 800f6a0: 5c 40 00 07 bne r2,r0,800f6bc <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 800f6a4: 41 83 00 0e lbu r3,(r12+14) 800f6a8: 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)) && 800f6ac: 44 62 00 04 be r3,r2,800f6bc (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { /* cluster 0 (zero) reserved for root dir */ *ret = 0; 800f6b0: 58 a0 00 00 sw (r5+0),r0 rc = RC_OK; 800f6b4: 34 01 00 00 mvi r1,0 break; 800f6b8: e0 00 00 10 bi 800f6f8 } cl_start = pos >> fs_info->vol.bpc_log2; 800f6bc: 41 82 00 08 lbu r2,(r12+8) 800f6c0: f8 00 72 d4 calli 802c210 <__lshrsi3> 800f6c4: b8 20 18 00 mv r3,r1 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 800f6c8: b9 60 10 00 mv r2,r11 800f6cc: b9 80 08 00 mv r1,r12 800f6d0: 37 84 00 14 addi r4,sp,20 800f6d4: fb ff fe 3f calli 800efd0 if ( rc != RC_OK ) 800f6d8: 5c 20 00 08 bne r1,r0,800f6f8 <== NEVER TAKEN break; *ret = cur_cln; 800f6dc: 2b 82 00 14 lw r2,(sp+20) 800f6e0: 59 a2 00 00 sw (r13+0),r2 break; 800f6e4: e0 00 00 05 bi 800f6f8 default: errno = EINVAL; 800f6e8: f8 00 28 c9 calli 8019a0c <__errno> <== NOT EXECUTED 800f6ec: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 800f6f0: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rc = -1; 800f6f4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED break; } va_end(ap); return rc; } 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 2c addi sp,sp,44 800f70c: c3 a0 00 00 ret =============================================================================== 0800efd0 : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 800efd0: 37 9c ff e0 addi sp,sp,-32 800efd4: 5b 8b 00 1c sw (sp+28),r11 800efd8: 5b 8c 00 18 sw (sp+24),r12 800efdc: 5b 8d 00 14 sw (sp+20),r13 800efe0: 5b 8e 00 10 sw (sp+16),r14 800efe4: 5b 8f 00 0c sw (sp+12),r15 800efe8: 5b 90 00 08 sw (sp+8),r16 800efec: 5b 9d 00 04 sw (sp+4),ra 800eff0: b8 40 58 00 mv r11,r2 int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 800eff4: 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 ) { 800eff8: b8 20 80 00 mv r16,r1 800effc: b8 60 60 00 mv r12,r3 800f000: b8 80 70 00 mv r14,r4 int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 800f004: 5c 62 00 04 bne r3,r2,800f014 *disk_cln = fat_fd->map.disk_cln; 800f008: 29 61 00 38 lw r1,(r11+56) 800f00c: 58 81 00 00 sw (r4+0),r1 800f010: e0 00 00 15 bi 800f064 { uint32_t cur_cln; uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) 800f014: 50 43 00 05 bgeu r2,r3,800f028 { cur_cln = fat_fd->map.disk_cln; 800f018: 29 61 00 38 lw r1,(r11+56) count = file_cln - fat_fd->map.file_cln; 800f01c: 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; 800f020: 5b 81 00 20 sw (sp+32),r1 800f024: e0 00 00 04 bi 800f034 count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; 800f028: 29 61 00 1c lw r1,(r11+28) 800f02c: b8 60 78 00 mv r15,r3 800f030: 5b 81 00 20 sw (sp+32),r1 count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 800f034: 34 0d 00 00 mvi r13,0 800f038: e0 00 00 06 bi 800f050 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 800f03c: ba 00 08 00 mv r1,r16 800f040: 37 83 00 20 addi r3,sp,32 800f044: f8 00 22 4b calli 8017970 if ( rc != RC_OK ) 800f048: 5c 20 00 08 bne r1,r0,800f068 <== NEVER TAKEN cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 800f04c: 35 ad 00 01 addi r13,r13,1 800f050: 2b 82 00 20 lw r2,(sp+32) 800f054: 55 ed ff fa bgu r15,r13,800f03c if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; 800f058: 59 6c 00 34 sw (r11+52),r12 fat_fd->map.disk_cln = cur_cln; 800f05c: 59 62 00 38 sw (r11+56),r2 *disk_cln = cur_cln; 800f060: 59 c2 00 00 sw (r14+0),r2 } return RC_OK; 800f064: 34 01 00 00 mvi r1,0 } 800f068: 2b 9d 00 04 lw ra,(sp+4) 800f06c: 2b 8b 00 1c lw r11,(sp+28) 800f070: 2b 8c 00 18 lw r12,(sp+24) 800f074: 2b 8d 00 14 lw r13,(sp+20) 800f078: 2b 8e 00 10 lw r14,(sp+16) 800f07c: 2b 8f 00 0c lw r15,(sp+12) 800f080: 2b 90 00 08 lw r16,(sp+8) 800f084: 37 9c 00 20 addi sp,sp,32 800f088: c3 a0 00 00 ret =============================================================================== 0800f08c : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 800f08c: 37 9c ff e0 addi sp,sp,-32 800f090: 5b 8b 00 1c sw (sp+28),r11 800f094: 5b 8c 00 18 sw (sp+24),r12 800f098: 5b 8d 00 14 sw (sp+20),r13 800f09c: 5b 8e 00 10 sw (sp+16),r14 800f0a0: 5b 8f 00 0c sw (sp+12),r15 800f0a4: 5b 90 00 08 sw (sp+8),r16 800f0a8: 5b 9d 00 04 sw (sp+4),ra 800f0ac: b8 20 68 00 mv r13,r1 800f0b0: b8 40 60 00 mv r12,r2 800f0b4: b8 60 78 00 mv r15,r3 int rc = RC_OK; fat_file_fd_t *lfat_fd = NULL; 800f0b8: 5b 80 00 20 sw (sp+32),r0 uint32_t key = 0; /* construct key */ key = fat_construct_key(fs_info, &dir_pos->sname); 800f0bc: fb ff ff 6b calli 800ee68 /* access "valid" hash table */ rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); 800f0c0: 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); 800f0c4: b8 20 70 00 mv r14,r1 /* access "valid" hash table */ rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); 800f0c8: b9 c0 18 00 mv r3,r14 800f0cc: b9 a0 08 00 mv r1,r13 800f0d0: 34 04 00 00 mvi r4,0 800f0d4: 37 85 00 20 addi r5,sp,32 800f0d8: fb ff ff 90 calli 800ef18 <_hash_search> 800f0dc: b8 20 10 00 mv r2,r1 if ( rc == RC_OK ) 800f0e0: 5c 20 00 07 bne r1,r0,800f0fc { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; 800f0e4: 2b 81 00 20 lw r1,(sp+32) lfat_fd->links_num++; 800f0e8: 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; 800f0ec: 59 e1 00 00 sw (r15+0),r1 lfat_fd->links_num++; 800f0f0: 34 63 00 01 addi r3,r3,1 800f0f4: 58 23 00 08 sw (r1+8),r3 return rc; 800f0f8: e0 00 00 3c bi 800f1e8 } /* access "removed-but-still-open" hash table */ rc = _hash_search(fs_info, fs_info->rhash, key, key, &lfat_fd); 800f0fc: 29 a2 00 70 lw r2,(r13+112) 800f100: b9 c0 18 00 mv r3,r14 800f104: b9 c0 20 00 mv r4,r14 800f108: 37 85 00 20 addi r5,sp,32 800f10c: b9 a0 08 00 mv r1,r13 800f110: fb ff ff 82 calli 800ef18 <_hash_search> 800f114: b8 20 80 00 mv r16,r1 lfat_fd = (*fat_fd) = (fat_file_fd_t*)malloc(sizeof(fat_file_fd_t)); 800f118: 34 01 00 44 mvi r1,68 800f11c: fb ff d1 42 calli 8003624 800f120: 59 e1 00 00 sw (r15+0),r1 800f124: 5b 81 00 20 sw (sp+32),r1 800f128: b8 20 58 00 mv r11,r1 if ( lfat_fd == NULL ) 800f12c: 44 20 00 1e be r1,r0,800f1a4 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 800f130: 34 02 00 00 mvi r2,0 800f134: 34 03 00 44 mvi r3,68 800f138: f8 00 2d c4 calli 801a848 lfat_fd->links_num = 1; 800f13c: 34 01 00 01 mvi r1,1 800f140: 59 61 00 08 sw (r11+8),r1 lfat_fd->flags &= ~FAT_FILE_REMOVED; 800f144: 41 61 00 30 lbu r1,(r11+48) lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; 800f148: 29 84 00 00 lw r4,(r12+0) 800f14c: 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; 800f150: 20 21 00 fe andi r1,r1,0xfe 800f154: 31 61 00 30 sb (r11+48),r1 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 800f158: 34 01 ff ff mvi r1,-1 800f15c: 59 61 00 3c sw (r11+60),r1 lfat_fd->dir_pos = *dir_pos; 800f160: 29 82 00 08 lw r2,(r12+8) 800f164: 29 81 00 0c lw r1,(r12+12) 800f168: 59 64 00 20 sw (r11+32),r4 800f16c: 59 63 00 24 sw (r11+36),r3 800f170: 59 62 00 28 sw (r11+40),r2 800f174: 59 61 00 2c sw (r11+44),r1 if ( rc != RC_OK ) 800f178: 46 00 00 03 be r16,r0,800f184 <== NEVER TAKEN lfat_fd->ino = key; 800f17c: 59 6e 00 0c sw (r11+12),r14 800f180: e0 00 00 0e bi 800f1b8 else { lfat_fd->ino = fat_get_unique_ino(fs_info); 800f184: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 800f188: f8 00 07 d4 calli 80110d8 <== NOT EXECUTED 800f18c: 59 61 00 0c sw (r11+12),r1 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 800f190: 2b 81 00 20 lw r1,(sp+32) <== NOT EXECUTED 800f194: 28 21 00 0c lw r1,(r1+12) <== NOT EXECUTED 800f198: 5c 30 00 08 bne r1,r16,800f1b8 <== NOT EXECUTED { free((*fat_fd)); 800f19c: 29 e1 00 00 lw r1,(r15+0) <== NOT EXECUTED 800f1a0: fb ff cf 8b calli 8002fcc <== 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 ); 800f1a4: f8 00 2a 1a calli 8019a0c <__errno> <== NOT EXECUTED 800f1a8: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 800f1ac: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800f1b0: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 800f1b4: e0 00 00 0d bi 800f1e8 <== 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); 800f1b8: 21 ce 00 01 andi r14,r14,0x1 800f1bc: 34 02 00 01 mvi r2,1 800f1c0: b9 c0 08 00 mv r1,r14 800f1c4: fb ff c8 09 calli 80011e8 <__ashlsi3> 800f1c8: 34 02 00 02 mvi r2,2 800f1cc: b4 2e 08 00 add r1,r1,r14 800f1d0: fb ff c8 06 calli 80011e8 <__ashlsi3> 800f1d4: 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 ); 800f1d8: b4 41 08 00 add r1,r2,r1 800f1dc: 2b 82 00 20 lw r2,(sp+32) 800f1e0: fb ff db f4 calli 80061b0 <_Chain_Append> /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; 800f1e4: 34 02 00 00 mvi r2,0 } 800f1e8: b8 40 08 00 mv r1,r2 800f1ec: 2b 9d 00 04 lw ra,(sp+4) 800f1f0: 2b 8b 00 1c lw r11,(sp+28) 800f1f4: 2b 8c 00 18 lw r12,(sp+24) 800f1f8: 2b 8d 00 14 lw r13,(sp+20) 800f1fc: 2b 8e 00 10 lw r14,(sp+16) 800f200: 2b 8f 00 0c lw r15,(sp+12) 800f204: 2b 90 00 08 lw r16,(sp+8) 800f208: 37 9c 00 20 addi sp,sp,32 800f20c: c3 a0 00 00 ret =============================================================================== 0800f224 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 800f224: 37 9c ff d0 addi sp,sp,-48 800f228: 5b 8b 00 2c sw (sp+44),r11 800f22c: 5b 8c 00 28 sw (sp+40),r12 800f230: 5b 8d 00 24 sw (sp+36),r13 800f234: 5b 8e 00 20 sw (sp+32),r14 800f238: 5b 8f 00 1c sw (sp+28),r15 800f23c: 5b 90 00 18 sw (sp+24),r16 800f240: 5b 91 00 14 sw (sp+20),r17 800f244: 5b 92 00 10 sw (sp+16),r18 800f248: 5b 93 00 0c sw (sp+12),r19 800f24c: 5b 94 00 08 sw (sp+8),r20 800f250: 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; 800f254: 5b 80 00 30 sw (sp+48),r0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 800f258: b8 20 58 00 mv r11,r1 800f25c: b8 40 68 00 mv r13,r2 800f260: b8 60 70 00 mv r14,r3 800f264: b8 80 60 00 mv r12,r4 800f268: 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; 800f26c: 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) 800f270: 44 80 00 66 be r4,r0,800f408 <== NEVER TAKEN /* * >= because start is offset and computed from 0 and file_size * computed from 1 */ if ( start >= fat_fd->fat_file_size ) 800f274: 28 42 00 18 lw r2,(r2+24) 800f278: 50 62 00 64 bgeu r3,r2,800f408 return FAT_EOF; if ((count > fat_fd->fat_file_size) || 800f27c: 54 82 00 03 bgu r4,r2,800f288 <== NEVER TAKEN (start > fat_fd->fat_file_size - count)) 800f280: 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) || 800f284: 50 23 00 02 bgeu r1,r3,800f28c (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 800f288: c8 4e 60 00 sub r12,r2,r14 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 800f28c: 29 a2 00 20 lw r2,(r13+32) 800f290: 34 01 00 01 mvi r1,1 800f294: 5c 41 00 1c bne r2,r1,800f304 800f298: 29 a1 00 24 lw r1,(r13+36) 800f29c: 5c 20 00 1a bne r1,r0,800f304 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 800f2a0: 41 62 00 0e lbu r2,(r11+14) 800f2a4: 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)) && 800f2a8: 44 41 00 17 be r2,r1,800f304 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); 800f2ac: 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)) ) 800f2b0: 5c 20 00 03 bne r1,r0,800f2bc <== NEVER TAKEN return fs_info->vol.rdir_loc; 800f2b4: 29 6d 00 20 lw r13,(r11+32) 800f2b8: e0 00 00 06 bi 800f2d0 return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800f2bc: 41 62 00 05 lbu r2,(r11+5) <== NOT EXECUTED 800f2c0: 34 21 ff fe addi r1,r1,-2 <== NOT EXECUTED 800f2c4: fb ff c7 c9 calli 80011e8 <__ashlsi3> <== NOT EXECUTED 800f2c8: 29 6d 00 34 lw r13,(r11+52) <== NOT EXECUTED 800f2cc: b4 2d 68 00 add r13,r1,r13 <== NOT EXECUTED sec += (start >> fs_info->vol.sec_log2); 800f2d0: 41 62 00 02 lbu r2,(r11+2) 800f2d4: b9 c0 08 00 mv r1,r14 800f2d8: f8 00 73 ce calli 802c210 <__lshrsi3> byte = start & (fs_info->vol.bps - 1); 800f2dc: 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); 800f2e0: 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); 800f2e4: 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); 800f2e8: 34 63 ff ff addi r3,r3,-1 ret = _fat_block_read(fs_info, sec, byte, count, buf); 800f2ec: b9 60 08 00 mv r1,r11 800f2f0: a1 c3 18 00 and r3,r14,r3 800f2f4: ba 80 28 00 mv r5,r20 800f2f8: f8 00 03 6d calli 80100ac <_fat_block_read> if ( ret < 0 ) 800f2fc: 4c 20 00 43 bge r1,r0,800f408 <== ALWAYS TAKEN 800f300: e0 00 00 41 bi 800f404 <== NOT EXECUTED return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 800f304: 41 62 00 08 lbu r2,(r11+8) 800f308: b9 c0 08 00 mv r1,r14 800f30c: f8 00 73 c1 calli 802c210 <__lshrsi3> 800f310: 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); 800f314: b9 a0 10 00 mv r2,r13 800f318: b9 60 08 00 mv r1,r11 800f31c: ba 60 18 00 mv r3,r19 800f320: 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); 800f324: 2d 6f 00 06 lhu r15,(r11+6) rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 800f328: fb ff ff 2a calli 800efd0 if (rc != RC_OK) 800f32c: 5c 20 00 37 bne r1,r0,800f408 <== NEVER TAKEN return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 800f330: 35 e1 ff ff addi r1,r15,-1 800f334: a1 c1 70 00 and r14,r14,r1 800f338: b9 c0 88 00 mv r17,r14 800f33c: 34 12 00 00 mvi r18,0 800f340: 34 0f 00 00 mvi r15,0 800f344: e0 00 00 26 bi 800f3dc if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 800f348: 2d 70 00 06 lhu r16,(r11+6) 800f34c: ca 11 80 00 sub r16,r16,r17 800f350: 51 90 00 02 bgeu r12,r16,800f358 800f354: b9 80 80 00 mv r16,r12 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 800f358: 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)) ) 800f35c: 5c 40 00 06 bne r2,r0,800f374 <== ALWAYS TAKEN 800f360: 41 61 00 0e lbu r1,(r11+14) <== NOT EXECUTED 800f364: 20 21 00 03 andi r1,r1,0x3 <== NOT EXECUTED 800f368: 44 22 00 03 be r1,r2,800f374 <== NOT EXECUTED return fs_info->vol.rdir_loc; 800f36c: 29 72 00 20 lw r18,(r11+32) <== NOT EXECUTED 800f370: e0 00 00 06 bi 800f388 <== NOT EXECUTED return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800f374: 34 41 ff fe addi r1,r2,-2 800f378: 41 62 00 05 lbu r2,(r11+5) 800f37c: fb ff c7 9b calli 80011e8 <__ashlsi3> 800f380: 29 72 00 34 lw r18,(r11+52) 800f384: b4 32 90 00 add r18,r1,r18 sec += (ofs >> fs_info->vol.sec_log2); 800f388: 41 62 00 02 lbu r2,(r11+2) 800f38c: ba 20 08 00 mv r1,r17 800f390: f8 00 73 a0 calli 802c210 <__lshrsi3> byte = ofs & (fs_info->vol.bps - 1); 800f394: 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); 800f398: 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); 800f39c: 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); 800f3a0: 34 63 ff ff addi r3,r3,-1 ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 800f3a4: b9 60 08 00 mv r1,r11 800f3a8: a2 23 18 00 and r3,r17,r3 800f3ac: b6 8f 28 00 add r5,r20,r15 800f3b0: f8 00 03 3f calli 80100ac <_fat_block_read> if ( ret < 0 ) 800f3b4: 48 01 00 14 bg r0,r1,800f404 <== NEVER TAKEN return -1; count -= c; cmpltd += c; save_cln = cur_cln; 800f3b8: 2b 92 00 30 lw r18,(sp+48) rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 800f3bc: b9 60 08 00 mv r1,r11 800f3c0: 37 83 00 30 addi r3,sp,48 800f3c4: ba 40 10 00 mv r2,r18 800f3c8: f8 00 21 6a calli 8017970 if ( rc != RC_OK ) 800f3cc: 5c 20 00 0f bne r1,r0,800f408 <== NEVER TAKEN ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) return -1; count -= c; 800f3d0: c9 90 60 00 sub r12,r12,r16 cmpltd += c; 800f3d4: 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; 800f3d8: 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) 800f3dc: 5d 80 ff db bne r12,r0,800f348 } /* 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); 800f3e0: 41 62 00 08 lbu r2,(r11+8) 800f3e4: 35 ce ff ff addi r14,r14,-1 800f3e8: b5 cf 08 00 add r1,r14,r15 800f3ec: f8 00 73 89 calli 802c210 <__lshrsi3> ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 800f3f0: b4 33 08 00 add r1,r1,r19 800f3f4: 59 a1 00 34 sw (r13+52),r1 ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; 800f3f8: 59 b2 00 38 sw (r13+56),r18 return cmpltd; 800f3fc: b9 e0 08 00 mv r1,r15 800f400: e0 00 00 02 bi 800f408 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; 800f404: 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; } 800f408: 2b 9d 00 04 lw ra,(sp+4) 800f40c: 2b 8b 00 2c lw r11,(sp+44) 800f410: 2b 8c 00 28 lw r12,(sp+40) 800f414: 2b 8d 00 24 lw r13,(sp+36) 800f418: 2b 8e 00 20 lw r14,(sp+32) 800f41c: 2b 8f 00 1c lw r15,(sp+28) 800f420: 2b 90 00 18 lw r16,(sp+24) 800f424: 2b 91 00 14 lw r17,(sp+20) 800f428: 2b 92 00 10 lw r18,(sp+16) 800f42c: 2b 93 00 0c lw r19,(sp+12) 800f430: 2b 94 00 08 lw r20,(sp+8) 800f434: 37 9c 00 30 addi sp,sp,48 800f438: c3 a0 00 00 ret =============================================================================== 0800fc74 : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 800fc74: 37 9c ff ec addi sp,sp,-20 800fc78: 5b 8b 00 10 sw (sp+16),r11 800fc7c: 5b 8c 00 0c sw (sp+12),r12 800fc80: 5b 8d 00 08 sw (sp+8),r13 800fc84: 5b 9d 00 04 sw (sp+4),ra 800fc88: b8 20 60 00 mv r12,r1 int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 800fc8c: 28 41 00 1c lw r1,(r2+28) int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 800fc90: 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)) && 800fc94: 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; 800fc98: 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)) && 800fc9c: 34 01 00 01 mvi r1,1 800fca0: 5c 41 00 09 bne r2,r1,800fcc4 800fca4: 29 61 00 24 lw r1,(r11+36) 800fca8: 5c 20 00 07 bne r1,r0,800fcc4 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 800fcac: 41 82 00 0e lbu r2,(r12+14) 800fcb0: 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)) && 800fcb4: 44 41 00 04 be r2,r1,800fcc4 <== ALWAYS TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { fat_fd->fat_file_size = fs_info->vol.rdir_size; 800fcb8: 29 81 00 2c lw r1,(r12+44) <== NOT EXECUTED 800fcbc: 59 61 00 18 sw (r11+24),r1 <== NOT EXECUTED 800fcc0: e0 00 00 14 bi 800fd10 <== NOT EXECUTED return rc; } fat_fd->fat_file_size = 0; 800fcc4: 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; 800fcc8: 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) 800fccc: e0 00 00 0b bi 800fcf8 { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 800fcd0: b9 80 08 00 mv r1,r12 800fcd4: b9 a0 10 00 mv r2,r13 800fcd8: 37 83 00 14 addi r3,sp,20 800fcdc: f8 00 1f 25 calli 8017970 if ( rc != RC_OK ) 800fce0: 5c 20 00 0d bne r1,r0,800fd14 <== NEVER TAKEN return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 800fce4: 2d 81 00 06 lhu r1,(r12+6) 800fce8: 29 62 00 18 lw r2,(r11+24) 800fcec: b4 41 08 00 add r1,r2,r1 800fcf0: 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; 800fcf4: 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) 800fcf8: 2b 8d 00 14 lw r13,(sp+20) 800fcfc: 29 82 00 10 lw r2,(r12+16) 800fd00: 29 83 00 14 lw r3,(r12+20) 800fd04: a1 a2 10 00 and r2,r13,r2 800fd08: 54 62 ff f2 bgu r3,r2,800fcd0 if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; 800fd0c: 59 61 00 3c sw (r11+60),r1 return rc; 800fd10: 34 01 00 00 mvi r1,0 } 800fd14: 2b 9d 00 04 lw ra,(sp+4) 800fd18: 2b 8b 00 10 lw r11,(sp+16) 800fd1c: 2b 8c 00 0c lw r12,(sp+12) 800fd20: 2b 8d 00 08 lw r13,(sp+8) 800fd24: 37 9c 00 14 addi sp,sp,20 800fd28: c3 a0 00 00 ret =============================================================================== 0800f43c : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 800f43c: 37 9c ff e0 addi sp,sp,-32 800f440: 5b 8b 00 18 sw (sp+24),r11 800f444: 5b 8c 00 14 sw (sp+20),r12 800f448: 5b 8d 00 10 sw (sp+16),r13 800f44c: 5b 8e 00 0c sw (sp+12),r14 800f450: 5b 8f 00 08 sw (sp+8),r15 800f454: 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 ) 800f458: 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 ) { 800f45c: 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; 800f460: 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; 800f464: 5b 80 00 20 sw (sp+32),r0 uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 800f468: 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 ) { 800f46c: 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 ) 800f470: 50 6e 00 36 bgeu r3,r14,800f548 return rc; assert(fat_fd->fat_file_size); 800f474: 5d c0 00 09 bne r14,r0,800f498 <== ALWAYS TAKEN 800f478: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 800f47c: 78 03 08 02 mvhi r3,0x802 <== NOT EXECUTED 800f480: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED 800f484: 38 21 d4 b8 ori r1,r1,0xd4b8 <== NOT EXECUTED 800f488: 34 02 02 d1 mvi r2,721 <== NOT EXECUTED 800f48c: 38 63 d5 18 ori r3,r3,0xd518 <== NOT EXECUTED 800f490: 38 84 d5 00 ori r4,r4,0xd500 <== NOT EXECUTED 800f494: f8 00 09 c8 calli 8011bb4 <__assert_func> <== NOT EXECUTED cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; 800f498: 2d 81 00 06 lhu r1,(r12+6) 800f49c: 41 8f 00 08 lbu r15,(r12+8) 800f4a0: 34 21 ff ff addi r1,r1,-1 800f4a4: b4 23 08 00 add r1,r1,r3 800f4a8: b9 e0 10 00 mv r2,r15 800f4ac: f8 00 73 59 calli 802c210 <__lshrsi3> if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 800f4b0: 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; 800f4b4: b8 20 68 00 mv r13,r1 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 800f4b8: fb ff c7 4c calli 80011e8 <__ashlsi3> return RC_OK; 800f4bc: 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) 800f4c0: 50 2e 00 23 bgeu r1,r14,800f54c return RC_OK; if (cl_start != 0) 800f4c4: 45 a0 00 08 be r13,r0,800f4e4 { rc = fat_file_lseek(fs_info, fat_fd, cl_start - 1, &new_last_cln); 800f4c8: 37 84 00 1c addi r4,sp,28 800f4cc: b9 80 08 00 mv r1,r12 800f4d0: b9 60 10 00 mv r2,r11 800f4d4: 35 a3 ff ff addi r3,r13,-1 800f4d8: fb ff fe be calli 800efd0 800f4dc: b8 20 20 00 mv r4,r1 if (rc != RC_OK) 800f4e0: 5c 20 00 1b bne r1,r0,800f54c <== NEVER TAKEN return rc; } rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 800f4e4: 37 84 00 20 addi r4,sp,32 800f4e8: b9 80 08 00 mv r1,r12 800f4ec: b9 60 10 00 mv r2,r11 800f4f0: b9 a0 18 00 mv r3,r13 800f4f4: fb ff fe b7 calli 800efd0 800f4f8: b8 20 20 00 mv r4,r1 if (rc != RC_OK) 800f4fc: 5c 20 00 14 bne r1,r0,800f54c <== NEVER TAKEN return rc; rc = fat_free_fat_clusters_chain(fs_info, cur_cln); 800f500: 2b 82 00 20 lw r2,(sp+32) 800f504: b9 80 08 00 mv r1,r12 800f508: f8 00 22 77 calli 8017ee4 800f50c: b8 20 20 00 mv r4,r1 if (rc != RC_OK) 800f510: 5c 20 00 0f bne r1,r0,800f54c <== NEVER TAKEN return rc; if (cl_start != 0) 800f514: 45 a1 00 0e be r13,r1,800f54c { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); 800f518: 2b 82 00 1c lw r2,(sp+28) 800f51c: b9 80 08 00 mv r1,r12 800f520: 34 03 ff ff mvi r3,-1 800f524: f8 00 21 9e calli 8017b9c 800f528: b8 20 20 00 mv r4,r1 if ( rc != RC_OK ) 800f52c: 5c 20 00 08 bne r1,r0,800f54c <== NEVER TAKEN return rc; fat_fd->map.file_cln = cl_start - 1; fat_fd->map.disk_cln = new_last_cln; 800f530: 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; 800f534: 35 ad ff ff addi r13,r13,-1 800f538: 59 6d 00 34 sw (r11+52),r13 fat_fd->map.disk_cln = new_last_cln; 800f53c: 59 61 00 38 sw (r11+56),r1 fat_fd->map.last_cln = new_last_cln; 800f540: 59 61 00 3c sw (r11+60),r1 800f544: e0 00 00 02 bi 800f54c uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; if ( new_length >= fat_fd->fat_file_size ) return rc; 800f548: 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; } 800f54c: b8 80 08 00 mv r1,r4 800f550: 2b 9d 00 04 lw ra,(sp+4) 800f554: 2b 8b 00 18 lw r11,(sp+24) 800f558: 2b 8c 00 14 lw r12,(sp+20) 800f55c: 2b 8d 00 10 lw r13,(sp+16) 800f560: 2b 8e 00 0c lw r14,(sp+12) 800f564: 2b 8f 00 08 lw r15,(sp+8) 800f568: 37 9c 00 20 addi sp,sp,32 800f56c: c3 a0 00 00 ret =============================================================================== 0800f964 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 800f964: 37 9c ff b8 addi sp,sp,-72 800f968: 5b 8b 00 40 sw (sp+64),r11 800f96c: 5b 8c 00 3c sw (sp+60),r12 800f970: 5b 8d 00 38 sw (sp+56),r13 800f974: 5b 8e 00 34 sw (sp+52),r14 800f978: 5b 8f 00 30 sw (sp+48),r15 800f97c: 5b 90 00 2c sw (sp+44),r16 800f980: 5b 91 00 28 sw (sp+40),r17 800f984: 5b 92 00 24 sw (sp+36),r18 800f988: 5b 93 00 20 sw (sp+32),r19 800f98c: 5b 94 00 1c sw (sp+28),r20 800f990: 5b 95 00 18 sw (sp+24),r21 800f994: 5b 96 00 14 sw (sp+20),r22 800f998: 5b 97 00 10 sw (sp+16),r23 800f99c: 5b 98 00 0c sw (sp+12),r24 800f9a0: 5b 99 00 08 sw (sp+8),r25 800f9a4: 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; 800f9a8: 5b 80 00 48 sw (sp+72),r0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 800f9ac: b8 40 58 00 mv r11,r2 800f9b0: 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; 800f9b4: 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; 800f9b8: 28 43 00 18 lw r3,(r2+24) fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 800f9bc: b8 20 60 00 mv r12,r1 800f9c0: 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; 800f9c4: 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 ) 800f9c8: 44 80 00 69 be r4,r0,800fb6c <== NEVER TAKEN return cmpltd; if (start >= fat_fd->size_limit) 800f9cc: 29 6d 00 14 lw r13,(r11+20) 800f9d0: 55 ae 00 06 bgu r13,r14,800f9e8 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EFBIG); 800f9d4: f8 00 28 0e calli 8019a0c <__errno> <== NOT EXECUTED 800f9d8: 34 02 00 1b mvi r2,27 <== NOT EXECUTED 800f9dc: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800f9e0: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 800f9e4: e0 00 00 62 bi 800fb6c <== NOT EXECUTED if (count > fat_fd->size_limit - start) 800f9e8: 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); 800f9ec: 50 8d 00 02 bgeu r4,r13,800f9f4 <== NEVER TAKEN 800f9f0: 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); 800f9f4: b5 ae 78 00 add r15,r13,r14 800f9f8: f5 c3 18 00 cmpgu r3,r14,r3 800f9fc: b9 60 10 00 mv r2,r11 800fa00: b9 80 08 00 mv r1,r12 800fa04: b9 e0 20 00 mv r4,r15 800fa08: 37 85 00 48 addi r5,sp,72 800fa0c: fb ff ff 41 calli 800f710 800fa10: b8 20 10 00 mv r2,r1 if (RC_OK == rc) 800fa14: 5c 20 00 56 bne r1,r0,800fb6c { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) 800fa18: 2b 81 00 48 lw r1,(sp+72) 800fa1c: 44 2f 00 02 be r1,r15,800fa24 <== ALWAYS TAKEN count = c - start; 800fa20: 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)); 800fa24: 29 63 00 20 lw r3,(r11+32) 800fa28: 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)) 800fa2c: 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)); 800fa30: 5c 61 00 62 bne r3,r1,800fbb8 800fa34: 29 61 00 24 lw r1,(r11+36) 800fa38: 5c 20 00 60 bne r1,r0,800fbb8 <== NEVER TAKEN 800fa3c: 20 42 00 03 andi r2,r2,0x3 800fa40: 44 41 00 5e be r2,r1,800fbb8 /* 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); 800fa44: 41 82 00 08 lbu r2,(r12+8) 800fa48: 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; 800fa4c: 29 6b 00 1c lw r11,(r11+28) cln += (start >> fs_info->vol.bpc_log2); 800fa50: f8 00 71 f0 calli 802c210 <__lshrsi3> byte = start & (fs_info->vol.bpc -1); 800fa54: 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); 800fa58: b4 2b 10 00 add r2,r1,r11 byte = start & (fs_info->vol.bpc -1); ret = fat_cluster_write(fs_info, 800fa5c: 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); 800fa60: 34 63 ff ff addi r3,r3,-1 ret = fat_cluster_write(fs_info, 800fa64: b9 80 08 00 mv r1,r12 800fa68: a1 c3 18 00 and r3,r14,r3 800fa6c: ba c0 28 00 mv r5,r22 800fa70: 34 06 00 00 mvi r6,0 800fa74: f8 00 02 6a calli 801041c byte, count, buf, false); if (0 > ret) rc = -1; 800fa78: 34 02 ff ff mvi r2,-1 cln, byte, count, buf, false); if (0 > ret) 800fa7c: 48 01 00 3c bg r0,r1,800fb6c <== NEVER TAKEN rc = -1; else cmpltd = ret; 800fa80: b8 20 10 00 mv r2,r1 800fa84: e0 00 00 3a bi 800fb6c 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); 800fa88: b9 e0 10 00 mv r2,r15 800fa8c: ba 20 08 00 mv r1,r17 800fa90: fb ff c5 d6 calli 80011e8 <__ashlsi3> 800fa94: 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; 800fa98: 2b 94 00 44 lw r20,(sp+68) 800fa9c: 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); 800faa0: 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; 800faa4: 34 10 00 00 mvi r16,0 800faa8: 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; 800faac: 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 */ 800fab0: 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; 800fab4: 34 0f 00 00 mvi r15,0 800fab8: e0 00 00 1c bi 800fb28 { 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)); 800fabc: 2d 84 00 06 lhu r4,(r12+6) 800fac0: c8 93 20 00 sub r4,r4,r19 800fac4: 51 a4 00 02 bgeu r13,r4,800facc 800fac8: b9 a0 20 00 mv r4,r13 if (file_cln_initial < file_cln_cnt) 800facc: 56 99 00 02 bgu r20,r25,800fad4 800fad0: e0 00 00 02 bi 800fad8 overwrite_cluster = true; 800fad4: 34 18 00 01 mvi r24,1 ret = fat_cluster_write(fs_info, 800fad8: 2b 82 00 44 lw r2,(sp+68) 800fadc: b9 80 08 00 mv r1,r12 800fae0: ba 60 18 00 mv r3,r19 800fae4: b6 cf 28 00 add r5,r22,r15 800fae8: bb 00 30 00 mv r6,r24 800faec: f8 00 02 4c calli 801041c cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 800faf0: 34 10 ff ff mvi r16,-1 800faf4: 48 01 00 0d bg r0,r1,800fb28 <== NEVER TAKEN rc = -1; if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; 800faf8: c9 a1 68 00 sub r13,r13,r1 if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 800fafc: 36 94 00 01 addi r20,r20,1 bytes_to_write -= ret; cmpltd += ret; 800fb00: b5 e1 78 00 add r15,r15,r1 save_cln = cur_cln; 800fb04: 2b 92 00 44 lw r18,(sp+68) if (0 < bytes_to_write) 800fb08: 34 10 00 00 mvi r16,0 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ofs_cln = 0; 800fb0c: 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) 800fb10: 45 a0 00 06 be r13,r0,800fb28 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 800fb14: b9 80 08 00 mv r1,r12 800fb18: ba 40 10 00 mv r2,r18 800fb1c: ba a0 18 00 mv r3,r21 800fb20: f8 00 1f 94 calli 8017970 800fb24: 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)) 800fb28: 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) 800fb2c: 66 01 00 00 cmpei r1,r16,0 800fb30: a2 e1 b8 00 and r23,r23,r1 800fb34: 5e e0 ff e2 bne r23,r0,800fabc } /* 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); 800fb38: 41 82 00 08 lbu r2,(r12+8) 800fb3c: 35 ce ff ff addi r14,r14,-1 800fb40: b5 cf 08 00 add r1,r14,r15 800fb44: f8 00 71 b3 calli 802c210 <__lshrsi3> } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 800fb48: b4 31 08 00 add r1,r1,r17 800fb4c: 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; 800fb50: 59 72 00 38 sw (r11+56),r18 } if (RC_OK != rc) 800fb54: ba 00 30 00 mv r6,r16 800fb58: 5e 17 00 02 bne r16,r23,800fb60 <== NEVER TAKEN return rc; else return cmpltd; 800fb5c: b9 e0 30 00 mv r6,r15 start, count, buf, file_cln_initial); if (0 > ret) rc = -1; 800fb60: 34 02 ff ff mvi r2,-1 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 800fb64: 48 06 00 02 bg r0,r6,800fb6c <== NEVER TAKEN rc = -1; else cmpltd = ret; 800fb68: b8 c0 10 00 mv r2,r6 } if (RC_OK != rc) return rc; else return cmpltd; } 800fb6c: b8 40 08 00 mv r1,r2 800fb70: 2b 9d 00 04 lw ra,(sp+4) 800fb74: 2b 8b 00 40 lw r11,(sp+64) 800fb78: 2b 8c 00 3c lw r12,(sp+60) 800fb7c: 2b 8d 00 38 lw r13,(sp+56) 800fb80: 2b 8e 00 34 lw r14,(sp+52) 800fb84: 2b 8f 00 30 lw r15,(sp+48) 800fb88: 2b 90 00 2c lw r16,(sp+44) 800fb8c: 2b 91 00 28 lw r17,(sp+40) 800fb90: 2b 92 00 24 lw r18,(sp+36) 800fb94: 2b 93 00 20 lw r19,(sp+32) 800fb98: 2b 94 00 1c lw r20,(sp+28) 800fb9c: 2b 95 00 18 lw r21,(sp+24) 800fba0: 2b 96 00 14 lw r22,(sp+20) 800fba4: 2b 97 00 10 lw r23,(sp+16) 800fba8: 2b 98 00 0c lw r24,(sp+12) 800fbac: 2b 99 00 08 lw r25,(sp+8) 800fbb0: 37 9c 00 48 addi sp,sp,72 800fbb4: 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; 800fbb8: 41 8f 00 08 lbu r15,(r12+8) 800fbbc: 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; 800fbc0: 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; 800fbc4: b9 e0 10 00 mv r2,r15 800fbc8: f8 00 71 92 calli 802c210 <__lshrsi3> 800fbcc: 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); 800fbd0: 37 95 00 44 addi r21,sp,68 800fbd4: b9 80 08 00 mv r1,r12 800fbd8: b9 60 10 00 mv r2,r11 800fbdc: ba 20 18 00 mv r3,r17 800fbe0: ba a0 20 00 mv r4,r21 800fbe4: fb ff fc fb calli 800efd0 800fbe8: b8 20 30 00 mv r6,r1 if (RC_OK == rc) 800fbec: 44 20 ff a7 be r1,r0,800fa88 <== ALWAYS TAKEN 800fbf0: e3 ff ff dc bi 800fb60 <== NOT EXECUTED =============================================================================== 08017ee4 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 8017ee4: 37 9c ff e0 addi sp,sp,-32 8017ee8: 5b 8b 00 1c sw (sp+28),r11 8017eec: 5b 8c 00 18 sw (sp+24),r12 8017ef0: 5b 8d 00 14 sw (sp+20),r13 8017ef4: 5b 8e 00 10 sw (sp+16),r14 8017ef8: 5b 8f 00 0c sw (sp+12),r15 8017efc: 5b 90 00 08 sw (sp+8),r16 8017f00: 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; 8017f04: 34 0d 00 00 mvi r13,0 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 8017f08: b8 20 58 00 mv r11,r1 8017f0c: b8 40 80 00 mv r16,r2 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 8017f10: 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; 8017f14: 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; 8017f18: 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) 8017f1c: e0 00 00 17 bi 8017f78 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 8017f20: b9 60 08 00 mv r1,r11 8017f24: b9 c0 10 00 mv r2,r14 8017f28: 37 83 00 20 addi r3,sp,32 8017f2c: fb ff fe 91 calli 8017970 8017f30: b8 20 60 00 mv r12,r1 if ( rc != RC_OK ) 8017f34: 44 20 00 09 be r1,r0,8017f58 <== ALWAYS TAKEN { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8017f38: 29 61 00 44 lw r1,(r11+68) <== NOT EXECUTED 8017f3c: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8017f40: 44 22 00 03 be r1,r2,8017f4c <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 8017f44: b5 a1 68 00 add r13,r13,r1 <== NOT EXECUTED 8017f48: 59 6d 00 44 sw (r11+68),r13 <== NOT EXECUTED fat_buf_release(fs_info); 8017f4c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8017f50: fb ff df 97 calli 800fdac <== NOT EXECUTED return rc; 8017f54: e0 00 00 16 bi 8017fac <== NOT EXECUTED } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 8017f58: b9 60 08 00 mv r1,r11 8017f5c: b9 c0 10 00 mv r2,r14 8017f60: 34 03 00 00 mvi r3,0 8017f64: fb ff ff 0e calli 8017b9c if ( rc != RC_OK ) 8017f68: 44 2c 00 02 be r1,r12,8017f70 <== ALWAYS TAKEN 8017f6c: b8 20 78 00 mv r15,r1 <== NOT EXECUTED rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; 8017f70: 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++; 8017f74: 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) 8017f78: 29 61 00 10 lw r1,(r11+16) 8017f7c: 29 62 00 14 lw r2,(r11+20) 8017f80: a1 c1 08 00 and r1,r14,r1 8017f84: 54 41 ff e7 bgu r2,r1,8017f20 freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8017f88: 29 61 00 44 lw r1,(r11+68) freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; 8017f8c: 59 70 00 4c sw (r11+76),r16 if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8017f90: 34 02 ff ff mvi r2,-1 8017f94: 44 22 00 03 be r1,r2,8017fa0 <== ALWAYS TAKEN fs_info->vol.free_cls += freed_cls_cnt; 8017f98: b5 a1 68 00 add r13,r13,r1 <== NOT EXECUTED 8017f9c: 59 6d 00 44 sw (r11+68),r13 <== NOT EXECUTED fat_buf_release(fs_info); 8017fa0: b9 60 08 00 mv r1,r11 8017fa4: fb ff df 82 calli 800fdac 8017fa8: b9 e0 60 00 mv r12,r15 if (rc1 != RC_OK) return rc1; return RC_OK; } 8017fac: b9 80 08 00 mv r1,r12 8017fb0: 2b 9d 00 04 lw ra,(sp+4) 8017fb4: 2b 8b 00 1c lw r11,(sp+28) 8017fb8: 2b 8c 00 18 lw r12,(sp+24) 8017fbc: 2b 8d 00 14 lw r13,(sp+20) 8017fc0: 2b 8e 00 10 lw r14,(sp+16) 8017fc4: 2b 8f 00 0c lw r15,(sp+12) 8017fc8: 2b 90 00 08 lw r16,(sp+8) 8017fcc: 37 9c 00 20 addi sp,sp,32 8017fd0: c3 a0 00 00 ret =============================================================================== 080111f8 : void fat_free_unique_ino( fat_fs_info_t *fs_info, uint32_t ino ) { 80111f8: 37 9c ff f4 addi sp,sp,-12 <== NOT EXECUTED 80111fc: 5b 8b 00 0c sw (sp+12),r11 <== NOT EXECUTED 8011200: 5b 8c 00 08 sw (sp+8),r12 <== NOT EXECUTED 8011204: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED FAT_SET_UNIQ_INO_FREE((ino - fs_info->uino_base), fs_info->uino); 8011208: 28 2c 00 80 lw r12,(r1+128) <== NOT EXECUTED void fat_free_unique_ino( fat_fs_info_t *fs_info, uint32_t ino ) { 801120c: b8 20 58 00 mv r11,r1 <== NOT EXECUTED FAT_SET_UNIQ_INO_FREE((ino - fs_info->uino_base), fs_info->uino); 8011210: c8 4c 60 00 sub r12,r2,r12 <== NOT EXECUTED 8011214: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8011218: 34 02 00 03 mvi r2,3 <== NOT EXECUTED 801121c: f8 00 6b fd calli 802c210 <__lshrsi3> <== NOT EXECUTED 8011220: 29 6b 00 74 lw r11,(r11+116) <== NOT EXECUTED 8011224: 21 82 00 07 andi r2,r12,0x7 <== NOT EXECUTED 8011228: b5 61 58 00 add r11,r11,r1 <== NOT EXECUTED 801122c: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8011230: fb ff bf ee calli 80011e8 <__ashlsi3> <== NOT EXECUTED 8011234: 41 62 00 00 lbu r2,(r11+0) <== NOT EXECUTED 8011238: a4 20 08 00 not r1,r1 <== NOT EXECUTED 801123c: a0 22 08 00 and r1,r1,r2 <== NOT EXECUTED 8011240: 31 61 00 00 sb (r11+0),r1 <== NOT EXECUTED } 8011244: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8011248: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED 801124c: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED 8011250: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 8011254: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08017970 : fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 8017970: 37 9c ff dc addi sp,sp,-36 8017974: 5b 8b 00 20 sw (sp+32),r11 8017978: 5b 8c 00 1c sw (sp+28),r12 801797c: 5b 8d 00 18 sw (sp+24),r13 8017980: 5b 8e 00 14 sw (sp+20),r14 8017984: 5b 8f 00 10 sw (sp+16),r15 8017988: 5b 90 00 0c sw (sp+12),r16 801798c: 5b 91 00 08 sw (sp+8),r17 8017990: 5b 9d 00 04 sw (sp+4),ra 8017994: 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)) ) 8017998: 34 01 00 01 mvi r1,1 fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 801799c: b8 40 60 00 mv r12,r2 80179a0: 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)) ) 80179a4: 50 22 00 6d bgeu r1,r2,8017b58 <== NEVER TAKEN 80179a8: 29 a1 00 38 lw r1,(r13+56) 80179ac: 34 21 00 01 addi r1,r1,1 80179b0: 50 22 00 02 bgeu r1,r2,80179b8 <== ALWAYS TAKEN 80179b4: e0 00 00 69 bi 8017b58 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 80179b8: 41 af 00 0e lbu r15,(r13+14) 80179bc: 21 ee 00 01 andi r14,r15,0x1 80179c0: 45 c0 00 06 be r14,r0,80179d8 80179c4: b8 40 08 00 mv r1,r2 80179c8: 34 02 00 01 mvi r2,1 80179cc: f8 00 52 11 calli 802c210 <__lshrsi3> 80179d0: b4 2c 08 00 add r1,r1,r12 80179d4: e0 00 00 09 bi 80179f8 80179d8: 21 e1 00 02 andi r1,r15,0x2 80179dc: 44 2e 00 04 be r1,r14,80179ec 80179e0: b8 40 08 00 mv r1,r2 80179e4: 34 02 00 01 mvi r2,1 80179e8: e0 00 00 03 bi 80179f4 80179ec: b8 40 08 00 mv r1,r2 80179f0: 34 02 00 02 mvi r2,2 80179f4: fb ff a5 fd calli 80011e8 <__ashlsi3> 80179f8: 41 a2 00 02 lbu r2,(r13+2) 80179fc: f8 00 52 05 calli 802c210 <__lshrsi3> 8017a00: 29 b0 00 58 lw r16,(r13+88) 8017a04: 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); 8017a08: 45 c0 00 06 be r14,r0,8017a20 8017a0c: b9 80 08 00 mv r1,r12 8017a10: 34 02 00 01 mvi r2,1 8017a14: f8 00 51 ff calli 802c210 <__lshrsi3> 8017a18: b4 2c 78 00 add r15,r1,r12 8017a1c: e0 00 00 09 bi 8017a40 8017a20: 21 ef 00 02 andi r15,r15,0x2 8017a24: b9 80 08 00 mv r1,r12 8017a28: 34 02 00 01 mvi r2,1 8017a2c: 5d ee 00 03 bne r15,r14,8017a38 8017a30: b9 80 08 00 mv r1,r12 8017a34: 34 02 00 02 mvi r2,2 8017a38: fb ff a5 ec calli 80011e8 <__ashlsi3> 8017a3c: b8 20 78 00 mv r15,r1 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 8017a40: b9 a0 08 00 mv r1,r13 8017a44: ba 00 10 00 mv r2,r16 8017a48: 34 03 00 01 mvi r3,1 8017a4c: 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); 8017a50: 2d b1 00 00 lhu r17,(r13+0) rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 8017a54: fb ff e1 54 calli 800ffa4 8017a58: b8 20 70 00 mv r14,r1 if (rc != RC_OK) 8017a5c: 5c 20 00 45 bne r1,r0,8017b70 <== NEVER TAKEN return rc; switch ( fs_info->vol.type ) 8017a60: 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); 8017a64: 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 ) 8017a68: 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); 8017a6c: 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 ) 8017a70: 44 81 00 27 be r4,r1,8017b0c 8017a74: 34 01 00 04 mvi r1,4 8017a78: 44 81 00 32 be r4,r1,8017b40 8017a7c: 34 01 00 01 mvi r1,1 8017a80: 5c 81 00 36 bne r4,r1,8017b58 <== 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)); 8017a84: 2b 84 00 24 lw r4,(sp+36) if ( ofs == (fs_info->vol.bps - 1) ) 8017a88: 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)); 8017a8c: b4 83 20 00 add r4,r4,r3 8017a90: 40 8f 00 00 lbu r15,(r4+0) if ( ofs == (fs_info->vol.bps - 1) ) 8017a94: 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)); 8017a98: 59 6f 00 00 sw (r11+0),r15 if ( ofs == (fs_info->vol.bps - 1) ) 8017a9c: 5c 61 00 0e bne r3,r1,8017ad4 <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 8017aa0: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8017aa4: 36 02 00 01 addi r2,r16,1 <== NOT EXECUTED 8017aa8: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8017aac: 37 84 00 24 addi r4,sp,36 <== NOT EXECUTED 8017ab0: fb ff e1 3d calli 800ffa4 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 8017ab4: 5c 20 00 2e bne r1,r0,8017b6c <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; 8017ab8: 2b 81 00 24 lw r1,(sp+36) <== NOT EXECUTED 8017abc: 34 02 00 08 mvi r2,8 <== NOT EXECUTED 8017ac0: 40 21 00 00 lbu r1,(r1+0) <== NOT EXECUTED 8017ac4: fb ff a5 c9 calli 80011e8 <__ashlsi3> <== NOT EXECUTED 8017ac8: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED 8017acc: b8 41 08 00 or r1,r2,r1 <== NOT EXECUTED 8017ad0: e0 00 00 05 bi 8017ae4 <== NOT EXECUTED } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 8017ad4: 40 81 00 01 lbu r1,(r4+1) 8017ad8: 34 02 00 08 mvi r2,8 8017adc: fb ff a5 c3 calli 80011e8 <__ashlsi3> 8017ae0: b8 2f 08 00 or r1,r1,r15 8017ae4: 59 61 00 00 sw (r11+0),r1 } if ( FAT_CLUSTER_IS_ODD(cln) ) 8017ae8: 21 8c 00 01 andi r12,r12,0x1 8017aec: 45 80 00 05 be r12,r0,8017b00 *ret_val = (*ret_val) >> FAT12_SHIFT; 8017af0: 29 61 00 00 lw r1,(r11+0) 8017af4: 34 02 00 04 mvi r2,4 8017af8: f8 00 51 c6 calli 802c210 <__lshrsi3> 8017afc: e0 00 00 15 bi 8017b50 else *ret_val = (*ret_val) & FAT_FAT12_MASK; 8017b00: 29 61 00 00 lw r1,(r11+0) 8017b04: 20 21 0f ff andi r1,r1,0xfff 8017b08: e0 00 00 12 bi 8017b50 break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 8017b0c: 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; 8017b10: 34 02 00 08 mvi r2,8 8017b14: b4 23 18 00 add r3,r1,r3 8017b18: 2c 6c 00 00 lhu r12,(r3+0) 8017b1c: b9 80 08 00 mv r1,r12 8017b20: fb ff a5 b2 calli 80011e8 <__ashlsi3> 8017b24: b8 20 68 00 mv r13,r1 8017b28: 34 02 00 08 mvi r2,8 8017b2c: b9 80 08 00 mv r1,r12 8017b30: f8 00 51 b8 calli 802c210 <__lshrsi3> 8017b34: b9 a1 08 00 or r1,r13,r1 *ret_val = CF_LE_W(*ret_val); 8017b38: 20 21 ff ff andi r1,r1,0xffff 8017b3c: e0 00 00 05 bi 8017b50 break; case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); 8017b40: 2b 81 00 24 lw r1,(sp+36) 8017b44: b4 23 18 00 add r3,r1,r3 *ret_val = CF_LE_L(*ret_val); 8017b48: 28 61 00 00 lw r1,(r3+0) 8017b4c: fb ff ff 69 calli 80178f0 8017b50: 59 61 00 00 sw (r11+0),r1 break; 8017b54: e0 00 00 07 bi 8017b70 default: rtems_set_errno_and_return_minus_one(EIO); 8017b58: f8 00 07 ad calli 8019a0c <__errno> <== NOT EXECUTED 8017b5c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8017b60: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8017b64: 34 0e ff ff mvi r14,-1 <== NOT EXECUTED 8017b68: e0 00 00 02 bi 8017b70 <== 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) 8017b6c: b8 20 70 00 mv r14,r1 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } 8017b70: b9 c0 08 00 mv r1,r14 8017b74: 2b 9d 00 04 lw ra,(sp+4) 8017b78: 2b 8b 00 20 lw r11,(sp+32) 8017b7c: 2b 8c 00 1c lw r12,(sp+28) 8017b80: 2b 8d 00 18 lw r13,(sp+24) 8017b84: 2b 8e 00 14 lw r14,(sp+20) 8017b88: 2b 8f 00 10 lw r15,(sp+16) 8017b8c: 2b 90 00 0c lw r16,(sp+12) 8017b90: 2b 91 00 08 lw r17,(sp+8) 8017b94: 37 9c 00 24 addi sp,sp,36 8017b98: c3 a0 00 00 ret =============================================================================== 080110d8 : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 80110d8: 37 9c ff dc addi sp,sp,-36 <== NOT EXECUTED 80110dc: 5b 8b 00 24 sw (sp+36),r11 <== NOT EXECUTED 80110e0: 5b 8c 00 20 sw (sp+32),r12 <== NOT EXECUTED 80110e4: 5b 8d 00 1c sw (sp+28),r13 <== NOT EXECUTED 80110e8: 5b 8e 00 18 sw (sp+24),r14 <== NOT EXECUTED 80110ec: 5b 8f 00 14 sw (sp+20),r15 <== NOT EXECUTED 80110f0: 5b 90 00 10 sw (sp+16),r16 <== NOT EXECUTED 80110f4: 5b 91 00 0c sw (sp+12),r17 <== NOT EXECUTED 80110f8: 5b 92 00 08 sw (sp+8),r18 <== NOT EXECUTED 80110fc: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 8011100: 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)) 8011104: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 8011108: 38 21 d5 2c ori r1,r1,0xd52c <== NOT EXECUTED 801110c: 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) 8011110: e0 00 00 2b bi 80111bc <== NOT EXECUTED { for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 8011114: 29 6e 00 78 lw r14,(r11+120) <== NOT EXECUTED 8011118: 34 02 00 03 mvi r2,3 <== NOT EXECUTED 801111c: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8011120: f8 00 6c 3c calli 802c210 <__lshrsi3> <== NOT EXECUTED 8011124: 29 6f 00 74 lw r15,(r11+116) <== NOT EXECUTED 8011128: 21 d1 00 07 andi r17,r14,0x7 <== NOT EXECUTED 801112c: ba 20 10 00 mv r2,r17 <== NOT EXECUTED 8011130: b5 e1 78 00 add r15,r15,r1 <== NOT EXECUTED 8011134: 41 f0 00 00 lbu r16,(r15+0) <== NOT EXECUTED 8011138: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 801113c: fb ff c0 52 calli 8001284 <__ashrsi3> <== NOT EXECUTED 8011140: 20 21 00 01 andi r1,r1,0x1 <== NOT EXECUTED 8011144: 5c 20 00 0a bne r1,r0,801116c <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); 8011148: ba 20 10 00 mv r2,r17 <== NOT EXECUTED 801114c: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8011150: fb ff c0 26 calli 80011e8 <__ashlsi3> <== NOT EXECUTED 8011154: b8 30 08 00 or r1,r1,r16 <== NOT EXECUTED 8011158: 31 e1 00 00 sb (r15+0),r1 <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 801115c: 29 62 00 78 lw r2,(r11+120) <== NOT EXECUTED 8011160: 29 61 00 80 lw r1,(r11+128) <== NOT EXECUTED 8011164: b4 41 08 00 add r1,r2,r1 <== NOT EXECUTED 8011168: e0 00 00 19 bi 80111cc <== NOT EXECUTED } fs_info->index++; 801116c: 35 ce 00 01 addi r14,r14,1 <== NOT EXECUTED 8011170: 59 6e 00 78 sw (r11+120),r14 <== NOT EXECUTED if (fs_info->index >= fs_info->uino_pool_size) 8011174: 55 ae 00 02 bgu r13,r14,801117c <== NOT EXECUTED fs_info->index = 0; 8011178: 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++) 801117c: 35 8c 00 01 addi r12,r12,1 <== NOT EXECUTED 8011180: 55 ac ff e5 bgu r13,r12,8011114 <== 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)) 8011184: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8011188: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 801118c: fb ff c0 17 calli 80011e8 <__ashlsi3> <== NOT EXECUTED 8011190: b8 20 10 00 mv r2,r1 <== NOT EXECUTED 8011194: 29 61 00 80 lw r1,(r11+128) <== NOT EXECUTED 8011198: ca 41 08 00 sub r1,r18,r1 <== NOT EXECUTED 801119c: 50 41 00 0b bgeu r2,r1,80111c8 <== NOT EXECUTED { fs_info->uino_pool_size <<= 1; fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); 80111a0: 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; 80111a4: 59 62 00 7c sw (r11+124),r2 <== NOT EXECUTED fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); 80111a8: fb ff cc 07 calli 80041c4 <== NOT EXECUTED 80111ac: 59 61 00 74 sw (r11+116),r1 <== NOT EXECUTED if (fs_info->uino != NULL) 80111b0: 44 20 00 06 be r1,r0,80111c8 <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; 80111b4: 29 61 00 7c lw r1,(r11+124) <== NOT EXECUTED 80111b8: 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++) 80111bc: 29 6d 00 7c lw r13,(r11+124) <== NOT EXECUTED 80111c0: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED 80111c4: e3 ff ff ef bi 8011180 <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 80111c8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED } 80111cc: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80111d0: 2b 8b 00 24 lw r11,(sp+36) <== NOT EXECUTED 80111d4: 2b 8c 00 20 lw r12,(sp+32) <== NOT EXECUTED 80111d8: 2b 8d 00 1c lw r13,(sp+28) <== NOT EXECUTED 80111dc: 2b 8e 00 18 lw r14,(sp+24) <== NOT EXECUTED 80111e0: 2b 8f 00 14 lw r15,(sp+20) <== NOT EXECUTED 80111e4: 2b 90 00 10 lw r16,(sp+16) <== NOT EXECUTED 80111e8: 2b 91 00 0c lw r17,(sp+12) <== NOT EXECUTED 80111ec: 2b 92 00 08 lw r18,(sp+8) <== NOT EXECUTED 80111f0: 37 9c 00 24 addi sp,sp,36 <== NOT EXECUTED 80111f4: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08011060 : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 8011060: 37 9c ff f4 addi sp,sp,-12 8011064: 5b 8b 00 08 sw (sp+8),r11 8011068: 5b 9d 00 04 sw (sp+4),ra 801106c: b8 20 58 00 mv r11,r1 int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 8011070: 5b 82 00 0c sw (sp+12),r2 while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8011074: e0 00 00 0d bi 80110a8 { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 8011078: 2d 64 00 06 lhu r4,(r11+6) 801107c: b9 60 08 00 mv r1,r11 8011080: 34 03 00 00 mvi r3,0 8011084: 34 05 00 00 mvi r5,0 8011088: fb ff fc 75 calli 801025c if ( ret != fs_info->vol.bpc ) 801108c: 2d 62 00 06 lhu r2,(r11+6) 8011090: 5c 22 00 0d bne r1,r2,80110c4 <== NEVER TAKEN { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 8011094: 2b 82 00 0c lw r2,(sp+12) 8011098: b9 60 08 00 mv r1,r11 801109c: 37 83 00 0c addi r3,sp,12 80110a0: f8 00 1a 34 calli 8017970 if ( rc != RC_OK ) 80110a4: 5c 20 00 09 bne r1,r0,80110c8 <== 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) 80110a8: 2b 82 00 0c lw r2,(sp+12) 80110ac: 29 61 00 10 lw r1,(r11+16) 80110b0: 29 63 00 14 lw r3,(r11+20) 80110b4: a0 41 08 00 and r1,r2,r1 80110b8: 54 61 ff f0 bgu r3,r1,8011078 return rc; } } return rc; 80110bc: 34 01 00 00 mvi r1,0 80110c0: e0 00 00 02 bi 80110c8 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; 80110c4: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED } } return rc; } 80110c8: 2b 9d 00 04 lw ra,(sp+4) 80110cc: 2b 8b 00 08 lw r11,(sp+8) 80110d0: 37 9c 00 0c addi sp,sp,12 80110d4: c3 a0 00 00 ret =============================================================================== 080105ec : * 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) { 80105ec: 37 9c ff 24 addi sp,sp,-220 80105f0: 5b 8b 00 44 sw (sp+68),r11 80105f4: 5b 8c 00 40 sw (sp+64),r12 80105f8: 5b 8d 00 3c sw (sp+60),r13 80105fc: 5b 8e 00 38 sw (sp+56),r14 8010600: 5b 8f 00 34 sw (sp+52),r15 8010604: 5b 90 00 30 sw (sp+48),r16 8010608: 5b 91 00 2c sw (sp+44),r17 801060c: 5b 92 00 28 sw (sp+40),r18 8010610: 5b 93 00 24 sw (sp+36),r19 8010614: 5b 94 00 20 sw (sp+32),r20 8010618: 5b 95 00 1c sw (sp+28),r21 801061c: 5b 96 00 18 sw (sp+24),r22 8010620: 5b 97 00 14 sw (sp+20),r23 8010624: 5b 98 00 10 sw (sp+16),r24 8010628: 5b 99 00 0c sw (sp+12),r25 801062c: 5b 9b 00 08 sw (sp+8),fp 8010630: 5b 9d 00 04 sw (sp+4),ra 8010634: 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); 8010638: b8 40 08 00 mv r1,r2 801063c: 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; 8010640: 5b 80 00 dc sw (sp+220),r0 vol->fd = open(device, O_RDWR); 8010644: fb ff ce 38 calli 8003f24 8010648: 59 e1 00 60 sw (r15+96),r1 if (vol->fd < 0) 801064c: 4c 20 00 02 bge r1,r0,8010654 <== ALWAYS TAKEN 8010650: e0 00 00 06 bi 8010668 <== NOT EXECUTED { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); 8010654: 37 82 00 88 addi r2,sp,136 8010658: fb ff ca 8b calli 8003084 if (rc != 0) 801065c: 44 20 00 08 be r1,r0,801067c <== ALWAYS TAKEN { close(vol->fd); 8010660: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010664: fb ff ca 2f calli 8002f20 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 8010668: f8 00 24 e9 calli 8019a0c <__errno> <== NOT EXECUTED 801066c: 34 02 00 06 mvi r2,6 <== NOT EXECUTED 8010670: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8010674: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8010678: e0 00 01 eb bi 8010e24 <== NOT EXECUTED } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) 801067c: 2b 84 00 94 lw r4,(sp+148) 8010680: 29 e2 00 60 lw r2,(r15+96) 8010684: 34 03 60 00 mvi r3,24576 8010688: 20 84 f0 00 andi r4,r4,0xf000 { close(vol->fd); 801068c: 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)) 8010690: 5c 83 ff f5 bne r4,r3,8010664 <== 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); 8010694: 78 03 08 02 mvhi r3,0x802 8010698: 38 63 d4 30 ori r3,r3,0xd430 801069c: b8 40 08 00 mv r1,r2 80106a0: 28 62 00 00 lw r2,(r3+0) 80106a4: 35 e3 00 64 addi r3,r15,100 80106a8: f8 00 05 f4 calli 8011e78 80106ac: 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) { 80106b0: 5c 20 ff ec bne r1,r0,8010660 <== 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); 80106b4: 29 e1 00 64 lw r1,(r15+100) 80106b8: 34 02 00 00 mvi r2,0 80106bc: 37 83 00 dc addi r3,sp,220 80106c0: fb ff f4 bd calli 800d9b4 80106c4: b8 20 70 00 mv r14,r1 if (sc != RTEMS_SUCCESSFUL) 80106c8: 5c 2b 00 33 bne r1,r11,8010794 <== NEVER TAKEN { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 80106cc: 2b 8a 00 dc lw r10,(sp+220) 80106d0: 29 43 00 1c lw r3,(r10+28) 80106d4: 40 61 00 13 lbu r1,(r3+19) 80106d8: 40 72 00 0b lbu r18,(r3+11) 80106dc: 40 71 00 0c lbu r17,(r3+12) 80106e0: 40 73 00 0d lbu r19,(r3+13) 80106e4: 40 76 00 0e lbu r22,(r3+14) 80106e8: 40 75 00 0f lbu r21,(r3+15) 80106ec: 40 74 00 10 lbu r20,(r3+16) 80106f0: 40 78 00 11 lbu r24,(r3+17) 80106f4: 40 77 00 12 lbu r23,(r3+18) 80106f8: 5b 81 00 6c sw (sp+108),r1 80106fc: 40 62 00 14 lbu r2,(r3+20) 8010700: 5b 82 00 70 sw (sp+112),r2 8010704: 40 61 00 16 lbu r1,(r3+22) 8010708: 5b 81 00 74 sw (sp+116),r1 801070c: 40 62 00 17 lbu r2,(r3+23) 8010710: 5b 82 00 78 sw (sp+120),r2 8010714: 40 61 00 21 lbu r1,(r3+33) 8010718: 40 6c 00 20 lbu r12,(r3+32) 801071c: 5b 81 00 7c sw (sp+124),r1 8010720: 40 62 00 22 lbu r2,(r3+34) 8010724: 5b 82 00 80 sw (sp+128),r2 8010728: 40 61 00 23 lbu r1,(r3+35) 801072c: 5b 81 00 84 sw (sp+132),r1 8010730: 40 62 00 25 lbu r2,(r3+37) 8010734: 40 6d 00 24 lbu r13,(r3+36) 8010738: 5b 82 00 5c sw (sp+92),r2 801073c: 40 61 00 26 lbu r1,(r3+38) 8010740: 5b 81 00 60 sw (sp+96),r1 8010744: 40 62 00 27 lbu r2,(r3+39) 8010748: 5b 82 00 64 sw (sp+100),r2 801074c: 40 61 00 28 lbu r1,(r3+40) 8010750: 5b 81 00 68 sw (sp+104),r1 8010754: 40 62 00 29 lbu r2,(r3+41) 8010758: 5b 82 00 54 sw (sp+84),r2 801075c: 40 61 00 2c lbu r1,(r3+44) 8010760: 5b 81 00 58 sw (sp+88),r1 8010764: 40 62 00 2d lbu r2,(r3+45) 8010768: 5b 82 00 4c sw (sp+76),r2 801076c: 40 61 00 2e lbu r1,(r3+46) 8010770: 5b 81 00 50 sw (sp+80),r1 8010774: 40 62 00 2f lbu r2,(r3+47) sc = rtems_bdbuf_release( block); 8010778: 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); 801077c: 5b 82 00 48 sw (sp+72),r2 8010780: 40 7b 00 30 lbu fp,(r3+48) 8010784: 40 79 00 31 lbu r25,(r3+49) sc = rtems_bdbuf_release( block); 8010788: fb ff f5 15 calli 800dbdc 801078c: b8 20 80 00 mv r16,r1 if (sc != RTEMS_SUCCESSFUL) 8010790: 44 2e 00 06 be r1,r14,80107a8 <== ALWAYS TAKEN { close(vol->fd); 8010794: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010798: fb ff c9 e2 calli 8002f20 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 801079c: f8 00 24 9c calli 8019a0c <__errno> <== NOT EXECUTED 80107a0: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 80107a4: e3 ff ff b3 bi 8010670 <== NOT EXECUTED } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 80107a8: ba 20 08 00 mv r1,r17 80107ac: 34 02 00 08 mvi r2,8 80107b0: fb ff c2 8e calli 80011e8 <__ashlsi3> 80107b4: b8 32 48 00 or r9,r1,r18 80107b8: 21 31 ff ff andi r17,r9,0xffff if ( (vol->bps != 512) && 80107bc: 7e 2e 04 00 cmpnei r14,r17,1024 80107c0: 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); 80107c4: 0d f1 00 00 sh (r15+0),r17 if ( (vol->bps != 512) && 80107c8: a1 ca 50 00 and r10,r14,r10 80107cc: 45 50 00 05 be r10,r16,80107e0 <== ALWAYS TAKEN (vol->bps != 1024) && 80107d0: 34 0a 08 00 mvi r10,2048 <== NOT EXECUTED 80107d4: 46 2a 00 03 be r17,r10,80107e0 <== NOT EXECUTED (vol->bps != 2048) && 80107d8: 34 0a 10 00 mvi r10,4096 <== NOT EXECUTED 80107dc: 5e 2a 00 f0 bne r17,r10,8010b9c <== 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; 80107e0: 31 e0 00 03 sb (r15+3),r0 80107e4: ba 20 08 00 mv r1,r17 80107e8: 34 02 00 09 mvi r2,9 80107ec: f8 00 6e 89 calli 802c210 <__lshrsi3> 80107f0: 20 2a ff ff andi r10,r1,0xffff 80107f4: b9 40 08 00 mv r1,r10 80107f8: e0 00 00 06 bi 8010810 i >>= 1, vol->sec_mul++); 80107fc: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8010800: fb ff c2 a1 calli 8001284 <__ashrsi3> <== NOT EXECUTED 8010804: 41 e2 00 03 lbu r2,(r15+3) <== NOT EXECUTED 8010808: 34 42 00 01 addi r2,r2,1 <== NOT EXECUTED 801080c: 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; 8010810: 20 22 00 01 andi r2,r1,0x1 8010814: 44 40 ff fa be r2,r0,80107fc <== NEVER TAKEN i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 8010818: 31 e0 00 02 sb (r15+2),r0 801081c: ba 20 08 00 mv r1,r17 8010820: e0 00 00 06 bi 8010838 i >>= 1, vol->sec_log2++); 8010824: 34 02 00 01 mvi r2,1 8010828: fb ff c2 97 calli 8001284 <__ashrsi3> 801082c: 41 e2 00 02 lbu r2,(r15+2) 8010830: 34 42 00 01 addi r2,r2,1 8010834: 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; 8010838: 20 22 00 01 andi r2,r1,0x1 801083c: 44 40 ff fa be r2,r0,8010824 i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; vol->bytes_per_block_log2 = vol->sec_log2; 8010840: 41 f2 00 02 lbu r18,(r15+2) vol->sectors_per_block = 1; 8010844: 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; 8010848: 0d f1 00 0a sh (r15+10),r17 vol->bytes_per_block_log2 = vol->sec_log2; 801084c: 31 f2 00 0c sb (r15+12),r18 vol->sectors_per_block = 1; 8010850: 31 ea 00 09 sb (r15+9),r10 vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); 8010854: 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) 8010858: 46 60 00 d1 be r19,r0,8010b9c <== NEVER TAKEN { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 801085c: 31 e0 00 05 sb (r15+5),r0 8010860: ba 60 08 00 mv r1,r19 8010864: e0 00 00 06 bi 801087c i >>= 1, vol->spc_log2++); 8010868: 34 02 00 01 mvi r2,1 801086c: fb ff c2 86 calli 8001284 <__ashrsi3> 8010870: 41 e2 00 05 lbu r2,(r15+5) 8010874: 34 42 00 01 addi r2,r2,1 8010878: 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; 801087c: 20 22 00 01 andi r2,r1,0x1 8010880: 44 40 ff fa be r2,r0,8010868 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) 8010884: 41 e2 00 05 lbu r2,(r15+5) 8010888: ba 20 08 00 mv r1,r17 801088c: fb ff c2 57 calli 80011e8 <__ashlsi3> 8010890: 20 2e ff ff andi r14,r1,0xffff 8010894: 0d ee 00 06 sh (r15+6),r14 8010898: 38 0a 80 00 mvu r10,0x8000 801089c: 51 4e 00 02 bgeu r10,r14,80108a4 <== ALWAYS TAKEN 80108a0: e0 00 00 bf bi 8010b9c <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 80108a4: 31 e0 00 08 sb (r15+8),r0 80108a8: b9 c0 08 00 mv r1,r14 80108ac: e0 00 00 06 bi 80108c4 i >>= 1, vol->bpc_log2++); 80108b0: 34 02 00 01 mvi r2,1 80108b4: fb ff c2 74 calli 8001284 <__ashrsi3> 80108b8: 41 e2 00 08 lbu r2,(r15+8) 80108bc: 34 42 00 01 addi r2,r2,1 80108c0: 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; 80108c4: 20 22 00 01 andi r2,r1,0x1 80108c8: 44 40 ff fa be r2,r0,80108b0 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); 80108cc: 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); 80108d0: 31 f4 00 0d sb (r15+13),r20 vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 80108d4: ba a0 08 00 mv r1,r21 80108d8: fb ff c2 44 calli 80011e8 <__ashlsi3> 80108dc: b8 36 40 00 or r8,r1,r22 80108e0: 21 10 ff ff andi r16,r8,0xffff vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 80108e4: 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); 80108e8: 0d f0 00 18 sh (r15+24),r16 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 80108ec: ba e0 08 00 mv r1,r23 80108f0: fb ff c2 3e calli 80011e8 <__ashlsi3> 80108f4: b8 38 38 00 or r7,r1,r24 80108f8: 20 e7 ff ff andi r7,r7,0xffff 80108fc: 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)) / 8010900: b8 e0 08 00 mv r1,r7 8010904: 34 02 00 05 mvi r2,5 8010908: fb ff c2 38 calli 80011e8 <__ashlsi3> 801090c: 36 2e ff ff addi r14,r17,-1 8010910: ba 20 10 00 mv r2,r17 8010914: b5 c1 08 00 add r1,r14,r1 8010918: fb ff c2 8e calli 8001350 <__divsi3> vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 801091c: 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)) / 8010920: 59 e1 00 28 sw (r15+40),r1 8010924: b8 20 58 00 mv r11,r1 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 8010928: fb ff c2 30 calli 80011e8 <__ashlsi3> 801092c: 59 e1 00 2c sw (r15+44),r1 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 8010930: 2b 81 00 78 lw r1,(sp+120) 8010934: 34 02 00 08 mvi r2,8 8010938: fb ff c2 2c calli 80011e8 <__ashlsi3> 801093c: 2b 83 00 74 lw r3,(sp+116) 8010940: 34 02 00 10 mvi r2,16 8010944: b8 23 08 00 or r1,r1,r3 8010948: fb ff c2 28 calli 80011e8 <__ashlsi3> 801094c: 34 02 00 10 mvi r2,16 8010950: fb ff c2 4d calli 8001284 <__ashrsi3> vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); 8010954: 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) 8010958: 5c 20 00 0e bne r1,r0,8010990 vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); 801095c: 2b 81 00 5c lw r1,(sp+92) 8010960: 34 02 00 08 mvi r2,8 8010964: fb ff c2 21 calli 80011e8 <__ashlsi3> 8010968: b8 20 70 00 mv r14,r1 801096c: 2b 81 00 60 lw r1,(sp+96) 8010970: 34 02 00 10 mvi r2,16 8010974: fb ff c2 1d calli 80011e8 <__ashlsi3> 8010978: b9 c1 30 00 or r6,r14,r1 801097c: 2b 81 00 64 lw r1,(sp+100) 8010980: 34 02 00 18 mvi r2,24 8010984: b8 cd 68 00 or r13,r6,r13 8010988: fb ff c2 18 calli 80011e8 <__ashlsi3> 801098c: b9 a1 30 00 or r6,r13,r1 8010990: 59 e6 00 1c sw (r15+28),r6 vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 8010994: 29 e2 00 1c lw r2,(r15+28) 8010998: ba 80 08 00 mv r1,r20 801099c: fb ff c2 61 calli 8001320 <__mulsi3> 80109a0: 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) 80109a4: 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 + 80109a8: 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; 80109ac: 59 e3 00 20 sw (r15+32),r3 if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 80109b0: 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 + 80109b4: 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) 80109b8: fb ff c2 0c calli 80011e8 <__ashlsi3> 80109bc: 2b 82 00 6c lw r2,(sp+108) 80109c0: b8 22 08 00 or r1,r1,r2 80109c4: 34 02 00 10 mvi r2,16 80109c8: fb ff c2 08 calli 80011e8 <__ashlsi3> 80109cc: 34 02 00 10 mvi r2,16 80109d0: fb ff c2 2d calli 8001284 <__ashrsi3> vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); 80109d4: 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) 80109d8: 5c 20 00 0e bne r1,r0,8010a10 vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); 80109dc: 2b 81 00 7c lw r1,(sp+124) 80109e0: 34 02 00 08 mvi r2,8 80109e4: fb ff c2 01 calli 80011e8 <__ashlsi3> 80109e8: b8 20 68 00 mv r13,r1 80109ec: 2b 81 00 80 lw r1,(sp+128) 80109f0: 34 02 00 10 mvi r2,16 80109f4: fb ff c1 fd calli 80011e8 <__ashlsi3> 80109f8: b9 a1 28 00 or r5,r13,r1 80109fc: 2b 81 00 84 lw r1,(sp+132) 8010a00: 34 02 00 18 mvi r2,24 8010a04: b8 ac 60 00 or r12,r5,r12 8010a08: fb ff c1 f8 calli 80011e8 <__ashlsi3> 8010a0c: b9 81 28 00 or r5,r12,r1 8010a10: 59 e5 00 30 sw (r15+48),r5 data_secs = vol->tot_secs - vol->data_fsec; 8010a14: 29 e5 00 30 lw r5,(r15+48) vol->data_cls = data_secs / vol->spc; 8010a18: ba 60 10 00 mv r2,r19 8010a1c: c8 ab 08 00 sub r1,r5,r11 8010a20: f8 00 6e 4c calli 802c350 <__udivsi3> 8010a24: 59 e1 00 38 sw (r15+56),r1 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 8010a28: 34 05 0f f4 mvi r5,4084 8010a2c: 54 25 00 07 bgu r1,r5,8010a48 { vol->type = FAT_FAT12; 8010a30: 34 05 00 01 mvi r5,1 8010a34: 31 e5 00 0e sb (r15+14),r5 vol->mask = FAT_FAT12_MASK; 8010a38: 34 05 0f ff mvi r5,4095 8010a3c: 59 e5 00 10 sw (r15+16),r5 vol->eoc_val = FAT_FAT12_EOC; 8010a40: 34 05 0f f8 mvi r5,4088 8010a44: e0 00 00 12 bi 8010a8c } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 8010a48: 38 05 ff f4 mvu r5,0xfff4 8010a4c: 54 25 00 07 bgu r1,r5,8010a68 { vol->type = FAT_FAT16; 8010a50: 34 05 00 02 mvi r5,2 8010a54: 31 e5 00 0e sb (r15+14),r5 vol->mask = FAT_FAT16_MASK; 8010a58: 38 05 ff ff mvu r5,0xffff 8010a5c: 59 e5 00 10 sw (r15+16),r5 vol->eoc_val = FAT_FAT16_EOC; 8010a60: 34 a5 ff f9 addi r5,r5,-7 8010a64: e0 00 00 0a bi 8010a8c } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 8010a68: 78 03 08 02 mvhi r3,0x802 vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; 8010a6c: 34 05 00 04 mvi r5,4 vol->mask = FAT_FAT32_MASK; 8010a70: 38 63 d5 2c ori r3,r3,0xd52c vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; 8010a74: 31 e5 00 0e sb (r15+14),r5 vol->mask = FAT_FAT32_MASK; 8010a78: 28 65 00 00 lw r5,(r3+0) vol->eoc_val = FAT_FAT32_EOC; 8010a7c: 78 01 08 02 mvhi r1,0x802 8010a80: 38 21 d5 30 ori r1,r1,0xd530 vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 8010a84: 59 e5 00 10 sw (r15+16),r5 vol->eoc_val = FAT_FAT32_EOC; 8010a88: 28 25 00 00 lw r5,(r1+0) } } if (vol->type == FAT_FAT32) 8010a8c: 41 e6 00 0e lbu r6,(r15+14) } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; vol->eoc_val = FAT_FAT32_EOC; 8010a90: 59 e5 00 14 sw (r15+20),r5 } } if (vol->type == FAT_FAT32) 8010a94: 34 05 00 04 mvi r5,4 8010a98: 5c c5 00 72 bne r6,r5,8010c60 { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8010a9c: 2b 81 00 4c lw r1,(sp+76) 8010aa0: 34 02 00 08 mvi r2,8 8010aa4: fb ff c1 d1 calli 80011e8 <__ashlsi3> 8010aa8: b8 20 60 00 mv r12,r1 8010aac: 2b 81 00 50 lw r1,(sp+80) 8010ab0: 34 02 00 10 mvi r2,16 8010ab4: fb ff c1 cd calli 80011e8 <__ashlsi3> 8010ab8: 2b 82 00 58 lw r2,(sp+88) 8010abc: b9 81 20 00 or r4,r12,r1 8010ac0: 2b 81 00 48 lw r1,(sp+72) 8010ac4: b8 82 58 00 or r11,r4,r2 8010ac8: 34 02 00 18 mvi r2,24 8010acc: fb ff c1 c7 calli 80011e8 <__ashlsi3> 8010ad0: b9 61 20 00 or r4,r11,r1 vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 8010ad4: 2b 81 00 54 lw r1,(sp+84) } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8010ad8: 59 e4 00 3c sw (r15+60),r4 vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 8010adc: 34 02 00 08 mvi r2,8 8010ae0: fb ff c1 c2 calli 80011e8 <__ashlsi3> 8010ae4: 2b 82 00 68 lw r2,(sp+104) 8010ae8: b8 22 18 00 or r3,r1,r2 8010aec: 20 63 00 ff andi r3,r3,0xff 8010af0: 20 64 00 80 andi r4,r3,0x80 8010af4: 20 84 00 ff andi r4,r4,0xff 8010af8: 31 e4 00 54 sb (r15+84),r4 if (vol->mirror) 8010afc: 44 80 00 04 be r4,r0,8010b0c <== ALWAYS TAKEN vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 8010b00: 20 63 00 0f andi r3,r3,0xf <== NOT EXECUTED 8010b04: 31 e3 00 5c sb (r15+92),r3 <== NOT EXECUTED 8010b08: e0 00 00 02 bi 8010b10 <== NOT EXECUTED else vol->afat = 0; 8010b0c: 31 e0 00 5c sb (r15+92),r0 vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 8010b10: 34 02 00 08 mvi r2,8 8010b14: bb 20 08 00 mv r1,r25 8010b18: fb ff c1 b4 calli 80011e8 <__ashlsi3> 8010b1c: b8 3b 10 00 or r2,r1,fp 8010b20: 20 42 ff ff andi r2,r2,0xffff 8010b24: 0d e2 00 40 sh (r15+64),r2 if( vol->info_sec == 0 ) 8010b28: 44 40 00 1d be r2,r0,8010b9c <== 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); 8010b2c: 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, 8010b30: b9 e0 08 00 mv r1,r15 8010b34: 34 03 00 00 mvi r3,0 8010b38: 34 04 00 04 mvi r4,4 8010b3c: b9 60 28 00 mv r5,r11 8010b40: fb ff fd 5b calli 80100ac <_fat_block_read> FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 8010b44: 4c 20 00 02 bge r1,r0,8010b4c <== ALWAYS TAKEN 8010b48: e0 00 00 23 bi 8010bd4 <== NOT EXECUTED { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 8010b4c: 43 81 00 d1 lbu r1,(sp+209) 8010b50: 34 02 00 08 mvi r2,8 8010b54: fb ff c1 a5 calli 80011e8 <__ashlsi3> 8010b58: b8 20 60 00 mv r12,r1 8010b5c: 43 81 00 d2 lbu r1,(sp+210) 8010b60: 34 02 00 10 mvi r2,16 8010b64: fb ff c1 a1 calli 80011e8 <__ashlsi3> 8010b68: b9 81 10 00 or r2,r12,r1 8010b6c: 43 8c 00 d0 lbu r12,(sp+208) 8010b70: 43 81 00 d3 lbu r1,(sp+211) 8010b74: b8 4c 60 00 or r12,r2,r12 8010b78: 34 02 00 18 mvi r2,24 8010b7c: fb ff c1 9b calli 80011e8 <__ashlsi3> 8010b80: b9 81 10 00 or r2,r12,r1 8010b84: 78 01 08 02 mvhi r1,0x802 8010b88: 38 21 d5 34 ori r1,r1,0xd534 8010b8c: 28 23 00 00 lw r3,(r1+0) 8010b90: 44 43 00 08 be r2,r3,8010bb0 <== 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); 8010b94: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 8010b98: fb ff fc 85 calli 800fdac <== NOT EXECUTED if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(fs_info); close(vol->fd); 8010b9c: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010ba0: fb ff c8 e0 calli 8002f20 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 8010ba4: f8 00 23 9a calli 8019a0c <__errno> <== NOT EXECUTED 8010ba8: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8010bac: e3 ff fe b1 bi 8010670 <== NOT EXECUTED } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 8010bb0: 2d e2 00 40 lhu r2,(r15+64) 8010bb4: b9 e0 08 00 mv r1,r15 8010bb8: 34 03 01 e4 mvi r3,484 8010bbc: 34 04 00 0c mvi r4,12 8010bc0: b9 60 28 00 mv r5,r11 8010bc4: fb ff fd 3a calli 80100ac <_fat_block_read> FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 8010bc8: 4c 20 00 06 bge r1,r0,8010be0 <== 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); 8010bcc: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 8010bd0: fb ff fc 77 calli 800fdac <== 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); 8010bd4: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010bd8: fb ff c8 d2 calli 8002f20 <== NOT EXECUTED 8010bdc: e3 ff fe a6 bi 8010674 <== NOT EXECUTED return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 8010be0: 43 81 00 d5 lbu r1,(sp+213) 8010be4: 34 02 00 08 mvi r2,8 8010be8: fb ff c1 80 calli 80011e8 <__ashlsi3> 8010bec: b8 20 58 00 mv r11,r1 8010bf0: 43 81 00 d6 lbu r1,(sp+214) 8010bf4: 34 02 00 10 mvi r2,16 8010bf8: fb ff c1 7c calli 80011e8 <__ashlsi3> 8010bfc: b9 61 10 00 or r2,r11,r1 8010c00: 43 8b 00 d4 lbu r11,(sp+212) 8010c04: 43 81 00 d7 lbu r1,(sp+215) 8010c08: b8 4b 58 00 or r11,r2,r11 8010c0c: 34 02 00 18 mvi r2,24 8010c10: fb ff c1 76 calli 80011e8 <__ashlsi3> 8010c14: 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); 8010c18: 43 81 00 d9 lbu r1,(sp+217) _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 8010c1c: 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; 8010c20: 59 e2 00 44 sw (r15+68),r2 vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 8010c24: 34 02 00 08 mvi r2,8 8010c28: fb ff c1 70 calli 80011e8 <__ashlsi3> 8010c2c: b8 20 58 00 mv r11,r1 8010c30: 43 81 00 da lbu r1,(sp+218) 8010c34: 34 02 00 10 mvi r2,16 8010c38: fb ff c1 6c calli 80011e8 <__ashlsi3> 8010c3c: b9 61 10 00 or r2,r11,r1 8010c40: 43 8b 00 d8 lbu r11,(sp+216) 8010c44: 43 81 00 db lbu r1,(sp+219) 8010c48: b8 4b 58 00 or r11,r2,r11 8010c4c: 34 02 00 18 mvi r2,24 8010c50: fb ff c1 66 calli 80011e8 <__ashlsi3> 8010c54: 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 = 8010c58: 59 e2 00 50 sw (r15+80),r2 8010c5c: e0 00 00 06 bi 8010c74 else { vol->rdir_cl = 0; vol->mirror = 0; vol->afat = 0; vol->free_cls = FAT_UNDEFINED_VALUE; 8010c60: 34 02 ff ff mvi r2,-1 } } } else { vol->rdir_cl = 0; 8010c64: 59 e0 00 3c sw (r15+60),r0 vol->mirror = 0; 8010c68: 31 e0 00 54 sb (r15+84),r0 vol->afat = 0; 8010c6c: 31 e0 00 5c sb (r15+92),r0 vol->free_cls = FAT_UNDEFINED_VALUE; 8010c70: 59 e2 00 44 sw (r15+68),r2 vol->next_cl = FAT_UNDEFINED_VALUE; 8010c74: 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); 8010c78: b9 e0 08 00 mv r1,r15 8010c7c: fb ff fc 4c calli 800fdac vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 8010c80: 29 e2 00 1c lw r2,(r15+28) 8010c84: 41 e1 00 5c lbu r1,(r15+92) 8010c88: fb ff c1 a6 calli 8001320 <__mulsi3> 8010c8c: 2d e2 00 18 lhu r2,(r15+24) 8010c90: b4 22 10 00 add r2,r1,r2 8010c94: 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)); 8010c98: 34 01 00 02 mvi r1,2 8010c9c: 34 02 00 0c mvi r2,12 8010ca0: fb ff c8 81 calli 8002ea4 8010ca4: 59 e1 00 6c sw (r15+108),r1 8010ca8: b8 20 10 00 mv r2,r1 if ( fs_info->vhash == NULL ) 8010cac: 44 20 00 11 be r1,r0,8010cf0 <== 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 ); 8010cb0: 34 23 00 04 addi r3,r1,4 head->next = tail; head->previous = NULL; tail->previous = head; 8010cb4: 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; 8010cb8: 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; 8010cbc: 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 ); 8010cc0: 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); 8010cc4: 34 23 00 0c addi r3,r1,12 head->next = tail; 8010cc8: 58 24 00 0c sw (r1+12),r4 fs_info->rhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 8010ccc: 34 02 00 0c mvi r2,12 head->previous = NULL; 8010cd0: 58 60 00 04 sw (r3+4),r0 tail->previous = head; 8010cd4: 58 63 00 08 sw (r3+8),r3 8010cd8: 34 01 00 02 mvi r1,2 8010cdc: fb ff c8 72 calli 8002ea4 8010ce0: 59 e1 00 70 sw (r15+112),r1 8010ce4: b8 20 10 00 mv r2,r1 if ( fs_info->rhash == NULL ) 8010ce8: 5c 20 00 05 bne r1,r0,8010cfc <== ALWAYS TAKEN 8010cec: e0 00 00 1c bi 8010d5c <== 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); 8010cf0: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010cf4: fb ff c8 8b calli 8002f20 <== NOT EXECUTED 8010cf8: e0 00 00 30 bi 8010db8 <== 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 ); 8010cfc: 34 23 00 04 addi r3,r1,4 head->next = tail; head->previous = NULL; tail->previous = head; 8010d00: 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; 8010d04: 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; 8010d08: 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 ); 8010d0c: 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); 8010d10: 34 23 00 0c addi r3,r1,12 head->next = tail; 8010d14: 58 24 00 0c sw (r1+12),r4 head->previous = NULL; 8010d18: 58 60 00 04 sw (r3+4),r0 tail->previous = head; 8010d1c: 58 63 00 08 sw (r3+8),r3 fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE; 8010d20: 34 02 01 00 mvi r2,256 8010d24: 59 e2 00 7c sw (r15+124),r2 fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 8010d28: 29 e1 00 30 lw r1,(r15+48) 8010d2c: 41 e2 00 03 lbu r2,(r15+3) 8010d30: fb ff c1 2e calli 80011e8 <__ashlsi3> 8010d34: 34 02 00 04 mvi r2,4 8010d38: fb ff c1 2c calli 80011e8 <__ashlsi3> 8010d3c: 59 e1 00 80 sw (r15+128),r1 fs_info->index = 0; 8010d40: 59 e0 00 78 sw (r15+120),r0 fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 8010d44: 34 01 01 00 mvi r1,256 8010d48: 34 02 00 01 mvi r2,1 8010d4c: fb ff c8 56 calli 8002ea4 8010d50: 59 e1 00 74 sw (r15+116),r1 if ( fs_info->uino == NULL ) 8010d54: 5c 20 00 0c bne r1,r0,8010d84 <== ALWAYS TAKEN 8010d58: e0 00 00 05 bi 8010d6c <== 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); 8010d5c: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010d60: fb ff c8 70 calli 8002f20 <== NOT EXECUTED free(fs_info->vhash); 8010d64: 29 e1 00 6c lw r1,(r15+108) <== NOT EXECUTED 8010d68: e0 00 00 13 bi 8010db4 <== 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); 8010d6c: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010d70: fb ff c8 6c calli 8002f20 <== NOT EXECUTED free(fs_info->vhash); 8010d74: 29 e1 00 6c lw r1,(r15+108) <== NOT EXECUTED 8010d78: fb ff c8 95 calli 8002fcc <== NOT EXECUTED free(fs_info->rhash); 8010d7c: 29 e1 00 70 lw r1,(r15+112) <== NOT EXECUTED 8010d80: e0 00 00 0d bi 8010db4 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); 8010d84: 2d e1 00 00 lhu r1,(r15+0) 8010d88: 34 02 00 01 mvi r2,1 8010d8c: fb ff c8 46 calli 8002ea4 8010d90: 59 e1 00 90 sw (r15+144),r1 if (fs_info->sec_buf == NULL) 8010d94: 5c 20 00 0c bne r1,r0,8010dc4 <== ALWAYS TAKEN { close(vol->fd); 8010d98: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010d9c: fb ff c8 61 calli 8002f20 <== NOT EXECUTED free(fs_info->vhash); 8010da0: 29 e1 00 6c lw r1,(r15+108) <== NOT EXECUTED 8010da4: fb ff c8 8a calli 8002fcc <== NOT EXECUTED free(fs_info->rhash); 8010da8: 29 e1 00 70 lw r1,(r15+112) <== NOT EXECUTED 8010dac: fb ff c8 88 calli 8002fcc <== NOT EXECUTED free(fs_info->uino); 8010db0: 29 e1 00 74 lw r1,(r15+116) <== NOT EXECUTED 8010db4: fb ff c8 86 calli 8002fcc <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 8010db8: f8 00 23 15 calli 8019a0c <__errno> <== NOT EXECUTED 8010dbc: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8010dc0: e3 ff fe 2c bi 8010670 <== 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; 8010dc4: 41 e3 00 04 lbu r3,(r15+4) 8010dc8: 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; 8010dcc: 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; 8010dd0: 34 63 ff ff addi r3,r3,-1 8010dd4: 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) 8010dd8: 5c 80 00 13 bne r4,r0,8010e24 <== NEVER TAKEN && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) 8010ddc: 41 e5 00 0e lbu r5,(r15+14) 8010de0: 34 04 00 04 mvi r4,4 8010de4: 44 a4 00 04 be r5,r4,8010df4 return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 8010de8: 29 e1 00 20 lw r1,(r15+32) 8010dec: 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))) 8010df0: 5c 60 00 0d bne r3,r0,8010e24 <== NEVER TAKEN { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 8010df4: 2d e2 00 06 lhu r2,(r15+6) 8010df8: 29 e1 00 64 lw r1,(r15+100) 8010dfc: 34 03 00 01 mvi r3,1 8010e00: fb ff f4 b2 calli 800e0c8 vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; 8010e04: 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) 8010e08: 5c 20 00 07 bne r1,r0,8010e24 <== NEVER TAKEN { vol->bytes_per_block = vol->bpc; 8010e0c: 2d e1 00 06 lhu r1,(r15+6) 8010e10: 0d e1 00 0a sh (r15+10),r1 vol->bytes_per_block_log2 = vol->bpc_log2; 8010e14: 41 e1 00 08 lbu r1,(r15+8) 8010e18: 31 e1 00 0c sb (r15+12),r1 vol->sectors_per_block = vol->spc; 8010e1c: 41 e1 00 04 lbu r1,(r15+4) 8010e20: 31 e1 00 09 sb (r15+9),r1 } } return RC_OK; } 8010e24: b8 40 08 00 mv r1,r2 8010e28: 2b 9d 00 04 lw ra,(sp+4) 8010e2c: 2b 8b 00 44 lw r11,(sp+68) 8010e30: 2b 8c 00 40 lw r12,(sp+64) 8010e34: 2b 8d 00 3c lw r13,(sp+60) 8010e38: 2b 8e 00 38 lw r14,(sp+56) 8010e3c: 2b 8f 00 34 lw r15,(sp+52) 8010e40: 2b 90 00 30 lw r16,(sp+48) 8010e44: 2b 91 00 2c lw r17,(sp+44) 8010e48: 2b 92 00 28 lw r18,(sp+40) 8010e4c: 2b 93 00 24 lw r19,(sp+36) 8010e50: 2b 94 00 20 lw r20,(sp+32) 8010e54: 2b 95 00 1c lw r21,(sp+28) 8010e58: 2b 96 00 18 lw r22,(sp+24) 8010e5c: 2b 97 00 14 lw r23,(sp+20) 8010e60: 2b 98 00 10 lw r24,(sp+16) 8010e64: 2b 99 00 0c lw r25,(sp+12) 8010e68: 2b 9b 00 08 lw fp,(sp+8) 8010e6c: 37 9c 00 dc addi sp,sp,220 8010e70: c3 a0 00 00 ret =============================================================================== 08017fd4 : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 8017fd4: 37 9c ff c8 addi sp,sp,-56 8017fd8: 5b 8b 00 34 sw (sp+52),r11 8017fdc: 5b 8c 00 30 sw (sp+48),r12 8017fe0: 5b 8d 00 2c sw (sp+44),r13 8017fe4: 5b 8e 00 28 sw (sp+40),r14 8017fe8: 5b 8f 00 24 sw (sp+36),r15 8017fec: 5b 90 00 20 sw (sp+32),r16 8017ff0: 5b 91 00 1c sw (sp+28),r17 8017ff4: 5b 92 00 18 sw (sp+24),r18 8017ff8: 5b 93 00 14 sw (sp+20),r19 8017ffc: 5b 94 00 10 sw (sp+16),r20 8018000: 5b 95 00 0c sw (sp+12),r21 8018004: 5b 96 00 08 sw (sp+8),r22 8018008: 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; 801800c: 28 34 00 38 lw r20,(r1+56) bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 8018010: 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; 8018014: 58 80 00 00 sw (r4+0),r0 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 8018018: b8 20 58 00 mv r11,r1 801801c: b8 40 78 00 mv r15,r2 8018020: b8 60 a8 00 mv r21,r3 8018024: b8 80 68 00 mv r13,r4 8018028: b8 a0 90 00 mv r18,r5 801802c: 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; 8018030: 36 94 00 02 addi r20,r20,2 ssize_t bytes_written; *cls_added = 0; if (count == 0) return rc; 8018034: 34 0e 00 00 mvi r14,0 uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) 8018038: 44 60 00 68 be r3,r0,80181d8 <== NEVER TAKEN return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) 801803c: 28 2c 00 4c lw r12,(r1+76) 8018040: 34 01 ff ff mvi r1,-1 8018044: 5d 81 00 02 bne r12,r1,801804c uint32_t *last_cl, bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; 8018048: 34 0c 00 02 mvi r12,2 } } i++; cl4find++; if (cl4find >= data_cls_val) cl4find = 2; 801804c: 34 11 00 02 mvi r17,2 8018050: 34 10 00 00 mvi r16,0 8018054: e0 00 00 47 bi 8018170 * 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); 8018058: b9 60 08 00 mv r1,r11 801805c: b9 80 10 00 mv r2,r12 8018060: 37 83 00 38 addi r3,sp,56 8018064: fb ff fe 43 calli 8017970 8018068: b8 20 70 00 mv r14,r1 if ( rc != RC_OK ) 801806c: 44 20 00 07 be r1,r0,8018088 <== ALWAYS TAKEN { if (*cls_added != 0) 8018070: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED 8018074: 44 20 00 59 be r1,r0,80181d8 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); 8018078: 29 e2 00 00 lw r2,(r15+0) <== NOT EXECUTED 801807c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8018080: fb ff ff 99 calli 8017ee4 <== NOT EXECUTED 8018084: e0 00 00 55 bi 80181d8 <== NOT EXECUTED return rc; } if (next_cln == FAT_GENFAT_FREE) 8018088: 2b 81 00 38 lw r1,(sp+56) 801808c: 5c 2e 00 34 bne r1,r14,801815c /* * 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) 8018090: 29 a1 00 00 lw r1,(r13+0) 8018094: 5c 20 00 08 bne r1,r0,80180b4 { *chain = cl4find; 8018098: 59 ec 00 00 sw (r15+0),r12 rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 801809c: b9 60 08 00 mv r1,r11 80180a0: b9 80 10 00 mv r2,r12 80180a4: 34 03 ff ff mvi r3,-1 80180a8: fb ff fe bd calli 8017b9c if ( rc != RC_OK ) 80180ac: 44 20 00 13 be r1,r0,80180f8 <== ALWAYS TAKEN 80180b0: e0 00 00 49 bi 80181d4 <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 80180b4: b9 60 08 00 mv r1,r11 80180b8: b9 80 10 00 mv r2,r12 80180bc: 34 03 ff ff mvi r3,-1 80180c0: fb ff fe b7 calli 8017b9c 80180c4: b8 20 98 00 mv r19,r1 if ( rc != RC_OK ) 80180c8: 44 20 00 06 be r1,r0,80180e0 <== ALWAYS TAKEN { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 80180cc: 29 e2 00 00 lw r2,(r15+0) <== NOT EXECUTED 80180d0: 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); 80180d4: ba 60 70 00 mv r14,r19 <== NOT EXECUTED if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 80180d8: fb ff ff 83 calli 8017ee4 <== NOT EXECUTED return rc; 80180dc: e0 00 00 3f bi 80181d8 <== NOT EXECUTED } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); 80180e0: ba 00 10 00 mv r2,r16 80180e4: b9 60 08 00 mv r1,r11 80180e8: b9 80 18 00 mv r3,r12 80180ec: fb ff fe ac calli 8017b9c 80180f0: b8 20 80 00 mv r16,r1 if ( rc != RC_OK ) 80180f4: 5c 20 00 2d bne r1,r0,80181a8 <== NEVER TAKEN goto cleanup; } if (zero_fill) 80180f8: 46 c0 00 09 be r22,r0,801811c { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 80180fc: 2d 64 00 06 lhu r4,(r11+6) 8018100: b9 80 10 00 mv r2,r12 8018104: b9 60 08 00 mv r1,r11 8018108: 34 03 00 00 mvi r3,0 801810c: 34 05 00 00 mvi r5,0 8018110: fb ff e0 53 calli 801025c if (fs_info->vol.bpc != bytes_written) 8018114: 2d 62 00 06 lhu r2,(r11+6) 8018118: 5c 41 00 23 bne r2,r1,80181a4 <== NEVER TAKEN goto cleanup; } } save_cln = cl4find; (*cls_added)++; 801811c: 29 a1 00 00 lw r1,(r13+0) 8018120: 34 21 00 01 addi r1,r1,1 8018124: 59 a1 00 00 sw (r13+0),r1 /* have we satisfied request ? */ if (*cls_added == count) 8018128: 5c 35 00 0c bne r1,r21,8018158 { fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 801812c: 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; 8018130: 59 6c 00 4c sw (r11+76),r12 if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8018134: 34 02 ff ff mvi r2,-1 8018138: 44 22 00 04 be r1,r2,8018148 <== ALWAYS TAKEN fs_info->vol.free_cls -= (*cls_added); 801813c: 29 a2 00 00 lw r2,(r13+0) <== NOT EXECUTED 8018140: c8 22 08 00 sub r1,r1,r2 <== NOT EXECUTED 8018144: 59 61 00 44 sw (r11+68),r1 <== NOT EXECUTED *last_cl = save_cln; 8018148: 5a 4c 00 00 sw (r18+0),r12 fat_buf_release(fs_info); 801814c: b9 60 08 00 mv r1,r11 8018150: fb ff df 17 calli 800fdac return rc; 8018154: e0 00 00 21 bi 80181d8 save_cln = cl4find; (*cls_added)++; /* have we satisfied request ? */ if (*cls_added == count) 8018158: b9 80 80 00 mv r16,r12 fat_buf_release(fs_info); return rc; } } i++; cl4find++; 801815c: 35 8c 00 01 addi r12,r12,1 *last_cl = save_cln; fat_buf_release(fs_info); return rc; } } i++; 8018160: 36 31 00 01 addi r17,r17,1 cl4find++; if (cl4find >= data_cls_val) 8018164: 51 94 00 02 bgeu r12,r20,801816c <== NEVER TAKEN 8018168: e0 00 00 02 bi 8018170 cl4find = 2; 801816c: 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) 8018170: 56 91 ff ba bgu r20,r17,8018058 <== 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) 8018174: 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; 8018178: 59 70 00 4c sw (r11+76),r16 <== NOT EXECUTED if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 801817c: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8018180: 44 22 00 04 be r1,r2,8018190 <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); 8018184: 29 a2 00 00 lw r2,(r13+0) <== NOT EXECUTED 8018188: c8 22 08 00 sub r1,r1,r2 <== NOT EXECUTED 801818c: 59 61 00 44 sw (r11+68),r1 <== NOT EXECUTED *last_cl = save_cln; 8018190: 5a 50 00 00 sw (r18+0),r16 <== NOT EXECUTED fat_buf_release(fs_info); 8018194: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8018198: fb ff df 05 calli 800fdac <== NOT EXECUTED return RC_OK; 801819c: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED 80181a0: e0 00 00 0e bi 80181d8 <== 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; 80181a4: 34 10 ff ff mvi r16,-1 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 80181a8: 29 e2 00 00 lw r2,(r15+0) <== NOT EXECUTED 80181ac: 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; 80181b0: ba 00 70 00 mv r14,r16 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 80181b4: fb ff ff 4c calli 8017ee4 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); 80181b8: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 80181bc: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 80181c0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 80181c4: fb ff fe 76 calli 8017b9c <== NOT EXECUTED fat_buf_release(fs_info); 80181c8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 80181cc: fb ff de f8 calli 800fdac <== NOT EXECUTED return rc; 80181d0: e0 00 00 02 bi 80181d8 <== NOT EXECUTED * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 80181d4: 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; } 80181d8: b9 c0 08 00 mv r1,r14 80181dc: 2b 9d 00 04 lw ra,(sp+4) 80181e0: 2b 8b 00 34 lw r11,(sp+52) 80181e4: 2b 8c 00 30 lw r12,(sp+48) 80181e8: 2b 8d 00 2c lw r13,(sp+44) 80181ec: 2b 8e 00 28 lw r14,(sp+40) 80181f0: 2b 8f 00 24 lw r15,(sp+36) 80181f4: 2b 90 00 20 lw r16,(sp+32) 80181f8: 2b 91 00 1c lw r17,(sp+28) 80181fc: 2b 92 00 18 lw r18,(sp+24) 8018200: 2b 93 00 14 lw r19,(sp+20) 8018204: 2b 94 00 10 lw r20,(sp+16) 8018208: 2b 95 00 0c lw r21,(sp+12) 801820c: 2b 96 00 08 lw r22,(sp+8) 8018210: 37 9c 00 38 addi sp,sp,56 8018214: c3 a0 00 00 ret =============================================================================== 08010170 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 8010170: 37 9c ff d8 addi sp,sp,-40 8010174: 5b 8b 00 24 sw (sp+36),r11 8010178: 5b 8c 00 20 sw (sp+32),r12 801017c: 5b 8d 00 1c sw (sp+28),r13 8010180: 5b 8e 00 18 sw (sp+24),r14 8010184: 5b 8f 00 14 sw (sp+20),r15 8010188: 5b 90 00 10 sw (sp+16),r16 801018c: 5b 91 00 0c sw (sp+12),r17 8010190: 5b 92 00 08 sw (sp+8),r18 8010194: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; ssize_t cmpltd = 0; 8010198: 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) { 801019c: b8 20 70 00 mv r14,r1 80101a0: b8 80 68 00 mv r13,r4 80101a4: b8 a0 90 00 mv r18,r5 int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; uint32_t ofs = offset; 80101a8: 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; 80101ac: 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; 80101b0: 34 11 00 01 mvi r17,1 uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 80101b4: e0 00 00 1b bi 8010220 { c = MIN(count, (fs_info->vol.bps - ofs)); 80101b8: 2d cb 00 00 lhu r11,(r14+0) 80101bc: c9 70 58 00 sub r11,r11,r16 80101c0: 51 ab 00 02 bgeu r13,r11,80101c8 80101c4: b9 a0 58 00 mv r11,r13 if (c == fs_info->vol.bytes_per_block) 80101c8: 2d c1 00 0a lhu r1,(r14+10) 80101cc: 5d 61 00 05 bne r11,r1,80101e0 <== ALWAYS TAKEN rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 80101d0: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 80101d4: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED 80101d8: 34 03 00 02 mvi r3,2 <== NOT EXECUTED 80101dc: e0 00 00 04 bi 80101ec <== NOT EXECUTED else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 80101e0: b9 c0 08 00 mv r1,r14 80101e4: b9 e0 10 00 mv r2,r15 80101e8: 34 03 00 01 mvi r3,1 80101ec: 37 84 00 28 addi r4,sp,40 80101f0: fb ff ff 6d calli 800ffa4 if (rc != RC_OK) 80101f4: 5c 20 00 0d bne r1,r0,8010228 <== NEVER TAKEN return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 80101f8: 2b 81 00 28 lw r1,(sp+40) 80101fc: b6 4c 10 00 add r2,r18,r12 8010200: b9 60 18 00 mv r3,r11 8010204: b4 30 08 00 add r1,r1,r16 8010208: f8 00 29 4f calli 801a744 fat_buf_mark_modified(fs_info); count -= c; 801020c: c9 ab 68 00 sub r13,r13,r11 8010210: 31 d1 00 88 sb (r14+136),r17 cmpltd +=c; 8010214: b5 6c 60 00 add r12,r11,r12 sec_num++; 8010218: 35 ef 00 01 addi r15,r15,1 ofs = 0; 801021c: 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) 8010220: 5d a0 ff e6 bne r13,r0,80101b8 8010224: e0 00 00 02 bi 801022c 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; 8010228: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 801022c: b9 80 08 00 mv r1,r12 8010230: 2b 9d 00 04 lw ra,(sp+4) 8010234: 2b 8b 00 24 lw r11,(sp+36) 8010238: 2b 8c 00 20 lw r12,(sp+32) 801023c: 2b 8d 00 1c lw r13,(sp+28) 8010240: 2b 8e 00 18 lw r14,(sp+24) 8010244: 2b 8f 00 14 lw r15,(sp+20) 8010248: 2b 90 00 10 lw r16,(sp+16) 801024c: 2b 91 00 0c lw r17,(sp+12) 8010250: 2b 92 00 08 lw r18,(sp+8) 8010254: 37 9c 00 28 addi sp,sp,40 8010258: c3 a0 00 00 ret =============================================================================== 08017b9c : fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 8017b9c: 37 9c ff d8 addi sp,sp,-40 8017ba0: 5b 8b 00 24 sw (sp+36),r11 8017ba4: 5b 8c 00 20 sw (sp+32),r12 8017ba8: 5b 8d 00 1c sw (sp+28),r13 8017bac: 5b 8e 00 18 sw (sp+24),r14 8017bb0: 5b 8f 00 14 sw (sp+20),r15 8017bb4: 5b 90 00 10 sw (sp+16),r16 8017bb8: 5b 91 00 0c sw (sp+12),r17 8017bbc: 5b 92 00 08 sw (sp+8),r18 8017bc0: 5b 9d 00 04 sw (sp+4),ra 8017bc4: 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; 8017bc8: 5b 80 00 28 sw (sp+40),r0 /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 8017bcc: 34 01 00 01 mvi r1,1 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 8017bd0: b8 40 60 00 mv r12,r2 8017bd4: 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)) ) 8017bd8: 50 22 00 b3 bgeu r1,r2,8017ea4 <== NEVER TAKEN 8017bdc: 29 61 00 38 lw r1,(r11+56) 8017be0: 34 21 00 01 addi r1,r1,1 8017be4: 50 22 00 02 bgeu r1,r2,8017bec <== ALWAYS TAKEN 8017be8: e0 00 00 af bi 8017ea4 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 8017bec: 41 6e 00 0e lbu r14,(r11+14) 8017bf0: 21 cd 00 01 andi r13,r14,0x1 8017bf4: 45 a0 00 06 be r13,r0,8017c0c 8017bf8: b8 40 08 00 mv r1,r2 8017bfc: 34 02 00 01 mvi r2,1 8017c00: f8 00 51 84 calli 802c210 <__lshrsi3> 8017c04: b4 2c 08 00 add r1,r1,r12 8017c08: e0 00 00 09 bi 8017c2c 8017c0c: 21 c1 00 02 andi r1,r14,0x2 8017c10: 44 2d 00 04 be r1,r13,8017c20 8017c14: b8 40 08 00 mv r1,r2 8017c18: 34 02 00 01 mvi r2,1 8017c1c: e0 00 00 03 bi 8017c28 8017c20: b8 40 08 00 mv r1,r2 8017c24: 34 02 00 02 mvi r2,2 8017c28: fb ff a5 70 calli 80011e8 <__ashlsi3> 8017c2c: 41 62 00 02 lbu r2,(r11+2) 8017c30: f8 00 51 78 calli 802c210 <__lshrsi3> 8017c34: 29 71 00 58 lw r17,(r11+88) 8017c38: 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); 8017c3c: 45 a0 00 06 be r13,r0,8017c54 8017c40: b9 80 08 00 mv r1,r12 8017c44: 34 02 00 01 mvi r2,1 8017c48: f8 00 51 72 calli 802c210 <__lshrsi3> 8017c4c: b4 2c 78 00 add r15,r1,r12 8017c50: e0 00 00 09 bi 8017c74 8017c54: 21 ce 00 02 andi r14,r14,0x2 8017c58: b9 80 08 00 mv r1,r12 8017c5c: 34 02 00 01 mvi r2,1 8017c60: 5d cd 00 03 bne r14,r13,8017c6c 8017c64: b9 80 08 00 mv r1,r12 8017c68: 34 02 00 02 mvi r2,2 8017c6c: fb ff a5 5f calli 80011e8 <__ashlsi3> 8017c70: b8 20 78 00 mv r15,r1 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 8017c74: b9 60 08 00 mv r1,r11 8017c78: ba 20 10 00 mv r2,r17 8017c7c: 34 03 00 01 mvi r3,1 8017c80: 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); 8017c84: 2d 6d 00 00 lhu r13,(r11+0) rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 8017c88: fb ff e0 c7 calli 800ffa4 8017c8c: b8 20 70 00 mv r14,r1 if (rc != RC_OK) 8017c90: 5c 20 00 89 bne r1,r0,8017eb4 <== 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); 8017c94: 35 ad ff ff addi r13,r13,-1 8017c98: 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 ) 8017c9c: 41 6f 00 0e lbu r15,(r11+14) 8017ca0: 34 01 00 02 mvi r1,2 8017ca4: 45 e1 00 62 be r15,r1,8017e2c 8017ca8: 34 01 00 04 mvi r1,4 8017cac: 45 e1 00 6d be r15,r1,8017e60 8017cb0: 34 01 00 01 mvi r1,1 8017cb4: 5d e1 00 7c bne r15,r1,8017ea4 <== NEVER TAKEN { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 8017cb8: 21 8c 00 01 andi r12,r12,0x1 8017cbc: 2b 92 00 28 lw r18,(sp+40) 8017cc0: 45 80 00 2c be r12,r0,8017d70 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; 8017cc4: 34 02 00 04 mvi r2,4 8017cc8: ba 00 08 00 mv r1,r16 8017ccc: fb ff a5 47 calli 80011e8 <__ashlsi3> 8017cd0: 20 2c ff ff andi r12,r1,0xffff *(sec_buf + ofs) &= 0x0F; 8017cd4: b6 4d 08 00 add r1,r18,r13 8017cd8: 40 22 00 00 lbu r2,(r1+0) 8017cdc: 20 42 00 0f andi r2,r2,0xf 8017ce0: 30 22 00 00 sb (r1+0),r2 *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 8017ce4: 2b 81 00 28 lw r1,(sp+40) 8017ce8: 21 82 ff f0 andi r2,r12,0xfff0 8017cec: b4 2d 08 00 add r1,r1,r13 8017cf0: 40 23 00 00 lbu r3,(r1+0) 8017cf4: b8 62 10 00 or r2,r3,r2 8017cf8: 30 22 00 00 sb (r1+0),r2 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 8017cfc: 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; 8017d00: 31 6f 00 88 sb (r11+136),r15 8017d04: 34 21 ff ff addi r1,r1,-1 8017d08: 5d a1 00 12 bne r13,r1,8017d50 <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 8017d0c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8017d10: 36 22 00 01 addi r2,r17,1 <== NOT EXECUTED 8017d14: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8017d18: 37 84 00 28 addi r4,sp,40 <== NOT EXECUTED 8017d1c: fb ff e0 a2 calli 800ffa4 <== NOT EXECUTED 8017d20: b8 20 70 00 mv r14,r1 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 8017d24: 5c 20 00 64 bne r1,r0,8017eb4 <== NOT EXECUTED return rc; *sec_buf &= 0x00; 8017d28: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 8017d2c: 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; 8017d30: 30 20 00 00 sb (r1+0),r0 <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 8017d34: 2b 8d 00 28 lw r13,(sp+40) <== NOT EXECUTED 8017d38: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8017d3c: f8 00 51 35 calli 802c210 <__lshrsi3> <== NOT EXECUTED 8017d40: 41 a2 00 00 lbu r2,(r13+0) <== NOT EXECUTED 8017d44: b8 22 08 00 or r1,r1,r2 <== NOT EXECUTED 8017d48: 31 a1 00 00 sb (r13+0),r1 <== NOT EXECUTED 8017d4c: e0 00 00 27 bi 8017de8 <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 8017d50: 2b 81 00 28 lw r1,(sp+40) 8017d54: 35 ad 00 01 addi r13,r13,1 8017d58: b4 2d 08 00 add r1,r1,r13 8017d5c: 30 20 00 00 sb (r1+0),r0 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 8017d60: 2b 81 00 28 lw r1,(sp+40) 8017d64: b4 2d 68 00 add r13,r1,r13 8017d68: b9 80 08 00 mv r1,r12 8017d6c: e0 00 00 2a bi 8017e14 } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 8017d70: b6 4d 90 00 add r18,r18,r13 8017d74: 32 40 00 00 sb (r18+0),r0 *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 8017d78: 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; 8017d7c: 22 10 0f ff andi r16,r16,0xfff *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 8017d80: b4 2d 08 00 add r1,r1,r13 8017d84: 40 22 00 00 lbu r2,(r1+0) 8017d88: b8 50 10 00 or r2,r2,r16 8017d8c: 30 22 00 00 sb (r1+0),r2 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 8017d90: 2d 61 00 00 lhu r1,(r11+0) 8017d94: 31 6f 00 88 sb (r11+136),r15 8017d98: 34 21 ff ff addi r1,r1,-1 8017d9c: 5d a1 00 15 bne r13,r1,8017df0 <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 8017da0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8017da4: 36 22 00 01 addi r2,r17,1 <== NOT EXECUTED 8017da8: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8017dac: 37 84 00 28 addi r4,sp,40 <== NOT EXECUTED 8017db0: fb ff e0 7d calli 800ffa4 <== NOT EXECUTED 8017db4: b8 20 70 00 mv r14,r1 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 8017db8: 5c 20 00 3f bne r1,r0,8017eb4 <== NOT EXECUTED return rc; *sec_buf &= 0xF0; 8017dbc: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED 8017dc0: 40 22 00 00 lbu r2,(r1+0) <== NOT EXECUTED 8017dc4: 20 42 00 f0 andi r2,r2,0xf0 <== NOT EXECUTED 8017dc8: 30 22 00 00 sb (r1+0),r2 <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 8017dcc: 2b 8c 00 28 lw r12,(sp+40) <== NOT EXECUTED 8017dd0: 34 02 00 08 mvi r2,8 <== NOT EXECUTED 8017dd4: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 8017dd8: f8 00 51 0e calli 802c210 <__lshrsi3> <== NOT EXECUTED 8017ddc: 41 82 00 00 lbu r2,(r12+0) <== NOT EXECUTED 8017de0: b8 22 08 00 or r1,r1,r2 <== NOT EXECUTED 8017de4: 31 81 00 00 sb (r12+0),r1 <== NOT EXECUTED 8017de8: 31 6f 00 88 sb (r11+136),r15 <== NOT EXECUTED 8017dec: e0 00 00 32 bi 8017eb4 <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 8017df0: 2b 81 00 28 lw r1,(sp+40) 8017df4: 35 ad 00 01 addi r13,r13,1 8017df8: b4 2d 08 00 add r1,r1,r13 8017dfc: 40 22 00 00 lbu r2,(r1+0) 8017e00: 20 42 00 f0 andi r2,r2,0xf0 8017e04: 30 22 00 00 sb (r1+0),r2 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 8017e08: 2b 81 00 28 lw r1,(sp+40) 8017e0c: b4 2d 68 00 add r13,r1,r13 8017e10: ba 00 08 00 mv r1,r16 8017e14: 34 02 00 08 mvi r2,8 8017e18: f8 00 50 fe calli 802c210 <__lshrsi3> 8017e1c: 41 a2 00 00 lbu r2,(r13+0) 8017e20: b8 22 08 00 or r1,r1,r2 8017e24: 31 a1 00 00 sb (r13+0),r1 8017e28: e0 00 00 23 bi 8017eb4 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 8017e2c: 2b 81 00 28 lw r1,(sp+40) (uint16_t )(CT_LE_W(in_val)); 8017e30: 22 10 ff ff andi r16,r16,0xffff 8017e34: 34 02 00 08 mvi r2,8 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 8017e38: b4 2d 68 00 add r13,r1,r13 8017e3c: ba 00 08 00 mv r1,r16 8017e40: fb ff a4 ea calli 80011e8 <__ashlsi3> 8017e44: b8 20 60 00 mv r12,r1 8017e48: 34 02 00 08 mvi r2,8 8017e4c: ba 00 08 00 mv r1,r16 8017e50: f8 00 50 f0 calli 802c210 <__lshrsi3> 8017e54: b9 81 08 00 or r1,r12,r1 8017e58: 0d a1 00 00 sh (r13+0),r1 8017e5c: e0 00 00 0f bi 8017e98 (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)); 8017e60: 78 02 08 02 mvhi r2,0x802 8017e64: 38 42 d5 2c ori r2,r2,0xd52c 8017e68: 28 41 00 00 lw r1,(r2+0) 8017e6c: a2 01 08 00 and r1,r16,r1 8017e70: fb ff fe a0 calli 80178f0 8017e74: b8 20 60 00 mv r12,r1 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 8017e78: 2b 81 00 28 lw r1,(sp+40) 8017e7c: b4 2d 68 00 add r13,r1,r13 8017e80: 78 01 f0 00 mvhi r1,0xf000 8017e84: fb ff fe 9b calli 80178f0 8017e88: 29 a2 00 00 lw r2,(r13+0) 8017e8c: a0 22 10 00 and r2,r1,r2 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 8017e90: b8 4c 10 00 or r2,r2,r12 8017e94: 59 a2 00 00 sw (r13+0),r2 8017e98: 34 01 00 01 mvi r1,1 8017e9c: 31 61 00 88 sb (r11+136),r1 fat_buf_mark_modified(fs_info); break; 8017ea0: e0 00 00 05 bi 8017eb4 default: rtems_set_errno_and_return_minus_one(EIO); 8017ea4: f8 00 06 da calli 8019a0c <__errno> <== NOT EXECUTED 8017ea8: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8017eac: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8017eb0: 34 0e ff ff mvi r14,-1 <== NOT EXECUTED break; } return RC_OK; } 8017eb4: b9 c0 08 00 mv r1,r14 8017eb8: 2b 9d 00 04 lw ra,(sp+4) 8017ebc: 2b 8b 00 24 lw r11,(sp+36) 8017ec0: 2b 8c 00 20 lw r12,(sp+32) 8017ec4: 2b 8d 00 1c lw r13,(sp+28) 8017ec8: 2b 8e 00 18 lw r14,(sp+24) 8017ecc: 2b 8f 00 14 lw r15,(sp+20) 8017ed0: 2b 90 00 10 lw r16,(sp+16) 8017ed4: 2b 91 00 0c lw r17,(sp+12) 8017ed8: 2b 92 00 08 lw r18,(sp+8) 8017edc: 37 9c 00 28 addi sp,sp,40 8017ee0: c3 a0 00 00 ret =============================================================================== 08010f7c : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 8010f7c: 37 9c ff e8 addi sp,sp,-24 8010f80: 5b 8b 00 18 sw (sp+24),r11 8010f84: 5b 8c 00 14 sw (sp+20),r12 8010f88: 5b 8d 00 10 sw (sp+16),r13 8010f8c: 5b 8e 00 0c sw (sp+12),r14 8010f90: 5b 8f 00 08 sw (sp+8),r15 8010f94: 5b 9d 00 04 sw (sp+4),ra 8010f98: b8 20 58 00 mv r11,r1 int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 8010f9c: fb ff ff b6 calli 8010e74 8010fa0: b8 20 60 00 mv r12,r1 if ( rc != RC_OK ) 8010fa4: 44 20 00 02 be r1,r0,8010fac <== ALWAYS TAKEN rc = -1; 8010fa8: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8010fac: 34 0d 00 00 mvi r13,0 for (i = 0; i < FAT_HASH_SIZE; i++) 8010fb0: 34 0e 00 18 mvi r14,24 { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; 8010fb4: 29 6f 00 6c lw r15,(r11+108) 8010fb8: b5 ed 78 00 add r15,r15,r13 while ( (node = rtems_chain_get(the_chain)) != NULL ) 8010fbc: e0 00 00 02 bi 8010fc4 free(node); 8010fc0: fb ff c8 03 calli 8002fcc */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 8010fc4: b9 e0 08 00 mv r1,r15 8010fc8: fb ff d4 86 calli 80061e0 <_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 ) 8010fcc: 5c 20 ff fd bne r1,r0,8010fc0 8010fd0: 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++) 8010fd4: 5d ae ff f8 bne r13,r14,8010fb4 8010fd8: 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++) 8010fdc: 34 0e 00 18 mvi r14,24 { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; 8010fe0: 29 6f 00 70 lw r15,(r11+112) 8010fe4: b5 ed 78 00 add r15,r15,r13 while ( (node = rtems_chain_get(the_chain)) != NULL ) 8010fe8: e0 00 00 02 bi 8010ff0 free(node); 8010fec: fb ff c7 f8 calli 8002fcc <== NOT EXECUTED 8010ff0: b9 e0 08 00 mv r1,r15 8010ff4: fb ff d4 7b calli 80061e0 <_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 ) 8010ff8: 5c 20 ff fd bne r1,r0,8010fec <== NEVER TAKEN 8010ffc: 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++) 8011000: 5d ae ff f8 bne r13,r14,8010fe0 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); 8011004: 29 61 00 6c lw r1,(r11+108) 8011008: fb ff c7 f1 calli 8002fcc free(fs_info->rhash); 801100c: 29 61 00 70 lw r1,(r11+112) 8011010: fb ff c7 ef calli 8002fcc free(fs_info->uino); 8011014: 29 61 00 74 lw r1,(r11+116) 8011018: fb ff c7 ed calli 8002fcc free(fs_info->sec_buf); 801101c: 29 61 00 90 lw r1,(r11+144) 8011020: fb ff c7 eb calli 8002fcc close(fs_info->vol.fd); 8011024: 29 61 00 60 lw r1,(r11+96) 8011028: fb ff c7 be calli 8002f20 if (rc) 801102c: 45 80 00 04 be r12,r0,801103c <== ALWAYS TAKEN errno = EIO; 8011030: f8 00 22 77 calli 8019a0c <__errno> <== NOT EXECUTED 8011034: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8011038: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED return rc; } 801103c: b9 80 08 00 mv r1,r12 8011040: 2b 9d 00 04 lw ra,(sp+4) 8011044: 2b 8b 00 18 lw r11,(sp+24) 8011048: 2b 8c 00 14 lw r12,(sp+20) 801104c: 2b 8d 00 10 lw r13,(sp+16) 8011050: 2b 8e 00 0c lw r14,(sp+12) 8011054: 2b 8f 00 08 lw r15,(sp+8) 8011058: 37 9c 00 18 addi sp,sp,24 801105c: c3 a0 00 00 ret =============================================================================== 08010e74 : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 8010e74: 37 9c ff e8 addi sp,sp,-24 8010e78: 5b 8b 00 14 sw (sp+20),r11 8010e7c: 5b 8c 00 10 sw (sp+16),r12 8010e80: 5b 8d 00 0c sw (sp+12),r13 8010e84: 5b 8e 00 08 sw (sp+8),r14 8010e88: 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) 8010e8c: 40 23 00 0e lbu r3,(r1+14) return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 8010e90: 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) 8010e94: 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; 8010e98: 34 02 00 00 mvi r2,0 8010e9c: 34 0e 00 00 mvi r14,0 if (fs_info->vol.type == FAT_FAT32) 8010ea0: 5c 61 00 1e bne r3,r1,8010f18 { uint32_t free_count = fs_info->vol.free_cls; 8010ea4: 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) 8010ea8: 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; 8010eac: 29 6c 00 4c lw r12,(r11+76) if (free_count != fs_info->vol.free_cls_in_fs_info) 8010eb0: 45 a1 00 0c be r13,r1,8010ee0 <== ALWAYS TAKEN { uint32_t le_free_count = CT_LE_L(free_count); 8010eb4: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8010eb8: fb ff fb 9d calli 800fd2c <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; ret1 = fat_sector_write(fs_info, 8010ebc: 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); 8010ec0: 5b 81 00 18 sw (sp+24),r1 <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; 8010ec4: 59 6d 00 48 sw (r11+72),r13 <== NOT EXECUTED ret1 = fat_sector_write(fs_info, 8010ec8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8010ecc: 34 03 01 e8 mvi r3,488 <== NOT EXECUTED 8010ed0: 34 04 00 04 mvi r4,4 <== NOT EXECUTED 8010ed4: 37 85 00 18 addi r5,sp,24 <== NOT EXECUTED 8010ed8: fb ff fc a6 calli 8010170 <== NOT EXECUTED 8010edc: 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) 8010ee0: 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; 8010ee4: 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) 8010ee8: 45 81 00 0c be r12,r1,8010f18 <== NEVER TAKEN { uint32_t le_next_free = CT_LE_L(next_free); 8010eec: b9 80 08 00 mv r1,r12 8010ef0: fb ff fb 8f calli 800fd2c fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 8010ef4: 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); 8010ef8: 5b 81 00 18 sw (sp+24),r1 fs_info->vol.next_cl_in_fs_info = next_free; 8010efc: 59 6c 00 50 sw (r11+80),r12 ret2 = fat_sector_write(fs_info, 8010f00: b9 60 08 00 mv r1,r11 8010f04: 34 03 01 ec mvi r3,492 8010f08: 34 04 00 04 mvi r4,4 8010f0c: 37 85 00 18 addi r5,sp,24 8010f10: fb ff fc 98 calli 8010170 8010f14: b8 20 10 00 mv r2,r1 sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 8010f18: b8 40 08 00 mv r1,r2 8010f1c: 34 02 00 1f mvi r2,31 8010f20: f8 00 6c bc calli 802c210 <__lshrsi3> 8010f24: b8 20 60 00 mv r12,r1 8010f28: 34 02 00 1f mvi r2,31 8010f2c: b9 c0 08 00 mv r1,r14 8010f30: f8 00 6c b8 calli 802c210 <__lshrsi3> 8010f34: b9 81 08 00 or r1,r12,r1 8010f38: 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); 8010f3c: b9 60 08 00 mv r1,r11 8010f40: fb ff fb 9b calli 800fdac if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 8010f44: 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; 8010f48: 65 8c 00 00 cmpei r12,r12,0 8010f4c: 35 8c ff ff addi r12,r12,-1 fat_buf_release(fs_info); if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 8010f50: fb ff f3 ca calli 800de78 8010f54: 44 20 00 02 be r1,r0,8010f5c <== ALWAYS TAKEN rc = -1; 8010f58: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED return rc; } 8010f5c: b9 80 08 00 mv r1,r12 8010f60: 2b 9d 00 04 lw ra,(sp+4) 8010f64: 2b 8b 00 14 lw r11,(sp+20) 8010f68: 2b 8c 00 10 lw r12,(sp+16) 8010f6c: 2b 8d 00 0c lw r13,(sp+12) 8010f70: 2b 8e 00 08 lw r14,(sp+8) 8010f74: 37 9c 00 18 addi sp,sp,24 8010f78: c3 a0 00 00 ret =============================================================================== 08032998 : /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { 8032998: 37 9c ff 90 addi sp,sp,-112 803299c: 5b 8b 00 10 sw (sp+16),r11 80329a0: 5b 8c 00 0c sw (sp+12),r12 80329a4: 5b 8d 00 08 sw (sp+8),r13 80329a8: 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 ); 80329ac: 78 02 08 06 mvhi r2,0x806 80329b0: 38 42 40 10 ori r2,r2,0x4010 80329b4: 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; 80329b8: 5b 80 00 20 sw (sp+32),r0 st.st_uid = 0; 80329bc: 0f 80 00 26 sh (sp+38),r0 st.st_gid = 0; 80329c0: 0f 80 00 28 sh (sp+40),r0 rtems_libio_check_fd( fd ); 80329c4: 54 41 00 02 bgu r2,r1,80329cc 80329c8: e0 00 00 0a bi 80329f0 iop = rtems_libio_iop( fd ); 80329cc: 78 0b 08 06 mvhi r11,0x806 80329d0: 39 6b 7e c0 ori r11,r11,0x7ec0 80329d4: 34 02 00 2c mvi r2,44 80329d8: f8 00 92 c6 calli 80574f0 <__mulsi3> 80329dc: 29 6c 00 00 lw r12,(r11+0) 80329e0: b5 81 60 00 add r12,r12,r1 rtems_libio_check_is_open( iop ); 80329e4: 29 81 00 08 lw r1,(r12+8) 80329e8: 20 21 01 00 andi r1,r1,0x100 80329ec: 5c 20 00 06 bne r1,r0,8032a04 80329f0: f8 00 14 79 calli 8037bd4 <__errno> 80329f4: 34 02 00 09 mvi r2,9 80329f8: 58 22 00 00 sw (r1+0),r2 80329fc: 34 0b ff ff mvi r11,-1 8032a00: e0 00 00 23 bi 8032a8c if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } 8032a04: 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 ); 8032a08: 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 ); 8032a0c: 28 22 00 0c lw r2,(r1+12) 8032a10: 28 42 00 00 lw r2,(r2+0) 8032a14: d8 40 00 00 call r2 8032a18: 29 81 00 1c lw r1,(r12+28) 8032a1c: 37 82 00 14 addi r2,sp,20 8032a20: 28 23 00 18 lw r3,(r1+24) 8032a24: b9 a0 08 00 mv r1,r13 8032a28: d8 60 00 00 call r3 8032a2c: b8 20 58 00 mv r11,r1 if ( rv == 0 ) { 8032a30: 5c 20 00 0f bne r1,r0,8032a6c <== NEVER TAKEN bool access_ok = rtems_filesystem_check_access( 8032a34: 2b 82 00 20 lw r2,(sp+32) 8032a38: 2f 83 00 26 lhu r3,(sp+38) 8032a3c: 2f 84 00 28 lhu r4,(sp+40) 8032a40: 34 01 00 01 mvi r1,1 8032a44: fb ff 61 01 calli 800ae48 st.st_mode, st.st_uid, st.st_gid ); if ( access_ok ) { 8032a48: 44 2b 00 05 be r1,r11,8032a5c rtems_filesystem_location_clone( &loc, &iop->pathinfo ); 8032a4c: 37 81 00 5c addi r1,sp,92 8032a50: b9 a0 10 00 mv r2,r13 8032a54: fb ff 5f 25 calli 800a6e8 8032a58: e0 00 00 05 bi 8032a6c } else { errno = EACCES; 8032a5c: f8 00 14 5e calli 8037bd4 <__errno> 8032a60: 34 02 00 0d mvi r2,13 8032a64: 58 22 00 00 sw (r1+0),r2 rv = -1; 8032a68: 34 0b ff ff mvi r11,-1 if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } 8032a6c: 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 ); 8032a70: 28 22 00 0c lw r2,(r1+12) 8032a74: 28 42 00 04 lw r2,(r2+4) 8032a78: d8 40 00 00 call r2 rv = -1; } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { 8032a7c: 5d 60 00 04 bne r11,r0,8032a8c rv = rtems_filesystem_chdir( &loc ); 8032a80: 37 81 00 5c addi r1,sp,92 8032a84: fb ff bc de calli 8021dfc 8032a88: b8 20 58 00 mv r11,r1 } return rv; } 8032a8c: b9 60 08 00 mv r1,r11 8032a90: 2b 9d 00 04 lw ra,(sp+4) 8032a94: 2b 8b 00 10 lw r11,(sp+16) 8032a98: 2b 8c 00 0c lw r12,(sp+12) 8032a9c: 2b 8d 00 08 lw r13,(sp+8) 8032aa0: 37 9c 00 70 addi sp,sp,112 8032aa4: c3 a0 00 00 ret =============================================================================== 08022458 : /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 8022458: 37 9c ff f4 addi sp,sp,-12 802245c: 5b 8b 00 0c sw (sp+12),r11 8022460: 5b 8c 00 08 sw (sp+8),r12 8022464: 5b 9d 00 04 sw (sp+4),ra int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8022468: 78 03 08 06 mvhi r3,0x806 802246c: 38 63 40 10 ori r3,r3,0x4010 /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 8022470: b8 40 60 00 mv r12,r2 int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8022474: 28 62 00 00 lw r2,(r3+0) 8022478: 54 41 00 02 bgu r2,r1,8022480 802247c: e0 00 00 0a bi 80224a4 iop = rtems_libio_iop( fd ); 8022480: 78 0b 08 06 mvhi r11,0x806 8022484: 39 6b 7e c0 ori r11,r11,0x7ec0 8022488: 34 02 00 2c mvi r2,44 802248c: f8 00 d4 19 calli 80574f0 <__mulsi3> 8022490: 29 6b 00 00 lw r11,(r11+0) 8022494: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open(iop); 8022498: 29 61 00 08 lw r1,(r11+8) 802249c: 20 21 01 00 andi r1,r1,0x100 80224a0: 5c 20 00 04 bne r1,r0,80224b0 80224a4: f8 00 55 cc calli 8037bd4 <__errno> 80224a8: 34 02 00 09 mvi r2,9 80224ac: e0 00 00 15 bi 8022500 if (iop->pathinfo.mt_entry->writeable) { 80224b0: 29 61 00 20 lw r1,(r11+32) 80224b4: 40 22 00 29 lbu r2,(r1+41) 80224b8: 44 40 00 10 be r2,r0,80224f8 <== 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 ); 80224bc: 28 22 00 0c lw r2,(r1+12) 80224c0: 28 42 00 00 lw r2,(r2+0) 80224c4: d8 40 00 00 call r2 rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); 80224c8: 29 61 00 20 lw r1,(r11+32) 80224cc: b9 80 10 00 mv r2,r12 80224d0: 28 21 00 0c lw r1,(r1+12) 80224d4: 28 23 00 20 lw r3,(r1+32) 80224d8: 35 61 00 0c addi r1,r11,12 80224dc: d8 60 00 00 call r3 80224e0: b8 20 60 00 mv r12,r1 errno = EROFS; rv = -1; } return rv; } 80224e4: 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 ); 80224e8: 28 22 00 0c lw r2,(r1+12) 80224ec: 28 42 00 04 lw r2,(r2+4) 80224f0: d8 40 00 00 call r2 80224f4: e0 00 00 05 bi 8022508 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; 80224f8: f8 00 55 b7 calli 8037bd4 <__errno> <== NOT EXECUTED 80224fc: 34 02 00 1e mvi r2,30 <== NOT EXECUTED 8022500: 58 22 00 00 sw (r1+0),r2 rv = -1; 8022504: 34 0c ff ff mvi r12,-1 } return rv; } 8022508: b9 80 08 00 mv r1,r12 802250c: 2b 9d 00 04 lw ra,(sp+4) 8022510: 2b 8b 00 0c lw r11,(sp+12) 8022514: 2b 8c 00 08 lw r12,(sp+8) 8022518: 37 9c 00 0c addi sp,sp,12 802251c: c3 a0 00 00 ret =============================================================================== 08022520 : /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 8022520: 37 9c ff f0 addi sp,sp,-16 8022524: 5b 8b 00 10 sw (sp+16),r11 8022528: 5b 8c 00 0c sw (sp+12),r12 802252c: 5b 8d 00 08 sw (sp+8),r13 8022530: 5b 9d 00 04 sw (sp+4),ra int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8022534: 78 04 08 06 mvhi r4,0x806 8022538: 38 84 40 10 ori r4,r4,0x4010 /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 802253c: 20 4d ff ff andi r13,r2,0xffff int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8022540: 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 ) { 8022544: 20 6c ff ff andi r12,r3,0xffff int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8022548: 54 41 00 02 bgu r2,r1,8022550 802254c: e0 00 00 0a bi 8022574 iop = rtems_libio_iop( fd ); 8022550: 78 0b 08 06 mvhi r11,0x806 8022554: 39 6b 7e c0 ori r11,r11,0x7ec0 8022558: 34 02 00 2c mvi r2,44 802255c: f8 00 d3 e5 calli 80574f0 <__mulsi3> 8022560: 29 6b 00 00 lw r11,(r11+0) 8022564: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open(iop); 8022568: 29 61 00 08 lw r1,(r11+8) 802256c: 20 21 01 00 andi r1,r1,0x100 8022570: 5c 20 00 04 bne r1,r0,8022580 8022574: f8 00 55 98 calli 8037bd4 <__errno> 8022578: 34 02 00 09 mvi r2,9 802257c: e0 00 00 16 bi 80225d4 if (iop->pathinfo.mt_entry->writeable) { 8022580: 29 61 00 20 lw r1,(r11+32) 8022584: 40 22 00 29 lbu r2,(r1+41) 8022588: 44 40 00 11 be r2,r0,80225cc <== 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 ); 802258c: 28 22 00 0c lw r2,(r1+12) 8022590: 28 42 00 00 lw r2,(r2+0) 8022594: d8 40 00 00 call r2 rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( 8022598: 29 61 00 20 lw r1,(r11+32) 802259c: b9 a0 10 00 mv r2,r13 80225a0: b9 80 18 00 mv r3,r12 80225a4: 28 21 00 0c lw r1,(r1+12) 80225a8: 28 24 00 24 lw r4,(r1+36) 80225ac: 35 61 00 0c addi r1,r11,12 80225b0: d8 80 00 00 call r4 80225b4: b8 20 60 00 mv r12,r1 errno = EROFS; rv = -1; } return rv; } 80225b8: 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 ); 80225bc: 28 22 00 0c lw r2,(r1+12) 80225c0: 28 42 00 04 lw r2,(r2+4) 80225c4: d8 40 00 00 call r2 80225c8: e0 00 00 05 bi 80225dc owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 80225cc: f8 00 55 82 calli 8037bd4 <__errno> <== NOT EXECUTED 80225d0: 34 02 00 1e mvi r2,30 <== NOT EXECUTED 80225d4: 58 22 00 00 sw (r1+0),r2 rv = -1; 80225d8: 34 0c ff ff mvi r12,-1 } return rv; } 80225dc: b9 80 08 00 mv r1,r12 80225e0: 2b 9d 00 04 lw ra,(sp+4) 80225e4: 2b 8b 00 10 lw r11,(sp+16) 80225e8: 2b 8c 00 0c lw r12,(sp+12) 80225ec: 2b 8d 00 08 lw r13,(sp+8) 80225f0: 37 9c 00 10 addi sp,sp,16 80225f4: c3 a0 00 00 ret =============================================================================== 080330f0 : int fcntl( int fd, int cmd, ... ) { 80330f0: 37 9c ff cc addi sp,sp,-52 80330f4: 5b 8b 00 18 sw (sp+24),r11 80330f8: 5b 8c 00 14 sw (sp+20),r12 80330fc: 5b 8d 00 10 sw (sp+16),r13 8033100: 5b 8e 00 0c sw (sp+12),r14 8033104: 5b 8f 00 08 sw (sp+8),r15 8033108: 5b 9d 00 04 sw (sp+4),ra 803310c: 5b 82 00 1c sw (sp+28),r2 8033110: b8 40 70 00 mv r14,r2 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8033114: 78 02 08 03 mvhi r2,0x803 int fcntl( int fd, int cmd, ... ) { 8033118: 5b 83 00 20 sw (sp+32),r3 803311c: 5b 84 00 24 sw (sp+36),r4 8033120: 5b 85 00 28 sw (sp+40),r5 8033124: 5b 86 00 2c sw (sp+44),r6 8033128: 5b 87 00 30 sw (sp+48),r7 803312c: 5b 88 00 34 sw (sp+52),r8 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8033130: 38 42 90 14 ori r2,r2,0x9014 8033134: 28 42 00 00 lw r2,(r2+0) ... ) { int ret; va_list ap; va_start( ap, cmd ); 8033138: 37 8f 00 20 addi r15,sp,32 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 803313c: 54 41 00 02 bgu r2,r1,8033144 8033140: e0 00 00 0a bi 8033168 iop = rtems_libio_iop( fd ); 8033144: 78 0b 08 04 mvhi r11,0x804 8033148: 39 6b 99 14 ori r11,r11,0x9914 803314c: 34 02 00 2c mvi r2,44 8033150: fb ff 39 32 calli 8001618 <__mulsi3> 8033154: 29 6b 00 00 lw r11,(r11+0) 8033158: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open(iop); 803315c: 29 6c 00 08 lw r12,(r11+8) 8033160: 21 81 01 00 andi r1,r12,0x100 8033164: 5c 20 00 04 bne r1,r0,8033174 8033168: fb ff b2 2b calli 801fa14 <__errno> 803316c: 34 02 00 09 mvi r2,9 8033170: e0 00 00 57 bi 80332cc /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 8033174: 34 01 00 09 mvi r1,9 8033178: 55 c1 00 53 bgu r14,r1,80332c4 803317c: 78 0d 08 03 mvhi r13,0x803 8033180: b9 c0 08 00 mv r1,r14 8033184: 34 02 00 02 mvi r2,2 8033188: fb ff 38 d6 calli 80014e0 <__ashlsi3> 803318c: 39 ad 8d 40 ori r13,r13,0x8d40 8033190: b5 a1 08 00 add r1,r13,r1 8033194: 28 21 00 00 lw r1,(r1+0) 8033198: 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(); 803319c: fb ff 4d f2 calli 8006964 80331a0: b8 20 68 00 mv r13,r1 if (diop != NULL) { 80331a4: 44 20 00 56 be r1,r0,80332fc int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 80331a8: 29 61 00 08 lw r1,(r11+8) oflag &= ~O_CREAT; 80331ac: 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 ); 80331b0: fb ff 4d d9 calli 8006914 oflag &= ~O_CREAT; 80331b4: a0 2c 60 00 and r12,r1,r12 diop->flags |= rtems_libio_fcntl_flags( oflag ); 80331b8: 29 af 00 08 lw r15,(r13+8) 80331bc: b9 80 08 00 mv r1,r12 80331c0: fb ff 4d bf calli 80068bc 80331c4: b8 2f 08 00 or r1,r1,r15 80331c8: 59 a1 00 08 sw (r13+8),r1 int cmd, int arg ) { return fcntl( fd, cmd, arg ); } 80331cc: 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 ); 80331d0: 28 22 00 0c lw r2,(r1+12) 80331d4: 28 42 00 00 lw r2,(r2+0) 80331d8: 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 ); 80331dc: 35 a1 00 0c addi r1,r13,12 80331e0: 35 62 00 0c addi r2,r11,12 80331e4: fb ff 85 84 calli 80147f4 int cmd, int arg ) { return fcntl( fd, cmd, arg ); } 80331e8: 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 ); 80331ec: 28 22 00 0c lw r2,(r1+12) 80331f0: 28 42 00 04 lw r2,(r2+4) 80331f4: 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 ); 80331f8: 29 a1 00 1c lw r1,(r13+28) 80331fc: b9 80 18 00 mv r3,r12 8033200: 34 02 00 00 mvi r2,0 8033204: 28 25 00 00 lw r5,(r1+0) 8033208: 34 04 00 00 mvi r4,0 803320c: b9 a0 08 00 mv r1,r13 8033210: d8 a0 00 00 call r5 8033214: b8 20 60 00 mv r12,r1 if ( rv == 0 ) { 8033218: 5c 20 00 0c bne r1,r0,8033248 <== NEVER TAKEN rv = diop - rtems_libio_iops; 803321c: 78 01 08 04 mvhi r1,0x804 8033220: 38 21 99 14 ori r1,r1,0x9914 8033224: 28 21 00 00 lw r1,(r1+0) 8033228: 34 02 00 02 mvi r2,2 803322c: c9 a1 08 00 sub r1,r13,r1 8033230: fb ff fe f8 calli 8032e10 <__ashrsi3> 8033234: 78 03 08 03 mvhi r3,0x803 8033238: 38 63 48 f4 ori r3,r3,0x48f4 803323c: 28 62 00 00 lw r2,(r3+0) 8033240: fb ff 38 f6 calli 8001618 <__mulsi3> 8033244: e0 00 00 11 bi 8033288 } else { rtems_libio_free( diop ); 8033248: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 803324c: fb ff 4d dc calli 80069bc <== NOT EXECUTED 8033250: e0 00 00 21 bi 80332d4 <== 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); 8033254: 21 8c 08 00 andi r12,r12,0x800 8033258: 7d 8c 00 00 cmpnei r12,r12,0 803325c: e0 00 00 1f bi 80332d8 * 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 ) ) 8033260: 29 e1 00 00 lw r1,(r15+0) 8033264: 44 20 00 03 be r1,r0,8033270 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 8033268: 39 8c 08 00 ori r12,r12,0x800 803326c: e0 00 00 03 bi 8033278 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 8033270: 34 01 f7 ff mvi r1,-2049 8033274: a1 81 60 00 and r12,r12,r1 8033278: 59 6c 00 08 sw (r11+8),r12 803327c: e0 00 00 0d bi 80332b0 break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 8033280: b9 80 08 00 mv r1,r12 8033284: fb ff 4d a4 calli 8006914 8033288: b8 20 60 00 mv r12,r1 803328c: e0 00 00 12 bi 80332d4 break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 8033290: 29 e1 00 00 lw r1,(r15+0) 8033294: fb ff 4d 8a calli 80068bc /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 8033298: 29 63 00 08 lw r3,(r11+8) 803329c: 34 02 fd fe mvi r2,-514 80332a0: 20 21 02 01 andi r1,r1,0x201 80332a4: a0 43 10 00 and r2,r2,r3 80332a8: b8 22 08 00 or r1,r1,r2 80332ac: 59 61 00 08 sw (r11+8),r1 { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 80332b0: 34 0c 00 00 mvi r12,0 80332b4: e0 00 00 09 bi 80332d8 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 80332b8: fb ff b1 d7 calli 801fa14 <__errno> 80332bc: 34 02 00 86 mvi r2,134 80332c0: e0 00 00 03 bi 80332cc ret = -1; break; default: errno = EINVAL; 80332c4: fb ff b1 d4 calli 801fa14 <__errno> 80332c8: 34 02 00 16 mvi r2,22 80332cc: 58 22 00 00 sw (r1+0),r2 80332d0: e0 00 00 0b bi 80332fc /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 80332d4: 48 0c 00 0b bg r0,r12,8033300 <== NEVER TAKEN int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 80332d8: 29 61 00 1c lw r1,(r11+28) 80332dc: b9 c0 10 00 mv r2,r14 80332e0: 28 23 00 28 lw r3,(r1+40) 80332e4: b9 60 08 00 mv r1,r11 80332e8: d8 60 00 00 call r3 80332ec: b8 20 58 00 mv r11,r1 if (err) { 80332f0: 44 20 00 04 be r1,r0,8033300 <== ALWAYS TAKEN errno = err; 80332f4: fb ff b1 c8 calli 801fa14 <__errno> <== NOT EXECUTED 80332f8: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED ret = -1; 80332fc: 34 0c ff ff mvi r12,-1 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 8033300: b9 80 08 00 mv r1,r12 8033304: 2b 9d 00 04 lw ra,(sp+4) 8033308: 2b 8b 00 18 lw r11,(sp+24) 803330c: 2b 8c 00 14 lw r12,(sp+20) 8033310: 2b 8d 00 10 lw r13,(sp+16) 8033314: 2b 8e 00 0c lw r14,(sp+12) 8033318: 2b 8f 00 08 lw r15,(sp+8) 803331c: 37 9c 00 34 addi sp,sp,52 8033320: c3 a0 00 00 ret =============================================================================== 0800a164 : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 800a164: 37 9c ff dc addi sp,sp,-36 800a168: 5b 8b 00 20 sw (sp+32),r11 800a16c: 5b 8c 00 1c sw (sp+28),r12 800a170: 5b 8d 00 18 sw (sp+24),r13 800a174: 5b 8e 00 14 sw (sp+20),r14 800a178: 5b 8f 00 10 sw (sp+16),r15 800a17c: 5b 90 00 0c sw (sp+12),r16 800a180: 5b 91 00 08 sw (sp+8),r17 800a184: 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) { 800a188: 78 0b 08 02 mvhi r11,0x802 800a18c: 39 6b 27 0c ori r11,r11,0x270c int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 800a190: b8 20 70 00 mv r14,r1 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 800a194: 29 61 00 00 lw r1,(r11+0) int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 800a198: b8 40 68 00 mv r13,r2 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 800a19c: 5c 20 00 19 bne r1,r0,800a200 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 800a1a0: 78 01 08 02 mvhi r1,0x802 800a1a4: 38 21 27 88 ori r1,r1,0x2788 800a1a8: 28 21 00 00 lw r1,(r1+0) 800a1ac: 34 02 00 00 mvi r2,0 800a1b0: 34 03 00 00 mvi r3,0 800a1b4: fb ff eb 63 calli 8004f40 rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 800a1b8: 29 61 00 00 lw r1,(r11+0) free(pipe); } static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; 800a1bc: 34 0f 00 00 mvi r15,0 if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 800a1c0: 5c 2f 00 0a bne r1,r15,800a1e8 <== NEVER TAKEN sc = rtems_semaphore_create( 800a1c4: 78 02 08 02 mvhi r2,0x802 800a1c8: 38 42 0e 60 ori r2,r2,0xe60 800a1cc: 28 41 00 00 lw r1,(r2+0) 800a1d0: 34 03 00 54 mvi r3,84 800a1d4: 34 02 00 01 mvi r2,1 800a1d8: 34 04 00 00 mvi r4,0 800a1dc: b9 60 28 00 mv r5,r11 800a1e0: fb ff ea db calli 8004d4c 800a1e4: b8 20 78 00 mv r15,r1 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 800a1e8: 78 01 08 02 mvhi r1,0x802 800a1ec: 38 21 27 88 ori r1,r1,0x2788 800a1f0: 28 21 00 00 lw r1,(r1+0) } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 800a1f4: 34 0c ff f4 mvi r12,-12 800a1f8: fb ff eb a2 calli 8005080 800a1fc: 5d e0 00 c4 bne r15,r0,800a50c sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 800a200: 78 01 08 02 mvhi r1,0x802 800a204: 38 21 27 0c ori r1,r1,0x270c 800a208: 28 21 00 00 lw r1,(r1+0) 800a20c: 34 02 00 00 mvi r2,0 800a210: 34 03 00 00 mvi r3,0 800a214: fb ff eb 4b calli 8004f40 } if (sc == RTEMS_SUCCESSFUL) { 800a218: 34 0c ff f4 mvi r12,-12 800a21c: 5c 20 00 bc bne r1,r0,800a50c <== NEVER TAKEN err = pipe_lock(); if (err) return err; pipe = *pipep; 800a220: 29 cb 00 00 lw r11,(r14+0) if (pipe == NULL) { 800a224: 5d 61 00 43 bne r11,r1,800a330 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 800a228: 34 01 00 34 mvi r1,52 800a22c: fb ff e2 63 calli 8002bb8 800a230: b8 20 58 00 mv r11,r1 800a234: b8 20 78 00 mv r15,r1 if (pipe == NULL) 800a238: 44 20 00 3c be r1,r0,800a328 return err; memset(pipe, 0, sizeof(pipe_control_t)); 800a23c: 34 02 00 00 mvi r2,0 800a240: 34 03 00 34 mvi r3,52 800a244: f8 00 11 31 calli 800e708 pipe->Size = PIPE_BUF; 800a248: 34 01 02 00 mvi r1,512 800a24c: 59 61 00 04 sw (r11+4),r1 pipe->Buffer = malloc(pipe->Size); 800a250: fb ff e2 5a calli 8002bb8 800a254: 59 61 00 00 sw (r11+0),r1 if (! pipe->Buffer) 800a258: 44 20 00 32 be r1,r0,800a320 <== NEVER TAKEN goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), 800a25c: 78 0c 08 02 mvhi r12,0x802 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 800a260: 78 03 08 02 mvhi r3,0x802 800a264: 38 63 0e 64 ori r3,r3,0xe64 rtems_build_name ('P', 'I', 'r', c), 800a268: 39 8c 21 b0 ori r12,r12,0x21b0 800a26c: 41 82 00 00 lbu r2,(r12+0) if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 800a270: 28 61 00 00 lw r1,(r3+0) 800a274: 35 64 00 2c addi r4,r11,44 800a278: 34 03 00 00 mvi r3,0 800a27c: b8 41 08 00 or r1,r2,r1 800a280: 34 02 00 00 mvi r2,0 800a284: f8 00 04 4c calli 800b3b4 800a288: b8 20 88 00 mv r17,r1 800a28c: 5c 20 00 23 bne r1,r0,800a318 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 800a290: 78 03 08 02 mvhi r3,0x802 800a294: 38 63 0e 68 ori r3,r3,0xe68 rtems_build_name ('P', 'I', 'w', c), 800a298: 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( 800a29c: 28 61 00 00 lw r1,(r3+0) 800a2a0: 35 64 00 30 addi r4,r11,48 800a2a4: 34 03 00 00 mvi r3,0 800a2a8: b8 41 08 00 or r1,r2,r1 800a2ac: 34 02 00 00 mvi r2,0 800a2b0: f8 00 04 41 calli 800b3b4 800a2b4: b8 20 80 00 mv r16,r1 800a2b8: 5c 31 00 16 bne r1,r17,800a310 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 800a2bc: 78 03 08 02 mvhi r3,0x802 800a2c0: 38 63 0e 6c ori r3,r3,0xe6c rtems_build_name ('P', 'I', 's', c), 1, 800a2c4: 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( 800a2c8: 28 61 00 00 lw r1,(r3+0) 800a2cc: 34 04 00 00 mvi r4,0 800a2d0: 34 03 00 10 mvi r3,16 800a2d4: b8 41 08 00 or r1,r2,r1 800a2d8: 35 65 00 28 addi r5,r11,40 800a2dc: 34 02 00 01 mvi r2,1 800a2e0: fb ff ea 9b calli 8004d4c 800a2e4: 5c 30 00 09 bne r1,r16,800a308 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 800a2e8: 41 81 00 00 lbu r1,(r12+0) 800a2ec: 34 22 00 01 addi r2,r1,1 800a2f0: 31 82 00 00 sb (r12+0),r2 800a2f4: 34 02 00 7a mvi r2,122 800a2f8: 5c 22 00 0e bne r1,r2,800a330 c = 'a'; 800a2fc: 34 01 00 61 mvi r1,97 800a300: 31 81 00 00 sb (r12+0),r1 800a304: e0 00 00 0b bi 800a330 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 800a308: 29 61 00 30 lw r1,(r11+48) 800a30c: f8 00 04 66 calli 800b4a4 err_wbar: rtems_barrier_delete(pipe->readBarrier); 800a310: 29 e1 00 2c lw r1,(r15+44) 800a314: f8 00 04 64 calli 800b4a4 err_rbar: free(pipe->Buffer); 800a318: 29 e1 00 00 lw r1,(r15+0) 800a31c: fb ff e0 d1 calli 8002660 err_buf: free(pipe); 800a320: b9 e0 08 00 mv r1,r15 800a324: fb ff e0 cf calli 8002660 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 800a328: 34 0c ff f4 mvi r12,-12 800a32c: e0 00 00 10 bi 800a36c err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 800a330: 29 61 00 28 lw r1,(r11+40) 800a334: 34 02 00 00 mvi r2,0 800a338: 34 03 00 00 mvi r3,0 800a33c: fb ff eb 01 calli 8004f40 800a340: 7c 21 00 00 cmpnei r1,r1,0 800a344: 34 02 ff fc mvi r2,-4 800a348: c8 01 60 00 sub r12,r0,r1 err = -EINTR; if (*pipep == NULL) { 800a34c: 29 c1 00 00 lw r1,(r14+0) err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 800a350: a1 82 60 00 and r12,r12,r2 err = -EINTR; if (*pipep == NULL) { 800a354: 5c 20 00 06 bne r1,r0,800a36c if (err) 800a358: 45 81 00 04 be r12,r1,800a368 <== ALWAYS TAKEN pipe_free(pipe); 800a35c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800a360: fb ff ff 3d calli 800a054 <== NOT EXECUTED 800a364: e0 00 00 02 bi 800a36c <== NOT EXECUTED else *pipep = pipe; 800a368: 59 cb 00 00 sw (r14+0),r11 } out: pipe_unlock(); 800a36c: fb ff ff 31 calli 800a030 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 800a370: 5d 80 00 67 bne r12,r0,800a50c return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 800a374: 29 a1 00 08 lw r1,(r13+8) 800a378: 34 02 00 04 mvi r2,4 int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; 800a37c: 29 cb 00 00 lw r11,(r14+0) switch (LIBIO_ACCMODE(iop)) { 800a380: 20 21 00 06 andi r1,r1,0x6 800a384: 44 22 00 24 be r1,r2,800a414 800a388: 34 02 00 06 mvi r2,6 800a38c: 44 22 00 45 be r1,r2,800a4a0 800a390: 34 02 00 02 mvi r2,2 800a394: 5c 22 00 57 bne r1,r2,800a4f0 <== NEVER TAKEN case LIBIO_FLAGS_READ: pipe->readerCounter ++; 800a398: 29 61 00 20 lw r1,(r11+32) 800a39c: 34 21 00 01 addi r1,r1,1 800a3a0: 59 61 00 20 sw (r11+32),r1 if (pipe->Readers ++ == 0) 800a3a4: 29 61 00 10 lw r1,(r11+16) 800a3a8: 34 22 00 01 addi r2,r1,1 800a3ac: 59 62 00 10 sw (r11+16),r2 800a3b0: 5c 20 00 04 bne r1,r0,800a3c0 <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); 800a3b4: 29 61 00 30 lw r1,(r11+48) 800a3b8: 37 82 00 24 addi r2,sp,36 800a3bc: f8 00 04 6a calli 800b564 if (pipe->Writers == 0) { 800a3c0: 29 61 00 14 lw r1,(r11+20) 800a3c4: 5c 20 00 4b bne r1,r0,800a4f0 /* Not an error */ if (LIBIO_NODELAY(iop)) 800a3c8: 29 a2 00 08 lw r2,(r13+8) 800a3cc: 20 42 00 01 andi r2,r2,0x1 800a3d0: 5c 41 00 48 bne r2,r1,800a4f0 break; prevCounter = pipe->writerCounter; 800a3d4: 29 70 00 24 lw r16,(r11+36) err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 800a3d8: 29 61 00 28 lw r1,(r11+40) 800a3dc: fb ff eb 29 calli 8005080 if (! PIPE_READWAIT(pipe)) 800a3e0: 29 61 00 2c lw r1,(r11+44) 800a3e4: 34 02 00 00 mvi r2,0 800a3e8: f8 00 04 7c calli 800b5d8 800a3ec: b8 20 78 00 mv r15,r1 800a3f0: 5c 20 00 43 bne r1,r0,800a4fc <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) 800a3f4: 29 61 00 28 lw r1,(r11+40) 800a3f8: 34 02 00 00 mvi r2,0 800a3fc: 34 03 00 00 mvi r3,0 800a400: fb ff ea d0 calli 8004f40 800a404: 5c 2f 00 3e bne r1,r15,800a4fc <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->writerCounter); 800a408: 29 61 00 24 lw r1,(r11+36) 800a40c: 46 01 ff f3 be r16,r1,800a3d8 <== NEVER TAKEN 800a410: e0 00 00 38 bi 800a4f0 } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 800a414: 29 61 00 24 lw r1,(r11+36) 800a418: 34 21 00 01 addi r1,r1,1 800a41c: 59 61 00 24 sw (r11+36),r1 if (pipe->Writers ++ == 0) 800a420: 29 61 00 14 lw r1,(r11+20) 800a424: 34 22 00 01 addi r2,r1,1 800a428: 59 62 00 14 sw (r11+20),r2 800a42c: 5c 20 00 04 bne r1,r0,800a43c <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 800a430: 29 61 00 2c lw r1,(r11+44) 800a434: 37 82 00 24 addi r2,sp,36 800a438: f8 00 04 4b calli 800b564 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 800a43c: 29 61 00 10 lw r1,(r11+16) 800a440: 5c 20 00 2c bne r1,r0,800a4f0 800a444: 29 a2 00 08 lw r2,(r13+8) 800a448: 20 42 00 01 andi r2,r2,0x1 800a44c: 44 41 00 05 be r2,r1,800a460 PIPE_UNLOCK(pipe); 800a450: 29 61 00 28 lw r1,(r11+40) err = -ENXIO; 800a454: 34 0c ff fa mvi r12,-6 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); 800a458: fb ff eb 0a calli 8005080 err = -ENXIO; goto out_error; 800a45c: e0 00 00 29 bi 800a500 } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; 800a460: 29 70 00 20 lw r16,(r11+32) err = -EINTR; do { PIPE_UNLOCK(pipe); 800a464: 29 61 00 28 lw r1,(r11+40) 800a468: fb ff eb 06 calli 8005080 if (! PIPE_WRITEWAIT(pipe)) 800a46c: 29 61 00 30 lw r1,(r11+48) 800a470: 34 02 00 00 mvi r2,0 800a474: f8 00 04 59 calli 800b5d8 800a478: b8 20 78 00 mv r15,r1 800a47c: 5c 20 00 20 bne r1,r0,800a4fc <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) 800a480: 29 61 00 28 lw r1,(r11+40) 800a484: 34 02 00 00 mvi r2,0 800a488: 34 03 00 00 mvi r3,0 800a48c: fb ff ea ad calli 8004f40 800a490: 5c 2f 00 1b bne r1,r15,800a4fc <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->readerCounter); 800a494: 29 61 00 20 lw r1,(r11+32) 800a498: 46 01 ff f3 be r16,r1,800a464 <== NEVER TAKEN 800a49c: e0 00 00 15 bi 800a4f0 } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 800a4a0: 29 61 00 20 lw r1,(r11+32) 800a4a4: 34 21 00 01 addi r1,r1,1 800a4a8: 59 61 00 20 sw (r11+32),r1 if (pipe->Readers ++ == 0) 800a4ac: 29 61 00 10 lw r1,(r11+16) 800a4b0: 34 22 00 01 addi r2,r1,1 800a4b4: 59 62 00 10 sw (r11+16),r2 800a4b8: 5c 20 00 04 bne r1,r0,800a4c8 <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); 800a4bc: 29 61 00 30 lw r1,(r11+48) 800a4c0: 37 82 00 24 addi r2,sp,36 800a4c4: f8 00 04 28 calli 800b564 pipe->writerCounter ++; 800a4c8: 29 61 00 24 lw r1,(r11+36) 800a4cc: 34 21 00 01 addi r1,r1,1 800a4d0: 59 61 00 24 sw (r11+36),r1 if (pipe->Writers ++ == 0) 800a4d4: 29 61 00 14 lw r1,(r11+20) 800a4d8: 34 22 00 01 addi r2,r1,1 800a4dc: 59 62 00 14 sw (r11+20),r2 800a4e0: 5c 20 00 04 bne r1,r0,800a4f0 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 800a4e4: 29 61 00 2c lw r1,(r11+44) 800a4e8: 37 82 00 24 addi r2,sp,36 800a4ec: f8 00 04 1e calli 800b564 break; } PIPE_UNLOCK(pipe); 800a4f0: 29 61 00 28 lw r1,(r11+40) 800a4f4: fb ff ea e3 calli 8005080 return 0; 800a4f8: e0 00 00 05 bi 800a50c goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; 800a4fc: 34 0c ff fc mvi r12,-4 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 800a500: b9 c0 08 00 mv r1,r14 800a504: b9 a0 10 00 mv r2,r13 800a508: fb ff fe e5 calli 800a09c return err; } 800a50c: b9 80 08 00 mv r1,r12 800a510: 2b 9d 00 04 lw ra,(sp+4) 800a514: 2b 8b 00 20 lw r11,(sp+32) 800a518: 2b 8c 00 1c lw r12,(sp+28) 800a51c: 2b 8d 00 18 lw r13,(sp+24) 800a520: 2b 8e 00 14 lw r14,(sp+20) 800a524: 2b 8f 00 10 lw r15,(sp+16) 800a528: 2b 90 00 0c lw r16,(sp+12) 800a52c: 2b 91 00 08 lw r17,(sp+8) 800a530: 37 9c 00 24 addi sp,sp,36 800a534: c3 a0 00 00 ret =============================================================================== 0800878c : */ long fpathconf( int fd, int name ) { 800878c: 37 9c ff f0 addi sp,sp,-16 8008790: 5b 8b 00 10 sw (sp+16),r11 8008794: 5b 8c 00 0c sw (sp+12),r12 8008798: 5b 8d 00 08 sw (sp+8),r13 800879c: 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); 80087a0: 78 03 08 01 mvhi r3,0x801 80087a4: 38 63 20 04 ori r3,r3,0x2004 */ long fpathconf( int fd, int name ) { 80087a8: 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); 80087ac: 28 62 00 00 lw r2,(r3+0) 80087b0: 54 41 00 02 bgu r2,r1,80087b8 80087b4: e0 00 00 0a bi 80087dc iop = rtems_libio_iop(fd); 80087b8: 78 0b 08 01 mvhi r11,0x801 80087bc: 34 02 00 2c mvi r2,44 80087c0: f8 00 1a 54 calli 800f110 <__mulsi3> 80087c4: 39 6b 27 3c ori r11,r11,0x273c 80087c8: 29 63 00 00 lw r3,(r11+0) 80087cc: b4 61 18 00 add r3,r3,r1 rtems_libio_check_is_open(iop); 80087d0: 28 61 00 08 lw r1,(r3+8) 80087d4: 20 21 01 00 andi r1,r1,0x100 80087d8: 5c 20 00 04 bne r1,r0,80087e8 <== ALWAYS TAKEN 80087dc: f8 00 07 3f calli 800a4d8 <__errno> 80087e0: 34 02 00 09 mvi r2,9 80087e4: e0 00 00 27 bi 8008880 /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; 80087e8: 28 61 00 20 lw r1,(r3+32) 80087ec: 28 2b 00 2c lw r11,(r1+44) switch ( name ) { 80087f0: 34 01 00 0b mvi r1,11 80087f4: 55 a1 00 21 bgu r13,r1,8008878 80087f8: 78 0c 08 01 mvhi r12,0x801 80087fc: b9 a0 08 00 mv r1,r13 8008800: 34 02 00 02 mvi r2,2 8008804: f8 00 19 ce calli 800ef3c <__ashlsi3> 8008808: 39 8c 19 78 ori r12,r12,0x1978 800880c: b5 81 08 00 add r1,r12,r1 8008810: 28 21 00 00 lw r1,(r1+0) 8008814: c0 20 00 00 b r1 case _PC_LINK_MAX: return_value = the_limits->link_max; 8008818: 29 61 00 00 lw r1,(r11+0) break; 800881c: e0 00 00 1b bi 8008888 case _PC_MAX_CANON: return_value = the_limits->max_canon; 8008820: 29 61 00 04 lw r1,(r11+4) break; 8008824: e0 00 00 19 bi 8008888 case _PC_MAX_INPUT: return_value = the_limits->max_input; 8008828: 29 61 00 08 lw r1,(r11+8) break; 800882c: e0 00 00 17 bi 8008888 case _PC_NAME_MAX: return_value = the_limits->name_max; 8008830: 29 61 00 0c lw r1,(r11+12) break; 8008834: e0 00 00 15 bi 8008888 case _PC_PATH_MAX: return_value = the_limits->path_max; 8008838: 29 61 00 10 lw r1,(r11+16) break; 800883c: e0 00 00 13 bi 8008888 case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 8008840: 29 61 00 14 lw r1,(r11+20) break; 8008844: e0 00 00 11 bi 8008888 case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 8008848: 29 61 00 1c lw r1,(r11+28) break; 800884c: e0 00 00 0f bi 8008888 case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 8008850: 29 61 00 20 lw r1,(r11+32) break; 8008854: e0 00 00 0d bi 8008888 case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 8008858: 29 61 00 2c lw r1,(r11+44) break; 800885c: e0 00 00 0b bi 8008888 case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 8008860: 29 61 00 18 lw r1,(r11+24) break; 8008864: e0 00 00 09 bi 8008888 case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 8008868: 29 61 00 24 lw r1,(r11+36) break; 800886c: e0 00 00 07 bi 8008888 case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 8008870: 29 61 00 28 lw r1,(r11+40) break; 8008874: e0 00 00 05 bi 8008888 default: rtems_set_errno_and_return_minus_one( EINVAL ); 8008878: f8 00 07 18 calli 800a4d8 <__errno> 800887c: 34 02 00 16 mvi r2,22 8008880: 58 22 00 00 sw (r1+0),r2 8008884: 34 01 ff ff mvi r1,-1 break; } return return_value; } 8008888: 2b 9d 00 04 lw ra,(sp+4) 800888c: 2b 8b 00 10 lw r11,(sp+16) 8008890: 2b 8c 00 0c lw r12,(sp+12) 8008894: 2b 8d 00 08 lw r13,(sp+8) 8008898: 37 9c 00 10 addi sp,sp,16 800889c: c3 a0 00 00 ret =============================================================================== 08001554 : #include void free( void *ptr ) { 8001554: 37 9c ff f4 addi sp,sp,-12 8001558: 5b 8b 00 0c sw (sp+12),r11 800155c: 5b 8c 00 08 sw (sp+8),r12 8001560: 5b 9d 00 04 sw (sp+4),ra 8001564: b8 20 58 00 mv r11,r1 MSBUMP(free_calls, 1); 8001568: 78 01 08 01 mvhi r1,0x801 800156c: 38 21 d7 b0 ori r1,r1,0xd7b0 8001570: 28 22 00 0c lw r2,(r1+12) 8001574: 34 42 00 01 addi r2,r2,1 8001578: 58 22 00 0c sw (r1+12),r2 if ( !ptr ) 800157c: 45 60 00 1f be r11,r0,80015f8 return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 8001580: 78 01 08 01 mvhi r1,0x801 8001584: 38 21 da 54 ori r1,r1,0xda54 8001588: 28 22 00 00 lw r2,(r1+0) 800158c: 34 01 00 03 mvi r1,3 8001590: 5c 41 00 06 bne r2,r1,80015a8 <== NEVER TAKEN !malloc_is_system_state_OK() ) { 8001594: f8 00 00 8e calli 80017cc return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 8001598: 5c 20 00 04 bne r1,r0,80015a8 !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); 800159c: b9 60 08 00 mv r1,r11 80015a0: f8 00 00 a3 calli 800182c return; 80015a4: e0 00 00 15 bi 80015f8 } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 80015a8: 78 01 08 01 mvhi r1,0x801 80015ac: 38 21 d7 0c ori r1,r1,0xd70c 80015b0: 28 21 00 00 lw r1,(r1+0) 80015b4: 44 20 00 04 be r1,r0,80015c4 (*rtems_malloc_statistics_helpers->at_free)(ptr); 80015b8: 28 22 00 08 lw r2,(r1+8) 80015bc: b9 60 08 00 mv r1,r11 80015c0: d8 40 00 00 call r2 if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { 80015c4: 78 0c 08 01 mvhi r12,0x801 80015c8: 39 8c d0 54 ori r12,r12,0xd054 80015cc: 29 81 00 00 lw r1,(r12+0) 80015d0: b9 60 10 00 mv r2,r11 80015d4: f8 00 10 e3 calli 8005960 <_Protected_heap_Free> 80015d8: 5c 20 00 08 bne r1,r0,80015f8 printk( "Program heap: free of bad pointer %p -- range %p - %p \n", ptr, RTEMS_Malloc_Heap->area_begin, 80015dc: 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", 80015e0: 78 01 08 01 mvhi r1,0x801 80015e4: 38 21 b8 fc ori r1,r1,0xb8fc 80015e8: 28 83 00 18 lw r3,(r4+24) 80015ec: 28 84 00 1c lw r4,(r4+28) 80015f0: b9 60 10 00 mv r2,r11 80015f4: f8 00 03 d7 calli 8002550 RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } 80015f8: 2b 9d 00 04 lw ra,(sp+4) 80015fc: 2b 8b 00 0c lw r11,(sp+12) 8001600: 2b 8c 00 08 lw r12,(sp+8) 8001604: 37 9c 00 0c addi sp,sp,12 8001608: c3 a0 00 00 ret =============================================================================== 0801a7f8 : int fstat( int fd, struct stat *sbuf ) { 801a7f8: 37 9c ff f4 addi sp,sp,-12 801a7fc: 5b 8b 00 0c sw (sp+12),r11 801a800: 5b 8c 00 08 sw (sp+8),r12 801a804: 5b 9d 00 04 sw (sp+4),ra 801a808: b8 40 60 00 mv r12,r2 rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 801a80c: 5c 40 00 04 bne r2,r0,801a81c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 801a810: fb ff c3 ff calli 800b80c <__errno> <== NOT EXECUTED 801a814: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 801a818: e0 00 00 10 bi 801a858 <== NOT EXECUTED /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 801a81c: 78 02 08 01 mvhi r2,0x801 801a820: 38 42 d0 10 ori r2,r2,0xd010 801a824: 28 42 00 00 lw r2,(r2+0) 801a828: 50 22 00 0a bgeu r1,r2,801a850 801a82c: 78 0b 08 01 mvhi r11,0x801 801a830: 39 6b d7 a0 ori r11,r11,0xd7a0 801a834: 34 02 00 2c mvi r2,44 801a838: fb ff fe f5 calli 801a40c <__mulsi3> 801a83c: 29 6b 00 00 lw r11,(r11+0) 801a840: b5 61 58 00 add r11,r11,r1 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 801a844: 29 61 00 08 lw r1,(r11+8) 801a848: 20 21 01 00 andi r1,r1,0x100 801a84c: 5c 20 00 06 bne r1,r0,801a864 /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); rtems_libio_check_fd( fd ); 801a850: fb ff c3 ef calli 800b80c <__errno> 801a854: 34 02 00 09 mvi r2,9 801a858: 58 22 00 00 sw (r1+0),r2 801a85c: 34 01 ff ff mvi r1,-1 801a860: e0 00 00 0a bi 801a888 /* * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); 801a864: 34 02 00 00 mvi r2,0 801a868: 34 03 00 48 mvi r3,72 801a86c: b9 80 08 00 mv r1,r12 801a870: fb ff c7 22 calli 800c4f8 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 801a874: 29 61 00 1c lw r1,(r11+28) 801a878: b9 80 10 00 mv r2,r12 801a87c: 28 23 00 18 lw r3,(r1+24) 801a880: 35 61 00 0c addi r1,r11,12 801a884: d8 60 00 00 call r3 } 801a888: 2b 9d 00 04 lw ra,(sp+4) 801a88c: 2b 8b 00 0c lw r11,(sp+12) 801a890: 2b 8c 00 08 lw r12,(sp+8) 801a894: 37 9c 00 0c addi sp,sp,12 801a898: c3 a0 00 00 ret =============================================================================== 080013b0 : } } 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 96 d8 ori r4,r4,0x96d8 } } 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 <== NEVER TAKEN 80013e4: 78 04 08 01 mvhi r4,0x801 80013e8: 38 84 96 d4 ori r4,r4,0x96d4 80013ec: 28 8d 00 00 lw r13,(r4+0) 80013f0: 45 a0 00 16 be r13,r0,8001448 <== NEVER TAKEN rtems_disk_device_table *dtab = disktab + major; 80013f4: 34 02 00 03 mvi r2,3 80013f8: f8 00 54 c0 calli 80166f8 <__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 <== NEVER TAKEN 8001408: 28 8d 00 00 lw r13,(r4+0) 800140c: 45 a0 00 0f be r13,r0,8001448 <== 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 54 b8 calli 80166f8 <__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 8001428: 5d 80 00 08 bne r12,r0,8001448 if (!dd->deleted) { 800142c: 41 61 00 40 lbu r1,(r11+64) 8001430: 5c 2c 00 05 bne r1,r12,8001444 ++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 } 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 : */ 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 <== 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 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 <== 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 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 <== 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 if (n != RTEMS_IDE_SECTOR_SIZE) 8003034: 34 02 02 00 mvi r2,512 8003038: 44 22 00 05 be r1,r2,800304c <== ALWAYS TAKEN { free(s); 800303c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8003040: f8 00 03 d6 calli 8003f98 <== NOT EXECUTED return RTEMS_IO_ERROR; 8003044: 34 04 00 1b mvi r4,27 <== NOT EXECUTED 8003048: e0 00 00 04 bi 8003058 <== 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 =============================================================================== 08033364 : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 8033364: 37 9c ff f0 addi sp,sp,-16 8033368: 5b 8b 00 10 sw (sp+16),r11 803336c: 5b 8c 00 0c sw (sp+12),r12 8033370: 5b 8d 00 08 sw (sp+8),r13 8033374: 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 ); 8033378: 78 04 08 03 mvhi r4,0x803 803337c: 38 84 90 14 ori r4,r4,0x9014 int getdents( int dd_fd, char *dd_buf, int dd_len ) { 8033380: 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 ); 8033384: 28 82 00 00 lw r2,(r4+0) int getdents( int dd_fd, char *dd_buf, int dd_len ) { 8033388: 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 ); 803338c: 34 0b 00 00 mvi r11,0 8033390: 50 22 00 07 bgeu r1,r2,80333ac <== NEVER TAKEN 8033394: 78 0b 08 04 mvhi r11,0x804 8033398: 39 6b 99 14 ori r11,r11,0x9914 803339c: 34 02 00 2c mvi r2,44 80333a0: fb ff 38 9e calli 8001618 <__mulsi3> 80333a4: 29 6b 00 00 lw r11,(r11+0) 80333a8: b5 61 58 00 add r11,r11,r1 /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); 80333ac: 35 61 00 0c addi r1,r11,12 80333b0: fb ff 55 4c calli 80088e0 if ( type != RTEMS_FILESYSTEM_DIRECTORY ) 80333b4: 44 20 00 06 be r1,r0,80333cc rtems_set_errno_and_return_minus_one( ENOTDIR ); 80333b8: fb ff b1 97 calli 801fa14 <__errno> 80333bc: 34 02 00 14 mvi r2,20 80333c0: 58 22 00 00 sw (r1+0),r2 80333c4: 34 01 ff ff mvi r1,-1 80333c8: e0 00 00 07 bi 80333e4 /* * 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 ); 80333cc: 29 61 00 1c lw r1,(r11+28) 80333d0: b9 a0 10 00 mv r2,r13 80333d4: b9 80 18 00 mv r3,r12 80333d8: 28 24 00 08 lw r4,(r1+8) 80333dc: b9 60 08 00 mv r1,r11 80333e0: d8 80 00 00 call r4 } 80333e4: 2b 9d 00 04 lw ra,(sp+4) 80333e8: 2b 8b 00 10 lw r11,(sp+16) 80333ec: 2b 8c 00 0c lw r12,(sp+12) 80333f0: 2b 8d 00 08 lw r13,(sp+8) 80333f4: 37 9c 00 10 addi sp,sp,16 80333f8: c3 a0 00 00 ret =============================================================================== 0800160c : */ int gettimeofday( struct timeval *tp, void * __tz __attribute__((unused)) ) { 800160c: 37 9c ff e8 addi sp,sp,-24 8001610: 5b 8b 00 10 sw (sp+16),r11 8001614: 5b 8c 00 0c sw (sp+12),r12 8001618: 5b 8d 00 08 sw (sp+8),r13 800161c: 5b 9d 00 04 sw (sp+4),ra 8001620: b8 20 58 00 mv r11,r1 /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) 8001624: 5c 20 00 06 bne r1,r0,800163c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 8001628: f8 00 28 79 calli 800b80c <__errno> <== NOT EXECUTED 800162c: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 8001630: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8001634: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8001638: e0 00 00 1b bi 80016a4 <== NOT EXECUTED ) { Timestamp_Control snapshot_as_timestamp; Timestamp_Control *snapshot_as_timestamp_ptr; snapshot_as_timestamp_ptr = 800163c: 78 02 08 01 mvhi r2,0x801 8001640: 38 42 d8 60 ori r2,r2,0xd860 8001644: 37 81 00 14 addi r1,sp,20 8001648: f8 00 0c 7e calli 8004840 <_TOD_Get_with_nanoseconds> static inline void _Timestamp64_implementation_To_timeval( const Timestamp64_Control *_timestamp, struct timeval *_timeval ) { _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U); 800164c: 78 05 08 01 mvhi r5,0x801 struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); } 8001650: 28 2c 00 04 lw r12,(r1+4) 8001654: 28 2d 00 00 lw r13,(r1+0) 8001658: 38 a5 b9 34 ori r5,r5,0xb934 800165c: 28 a4 00 00 lw r4,(r5+0) 8001660: 34 03 00 00 mvi r3,0 8001664: b9 a0 08 00 mv r1,r13 8001668: b9 80 10 00 mv r2,r12 800166c: f8 00 4e 40 calli 8014f6c <__divdi3> _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); 8001670: 78 05 08 01 mvhi r5,0x801 8001674: 38 a5 b9 34 ori r5,r5,0xb934 8001678: 28 a4 00 00 lw r4,(r5+0) static inline void _Timestamp64_implementation_To_timeval( const Timestamp64_Control *_timestamp, struct timeval *_timeval ) { _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U); 800167c: 59 62 00 00 sw (r11+0),r2 _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); 8001680: 34 03 00 00 mvi r3,0 8001684: b9 a0 08 00 mv r1,r13 8001688: b9 80 10 00 mv r2,r12 800168c: f8 00 50 3a calli 8015774 <__moddi3> 8001690: 34 03 00 00 mvi r3,0 8001694: 34 04 03 e8 mvi r4,1000 8001698: f8 00 4e 35 calli 8014f6c <__divdi3> 800169c: 59 62 00 04 sw (r11+4),r2 * Timezone information ignored by the OS proper. Per email * with Eric Norum, this is how GNU/Linux, Solaris, and MacOS X * do it. This puts us in good company. */ return 0; 80016a0: 34 01 00 00 mvi r1,0 } 80016a4: 2b 9d 00 04 lw ra,(sp+4) 80016a8: 2b 8b 00 10 lw r11,(sp+16) 80016ac: 2b 8c 00 0c lw r12,(sp+12) 80016b0: 2b 8d 00 08 lw r13,(sp+8) 80016b4: 37 9c 00 18 addi sp,sp,24 80016b8: c3 a0 00 00 ret =============================================================================== 08022cbc : /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 8022cbc: 37 9c ff f0 addi sp,sp,-16 8022cc0: 5b 8b 00 10 sw (sp+16),r11 8022cc4: 5b 8c 00 0c sw (sp+12),r12 8022cc8: 5b 8d 00 08 sw (sp+8),r13 8022ccc: 5b 9d 00 04 sw (sp+4),ra FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 8022cd0: 78 01 08 06 mvhi r1,0x806 8022cd4: 38 21 7b b0 ori r1,r1,0x7bb0 8022cd8: 40 2d 00 00 lbu r13,(r1+0) 8022cdc: 5d a0 00 2f bne r13,r0,8022d98 return; etc_passwd_initted = 1; 8022ce0: 34 02 00 01 mvi r2,1 8022ce4: 30 22 00 00 sb (r1+0),r2 mkdir("/etc", 0777); 8022ce8: 78 01 08 05 mvhi r1,0x805 8022cec: 34 02 01 ff mvi r2,511 8022cf0: 38 21 dc 08 ori r1,r1,0xdc08 8022cf4: fb ff 7a 2c calli 80015a4 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 8022cf8: 78 0b 08 05 mvhi r11,0x805 8022cfc: 39 6b dc 10 ori r11,r11,0xdc10 8022d00: 78 02 08 05 mvhi r2,0x805 8022d04: b9 60 08 00 mv r1,r11 8022d08: 38 42 cc 08 ori r2,r2,0xcc08 8022d0c: f8 00 56 f7 calli 80388e8 8022d10: b8 20 60 00 mv r12,r1 8022d14: 5c 2d 00 0c bne r1,r13,8022d44 fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 8022d18: 78 02 08 05 mvhi r2,0x805 8022d1c: b9 60 08 00 mv r1,r11 8022d20: 38 42 99 1c ori r2,r2,0x991c 8022d24: f8 00 56 f1 calli 80388e8 8022d28: b8 20 58 00 mv r11,r1 8022d2c: 44 2c 00 07 be r1,r12,8022d48 <== NEVER TAKEN fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 8022d30: 78 01 08 05 mvhi r1,0x805 8022d34: 38 21 dc 1c ori r1,r1,0xdc1c 8022d38: b9 60 10 00 mv r2,r11 8022d3c: f8 00 57 6f calli 8038af8 "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 8022d40: b9 60 08 00 mv r1,r11 8022d44: f8 00 53 fc calli 8037d34 } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 8022d48: 78 0b 08 05 mvhi r11,0x805 8022d4c: 39 6b dc 84 ori r11,r11,0xdc84 8022d50: 78 02 08 05 mvhi r2,0x805 8022d54: b9 60 08 00 mv r1,r11 8022d58: 38 42 cc 08 ori r2,r2,0xcc08 8022d5c: f8 00 56 e3 calli 80388e8 8022d60: b8 20 60 00 mv r12,r1 8022d64: 5c 20 00 0c bne r1,r0,8022d94 fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { 8022d68: 78 02 08 05 mvhi r2,0x805 8022d6c: b9 60 08 00 mv r1,r11 8022d70: 38 42 99 1c ori r2,r2,0x991c 8022d74: f8 00 56 dd calli 80388e8 8022d78: b8 20 58 00 mv r11,r1 8022d7c: 44 2c 00 07 be r1,r12,8022d98 <== NEVER TAKEN fprintf( fp, "root:x:0:root\n" 8022d80: 78 01 08 05 mvhi r1,0x805 8022d84: 38 21 dc 90 ori r1,r1,0xdc90 8022d88: b9 60 10 00 mv r2,r11 8022d8c: f8 00 57 5b calli 8038af8 "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 8022d90: b9 60 08 00 mv r1,r11 8022d94: f8 00 53 e8 calli 8037d34 } } 8022d98: 2b 9d 00 04 lw ra,(sp+4) 8022d9c: 2b 8b 00 10 lw r11,(sp+16) 8022da0: 2b 8c 00 0c lw r12,(sp+12) 8022da4: 2b 8d 00 08 lw r13,(sp+8) 8022da8: 37 9c 00 10 addi sp,sp,16 8022dac: c3 a0 00 00 ret =============================================================================== 08002ab0 : 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 90 10 ori r3,r3,0x9010 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 8002af0: e0 00 00 0a bi 8002b18 iop = rtems_libio_iop( fd ); 8002af4: 34 02 00 2c mvi r2,44 8002af8: 78 0b 08 01 mvhi r11,0x801 8002afc: f8 00 4f 74 calli 80168cc <__mulsi3> 8002b00: 39 6b 98 00 ori r11,r11,0x9800 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 <== ALWAYS TAKEN 8002b18: f8 00 37 db calli 8010a84 <__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 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 : /* * 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 <== 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 c = tolower (c); 8004fd0: 78 01 08 02 mvhi r1,0x802 8004fd4: 38 21 62 94 ori r1,r1,0x6294 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 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 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 <== 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 <== NEVER TAKEN c = '\n'; 8005014: 34 0c 00 0a mvi r12,10 8005018: e0 00 00 08 bi 8005038 } 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 8005024: 20 42 00 40 andi r2,r2,0x40 8005028: 44 40 00 04 be r2,r0,8005038 <== ALWAYS TAKEN c = '\r'; 800502c: 34 0c 00 0d mvi r12,13 <== NOT EXECUTED 8005030: e0 00 00 02 bi 8005038 <== NOT EXECUTED } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 8005034: 45 80 00 2f be r12,r0,80050f0 <== 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 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 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 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 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 800506c: e0 00 00 34 bi 800513c 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 <== 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 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 <== NEVER TAKEN echo (c, tty); 800508c: b9 60 10 00 mv r2,r11 8005090: fb ff ff 1d calli 8004d04 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 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 <== NEVER TAKEN 80050b4: 41 61 00 51 lbu r1,(r11+81) 80050b8: 5c 2c 00 0e bne r1,r12,80050f0 <== 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 <== 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 <== 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 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 80050f0: 78 01 08 02 mvhi r1,0x802 80050f4: 38 21 61 40 ori r1,r1,0x6140 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 <== 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 <== 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 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 =============================================================================== 0801a8e8 : #if !defined(RTEMS_POSIX_API) int kill( pid_t pid, int sig ) { return 0; } 801a8e8: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 801a8ec: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08001f0c : extern void _wrapup_reent(struct _reent *); extern void _reclaim_reent(struct _reent *); void libc_wrapup(void) { 8001f0c: 37 9c ff f4 addi sp,sp,-12 8001f10: 5b 8b 00 0c sw (sp+12),r11 8001f14: 5b 8c 00 08 sw (sp+8),r12 8001f18: 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())) 8001f1c: 78 01 08 01 mvhi r1,0x801 8001f20: 38 21 da 54 ori r1,r1,0xda54 8001f24: 28 22 00 00 lw r2,(r1+0) 8001f28: 34 01 00 03 mvi r1,3 8001f2c: 5c 41 00 16 bne r2,r1,8001f84 <== NEVER TAKEN /* * This was already done if the user called exit() directly . _wrapup_reent(0); */ if (_REENT != _global_impure_ptr) { 8001f30: 78 01 08 01 mvhi r1,0x801 8001f34: 78 0b 08 01 mvhi r11,0x801 8001f38: 38 21 be 78 ori r1,r1,0xbe78 8001f3c: 39 6b d2 28 ori r11,r11,0xd228 8001f40: 28 2c 00 00 lw r12,(r1+0) 8001f44: 29 61 00 00 lw r1,(r11+0) 8001f48: 44 2c 00 04 be r1,r12,8001f58 _wrapup_reent(_global_impure_ptr); 8001f4c: b9 80 08 00 mv r1,r12 8001f50: f8 00 2a 44 calli 800c860 <_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; 8001f54: 59 6c 00 00 sw (r11+0),r12 * * Should this be changed to do *all* file streams? * _fwalk (_REENT, fclose); */ fclose (stdin); 8001f58: 78 0b 08 01 mvhi r11,0x801 8001f5c: 39 6b d2 28 ori r11,r11,0xd228 8001f60: 29 61 00 00 lw r1,(r11+0) 8001f64: 28 21 00 04 lw r1,(r1+4) 8001f68: f8 00 26 81 calli 800b96c fclose (stdout); 8001f6c: 29 61 00 00 lw r1,(r11+0) 8001f70: 28 21 00 08 lw r1,(r1+8) 8001f74: f8 00 26 7e calli 800b96c fclose (stderr); 8001f78: 29 61 00 00 lw r1,(r11+0) 8001f7c: 28 21 00 0c lw r1,(r1+12) 8001f80: f8 00 26 7b calli 800b96c } 8001f84: 2b 9d 00 04 lw ra,(sp+4) 8001f88: 2b 8b 00 0c lw r11,(sp+12) 8001f8c: 2b 8c 00 08 lw r12,(sp+8) 8001f90: 37 9c 00 0c addi sp,sp,12 8001f94: c3 a0 00 00 ret =============================================================================== 08001944 : #include "malloc_p.h" void *malloc( size_t size ) { 8001944: 37 9c ff f0 addi sp,sp,-16 8001948: 5b 8b 00 10 sw (sp+16),r11 800194c: 5b 8c 00 0c sw (sp+12),r12 8001950: 5b 8d 00 08 sw (sp+8),r13 8001954: 5b 9d 00 04 sw (sp+4),ra void *return_this; MSBUMP(malloc_calls, 1); 8001958: 78 03 08 01 mvhi r3,0x801 800195c: 38 63 d7 b0 ori r3,r3,0xd7b0 #include "malloc_p.h" void *malloc( size_t size ) { 8001960: b8 20 60 00 mv r12,r1 void *return_this; MSBUMP(malloc_calls, 1); 8001964: 28 61 00 04 lw r1,(r3+4) /* * Validate the parameters */ if ( !size ) return (void *) 0; 8001968: 34 0b 00 00 mvi r11,0 size_t size ) { void *return_this; MSBUMP(malloc_calls, 1); 800196c: 34 21 00 01 addi r1,r1,1 8001970: 58 61 00 04 sw (r3+4),r1 /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 8001974: fb ff ff a0 calli 80017f4 /* * Validate the parameters */ if ( !size ) 8001978: 45 80 00 2b be r12,r0,8001a24 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 800197c: 78 01 08 01 mvhi r1,0x801 8001980: 38 21 da 54 ori r1,r1,0xda54 8001984: 28 22 00 00 lw r2,(r1+0) 8001988: 34 01 00 03 mvi r1,3 800198c: 5c 41 00 03 bne r2,r1,8001998 !malloc_is_system_state_OK() ) 8001990: fb ff ff 8f calli 80017cc return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 8001994: 44 20 00 24 be r1,r0,8001a24 <== 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 ); 8001998: 78 0d 08 01 mvhi r13,0x801 800199c: 39 ad d0 54 ori r13,r13,0xd054 80019a0: 29 a1 00 00 lw r1,(r13+0) 80019a4: b9 80 10 00 mv r2,r12 80019a8: 34 03 00 00 mvi r3,0 80019ac: 34 04 00 00 mvi r4,0 80019b0: f8 00 0f d2 calli 80058f8 <_Protected_heap_Allocate_aligned_with_boundary> 80019b4: 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 ) { 80019b8: 5c 20 00 0d bne r1,r0,80019ec return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 80019bc: 78 01 08 01 mvhi r1,0x801 80019c0: 38 21 b2 08 ori r1,r1,0xb208 80019c4: 28 23 00 00 lw r3,(r1+0) 80019c8: 29 a1 00 00 lw r1,(r13+0) 80019cc: b9 80 10 00 mv r2,r12 80019d0: d8 60 00 00 call r3 80019d4: b8 20 58 00 mv r11,r1 if ( !return_this ) { 80019d8: 5c 20 00 05 bne r1,r0,80019ec <== NEVER TAKEN errno = ENOMEM; 80019dc: f8 00 27 8c calli 800b80c <__errno> 80019e0: 34 02 00 0c mvi r2,12 80019e4: 58 22 00 00 sw (r1+0),r2 return (void *) 0; 80019e8: e0 00 00 0f bi 8001a24 } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) 80019ec: 78 01 08 01 mvhi r1,0x801 80019f0: 38 21 d7 10 ori r1,r1,0xd710 80019f4: 28 23 00 00 lw r3,(r1+0) 80019f8: 44 60 00 04 be r3,r0,8001a08 (*rtems_malloc_dirty_helper)( return_this, size ); 80019fc: b9 60 08 00 mv r1,r11 8001a00: b9 80 10 00 mv r2,r12 8001a04: d8 60 00 00 call r3 /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 8001a08: 78 01 08 01 mvhi r1,0x801 8001a0c: 38 21 d7 0c ori r1,r1,0xd70c 8001a10: 28 21 00 00 lw r1,(r1+0) 8001a14: 44 20 00 04 be r1,r0,8001a24 (*rtems_malloc_statistics_helpers->at_malloc)(return_this); 8001a18: 28 22 00 04 lw r2,(r1+4) 8001a1c: b9 60 08 00 mv r1,r11 8001a20: d8 40 00 00 call r2 return return_this; } 8001a24: b9 60 08 00 mv r1,r11 8001a28: 2b 9d 00 04 lw ra,(sp+4) 8001a2c: 2b 8b 00 10 lw r11,(sp+16) 8001a30: 2b 8c 00 0c lw r12,(sp+12) 8001a34: 2b 8d 00 08 lw r13,(sp+8) 8001a38: 37 9c 00 10 addi sp,sp,16 8001a3c: c3 a0 00 00 ret =============================================================================== 0800ac50 : rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { 800ac50: 37 9c ff fc addi sp,sp,-4 800ac54: 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) 800ac58: 28 23 00 08 lw r3,(r1+8) mode_t mode ) { IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 800ac5c: 28 22 00 14 lw r2,(r1+20) if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; 800ac60: 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) 800ac64: 20 63 00 04 andi r3,r3,0x4 800ac68: 44 60 00 14 be r3,r0,800acb8 800ac6c: 28 43 00 4c lw r3,(r2+76) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { 800ac70: 28 64 00 00 lw r4,(r3+0) 800ac74: 34 03 00 05 mvi r3,5 800ac78: 5c 83 00 10 bne r4,r3,800acb8 <== ALWAYS TAKEN uint32_t count = the_jnode->info.linearfile.size; 800ac7c: 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; 800ac80: 78 05 08 01 mvhi r5,0x801 <== NOT EXECUTED 800ac84: 38 a5 bc e8 ori r5,r5,0xbce8 <== 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; 800ac88: 28 43 00 54 lw r3,(r2+84) <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; 800ac8c: 58 45 00 4c sw (r2+76),r5 <== NOT EXECUTED the_jnode->info.file.size = 0; 800ac90: 58 40 00 50 sw (r2+80),r0 <== NOT EXECUTED the_jnode->info.file.indirect = 0; 800ac94: 58 40 00 54 sw (r2+84),r0 <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; 800ac98: 58 40 00 58 sw (r2+88),r0 <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; 800ac9c: 58 40 00 5c sw (r2+92),r0 <== NOT EXECUTED if ((count != 0) 800aca0: 44 80 00 06 be r4,r0,800acb8 <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 800aca4: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 800aca8: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 800acac: fb ff ff 68 calli 800aa4c <== NOT EXECUTED return -1; } return 0; 800acb0: 64 21 ff ff cmpei r1,r1,-1 <== NOT EXECUTED 800acb4: c8 01 08 00 sub r1,r0,r1 <== NOT EXECUTED } 800acb8: 2b 9d 00 04 lw ra,(sp+4) 800acbc: 37 9c 00 04 addi sp,sp,4 800acc0: c3 a0 00 00 ret =============================================================================== 08001bc8 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8001bc8: 37 9c ff 78 addi sp,sp,-136 8001bcc: 5b 8b 00 38 sw (sp+56),r11 8001bd0: 5b 8c 00 34 sw (sp+52),r12 8001bd4: 5b 8d 00 30 sw (sp+48),r13 8001bd8: 5b 8e 00 2c sw (sp+44),r14 8001bdc: 5b 8f 00 28 sw (sp+40),r15 8001be0: 5b 90 00 24 sw (sp+36),r16 8001be4: 5b 91 00 20 sw (sp+32),r17 8001be8: 5b 92 00 1c sw (sp+28),r18 8001bec: 5b 93 00 18 sw (sp+24),r19 8001bf0: 5b 94 00 14 sw (sp+20),r20 8001bf4: 5b 95 00 10 sw (sp+16),r21 8001bf8: 5b 96 00 0c sw (sp+12),r22 8001bfc: 5b 97 00 08 sw (sp+8),r23 8001c00: 5b 9d 00 04 sw (sp+4),ra 8001c04: b8 20 88 00 mv r17,r1 int rv = 0; if ( 8001c08: 34 01 00 01 mvi r1,1 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8001c0c: b8 40 70 00 mv r14,r2 8001c10: b8 60 98 00 mv r19,r3 8001c14: b8 80 a8 00 mv r21,r4 8001c18: b8 a0 b8 00 mv r23,r5 int rv = 0; if ( 8001c1c: 54 81 00 a7 bgu r4,r1,8001eb8 options == RTEMS_FILESYSTEM_READ_ONLY || options == RTEMS_FILESYSTEM_READ_WRITE ) { rtems_filesystem_fsmount_me_t fsmount_me_h = 8001c20: b8 60 08 00 mv r1,r3 8001c24: f8 00 1b d0 calli 8008b64 8001c28: b8 20 a0 00 mv r20,r1 rtems_filesystem_get_mount_handler( filesystemtype ); if ( fsmount_me_h != NULL ) { 8001c2c: 44 20 00 a3 be r1,r0,8001eb8 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 8001c30: b9 c0 68 00 mv r13,r14 8001c34: 5d c0 00 03 bne r14,r0,8001c40 8001c38: 78 0d 08 01 mvhi r13,0x801 8001c3c: 39 ad b9 3c ori r13,r13,0xb93c size_t filesystemtype_size = strlen( filesystemtype ) + 1; 8001c40: ba 60 08 00 mv r1,r19 8001c44: f8 00 2d 37 calli 800d120 8001c48: 34 2c 00 01 addi r12,r1,1 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 8001c4c: 34 10 00 00 mvi r16,0 8001c50: 46 20 00 04 be r17,r0,8001c60 8001c54: ba 20 08 00 mv r1,r17 8001c58: f8 00 2d 32 calli 800d120 8001c5c: 34 30 00 01 addi r16,r1,1 size_t target_size = strlen( target ) + 1; 8001c60: b9 a0 08 00 mv r1,r13 8001c64: f8 00 2d 2f calli 800d120 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size 8001c68: 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; 8001c6c: 34 36 00 01 addi r22,r1,1 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size 8001c70: 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 ); 8001c74: 34 01 00 01 mvi r1,1 8001c78: b4 76 10 00 add r2,r3,r22 8001c7c: fb ff fd 66 calli 8001214 8001c80: b8 20 58 00 mv r11,r1 if ( mt_entry != NULL ) { 8001c84: 44 20 00 2a be r1,r0,8001d2c <== 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 ); 8001c88: 34 32 00 64 addi r18,r1,100 memcpy( str, filesystemtype, filesystemtype_size ); 8001c8c: 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 = 8001c90: 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 ); 8001c94: ba 60 10 00 mv r2,r19 8001c98: ba 40 08 00 mv r1,r18 8001c9c: f8 00 29 d6 calli 800c3f4 mt_entry->type = str; 8001ca0: 59 72 00 34 sw (r11+52),r18 str += filesystemtype_size; 8001ca4: b6 4c 60 00 add r12,r18,r12 if ( source_or_null != NULL ) { 8001ca8: 46 20 00 07 be r17,r0,8001cc4 memcpy( str, source_or_null, source_size ); 8001cac: b9 80 08 00 mv r1,r12 8001cb0: ba 20 10 00 mv r2,r17 8001cb4: ba 00 18 00 mv r3,r16 8001cb8: f8 00 29 cf calli 800c3f4 mt_entry->dev = str; 8001cbc: 59 6c 00 38 sw (r11+56),r12 str += source_size; 8001cc0: b5 90 60 00 add r12,r12,r16 } memcpy( str, target, target_size ); 8001cc4: b9 80 08 00 mv r1,r12 8001cc8: b9 a0 10 00 mv r2,r13 8001ccc: ba c0 18 00 mv r3,r22 8001cd0: f8 00 29 c9 calli 800c3f4 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; 8001cd4: 78 03 08 01 mvhi r3,0x801 memcpy( str, target, target_size ); mt_entry->target = str; str += target_size; mt_entry->mounted = true; 8001cd8: 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; 8001cdc: 38 63 b9 40 ori r3,r3,0xb940 mt_entry->dev = str; str += source_size; } memcpy( str, target, target_size ); mt_entry->target = str; 8001ce0: 59 6c 00 30 sw (r11+48),r12 str += target_size; mt_entry->mounted = true; 8001ce4: 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; 8001ce8: 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; 8001cec: 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; 8001cf0: 34 01 00 01 mvi r1,1 8001cf4: 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 ); 8001cf8: b9 e0 10 00 mv r2,r15 8001cfc: 35 61 00 14 addi r1,r11,20 8001d00: 34 03 00 01 mvi r3,1 8001d04: 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; 8001d08: 59 eb 00 14 sw (r15+20),r11 8001d0c: f8 00 09 bb calli 80043f8 <_Chain_Initialize> ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; rv = (*fsmount_me_h)( mt_entry, data ); 8001d10: b9 60 08 00 mv r1,r11 filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 8001d14: 31 75 00 29 sb (r11+41),r21 rv = (*fsmount_me_h)( mt_entry, data ); 8001d18: ba e0 10 00 mv r2,r23 8001d1c: da 80 00 00 call r20 8001d20: b8 20 60 00 mv r12,r1 if ( rv == 0 ) { 8001d24: 44 20 00 06 be r1,r0,8001d3c 8001d28: e0 00 00 61 bi 8001eac mt_fs_root, 1, sizeof(*mt_fs_root) ); } else { free( mt_entry ); 8001d2c: fb ff fe 0a calli 8001554 <== NOT EXECUTED if ( rv != 0 ) { free( mt_entry ); } } else { errno = ENOMEM; 8001d30: f8 00 26 b7 calli 800b80c <__errno> <== NOT EXECUTED 8001d34: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8001d38: e0 00 00 62 bi 8001ec0 <== 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 ) { 8001d3c: 45 c1 00 33 be r14,r1,8001e08 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 ); 8001d40: 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 = 8001d44: b9 c0 10 00 mv r2,r14 8001d48: 34 03 00 1f mvi r3,31 8001d4c: b9 80 08 00 mv r1,r12 8001d50: f8 00 03 16 calli 80029a8 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; 8001d54: 28 22 00 14 lw r2,(r1+20) return (*mt_entry->ops->are_nodes_equal_h)( 8001d58: 28 43 00 0c lw r3,(r2+12) 8001d5c: 28 42 00 24 lw r2,(r2+36) 8001d60: 28 63 00 10 lw r3,(r3+16) 8001d64: d8 60 00 00 call r3 8001d68: b8 20 70 00 mv r14,r1 rtems_filesystem_eval_path_start( &ctx, target, eval_flags ); if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { 8001d6c: 5c 20 00 1f bne r1,r0,8001de8 rtems_filesystem_location_info_t targetloc; rtems_filesystem_global_location_t *mt_point_node; rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc ); 8001d70: 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( 8001d74: b9 80 08 00 mv r1,r12 8001d78: 37 82 00 54 addi r2,sp,84 8001d7c: f8 00 04 3b calli 8002e68 mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc ); 8001d80: b9 80 08 00 mv r1,r12 8001d84: f8 00 04 d7 calli 80030e0 mt_entry->mt_point_node = mt_point_node; 8001d88: 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 ); 8001d8c: 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 ); 8001d90: 28 21 00 14 lw r1,(r1+20) 8001d94: 28 21 00 0c lw r1,(r1+12) 8001d98: 28 22 00 30 lw r2,(r1+48) 8001d9c: b9 60 08 00 mv r1,r11 8001da0: d8 40 00 00 call r2 8001da4: b8 20 60 00 mv r12,r1 if ( rv == 0 ) { 8001da8: 5c 2e 00 0d bne r1,r14,8001ddc rtems_filesystem_mt_lock(); 8001dac: fb ff ff 73 calli 8001b78 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 8001db0: 78 01 08 01 mvhi r1,0x801 8001db4: 38 21 d0 f4 ori r1,r1,0xd0f4 8001db8: 28 23 00 08 lw r3,(r1+8) the_node->next = tail; 8001dbc: 78 02 08 01 mvhi r2,0x801 8001dc0: 38 42 d0 f8 ori r2,r2,0xd0f8 8001dc4: 59 62 00 00 sw (r11+0),r2 tail->previous = the_node; 8001dc8: 58 2b 00 08 sw (r1+8),r11 old_last->next = the_node; 8001dcc: 58 6b 00 00 sw (r3+0),r11 the_node->previous = old_last; 8001dd0: 59 63 00 04 sw (r11+4),r3 rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); rtems_filesystem_mt_unlock(); 8001dd4: fb ff ff 74 calli 8001ba4 8001dd8: e0 00 00 08 bi 8001df8 } else { rtems_filesystem_global_location_release( mt_point_node ); 8001ddc: b9 a0 08 00 mv r1,r13 8001de0: f8 00 04 5d calli 8002f54 8001de4: e0 00 00 05 bi 8001df8 } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); 8001de8: b9 80 08 00 mv r1,r12 8001dec: 34 02 00 10 mvi r2,16 8001df0: f8 00 02 26 calli 8002688 rv = -1; 8001df4: 34 0c ff ff mvi r12,-1 } rtems_filesystem_eval_path_cleanup( &ctx ); 8001df8: 37 81 00 3c addi r1,sp,60 8001dfc: f8 00 03 38 calli 8002adc rv = register_subordinate_file_system( mt_entry, target ); } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { 8001e00: 45 80 00 32 be r12,r0,8001ec8 8001e04: e0 00 00 26 bi 8001e9c rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; rtems_filesystem_mt_lock(); 8001e08: fb ff ff 5c calli 8001b78 errno = EINVAL; rv = -1; } return rv; } 8001e0c: 78 01 08 01 mvhi r1,0x801 8001e10: 38 21 d0 f4 ori r1,r1,0xd0f4 ) { int rv = 0; rtems_filesystem_mt_lock(); if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { 8001e14: 28 23 00 00 lw r3,(r1+0) 8001e18: 78 02 08 01 mvhi r2,0x801 8001e1c: 38 42 d0 f8 ori r2,r2,0xd0f8 8001e20: 5c 62 00 07 bne r3,r2,8001e3c <== NEVER TAKEN Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 8001e24: 28 22 00 08 lw r2,(r1+8) the_node->next = tail; 8001e28: 59 63 00 00 sw (r11+0),r3 tail->previous = the_node; 8001e2c: 58 2b 00 08 sw (r1+8),r11 old_last->next = the_node; 8001e30: 58 4b 00 00 sw (r2+0),r11 the_node->previous = old_last; 8001e34: 59 62 00 04 sw (r11+4),r2 8001e38: e0 00 00 05 bi 8001e4c rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); } else { errno = EINVAL; 8001e3c: f8 00 26 74 calli 800b80c <__errno> <== NOT EXECUTED 8001e40: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8001e44: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8001e48: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED } rtems_filesystem_mt_unlock(); 8001e4c: fb ff ff 56 calli 8001ba4 if ( rv == 0 ) { 8001e50: 5d 80 00 12 bne r12,r0,8001e98 <== NEVER TAKEN rtems_filesystem_global_location_t *new_fs_root = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); 8001e54: 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 = 8001e58: b9 60 08 00 mv r1,r11 8001e5c: f8 00 04 67 calli 8002ff8 8001e60: 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 = 8001e64: b9 60 08 00 mv r1,r11 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 8001e68: 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 = 8001e6c: f8 00 04 63 calli 8002ff8 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 8001e70: 39 6b d1 90 ori r11,r11,0xd190 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 = 8001e74: b8 20 68 00 mv r13,r1 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 8001e78: 29 61 00 00 lw r1,(r11+0) 8001e7c: b9 c0 10 00 mv r2,r14 8001e80: 34 21 00 04 addi r1,r1,4 8001e84: f8 00 04 4f calli 8002fc0 &rtems_filesystem_root, new_fs_root ); rtems_filesystem_global_location_assign( 8001e88: 29 61 00 00 lw r1,(r11+0) 8001e8c: b9 a0 10 00 mv r2,r13 8001e90: f8 00 04 4c calli 8002fc0 8001e94: e0 00 00 0d bi 8001ec8 errno = EINVAL; rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { 8001e98: 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 ); 8001e9c: 29 61 00 0c lw r1,(r11+12) 8001ea0: 28 22 00 3c lw r2,(r1+60) 8001ea4: b9 60 08 00 mv r1,r11 8001ea8: d8 40 00 00 call r2 } } if ( rv != 0 ) { free( mt_entry ); 8001eac: b9 60 08 00 mv r1,r11 8001eb0: fb ff fd a9 calli 8001554 8001eb4: e0 00 00 05 bi 8001ec8 } else { errno = EINVAL; rv = -1; } } else { errno = EINVAL; 8001eb8: f8 00 26 55 calli 800b80c <__errno> 8001ebc: 34 02 00 16 mvi r2,22 8001ec0: 58 22 00 00 sw (r1+0),r2 rv = -1; 8001ec4: 34 0c ff ff mvi r12,-1 } return rv; } 8001ec8: b9 80 08 00 mv r1,r12 8001ecc: 2b 9d 00 04 lw ra,(sp+4) 8001ed0: 2b 8b 00 38 lw r11,(sp+56) 8001ed4: 2b 8c 00 34 lw r12,(sp+52) 8001ed8: 2b 8d 00 30 lw r13,(sp+48) 8001edc: 2b 8e 00 2c lw r14,(sp+44) 8001ee0: 2b 8f 00 28 lw r15,(sp+40) 8001ee4: 2b 90 00 24 lw r16,(sp+36) 8001ee8: 2b 91 00 20 lw r17,(sp+32) 8001eec: 2b 92 00 1c lw r18,(sp+28) 8001ef0: 2b 93 00 18 lw r19,(sp+24) 8001ef4: 2b 94 00 14 lw r20,(sp+20) 8001ef8: 2b 95 00 10 lw r21,(sp+16) 8001efc: 2b 96 00 0c lw r22,(sp+12) 8001f00: 2b 97 00 08 lw r23,(sp+8) 8001f04: 37 9c 00 88 addi sp,sp,136 8001f08: c3 a0 00 00 ret =============================================================================== 08006e6c : 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 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 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 <== 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 8006ebc: e0 00 00 05 bi 8006ed0 options, data ); } } else { errno = EINVAL; 8006ec0: f8 00 62 d5 calli 801fa14 <__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 =============================================================================== 08014f68 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 8014f68: 37 9c ff 24 addi sp,sp,-220 8014f6c: 5b 8b 00 44 sw (sp+68),r11 8014f70: 5b 8c 00 40 sw (sp+64),r12 8014f74: 5b 8d 00 3c sw (sp+60),r13 8014f78: 5b 8e 00 38 sw (sp+56),r14 8014f7c: 5b 8f 00 34 sw (sp+52),r15 8014f80: 5b 90 00 30 sw (sp+48),r16 8014f84: 5b 91 00 2c sw (sp+44),r17 8014f88: 5b 92 00 28 sw (sp+40),r18 8014f8c: 5b 93 00 24 sw (sp+36),r19 8014f90: 5b 94 00 20 sw (sp+32),r20 8014f94: 5b 95 00 1c sw (sp+28),r21 8014f98: 5b 96 00 18 sw (sp+24),r22 8014f9c: 5b 97 00 14 sw (sp+20),r23 8014fa0: 5b 98 00 10 sw (sp+16),r24 8014fa4: 5b 99 00 0c sw (sp+12),r25 8014fa8: 5b 9b 00 08 sw (sp+8),fp 8014fac: 5b 9d 00 04 sw (sp+4),ra 8014fb0: 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; 8014fb4: 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); 8014fb8: 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; 8014fbc: 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; 8014fc0: 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; 8014fc4: 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); 8014fc8: 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) { 8014fcc: b8 20 a0 00 mv r20,r1 8014fd0: 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); 8014fd4: b9 a0 08 00 mv r1,r13 8014fd8: 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) { 8014fdc: b8 80 70 00 mv r14,r4 8014fe0: 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; 8014fe4: 5b 80 00 d8 sw (sp+216),r0 time_t time_ret = 0; uint16_t time_val = 0; 8014fe8: 0f 80 00 de sh (sp+222),r0 uint16_t date = 0; 8014fec: 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; 8014ff0: 5b 80 00 c8 sw (sp+200),r0 dir_pos->sname.ofs = 0; 8014ff4: 5b 80 00 cc sw (sp+204),r0 dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 8014ff8: 5b 8c 00 d0 sw (sp+208),r12 dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 8014ffc: 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); 8015000: f8 00 16 12 calli 801a848 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 8015004: 34 03 00 40 mvi r3,64 8015008: 37 81 00 48 addi r1,sp,72 801500c: 34 02 00 00 mvi r2,0 8015010: f8 00 16 0e calli 801a848 if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 8015014: 34 03 01 04 mvi r3,260 8015018: 4c 6e 00 04 bge r3,r14,8015028 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENAMETOOLONG); 801501c: f8 00 12 7c calli 8019a0c <__errno> <== NOT EXECUTED 8015020: 34 02 00 5b mvi r2,91 <== NOT EXECUTED 8015024: e0 00 00 0a bi 801504c <== NOT EXECUTED } name_type = msdos_long_to_short (name, name_len, 8015028: ba 00 08 00 mv r1,r16 801502c: b9 c0 10 00 mv r2,r14 8015030: b9 a0 18 00 mv r3,r13 8015034: 34 04 00 0b mvi r4,11 8015038: f8 00 02 14 calli 8015888 801503c: b8 20 78 00 mv r15,r1 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 8015040: 5c 20 00 06 bne r1,r0,8015058 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EINVAL); 8015044: f8 00 12 72 calli 8019a0c <__errno> <== NOT EXECUTED 8015048: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 801504c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8015050: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED 8015054: e0 00 01 6d bi 8015608 <== 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); 8015058: 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; 801505c: 33 80 00 b4 sb (sp+180),r0 /* set up last write date and time */ time_ret = time(NULL); 8015060: f8 00 24 1e calli 801e0d8