=============================================================================== 08003760 : */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 8003760: 37 9c ff bc addi sp,sp,-68 8003764: 5b 8b 00 44 sw (sp+68),r11 8003768: 5b 8c 00 40 sw (sp+64),r12 800376c: 5b 8d 00 3c sw (sp+60),r13 8003770: 5b 8e 00 38 sw (sp+56),r14 8003774: 5b 8f 00 34 sw (sp+52),r15 8003778: 5b 90 00 30 sw (sp+48),r16 800377c: 5b 91 00 2c sw (sp+44),r17 8003780: 5b 92 00 28 sw (sp+40),r18 8003784: 5b 93 00 24 sw (sp+36),r19 8003788: 5b 94 00 20 sw (sp+32),r20 800378c: 5b 95 00 1c sw (sp+28),r21 8003790: 5b 96 00 18 sw (sp+24),r22 8003794: 5b 97 00 14 sw (sp+20),r23 8003798: 5b 98 00 10 sw (sp+16),r24 800379c: 5b 99 00 0c sw (sp+12),r25 80037a0: 5b 9b 00 08 sw (sp+8),fp 80037a4: 5b 9d 00 04 sw (sp+4),ra } int IMFS_memfile_maximum_size( void ) { return IMFS_MEMFILE_MAXIMUM_SIZE; } 80037a8: 28 2d 00 50 lw r13,(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 )); 80037ac: 34 30 00 54 addi r16,r1,84 */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 80037b0: b8 40 70 00 mv r14,r2 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 ); 80037b4: 45 b0 00 38 be r13,r16,8003894 80037b8: 78 0b 08 02 mvhi r11,0x802 80037bc: 78 0f 08 02 mvhi r15,0x802 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 80037c0: 78 19 08 02 mvhi r25,0x802 ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { 80037c4: 78 12 08 02 mvhi r18,0x802 default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); 80037c8: 78 11 08 02 mvhi r17,0x802 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 80037cc: 78 18 08 02 mvhi r24,0x802 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 80037d0: 78 14 08 02 mvhi r20,0x802 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 80037d4: 78 17 08 02 mvhi r23,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)", 80037d8: 78 16 08 02 mvhi r22,0x802 case IMFS_DIRECTORY: fprintf(stdout, "/" ); break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 80037dc: 78 15 08 02 mvhi r21,0x802 80037e0: 39 6b 62 28 ori r11,r11,0x6228 80037e4: 39 ef 33 bc ori r15,r15,0x33bc ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { 80037e8: 34 13 00 06 mvi r19,6 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 80037ec: 3b 39 34 1c ori r25,r25,0x341c ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { 80037f0: 3a 52 34 a0 ori r18,r18,0x34a0 default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); 80037f4: 3a 31 2f 8c ori r17,r17,0x2f8c case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 80037f8: 3b 18 34 08 ori r24,r24,0x3408 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 80037fc: 3a 94 33 f4 ori r20,r20,0x33f4 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 8003800: 3a f7 33 e8 ori r23,r23,0x33e8 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)", 8003804: 3a d6 33 d8 ori r22,r22,0x33d8 case IMFS_DIRECTORY: fprintf(stdout, "/" ); break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 8003808: 3a b5 33 c4 ori r21,r21,0x33c4 for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) IMFS_dump_directory( the_jnode, level + 1 ); 800380c: 34 5b 00 01 addi fp,r2,1 !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) 8003810: 48 0e 00 0a bg r0,r14,8003838 <== NEVER TAKEN 8003814: 34 0c 00 00 mvi r12,0 fprintf(stdout, "...." ); 8003818: 29 63 00 00 lw r3,(r11+0) !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) 800381c: 35 8c 00 01 addi r12,r12,1 fprintf(stdout, "...." ); 8003820: b9 e0 08 00 mv r1,r15 8003824: 28 64 00 08 lw r4,(r3+8) 8003828: 34 02 00 01 mvi r2,1 800382c: 34 03 00 04 mvi r3,4 8003830: f8 00 38 a9 calli 8011ad4 !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++ ) 8003834: 4d cc ff f9 bge r14,r12,8003818 IMFS_jnode_t *the_jnode ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 8003838: 29 63 00 00 lw r3,(r11+0) 800383c: 35 a1 00 0c addi r1,r13,12 8003840: 28 62 00 08 lw r2,(r3+8) 8003844: f8 00 35 6a calli 8010dec rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 8003848: 29 a3 00 4c lw r3,(r13+76) 800384c: 28 63 00 00 lw r3,(r3+0) switch( IMFS_type( the_jnode ) ) { 8003850: 54 73 00 4c bgu r3,r19,8003980 <== NEVER TAKEN 8003854: b4 63 18 00 add r3,r3,r3 8003858: b4 63 18 00 add r3,r3,r3 800385c: b6 43 18 00 add r3,r18,r3 8003860: 28 63 00 00 lw r3,(r3+0) 8003864: c0 60 00 00 b r3 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 8003868: 29 63 00 00 lw r3,(r11+0) 800386c: ba 80 08 00 mv r1,r20 8003870: 34 02 00 01 mvi r2,1 8003874: 28 64 00 08 lw r4,(r3+8) 8003878: 34 03 00 13 mvi r3,19 800387c: f8 00 38 96 calli 8011ad4 } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 8003880: 29 a3 00 4c lw r3,(r13+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 ) ) 8003884: 28 63 00 00 lw r3,(r3+0) 8003888: 44 60 00 21 be r3,r0,800390c <== NEVER TAKEN 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 ) { 800388c: 29 ad 00 00 lw r13,(r13+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 ); 8003890: 5d b0 ff e0 bne r13,r16,8003810 fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) IMFS_dump_directory( the_jnode, level + 1 ); } } 8003894: 2b 9d 00 04 lw ra,(sp+4) 8003898: 2b 8b 00 44 lw r11,(sp+68) 800389c: 2b 8c 00 40 lw r12,(sp+64) 80038a0: 2b 8d 00 3c lw r13,(sp+60) 80038a4: 2b 8e 00 38 lw r14,(sp+56) 80038a8: 2b 8f 00 34 lw r15,(sp+52) 80038ac: 2b 90 00 30 lw r16,(sp+48) 80038b0: 2b 91 00 2c lw r17,(sp+44) 80038b4: 2b 92 00 28 lw r18,(sp+40) 80038b8: 2b 93 00 24 lw r19,(sp+36) 80038bc: 2b 94 00 20 lw r20,(sp+32) 80038c0: 2b 95 00 1c lw r21,(sp+28) 80038c4: 2b 96 00 18 lw r22,(sp+24) 80038c8: 2b 97 00 14 lw r23,(sp+20) 80038cc: 2b 98 00 10 lw r24,(sp+16) 80038d0: 2b 99 00 0c lw r25,(sp+12) 80038d4: 2b 9b 00 08 lw fp,(sp+8) 80038d8: 37 9c 00 44 addi sp,sp,68 80038dc: c3 a0 00 00 ret 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)", 80038e0: 29 61 00 00 lw r1,(r11+0) 80038e4: 29 a3 00 50 lw r3,(r13+80) 80038e8: 29 a4 00 54 lw r4,(r13+84) 80038ec: 28 21 00 08 lw r1,(r1+8) 80038f0: ba c0 10 00 mv r2,r22 80038f4: f8 00 34 d3 calli 8010c40 default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); 80038f8: ba 20 08 00 mv r1,r17 80038fc: f8 00 3d 17 calli 8012d58 8003900: 29 a3 00 4c lw r3,(r13+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 ) ) 8003904: 28 63 00 00 lw r3,(r3+0) 8003908: 5c 60 ff e1 bne r3,r0,800388c IMFS_dump_directory( the_jnode, level + 1 ); 800390c: b9 a0 08 00 mv r1,r13 8003910: bb 60 10 00 mv r2,fp 8003914: fb ff ff 93 calli 8003760 8003918: e3 ff ff dd bi 800388c case IMFS_DIRECTORY: fprintf(stdout, "/" ); break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 800391c: 29 61 00 00 lw r1,(r11+0) 8003920: 29 a3 00 50 lw r3,(r13+80) 8003924: 29 a4 00 54 lw r4,(r13+84) 8003928: 28 21 00 08 lw r1,(r1+8) 800392c: ba a0 10 00 mv r2,r21 8003930: f8 00 34 c4 calli 8010c40 8003934: e3 ff ff f1 bi 80038f8 IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { case IMFS_DIRECTORY: fprintf(stdout, "/" ); 8003938: 29 62 00 00 lw r2,(r11+0) 800393c: 34 01 00 2f mvi r1,47 8003940: 28 42 00 08 lw r2,(r2+8) 8003944: f8 00 34 e6 calli 8010cdc 8003948: e3 ff ff ec bi 80038f8 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 800394c: 29 63 00 00 lw r3,(r11+0) 8003950: bb 00 08 00 mv r1,r24 8003954: 34 02 00 01 mvi r2,1 8003958: 28 64 00 08 lw r4,(r3+8) 800395c: 34 03 00 12 mvi r3,18 8003960: f8 00 38 5d calli 8011ad4 8003964: e3 ff ff c7 bi 8003880 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 8003968: 29 61 00 00 lw r1,(r11+0) 800396c: 29 a3 00 50 lw r3,(r13+80) 8003970: ba e0 10 00 mv r2,r23 8003974: 28 21 00 08 lw r1,(r1+8) 8003978: f8 00 34 b2 calli 8010c40 800397c: e3 ff ff df bi 80038f8 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 8003980: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED 8003984: bb 20 10 00 mv r2,r25 <== NOT EXECUTED 8003988: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED 800398c: f8 00 34 ad calli 8010c40 <== NOT EXECUTED 8003990: e3 ff ff bc bi 8003880 <== NOT EXECUTED =============================================================================== 0800862c : rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 800862c: 37 9c ff e4 addi sp,sp,-28 8008630: 5b 8b 00 1c sw (sp+28),r11 8008634: 5b 8c 00 18 sw (sp+24),r12 8008638: 5b 8d 00 14 sw (sp+20),r13 800863c: 5b 8e 00 10 sw (sp+16),r14 8008640: 5b 8f 00 0c sw (sp+12),r15 8008644: 5b 90 00 08 sw (sp+8),r16 8008648: 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; 800864c: 28 2c 00 20 lw r12,(r1+32) rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 8008650: b8 60 78 00 mv r15,r3 8008654: b8 80 70 00 mv r14,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( 8008658: 29 83 00 30 lw r3,(r12+48) 800865c: 2d 84 00 3c lhu r4,(r12+60) 8008660: 2d 85 00 3e lhu r5,(r12+62) 8008664: 34 02 00 01 mvi r2,1 rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 8008668: b8 20 68 00 mv r13,r1 rtems_filesystem_eval_path_generic_status status = 800866c: 34 0b 00 01 mvi r11,1 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( 8008670: f8 00 03 90 calli 80094b0 dir->st_mode, dir->st_uid, dir->st_gid ); if ( access_ok ) { 8008674: 44 20 00 27 be r1,r0,8008710 static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; 8008678: 45 cb 00 44 be r14,r11,8008788 static inline bool rtems_filesystem_is_parent_directory( const char *token, size_t tokenlen ) { return tokenlen == 2 && token [0] == '.' && token [1] == '.'; 800867c: 34 01 00 02 mvi r1,2 8008680: 45 c1 00 57 be r14,r1,80087dc }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 8008684: 29 8b 00 50 lw r11,(r12+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 ); 8008688: 35 90 00 54 addi r16,r12,84 while ( current != tail ) { 800868c: 45 70 00 2d be r11,r16,8008740 IMFS_jnode_t *entry = (IMFS_jnode_t *) current; bool match = strncmp( entry->name, token, tokenlen ) == 0 8008690: b9 e0 10 00 mv r2,r15 8008694: 35 61 00 0c addi r1,r11,12 8008698: b9 c0 18 00 mv r3,r14 800869c: f8 00 14 b6 calli 800d974 && entry->name [tokenlen] == '\0'; 80086a0: b5 6e 10 00 add r2,r11,r14 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; 80086a4: b9 60 28 00 mv r5,r11 bool match = strncmp( entry->name, token, tokenlen ) == 0 && entry->name [tokenlen] == '\0'; 80086a8: 5c 20 00 24 bne r1,r0,8008738 80086ac: 40 42 00 0c lbu r2,(r2+12) 80086b0: 5c 41 00 22 bne r2,r1,8008738 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; 80086b4: 34 0b 00 02 mvi r11,2 ); if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { 80086b8: 44 a0 00 16 be r5,r0,8008710 }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 80086bc: 28 a3 00 4c lw r3,(r5+76) 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 ); 80086c0: 29 a4 00 04 lw r4,(r13+4) }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 80086c4: 29 a2 00 10 lw r2,(r13+16) rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 80086c8: 28 61 00 00 lw r1,(r3+0) static inline void rtems_filesystem_eval_path_clear_token( rtems_filesystem_eval_path_context_t *ctx ) { ctx->tokenlen = 0; 80086cc: 59 a0 00 0c sw (r13+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 ); 80086d0: 64 84 00 00 cmpei r4,r4,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)) { 80086d4: 44 2b 00 1d be r1,r11,8008748 entry = entry->info.hard_link.link_node; } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 80086d8: 34 06 00 03 mvi r6,3 80086dc: 44 26 00 34 be r1,r6,80087ac IMFS_jnode_types_t type ) { rtems_filesystem_global_location_t **fs_root_ptr = NULL; if ( type == IMFS_DIRECTORY ) { 80086e0: 5c 20 00 1f bne r1,r0,800875c if ( node->info.directory.mt_fs != NULL ) { 80086e4: 28 a6 00 5c lw r6,(r5+92) 80086e8: 44 c1 00 1d be r6,r1,800875c if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( 80086ec: 28 a3 00 30 lw r3,(r5+48) 80086f0: 2c a4 00 3c lhu r4,(r5+60) 80086f4: 2c a5 00 3e lhu r5,(r5+62) 80086f8: b9 a0 08 00 mv r1,r13 80086fc: 34 02 00 01 mvi r2,1 { 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; 8008700: 34 cc 00 24 addi r12,r6,36 if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( 8008704: f8 00 03 6b calli 80094b0 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 8008708: 34 0b 00 01 mvi r11,1 RTEMS_FS_PERMS_EXEC, entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { 800870c: 5c 20 00 24 bne r1,r0,800879c <== ALWAYS TAKEN status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } 8008710: b9 60 08 00 mv r1,r11 8008714: 2b 9d 00 04 lw ra,(sp+4) 8008718: 2b 8b 00 1c lw r11,(sp+28) 800871c: 2b 8c 00 18 lw r12,(sp+24) 8008720: 2b 8d 00 14 lw r13,(sp+20) 8008724: 2b 8e 00 10 lw r14,(sp+16) 8008728: 2b 8f 00 0c lw r15,(sp+12) 800872c: 2b 90 00 08 lw r16,(sp+8) 8008730: 37 9c 00 1c addi sp,sp,28 8008734: c3 a0 00 00 ret }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 8008738: 29 6b 00 00 lw r11,(r11+0) } 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 ) { 800873c: 5e 0b ff d5 bne r16,r11,8008690 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; 8008740: 34 0b 00 02 mvi r11,2 8008744: e3 ff ff f3 bi 8008710 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; 8008748: 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)) { 800874c: 5c 40 00 02 bne r2,r0,8008754 8008750: 5c 82 00 02 bne r4,r2,8008758 <== ALWAYS TAKEN entry = entry->info.hard_link.link_node; 8008754: 28 a5 00 50 lw r5,(r5+80) } 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 ) { 8008758: 28 a3 00 4c lw r3,(r5+76) } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; 800875c: 2d 81 00 34 lhu r1,(r12+52) 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; 8008760: 28 62 00 04 lw r2,(r3+4) void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 8008764: b8 80 58 00 mv r11,r4 } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; 8008768: 34 21 ff ff addi r1,r1,-1 800876c: 0d 81 00 34 sh (r12+52),r1 ++entry->reference_count; 8008770: 2c a1 00 34 lhu r1,(r5+52) 8008774: 34 21 00 01 addi r1,r1,1 8008778: 0c a1 00 34 sh (r5+52),r1 currentloc->node_access = entry; 800877c: 59 a5 00 20 sw (r13+32),r5 8008780: 59 a2 00 28 sw (r13+40),r2 8008784: e3 ff ff e3 bi 8008710 static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; 8008788: 41 e2 00 00 lbu r2,(r15+0) 800878c: 34 01 00 2e mvi r1,46 8008790: 5c 41 ff bd bne r2,r1,8008684 8008794: b9 80 28 00 mv r5,r12 8008798: e3 ff ff c7 bi 80086b4 entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); 800879c: b9 a0 08 00 mv r1,r13 80087a0: b9 80 10 00 mv r2,r12 80087a4: fb ff e9 8a calli 8002dcc 80087a8: e3 ff ff da bi 8008710 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; 80087ac: 20 42 00 10 andi r2,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)) { 80087b0: 5c 40 00 02 bne r2,r0,80087b8 80087b4: 5c 82 ff ea bne r4,r2,800875c const char *target = entry->info.sym_link.name; 80087b8: 28 ac 00 50 lw r12,(r5+80) void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 80087bc: 34 0b 00 01 mvi r11,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 ) ); 80087c0: b9 80 08 00 mv r1,r12 80087c4: f8 00 14 3d calli 800d8b8 80087c8: b8 20 18 00 mv r3,r1 80087cc: b9 80 10 00 mv r2,r12 80087d0: b9 a0 08 00 mv r1,r13 80087d4: fb ff e9 ae calli 8002e8c 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)) { 80087d8: e3 ff ff ce bi 8008710 static inline bool rtems_filesystem_is_parent_directory( const char *token, size_t tokenlen ) { return tokenlen == 2 && token [0] == '.' && token [1] == '.'; 80087dc: 41 e1 00 00 lbu r1,(r15+0) 80087e0: 34 02 00 2e mvi r2,46 80087e4: 5c 22 ff a8 bne r1,r2,8008684 80087e8: 41 e2 00 01 lbu r2,(r15+1) 80087ec: 5c 41 ff a6 bne r2,r1,8008684 <== NEVER TAKEN { if ( rtems_filesystem_is_current_directory( token, tokenlen ) ) { return dir; } else { if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { return dir->Parent; 80087f0: 29 85 00 08 lw r5,(r12+8) 80087f4: e3 ff ff b0 bi 80086b4 =============================================================================== 080017d0 : static int IMFS_fifo_ioctl( rtems_libio_t *iop, ioctl_command_t command, void *buffer ) { 80017d0: 37 9c ff f8 addi sp,sp,-8 80017d4: 5b 8b 00 08 sw (sp+8),r11 80017d8: 5b 9d 00 04 sw (sp+4),ra int err; if (command == FIONBIO) { 80017dc: 78 06 08 02 mvhi r6,0x802 80017e0: 38 c6 14 44 ori r6,r6,0x1444 80017e4: 28 c5 00 00 lw r5,(r6+0) static int IMFS_fifo_ioctl( rtems_libio_t *iop, ioctl_command_t command, void *buffer ) { 80017e8: b8 20 20 00 mv r4,r1 int err; if (command == FIONBIO) { 80017ec: 44 45 00 07 be r2,r5,8001808 iop->flags &= ~LIBIO_FLAGS_NO_DELAY; return 0; } } else err = pipe_ioctl(LIBIO2PIPE(iop), command, buffer, iop); 80017f0: 28 81 00 14 lw r1,(r4+20) 80017f4: 28 21 00 50 lw r1,(r1+80) 80017f8: f8 00 26 5c calli 800b168 IMFS_FIFO_RETURN(err); 80017fc: 4c 20 00 0a bge r1,r0,8001824 <== NEVER TAKEN 8001800: c8 01 58 00 sub r11,r0,r1 8001804: e0 00 00 16 bi 800185c ) { int err; if (command == FIONBIO) { if (buffer == NULL) 8001808: 44 60 00 14 be r3,r0,8001858 <== NEVER TAKEN err = -EFAULT; else { if (*(int *)buffer) 800180c: 28 61 00 00 lw r1,(r3+0) 8001810: 44 20 00 09 be r1,r0,8001834 iop->flags |= LIBIO_FLAGS_NO_DELAY; 8001814: 28 82 00 08 lw r2,(r4+8) else iop->flags &= ~LIBIO_FLAGS_NO_DELAY; return 0; 8001818: 34 01 00 00 mvi r1,0 if (command == FIONBIO) { if (buffer == NULL) err = -EFAULT; else { if (*(int *)buffer) iop->flags |= LIBIO_FLAGS_NO_DELAY; 800181c: 38 42 00 01 ori r2,r2,0x1 8001820: 58 82 00 08 sw (r4+8),r2 } else err = pipe_ioctl(LIBIO2PIPE(iop), command, buffer, iop); IMFS_FIFO_RETURN(err); } 8001824: 2b 9d 00 04 lw ra,(sp+4) 8001828: 2b 8b 00 08 lw r11,(sp+8) 800182c: 37 9c 00 08 addi sp,sp,8 8001830: c3 a0 00 00 ret err = -EFAULT; else { if (*(int *)buffer) iop->flags |= LIBIO_FLAGS_NO_DELAY; else iop->flags &= ~LIBIO_FLAGS_NO_DELAY; 8001834: 28 83 00 08 lw r3,(r4+8) 8001838: 34 02 ff fe mvi r2,-2 return 0; 800183c: 34 01 00 00 mvi r1,0 err = -EFAULT; else { if (*(int *)buffer) iop->flags |= LIBIO_FLAGS_NO_DELAY; else iop->flags &= ~LIBIO_FLAGS_NO_DELAY; 8001840: a0 62 10 00 and r2,r3,r2 8001844: 58 82 00 08 sw (r4+8),r2 } else err = pipe_ioctl(LIBIO2PIPE(iop), command, buffer, iop); IMFS_FIFO_RETURN(err); } 8001848: 2b 9d 00 04 lw ra,(sp+4) 800184c: 2b 8b 00 08 lw r11,(sp+8) 8001850: 37 9c 00 08 addi sp,sp,8 8001854: c3 a0 00 00 ret ) { int err; if (command == FIONBIO) { if (buffer == NULL) 8001858: 34 0b 00 0e mvi r11,14 } } else err = pipe_ioctl(LIBIO2PIPE(iop), command, buffer, iop); IMFS_FIFO_RETURN(err); 800185c: f8 00 30 72 calli 800da24 <__errno> 8001860: 58 2b 00 00 sw (r1+0),r11 8001864: 34 01 ff ff mvi r1,-1 8001868: e3 ff ff ef bi 8001824 =============================================================================== 0800186c : static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 800186c: 37 9c ff ec addi sp,sp,-20 8001870: 5b 8b 00 0c sw (sp+12),r11 8001874: 5b 8c 00 08 sw (sp+8),r12 8001878: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode = iop->pathinfo.node_access; 800187c: 28 2c 00 14 lw r12,(r1+20) int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 8001880: b8 20 20 00 mv r4,r1 8001884: 29 81 00 50 lw r1,(r12+80) 8001888: f8 00 25 ab calli 800af34 800188c: b8 20 58 00 mv r11,r1 if (err > 0) { 8001890: 4c 01 00 0d bge r0,r1,80018c4 IMFS_mtime_ctime_update(jnode); 8001894: 37 81 00 10 addi r1,sp,16 8001898: 34 02 00 00 mvi r2,0 800189c: f8 00 04 04 calli 80028ac 80018a0: 2b 81 00 10 lw r1,(sp+16) 80018a4: 59 81 00 44 sw (r12+68),r1 80018a8: 59 81 00 48 sw (r12+72),r1 } IMFS_FIFO_RETURN(err); } 80018ac: b9 60 08 00 mv r1,r11 80018b0: 2b 9d 00 04 lw ra,(sp+4) 80018b4: 2b 8b 00 0c lw r11,(sp+12) 80018b8: 2b 8c 00 08 lw r12,(sp+8) 80018bc: 37 9c 00 14 addi sp,sp,20 80018c0: c3 a0 00 00 ret int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); if (err > 0) { IMFS_mtime_ctime_update(jnode); } IMFS_FIFO_RETURN(err); 80018c4: 44 20 ff fa be r1,r0,80018ac <== NEVER TAKEN 80018c8: c8 0b 58 00 sub r11,r0,r11 80018cc: f8 00 30 56 calli 800da24 <__errno> 80018d0: 58 2b 00 00 sw (r1+0),r11 80018d4: 34 0b ff ff mvi r11,-1 80018d8: e3 ff ff f5 bi 80018ac =============================================================================== 0800886c : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 800886c: 37 9c ff d8 addi sp,sp,-40 8008870: 5b 8b 00 10 sw (sp+16),r11 8008874: 5b 8c 00 0c sw (sp+12),r12 8008878: 5b 8d 00 08 sw (sp+8),r13 800887c: 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; 8008880: 28 24 00 24 lw r4,(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 ); 8008884: 37 8d 00 14 addi r13,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; 8008888: 28 82 00 08 lw r2,(r4+8) 800888c: 28 89 00 00 lw r9,(r4+0) 8008890: 28 88 00 04 lw r8,(r4+4) 8008894: 28 87 00 0c lw r7,(r4+12) 8008898: 28 86 00 10 lw r6,(r4+16) 800889c: 28 85 00 14 lw r5,(r4+20) /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; 80088a0: 28 41 00 4c lw r1,(r2+76) * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; jnode = (IMFS_jnode_t *)loc.node_access; 80088a4: b8 40 58 00 mv r11,r2 /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; 80088a8: 28 23 00 00 lw r3,(r1+0) /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; 80088ac: 5b 89 00 14 sw (sp+20),r9 80088b0: 5b 88 00 18 sw (sp+24),r8 80088b4: 5b 82 00 1c sw (sp+28),r2 80088b8: 5b 87 00 20 sw (sp+32),r7 80088bc: 5b 86 00 24 sw (sp+36),r6 80088c0: 5b 85 00 28 sw (sp+40),r5 /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; 80088c4: 58 80 00 08 sw (r4+8),r0 80088c8: 28 21 00 04 lw r1,(r1+4) do { next = jnode->Parent; 80088cc: 29 6c 00 08 lw r12,(r11+8) loc.node_access = (void *)jnode; 80088d0: 5b 8b 00 1c sw (sp+28),r11 80088d4: 5b 81 00 24 sw (sp+36),r1 IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { 80088d8: 5c 60 00 14 bne r3,r0,8008928 <== NEVER TAKEN 80088dc: 29 63 00 50 lw r3,(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 ); 80088e0: 35 61 00 54 addi r1,r11,84 80088e4: 44 61 00 11 be r3,r1,8008928 if ( result != 0 ) rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); jnode = next; } if ( jnode != NULL ) { 80088e8: 45 60 00 18 be r11,r0,8008948 <== NEVER TAKEN if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); } 80088ec: 29 61 00 4c lw r1,(r11+76) return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 80088f0: 28 23 00 00 lw r3,(r1+0) rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); jnode = next; } if ( jnode != NULL ) { if ( IMFS_is_directory( jnode ) ) { 80088f4: 5c 60 ff f5 bne r3,r0,80088c8 <== NEVER TAKEN if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); } 80088f8: 29 64 00 50 lw r4,(r11+80) 80088fc: 35 65 00 54 addi r5,r11,84 IMFS_node_destroy( jnode ); jnode = next; } if ( jnode != NULL ) { if ( IMFS_is_directory( jnode ) ) { if ( jnode_has_children( jnode ) ) 8008900: 44 85 ff f2 be r4,r5,80088c8 jnode = jnode_get_first_child( jnode ); 8008904: b8 80 58 00 mv r11,r4 } } } while (jnode != NULL); 8008908: 44 80 00 10 be r4,r0,8008948 <== NEVER TAKEN 800890c: 28 81 00 4c lw r1,(r4+76) */ temp_mt_entry->mt_fs_root->location.node_access = NULL; do { next = jnode->Parent; 8008910: 29 6c 00 08 lw r12,(r11+8) if ( IMFS_is_directory( jnode ) ) { if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); 8008914: 28 23 00 00 lw r3,(r1+0) 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; 8008918: 28 21 00 04 lw r1,(r1+4) temp_mt_entry->mt_fs_root->location.node_access = NULL; do { next = jnode->Parent; loc.node_access = (void *)jnode; 800891c: 5b 8b 00 1c sw (sp+28),r11 8008920: 5b 81 00 24 sw (sp+36),r1 IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { 8008924: 44 60 ff ee be r3,r0,80088dc result = IMFS_rmnod( NULL, &loc ); 8008928: 34 01 00 00 mvi r1,0 800892c: b9 a0 10 00 mv r2,r13 8008930: fb ff e1 c0 calli 8001030 if ( result != 0 ) 8008934: 5c 20 00 0b bne r1,r0,8008960 <== NEVER TAKEN rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); 8008938: b9 60 08 00 mv r1,r11 jnode = next; 800893c: b9 80 58 00 mv r11,r12 if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { result = IMFS_rmnod( NULL, &loc ); if ( result != 0 ) rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); 8008940: fb ff e0 d6 calli 8000c98 jnode = next; } if ( jnode != NULL ) { 8008944: 5d 60 ff ea bne r11,r0,80088ec if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); } 8008948: 2b 9d 00 04 lw ra,(sp+4) 800894c: 2b 8b 00 10 lw r11,(sp+16) 8008950: 2b 8c 00 0c lw r12,(sp+12) 8008954: 2b 8d 00 08 lw r13,(sp+8) 8008958: 37 9c 00 28 addi sp,sp,40 800895c: c3 a0 00 00 ret IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { result = IMFS_rmnod( NULL, &loc ); if ( result != 0 ) rtems_fatal_error_occurred( 0xdeadbeef ); 8008960: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8008964: 38 42 c1 10 ori r2,r2,0xc110 <== NOT EXECUTED 8008968: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 800896c: fb ff ee ce calli 80044a4 <== NOT EXECUTED =============================================================================== 08000b2c : 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] ) { 8000b2c: 37 9c ff ec addi sp,sp,-20 8000b30: 5b 8b 00 14 sw (sp+20),r11 8000b34: 5b 8c 00 10 sw (sp+16),r12 8000b38: 5b 8d 00 0c sw (sp+12),r13 8000b3c: 5b 8e 00 08 sw (sp+8),r14 8000b40: 5b 9d 00 04 sw (sp+4),ra 8000b44: b8 20 68 00 mv r13,r1 8000b48: 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 ) ); 8000b4c: 34 01 00 01 mvi r1,1 8000b50: 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] ) { 8000b54: 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 ) ); 8000b58: f8 00 01 e9 calli 80012fc 8000b5c: b8 20 60 00 mv r12,r1 if ( fs_info != NULL ) { 8000b60: 44 20 00 43 be r1,r0,8000c6c IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 8000b64: 78 04 08 01 mvhi r4,0x801 8000b68: 38 84 e7 18 ori r4,r4,0xe718 8000b6c: 28 87 00 00 lw r7,(r4+0) memcpy( fs_info->node_controls, 8000b70: 34 23 00 08 addi r3,r1,8 IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); if ( fs_info != NULL ) { IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 8000b74: 34 e2 00 01 addi r2,r7,1 8000b78: 58 82 00 00 sw (r4+0),r2 memcpy( 8000b7c: 29 6a 00 00 lw r10,(r11+0) 8000b80: 29 66 00 0c lw r6,(r11+12) 8000b84: 29 65 00 10 lw r5,(r11+16) 8000b88: 29 64 00 14 lw r4,(r11+20) 8000b8c: 29 62 00 18 lw r2,(r11+24) 8000b90: 29 69 00 04 lw r9,(r11+4) 8000b94: 29 68 00 08 lw r8,(r11+8) 8000b98: 58 2a 00 08 sw (r1+8),r10 8000b9c: 58 66 00 0c sw (r3+12),r6 8000ba0: 58 65 00 10 sw (r3+16),r5 8000ba4: 58 64 00 14 sw (r3+20),r4 8000ba8: 58 69 00 04 sw (r3+4),r9 8000bac: 58 68 00 08 sw (r3+8),r8 8000bb0: 58 62 00 18 sw (r3+24),r2 fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( 8000bb4: 28 22 00 08 lw r2,(r1+8) 8000bb8: 78 03 08 01 mvhi r3,0x801 8000bbc: 34 04 00 00 mvi r4,0 8000bc0: 38 63 ba bc ori r3,r3,0xbabc 8000bc4: 34 05 41 ed mvi r5,16877 8000bc8: 34 06 00 00 mvi r6,0 IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); if ( fs_info != NULL ) { IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 8000bcc: 58 27 00 00 sw (r1+0),r7 fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( 8000bd0: f8 00 1e 38 calli 80084b0 8000bd4: b8 20 20 00 mv r4,r1 "", 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { 8000bd8: 44 20 00 25 be r1,r0,8000c6c <== NEVER TAKEN 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; 8000bdc: 28 22 00 4c lw r2,(r1+76) errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 8000be0: 78 03 08 01 mvhi r3,0x801 ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; mt_entry->mt_fs_root->location.node_access = root_node; 8000be4: 29 a5 00 24 lw r5,(r13+36) 8000be8: 28 42 00 04 lw r2,(r2+4) NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; 8000bec: 78 01 08 01 mvhi r1,0x801 errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 8000bf0: 38 63 e0 14 ori r3,r3,0xe014 NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; 8000bf4: 38 21 c3 68 ori r1,r1,0xc368 errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 8000bf8: 28 63 00 00 lw r3,(r3+0) NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; 8000bfc: 59 a1 00 2c sw (r13+44),r1 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; 8000c00: 59 ac 00 08 sw (r13+8),r12 mt_entry->ops = op_table; 8000c04: 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; 8000c08: 58 a4 00 08 sw (r5+8),r4 8000c0c: 58 a2 00 10 sw (r5+16),r2 /* * 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) { 8000c10: 34 01 00 10 mvi r1,16 8000c14: 44 61 00 0b be r3,r1,8000c40 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) 8000c18: 34 01 00 0f mvi r1,15 8000c1c: 4c 23 00 08 bge r1,r3,8000c3c 8000c20: 34 02 00 05 mvi r2,5 8000c24: 34 01 00 20 mvi r1,32 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 8000c28: 34 42 ff ff addi r2,r2,-1 if (bit_mask == requested_bytes_per_block) { 8000c2c: 44 61 00 05 be r3,r1,8000c40 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) 8000c30: 48 23 00 03 bg r1,r3,8000c3c <== NEVER TAKEN int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 8000c34: b4 21 08 00 add r1,r1,r1 8000c38: 5c 40 ff fc bne r2,r0,8000c28 <== ALWAYS TAKEN if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); 8000c3c: 34 03 00 80 mvi r3,128 break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) 8000c40: 78 01 08 01 mvhi r1,0x801 8000c44: 38 21 e7 14 ori r1,r1,0xe714 8000c48: 58 23 00 00 sw (r1+0),r3 const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT] ) { static int imfs_instance; int rv = 0; 8000c4c: 34 01 00 00 mvi r1,0 IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK ); } return rv; } 8000c50: 2b 9d 00 04 lw ra,(sp+4) 8000c54: 2b 8b 00 14 lw r11,(sp+20) 8000c58: 2b 8c 00 10 lw r12,(sp+16) 8000c5c: 2b 8d 00 0c lw r13,(sp+12) 8000c60: 2b 8e 00 08 lw r14,(sp+8) 8000c64: 37 9c 00 14 addi sp,sp,20 8000c68: c3 a0 00 00 ret } else { errno = ENOMEM; rv = -1; } } else { errno = ENOMEM; 8000c6c: f8 00 2c ce calli 800bfa4 <__errno> 8000c70: 34 02 00 0c mvi r2,12 8000c74: 58 22 00 00 sw (r1+0),r2 8000c78: 34 01 ff ff mvi r1,-1 8000c7c: e3 ff ff f5 bi 8000c50 =============================================================================== 08002c00 : const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 8002c00: 37 9c ff 98 addi sp,sp,-104 8002c04: 5b 8b 00 18 sw (sp+24),r11 8002c08: 5b 8c 00 14 sw (sp+20),r12 8002c0c: 5b 8d 00 10 sw (sp+16),r13 8002c10: 5b 8e 00 0c sw (sp+12),r14 8002c14: 5b 8f 00 08 sw (sp+8),r15 8002c18: 5b 9d 00 04 sw (sp+4),ra int rv = 0; mode &= ~rtems_filesystem_umask; 8002c1c: 78 05 08 01 mvhi r5,0x801 8002c20: 38 a5 a1 7c ori r5,r5,0xa17c 8002c24: 28 a5 00 00 lw r5,(r5+0) switch (mode & S_IFMT) { 8002c28: 34 07 20 00 mvi r7,8192 const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 8002c2c: b8 20 40 00 mv r8,r1 int rv = 0; mode &= ~rtems_filesystem_umask; 8002c30: 28 ad 00 08 lw r13,(r5+8) const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 8002c34: b8 60 58 00 mv r11,r3 8002c38: b8 80 70 00 mv r14,r4 int rv = 0; mode &= ~rtems_filesystem_umask; 8002c3c: a5 a0 68 00 not r13,r13 8002c40: a0 4d 68 00 and r13,r2,r13 switch (mode & S_IFMT) { 8002c44: 21 a6 f0 00 andi r6,r13,0xf000 8002c48: 44 c7 00 15 be r6,r7,8002c9c 8002c4c: 54 c7 00 10 bgu r6,r7,8002c8c <== ALWAYS TAKEN 8002c50: 34 01 10 00 mvi r1,4096 <== NOT EXECUTED 8002c54: 44 c1 00 12 be r6,r1,8002c9c <== NOT EXECUTED rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); } else { errno = EINVAL; 8002c58: f8 00 3b c8 calli 8011b78 <__errno> 8002c5c: 34 02 00 16 mvi r2,22 8002c60: 58 22 00 00 sw (r1+0),r2 rv = -1; 8002c64: 34 0b ff ff mvi r11,-1 } } return rv; } 8002c68: b9 60 08 00 mv r1,r11 8002c6c: 2b 9d 00 04 lw ra,(sp+4) 8002c70: 2b 8b 00 18 lw r11,(sp+24) 8002c74: 2b 8c 00 14 lw r12,(sp+20) 8002c78: 2b 8d 00 10 lw r13,(sp+16) 8002c7c: 2b 8e 00 0c lw r14,(sp+12) 8002c80: 2b 8f 00 08 lw r15,(sp+8) 8002c84: 37 9c 00 68 addi sp,sp,104 8002c88: c3 a0 00 00 ret { int rv = 0; mode &= ~rtems_filesystem_umask; switch (mode & S_IFMT) { 8002c8c: 34 01 60 00 mvi r1,24576 8002c90: 44 c1 00 03 be r6,r1,8002c9c 8002c94: 34 21 20 00 addi r1,r1,8192 8002c98: 5c c1 ff f0 bne r6,r1,8002c58 <== ALWAYS TAKEN rv = -1; break; } if ( rv == 0 ) { if ( node_control->imfs_type == IMFS_GENERIC ) { 8002c9c: 29 62 00 00 lw r2,(r11+0) 8002ca0: 34 01 00 07 mvi r1,7 8002ca4: 5c 41 ff ed bne r2,r1,8002c58 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 ); 8002ca8: 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 = 8002cac: b9 80 08 00 mv r1,r12 8002cb0: b9 00 10 00 mv r2,r8 8002cb4: 34 03 00 78 mvi r3,120 8002cb8: f8 00 08 bd calli 8004fac 8002cbc: b8 20 78 00 mv r15,r1 rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); if ( IMFS_is_imfs_instance( currentloc ) ) { 8002cc0: fb ff ff bb calli 8002bac 8002cc4: 44 20 00 1b be r1,r0,8002d30 IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; new_node = IMFS_create_node_with_control( 8002cc8: 2b 83 00 24 lw r3,(sp+36) 8002ccc: 2b 84 00 28 lw r4,(sp+40) 8002cd0: b9 60 10 00 mv r2,r11 8002cd4: b9 e0 08 00 mv r1,r15 8002cd8: b9 a0 28 00 mv r5,r13 8002cdc: 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; 8002ce0: 5b 8e 00 54 sw (sp+84),r14 new_node = IMFS_create_node_with_control( 8002ce4: f8 00 2a ae calli 800d79c IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); } else { rv = -1; 8002ce8: 34 0b ff ff mvi r11,-1 rtems_filesystem_eval_path_get_tokenlen( &ctx ), mode, &info ); if ( new_node != NULL ) { 8002cec: 44 20 00 0e be r1,r0,8002d24 IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); 8002cf0: 37 8b 00 64 addi r11,sp,100 8002cf4: 34 02 00 00 mvi r2,0 8002cf8: b9 60 08 00 mv r1,r11 mode, &info ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; 8002cfc: 29 ed 00 08 lw r13,(r15+8) IMFS_update_ctime( parent ); 8002d00: f8 00 02 3c calli 80035f0 8002d04: 2b 83 00 64 lw r3,(sp+100) IMFS_update_mtime( parent ); 8002d08: b9 60 08 00 mv r1,r11 8002d0c: 34 02 00 00 mvi r2,0 ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); 8002d10: 59 a3 00 48 sw (r13+72),r3 IMFS_update_mtime( parent ); 8002d14: f8 00 02 37 calli 80035f0 8002d18: 2b 81 00 64 lw r1,(sp+100) 8002d1c: 34 0b 00 00 mvi r11,0 8002d20: 59 a1 00 44 sw (r13+68),r1 } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 8002d24: b9 80 08 00 mv r1,r12 8002d28: f8 00 08 f8 calli 8005108 8002d2c: e3 ff ff cf bi 8002c68 IMFS_update_mtime( parent ); } else { rv = -1; } } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); 8002d30: b9 80 08 00 mv r1,r12 8002d34: 34 02 00 86 mvi r2,134 8002d38: f8 00 07 b4 calli 8004c08 rv = -1; 8002d3c: 34 0b ff ff mvi r11,-1 8002d40: e3 ff ff f9 bi 8002d24 =============================================================================== 0800b05c : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 800b05c: 37 9c ff d0 addi sp,sp,-48 800b060: 5b 8b 00 28 sw (sp+40),r11 800b064: 5b 8c 00 24 sw (sp+36),r12 800b068: 5b 8d 00 20 sw (sp+32),r13 800b06c: 5b 8e 00 1c sw (sp+28),r14 800b070: 5b 8f 00 18 sw (sp+24),r15 800b074: 5b 90 00 14 sw (sp+20),r16 800b078: 5b 91 00 10 sw (sp+16),r17 800b07c: 5b 92 00 0c sw (sp+12),r18 800b080: 5b 93 00 08 sw (sp+8),r19 800b084: 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 ) 800b088: 78 0d 08 01 mvhi r13,0x801 800b08c: 39 ad e7 14 ori r13,r13,0xe714 800b090: 29 b2 00 00 lw r18,(r13+0) MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 800b094: b8 20 60 00 mv r12,r1 800b098: 20 51 00 ff andi r17,r2,0xff IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 800b09c: 02 4b 00 01 srui r11,r18,1 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 800b0a0: b8 60 98 00 mv r19,r3 IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 800b0a4: 01 6b 00 01 srui r11,r11,1 800b0a8: b9 60 10 00 mv r2,r11 800b0ac: 35 61 00 01 addi r1,r11,1 800b0b0: f8 00 3e bd calli 801aba4 <__mulsi3> 800b0b4: b9 60 10 00 mv r2,r11 800b0b8: 34 21 00 01 addi r1,r1,1 800b0bc: f8 00 3e ba calli 801aba4 <__mulsi3> 800b0c0: 34 21 ff ff addi r1,r1,-1 800b0c4: ba 40 10 00 mv r2,r18 800b0c8: f8 00 3e b7 calli 801aba4 <__mulsi3> 800b0cc: 54 33 00 11 bgu r1,r19,800b110 rtems_set_errno_and_return_minus_one( EFBIG ); 800b0d0: f8 00 03 b5 calli 800bfa4 <__errno> 800b0d4: 34 02 00 1b mvi r2,27 800b0d8: 58 22 00 00 sw (r1+0),r2 800b0dc: 34 01 ff ff mvi r1,-1 the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); IMFS_update_mtime(the_jnode); return 0; } 800b0e0: 2b 9d 00 04 lw ra,(sp+4) 800b0e4: 2b 8b 00 28 lw r11,(sp+40) 800b0e8: 2b 8c 00 24 lw r12,(sp+36) 800b0ec: 2b 8d 00 20 lw r13,(sp+32) 800b0f0: 2b 8e 00 1c lw r14,(sp+28) 800b0f4: 2b 8f 00 18 lw r15,(sp+24) 800b0f8: 2b 90 00 14 lw r16,(sp+20) 800b0fc: 2b 91 00 10 lw r17,(sp+16) 800b100: 2b 92 00 0c lw r18,(sp+12) 800b104: 2b 93 00 08 lw r19,(sp+8) 800b108: 37 9c 00 30 addi sp,sp,48 800b10c: c3 a0 00 00 ret 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 ) 800b110: 29 8e 00 50 lw r14,(r12+80) return 0; 800b114: 34 01 00 00 mvi r1,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 ) 800b118: 4d d3 ff f2 bge r14,r19,800b0e0 <== NEVER TAKEN return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 800b11c: ba 40 10 00 mv r2,r18 800b120: ba 60 08 00 mv r1,r19 800b124: f8 00 3e ac calli 801abd4 <__divsi3> 800b128: b8 20 80 00 mv r16,r1 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 800b12c: ba 40 10 00 mv r2,r18 800b130: b9 c0 08 00 mv r1,r14 800b134: f8 00 3e a8 calli 801abd4 <__divsi3> 800b138: b8 20 78 00 mv r15,r1 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++ ) { 800b13c: 54 30 00 0c bgu r1,r16,800b16c <== NEVER TAKEN /* * 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; offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK; 800b140: ba 40 10 00 mv r2,r18 800b144: f8 00 3e 98 calli 801aba4 <__mulsi3> 800b148: c9 c1 70 00 sub r14,r14,r1 800b14c: b9 e0 58 00 mv r11,r15 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { if ( !IMFS_memfile_addblock( the_jnode, block ) ) { 800b150: b9 60 10 00 mv r2,r11 800b154: b9 80 08 00 mv r1,r12 800b158: fb ff ff 0b calli 800ad84 800b15c: 5c 20 00 16 bne r1,r0,800b1b4 if ( zero_fill ) { 800b160: 5e 21 00 1b bne r17,r1,800b1cc 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++ ) { 800b164: 35 6b 00 01 addi r11,r11,1 800b168: 52 0b ff fa bgeu r16,r11,800b150 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); 800b16c: 37 8b 00 2c addi r11,sp,44 800b170: 34 02 00 00 mvi r2,0 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; 800b174: 59 93 00 50 sw (r12+80),r19 IMFS_update_ctime(the_jnode); 800b178: b9 60 08 00 mv r1,r11 800b17c: fb ff d9 59 calli 80016e0 800b180: 2b 83 00 2c lw r3,(sp+44) IMFS_update_mtime(the_jnode); 800b184: 34 02 00 00 mvi r2,0 800b188: b9 60 08 00 mv r1,r11 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); 800b18c: 59 83 00 48 sw (r12+72),r3 IMFS_update_mtime(the_jnode); 800b190: fb ff d9 54 calli 80016e0 800b194: 2b 82 00 2c lw r2,(sp+44) return 0; 800b198: 34 01 00 00 mvi r1,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); 800b19c: 59 82 00 44 sw (r12+68),r2 return 0; 800b1a0: e3 ff ff d0 bi 800b0e0 memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); 800b1a4: b9 60 10 00 mv r2,r11 800b1a8: b9 80 08 00 mv r1,r12 memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 800b1ac: 35 6b ff ff addi r11,r11,-1 IMFS_memfile_remove_block( the_jnode, block ); 800b1b0: fb ff ff 9f calli 800b02c memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 800b1b4: 51 6f ff fc bgeu r11,r15,800b1a4 IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 800b1b8: f8 00 03 7b calli 800bfa4 <__errno> 800b1bc: 34 02 00 1c mvi r2,28 800b1c0: 58 22 00 00 sw (r1+0),r2 800b1c4: 34 01 ff ff mvi r1,-1 800b1c8: e3 ff ff c6 bi 800b0e0 */ 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; block_p *block_ptr = 800b1cc: b9 60 10 00 mv r2,r11 800b1d0: 34 03 00 00 mvi r3,0 800b1d4: 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; 800b1d8: 29 b2 00 00 lw r18,(r13+0) block_p *block_ptr = 800b1dc: fb ff fd bc calli 800a8cc IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 800b1e0: 28 21 00 00 lw r1,(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; 800b1e4: ca 4e 90 00 sub r18,r18,r14 block_p *block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 800b1e8: 34 02 00 00 mvi r2,0 800b1ec: b4 2e 08 00 add r1,r1,r14 800b1f0: ba 40 18 00 mv r3,r18 800b1f4: f8 00 06 a7 calli 800cc90 offset = 0; 800b1f8: 34 0e 00 00 mvi r14,0 800b1fc: e3 ff ff da bi 800b164 =============================================================================== 0800a8cc : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 800a8cc: 37 9c ff dc addi sp,sp,-36 800a8d0: 5b 8b 00 20 sw (sp+32),r11 800a8d4: 5b 8c 00 1c sw (sp+28),r12 800a8d8: 5b 8d 00 18 sw (sp+24),r13 800a8dc: 5b 8e 00 14 sw (sp+20),r14 800a8e0: 5b 8f 00 10 sw (sp+16),r15 800a8e4: 5b 90 00 0c sw (sp+12),r16 800a8e8: 5b 91 00 08 sw (sp+8),r17 800a8ec: 5b 9d 00 04 sw (sp+4),ra my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 800a8f0: 78 04 08 01 mvhi r4,0x801 800a8f4: 38 84 e7 14 ori r4,r4,0xe714 800a8f8: 28 8b 00 00 lw r11,(r4+0) #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 800a8fc: b8 20 70 00 mv r14,r1 800a900: b8 40 60 00 mv r12,r2 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 800a904: 01 6b 00 01 srui r11,r11,1 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 800a908: b8 60 78 00 mv r15,r3 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 800a90c: 01 6b 00 01 srui r11,r11,1 800a910: 35 61 ff ff addi r1,r11,-1 800a914: 54 41 00 08 bgu r2,r1,800a934 p = info->indirect; 800a918: 29 c2 00 54 lw r2,(r14+84) if ( malloc_it ) { 800a91c: 44 60 00 2b be r3,r0,800a9c8 if ( !p ) { 800a920: 44 40 00 5f be r2,r0,800aa9c } if ( !p ) return 0; return &info->indirect[ my_block ]; 800a924: b5 8c 60 00 add r12,r12,r12 800a928: b5 8c 60 00 add r12,r12,r12 800a92c: b4 4c 68 00 add r13,r2,r12 800a930: e0 00 00 1b bi 800a99c /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 800a934: 35 61 00 01 addi r1,r11,1 800a938: b9 60 10 00 mv r2,r11 800a93c: f8 00 40 9a calli 801aba4 <__mulsi3> 800a940: b8 20 80 00 mv r16,r1 800a944: 34 21 ff ff addi r1,r1,-1 800a948: 55 81 00 23 bgu r12,r1,800a9d4 my_block -= FIRST_DOUBLY_INDIRECT; 800a94c: c9 8b 60 00 sub r12,r12,r11 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 800a950: b9 60 10 00 mv r2,r11 800a954: b9 80 08 00 mv r1,r12 800a958: f8 00 41 08 calli 801ad78 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800a95c: b9 60 10 00 mv r2,r11 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 800a960: b8 20 80 00 mv r16,r1 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800a964: b9 80 08 00 mv r1,r12 800a968: f8 00 40 f4 calli 801ad38 <__udivsi3> 800a96c: b8 20 10 00 mv r2,r1 p = info->doubly_indirect; 800a970: 29 c3 00 58 lw r3,(r14+88) if ( malloc_it ) { 800a974: 45 e0 00 3f be r15,r0,800aa70 if ( !p ) { 800a978: 44 60 00 4f be r3,r0,800aab4 if ( !p ) return 0; info->doubly_indirect = p; } p1 = (block_p *)p[ doubly ]; 800a97c: b4 42 10 00 add r2,r2,r2 800a980: b4 42 10 00 add r2,r2,r2 800a984: b4 62 10 00 add r2,r3,r2 800a988: 28 41 00 00 lw r1,(r2+0) if ( !p1 ) { 800a98c: 44 20 00 52 be r1,r0,800aad4 if ( !p1 ) return 0; p[ doubly ] = (block_p) p1; } return (block_p *)&p1[ singly ]; 800a990: b6 10 68 00 add r13,r16,r16 800a994: b5 ad 68 00 add r13,r13,r13 800a998: b4 2d 68 00 add r13,r1,r13 /* * This means the requested block number is out of range. */ return 0; } 800a99c: b9 a0 08 00 mv r1,r13 800a9a0: 2b 9d 00 04 lw ra,(sp+4) 800a9a4: 2b 8b 00 20 lw r11,(sp+32) 800a9a8: 2b 8c 00 1c lw r12,(sp+28) 800a9ac: 2b 8d 00 18 lw r13,(sp+24) 800a9b0: 2b 8e 00 14 lw r14,(sp+20) 800a9b4: 2b 8f 00 10 lw r15,(sp+16) 800a9b8: 2b 90 00 0c lw r16,(sp+12) 800a9bc: 2b 91 00 08 lw r17,(sp+8) 800a9c0: 37 9c 00 24 addi sp,sp,36 800a9c4: c3 a0 00 00 ret } return &info->indirect[ my_block ]; } if ( !p ) return 0; 800a9c8: 34 0d 00 00 mvi r13,0 info->indirect = p; } return &info->indirect[ my_block ]; } if ( !p ) 800a9cc: 5c 4d ff d6 bne r2,r13,800a924 <== ALWAYS TAKEN 800a9d0: e3 ff ff f3 bi 800a99c <== NOT EXECUTED } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 800a9d4: 36 01 00 01 addi r1,r16,1 800a9d8: b9 60 10 00 mv r2,r11 800a9dc: f8 00 40 72 calli 801aba4 <__mulsi3> 800a9e0: 34 21 ff ff addi r1,r1,-1 } /* * This means the requested block number is out of range. */ return 0; 800a9e4: 34 0d 00 00 mvi r13,0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 800a9e8: 55 81 ff ed bgu r12,r1,800a99c <== NEVER TAKEN my_block -= FIRST_TRIPLY_INDIRECT; 800a9ec: c9 90 80 00 sub r16,r12,r16 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 800a9f0: b9 60 10 00 mv r2,r11 800a9f4: ba 00 08 00 mv r1,r16 800a9f8: f8 00 40 e0 calli 801ad78 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800a9fc: b9 60 10 00 mv r2,r11 * 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; 800aa00: b8 20 60 00 mv r12,r1 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800aa04: ba 00 08 00 mv r1,r16 800aa08: f8 00 40 cc calli 801ad38 <__udivsi3> triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 800aa0c: b9 60 10 00 mv r2,r11 */ 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; 800aa10: b8 20 88 00 mv r17,r1 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 800aa14: f8 00 40 c9 calli 801ad38 <__udivsi3> doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 800aa18: b9 60 10 00 mv r2,r11 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; 800aa1c: b8 20 80 00 mv r16,r1 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 800aa20: ba 20 08 00 mv r1,r17 800aa24: f8 00 40 d5 calli 801ad78 <__umodsi3> 800aa28: b8 20 58 00 mv r11,r1 p = info->triply_indirect; 800aa2c: 29 c4 00 5c lw r4,(r14+92) if ( malloc_it ) { 800aa30: 45 e0 00 30 be r15,r0,800aaf0 if ( !p ) { 800aa34: 44 80 00 3e be r4,r0,800ab2c if ( !p ) return 0; info->triply_indirect = p; } p1 = (block_p *) p[ triply ]; 800aa38: b6 10 18 00 add r3,r16,r16 800aa3c: b4 63 18 00 add r3,r3,r3 800aa40: b4 83 70 00 add r14,r4,r3 800aa44: 29 c1 00 00 lw r1,(r14+0) if ( !p1 ) { 800aa48: 44 20 00 43 be r1,r0,800ab54 if ( !p1 ) return 0; p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; 800aa4c: b5 6b 10 00 add r2,r11,r11 800aa50: b4 42 10 00 add r2,r2,r2 800aa54: b4 22 58 00 add r11,r1,r2 800aa58: 29 61 00 00 lw r1,(r11+0) if ( !p2 ) { 800aa5c: 44 20 00 39 be r1,r0,800ab40 p2 = memfile_alloc_block(); if ( !p2 ) return 0; p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; 800aa60: b5 8c 68 00 add r13,r12,r12 800aa64: b5 ad 68 00 add r13,r13,r13 800aa68: b4 2d 68 00 add r13,r1,r13 800aa6c: e3 ff ff cc bi 800a99c return (block_p *)&p1[ singly ]; } if ( !p ) return 0; 800aa70: 34 0d 00 00 mvi r13,0 } return (block_p *)&p1[ singly ]; } if ( !p ) 800aa74: 44 6d ff ca be r3,r13,800a99c <== NEVER TAKEN return 0; p = (block_p *)p[ doubly ]; 800aa78: b4 21 10 00 add r2,r1,r1 800aa7c: b4 42 10 00 add r2,r2,r2 800aa80: b4 62 10 00 add r2,r3,r2 800aa84: 28 41 00 00 lw r1,(r2+0) if ( !p ) 800aa88: 44 20 ff c5 be r1,r0,800a99c <== NEVER TAKEN return 0; return (block_p *)&p[ singly ]; 800aa8c: b6 10 80 00 add r16,r16,r16 800aa90: b6 10 80 00 add r16,r16,r16 800aa94: b4 30 68 00 add r13,r1,r16 800aa98: e3 ff ff c1 bi 800a99c p = info->indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); 800aa9c: fb ff ff 7c calli 800a88c 800aaa0: b8 20 10 00 mv r2,r1 if ( !p ) return 0; 800aaa4: 34 0d 00 00 mvi r13,0 if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) 800aaa8: 44 20 ff bd be r1,r0,800a99c <== NEVER TAKEN return 0; info->indirect = p; 800aaac: 59 c1 00 54 sw (r14+84),r1 800aab0: e3 ff ff 9d bi 800a924 p = info->doubly_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); 800aab4: 5b 81 00 24 sw (sp+36),r1 800aab8: fb ff ff 75 calli 800a88c 800aabc: b8 20 18 00 mv r3,r1 if ( !p ) return 0; 800aac0: 34 0d 00 00 mvi r13,0 p = info->doubly_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) 800aac4: 2b 82 00 24 lw r2,(sp+36) 800aac8: 44 20 ff b5 be r1,r0,800a99c <== NEVER TAKEN return 0; info->doubly_indirect = p; 800aacc: 59 c1 00 58 sw (r14+88),r1 800aad0: e3 ff ff ab bi 800a97c } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); 800aad4: 5b 82 00 24 sw (sp+36),r2 800aad8: fb ff ff 6d calli 800a88c if ( !p1 ) return 0; 800aadc: 34 0d 00 00 mvi r13,0 } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) 800aae0: 2b 82 00 24 lw r2,(sp+36) 800aae4: 44 20 ff ae be r1,r0,800a99c <== NEVER TAKEN return 0; p[ doubly ] = (block_p) p1; 800aae8: 58 41 00 00 sw (r2+0),r1 800aaec: e3 ff ff a9 bi 800a990 p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; } if ( !p ) 800aaf0: 44 8d ff ab be r4,r13,800a99c <== NEVER TAKEN return 0; p1 = (block_p *) p[ triply ]; 800aaf4: b6 10 80 00 add r16,r16,r16 800aaf8: b6 10 80 00 add r16,r16,r16 800aafc: b4 90 20 00 add r4,r4,r16 800ab00: 28 81 00 00 lw r1,(r4+0) if ( !p1 ) 800ab04: 44 20 ff a6 be r1,r0,800a99c <== NEVER TAKEN return 0; p2 = (block_p *)p1[ doubly ]; 800ab08: b5 6b 58 00 add r11,r11,r11 800ab0c: b5 6b 58 00 add r11,r11,r11 800ab10: b4 2b 08 00 add r1,r1,r11 800ab14: 28 21 00 00 lw r1,(r1+0) if ( !p2 ) 800ab18: 44 20 ff a1 be r1,r0,800a99c <== NEVER TAKEN return 0; return (block_p *)&p2[ singly ]; 800ab1c: b5 8c 60 00 add r12,r12,r12 800ab20: b5 8c 60 00 add r12,r12,r12 800ab24: b4 2c 68 00 add r13,r1,r12 800ab28: e3 ff ff 9d bi 800a99c p = info->triply_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); 800ab2c: fb ff ff 58 calli 800a88c 800ab30: b8 20 20 00 mv r4,r1 if ( !p ) 800ab34: 44 20 ff 9a be r1,r0,800a99c <== NEVER TAKEN return 0; info->triply_indirect = p; 800ab38: 59 c1 00 5c sw (r14+92),r1 800ab3c: e3 ff ff bf bi 800aa38 p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); 800ab40: fb ff ff 53 calli 800a88c if ( !p2 ) return 0; 800ab44: 34 0d 00 00 mvi r13,0 } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); if ( !p2 ) 800ab48: 44 20 ff 95 be r1,r0,800a99c <== NEVER TAKEN return 0; p1[ doubly ] = (block_p) p2; 800ab4c: 59 61 00 00 sw (r11+0),r1 800ab50: e3 ff ff c4 bi 800aa60 info->triply_indirect = p; } p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); 800ab54: fb ff ff 4e calli 800a88c if ( !p1 ) return 0; 800ab58: 34 0d 00 00 mvi r13,0 } p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) 800ab5c: 44 20 ff 90 be r1,r0,800a99c <== NEVER TAKEN return 0; p[ triply ] = (block_p) p1; 800ab60: 59 c1 00 00 sw (r14+0),r1 800ab64: e3 ff ff ba bi 800aa4c =============================================================================== 0800ab68 : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 800ab68: 37 9c ff d0 addi sp,sp,-48 800ab6c: 5b 8b 00 28 sw (sp+40),r11 800ab70: 5b 8c 00 24 sw (sp+36),r12 800ab74: 5b 8d 00 20 sw (sp+32),r13 800ab78: 5b 8e 00 1c sw (sp+28),r14 800ab7c: 5b 8f 00 18 sw (sp+24),r15 800ab80: 5b 90 00 14 sw (sp+20),r16 800ab84: 5b 91 00 10 sw (sp+16),r17 800ab88: 5b 92 00 0c sw (sp+12),r18 800ab8c: 5b 93 00 08 sw (sp+8),r19 800ab90: 5b 9d 00 04 sw (sp+4),ra 800ab94: b8 20 80 00 mv r16,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; 800ab98: 28 21 00 4c lw r1,(r1+76) 800ab9c: b8 40 68 00 mv r13,r2 800aba0: b8 60 90 00 mv r18,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 ) { 800aba4: 28 22 00 00 lw r2,(r1+0) 800aba8: 34 01 00 05 mvi r1,5 800abac: 44 41 00 55 be r2,r1,800ad00 /* * 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 ) 800abb0: 2a 01 00 50 lw r1,(r16+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; 800abb4: b4 8d 10 00 add r2,r4,r13 if ( last_byte > the_jnode->info.file.size ) 800abb8: b8 80 60 00 mv r12,r4 800abbc: 50 22 00 02 bgeu r1,r2,800abc4 my_length = the_jnode->info.file.size - start; 800abc0: c8 2d 60 00 sub r12,r1,r13 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800abc4: 78 11 08 01 mvhi r17,0x801 800abc8: 3a 31 e7 14 ori r17,r17,0xe714 800abcc: 2a 2b 00 00 lw r11,(r17+0) 800abd0: b9 a0 08 00 mv r1,r13 unsigned int last_byte; unsigned int copied; unsigned int start_offset; unsigned char *dest; dest = destination; 800abd4: ba 40 70 00 mv r14,r18 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800abd8: b9 60 10 00 mv r2,r11 800abdc: f8 00 40 2e calli 801ac94 <__modsi3> 800abe0: b8 20 98 00 mv r19,r1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 800abe4: b9 60 10 00 mv r2,r11 800abe8: b9 a0 08 00 mv r1,r13 800abec: f8 00 3f fa calli 801abd4 <__divsi3> 800abf0: b8 20 68 00 mv r13,r1 */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) my_length = the_jnode->info.file.size - start; copied = 0; 800abf4: 34 0f 00 00 mvi r15,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 ) { 800abf8: 5e 60 00 2f bne r19,r0,800acb4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800abfc: 55 6c 00 11 bgu r11,r12,800ac40 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800ac00: b9 a0 10 00 mv r2,r13 800ac04: 34 03 00 00 mvi r3,0 800ac08: ba 00 08 00 mv r1,r16 800ac0c: fb ff ff 30 calli 800a8cc 800ac10: b8 20 10 00 mv r2,r1 if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 800ac14: b9 60 18 00 mv r3,r11 800ac18: b9 c0 08 00 mv r1,r14 dest += to_copy; block++; my_length -= to_copy; 800ac1c: c9 8b 60 00 sub r12,r12,r11 * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) 800ac20: 44 40 00 18 be r2,r0,800ac80 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 800ac24: 28 42 00 00 lw r2,(r2+0) dest += to_copy; 800ac28: b5 cb 70 00 add r14,r14,r11 block++; 800ac2c: 35 ad 00 01 addi r13,r13,1 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 800ac30: f8 00 07 d7 calli 800cb8c /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800ac34: 2a 21 00 00 lw r1,(r17+0) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); dest += to_copy; block++; my_length -= to_copy; copied += to_copy; 800ac38: b5 eb 78 00 add r15,r15,r11 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800ac3c: 51 81 ff f1 bgeu r12,r1,800ac00 /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { 800ac40: 45 80 00 0b be r12,r0,800ac6c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800ac44: ba 00 08 00 mv r1,r16 800ac48: b9 a0 10 00 mv r2,r13 800ac4c: 34 03 00 00 mvi r3,0 800ac50: fb ff ff 1f calli 800a8cc if ( !block_ptr ) 800ac54: 44 20 00 0b be r1,r0,800ac80 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 800ac58: 28 22 00 00 lw r2,(r1+0) 800ac5c: b9 80 18 00 mv r3,r12 800ac60: b9 c0 08 00 mv r1,r14 800ac64: f8 00 07 ca calli 800cb8c copied += my_length; 800ac68: b5 ec 78 00 add r15,r15,r12 } IMFS_update_atime( the_jnode ); 800ac6c: 37 81 00 2c addi r1,sp,44 800ac70: 34 02 00 00 mvi r2,0 800ac74: fb ff da 9b calli 80016e0 800ac78: 2b 81 00 2c lw r1,(sp+44) 800ac7c: 5a 01 00 40 sw (r16+64),r1 return copied; } 800ac80: b9 e0 08 00 mv r1,r15 800ac84: 2b 9d 00 04 lw ra,(sp+4) 800ac88: 2b 8b 00 28 lw r11,(sp+40) 800ac8c: 2b 8c 00 24 lw r12,(sp+36) 800ac90: 2b 8d 00 20 lw r13,(sp+32) 800ac94: 2b 8e 00 1c lw r14,(sp+28) 800ac98: 2b 8f 00 18 lw r15,(sp+24) 800ac9c: 2b 90 00 14 lw r16,(sp+20) 800aca0: 2b 91 00 10 lw r17,(sp+16) 800aca4: 2b 92 00 0c lw r18,(sp+12) 800aca8: 2b 93 00 08 lw r19,(sp+8) 800acac: 37 9c 00 30 addi sp,sp,48 800acb0: c3 a0 00 00 ret block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800acb4: ba 00 08 00 mv r1,r16 800acb8: b9 a0 10 00 mv r2,r13 800acbc: 34 03 00 00 mvi r3,0 800acc0: fb ff ff 03 calli 800a8cc if ( !block_ptr ) 800acc4: 44 20 ff ef be r1,r0,800ac80 <== 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; 800acc8: c9 73 58 00 sub r11,r11,r19 800accc: b9 80 78 00 mv r15,r12 800acd0: 51 6c 00 02 bgeu r11,r12,800acd8 800acd4: b9 60 78 00 mv r15,r11 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 ); 800acd8: 28 22 00 00 lw r2,(r1+0) 800acdc: b9 e0 18 00 mv r3,r15 800ace0: ba 40 08 00 mv r1,r18 800ace4: b4 53 10 00 add r2,r2,r19 800ace8: f8 00 07 a9 calli 800cb8c dest += to_copy; 800acec: b6 4f 70 00 add r14,r18,r15 block++; my_length -= to_copy; 800acf0: 2a 2b 00 00 lw r11,(r17+0) block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); dest += to_copy; block++; 800acf4: 35 ad 00 01 addi r13,r13,1 my_length -= to_copy; 800acf8: c9 8f 60 00 sub r12,r12,r15 800acfc: e3 ff ff c0 bi 800abfc if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) 800ad00: 2a 0f 00 50 lw r15,(r16+80) 800ad04: c9 ed 78 00 sub r15,r15,r13 * 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 ) { 800ad08: 50 8f 00 02 bgeu r4,r15,800ad10 <== ALWAYS TAKEN 800ad0c: b8 80 78 00 mv r15,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); 800ad10: 2a 02 00 54 lw r2,(r16+84) 800ad14: b9 e0 18 00 mv r3,r15 800ad18: ba 40 08 00 mv r1,r18 800ad1c: b4 4d 10 00 add r2,r2,r13 800ad20: f8 00 07 9b calli 800cb8c return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); 800ad24: 37 81 00 2c addi r1,sp,44 800ad28: 34 02 00 00 mvi r2,0 800ad2c: fb ff da 6d calli 80016e0 800ad30: 2b 81 00 2c lw r1,(sp+44) 800ad34: 5a 01 00 40 sw (r16+64),r1 800ad38: e3 ff ff d2 bi 800ac80 =============================================================================== 0800ae80 : * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 800ae80: 37 9c ff dc addi sp,sp,-36 800ae84: 5b 8b 00 24 sw (sp+36),r11 800ae88: 5b 8c 00 20 sw (sp+32),r12 800ae8c: 5b 8d 00 1c sw (sp+28),r13 800ae90: 5b 8e 00 18 sw (sp+24),r14 800ae94: 5b 8f 00 14 sw (sp+20),r15 800ae98: 5b 90 00 10 sw (sp+16),r16 800ae9c: 5b 91 00 0c sw (sp+12),r17 800aea0: 5b 92 00 08 sw (sp+8),r18 800aea4: 5b 9d 00 04 sw (sp+4),ra /* * 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; 800aea8: 78 0c 08 01 mvhi r12,0x801 800aeac: 39 8c e7 14 ori r12,r12,0xe714 800aeb0: 29 8d 00 00 lw r13,(r12+0) * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 800aeb4: b8 20 78 00 mv r15,r1 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 800aeb8: 28 21 00 54 lw r1,(r1+84) /* * 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; 800aebc: 01 ad 00 01 srui r13,r13,1 800aec0: 01 ad 00 01 srui r13,r13,1 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 800aec4: 44 20 00 04 be r1,r0,800aed4 memfile_free_blocks_in_table( &info->indirect, to_free ); 800aec8: 35 e1 00 54 addi r1,r15,84 800aecc: b9 a0 10 00 mv r2,r13 800aed0: fb ff ff ce calli 800ae08 } if ( info->doubly_indirect ) { 800aed4: 29 e2 00 58 lw r2,(r15+88) 800aed8: 44 40 00 19 be r2,r0,800af3c for ( i=0 ; i <== NEVER TAKEN if ( info->doubly_indirect[i] ) { 800aef4: b4 21 08 00 add r1,r1,r1 800aef8: b4 21 08 00 add r1,r1,r1 800aefc: b4 41 08 00 add r1,r2,r1 800af00: 28 23 00 00 lw r3,(r1+0) if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; idoubly_indirect[i] ) { memfile_free_blocks_in_table( 800af08: b9 a0 10 00 mv r2,r13 memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; idoubly_indirect[i] ) { 800af0c: 44 60 00 02 be r3,r0,800af14 <== NEVER TAKEN memfile_free_blocks_in_table( 800af10: fb ff ff be calli 800ae08 if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i 800af28: 29 e2 00 58 lw r2,(r15+88) 800af2c: e3 ff ff f2 bi 800aef4 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 ); 800af30: 35 e1 00 58 addi r1,r15,88 800af34: b9 a0 10 00 mv r2,r13 800af38: fb ff ff b4 calli 800ae08 } if ( info->triply_indirect ) { 800af3c: 29 e1 00 5c lw r1,(r15+92) 800af40: 44 20 00 27 be r1,r0,800afdc for ( i=0 ; i <== NEVER TAKEN p = (block_p *) info->triply_indirect[i]; 800af54: 28 2e 00 00 lw r14,(r1+0) if ( !p ) /* ensure we have a valid pointer */ 800af58: 34 10 00 04 mvi r16,4 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 800af5c: 34 12 00 00 mvi r18,0 if ( !p ) /* ensure we have a valid pointer */ 800af60: 34 11 00 00 mvi r17,0 800af64: 45 c0 00 1b be r14,r0,800afd0 <== NEVER TAKEN break; for ( j=0 ; j <== NEVER TAKEN 800af70: 34 03 00 00 mvi r3,0 800af74: 34 0b 00 00 mvi r11,0 if ( p[j] ) { 800af78: b4 63 18 00 add r3,r3,r3 800af7c: b4 63 18 00 add r3,r3,r3 800af80: b5 c3 08 00 add r1,r14,r3 800af84: 28 23 00 00 lw r3,(r1+0) if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; jtriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j <== NEVER TAKEN memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 800af94: fb ff ff 9d calli 800ae08 if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j 800afac: 29 e1 00 5c lw r1,(r15+92) if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( 800afb0: b4 32 08 00 add r1,r1,r18 800afb4: b9 a0 10 00 mv r2,r13 800afb8: fb ff ff 94 calli 800ae08 memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( 800afd0: 35 e1 00 5c addi r1,r15,92 800afd4: b9 a0 10 00 mv r2,r13 800afd8: fb ff ff 8c calli 800ae08 (block_p **)&info->triply_indirect, to_free ); } return the_jnode; } 800afdc: b9 e0 08 00 mv r1,r15 800afe0: 2b 9d 00 04 lw ra,(sp+4) 800afe4: 2b 8b 00 24 lw r11,(sp+36) 800afe8: 2b 8c 00 20 lw r12,(sp+32) 800afec: 2b 8d 00 1c lw r13,(sp+28) 800aff0: 2b 8e 00 18 lw r14,(sp+24) 800aff4: 2b 8f 00 14 lw r15,(sp+20) 800aff8: 2b 90 00 10 lw r16,(sp+16) 800affc: 2b 91 00 0c lw r17,(sp+12) 800b000: 2b 92 00 08 lw r18,(sp+8) 800b004: 37 9c 00 24 addi sp,sp,36 800b008: c3 a0 00 00 ret } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 800b00c: 29 e1 00 5c lw r1,(r15+92) 800b010: 36 04 00 04 addi r4,r16,4 800b014: b4 30 18 00 add r3,r1,r16 800b018: 28 6e 00 00 lw r14,(r3+0) if ( !p ) /* ensure we have a valid pointer */ 800b01c: 45 c0 ff ed be r14,r0,800afd0 <== NEVER TAKEN } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 800b020: ba 00 90 00 mv r18,r16 if ( !p ) /* ensure we have a valid pointer */ 800b024: b8 80 80 00 mv r16,r4 800b028: e3 ff ff d0 bi 800af68 =============================================================================== 0800b200 : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 800b200: 37 9c ff cc addi sp,sp,-52 800b204: 5b 8b 00 2c sw (sp+44),r11 800b208: 5b 8c 00 28 sw (sp+40),r12 800b20c: 5b 8d 00 24 sw (sp+36),r13 800b210: 5b 8e 00 20 sw (sp+32),r14 800b214: 5b 8f 00 1c sw (sp+28),r15 800b218: 5b 90 00 18 sw (sp+24),r16 800b21c: 5b 91 00 14 sw (sp+20),r17 800b220: 5b 92 00 10 sw (sp+16),r18 800b224: 5b 93 00 0c sw (sp+12),r19 800b228: 5b 94 00 08 sw (sp+8),r20 800b22c: 5b 9d 00 04 sw (sp+4),ra * 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 ) { 800b230: 28 25 00 50 lw r5,(r1+80) IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 800b234: b8 80 90 00 mv r18,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; 800b238: b4 82 20 00 add r4,r4,r2 IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 800b23c: b8 20 88 00 mv r17,r1 800b240: b8 40 60 00 mv r12,r2 800b244: b8 60 98 00 mv r19,r3 * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + my_length; if ( last_byte > the_jnode->info.file.size ) { 800b248: 50 a4 00 06 bgeu r5,r4,800b260 bool zero_fill = start > the_jnode->info.file.size; status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); 800b24c: e8 45 10 00 cmpg r2,r2,r5 800b250: b8 80 18 00 mv r3,r4 800b254: fb ff ff 82 calli 800b05c 800b258: b8 20 28 00 mv r5,r1 if ( status ) 800b25c: 5c 20 00 33 bne r1,r0,800b328 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800b260: 78 10 08 01 mvhi r16,0x801 800b264: 3a 10 e7 14 ori r16,r16,0xe714 800b268: 2a 0b 00 00 lw r11,(r16+0) 800b26c: b9 80 08 00 mv r1,r12 unsigned int last_byte; unsigned int start_offset; int copied; const unsigned char *src; src = source; 800b270: ba 60 70 00 mv r14,r19 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800b274: b9 60 10 00 mv r2,r11 800b278: f8 00 3e 87 calli 801ac94 <__modsi3> 800b27c: b8 20 a0 00 mv r20,r1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 800b280: b9 60 10 00 mv r2,r11 800b284: b9 80 08 00 mv r1,r12 800b288: f8 00 3e 53 calli 801abd4 <__divsi3> 800b28c: b8 20 68 00 mv r13,r1 if ( start_offset ) { 800b290: ba 40 60 00 mv r12,r18 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); if ( status ) return status; } copied = 0; 800b294: 34 0f 00 00 mvi r15,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 ) { 800b298: 5e 80 00 32 bne r20,r0,800b360 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800b29c: 55 6c 00 10 bgu r11,r12,800b2dc block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800b2a0: b9 a0 10 00 mv r2,r13 800b2a4: 34 03 00 00 mvi r3,0 800b2a8: ba 20 08 00 mv r1,r17 800b2ac: fb ff fd 88 calli 800a8cc if ( !block_ptr ) return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, to_copy ); 800b2b0: b9 c0 10 00 mv r2,r14 800b2b4: b9 60 18 00 mv r3,r11 src += to_copy; block++; my_length -= to_copy; 800b2b8: c9 8b 60 00 sub r12,r12,r11 */ 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 ) 800b2bc: 44 20 00 3c be r1,r0,800b3ac <== 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 ); 800b2c0: 28 21 00 00 lw r1,(r1+0) src += to_copy; 800b2c4: b5 cb 70 00 add r14,r14,r11 block++; 800b2c8: 35 ad 00 01 addi r13,r13,1 if ( !block_ptr ) return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, to_copy ); 800b2cc: f8 00 06 30 calli 800cb8c /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800b2d0: 2a 01 00 00 lw r1,(r16+0) * 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( 800b2d4: b5 eb 78 00 add r15,r15,r11 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800b2d8: 51 81 ff f2 bgeu r12,r1,800b2a0 * 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 ) { 800b2dc: 45 80 00 0c be r12,r0,800b30c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800b2e0: ba 20 08 00 mv r1,r17 800b2e4: b9 a0 10 00 mv r2,r13 800b2e8: 34 03 00 00 mvi r3,0 800b2ec: fb ff fd 78 calli 800a8cc if ( !block_ptr ) 800b2f0: b9 e0 28 00 mv r5,r15 800b2f4: 44 20 00 0d be r1,r0,800b328 <== 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 ); 800b2f8: 28 21 00 00 lw r1,(r1+0) 800b2fc: b9 c0 10 00 mv r2,r14 800b300: b9 80 18 00 mv r3,r12 800b304: f8 00 06 22 calli 800cb8c my_length = 0; copied += to_copy; 800b308: b5 ec 78 00 add r15,r15,r12 } IMFS_mtime_ctime_update( the_jnode ); 800b30c: 37 81 00 30 addi r1,sp,48 800b310: 34 02 00 00 mvi r2,0 800b314: fb ff d8 f3 calli 80016e0 800b318: 2b 81 00 30 lw r1,(sp+48) return copied; 800b31c: b9 e0 28 00 mv r5,r15 memcpy( &(*block_ptr)[ 0 ], src, my_length ); my_length = 0; copied += to_copy; } IMFS_mtime_ctime_update( the_jnode ); 800b320: 5a 21 00 44 sw (r17+68),r1 800b324: 5a 21 00 48 sw (r17+72),r1 return copied; } 800b328: b8 a0 08 00 mv r1,r5 800b32c: 2b 9d 00 04 lw ra,(sp+4) 800b330: 2b 8b 00 2c lw r11,(sp+44) 800b334: 2b 8c 00 28 lw r12,(sp+40) 800b338: 2b 8d 00 24 lw r13,(sp+36) 800b33c: 2b 8e 00 20 lw r14,(sp+32) 800b340: 2b 8f 00 1c lw r15,(sp+28) 800b344: 2b 90 00 18 lw r16,(sp+24) 800b348: 2b 91 00 14 lw r17,(sp+20) 800b34c: 2b 92 00 10 lw r18,(sp+16) 800b350: 2b 93 00 0c lw r19,(sp+12) 800b354: 2b 94 00 08 lw r20,(sp+8) 800b358: 37 9c 00 34 addi sp,sp,52 800b35c: c3 a0 00 00 ret block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800b360: ba 20 08 00 mv r1,r17 800b364: b9 a0 10 00 mv r2,r13 800b368: 34 03 00 00 mvi r3,0 800b36c: fb ff fd 58 calli 800a8cc if ( !block_ptr ) return copied; 800b370: 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 ) 800b374: 44 20 ff ed be r1,r0,800b328 <== 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; 800b378: c9 74 78 00 sub r15,r11,r20 800b37c: 52 4f 00 02 bgeu r18,r15,800b384 800b380: ba 40 78 00 mv r15,r18 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 800b384: 28 21 00 00 lw r1,(r1+0) 800b388: ba 60 10 00 mv r2,r19 800b38c: b9 e0 18 00 mv r3,r15 800b390: b4 34 08 00 add r1,r1,r20 800b394: f8 00 05 fe calli 800cb8c src += to_copy; 800b398: b6 6f 70 00 add r14,r19,r15 block++; my_length -= to_copy; copied += to_copy; 800b39c: 2a 0b 00 00 lw r11,(r16+0) src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); src += to_copy; block++; 800b3a0: 35 ad 00 01 addi r13,r13,1 my_length -= to_copy; 800b3a4: ca 4f 60 00 sub r12,r18,r15 800b3a8: e3 ff ff bd bi 800b29c */ 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 ) 800b3ac: b9 e0 28 00 mv r5,r15 <== NOT EXECUTED 800b3b0: e3 ff ff de bi 800b328 <== NOT EXECUTED =============================================================================== 08000d94 : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 8000d94: 37 9c ff dc addi sp,sp,-36 8000d98: 5b 8b 00 0c sw (sp+12),r11 8000d9c: 5b 8c 00 08 sw (sp+8),r12 8000da0: 5b 9d 00 04 sw (sp+4),ra dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 8000da4: 20 87 f0 00 andi r7,r4,0xf000 const char *name, size_t namelen, mode_t mode, dev_t dev ) { 8000da8: b8 40 48 00 mv r9,r2 dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 8000dac: 34 02 40 00 mvi r2,16384 const char *name, size_t namelen, mode_t mode, dev_t dev ) { 8000db0: b8 80 40 00 mv r8,r4 8000db4: b8 20 58 00 mv r11,r1 8000db8: b8 60 20 00 mv r4,r3 IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; 8000dbc: 34 01 00 00 mvi r1,0 dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 8000dc0: 44 e2 00 0a be r7,r2,8000de8 *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { 8000dc4: 34 42 40 00 addi r2,r2,16384 8000dc8: 44 e2 00 2d be r7,r2,8000e7c *type = IMFS_MEMORY_FILE; } else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) { 8000dcc: 64 e3 20 00 cmpei r3,r7,8192 8000dd0: 64 e2 60 00 cmpei r2,r7,24576 8000dd4: b8 62 10 00 or r2,r3,r2 8000dd8: 44 40 00 25 be r2,r0,8000e6c *type = IMFS_DEVICE; rtems_filesystem_split_dev_t( 8000ddc: 5b 85 00 10 sw (sp+16),r5 8000de0: 5b 86 00 14 sw (sp+20),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; 8000de4: 34 01 00 01 mvi r1,1 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; 8000de8: 29 62 00 14 lw r2,(r11+20) return IMFS_create_node_with_control( 8000dec: 34 26 00 02 addi r6,r1,2 8000df0: b4 c6 30 00 add r6,r6,r6 8000df4: 28 42 00 08 lw r2,(r2+8) 8000df8: b4 c6 30 00 add r6,r6,r6 8000dfc: b9 60 08 00 mv r1,r11 8000e00: b4 46 30 00 add r6,r2,r6 8000e04: 28 c2 00 00 lw r2,(r6+0) 8000e08: b9 20 18 00 mv r3,r9 8000e0c: b9 00 28 00 mv r5,r8 8000e10: 37 86 00 10 addi r6,sp,16 8000e14: f8 00 1d ed calli 80085c8 IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); } else { rv = -1; 8000e18: 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 ) { 8000e1c: 44 20 00 0e be r1,r0,8000e54 IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); 8000e20: 37 8c 00 20 addi r12,sp,32 8000e24: 34 02 00 00 mvi r2,0 8000e28: 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; 8000e2c: 29 6b 00 08 lw r11,(r11+8) IMFS_update_ctime( parent ); 8000e30: f8 00 02 2c calli 80016e0 8000e34: 2b 83 00 20 lw r3,(sp+32) IMFS_update_mtime( parent ); 8000e38: 34 02 00 00 mvi r2,0 8000e3c: b9 80 08 00 mv r1,r12 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 ); 8000e40: 59 63 00 48 sw (r11+72),r3 IMFS_update_mtime( parent ); 8000e44: f8 00 02 27 calli 80016e0 8000e48: 2b 81 00 20 lw r1,(sp+32) size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 8000e4c: 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 ); 8000e50: 59 61 00 44 sw (r11+68),r1 } else { rv = -1; } return rv; } 8000e54: b8 40 08 00 mv r1,r2 8000e58: 2b 9d 00 04 lw ra,(sp+4) 8000e5c: 2b 8b 00 0c lw r11,(sp+12) 8000e60: 2b 8c 00 08 lw r12,(sp+8) 8000e64: 37 9c 00 24 addi sp,sp,36 8000e68: c3 a0 00 00 ret rtems_filesystem_split_dev_t( dev, info->device.major, info->device.minor ); } else if (S_ISFIFO( mode )) { 8000e6c: 34 02 10 00 mvi r2,4096 8000e70: 5c e2 ff de bne r7,r2,8000de8 <== NEVER TAKEN *type = IMFS_FIFO; 8000e74: 34 01 00 06 mvi r1,6 8000e78: e3 ff ff dc bi 8000de8 ) { if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { *type = IMFS_MEMORY_FILE; 8000e7c: 34 01 00 04 mvi r1,4 8000e80: e3 ff ff da bi 8000de8 =============================================================================== 08000e84 : #endif #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 8000e84: 37 9c ff fc addi sp,sp,-4 8000e88: 5b 9d 00 04 sw (sp+4),ra int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 8000e8c: 28 22 00 20 lw r2,(r1+32) 8000e90: 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; 8000e94: 28 43 00 4c lw r3,(r2+76) if ( IMFS_is_directory( node ) ) { 8000e98: 28 63 00 00 lw r3,(r3+0) 8000e9c: 5c 60 00 0d bne r3,r0,8000ed0 if ( node->info.directory.mt_fs == NULL ) { 8000ea0: 28 44 00 5c lw r4,(r2+92) 8000ea4: 5c 83 00 06 bne r4,r3,8000ebc <== NEVER TAKEN node->info.directory.mt_fs = mt_entry; 8000ea8: 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; 8000eac: 34 01 00 00 mvi r1,0 errno = ENOTDIR; rv = -1; } return rv; } 8000eb0: 2b 9d 00 04 lw ra,(sp+4) 8000eb4: 37 9c 00 04 addi sp,sp,4 8000eb8: c3 a0 00 00 ret if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == NULL ) { node->info.directory.mt_fs = mt_entry; } else { errno = EBUSY; 8000ebc: f8 00 2c 3a calli 800bfa4 <__errno> <== NOT EXECUTED 8000ec0: 34 02 00 10 mvi r2,16 <== NOT EXECUTED 8000ec4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8000ec8: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8000ecc: e3 ff ff f9 bi 8000eb0 <== NOT EXECUTED } } else { errno = ENOTDIR; 8000ed0: f8 00 2c 35 calli 800bfa4 <__errno> 8000ed4: 34 02 00 14 mvi r2,20 8000ed8: 58 22 00 00 sw (r1+0),r2 rv = -1; 8000edc: 34 01 ff ff mvi r1,-1 8000ee0: e3 ff ff f4 bi 8000eb0 =============================================================================== 08008a04 : } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { 8008a04: 37 9c ff fc addi sp,sp,-4 8008a08: 5b 9d 00 04 sw (sp+4),ra if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 8008a0c: 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 ); 8008a10: 34 22 00 54 addi r2,r1,84 8008a14: 5c 62 00 06 bne r3,r2,8008a2c errno = ENOTEMPTY; node = NULL; } else if ( IMFS_is_mount_point( node ) ) { 8008a18: 28 22 00 5c lw r2,(r1+92) 8008a1c: 5c 40 00 0b bne r2,r0,8008a48 <== NEVER TAKEN errno = EBUSY; node = NULL; } return node; } 8008a20: 2b 9d 00 04 lw ra,(sp+4) 8008a24: 37 9c 00 04 addi sp,sp,4 8008a28: c3 a0 00 00 ret static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { errno = ENOTEMPTY; 8008a2c: f8 00 0d 5e calli 800bfa4 <__errno> 8008a30: 34 02 00 5a mvi r2,90 8008a34: 58 22 00 00 sw (r1+0),r2 node = NULL; 8008a38: 34 01 00 00 mvi r1,0 errno = EBUSY; node = NULL; } return node; } 8008a3c: 2b 9d 00 04 lw ra,(sp+4) 8008a40: 37 9c 00 04 addi sp,sp,4 8008a44: c3 a0 00 00 ret { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { errno = ENOTEMPTY; node = NULL; } else if ( IMFS_is_mount_point( node ) ) { errno = EBUSY; 8008a48: f8 00 0d 57 calli 800bfa4 <__errno> <== NOT EXECUTED 8008a4c: 34 02 00 10 mvi r2,16 <== NOT EXECUTED 8008a50: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED node = NULL; 8008a54: 34 01 00 00 mvi r1,0 <== NOT EXECUTED } return node; } 8008a58: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8008a5c: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 8008a60: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08000ee4 : rtems_filesystem_node_types_t IMFS_node_type( const rtems_filesystem_location_info_t *loc ) { const IMFS_jnode_t *node = loc->node_access; 8000ee4: 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 ) { 8000ee8: 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; 8000eec: 28 22 00 4c lw r2,(r1+76) 8000ef0: 28 42 00 00 lw r2,(r2+0) 8000ef4: 44 43 00 06 be r2,r3,8000f0c 8000ef8: 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; 8000efc: 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 ) { 8000f00: 44 43 00 07 be r2,r3,8000f1c <== NEVER TAKEN 8000f04: b8 40 08 00 mv r1,r2 type = imfs_type; break; } return type; } 8000f08: c3 a0 00 00 ret 8000f0c: 28 21 00 50 lw r1,(r1+80) 8000f10: 28 21 00 4c lw r1,(r1+76) 8000f14: 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; 8000f18: c3 a0 00 00 ret 8000f1c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08000f20 : ) { IMFS_jnode_t *node; ssize_t i; node = loc->node_access; 8000f20: 28 25 00 08 lw r5,(r1+8) IMFS_assert( node->control->imfs_type == IMFS_SYM_LINK ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) 8000f24: 34 01 00 00 mvi r1,0 8000f28: 44 60 00 0e be r3,r0,8000f60 <== NEVER TAKEN 8000f2c: 28 a4 00 50 lw r4,(r5+80) 8000f30: 40 84 00 00 lbu r4,(r4+0) 8000f34: 44 80 00 0b be r4,r0,8000f60 <== NEVER TAKEN 8000f38: 34 06 00 00 mvi r6,0 buf[i] = node->info.sym_link.name[i]; 8000f3c: b4 46 30 00 add r6,r2,r6 8000f40: 30 c4 00 00 sb (r6+0),r4 node = loc->node_access; IMFS_assert( node->control->imfs_type == IMFS_SYM_LINK ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) 8000f44: 34 21 00 01 addi r1,r1,1 8000f48: b8 20 30 00 mv r6,r1 8000f4c: 50 23 00 05 bgeu r1,r3,8000f60 8000f50: 28 a4 00 50 lw r4,(r5+80) 8000f54: b4 81 20 00 add r4,r4,r1 8000f58: 40 84 00 00 lbu r4,(r4+0) 8000f5c: 5c 80 ff f8 bne r4,r0,8000f3c buf[i] = node->info.sym_link.name[i]; return i; } 8000f60: c3 a0 00 00 ret =============================================================================== 08000f64 : const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 8000f64: 37 9c ff e8 addi sp,sp,-24 8000f68: 5b 8b 00 10 sw (sp+16),r11 8000f6c: 5b 8c 00 0c sw (sp+12),r12 8000f70: 5b 8d 00 08 sw (sp+8),r13 8000f74: 5b 9d 00 04 sw (sp+4),ra int rv = 0; IMFS_jnode_t *node = oldloc->node_access; 8000f78: 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 ) { 8000f7c: 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; 8000f80: 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 ) { 8000f84: 29 61 00 08 lw r1,(r11+8) 8000f88: 44 20 00 25 be r1,r0,800101c <== NEVER TAKEN if ( namelen < IMFS_NAME_MAX ) { 8000f8c: 34 01 00 1f mvi r1,31 8000f90: 54 a1 00 1e bgu r5,r1,8001008 <== NEVER TAKEN memcpy( node->name, name, namelen ); 8000f94: b8 80 10 00 mv r2,r4 8000f98: b8 a0 18 00 mv r3,r5 8000f9c: 35 61 00 0c addi r1,r11,12 8000fa0: f8 00 2e fb calli 800cb8c ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 8000fa4: 29 63 00 00 lw r3,(r11+0) previous = the_node->previous; 8000fa8: 29 61 00 04 lw r1,(r11+4) node->name [namelen] = '\0'; 8000fac: b5 6d 68 00 add r13,r11,r13 8000fb0: 31 a0 00 0c sb (r13+12),r0 next->previous = previous; 8000fb4: 58 61 00 04 sw (r3+4),r1 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 8000fb8: 29 82 00 58 lw r2,(r12+88) Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; previous->next = next; 8000fbc: 58 23 00 00 sw (r1+0),r3 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 8000fc0: 35 81 00 54 addi r1,r12,84 Chain_Node *old_last = tail->previous; the_node->next = tail; 8000fc4: 59 61 00 00 sw (r11+0),r1 static inline void IMFS_add_to_directory( IMFS_jnode_t *dir, IMFS_jnode_t *node ) { node->Parent = dir; 8000fc8: 59 6c 00 08 sw (r11+8),r12 tail->previous = the_node; old_last->next = the_node; 8000fcc: 58 4b 00 00 sw (r2+0),r11 the_node->previous = old_last; 8000fd0: 59 62 00 04 sw (r11+4),r2 { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 8000fd4: 59 8b 00 58 sw (r12+88),r11 IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); 8000fd8: 34 02 00 00 mvi r2,0 8000fdc: 37 81 00 14 addi r1,sp,20 8000fe0: f8 00 01 c0 calli 80016e0 8000fe4: 2b 82 00 14 lw r2,(sp+20) const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { int rv = 0; 8000fe8: 34 01 00 00 mvi r1,0 memcpy( node->name, name, namelen ); node->name [namelen] = '\0'; IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); 8000fec: 59 62 00 48 sw (r11+72),r2 errno = EINVAL; rv = -1; } return rv; } 8000ff0: 2b 9d 00 04 lw ra,(sp+4) 8000ff4: 2b 8b 00 10 lw r11,(sp+16) 8000ff8: 2b 8c 00 0c lw r12,(sp+12) 8000ffc: 2b 8d 00 08 lw r13,(sp+8) 8001000: 37 9c 00 18 addi sp,sp,24 8001004: c3 a0 00 00 ret IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); } else { errno = ENAMETOOLONG; 8001008: f8 00 2b e7 calli 800bfa4 <__errno> <== NOT EXECUTED 800100c: 34 02 00 5b mvi r2,91 <== NOT EXECUTED 8001010: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8001014: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8001018: e3 ff ff f6 bi 8000ff0 <== NOT EXECUTED } } else { errno = EINVAL; 800101c: f8 00 2b e2 calli 800bfa4 <__errno> <== NOT EXECUTED 8001020: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8001024: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8001028: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800102c: e3 ff ff f1 bi 8000ff0 <== NOT EXECUTED =============================================================================== 0800112c : #endif #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 800112c: 37 9c ff fc addi sp,sp,-4 8001130: 5b 9d 00 04 sw (sp+4),ra int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 8001134: 28 22 00 20 lw r2,(r1+32) 8001138: 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; 800113c: 28 43 00 4c lw r3,(r2+76) if ( IMFS_is_directory( node ) ) { 8001140: 28 63 00 00 lw r3,(r3+0) 8001144: 5c 60 00 0d bne r3,r0,8001178 <== NEVER TAKEN if ( node->info.directory.mt_fs == mt_entry ) { 8001148: 28 43 00 5c lw r3,(r2+92) 800114c: 5c 61 00 06 bne r3,r1,8001164 <== NEVER TAKEN node->info.directory.mt_fs = NULL; 8001150: 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; 8001154: 34 01 00 00 mvi r1,0 errno = ENOTDIR; rv = -1; } return rv; } 8001158: 2b 9d 00 04 lw ra,(sp+4) 800115c: 37 9c 00 04 addi sp,sp,4 8001160: c3 a0 00 00 ret if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == mt_entry ) { node->info.directory.mt_fs = NULL; } else { errno = EINVAL; 8001164: f8 00 2b 90 calli 800bfa4 <__errno> <== NOT EXECUTED 8001168: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 800116c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8001170: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8001174: e3 ff ff f9 bi 8001158 <== NOT EXECUTED } } else { errno = ENOTDIR; 8001178: f8 00 2b 8b calli 800bfa4 <__errno> <== NOT EXECUTED 800117c: 34 02 00 14 mvi r2,20 <== NOT EXECUTED 8001180: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8001184: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8001188: e3 ff ff f4 bi 8001158 <== NOT EXECUTED =============================================================================== 08001938 : void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8001938: 37 9c ff e0 addi sp,sp,-32 800193c: 5b 8b 00 20 sw (sp+32),r11 8001940: 5b 8c 00 1c sw (sp+28),r12 8001944: 5b 8d 00 18 sw (sp+24),r13 8001948: 5b 8e 00 14 sw (sp+20),r14 800194c: 5b 8f 00 10 sw (sp+16),r15 8001950: 5b 90 00 0c sw (sp+12),r16 8001954: 5b 91 00 08 sw (sp+8),r17 8001958: 5b 9d 00 04 sw (sp+4),ra Heap_Control *heap = RTEMS_Malloc_Heap; if ( !rtems_configuration_get_unified_work_area() ) { 800195c: 78 04 08 01 mvhi r4,0x801 8001960: 38 84 b9 9c ori r4,r4,0xb99c 8001964: 40 85 00 31 lbu r5,(r4+49) const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Control *heap = RTEMS_Malloc_Heap; 8001968: 78 04 08 01 mvhi r4,0x801 800196c: 38 84 e0 54 ori r4,r4,0xe054 void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8001970: b8 40 78 00 mv r15,r2 8001974: b8 60 80 00 mv r16,r3 Heap_Control *heap = RTEMS_Malloc_Heap; 8001978: 28 8e 00 00 lw r14,(r4+0) if ( !rtems_configuration_get_unified_work_area() ) { 800197c: 5c a0 00 12 bne r5,r0,80019c4 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) { 8001980: 44 45 00 28 be r2,r5,8001a20 8001984: 78 11 08 00 mvhi r17,0x800 8001988: 3a 31 51 80 ori r17,r17,0x5180 800198c: b8 20 58 00 mv r11,r1 8001990: 34 0c 00 00 mvi r12,0 8001994: ba 20 68 00 mv r13,r17 const Heap_Area *area = &areas [i]; uintptr_t space_available = (*init_or_extend)( 8001998: 29 62 00 00 lw r2,(r11+0) 800199c: 29 63 00 04 lw r3,(r11+4) 80019a0: b9 c0 08 00 mv r1,r14 80019a4: 34 04 00 04 mvi r4,4 80019a8: d9 a0 00 00 call r13 area->begin, area->size, page_size ); if ( space_available > 0 ) { 80019ac: 44 20 00 02 be r1,r0,80019b4 <== NEVER TAKEN init_or_extend = extend; 80019b0: ba 00 68 00 mv r13,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) { 80019b4: 35 8c 00 01 addi r12,r12,1 80019b8: 35 6b 00 08 addi r11,r11,8 80019bc: 55 ec ff f7 bgu r15,r12,8001998 <== NEVER TAKEN if ( space_available > 0 ) { init_or_extend = extend; } } if ( init_or_extend == _Heap_Initialize ) { 80019c0: 45 b1 00 18 be r13,r17,8001a20 <== NEVER TAKEN } /* * If configured, initialize the statistics support */ if ( rtems_malloc_statistics_helpers != NULL ) { 80019c4: 78 01 08 01 mvhi r1,0x801 80019c8: 38 21 e7 0c ori r1,r1,0xe70c 80019cc: 28 21 00 00 lw r1,(r1+0) 80019d0: 44 20 00 03 be r1,r0,80019dc (*rtems_malloc_statistics_helpers->initialize)(); 80019d4: 28 21 00 00 lw r1,(r1+0) 80019d8: d8 20 00 00 call r1 } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); 80019dc: 78 0b 08 01 mvhi r11,0x801 80019e0: 39 6b e7 b0 ori r11,r11,0xe7b0 80019e4: 29 6c 00 00 lw r12,(r11+0) 80019e8: b9 c0 08 00 mv r1,r14 80019ec: f8 00 11 5b calli 8005f58 <_Protected_heap_Get_size> 80019f0: b4 2c 08 00 add r1,r1,r12 80019f4: 59 61 00 00 sw (r11+0),r1 } 80019f8: 2b 9d 00 04 lw ra,(sp+4) 80019fc: 2b 8b 00 20 lw r11,(sp+32) 8001a00: 2b 8c 00 1c lw r12,(sp+28) 8001a04: 2b 8d 00 18 lw r13,(sp+24) 8001a08: 2b 8e 00 14 lw r14,(sp+20) 8001a0c: 2b 8f 00 10 lw r15,(sp+16) 8001a10: 2b 90 00 0c lw r16,(sp+12) 8001a14: 2b 91 00 08 lw r17,(sp+8) 8001a18: 37 9c 00 20 addi sp,sp,32 8001a1c: c3 a0 00 00 ret init_or_extend = extend; } } if ( init_or_extend == _Heap_Initialize ) { _Internal_error_Occurred( 8001a20: 34 01 00 00 mvi r1,0 8001a24: 34 02 00 01 mvi r2,1 8001a28: 34 03 00 17 mvi r3,23 8001a2c: f8 00 0e 86 calli 8005444 <_Internal_error_Occurred> =============================================================================== 08022b6c : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 8022b6c: 37 9c ff d0 addi sp,sp,-48 8022b70: 5b 8b 00 28 sw (sp+40),r11 8022b74: 5b 8c 00 24 sw (sp+36),r12 8022b78: 5b 8d 00 20 sw (sp+32),r13 8022b7c: 5b 8e 00 1c sw (sp+28),r14 8022b80: 5b 8f 00 18 sw (sp+24),r15 8022b84: 5b 90 00 14 sw (sp+20),r16 8022b88: 5b 91 00 10 sw (sp+16),r17 8022b8c: 5b 92 00 0c sw (sp+12),r18 8022b90: 5b 93 00 08 sw (sp+8),r19 8022b94: 5b 9d 00 04 sw (sp+4),ra /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { 8022b98: 34 02 ff ff mvi r2,-1 8022b9c: 44 22 00 62 be r1,r2,8022d24 current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); 8022ba0: 28 31 01 00 lw r17,(r1+256) 8022ba4: 28 27 00 b4 lw r7,(r1+180) the_thread = 0; current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; 8022ba8: 34 2d 00 b0 addi r13,r1,176 current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); 8022bac: 29 ae 00 00 lw r14,(r13+0) /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 8022bb0: 34 e2 00 20 addi r2,r7,32 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 8022bb4: 34 e6 00 10 addi r6,r7,16 size = Stack_check_usable_stack_size(stack); 8022bb8: 35 ce ff f0 addi r14,r14,-16 { const uint32_t *base, *ebase; uint32_t length; base = s; length = n/4; 8022bbc: 01 c4 00 01 srui r4,r14,1 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; 8022bc0: 34 0f 00 00 mvi r15,0 { const uint32_t *base, *ebase; uint32_t length; base = s; length = n/4; 8022bc4: 00 84 00 01 srui r4,r4,1 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 8022bc8: b4 84 20 00 add r4,r4,r4 8022bcc: b4 84 20 00 add r4,r4,r4 8022bd0: b4 44 20 00 add r4,r2,r4 8022bd4: 50 44 00 09 bgeu r2,r4,8022bf8 <== NEVER TAKEN if (*base != U32_PATTERN) 8022bd8: 28 e3 00 20 lw r3,(r7+32) 8022bdc: 78 07 08 06 mvhi r7,0x806 8022be0: 38 e7 2a 74 ori r7,r7,0x2a74 8022be4: 28 e5 00 00 lw r5,(r7+0) 8022be8: 5c 65 00 39 bne r3,r5,8022ccc <== NEVER TAKEN * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 8022bec: 34 42 00 04 addi r2,r2,4 8022bf0: 54 82 00 35 bgu r4,r2,8022cc4 <== 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; 8022bf4: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 8022bf8: 44 20 00 3a be r1,r0,8022ce0 <== NOT EXECUTED #endif { (*print_handler)( 8022bfc: 28 30 00 08 lw r16,(r1+8) 8022c00: 78 0c 08 06 mvhi r12,0x806 8022c04: 39 8c d9 d0 ori r12,r12,0xd9d0 8022c08: 78 0b 08 06 mvhi r11,0x806 8022c0c: 29 93 00 00 lw r19,(r12+0) 8022c10: 37 83 00 2c addi r3,sp,44 8022c14: 34 02 00 05 mvi r2,5 8022c18: 39 6b d9 d4 ori r11,r11,0xd9d4 8022c1c: ba 00 08 00 mv r1,r16 8022c20: 29 72 00 00 lw r18,(r11+0) 8022c24: fb ff a5 e6 calli 800c3bc 8022c28: 78 02 08 06 mvhi r2,0x806 8022c2c: b8 20 20 00 mv r4,r1 8022c30: 38 42 28 e8 ori r2,r2,0x28e8 8022c34: ba 60 08 00 mv r1,r19 8022c38: ba 00 18 00 mv r3,r16 8022c3c: da 40 00 00 call r18 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 8022c40: 29 a4 00 00 lw r4,(r13+0) 8022c44: 29 a3 00 04 lw r3,(r13+4) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 8022c48: 29 67 00 00 lw r7,(r11+0) 8022c4c: 29 81 00 00 lw r1,(r12+0) print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 8022c50: 34 84 ff ff addi r4,r4,-1 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 8022c54: 78 02 08 06 mvhi r2,0x806 8022c58: 38 42 29 08 ori r2,r2,0x2908 8022c5c: b4 64 20 00 add r4,r3,r4 8022c60: ba 20 28 00 mv r5,r17 8022c64: b9 c0 30 00 mv r6,r14 8022c68: d8 e0 00 00 call r7 stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 8022c6c: 78 01 08 06 mvhi r1,0x806 8022c70: 38 21 d9 d8 ori r1,r1,0xd9d8 8022c74: 28 21 00 00 lw r1,(r1+0) 8022c78: 44 20 00 25 be r1,r0,8022d0c <== NEVER TAKEN (*print_handler)( print_context, "Unavailable\n" ); } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 8022c7c: 29 64 00 00 lw r4,(r11+0) 8022c80: 29 81 00 00 lw r1,(r12+0) 8022c84: 78 02 08 06 mvhi r2,0x806 8022c88: 38 42 29 38 ori r2,r2,0x2938 8022c8c: b9 e0 18 00 mv r3,r15 8022c90: d8 80 00 00 call r4 } } 8022c94: 2b 9d 00 04 lw ra,(sp+4) 8022c98: 2b 8b 00 28 lw r11,(sp+40) 8022c9c: 2b 8c 00 24 lw r12,(sp+36) 8022ca0: 2b 8d 00 20 lw r13,(sp+32) 8022ca4: 2b 8e 00 1c lw r14,(sp+28) 8022ca8: 2b 8f 00 18 lw r15,(sp+24) 8022cac: 2b 90 00 14 lw r16,(sp+20) 8022cb0: 2b 91 00 10 lw r17,(sp+16) 8022cb4: 2b 92 00 0c lw r18,(sp+12) 8022cb8: 2b 93 00 08 lw r19,(sp+8) 8022cbc: 37 9c 00 30 addi sp,sp,48 8022cc0: c3 a0 00 00 ret * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) if (*base != U32_PATTERN) 8022cc4: 28 47 00 00 lw r7,(r2+0) 8022cc8: 44 e3 ff c9 be r7,r3,8022bec 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; 8022ccc: 34 0f 00 00 mvi r15,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 ) 8022cd0: 44 40 ff ca be r2,r0,8022bf8 <== NEVER TAKEN used = Stack_check_Calculate_used( low, size, high_water_mark ); 8022cd4: b4 ce 78 00 add r15,r6,r14 8022cd8: c9 e2 78 00 sub r15,r15,r2 else used = 0; #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 8022cdc: 5c 20 ff c8 bne r1,r0,8022bfc 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 ); 8022ce0: 78 0b 08 06 mvhi r11,0x806 8022ce4: 78 0c 08 06 mvhi r12,0x806 8022ce8: 39 6b d9 d4 ori r11,r11,0xd9d4 8022cec: 39 8c d9 d0 ori r12,r12,0xd9d0 8022cf0: 29 64 00 00 lw r4,(r11+0) 8022cf4: 29 81 00 00 lw r1,(r12+0) 8022cf8: 78 02 08 06 mvhi r2,0x806 8022cfc: 38 42 28 f8 ori r2,r2,0x28f8 8022d00: 34 03 ff ff mvi r3,-1 8022d04: d8 80 00 00 call r4 8022d08: e3 ff ff ce bi 8022c40 current, size ); if (Stack_check_Initialized == 0) { (*print_handler)( print_context, "Unavailable\n" ); 8022d0c: 29 63 00 00 lw r3,(r11+0) <== NOT EXECUTED 8022d10: 29 81 00 00 lw r1,(r12+0) <== NOT EXECUTED 8022d14: 78 02 08 06 mvhi r2,0x806 <== NOT EXECUTED 8022d18: 38 42 29 28 ori r2,r2,0x2928 <== NOT EXECUTED 8022d1c: d8 60 00 00 call r3 <== NOT EXECUTED 8022d20: e3 ff ff dd bi 8022c94 <== NOT EXECUTED /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { if (!Stack_check_Interrupt_stack.area) 8022d24: 78 0d 08 06 mvhi r13,0x806 8022d28: 39 ad e3 44 ori r13,r13,0xe344 8022d2c: 29 a7 00 04 lw r7,(r13+4) return; stack = &Stack_check_Interrupt_stack; the_thread = 0; current = 0; 8022d30: 34 11 00 00 mvi r17,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; 8022d34: 34 01 00 00 mvi r1,0 /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { if (!Stack_check_Interrupt_stack.area) 8022d38: 5c e0 ff 9d bne r7,r0,8022bac <== ALWAYS TAKEN 8022d3c: e3 ff ff d6 bi 8022c94 <== NOT EXECUTED =============================================================================== 08022e54 : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 8022e54: 37 9c ff d0 addi sp,sp,-48 8022e58: 5b 8b 00 10 sw (sp+16),r11 8022e5c: 5b 8c 00 0c sw (sp+12),r12 8022e60: 5b 8d 00 08 sw (sp+8),r13 8022e64: 5b 9d 00 04 sw (sp+4),ra 8022e68: b8 20 58 00 mv r11,r1 Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); char name[32]; printk("BLOWN STACK!!!\n"); 8022e6c: 78 01 08 06 mvhi r1,0x806 8022e70: 38 21 29 40 ori r1,r1,0x2940 Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 8022e74: 20 4c 00 ff andi r12,r2,0xff Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); 8022e78: 29 6d 00 b4 lw r13,(r11+180) char name[32]; printk("BLOWN STACK!!!\n"); 8022e7c: fb ff 7c ae calli 8002134 printk("task control block: 0x%08" PRIxPTR "\n", running); 8022e80: 78 01 08 06 mvhi r1,0x806 8022e84: 38 21 29 50 ori r1,r1,0x2950 8022e88: b9 60 10 00 mv r2,r11 8022e8c: fb ff 7c aa calli 8002134 printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); 8022e90: 29 62 00 08 lw r2,(r11+8) 8022e94: 78 01 08 06 mvhi r1,0x806 8022e98: 38 21 29 6c ori r1,r1,0x296c 8022e9c: fb ff 7c a6 calli 8002134 printk( 8022ea0: 29 62 00 0c lw r2,(r11+12) 8022ea4: 78 01 08 06 mvhi r1,0x806 8022ea8: 38 21 29 80 ori r1,r1,0x2980 8022eac: fb ff 7c a2 calli 8002134 "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( 8022eb0: 29 61 00 08 lw r1,(r11+8) 8022eb4: 37 83 00 14 addi r3,sp,20 8022eb8: 34 02 00 20 mvi r2,32 8022ebc: fb ff a5 40 calli 800c3bc 8022ec0: b8 20 10 00 mv r2,r1 8022ec4: 78 01 08 06 mvhi r1,0x806 8022ec8: 38 21 29 94 ori r1,r1,0x2994 8022ecc: fb ff 7c 9a calli 8002134 ); printk( "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) 8022ed0: 29 63 00 b4 lw r3,(r11+180) 8022ed4: 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( 8022ed8: 78 01 08 06 mvhi r1,0x806 8022edc: 38 21 29 ac ori r1,r1,0x29ac 8022ee0: b4 62 20 00 add r4,r3,r2 8022ee4: fb ff 7c 94 calli 8002134 "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) { 8022ee8: 45 80 00 04 be r12,r0,8022ef8 <== ALWAYS TAKEN rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal( 8022eec: 29 62 00 0c lw r2,(r11+12) 8022ef0: 34 01 00 09 mvi r1,9 8022ef4: fb ff 83 44 calli 8003c04 (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) ); if (!pattern_ok) { printk( 8022ef8: 78 01 08 06 mvhi r1,0x806 8022efc: 38 21 29 dc ori r1,r1,0x29dc 8022f00: 34 02 00 10 mvi r2,16 8022f04: 35 a3 00 08 addi r3,r13,8 8022f08: 35 a4 00 18 addi r4,r13,24 8022f0c: fb ff 7c 8a calli 8002134 8022f10: e3 ff ff f7 bi 8022eec =============================================================================== 080046e4 <_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); 80046e4: 28 22 00 00 lw r2,(r1+0) 80046e8: 44 40 00 02 be r2,r0,80046f0 <_API_extensions_Add_post_switch+0xc> 80046ec: c3 a0 00 00 ret 80046f0: 28 23 00 04 lw r3,(r1+4) 80046f4: 5c 62 ff fe bne r3,r2,80046ec <_API_extensions_Add_post_switch+0x8><== NEVER TAKEN Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 80046f8: 78 02 08 01 mvhi r2,0x801 80046fc: 38 42 e9 50 ori r2,r2,0xe950 8004700: 28 44 00 08 lw r4,(r2+8) the_node->next = tail; 8004704: 78 03 08 01 mvhi r3,0x801 8004708: 38 63 e9 54 ori r3,r3,0xe954 800470c: 58 23 00 00 sw (r1+0),r3 tail->previous = the_node; 8004710: 58 41 00 08 sw (r2+8),r1 old_last->next = the_node; 8004714: 58 81 00 00 sw (r4+0),r1 the_node->previous = old_last; 8004718: 58 24 00 04 sw (r1+4),r4 800471c: c3 a0 00 00 ret =============================================================================== 08004720 <_API_extensions_Run_postdriver>: } } #endif void _API_extensions_Run_postdriver( void ) { 8004720: 37 9c ff f4 addi sp,sp,-12 8004724: 5b 8b 00 0c sw (sp+12),r11 8004728: 5b 8c 00 08 sw (sp+8),r12 800472c: 5b 9d 00 04 sw (sp+4),ra #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); } } 8004730: 78 01 08 01 mvhi r1,0x801 8004734: 38 21 ea 10 ori r1,r1,0xea10 8004738: 28 2b 00 00 lw r11,(r1+0) void _API_extensions_Run_postdriver( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 800473c: 78 0c 08 01 mvhi r12,0x801 8004740: 39 8c ea 14 ori r12,r12,0xea14 8004744: 45 6c 00 05 be r11,r12,8004758 <_API_extensions_Run_postdriver+0x38><== NEVER TAKEN * Currently all APIs configure this hook so it is always non-NULL. */ #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); 8004748: 29 61 00 08 lw r1,(r11+8) 800474c: d8 20 00 00 call r1 Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { 8004750: 29 6b 00 00 lw r11,(r11+0) void _API_extensions_Run_postdriver( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 8004754: 5d 6c ff fd bne r11,r12,8004748 <_API_extensions_Run_postdriver+0x28><== NEVER TAKEN #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); } } 8004758: 2b 9d 00 04 lw ra,(sp+4) 800475c: 2b 8b 00 0c lw r11,(sp+12) 8004760: 2b 8c 00 08 lw r12,(sp+8) 8004764: 37 9c 00 0c addi sp,sp,12 8004768: c3 a0 00 00 ret =============================================================================== 0800f638 <_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 ) { 800f638: 37 9c ff e8 addi sp,sp,-24 800f63c: 5b 8b 00 18 sw (sp+24),r11 800f640: 5b 8c 00 14 sw (sp+20),r12 800f644: 5b 8d 00 10 sw (sp+16),r13 800f648: 5b 8e 00 0c sw (sp+12),r14 800f64c: 5b 8f 00 08 sw (sp+8),r15 800f650: 5b 9d 00 04 sw (sp+4),ra 800f654: 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; 800f658: 58 20 00 48 sw (r1+72),r0 the_message_queue->maximum_message_size = maximum_message_size; 800f65c: 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; 800f660: 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)) { 800f664: 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 ) { 800f668: b8 60 60 00 mv r12,r3 800f66c: b8 40 78 00 mv r15,r2 /* * 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)) { 800f670: b8 80 28 00 mv r5,r4 800f674: 44 20 00 06 be r1,r0,800f68c <_CORE_message_queue_Initialize+0x54> allocated_message_size += sizeof(uintptr_t); 800f678: 34 85 00 04 addi r5,r4,4 allocated_message_size &= ~(sizeof(uintptr_t) - 1); 800f67c: 34 01 ff fc mvi r1,-4 800f680: 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; 800f684: 34 0d 00 00 mvi r13,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) 800f688: 54 85 00 1f bgu r4,r5,800f704 <_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( 800f68c: 34 ae 00 10 addi r14,r5,16 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 800f690: 34 01 00 00 mvi r1,0 800f694: b9 c0 10 00 mv r2,r14 800f698: 34 03 00 00 mvi r3,0 800f69c: b9 80 20 00 mv r4,r12 800f6a0: f8 00 42 f8 calli 8020280 <__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; 800f6a4: 34 0d 00 00 mvi r13,0 size_t *c ) { long long x = (long long)a*b; if ( x > SIZE_MAX ) 800f6a8: 48 20 00 17 bg r1,r0,800f704 <_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 ); 800f6ac: b8 40 08 00 mv r1,r2 800f6b0: f8 00 0e 98 calli 8013110 <_Workspace_Allocate> return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 800f6b4: 59 61 00 5c sw (r11+92),r1 _Workspace_Allocate( message_buffering_required ); 800f6b8: b8 20 18 00 mv r3,r1 if (the_message_queue->message_buffers == 0) 800f6bc: 44 20 00 12 be r1,r0,800f704 <_CORE_message_queue_Initialize+0xcc><== NEVER TAKEN /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 800f6c0: b8 60 10 00 mv r2,r3 800f6c4: 35 61 00 60 addi r1,r11,96 800f6c8: b9 80 18 00 mv r3,r12 800f6cc: b9 c0 20 00 mv r4,r14 800f6d0: fb ff ff b9 calli 800f5b4 <_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 ); 800f6d4: 35 62 00 54 addi r2,r11,84 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 800f6d8: 35 61 00 50 addi r1,r11,80 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; tail->previous = head; 800f6dc: 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; 800f6e0: 59 62 00 50 sw (r11+80),r2 head->previous = NULL; 800f6e4: 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( 800f6e8: 29 e2 00 00 lw r2,(r15+0) 800f6ec: b9 60 08 00 mv r1,r11 800f6f0: 34 03 00 80 mvi r3,128 800f6f4: 64 42 00 01 cmpei r2,r2,1 800f6f8: 34 04 00 06 mvi r4,6 800f6fc: f8 00 0b da calli 8012664 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 800f700: 34 0d 00 01 mvi r13,1 } 800f704: b9 a0 08 00 mv r1,r13 800f708: 2b 9d 00 04 lw ra,(sp+4) 800f70c: 2b 8b 00 18 lw r11,(sp+24) 800f710: 2b 8c 00 14 lw r12,(sp+20) 800f714: 2b 8d 00 10 lw r13,(sp+16) 800f718: 2b 8e 00 0c lw r14,(sp+12) 800f71c: 2b 8f 00 08 lw r15,(sp+8) 800f720: 37 9c 00 18 addi sp,sp,24 800f724: c3 a0 00 00 ret =============================================================================== 08004d78 <_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 ) { 8004d78: 37 9c ff f8 addi sp,sp,-8 8004d7c: 5b 8b 00 08 sw (sp+8),r11 8004d80: 5b 9d 00 04 sw (sp+4),ra 8004d84: 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)) ) { 8004d88: f8 00 08 94 calli 8006fd8 <_Thread_queue_Dequeue> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 8004d8c: 34 02 00 00 mvi r2,0 if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 8004d90: 44 20 00 06 be r1,r0,8004da8 <_CORE_semaphore_Surrender+0x30> status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 8004d94: b8 40 08 00 mv r1,r2 8004d98: 2b 9d 00 04 lw ra,(sp+4) 8004d9c: 2b 8b 00 08 lw r11,(sp+8) 8004da0: 37 9c 00 08 addi sp,sp,8 8004da4: c3 a0 00 00 ret if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 8004da8: 90 00 08 00 rcsr r1,IE 8004dac: 34 02 ff fe mvi r2,-2 8004db0: a0 22 10 00 and r2,r1,r2 8004db4: d0 02 00 00 wcsr IE,r2 if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 8004db8: 29 63 00 48 lw r3,(r11+72) 8004dbc: 29 64 00 40 lw r4,(r11+64) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 8004dc0: 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 ) 8004dc4: 50 64 00 04 bgeu r3,r4,8004dd4 <_CORE_semaphore_Surrender+0x5c><== NEVER TAKEN the_semaphore->count += 1; 8004dc8: 34 63 00 01 addi r3,r3,1 8004dcc: 59 63 00 48 sw (r11+72),r3 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 8004dd0: 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 ); 8004dd4: d0 01 00 00 wcsr IE,r1 } return status; } 8004dd8: b8 40 08 00 mv r1,r2 8004ddc: 2b 9d 00 04 lw ra,(sp+4) 8004de0: 2b 8b 00 08 lw r11,(sp+8) 8004de4: 37 9c 00 08 addi sp,sp,8 8004de8: c3 a0 00 00 ret =============================================================================== 08004918 <_Chain_Initialize>: Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 8004918: 37 9c ff f0 addi sp,sp,-16 800491c: 5b 8b 00 10 sw (sp+16),r11 8004920: 5b 8c 00 0c sw (sp+12),r12 8004924: 5b 8d 00 08 sw (sp+8),r13 8004928: 5b 9d 00 04 sw (sp+4),ra Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; 800492c: 58 20 00 04 sw (r1+4),r0 Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 8004930: b8 20 58 00 mv r11,r1 8004934: b8 40 60 00 mv r12,r2 size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8004938: 34 2d 00 04 addi r13,r1,4 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 800493c: 44 60 00 10 be r3,r0,800497c <_Chain_Initialize+0x64> <== NEVER TAKEN 8004940: 34 63 ff ff addi r3,r3,-1 8004944: b8 60 10 00 mv r2,r3 { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; Chain_Node *next = starting_address; 8004948: b9 80 28 00 mv r5,r12 ) { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; 800494c: b9 60 30 00 mv r6,r11 8004950: e0 00 00 04 bi 8004960 <_Chain_Initialize+0x48> Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 8004954: b8 a0 30 00 mv r6,r5 8004958: 34 63 ff ff addi r3,r3,-1 current->next = next; next->previous = current; current = next; next = (Chain_Node *) 800495c: b8 e0 28 00 mv r5,r7 Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { current->next = next; 8004960: 58 c5 00 00 sw (r6+0),r5 next->previous = current; 8004964: 58 a6 00 04 sw (r5+4),r6 #include #include #include #include void _Chain_Initialize( 8004968: b4 a4 38 00 add r7,r5,r4 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 800496c: 5c 60 ff fa bne r3,r0,8004954 <_Chain_Initialize+0x3c> #include #include #include #include void _Chain_Initialize( 8004970: b8 80 08 00 mv r1,r4 8004974: f8 00 58 8c calli 801aba4 <__mulsi3> Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 8004978: b5 81 08 00 add r1,r12,r1 current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = tail; 800497c: 58 2d 00 00 sw (r1+0),r13 tail->previous = current; 8004980: 59 61 00 08 sw (r11+8),r1 } 8004984: 2b 9d 00 04 lw ra,(sp+4) 8004988: 2b 8b 00 10 lw r11,(sp+16) 800498c: 2b 8c 00 0c lw r12,(sp+12) 8004990: 2b 8d 00 08 lw r13,(sp+8) 8004994: 37 9c 00 10 addi sp,sp,16 8004998: c3 a0 00 00 ret =============================================================================== 080098b0 <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 80098b0: 37 9c ff f4 addi sp,sp,-12 80098b4: 5b 8b 00 0c sw (sp+12),r11 80098b8: 5b 8c 00 08 sw (sp+8),r12 80098bc: 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; 80098c0: 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 ) { 80098c4: 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 ); 80098c8: 90 00 08 00 rcsr r1,IE 80098cc: 34 09 ff fe mvi r9,-2 80098d0: a0 29 48 00 and r9,r1,r9 80098d4: 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; 80098d8: 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; 80098dc: 29 68 00 24 lw r8,(r11+36) 80098e0: b8 46 10 00 or r2,r2,r6 80098e4: 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 ); 80098e8: 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 ) ) { 80098ec: 44 c0 00 32 be r6,r0,80099b4 <_Event_Surrender+0x104> /* * 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() && 80098f0: 78 07 08 01 mvhi r7,0x801 80098f4: 38 e7 ea 60 ori r7,r7,0xea60 80098f8: 28 ec 00 08 lw r12,(r7+8) 80098fc: 45 80 00 03 be r12,r0,8009908 <_Event_Surrender+0x58> 8009900: 28 e7 00 10 lw r7,(r7+16) 8009904: 45 67 00 1d be r11,r7,8009978 <_Event_Surrender+0xc8> RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 8009908: 29 64 00 10 lw r4,(r11+16) 800990c: 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 ) ) { 8009910: 44 a0 00 29 be r5,r0,80099b4 <_Event_Surrender+0x104> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 8009914: 45 06 00 03 be r8,r6,8009920 <_Event_Surrender+0x70> */ RTEMS_INLINE_ROUTINE bool _Options_Is_any ( rtems_option option_set ) { return (option_set & RTEMS_EVENT_ANY) ? true : false; 8009918: 21 4a 00 02 andi r10,r10,0x2 800991c: 45 40 00 26 be r10,r0,80099b4 <_Event_Surrender+0x104> <== 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) ); 8009920: a4 c0 20 00 not r4,r6 event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 8009924: 29 65 00 28 lw r5,(r11+40) 8009928: a0 82 10 00 and r2,r4,r2 /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { event->pending_events = _Event_sets_Clear( 800992c: 58 62 00 00 sw (r3+0),r2 pending_events, seized_events ); the_thread->Wait.count = 0; 8009930: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 8009934: 58 a6 00 00 sw (r5+0),r6 _ISR_Flash( level ); 8009938: d0 01 00 00 wcsr IE,r1 800993c: d0 09 00 00 wcsr IE,r9 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 8009940: 29 63 00 50 lw r3,(r11+80) 8009944: 34 02 00 02 mvi r2,2 8009948: 44 62 00 21 be r3,r2,80099cc <_Event_Surrender+0x11c> _ISR_Enable( level ); 800994c: d0 01 00 00 wcsr IE,r1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 8009950: 78 01 08 01 mvhi r1,0x801 8009954: 38 21 c3 38 ori r1,r1,0xc338 8009958: 28 22 00 00 lw r2,(r1+0) 800995c: b9 60 08 00 mv r1,r11 8009960: f8 00 02 c9 calli 800a484 <_Thread_Clear_state> } return; } } _ISR_Enable( level ); } 8009964: 2b 9d 00 04 lw ra,(sp+4) 8009968: 2b 8b 00 0c lw r11,(sp+12) 800996c: 2b 8c 00 08 lw r12,(sp+8) 8009970: 37 9c 00 0c addi sp,sp,12 8009974: c3 a0 00 00 ret * 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 ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 8009978: 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 ) && 800997c: 34 07 00 01 mvi r7,1 ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 8009980: 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 ) && 8009984: 55 87 ff e1 bgu r12,r7,8009908 <_Event_Surrender+0x58> <== NEVER TAKEN ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 8009988: 45 06 00 03 be r8,r6,8009994 <_Event_Surrender+0xe4> <== ALWAYS TAKEN 800998c: 21 4a 00 02 andi r10,r10,0x2 <== NOT EXECUTED 8009990: 45 40 00 09 be r10,r0,80099b4 <_Event_Surrender+0x104> <== NOT EXECUTED 8009994: a4 c0 38 00 not r7,r6 event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 8009998: 29 65 00 28 lw r5,(r11+40) 800999c: a0 e2 10 00 and r2,r7,r2 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { event->pending_events = _Event_sets_Clear( 80099a0: 58 62 00 00 sw (r3+0),r2 pending_events, seized_events ); the_thread->Wait.count = 0; 80099a4: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 80099a8: 58 a6 00 00 sw (r5+0),r6 *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 80099ac: 34 02 00 03 mvi r2,3 80099b0: 58 82 00 00 sw (r4+0),r2 _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 80099b4: d0 01 00 00 wcsr IE,r1 } 80099b8: 2b 9d 00 04 lw ra,(sp+4) 80099bc: 2b 8b 00 0c lw r11,(sp+12) 80099c0: 2b 8c 00 08 lw r12,(sp+8) 80099c4: 37 9c 00 0c addi sp,sp,12 80099c8: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 80099cc: 34 02 00 03 mvi r2,3 80099d0: 59 62 00 50 sw (r11+80),r2 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 80099d4: d0 01 00 00 wcsr IE,r1 (void) _Watchdog_Remove( &the_thread->Timer ); 80099d8: 35 61 00 48 addi r1,r11,72 80099dc: fb ff f8 95 calli 8007c30 <_Watchdog_Remove> 80099e0: 78 03 08 01 mvhi r3,0x801 80099e4: 38 63 c3 38 ori r3,r3,0xc338 80099e8: 28 62 00 00 lw r2,(r3+0) 80099ec: b9 60 08 00 mv r1,r11 80099f0: f8 00 02 a5 calli 800a484 <_Thread_Clear_state> 80099f4: e3 ff ff f1 bi 80099b8 <_Event_Surrender+0x108> =============================================================================== 0800e420 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 800e420: 37 9c ff f4 addi sp,sp,-12 800e424: 5b 8b 00 08 sw (sp+8),r11 800e428: 5b 9d 00 04 sw (sp+4),ra 800e42c: 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 ); 800e430: 37 82 00 0c addi r2,sp,12 800e434: fb ff e6 4d calli 8007d68 <_Thread_Get> switch ( location ) { 800e438: 2b 82 00 0c lw r2,(sp+12) 800e43c: 44 40 00 05 be r2,r0,800e450 <_Event_Timeout+0x30> <== ALWAYS TAKEN case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800e440: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800e444: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 800e448: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 800e44c: c3 a0 00 00 ret <== NOT EXECUTED * * 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 ); 800e450: 90 00 20 00 rcsr r4,IE 800e454: 34 03 ff fe mvi r3,-2 800e458: a0 83 18 00 and r3,r4,r3 800e45c: d0 03 00 00 wcsr IE,r3 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800e460: 78 03 08 01 mvhi r3,0x801 800e464: 38 63 9a 80 ori r3,r3,0x9a80 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 800e468: 28 63 00 10 lw r3,(r3+16) _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 800e46c: 58 20 00 24 sw (r1+36),r0 if ( _Thread_Is_executing( the_thread ) ) { 800e470: 44 23 00 11 be r1,r3,800e4b4 <_Event_Timeout+0x94> <== NEVER TAKEN if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 800e474: 34 02 00 06 mvi r2,6 800e478: 58 22 00 34 sw (r1+52),r2 _ISR_Enable( level ); 800e47c: d0 04 00 00 wcsr IE,r4 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800e480: 78 03 08 01 mvhi r3,0x801 800e484: 38 63 83 bc ori r3,r3,0x83bc 800e488: 28 62 00 00 lw r2,(r3+0) 800e48c: f8 00 04 9d calli 800f700 <_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; 800e490: 78 01 08 01 mvhi r1,0x801 800e494: 38 21 99 00 ori r1,r1,0x9900 800e498: 28 22 00 00 lw r2,(r1+0) --level; 800e49c: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 800e4a0: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800e4a4: 2b 9d 00 04 lw ra,(sp+4) 800e4a8: 2b 8b 00 08 lw r11,(sp+8) 800e4ac: 37 9c 00 0c addi sp,sp,12 800e4b0: c3 a0 00 00 ret } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800e4b4: 29 63 00 00 lw r3,(r11+0) <== NOT EXECUTED 800e4b8: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 800e4bc: 5c 62 ff ee bne r3,r2,800e474 <_Event_Timeout+0x54> <== NOT EXECUTED *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800e4c0: 34 02 00 02 mvi r2,2 <== NOT EXECUTED 800e4c4: 59 62 00 00 sw (r11+0),r2 <== NOT EXECUTED 800e4c8: e3 ff ff eb bi 800e474 <_Event_Timeout+0x54> <== NOT EXECUTED =============================================================================== 08009fc0 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 8009fc0: 37 9c ff bc addi sp,sp,-68 8009fc4: 5b 8b 00 44 sw (sp+68),r11 8009fc8: 5b 8c 00 40 sw (sp+64),r12 8009fcc: 5b 8d 00 3c sw (sp+60),r13 8009fd0: 5b 8e 00 38 sw (sp+56),r14 8009fd4: 5b 8f 00 34 sw (sp+52),r15 8009fd8: 5b 90 00 30 sw (sp+48),r16 8009fdc: 5b 91 00 2c sw (sp+44),r17 8009fe0: 5b 92 00 28 sw (sp+40),r18 8009fe4: 5b 93 00 24 sw (sp+36),r19 8009fe8: 5b 94 00 20 sw (sp+32),r20 8009fec: 5b 95 00 1c sw (sp+28),r21 8009ff0: 5b 96 00 18 sw (sp+24),r22 8009ff4: 5b 97 00 14 sw (sp+20),r23 8009ff8: 5b 98 00 10 sw (sp+16),r24 8009ffc: 5b 99 00 0c sw (sp+12),r25 800a000: 5b 9b 00 08 sw (sp+8),fp 800a004: 5b 9d 00 04 sw (sp+4),ra Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE 800a008: 34 54 00 04 addi r20,r2,4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 800a00c: b8 20 78 00 mv r15,r1 Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_ALLOC_BONUS; uintptr_t const page_size = heap->page_size; 800a010: 28 37 00 10 lw r23,(r1+16) Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 800a014: b8 40 70 00 mv r14,r2 800a018: b8 60 80 00 mv r16,r3 800a01c: b8 80 90 00 mv r18,r4 uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { /* Integer overflow occured */ return NULL; 800a020: 34 01 00 00 mvi r1,0 Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { 800a024: 54 54 00 5b bgu r2,r20,800a190 <_Heap_Allocate_aligned_with_boundary+0x1d0> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 800a028: 5c 80 00 6f bne r4,r0,800a1e4 <_Heap_Allocate_aligned_with_boundary+0x224> if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 800a02c: 29 ec 00 08 lw r12,(r15+8) do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 800a030: 34 01 00 00 mvi r1,0 800a034: 45 ec 00 57 be r15,r12,800a190 <_Heap_Allocate_aligned_with_boundary+0x1d0> uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 800a038: 34 18 00 04 mvi r24,4 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 800a03c: 34 11 00 01 mvi r17,1 - 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; 800a040: 34 1b ff fe mvi fp,-2 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 800a044: 36 f9 00 07 addi r25,r23,7 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 800a048: cb 0e c0 00 sub r24,r24,r14 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 800a04c: 29 81 00 04 lw r1,(r12+4) 800a050: 52 81 00 3b bgeu r20,r1,800a13c <_Heap_Allocate_aligned_with_boundary+0x17c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 800a054: 35 8b 00 08 addi r11,r12,8 if ( alignment == 0 ) { 800a058: 46 00 00 3e be r16,r0,800a150 <_Heap_Allocate_aligned_with_boundary+0x190> - 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; 800a05c: a0 3b 68 00 and r13,r1,fp if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 800a060: 29 f5 00 14 lw r21,(r15+20) uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 800a064: b5 8d 68 00 add r13,r12,r13 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; uintptr_t alloc_begin = alloc_end - alloc_size; 800a068: b7 0d 58 00 add r11,r24,r13 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 800a06c: cb 35 18 00 sub r3,r25,r21 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800a070: b9 60 08 00 mv r1,r11 800a074: ba 00 10 00 mv r2,r16 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 800a078: b4 6d 68 00 add r13,r3,r13 800a07c: f8 00 43 3f calli 801ad78 <__umodsi3> 800a080: c9 61 58 00 sub r11,r11,r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 800a084: 35 96 00 08 addi r22,r12,8 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 800a088: 51 ab 00 05 bgeu r13,r11,800a09c <_Heap_Allocate_aligned_with_boundary+0xdc> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800a08c: b9 a0 08 00 mv r1,r13 800a090: ba 00 10 00 mv r2,r16 800a094: f8 00 43 39 calli 801ad78 <__umodsi3> 800a098: c9 a1 58 00 sub r11,r13,r1 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 800a09c: 46 40 00 1c be r18,r0,800a10c <_Heap_Allocate_aligned_with_boundary+0x14c> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 800a0a0: b5 6e 68 00 add r13,r11,r14 800a0a4: b9 a0 08 00 mv r1,r13 800a0a8: ba 40 10 00 mv r2,r18 800a0ac: f8 00 43 33 calli 801ad78 <__umodsi3> 800a0b0: c9 a1 28 00 sub r5,r13,r1 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 800a0b4: f5 a5 68 00 cmpgu r13,r13,r5 800a0b8: f4 ab 08 00 cmpgu r1,r5,r11 800a0bc: a1 a1 68 00 and r13,r13,r1 800a0c0: 45 a0 00 13 be r13,r0,800a10c <_Heap_Allocate_aligned_with_boundary+0x14c> alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 800a0c4: b6 ce 98 00 add r19,r22,r14 uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 800a0c8: 56 65 00 1d bgu r19,r5,800a13c <_Heap_Allocate_aligned_with_boundary+0x17c> 800a0cc: e0 00 00 02 bi 800a0d4 <_Heap_Allocate_aligned_with_boundary+0x114> 800a0d0: 56 65 00 1b bgu r19,r5,800a13c <_Heap_Allocate_aligned_with_boundary+0x17c><== NEVER TAKEN return 0; } alloc_begin = boundary_line - alloc_size; 800a0d4: c8 ae 58 00 sub r11,r5,r14 800a0d8: ba 00 10 00 mv r2,r16 800a0dc: b9 60 08 00 mv r1,r11 800a0e0: f8 00 43 26 calli 801ad78 <__umodsi3> 800a0e4: c9 61 58 00 sub r11,r11,r1 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 800a0e8: b5 6e 68 00 add r13,r11,r14 800a0ec: b9 a0 08 00 mv r1,r13 800a0f0: ba 40 10 00 mv r2,r18 800a0f4: f8 00 43 21 calli 801ad78 <__umodsi3> 800a0f8: c9 a1 28 00 sub r5,r13,r1 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 800a0fc: f5 a5 68 00 cmpgu r13,r13,r5 800a100: f4 ab 08 00 cmpgu r1,r5,r11 800a104: a1 a1 68 00 and r13,r13,r1 800a108: 5d a0 ff f2 bne r13,r0,800a0d0 <_Heap_Allocate_aligned_with_boundary+0x110> boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { 800a10c: 56 cb 00 0c bgu r22,r11,800a13c <_Heap_Allocate_aligned_with_boundary+0x17c> 800a110: 34 01 ff f8 mvi r1,-8 800a114: c8 2c 68 00 sub r13,r1,r12 800a118: ba e0 10 00 mv r2,r23 800a11c: b9 60 08 00 mv r1,r11 800a120: f8 00 43 16 calli 801ad78 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800a124: b5 ab 68 00 add r13,r13,r11 uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; 800a128: c9 a1 08 00 sub r1,r13,r1 if ( free_size >= min_block_size || free_size == 0 ) { 800a12c: 64 22 00 00 cmpei r2,r1,0 800a130: f0 35 a8 00 cmpgeu r21,r1,r21 800a134: b8 55 08 00 or r1,r2,r21 800a138: 5c 20 00 06 bne r1,r0,800a150 <_Heap_Allocate_aligned_with_boundary+0x190> if ( alloc_begin != 0 ) { break; } block = block->next; 800a13c: 29 8c 00 08 lw r12,(r12+8) 800a140: 36 21 00 01 addi r1,r17,1 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 800a144: 45 ec 00 26 be r15,r12,800a1dc <_Heap_Allocate_aligned_with_boundary+0x21c> 800a148: b8 20 88 00 mv r17,r1 800a14c: e3 ff ff c0 bi 800a04c <_Heap_Allocate_aligned_with_boundary+0x8c> } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { 800a150: 45 60 ff fb be r11,r0,800a13c <_Heap_Allocate_aligned_with_boundary+0x17c><== NEVER TAKEN search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 800a154: 29 e3 00 48 lw r3,(r15+72) stats->searches += search_count; 800a158: 29 e2 00 4c lw r2,(r15+76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 800a15c: b9 e0 08 00 mv r1,r15 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 800a160: 34 63 00 01 addi r3,r3,1 stats->searches += search_count; 800a164: b4 51 10 00 add r2,r2,r17 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 800a168: 59 e3 00 48 sw (r15+72),r3 stats->searches += search_count; 800a16c: 59 e2 00 4c sw (r15+76),r2 block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 800a170: b9 60 18 00 mv r3,r11 800a174: b9 80 10 00 mv r2,r12 800a178: b9 c0 20 00 mv r4,r14 800a17c: fb ff ec 56 calli 80052d4 <_Heap_Block_allocate> 800a180: b9 60 08 00 mv r1,r11 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 800a184: 29 e2 00 44 lw r2,(r15+68) 800a188: 50 51 00 02 bgeu r2,r17,800a190 <_Heap_Allocate_aligned_with_boundary+0x1d0> stats->max_search = search_count; 800a18c: 59 f1 00 44 sw (r15+68),r17 } return (void *) alloc_begin; } 800a190: 2b 9d 00 04 lw ra,(sp+4) 800a194: 2b 8b 00 44 lw r11,(sp+68) 800a198: 2b 8c 00 40 lw r12,(sp+64) 800a19c: 2b 8d 00 3c lw r13,(sp+60) 800a1a0: 2b 8e 00 38 lw r14,(sp+56) 800a1a4: 2b 8f 00 34 lw r15,(sp+52) 800a1a8: 2b 90 00 30 lw r16,(sp+48) 800a1ac: 2b 91 00 2c lw r17,(sp+44) 800a1b0: 2b 92 00 28 lw r18,(sp+40) 800a1b4: 2b 93 00 24 lw r19,(sp+36) 800a1b8: 2b 94 00 20 lw r20,(sp+32) 800a1bc: 2b 95 00 1c lw r21,(sp+28) 800a1c0: 2b 96 00 18 lw r22,(sp+24) 800a1c4: 2b 97 00 14 lw r23,(sp+20) 800a1c8: 2b 98 00 10 lw r24,(sp+16) 800a1cc: 2b 99 00 0c lw r25,(sp+12) 800a1d0: 2b 9b 00 08 lw fp,(sp+8) 800a1d4: 37 9c 00 44 addi sp,sp,68 800a1d8: c3 a0 00 00 ret do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 800a1dc: 34 01 00 00 mvi r1,0 800a1e0: e3 ff ff e9 bi 800a184 <_Heap_Allocate_aligned_with_boundary+0x1c4> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { 800a1e4: 54 44 ff eb bgu r2,r4,800a190 <_Heap_Allocate_aligned_with_boundary+0x1d0> return NULL; } if ( alignment == 0 ) { 800a1e8: 5c 60 ff 91 bne r3,r0,800a02c <_Heap_Allocate_aligned_with_boundary+0x6c> alignment = page_size; 800a1ec: ba e0 80 00 mv r16,r23 800a1f0: e3 ff ff 8f bi 800a02c <_Heap_Allocate_aligned_with_boundary+0x6c> =============================================================================== 08009c74 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { 8009c74: 37 9c ff bc addi sp,sp,-68 8009c78: 5b 8b 00 3c sw (sp+60),r11 8009c7c: 5b 8c 00 38 sw (sp+56),r12 8009c80: 5b 8d 00 34 sw (sp+52),r13 8009c84: 5b 8e 00 30 sw (sp+48),r14 8009c88: 5b 8f 00 2c sw (sp+44),r15 8009c8c: 5b 90 00 28 sw (sp+40),r16 8009c90: 5b 91 00 24 sw (sp+36),r17 8009c94: 5b 92 00 20 sw (sp+32),r18 8009c98: 5b 93 00 1c sw (sp+28),r19 8009c9c: 5b 94 00 18 sw (sp+24),r20 8009ca0: 5b 95 00 14 sw (sp+20),r21 8009ca4: 5b 96 00 10 sw (sp+16),r22 8009ca8: 5b 97 00 0c sw (sp+12),r23 8009cac: 5b 98 00 08 sw (sp+8),r24 8009cb0: 5b 9d 00 04 sw (sp+4),ra Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; 8009cb4: 5b 80 00 44 sw (sp+68),r0 Heap_Block *extend_last_block = NULL; 8009cb8: 5b 80 00 40 sw (sp+64),r0 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; 8009cbc: b4 43 70 00 add r14,r2,r3 Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { 8009cc0: b8 40 68 00 mv r13,r2 8009cc4: b8 20 58 00 mv r11,r1 Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 8009cc8: 28 30 00 20 lw r16,(r1+32) Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; 8009ccc: 28 32 00 10 lw r18,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8009cd0: 28 24 00 14 lw r4,(r1+20) uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; 8009cd4: 28 37 00 30 lw r23,(r1+48) uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { return 0; 8009cd8: 34 0c 00 00 mvi r12,0 uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 8009cdc: 54 4e 00 72 bgu r2,r14,8009ea4 <_Heap_Extend+0x230> return 0; } extend_area_ok = _Heap_Get_first_and_last_block( 8009ce0: b8 40 08 00 mv r1,r2 8009ce4: 37 85 00 44 addi r5,sp,68 8009ce8: b8 60 10 00 mv r2,r3 8009cec: 37 86 00 40 addi r6,sp,64 8009cf0: ba 40 18 00 mv r3,r18 8009cf4: fb ff ec 01 calli 8004cf8 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 8009cf8: 44 20 00 6b be r1,r0,8009ea4 <_Heap_Extend+0x230> 8009cfc: ba 00 60 00 mv r12,r16 8009d00: 34 16 00 00 mvi r22,0 8009d04: 34 18 00 00 mvi r24,0 8009d08: 34 11 00 00 mvi r17,0 8009d0c: 34 14 00 00 mvi r20,0 - 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; 8009d10: 34 15 ff fe mvi r21,-2 8009d14: e0 00 00 0d bi 8009d48 <_Heap_Extend+0xd4> return 0; } if ( extend_area_end == sub_area_begin ) { merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 8009d18: 55 ee 00 77 bgu r15,r14,8009ef4 <_Heap_Extend+0x280> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8009d1c: b9 e0 08 00 mv r1,r15 8009d20: ba 40 10 00 mv r2,r18 8009d24: 35 f3 ff f8 addi r19,r15,-8 8009d28: f8 00 1f f3 calli 8011cf4 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 8009d2c: ca 61 08 00 sub r1,r19,r1 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 8009d30: 45 af 00 15 be r13,r15,8009d84 <_Heap_Extend+0x110> start_block->prev_size = extend_area_end; merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 8009d34: 55 af 00 6e bgu r13,r15,8009eec <_Heap_Extend+0x278> } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8009d38: 28 2c 00 04 lw r12,(r1+4) 8009d3c: a2 ac 60 00 and r12,r21,r12 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8009d40: b4 2c 60 00 add r12,r1,r12 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 8009d44: 46 0c 00 16 be r16,r12,8009d9c <_Heap_Extend+0x128> return 0; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 8009d48: b9 80 08 00 mv r1,r12 8009d4c: 45 90 00 6c be r12,r16,8009efc <_Heap_Extend+0x288> uintptr_t const sub_area_end = start_block->prev_size; 8009d50: 29 8f 00 00 lw r15,(r12+0) Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin 8009d54: f5 c1 28 00 cmpgu r5,r14,r1 8009d58: f5 ed 20 00 cmpgu r4,r15,r13 (uintptr_t) start_block : heap->area_begin; uintptr_t const sub_area_end = start_block->prev_size; Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 8009d5c: a0 a4 20 00 and r4,r5,r4 8009d60: 5c 80 00 71 bne r4,r0,8009f24 <_Heap_Extend+0x2b0> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return 0; } if ( extend_area_end == sub_area_begin ) { 8009d64: 5c 2e ff ed bne r1,r14,8009d18 <_Heap_Extend+0xa4> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8009d68: b9 e0 08 00 mv r1,r15 8009d6c: ba 40 10 00 mv r2,r18 8009d70: 35 f3 ff f8 addi r19,r15,-8 8009d74: f8 00 1f e0 calli 8011cf4 <__umodsi3> 8009d78: b9 80 a0 00 mv r20,r12 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 8009d7c: ca 61 08 00 sub r1,r19,r1 merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 8009d80: 5d af ff ed bne r13,r15,8009d34 <_Heap_Extend+0xc0> <== ALWAYS TAKEN start_block->prev_size = extend_area_end; 8009d84: 59 8e 00 00 sw (r12+0),r14 } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8009d88: 28 2c 00 04 lw r12,(r1+4) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 8009d8c: b8 20 88 00 mv r17,r1 - 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; 8009d90: a2 ac 60 00 and r12,r21,r12 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8009d94: b4 2c 60 00 add r12,r1,r12 } else if ( sub_area_end < extend_area_begin ) { link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 8009d98: 5e 0c ff ec bne r16,r12,8009d48 <_Heap_Extend+0xd4> <== NEVER TAKEN if ( extend_area_begin < heap->area_begin ) { 8009d9c: 29 61 00 18 lw r1,(r11+24) 8009da0: 51 a1 00 5d bgeu r13,r1,8009f14 <_Heap_Extend+0x2a0> heap->area_begin = extend_area_begin; 8009da4: 59 6d 00 18 sw (r11+24),r13 } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 8009da8: 2b 81 00 40 lw r1,(sp+64) 8009dac: 2b 82 00 44 lw r2,(sp+68) extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 8009db0: 29 65 00 20 lw r5,(r11+32) heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 8009db4: c8 22 18 00 sub r3,r1,r2 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 8009db8: 38 64 00 01 ori r4,r3,0x1 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; 8009dbc: 58 4e 00 00 sw (r2+0),r14 extend_first_block->size_and_flag = 8009dc0: 58 44 00 04 sw (r2+4),r4 extend_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; 8009dc4: 58 23 00 00 sw (r1+0),r3 extend_last_block->size_and_flag = 0; 8009dc8: 58 20 00 04 sw (r1+4),r0 _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 8009dcc: 50 45 00 4e bgeu r2,r5,8009f04 <_Heap_Extend+0x290> heap->first_block = extend_first_block; 8009dd0: 59 62 00 20 sw (r11+32),r2 } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { 8009dd4: 46 80 00 66 be r20,r0,8009f6c <_Heap_Extend+0x2f8> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 8009dd8: 29 6c 00 10 lw r12,(r11+16) uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); 8009ddc: 35 ad 00 08 addi r13,r13,8 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 8009de0: b9 a0 08 00 mv r1,r13 8009de4: b9 80 10 00 mv r2,r12 8009de8: f8 00 1f c3 calli 8011cf4 <__umodsi3> if ( remainder != 0 ) { 8009dec: 44 20 00 03 be r1,r0,8009df8 <_Heap_Extend+0x184> return value - remainder + alignment; 8009df0: b5 ac 68 00 add r13,r13,r12 8009df4: c9 a1 68 00 sub r13,r13,r1 uintptr_t const new_first_block_begin = 8009df8: 35 a2 ff f8 addi r2,r13,-8 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 8009dfc: 2a 83 00 00 lw r3,(r20+0) uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = 8009e00: ca 82 08 00 sub r1,r20,r2 first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 8009e04: 38 21 00 01 ori r1,r1,0x1 8009e08: 58 41 00 04 sw (r2+4),r1 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 8009e0c: 59 a3 ff f8 sw (r13+-8),r3 new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Free_block( heap, new_first_block ); 8009e10: b9 60 08 00 mv r1,r11 8009e14: fb ff ff 7e calli 8009c0c <_Heap_Free_block> link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 8009e18: 46 20 00 45 be r17,r0,8009f2c <_Heap_Extend+0x2b8> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8009e1c: 29 62 00 10 lw r2,(r11+16) ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE, 8009e20: 35 ce ff f8 addi r14,r14,-8 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( 8009e24: c9 d1 70 00 sub r14,r14,r17 8009e28: b9 c0 08 00 mv r1,r14 8009e2c: f8 00 1f b2 calli 8011cf4 <__umodsi3> ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) 8009e30: 2a 22 00 04 lw r2,(r17+4) 8009e34: c9 c1 70 00 sub r14,r14,r1 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 8009e38: b5 d1 08 00 add r1,r14,r17 (last_block->size_and_flag - last_block_new_size) 8009e3c: c8 4e 10 00 sub r2,r2,r14 | HEAP_PREV_BLOCK_USED; 8009e40: 38 42 00 01 ori r2,r2,0x1 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 8009e44: 58 22 00 04 sw (r1+4),r2 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 8009e48: 2a 23 00 04 lw r3,(r17+4) (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 8009e4c: b9 60 08 00 mv r1,r11 8009e50: ba 20 10 00 mv r2,r17 8009e54: 20 63 00 01 andi r3,r3,0x1 block->size_and_flag = size | flag; 8009e58: b9 c3 70 00 or r14,r14,r3 8009e5c: 5a 2e 00 04 sw (r17+4),r14 8009e60: fb ff ff 6b calli 8009c0c <_Heap_Free_block> extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 8009e64: 66 31 00 00 cmpei r17,r17,0 8009e68: 66 94 00 00 cmpei r20,r20,0 8009e6c: a2 34 88 00 and r17,r17,r20 8009e70: 5e 20 00 3b bne r17,r0,8009f5c <_Heap_Extend+0x2e8> /* Statistics */ stats->size += extended_size; return extended_size; } 8009e74: 29 61 00 24 lw r1,(r11+36) * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 8009e78: 29 63 00 20 lw r3,(r11+32) _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 8009e7c: 29 6c 00 30 lw r12,(r11+48) RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 8009e80: 28 22 00 04 lw r2,(r1+4) /* Statistics */ stats->size += extended_size; 8009e84: 29 64 00 2c lw r4,(r11+44) * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 8009e88: c8 61 18 00 sub r3,r3,r1 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 8009e8c: 20 42 00 01 andi r2,r2,0x1 block->size_and_flag = size | flag; 8009e90: b8 62 10 00 or r2,r3,r2 _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 8009e94: c9 97 60 00 sub r12,r12,r23 8009e98: 58 22 00 04 sw (r1+4),r2 /* Statistics */ stats->size += extended_size; 8009e9c: b4 8c 08 00 add r1,r4,r12 8009ea0: 59 61 00 2c sw (r11+44),r1 return extended_size; } 8009ea4: b9 80 08 00 mv r1,r12 8009ea8: 2b 9d 00 04 lw ra,(sp+4) 8009eac: 2b 8b 00 3c lw r11,(sp+60) 8009eb0: 2b 8c 00 38 lw r12,(sp+56) 8009eb4: 2b 8d 00 34 lw r13,(sp+52) 8009eb8: 2b 8e 00 30 lw r14,(sp+48) 8009ebc: 2b 8f 00 2c lw r15,(sp+44) 8009ec0: 2b 90 00 28 lw r16,(sp+40) 8009ec4: 2b 91 00 24 lw r17,(sp+36) 8009ec8: 2b 92 00 20 lw r18,(sp+32) 8009ecc: 2b 93 00 1c lw r19,(sp+28) 8009ed0: 2b 94 00 18 lw r20,(sp+24) 8009ed4: 2b 95 00 14 lw r21,(sp+20) 8009ed8: 2b 96 00 10 lw r22,(sp+16) 8009edc: 2b 97 00 0c lw r23,(sp+12) 8009ee0: 2b 98 00 08 lw r24,(sp+8) 8009ee4: 37 9c 00 44 addi sp,sp,68 8009ee8: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 8009eec: b8 20 b0 00 mv r22,r1 8009ef0: e3 ff ff 92 bi 8009d38 <_Heap_Extend+0xc4> return 0; } if ( extend_area_end == sub_area_begin ) { merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 8009ef4: b9 80 c0 00 mv r24,r12 8009ef8: e3 ff ff 89 bi 8009d1c <_Heap_Extend+0xa8> return 0; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 8009efc: 29 61 00 18 lw r1,(r11+24) 8009f00: e3 ff ff 94 bi 8009d50 <_Heap_Extend+0xdc> extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { heap->first_block = extend_first_block; } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 8009f04: 29 62 00 24 lw r2,(r11+36) 8009f08: 50 41 ff b3 bgeu r2,r1,8009dd4 <_Heap_Extend+0x160> heap->last_block = extend_last_block; 8009f0c: 59 61 00 24 sw (r11+36),r1 8009f10: e3 ff ff b1 bi 8009dd4 <_Heap_Extend+0x160> start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); if ( extend_area_begin < heap->area_begin ) { heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { 8009f14: 29 61 00 1c lw r1,(r11+28) 8009f18: 50 2e ff a4 bgeu r1,r14,8009da8 <_Heap_Extend+0x134> heap->area_end = extend_area_end; 8009f1c: 59 6e 00 1c sw (r11+28),r14 8009f20: e3 ff ff a2 bi 8009da8 <_Heap_Extend+0x134> _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return 0; 8009f24: 34 0c 00 00 mvi r12,0 8009f28: e3 ff ff df bi 8009ea4 <_Heap_Extend+0x230> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 8009f2c: 46 d1 ff ce be r22,r17,8009e64 <_Heap_Extend+0x1f0> RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 8009f30: 2a c3 00 04 lw r3,(r22+4) ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 8009f34: 2b 82 00 44 lw r2,(sp+68) } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { _Heap_Link_above( 8009f38: 2b 81 00 40 lw r1,(sp+64) 8009f3c: 20 63 00 01 andi r3,r3,0x1 ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 8009f40: c8 56 10 00 sub r2,r2,r22 block->size_and_flag = size | flag; 8009f44: b8 43 10 00 or r2,r2,r3 8009f48: 5a c2 00 04 sw (r22+4),r2 last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 8009f4c: 28 22 00 04 lw r2,(r1+4) 8009f50: 38 42 00 01 ori r2,r2,0x1 8009f54: 58 22 00 04 sw (r1+4),r2 8009f58: e3 ff ff c3 bi 8009e64 <_Heap_Extend+0x1f0> extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { _Heap_Free_block( heap, extend_first_block ); 8009f5c: 2b 82 00 44 lw r2,(sp+68) 8009f60: b9 60 08 00 mv r1,r11 8009f64: fb ff ff 2a calli 8009c0c <_Heap_Free_block> 8009f68: e3 ff ff c3 bi 8009e74 <_Heap_Extend+0x200> heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { 8009f6c: 47 14 ff ab be r24,r20,8009e18 <_Heap_Extend+0x1a4> { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; 8009f70: cb 01 c0 00 sub r24,r24,r1 8009f74: 3b 18 00 01 ori r24,r24,0x1 ) { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = 8009f78: 58 38 00 04 sw (r1+4),r24 8009f7c: e3 ff ff a7 bi 8009e18 <_Heap_Extend+0x1a4> =============================================================================== 0800a1f4 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 800a1f4: 37 9c ff f4 addi sp,sp,-12 800a1f8: 5b 8b 00 0c sw (sp+12),r11 800a1fc: 5b 8c 00 08 sw (sp+8),r12 800a200: 5b 9d 00 04 sw (sp+4),ra 800a204: b8 20 58 00 mv r11,r1 800a208: b8 40 18 00 mv r3,r2 * 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; 800a20c: 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 ) { 800a210: 44 40 00 4b be r2,r0,800a33c <_Heap_Free+0x148> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800a214: 29 62 00 10 lw r2,(r11+16) 800a218: b8 60 08 00 mv r1,r3 800a21c: 34 6c ff f8 addi r12,r3,-8 800a220: f8 00 42 d6 calli 801ad78 <__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 800a224: 29 64 00 20 lw r4,(r11+32) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800a228: c9 81 10 00 sub r2,r12,r1 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 ) ) { return false; 800a22c: 34 01 00 00 mvi r1,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; 800a230: 54 82 00 43 bgu r4,r2,800a33c <_Heap_Free+0x148> 800a234: 29 65 00 24 lw r5,(r11+36) 800a238: 54 45 00 41 bgu r2,r5,800a33c <_Heap_Free+0x148> <== NEVER TAKEN --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800a23c: 28 48 00 04 lw r8,(r2+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; 800a240: 34 07 ff fe mvi r7,-2 800a244: a1 07 30 00 and r6,r8,r7 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800a248: b4 46 18 00 add r3,r2,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; 800a24c: 54 83 00 3c bgu r4,r3,800a33c <_Heap_Free+0x148> <== NEVER TAKEN 800a250: 54 65 00 3b bgu r3,r5,800a33c <_Heap_Free+0x148> <== NEVER TAKEN 800a254: 28 69 00 04 lw r9,(r3+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; 800a258: 21 2a 00 01 andi r10,r9,0x1 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 800a25c: 45 40 00 38 be r10,r0,800a33c <_Heap_Free+0x148> - 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; 800a260: a1 27 48 00 and r9,r9,r7 return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 800a264: 34 07 00 00 mvi r7,0 800a268: 44 a3 00 05 be r5,r3,800a27c <_Heap_Free+0x88> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800a26c: b4 69 08 00 add r1,r3,r9 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; 800a270: 28 27 00 04 lw r7,(r1+4) 800a274: 20 e7 00 01 andi r7,r7,0x1 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 800a278: 18 e7 00 01 xori r7,r7,0x1 800a27c: 21 08 00 01 andi r8,r8,0x1 next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 800a280: 5d 00 00 19 bne r8,r0,800a2e4 <_Heap_Free+0xf0> uintptr_t const prev_size = block->prev_size; 800a284: 28 4a 00 00 lw r10,(r2+0) Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { _HAssert( false ); return( false ); 800a288: 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); 800a28c: c8 4a 10 00 sub r2,r2,r10 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; 800a290: 54 82 00 2b bgu r4,r2,800a33c <_Heap_Free+0x148> <== NEVER TAKEN 800a294: b9 00 08 00 mv r1,r8 800a298: 54 45 00 29 bgu r2,r5,800a33c <_Heap_Free+0x148> <== 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; 800a29c: 28 44 00 04 lw r4,(r2+4) 800a2a0: 20 84 00 01 andi r4,r4,0x1 } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { 800a2a4: 44 80 00 26 be r4,r0,800a33c <_Heap_Free+0x148> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 800a2a8: 44 e0 00 3d be r7,r0,800a39c <_Heap_Free+0x1a8> uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 800a2ac: 29 64 00 38 lw r4,(r11+56) --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800a2b0: 28 61 00 08 lw r1,(r3+8) 800a2b4: 28 63 00 0c lw r3,(r3+12) _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 800a2b8: b4 c9 48 00 add r9,r6,r9 800a2bc: b5 2a 50 00 add r10,r9,r10 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 800a2c0: 58 61 00 08 sw (r3+8),r1 next->prev = prev; 800a2c4: 58 23 00 0c sw (r1+12),r3 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 800a2c8: 34 81 ff ff addi r1,r4,-1 800a2cc: 59 61 00 38 sw (r11+56),r1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800a2d0: 39 43 00 01 ori r3,r10,0x1 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 800a2d4: b4 4a 08 00 add r1,r2,r10 if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800a2d8: 58 43 00 04 sw (r2+4),r3 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 800a2dc: 58 2a 00 00 sw (r1+0),r10 800a2e0: e0 00 00 0d bi 800a314 <_Heap_Free+0x120> uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 800a2e4: 44 e0 00 1b be r7,r0,800a350 <_Heap_Free+0x15c> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800a2e8: 28 64 00 08 lw r4,(r3+8) 800a2ec: 28 61 00 0c lw r1,(r3+12) prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; 800a2f0: b5 26 48 00 add r9,r9,r6 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 800a2f4: 58 44 00 08 sw (r2+8),r4 new_block->prev = prev; 800a2f8: 58 41 00 0c sw (r2+12),r1 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800a2fc: 39 25 00 01 ori r5,r9,0x1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 800a300: b4 49 18 00 add r3,r2,r9 next->prev = new_block; 800a304: 58 82 00 0c sw (r4+12),r2 prev->next = new_block; 800a308: 58 22 00 08 sw (r1+8),r2 next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800a30c: 58 45 00 04 sw (r2+4),r5 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 800a310: 58 69 00 00 sw (r3+0),r9 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 800a314: 29 62 00 40 lw r2,(r11+64) ++stats->frees; 800a318: 29 61 00 50 lw r1,(r11+80) stats->free_size += block_size; 800a31c: 29 63 00 30 lw r3,(r11+48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 800a320: 34 42 ff ff addi r2,r2,-1 ++stats->frees; 800a324: 34 21 00 01 addi r1,r1,1 stats->free_size += block_size; 800a328: b4 66 30 00 add r6,r3,r6 } } /* Statistics */ --stats->used_blocks; ++stats->frees; 800a32c: 59 61 00 50 sw (r11+80),r1 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 800a330: 59 62 00 40 sw (r11+64),r2 ++stats->frees; stats->free_size += block_size; 800a334: 59 66 00 30 sw (r11+48),r6 return( true ); 800a338: 34 01 00 01 mvi r1,1 } 800a33c: 2b 9d 00 04 lw ra,(sp+4) 800a340: 2b 8b 00 0c lw r11,(sp+12) 800a344: 2b 8c 00 08 lw r12,(sp+8) 800a348: 37 9c 00 0c addi sp,sp,12 800a34c: c3 a0 00 00 ret 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; 800a350: 38 c1 00 01 ori r1,r6,0x1 800a354: 58 41 00 04 sw (r2+4),r1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800a358: 28 67 00 04 lw r7,(r3+4) next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 800a35c: 29 61 00 38 lw r1,(r11+56) RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 800a360: 29 64 00 08 lw r4,(r11+8) } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800a364: 34 05 ff fe mvi r5,-2 new_block->next = next; new_block->prev = block_before; 800a368: 58 4b 00 0c sw (r2+12),r11 800a36c: a0 e5 28 00 and r5,r7,r5 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { 800a370: 29 67 00 3c lw r7,(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; 800a374: 34 21 00 01 addi r1,r1,1 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 800a378: 58 44 00 08 sw (r2+8),r4 new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 800a37c: 58 82 00 0c sw (r4+12),r2 } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800a380: 58 65 00 04 sw (r3+4),r5 next_block->prev_size = block_size; 800a384: 58 66 00 00 sw (r3+0),r6 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 800a388: 59 62 00 08 sw (r11+8),r2 /* Statistics */ ++stats->free_blocks; 800a38c: 59 61 00 38 sw (r11+56),r1 if ( stats->max_free_blocks < stats->free_blocks ) { 800a390: 50 e1 ff e1 bgeu r7,r1,800a314 <_Heap_Free+0x120> stats->max_free_blocks = stats->free_blocks; 800a394: 59 61 00 3c sw (r11+60),r1 800a398: e3 ff ff df bi 800a314 <_Heap_Free+0x120> prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 800a39c: b4 ca 50 00 add r10,r6,r10 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800a3a0: 39 41 00 01 ori r1,r10,0x1 800a3a4: 58 41 00 04 sw (r2+4),r1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800a3a8: 28 62 00 04 lw r2,(r3+4) 800a3ac: 34 01 ff fe mvi r1,-2 next_block->prev_size = size; 800a3b0: 58 6a 00 00 sw (r3+0),r10 _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; 800a3b4: a0 41 08 00 and r1,r2,r1 800a3b8: 58 61 00 04 sw (r3+4),r1 800a3bc: e3 ff ff d6 bi 800a314 <_Heap_Free+0x120> =============================================================================== 08010660 <_Heap_Get_free_information>: info->number++; info->total += the_size; if ( info->largest < the_size ) info->largest = the_size; } } 8010660: 28 23 00 08 lw r3,(r1+8) ) { Heap_Block *the_block; Heap_Block *const tail = _Heap_Free_list_tail(the_heap); info->number = 0; 8010664: 58 40 00 00 sw (r2+0),r0 info->largest = 0; 8010668: 58 40 00 04 sw (r2+4),r0 info->total = 0; 801066c: 58 40 00 08 sw (r2+8),r0 for(the_block = _Heap_Free_list_first(the_heap); 8010670: 44 23 00 12 be r1,r3,80106b8 <_Heap_Get_free_information+0x58><== NEVER TAKEN 8010674: 34 06 00 01 mvi r6,1 8010678: 34 07 00 00 mvi r7,0 801067c: 34 05 00 00 mvi r5,0 - 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; 8010680: 34 09 ff fe mvi r9,-2 8010684: e0 00 00 03 bi 8010690 <_Heap_Get_free_information+0x30> 8010688: 28 47 00 04 lw r7,(r2+4) 801068c: b9 00 30 00 mv r6,r8 8010690: 28 64 00 04 lw r4,(r3+4) the_block != tail; the_block = the_block->next) 8010694: 34 c8 00 01 addi r8,r6,1 8010698: a1 24 20 00 and r4,r9,r4 /* As we always coalesce free blocks, prev block must have been used. */ _HAssert(_Heap_Is_prev_used(the_block)); info->number++; info->total += the_size; 801069c: b4 a4 28 00 add r5,r5,r4 if ( info->largest < the_size ) 80106a0: 50 e4 00 02 bgeu r7,r4,80106a8 <_Heap_Get_free_information+0x48> info->largest = the_size; 80106a4: 58 44 00 04 sw (r2+4),r4 info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); the_block != tail; the_block = the_block->next) 80106a8: 28 63 00 08 lw r3,(r3+8) info->number = 0; info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); 80106ac: 5c 23 ff f7 bne r1,r3,8010688 <_Heap_Get_free_information+0x28> 80106b0: 58 46 00 00 sw (r2+0),r6 80106b4: 58 45 00 08 sw (r2+8),r5 80106b8: c3 a0 00 00 ret =============================================================================== 080071d0 <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 80071d0: 37 9c ff e4 addi sp,sp,-28 80071d4: 5b 8b 00 1c sw (sp+28),r11 80071d8: 5b 8c 00 18 sw (sp+24),r12 80071dc: 5b 8d 00 14 sw (sp+20),r13 80071e0: 5b 8e 00 10 sw (sp+16),r14 80071e4: 5b 8f 00 0c sw (sp+12),r15 80071e8: 5b 90 00 08 sw (sp+8),r16 80071ec: 5b 9d 00 04 sw (sp+4),ra Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *allocated_blocks = NULL; 80071f0: 34 0d 00 00 mvi r13,0 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 80071f4: b8 60 80 00 mv r16,r3 80071f8: 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) { 80071fc: 44 60 00 12 be r3,r0,8007244 <_Heap_Greedy_allocate+0x74> 8007200: b8 40 70 00 mv r14,r2 8007204: 34 0b 00 00 mvi r11,0 * @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 ); 8007208: 29 c2 00 00 lw r2,(r14+0) 800720c: 34 03 00 00 mvi r3,0 8007210: 34 04 00 00 mvi r4,0 8007214: b9 80 08 00 mv r1,r12 8007218: f8 00 21 8f calli 800f854 <_Heap_Allocate_aligned_with_boundary> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800721c: 34 2f ff f8 addi r15,r1,-8 8007220: 35 6b 00 01 addi r11,r11,1 void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 8007224: 44 20 00 06 be r1,r0,800723c <_Heap_Greedy_allocate+0x6c> <== NEVER TAKEN 8007228: 29 82 00 10 lw r2,(r12+16) 800722c: f8 00 42 d6 calli 8017d84 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 8007230: c9 e1 08 00 sub r1,r15,r1 Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; 8007234: 58 2d 00 08 sw (r1+8),r13 8007238: b8 20 68 00 mv r13,r1 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 800723c: 35 ce 00 04 addi r14,r14,4 8007240: 56 0b ff f2 bgu r16,r11,8007208 <_Heap_Greedy_allocate+0x38> Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 8007244: 29 8b 00 08 lw r11,(r12+8) next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 8007248: 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; 800724c: 34 0f ff fe mvi r15,-2 8007250: 5d 8b 00 03 bne r12,r11,800725c <_Heap_Greedy_allocate+0x8c><== ALWAYS TAKEN 8007254: e0 00 00 0d bi 8007288 <_Heap_Greedy_allocate+0xb8> <== NOT EXECUTED Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 8007258: b8 20 58 00 mv r11,r1 800725c: 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( 8007260: b9 60 10 00 mv r2,r11 8007264: 35 63 00 08 addi r3,r11,8 8007268: a1 e4 20 00 and r4,r15,r4 800726c: b9 80 08 00 mv r1,r12 8007270: 34 84 ff f8 addi r4,r4,-8 8007274: f8 00 01 0b calli 80076a0 <_Heap_Block_allocate> current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 8007278: 59 6e 00 08 sw (r11+8),r14 Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 800727c: 29 81 00 08 lw r1,(r12+8) next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 8007280: b9 60 70 00 mv r14,r11 8007284: 5d 81 ff f5 bne r12,r1,8007258 <_Heap_Greedy_allocate+0x88> current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 8007288: 5d a0 00 03 bne r13,r0,8007294 <_Heap_Greedy_allocate+0xc4> 800728c: e0 00 00 07 bi 80072a8 <_Heap_Greedy_allocate+0xd8> current = allocated_blocks; allocated_blocks = allocated_blocks->next; 8007290: b9 60 68 00 mv r13,r11 8007294: 29 ab 00 08 lw r11,(r13+8) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 8007298: 35 a2 00 08 addi r2,r13,8 800729c: b9 80 08 00 mv r1,r12 80072a0: f8 00 21 fa calli 800fa88 <_Heap_Free> current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 80072a4: 5d 60 ff fb bne r11,r0,8007290 <_Heap_Greedy_allocate+0xc0> allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 80072a8: b9 c0 08 00 mv r1,r14 80072ac: 2b 9d 00 04 lw ra,(sp+4) 80072b0: 2b 8b 00 1c lw r11,(sp+28) 80072b4: 2b 8c 00 18 lw r12,(sp+24) 80072b8: 2b 8d 00 14 lw r13,(sp+20) 80072bc: 2b 8e 00 10 lw r14,(sp+16) 80072c0: 2b 8f 00 0c lw r15,(sp+12) 80072c4: 2b 90 00 08 lw r16,(sp+8) 80072c8: 37 9c 00 1c addi sp,sp,28 80072cc: c3 a0 00 00 ret =============================================================================== 080072d0 <_Heap_Greedy_free>: void _Heap_Greedy_free( Heap_Control *heap, Heap_Block *blocks ) { 80072d0: 37 9c ff f4 addi sp,sp,-12 80072d4: 5b 8b 00 0c sw (sp+12),r11 80072d8: 5b 8c 00 08 sw (sp+8),r12 80072dc: 5b 9d 00 04 sw (sp+4),ra 80072e0: b8 20 60 00 mv r12,r1 while ( blocks != NULL ) { 80072e4: 5c 40 00 03 bne r2,r0,80072f0 <_Heap_Greedy_free+0x20> <== ALWAYS TAKEN 80072e8: e0 00 00 07 bi 8007304 <_Heap_Greedy_free+0x34> <== NOT EXECUTED Heap_Block *current = blocks; blocks = blocks->next; 80072ec: b9 60 10 00 mv r2,r11 80072f0: 28 4b 00 08 lw r11,(r2+8) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 80072f4: b9 80 08 00 mv r1,r12 80072f8: 34 42 00 08 addi r2,r2,8 80072fc: f8 00 21 e3 calli 800fa88 <_Heap_Free> void _Heap_Greedy_free( Heap_Control *heap, Heap_Block *blocks ) { while ( blocks != NULL ) { 8007300: 5d 60 ff fb bne r11,r0,80072ec <_Heap_Greedy_free+0x1c> Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 8007304: 2b 9d 00 04 lw ra,(sp+4) 8007308: 2b 8b 00 0c lw r11,(sp+12) 800730c: 2b 8c 00 08 lw r12,(sp+8) 8007310: 37 9c 00 0c addi sp,sp,12 8007314: c3 a0 00 00 ret =============================================================================== 08010730 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 8010730: 37 9c ff e8 addi sp,sp,-24 8010734: 5b 8b 00 18 sw (sp+24),r11 8010738: 5b 8c 00 14 sw (sp+20),r12 801073c: 5b 8d 00 10 sw (sp+16),r13 8010740: 5b 8e 00 0c sw (sp+12),r14 8010744: 5b 8f 00 08 sw (sp+8),r15 8010748: 5b 9d 00 04 sw (sp+4),ra Heap_Block *current = heap->first_block; 801074c: 28 25 00 20 lw r5,(r1+32) Heap_Block *end = heap->last_block; 8010750: 28 2c 00 24 lw r12,(r1+36) void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 8010754: b8 40 68 00 mv r13,r2 8010758: b8 60 70 00 mv r14,r3 801075c: 34 0f ff fe mvi r15,-2 Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 8010760: 5c ac 00 04 bne r5,r12,8010770 <_Heap_Iterate+0x40> <== ALWAYS TAKEN 8010764: e0 00 00 0c bi 8010794 <_Heap_Iterate+0x64> <== NOT EXECUTED 8010768: 45 8b 00 0b be r12,r11,8010794 <_Heap_Iterate+0x64> 801076c: b9 60 28 00 mv r5,r11 8010770: 28 a2 00 04 lw r2,(r5+4) uintptr_t size = _Heap_Block_size( current ); Heap_Block *next = _Heap_Block_at( current, size ); bool used = _Heap_Is_prev_used( next ); stop = (*visitor)( current, size, used, visitor_arg ); 8010774: b8 a0 08 00 mv r1,r5 8010778: b9 c0 20 00 mv r4,r14 801077c: a1 e2 10 00 and r2,r15,r2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8010780: b4 a2 58 00 add r11,r5,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; 8010784: 29 63 00 04 lw r3,(r11+4) 8010788: 20 63 00 01 andi r3,r3,0x1 801078c: d9 a0 00 00 call r13 { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 8010790: 44 20 ff f6 be r1,r0,8010768 <_Heap_Iterate+0x38> <== ALWAYS TAKEN stop = (*visitor)( current, size, used, visitor_arg ); current = next; } } 8010794: 2b 9d 00 04 lw ra,(sp+4) 8010798: 2b 8b 00 18 lw r11,(sp+24) 801079c: 2b 8c 00 14 lw r12,(sp+20) 80107a0: 2b 8d 00 10 lw r13,(sp+16) 80107a4: 2b 8e 00 0c lw r14,(sp+12) 80107a8: 2b 8f 00 08 lw r15,(sp+8) 80107ac: 37 9c 00 18 addi sp,sp,24 80107b0: c3 a0 00 00 ret =============================================================================== 0801b6a8 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 801b6a8: 37 9c ff f0 addi sp,sp,-16 801b6ac: 5b 8b 00 10 sw (sp+16),r11 801b6b0: 5b 8c 00 0c sw (sp+12),r12 801b6b4: 5b 8d 00 08 sw (sp+8),r13 801b6b8: 5b 9d 00 04 sw (sp+4),ra 801b6bc: b8 40 60 00 mv r12,r2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 801b6c0: 28 22 00 10 lw r2,(r1+16) 801b6c4: b8 20 58 00 mv r11,r1 801b6c8: b9 80 08 00 mv r1,r12 801b6cc: b8 60 68 00 mv r13,r3 801b6d0: fb ff fd aa calli 801ad78 <__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 801b6d4: 29 62 00 20 lw r2,(r11+32) RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 801b6d8: 35 84 ff f8 addi r4,r12,-8 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 801b6dc: c8 81 20 00 sub r4,r4,r1 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 ) ) { return false; 801b6e0: 34 01 00 00 mvi r1,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; 801b6e4: 54 44 00 10 bgu r2,r4,801b724 <_Heap_Size_of_alloc_area+0x7c> 801b6e8: 29 65 00 24 lw r5,(r11+36) 801b6ec: 54 85 00 0e bgu r4,r5,801b724 <_Heap_Size_of_alloc_area+0x7c><== NEVER TAKEN - 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; 801b6f0: 28 86 00 04 lw r6,(r4+4) 801b6f4: 34 03 ff fe mvi r3,-2 801b6f8: a0 66 18 00 and r3,r3,r6 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 801b6fc: b4 83 20 00 add r4,r4,r3 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; 801b700: 54 44 00 09 bgu r2,r4,801b724 <_Heap_Size_of_alloc_area+0x7c><== NEVER TAKEN 801b704: 54 85 00 08 bgu r4,r5,801b724 <_Heap_Size_of_alloc_area+0x7c><== 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; 801b708: 28 82 00 04 lw r2,(r4+4) 801b70c: 20 42 00 01 andi r2,r2,0x1 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 801b710: 44 40 00 05 be r2,r0,801b724 <_Heap_Size_of_alloc_area+0x7c><== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 801b714: c8 8c 20 00 sub r4,r4,r12 801b718: 34 84 00 04 addi r4,r4,4 801b71c: 59 a4 00 00 sw (r13+0),r4 return true; 801b720: 34 01 00 01 mvi r1,1 } 801b724: 2b 9d 00 04 lw ra,(sp+4) 801b728: 2b 8b 00 10 lw r11,(sp+16) 801b72c: 2b 8c 00 0c lw r12,(sp+12) 801b730: 2b 8d 00 08 lw r13,(sp+8) 801b734: 37 9c 00 10 addi sp,sp,16 801b738: c3 a0 00 00 ret =============================================================================== 080058c0 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 80058c0: 37 9c ff 9c addi sp,sp,-100 80058c4: 5b 8b 00 50 sw (sp+80),r11 80058c8: 5b 8c 00 4c sw (sp+76),r12 80058cc: 5b 8d 00 48 sw (sp+72),r13 80058d0: 5b 8e 00 44 sw (sp+68),r14 80058d4: 5b 8f 00 40 sw (sp+64),r15 80058d8: 5b 90 00 3c sw (sp+60),r16 80058dc: 5b 91 00 38 sw (sp+56),r17 80058e0: 5b 92 00 34 sw (sp+52),r18 80058e4: 5b 93 00 30 sw (sp+48),r19 80058e8: 5b 94 00 2c sw (sp+44),r20 80058ec: 5b 95 00 28 sw (sp+40),r21 80058f0: 5b 96 00 24 sw (sp+36),r22 80058f4: 5b 97 00 20 sw (sp+32),r23 80058f8: 5b 98 00 1c sw (sp+28),r24 80058fc: 5b 99 00 18 sw (sp+24),r25 8005900: 5b 9b 00 14 sw (sp+20),fp 8005904: 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; 8005908: 78 0f 08 00 mvhi r15,0x800 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 800590c: 20 63 00 ff andi r3,r3,0xff 8005910: b8 20 68 00 mv r13,r1 8005914: b8 40 98 00 mv r19,r2 uintptr_t const page_size = heap->page_size; 8005918: 28 35 00 10 lw r21,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 800591c: 28 36 00 14 lw r22,(r1+20) Heap_Block *const first_block = heap->first_block; 8005920: 28 34 00 20 lw r20,(r1+32) Heap_Block *const last_block = heap->last_block; 8005924: 28 37 00 24 lw r23,(r1+36) Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8005928: 39 ef 58 18 ori r15,r15,0x5818 800592c: 44 60 00 03 be r3,r0,8005938 <_Heap_Walk+0x78> 8005930: 78 0f 08 00 mvhi r15,0x800 8005934: 39 ef 58 3c ori r15,r15,0x583c if ( !_System_state_Is_up( _System_state_Get() ) ) { 8005938: 78 03 08 01 mvhi r3,0x801 800593c: 38 63 6a 74 ori r3,r3,0x6a74 8005940: 28 69 00 00 lw r9,(r3+0) 8005944: 34 07 00 03 mvi r7,3 return true; 8005948: 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() ) ) { 800594c: 45 27 00 15 be r9,r7,80059a0 <_Heap_Walk+0xe0> block = next_block; } while ( block != first_block ); return true; } 8005950: b8 60 08 00 mv r1,r3 8005954: 2b 9d 00 10 lw ra,(sp+16) 8005958: 2b 8b 00 50 lw r11,(sp+80) 800595c: 2b 8c 00 4c lw r12,(sp+76) 8005960: 2b 8d 00 48 lw r13,(sp+72) 8005964: 2b 8e 00 44 lw r14,(sp+68) 8005968: 2b 8f 00 40 lw r15,(sp+64) 800596c: 2b 90 00 3c lw r16,(sp+60) 8005970: 2b 91 00 38 lw r17,(sp+56) 8005974: 2b 92 00 34 lw r18,(sp+52) 8005978: 2b 93 00 30 lw r19,(sp+48) 800597c: 2b 94 00 2c lw r20,(sp+44) 8005980: 2b 95 00 28 lw r21,(sp+40) 8005984: 2b 96 00 24 lw r22,(sp+36) 8005988: 2b 97 00 20 lw r23,(sp+32) 800598c: 2b 98 00 1c lw r24,(sp+28) 8005990: 2b 99 00 18 lw r25,(sp+24) 8005994: 2b 9b 00 14 lw fp,(sp+20) 8005998: 37 9c 00 64 addi sp,sp,100 800599c: c3 a0 00 00 ret 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)( 80059a0: 29 a2 00 08 lw r2,(r13+8) 80059a4: 29 a1 00 0c lw r1,(r13+12) 80059a8: 29 a6 00 18 lw r6,(r13+24) 80059ac: 29 a7 00 1c lw r7,(r13+28) 80059b0: 78 03 08 01 mvhi r3,0x801 80059b4: 5b 82 00 08 sw (sp+8),r2 80059b8: 5b 81 00 0c sw (sp+12),r1 80059bc: 5b 97 00 04 sw (sp+4),r23 80059c0: ba 60 08 00 mv r1,r19 80059c4: 34 02 00 00 mvi r2,0 80059c8: 38 63 3c a4 ori r3,r3,0x3ca4 80059cc: ba a0 20 00 mv r4,r21 80059d0: ba c0 28 00 mv r5,r22 80059d4: ba 80 40 00 mv r8,r20 80059d8: d9 e0 00 00 call r15 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 80059dc: 46 a0 00 26 be r21,r0,8005a74 <_Heap_Walk+0x1b4> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 80059e0: 22 ab 00 03 andi r11,r21,0x3 (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 80059e4: 5d 60 00 2b bne r11,r0,8005a90 <_Heap_Walk+0x1d0> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 80059e8: ba c0 08 00 mv r1,r22 80059ec: ba a0 10 00 mv r2,r21 80059f0: fb ff ec 0c calli 8000a20 <__umodsi3> 80059f4: b8 20 60 00 mv r12,r1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 80059f8: 5c 2b 00 2e bne r1,r11,8005ab0 <_Heap_Walk+0x1f0> 80059fc: 36 81 00 08 addi r1,r20,8 8005a00: ba a0 10 00 mv r2,r21 8005a04: fb ff ec 07 calli 8000a20 <__umodsi3> 8005a08: b8 20 18 00 mv r3,r1 ); return false; } if ( 8005a0c: 5c 2c 00 31 bne r1,r12,8005ad0 <_Heap_Walk+0x210> block = next_block; } while ( block != first_block ); return true; } 8005a10: 2a 8c 00 04 lw r12,(r20+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; 8005a14: 21 81 00 01 andi r1,r12,0x1 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 8005a18: 44 23 00 fe be r1,r3,8005e10 <_Heap_Walk+0x550> - 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; 8005a1c: 2a e2 00 04 lw r2,(r23+4) 8005a20: 34 01 ff fe mvi r1,-2 8005a24: a0 22 08 00 and r1,r1,r2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8005a28: b6 e1 08 00 add r1,r23,r1 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 8005a2c: 28 22 00 04 lw r2,(r1+4) 8005a30: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( _Heap_Is_free( last_block ) ) { 8005a34: 44 43 00 09 be r2,r3,8005a58 <_Heap_Walk+0x198> ); return false; } if ( 8005a38: 46 81 00 2e be r20,r1,8005af0 <_Heap_Walk+0x230> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 8005a3c: 78 03 08 01 mvhi r3,0x801 8005a40: 38 63 3e 0c ori r3,r3,0x3e0c 8005a44: ba 60 08 00 mv r1,r19 8005a48: 34 02 00 01 mvi r2,1 8005a4c: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005a50: 34 03 00 00 mvi r3,0 8005a54: e3 ff ff bf bi 8005950 <_Heap_Walk+0x90> return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 8005a58: 78 03 08 01 mvhi r3,0x801 8005a5c: 38 63 3d f4 ori r3,r3,0x3df4 8005a60: ba 60 08 00 mv r1,r19 8005a64: 34 02 00 01 mvi r2,1 8005a68: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005a6c: 34 03 00 00 mvi r3,0 8005a70: e3 ff ff b8 bi 8005950 <_Heap_Walk+0x90> first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" ); 8005a74: 78 03 08 01 mvhi r3,0x801 8005a78: 38 63 3d 38 ori r3,r3,0x3d38 8005a7c: ba 60 08 00 mv r1,r19 8005a80: 34 02 00 01 mvi r2,1 8005a84: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005a88: 34 03 00 00 mvi r3,0 8005a8c: e3 ff ff b1 bi 8005950 <_Heap_Walk+0x90> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 8005a90: 78 03 08 01 mvhi r3,0x801 8005a94: 38 63 3d 4c ori r3,r3,0x3d4c 8005a98: ba 60 08 00 mv r1,r19 8005a9c: 34 02 00 01 mvi r2,1 8005aa0: ba a0 20 00 mv r4,r21 8005aa4: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005aa8: 34 03 00 00 mvi r3,0 8005aac: e3 ff ff a9 bi 8005950 <_Heap_Walk+0x90> return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 8005ab0: 78 03 08 01 mvhi r3,0x801 8005ab4: 38 63 3d 6c ori r3,r3,0x3d6c 8005ab8: ba 60 08 00 mv r1,r19 8005abc: 34 02 00 01 mvi r2,1 8005ac0: ba c0 20 00 mv r4,r22 8005ac4: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005ac8: 34 03 00 00 mvi r3,0 8005acc: e3 ff ff a1 bi 8005950 <_Heap_Walk+0x90> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 8005ad0: 78 03 08 01 mvhi r3,0x801 8005ad4: 38 63 3d 90 ori r3,r3,0x3d90 8005ad8: ba 60 08 00 mv r1,r19 8005adc: 34 02 00 01 mvi r2,1 8005ae0: ba 80 20 00 mv r4,r20 8005ae4: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005ae8: 34 03 00 00 mvi r3,0 8005aec: e3 ff ff 99 bi 8005950 <_Heap_Walk+0x90> block = next_block; } while ( block != first_block ); return true; } 8005af0: 29 ab 00 08 lw r11,(r13+8) int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 8005af4: 29 b2 00 10 lw r18,(r13+16) 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 ) { 8005af8: 45 ab 00 2f be r13,r11,8005bb4 <_Heap_Walk+0x2f4> block = next_block; } while ( block != first_block ); return true; } 8005afc: 29 ae 00 20 lw r14,(r13+32) 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; 8005b00: 55 cb 00 dd bgu r14,r11,8005e74 <_Heap_Walk+0x5b4> <== NEVER TAKEN 8005b04: 29 b8 00 24 lw r24,(r13+36) 8005b08: 55 78 00 db bgu r11,r24,8005e74 <_Heap_Walk+0x5b4> <== NEVER TAKEN RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005b0c: 35 61 00 08 addi r1,r11,8 8005b10: ba 40 10 00 mv r2,r18 8005b14: fb ff eb c3 calli 8000a20 <__umodsi3> ); return false; } if ( 8005b18: 5c 20 00 df bne r1,r0,8005e94 <_Heap_Walk+0x5d4> <== NEVER TAKEN - 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; 8005b1c: 29 63 00 04 lw r3,(r11+4) 8005b20: 34 02 ff fe mvi r2,-2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005b24: b9 60 80 00 mv r16,r11 8005b28: a0 43 10 00 and r2,r2,r3 block = next_block; } while ( block != first_block ); return true; } 8005b2c: b5 62 10 00 add r2,r11,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; 8005b30: 28 42 00 04 lw r2,(r2+4) ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005b34: b9 a0 18 00 mv r3,r13 - 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; 8005b38: 34 11 ff fe mvi r17,-2 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; 8005b3c: 20 42 00 01 andi r2,r2,0x1 8005b40: 44 41 00 12 be r2,r1,8005b88 <_Heap_Walk+0x2c8> <== ALWAYS TAKEN 8005b44: e0 00 00 dc bi 8005eb4 <_Heap_Walk+0x5f4> <== NOT EXECUTED return false; } prev_block = free_block; free_block = free_block->next; 8005b48: 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 ) { 8005b4c: 45 ab 00 1b be r13,r11,8005bb8 <_Heap_Walk+0x2f8> 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; 8005b50: 55 cb 00 c9 bgu r14,r11,8005e74 <_Heap_Walk+0x5b4> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005b54: 35 61 00 08 addi r1,r11,8 8005b58: ba 40 10 00 mv r2,r18 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; 8005b5c: 55 78 00 c6 bgu r11,r24,8005e74 <_Heap_Walk+0x5b4> <== NEVER TAKEN RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005b60: fb ff eb b0 calli 8000a20 <__umodsi3> ); return false; } if ( 8005b64: 5c 20 00 cc bne r1,r0,8005e94 <_Heap_Walk+0x5d4> - 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; 8005b68: 29 64 00 04 lw r4,(r11+4) ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005b6c: ba 00 18 00 mv r3,r16 8005b70: b9 60 80 00 mv r16,r11 8005b74: a2 24 20 00 and r4,r17,r4 block = next_block; } while ( block != first_block ); return true; } 8005b78: b4 8b 20 00 add r4,r4,r11 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; 8005b7c: 28 84 00 04 lw r4,(r4+4) 8005b80: 20 84 00 01 andi r4,r4,0x1 ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005b84: 5c 81 00 cc bne r4,r1,8005eb4 <_Heap_Walk+0x5f4> ); return false; } if ( free_block->prev != prev_block ) { 8005b88: 29 67 00 0c lw r7,(r11+12) 8005b8c: 44 e3 ff ef be r7,r3,8005b48 <_Heap_Walk+0x288> (*printer)( 8005b90: 78 03 08 01 mvhi r3,0x801 8005b94: 38 63 3e a8 ori r3,r3,0x3ea8 8005b98: ba 60 08 00 mv r1,r19 8005b9c: 34 02 00 01 mvi r2,1 8005ba0: b9 60 20 00 mv r4,r11 8005ba4: b8 e0 28 00 mv r5,r7 8005ba8: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005bac: 34 03 00 00 mvi r3,0 8005bb0: e3 ff ff 68 bi 8005950 <_Heap_Walk+0x90> 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 ) { 8005bb4: 29 ae 00 20 lw r14,(r13+32) 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)( 8005bb8: 78 01 08 01 mvhi r1,0x801 8005bbc: 5b 81 00 54 sw (sp+84),r1 8005bc0: 78 01 08 01 mvhi r1,0x801 8005bc4: 5b 81 00 58 sw (sp+88),r1 8005bc8: 78 01 08 01 mvhi r1,0x801 8005bcc: 5b 81 00 5c sw (sp+92),r1 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005bd0: 78 01 08 01 mvhi r1,0x801 8005bd4: 5b 81 00 60 sw (sp+96),r1 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005bd8: 78 01 08 01 mvhi r1,0x801 8005bdc: 5b 81 00 64 sw (sp+100),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)( 8005be0: 2b 81 00 54 lw r1,(sp+84) "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8005be4: 78 1b 08 01 mvhi fp,0x801 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 8005be8: 78 19 08 01 mvhi r25,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)( 8005bec: 38 21 3c 6c ori r1,r1,0x3c6c 8005bf0: 5b 81 00 54 sw (sp+84),r1 8005bf4: 2b 81 00 58 lw r1,(sp+88) " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005bf8: 78 18 08 01 mvhi r24,0x801 ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005bfc: ba 80 88 00 mv r17,r20 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)( 8005c00: 38 21 3c 88 ori r1,r1,0x3c88 8005c04: 5b 81 00 58 sw (sp+88),r1 8005c08: 2b 81 00 5c lw r1,(sp+92) "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8005c0c: 3b 7b 40 58 ori fp,fp,0x4058 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 8005c10: 3b 39 40 40 ori r25,r25,0x4040 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)( 8005c14: 38 21 3f 9c ori r1,r1,0x3f9c 8005c18: 5b 81 00 5c sw (sp+92),r1 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005c1c: 2b 81 00 60 lw r1,(sp+96) 8005c20: 3b 18 40 0c ori r24,r24,0x400c 8005c24: 38 21 3c 98 ori r1,r1,0x3c98 8005c28: 5b 81 00 60 sw (sp+96),r1 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005c2c: 2b 81 00 64 lw r1,(sp+100) 8005c30: 38 21 3c 7c ori r1,r1,0x3c7c 8005c34: 5b 81 00 64 sw (sp+100),r1 - 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; 8005c38: 34 01 ff fe mvi r1,-2 8005c3c: a1 81 90 00 and r18,r12,r1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8005c40: b6 51 80 00 add r16,r18,r17 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; 8005c44: 55 d0 00 7a bgu r14,r16,8005e2c <_Heap_Walk+0x56c> <== NEVER TAKEN 8005c48: 29 a4 00 24 lw r4,(r13+36) 8005c4c: 56 04 00 78 bgu r16,r4,8005e2c <_Heap_Walk+0x56c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005c50: ba 40 08 00 mv r1,r18 8005c54: ba a0 10 00 mv r2,r21 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; 8005c58: fe 37 58 00 cmpne r11,r17,r23 8005c5c: fb ff eb 71 calli 8000a20 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 8005c60: 44 20 00 02 be r1,r0,8005c68 <_Heap_Walk+0x3a8> 8005c64: 5d 60 00 15 bne r11,r0,8005cb8 <_Heap_Walk+0x3f8> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 8005c68: 52 56 00 02 bgeu r18,r22,8005c70 <_Heap_Walk+0x3b0> 8005c6c: 5d 60 00 1c bne r11,r0,8005cdc <_Heap_Walk+0x41c> <== ALWAYS TAKEN ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 8005c70: 56 11 00 02 bgu r16,r17,8005c78 <_Heap_Walk+0x3b8> 8005c74: 5d 60 00 77 bne r11,r0,8005e50 <_Heap_Walk+0x590> 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; 8005c78: 2a 06 00 04 lw r6,(r16+4) 8005c7c: 21 8c 00 01 andi r12,r12,0x1 8005c80: 20 c6 00 01 andi r6,r6,0x1 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 8005c84: 44 c0 00 28 be r6,r0,8005d24 <_Heap_Walk+0x464> if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 8005c88: 45 80 00 1f be r12,r0,8005d04 <_Heap_Walk+0x444> (*printer)( 8005c8c: ba 60 08 00 mv r1,r19 8005c90: 34 02 00 00 mvi r2,0 8005c94: bb 20 18 00 mv r3,r25 8005c98: ba 20 20 00 mv r4,r17 8005c9c: ba 40 28 00 mv r5,r18 8005ca0: d9 e0 00 00 call r15 block->prev_size ); } block = next_block; } while ( block != first_block ); 8005ca4: 46 90 00 43 be r20,r16,8005db0 <_Heap_Walk+0x4f0> 8005ca8: 2a 0c 00 04 lw r12,(r16+4) 8005cac: 29 ae 00 20 lw r14,(r13+32) 8005cb0: ba 00 88 00 mv r17,r16 8005cb4: e3 ff ff e1 bi 8005c38 <_Heap_Walk+0x378> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { (*printer)( 8005cb8: 78 03 08 01 mvhi r3,0x801 8005cbc: 38 63 3f 0c ori r3,r3,0x3f0c 8005cc0: ba 60 08 00 mv r1,r19 8005cc4: 34 02 00 01 mvi r2,1 8005cc8: ba 20 20 00 mv r4,r17 8005ccc: ba 40 28 00 mv r5,r18 8005cd0: d9 e0 00 00 call r15 "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 8005cd4: 34 03 00 00 mvi r3,0 8005cd8: e3 ff ff 1e bi 8005950 <_Heap_Walk+0x90> } if ( block_size < min_block_size && is_not_last_block ) { (*printer)( 8005cdc: 78 03 08 01 mvhi r3,0x801 8005ce0: 38 63 3f 3c ori r3,r3,0x3f3c 8005ce4: ba 60 08 00 mv r1,r19 8005ce8: 34 02 00 01 mvi r2,1 8005cec: ba 20 20 00 mv r4,r17 8005cf0: ba 40 28 00 mv r5,r18 8005cf4: ba c0 30 00 mv r6,r22 8005cf8: d9 e0 00 00 call r15 block, block_size, min_block_size ); return false; 8005cfc: 34 03 00 00 mvi r3,0 8005d00: e3 ff ff 14 bi 8005950 <_Heap_Walk+0x90> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8005d04: 2a 26 00 00 lw r6,(r17+0) 8005d08: ba 20 20 00 mv r4,r17 8005d0c: ba 60 08 00 mv r1,r19 8005d10: 34 02 00 00 mvi r2,0 8005d14: bb 60 18 00 mv r3,fp 8005d18: ba 40 28 00 mv r5,r18 8005d1c: d9 e0 00 00 call r15 8005d20: e3 ff ff e1 bi 8005ca4 <_Heap_Walk+0x3e4> 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 ? 8005d24: 2a 26 00 0c lw r6,(r17+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)( 8005d28: 29 a4 00 08 lw r4,(r13+8) block = next_block; } while ( block != first_block ); return true; } 8005d2c: 29 a5 00 0c lw r5,(r13+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)( 8005d30: 2b 87 00 54 lw r7,(sp+84) 8005d34: 44 86 00 03 be r4,r6,8005d40 <_Heap_Walk+0x480> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005d38: bb 00 38 00 mv r7,r24 8005d3c: 45 a6 00 29 be r13,r6,8005de0 <_Heap_Walk+0x520> block->next, block->next == last_free_block ? 8005d40: 2a 28 00 08 lw r8,(r17+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)( 8005d44: 2b 84 00 58 lw r4,(sp+88) 8005d48: 44 a8 00 03 be r5,r8,8005d54 <_Heap_Walk+0x494> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005d4c: bb 00 20 00 mv r4,r24 8005d50: 45 a8 00 26 be r13,r8,8005de8 <_Heap_Walk+0x528> 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)( 8005d54: 2b 83 00 5c lw r3,(sp+92) 8005d58: 5b 84 00 04 sw (sp+4),r4 8005d5c: ba 60 08 00 mv r1,r19 8005d60: 34 02 00 00 mvi r2,0 8005d64: ba 20 20 00 mv r4,r17 8005d68: ba 40 28 00 mv r5,r18 8005d6c: d9 e0 00 00 call r15 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 8005d70: 2a 06 00 00 lw r6,(r16+0) 8005d74: 5e 46 00 11 bne r18,r6,8005db8 <_Heap_Walk+0x4f8> ); return false; } if ( !prev_used ) { 8005d78: 45 80 00 1e be r12,r0,8005df0 <_Heap_Walk+0x530> block = next_block; } while ( block != first_block ); return true; } 8005d7c: 29 a5 00 08 lw r5,(r13+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 ) { 8005d80: 45 a5 00 04 be r13,r5,8005d90 <_Heap_Walk+0x4d0> <== NEVER TAKEN if ( free_block == block ) { 8005d84: 46 25 ff c8 be r17,r5,8005ca4 <_Heap_Walk+0x3e4> return true; } free_block = free_block->next; 8005d88: 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 ) { 8005d8c: 5d a5 ff fe bne r13,r5,8005d84 <_Heap_Walk+0x4c4> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 8005d90: 78 03 08 01 mvhi r3,0x801 8005d94: 38 63 40 80 ori r3,r3,0x4080 8005d98: ba 60 08 00 mv r1,r19 8005d9c: 34 02 00 01 mvi r2,1 8005da0: ba 20 20 00 mv r4,r17 8005da4: d9 e0 00 00 call r15 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 8005da8: 34 03 00 00 mvi r3,0 8005dac: e3 ff fe e9 bi 8005950 <_Heap_Walk+0x90> } block = next_block; } while ( block != first_block ); return true; 8005db0: 34 03 00 01 mvi r3,1 8005db4: e3 ff fe e7 bi 8005950 <_Heap_Walk+0x90> " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { (*printer)( 8005db8: 78 03 08 01 mvhi r3,0x801 8005dbc: 38 63 3f d4 ori r3,r3,0x3fd4 8005dc0: ba 60 08 00 mv r1,r19 8005dc4: 34 02 00 01 mvi r2,1 8005dc8: ba 20 20 00 mv r4,r17 8005dcc: ba 40 28 00 mv r5,r18 8005dd0: ba 00 38 00 mv r7,r16 8005dd4: d9 e0 00 00 call r15 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 8005dd8: 34 03 00 00 mvi r3,0 8005ddc: e3 ff fe dd bi 8005950 <_Heap_Walk+0x90> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005de0: 2b 87 00 64 lw r7,(sp+100) 8005de4: e3 ff ff d7 bi 8005d40 <_Heap_Walk+0x480> block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005de8: 2b 84 00 60 lw r4,(sp+96) 8005dec: e3 ff ff da bi 8005d54 <_Heap_Walk+0x494> return false; } if ( !prev_used ) { (*printer)( 8005df0: 78 03 08 01 mvhi r3,0x801 8005df4: 38 63 40 10 ori r3,r3,0x4010 8005df8: ba 60 08 00 mv r1,r19 8005dfc: 34 02 00 01 mvi r2,1 8005e00: ba 20 20 00 mv r4,r17 8005e04: d9 e0 00 00 call r15 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 8005e08: 34 03 00 00 mvi r3,0 8005e0c: e3 ff fe d1 bi 8005950 <_Heap_Walk+0x90> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 8005e10: 78 03 08 01 mvhi r3,0x801 8005e14: 38 63 3d c4 ori r3,r3,0x3dc4 8005e18: ba 60 08 00 mv r1,r19 8005e1c: 34 02 00 01 mvi r2,1 8005e20: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005e24: 34 03 00 00 mvi r3,0 8005e28: e3 ff fe ca bi 8005950 <_Heap_Walk+0x90> 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 ) ) { (*printer)( 8005e2c: 78 03 08 01 mvhi r3,0x801 8005e30: 38 63 3e dc ori r3,r3,0x3edc 8005e34: ba 60 08 00 mv r1,r19 8005e38: 34 02 00 01 mvi r2,1 8005e3c: ba 20 20 00 mv r4,r17 8005e40: ba 00 28 00 mv r5,r16 8005e44: d9 e0 00 00 call r15 "block 0x%08x: next block 0x%08x not in heap\n", block, next_block ); return false; 8005e48: 34 03 00 00 mvi r3,0 8005e4c: e3 ff fe c1 bi 8005950 <_Heap_Walk+0x90> return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { (*printer)( 8005e50: 78 03 08 01 mvhi r3,0x801 8005e54: 38 63 3f 68 ori r3,r3,0x3f68 8005e58: ba 60 08 00 mv r1,r19 8005e5c: 34 02 00 01 mvi r2,1 8005e60: ba 20 20 00 mv r4,r17 8005e64: ba 00 28 00 mv r5,r16 8005e68: d9 e0 00 00 call r15 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 8005e6c: 34 03 00 00 mvi r3,0 8005e70: e3 ff fe b8 bi 8005950 <_Heap_Walk+0x90> 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 ) ) { (*printer)( 8005e74: 78 03 08 01 mvhi r3,0x801 8005e78: 38 63 3e 3c ori r3,r3,0x3e3c 8005e7c: ba 60 08 00 mv r1,r19 8005e80: 34 02 00 01 mvi r2,1 8005e84: b9 60 20 00 mv r4,r11 8005e88: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005e8c: 34 03 00 00 mvi r3,0 8005e90: e3 ff fe b0 bi 8005950 <_Heap_Walk+0x90> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 8005e94: 78 03 08 01 mvhi r3,0x801 8005e98: 38 63 3e 5c ori r3,r3,0x3e5c 8005e9c: ba 60 08 00 mv r1,r19 8005ea0: 34 02 00 01 mvi r2,1 8005ea4: b9 60 20 00 mv r4,r11 8005ea8: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005eac: 34 03 00 00 mvi r3,0 8005eb0: e3 ff fe a8 bi 8005950 <_Heap_Walk+0x90> return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 8005eb4: 78 03 08 01 mvhi r3,0x801 8005eb8: 38 63 3e 8c ori r3,r3,0x3e8c 8005ebc: ba 60 08 00 mv r1,r19 8005ec0: 34 02 00 01 mvi r2,1 8005ec4: b9 60 20 00 mv r4,r11 8005ec8: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005ecc: 34 03 00 00 mvi r3,0 8005ed0: e3 ff fe a0 bi 8005950 <_Heap_Walk+0x90> =============================================================================== 080045dc <_IO_Initialize_all_drivers>: void _IO_Initialize_all_drivers( void ) { 80045dc: 37 9c ff f4 addi sp,sp,-12 80045e0: 5b 8b 00 0c sw (sp+12),r11 80045e4: 5b 8c 00 08 sw (sp+8),r12 80045e8: 5b 9d 00 04 sw (sp+4),ra rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 80045ec: 78 0c 08 01 mvhi r12,0x801 80045f0: 39 8c eb 30 ori r12,r12,0xeb30 80045f4: 29 81 00 00 lw r1,(r12+0) 80045f8: 44 20 00 09 be r1,r0,800461c <_IO_Initialize_all_drivers+0x40><== NEVER TAKEN 80045fc: 34 0b 00 00 mvi r11,0 (void) rtems_io_initialize( major, 0, NULL ); 8004600: b9 60 08 00 mv r1,r11 8004604: 34 02 00 00 mvi r2,0 8004608: 34 03 00 00 mvi r3,0 800460c: f8 00 16 03 calli 8009e18 void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 8004610: 29 81 00 00 lw r1,(r12+0) 8004614: 35 6b 00 01 addi r11,r11,1 8004618: 54 2b ff fa bgu r1,r11,8004600 <_IO_Initialize_all_drivers+0x24> (void) rtems_io_initialize( major, 0, NULL ); } 800461c: 2b 9d 00 04 lw ra,(sp+4) 8004620: 2b 8b 00 0c lw r11,(sp+12) 8004624: 2b 8c 00 08 lw r12,(sp+8) 8004628: 37 9c 00 0c addi sp,sp,12 800462c: c3 a0 00 00 ret =============================================================================== 080044bc <_IO_Manager_initialization>: #include #include void _IO_Manager_initialization(void) { 80044bc: 37 9c ff e8 addi sp,sp,-24 80044c0: 5b 8b 00 18 sw (sp+24),r11 80044c4: 5b 8c 00 14 sw (sp+20),r12 80044c8: 5b 8d 00 10 sw (sp+16),r13 80044cc: 5b 8e 00 0c sw (sp+12),r14 80044d0: 5b 8f 00 08 sw (sp+8),r15 80044d4: 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(); 80044d8: 78 01 08 01 mvhi r1,0x801 80044dc: 38 21 b9 9c ori r1,r1,0xb99c drivers_in_table = rtems_configuration_get_number_of_device_drivers(); 80044e0: 28 2b 00 38 lw r11,(r1+56) number_of_drivers = rtems_configuration_get_maximum_drivers(); 80044e4: 28 2e 00 34 lw r14,(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(); 80044e8: 28 2d 00 3c lw r13,(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 ) 80044ec: 51 6e 00 2e bgeu r11,r14,80045a4 <_IO_Manager_initialization+0xe8> * 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 ) 80044f0: b5 ce 60 00 add r12,r14,r14 80044f4: b5 8e 60 00 add r12,r12,r14 80044f8: b5 8c 60 00 add r12,r12,r12 80044fc: b5 8c 60 00 add r12,r12,r12 8004500: b5 8c 60 00 add r12,r12,r12 * 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( 8004504: b9 80 08 00 mv r1,r12 8004508: f8 00 0e ab calli 8007fb4 <_Workspace_Allocate_or_fatal_error> sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 800450c: 78 04 08 01 mvhi r4,0x801 /* * 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 *) 8004510: 78 0f 08 01 mvhi r15,0x801 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 8004514: 38 84 eb 30 ori r4,r4,0xeb30 /* * 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 *) 8004518: 39 ef eb 34 ori r15,r15,0xeb34 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 800451c: 34 02 00 00 mvi r2,0 8004520: b9 80 18 00 mv r3,r12 _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 8004524: 58 8e 00 00 sw (r4+0),r14 /* * 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 *) 8004528: 59 e1 00 00 sw (r15+0),r1 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 800452c: f8 00 21 d9 calli 800cc90 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8004530: 45 60 00 15 be r11,r0,8004584 <_IO_Manager_initialization+0xc8><== NEVER TAKEN 8004534: 29 e5 00 00 lw r5,(r15+0) 8004538: 34 03 00 00 mvi r3,0 800453c: 34 04 00 00 mvi r4,0 #include #include #include void _IO_Manager_initialization(void) 8004540: b5 a3 08 00 add r1,r13,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]; 8004544: 28 26 00 00 lw r6,(r1+0) #include #include #include void _IO_Manager_initialization(void) 8004548: b4 a3 10 00 add r2,r5,r3 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 800454c: 34 84 00 01 addi r4,r4,1 _IO_Driver_address_table[index] = driver_table[index]; 8004550: 58 46 00 00 sw (r2+0),r6 8004554: 28 26 00 04 lw r6,(r1+4) memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8004558: 34 63 00 18 addi r3,r3,24 _IO_Driver_address_table[index] = driver_table[index]; 800455c: 58 46 00 04 sw (r2+4),r6 8004560: 28 26 00 08 lw r6,(r1+8) 8004564: 58 46 00 08 sw (r2+8),r6 8004568: 28 26 00 0c lw r6,(r1+12) 800456c: 58 46 00 0c sw (r2+12),r6 8004570: 28 26 00 10 lw r6,(r1+16) 8004574: 58 46 00 10 sw (r2+16),r6 8004578: 28 21 00 14 lw r1,(r1+20) 800457c: 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++ ) 8004580: 55 64 ff f0 bgu r11,r4,8004540 <_IO_Manager_initialization+0x84> _IO_Driver_address_table[index] = driver_table[index]; } 8004584: 2b 9d 00 04 lw ra,(sp+4) 8004588: 2b 8b 00 18 lw r11,(sp+24) 800458c: 2b 8c 00 14 lw r12,(sp+20) 8004590: 2b 8d 00 10 lw r13,(sp+16) 8004594: 2b 8e 00 0c lw r14,(sp+12) 8004598: 2b 8f 00 08 lw r15,(sp+8) 800459c: 37 9c 00 18 addi sp,sp,24 80045a0: c3 a0 00 00 ret * 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; 80045a4: 78 02 08 01 mvhi r2,0x801 _IO_Number_of_drivers = number_of_drivers; 80045a8: 78 01 08 01 mvhi r1,0x801 * 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; 80045ac: 38 42 eb 34 ori r2,r2,0xeb34 _IO_Number_of_drivers = number_of_drivers; 80045b0: 38 21 eb 30 ori r1,r1,0xeb30 * 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; 80045b4: 58 4d 00 00 sw (r2+0),r13 _IO_Number_of_drivers = number_of_drivers; 80045b8: 58 2b 00 00 sw (r1+0),r11 sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; } 80045bc: 2b 9d 00 04 lw ra,(sp+4) 80045c0: 2b 8b 00 18 lw r11,(sp+24) 80045c4: 2b 8c 00 14 lw r12,(sp+20) 80045c8: 2b 8d 00 10 lw r13,(sp+16) 80045cc: 2b 8e 00 0c lw r14,(sp+12) 80045d0: 2b 8f 00 08 lw r15,(sp+8) 80045d4: 37 9c 00 18 addi sp,sp,24 80045d8: c3 a0 00 00 ret =============================================================================== 08005534 <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 8005534: 37 9c ff ec addi sp,sp,-20 8005538: 5b 8b 00 14 sw (sp+20),r11 800553c: 5b 8c 00 10 sw (sp+16),r12 8005540: 5b 8d 00 0c sw (sp+12),r13 8005544: 5b 8e 00 08 sw (sp+8),r14 8005548: 5b 9d 00 04 sw (sp+4),ra 800554c: 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 ) 8005550: 28 21 00 18 lw r1,(r1+24) return NULL; 8005554: 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 ) 8005558: 5c 20 00 09 bne r1,r0,800557c <_Objects_Allocate+0x48> <== ALWAYS TAKEN ); } #endif return the_object; } 800555c: b9 80 08 00 mv r1,r12 8005560: 2b 9d 00 04 lw ra,(sp+4) 8005564: 2b 8b 00 14 lw r11,(sp+20) 8005568: 2b 8c 00 10 lw r12,(sp+16) 800556c: 2b 8d 00 0c lw r13,(sp+12) 8005570: 2b 8e 00 08 lw r14,(sp+8) 8005574: 37 9c 00 14 addi sp,sp,20 8005578: c3 a0 00 00 ret /* * 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 ); 800557c: 35 6d 00 20 addi r13,r11,32 8005580: b9 a0 08 00 mv r1,r13 8005584: fb ff fc d4 calli 80048d4 <_Chain_Get> 8005588: b8 20 60 00 mv r12,r1 if ( information->auto_extend ) { 800558c: 41 61 00 12 lbu r1,(r11+18) /* * 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 ); 8005590: b9 80 70 00 mv r14,r12 if ( information->auto_extend ) { 8005594: 44 20 ff f2 be r1,r0,800555c <_Objects_Allocate+0x28> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 8005598: 45 80 00 18 be r12,r0,80055f8 <_Objects_Allocate+0xc4> } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 800559c: 2d 83 00 0a lhu r3,(r12+10) 80055a0: 2d 61 00 0a lhu r1,(r11+10) _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 80055a4: 2d 62 00 14 lhu r2,(r11+20) 80055a8: c8 61 08 00 sub r1,r3,r1 80055ac: f8 00 55 e3 calli 801ad38 <__udivsi3> information->inactive_per_block[ block ]--; 80055b0: 29 62 00 30 lw r2,(r11+48) 80055b4: b4 21 08 00 add r1,r1,r1 80055b8: b4 21 08 00 add r1,r1,r1 80055bc: b4 41 08 00 add r1,r2,r1 80055c0: 28 22 00 00 lw r2,(r1+0) information->inactive--; 80055c4: 2d 63 00 2c lhu r3,(r11+44) block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 80055c8: 34 42 ff ff addi r2,r2,-1 80055cc: 58 22 00 00 sw (r1+0),r2 information->inactive--; 80055d0: 34 61 ff ff addi r1,r3,-1 80055d4: 0d 61 00 2c sh (r11+44),r1 ); } #endif return the_object; } 80055d8: b9 80 08 00 mv r1,r12 80055dc: 2b 9d 00 04 lw ra,(sp+4) 80055e0: 2b 8b 00 14 lw r11,(sp+20) 80055e4: 2b 8c 00 10 lw r12,(sp+16) 80055e8: 2b 8d 00 0c lw r13,(sp+12) 80055ec: 2b 8e 00 08 lw r14,(sp+8) 80055f0: 37 9c 00 14 addi sp,sp,20 80055f4: c3 a0 00 00 ret * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { _Objects_Extend_information( information ); 80055f8: b9 60 08 00 mv r1,r11 80055fc: f8 00 00 06 calli 8005614 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 8005600: b9 a0 08 00 mv r1,r13 8005604: fb ff fc b4 calli 80048d4 <_Chain_Get> 8005608: b8 20 60 00 mv r12,r1 } if ( the_object ) { 800560c: 44 2e ff d4 be r1,r14,800555c <_Objects_Allocate+0x28> 8005610: e3 ff ff e3 bi 800559c <_Objects_Allocate+0x68> =============================================================================== 08005614 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 8005614: 37 9c ff c8 addi sp,sp,-56 8005618: 5b 8b 00 2c sw (sp+44),r11 800561c: 5b 8c 00 28 sw (sp+40),r12 8005620: 5b 8d 00 24 sw (sp+36),r13 8005624: 5b 8e 00 20 sw (sp+32),r14 8005628: 5b 8f 00 1c sw (sp+28),r15 800562c: 5b 90 00 18 sw (sp+24),r16 8005630: 5b 91 00 14 sw (sp+20),r17 8005634: 5b 92 00 10 sw (sp+16),r18 8005638: 5b 93 00 0c sw (sp+12),r19 800563c: 5b 94 00 08 sw (sp+8),r20 8005640: 5b 9d 00 04 sw (sp+4),ra minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 8005644: 28 2c 00 34 lw r12,(r1+52) */ void _Objects_Extend_information( Objects_Information *information ) { 8005648: b8 20 58 00 mv r11,r1 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 800564c: 2c 30 00 0a lhu r16,(r1+10) index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 8005650: 45 80 00 9f be r12,r0,80058cc <_Objects_Extend_information+0x2b8> block_count = 0; else { block_count = information->maximum / information->allocation_size; 8005654: 2c 2f 00 14 lhu r15,(r1+20) 8005658: 2c 31 00 10 lhu r17,(r1+16) 800565c: b9 e0 10 00 mv r2,r15 8005660: ba 20 08 00 mv r1,r17 8005664: f8 00 55 b5 calli 801ad38 <__udivsi3> 8005668: 20 2e ff ff andi r14,r1,0xffff for ( ; block < block_count; block++ ) { 800566c: 45 c0 00 b3 be r14,r0,8005938 <_Objects_Extend_information+0x324><== NEVER TAKEN if ( information->object_blocks[ block ] == NULL ) { 8005670: 29 81 00 00 lw r1,(r12+0) 8005674: 44 20 00 b6 be r1,r0,800594c <_Objects_Extend_information+0x338><== NEVER TAKEN 8005678: b9 80 18 00 mv r3,r12 800567c: b9 e0 08 00 mv r1,r15 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 8005680: ba 00 68 00 mv r13,r16 index_base = minimum_index; block = 0; 8005684: 34 0c 00 00 mvi r12,0 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 8005688: 35 8c 00 01 addi r12,r12,1 if ( information->object_blocks[ block ] == NULL ) { do_extend = false; break; } else index_base += information->allocation_size; 800568c: b5 af 68 00 add r13,r13,r15 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 8005690: 55 cc 00 83 bgu r14,r12,800589c <_Objects_Extend_information+0x288> /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 8005694: 34 0f 00 01 mvi r15,1 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 8005698: b6 21 88 00 add r17,r17,r1 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 800569c: 38 02 ff ff mvu r2,0xffff 80056a0: 56 22 00 72 bgu r17,r2,8005868 <_Objects_Extend_information+0x254><== NEVER TAKEN /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 80056a4: 29 62 00 18 lw r2,(r11+24) 80056a8: f8 00 55 3f calli 801aba4 <__mulsi3> if ( information->auto_extend ) { 80056ac: 41 62 00 12 lbu r2,(r11+18) 80056b0: 44 40 00 80 be r2,r0,80058b0 <_Objects_Extend_information+0x29c> new_object_block = _Workspace_Allocate( block_size ); 80056b4: f8 00 0a 2c calli 8007f64 <_Workspace_Allocate> 80056b8: b8 20 90 00 mv r18,r1 if ( !new_object_block ) 80056bc: 44 20 00 6b be r1,r0,8005868 <_Objects_Extend_information+0x254> } /* * Do we need to grow the tables? */ if ( do_extend ) { 80056c0: 45 e0 00 43 be r15,r0,80057cc <_Objects_Extend_information+0x1b8> */ /* * Up the block count and maximum */ block_count++; 80056c4: 35 c1 00 01 addi r1,r14,1 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 80056c8: b4 21 98 00 add r19,r1,r1 80056cc: b6 61 18 00 add r3,r19,r1 ((maximum + minimum_index) * sizeof(Objects_Control *)); 80056d0: b6 23 18 00 add r3,r17,r3 if ( information->auto_extend ) { 80056d4: 41 62 00 12 lbu r2,(r11+18) /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 80056d8: b4 70 18 00 add r3,r3,r16 block_count++; /* * Allocate the tables and break it up. */ block_size = block_count * 80056dc: b4 63 18 00 add r3,r3,r3 80056e0: b4 63 18 00 add r3,r3,r3 (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 80056e4: 44 40 00 76 be r2,r0,80058bc <_Objects_Extend_information+0x2a8> object_blocks = _Workspace_Allocate( block_size ); 80056e8: b8 60 08 00 mv r1,r3 80056ec: f8 00 0a 1e calli 8007f64 <_Workspace_Allocate> 80056f0: b8 20 78 00 mv r15,r1 if ( !object_blocks ) { 80056f4: 44 20 00 8e be r1,r0,800592c <_Objects_Extend_information+0x318> * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 80056f8: 2d 61 00 10 lhu r1,(r11+16) /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( object_blocks, block_count * sizeof(void*) ); 80056fc: b6 73 a0 00 add r20,r19,r19 8005700: b5 f4 98 00 add r19,r15,r20 8005704: b6 74 a0 00 add r20,r19,r20 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 8005708: 54 30 00 77 bgu r1,r16,80058e4 <_Objects_Extend_information+0x2d0> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 800570c: ba 80 20 00 mv r4,r20 8005710: 34 03 00 00 mvi r3,0 8005714: 46 00 00 05 be r16,r0,8005728 <_Objects_Extend_information+0x114><== NEVER TAKEN local_table[ index ] = NULL; 8005718: 58 80 00 00 sw (r4+0),r0 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 800571c: 34 63 00 01 addi r3,r3,1 8005720: 34 84 00 04 addi r4,r4,4 8005724: 56 03 ff fd bgu r16,r3,8005718 <_Objects_Extend_information+0x104><== NEVER TAKEN 8005728: b5 ce 70 00 add r14,r14,r14 800572c: b5 ce 70 00 add r14,r14,r14 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 8005730: 2d 65 00 14 lhu r5,(r11+20) } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 8005734: b5 ee 08 00 add r1,r15,r14 8005738: 58 20 00 00 sw (r1+0),r0 inactive_per_block[block_count] = 0; 800573c: b6 6e 70 00 add r14,r19,r14 8005740: 59 c0 00 00 sw (r14+0),r0 for ( index=index_base ; index < ( information->allocation_size + index_base ); 8005744: b5 a5 28 00 add r5,r13,r5 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 8005748: 51 a5 00 09 bgeu r13,r5,800576c <_Objects_Extend_information+0x158><== NEVER TAKEN * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 800574c: b5 ad 20 00 add r4,r13,r13 8005750: b4 84 20 00 add r4,r4,r4 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 8005754: b6 84 20 00 add r4,r20,r4 * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 8005758: b9 a0 18 00 mv r3,r13 inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 800575c: 58 80 00 00 sw (r4+0),r0 object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 8005760: 34 63 00 01 addi r3,r3,1 8005764: 34 84 00 04 addi r4,r4,4 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 8005768: 54 a3 ff fd bgu r5,r3,800575c <_Objects_Extend_information+0x148> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 800576c: 90 00 70 00 rcsr r14,IE 8005770: 34 01 ff fe mvi r1,-2 8005774: a1 c1 08 00 and r1,r14,r1 8005778: d0 01 00 00 wcsr IE,r1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 800577c: 29 61 00 00 lw r1,(r11+0) old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 8005780: 22 31 ff ff andi r17,r17,0xffff 8005784: 0d 71 00 10 sh (r11+16),r17 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 8005788: 29 70 00 34 lw r16,(r11+52) information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 800578c: 59 73 00 30 sw (r11+48),r19 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 8005790: 59 6f 00 34 sw (r11+52),r15 information->inactive_per_block = inactive_per_block; information->local_table = local_table; 8005794: 59 74 00 1c sw (r11+28),r20 8005798: 34 02 00 18 mvi r2,24 800579c: f8 00 54 8d calli 801a9d0 <__ashlsi3> 80057a0: 78 0f 00 01 mvhi r15,0x1 80057a4: b8 2f 78 00 or r15,r1,r15 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 80057a8: 2d 61 00 04 lhu r1,(r11+4) 80057ac: 34 02 00 1b mvi r2,27 80057b0: f8 00 54 88 calli 801a9d0 <__ashlsi3> 80057b4: b9 e1 10 00 or r2,r15,r1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 80057b8: b8 51 88 00 or r17,r2,r17 information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 80057bc: 59 71 00 0c sw (r11+12),r17 information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 80057c0: d0 0e 00 00 wcsr IE,r14 _Workspace_Free( old_tables ); 80057c4: ba 00 08 00 mv r1,r16 80057c8: f8 00 09 f2 calli 8007f90 <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 80057cc: 29 61 00 34 lw r1,(r11+52) 80057d0: b5 8c 60 00 add r12,r12,r12 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 80057d4: 2d 63 00 14 lhu r3,(r11+20) 80057d8: 29 64 00 18 lw r4,(r11+24) } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 80057dc: b5 8c 60 00 add r12,r12,r12 80057e0: b4 2c 08 00 add r1,r1,r12 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 80057e4: 37 90 00 30 addi r16,sp,48 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 80057e8: 58 32 00 00 sw (r1+0),r18 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 80057ec: ba 40 10 00 mv r2,r18 80057f0: ba 00 08 00 mv r1,r16 80057f4: fb ff fc 49 calli 8004918 <_Chain_Initialize> 80057f8: 78 12 00 01 mvhi r18,0x1 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 80057fc: 35 71 00 20 addi r17,r11,32 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 8005800: e0 00 00 0e bi 8005838 <_Objects_Extend_information+0x224> 8005804: 29 61 00 00 lw r1,(r11+0) 8005808: f8 00 54 72 calli 801a9d0 <__ashlsi3> 800580c: b8 32 78 00 or r15,r1,r18 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 8005810: 2d 61 00 04 lhu r1,(r11+4) 8005814: 34 02 00 1b mvi r2,27 8005818: f8 00 54 6e calli 801a9d0 <__ashlsi3> 800581c: b9 e1 10 00 or r2,r15,r1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 8005820: b8 4d 10 00 or r2,r2,r13 the_object->id = _Objects_Build_id( 8005824: 59 c2 00 08 sw (r14+8),r2 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 8005828: ba 20 08 00 mv r1,r17 800582c: b9 c0 10 00 mv r2,r14 8005830: fb ff fc 1d calli 80048a4 <_Chain_Append> index++; 8005834: 35 ad 00 01 addi r13,r13,1 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 8005838: ba 00 08 00 mv r1,r16 800583c: fb ff fc 26 calli 80048d4 <_Chain_Get> 8005840: b8 20 70 00 mv r14,r1 8005844: 34 02 00 18 mvi r2,24 8005848: 5c 20 ff ef bne r1,r0,8005804 <_Objects_Extend_information+0x1f0> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 800584c: 29 63 00 30 lw r3,(r11+48) information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 8005850: 2d 62 00 2c lhu r2,(r11+44) _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 8005854: 2d 61 00 14 lhu r1,(r11+20) 8005858: b4 6c 60 00 add r12,r3,r12 800585c: 59 81 00 00 sw (r12+0),r1 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 8005860: b4 22 08 00 add r1,r1,r2 index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = 8005864: 0d 61 00 2c sh (r11+44),r1 (Objects_Maximum)(information->inactive + information->allocation_size); } 8005868: 2b 9d 00 04 lw ra,(sp+4) 800586c: 2b 8b 00 2c lw r11,(sp+44) 8005870: 2b 8c 00 28 lw r12,(sp+40) 8005874: 2b 8d 00 24 lw r13,(sp+36) 8005878: 2b 8e 00 20 lw r14,(sp+32) 800587c: 2b 8f 00 1c lw r15,(sp+28) 8005880: 2b 90 00 18 lw r16,(sp+24) 8005884: 2b 91 00 14 lw r17,(sp+20) 8005888: 2b 92 00 10 lw r18,(sp+16) 800588c: 2b 93 00 0c lw r19,(sp+12) 8005890: 2b 94 00 08 lw r20,(sp+8) 8005894: 37 9c 00 38 addi sp,sp,56 8005898: c3 a0 00 00 ret block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { 800589c: 28 62 00 04 lw r2,(r3+4) 80058a0: 34 63 00 04 addi r3,r3,4 80058a4: 5c 40 ff 79 bne r2,r0,8005688 <_Objects_Extend_information+0x74> do_extend = false; 80058a8: 34 0f 00 00 mvi r15,0 80058ac: e3 ff ff 7b bi 8005698 <_Objects_Extend_information+0x84> if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 80058b0: f8 00 09 c1 calli 8007fb4 <_Workspace_Allocate_or_fatal_error> 80058b4: b8 20 90 00 mv r18,r1 80058b8: e3 ff ff 82 bi 80056c0 <_Objects_Extend_information+0xac> if ( !object_blocks ) { _Workspace_Free( new_object_block ); return; } } else { object_blocks = _Workspace_Allocate_or_fatal_error( block_size ); 80058bc: b8 60 08 00 mv r1,r3 80058c0: f8 00 09 bd calli 8007fb4 <_Workspace_Allocate_or_fatal_error> 80058c4: b8 20 78 00 mv r15,r1 80058c8: e3 ff ff 8c bi 80056f8 <_Objects_Extend_information+0xe4> minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 80058cc: 2c 31 00 10 lhu r17,(r1+16) /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 80058d0: ba 00 68 00 mv r13,r16 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 80058d4: 2c 21 00 14 lhu r1,(r1+20) /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 80058d8: 34 0f 00 01 mvi r15,1 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; 80058dc: 34 0e 00 00 mvi r14,0 80058e0: e3 ff ff 6e bi 8005698 <_Objects_Extend_information+0x84> /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 80058e4: 29 62 00 34 lw r2,(r11+52) information->object_blocks, block_count * sizeof(void*) ); 80058e8: b5 ce 70 00 add r14,r14,r14 80058ec: b5 ce 70 00 add r14,r14,r14 /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 80058f0: b9 c0 18 00 mv r3,r14 80058f4: b9 e0 08 00 mv r1,r15 80058f8: f8 00 1c a5 calli 800cb8c information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 80058fc: 29 62 00 30 lw r2,(r11+48) 8005900: b9 c0 18 00 mv r3,r14 8005904: ba 60 08 00 mv r1,r19 8005908: f8 00 1c a1 calli 800cb8c information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 800590c: 2d 63 00 10 lhu r3,(r11+16) information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 8005910: 29 62 00 1c lw r2,(r11+28) 8005914: ba 80 08 00 mv r1,r20 information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 8005918: b6 03 18 00 add r3,r16,r3 800591c: b4 63 18 00 add r3,r3,r3 8005920: b4 63 18 00 add r3,r3,r3 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 8005924: f8 00 1c 9a calli 800cb8c 8005928: e3 ff ff 82 bi 8005730 <_Objects_Extend_information+0x11c> (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { object_blocks = _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block ); 800592c: ba 40 08 00 mv r1,r18 8005930: f8 00 09 98 calli 8007f90 <_Workspace_Free> return; 8005934: e3 ff ff cd bi 8005868 <_Objects_Extend_information+0x254> if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 8005938: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 800593c: ba 00 68 00 mv r13,r16 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 8005940: 34 0f 00 01 mvi r15,1 <== NOT EXECUTED minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 8005944: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED 8005948: e3 ff ff 54 bi 8005698 <_Objects_Extend_information+0x84> <== NOT EXECUTED block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { 800594c: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 8005950: ba 00 68 00 mv r13,r16 <== NOT EXECUTED else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { do_extend = false; 8005954: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 8005958: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED 800595c: e3 ff ff 4f bi 8005698 <_Objects_Extend_information+0x84> <== NOT EXECUTED =============================================================================== 08005a48 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 8005a48: 37 9c ff f0 addi sp,sp,-16 8005a4c: 5b 8b 00 10 sw (sp+16),r11 8005a50: 5b 8c 00 0c sw (sp+12),r12 8005a54: 5b 8d 00 08 sw (sp+8),r13 8005a58: 5b 9d 00 04 sw (sp+4),ra 8005a5c: 20 4c ff ff andi r12,r2,0xffff 8005a60: b8 20 68 00 mv r13,r1 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) return NULL; 8005a64: 34 0b 00 00 mvi r11,0 ) { Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 8005a68: 5d 80 00 08 bne r12,r0,8005a88 <_Objects_Get_information+0x40> if ( info->maximum == 0 ) return NULL; #endif return info; } 8005a6c: b9 60 08 00 mv r1,r11 8005a70: 2b 9d 00 04 lw ra,(sp+4) 8005a74: 2b 8b 00 10 lw r11,(sp+16) 8005a78: 2b 8c 00 0c lw r12,(sp+12) 8005a7c: 2b 8d 00 08 lw r13,(sp+8) 8005a80: 37 9c 00 10 addi sp,sp,16 8005a84: c3 a0 00 00 ret /* * 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 ); 8005a88: f8 00 12 4e calli 800a3c0 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 8005a8c: 44 20 ff f8 be r1,r0,8005a6c <_Objects_Get_information+0x24> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 8005a90: 55 81 ff f7 bgu r12,r1,8005a6c <_Objects_Get_information+0x24> return NULL; if ( !_Objects_Information_table[ the_api ] ) 8005a94: 78 01 08 01 mvhi r1,0x801 8005a98: b5 ad 68 00 add r13,r13,r13 8005a9c: 38 21 e8 7c ori r1,r1,0xe87c 8005aa0: b5 ad 68 00 add r13,r13,r13 8005aa4: b4 2d 08 00 add r1,r1,r13 8005aa8: 28 21 00 00 lw r1,(r1+0) 8005aac: 44 20 ff f0 be r1,r0,8005a6c <_Objects_Get_information+0x24><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 8005ab0: b5 8c 60 00 add r12,r12,r12 8005ab4: b5 8c 60 00 add r12,r12,r12 8005ab8: b4 2c 08 00 add r1,r1,r12 8005abc: 28 2b 00 00 lw r11,(r1+0) if ( !info ) 8005ac0: 45 60 ff eb be r11,r0,8005a6c <_Objects_Get_information+0x24><== 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 ) 8005ac4: 2d 61 00 10 lhu r1,(r11+16) return NULL; 8005ac8: 7c 21 00 00 cmpnei r1,r1,0 8005acc: c8 01 08 00 sub r1,r0,r1 8005ad0: a1 61 58 00 and r11,r11,r1 8005ad4: e3 ff ff e6 bi 8005a6c <_Objects_Get_information+0x24> =============================================================================== 0801558c <_Objects_Get_name_as_string>: char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { 801558c: 37 9c ff dc addi sp,sp,-36 8015590: 5b 8b 00 18 sw (sp+24),r11 8015594: 5b 8c 00 14 sw (sp+20),r12 8015598: 5b 8d 00 10 sw (sp+16),r13 801559c: 5b 8e 00 0c sw (sp+12),r14 80155a0: 5b 8f 00 08 sw (sp+8),r15 80155a4: 5b 9d 00 04 sw (sp+4),ra 80155a8: b8 40 60 00 mv r12,r2 80155ac: b8 60 58 00 mv r11,r3 char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) 80155b0: 5c 40 00 0b bne r2,r0,80155dc <_Objects_Get_name_as_string+0x50> #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* not supported */ #endif case OBJECTS_ERROR: return NULL; 80155b4: 34 0b 00 00 mvi r11,0 _Thread_Enable_dispatch(); return name; } return NULL; /* unreachable path */ } 80155b8: b9 60 08 00 mv r1,r11 80155bc: 2b 9d 00 04 lw ra,(sp+4) 80155c0: 2b 8b 00 18 lw r11,(sp+24) 80155c4: 2b 8c 00 14 lw r12,(sp+20) 80155c8: 2b 8d 00 10 lw r13,(sp+16) 80155cc: 2b 8e 00 0c lw r14,(sp+12) 80155d0: 2b 8f 00 08 lw r15,(sp+8) 80155d4: 37 9c 00 24 addi sp,sp,36 80155d8: c3 a0 00 00 ret Objects_Id tmpId; if ( length == 0 ) return NULL; if ( name == NULL ) 80155dc: 44 60 ff f7 be r3,r0,80155b8 <_Objects_Get_name_as_string+0x2c> return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 80155e0: b8 20 68 00 mv r13,r1 80155e4: 5c 20 00 05 bne r1,r0,80155f8 <_Objects_Get_name_as_string+0x6c> 80155e8: 78 01 08 03 mvhi r1,0x803 80155ec: 38 21 33 80 ori r1,r1,0x3380 80155f0: 28 21 00 10 lw r1,(r1+16) 80155f4: 28 2d 00 08 lw r13,(r1+8) information = _Objects_Get_information_id( tmpId ); 80155f8: b9 a0 08 00 mv r1,r13 80155fc: fb ff de 34 calli 800cecc <_Objects_Get_information_id> if ( !information ) 8015600: 44 20 ff ed be r1,r0,80155b4 <_Objects_Get_name_as_string+0x28> return NULL; the_object = _Objects_Get( information, tmpId, &location ); 8015604: b9 a0 10 00 mv r2,r13 8015608: 37 83 00 24 addi r3,sp,36 801560c: fb ff de 82 calli 800d014 <_Objects_Get> switch ( location ) { 8015610: 2b 8f 00 24 lw r15,(sp+36) 8015614: 5d e0 ff e8 bne r15,r0,80155b4 <_Objects_Get_name_as_string+0x28> if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 8015618: 28 2e 00 0c lw r14,(r1+12) lname[ 0 ] = (u32_name >> 24) & 0xff; 801561c: 34 02 00 18 mvi r2,24 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 8015620: 35 8c ff ff addi r12,r12,-1 } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 8015624: b9 c0 08 00 mv r1,r14 8015628: f8 00 5d 05 calli 802ca3c <__lshrsi3> 801562c: 20 2d 00 ff andi r13,r1,0xff lname[ 1 ] = (u32_name >> 16) & 0xff; 8015630: 34 02 00 10 mvi r2,16 8015634: b9 c0 08 00 mv r1,r14 } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 8015638: 33 8d 00 1c sb (sp+28),r13 lname[ 1 ] = (u32_name >> 16) & 0xff; 801563c: f8 00 5d 00 calli 802ca3c <__lshrsi3> lname[ 2 ] = (u32_name >> 8) & 0xff; 8015640: 01 c3 00 01 srui r3,r14,1 #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 8015644: 33 81 00 1d sb (sp+29),r1 lname[ 2 ] = (u32_name >> 8) & 0xff; 8015648: 00 63 00 01 srui r3,r3,1 lname[ 3 ] = (u32_name >> 0) & 0xff; 801564c: 33 8e 00 1f sb (sp+31),r14 { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 8015650: 00 63 00 01 srui r3,r3,1 lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 8015654: 33 80 00 20 sb (sp+32),r0 { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 8015658: 00 63 00 01 srui r3,r3,1 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 801565c: b9 60 10 00 mv r2,r11 { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 8015660: 00 63 00 01 srui r3,r3,1 8015664: 00 63 00 01 srui r3,r3,1 8015668: 00 63 00 01 srui r3,r3,1 801566c: 00 63 00 01 srui r3,r3,1 8015670: 33 83 00 1e sb (sp+30),r3 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 8015674: 45 8f 00 13 be r12,r15,80156c0 <_Objects_Get_name_as_string+0x134><== NEVER TAKEN 8015678: 45 a0 00 12 be r13,r0,80156c0 <_Objects_Get_name_as_string+0x134> 801567c: 78 03 08 03 mvhi r3,0x803 8015680: 34 01 00 00 mvi r1,0 8015684: 38 63 23 fc ori r3,r3,0x23fc * This method objects the name of an object and returns its name * in the form of a C string. It attempts to be careful about * overflowing the user's string and about returning unprintable characters. */ char *_Objects_Get_name_as_string( 8015688: 37 86 00 1c addi r6,sp,28 } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { *d = (isprint((unsigned char)*s)) ? *s : '*'; 801568c: 28 64 00 00 lw r4,(r3+0) s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 8015690: 34 21 00 01 addi r1,r1,1 * This method objects the name of an object and returns its name * in the form of a C string. It attempts to be careful about * overflowing the user's string and about returning unprintable characters. */ char *_Objects_Get_name_as_string( 8015694: b4 c1 28 00 add r5,r6,r1 } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { *d = (isprint((unsigned char)*s)) ? *s : '*'; 8015698: b4 8d 20 00 add r4,r4,r13 801569c: 40 84 00 01 lbu r4,(r4+1) 80156a0: 20 84 00 97 andi r4,r4,0x97 80156a4: 5c 80 00 02 bne r4,r0,80156ac <_Objects_Get_name_as_string+0x120> 80156a8: 34 0d 00 2a mvi r13,42 80156ac: 30 4d 00 00 sb (r2+0),r13 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 80156b0: 34 42 00 01 addi r2,r2,1 80156b4: 50 2c 00 03 bgeu r1,r12,80156c0 <_Objects_Get_name_as_string+0x134> 80156b8: 40 ad 00 00 lbu r13,(r5+0) 80156bc: 5d a0 ff f4 bne r13,r0,801568c <_Objects_Get_name_as_string+0x100> *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; 80156c0: 30 40 00 00 sb (r2+0),r0 _Thread_Enable_dispatch(); 80156c4: fb ff e2 f4 calli 800e294 <_Thread_Enable_dispatch> return name; 80156c8: e3 ff ff bc bi 80155b8 <_Objects_Get_name_as_string+0x2c> =============================================================================== 08018b44 <_Objects_Get_no_protection>: /* * 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; 8018b44: 28 25 00 08 lw r5,(r1+8) if ( information->maximum >= index ) { 8018b48: 2c 24 00 10 lhu r4,(r1+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; 8018b4c: c8 45 10 00 sub r2,r2,r5 8018b50: 34 42 00 01 addi r2,r2,1 if ( information->maximum >= index ) { 8018b54: 54 44 00 09 bgu r2,r4,8018b78 <_Objects_Get_no_protection+0x34> if ( (the_object = information->local_table[ index ]) != NULL ) { 8018b58: 28 24 00 1c lw r4,(r1+28) 8018b5c: b4 42 08 00 add r1,r2,r2 8018b60: b4 21 08 00 add r1,r1,r1 8018b64: b4 81 08 00 add r1,r4,r1 8018b68: 28 21 00 00 lw r1,(r1+0) 8018b6c: 44 20 00 03 be r1,r0,8018b78 <_Objects_Get_no_protection+0x34><== NEVER TAKEN *location = OBJECTS_LOCAL; 8018b70: 58 60 00 00 sw (r3+0),r0 return the_object; 8018b74: c3 a0 00 00 ret /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 8018b78: 34 01 00 01 mvi r1,1 8018b7c: 58 61 00 00 sw (r3+0),r1 return NULL; 8018b80: 34 01 00 00 mvi r1,0 } 8018b84: c3 a0 00 00 ret =============================================================================== 0800d0ac <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 800d0ac: 37 9c ff e8 addi sp,sp,-24 800d0b0: 5b 8b 00 14 sw (sp+20),r11 800d0b4: 5b 8c 00 10 sw (sp+16),r12 800d0b8: 5b 8d 00 0c sw (sp+12),r13 800d0bc: 5b 8e 00 08 sw (sp+8),r14 800d0c0: 5b 9d 00 04 sw (sp+4),ra /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 800d0c4: b8 20 58 00 mv r11,r1 Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 800d0c8: b8 40 70 00 mv r14,r2 /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 800d0cc: 5c 20 00 05 bne r1,r0,800d0e0 <_Objects_Id_to_name+0x34> 800d0d0: 78 01 08 03 mvhi r1,0x803 800d0d4: 38 21 33 80 ori r1,r1,0x3380 800d0d8: 28 21 00 10 lw r1,(r1+16) 800d0dc: 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); 800d0e0: b9 60 08 00 mv r1,r11 800d0e4: 34 02 00 18 mvi r2,24 800d0e8: f8 00 7e 55 calli 802ca3c <__lshrsi3> 800d0ec: 20 23 00 07 andi r3,r1,0x7 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 800d0f0: 34 64 ff ff addi r4,r3,-1 800d0f4: 34 01 00 02 mvi r1,2 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 800d0f8: 34 0c 00 03 mvi r12,3 800d0fc: 54 81 00 18 bgu r4,r1,800d15c <_Objects_Id_to_name+0xb0> if ( !_Objects_Information_table[ the_api ] ) 800d100: 78 04 08 03 mvhi r4,0x803 800d104: b4 63 18 00 add r3,r3,r3 800d108: 38 84 31 54 ori r4,r4,0x3154 800d10c: b4 63 18 00 add r3,r3,r3 800d110: b4 83 18 00 add r3,r4,r3 800d114: 28 6d 00 00 lw r13,(r3+0) 800d118: 45 a0 00 11 be r13,r0,800d15c <_Objects_Id_to_name+0xb0> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 800d11c: b9 60 08 00 mv r1,r11 800d120: 34 02 00 1b mvi r2,27 800d124: f8 00 7e 46 calli 802ca3c <__lshrsi3> return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 800d128: b4 21 18 00 add r3,r1,r1 800d12c: b4 63 18 00 add r3,r3,r3 800d130: b5 a3 18 00 add r3,r13,r3 800d134: 28 61 00 00 lw r1,(r3+0) if ( !information ) 800d138: 44 20 00 09 be r1,r0,800d15c <_Objects_Id_to_name+0xb0> <== 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 ); 800d13c: b9 60 10 00 mv r2,r11 800d140: 37 83 00 18 addi r3,sp,24 800d144: fb ff ff b4 calli 800d014 <_Objects_Get> if ( !the_object ) 800d148: 44 20 00 05 be r1,r0,800d15c <_Objects_Id_to_name+0xb0> return OBJECTS_INVALID_ID; *name = the_object->name; 800d14c: 28 21 00 0c lw r1,(r1+12) _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 800d150: 34 0c 00 00 mvi r12,0 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; 800d154: 59 c1 00 00 sw (r14+0),r1 _Thread_Enable_dispatch(); 800d158: f8 00 04 4f calli 800e294 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 800d15c: b9 80 08 00 mv r1,r12 800d160: 2b 9d 00 04 lw ra,(sp+4) 800d164: 2b 8b 00 14 lw r11,(sp+20) 800d168: 2b 8c 00 10 lw r12,(sp+16) 800d16c: 2b 8d 00 0c lw r13,(sp+12) 800d170: 2b 8e 00 08 lw r14,(sp+8) 800d174: 37 9c 00 18 addi sp,sp,24 800d178: c3 a0 00 00 ret =============================================================================== 08005d88 <_Objects_Shrink_information>: #include void _Objects_Shrink_information( Objects_Information *information ) { 8005d88: 37 9c ff ec addi sp,sp,-20 8005d8c: 5b 8b 00 14 sw (sp+20),r11 8005d90: 5b 8c 00 10 sw (sp+16),r12 8005d94: 5b 8d 00 0c sw (sp+12),r13 8005d98: 5b 8e 00 08 sw (sp+8),r14 8005d9c: 5b 9d 00 04 sw (sp+4),ra /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 8005da0: 2c 2c 00 0a lhu r12,(r1+10) block_count = (information->maximum - index_base) / 8005da4: 2c 2d 00 14 lhu r13,(r1+20) #include void _Objects_Shrink_information( Objects_Information *information ) { 8005da8: b8 20 70 00 mv r14,r1 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / 8005dac: 2c 21 00 10 lhu r1,(r1+16) 8005db0: b9 a0 10 00 mv r2,r13 8005db4: c8 2c 08 00 sub r1,r1,r12 8005db8: f8 00 53 e0 calli 801ad38 <__udivsi3> information->allocation_size; for ( block = 0; block < block_count; block++ ) { 8005dbc: 44 20 00 09 be r1,r0,8005de0 <_Objects_Shrink_information+0x58><== NEVER TAKEN if ( information->inactive_per_block[ block ] == 8005dc0: 29 c5 00 30 lw r5,(r14+48) 8005dc4: 34 0b 00 04 mvi r11,4 8005dc8: 34 03 00 00 mvi r3,0 8005dcc: 28 a2 00 00 lw r2,(r5+0) 8005dd0: 45 a2 00 11 be r13,r2,8005e14 <_Objects_Shrink_information+0x8c><== NEVER TAKEN index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 8005dd4: 34 63 00 01 addi r3,r3,1 #include #include #include #include void _Objects_Shrink_information( 8005dd8: b4 ab 10 00 add r2,r5,r11 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 8005ddc: 54 23 00 08 bgu r1,r3,8005dfc <_Objects_Shrink_information+0x74> return; } index_base += information->allocation_size; } } 8005de0: 2b 9d 00 04 lw ra,(sp+4) 8005de4: 2b 8b 00 14 lw r11,(sp+20) 8005de8: 2b 8c 00 10 lw r12,(sp+16) 8005dec: 2b 8d 00 0c lw r13,(sp+12) 8005df0: 2b 8e 00 08 lw r14,(sp+8) 8005df4: 37 9c 00 14 addi sp,sp,20 8005df8: c3 a0 00 00 ret index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 8005dfc: 28 42 00 00 lw r2,(r2+0) information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 8005e00: 35 64 00 04 addi r4,r11,4 8005e04: b5 8d 60 00 add r12,r12,r13 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 8005e08: 45 a2 00 04 be r13,r2,8005e18 <_Objects_Shrink_information+0x90> 8005e0c: b8 80 58 00 mv r11,r4 8005e10: e3 ff ff f1 bi 8005dd4 <_Objects_Shrink_information+0x4c> 8005e14: 34 0b 00 00 mvi r11,0 <== NOT EXECUTED information->allocation_size ) { /* * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) _Chain_First( &information->Inactive ); 8005e18: 29 c1 00 20 lw r1,(r14+32) do { index = _Objects_Get_index( the_object->id ); 8005e1c: 2c 22 00 0a lhu r2,(r1+10) /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 8005e20: 28 2d 00 00 lw r13,(r1+0) if ((index >= index_base) && 8005e24: 55 82 00 05 bgu r12,r2,8005e38 <_Objects_Shrink_information+0xb0> (index < (index_base + information->allocation_size))) { 8005e28: 2d c3 00 14 lhu r3,(r14+20) 8005e2c: b5 83 18 00 add r3,r12,r3 /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && 8005e30: 50 43 00 02 bgeu r2,r3,8005e38 <_Objects_Shrink_information+0xb0> (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 8005e34: f8 00 10 12 calli 8009e7c <_Chain_Extract> } } while ( the_object ); 8005e38: 45 a0 00 03 be r13,r0,8005e44 <_Objects_Shrink_information+0xbc> index = _Objects_Get_index( the_object->id ); /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 8005e3c: b9 a0 08 00 mv r1,r13 8005e40: e3 ff ff f7 bi 8005e1c <_Objects_Shrink_information+0x94> while ( the_object ); /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 8005e44: 29 c1 00 34 lw r1,(r14+52) 8005e48: b4 2b 08 00 add r1,r1,r11 8005e4c: 28 21 00 00 lw r1,(r1+0) 8005e50: f8 00 08 50 calli 8007f90 <_Workspace_Free> information->object_blocks[ block ] = NULL; 8005e54: 29 c2 00 34 lw r2,(r14+52) information->inactive_per_block[ block ] = 0; 8005e58: 29 c4 00 30 lw r4,(r14+48) information->inactive -= information->allocation_size; 8005e5c: 2d c3 00 2c lhu r3,(r14+44) 8005e60: 2d c1 00 14 lhu r1,(r14+20) /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 8005e64: b4 4b 10 00 add r2,r2,r11 8005e68: 58 40 00 00 sw (r2+0),r0 information->inactive_per_block[ block ] = 0; 8005e6c: b4 8b 58 00 add r11,r4,r11 8005e70: 59 60 00 00 sw (r11+0),r0 information->inactive -= information->allocation_size; 8005e74: c8 61 08 00 sub r1,r3,r1 8005e78: 0d c1 00 2c sh (r14+44),r1 return; } index_base += information->allocation_size; } } 8005e7c: 2b 9d 00 04 lw ra,(sp+4) 8005e80: 2b 8b 00 14 lw r11,(sp+20) 8005e84: 2b 8c 00 10 lw r12,(sp+16) 8005e88: 2b 8d 00 0c lw r13,(sp+12) 8005e8c: 2b 8e 00 08 lw r14,(sp+8) 8005e90: 37 9c 00 14 addi sp,sp,20 8005e94: c3 a0 00 00 ret =============================================================================== 0800bfd8 <_Protected_heap_Get_information>: bool _Protected_heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 800bfd8: 37 9c ff f0 addi sp,sp,-16 800bfdc: 5b 8b 00 0c sw (sp+12),r11 800bfe0: 5b 8c 00 08 sw (sp+8),r12 800bfe4: 5b 9d 00 04 sw (sp+4),ra if ( !the_heap ) return false; 800bfe8: 34 03 00 00 mvi r3,0 bool _Protected_heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 800bfec: b8 20 60 00 mv r12,r1 if ( !the_heap ) 800bff0: 44 20 00 0d be r1,r0,800c024 <_Protected_heap_Get_information+0x4c><== NEVER TAKEN return false; if ( !the_info ) 800bff4: 44 40 00 0c be r2,r0,800c024 <_Protected_heap_Get_information+0x4c><== NEVER TAKEN return false; _RTEMS_Lock_allocator(); 800bff8: 78 0b 08 02 mvhi r11,0x802 800bffc: 39 6b 62 48 ori r11,r11,0x6248 800c000: 29 61 00 00 lw r1,(r11+0) 800c004: 5b 82 00 10 sw (sp+16),r2 800c008: fb ff f6 3a calli 80098f0 <_API_Mutex_Lock> _Heap_Get_information( the_heap, the_info ); 800c00c: 2b 82 00 10 lw r2,(sp+16) 800c010: b9 80 08 00 mv r1,r12 800c014: f8 00 11 b8 calli 80106f4 <_Heap_Get_information> _RTEMS_Unlock_allocator(); 800c018: 29 61 00 00 lw r1,(r11+0) 800c01c: fb ff f6 51 calli 8009960 <_API_Mutex_Unlock> return true; 800c020: 34 03 00 01 mvi r3,1 } 800c024: b8 60 08 00 mv r1,r3 800c028: 2b 9d 00 04 lw ra,(sp+4) 800c02c: 2b 8b 00 0c lw r11,(sp+12) 800c030: 2b 8c 00 08 lw r12,(sp+8) 800c034: 37 9c 00 10 addi sp,sp,16 800c038: c3 a0 00 00 ret =============================================================================== 080068c0 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 80068c0: 37 9c ff ec addi sp,sp,-20 80068c4: 5b 8b 00 14 sw (sp+20),r11 80068c8: 5b 8c 00 10 sw (sp+16),r12 80068cc: 5b 8d 00 0c sw (sp+12),r13 80068d0: 5b 8e 00 08 sw (sp+8),r14 80068d4: 5b 9d 00 04 sw (sp+4),ra 80068d8: b8 40 60 00 mv r12,r2 80068dc: b8 20 68 00 mv r13,r1 RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 80068e0: 44 40 00 35 be r2,r0,80069b4 <_RBTree_Extract_unprotected+0xf4> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 80068e4: 28 21 00 08 lw r1,(r1+8) 80068e8: 44 22 00 4a be r1,r2,8006a10 <_RBTree_Extract_unprotected+0x150> the_rbtree->first[RBT_LEFT] = next; } /* 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]) { 80068ec: 29 a1 00 0c lw r1,(r13+12) 80068f0: 44 2c 00 4d be r1,r12,8006a24 <_RBTree_Extract_unprotected+0x164> * 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]) { 80068f4: 29 8b 00 04 lw r11,(r12+4) 80068f8: 45 60 00 53 be r11,r0,8006a44 <_RBTree_Extract_unprotected+0x184> 80068fc: 29 81 00 08 lw r1,(r12+8) 8006900: 5c 20 00 03 bne r1,r0,800690c <_RBTree_Extract_unprotected+0x4c> 8006904: e0 00 00 36 bi 80069dc <_RBTree_Extract_unprotected+0x11c> target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 8006908: b8 40 58 00 mv r11,r2 800690c: 29 62 00 08 lw r2,(r11+8) 8006910: 5c 40 ff fe bne r2,r0,8006908 <_RBTree_Extract_unprotected+0x48> * 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]; 8006914: 29 6e 00 04 lw r14,(r11+4) if(leaf) { 8006918: 45 c2 00 48 be r14,r2,8006a38 <_RBTree_Extract_unprotected+0x178> leaf->parent = target->parent; 800691c: 29 61 00 00 lw r1,(r11+0) 8006920: 59 c1 00 00 sw (r14+0),r1 } else { /* 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]; 8006924: 29 61 00 00 lw r1,(r11+0) target->parent->child[dir] = leaf; /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 8006928: 29 84 00 00 lw r4,(r12+0) 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; 800692c: 29 63 00 0c lw r3,(r11+12) dir = target != target->parent->child[0]; 8006930: 28 22 00 04 lw r2,(r1+4) 8006934: fc 4b 10 00 cmpne r2,r2,r11 target->parent->child[dir] = leaf; 8006938: b4 42 10 00 add r2,r2,r2 800693c: b4 42 10 00 add r2,r2,r2 8006940: b4 22 10 00 add r2,r1,r2 8006944: 58 4e 00 04 sw (r2+4),r14 /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 8006948: 28 81 00 04 lw r1,(r4+4) 800694c: fc 2c 08 00 cmpne r1,r1,r12 the_node->parent->child[dir] = target; 8006950: b4 21 08 00 add r1,r1,r1 8006954: b4 21 08 00 add r1,r1,r1 8006958: b4 81 08 00 add r1,r4,r1 800695c: 58 2b 00 04 sw (r1+4),r11 /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 8006960: 29 81 00 08 lw r1,(r12+8) 8006964: 59 61 00 08 sw (r11+8),r1 if (the_node->child[RBT_RIGHT]) 8006968: 29 81 00 08 lw r1,(r12+8) 800696c: 44 20 00 02 be r1,r0,8006974 <_RBTree_Extract_unprotected+0xb4><== NEVER TAKEN the_node->child[RBT_RIGHT]->parent = target; 8006970: 58 2b 00 00 sw (r1+0),r11 target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 8006974: 29 81 00 04 lw r1,(r12+4) 8006978: 59 61 00 04 sw (r11+4),r1 if (the_node->child[RBT_LEFT]) 800697c: 29 81 00 04 lw r1,(r12+4) 8006980: 44 20 00 02 be r1,r0,8006988 <_RBTree_Extract_unprotected+0xc8> the_node->child[RBT_LEFT]->parent = target; 8006984: 58 2b 00 00 sw (r1+0),r11 /* 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; 8006988: 29 82 00 00 lw r2,(r12+0) target->color = the_node->color; 800698c: 29 81 00 0c lw r1,(r12+12) /* 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; 8006990: 59 62 00 00 sw (r11+0),r2 target->color = the_node->color; 8006994: 59 61 00 0c sw (r11+12),r1 /* 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 */ 8006998: 44 60 00 0e be r3,r0,80069d0 <_RBTree_Extract_unprotected+0x110> /* 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; 800699c: 29 a1 00 04 lw r1,(r13+4) */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; 80069a0: 59 80 00 08 sw (r12+8),r0 80069a4: 59 80 00 04 sw (r12+4),r0 80069a8: 59 80 00 00 sw (r12+0),r0 80069ac: 44 20 00 02 be r1,r0,80069b4 <_RBTree_Extract_unprotected+0xf4> 80069b0: 58 20 00 0c sw (r1+12),r0 } 80069b4: 2b 9d 00 04 lw ra,(sp+4) 80069b8: 2b 8b 00 14 lw r11,(sp+20) 80069bc: 2b 8c 00 10 lw r12,(sp+16) 80069c0: 2b 8d 00 0c lw r13,(sp+12) 80069c4: 2b 8e 00 08 lw r14,(sp+8) 80069c8: 37 9c 00 14 addi sp,sp,20 80069cc: c3 a0 00 00 ret * 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 */ if (leaf) { 80069d0: 45 c3 ff f3 be r14,r3,800699c <_RBTree_Extract_unprotected+0xdc> leaf->color = RBT_BLACK; /* case 2 */ 80069d4: 59 c0 00 0c sw (r14+12),r0 80069d8: e3 ff ff f1 bi 800699c <_RBTree_Extract_unprotected+0xdc> * 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]) { 80069dc: b9 60 70 00 mv r14,r11 * 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; 80069e0: 29 81 00 00 lw r1,(r12+0) 80069e4: 59 c1 00 00 sw (r14+0),r1 _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 80069e8: 29 82 00 00 lw r2,(r12+0) 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; 80069ec: 29 83 00 0c lw r3,(r12+12) /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 80069f0: 28 41 00 04 lw r1,(r2+4) 80069f4: fc 2c 08 00 cmpne r1,r1,r12 the_node->parent->child[dir] = leaf; 80069f8: b4 21 08 00 add r1,r1,r1 80069fc: b4 21 08 00 add r1,r1,r1 8006a00: b4 41 08 00 add r1,r2,r1 8006a04: 58 2e 00 04 sw (r1+4),r14 /* 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 */ 8006a08: 5c 60 ff e5 bne r3,r0,800699c <_RBTree_Extract_unprotected+0xdc> 8006a0c: e3 ff ff f1 bi 80069d0 <_RBTree_Extract_unprotected+0x110> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); 8006a10: b8 40 08 00 mv r1,r2 8006a14: 34 02 00 01 mvi r2,1 8006a18: f8 00 01 09 calli 8006e3c <_RBTree_Next_unprotected> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 8006a1c: 59 a1 00 08 sw (r13+8),r1 8006a20: e3 ff ff b3 bi 80068ec <_RBTree_Extract_unprotected+0x2c> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); 8006a24: b9 80 08 00 mv r1,r12 8006a28: 34 02 00 00 mvi r2,0 8006a2c: f8 00 01 04 calli 8006e3c <_RBTree_Next_unprotected> /* 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]) { RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 8006a30: 59 a1 00 0c sw (r13+12),r1 8006a34: e3 ff ff b0 bi 80068f4 <_RBTree_Extract_unprotected+0x34> leaf = target->child[RBT_LEFT]; if(leaf) { leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 8006a38: b9 60 08 00 mv r1,r11 8006a3c: fb ff fe e2 calli 80065c4 <_RBTree_Extract_validate_unprotected> 8006a40: e3 ff ff b9 bi 8006924 <_RBTree_Extract_unprotected+0x64> * the_node's location in the tree. This may cause the coloring to be * 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]; 8006a44: 29 8e 00 08 lw r14,(r12+8) if( leaf ) { 8006a48: 5d cb ff e6 bne r14,r11,80069e0 <_RBTree_Extract_unprotected+0x120> leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 8006a4c: b9 80 08 00 mv r1,r12 8006a50: fb ff fe dd calli 80065c4 <_RBTree_Extract_validate_unprotected> 8006a54: e3 ff ff e5 bi 80069e8 <_RBTree_Extract_unprotected+0x128> =============================================================================== 080065c4 <_RBTree_Extract_validate_unprotected>: * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( RBTree_Node *the_node ) { 80065c4: 37 9c ff fc addi sp,sp,-4 80065c8: 5b 8b 00 04 sw (sp+4),r11 RBTree_Node *parent, *sibling; RBTree_Direction dir; parent = the_node->parent; 80065cc: 28 22 00 00 lw r2,(r1+0) if(!parent->parent) return; 80065d0: 28 43 00 00 lw r3,(r2+0) 80065d4: 44 60 00 23 be r3,r0,8006660 <_RBTree_Extract_validate_unprotected+0x9c> { 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]) 80065d8: 28 43 00 04 lw r3,(r2+4) 80065dc: 44 23 00 af be r1,r3,8006898 <_RBTree_Extract_validate_unprotected+0x2d4> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 80065e0: 34 04 00 01 mvi r4,1 80065e4: e0 00 00 1a bi 800664c <_RBTree_Extract_validate_unprotected+0x88> sibling = _RBTree_Sibling(the_node); /* continue to correct tree as long as the_node is black and not the root */ while (!_RBTree_Is_red(the_node) && parent->parent) { 80065e8: 28 45 00 00 lw r5,(r2+0) 80065ec: 44 a0 00 1a be r5,r0,8006654 <_RBTree_Extract_validate_unprotected+0x90> 80065f0: 44 60 00 03 be r3,r0,80065fc <_RBTree_Extract_validate_unprotected+0x38><== NEVER TAKEN 80065f4: 28 66 00 0c lw r6,(r3+12) 80065f8: 44 c4 00 1d be r6,r4,800666c <_RBTree_Extract_validate_unprotected+0xa8> _RBTree_Rotate(parent, dir); sibling = parent->child[_RBTree_Opposite_direction(dir)]; } /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && 80065fc: 28 65 00 08 lw r5,(r3+8) 8006600: 44 a0 00 03 be r5,r0,800660c <_RBTree_Extract_validate_unprotected+0x48> 8006604: 28 a6 00 0c lw r6,(r5+12) 8006608: 44 c4 00 4d be r6,r4,800673c <_RBTree_Extract_validate_unprotected+0x178> !_RBTree_Is_red(sibling->child[RBT_LEFT])) { 800660c: 28 66 00 04 lw r6,(r3+4) 8006610: 44 c0 00 03 be r6,r0,800661c <_RBTree_Extract_validate_unprotected+0x58> 8006614: 28 c6 00 0c lw r6,(r6+12) 8006618: 44 c4 00 49 be r6,r4,800673c <_RBTree_Extract_validate_unprotected+0x178> sibling->color = RBT_RED; 800661c: 58 64 00 0c sw (r3+12),r4 8006620: 28 43 00 0c lw r3,(r2+12) 8006624: 44 64 00 3c be r3,r4,8006714 <_RBTree_Extract_validate_unprotected+0x150> if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; break; } the_node = parent; /* done if parent is red */ parent = the_node->parent; 8006628: 28 45 00 00 lw r5,(r2+0) RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 800662c: 34 03 00 00 mvi r3,0 8006630: 44 a0 00 05 be r5,r0,8006644 <_RBTree_Extract_validate_unprotected+0x80><== NEVER TAKEN if(!(the_node->parent->parent)) return NULL; 8006634: 28 a1 00 00 lw r1,(r5+0) 8006638: 44 20 00 03 be r1,r0,8006644 <_RBTree_Extract_validate_unprotected+0x80> if(the_node == the_node->parent->child[RBT_LEFT]) 800663c: 28 a3 00 04 lw r3,(r5+4) 8006640: 44 43 00 3d be r2,r3,8006734 <_RBTree_Extract_validate_unprotected+0x170> c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; c->parent = the_node->parent; the_node->parent = c; 8006644: b8 40 08 00 mv r1,r2 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 8006648: b8 a0 10 00 mv r2,r5 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 800664c: 28 25 00 0c lw r5,(r1+12) 8006650: 5c a4 ff e6 bne r5,r4,80065e8 <_RBTree_Extract_validate_unprotected+0x24> sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 8006654: 28 22 00 00 lw r2,(r1+0) 8006658: 28 42 00 00 lw r2,(r2+0) 800665c: 44 40 00 32 be r2,r0,8006724 <_RBTree_Extract_validate_unprotected+0x160> } 8006660: 2b 8b 00 04 lw r11,(sp+4) 8006664: 37 9c 00 04 addi sp,sp,4 8006668: c3 a0 00 00 ret * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; 800666c: 28 46 00 04 lw r6,(r2+4) * then rotate parent left, making the sibling be the_node's grandparent. * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; 8006670: 58 44 00 0c sw (r2+12),r4 sibling->color = RBT_BLACK; 8006674: 58 60 00 0c sw (r3+12),r0 dir = the_node != parent->child[0]; 8006678: fc c1 50 00 cmpne r10,r6,r1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 800667c: 34 03 00 00 mvi r3,0 * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 8006680: 19 49 00 01 xori r9,r10,0x1 8006684: b5 29 38 00 add r7,r9,r9 8006688: b4 e7 40 00 add r8,r7,r7 800668c: b4 48 40 00 add r8,r2,r8 8006690: 29 08 00 04 lw r8,(r8+4) 8006694: 45 00 ff da be r8,r0,80065fc <_RBTree_Extract_validate_unprotected+0x38><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006698: 34 08 00 00 mvi r8,0 800669c: 45 20 00 03 be r9,r0,80066a8 <_RBTree_Extract_validate_unprotected+0xe4> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 80066a0: 28 46 00 08 lw r6,(r2+8) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 80066a4: 34 08 00 01 mvi r8,1 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 80066a8: b5 4a 18 00 add r3,r10,r10 80066ac: b4 63 48 00 add r9,r3,r3 80066b0: b4 c9 48 00 add r9,r6,r9 80066b4: b5 08 40 00 add r8,r8,r8 80066b8: 29 2a 00 04 lw r10,(r9+4) 80066bc: b5 08 40 00 add r8,r8,r8 80066c0: b4 48 40 00 add r8,r2,r8 80066c4: 59 0a 00 04 sw (r8+4),r10 if (c->child[dir]) 80066c8: 29 28 00 04 lw r8,(r9+4) 80066cc: 45 00 00 03 be r8,r0,80066d8 <_RBTree_Extract_validate_unprotected+0x114><== NEVER TAKEN c->child[dir]->parent = the_node; 80066d0: 59 02 00 00 sw (r8+0),r2 80066d4: 28 45 00 00 lw r5,(r2+0) c->child[dir] = the_node; 80066d8: b4 63 18 00 add r3,r3,r3 80066dc: b4 c3 18 00 add r3,r6,r3 80066e0: 58 62 00 04 sw (r3+4),r2 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80066e4: 28 a3 00 04 lw r3,(r5+4) c->parent = the_node->parent; 80066e8: 58 c5 00 00 sw (r6+0),r5 the_node->parent = c; 80066ec: b4 e7 38 00 add r7,r7,r7 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80066f0: fc 43 18 00 cmpne r3,r2,r3 c->parent = the_node->parent; the_node->parent = c; 80066f4: b4 47 38 00 add r7,r2,r7 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80066f8: b4 63 18 00 add r3,r3,r3 80066fc: b4 63 18 00 add r3,r3,r3 8006700: b4 a3 28 00 add r5,r5,r3 8006704: 58 a6 00 04 sw (r5+4),r6 c->parent = the_node->parent; the_node->parent = c; 8006708: 28 e3 00 04 lw r3,(r7+4) 800670c: 58 46 00 00 sw (r2+0),r6 8006710: e3 ff ff bb bi 80065fc <_RBTree_Extract_validate_unprotected+0x38> /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && !_RBTree_Is_red(sibling->child[RBT_LEFT])) { sibling->color = RBT_RED; if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; 8006714: 58 40 00 0c sw (r2+12),r0 sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 8006718: 28 22 00 00 lw r2,(r1+0) 800671c: 28 42 00 00 lw r2,(r2+0) 8006720: 5c 40 ff d0 bne r2,r0,8006660 <_RBTree_Extract_validate_unprotected+0x9c><== ALWAYS TAKEN 8006724: 58 20 00 0c sw (r1+12),r0 } 8006728: 2b 8b 00 04 lw r11,(sp+4) 800672c: 37 9c 00 04 addi sp,sp,4 8006730: c3 a0 00 00 ret 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]) return the_node->parent->child[RBT_RIGHT]; 8006734: 28 a3 00 08 lw r3,(r5+8) 8006738: e3 ff ff c3 bi 8006644 <_RBTree_Extract_validate_unprotected+0x80> * cases, either the_node is to the left or the right of the parent. * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; 800673c: 28 47 00 04 lw r7,(r2+4) 8006740: fc e1 38 00 cmpne r7,r7,r1 * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 8006744: 18 e8 00 01 xori r8,r7,0x1 * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { 8006748: b5 08 20 00 add r4,r8,r8 800674c: b4 84 48 00 add r9,r4,r4 8006750: b4 69 30 00 add r6,r3,r9 8006754: 28 c6 00 04 lw r6,(r6+4) */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8006758: 44 c0 00 04 be r6,r0,8006768 <_RBTree_Extract_validate_unprotected+0x1a4> 800675c: 28 cb 00 0c lw r11,(r6+12) 8006760: 34 0a 00 01 mvi r10,1 8006764: 45 6a 00 54 be r11,r10,80068b4 <_RBTree_Extract_validate_unprotected+0x2f0> sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; 8006768: b4 e7 48 00 add r9,r7,r7 * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 800676c: 19 0a 00 01 xori r10,r8,0x1 * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; 8006770: b5 29 48 00 add r9,r9,r9 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 8006774: b5 4a 30 00 add r6,r10,r10 8006778: b4 69 48 00 add r9,r3,r9 800677c: b4 c6 30 00 add r6,r6,r6 8006780: 29 29 00 04 lw r9,(r9+4) 8006784: b4 66 30 00 add r6,r3,r6 * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; 8006788: 34 0b 00 01 mvi r11,1 800678c: 28 c6 00 04 lw r6,(r6+4) 8006790: 58 6b 00 0c sw (r3+12),r11 sibling->child[dir]->color = RBT_BLACK; 8006794: 59 20 00 0c sw (r9+12),r0 8006798: 44 c0 00 1a be r6,r0,8006800 <_RBTree_Extract_validate_unprotected+0x23c><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 800679c: 5d 40 00 41 bne r10,r0,80068a0 <_RBTree_Extract_validate_unprotected+0x2dc> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 80067a0: 28 65 00 04 lw r5,(r3+4) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 80067a4: 34 06 00 00 mvi r6,0 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 80067a8: b4 84 48 00 add r9,r4,r4 80067ac: b4 a9 48 00 add r9,r5,r9 80067b0: b4 c6 30 00 add r6,r6,r6 80067b4: 29 2a 00 04 lw r10,(r9+4) 80067b8: b4 c6 30 00 add r6,r6,r6 80067bc: b4 66 30 00 add r6,r3,r6 80067c0: 58 ca 00 04 sw (r6+4),r10 if (c->child[dir]) 80067c4: 29 26 00 04 lw r6,(r9+4) 80067c8: 44 c0 00 02 be r6,r0,80067d0 <_RBTree_Extract_validate_unprotected+0x20c> c->child[dir]->parent = the_node; 80067cc: 58 c3 00 00 sw (r6+0),r3 c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80067d0: 28 66 00 00 lw r6,(r3+0) the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 80067d4: b4 84 48 00 add r9,r4,r4 80067d8: b4 a9 48 00 add r9,r5,r9 80067dc: 59 23 00 04 sw (r9+4),r3 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80067e0: 28 c9 00 04 lw r9,(r6+4) c->parent = the_node->parent; 80067e4: 58 a6 00 00 sw (r5+0),r6 the_node->parent = c; 80067e8: 58 65 00 00 sw (r3+0),r5 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80067ec: fc 69 18 00 cmpne r3,r3,r9 80067f0: b4 63 18 00 add r3,r3,r3 80067f4: b4 63 18 00 add r3,r3,r3 80067f8: b4 c3 18 00 add r3,r6,r3 80067fc: 58 65 00 04 sw (r3+4),r5 _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; 8006800: b4 84 20 00 add r4,r4,r4 8006804: b4 44 18 00 add r3,r2,r4 8006808: 28 63 00 04 lw r3,(r3+4) 800680c: b4 64 20 00 add r4,r3,r4 8006810: 28 86 00 04 lw r6,(r4+4) 8006814: b8 60 20 00 mv r4,r3 } sibling->color = parent->color; 8006818: 28 45 00 0c lw r5,(r2+12) 800681c: 58 65 00 0c sw (r3+12),r5 parent->color = RBT_BLACK; 8006820: 58 40 00 0c sw (r2+12),r0 sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; 8006824: 58 c0 00 0c sw (r6+12),r0 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 8006828: 44 80 ff 8b be r4,r0,8006654 <_RBTree_Extract_validate_unprotected+0x90><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 800682c: 45 00 00 1f be r8,r0,80068a8 <_RBTree_Extract_validate_unprotected+0x2e4> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 8006830: 28 43 00 08 lw r3,(r2+8) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006834: 34 04 00 01 mvi r4,1 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 8006838: b4 e7 38 00 add r7,r7,r7 800683c: b4 e7 28 00 add r5,r7,r7 8006840: b4 65 28 00 add r5,r3,r5 8006844: b4 84 20 00 add r4,r4,r4 8006848: 28 a6 00 04 lw r6,(r5+4) 800684c: b4 84 20 00 add r4,r4,r4 8006850: b4 44 20 00 add r4,r2,r4 8006854: 58 86 00 04 sw (r4+4),r6 if (c->child[dir]) 8006858: 28 a4 00 04 lw r4,(r5+4) 800685c: 44 80 00 02 be r4,r0,8006864 <_RBTree_Extract_validate_unprotected+0x2a0> c->child[dir]->parent = the_node; 8006860: 58 82 00 00 sw (r4+0),r2 c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006864: 28 44 00 00 lw r4,(r2+0) the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 8006868: b4 e7 38 00 add r7,r7,r7 800686c: b4 67 38 00 add r7,r3,r7 8006870: 58 e2 00 04 sw (r7+4),r2 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006874: 28 85 00 04 lw r5,(r4+4) c->parent = the_node->parent; 8006878: 58 64 00 00 sw (r3+0),r4 the_node->parent = c; 800687c: 58 43 00 00 sw (r2+0),r3 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006880: fc 45 10 00 cmpne r2,r2,r5 8006884: b4 42 10 00 add r2,r2,r2 8006888: b4 42 10 00 add r2,r2,r2 800688c: b4 82 10 00 add r2,r4,r2 8006890: 58 43 00 04 sw (r2+4),r3 8006894: e3 ff ff 70 bi 8006654 <_RBTree_Extract_validate_unprotected+0x90> 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]) return the_node->parent->child[RBT_RIGHT]; 8006898: 28 43 00 08 lw r3,(r2+8) 800689c: e3 ff ff 51 bi 80065e0 <_RBTree_Extract_validate_unprotected+0x1c> */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 80068a0: 34 06 00 01 mvi r6,1 80068a4: e3 ff ff c1 bi 80067a8 <_RBTree_Extract_validate_unprotected+0x1e4> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 80068a8: 28 43 00 04 lw r3,(r2+4) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 80068ac: 34 04 00 00 mvi r4,0 80068b0: e3 ff ff e2 bi 8006838 <_RBTree_Extract_validate_unprotected+0x274> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 80068b4: b4 49 48 00 add r9,r2,r9 80068b8: 29 24 00 04 lw r4,(r9+4) 80068bc: e3 ff ff d7 bi 8006818 <_RBTree_Extract_validate_unprotected+0x254> =============================================================================== 08006ca4 <_RBTree_Find>: RBTree_Node *_RBTree_Find( RBTree_Control *the_rbtree, RBTree_Node *search_node ) { 8006ca4: 37 9c ff e8 addi sp,sp,-24 8006ca8: 5b 8b 00 18 sw (sp+24),r11 8006cac: 5b 8c 00 14 sw (sp+20),r12 8006cb0: 5b 8d 00 10 sw (sp+16),r13 8006cb4: 5b 8e 00 0c sw (sp+12),r14 8006cb8: 5b 8f 00 08 sw (sp+8),r15 8006cbc: 5b 9d 00 04 sw (sp+4),ra 8006cc0: b8 20 60 00 mv r12,r1 8006cc4: b8 40 68 00 mv r13,r2 ISR_Level level; RBTree_Node *return_node; return_node = NULL; _ISR_Disable( level ); 8006cc8: 90 00 78 00 rcsr r15,IE 8006ccc: 34 01 ff fe mvi r1,-2 8006cd0: a1 e1 08 00 and r1,r15,r1 8006cd4: d0 01 00 00 wcsr IE,r1 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; 8006cd8: 29 8b 00 04 lw r11,(r12+4) RBTree_Node* found = NULL; 8006cdc: 34 0e 00 00 mvi r14,0 int compare_result; while (iter_node) { 8006ce0: 45 60 00 0f be r11,r0,8006d1c <_RBTree_Find+0x78> <== NEVER TAKEN compare_result = the_rbtree->compare_function(the_node, iter_node); 8006ce4: 29 83 00 10 lw r3,(r12+16) 8006ce8: b9 60 10 00 mv r2,r11 8006cec: b9 a0 08 00 mv r1,r13 8006cf0: d8 60 00 00 call r3 found = iter_node; if ( the_rbtree->is_unique ) break; } RBTree_Direction dir = 8006cf4: 68 23 00 00 cmpgi r3,r1,0 RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( _RBTree_Is_equal( compare_result ) ) { 8006cf8: 5c 20 00 04 bne r1,r0,8006d08 <_RBTree_Find+0x64> found = iter_node; if ( the_rbtree->is_unique ) 8006cfc: 41 82 00 14 lbu r2,(r12+20) 8006d00: b9 60 70 00 mv r14,r11 8006d04: 5c 41 00 10 bne r2,r1,8006d44 <_RBTree_Find+0xa0> break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 8006d08: b4 63 18 00 add r3,r3,r3 8006d0c: b4 63 18 00 add r3,r3,r3 8006d10: b5 63 58 00 add r11,r11,r3 8006d14: 29 6b 00 04 lw r11,(r11+4) ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { 8006d18: 5d 60 ff f3 bne r11,r0,8006ce4 <_RBTree_Find+0x40> return_node = _RBTree_Find_unprotected( the_rbtree, search_node ); _ISR_Enable( level ); 8006d1c: d0 0f 00 00 wcsr IE,r15 return return_node; } 8006d20: b9 c0 08 00 mv r1,r14 8006d24: 2b 9d 00 04 lw ra,(sp+4) 8006d28: 2b 8b 00 18 lw r11,(sp+24) 8006d2c: 2b 8c 00 14 lw r12,(sp+20) 8006d30: 2b 8d 00 10 lw r13,(sp+16) 8006d34: 2b 8e 00 0c lw r14,(sp+12) 8006d38: 2b 8f 00 08 lw r15,(sp+8) 8006d3c: 37 9c 00 18 addi sp,sp,24 8006d40: c3 a0 00 00 ret compare_result = the_rbtree->compare_function(the_node, iter_node); if ( _RBTree_Is_equal( compare_result ) ) { found = iter_node; if ( the_rbtree->is_unique ) 8006d44: b9 60 70 00 mv r14,r11 8006d48: e3 ff ff f5 bi 8006d1c <_RBTree_Find+0x78> =============================================================================== 08007188 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 8007188: 37 9c ff ec addi sp,sp,-20 800718c: 5b 8b 00 14 sw (sp+20),r11 8007190: 5b 8c 00 10 sw (sp+16),r12 8007194: 5b 8d 00 0c sw (sp+12),r13 8007198: 5b 8e 00 08 sw (sp+8),r14 800719c: 5b 9d 00 04 sw (sp+4),ra 80071a0: b8 20 68 00 mv r13,r1 80071a4: b8 80 58 00 mv r11,r4 80071a8: b8 a0 70 00 mv r14,r5 80071ac: 20 c6 00 ff andi r6,r6,0xff size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 80071b0: 44 20 00 0f be r1,r0,80071ec <_RBTree_Initialize+0x64> <== NEVER TAKEN RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 80071b4: 58 20 00 00 sw (r1+0),r0 the_rbtree->root = NULL; 80071b8: 58 20 00 04 sw (r1+4),r0 the_rbtree->first[0] = NULL; 80071bc: 58 20 00 08 sw (r1+8),r0 the_rbtree->first[1] = NULL; 80071c0: 58 20 00 0c sw (r1+12),r0 the_rbtree->compare_function = compare_function; 80071c4: 58 22 00 10 sw (r1+16),r2 the_rbtree->is_unique = is_unique; 80071c8: 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; while ( count-- ) { 80071cc: 44 80 00 08 be r4,r0,80071ec <_RBTree_Initialize+0x64> <== NEVER TAKEN /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; 80071d0: b8 60 60 00 mv r12,r3 while ( count-- ) { _RBTree_Insert_unprotected(the_rbtree, next); 80071d4: b9 80 10 00 mv r2,r12 80071d8: b9 a0 08 00 mv r1,r13 #include #include #include #include void _RBTree_Initialize( 80071dc: 35 6b ff ff addi r11,r11,-1 _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { _RBTree_Insert_unprotected(the_rbtree, next); 80071e0: fb ff fe f1 calli 8006da4 <_RBTree_Insert_unprotected> #include #include #include #include void _RBTree_Initialize( 80071e4: b5 8e 60 00 add r12,r12,r14 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 80071e8: 5d 60 ff fb bne r11,r0,80071d4 <_RBTree_Initialize+0x4c> _RBTree_Insert_unprotected(the_rbtree, next); next = (RBTree_Node *) _Addresses_Add_offset( (void *) next, node_size ); } } 80071ec: 2b 9d 00 04 lw ra,(sp+4) 80071f0: 2b 8b 00 14 lw r11,(sp+20) 80071f4: 2b 8c 00 10 lw r12,(sp+16) 80071f8: 2b 8d 00 0c lw r13,(sp+12) 80071fc: 2b 8e 00 08 lw r14,(sp+8) 8007200: 37 9c 00 14 addi sp,sp,20 8007204: c3 a0 00 00 ret =============================================================================== 08006a8c <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 8006a8c: 37 9c ff e4 addi sp,sp,-28 8006a90: 5b 8b 00 1c sw (sp+28),r11 8006a94: 5b 8c 00 18 sw (sp+24),r12 8006a98: 5b 8d 00 14 sw (sp+20),r13 8006a9c: 5b 8e 00 10 sw (sp+16),r14 8006aa0: 5b 8f 00 0c sw (sp+12),r15 8006aa4: 5b 90 00 08 sw (sp+8),r16 8006aa8: 5b 9d 00 04 sw (sp+4),ra if(!the_node) return (RBTree_Node*)-1; 8006aac: 34 0d ff ff mvi r13,-1 */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 8006ab0: b8 40 58 00 mv r11,r2 8006ab4: b8 20 60 00 mv r12,r1 if(!the_node) return (RBTree_Node*)-1; 8006ab8: 44 40 00 87 be r2,r0,8006cd4 <_RBTree_Insert_unprotected+0x248> RBTree_Node *iter_node = the_rbtree->root; 8006abc: 28 2f 00 04 lw r15,(r1+4) int compare_result; if (!iter_node) { /* special case: first node inserted */ 8006ac0: 5d e0 00 03 bne r15,r0,8006acc <_RBTree_Insert_unprotected+0x40> 8006ac4: e0 00 00 a3 bi 8006d50 <_RBTree_Insert_unprotected+0x2c4> 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]) { 8006ac8: 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); 8006acc: 29 83 00 10 lw r3,(r12+16) 8006ad0: b9 e0 10 00 mv r2,r15 8006ad4: b9 60 08 00 mv r1,r11 8006ad8: d8 60 00 00 call r3 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 8006adc: 41 82 00 14 lbu r2,(r12+20) 8006ae0: 44 40 00 02 be r2,r0,8006ae8 <_RBTree_Insert_unprotected+0x5c> 8006ae4: 44 20 00 99 be r1,r0,8006d48 <_RBTree_Insert_unprotected+0x2bc><== NEVER TAKEN return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 8006ae8: a4 20 08 00 not r1,r1 8006aec: 34 02 00 1f mvi r2,31 8006af0: fb ff e8 96 calli 8000d48 <__lshrsi3> if (!iter_node->child[dir]) { 8006af4: b4 21 18 00 add r3,r1,r1 8006af8: b4 63 18 00 add r3,r3,r3 8006afc: b5 e3 18 00 add r3,r15,r3 8006b00: 28 6d 00 04 lw r13,(r3+4) /* 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 ); 8006b04: b8 20 70 00 mv r14,r1 if (!iter_node->child[dir]) { 8006b08: 34 63 00 04 addi r3,r3,4 8006b0c: 5d a0 ff ef bne r13,r0,8006ac8 <_RBTree_Insert_unprotected+0x3c> RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 8006b10: 34 30 00 02 addi r16,r1,2 8006b14: b6 10 08 00 add r1,r16,r16 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 8006b18: 59 60 00 08 sw (r11+8),r0 8006b1c: 59 60 00 04 sw (r11+4),r0 8006b20: b4 21 08 00 add r1,r1,r1 the_node->color = RBT_RED; iter_node->child[dir] = the_node; 8006b24: 58 6b 00 00 sw (r3+0),r11 8006b28: b5 81 08 00 add r1,r12,r1 the_node->parent = iter_node; 8006b2c: 59 6f 00 00 sw (r11+0),r15 /* update min/max */ compare_result = the_rbtree->compare_function( 8006b30: 28 22 00 00 lw r2,(r1+0) 8006b34: 29 84 00 10 lw r4,(r12+16) 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]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; 8006b38: 34 03 00 01 mvi r3,1 8006b3c: 59 63 00 0c sw (r11+12),r3 iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ compare_result = the_rbtree->compare_function( 8006b40: b9 60 08 00 mv r1,r11 8006b44: d8 80 00 00 call r4 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 8006b48: 5d cd 00 6f bne r14,r13,8006d04 <_RBTree_Insert_unprotected+0x278> 8006b4c: 49 a1 00 6f bg r13,r1,8006d08 <_RBTree_Insert_unprotected+0x27c> (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; 8006b50: 29 63 00 00 lw r3,(r11+0) */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8006b54: 34 06 00 01 mvi r6,1 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 8006b58: 28 62 00 00 lw r2,(r3+0) 8006b5c: b8 40 08 00 mv r1,r2 8006b60: 44 40 00 5c be r2,r0,8006cd0 <_RBTree_Insert_unprotected+0x244> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8006b64: 28 64 00 0c lw r4,(r3+12) 8006b68: 5c 86 00 5b bne r4,r6,8006cd4 <_RBTree_Insert_unprotected+0x248> ) { 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; 8006b6c: 28 47 00 00 lw r7,(r2+0) 8006b70: 44 e0 00 74 be r7,r0,8006d40 <_RBTree_Insert_unprotected+0x2b4><== 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]) 8006b74: 28 44 00 04 lw r4,(r2+4) 8006b78: b8 80 28 00 mv r5,r4 8006b7c: 44 64 00 60 be r3,r4,8006cfc <_RBTree_Insert_unprotected+0x270> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8006b80: 44 a0 00 03 be r5,r0,8006b8c <_RBTree_Insert_unprotected+0x100> 8006b84: 28 a8 00 0c lw r8,(r5+12) 8006b88: 45 06 00 65 be r8,r6,8006d1c <_RBTree_Insert_unprotected+0x290> 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]; 8006b8c: 28 65 00 04 lw r5,(r3+4) RBTree_Direction pdir = the_node->parent != g->child[0]; 8006b90: fc 64 20 00 cmpne r4,r3,r4 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]; 8006b94: fd 65 38 00 cmpne r7,r11,r5 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 8006b98: 44 e4 00 27 be r7,r4,8006c34 <_RBTree_Insert_unprotected+0x1a8> * in an unique @a the_rbtree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ RBTree_Node *_RBTree_Insert_unprotected( 8006b9c: 18 89 00 01 xori r9,r4,0x1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 8006ba0: b5 29 38 00 add r7,r9,r9 8006ba4: b4 e7 38 00 add r7,r7,r7 8006ba8: b4 67 38 00 add r7,r3,r7 8006bac: 28 e8 00 04 lw r8,(r7+4) 8006bb0: b4 84 38 00 add r7,r4,r4 8006bb4: 45 00 00 1c be r8,r0,8006c24 <_RBTree_Insert_unprotected+0x198><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006bb8: 34 08 00 00 mvi r8,0 8006bbc: 45 20 00 03 be r9,r0,8006bc8 <_RBTree_Insert_unprotected+0x13c> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 8006bc0: 28 65 00 08 lw r5,(r3+8) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006bc4: 34 08 00 01 mvi r8,1 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 8006bc8: b4 84 38 00 add r7,r4,r4 8006bcc: b4 e7 48 00 add r9,r7,r7 8006bd0: b4 a9 48 00 add r9,r5,r9 8006bd4: b5 08 40 00 add r8,r8,r8 8006bd8: 29 2a 00 04 lw r10,(r9+4) 8006bdc: b5 08 40 00 add r8,r8,r8 8006be0: b4 68 40 00 add r8,r3,r8 8006be4: 59 0a 00 04 sw (r8+4),r10 if (c->child[dir]) 8006be8: 29 28 00 04 lw r8,(r9+4) 8006bec: 45 00 00 03 be r8,r0,8006bf8 <_RBTree_Insert_unprotected+0x16c> c->child[dir]->parent = the_node; 8006bf0: 59 03 00 00 sw (r8+0),r3 8006bf4: 28 62 00 00 lw r2,(r3+0) c->child[dir] = the_node; 8006bf8: b4 e7 40 00 add r8,r7,r7 8006bfc: b4 a8 40 00 add r8,r5,r8 8006c00: 59 03 00 04 sw (r8+4),r3 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006c04: 28 48 00 04 lw r8,(r2+4) c->parent = the_node->parent; 8006c08: 58 a2 00 00 sw (r5+0),r2 the_node->parent = c; 8006c0c: 58 65 00 00 sw (r3+0),r5 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006c10: fc 68 18 00 cmpne r3,r3,r8 8006c14: b4 63 18 00 add r3,r3,r3 8006c18: b4 63 18 00 add r3,r3,r3 8006c1c: b4 43 10 00 add r2,r2,r3 8006c20: 58 45 00 04 sw (r2+4),r5 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); the_node = the_node->child[pdir]; 8006c24: b4 e7 38 00 add r7,r7,r7 8006c28: b5 67 58 00 add r11,r11,r7 8006c2c: 29 6b 00 04 lw r11,(r11+4) 8006c30: 29 63 00 00 lw r3,(r11+0) } the_node->parent->color = RBT_BLACK; g->color = RBT_RED; /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 8006c34: c8 c4 20 00 sub r4,r6,r4 * in an unique @a the_rbtree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ RBTree_Node *_RBTree_Insert_unprotected( 8006c38: 64 85 00 00 cmpei r5,r4,0 /* 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; 8006c3c: 58 60 00 0c sw (r3+12),r0 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 8006c40: b4 a5 10 00 add r2,r5,r5 8006c44: b4 42 10 00 add r2,r2,r2 8006c48: b4 22 10 00 add r2,r1,r2 8006c4c: 28 42 00 04 lw r2,(r2+4) g->color = RBT_RED; 8006c50: 58 26 00 0c sw (r1+12),r6 8006c54: 44 40 ff c1 be r2,r0,8006b58 <_RBTree_Insert_unprotected+0xcc><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006c58: 44 a0 00 37 be r5,r0,8006d34 <_RBTree_Insert_unprotected+0x2a8> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 8006c5c: 28 22 00 08 lw r2,(r1+8) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006c60: 34 03 00 01 mvi r3,1 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 8006c64: b4 84 20 00 add r4,r4,r4 8006c68: b4 84 28 00 add r5,r4,r4 8006c6c: b4 45 28 00 add r5,r2,r5 8006c70: b4 63 18 00 add r3,r3,r3 8006c74: 28 a7 00 04 lw r7,(r5+4) 8006c78: b4 63 18 00 add r3,r3,r3 8006c7c: b4 23 18 00 add r3,r1,r3 8006c80: 58 67 00 04 sw (r3+4),r7 if (c->child[dir]) 8006c84: 28 a3 00 04 lw r3,(r5+4) 8006c88: 44 60 00 02 be r3,r0,8006c90 <_RBTree_Insert_unprotected+0x204> c->child[dir]->parent = the_node; 8006c8c: 58 61 00 00 sw (r3+0),r1 c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006c90: 28 25 00 00 lw r5,(r1+0) the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 8006c94: b4 84 20 00 add r4,r4,r4 8006c98: b4 44 20 00 add r4,r2,r4 8006c9c: 58 81 00 04 sw (r4+4),r1 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006ca0: 28 a3 00 04 lw r3,(r5+4) c->parent = the_node->parent; 8006ca4: 58 45 00 00 sw (r2+0),r5 the_node->parent = c; 8006ca8: 58 22 00 00 sw (r1+0),r2 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006cac: fc 23 08 00 cmpne r1,r1,r3 c->parent = the_node->parent; the_node->parent = c; 8006cb0: 29 63 00 00 lw r3,(r11+0) if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006cb4: b4 21 08 00 add r1,r1,r1 8006cb8: b4 21 08 00 add r1,r1,r1 8006cbc: b4 a1 08 00 add r1,r5,r1 8006cc0: 58 22 00 04 sw (r1+4),r2 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 8006cc4: 28 62 00 00 lw r2,(r3+0) 8006cc8: b8 40 08 00 mv r1,r2 8006ccc: 5c 40 ff a6 bne r2,r0,8006b64 <_RBTree_Insert_unprotected+0xd8><== ALWAYS TAKEN /* 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; 8006cd0: 59 60 00 0c sw (r11+12),r0 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 8006cd4: b9 a0 08 00 mv r1,r13 8006cd8: 2b 9d 00 04 lw ra,(sp+4) 8006cdc: 2b 8b 00 1c lw r11,(sp+28) 8006ce0: 2b 8c 00 18 lw r12,(sp+24) 8006ce4: 2b 8d 00 14 lw r13,(sp+20) 8006ce8: 2b 8e 00 10 lw r14,(sp+16) 8006cec: 2b 8f 00 0c lw r15,(sp+12) 8006cf0: 2b 90 00 08 lw r16,(sp+8) 8006cf4: 37 9c 00 1c addi sp,sp,28 8006cf8: c3 a0 00 00 ret 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]) return the_node->parent->child[RBT_RIGHT]; 8006cfc: 28 45 00 08 lw r5,(r2+8) 8006d00: e3 ff ff a0 bi 8006b80 <_RBTree_Insert_unprotected+0xf4> compare_result = the_rbtree->compare_function( the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || (dir && _RBTree_Is_greater(compare_result)) ) { 8006d04: 4c 01 ff 93 bge r0,r1,8006b50 <_RBTree_Insert_unprotected+0xc4> the_rbtree->first[dir] = the_node; 8006d08: b6 10 80 00 add r16,r16,r16 8006d0c: b6 10 80 00 add r16,r16,r16 8006d10: b5 90 60 00 add r12,r12,r16 8006d14: 59 8b 00 00 sw (r12+0),r11 8006d18: e3 ff ff 8e bi 8006b50 <_RBTree_Insert_unprotected+0xc4> 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; 8006d1c: 58 60 00 0c sw (r3+12),r0 u->color = RBT_BLACK; 8006d20: 58 a0 00 0c sw (r5+12),r0 g->color = RBT_RED; 8006d24: 58 46 00 0c sw (r2+12),r6 8006d28: b8 e0 18 00 mv r3,r7 8006d2c: b8 40 58 00 mv r11,r2 8006d30: e3 ff ff 8a bi 8006b58 <_RBTree_Insert_unprotected+0xcc> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 8006d34: 28 22 00 04 lw r2,(r1+4) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006d38: 34 03 00 00 mvi r3,0 8006d3c: e3 ff ff ca bi 8006c64 <_RBTree_Insert_unprotected+0x1d8> /* 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; 8006d40: 28 44 00 04 lw r4,(r2+4) <== NOT EXECUTED 8006d44: e3 ff ff 92 bi 8006b8c <_RBTree_Insert_unprotected+0x100> <== NOT EXECUTED 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); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 8006d48: b9 e0 68 00 mv r13,r15 8006d4c: e3 ff ff e2 bi 8006cd4 <_RBTree_Insert_unprotected+0x248> RBTree_Node *iter_node = the_rbtree->root; int compare_result; if (!iter_node) { /* special case: first node inserted */ the_node->color = RBT_BLACK; 8006d50: 58 40 00 0c sw (r2+12),r0 the_rbtree->root = the_node; 8006d54: 59 82 00 04 sw (r12+4),r2 the_rbtree->first[0] = the_rbtree->first[1] = the_node; 8006d58: 59 82 00 0c sw (r12+12),r2 8006d5c: 59 82 00 08 sw (r12+8),r2 the_node->parent = (RBTree_Node *) the_rbtree; 8006d60: 59 61 00 00 sw (r11+0),r1 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 8006d64: 58 40 00 08 sw (r2+8),r0 8006d68: 58 40 00 04 sw (r2+4),r0 } /* while(iter_node) */ /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; 8006d6c: 34 0d 00 00 mvi r13,0 8006d70: e3 ff ff d9 bi 8006cd4 <_RBTree_Insert_unprotected+0x248> =============================================================================== 08006da8 <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 8006da8: 37 9c ff e8 addi sp,sp,-24 8006dac: 5b 8b 00 18 sw (sp+24),r11 8006db0: 5b 8c 00 14 sw (sp+20),r12 8006db4: 5b 8d 00 10 sw (sp+16),r13 8006db8: 5b 8e 00 0c sw (sp+12),r14 8006dbc: 5b 8f 00 08 sw (sp+8),r15 8006dc0: 5b 9d 00 04 sw (sp+4),ra 8006dc4: b8 40 60 00 mv r12,r2 8006dc8: 64 42 00 00 cmpei r2,r2,0 8006dcc: b8 60 78 00 mv r15,r3 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 8006dd0: 34 42 00 02 addi r2,r2,2 8006dd4: b4 42 10 00 add r2,r2,r2 8006dd8: b4 42 10 00 add r2,r2,r2 8006ddc: b4 22 08 00 add r1,r1,r2 8006de0: 28 2b 00 00 lw r11,(r1+0) 8006de4: b8 80 70 00 mv r14,r4 RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 8006de8: 5d 60 00 03 bne r11,r0,8006df4 <_RBTree_Iterate_unprotected+0x4c><== ALWAYS TAKEN 8006dec: e0 00 00 0c bi 8006e1c <_RBTree_Iterate_unprotected+0x74> <== NOT EXECUTED 8006df0: 44 2d 00 0b be r1,r13,8006e1c <_RBTree_Iterate_unprotected+0x74> stop = (*visitor)( current, dir, visitor_arg ); 8006df4: b9 60 08 00 mv r1,r11 8006df8: b9 c0 18 00 mv r3,r14 8006dfc: b9 80 10 00 mv r2,r12 8006e00: d9 e0 00 00 call r15 8006e04: b8 20 68 00 mv r13,r1 current = _RBTree_Next_unprotected( current, dir ); 8006e08: b9 80 10 00 mv r2,r12 8006e0c: b9 60 08 00 mv r1,r11 8006e10: f8 00 00 0b calli 8006e3c <_RBTree_Next_unprotected> 8006e14: 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 ) { 8006e18: 45 a0 ff f6 be r13,r0,8006df0 <_RBTree_Iterate_unprotected+0x48><== ALWAYS TAKEN stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); } } 8006e1c: 2b 9d 00 04 lw ra,(sp+4) 8006e20: 2b 8b 00 18 lw r11,(sp+24) 8006e24: 2b 8c 00 14 lw r12,(sp+20) 8006e28: 2b 8d 00 10 lw r13,(sp+16) 8006e2c: 2b 8e 00 0c lw r14,(sp+12) 8006e30: 2b 8f 00 08 lw r15,(sp+8) 8006e34: 37 9c 00 18 addi sp,sp,24 8006e38: c3 a0 00 00 ret =============================================================================== 08004e40 <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 8004e40: 37 9c ff f0 addi sp,sp,-16 8004e44: 5b 8b 00 0c sw (sp+12),r11 8004e48: 5b 8c 00 08 sw (sp+8),r12 8004e4c: 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 ]; 8004e50: 28 2b 01 14 lw r11,(r1+276) if ( !api ) 8004e54: 45 60 00 1a be r11,r0,8004ebc <_RTEMS_signal_Post_switch_hook+0x7c><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 8004e58: 90 00 10 00 rcsr r2,IE 8004e5c: 34 01 ff fe mvi r1,-2 8004e60: a0 41 08 00 and r1,r2,r1 8004e64: d0 01 00 00 wcsr IE,r1 signal_set = asr->signals_posted; 8004e68: 29 6c 00 14 lw r12,(r11+20) asr->signals_posted = 0; 8004e6c: 59 60 00 14 sw (r11+20),r0 _ISR_Enable( level ); 8004e70: d0 02 00 00 wcsr IE,r2 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 8004e74: 45 80 00 12 be r12,r0,8004ebc <_RTEMS_signal_Post_switch_hook+0x7c> return; asr->nest_level += 1; 8004e78: 29 64 00 1c lw r4,(r11+28) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004e7c: 29 61 00 10 lw r1,(r11+16) 8004e80: 37 83 00 10 addi r3,sp,16 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 8004e84: 34 84 00 01 addi r4,r4,1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004e88: 38 02 ff ff mvu r2,0xffff if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 8004e8c: 59 64 00 1c sw (r11+28),r4 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004e90: f8 00 01 3d calli 8005384 (*asr->handler)( signal_set ); 8004e94: 29 62 00 0c lw r2,(r11+12) 8004e98: b9 80 08 00 mv r1,r12 8004e9c: d8 40 00 00 call r2 asr->nest_level -= 1; 8004ea0: 29 63 00 1c lw r3,(r11+28) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004ea4: 2b 81 00 10 lw r1,(sp+16) 8004ea8: 38 02 ff ff mvu r2,0xffff asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; 8004eac: 34 63 ff ff addi r3,r3,-1 8004eb0: 59 63 00 1c sw (r11+28),r3 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004eb4: 37 83 00 10 addi r3,sp,16 8004eb8: f8 00 01 33 calli 8005384 } 8004ebc: 2b 9d 00 04 lw ra,(sp+4) 8004ec0: 2b 8b 00 0c lw r11,(sp+12) 8004ec4: 2b 8c 00 08 lw r12,(sp+8) 8004ec8: 37 9c 00 10 addi sp,sp,16 8004ecc: c3 a0 00 00 ret =============================================================================== 08004184 <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 8004184: 37 9c ff e8 addi sp,sp,-24 8004188: 5b 8b 00 14 sw (sp+20),r11 800418c: 5b 8c 00 10 sw (sp+16),r12 8004190: 5b 8d 00 0c sw (sp+12),r13 8004194: 5b 8e 00 08 sw (sp+8),r14 8004198: 5b 9d 00 04 sw (sp+4),ra rtems_initialization_tasks_table *user_tasks; /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; 800419c: 78 01 08 01 mvhi r1,0x801 80041a0: 38 21 e0 a4 ori r1,r1,0xe0a4 80041a4: 28 2b 00 2c lw r11,(r1+44) maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 80041a8: 28 2e 00 28 lw r14,(r1+40) /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 80041ac: 45 60 00 15 be r11,r0,8004200 <_RTEMS_tasks_Initialize_user_tasks_body+0x7c> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 80041b0: 45 c0 00 14 be r14,r0,8004200 <_RTEMS_tasks_Initialize_user_tasks_body+0x7c><== NEVER TAKEN 80041b4: 34 0c 00 00 mvi r12,0 return_value = rtems_task_create( 80041b8: 29 61 00 00 lw r1,(r11+0) 80041bc: 29 62 00 08 lw r2,(r11+8) 80041c0: 29 63 00 04 lw r3,(r11+4) 80041c4: 29 64 00 14 lw r4,(r11+20) 80041c8: 29 65 00 0c lw r5,(r11+12) 80041cc: 37 86 00 18 addi r6,sp,24 80041d0: fb ff ff 52 calli 8003f18 80041d4: b8 20 68 00 mv r13,r1 user_tasks[ index ].stack_size, user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) 80041d8: 5c 20 00 11 bne r1,r0,800421c <_RTEMS_tasks_Initialize_user_tasks_body+0x98> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 80041dc: 29 63 00 18 lw r3,(r11+24) 80041e0: 2b 81 00 18 lw r1,(sp+24) 80041e4: 29 62 00 10 lw r2,(r11+16) 80041e8: f8 00 00 14 calli 8004238 80041ec: b8 20 18 00 mv r3,r1 id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 80041f0: 5c 2d 00 0f bne r1,r13,800422c <_RTEMS_tasks_Initialize_user_tasks_body+0xa8> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 80041f4: 35 8c 00 01 addi r12,r12,1 80041f8: 35 6b 00 1c addi r11,r11,28 80041fc: 55 cc ff ef bgu r14,r12,80041b8 <_RTEMS_tasks_Initialize_user_tasks_body+0x34><== NEVER TAKEN user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); } } 8004200: 2b 9d 00 04 lw ra,(sp+4) 8004204: 2b 8b 00 14 lw r11,(sp+20) 8004208: 2b 8c 00 10 lw r12,(sp+16) 800420c: 2b 8d 00 0c lw r13,(sp+12) 8004210: 2b 8e 00 08 lw r14,(sp+8) 8004214: 37 9c 00 18 addi sp,sp,24 8004218: c3 a0 00 00 ret user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 800421c: 34 01 00 01 mvi r1,1 8004220: 34 02 00 01 mvi r2,1 8004224: b9 a0 18 00 mv r3,r13 8004228: f8 00 04 87 calli 8005444 <_Internal_error_Occurred> id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 800422c: 34 01 00 01 mvi r1,1 8004230: 34 02 00 01 mvi r2,1 8004234: f8 00 04 84 calli 8005444 <_Internal_error_Occurred> =============================================================================== 08009b98 <_RTEMS_tasks_Switch_extension>: /* * Per Task Variables */ tvp = executing->task_variables; 8009b98: 28 21 01 20 lw r1,(r1+288) while (tvp) { 8009b9c: 44 20 00 08 be r1,r0,8009bbc <_RTEMS_tasks_Switch_extension+0x24> tvp->tval = *tvp->ptr; 8009ba0: 28 23 00 04 lw r3,(r1+4) *tvp->ptr = tvp->gval; 8009ba4: 28 24 00 08 lw r4,(r1+8) * Per Task Variables */ tvp = executing->task_variables; while (tvp) { tvp->tval = *tvp->ptr; 8009ba8: 28 65 00 00 lw r5,(r3+0) 8009bac: 58 25 00 0c sw (r1+12),r5 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; 8009bb0: 28 21 00 00 lw r1,(r1+0) */ tvp = executing->task_variables; while (tvp) { tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; 8009bb4: 58 64 00 00 sw (r3+0),r4 /* * Per Task Variables */ tvp = executing->task_variables; while (tvp) { 8009bb8: 5c 20 ff fa bne r1,r0,8009ba0 <_RTEMS_tasks_Switch_extension+0x8><== NEVER TAKEN tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; 8009bbc: 28 41 01 20 lw r1,(r2+288) while (tvp) { 8009bc0: 44 20 00 08 be r1,r0,8009be0 <_RTEMS_tasks_Switch_extension+0x48> tvp->gval = *tvp->ptr; 8009bc4: 28 22 00 04 lw r2,(r1+4) *tvp->ptr = tvp->tval; 8009bc8: 28 23 00 0c lw r3,(r1+12) tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { tvp->gval = *tvp->ptr; 8009bcc: 28 44 00 00 lw r4,(r2+0) 8009bd0: 58 24 00 08 sw (r1+8),r4 *tvp->ptr = tvp->tval; tvp = (rtems_task_variable_t *)tvp->next; 8009bd4: 28 21 00 00 lw r1,(r1+0) } tvp = heir->task_variables; while (tvp) { tvp->gval = *tvp->ptr; *tvp->ptr = tvp->tval; 8009bd8: 58 43 00 00 sw (r2+0),r3 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { 8009bdc: 5c 20 ff fa bne r1,r0,8009bc4 <_RTEMS_tasks_Switch_extension+0x2c><== NEVER TAKEN 8009be0: c3 a0 00 00 ret =============================================================================== 0803746c <_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 ) { 803746c: 37 9c ff e4 addi sp,sp,-28 8037470: 5b 8b 00 14 sw (sp+20),r11 8037474: 5b 8c 00 10 sw (sp+16),r12 8037478: 5b 8d 00 0c sw (sp+12),r13 803747c: 5b 8e 00 08 sw (sp+8),r14 8037480: 5b 9d 00 04 sw (sp+4),ra 8037484: b8 40 68 00 mv r13,r2 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 8037488: 78 02 08 06 mvhi r2,0x806 803748c: b8 20 58 00 mv r11,r1 8037490: 38 42 df 48 ori r2,r2,0xdf48 8037494: 37 81 00 18 addi r1,sp,24 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 8037498: 29 6c 00 40 lw r12,(r11+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 ) { 803749c: b8 60 70 00 mv r14,r3 80374a0: fb ff 34 13 calli 80044ec <_TOD_Get_with_nanoseconds> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80374a4: 2b 85 00 1c lw r5,(sp+28) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 80374a8: 29 61 00 54 lw r1,(r11+84) 80374ac: 29 66 00 50 lw r6,(r11+80) 80374b0: 2b 82 00 18 lw r2,(sp+24) 80374b4: c8 a1 08 00 sub r1,r5,r1 * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 80374b8: 78 04 08 06 mvhi r4,0x806 80374bc: f4 25 38 00 cmpgu r7,r1,r5 80374c0: 38 84 e1 40 ori r4,r4,0xe140 80374c4: 28 88 00 10 lw r8,(r4+16) 80374c8: c8 46 30 00 sub r6,r2,r6 80374cc: c8 c7 30 00 sub r6,r6,r7 80374d0: 59 a1 00 04 sw (r13+4),r1 80374d4: 59 a6 00 00 sw (r13+0),r6 #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 80374d8: 29 83 00 80 lw r3,(r12+128) 80374dc: 29 86 00 84 lw r6,(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; 80374e0: 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) { 80374e4: 45 0c 00 08 be r8,r12,8037504 <_Rate_monotonic_Get_status+0x98> return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 80374e8: 2b 9d 00 04 lw ra,(sp+4) 80374ec: 2b 8b 00 14 lw r11,(sp+20) 80374f0: 2b 8c 00 10 lw r12,(sp+16) 80374f4: 2b 8d 00 0c lw r13,(sp+12) 80374f8: 2b 8e 00 08 lw r14,(sp+8) 80374fc: 37 9c 00 1c addi sp,sp,28 8037500: c3 a0 00 00 ret static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8037504: 28 81 00 24 lw r1,(r4+36) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8037508: b4 c5 28 00 add r5,r6,r5 803750c: f4 c5 30 00 cmpgu r6,r6,r5 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8037510: 28 87 00 20 lw r7,(r4+32) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8037514: b4 62 10 00 add r2,r3,r2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8037518: c8 a1 08 00 sub r1,r5,r1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 803751c: b4 c2 10 00 add r2,r6,r2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8037520: f4 25 28 00 cmpgu r5,r1,r5 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8037524: 29 64 00 48 lw r4,(r11+72) 8037528: c8 47 10 00 sub r2,r2,r7 803752c: c8 45 28 00 sub r5,r2,r5 8037530: 29 62 00 4c lw r2,(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)) 8037534: 48 85 00 10 bg r4,r5,8037574 <_Rate_monotonic_Get_status+0x108><== NEVER TAKEN 8037538: 44 85 00 11 be r4,r5,803757c <_Rate_monotonic_Get_status+0x110> const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 803753c: c8 22 10 00 sub r2,r1,r2 8037540: f4 41 08 00 cmpgu r1,r2,r1 8037544: c8 a4 20 00 sub r4,r5,r4 8037548: c8 81 08 00 sub r1,r4,r1 803754c: 59 c1 00 00 sw (r14+0),r1 if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 8037550: 34 01 00 01 mvi r1,1 8037554: 59 c2 00 04 sw (r14+4),r2 } 8037558: 2b 9d 00 04 lw ra,(sp+4) 803755c: 2b 8b 00 14 lw r11,(sp+20) 8037560: 2b 8c 00 10 lw r12,(sp+16) 8037564: 2b 8d 00 0c lw r13,(sp+12) 8037568: 2b 8e 00 08 lw r14,(sp+8) 803756c: 37 9c 00 1c addi sp,sp,28 8037570: c3 a0 00 00 ret /* * 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; 8037574: 34 01 00 00 mvi r1,0 8037578: e3 ff ff dc bi 80374e8 <_Rate_monotonic_Get_status+0x7c> /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 803757c: 54 41 ff fe bgu r2,r1,8037574 <_Rate_monotonic_Get_status+0x108> 8037580: e3 ff ff ef bi 803753c <_Rate_monotonic_Get_status+0xd0> =============================================================================== 08037970 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 8037970: 37 9c ff f4 addi sp,sp,-12 8037974: 5b 8b 00 08 sw (sp+8),r11 8037978: 5b 9d 00 04 sw (sp+4),ra 803797c: b8 20 10 00 mv r2,r1 8037980: 78 01 08 06 mvhi r1,0x806 8037984: 38 21 e3 d0 ori r1,r1,0xe3d0 8037988: 37 83 00 0c addi r3,sp,12 803798c: fb ff 35 f7 calli 8005168 <_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 ) { 8037990: 2b 82 00 0c lw r2,(sp+12) 8037994: b8 20 58 00 mv r11,r1 8037998: 44 40 00 05 be r2,r0,80379ac <_Rate_monotonic_Timeout+0x3c><== ALWAYS TAKEN case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 803799c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80379a0: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 80379a4: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 80379a8: c3 a0 00 00 ret <== NOT EXECUTED */ the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: the_thread = the_period->owner; 80379ac: 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); 80379b0: 28 23 00 10 lw r3,(r1+16) 80379b4: 20 63 40 00 andi r3,r3,0x4000 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 80379b8: 44 62 00 04 be r3,r2,80379c8 <_Rate_monotonic_Timeout+0x58> 80379bc: 28 23 00 20 lw r3,(r1+32) 80379c0: 29 62 00 08 lw r2,(r11+8) 80379c4: 44 62 00 1a be r3,r2,8037a2c <_Rate_monotonic_Timeout+0xbc> _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 ) { 80379c8: 29 62 00 38 lw r2,(r11+56) 80379cc: 34 01 00 01 mvi r1,1 80379d0: 44 41 00 0c be r2,r1,8037a00 <_Rate_monotonic_Timeout+0x90><== NEVER TAKEN _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 80379d4: 34 01 00 04 mvi r1,4 80379d8: 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; 80379dc: 78 01 08 06 mvhi r1,0x806 80379e0: 38 21 df c0 ori r1,r1,0xdfc0 80379e4: 28 22 00 00 lw r2,(r1+0) --level; 80379e8: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 80379ec: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 80379f0: 2b 9d 00 04 lw ra,(sp+4) 80379f4: 2b 8b 00 08 lw r11,(sp+8) 80379f8: 37 9c 00 0c addi sp,sp,12 80379fc: c3 a0 00 00 ret _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 ) { the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 8037a00: 34 02 00 03 mvi r2,3 <== NOT EXECUTED _Rate_monotonic_Initiate_statistics( the_period ); 8037a04: b9 60 08 00 mv r1,r11 <== NOT EXECUTED _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 ) { the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 8037a08: 59 62 00 38 sw (r11+56),r2 <== NOT EXECUTED _Rate_monotonic_Initiate_statistics( the_period ); 8037a0c: fb ff ff 2b calli 80376b8 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8037a10: 29 62 00 3c lw r2,(r11+60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8037a14: 78 01 08 06 mvhi r1,0x806 8037a18: 38 21 e0 58 ori r1,r1,0xe058 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8037a1c: 59 62 00 1c sw (r11+28),r2 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8037a20: 35 62 00 10 addi r2,r11,16 8037a24: fb ff 3d 3e calli 8006f1c <_Watchdog_Insert> 8037a28: e3 ff ff ed bi 80379dc <_Rate_monotonic_Timeout+0x6c> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 8037a2c: 78 03 08 05 mvhi r3,0x805 8037a30: 38 63 ca 58 ori r3,r3,0xca58 8037a34: 28 62 00 00 lw r2,(r3+0) 8037a38: fb ff 55 dc calli 800d1a8 <_Thread_Clear_state> the_thread = the_period->owner; if ( _States_Is_waiting_for_period( the_thread->current_state ) && the_thread->Wait.id == the_period->Object.id ) { _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); 8037a3c: b9 60 08 00 mv r1,r11 8037a40: e3 ff ff f3 bi 8037a0c <_Rate_monotonic_Timeout+0x9c> =============================================================================== 08037584 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 8037584: 37 9c ff e8 addi sp,sp,-24 8037588: 5b 8b 00 08 sw (sp+8),r11 803758c: 5b 9d 00 04 sw (sp+4),ra 8037590: b8 20 58 00 mv r11,r1 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8037594: 28 21 00 58 lw r1,(r1+88) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 8037598: 29 62 00 38 lw r2,(r11+56) /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 803759c: 34 21 00 01 addi r1,r1,1 80375a0: 59 61 00 58 sw (r11+88),r1 if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 80375a4: 34 01 00 04 mvi r1,4 80375a8: 44 41 00 3a be r2,r1,8037690 <_Rate_monotonic_Update_statistics+0x10c> stats->missed_count++; /* * Grab status for time statistics. */ valid_status = 80375ac: b9 60 08 00 mv r1,r11 80375b0: 37 82 00 0c addi r2,sp,12 80375b4: 37 83 00 14 addi r3,sp,20 80375b8: fb ff ff ad calli 803746c <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 80375bc: 44 20 00 13 be r1,r0,8037608 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80375c0: 2b 82 00 18 lw r2,(sp+24) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 80375c4: 29 63 00 74 lw r3,(r11+116) 80375c8: 29 65 00 70 lw r5,(r11+112) 80375cc: 2b 81 00 14 lw r1,(sp+20) 80375d0: b4 43 18 00 add r3,r2,r3 80375d4: f4 43 30 00 cmpgu r6,r2,r3 80375d8: b4 25 28 00 add r5,r1,r5 * 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 ) ) 80375dc: 29 64 00 60 lw r4,(r11+96) 80375e0: b4 c5 28 00 add r5,r6,r5 80375e4: 59 65 00 70 sw (r11+112),r5 80375e8: 59 63 00 74 sw (r11+116),r3 80375ec: 48 81 00 0b bg r4,r1,8037618 <_Rate_monotonic_Update_statistics+0x94> 80375f0: 5c 81 00 0c bne r4,r1,8037620 <_Rate_monotonic_Update_statistics+0x9c><== NEVER TAKEN 80375f4: 29 63 00 64 lw r3,(r11+100) 80375f8: 54 62 00 08 bgu r3,r2,8037618 <_Rate_monotonic_Update_statistics+0x94> 80375fc: e0 00 00 09 bi 8037620 <_Rate_monotonic_Update_statistics+0x9c> if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) stats->min_wall_time = since_last_period; if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) stats->max_wall_time = since_last_period; 8037600: 59 61 00 80 sw (r11+128),r1 8037604: 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 } 8037608: 2b 9d 00 04 lw ra,(sp+4) 803760c: 2b 8b 00 08 lw r11,(sp+8) 8037610: 37 9c 00 18 addi sp,sp,24 8037614: c3 a0 00 00 ret */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) stats->min_cpu_time = executed; 8037618: 59 61 00 60 sw (r11+96),r1 803761c: 59 62 00 64 sw (r11+100),r2 if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 8037620: 29 63 00 68 lw r3,(r11+104) 8037624: 48 23 00 18 bg r1,r3,8037684 <_Rate_monotonic_Update_statistics+0x100><== NEVER TAKEN 8037628: 44 61 00 21 be r3,r1,80376ac <_Rate_monotonic_Update_statistics+0x128><== ALWAYS TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 803762c: 2b 82 00 10 lw r2,(sp+16) 8037630: 29 63 00 8c lw r3,(r11+140) 8037634: 29 65 00 88 lw r5,(r11+136) 8037638: 2b 81 00 0c lw r1,(sp+12) 803763c: b4 43 18 00 add r3,r2,r3 8037640: f4 43 30 00 cmpgu r6,r2,r3 8037644: b4 25 28 00 add r5,r1,r5 * 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 ) ) 8037648: 29 64 00 78 lw r4,(r11+120) 803764c: b4 c5 28 00 add r5,r6,r5 8037650: 59 65 00 88 sw (r11+136),r5 8037654: 59 63 00 8c sw (r11+140),r3 8037658: 48 81 00 08 bg r4,r1,8037678 <_Rate_monotonic_Update_statistics+0xf4> 803765c: 44 81 00 11 be r4,r1,80376a0 <_Rate_monotonic_Update_statistics+0x11c><== ALWAYS TAKEN stats->min_wall_time = since_last_period; if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 8037660: 29 63 00 80 lw r3,(r11+128) 8037664: 48 23 ff e7 bg r1,r3,8037600 <_Rate_monotonic_Update_statistics+0x7c><== NEVER TAKEN 8037668: 5c 61 ff e8 bne r3,r1,8037608 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN 803766c: 29 63 00 84 lw r3,(r11+132) 8037670: 54 43 ff e4 bgu r2,r3,8037600 <_Rate_monotonic_Update_statistics+0x7c> 8037674: e3 ff ff e5 bi 8037608 <_Rate_monotonic_Update_statistics+0x84> */ #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 ) ) stats->min_wall_time = since_last_period; 8037678: 59 61 00 78 sw (r11+120),r1 803767c: 59 62 00 7c sw (r11+124),r2 8037680: e3 ff ff f8 bi 8037660 <_Rate_monotonic_Update_statistics+0xdc> if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) stats->min_cpu_time = executed; if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) stats->max_cpu_time = executed; 8037684: 59 61 00 68 sw (r11+104),r1 8037688: 59 62 00 6c sw (r11+108),r2 803768c: e3 ff ff e8 bi 803762c <_Rate_monotonic_Update_statistics+0xa8> */ stats = &the_period->Statistics; stats->count++; if ( the_period->state == RATE_MONOTONIC_EXPIRED ) stats->missed_count++; 8037690: 29 61 00 5c lw r1,(r11+92) 8037694: 34 21 00 01 addi r1,r1,1 8037698: 59 61 00 5c sw (r11+92),r1 803769c: e3 ff ff c4 bi 80375ac <_Rate_monotonic_Update_statistics+0x28> * 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 ) ) 80376a0: 29 63 00 7c lw r3,(r11+124) 80376a4: 54 62 ff f5 bgu r3,r2,8037678 <_Rate_monotonic_Update_statistics+0xf4> 80376a8: e3 ff ff ee bi 8037660 <_Rate_monotonic_Update_statistics+0xdc> _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) stats->min_cpu_time = executed; if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 80376ac: 29 63 00 6c lw r3,(r11+108) 80376b0: 54 43 ff f5 bgu r2,r3,8037684 <_Rate_monotonic_Update_statistics+0x100> 80376b4: e3 ff ff de bi 803762c <_Rate_monotonic_Update_statistics+0xa8> =============================================================================== 08006ec0 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 8006ec0: 37 9c ff f8 addi sp,sp,-8 8006ec4: 5b 8b 00 08 sw (sp+8),r11 8006ec8: 5b 9d 00 04 sw (sp+4),ra 8006ecc: b8 20 58 00 mv r11,r1 void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 8006ed0: 34 01 00 1c mvi r1,28 8006ed4: f8 00 07 f6 calli 8008eac <_Workspace_Allocate> if ( sched ) { 8006ed8: 44 20 00 06 be r1,r0,8006ef0 <_Scheduler_CBS_Allocate+0x30><== NEVER TAKEN the_thread->scheduler_info = sched; 8006edc: 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; 8006ee0: 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; 8006ee4: 58 2b 00 00 sw (r1+0),r11 schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 8006ee8: 58 22 00 14 sw (r1+20),r2 schinfo->cbs_server = NULL; 8006eec: 58 20 00 18 sw (r1+24),r0 } return sched; } 8006ef0: 2b 9d 00 04 lw ra,(sp+4) 8006ef4: 2b 8b 00 08 lw r11,(sp+8) 8006ef8: 37 9c 00 08 addi sp,sp,8 8006efc: c3 a0 00 00 ret =============================================================================== 080081fc <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 80081fc: 37 9c ff f4 addi sp,sp,-12 8008200: 5b 8b 00 08 sw (sp+8),r11 8008204: 5b 9d 00 04 sw (sp+4),ra 8008208: 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; 800820c: 28 22 00 ac lw r2,(r1+172) if ( the_thread->real_priority != new_priority ) 8008210: 28 21 00 18 lw r1,(r1+24) 8008214: 44 22 00 02 be r1,r2,800821c <_Scheduler_CBS_Budget_callout+0x20><== NEVER TAKEN the_thread->real_priority = new_priority; 8008218: 59 62 00 18 sw (r11+24),r2 if ( the_thread->current_priority != new_priority ) 800821c: 29 61 00 14 lw r1,(r11+20) 8008220: 44 22 00 04 be r1,r2,8008230 <_Scheduler_CBS_Budget_callout+0x34><== NEVER TAKEN _Thread_Change_priority(the_thread, new_priority, true); 8008224: b9 60 08 00 mv r1,r11 8008228: 34 03 00 01 mvi r3,1 800822c: f8 00 01 a5 calli 80088c0 <_Thread_Change_priority> /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 8008230: 29 6b 00 88 lw r11,(r11+136) if ( sched_info->cbs_server->cbs_budget_overrun ) { 8008234: 29 61 00 18 lw r1,(r11+24) 8008238: 28 22 00 0c lw r2,(r1+12) 800823c: 44 40 00 08 be r2,r0,800825c <_Scheduler_CBS_Budget_callout+0x60><== NEVER TAKEN _Scheduler_CBS_Get_server_id( 8008240: 28 21 00 00 lw r1,(r1+0) 8008244: 37 82 00 0c addi r2,sp,12 8008248: fb ff ff d6 calli 80081a0 <_Scheduler_CBS_Get_server_id> sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); 800824c: 29 62 00 18 lw r2,(r11+24) 8008250: 2b 81 00 0c lw r1,(sp+12) 8008254: 28 42 00 0c lw r2,(r2+12) 8008258: d8 40 00 00 call r2 } } 800825c: 2b 9d 00 04 lw ra,(sp+4) 8008260: 2b 8b 00 08 lw r11,(sp+8) 8008264: 37 9c 00 0c addi sp,sp,12 8008268: c3 a0 00 00 ret =============================================================================== 08007c68 <_Scheduler_CBS_Cleanup>: #include #include #include int _Scheduler_CBS_Cleanup (void) { 8007c68: 37 9c ff ec addi sp,sp,-20 8007c6c: 5b 8b 00 14 sw (sp+20),r11 8007c70: 5b 8c 00 10 sw (sp+16),r12 8007c74: 5b 8d 00 0c sw (sp+12),r13 8007c78: 5b 8e 00 08 sw (sp+8),r14 8007c7c: 5b 9d 00 04 sw (sp+4),ra unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007c80: 78 0d 08 02 mvhi r13,0x802 8007c84: 39 ad 20 18 ori r13,r13,0x2018 8007c88: 29 a1 00 00 lw r1,(r13+0) 8007c8c: 44 20 00 1a be r1,r0,8007cf4 <_Scheduler_CBS_Cleanup+0x8c> <== NEVER TAKEN 8007c90: 78 0e 08 02 mvhi r14,0x802 8007c94: 39 ce 2b 28 ori r14,r14,0x2b28 8007c98: 29 c2 00 00 lw r2,(r14+0) 8007c9c: 34 0c 00 00 mvi r12,0 8007ca0: 34 0b 00 00 mvi r11,0 if ( _Scheduler_CBS_Server_list[ i ] ) 8007ca4: b4 4c 08 00 add r1,r2,r12 8007ca8: 28 23 00 00 lw r3,(r1+0) _Scheduler_CBS_Destroy_server( i ); 8007cac: b9 60 08 00 mv r1,r11 int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007cb0: 35 6b 00 01 addi r11,r11,1 if ( _Scheduler_CBS_Server_list[ i ] ) 8007cb4: 44 60 00 03 be r3,r0,8007cc0 <_Scheduler_CBS_Cleanup+0x58> _Scheduler_CBS_Destroy_server( i ); 8007cb8: f8 00 00 57 calli 8007e14 <_Scheduler_CBS_Destroy_server> 8007cbc: 29 c2 00 00 lw r2,(r14+0) int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007cc0: 29 a1 00 00 lw r1,(r13+0) 8007cc4: 35 8c 00 04 addi r12,r12,4 8007cc8: 54 2b ff f7 bgu r1,r11,8007ca4 <_Scheduler_CBS_Cleanup+0x3c> if ( _Scheduler_CBS_Server_list[ i ] ) _Scheduler_CBS_Destroy_server( i ); } _Workspace_Free( _Scheduler_CBS_Server_list ); 8007ccc: b8 40 08 00 mv r1,r2 8007cd0: f8 00 09 6e calli 800a288 <_Workspace_Free> return SCHEDULER_CBS_OK; } 8007cd4: 34 01 00 00 mvi r1,0 8007cd8: 2b 9d 00 04 lw ra,(sp+4) 8007cdc: 2b 8b 00 14 lw r11,(sp+20) 8007ce0: 2b 8c 00 10 lw r12,(sp+16) 8007ce4: 2b 8d 00 0c lw r13,(sp+12) 8007ce8: 2b 8e 00 08 lw r14,(sp+8) 8007cec: 37 9c 00 14 addi sp,sp,20 8007cf0: c3 a0 00 00 ret int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007cf4: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 8007cf8: 38 21 2b 28 ori r1,r1,0x2b28 <== NOT EXECUTED 8007cfc: 28 22 00 00 lw r2,(r1+0) <== NOT EXECUTED 8007d00: e3 ff ff f3 bi 8007ccc <_Scheduler_CBS_Cleanup+0x64> <== NOT EXECUTED =============================================================================== 08007d04 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 8007d04: 37 9c ff e4 addi sp,sp,-28 8007d08: 5b 8b 00 14 sw (sp+20),r11 8007d0c: 5b 8c 00 10 sw (sp+16),r12 8007d10: 5b 8d 00 0c sw (sp+12),r13 8007d14: 5b 8e 00 08 sw (sp+8),r14 8007d18: 5b 9d 00 04 sw (sp+4),ra unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 8007d1c: 28 24 00 04 lw r4,(r1+4) int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 8007d20: b8 20 58 00 mv r11,r1 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; 8007d24: 34 01 ff ee mvi r1,-18 ) { unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 8007d28: 4c 04 00 2e bge r0,r4,8007de0 <_Scheduler_CBS_Create_server+0xdc> 8007d2c: 29 64 00 00 lw r4,(r11+0) 8007d30: 4c 04 00 2c bge r0,r4,8007de0 <_Scheduler_CBS_Create_server+0xdc> 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++ ) { 8007d34: 78 01 08 02 mvhi r1,0x802 8007d38: 38 21 20 18 ori r1,r1,0x2018 8007d3c: 28 24 00 00 lw r4,(r1+0) if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 8007d40: 34 01 ff e6 mvi r1,-26 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++ ) { 8007d44: 44 80 00 27 be r4,r0,8007de0 <_Scheduler_CBS_Create_server+0xdc><== NEVER TAKEN if ( !_Scheduler_CBS_Server_list[i] ) 8007d48: 78 0e 08 02 mvhi r14,0x802 8007d4c: 39 ce 2b 28 ori r14,r14,0x2b28 8007d50: 29 cd 00 00 lw r13,(r14+0) 8007d54: 29 a1 00 00 lw r1,(r13+0) 8007d58: 44 20 00 2d be r1,r0,8007e0c <_Scheduler_CBS_Create_server+0x108> 8007d5c: b9 a0 08 00 mv r1,r13 8007d60: 34 0c 00 00 mvi r12,0 params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007d64: 35 8c 00 01 addi r12,r12,1 8007d68: 54 8c 00 25 bgu r4,r12,8007dfc <_Scheduler_CBS_Create_server+0xf8> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 8007d6c: 34 01 ff e6 mvi r1,-26 for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) 8007d70: 45 84 00 1c be r12,r4,8007de0 <_Scheduler_CBS_Create_server+0xdc> return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 8007d74: 58 6c 00 00 sw (r3+0),r12 _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 8007d78: 34 01 00 10 mvi r1,16 8007d7c: 5b 82 00 1c sw (sp+28),r2 8007d80: 5b 83 00 18 sw (sp+24),r3 8007d84: f8 00 09 36 calli 800a25c <_Workspace_Allocate> the_server = _Scheduler_CBS_Server_list[*server_id]; 8007d88: 2b 83 00 18 lw r3,(sp+24) 8007d8c: 29 c4 00 00 lw r4,(r14+0) if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 8007d90: b5 8c 60 00 add r12,r12,r12 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 8007d94: 28 63 00 00 lw r3,(r3+0) if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 8007d98: b5 8c 60 00 add r12,r12,r12 8007d9c: b5 ac 60 00 add r12,r13,r12 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 8007da0: b4 63 18 00 add r3,r3,r3 8007da4: b4 63 18 00 add r3,r3,r3 if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 8007da8: 59 81 00 00 sw (r12+0),r1 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 8007dac: b4 83 18 00 add r3,r4,r3 8007db0: 28 63 00 00 lw r3,(r3+0) if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 8007db4: 34 01 ff ef mvi r1,-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 ) 8007db8: 2b 82 00 1c lw r2,(sp+28) 8007dbc: 44 60 00 09 be r3,r0,8007de0 <_Scheduler_CBS_Create_server+0xdc><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 8007dc0: 29 64 00 00 lw r4,(r11+0) the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 8007dc4: 34 01 00 00 mvi r1,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; 8007dc8: 58 64 00 04 sw (r3+4),r4 8007dcc: 29 65 00 04 lw r5,(r11+4) the_server->task_id = -1; 8007dd0: 34 04 ff ff mvi r4,-1 8007dd4: 58 64 00 00 sw (r3+0),r4 the_server->cbs_budget_overrun = budget_overrun_callback; 8007dd8: 58 62 00 0c sw (r3+12),r2 _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; 8007ddc: 58 65 00 08 sw (r3+8),r5 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 8007de0: 2b 9d 00 04 lw ra,(sp+4) 8007de4: 2b 8b 00 14 lw r11,(sp+20) 8007de8: 2b 8c 00 10 lw r12,(sp+16) 8007dec: 2b 8d 00 0c lw r13,(sp+12) 8007df0: 2b 8e 00 08 lw r14,(sp+8) 8007df4: 37 9c 00 1c addi sp,sp,28 8007df8: c3 a0 00 00 ret params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( !_Scheduler_CBS_Server_list[i] ) 8007dfc: 28 25 00 04 lw r5,(r1+4) 8007e00: 34 21 00 04 addi r1,r1,4 8007e04: 5c a0 ff d8 bne r5,r0,8007d64 <_Scheduler_CBS_Create_server+0x60> 8007e08: e3 ff ff d9 bi 8007d6c <_Scheduler_CBS_Create_server+0x68> 8007e0c: 34 0c 00 00 mvi r12,0 8007e10: e3 ff ff d9 bi 8007d74 <_Scheduler_CBS_Create_server+0x70> =============================================================================== 08007eb4 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 8007eb4: 37 9c ff ec addi sp,sp,-20 8007eb8: 5b 8b 00 10 sw (sp+16),r11 8007ebc: 5b 8c 00 0c sw (sp+12),r12 8007ec0: 5b 8d 00 08 sw (sp+8),r13 8007ec4: 5b 9d 00 04 sw (sp+4),ra 8007ec8: b8 40 68 00 mv r13,r2 8007ecc: b8 20 60 00 mv r12,r1 Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 8007ed0: 37 82 00 14 addi r2,sp,20 8007ed4: b9 a0 08 00 mv r1,r13 8007ed8: f8 00 04 09 calli 8008efc <_Thread_Get> 8007edc: b8 20 58 00 mv r11,r1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 8007ee0: 44 20 00 02 be r1,r0,8007ee8 <_Scheduler_CBS_Detach_thread+0x34> _Thread_Enable_dispatch(); 8007ee4: f8 00 03 fa calli 8008ecc <_Thread_Enable_dispatch> } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 8007ee8: 78 03 08 02 mvhi r3,0x802 8007eec: 38 63 20 18 ori r3,r3,0x2018 8007ef0: 28 61 00 00 lw r1,(r3+0) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 8007ef4: 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 ) 8007ef8: 51 81 00 19 bgeu r12,r1,8007f5c <_Scheduler_CBS_Detach_thread+0xa8> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 8007efc: 45 60 00 18 be r11,r0,8007f5c <_Scheduler_CBS_Detach_thread+0xa8> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 8007f00: 78 01 08 02 mvhi r1,0x802 8007f04: 38 21 2b 28 ori r1,r1,0x2b28 8007f08: 28 21 00 00 lw r1,(r1+0) 8007f0c: b5 8c 60 00 add r12,r12,r12 8007f10: b5 8c 60 00 add r12,r12,r12 8007f14: b4 2c 60 00 add r12,r1,r12 8007f18: 29 81 00 00 lw r1,(r12+0) return SCHEDULER_CBS_ERROR_NOSERVER; 8007f1c: 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] ) 8007f20: 44 20 00 0f be r1,r0,8007f5c <_Scheduler_CBS_Detach_thread+0xa8> return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 8007f24: 28 22 00 00 lw r2,(r1+0) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 8007f28: 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 ) 8007f2c: 5c 4d 00 0c bne r2,r13,8007f5c <_Scheduler_CBS_Detach_thread+0xa8><== NEVER TAKEN 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; 8007f30: 29 66 00 88 lw r6,(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; 8007f34: 41 63 00 9c lbu r3,(r11+156) _Scheduler_CBS_Server_list[server_id]->task_id = -1; sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 8007f38: 29 65 00 a0 lw r5,(r11+160) the_thread->budget_callout = the_thread->Start.budget_callout; 8007f3c: 29 64 00 a4 lw r4,(r11+164) return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ 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; 8007f40: 34 02 ff ff mvi r2,-1 8007f44: 58 22 00 00 sw (r1+0),r2 sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 8007f48: 58 c0 00 18 sw (r6+24),r0 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; 8007f4c: 31 63 00 70 sb (r11+112),r3 _Scheduler_CBS_Server_list[server_id]->task_id = -1; sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 8007f50: 59 65 00 78 sw (r11+120),r5 the_thread->budget_callout = the_thread->Start.budget_callout; 8007f54: 59 64 00 7c sw (r11+124),r4 the_thread->is_preemptible = the_thread->Start.is_preemptible; return SCHEDULER_CBS_OK; 8007f58: 34 03 00 00 mvi r3,0 } 8007f5c: b8 60 08 00 mv r1,r3 8007f60: 2b 9d 00 04 lw ra,(sp+4) 8007f64: 2b 8b 00 10 lw r11,(sp+16) 8007f68: 2b 8c 00 0c lw r12,(sp+12) 8007f6c: 2b 8d 00 08 lw r13,(sp+8) 8007f70: 37 9c 00 14 addi sp,sp,20 8007f74: c3 a0 00 00 ret =============================================================================== 080081a0 <_Scheduler_CBS_Get_server_id>: rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 80081a0: 78 03 08 02 mvhi r3,0x802 80081a4: 38 63 20 18 ori r3,r3,0x2018 80081a8: 28 66 00 00 lw r6,(r3+0) _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; return SCHEDULER_CBS_OK; } } return SCHEDULER_CBS_ERROR_NOSERVER; 80081ac: 34 03 ff e7 mvi r3,-25 rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 80081b0: 44 c0 00 0d be r6,r0,80081e4 <_Scheduler_CBS_Get_server_id+0x44><== NEVER TAKEN 80081b4: 78 03 08 02 mvhi r3,0x802 80081b8: 38 63 2b 28 ori r3,r3,0x2b28 80081bc: 28 63 00 00 lw r3,(r3+0) 80081c0: 34 04 00 00 mvi r4,0 if ( _Scheduler_CBS_Server_list[i] && 80081c4: 28 65 00 00 lw r5,(r3+0) rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 80081c8: 34 63 00 04 addi r3,r3,4 if ( _Scheduler_CBS_Server_list[i] && 80081cc: 44 a0 00 03 be r5,r0,80081d8 <_Scheduler_CBS_Get_server_id+0x38> 80081d0: 28 a5 00 00 lw r5,(r5+0) 80081d4: 44 a1 00 06 be r5,r1,80081ec <_Scheduler_CBS_Get_server_id+0x4c> rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 80081d8: 34 84 00 01 addi r4,r4,1 80081dc: 54 c4 ff fa bgu r6,r4,80081c4 <_Scheduler_CBS_Get_server_id+0x24> _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; return SCHEDULER_CBS_OK; } } return SCHEDULER_CBS_ERROR_NOSERVER; 80081e0: 34 03 ff e7 mvi r3,-25 } 80081e4: b8 60 08 00 mv r1,r3 80081e8: c3 a0 00 00 ret unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( _Scheduler_CBS_Server_list[i] && _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; return SCHEDULER_CBS_OK; 80081ec: 34 03 00 00 mvi r3,0 { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( _Scheduler_CBS_Server_list[i] && _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; 80081f0: 58 44 00 00 sw (r2+0),r4 return SCHEDULER_CBS_OK; } } return SCHEDULER_CBS_ERROR_NOSERVER; } 80081f4: b8 60 08 00 mv r1,r3 80081f8: c3 a0 00 00 ret =============================================================================== 0800826c <_Scheduler_CBS_Initialize>: int _Scheduler_CBS_Initialize(void) { 800826c: 37 9c ff f8 addi sp,sp,-8 8008270: 5b 8b 00 08 sw (sp+8),r11 8008274: 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*) ); 8008278: 78 0b 08 02 mvhi r11,0x802 800827c: 39 6b 20 18 ori r11,r11,0x2018 8008280: 29 61 00 00 lw r1,(r11+0) 8008284: b4 21 08 00 add r1,r1,r1 8008288: b4 21 08 00 add r1,r1,r1 } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 800828c: f8 00 07 f4 calli 800a25c <_Workspace_Allocate> 8008290: 78 02 08 02 mvhi r2,0x802 8008294: 38 42 2b 28 ori r2,r2,0x2b28 8008298: 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; 800829c: 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 ) 80082a0: 44 20 00 09 be r1,r0,80082c4 <_Scheduler_CBS_Initialize+0x58><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 80082a4: 29 63 00 00 lw r3,(r11+0) _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 80082a8: 34 02 00 00 mvi r2,0 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++) { 80082ac: 44 60 00 06 be r3,r0,80082c4 <_Scheduler_CBS_Initialize+0x58><== NEVER TAKEN _Scheduler_CBS_Server_list[i] = NULL; 80082b0: 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++) { 80082b4: 34 42 00 01 addi r2,r2,1 80082b8: 34 21 00 04 addi r1,r1,4 80082bc: 54 62 ff fd bgu r3,r2,80082b0 <_Scheduler_CBS_Initialize+0x44> _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 80082c0: 34 02 00 00 mvi r2,0 } 80082c4: b8 40 08 00 mv r1,r2 80082c8: 2b 9d 00 04 lw ra,(sp+4) 80082cc: 2b 8b 00 08 lw r11,(sp+8) 80082d0: 37 9c 00 08 addi sp,sp,8 80082d4: c3 a0 00 00 ret =============================================================================== 08006f00 <_Scheduler_CBS_Release_job>: void _Scheduler_CBS_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 8006f00: 37 9c ff fc addi sp,sp,-4 8006f04: 5b 9d 00 04 sw (sp+4),ra 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; 8006f08: 28 23 00 88 lw r3,(r1+136) void _Scheduler_CBS_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 8006f0c: 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 = 8006f10: 28 63 00 18 lw r3,(r3+24) (Scheduler_CBS_Server *) sched_info->cbs_server; if (deadline) { 8006f14: 44 40 00 13 be r2,r0,8006f60 <_Scheduler_CBS_Release_job+0x60> /* Initializing or shifting deadline. */ if (serv_info) 8006f18: 44 60 00 15 be r3,r0,8006f6c <_Scheduler_CBS_Release_job+0x6c> new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 8006f1c: 78 02 08 02 mvhi r2,0x802 8006f20: 38 42 0a 30 ori r2,r2,0xa30 8006f24: 28 64 00 04 lw r4,(r3+4) 8006f28: 28 42 00 00 lw r2,(r2+0) 8006f2c: 78 05 08 01 mvhi r5,0x801 8006f30: 38 a5 e3 b8 ori r5,r5,0xe3b8 8006f34: b4 44 10 00 add r2,r2,r4 8006f38: 28 a4 00 00 lw r4,(r5+0) 8006f3c: a0 44 10 00 and r2,r2,r4 new_priority = the_thread->Start.initial_priority; } /* Budget replenishment for the next job. */ if (serv_info) the_thread->cpu_time_budget = serv_info->parameters.budget; 8006f40: 28 63 00 08 lw r3,(r3+8) 8006f44: 58 23 00 74 sw (r1+116),r3 the_thread->real_priority = new_priority; 8006f48: 58 22 00 18 sw (r1+24),r2 _Thread_Change_priority(the_thread, new_priority, true); 8006f4c: 34 03 00 01 mvi r3,1 8006f50: f8 00 01 4e calli 8007488 <_Thread_Change_priority> } 8006f54: 2b 9d 00 04 lw ra,(sp+4) 8006f58: 37 9c 00 04 addi sp,sp,4 8006f5c: c3 a0 00 00 ret new_priority = (_Watchdog_Ticks_since_boot + deadline) & ~SCHEDULER_EDF_PRIO_MSB; } else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; 8006f60: 28 22 00 ac lw r2,(r1+172) } /* Budget replenishment for the next job. */ if (serv_info) 8006f64: 5c 64 ff f7 bne r3,r4,8006f40 <_Scheduler_CBS_Release_job+0x40><== ALWAYS TAKEN 8006f68: e3 ff ff f8 bi 8006f48 <_Scheduler_CBS_Release_job+0x48> <== NOT EXECUTED /* Initializing or shifting deadline. */ if (serv_info) new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 8006f6c: 78 02 08 02 mvhi r2,0x802 8006f70: 38 42 0a 30 ori r2,r2,0xa30 8006f74: 28 42 00 00 lw r2,(r2+0) 8006f78: b4 82 10 00 add r2,r4,r2 8006f7c: 78 04 08 01 mvhi r4,0x801 8006f80: 38 84 e3 b8 ori r4,r4,0xe3b8 8006f84: 28 83 00 00 lw r3,(r4+0) 8006f88: a0 43 10 00 and r2,r2,r3 8006f8c: e3 ff ff ef bi 8006f48 <_Scheduler_CBS_Release_job+0x48> =============================================================================== 08006f90 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 8006f90: 37 9c ff ec addi sp,sp,-20 8006f94: 5b 8b 00 14 sw (sp+20),r11 8006f98: 5b 8c 00 10 sw (sp+16),r12 8006f9c: 5b 8d 00 0c sw (sp+12),r13 8006fa0: 5b 8e 00 08 sw (sp+8),r14 8006fa4: 5b 9d 00 04 sw (sp+4),ra 8006fa8: 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); 8006fac: f8 00 00 59 calli 8007110 <_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; 8006fb0: 29 61 00 88 lw r1,(r11+136) 8006fb4: 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) { 8006fb8: 45 80 00 0d be r12,r0,8006fec <_Scheduler_CBS_Unblock+0x5c> 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 - 8006fbc: 78 01 08 02 mvhi r1,0x802 8006fc0: 38 21 0a 30 ori r1,r1,0xa30 8006fc4: 28 21 00 00 lw r1,(r1+0) 8006fc8: 29 6d 00 18 lw r13,(r11+24) _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 8006fcc: 29 82 00 04 lw r2,(r12+4) 8006fd0: c9 a1 08 00 sub r1,r13,r1 8006fd4: f8 00 56 bd calli 801cac8 <__mulsi3> 8006fd8: b8 20 70 00 mv r14,r1 8006fdc: 29 82 00 08 lw r2,(r12+8) 8006fe0: 29 61 00 74 lw r1,(r11+116) 8006fe4: f8 00 56 b9 calli 801cac8 <__mulsi3> 8006fe8: 49 c1 00 18 bg r14,r1,8007048 <_Scheduler_CBS_Unblock+0xb8> /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; if ( the_thread->real_priority != new_priority ) the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) _Thread_Change_priority(the_thread, new_priority, true); 8006fec: 29 61 00 14 lw r1,(r11+20) * 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, 8006ff0: 78 0c 08 02 mvhi r12,0x802 8006ff4: 39 8c 0a c0 ori r12,r12,0xac0 8006ff8: 29 84 00 14 lw r4,(r12+20) 8006ffc: 78 02 08 02 mvhi r2,0x802 8007000: 38 42 00 1c ori r2,r2,0x1c 8007004: 28 43 00 30 lw r3,(r2+48) 8007008: 28 82 00 14 lw r2,(r4+20) 800700c: d8 60 00 00 call r3 8007010: 4c 01 00 07 bge r0,r1,800702c <_Scheduler_CBS_Unblock+0x9c> _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 8007014: 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; 8007018: 59 8b 00 14 sw (r12+20),r11 if ( _Thread_Executing->is_preemptible || 800701c: 40 21 00 70 lbu r1,(r1+112) 8007020: 44 20 00 13 be r1,r0,800706c <_Scheduler_CBS_Unblock+0xdc> the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 8007024: 34 01 00 01 mvi r1,1 8007028: 31 81 00 0c sb (r12+12),r1 } } 800702c: 2b 9d 00 04 lw ra,(sp+4) 8007030: 2b 8b 00 14 lw r11,(sp+20) 8007034: 2b 8c 00 10 lw r12,(sp+16) 8007038: 2b 8d 00 0c lw r13,(sp+12) 800703c: 2b 8e 00 08 lw r14,(sp+8) 8007040: 37 9c 00 14 addi sp,sp,20 8007044: c3 a0 00 00 ret time_t budget_left = the_thread->real_priority - _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 8007048: 29 62 00 ac lw r2,(r11+172) if ( the_thread->real_priority != new_priority ) 800704c: 45 a2 00 02 be r13,r2,8007054 <_Scheduler_CBS_Unblock+0xc4> the_thread->real_priority = new_priority; 8007050: 59 62 00 18 sw (r11+24),r2 if ( the_thread->current_priority != new_priority ) 8007054: 29 61 00 14 lw r1,(r11+20) 8007058: 44 22 ff e6 be r1,r2,8006ff0 <_Scheduler_CBS_Unblock+0x60> _Thread_Change_priority(the_thread, new_priority, true); 800705c: b9 60 08 00 mv r1,r11 8007060: 34 03 00 01 mvi r3,1 8007064: f8 00 01 09 calli 8007488 <_Thread_Change_priority> 8007068: e3 ff ff e1 bi 8006fec <_Scheduler_CBS_Unblock+0x5c> * 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; if ( _Thread_Executing->is_preemptible || 800706c: 29 62 00 14 lw r2,(r11+20) 8007070: 44 41 ff ed be r2,r1,8007024 <_Scheduler_CBS_Unblock+0x94> <== NEVER TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; } } 8007074: 2b 9d 00 04 lw ra,(sp+4) 8007078: 2b 8b 00 14 lw r11,(sp+20) 800707c: 2b 8c 00 10 lw r12,(sp+16) 8007080: 2b 8d 00 0c lw r13,(sp+12) 8007084: 2b 8e 00 08 lw r14,(sp+8) 8007088: 37 9c 00 14 addi sp,sp,20 800708c: c3 a0 00 00 ret =============================================================================== 08006ec0 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 8006ec0: 37 9c ff f8 addi sp,sp,-8 8006ec4: 5b 8b 00 08 sw (sp+8),r11 8006ec8: 5b 9d 00 04 sw (sp+4),ra 8006ecc: b8 20 58 00 mv r11,r1 void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 8006ed0: 34 01 00 18 mvi r1,24 8006ed4: f8 00 07 c9 calli 8008df8 <_Workspace_Allocate> if ( sched ) { 8006ed8: 44 20 00 05 be r1,r0,8006eec <_Scheduler_EDF_Allocate+0x2c><== NEVER TAKEN the_thread->scheduler_info = sched; 8006edc: 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; 8006ee0: 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; 8006ee4: 58 2b 00 00 sw (r1+0),r11 schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 8006ee8: 58 22 00 14 sw (r1+20),r2 } return sched; } 8006eec: 2b 9d 00 04 lw ra,(sp+4) 8006ef0: 2b 8b 00 08 lw r11,(sp+8) 8006ef4: 37 9c 00 08 addi sp,sp,8 8006ef8: c3 a0 00 00 ret =============================================================================== 08007134 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 8007134: 37 9c ff f4 addi sp,sp,-12 8007138: 5b 8b 00 0c sw (sp+12),r11 800713c: 5b 8c 00 08 sw (sp+8),r12 8007140: 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( 8007144: 78 0b 08 02 mvhi r11,0x802 #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 8007148: 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( 800714c: 39 6b 0a c0 ori r11,r11,0xac0 void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { _Scheduler_EDF_Enqueue(the_thread); 8007150: fb ff ff 8b calli 8006f7c <_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( 8007154: 29 61 00 14 lw r1,(r11+20) 8007158: 78 02 08 02 mvhi r2,0x802 800715c: 38 42 00 18 ori r2,r2,0x18 8007160: 28 43 00 30 lw r3,(r2+48) 8007164: 28 21 00 14 lw r1,(r1+20) 8007168: 29 82 00 14 lw r2,(r12+20) 800716c: d8 60 00 00 call r3 8007170: 4c 20 00 07 bge r1,r0,800718c <_Scheduler_EDF_Unblock+0x58> _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 8007174: 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; 8007178: 59 6c 00 14 sw (r11+20),r12 if ( _Thread_Executing->is_preemptible || 800717c: 40 21 00 70 lbu r1,(r1+112) 8007180: 44 20 00 08 be r1,r0,80071a0 <_Scheduler_EDF_Unblock+0x6c> the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 8007184: 34 01 00 01 mvi r1,1 8007188: 31 61 00 0c sb (r11+12),r1 } } 800718c: 2b 9d 00 04 lw ra,(sp+4) 8007190: 2b 8b 00 0c lw r11,(sp+12) 8007194: 2b 8c 00 08 lw r12,(sp+8) 8007198: 37 9c 00 0c addi sp,sp,12 800719c: c3 a0 00 00 ret */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 80071a0: 29 82 00 14 lw r2,(r12+20) 80071a4: 5c 41 ff fa bne r2,r1,800718c <_Scheduler_EDF_Unblock+0x58><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 80071a8: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 80071ac: 31 61 00 0c sb (r11+12),r1 <== NOT EXECUTED 80071b0: e3 ff ff f7 bi 800718c <_Scheduler_EDF_Unblock+0x58> <== NOT EXECUTED =============================================================================== 08005fb0 <_Scheduler_priority_Block>: ) { Scheduler_priority_Per_thread *sched_info; Chain_Control *ready; sched_info = (Scheduler_priority_Per_thread *) the_thread->scheduler_info; 8005fb0: 28 23 00 88 lw r3,(r1+136) ready = sched_info->ready_chain; 8005fb4: 28 62 00 00 lw r2,(r3+0) if ( _Chain_Has_only_one_node( ready ) ) { 8005fb8: 28 45 00 00 lw r5,(r2+0) 8005fbc: 28 44 00 08 lw r4,(r2+8) 8005fc0: 44 a4 00 37 be r5,r4,800609c <_Scheduler_priority_Block+0xec> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 8005fc4: 28 23 00 00 lw r3,(r1+0) previous = the_node->previous; 8005fc8: 28 22 00 04 lw r2,(r1+4) next->previous = previous; 8005fcc: 58 62 00 04 sw (r3+4),r2 previous->next = next; 8005fd0: 58 43 00 00 sw (r2+0),r3 RTEMS_INLINE_ROUTINE bool _Thread_Is_heir ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Heir ); 8005fd4: 78 02 08 01 mvhi r2,0x801 8005fd8: 38 42 ea 60 ori r2,r2,0xea60 { _Scheduler_priority_Ready_queue_extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) 8005fdc: 28 43 00 14 lw r3,(r2+20) 8005fe0: 44 23 00 07 be r1,r3,8005ffc <_Scheduler_priority_Block+0x4c> _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) 8005fe4: 28 43 00 10 lw r3,(r2+16) 8005fe8: 44 23 00 02 be r1,r3,8005ff0 <_Scheduler_priority_Block+0x40> 8005fec: c3 a0 00 00 ret _Thread_Dispatch_necessary = true; 8005ff0: 34 01 00 01 mvi r1,1 8005ff4: 30 41 00 0c sb (r2+12),r1 8005ff8: c3 a0 00 00 ret 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 ); 8005ffc: 78 03 08 01 mvhi r3,0x801 8006000: 38 63 ea a0 ori r3,r3,0xeaa0 8006004: 2c 64 00 00 lhu r4,(r3+0) * @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 8006008: 78 03 08 01 mvhi r3,0x801 800600c: 38 63 e0 18 ori r3,r3,0xe018 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 8006010: 28 67 00 00 lw r7,(r3+0) 8006014: 20 84 ff ff andi r4,r4,0xffff 8006018: 34 03 00 ff mvi r3,255 800601c: 54 83 00 3c bgu r4,r3,800610c <_Scheduler_priority_Block+0x15c> 8006020: 78 05 08 01 mvhi r5,0x801 8006024: 38 a5 c1 d4 ori r5,r5,0xc1d4 8006028: b4 a4 20 00 add r4,r5,r4 800602c: 40 84 00 00 lbu r4,(r4+0) 8006030: 34 84 00 08 addi r4,r4,8 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8006034: 78 06 08 01 mvhi r6,0x801 8006038: 38 c6 ea c0 ori r6,r6,0xeac0 800603c: b4 84 20 00 add r4,r4,r4 8006040: b4 c4 30 00 add r6,r6,r4 8006044: 2c c3 00 00 lhu r3,(r6+0) 8006048: 34 06 00 ff mvi r6,255 800604c: 54 66 00 25 bgu r3,r6,80060e0 <_Scheduler_priority_Block+0x130> 8006050: b4 a3 18 00 add r3,r5,r3 8006054: 40 65 00 00 lbu r5,(r3+0) 8006058: 34 a5 00 08 addi r5,r5,8 return (_Priority_Bits_index( major ) << 4) + 800605c: b4 84 18 00 add r3,r4,r4 8006060: b4 63 18 00 add r3,r3,r3 8006064: b4 63 18 00 add r3,r3,r3 8006068: b4 a3 18 00 add r3,r5,r3 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 800606c: b4 63 20 00 add r4,r3,r3 8006070: b4 83 18 00 add r3,r4,r3 8006074: b4 63 18 00 add r3,r3,r3 8006078: b4 63 18 00 add r3,r3,r3 800607c: b4 e3 18 00 add r3,r7,r3 } 8006080: 28 65 00 00 lw r5,(r3+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8006084: 34 63 00 04 addi r3,r3,4 return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 8006088: 34 04 00 00 mvi r4,0 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 800608c: 44 a3 00 02 be r5,r3,8006094 <_Scheduler_priority_Block+0xe4><== NEVER TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); 8006090: b8 a0 20 00 mv r4,r5 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 8006094: 58 44 00 14 sw (r2+20),r4 8006098: e3 ff ff d3 bi 8005fe4 <_Scheduler_priority_Block+0x34> RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 800609c: 28 64 00 04 lw r4,(r3+4) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 80060a0: 34 45 00 04 addi r5,r2,4 head->next = tail; 80060a4: 58 45 00 00 sw (r2+0),r5 head->previous = NULL; 80060a8: 58 40 00 04 sw (r2+4),r0 tail->previous = head; 80060ac: 58 42 00 08 sw (r2+8),r2 80060b0: 2c 65 00 0e lhu r5,(r3+14) 80060b4: 2c 82 00 00 lhu r2,(r4+0) 80060b8: a0 45 10 00 and r2,r2,r5 80060bc: 0c 82 00 00 sh (r4+0),r2 if ( *the_priority_map->minor == 0 ) 80060c0: 5c 40 ff c5 bne r2,r0,8005fd4 <_Scheduler_priority_Block+0x24> _Priority_Major_bit_map &= the_priority_map->block_major; 80060c4: 78 02 08 01 mvhi r2,0x801 80060c8: 38 42 ea a0 ori r2,r2,0xeaa0 80060cc: 2c 44 00 00 lhu r4,(r2+0) 80060d0: 2c 63 00 0c lhu r3,(r3+12) 80060d4: a0 64 18 00 and r3,r3,r4 80060d8: 0c 43 00 00 sh (r2+0),r3 80060dc: e3 ff ff be bi 8005fd4 <_Scheduler_priority_Block+0x24> { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 80060e0: 00 63 00 01 srui r3,r3,1 80060e4: 00 63 00 01 srui r3,r3,1 80060e8: 00 63 00 01 srui r3,r3,1 80060ec: 00 63 00 01 srui r3,r3,1 80060f0: 00 63 00 01 srui r3,r3,1 80060f4: 00 63 00 01 srui r3,r3,1 80060f8: 00 63 00 01 srui r3,r3,1 80060fc: 00 63 00 01 srui r3,r3,1 8006100: b4 a3 18 00 add r3,r5,r3 8006104: 40 65 00 00 lbu r5,(r3+0) 8006108: e3 ff ff d5 bi 800605c <_Scheduler_priority_Block+0xac> 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 ); 800610c: 00 84 00 01 srui r4,r4,1 8006110: 78 05 08 01 mvhi r5,0x801 8006114: 00 84 00 01 srui r4,r4,1 8006118: 38 a5 c1 d4 ori r5,r5,0xc1d4 800611c: 00 84 00 01 srui r4,r4,1 8006120: 00 84 00 01 srui r4,r4,1 8006124: 00 84 00 01 srui r4,r4,1 8006128: 00 84 00 01 srui r4,r4,1 800612c: 00 84 00 01 srui r4,r4,1 8006130: 00 84 00 01 srui r4,r4,1 8006134: b4 a4 20 00 add r4,r5,r4 8006138: 40 84 00 00 lbu r4,(r4+0) 800613c: e3 ff ff be bi 8006034 <_Scheduler_priority_Block+0x84> =============================================================================== 0800630c <_Scheduler_priority_Schedule>: 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 ); 800630c: 78 01 08 01 mvhi r1,0x801 8006310: 38 21 ea a0 ori r1,r1,0xeaa0 8006314: 2c 22 00 00 lhu r2,(r1+0) * @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 8006318: 78 01 08 01 mvhi r1,0x801 800631c: 38 21 e0 18 ori r1,r1,0xe018 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 8006320: 28 25 00 00 lw r5,(r1+0) 8006324: 20 42 ff ff andi r2,r2,0xffff 8006328: 34 01 00 ff mvi r1,255 800632c: 54 41 00 2d bgu r2,r1,80063e0 <_Scheduler_priority_Schedule+0xd4> 8006330: 78 03 08 01 mvhi r3,0x801 8006334: 38 63 c1 d4 ori r3,r3,0xc1d4 8006338: b4 62 10 00 add r2,r3,r2 800633c: 40 42 00 00 lbu r2,(r2+0) 8006340: 34 42 00 08 addi r2,r2,8 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8006344: 78 04 08 01 mvhi r4,0x801 8006348: 38 84 ea c0 ori r4,r4,0xeac0 800634c: b4 42 10 00 add r2,r2,r2 8006350: b4 82 20 00 add r4,r4,r2 8006354: 2c 81 00 00 lhu r1,(r4+0) 8006358: 34 04 00 ff mvi r4,255 800635c: 54 24 00 16 bgu r1,r4,80063b4 <_Scheduler_priority_Schedule+0xa8> 8006360: b4 61 08 00 add r1,r3,r1 8006364: 40 23 00 00 lbu r3,(r1+0) 8006368: 34 63 00 08 addi r3,r3,8 return (_Priority_Bits_index( major ) << 4) + 800636c: b4 42 08 00 add r1,r2,r2 8006370: b4 21 08 00 add r1,r1,r1 8006374: b4 21 08 00 add r1,r1,r1 8006378: b4 61 08 00 add r1,r3,r1 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 800637c: b4 21 10 00 add r2,r1,r1 8006380: b4 41 08 00 add r1,r2,r1 8006384: b4 21 08 00 add r1,r1,r1 8006388: b4 21 08 00 add r1,r1,r1 800638c: b4 a1 08 00 add r1,r5,r1 #include void _Scheduler_priority_Schedule(void) { _Scheduler_priority_Schedule_body(); } 8006390: 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 ); 8006394: 34 21 00 04 addi r1,r1,4 return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 8006398: 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 ] ) ) 800639c: 44 61 00 02 be r3,r1,80063a4 <_Scheduler_priority_Schedule+0x98><== NEVER TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); 80063a0: 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( 80063a4: 78 01 08 01 mvhi r1,0x801 80063a8: 38 21 ea 60 ori r1,r1,0xea60 80063ac: 58 22 00 14 sw (r1+20),r2 80063b0: c3 a0 00 00 ret { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 80063b4: 00 21 00 01 srui r1,r1,1 80063b8: 00 21 00 01 srui r1,r1,1 80063bc: 00 21 00 01 srui r1,r1,1 80063c0: 00 21 00 01 srui r1,r1,1 80063c4: 00 21 00 01 srui r1,r1,1 80063c8: 00 21 00 01 srui r1,r1,1 80063cc: 00 21 00 01 srui r1,r1,1 80063d0: 00 21 00 01 srui r1,r1,1 80063d4: b4 61 08 00 add r1,r3,r1 80063d8: 40 23 00 00 lbu r3,(r1+0) 80063dc: e3 ff ff e4 bi 800636c <_Scheduler_priority_Schedule+0x60> 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 ); 80063e0: 00 42 00 01 srui r2,r2,1 80063e4: 78 03 08 01 mvhi r3,0x801 80063e8: 00 42 00 01 srui r2,r2,1 80063ec: 38 63 c1 d4 ori r3,r3,0xc1d4 80063f0: 00 42 00 01 srui r2,r2,1 80063f4: 00 42 00 01 srui r2,r2,1 80063f8: 00 42 00 01 srui r2,r2,1 80063fc: 00 42 00 01 srui r2,r2,1 8006400: 00 42 00 01 srui r2,r2,1 8006404: 00 42 00 01 srui r2,r2,1 8006408: b4 62 10 00 add r2,r3,r2 800640c: 40 42 00 00 lbu r2,(r2+0) 8006410: e3 ff ff cd bi 8006344 <_Scheduler_priority_Schedule+0x38> =============================================================================== 080051a0 <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 80051a0: 37 9c ff f4 addi sp,sp,-12 80051a4: 5b 8b 00 0c sw (sp+12),r11 80051a8: 5b 8c 00 08 sw (sp+8),r12 80051ac: 5b 9d 00 04 sw (sp+4),ra uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 80051b0: 78 02 08 01 mvhi r2,0x801 80051b4: 38 42 e0 90 ori r2,r2,0xe090 }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 80051b8: 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(); 80051bc: 28 42 00 0c lw r2,(r2+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; 80051c0: 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) || 80051c4: 44 20 00 22 be r1,r0,800524c <_TOD_Validate+0xac> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 80051c8: 78 03 08 01 mvhi r3,0x801 80051cc: 38 63 e4 14 ori r3,r3,0xe414 80051d0: 28 61 00 00 lw r1,(r3+0) 80051d4: f8 00 60 6e calli 801d38c <__udivsi3> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 80051d8: 29 62 00 18 lw r2,(r11+24) 80051dc: 50 41 00 1c bgeu r2,r1,800524c <_TOD_Validate+0xac> (the_tod->ticks >= ticks_per_second) || 80051e0: 29 62 00 14 lw r2,(r11+20) 80051e4: 34 01 00 3b mvi r1,59 80051e8: 54 41 00 19 bgu r2,r1,800524c <_TOD_Validate+0xac> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 80051ec: 29 62 00 10 lw r2,(r11+16) 80051f0: 54 41 00 17 bgu r2,r1,800524c <_TOD_Validate+0xac> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 80051f4: 29 62 00 0c lw r2,(r11+12) 80051f8: 34 01 00 17 mvi r1,23 80051fc: 54 41 00 14 bgu r2,r1,800524c <_TOD_Validate+0xac> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 8005200: 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) || 8005204: 44 20 00 12 be r1,r0,800524c <_TOD_Validate+0xac> <== NEVER TAKEN (the_tod->month == 0) || 8005208: 34 02 00 0c mvi r2,12 800520c: 54 22 00 10 bgu r1,r2,800524c <_TOD_Validate+0xac> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 8005210: 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) || 8005214: 34 03 07 c3 mvi r3,1987 8005218: 50 62 00 0d bgeu r3,r2,800524c <_TOD_Validate+0xac> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 800521c: 29 63 00 08 lw r3,(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) || 8005220: 44 60 00 0b be r3,r0,800524c <_TOD_Validate+0xac> <== NEVER TAKEN (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 8005224: 20 42 00 03 andi r2,r2,0x3 8005228: 5c 40 00 02 bne r2,r0,8005230 <_TOD_Validate+0x90> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 800522c: 34 21 00 0d addi r1,r1,13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 8005230: 78 02 08 01 mvhi r2,0x801 8005234: b4 21 08 00 add r1,r1,r1 8005238: 38 42 ed 90 ori r2,r2,0xed90 800523c: b4 21 08 00 add r1,r1,r1 8005240: b4 41 08 00 add r1,r2,r1 8005244: 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( 8005248: f1 83 60 00 cmpgeu r12,r12,r3 if ( the_tod->day > days_in_month ) return false; return true; } 800524c: b9 80 08 00 mv r1,r12 8005250: 2b 9d 00 04 lw ra,(sp+4) 8005254: 2b 8b 00 0c lw r11,(sp+12) 8005258: 2b 8c 00 08 lw r12,(sp+8) 800525c: 37 9c 00 0c addi sp,sp,12 8005260: c3 a0 00 00 ret =============================================================================== 08006680 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 8006680: 37 9c ff e4 addi sp,sp,-28 8006684: 5b 8b 00 1c sw (sp+28),r11 8006688: 5b 8c 00 18 sw (sp+24),r12 800668c: 5b 8d 00 14 sw (sp+20),r13 8006690: 5b 8e 00 10 sw (sp+16),r14 8006694: 5b 8f 00 0c sw (sp+12),r15 8006698: 5b 90 00 08 sw (sp+8),r16 800669c: 5b 9d 00 04 sw (sp+4),ra 80066a0: b8 20 58 00 mv r11,r1 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 80066a4: 28 2f 00 10 lw r15,(r1+16) void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 80066a8: b8 40 60 00 mv r12,r2 80066ac: 20 70 00 ff andi r16,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 ); 80066b0: f8 00 03 fe calli 80076a8 <_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 ) 80066b4: 29 61 00 14 lw r1,(r11+20) 80066b8: 44 2c 00 04 be r1,r12,80066c8 <_Thread_Change_priority+0x48> _Thread_Set_priority( the_thread, new_priority ); 80066bc: b9 60 08 00 mv r1,r11 80066c0: b9 80 10 00 mv r2,r12 80066c4: f8 00 03 d5 calli 8007618 <_Thread_Set_priority> _ISR_Disable( level ); 80066c8: 90 00 60 00 rcsr r12,IE 80066cc: 34 0d ff fe mvi r13,-2 80066d0: a1 8d 68 00 and r13,r12,r13 80066d4: 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; 80066d8: 29 61 00 10 lw r1,(r11+16) if ( state != STATES_TRANSIENT ) { 80066dc: 34 02 00 04 mvi r2,4 80066e0: 44 22 00 1f be r1,r2,800675c <_Thread_Change_priority+0xdc> */ RTEMS_INLINE_ROUTINE bool _States_Is_transient ( States_Control the_states ) { return (the_states & STATES_TRANSIENT); 80066e4: 21 ef 00 04 andi r15,r15,0x4 /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 80066e8: 45 e0 00 10 be r15,r0,8006728 <_Thread_Change_priority+0xa8><== ALWAYS TAKEN the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 80066ec: d0 0c 00 00 wcsr IE,r12 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 80066f0: 78 03 08 01 mvhi r3,0x801 <== NOT EXECUTED 80066f4: 38 63 c3 30 ori r3,r3,0xc330 <== NOT EXECUTED 80066f8: 28 62 00 00 lw r2,(r3+0) <== NOT EXECUTED 80066fc: a0 22 08 00 and r1,r1,r2 <== NOT EXECUTED if ( _States_Is_waiting_on_thread_queue( state ) ) { 8006700: 5c 20 00 13 bne r1,r0,800674c <_Thread_Change_priority+0xcc><== NOT EXECUTED if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } 8006704: 2b 9d 00 04 lw ra,(sp+4) 8006708: 2b 8b 00 1c lw r11,(sp+28) 800670c: 2b 8c 00 18 lw r12,(sp+24) 8006710: 2b 8d 00 14 lw r13,(sp+20) 8006714: 2b 8e 00 10 lw r14,(sp+16) 8006718: 2b 8f 00 0c lw r15,(sp+12) 800671c: 2b 90 00 08 lw r16,(sp+8) 8006720: 37 9c 00 1c addi sp,sp,28 8006724: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 8006728: 34 02 ff fb mvi r2,-5 800672c: a0 22 10 00 and r2,r1,r2 */ state = the_thread->current_state; if ( state != STATES_TRANSIENT ) { /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 8006730: 59 62 00 10 sw (r11+16),r2 _ISR_Enable( level ); 8006734: 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); 8006738: 78 03 08 01 mvhi r3,0x801 800673c: 38 63 c3 30 ori r3,r3,0xc330 8006740: 28 62 00 00 lw r2,(r3+0) 8006744: a0 22 08 00 and r1,r1,r2 if ( _States_Is_waiting_on_thread_queue( state ) ) { 8006748: 44 20 ff ef be r1,r0,8006704 <_Thread_Change_priority+0x84> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 800674c: 29 61 00 44 lw r1,(r11+68) 8006750: b9 60 10 00 mv r2,r11 8006754: f8 00 03 74 calli 8007524 <_Thread_queue_Requeue> 8006758: e3 ff ff eb bi 8006704 <_Thread_Change_priority+0x84> 800675c: 78 0e 08 01 mvhi r14,0x801 */ RTEMS_INLINE_ROUTINE bool _States_Is_transient ( States_Control the_states ) { return (the_states & STATES_TRANSIENT); 8006760: 21 ef 00 04 andi r15,r15,0x4 8006764: 39 ce e0 18 ori r14,r14,0xe018 } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 8006768: 5d e0 00 06 bne r15,r0,8006780 <_Thread_Change_priority+0x100><== NEVER TAKEN * 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 ); 800676c: 59 60 00 10 sw (r11+16),r0 if ( prepend_it ) 8006770: 46 0f 00 13 be r16,r15,80067bc <_Thread_Change_priority+0x13c> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 8006774: 29 c2 00 28 lw r2,(r14+40) 8006778: b9 60 08 00 mv r1,r11 800677c: d8 40 00 00 call r2 _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 8006780: d0 0c 00 00 wcsr IE,r12 8006784: 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(); 8006788: 29 c1 00 08 lw r1,(r14+8) 800678c: 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 ); 8006790: 78 01 08 01 mvhi r1,0x801 8006794: 38 21 ea 60 ori r1,r1,0xea60 8006798: 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() && 800679c: 28 23 00 14 lw r3,(r1+20) 80067a0: 44 43 00 05 be r2,r3,80067b4 <_Thread_Change_priority+0x134> 80067a4: 40 42 00 70 lbu r2,(r2+112) 80067a8: 44 40 00 03 be r2,r0,80067b4 <_Thread_Change_priority+0x134> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 80067ac: 34 02 00 01 mvi r2,1 80067b0: 30 22 00 0c sb (r1+12),r2 _ISR_Enable( level ); 80067b4: d0 0c 00 00 wcsr IE,r12 80067b8: e3 ff ff d3 bi 8006704 <_Thread_Change_priority+0x84> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 80067bc: 29 c2 00 24 lw r2,(r14+36) 80067c0: b9 60 08 00 mv r1,r11 80067c4: d8 40 00 00 call r2 80067c8: e3 ff ff ee bi 8006780 <_Thread_Change_priority+0x100> =============================================================================== 0800d404 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 800d404: 37 9c ff f8 addi sp,sp,-8 800d408: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 800d40c: 37 82 00 08 addi r2,sp,8 800d410: f8 00 00 a7 calli 800d6ac <_Thread_Get> switch ( location ) { 800d414: 2b 82 00 08 lw r2,(sp+8) 800d418: 5c 40 00 0a bne r2,r0,800d440 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 800d41c: 78 03 08 02 mvhi r3,0x802 800d420: 38 63 6d 70 ori r3,r3,0x6d70 800d424: 28 62 00 00 lw r2,(r3+0) 800d428: fb ff ff 65 calli 800d1bc <_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; 800d42c: 78 01 08 02 mvhi r1,0x802 800d430: 38 21 9a 00 ori r1,r1,0x9a00 800d434: 28 22 00 00 lw r2,(r1+0) --level; 800d438: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 800d43c: 58 22 00 00 sw (r1+0),r2 | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 800d440: 2b 9d 00 04 lw ra,(sp+4) 800d444: 37 9c 00 08 addi sp,sp,8 800d448: c3 a0 00 00 ret =============================================================================== 080069a4 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 80069a4: 37 9c ff bc addi sp,sp,-68 80069a8: 5b 8b 00 3c sw (sp+60),r11 80069ac: 5b 8c 00 38 sw (sp+56),r12 80069b0: 5b 8d 00 34 sw (sp+52),r13 80069b4: 5b 8e 00 30 sw (sp+48),r14 80069b8: 5b 8f 00 2c sw (sp+44),r15 80069bc: 5b 90 00 28 sw (sp+40),r16 80069c0: 5b 91 00 24 sw (sp+36),r17 80069c4: 5b 92 00 20 sw (sp+32),r18 80069c8: 5b 93 00 1c sw (sp+28),r19 80069cc: 5b 94 00 18 sw (sp+24),r20 80069d0: 5b 95 00 14 sw (sp+20),r21 80069d4: 5b 96 00 10 sw (sp+16),r22 80069d8: 5b 97 00 0c sw (sp+12),r23 80069dc: 5b 98 00 08 sw (sp+8),r24 80069e0: 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; 80069e4: 78 01 08 01 mvhi r1,0x801 80069e8: 38 21 ea 60 ori r1,r1,0xea60 80069ec: 28 2c 00 10 lw r12,(r1+16) _ISR_Disable( level ); 80069f0: 90 00 18 00 rcsr r3,IE 80069f4: 34 01 ff fe mvi r1,-2 80069f8: a0 61 08 00 and r1,r3,r1 80069fc: d0 01 00 00 wcsr IE,r1 while ( _Thread_Dispatch_necessary == true ) { 8006a00: 78 0e 08 01 mvhi r14,0x801 8006a04: 39 ce ea 60 ori r14,r14,0xea60 8006a08: 41 c2 00 0c lbu r2,(r14+12) 8006a0c: 78 11 08 01 mvhi r17,0x801 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); 8006a10: b8 60 08 00 mv r1,r3 while ( _Thread_Dispatch_necessary == true ) { 8006a14: 20 42 00 ff andi r2,r2,0xff 8006a18: 3a 31 e8 e0 ori r17,r17,0xe8e0 8006a1c: 44 40 00 4d be r2,r0,8006b50 <_Thread_Dispatch+0x1ac> heir = _Thread_Heir; 8006a20: 29 cd 00 14 lw r13,(r14+20) * 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; 8006a24: 34 01 00 01 mvi r1,1 8006a28: 5a 21 00 00 sw (r17+0),r1 #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 8006a2c: 31 c0 00 0c sb (r14+12),r0 _Thread_Executing = heir; 8006a30: 59 cd 00 10 sw (r14+16),r13 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); 8006a34: b8 60 08 00 mv r1,r3 /* * 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 ) 8006a38: 45 8d 00 46 be r12,r13,8006b50 <_Thread_Dispatch+0x1ac> 8006a3c: 78 15 08 01 mvhi r21,0x801 8006a40: 78 14 08 01 mvhi r20,0x801 8006a44: 78 13 08 01 mvhi r19,0x801 8006a48: 78 0f 08 01 mvhi r15,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; 8006a4c: 78 16 08 01 mvhi r22,0x801 8006a50: 37 98 00 40 addi r24,sp,64 8006a54: 3a b5 e8 68 ori r21,r21,0xe868 8006a58: 3a 94 e9 4c ori r20,r20,0xe94c 8006a5c: 3a 73 e1 a0 ori r19,r19,0xe1a0 8006a60: 39 ef e1 a4 ori r15,r15,0xe1a4 */ #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 ) 8006a64: 34 12 00 01 mvi r18,1 heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 8006a68: 3a d6 e8 78 ori r22,r22,0xe878 #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 8006a6c: 34 17 ff fe mvi r23,-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 ) { 8006a70: b9 c0 80 00 mv r16,r14 */ #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 ) 8006a74: 29 a1 00 78 lw r1,(r13+120) 8006a78: 44 32 00 54 be r1,r18,8006bc8 <_Thread_Dispatch+0x224> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; _ISR_Enable( level ); 8006a7c: d0 03 00 00 wcsr IE,r3 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 8006a80: bb 00 08 00 mv r1,r24 8006a84: ba a0 10 00 mv r2,r21 8006a88: fb ff f8 d9 calli 8004dec <_TOD_Get_with_nanoseconds> #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 8006a8c: 2b 84 00 44 lw r4,(sp+68) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006a90: 29 83 00 84 lw r3,(r12+132) 8006a94: 29 88 00 80 lw r8,(r12+128) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006a98: 29 c5 00 24 lw r5,(r14+36) 8006a9c: 2b 86 00 40 lw r6,(sp+64) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006aa0: b4 83 18 00 add r3,r4,r3 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006aa4: 29 c1 00 20 lw r1,(r14+32) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006aa8: f4 83 48 00 cmpgu r9,r4,r3 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006aac: c8 65 28 00 sub r5,r3,r5 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006ab0: b4 c8 40 00 add r8,r6,r8 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006ab4: f4 a3 18 00 cmpgu r3,r5,r3 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006ab8: b5 28 38 00 add r7,r9,r8 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006abc: c8 e1 38 00 sub r7,r7,r1 8006ac0: c8 e3 38 00 sub r7,r7,r3 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8006ac4: 2a 83 00 00 lw r3,(r20+0) 8006ac8: 59 87 00 80 sw (r12+128),r7 8006acc: 59 85 00 84 sw (r12+132),r5 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 8006ad0: 59 c6 00 20 sw (r14+32),r6 8006ad4: 59 c4 00 24 sw (r14+36),r4 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8006ad8: 44 60 00 05 be r3,r0,8006aec <_Thread_Dispatch+0x148> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 8006adc: 28 61 00 00 lw r1,(r3+0) 8006ae0: 59 81 01 10 sw (r12+272),r1 *_Thread_libc_reent = heir->libc_reent; 8006ae4: 29 a1 01 10 lw r1,(r13+272) 8006ae8: 58 61 00 00 sw (r3+0),r1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 8006aec: 2a 6b 00 00 lw r11,(r19+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 ) { 8006af0: 45 6f 00 07 be r11,r15,8006b0c <_Thread_Dispatch+0x168> <== NEVER TAKEN const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 8006af4: 29 63 00 08 lw r3,(r11+8) 8006af8: b9 80 08 00 mv r1,r12 8006afc: b9 a0 10 00 mv r2,r13 8006b00: d8 60 00 00 call r3 8006b04: 29 6b 00 00 lw r11,(r11+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 ) { 8006b08: 5d 6f ff fb bne r11,r15,8006af4 <_Thread_Dispatch+0x150> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 8006b0c: 35 81 00 bc addi r1,r12,188 8006b10: 35 a2 00 bc addi r2,r13,188 8006b14: f8 00 05 37 calli 8007ff0 <_CPU_Context_switch> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 8006b18: 29 cc 00 10 lw r12,(r14+16) _ISR_Disable( level ); 8006b1c: 90 00 18 00 rcsr r3,IE 8006b20: a0 77 20 00 and r4,r3,r23 8006b24: d0 04 00 00 wcsr IE,r4 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 8006b28: 42 04 00 0c lbu r4,(r16+12) 8006b2c: ba 00 70 00 mv r14,r16 8006b30: 20 84 00 ff andi r4,r4,0xff 8006b34: 44 80 00 06 be r4,r0,8006b4c <_Thread_Dispatch+0x1a8> heir = _Thread_Heir; 8006b38: 2a 0d 00 14 lw r13,(r16+20) 8006b3c: 5a 32 00 00 sw (r17+0),r18 #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 8006b40: 32 00 00 0c sb (r16+12),r0 _Thread_Executing = heir; 8006b44: 5a 0d 00 10 sw (r16+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 ) 8006b48: 5d ac ff cb bne r13,r12,8006a74 <_Thread_Dispatch+0xd0> <== ALWAYS TAKEN #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 8006b4c: b8 60 08 00 mv r1,r3 8006b50: 5a 20 00 00 sw (r17+0),r0 post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 8006b54: d0 01 00 00 wcsr IE,r1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 8006b58: 78 01 08 01 mvhi r1,0x801 8006b5c: 38 21 e9 50 ori r1,r1,0xe950 8006b60: 28 2b 00 00 lw r11,(r1+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 ) { 8006b64: 78 0d 08 01 mvhi r13,0x801 8006b68: 39 ad e9 54 ori r13,r13,0xe954 8006b6c: 45 6d 00 06 be r11,r13,8006b84 <_Thread_Dispatch+0x1e0> const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 8006b70: 29 62 00 08 lw r2,(r11+8) 8006b74: b9 80 08 00 mv r1,r12 8006b78: d8 40 00 00 call r2 8006b7c: 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 ) { 8006b80: 5d 6d ff fc bne r11,r13,8006b70 <_Thread_Dispatch+0x1cc> <== NEVER TAKEN 8006b84: 2b 9d 00 04 lw ra,(sp+4) 8006b88: 2b 8b 00 3c lw r11,(sp+60) 8006b8c: 2b 8c 00 38 lw r12,(sp+56) 8006b90: 2b 8d 00 34 lw r13,(sp+52) 8006b94: 2b 8e 00 30 lw r14,(sp+48) 8006b98: 2b 8f 00 2c lw r15,(sp+44) 8006b9c: 2b 90 00 28 lw r16,(sp+40) 8006ba0: 2b 91 00 24 lw r17,(sp+36) 8006ba4: 2b 92 00 20 lw r18,(sp+32) 8006ba8: 2b 93 00 1c lw r19,(sp+28) 8006bac: 2b 94 00 18 lw r20,(sp+24) 8006bb0: 2b 95 00 14 lw r21,(sp+20) 8006bb4: 2b 96 00 10 lw r22,(sp+16) 8006bb8: 2b 97 00 0c lw r23,(sp+12) 8006bbc: 2b 98 00 08 lw r24,(sp+8) 8006bc0: 37 9c 00 44 addi sp,sp,68 8006bc4: c3 a0 00 00 ret #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; 8006bc8: 2a c1 00 00 lw r1,(r22+0) 8006bcc: 59 a1 00 74 sw (r13+116),r1 8006bd0: e3 ff ff ab bi 8006a7c <_Thread_Dispatch+0xd8> =============================================================================== 0800bdc0 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 800bdc0: 37 9c ff f4 addi sp,sp,-12 800bdc4: 5b 8b 00 0c sw (sp+12),r11 800bdc8: 5b 8c 00 08 sw (sp+8),r12 800bdcc: 5b 9d 00 04 sw (sp+4),ra #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 800bdd0: 78 01 08 01 mvhi r1,0x801 800bdd4: 38 21 ea 60 ori r1,r1,0xea60 800bdd8: 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; 800bddc: 29 61 00 a8 lw r1,(r11+168) _ISR_Set_level(level); 800bde0: 64 21 00 00 cmpei r1,r1,0 800bde4: 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; 800bde8: 78 03 08 01 mvhi r3,0x801 800bdec: 38 63 e7 2c ori r3,r3,0xe72c 800bdf0: 40 6c 00 00 lbu r12,(r3+0) doneConstructors = true; 800bdf4: 34 04 00 01 mvi r4,1 ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 800bdf8: 78 02 08 00 mvhi r2,0x800 800bdfc: b9 60 08 00 mv r1,r11 800be00: 38 42 78 d8 ori r2,r2,0x78d8 800be04: 30 64 00 00 sb (r3+0),r4 800be08: fb ff ee d0 calli 8007948 <_User_extensions_Iterate> _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 800be0c: fb ff eb 72 calli 8006bd4 <_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) */ { 800be10: 45 80 00 0b be r12,r0,800be3c <_Thread_Handler+0x7c> _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 800be14: 29 61 00 90 lw r1,(r11+144) 800be18: 44 20 00 0c be r1,r0,800be48 <_Thread_Handler+0x88> <== ALWAYS TAKEN } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 800be1c: 78 02 08 00 mvhi r2,0x800 800be20: b9 60 08 00 mv r1,r11 800be24: 38 42 78 f8 ori r2,r2,0x78f8 800be28: fb ff ee c8 calli 8007948 <_User_extensions_Iterate> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 800be2c: 34 01 00 00 mvi r1,0 800be30: 34 02 00 01 mvi r2,1 800be34: 34 03 00 05 mvi r3,5 800be38: fb ff e5 83 calli 8005444 <_Internal_error_Occurred> * _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) */ { INIT_NAME (); 800be3c: fb ff d0 71 calli 8000000 _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 800be40: 29 61 00 90 lw r1,(r11+144) 800be44: 5c 20 ff f6 bne r1,r0,800be1c <_Thread_Handler+0x5c> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 800be48: 29 62 00 8c lw r2,(r11+140) 800be4c: 29 61 00 98 lw r1,(r11+152) 800be50: d8 40 00 00 call r2 #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 800be54: 59 61 00 28 sw (r11+40),r1 800be58: e3 ff ff f1 bi 800be1c <_Thread_Handler+0x5c> =============================================================================== 08006f24 <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 8006f24: 37 9c ff f4 addi sp,sp,-12 8006f28: 5b 8b 00 0c sw (sp+12),r11 8006f2c: 5b 8c 00 08 sw (sp+8),r12 8006f30: 5b 9d 00 04 sw (sp+4),ra uint32_t ticks_per_timeslice = 8006f34: 78 01 08 01 mvhi r1,0x801 8006f38: 38 21 b9 9c ori r1,r1,0xb99c #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 8006f3c: 28 23 00 28 lw r3,(r1+40) #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = 8006f40: 28 2b 00 14 lw r11,(r1+20) rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 8006f44: 28 2c 00 08 lw r12,(r1+8) rtems_configuration_get_maximum_extensions(); rtems_stack_allocate_init_hook stack_allocate_init_hook = 8006f48: 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 || 8006f4c: 44 60 00 1f be r3,r0,8006fc8 <_Thread_Handler_initialization+0xa4><== NEVER TAKEN 8006f50: 28 23 00 2c lw r3,(r1+44) 8006f54: 44 60 00 1d be r3,r0,8006fc8 <_Thread_Handler_initialization+0xa4> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 8006f58: 44 40 00 03 be r2,r0,8006f64 <_Thread_Handler_initialization+0x40> (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 8006f5c: 28 21 00 04 lw r1,(r1+4) 8006f60: d8 40 00 00 call r2 _Thread_Dispatch_necessary = false; 8006f64: 78 08 08 01 mvhi r8,0x801 8006f68: 39 08 ea 60 ori r8,r8,0xea60 _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 8006f6c: 78 0a 08 01 mvhi r10,0x801 _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8006f70: 78 09 08 01 mvhi r9,0x801 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 8006f74: 78 01 08 01 mvhi r1,0x801 ); if ( stack_allocate_init_hook != NULL ) (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); _Thread_Dispatch_necessary = false; 8006f78: 31 00 00 0c sb (r8+12),r0 _Thread_Executing = NULL; 8006f7c: 59 00 00 10 sw (r8+16),r0 _Thread_Heir = NULL; 8006f80: 59 00 00 14 sw (r8+20),r0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 8006f84: 39 4a e9 5c ori r10,r10,0xe95c _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8006f88: 39 29 e8 78 ori r9,r9,0xe878 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 8006f8c: 38 21 e9 d0 ori r1,r1,0xe9d0 8006f90: 34 02 00 01 mvi r2,1 8006f94: 34 03 00 01 mvi r3,1 8006f98: 34 04 00 01 mvi r4,1 8006f9c: 34 05 01 28 mvi r5,296 8006fa0: 34 06 00 00 mvi r6,0 8006fa4: 34 07 00 08 mvi r7,8 _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 8006fa8: 59 4c 00 00 sw (r10+0),r12 _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8006fac: 59 2b 00 00 sw (r9+0),r11 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 8006fb0: fb ff fb 0b calli 8005bdc <_Objects_Initialize_information> false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 8006fb4: 2b 9d 00 04 lw ra,(sp+4) 8006fb8: 2b 8b 00 0c lw r11,(sp+12) 8006fbc: 2b 8c 00 08 lw r12,(sp+8) 8006fc0: 37 9c 00 0c addi sp,sp,12 8006fc4: c3 a0 00 00 ret _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 8006fc8: 34 01 00 00 mvi r1,0 8006fcc: 34 02 00 01 mvi r2,1 8006fd0: 34 03 00 0e mvi r3,14 8006fd4: fb ff f9 1c calli 8005444 <_Internal_error_Occurred> =============================================================================== 0800a424 <_Thread_blocking_operation_Cancel>: Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 800a424: 37 9c ff f8 addi sp,sp,-8 800a428: 5b 8b 00 08 sw (sp+8),r11 800a42c: 5b 9d 00 04 sw (sp+4),ra 800a430: b8 40 58 00 mv r11,r2 /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 800a434: 28 42 00 50 lw r2,(r2+80) #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 800a438: 59 60 00 44 sw (r11+68),r0 /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 800a43c: 34 01 00 02 mvi r1,2 800a440: 44 41 00 0b be r2,r1,800a46c <_Thread_blocking_operation_Cancel+0x48><== NEVER TAKEN _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); (void) _Watchdog_Remove( &the_thread->Timer ); } else _ISR_Enable( level ); 800a444: d0 03 00 00 wcsr IE,r3 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800a448: 78 01 08 01 mvhi r1,0x801 800a44c: 38 21 c3 38 ori r1,r1,0xc338 800a450: 28 22 00 00 lw r2,(r1+0) 800a454: b9 60 08 00 mv r1,r11 800a458: f8 00 00 0b calli 800a484 <_Thread_Clear_state> #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 800a45c: 2b 9d 00 04 lw ra,(sp+4) 800a460: 2b 8b 00 08 lw r11,(sp+8) 800a464: 37 9c 00 08 addi sp,sp,8 800a468: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 800a46c: 34 01 00 03 mvi r1,3 <== NOT EXECUTED 800a470: 59 61 00 50 sw (r11+80),r1 <== NOT EXECUTED * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 800a474: d0 03 00 00 wcsr IE,r3 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 800a478: 35 61 00 48 addi r1,r11,72 <== NOT EXECUTED 800a47c: fb ff f5 ed calli 8007c30 <_Watchdog_Remove> <== NOT EXECUTED 800a480: e3 ff ff f2 bi 800a448 <_Thread_blocking_operation_Cancel+0x24><== NOT EXECUTED =============================================================================== 08006fd8 <_Thread_queue_Dequeue>: #include Thread_Control *_Thread_queue_Dequeue( Thread_queue_Control *the_thread_queue ) { 8006fd8: 37 9c ff f8 addi sp,sp,-8 8006fdc: 5b 8b 00 08 sw (sp+8),r11 8006fe0: 5b 9d 00 04 sw (sp+4),ra Thread_Control *(*dequeue_p)( Thread_queue_Control * ); Thread_Control *the_thread; ISR_Level level; Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 8006fe4: 28 23 00 34 lw r3,(r1+52) #include Thread_Control *_Thread_queue_Dequeue( Thread_queue_Control *the_thread_queue ) { 8006fe8: b8 20 58 00 mv r11,r1 Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) dequeue_p = _Thread_queue_Dequeue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ dequeue_p = _Thread_queue_Dequeue_fifo; 8006fec: 78 02 08 00 mvhi r2,0x800 Thread_Control *(*dequeue_p)( Thread_queue_Control * ); Thread_Control *the_thread; ISR_Level level; Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 8006ff0: 34 01 00 01 mvi r1,1 dequeue_p = _Thread_queue_Dequeue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ dequeue_p = _Thread_queue_Dequeue_fifo; 8006ff4: 38 42 a5 40 ori r2,r2,0xa540 Thread_Control *(*dequeue_p)( Thread_queue_Control * ); Thread_Control *the_thread; ISR_Level level; Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 8006ff8: 44 61 00 0d be r3,r1,800702c <_Thread_queue_Dequeue+0x54> dequeue_p = _Thread_queue_Dequeue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ dequeue_p = _Thread_queue_Dequeue_fifo; the_thread = (*dequeue_p)( the_thread_queue ); 8006ffc: b9 60 08 00 mv r1,r11 8007000: d8 40 00 00 call r2 _ISR_Disable( level ); 8007004: 90 00 10 00 rcsr r2,IE 8007008: 34 03 ff fe mvi r3,-2 800700c: a0 43 18 00 and r3,r2,r3 8007010: d0 03 00 00 wcsr IE,r3 if ( !the_thread ) { 8007014: 44 20 00 0f be r1,r0,8007050 <_Thread_queue_Dequeue+0x78> (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; the_thread = _Thread_Executing; } } _ISR_Enable( level ); 8007018: d0 02 00 00 wcsr IE,r2 return the_thread; } 800701c: 2b 9d 00 04 lw ra,(sp+4) 8007020: 2b 8b 00 08 lw r11,(sp+8) 8007024: 37 9c 00 08 addi sp,sp,8 8007028: c3 a0 00 00 ret Thread_Control *the_thread; ISR_Level level; Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) dequeue_p = _Thread_queue_Dequeue_priority; 800702c: 78 02 08 00 mvhi r2,0x800 8007030: 38 42 70 78 ori r2,r2,0x7078 else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ dequeue_p = _Thread_queue_Dequeue_fifo; the_thread = (*dequeue_p)( the_thread_queue ); 8007034: b9 60 08 00 mv r1,r11 8007038: d8 40 00 00 call r2 _ISR_Disable( level ); 800703c: 90 00 10 00 rcsr r2,IE 8007040: 34 03 ff fe mvi r3,-2 8007044: a0 43 18 00 and r3,r2,r3 8007048: d0 03 00 00 wcsr IE,r3 if ( !the_thread ) { 800704c: 5c 20 ff f3 bne r1,r0,8007018 <_Thread_queue_Dequeue+0x40> sync_state = the_thread_queue->sync_state; if ( (sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 8007050: 29 64 00 30 lw r4,(r11+48) 8007054: 34 03 00 01 mvi r3,1 8007058: 34 84 ff ff addi r4,r4,-1 800705c: 54 83 ff ef bgu r4,r3,8007018 <_Thread_queue_Dequeue+0x40> <== ALWAYS TAKEN (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; the_thread = _Thread_Executing; 8007060: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8007064: 38 21 ea 60 ori r1,r1,0xea60 <== NOT EXECUTED _ISR_Disable( level ); if ( !the_thread ) { sync_state = the_thread_queue->sync_state; if ( (sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 8007068: 34 03 00 03 mvi r3,3 <== NOT EXECUTED the_thread = _Thread_Executing; 800706c: 28 21 00 10 lw r1,(r1+16) <== NOT EXECUTED _ISR_Disable( level ); if ( !the_thread ) { sync_state = the_thread_queue->sync_state; if ( (sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 8007070: 59 63 00 30 sw (r11+48),r3 <== NOT EXECUTED 8007074: e3 ff ff e9 bi 8007018 <_Thread_queue_Dequeue+0x40> <== NOT EXECUTED =============================================================================== 0800a60c <_Thread_queue_Enqueue_fifo>: ) { Thread_blocking_operation_States sync_state; ISR_Level level; _ISR_Disable( level ); 800a60c: 90 00 20 00 rcsr r4,IE 800a610: 34 05 ff fe mvi r5,-2 800a614: a0 85 28 00 and r5,r4,r5 800a618: d0 05 00 00 wcsr IE,r5 sync_state = the_thread_queue->sync_state; 800a61c: 28 25 00 30 lw r5,(r1+48) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) { 800a620: 34 06 00 01 mvi r6,1 ISR_Level level; _ISR_Disable( level ); sync_state = the_thread_queue->sync_state; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 800a624: 58 20 00 30 sw (r1+48),r0 if (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) { 800a628: 44 a6 00 04 be r5,r6,800a638 <_Thread_queue_Enqueue_fifo+0x2c><== ALWAYS TAKEN * 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; 800a62c: 58 64 00 00 sw (r3+0),r4 <== NOT EXECUTED return sync_state; } 800a630: b8 a0 08 00 mv r1,r5 <== NOT EXECUTED 800a634: c3 a0 00 00 ret <== NOT EXECUTED Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 800a638: 28 23 00 08 lw r3,(r1+8) RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 800a63c: 34 26 00 04 addi r6,r1,4 Chain_Node *old_last = tail->previous; the_node->next = tail; 800a640: 58 46 00 00 sw (r2+0),r6 tail->previous = the_node; 800a644: 58 22 00 08 sw (r1+8),r2 old_last->next = the_node; 800a648: 58 62 00 00 sw (r3+0),r2 the_node->previous = old_last; 800a64c: 58 43 00 04 sw (r2+4),r3 if (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) { _Chain_Append_unprotected( &the_thread_queue->Queues.Fifo, &the_thread->Object.Node ); the_thread->Wait.queue = the_thread_queue; 800a650: 58 41 00 44 sw (r2+68),r1 the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; _ISR_Enable( level ); 800a654: d0 04 00 00 wcsr IE,r4 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return sync_state; } 800a658: b8 a0 08 00 mv r1,r5 800a65c: c3 a0 00 00 ret =============================================================================== 08007284 <_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 ) { 8007284: 37 9c ff f4 addi sp,sp,-12 8007288: 5b 8b 00 0c sw (sp+12),r11 800728c: 5b 8c 00 08 sw (sp+8),r12 8007290: 5b 8d 00 04 sw (sp+4),r13 Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 8007294: 28 45 00 14 lw r5,(r2+20) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8007298: 34 47 00 3c addi r7,r2,60 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 800729c: 34 46 00 38 addi r6,r2,56 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 80072a0: 00 a4 00 01 srui r4,r5,1 80072a4: 78 0c 08 01 mvhi r12,0x801 80072a8: 00 84 00 01 srui r4,r4,1 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 80072ac: 58 47 00 38 sw (r2+56),r7 80072b0: 00 84 00 01 srui r4,r4,1 head->previous = NULL; tail->previous = head; 80072b4: 58 46 00 40 sw (r2+64),r6 80072b8: 00 84 00 01 srui r4,r4,1 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 80072bc: 58 40 00 3c sw (r2+60),r0 80072c0: 00 84 00 01 srui r4,r4,1 RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_reverse_search ( Priority_Control the_priority ) { return ( the_priority & TASK_QUEUE_DATA_REVERSE_SEARCH_MASK ); 80072c4: 20 a8 00 20 andi r8,r5,0x20 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 80072c8: 00 84 00 01 srui r4,r4,1 header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; 80072cc: 28 27 00 38 lw r7,(r1+56) 80072d0: b4 84 30 00 add r6,r4,r4 80072d4: 39 8c e0 d8 ori r12,r12,0xe0d8 if ( _Thread_queue_Is_reverse_search( priority ) ) 80072d8: 5d 00 00 18 bne r8,r0,8007338 <_Thread_queue_Enqueue_priority+0xb4> * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 80072dc: b4 c4 20 00 add r4,r6,r4 80072e0: b4 84 20 00 add r4,r4,r4 80072e4: b4 84 20 00 add r4,r4,r4 80072e8: b4 24 60 00 add r12,r1,r4 if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 80072ec: 34 0d ff fe mvi r13,-2 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 )); 80072f0: 35 8b 00 04 addi r11,r12,4 80072f4: 90 00 40 00 rcsr r8,IE 80072f8: a1 0d 50 00 and r10,r8,r13 80072fc: d0 0a 00 00 wcsr IE,r10 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007300: 29 84 00 00 lw r4,(r12+0) 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 ) ) { 8007304: 5c 8b 00 04 bne r4,r11,8007314 <_Thread_queue_Enqueue_priority+0x90> 8007308: e0 00 00 24 bi 8007398 <_Thread_queue_Enqueue_priority+0x114> if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; 800730c: 28 84 00 00 lw r4,(r4+0) 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 ) ) { 8007310: 44 8b 00 23 be r4,r11,800739c <_Thread_queue_Enqueue_priority+0x118> search_priority = search_thread->current_priority; 8007314: 28 86 00 14 lw r6,(r4+20) if ( priority <= search_priority ) 8007318: 50 c5 00 21 bgeu r6,r5,800739c <_Thread_queue_Enqueue_priority+0x118> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 800731c: d0 08 00 00 wcsr IE,r8 8007320: d0 0a 00 00 wcsr IE,r10 RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 8007324: 28 89 00 10 lw r9,(r4+16) 8007328: a0 e9 48 00 and r9,r7,r9 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 800732c: 5d 20 ff f8 bne r9,r0,800730c <_Thread_queue_Enqueue_priority+0x88> _ISR_Enable( level ); 8007330: d0 08 00 00 wcsr IE,r8 goto restart_forward_search; 8007334: e3 ff ff f0 bi 80072f4 <_Thread_queue_Enqueue_priority+0x70> * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007338: b4 c4 20 00 add r4,r6,r4 800733c: b4 84 20 00 add r4,r4,r4 8007340: b4 84 20 00 add r4,r4,r4 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 8007344: 34 0d ff fe mvi r13,-2 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007348: b4 24 50 00 add r10,r1,r4 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 800734c: 41 86 00 00 lbu r6,(r12+0) 8007350: 34 c6 00 01 addi r6,r6,1 _ISR_Disable( level ); 8007354: 90 00 40 00 rcsr r8,IE 8007358: a1 0d 58 00 and r11,r8,r13 800735c: d0 0b 00 00 wcsr IE,r11 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007360: 29 44 00 08 lw r4,(r10+8) 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 ) ) { 8007364: 5c 8a 00 04 bne r4,r10,8007374 <_Thread_queue_Enqueue_priority+0xf0> 8007368: e0 00 00 18 bi 80073c8 <_Thread_queue_Enqueue_priority+0x144> if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) search_thread->Object.Node.previous; 800736c: 28 84 00 04 lw r4,(r4+4) restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8007370: 44 8a 00 16 be r4,r10,80073c8 <_Thread_queue_Enqueue_priority+0x144> search_priority = search_thread->current_priority; 8007374: 28 86 00 14 lw r6,(r4+20) if ( priority >= search_priority ) 8007378: 50 a6 00 14 bgeu r5,r6,80073c8 <_Thread_queue_Enqueue_priority+0x144> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 800737c: d0 08 00 00 wcsr IE,r8 8007380: d0 0b 00 00 wcsr IE,r11 8007384: 28 89 00 10 lw r9,(r4+16) 8007388: a0 e9 48 00 and r9,r7,r9 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 800738c: 5d 20 ff f8 bne r9,r0,800736c <_Thread_queue_Enqueue_priority+0xe8><== ALWAYS TAKEN _ISR_Enable( level ); 8007390: d0 08 00 00 wcsr IE,r8 <== NOT EXECUTED goto restart_reverse_search; 8007394: e3 ff ff ee bi 800734c <_Thread_queue_Enqueue_priority+0xc8><== NOT EXECUTED if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 8007398: 34 06 ff ff mvi r6,-1 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 800739c: 28 27 00 30 lw r7,(r1+48) 80073a0: 34 0a 00 01 mvi r10,1 80073a4: b9 00 48 00 mv r9,r8 80073a8: 44 ea 00 1b be r7,r10,8007414 <_Thread_queue_Enqueue_priority+0x190><== ALWAYS TAKEN * 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; 80073ac: 58 69 00 00 sw (r3+0),r9 <== NOT EXECUTED return the_thread_queue->sync_state; } 80073b0: b8 e0 08 00 mv r1,r7 80073b4: 2b 8b 00 0c lw r11,(sp+12) 80073b8: 2b 8c 00 08 lw r12,(sp+8) 80073bc: 2b 8d 00 04 lw r13,(sp+4) 80073c0: 37 9c 00 0c addi sp,sp,12 80073c4: c3 a0 00 00 ret } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 80073c8: 28 27 00 30 lw r7,(r1+48) 80073cc: 34 0a 00 01 mvi r10,1 80073d0: b9 00 48 00 mv r9,r8 80073d4: 5c ea ff f6 bne r7,r10,80073ac <_Thread_queue_Enqueue_priority+0x128><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 80073d8: 58 20 00 30 sw (r1+48),r0 if ( priority == search_priority ) 80073dc: 44 a6 00 1d be r5,r6,8007450 <_Thread_queue_Enqueue_priority+0x1cc> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 80073e0: 28 83 00 00 lw r3,(r4+0) the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 80073e4: 58 44 00 04 sw (r2+4),r4 search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 80073e8: 58 43 00 00 sw (r2+0),r3 the_node->previous = search_node; search_node->next = the_node; 80073ec: 58 82 00 00 sw (r4+0),r2 next_node->previous = the_node; 80073f0: 58 62 00 04 sw (r3+4),r2 the_thread->Wait.queue = the_thread_queue; 80073f4: 58 41 00 44 sw (r2+68),r1 _ISR_Enable( level ); 80073f8: d0 08 00 00 wcsr IE,r8 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 80073fc: b8 e0 08 00 mv r1,r7 8007400: 2b 8b 00 0c lw r11,(sp+12) 8007404: 2b 8c 00 08 lw r12,(sp+8) 8007408: 2b 8d 00 04 lw r13,(sp+4) 800740c: 37 9c 00 0c addi sp,sp,12 8007410: c3 a0 00 00 ret if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8007414: 58 20 00 30 sw (r1+48),r0 if ( priority == search_priority ) 8007418: 44 a6 00 0e be r5,r6,8007450 <_Thread_queue_Enqueue_priority+0x1cc> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 800741c: 28 83 00 04 lw r3,(r4+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8007420: 58 44 00 00 sw (r2+0),r4 the_node->previous = previous_node; 8007424: 58 43 00 04 sw (r2+4),r3 previous_node->next = the_node; 8007428: 58 62 00 00 sw (r3+0),r2 search_node->previous = the_node; 800742c: 58 82 00 04 sw (r4+4),r2 the_thread->Wait.queue = the_thread_queue; 8007430: 58 41 00 44 sw (r2+68),r1 _ISR_Enable( level ); 8007434: d0 08 00 00 wcsr IE,r8 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007438: b8 e0 08 00 mv r1,r7 800743c: 2b 8b 00 0c lw r11,(sp+12) 8007440: 2b 8c 00 08 lw r12,(sp+8) 8007444: 2b 8d 00 04 lw r13,(sp+4) 8007448: 37 9c 00 0c addi sp,sp,12 800744c: c3 a0 00 00 ret _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 8007450: 28 83 00 40 lw r3,(r4+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 ); 8007454: 34 85 00 3c addi r5,r4,60 previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8007458: 58 45 00 00 sw (r2+0),r5 the_node->previous = previous_node; 800745c: 58 43 00 04 sw (r2+4),r3 previous_node->next = the_node; 8007460: 58 62 00 00 sw (r3+0),r2 search_node->previous = the_node; 8007464: 58 82 00 40 sw (r4+64),r2 the_thread->Wait.queue = the_thread_queue; 8007468: 58 41 00 44 sw (r2+68),r1 _ISR_Enable( level ); 800746c: d0 08 00 00 wcsr IE,r8 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8007470: 34 07 00 01 mvi r7,1 8007474: e3 ff ff cf bi 80073b0 <_Thread_queue_Enqueue_priority+0x12c> =============================================================================== 080071a8 <_Thread_queue_Enqueue_with_handler>: void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 80071a8: 37 9c ff e8 addi sp,sp,-24 80071ac: 5b 8b 00 14 sw (sp+20),r11 80071b0: 5b 8c 00 10 sw (sp+16),r12 80071b4: 5b 8d 00 0c sw (sp+12),r13 80071b8: 5b 8e 00 08 sw (sp+8),r14 80071bc: 5b 9d 00 04 sw (sp+4),ra Thread_queue_Control *, Thread_Control *, ISR_Level * ); the_thread = _Thread_Executing; 80071c0: 78 04 08 01 mvhi r4,0x801 80071c4: 38 84 ea 60 ori r4,r4,0xea60 80071c8: 28 8b 00 10 lw r11,(r4+16) void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 80071cc: b8 40 68 00 mv r13,r2 else #endif /* * Set the blocking state for this thread queue in the thread. */ _Thread_Set_state( the_thread, the_thread_queue->state ); 80071d0: 28 22 00 38 lw r2,(r1+56) void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 80071d4: b8 20 60 00 mv r12,r1 else #endif /* * Set the blocking state for this thread queue in the thread. */ _Thread_Set_state( the_thread, the_thread_queue->state ); 80071d8: b9 60 08 00 mv r1,r11 void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 80071dc: b8 60 70 00 mv r14,r3 else #endif /* * Set the blocking state for this thread queue in the thread. */ _Thread_Set_state( the_thread, the_thread_queue->state ); 80071e0: f8 00 01 18 calli 8007640 <_Thread_Set_state> /* * If the thread wants to timeout, then schedule its timer. */ if ( timeout ) { 80071e4: 5d a0 00 16 bne r13,r0,800723c <_Thread_queue_Enqueue_with_handler+0x94> } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 80071e8: 29 82 00 34 lw r2,(r12+52) enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; 80071ec: 78 04 08 00 mvhi r4,0x800 } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 80071f0: 34 01 00 01 mvi r1,1 enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; 80071f4: 38 84 a6 0c ori r4,r4,0xa60c } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 80071f8: 44 41 00 20 be r2,r1,8007278 <_Thread_queue_Enqueue_with_handler+0xd0> enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; sync_state = (*enqueue_p)( the_thread_queue, the_thread, &level ); 80071fc: b9 60 10 00 mv r2,r11 8007200: b9 80 08 00 mv r1,r12 8007204: 37 83 00 18 addi r3,sp,24 8007208: d8 80 00 00 call r4 if ( sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800720c: 34 02 00 01 mvi r2,1 8007210: 44 22 00 04 be r1,r2,8007220 <_Thread_queue_Enqueue_with_handler+0x78><== ALWAYS TAKEN _Thread_blocking_operation_Cancel( sync_state, the_thread, level ); 8007214: 2b 83 00 18 lw r3,(sp+24) <== NOT EXECUTED 8007218: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 800721c: f8 00 0c 82 calli 800a424 <_Thread_blocking_operation_Cancel><== NOT EXECUTED } 8007220: 2b 9d 00 04 lw ra,(sp+4) 8007224: 2b 8b 00 14 lw r11,(sp+20) 8007228: 2b 8c 00 10 lw r12,(sp+16) 800722c: 2b 8d 00 0c lw r13,(sp+12) 8007230: 2b 8e 00 08 lw r14,(sp+8) 8007234: 37 9c 00 18 addi sp,sp,24 8007238: c3 a0 00 00 ret /* * If the thread wants to timeout, then schedule its timer. */ if ( timeout ) { _Watchdog_Initialize( 800723c: 29 61 00 08 lw r1,(r11+8) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8007240: 35 62 00 48 addi r2,r11,72 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8007244: 59 60 00 50 sw (r11+80),r0 the_watchdog->routine = routine; the_watchdog->id = id; 8007248: 59 61 00 68 sw (r11+104),r1 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800724c: 78 01 08 01 mvhi r1,0x801 8007250: 38 21 e9 78 ori r1,r1,0xe978 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 8007254: 59 6e 00 64 sw (r11+100),r14 the_watchdog->id = id; the_watchdog->user_data = user_data; 8007258: 59 60 00 6c sw (r11+108),r0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 800725c: 59 6d 00 54 sw (r11+84),r13 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8007260: f8 00 02 0e calli 8007a98 <_Watchdog_Insert> } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 8007264: 29 82 00 34 lw r2,(r12+52) enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; 8007268: 78 04 08 00 mvhi r4,0x800 } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 800726c: 34 01 00 01 mvi r1,1 enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; 8007270: 38 84 a6 0c ori r4,r4,0xa60c } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 8007274: 5c 41 ff e2 bne r2,r1,80071fc <_Thread_queue_Enqueue_with_handler+0x54> enqueue_p = _Thread_queue_Enqueue_priority; 8007278: 78 04 08 00 mvhi r4,0x800 800727c: 38 84 72 84 ori r4,r4,0x7284 8007280: e3 ff ff df bi 80071fc <_Thread_queue_Enqueue_with_handler+0x54> =============================================================================== 0800a798 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 800a798: 37 9c ff fc addi sp,sp,-4 800a79c: 5b 9d 00 04 sw (sp+4),ra Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 800a7a0: 28 23 00 44 lw r3,(r1+68) #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 800a7a4: b8 20 20 00 mv r4,r1 * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && 800a7a8: 28 62 00 30 lw r2,(r3+48) 800a7ac: 44 40 00 05 be r2,r0,800a7c0 <_Thread_queue_Process_timeout+0x28><== ALWAYS TAKEN RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800a7b0: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 800a7b4: 38 21 ea 60 ori r1,r1,0xea60 <== NOT EXECUTED 800a7b8: 28 21 00 10 lw r1,(r1+16) <== NOT EXECUTED 800a7bc: 44 81 00 09 be r4,r1,800a7e0 <_Thread_queue_Process_timeout+0x48><== NOT EXECUTED if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800a7c0: 28 65 00 3c lw r5,(r3+60) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 800a7c4: b8 60 08 00 mv r1,r3 800a7c8: b8 80 10 00 mv r2,r4 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800a7cc: 58 85 00 34 sw (r4+52),r5 _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 800a7d0: fb ff ff a4 calli 800a660 <_Thread_queue_Extract> } } 800a7d4: 2b 9d 00 04 lw ra,(sp+4) 800a7d8: 37 9c 00 04 addi sp,sp,4 800a7dc: c3 a0 00 00 ret * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 800a7e0: 34 01 00 03 mvi r1,3 <== NOT EXECUTED 800a7e4: 44 41 ff fc be r2,r1,800a7d4 <_Thread_queue_Process_timeout+0x3c><== NOT EXECUTED the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800a7e8: 28 61 00 3c lw r1,(r3+60) <== NOT EXECUTED 800a7ec: 58 81 00 34 sw (r4+52),r1 <== NOT EXECUTED the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800a7f0: 34 01 00 02 mvi r1,2 <== NOT EXECUTED 800a7f4: 58 61 00 30 sw (r3+48),r1 <== NOT EXECUTED 800a7f8: e3 ff ff f7 bi 800a7d4 <_Thread_queue_Process_timeout+0x3c><== NOT EXECUTED =============================================================================== 08007524 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 8007524: 37 9c ff ec addi sp,sp,-20 8007528: 5b 8b 00 10 sw (sp+16),r11 800752c: 5b 8c 00 0c sw (sp+12),r12 8007530: 5b 8d 00 08 sw (sp+8),r13 8007534: 5b 9d 00 04 sw (sp+4),ra 8007538: b8 20 58 00 mv r11,r1 800753c: 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 ) 8007540: 44 20 00 04 be r1,r0,8007550 <_Thread_queue_Requeue+0x2c> <== 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 ) { 8007544: 28 22 00 34 lw r2,(r1+52) 8007548: 34 01 00 01 mvi r1,1 800754c: 44 41 00 07 be r2,r1,8007568 <_Thread_queue_Requeue+0x44> <== ALWAYS TAKEN _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); } } 8007550: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8007554: 2b 8b 00 10 lw r11,(sp+16) <== NOT EXECUTED 8007558: 2b 8c 00 0c lw r12,(sp+12) <== NOT EXECUTED 800755c: 2b 8d 00 08 lw r13,(sp+8) <== NOT EXECUTED 8007560: 37 9c 00 14 addi sp,sp,20 <== NOT EXECUTED 8007564: c3 a0 00 00 ret <== NOT EXECUTED if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 8007568: 90 00 68 00 rcsr r13,IE 800756c: 34 01 ff fe mvi r1,-2 8007570: a1 a1 08 00 and r1,r13,r1 8007574: d0 01 00 00 wcsr IE,r1 8007578: 78 03 08 01 mvhi r3,0x801 800757c: 38 63 c3 30 ori r3,r3,0xc330 8007580: 29 82 00 10 lw r2,(r12+16) 8007584: 28 61 00 00 lw r1,(r3+0) 8007588: a0 41 08 00 and r1,r2,r1 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 800758c: 5c 20 00 08 bne r1,r0,80075ac <_Thread_queue_Requeue+0x88> <== ALWAYS TAKEN _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); 8007590: d0 0d 00 00 wcsr IE,r13 <== NOT EXECUTED } } 8007594: 2b 9d 00 04 lw ra,(sp+4) 8007598: 2b 8b 00 10 lw r11,(sp+16) 800759c: 2b 8c 00 0c lw r12,(sp+12) 80075a0: 2b 8d 00 08 lw r13,(sp+8) 80075a4: 37 9c 00 14 addi sp,sp,20 80075a8: c3 a0 00 00 ret 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; 80075ac: 34 01 00 01 mvi r1,1 80075b0: 59 61 00 30 sw (r11+48),r1 ISR_Level level_ignored; _ISR_Disable( level ); if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 80075b4: b9 80 10 00 mv r2,r12 80075b8: b9 60 08 00 mv r1,r11 80075bc: 34 03 00 01 mvi r3,1 80075c0: f8 00 0c 36 calli 800a698 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 80075c4: b9 60 08 00 mv r1,r11 80075c8: b9 80 10 00 mv r2,r12 80075cc: 37 83 00 14 addi r3,sp,20 80075d0: fb ff ff 2d calli 8007284 <_Thread_queue_Enqueue_priority> } _ISR_Enable( level ); 80075d4: d0 0d 00 00 wcsr IE,r13 80075d8: e3 ff ff ef bi 8007594 <_Thread_queue_Requeue+0x70> =============================================================================== 080075dc <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 80075dc: 37 9c ff f8 addi sp,sp,-8 80075e0: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 80075e4: 37 82 00 08 addi r2,sp,8 80075e8: fb ff fd 87 calli 8006c04 <_Thread_Get> switch ( location ) { 80075ec: 2b 82 00 08 lw r2,(sp+8) 80075f0: 5c 40 00 07 bne r2,r0,800760c <_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 ); 80075f4: f8 00 0c 69 calli 800a798 <_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; 80075f8: 78 01 08 01 mvhi r1,0x801 80075fc: 38 21 e8 e0 ori r1,r1,0xe8e0 8007600: 28 22 00 00 lw r2,(r1+0) --level; 8007604: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 8007608: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 800760c: 2b 9d 00 04 lw ra,(sp+4) 8007610: 37 9c 00 08 addi sp,sp,8 8007614: c3 a0 00 00 ret =============================================================================== 080159cc <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 80159cc: 37 9c ff a4 addi sp,sp,-92 80159d0: 5b 8b 00 44 sw (sp+68),r11 80159d4: 5b 8c 00 40 sw (sp+64),r12 80159d8: 5b 8d 00 3c sw (sp+60),r13 80159dc: 5b 8e 00 38 sw (sp+56),r14 80159e0: 5b 8f 00 34 sw (sp+52),r15 80159e4: 5b 90 00 30 sw (sp+48),r16 80159e8: 5b 91 00 2c sw (sp+44),r17 80159ec: 5b 92 00 28 sw (sp+40),r18 80159f0: 5b 93 00 24 sw (sp+36),r19 80159f4: 5b 94 00 20 sw (sp+32),r20 80159f8: 5b 95 00 1c sw (sp+28),r21 80159fc: 5b 96 00 18 sw (sp+24),r22 8015a00: 5b 97 00 14 sw (sp+20),r23 8015a04: 5b 98 00 10 sw (sp+16),r24 8015a08: 5b 99 00 0c sw (sp+12),r25 8015a0c: 5b 9b 00 08 sw (sp+8),fp 8015a10: 5b 9d 00 04 sw (sp+4),ra 8015a14: 78 13 08 03 mvhi r19,0x803 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8015a18: 37 96 00 54 addi r22,sp,84 8015a1c: 37 95 00 58 addi r21,sp,88 8015a20: 37 8f 00 48 addi r15,sp,72 8015a24: 37 94 00 4c addi r20,sp,76 8015a28: 78 0e 08 03 mvhi r14,0x803 8015a2c: 78 17 08 03 mvhi r23,0x803 8015a30: b8 20 58 00 mv r11,r1 8015a34: 5b 95 00 54 sw (sp+84),r21 head->previous = NULL; 8015a38: 5b 80 00 58 sw (sp+88),r0 tail->previous = head; 8015a3c: 5b 96 00 5c sw (sp+92),r22 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8015a40: 5b 94 00 48 sw (sp+72),r20 head->previous = NULL; 8015a44: 5b 80 00 4c sw (sp+76),r0 tail->previous = head; 8015a48: 5b 8f 00 50 sw (sp+80),r15 8015a4c: 3a 73 dd b8 ori r19,r19,0xddb8 8015a50: 34 31 00 30 addi r17,r1,48 8015a54: 39 ce dc 50 ori r14,r14,0xdc50 8015a58: 34 30 00 68 addi r16,r1,104 8015a5c: 3a f7 dc d0 ori r23,r23,0xdcd0 8015a60: 34 3b 00 08 addi fp,r1,8 8015a64: 34 39 00 40 addi r25,r1,64 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 ) { 8015a68: 34 0d 00 03 mvi r13,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 ); 8015a6c: 34 12 ff fe mvi r18,-2 _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; 8015a70: 34 18 00 01 mvi r24,1 { /* * 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; 8015a74: 59 76 00 78 sw (r11+120),r22 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 8015a78: 2a 64 00 00 lw r4,(r19+0) /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 8015a7c: 29 62 00 3c lw r2,(r11+60) watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8015a80: ba 20 08 00 mv r1,r17 8015a84: b9 e0 18 00 mv r3,r15 8015a88: c8 82 10 00 sub r2,r4,r2 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 8015a8c: 59 64 00 3c sw (r11+60),r4 _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8015a90: f8 00 14 cc calli 801adc0 <_Watchdog_Adjust_to_chain> 8015a94: 78 03 08 03 mvhi r3,0x803 8015a98: 38 63 75 fc ori r3,r3,0x75fc 8015a9c: 28 64 00 00 lw r4,(r3+0) 8015aa0: 29 c1 00 00 lw r1,(r14+0) 8015aa4: 29 c2 00 04 lw r2,(r14+4) 8015aa8: 34 03 00 00 mvi r3,0 8015aac: f8 00 51 b1 calli 802a170 <__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; 8015ab0: 29 64 00 74 lw r4,(r11+116) 8015ab4: 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 ) { 8015ab8: 50 82 00 1c bgeu r4,r2,8015b28 <_Timer_server_Body+0x15c> /* * 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 ); 8015abc: ba 00 08 00 mv r1,r16 8015ac0: c8 44 10 00 sub r2,r2,r4 8015ac4: b9 e0 18 00 mv r3,r15 8015ac8: f8 00 14 be calli 801adc0 <_Watchdog_Adjust_to_chain> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 8015acc: 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 ) { 8015ad0: 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 ); 8015ad4: 29 61 00 78 lw r1,(r11+120) 8015ad8: f8 00 03 46 calli 80167f0 <_Chain_Get> 8015adc: b8 20 10 00 mv r2,r1 if ( timer == NULL ) { 8015ae0: 44 20 00 0b be r1,r0,8015b0c <_Timer_server_Body+0x140> <== ALWAYS TAKEN static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8015ae4: 28 24 00 38 lw r4,(r1+56) <== NOT EXECUTED 8015ae8: 44 8c 00 16 be r4,r12,8015b40 <_Timer_server_Body+0x174> <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8015aec: 5c 8d ff fa bne r4,r13,8015ad4 <_Timer_server_Body+0x108> <== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8015af0: 34 42 00 10 addi r2,r2,16 <== NOT EXECUTED 8015af4: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 8015af8: f8 00 14 d6 calli 801ae50 <_Watchdog_Insert> <== NOT EXECUTED } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 8015afc: 29 61 00 78 lw r1,(r11+120) <== NOT EXECUTED 8015b00: f8 00 03 3c calli 80167f0 <_Chain_Get> <== NOT EXECUTED 8015b04: b8 20 10 00 mv r2,r1 <== NOT EXECUTED if ( timer == NULL ) { 8015b08: 5c 20 ff f7 bne r1,r0,8015ae4 <_Timer_server_Body+0x118> <== 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 ); 8015b0c: 90 00 10 00 rcsr r2,IE 8015b10: a0 52 18 00 and r3,r2,r18 8015b14: d0 03 00 00 wcsr IE,r3 if ( _Chain_Is_empty( insert_chain ) ) { 8015b18: 2b 83 00 54 lw r3,(sp+84) 8015b1c: 44 75 00 0d be r3,r21,8015b50 <_Timer_server_Body+0x184> <== ALWAYS TAKEN ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 8015b20: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED 8015b24: e3 ff ff d5 bi 8015a78 <_Timer_server_Body+0xac> <== NOT EXECUTED * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 8015b28: 50 44 ff e9 bgeu r2,r4,8015acc <_Timer_server_Body+0x100> /* * 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 ); 8015b2c: ba 00 08 00 mv r1,r16 8015b30: 34 02 00 01 mvi r2,1 8015b34: c8 8c 18 00 sub r3,r4,r12 8015b38: f8 00 14 64 calli 801acc8 <_Watchdog_Adjust> 8015b3c: e3 ff ff e4 bi 8015acc <_Timer_server_Body+0x100> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8015b40: ba 20 08 00 mv r1,r17 <== NOT EXECUTED 8015b44: 34 42 00 10 addi r2,r2,16 <== NOT EXECUTED 8015b48: f8 00 14 c2 calli 801ae50 <_Watchdog_Insert> <== NOT EXECUTED 8015b4c: e3 ff ff e2 bi 8015ad4 <_Timer_server_Body+0x108> <== NOT EXECUTED */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 8015b50: 59 60 00 78 sw (r11+120),r0 _ISR_Enable( level ); 8015b54: 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 ) ) { 8015b58: 2b 82 00 48 lw r2,(sp+72) 8015b5c: 5c 54 00 0b bne r2,r20,8015b88 <_Timer_server_Body+0x1bc> 8015b60: e0 00 00 11 bi 8015ba4 <_Timer_server_Body+0x1d8> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 8015b64: 28 43 00 00 lw r3,(r2+0) head->next = new_first; new_first->previous = head; 8015b68: 58 6f 00 04 sw (r3+4),r15 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 8015b6c: 5b 83 00 48 sw (sp+72),r3 * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 8015b70: 58 40 00 08 sw (r2+8),r0 _ISR_Enable( level ); 8015b74: d0 04 00 00 wcsr IE,r4 /* * 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 ); 8015b78: 28 43 00 1c lw r3,(r2+28) 8015b7c: 28 41 00 20 lw r1,(r2+32) 8015b80: 28 42 00 24 lw r2,(r2+36) 8015b84: d8 60 00 00 call r3 /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 8015b88: 90 00 20 00 rcsr r4,IE 8015b8c: a0 92 10 00 and r2,r4,r18 8015b90: d0 02 00 00 wcsr IE,r2 initialized = false; } #endif return status; } 8015b94: 2b 82 00 48 lw r2,(sp+72) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 8015b98: 5c 54 ff f3 bne r2,r20,8015b64 <_Timer_server_Body+0x198> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 8015b9c: d0 04 00 00 wcsr IE,r4 8015ba0: e3 ff ff b5 bi 8015a74 <_Timer_server_Body+0xa8> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 8015ba4: 31 60 00 7c sb (r11+124),r0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 8015ba8: 2a e1 00 00 lw r1,(r23+0) ++level; 8015bac: 34 21 00 01 addi r1,r1,1 _Thread_Dispatch_disable_level = level; 8015bb0: 5a e1 00 00 sw (r23+0),r1 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 8015bb4: 29 61 00 00 lw r1,(r11+0) 8015bb8: 34 02 00 08 mvi r2,8 8015bbc: f8 00 13 2d calli 801a870 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 8015bc0: b9 60 08 00 mv r1,r11 8015bc4: fb ff ff 40 calli 80158c4 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 8015bc8: b9 60 08 00 mv r1,r11 8015bcc: fb ff ff 5f calli 8015948 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 8015bd0: f8 00 10 5a calli 8019d38 <_Thread_Enable_dispatch> static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8015bd4: bb 60 08 00 mv r1,fp _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; 8015bd8: 31 78 00 7c sb (r11+124),r24 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8015bdc: f8 00 15 03 calli 801afe8 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 8015be0: bb 20 08 00 mv r1,r25 8015be4: f8 00 15 01 calli 801afe8 <_Watchdog_Remove> 8015be8: e3 ff ff a3 bi 8015a74 <_Timer_server_Body+0xa8> =============================================================================== 08015bec <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8015bec: 37 9c ff f0 addi sp,sp,-16 8015bf0: 5b 8b 00 10 sw (sp+16),r11 8015bf4: 5b 8c 00 0c sw (sp+12),r12 8015bf8: 5b 8d 00 08 sw (sp+8),r13 8015bfc: 5b 9d 00 04 sw (sp+4),ra 8015c00: b8 20 58 00 mv r11,r1 if ( ts->insert_chain == NULL ) { 8015c04: 28 21 00 78 lw r1,(r1+120) static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8015c08: b8 40 60 00 mv r12,r2 if ( ts->insert_chain == NULL ) { 8015c0c: 44 20 00 09 be r1,r0,8015c30 <_Timer_server_Schedule_operation_method+0x44><== ALWAYS TAKEN * 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 ); 8015c10: 29 61 00 78 lw r1,(r11+120) <== NOT EXECUTED 8015c14: f8 00 02 eb calli 80167c0 <_Chain_Append> <== NOT EXECUTED } } 8015c18: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8015c1c: 2b 8b 00 10 lw r11,(sp+16) <== NOT EXECUTED 8015c20: 2b 8c 00 0c lw r12,(sp+12) <== NOT EXECUTED 8015c24: 2b 8d 00 08 lw r13,(sp+8) <== NOT EXECUTED 8015c28: 37 9c 00 10 addi sp,sp,16 <== NOT EXECUTED 8015c2c: c3 a0 00 00 ret <== NOT EXECUTED * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 8015c30: 78 01 08 03 mvhi r1,0x803 8015c34: 38 21 dc d0 ori r1,r1,0xdcd0 8015c38: 28 22 00 00 lw r2,(r1+0) ++level; 8015c3c: 34 42 00 01 addi r2,r2,1 _Thread_Dispatch_disable_level = level; 8015c40: 58 22 00 00 sw (r1+0),r2 * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8015c44: 29 81 00 38 lw r1,(r12+56) 8015c48: 34 02 00 01 mvi r2,1 8015c4c: 44 22 00 30 be r1,r2,8015d0c <_Timer_server_Schedule_operation_method+0x120> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); if ( !ts->active ) { _Timer_server_Reset_interval_system_watchdog( ts ); } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8015c50: 34 02 00 03 mvi r2,3 8015c54: 44 22 00 08 be r1,r2,8015c74 <_Timer_server_Schedule_operation_method+0x88> if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 8015c58: f8 00 10 38 calli 8019d38 <_Thread_Enable_dispatch> * 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 ); } } 8015c5c: 2b 9d 00 04 lw ra,(sp+4) 8015c60: 2b 8b 00 10 lw r11,(sp+16) 8015c64: 2b 8c 00 0c lw r12,(sp+12) 8015c68: 2b 8d 00 08 lw r13,(sp+8) 8015c6c: 37 9c 00 10 addi sp,sp,16 8015c70: c3 a0 00 00 ret } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8015c74: 90 00 68 00 rcsr r13,IE 8015c78: 34 01 ff fe mvi r1,-2 8015c7c: a1 a1 08 00 and r1,r13,r1 8015c80: d0 01 00 00 wcsr IE,r1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8015c84: 78 02 08 03 mvhi r2,0x803 8015c88: 78 03 08 03 mvhi r3,0x803 8015c8c: 38 42 dc 50 ori r2,r2,0xdc50 8015c90: 38 63 75 fc ori r3,r3,0x75fc 8015c94: 28 64 00 00 lw r4,(r3+0) 8015c98: 28 41 00 00 lw r1,(r2+0) 8015c9c: 28 42 00 04 lw r2,(r2+4) 8015ca0: 34 03 00 00 mvi r3,0 8015ca4: f8 00 51 33 calli 802a170 <__divdi3> initialized = false; } #endif return status; } 8015ca8: 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; 8015cac: 29 63 00 74 lw r3,(r11+116) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8015cb0: 35 64 00 6c addi r4,r11,108 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 8015cb4: 44 24 00 0a be r1,r4,8015cdc <_Timer_server_Schedule_operation_method+0xf0> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 8015cb8: 28 25 00 10 lw r5,(r1+16) } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 8015cbc: b4 a3 20 00 add r4,r5,r3 delta_interval += delta; 8015cc0: c8 82 20 00 sub r4,r4,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 ) { 8015cc4: 50 62 00 05 bgeu r3,r2,8015cd8 <_Timer_server_Schedule_operation_method+0xec> /* * We advanced in time. */ delta = snapshot - last_snapshot; 8015cc8: c8 43 18 00 sub r3,r2,r3 if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 8015ccc: 34 04 00 00 mvi r4,0 if ( snapshot > last_snapshot ) { /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { 8015cd0: 50 65 00 02 bgeu r3,r5,8015cd8 <_Timer_server_Schedule_operation_method+0xec><== NEVER TAKEN delta_interval -= delta; 8015cd4: c8 a3 20 00 sub r4,r5,r3 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 8015cd8: 58 24 00 10 sw (r1+16),r4 } ts->TOD_watchdogs.last_snapshot = snapshot; 8015cdc: 59 62 00 74 sw (r11+116),r2 _ISR_Enable( level ); 8015ce0: d0 0d 00 00 wcsr IE,r13 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8015ce4: 35 61 00 68 addi r1,r11,104 8015ce8: 35 82 00 10 addi r2,r12,16 8015cec: f8 00 14 59 calli 801ae50 <_Watchdog_Insert> if ( !ts->active ) { 8015cf0: 41 61 00 7c lbu r1,(r11+124) 8015cf4: 20 21 00 ff andi r1,r1,0xff 8015cf8: 5c 20 ff d8 bne r1,r0,8015c58 <_Timer_server_Schedule_operation_method+0x6c><== NEVER TAKEN _Timer_server_Reset_tod_system_watchdog( ts ); 8015cfc: b9 60 08 00 mv r1,r11 8015d00: fb ff ff 12 calli 8015948 <_Timer_server_Reset_tod_system_watchdog> } } _Thread_Enable_dispatch(); 8015d04: f8 00 10 0d calli 8019d38 <_Thread_Enable_dispatch> 8015d08: e3 ff ff d5 bi 8015c5c <_Timer_server_Schedule_operation_method+0x70> if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8015d0c: 90 00 18 00 rcsr r3,IE 8015d10: 34 01 ff fe mvi r1,-2 8015d14: a0 61 08 00 and r1,r3,r1 8015d18: d0 01 00 00 wcsr IE,r1 snapshot = _Watchdog_Ticks_since_boot; 8015d1c: 78 01 08 03 mvhi r1,0x803 8015d20: 38 21 dd b8 ori r1,r1,0xddb8 initialized = false; } #endif return status; } 8015d24: 29 62 00 30 lw r2,(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; 8015d28: 28 21 00 00 lw r1,(r1+0) last_snapshot = ts->Interval_watchdogs.last_snapshot; 8015d2c: 29 65 00 3c lw r5,(r11+60) 8015d30: 35 64 00 34 addi r4,r11,52 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 8015d34: 44 44 00 07 be r2,r4,8015d50 <_Timer_server_Schedule_operation_method+0x164> /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 8015d38: 28 46 00 10 lw r6,(r2+16) first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 8015d3c: c8 25 28 00 sub r5,r1,r5 delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 8015d40: 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) { 8015d44: 50 a6 00 02 bgeu r5,r6,8015d4c <_Timer_server_Schedule_operation_method+0x160> delta_interval -= delta; 8015d48: c8 c5 20 00 sub r4,r6,r5 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 8015d4c: 58 44 00 10 sw (r2+16),r4 } ts->Interval_watchdogs.last_snapshot = snapshot; 8015d50: 59 61 00 3c sw (r11+60),r1 _ISR_Enable( level ); 8015d54: d0 03 00 00 wcsr IE,r3 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8015d58: 35 61 00 30 addi r1,r11,48 8015d5c: 35 82 00 10 addi r2,r12,16 8015d60: f8 00 14 3c calli 801ae50 <_Watchdog_Insert> if ( !ts->active ) { 8015d64: 41 61 00 7c lbu r1,(r11+124) 8015d68: 20 21 00 ff andi r1,r1,0xff 8015d6c: 5c 20 ff bb bne r1,r0,8015c58 <_Timer_server_Schedule_operation_method+0x6c> _Timer_server_Reset_interval_system_watchdog( ts ); 8015d70: b9 60 08 00 mv r1,r11 8015d74: fb ff fe d4 calli 80158c4 <_Timer_server_Reset_interval_system_watchdog> if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 8015d78: f8 00 0f f0 calli 8019d38 <_Thread_Enable_dispatch> 8015d7c: e3 ff ff b8 bi 8015c5c <_Timer_server_Schedule_operation_method+0x70> =============================================================================== 08007854 <_Timespec_Add_to>: uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { 8007854: b8 20 20 00 mv r4,r1 uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; 8007858: 28 83 00 00 lw r3,(r4+0) uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { uint32_t seconds = add->tv_sec; 800785c: 28 41 00 00 lw r1,(r2+0) /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; 8007860: 28 86 00 04 lw r6,(r4+4) 8007864: 28 42 00 04 lw r2,(r2+4) /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 8007868: 78 07 08 01 mvhi r7,0x801 800786c: 38 e7 42 e0 ori r7,r7,0x42e0 8007870: 28 e5 00 00 lw r5,(r7+0) ) { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; 8007874: b4 61 18 00 add r3,r3,r1 time->tv_nsec += add->tv_nsec; 8007878: b4 46 10 00 add r2,r2,r6 ) { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; 800787c: 58 83 00 00 sw (r4+0),r3 time->tv_nsec += add->tv_nsec; 8007880: 58 82 00 04 sw (r4+4),r2 /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 8007884: 50 a2 00 0a bgeu r5,r2,80078ac <_Timespec_Add_to+0x58> time->tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 8007888: 78 07 08 01 mvhi r7,0x801 800788c: 38 e7 42 e4 ori r7,r7,0x42e4 8007890: 28 e6 00 00 lw r6,(r7+0) 8007894: b4 46 10 00 add r2,r2,r6 #include #include #include #include uint32_t _Timespec_Add_to( 8007898: 34 63 00 01 addi r3,r3,1 /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { time->tv_nsec -= TOD_NANOSECONDS_PER_SECOND; time->tv_sec++; seconds++; 800789c: 34 21 00 01 addi r1,r1,1 /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 80078a0: 54 45 ff fd bgu r2,r5,8007894 <_Timespec_Add_to+0x40> <== NEVER TAKEN 80078a4: 58 82 00 04 sw (r4+4),r2 80078a8: 58 83 00 00 sw (r4+0),r3 time->tv_sec++; seconds++; } return seconds; } 80078ac: c3 a0 00 00 ret =============================================================================== 08007a4c <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 8007a4c: 37 9c ff f8 addi sp,sp,-8 8007a50: 5b 9d 00 04 sw (sp+4),ra uint32_t number_of_initial_extensions = 8007a54: 78 01 08 01 mvhi r1,0x801 8007a58: 38 21 b9 9c ori r1,r1,0xb99c 8007a5c: 28 21 00 40 lw r1,(r1+64) rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 8007a60: 44 20 00 0b be r1,r0,8007a8c <_User_extensions_Handler_initialization+0x40><== NEVER TAKEN User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) 8007a64: b4 21 10 00 add r2,r1,r1 8007a68: b4 41 08 00 add r1,r2,r1 8007a6c: b4 21 08 00 add r1,r1,r1 8007a70: b4 21 08 00 add r1,r1,r1 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( 8007a74: f8 00 01 50 calli 8007fb4 <_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 ); 8007a78: 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 }; 8007a7c: 5b 81 00 08 sw (sp+8),r1 _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 8007a80: 38 42 7a 0c ori r2,r2,0x7a0c 8007a84: 37 81 00 08 addi r1,sp,8 8007a88: fb ff ff b0 calli 8007948 <_User_extensions_Iterate> } } 8007a8c: 2b 9d 00 04 lw ra,(sp+4) 8007a90: 37 9c 00 08 addi sp,sp,8 8007a94: c3 a0 00 00 ret =============================================================================== 08007948 <_User_extensions_Iterate>: void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { 8007948: 37 9c ff e8 addi sp,sp,-24 800794c: 5b 8b 00 18 sw (sp+24),r11 8007950: 5b 8c 00 14 sw (sp+20),r12 8007954: 5b 8d 00 10 sw (sp+16),r13 8007958: 5b 8e 00 0c sw (sp+12),r14 800795c: 5b 8f 00 08 sw (sp+8),r15 8007960: 5b 9d 00 04 sw (sp+4),ra Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = 8007964: 78 04 08 01 mvhi r4,0x801 8007968: 38 84 b9 9c ori r4,r4,0xb99c rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); 800796c: 28 83 00 40 lw r3,(r4+64) void *arg, User_extensions_Visitor visitor ) { Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = 8007970: 28 8b 00 44 lw r11,(r4+68) void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { Thread_Control *executing = _Thread_Executing; 8007974: 78 04 08 01 mvhi r4,0x801 const User_extensions_Table *callouts_current = rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); 8007978: b4 63 18 00 add r3,r3,r3 800797c: b4 63 18 00 add r3,r3,r3 8007980: b4 63 18 00 add r3,r3,r3 8007984: b4 63 18 00 add r3,r3,r3 8007988: b4 63 18 00 add r3,r3,r3 void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { Thread_Control *executing = _Thread_Executing; 800798c: 38 84 ea 60 ori r4,r4,0xea60 const User_extensions_Table *callouts_current = rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = 8007990: b5 63 78 00 add r15,r11,r3 void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { 8007994: b8 20 68 00 mv r13,r1 8007998: b8 40 70 00 mv r14,r2 Thread_Control *executing = _Thread_Executing; 800799c: 28 8c 00 10 lw r12,(r4+16) const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { 80079a0: 45 6f 00 07 be r11,r15,80079bc <_User_extensions_Iterate+0x74><== NEVER TAKEN (*visitor)( executing, arg, callouts_current ); 80079a4: b9 60 18 00 mv r3,r11 80079a8: b9 80 08 00 mv r1,r12 ++callouts_current; 80079ac: 35 6b 00 20 addi r11,r11,32 callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { (*visitor)( executing, arg, callouts_current ); 80079b0: b9 a0 10 00 mv r2,r13 80079b4: d9 c0 00 00 call r14 const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { 80079b8: 5d eb ff fb bne r15,r11,80079a4 <_User_extensions_Iterate+0x5c> (*visitor)( executing, arg, &extension->Callouts ); node = _Chain_Immutable_next( node ); } } 80079bc: 78 01 08 01 mvhi r1,0x801 80079c0: 38 21 e1 94 ori r1,r1,0xe194 80079c4: 28 2b 00 00 lw r11,(r1+0) ++callouts_current; } node = _Chain_Immutable_first( &_User_extensions_List ); tail = _Chain_Immutable_tail( &_User_extensions_List ); while ( node != tail ) { 80079c8: 78 0f 08 01 mvhi r15,0x801 80079cc: 39 ef e1 98 ori r15,r15,0xe198 80079d0: 45 6f 00 07 be r11,r15,80079ec <_User_extensions_Iterate+0xa4> const User_extensions_Control *extension = (const User_extensions_Control *) node; (*visitor)( executing, arg, &extension->Callouts ); 80079d4: 35 63 00 14 addi r3,r11,20 80079d8: b9 80 08 00 mv r1,r12 80079dc: b9 a0 10 00 mv r2,r13 80079e0: d9 c0 00 00 call r14 node = _Chain_Immutable_next( node ); } } 80079e4: 29 6b 00 00 lw r11,(r11+0) ++callouts_current; } node = _Chain_Immutable_first( &_User_extensions_List ); tail = _Chain_Immutable_tail( &_User_extensions_List ); while ( node != tail ) { 80079e8: 5d 6f ff fb bne r11,r15,80079d4 <_User_extensions_Iterate+0x8c> (*visitor)( executing, arg, &extension->Callouts ); node = _Chain_Immutable_next( node ); } } 80079ec: 2b 9d 00 04 lw ra,(sp+4) 80079f0: 2b 8b 00 18 lw r11,(sp+24) 80079f4: 2b 8c 00 14 lw r12,(sp+20) 80079f8: 2b 8d 00 10 lw r13,(sp+16) 80079fc: 2b 8e 00 0c lw r14,(sp+12) 8007a00: 2b 8f 00 08 lw r15,(sp+8) 8007a04: 37 9c 00 18 addi sp,sp,24 8007a08: c3 a0 00 00 ret =============================================================================== 080099b8 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 80099b8: 37 9c ff e4 addi sp,sp,-28 80099bc: 5b 8b 00 1c sw (sp+28),r11 80099c0: 5b 8c 00 18 sw (sp+24),r12 80099c4: 5b 8d 00 14 sw (sp+20),r13 80099c8: 5b 8e 00 10 sw (sp+16),r14 80099cc: 5b 8f 00 0c sw (sp+12),r15 80099d0: 5b 90 00 08 sw (sp+8),r16 80099d4: 5b 9d 00 04 sw (sp+4),ra 80099d8: b8 20 60 00 mv r12,r1 80099dc: b8 60 58 00 mv r11,r3 ISR_Level level; _ISR_Disable( level ); 80099e0: 90 00 18 00 rcsr r3,IE 80099e4: 34 01 ff fe mvi r1,-2 80099e8: a0 61 08 00 and r1,r3,r1 80099ec: d0 01 00 00 wcsr IE,r1 } } _ISR_Enable( level ); } 80099f0: 29 81 00 00 lw r1,(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 ); 80099f4: 35 8e 00 04 addi r14,r12,4 Watchdog_Interval units ) { ISR_Level level; _ISR_Disable( level ); 80099f8: b8 60 20 00 mv r4,r3 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 80099fc: 44 2e 00 04 be r1,r14,8009a0c <_Watchdog_Adjust+0x54> switch ( direction ) { 8009a00: 44 40 00 11 be r2,r0,8009a44 <_Watchdog_Adjust+0x8c> 8009a04: 34 03 00 01 mvi r3,1 8009a08: 44 43 00 0b be r2,r3,8009a34 <_Watchdog_Adjust+0x7c> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 8009a0c: d0 04 00 00 wcsr IE,r4 } 8009a10: 2b 9d 00 04 lw ra,(sp+4) 8009a14: 2b 8b 00 1c lw r11,(sp+28) 8009a18: 2b 8c 00 18 lw r12,(sp+24) 8009a1c: 2b 8d 00 14 lw r13,(sp+20) 8009a20: 2b 8e 00 10 lw r14,(sp+16) 8009a24: 2b 8f 00 0c lw r15,(sp+12) 8009a28: 2b 90 00 08 lw r16,(sp+8) 8009a2c: 37 9c 00 1c addi sp,sp,28 8009a30: c3 a0 00 00 ret * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 8009a34: 28 22 00 10 lw r2,(r1+16) 8009a38: b4 4b 58 00 add r11,r2,r11 8009a3c: 58 2b 00 10 sw (r1+16),r11 break; 8009a40: e3 ff ff f3 bi 8009a0c <_Watchdog_Adjust+0x54> case WATCHDOG_FORWARD: while ( units ) { 8009a44: b8 60 20 00 mv r4,r3 8009a48: 45 62 ff f1 be r11,r2,8009a0c <_Watchdog_Adjust+0x54> <== NEVER TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 8009a4c: 28 2d 00 10 lw r13,(r1+16) 8009a50: 55 ab 00 13 bgu r13,r11,8009a9c <_Watchdog_Adjust+0xe4> <== NEVER TAKEN _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 8009a54: 34 10 00 01 mvi r16,1 _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8009a58: 34 0f ff fe mvi r15,-2 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; 8009a5c: 58 30 00 10 sw (r1+16),r16 _ISR_Enable( level ); 8009a60: d0 03 00 00 wcsr IE,r3 _Watchdog_Tickle( header ); 8009a64: b9 80 08 00 mv r1,r12 8009a68: f8 00 00 ad calli 8009d1c <_Watchdog_Tickle> _ISR_Disable( level ); 8009a6c: 90 00 10 00 rcsr r2,IE 8009a70: a0 4f 08 00 and r1,r2,r15 8009a74: d0 01 00 00 wcsr IE,r1 } } _ISR_Enable( level ); } 8009a78: 29 84 00 00 lw r4,(r12+0) while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 8009a7c: c9 6d 58 00 sub r11,r11,r13 _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8009a80: b8 40 18 00 mv r3,r2 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) _Chain_First( header ) ); 8009a84: b8 80 08 00 mv r1,r4 if ( _Chain_Is_empty( header ) ) 8009a88: 45 c4 00 08 be r14,r4,8009aa8 <_Watchdog_Adjust+0xf0> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 8009a8c: 45 60 00 07 be r11,r0,8009aa8 <_Watchdog_Adjust+0xf0> <== NEVER TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 8009a90: 28 2d 00 10 lw r13,(r1+16) 8009a94: 51 6d ff f2 bgeu r11,r13,8009a5c <_Watchdog_Adjust+0xa4> _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8009a98: b8 40 20 00 mv r4,r2 _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; 8009a9c: c9 ab 58 00 sub r11,r13,r11 8009aa0: 58 2b 00 10 sw (r1+16),r11 break; 8009aa4: e3 ff ff da bi 8009a0c <_Watchdog_Adjust+0x54> _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8009aa8: b8 40 20 00 mv r4,r2 8009aac: e3 ff ff d8 bi 8009a0c <_Watchdog_Adjust+0x54> =============================================================================== 08007a98 <_Watchdog_Insert>: void _Watchdog_Insert( Chain_Control *header, Watchdog_Control *the_watchdog ) { 8007a98: 37 9c ff f8 addi sp,sp,-8 8007a9c: 5b 8b 00 08 sw (sp+8),r11 8007aa0: 5b 8c 00 04 sw (sp+4),r12 Watchdog_Control *after; uint32_t insert_isr_nest_level; Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; 8007aa4: 78 03 08 01 mvhi r3,0x801 8007aa8: 38 63 ea 60 ori r3,r3,0xea60 8007aac: 28 69 00 08 lw r9,(r3+8) _ISR_Disable( level ); 8007ab0: 90 00 30 00 rcsr r6,IE 8007ab4: 34 08 ff fe mvi r8,-2 8007ab8: a0 c8 40 00 and r8,r6,r8 8007abc: d0 08 00 00 wcsr IE,r8 /* * Check to see if the watchdog has just been inserted by a * higher priority interrupt. If so, abandon this insert. */ if ( the_watchdog->state != WATCHDOG_INACTIVE ) { 8007ac0: 28 43 00 08 lw r3,(r2+8) 8007ac4: 5c 60 00 32 bne r3,r0,8007b8c <_Watchdog_Insert+0xf4> _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; 8007ac8: 78 0c 08 01 mvhi r12,0x801 8007acc: 39 8c e9 c4 ori r12,r12,0xe9c4 8007ad0: 29 83 00 00 lw r3,(r12+0) 8007ad4: 78 07 08 01 mvhi r7,0x801 if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 8007ad8: 34 04 00 01 mvi r4,1 _Watchdog_Sync_count++; 8007adc: 34 63 00 01 addi r3,r3,1 if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 8007ae0: 58 44 00 08 sw (r2+8),r4 _Watchdog_Sync_count++; 8007ae4: 59 83 00 00 sw (r12+0),r3 8007ae8: 38 e7 e9 64 ori r7,r7,0xe964 delta_interval -= after->delta_interval; _ISR_Flash( level ); if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8007aec: 34 0a 00 01 mvi r10,1 the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; restart: delta_interval = the_watchdog->initial; 8007af0: 28 44 00 0c lw r4,(r2+12) RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) _Chain_First( header ) ); 8007af4: 28 23 00 00 lw r3,(r1+0) for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 8007af8: 44 80 00 14 be r4,r0,8007b48 <_Watchdog_Insert+0xb0> 8007afc: 28 65 00 00 lw r5,(r3+0) 8007b00: 44 a0 00 12 be r5,r0,8007b48 <_Watchdog_Insert+0xb0> break; if ( delta_interval < after->delta_interval ) { 8007b04: 28 65 00 10 lw r5,(r3+16) 8007b08: 54 a4 00 0e bgu r5,r4,8007b40 <_Watchdog_Insert+0xa8> break; } delta_interval -= after->delta_interval; _ISR_Flash( level ); 8007b0c: d0 06 00 00 wcsr IE,r6 8007b10: d0 08 00 00 wcsr IE,r8 if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8007b14: 28 4b 00 08 lw r11,(r2+8) 8007b18: 5d 6a 00 19 bne r11,r10,8007b7c <_Watchdog_Insert+0xe4> goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 8007b1c: 28 eb 00 00 lw r11,(r7+0) 8007b20: 55 69 00 28 bgu r11,r9,8007bc0 <_Watchdog_Insert+0x128> if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 8007b24: c8 85 20 00 sub r4,r4,r5 exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; _Watchdog_Sync_count--; _ISR_Enable( level ); } 8007b28: 28 63 00 00 lw r3,(r3+0) for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 8007b2c: 44 80 00 07 be r4,r0,8007b48 <_Watchdog_Insert+0xb0> 8007b30: 28 65 00 00 lw r5,(r3+0) 8007b34: 44 a0 00 05 be r5,r0,8007b48 <_Watchdog_Insert+0xb0> break; if ( delta_interval < after->delta_interval ) { 8007b38: 28 65 00 10 lw r5,(r3+16) 8007b3c: 50 85 00 19 bgeu r4,r5,8007ba0 <_Watchdog_Insert+0x108> after->delta_interval -= delta_interval; 8007b40: c8 a4 28 00 sub r5,r5,r4 8007b44: 58 65 00 10 sw (r3+16),r5 _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); 8007b48: 28 63 00 04 lw r3,(r3+4) the_watchdog->start_time = _Watchdog_Ticks_since_boot; 8007b4c: 78 01 08 01 mvhi r1,0x801 8007b50: 38 21 e9 c8 ori r1,r1,0xe9c8 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 8007b54: 28 65 00 00 lw r5,(r3+0) 8007b58: 28 28 00 00 lw r8,(r1+0) RTEMS_INLINE_ROUTINE void _Watchdog_Activate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_ACTIVE; 8007b5c: 34 01 00 02 mvi r1,2 8007b60: 58 41 00 08 sw (r2+8),r1 } } _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; 8007b64: 58 44 00 10 sw (r2+16),r4 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 8007b68: 58 43 00 04 sw (r2+4),r3 before_node = after_node->next; after_node->next = the_node; 8007b6c: 58 62 00 00 sw (r3+0),r2 the_node->next = before_node; before_node->previous = the_node; 8007b70: 58 a2 00 04 sw (r5+4),r2 Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 8007b74: 58 45 00 00 sw (r2+0),r5 _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); the_watchdog->start_time = _Watchdog_Ticks_since_boot; 8007b78: 58 48 00 14 sw (r2+20),r8 exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; 8007b7c: 58 e9 00 00 sw (r7+0),r9 _Watchdog_Sync_count--; 8007b80: 29 81 00 00 lw r1,(r12+0) 8007b84: 34 21 ff ff addi r1,r1,-1 8007b88: 59 81 00 00 sw (r12+0),r1 _ISR_Enable( level ); 8007b8c: d0 06 00 00 wcsr IE,r6 } 8007b90: 2b 8b 00 08 lw r11,(sp+8) 8007b94: 2b 8c 00 04 lw r12,(sp+4) 8007b98: 37 9c 00 08 addi sp,sp,8 8007b9c: c3 a0 00 00 ret break; } delta_interval -= after->delta_interval; _ISR_Flash( level ); 8007ba0: d0 06 00 00 wcsr IE,r6 8007ba4: d0 08 00 00 wcsr IE,r8 if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8007ba8: 28 4b 00 08 lw r11,(r2+8) if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 8007bac: c8 85 20 00 sub r4,r4,r5 _ISR_Flash( level ); if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8007bb0: 5d 6a ff f3 bne r11,r10,8007b7c <_Watchdog_Insert+0xe4> <== NEVER TAKEN goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 8007bb4: 28 e5 00 00 lw r5,(r7+0) 8007bb8: 54 a9 00 02 bgu r5,r9,8007bc0 <_Watchdog_Insert+0x128> <== NEVER TAKEN 8007bbc: e3 ff ff db bi 8007b28 <_Watchdog_Insert+0x90> _Watchdog_Sync_level = insert_isr_nest_level; 8007bc0: 58 e9 00 00 sw (r7+0),r9 goto restart; 8007bc4: e3 ff ff cb bi 8007af0 <_Watchdog_Insert+0x58> =============================================================================== 08007c30 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 8007c30: 90 00 20 00 rcsr r4,IE 8007c34: 34 02 ff fe mvi r2,-2 8007c38: a0 82 10 00 and r2,r4,r2 8007c3c: d0 02 00 00 wcsr IE,r2 previous_state = the_watchdog->state; 8007c40: 28 22 00 08 lw r2,(r1+8) switch ( previous_state ) { 8007c44: 34 03 00 01 mvi r3,1 8007c48: 44 43 00 27 be r2,r3,8007ce4 <_Watchdog_Remove+0xb4> 8007c4c: 5c 40 00 08 bne r2,r0,8007c6c <_Watchdog_Remove+0x3c> _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8007c50: 78 03 08 01 mvhi r3,0x801 8007c54: 38 63 e9 c8 ori r3,r3,0xe9c8 8007c58: 28 63 00 00 lw r3,(r3+0) 8007c5c: 58 23 00 18 sw (r1+24),r3 _ISR_Enable( level ); 8007c60: d0 04 00 00 wcsr IE,r4 return( previous_state ); } 8007c64: b8 40 08 00 mv r1,r2 8007c68: c3 a0 00 00 ret Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); previous_state = the_watchdog->state; switch ( previous_state ) { 8007c6c: 34 03 00 03 mvi r3,3 8007c70: 54 43 ff f8 bgu r2,r3,8007c50 <_Watchdog_Remove+0x20> <== NEVER TAKEN } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 8007c74: 28 23 00 00 lw r3,(r1+0) break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 8007c78: 58 20 00 08 sw (r1+8),r0 next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 8007c7c: 28 65 00 00 lw r5,(r3+0) 8007c80: 44 a0 00 05 be r5,r0,8007c94 <_Watchdog_Remove+0x64> next_watchdog->delta_interval += the_watchdog->delta_interval; 8007c84: 28 66 00 10 lw r6,(r3+16) 8007c88: 28 25 00 10 lw r5,(r1+16) 8007c8c: b4 c5 28 00 add r5,r6,r5 8007c90: 58 65 00 10 sw (r3+16),r5 if ( _Watchdog_Sync_count ) 8007c94: 78 05 08 01 mvhi r5,0x801 8007c98: 38 a5 e9 c4 ori r5,r5,0xe9c4 8007c9c: 28 a5 00 00 lw r5,(r5+0) 8007ca0: 44 a0 00 07 be r5,r0,8007cbc <_Watchdog_Remove+0x8c> _Watchdog_Sync_level = _ISR_Nest_level; 8007ca4: 78 05 08 01 mvhi r5,0x801 8007ca8: 38 a5 ea 60 ori r5,r5,0xea60 8007cac: 28 a6 00 08 lw r6,(r5+8) 8007cb0: 78 05 08 01 mvhi r5,0x801 8007cb4: 38 a5 e9 64 ori r5,r5,0xe964 8007cb8: 58 a6 00 00 sw (r5+0),r6 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 8007cbc: 28 25 00 04 lw r5,(r1+4) next->previous = previous; 8007cc0: 58 65 00 04 sw (r3+4),r5 previous->next = next; 8007cc4: 58 a3 00 00 sw (r5+0),r3 _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8007cc8: 78 03 08 01 mvhi r3,0x801 8007ccc: 38 63 e9 c8 ori r3,r3,0xe9c8 8007cd0: 28 63 00 00 lw r3,(r3+0) 8007cd4: 58 23 00 18 sw (r1+24),r3 _ISR_Enable( level ); 8007cd8: d0 04 00 00 wcsr IE,r4 return( previous_state ); } 8007cdc: b8 40 08 00 mv r1,r2 8007ce0: c3 a0 00 00 ret _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8007ce4: 78 03 08 01 mvhi r3,0x801 8007ce8: 38 63 e9 c8 ori r3,r3,0xe9c8 8007cec: 28 63 00 00 lw r3,(r3+0) /* * 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; 8007cf0: 58 20 00 08 sw (r1+8),r0 _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8007cf4: 58 23 00 18 sw (r1+24),r3 _ISR_Enable( level ); 8007cf8: d0 04 00 00 wcsr IE,r4 return( previous_state ); } 8007cfc: b8 40 08 00 mv r1,r2 8007d00: c3 a0 00 00 ret =============================================================================== 08009524 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 8009524: 37 9c ff ec addi sp,sp,-20 8009528: 5b 8b 00 14 sw (sp+20),r11 800952c: 5b 8c 00 10 sw (sp+16),r12 8009530: 5b 8d 00 0c sw (sp+12),r13 8009534: 5b 8e 00 08 sw (sp+8),r14 8009538: 5b 9d 00 04 sw (sp+4),ra 800953c: b8 20 70 00 mv r14,r1 8009540: b8 40 60 00 mv r12,r2 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 8009544: 90 00 68 00 rcsr r13,IE 8009548: 34 01 ff fe mvi r1,-2 800954c: a1 a1 08 00 and r1,r13,r1 8009550: d0 01 00 00 wcsr IE,r1 printk( "Watchdog Chain: %s %p\n", name, header ); 8009554: 78 01 08 01 mvhi r1,0x801 8009558: b9 80 18 00 mv r3,r12 800955c: 38 21 e7 48 ori r1,r1,0xe748 8009560: b9 c0 10 00 mv r2,r14 8009564: fb ff e6 ff calli 8003160 printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); } 8009568: 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 ); 800956c: 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 ) ) { 8009570: 45 6c 00 12 be r11,r12,80095b8 <_Watchdog_Report_chain+0x94> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 8009574: b9 60 10 00 mv r2,r11 8009578: 34 01 00 00 mvi r1,0 800957c: f8 00 00 13 calli 80095c8 <_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 ) 8009580: 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 ) ; 8009584: 5d 6c ff fc bne r11,r12,8009574 <_Watchdog_Report_chain+0x50><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 8009588: 78 01 08 01 mvhi r1,0x801 800958c: 38 21 e7 60 ori r1,r1,0xe760 8009590: b9 c0 10 00 mv r2,r14 8009594: fb ff e6 f3 calli 8003160 } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); 8009598: d0 0d 00 00 wcsr IE,r13 } 800959c: 2b 9d 00 04 lw ra,(sp+4) 80095a0: 2b 8b 00 14 lw r11,(sp+20) 80095a4: 2b 8c 00 10 lw r12,(sp+16) 80095a8: 2b 8d 00 0c lw r13,(sp+12) 80095ac: 2b 8e 00 08 lw r14,(sp+8) 80095b0: 37 9c 00 14 addi sp,sp,20 80095b4: c3 a0 00 00 ret _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 80095b8: 78 01 08 01 mvhi r1,0x801 80095bc: 38 21 e7 70 ori r1,r1,0xe770 80095c0: fb ff e6 e8 calli 8003160 80095c4: e3 ff ff f5 bi 8009598 <_Watchdog_Report_chain+0x74> =============================================================================== 08007d04 <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 8007d04: 37 9c ff e4 addi sp,sp,-28 8007d08: 5b 8b 00 1c sw (sp+28),r11 8007d0c: 5b 8c 00 18 sw (sp+24),r12 8007d10: 5b 8d 00 14 sw (sp+20),r13 8007d14: 5b 8e 00 10 sw (sp+16),r14 8007d18: 5b 8f 00 0c sw (sp+12),r15 8007d1c: 5b 90 00 08 sw (sp+8),r16 8007d20: 5b 9d 00 04 sw (sp+4),ra 8007d24: 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 ); 8007d28: 90 00 68 00 rcsr r13,IE 8007d2c: 34 01 ff fe mvi r1,-2 8007d30: a1 a1 08 00 and r1,r13,r1 8007d34: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 8007d38: 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 ); 8007d3c: 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 ); 8007d40: b9 a0 10 00 mv r2,r13 if ( _Chain_Is_empty( header ) ) 8007d44: 45 6e 00 1e be r11,r14,8007dbc <_Watchdog_Tickle+0xb8> * 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) { 8007d48: 29 61 00 10 lw r1,(r11+16) 8007d4c: 5c 20 00 26 bne r1,r0,8007de4 <_Watchdog_Tickle+0xe0> <== ALWAYS TAKEN do { watchdog_state = _Watchdog_Remove( the_watchdog ); _ISR_Enable( level ); switch( watchdog_state ) { 8007d50: 34 10 00 02 mvi r16,2 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8007d54: 34 0f ff fe mvi r15,-2 8007d58: e0 00 00 0a bi 8007d80 <_Watchdog_Tickle+0x7c> 8007d5c: 90 00 10 00 rcsr r2,IE <== NOT EXECUTED 8007d60: a0 4f 08 00 and r1,r2,r15 <== NOT EXECUTED 8007d64: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 8007d68: 29 81 00 00 lw r1,(r12+0) <== NOT EXECUTED case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8007d6c: b8 40 68 00 mv r13,r2 <== NOT EXECUTED RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) _Chain_First( header ) ); 8007d70: b8 20 58 00 mv r11,r1 <== NOT EXECUTED the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 8007d74: 44 2e 00 12 be r1,r14,8007dbc <_Watchdog_Tickle+0xb8> <== NOT EXECUTED } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 8007d78: 28 21 00 10 lw r1,(r1+16) 8007d7c: 5c 20 00 10 bne r1,r0,8007dbc <_Watchdog_Tickle+0xb8> if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 8007d80: b9 60 08 00 mv r1,r11 8007d84: fb ff ff ab calli 8007c30 <_Watchdog_Remove> _ISR_Enable( level ); 8007d88: d0 0d 00 00 wcsr IE,r13 switch( watchdog_state ) { 8007d8c: 5c 30 ff f4 bne r1,r16,8007d5c <_Watchdog_Tickle+0x58> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 8007d90: 29 63 00 1c lw r3,(r11+28) 8007d94: 29 61 00 20 lw r1,(r11+32) 8007d98: 29 62 00 24 lw r2,(r11+36) 8007d9c: d8 60 00 00 call r3 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8007da0: 90 00 10 00 rcsr r2,IE 8007da4: a0 4f 08 00 and r1,r2,r15 8007da8: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 8007dac: 29 81 00 00 lw r1,(r12+0) case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8007db0: b8 40 68 00 mv r13,r2 8007db4: b8 20 58 00 mv r11,r1 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 8007db8: 5c 2e ff f0 bne r1,r14,8007d78 <_Watchdog_Tickle+0x74> leave: _ISR_Enable(level); 8007dbc: d0 02 00 00 wcsr IE,r2 } 8007dc0: 2b 9d 00 04 lw ra,(sp+4) 8007dc4: 2b 8b 00 1c lw r11,(sp+28) 8007dc8: 2b 8c 00 18 lw r12,(sp+24) 8007dcc: 2b 8d 00 14 lw r13,(sp+20) 8007dd0: 2b 8e 00 10 lw r14,(sp+16) 8007dd4: 2b 8f 00 0c lw r15,(sp+12) 8007dd8: 2b 90 00 08 lw r16,(sp+8) 8007ddc: 37 9c 00 1c addi sp,sp,28 8007de0: c3 a0 00 00 ret * 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) { the_watchdog->delta_interval--; 8007de4: 34 21 ff ff addi r1,r1,-1 8007de8: 59 61 00 10 sw (r11+16),r1 if ( the_watchdog->delta_interval != 0 ) 8007dec: 44 20 ff d9 be r1,r0,8007d50 <_Watchdog_Tickle+0x4c> 8007df0: e3 ff ff f3 bi 8007dbc <_Watchdog_Tickle+0xb8> =============================================================================== 08007df4 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8007df4: 37 9c ff d0 addi sp,sp,-48 8007df8: 5b 8b 00 30 sw (sp+48),r11 8007dfc: 5b 8c 00 2c sw (sp+44),r12 8007e00: 5b 8d 00 28 sw (sp+40),r13 8007e04: 5b 8e 00 24 sw (sp+36),r14 8007e08: 5b 8f 00 20 sw (sp+32),r15 8007e0c: 5b 90 00 1c sw (sp+28),r16 8007e10: 5b 91 00 18 sw (sp+24),r17 8007e14: 5b 92 00 14 sw (sp+20),r18 8007e18: 5b 93 00 10 sw (sp+16),r19 8007e1c: 5b 94 00 0c sw (sp+12),r20 8007e20: 5b 95 00 08 sw (sp+8),r21 8007e24: 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(); 8007e28: 78 04 08 01 mvhi r4,0x801 8007e2c: 38 84 b9 9c ori r4,r4,0xb99c 8007e30: 40 85 00 32 lbu r5,(r4+50) void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8007e34: b8 40 80 00 mv r16,r2 8007e38: b8 60 a0 00 mv r20,r3 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 8007e3c: 28 8e 00 00 lw r14,(r4+0) 8007e40: 34 02 00 00 mvi r2,0 8007e44: 5c a0 00 02 bne r5,r0,8007e4c <_Workspace_Handler_initialization+0x58> 8007e48: 28 82 00 04 lw r2,(r4+4) 8007e4c: b4 4e 70 00 add r14,r2,r14 bool do_zero = rtems_configuration_get_do_zero_of_workspace(); 8007e50: 40 92 00 30 lbu r18,(r4+48) bool unified = rtems_configuration_get_unified_work_area(); 8007e54: 40 95 00 31 lbu r21,(r4+49) 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) { 8007e58: 46 00 00 21 be r16,r0,8007edc <_Workspace_Handler_initialization+0xe8><== NEVER TAKEN Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 8007e5c: 78 0f 08 00 mvhi r15,0x800 } else { size = 0; } } space_available = (*init_or_extend)( 8007e60: 78 11 08 01 mvhi r17,0x801 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) { 8007e64: b8 20 58 00 mv r11,r1 8007e68: 34 0d 00 00 mvi r13,0 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 8007e6c: 39 ef 51 80 ori r15,r15,0x5180 if ( do_zero ) { memset( area->begin, 0, area->size ); } if ( area->size > overhead ) { 8007e70: 34 13 00 0e mvi r19,14 } else { size = 0; } } space_available = (*init_or_extend)( 8007e74: 3a 31 e8 f0 ori r17,r17,0xe8f0 size_t i; for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { 8007e78: 5e 40 00 28 bne r18,r0,8007f18 <_Workspace_Handler_initialization+0x124> memset( area->begin, 0, area->size ); } if ( area->size > overhead ) { 8007e7c: 29 6c 00 04 lw r12,(r11+4) 8007e80: 52 6c 00 14 bgeu r19,r12,8007ed0 <_Workspace_Handler_initialization+0xdc> uintptr_t space_available; uintptr_t size; if ( unified ) { 8007e84: 5e a0 00 05 bne r21,r0,8007e98 <_Workspace_Handler_initialization+0xa4> size = area->size; } else { if ( remaining > 0 ) { 8007e88: 45 d5 00 29 be r14,r21,8007f2c <_Workspace_Handler_initialization+0x138><== NEVER TAKEN size = remaining < area->size - overhead ? 8007e8c: 35 81 ff f2 addi r1,r12,-14 remaining + overhead : area->size; 8007e90: 51 c1 00 02 bgeu r14,r1,8007e98 <_Workspace_Handler_initialization+0xa4><== NEVER TAKEN 8007e94: 35 cc 00 0e addi r12,r14,14 } else { size = 0; } } space_available = (*init_or_extend)( 8007e98: 29 62 00 00 lw r2,(r11+0) 8007e9c: b9 80 18 00 mv r3,r12 8007ea0: ba 20 08 00 mv r1,r17 8007ea4: 34 04 00 04 mvi r4,4 8007ea8: d9 e0 00 00 call r15 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 8007eac: 29 62 00 00 lw r2,(r11+0) area->size -= size; 8007eb0: 29 63 00 04 lw r3,(r11+4) area->begin, size, page_size ); area->begin = (char *) area->begin + size; 8007eb4: b4 4c 10 00 add r2,r2,r12 area->size -= size; 8007eb8: c8 6c 60 00 sub r12,r3,r12 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 8007ebc: 59 62 00 00 sw (r11+0),r2 area->size -= size; 8007ec0: 59 6c 00 04 sw (r11+4),r12 if ( space_available < remaining ) { 8007ec4: 50 2e 00 21 bgeu r1,r14,8007f48 <_Workspace_Handler_initialization+0x154><== ALWAYS TAKEN remaining -= space_available; 8007ec8: c9 c1 70 00 sub r14,r14,r1 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 8007ecc: ba 80 78 00 mv r15,r20 <== NOT EXECUTED bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 8007ed0: 35 ad 00 01 addi r13,r13,1 8007ed4: 35 6b 00 08 addi r11,r11,8 8007ed8: 56 0d ff e8 bgu r16,r13,8007e78 <_Workspace_Handler_initialization+0x84><== NEVER TAKEN init_or_extend = extend; } } if ( remaining > 0 ) { 8007edc: 5d c0 00 1e bne r14,r0,8007f54 <_Workspace_Handler_initialization+0x160> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } } 8007ee0: 2b 9d 00 04 lw ra,(sp+4) 8007ee4: 2b 8b 00 30 lw r11,(sp+48) 8007ee8: 2b 8c 00 2c lw r12,(sp+44) 8007eec: 2b 8d 00 28 lw r13,(sp+40) 8007ef0: 2b 8e 00 24 lw r14,(sp+36) 8007ef4: 2b 8f 00 20 lw r15,(sp+32) 8007ef8: 2b 90 00 1c lw r16,(sp+28) 8007efc: 2b 91 00 18 lw r17,(sp+24) 8007f00: 2b 92 00 14 lw r18,(sp+20) 8007f04: 2b 93 00 10 lw r19,(sp+16) 8007f08: 2b 94 00 0c lw r20,(sp+12) 8007f0c: 2b 95 00 08 lw r21,(sp+8) 8007f10: 37 9c 00 30 addi sp,sp,48 8007f14: c3 a0 00 00 ret for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { memset( area->begin, 0, area->size ); 8007f18: 29 61 00 00 lw r1,(r11+0) 8007f1c: 29 63 00 04 lw r3,(r11+4) 8007f20: 34 02 00 00 mvi r2,0 8007f24: f8 00 13 5b calli 800cc90 8007f28: e3 ff ff d5 bi 8007e7c <_Workspace_Handler_initialization+0x88> } else { size = 0; } } space_available = (*init_or_extend)( 8007f2c: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED 8007f30: ba 20 08 00 mv r1,r17 <== NOT EXECUTED 8007f34: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 8007f38: 34 04 00 04 mvi r4,4 <== NOT EXECUTED 8007f3c: d9 e0 00 00 call r15 <== NOT EXECUTED remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 8007f40: ba 80 78 00 mv r15,r20 <== NOT EXECUTED 8007f44: e3 ff ff e3 bi 8007ed0 <_Workspace_Handler_initialization+0xdc><== NOT EXECUTED 8007f48: ba 80 78 00 mv r15,r20 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 8007f4c: 34 0e 00 00 mvi r14,0 8007f50: e3 ff ff e0 bi 8007ed0 <_Workspace_Handler_initialization+0xdc> init_or_extend = extend; } } if ( remaining > 0 ) { _Internal_error_Occurred( 8007f54: 34 01 00 00 mvi r1,0 8007f58: 34 02 00 01 mvi r2,1 8007f5c: 34 03 00 02 mvi r3,2 8007f60: fb ff f5 39 calli 8005444 <_Internal_error_Occurred> =============================================================================== 08007484 <_Workspace_String_duplicate>: char *_Workspace_String_duplicate( const char *string, size_t len ) { 8007484: 37 9c ff f0 addi sp,sp,-16 8007488: 5b 8b 00 10 sw (sp+16),r11 800748c: 5b 8c 00 0c sw (sp+12),r12 8007490: 5b 8d 00 08 sw (sp+8),r13 8007494: 5b 9d 00 04 sw (sp+4),ra 8007498: b8 20 68 00 mv r13,r1 char *dup = _Workspace_Allocate(len + 1); 800749c: 34 41 00 01 addi r1,r2,1 char *_Workspace_String_duplicate( const char *string, size_t len ) { 80074a0: b8 40 60 00 mv r12,r2 char *dup = _Workspace_Allocate(len + 1); 80074a4: fb ff ff d5 calli 80073f8 <_Workspace_Allocate> 80074a8: b8 20 58 00 mv r11,r1 if (dup != NULL) { 80074ac: 44 20 00 06 be r1,r0,80074c4 <_Workspace_String_duplicate+0x40><== NEVER TAKEN dup [len] = '\0'; 80074b0: b4 2c 10 00 add r2,r1,r12 80074b4: 30 40 00 00 sb (r2+0),r0 memcpy(dup, string, len); 80074b8: b9 80 18 00 mv r3,r12 80074bc: b9 a0 10 00 mv r2,r13 80074c0: f8 00 13 e1 calli 800c444 } return dup; } 80074c4: b9 60 08 00 mv r1,r11 80074c8: 2b 9d 00 04 lw ra,(sp+4) 80074cc: 2b 8b 00 10 lw r11,(sp+16) 80074d0: 2b 8c 00 0c lw r12,(sp+12) 80074d4: 2b 8d 00 08 lw r13,(sp+8) 80074d8: 37 9c 00 10 addi sp,sp,16 80074dc: c3 a0 00 00 ret =============================================================================== 0801b0bc <__kill>: #endif int __kill( pid_t pid, int sig ) { return 0; } 801b0bc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 801b0c0: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08010e3c <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 8010e3c: 37 9c ff dc addi sp,sp,-36 8010e40: 5b 8b 00 20 sw (sp+32),r11 8010e44: 5b 8c 00 1c sw (sp+28),r12 8010e48: 5b 8d 00 18 sw (sp+24),r13 8010e4c: 5b 8e 00 14 sw (sp+20),r14 8010e50: 5b 8f 00 10 sw (sp+16),r15 8010e54: 5b 90 00 0c sw (sp+12),r16 8010e58: 5b 91 00 08 sw (sp+8),r17 8010e5c: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; ssize_t cmpltd = 0; 8010e60: 34 0d 00 00 mvi r13,0 uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 8010e64: b8 80 60 00 mv r12,r4 8010e68: b8 20 80 00 mv r16,r1 8010e6c: b8 a0 88 00 mv r17,r5 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 8010e70: 44 80 00 19 be r4,r0,8010ed4 <_fat_block_read+0x98> <== NEVER TAKEN 8010e74: b8 60 78 00 mv r15,r3 8010e78: b8 40 70 00 mv r14,r2 8010e7c: e0 00 00 0f bi 8010eb8 <_fat_block_read+0x7c> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 8010e80: 2e 0b 00 00 lhu r11,(r16+0) memcpy((buff + cmpltd), (sec_buf + ofs), c); 8010e84: 2b 82 00 24 lw r2,(sp+36) 8010e88: b6 2d 08 00 add r1,r17,r13 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 8010e8c: c9 6f 58 00 sub r11,r11,r15 memcpy((buff + cmpltd), (sec_buf + ofs), c); 8010e90: b4 4f 10 00 add r2,r2,r15 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 8010e94: 51 8b 00 02 bgeu r12,r11,8010e9c <_fat_block_read+0x60> 8010e98: b9 80 58 00 mv r11,r12 memcpy((buff + cmpltd), (sec_buf + ofs), c); 8010e9c: b9 60 18 00 mv r3,r11 count -= c; 8010ea0: c9 8b 60 00 sub r12,r12,r11 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); 8010ea4: f8 00 2c ee calli 801c25c count -= c; cmpltd += c; 8010ea8: b5 6d 68 00 add r13,r11,r13 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 8010eac: 45 80 00 0a be r12,r0,8010ed4 <_fat_block_read+0x98> c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); count -= c; cmpltd += c; sec_num++; 8010eb0: 35 ce 00 01 addi r14,r14,1 ofs = 0; 8010eb4: 34 0f 00 00 mvi r15,0 uint8_t *sec_buf; uint32_t c = 0; while (count > 0) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 8010eb8: b9 c0 10 00 mv r2,r14 8010ebc: 37 84 00 24 addi r4,sp,36 8010ec0: ba 00 08 00 mv r1,r16 8010ec4: 34 03 00 01 mvi r3,1 8010ec8: fb ff ff 98 calli 8010d28 if (rc != RC_OK) 8010ecc: 44 20 ff ed be r1,r0,8010e80 <_fat_block_read+0x44> <== ALWAYS TAKEN return -1; 8010ed0: 34 0d ff ff mvi r13,-1 <== NOT EXECUTED cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } 8010ed4: b9 a0 08 00 mv r1,r13 8010ed8: 2b 9d 00 04 lw ra,(sp+4) 8010edc: 2b 8b 00 20 lw r11,(sp+32) 8010ee0: 2b 8c 00 1c lw r12,(sp+28) 8010ee4: 2b 8d 00 18 lw r13,(sp+24) 8010ee8: 2b 8e 00 14 lw r14,(sp+20) 8010eec: 2b 8f 00 10 lw r15,(sp+16) 8010ef0: 2b 90 00 0c lw r16,(sp+12) 8010ef4: 2b 91 00 08 lw r17,(sp+8) 8010ef8: 37 9c 00 24 addi sp,sp,36 8010efc: c3 a0 00 00 ret =============================================================================== 080017b0 <_gettimeofday>: */ int _gettimeofday( struct timeval *tp, struct timezone *tzp ) { 80017b0: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 80017b4: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return gettimeofday( tp, tzp ); 80017b8: fb ff ff ca calli 80016e0 <== NOT EXECUTED } 80017bc: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80017c0: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 80017c4: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08002518 <_lstat_r>: int _STAT_R_NAME( struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { 8002518: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 800251c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return _STAT_NAME( path, buf ); 8002520: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 8002524: b8 60 10 00 mv r2,r3 <== NOT EXECUTED 8002528: fb ff ff dd calli 800249c <== NOT EXECUTED } 800252c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8002530: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 8002534: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080027c4 <_stat_r>: int _STAT_R_NAME( struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { 80027c4: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 80027c8: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return _STAT_NAME( path, buf ); 80027cc: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 80027d0: b8 60 10 00 mv r2,r3 <== NOT EXECUTED 80027d4: fb ff ff dd calli 8002748 <== NOT EXECUTED } 80027d8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80027dc: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 80027e0: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 0800499c : rtems_chain_control *free_chain, rtems_rbtree_control *chunk_tree, rtems_rbheap_chunk *a, rtems_rbheap_chunk *b ) { 800499c: 37 9c ff fc addi sp,sp,-4 80049a0: 5b 9d 00 04 sw (sp+4),ra 80049a4: b8 20 28 00 mv r5,r1 if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) { 80049a8: 34 01 ff f8 mvi r1,-8 80049ac: 44 81 00 15 be r4,r1,8004a00 rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); if (chunk != NULL) { rtems_rbheap_add_to_spare_descriptor_chain(control, chunk); } } 80049b0: 28 86 00 00 lw r6,(r4+0) */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 80049b4: 44 c0 00 1b be r6,r0,8004a20 rtems_rbheap_chunk *a, rtems_rbheap_chunk *b ) { if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) { if (b->begin < a->begin) { 80049b8: 28 81 00 18 lw r1,(r4+24) 80049bc: 28 67 00 18 lw r7,(r3+24) 80049c0: 54 e1 00 13 bgu r7,r1,8004a0c a = b; b = t; } a->size += b->size; 80049c4: 28 69 00 1c lw r9,(r3+28) 80049c8: 28 88 00 1c lw r8,(r4+28) { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 80049cc: 28 87 00 04 lw r7,(r4+4) rtems_chain_extract_unprotected(&b->chain_node); add_to_chain(free_chain, b); _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); 80049d0: b8 40 08 00 mv r1,r2 a = b; b = t; } a->size += b->size; 80049d4: b5 28 10 00 add r2,r9,r8 80049d8: 58 62 00 1c sw (r3+28),r2 next->previous = previous; previous->next = next; 80049dc: 58 e6 00 00 sw (r7+0),r6 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 80049e0: 28 a2 00 00 lw r2,(r5+0) Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 80049e4: 58 c7 00 04 sw (r6+4),r7 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 80049e8: 58 85 00 04 sw (r4+4),r5 before_node = after_node->next; after_node->next = the_node; 80049ec: 58 a4 00 00 sw (r5+0),r4 the_node->next = before_node; 80049f0: 58 82 00 00 sw (r4+0),r2 before_node->previous = the_node; 80049f4: 58 44 00 04 sw (r2+4),r4 rtems_chain_extract_unprotected(&b->chain_node); add_to_chain(free_chain, b); _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); 80049f8: 34 82 00 08 addi r2,r4,8 80049fc: f8 00 07 b1 calli 80068c0 <_RBTree_Extract_unprotected> } } 8004a00: 2b 9d 00 04 lw ra,(sp+4) 8004a04: 37 9c 00 04 addi sp,sp,4 8004a08: c3 a0 00 00 ret rtems_rbheap_chunk *a, rtems_rbheap_chunk *b ) { if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) { if (b->begin < a->begin) { 8004a0c: b8 60 08 00 mv r1,r3 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 8004a10: 28 66 00 00 lw r6,(r3+0) 8004a14: b8 80 18 00 mv r3,r4 8004a18: b8 20 20 00 mv r4,r1 8004a1c: e3 ff ff ea bi 80049c4 8004a20: 28 81 00 04 lw r1,(r4+4) 8004a24: 5c 26 ff e5 bne r1,r6,80049b8 <== NEVER TAKEN 8004a28: e3 ff ff f6 bi 8004a00 =============================================================================== 08002128 : #include #include int chroot( const char *path ) { 8002128: 37 9c ff 98 addi sp,sp,-104 800212c: 5b 8b 00 14 sw (sp+20),r11 8002130: 5b 8c 00 10 sw (sp+16),r12 8002134: 5b 8d 00 0c sw (sp+12),r13 8002138: 5b 8e 00 08 sw (sp+8),r14 800213c: 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( 8002140: 78 04 08 01 mvhi r4,0x801 8002144: 37 8d 00 18 addi r13,sp,24 8002148: 78 05 08 01 mvhi r5,0x801 800214c: 34 03 00 19 mvi r3,25 8002150: 38 84 31 20 ori r4,r4,0x3120 8002154: 38 a5 31 1c ori r5,r5,0x311c 8002158: b8 20 10 00 mv r2,r1 800215c: b9 a0 08 00 mv r1,r13 8002160: f8 00 05 7e calli 8003758 eval_flags, &rtems_global_user_env.root_directory, &rtems_global_user_env.current_directory ); rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc ); 8002164: 37 8b 00 50 addi r11,sp,80 8002168: 37 82 00 30 addi r2,sp,48 800216c: b9 60 08 00 mv r1,r11 8002170: f8 00 07 2c calli 8003e20 new_current_loc = rtems_filesystem_location_transform_to_global( &loc ); 8002174: b9 60 08 00 mv r1,r11 8002178: f8 00 07 f1 calli 800413c if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { 800217c: 28 22 00 10 lw r2,(r1+16) 8002180: 78 0b 08 01 mvhi r11,0x801 &rtems_global_user_env.root_directory, &rtems_global_user_env.current_directory ); rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc ); new_current_loc = rtems_filesystem_location_transform_to_global( &loc ); 8002184: 5b 81 00 68 sw (sp+104),r1 if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { 8002188: 39 6b 20 90 ori r11,r11,0x2090 800218c: 44 4b 00 11 be r2,r11,80021d0 rtems_filesystem_global_location_t *new_root_loc = 8002190: 37 81 00 68 addi r1,sp,104 8002194: f8 00 07 b1 calli 8004058 rtems_filesystem_global_location_obtain( &new_current_loc ); rtems_filesystem_node_types_t type = (*new_root_loc->location.mt_entry->ops->node_type_h)( 8002198: 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 = 800219c: b8 20 60 00 mv r12,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)( 80021a0: 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 = 80021a4: 28 42 00 14 lw r2,(r2+20) 80021a8: d8 40 00 00 call r2 80021ac: b8 20 70 00 mv r14,r1 (*new_root_loc->location.mt_entry->ops->node_type_h)( &new_root_loc->location ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { 80021b0: 44 20 00 14 be r1,r0,8002200 static inline void rtems_filesystem_location_error( const rtems_filesystem_location_info_t *loc, int eno ) { if ( !rtems_filesystem_location_is_null( loc ) ) { 80021b4: 29 81 00 10 lw r1,(r12+16) 80021b8: 44 2b 00 04 be r1,r11,80021c8 <== NEVER TAKEN errno = eno; 80021bc: f8 00 23 0e calli 800adf4 <__errno> 80021c0: 34 02 00 14 mvi r2,20 80021c4: 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 ); 80021c8: b9 80 08 00 mv r1,r12 80021cc: f8 00 07 78 calli 8003fac } } else { rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 80021d0: b9 a0 08 00 mv r1,r13 80021d4: f8 00 05 d3 calli 8003920 if ( rv != 0 ) { rtems_filesystem_global_location_release( new_current_loc ); 80021d8: 2b 81 00 68 lw r1,(sp+104) 80021dc: f8 00 07 74 calli 8003fac 80021e0: 34 01 ff ff mvi r1,-1 } return rv; } 80021e4: 2b 9d 00 04 lw ra,(sp+4) 80021e8: 2b 8b 00 14 lw r11,(sp+20) 80021ec: 2b 8c 00 10 lw r12,(sp+16) 80021f0: 2b 8d 00 0c lw r13,(sp+12) 80021f4: 2b 8e 00 08 lw r14,(sp+8) 80021f8: 37 9c 00 68 addi sp,sp,104 80021fc: c3 a0 00 00 ret (*new_root_loc->location.mt_entry->ops->node_type_h)( &new_root_loc->location ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { sc = rtems_libio_set_private_env(); 8002200: f8 00 03 27 calli 8002e9c if (sc == RTEMS_SUCCESSFUL) { 8002204: 44 2e 00 07 be r1,r14,8002220 rtems_filesystem_global_location_assign( &rtems_filesystem_current, new_current_loc ); } else { if (sc != RTEMS_UNSATISFIED) { 8002208: 34 02 00 0d mvi r2,13 800220c: 44 22 ff ef be r1,r2,80021c8 <== NEVER TAKEN errno = ENOMEM; 8002210: f8 00 22 f9 calli 800adf4 <__errno> 8002214: 34 02 00 0c mvi r2,12 8002218: 58 22 00 00 sw (r1+0),r2 800221c: e3 ff ff eb bi 80021c8 ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { sc = rtems_libio_set_private_env(); if (sc == RTEMS_SUCCESSFUL) { rtems_filesystem_global_location_assign( 8002220: 78 0b 08 01 mvhi r11,0x801 8002224: 39 6b 31 48 ori r11,r11,0x3148 8002228: 29 61 00 00 lw r1,(r11+0) 800222c: b9 80 10 00 mv r2,r12 8002230: 34 21 00 04 addi r1,r1,4 8002234: f8 00 07 7b calli 8004020 &rtems_filesystem_root, new_root_loc ); rtems_filesystem_global_location_assign( 8002238: 2b 82 00 68 lw r2,(sp+104) 800223c: 29 61 00 00 lw r1,(r11+0) 8002240: f8 00 07 78 calli 8004020 } } else { rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 8002244: b9 a0 08 00 mv r1,r13 8002248: f8 00 05 b6 calli 8003920 800224c: 34 01 00 00 mvi r1,0 8002250: e3 ff ff e5 bi 80021e4 =============================================================================== 08001478 : dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 8001478: 37 9c ff cc addi sp,sp,-52 800147c: 5b 8b 00 34 sw (sp+52),r11 8001480: 5b 8c 00 30 sw (sp+48),r12 8001484: 5b 8d 00 2c sw (sp+44),r13 8001488: 5b 8e 00 28 sw (sp+40),r14 800148c: 5b 8f 00 24 sw (sp+36),r15 8001490: 5b 90 00 20 sw (sp+32),r16 8001494: 5b 91 00 1c sw (sp+28),r17 8001498: 5b 92 00 18 sw (sp+24),r18 800149c: 5b 93 00 14 sw (sp+20),r19 80014a0: 5b 94 00 10 sw (sp+16),r20 80014a4: 5b 95 00 0c sw (sp+12),r21 80014a8: 5b 96 00 08 sw (sp+8),r22 80014ac: 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) { 80014b0: 78 0b 08 01 mvhi r11,0x801 80014b4: 39 6b 96 d8 ori r11,r11,0x96d8 80014b8: 29 6e 00 00 lw r14,(r11+0) dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 80014bc: b8 20 78 00 mv r15,r1 80014c0: b8 40 80 00 mv r16,r2 80014c4: b8 60 98 00 mv r19,r3 80014c8: b8 80 a0 00 mv r20,r4 80014cc: b8 a0 a8 00 mv r21,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) { 80014d0: 50 2e 00 51 bgeu r1,r14,8001614 80014d4: 78 0c 08 01 mvhi r12,0x801 80014d8: 39 8c 96 d4 ori r12,r12,0x96d4 80014dc: 29 91 00 00 lw r17,(r12+0) memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); disktab = table; disktab_size = new_size; } if (disktab [major].minor == NULL || minor >= disktab[major].size) { 80014e0: b5 ef 58 00 add r11,r15,r15 80014e4: b5 6b 58 00 add r11,r11,r11 80014e8: b5 6b 58 00 add r11,r11,r11 80014ec: b6 2b 10 00 add r2,r17,r11 80014f0: 28 4e 00 00 lw r14,(r2+0) 80014f4: 45 c0 00 6b be r14,r0,80016a0 80014f8: 28 51 00 04 lw r17,(r2+4) 80014fc: 56 30 00 19 bgu r17,r16,8001560 rtems_disk_device **table = disktab [major].minor; rtems_device_minor_number old_size = disktab [major].size; rtems_device_minor_number new_size = 0; if (old_size == 0) { new_size = DISKTAB_INITIAL_SIZE; 8001500: 34 12 00 08 mvi r18,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) { 8001504: 46 20 00 02 be r17,r0,800150c new_size = DISKTAB_INITIAL_SIZE; } else { new_size = 2 * old_size; 8001508: b6 31 90 00 add r18,r17,r17 } if (minor >= new_size) { 800150c: 56 50 00 02 bgu r18,r16,8001514 new_size = minor + 1; 8001510: 36 12 00 01 addi r18,r16,1 } table = realloc(table, new_size * sizeof(*table)); 8001514: b6 52 10 00 add r2,r18,r18 8001518: b9 c0 08 00 mv r1,r14 800151c: b4 42 10 00 add r2,r2,r2 8001520: f8 00 09 93 calli 8003b6c 8001524: b8 20 70 00 mv r14,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; 8001528: 34 0d 00 1a mvi r13,26 if (minor >= new_size) { new_size = minor + 1; } table = realloc(table, new_size * sizeof(*table)); if (table == NULL) { 800152c: 44 20 00 15 be r1,r0,8001580 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 8001530: ca 51 18 00 sub r3,r18,r17 8001534: b6 31 88 00 add r17,r17,r17 8001538: b4 63 18 00 add r3,r3,r3 800153c: b6 31 88 00 add r17,r17,r17 8001540: b4 63 18 00 add r3,r3,r3 8001544: b4 31 08 00 add r1,r1,r17 8001548: 34 02 00 00 mvi r2,0 800154c: f8 00 42 c3 calli 8012058 disktab [major].minor = table; 8001550: 29 81 00 00 lw r1,(r12+0) 8001554: b4 2b 58 00 add r11,r1,r11 8001558: 59 6e 00 00 sw (r11+0),r14 disktab [major].size = new_size; 800155c: 59 72 00 04 sw (r11+4),r18 } return disktab [major].minor + minor; 8001560: b6 10 30 00 add r6,r16,r16 8001564: b4 c6 30 00 add r6,r6,r6 8001568: b5 c6 70 00 add r14,r14,r6 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; 800156c: 34 0d 00 1a mvi r13,26 { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { 8001570: 45 c0 00 04 be r14,r0,8001580 <== NEVER TAKEN return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { 8001574: 29 cb 00 00 lw r11,(r14+0) return RTEMS_RESOURCE_IN_USE; 8001578: 34 0d 00 0c mvi r13,12 if (dd_entry == NULL) { return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { 800157c: 45 60 00 11 be r11,r0,80015c0 *dd_entry = dd; *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; } 8001580: b9 a0 08 00 mv r1,r13 8001584: 2b 9d 00 04 lw ra,(sp+4) 8001588: 2b 8b 00 34 lw r11,(sp+52) 800158c: 2b 8c 00 30 lw r12,(sp+48) 8001590: 2b 8d 00 2c lw r13,(sp+44) 8001594: 2b 8e 00 28 lw r14,(sp+40) 8001598: 2b 8f 00 24 lw r15,(sp+36) 800159c: 2b 90 00 20 lw r16,(sp+32) 80015a0: 2b 91 00 1c lw r17,(sp+28) 80015a4: 2b 92 00 18 lw r18,(sp+24) 80015a8: 2b 93 00 14 lw r19,(sp+20) 80015ac: 2b 94 00 10 lw r20,(sp+16) 80015b0: 2b 95 00 0c lw r21,(sp+12) 80015b4: 2b 96 00 08 lw r22,(sp+8) 80015b8: 37 9c 00 34 addi sp,sp,52 80015bc: c3 a0 00 00 ret if (*dd_entry != NULL) { return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); 80015c0: 34 01 00 78 mvi r1,120 80015c4: f8 00 06 52 calli 8002f0c 80015c8: b8 20 60 00 mv r12,r1 if (dd == NULL) { return RTEMS_NO_MEMORY; 80015cc: 34 0d 00 1a mvi r13,26 if (*dd_entry != NULL) { return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); if (dd == NULL) { 80015d0: 44 2b ff ec be r1,r11,8001580 <== NEVER TAKEN return RTEMS_NO_MEMORY; } if (name != NULL) { 80015d4: 46 60 00 31 be r19,r0,8001698 alloc_name = strdup(name); 80015d8: ba 60 08 00 mv r1,r19 80015dc: f8 00 43 e6 calli 8012574 80015e0: b8 20 58 00 mv r11,r1 80015e4: b8 20 88 00 mv r17,r1 if (alloc_name == NULL) { 80015e8: 44 20 00 30 be r1,r0,80016a8 <== NEVER TAKEN return RTEMS_NO_MEMORY; } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { 80015ec: 34 02 61 ff mvi r2,25087 80015f0: b9 e0 18 00 mv r3,r15 80015f4: ba 00 20 00 mv r4,r16 80015f8: f8 00 06 b0 calli 80030b8 80015fc: 48 01 00 21 bg r0,r1,8001680 <== NEVER TAKEN free(dd); return RTEMS_UNSATISFIED; } } *dd_entry = dd; 8001600: 59 cc 00 00 sw (r14+0),r12 *dd_ptr = dd; 8001604: 5a 8c 00 00 sw (r20+0),r12 *alloc_name_ptr = alloc_name; 8001608: 5a b1 00 00 sw (r21+0),r17 return RTEMS_SUCCESSFUL; 800160c: 34 0d 00 00 mvi r13,0 8001610: e3 ff ff dc bi 8001580 rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { rtems_disk_device_table *table = disktab; 8001614: 78 0c 08 01 mvhi r12,0x801 8001618: 39 8c 96 d4 ori r12,r12,0x96d4 rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; 800161c: b5 ce b0 00 add r22,r14,r14 rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { rtems_disk_device_table *table = disktab; 8001620: 29 81 00 00 lw r1,(r12+0) rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; 8001624: ba c0 90 00 mv r18,r22 if (major >= new_size) { 8001628: 56 cf 00 02 bgu r22,r15,8001630 <== NEVER TAKEN new_size = major + 1; 800162c: 35 f2 00 01 addi r18,r15,1 } table = realloc(table, new_size * sizeof(*table)); 8001630: b6 52 10 00 add r2,r18,r18 8001634: b4 42 10 00 add r2,r2,r2 8001638: b4 42 10 00 add r2,r2,r2 800163c: f8 00 09 4c calli 8003b6c 8001640: 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; 8001644: 34 0d 00 1a mvi r13,26 if (major >= new_size) { new_size = major + 1; } table = realloc(table, new_size * sizeof(*table)); if (table == NULL) { 8001648: 44 20 ff ce be r1,r0,8001580 <== ALWAYS TAKEN return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 800164c: ca 4e 70 00 sub r14,r18,r14 <== NOT EXECUTED 8001650: b5 ce 70 00 add r14,r14,r14 <== NOT EXECUTED 8001654: b5 ce 70 00 add r14,r14,r14 <== NOT EXECUTED 8001658: b6 d6 b0 00 add r22,r22,r22 <== NOT EXECUTED 800165c: b5 ce 70 00 add r14,r14,r14 <== NOT EXECUTED 8001660: b6 d6 b0 00 add r22,r22,r22 <== NOT EXECUTED 8001664: b4 36 08 00 add r1,r1,r22 <== NOT EXECUTED 8001668: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 800166c: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED 8001670: f8 00 42 7a calli 8012058 <== NOT EXECUTED disktab = table; 8001674: 59 91 00 00 sw (r12+0),r17 <== NOT EXECUTED disktab_size = new_size; 8001678: 59 72 00 00 sw (r11+0),r18 <== NOT EXECUTED 800167c: e3 ff ff 99 bi 80014e0 <== NOT EXECUTED } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { free(alloc_name); 8001680: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8001684: f8 00 04 8e calli 80028bc <== NOT EXECUTED free(dd); 8001688: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 800168c: f8 00 04 8c calli 80028bc <== NOT EXECUTED return RTEMS_UNSATISFIED; 8001690: 34 0d 00 0d mvi r13,13 <== NOT EXECUTED 8001694: e3 ff ff bb bi 8001580 <== 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; 8001698: 34 11 00 00 mvi r17,0 800169c: e3 ff ff d9 bi 8001600 memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); disktab = table; disktab_size = new_size; } if (disktab [major].minor == NULL || minor >= disktab[major].size) { 80016a0: 28 51 00 04 lw r17,(r2+4) 80016a4: e3 ff ff 97 bi 8001500 if (name != NULL) { alloc_name = strdup(name); if (alloc_name == NULL) { free(dd); 80016a8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 80016ac: f8 00 04 84 calli 80028bc <== NOT EXECUTED return RTEMS_NO_MEMORY; 80016b0: e3 ff ff b4 bi 8001580 <== NOT EXECUTED =============================================================================== 0800118c : */ char *ctermid( char *s ) { if ( !s ) 800118c: 44 20 00 18 be r1,r0,80011ec <== 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 ); 8001190: 34 04 00 2f mvi r4,47 <== NOT EXECUTED 8001194: 30 24 00 00 sb (r1+0),r4 <== NOT EXECUTED 8001198: 30 24 00 04 sb (r1+4),r4 <== NOT EXECUTED 800119c: 34 04 00 63 mvi r4,99 <== NOT EXECUTED 80011a0: 34 03 00 6f mvi r3,111 <== NOT EXECUTED 80011a4: 34 05 00 64 mvi r5,100 <== NOT EXECUTED 80011a8: 30 24 00 05 sb (r1+5),r4 <== NOT EXECUTED 80011ac: 34 04 00 6e mvi r4,110 <== NOT EXECUTED 80011b0: 34 02 00 65 mvi r2,101 <== NOT EXECUTED 80011b4: 30 25 00 01 sb (r1+1),r5 <== NOT EXECUTED 80011b8: 30 23 00 06 sb (r1+6),r3 <== NOT EXECUTED 80011bc: 34 05 00 76 mvi r5,118 <== NOT EXECUTED 80011c0: 30 24 00 07 sb (r1+7),r4 <== NOT EXECUTED 80011c4: 30 23 00 09 sb (r1+9),r3 <== NOT EXECUTED 80011c8: 34 04 00 73 mvi r4,115 <== NOT EXECUTED 80011cc: 34 03 00 6c mvi r3,108 <== NOT EXECUTED 80011d0: 30 22 00 02 sb (r1+2),r2 <== NOT EXECUTED 80011d4: 30 25 00 03 sb (r1+3),r5 <== NOT EXECUTED 80011d8: 30 24 00 08 sb (r1+8),r4 <== NOT EXECUTED 80011dc: 30 23 00 0a sb (r1+10),r3 <== NOT EXECUTED 80011e0: 30 22 00 0b sb (r1+11),r2 <== NOT EXECUTED 80011e4: 30 20 00 0c sb (r1+12),r0 <== NOT EXECUTED return s; 80011e8: c3 a0 00 00 ret <== NOT EXECUTED char *ctermid( char *s ) { if ( !s ) return ctermid_name; 80011ec: 78 01 08 00 mvhi r1,0x800 <== NOT EXECUTED 80011f0: 38 21 fa 78 ori r1,r1,0xfa78 <== 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; } 80011f4: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 0800321c : * 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) { 800321c: 37 9c ff e0 addi sp,sp,-32 8003220: 5b 8b 00 1c sw (sp+28),r11 8003224: 5b 8c 00 18 sw (sp+24),r12 8003228: 5b 8d 00 14 sw (sp+20),r13 800322c: 5b 8e 00 10 sw (sp+16),r14 8003230: 5b 8f 00 0c sw (sp+12),r15 8003234: 5b 90 00 08 sw (sp+8),r16 8003238: 5b 9d 00 04 sw (sp+4),ra 800323c: b8 20 58 00 mv r11,r1 8003240: b8 40 68 00 mv r13,r2 rtems_part_desc_t *part_desc; uint32_t temp; if (new_part_desc == NULL) { return RTEMS_INTERNAL_ERROR; 8003244: 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) 8003248: 44 40 00 72 be r2,r0,8003410 <== NEVER TAKEN { return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; 800324c: 58 40 00 00 sw (r2+0),r0 if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) 8003250: 34 01 00 01 mvi r1,1 8003254: 34 02 00 28 mvi r2,40 8003258: f8 00 03 c6 calli 8004170 800325c: b8 20 60 00 mv r12,r1 { return RTEMS_NO_MEMORY; 8003260: 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) 8003264: 45 80 00 6b be r12,r0,8003410 <== NEVER TAKEN part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); /* 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)); 8003268: 35 61 00 08 addi r1,r11,8 800326c: 41 64 00 08 lbu r4,(r11+8) 8003270: 40 23 00 01 lbu r3,(r1+1) 8003274: 40 22 00 02 lbu r2,(r1+2) 8003278: 40 21 00 03 lbu r1,(r1+3) 800327c: 33 84 00 20 sb (sp+32),r4 8003280: 33 82 00 22 sb (sp+34),r2 8003284: 33 81 00 23 sb (sp+35),r1 8003288: 33 83 00 21 sb (sp+33),r3 part_desc->start = LE_TO_CPU_U32(temp); 800328c: 2b 8f 00 20 lw r15,(sp+32) if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); 8003290: 41 63 00 00 lbu r3,(r11+0) part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); 8003294: 41 6e 00 04 lbu r14,(r11+4) byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8003298: 34 02 00 18 mvi r2,24 800329c: 21 e1 00 ff andi r1,r15,0xff if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); 80032a0: 31 83 00 00 sb (r12+0),r3 part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); 80032a4: 31 8e 00 01 sb (r12+1),r14 80032a8: f8 00 87 94 calli 80250f8 <__ashlsi3> 80032ac: b8 20 80 00 mv r16,r1 uint32_t value ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; 80032b0: 34 02 00 18 mvi r2,24 80032b4: b9 e0 08 00 mv r1,r15 80032b8: f8 00 87 de calli 8025230 <__lshrsi3> byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 80032bc: 01 e4 00 01 srui r4,r15,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 80032c0: ba 01 80 00 or r16,r16,r1 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 80032c4: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 80032c8: 34 02 00 10 mvi r2,16 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 80032cc: 00 84 00 01 srui r4,r4,1 80032d0: 00 84 00 01 srui r4,r4,1 80032d4: 00 84 00 01 srui r4,r4,1 80032d8: 00 84 00 01 srui r4,r4,1 80032dc: 00 84 00 01 srui r4,r4,1 80032e0: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 80032e4: 20 81 00 ff andi r1,r4,0xff 80032e8: f8 00 87 84 calli 80250f8 <__ashlsi3> 80032ec: ba 01 80 00 or r16,r16,r1 ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; 80032f0: 34 02 00 10 mvi r2,16 80032f4: b9 e0 08 00 mv r1,r15 80032f8: f8 00 87 ce calli 8025230 <__lshrsi3> 80032fc: 20 23 00 ff andi r3,r1,0xff /* 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); memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); 8003300: 35 62 00 0c addi r2,r11,12 byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8003304: b4 63 18 00 add r3,r3,r3 8003308: 40 45 00 01 lbu r5,(r2+1) 800330c: 40 44 00 02 lbu r4,(r2+2) 8003310: 40 41 00 03 lbu r1,(r2+3) 8003314: b4 63 18 00 add r3,r3,r3 8003318: 41 62 00 0c lbu r2,(r11+12) 800331c: b4 63 18 00 add r3,r3,r3 8003320: b4 63 18 00 add r3,r3,r3 8003324: 33 85 00 21 sb (sp+33),r5 8003328: 33 84 00 22 sb (sp+34),r4 800332c: 33 82 00 20 sb (sp+32),r2 8003330: 33 81 00 23 sb (sp+35),r1 8003334: b4 63 18 00 add r3,r3,r3 part_desc->size = LE_TO_CPU_U32(temp); 8003338: 2b 8b 00 20 lw r11,(sp+32) 800333c: b4 63 18 00 add r3,r3,r3 8003340: b4 63 18 00 add r3,r3,r3 8003344: b4 63 18 00 add r3,r3,r3 8003348: ba 03 18 00 or r3,r16,r3 800334c: 34 02 00 18 mvi r2,24 8003350: 21 61 00 ff andi r1,r11,0xff /* 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); 8003354: 59 83 00 04 sw (r12+4),r3 8003358: f8 00 87 68 calli 80250f8 <__ashlsi3> 800335c: b8 20 78 00 mv r15,r1 uint32_t value ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; 8003360: 34 02 00 18 mvi r2,24 8003364: b9 60 08 00 mv r1,r11 8003368: f8 00 87 b2 calli 8025230 <__lshrsi3> byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 800336c: 01 64 00 01 srui r4,r11,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8003370: b9 e1 78 00 or r15,r15,r1 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8003374: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8003378: 34 02 00 10 mvi r2,16 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 800337c: 00 84 00 01 srui r4,r4,1 8003380: 00 84 00 01 srui r4,r4,1 8003384: 00 84 00 01 srui r4,r4,1 8003388: 00 84 00 01 srui r4,r4,1 800338c: 00 84 00 01 srui r4,r4,1 8003390: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8003394: 20 81 00 ff andi r1,r4,0xff 8003398: f8 00 87 58 calli 80250f8 <__ashlsi3> 800339c: b9 e1 78 00 or r15,r15,r1 ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; 80033a0: 34 02 00 10 mvi r2,16 80033a4: b9 60 08 00 mv r1,r11 80033a8: f8 00 87 a2 calli 8025230 <__lshrsi3> 80033ac: 20 23 00 ff andi r3,r1,0xff byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 80033b0: b4 63 18 00 add r3,r3,r3 80033b4: b4 63 18 00 add r3,r3,r3 80033b8: b4 63 18 00 add r3,r3,r3 80033bc: b4 63 18 00 add r3,r3,r3 80033c0: b4 63 18 00 add r3,r3,r3 80033c4: b4 63 18 00 add r3,r3,r3 80033c8: b4 63 18 00 add r3,r3,r3 80033cc: b4 63 18 00 add r3,r3,r3 * true if partition type is extended, false otherwise */ static bool is_extended(uint8_t type) { return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED)); 80033d0: 65 cb 00 85 cmpei r11,r14,133 80033d4: 65 c2 00 05 cmpei r2,r14,5 80033d8: b9 e3 78 00 or r15,r15,r3 /* 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); memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); part_desc->size = LE_TO_CPU_U32(temp); 80033dc: 59 8f 00 08 sw (r12+8),r15 * true if partition type is extended, false otherwise */ static bool is_extended(uint8_t type) { return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED)); 80033e0: b9 62 58 00 or r11,r11,r2 * use partitions that are * - extended * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || 80033e4: 5d 60 00 14 bne r11,r0,8003434 DOS_P32MB_PARTITION, FAT32_PARTITION ,FAT32_LBA_PARTITION, FAT16_LBA_PARTITION }; return (NULL != memchr(fat_part_types,type,sizeof(fat_part_types))); 80033e8: 78 01 08 02 mvhi r1,0x802 80033ec: 38 21 61 08 ori r1,r1,0x6108 80033f0: b9 c0 10 00 mv r2,r14 80033f4: 34 03 00 06 mvi r3,6 80033f8: f8 00 42 23 calli 8013c84 * use partitions that are * - extended * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || 80033fc: 44 2b 00 02 be r1,r11,8003404 ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { 8003400: 5d e0 00 0d bne r15,r0,8003434 <== ALWAYS TAKEN *new_part_desc = part_desc; } else { /* empty partition */ free(part_desc); 8003404: b9 80 08 00 mv r1,r12 8003408: f8 00 03 a8 calli 80042a8 } return RTEMS_SUCCESSFUL; 800340c: 34 01 00 00 mvi r1,0 } 8003410: 2b 9d 00 04 lw ra,(sp+4) 8003414: 2b 8b 00 1c lw r11,(sp+28) 8003418: 2b 8c 00 18 lw r12,(sp+24) 800341c: 2b 8d 00 14 lw r13,(sp+20) 8003420: 2b 8e 00 10 lw r14,(sp+16) 8003424: 2b 8f 00 0c lw r15,(sp+12) 8003428: 2b 90 00 08 lw r16,(sp+8) 800342c: 37 9c 00 20 addi sp,sp,32 8003430: c3 a0 00 00 ret * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { *new_part_desc = part_desc; 8003434: 59 ac 00 00 sw (r13+0),r12 } else { /* empty partition */ free(part_desc); } return RTEMS_SUCCESSFUL; 8003438: 34 01 00 00 mvi r1,0 * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { *new_part_desc = part_desc; 800343c: e3 ff ff f5 bi 8003410 =============================================================================== 08000970 : #endif #include "devfs.h" void devFS_Show(void) { 8000970: 37 9c ff dc addi sp,sp,-36 8000974: 5b 8b 00 24 sw (sp+36),r11 8000978: 5b 8c 00 20 sw (sp+32),r12 800097c: 5b 8d 00 1c sw (sp+28),r13 8000980: 5b 8e 00 18 sw (sp+24),r14 8000984: 5b 8f 00 14 sw (sp+20),r15 8000988: 5b 90 00 10 sw (sp+16),r16 800098c: 5b 91 00 0c sw (sp+12),r17 8000990: 5b 92 00 08 sw (sp+8),r18 8000994: 5b 9d 00 04 sw (sp+4),ra rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; 8000998: 78 01 08 01 mvhi r1,0x801 800099c: 38 21 01 80 ori r1,r1,0x180 80009a0: 28 22 00 00 lw r2,(r1+0) if (rootloc->mt_entry->ops == &devFS_ops) { 80009a4: 78 01 08 00 mvhi r1,0x800 80009a8: 38 21 f4 b8 ori r1,r1,0xf4b8 #include "devfs.h" void devFS_Show(void) { rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; 80009ac: 28 42 00 04 lw r2,(r2+4) if (rootloc->mt_entry->ops == &devFS_ops) { 80009b0: 28 42 00 14 lw r2,(r2+20) 80009b4: 28 43 00 0c lw r3,(r2+12) 80009b8: 44 61 00 0c be r3,r1,80009e8 <== ALWAYS TAKEN (unsigned long) current->minor ); } } } } 80009bc: 2b 9d 00 04 lw ra,(sp+4) 80009c0: 2b 8b 00 24 lw r11,(sp+36) 80009c4: 2b 8c 00 20 lw r12,(sp+32) 80009c8: 2b 8d 00 1c lw r13,(sp+28) 80009cc: 2b 8e 00 18 lw r14,(sp+24) 80009d0: 2b 8f 00 14 lw r15,(sp+20) 80009d4: 2b 90 00 10 lw r16,(sp+16) 80009d8: 2b 91 00 0c lw r17,(sp+12) 80009dc: 2b 92 00 08 lw r18,(sp+8) 80009e0: 37 9c 00 24 addi sp,sp,36 80009e4: c3 a0 00 00 ret 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; 80009e8: 28 41 00 10 lw r1,(r2+16) 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; 80009ec: 28 32 00 04 lw r18,(r1+4) devFS_node *nodes = data->nodes; 80009f0: 28 2c 00 00 lw r12,(r1+0) for (i = 0; i < n; ++i) { 80009f4: 46 40 ff f2 be r18,r0,80009bc <== NEVER TAKEN if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); 80009f8: 78 11 08 00 mvhi r17,0x800 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); } printk( 80009fc: 78 10 08 00 mvhi r16,0x800 8000a00: 78 0d 08 00 mvhi r13,0x800 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) { 8000a04: 34 0f 00 00 mvi r15,0 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); 8000a08: 3a 31 f5 38 ori r17,r17,0xf538 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); } printk( 8000a0c: 3a 10 f5 40 ori r16,r16,0xf540 8000a10: 39 ad f5 3c ori r13,r13,0xf53c devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { devFS_node *current = nodes + i; if (current->name != NULL) { 8000a14: 29 81 00 00 lw r1,(r12+0) 8000a18: 44 20 00 11 be r1,r0,8000a5c size_t j = 0; size_t m = current->namelen; 8000a1c: 29 8e 00 04 lw r14,(r12+4) printk("/"); 8000a20: ba 20 08 00 mv r1,r17 8000a24: f8 00 04 19 calli 8001a88 for (j = 0; j < m; ++j) { 8000a28: 45 c0 00 09 be r14,r0,8000a4c <== NEVER TAKEN 8000a2c: 34 0b 00 00 mvi r11,0 printk("%c", current->name [j]); 8000a30: 29 82 00 00 lw r2,(r12+0) 8000a34: b9 a0 08 00 mv r1,r13 8000a38: b4 4b 10 00 add r2,r2,r11 8000a3c: 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) { 8000a40: 35 6b 00 01 addi r11,r11,1 printk("%c", current->name [j]); 8000a44: f8 00 04 11 calli 8001a88 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); for (j = 0; j < m; ++j) { 8000a48: 55 cb ff fa bgu r14,r11,8000a30 printk("%c", current->name [j]); } printk( 8000a4c: 29 82 00 08 lw r2,(r12+8) 8000a50: 29 83 00 0c lw r3,(r12+12) 8000a54: ba 00 08 00 mv r1,r16 8000a58: f8 00 04 0c calli 8001a88 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) { 8000a5c: 35 ef 00 01 addi r15,r15,1 8000a60: 35 8c 00 14 addi r12,r12,20 8000a64: 56 4f ff ec bgu r18,r15,8000a14 8000a68: e3 ff ff d5 bi 80009bc =============================================================================== 0800a028 : } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { 800a028: 37 9c ff dc addi sp,sp,-36 800a02c: 5b 8b 00 24 sw (sp+36),r11 800a030: 5b 8c 00 20 sw (sp+32),r12 800a034: 5b 8d 00 1c sw (sp+28),r13 800a038: 5b 8e 00 18 sw (sp+24),r14 800a03c: 5b 8f 00 14 sw (sp+20),r15 800a040: 5b 90 00 10 sw (sp+16),r16 800a044: 5b 91 00 0c sw (sp+12),r17 800a048: 5b 92 00 08 sw (sp+8),r18 800a04c: 5b 9d 00 04 sw (sp+4),ra 800a050: b8 20 80 00 mv r16,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; 800a054: 28 21 00 2c lw r1,(r1+44) } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } 800a058: 2a 12 00 00 lw r18,(r16+0) 800a05c: 2a 0f 00 04 lw r15,(r16+4) 800a060: 28 21 00 10 lw r1,(r1+16) size_t pathlen, devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; 800a064: 28 31 00 04 lw r17,(r1+4) devFS_node *nodes = data->nodes; 800a068: 28 2b 00 00 lw r11,(r1+0) devFS_node *node = NULL; devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 800a06c: 46 20 00 2c be r17,r0,800a11c ) { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; 800a070: 34 0d 00 00 mvi r13,0 devFS_node *free_node = NULL; 800a074: 34 0e 00 00 mvi r14,0 for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 800a078: 34 0c 00 00 mvi r12,0 devFS_node *current = nodes + i; if (current->name != NULL) { 800a07c: 29 61 00 00 lw r1,(r11+0) 800a080: 44 20 00 21 be r1,r0,800a104 if ( 800a084: 29 63 00 04 lw r3,(r11+4) 800a088: 45 e3 00 19 be r15,r3,800a0ec 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) { 800a08c: 65 a5 00 00 cmpei r5,r13,0 800a090: 65 c4 00 00 cmpei r4,r14,0 800a094: 35 8c 00 01 addi r12,r12,1 800a098: b8 a4 20 00 or r4,r5,r4 800a09c: 44 80 00 03 be r4,r0,800a0a8 800a0a0: 35 6b 00 14 addi r11,r11,20 800a0a4: 56 2c ff f6 bgu r17,r12,800a07c } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } 800a0a8: 2a 01 00 10 lw r1,(r16+16) rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { 800a0ac: 45 a0 00 1e be r13,r0,800a124 if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { 800a0b0: 20 21 00 40 andi r1,r1,0x40 800a0b4: 5c 20 00 16 bne r1,r0,800a10c currentloc->node_access = node; 800a0b8: 5a 0d 00 20 sw (r16+32),r13 static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; 800a0bc: 5a 00 00 04 sw (r16+4),r0 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } 800a0c0: 2b 9d 00 04 lw ra,(sp+4) 800a0c4: 2b 8b 00 24 lw r11,(sp+36) 800a0c8: 2b 8c 00 20 lw r12,(sp+32) 800a0cc: 2b 8d 00 1c lw r13,(sp+28) 800a0d0: 2b 8e 00 18 lw r14,(sp+24) 800a0d4: 2b 8f 00 14 lw r15,(sp+20) 800a0d8: 2b 90 00 10 lw r16,(sp+16) 800a0dc: 2b 91 00 0c lw r17,(sp+12) 800a0e0: 2b 92 00 08 lw r18,(sp+8) 800a0e4: 37 9c 00 24 addi sp,sp,36 800a0e8: c3 a0 00 00 ret devFS_node *current = nodes + i; if (current->name != NULL) { if ( current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 800a0ec: ba 40 10 00 mv r2,r18 800a0f0: b9 e0 18 00 mv r3,r15 800a0f4: f8 00 0b e8 calli 800d094 800a0f8: 5c 20 ff e5 bne r1,r0,800a08c 800a0fc: b9 60 68 00 mv r13,r11 800a100: e3 ff ff e3 bi 800a08c 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) { 800a104: b9 60 70 00 mv r14,r11 800a108: e3 ff ff e1 bi 800a08c if (node != NULL) { if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { currentloc->node_access = node; rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); 800a10c: ba 00 08 00 mv r1,r16 800a110: 34 02 00 11 mvi r2,17 800a114: fb ff ea 5e calli 8004a8c 800a118: e3 ff ff ea bi 800a0c0 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } 800a11c: 2a 01 00 10 lw r1,(r16+16) { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; 800a120: 34 0e 00 00 mvi r14,0 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { 800a124: 20 21 00 20 andi r1,r1,0x20 800a128: 44 20 00 09 be r1,r0,800a14c <== NEVER TAKEN if (free_node != NULL) { 800a12c: 45 c0 00 0c be r14,r0,800a15c free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; 800a130: 34 01 01 ff mvi r1,511 800a134: 59 c1 00 10 sw (r14+16),r1 currentloc->node_access = free_node; 800a138: 5a 0e 00 20 sw (r16+32),r14 rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; 800a13c: 5a 12 00 08 sw (r16+8),r18 ctx->tokenlen = tokenlen; 800a140: 5a 0f 00 0c sw (r16+12),r15 static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; 800a144: 5a 00 00 04 sw (r16+4),r0 800a148: e3 ff ff de bi 800a0c0 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, ENOSPC); } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); 800a14c: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 800a150: 34 02 00 02 mvi r2,2 <== NOT EXECUTED 800a154: fb ff ea 4e calli 8004a8c <== NOT EXECUTED 800a158: e3 ff ff da bi 800a0c0 <== NOT EXECUTED rtems_filesystem_eval_path_get_path(ctx), rtems_filesystem_eval_path_get_pathlen(ctx) ); rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, ENOSPC); 800a15c: ba 00 08 00 mv r1,r16 800a160: 34 02 00 1c mvi r2,28 800a164: fb ff ea 4a calli 8004a8c 800a168: e3 ff ff d6 bi 800a0c0 =============================================================================== 080036d8 : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 80036d8: 37 9c ff e4 addi sp,sp,-28 80036dc: 5b 8b 00 18 sw (sp+24),r11 80036e0: 5b 8c 00 14 sw (sp+20),r12 80036e4: 5b 8d 00 10 sw (sp+16),r13 80036e8: 5b 8e 00 0c sw (sp+12),r14 80036ec: 5b 8f 00 08 sw (sp+8),r15 80036f0: 5b 9d 00 04 sw (sp+4),ra 80036f4: b8 60 58 00 mv r11,r3 int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { 80036f8: 34 03 00 03 mvi r3,3 const char *name, size_t namelen, mode_t mode, dev_t dev ) { 80036fc: b8 20 78 00 mv r15,r1 8003700: b8 80 60 00 mv r12,r4 8003704: b8 a0 70 00 mv r14,r5 8003708: b8 c0 68 00 mv r13,r6 int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { 800370c: 45 63 00 1c be r11,r3,800377c if (S_ISBLK(mode) || S_ISCHR(mode)) { 8003710: 21 83 f0 00 andi r3,r12,0xf000 8003714: 64 64 20 00 cmpei r4,r3,8192 8003718: 64 63 60 00 cmpei r3,r3,24576 800371c: b8 83 18 00 or r3,r4,r3 8003720: 44 60 00 24 be r3,r0,80037b0 char *dupname = malloc(namelen); 8003724: b9 60 08 00 mv r1,r11 8003728: 5b 82 00 1c sw (sp+28),r2 800372c: f8 00 01 2b calli 8003bd8 if (dupname != NULL) { 8003730: 2b 82 00 1c lw r2,(sp+28) 8003734: 44 20 00 24 be r1,r0,80037c4 devFS_node *node = parentloc->node_access; 8003738: 29 e7 00 08 lw r7,(r15+8) node->name = dupname; node->namelen = namelen; node->major = rtems_filesystem_dev_major_t(dev); node->minor = rtems_filesystem_dev_minor_t(dev); node->mode = mode; memcpy(dupname, name, namelen); 800373c: b9 60 18 00 mv r3,r11 char *dupname = malloc(namelen); if (dupname != NULL) { devFS_node *node = parentloc->node_access; node->name = dupname; 8003740: 58 e1 00 00 sw (r7+0),r1 node->namelen = namelen; 8003744: 58 eb 00 04 sw (r7+4),r11 node->major = rtems_filesystem_dev_major_t(dev); 8003748: 58 ee 00 08 sw (r7+8),r14 node->minor = rtems_filesystem_dev_minor_t(dev); 800374c: 58 ed 00 0c sw (r7+12),r13 node->mode = mode; 8003750: 58 ec 00 10 sw (r7+16),r12 memcpy(dupname, name, namelen); 8003754: f8 00 26 71 calli 800d118 size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 8003758: 34 01 00 00 mvi r1,0 rv = -1; } } return rv; } 800375c: 2b 9d 00 04 lw ra,(sp+4) 8003760: 2b 8b 00 18 lw r11,(sp+24) 8003764: 2b 8c 00 14 lw r12,(sp+20) 8003768: 2b 8d 00 10 lw r13,(sp+16) 800376c: 2b 8e 00 0c lw r14,(sp+12) 8003770: 2b 8f 00 08 lw r15,(sp+8) 8003774: 37 9c 00 1c addi sp,sp,28 8003778: c3 a0 00 00 ret dev_t dev ) { int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { 800377c: 40 43 00 00 lbu r3,(r2+0) 8003780: 34 01 00 64 mvi r1,100 8003784: 5c 61 ff e3 bne r3,r1,8003710 <== NEVER TAKEN 8003788: 40 43 00 01 lbu r3,(r2+1) 800378c: 34 01 00 65 mvi r1,101 8003790: 5c 61 ff e0 bne r3,r1,8003710 <== NEVER TAKEN 8003794: 40 43 00 02 lbu r3,(r2+2) 8003798: 34 01 00 76 mvi r1,118 800379c: 5c 61 ff dd bne r3,r1,8003710 <== NEVER TAKEN } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { 80037a0: 20 8c f0 00 andi r12,r4,0xf000 80037a4: 34 02 40 00 mvi r2,16384 size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 80037a8: 34 01 00 00 mvi r1,0 } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { 80037ac: 45 82 ff ec be r12,r2,800375c <== ALWAYS TAKEN errno = ENOTSUP; 80037b0: f8 00 23 15 calli 800c404 <__errno> 80037b4: 34 02 00 86 mvi r2,134 80037b8: 58 22 00 00 sw (r1+0),r2 rv = -1; 80037bc: 34 01 ff ff mvi r1,-1 80037c0: e3 ff ff e7 bi 800375c 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; 80037c4: f8 00 23 10 calli 800c404 <__errno> 80037c8: 34 02 00 0c mvi r2,12 80037cc: 58 22 00 00 sw (r1+0),r2 rv = -1; 80037d0: 34 01 ff ff mvi r1,-1 80037d4: e3 ff ff e2 bi 800375c =============================================================================== 080013e8 : */ static volatile bool diskdevs_protected; static rtems_status_code disk_lock(void) { 80013e8: 37 9c ff fc addi sp,sp,-4 80013ec: 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); 80013f0: 78 01 08 01 mvhi r1,0x801 80013f4: 38 21 96 dc ori r1,r1,0x96dc 80013f8: 28 21 00 00 lw r1,(r1+0) 80013fc: 34 02 00 00 mvi r2,0 8001400: 34 03 00 00 mvi r3,0 8001404: f8 00 0f b4 calli 80052d4 if (sc == RTEMS_SUCCESSFUL) { diskdevs_protected = true; return RTEMS_SUCCESSFUL; } else { return RTEMS_NOT_CONFIGURED; 8001408: 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) { 800140c: 5c 20 00 06 bne r1,r0,8001424 <== NEVER TAKEN diskdevs_protected = true; 8001410: 78 01 08 01 mvhi r1,0x801 8001414: 34 02 00 01 mvi r2,1 8001418: 38 21 96 e0 ori r1,r1,0x96e0 800141c: 30 22 00 00 sb (r1+0),r2 return RTEMS_SUCCESSFUL; 8001420: 34 02 00 00 mvi r2,0 } else { return RTEMS_NOT_CONFIGURED; } } 8001424: b8 40 08 00 mv r1,r2 8001428: 2b 9d 00 04 lw ra,(sp+4) 800142c: 37 9c 00 04 addi sp,sp,4 8001430: c3 a0 00 00 ret =============================================================================== 08001434 : static void disk_unlock(void) { 8001434: 37 9c ff fc addi sp,sp,-4 8001438: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; sc = rtems_semaphore_release(diskdevs_mutex); 800143c: 78 01 08 01 mvhi r1,0x801 8001440: 38 21 96 dc ori r1,r1,0x96dc static void disk_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 8001444: 78 02 08 01 mvhi r2,0x801 sc = rtems_semaphore_release(diskdevs_mutex); 8001448: 28 21 00 00 lw r1,(r1+0) static void disk_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 800144c: 38 42 96 e0 ori r2,r2,0x96e0 8001450: 30 40 00 00 sb (r2+0),r0 sc = rtems_semaphore_release(diskdevs_mutex); 8001454: f8 00 0f fc calli 8005444 if (sc != RTEMS_SUCCESSFUL) { 8001458: 5c 20 00 04 bne r1,r0,8001468 <== NEVER TAKEN /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); } } 800145c: 2b 9d 00 04 lw ra,(sp+4) 8001460: 37 9c 00 04 addi sp,sp,4 8001464: c3 a0 00 00 ret diskdevs_protected = false; sc = rtems_semaphore_release(diskdevs_mutex); if (sc != RTEMS_SUCCESSFUL) { /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); 8001468: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 800146c: 38 42 7f ec ori r2,r2,0x7fec <== NOT EXECUTED 8001470: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 8001474: f8 00 10 fb calli 8005860 <== NOT EXECUTED =============================================================================== 08004318 : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) { 8004318: 37 9c ff f0 addi sp,sp,-16 800431c: 5b 8b 00 10 sw (sp+16),r11 8004320: 5b 8c 00 0c sw (sp+12),r12 8004324: 5b 8d 00 08 sw (sp+8),r13 8004328: 5b 9d 00 04 sw (sp+4),ra 800432c: b8 20 58 00 mv r11,r1 rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { 8004330: 28 21 00 b4 lw r1,(r1+180) 8004334: 44 20 00 18 be r1,r0,8004394 rtems_interrupt_disable (level); 8004338: 90 00 08 00 rcsr r1,IE 800433c: 34 02 ff fe mvi r2,-2 8004340: a0 22 10 00 and r2,r1,r2 8004344: d0 02 00 00 wcsr IE,r2 while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { 8004348: 29 63 00 84 lw r3,(r11+132) 800434c: 29 62 00 80 lw r2,(r11+128) 8004350: 44 62 00 10 be r3,r2,8004390 <== ALWAYS TAKEN tty->rawOutBufState = rob_wait; 8004354: 34 0c 00 02 mvi r12,2 <== NOT EXECUTED 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); 8004358: 34 0d ff fe mvi r13,-2 <== NOT EXECUTED rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; 800435c: 59 6c 00 94 sw (r11+148),r12 <== NOT EXECUTED rtems_interrupt_enable (level); 8004360: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED sc = rtems_semaphore_obtain( 8004364: 29 61 00 8c lw r1,(r11+140) <== NOT EXECUTED 8004368: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 800436c: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 8004370: f8 00 0a 79 calli 8006d54 <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 8004374: 5c 20 00 0e bne r1,r0,80043ac <== NOT EXECUTED rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); 8004378: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 800437c: a0 2d 10 00 and r2,r1,r13 <== NOT EXECUTED 8004380: 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) { 8004384: 29 63 00 84 lw r3,(r11+132) <== NOT EXECUTED 8004388: 29 62 00 80 lw r2,(r11+128) <== NOT EXECUTED 800438c: 5c 62 ff f4 bne r3,r2,800435c <== NOT EXECUTED 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); 8004390: d0 01 00 00 wcsr IE,r1 } } 8004394: 2b 9d 00 04 lw ra,(sp+4) 8004398: 2b 8b 00 10 lw r11,(sp+16) 800439c: 2b 8c 00 0c lw r12,(sp+12) 80043a0: 2b 8d 00 08 lw r13,(sp+8) 80043a4: 37 9c 00 10 addi sp,sp,16 80043a8: c3 a0 00 00 ret tty->rawOutBufState = rob_wait; rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); 80043ac: f8 00 0c ff calli 80077a8 <== NOT EXECUTED =============================================================================== 08001be4 : */ int dup2( int fildes, int fildes2 ) { 8001be4: 37 9c ff a4 addi sp,sp,-92 8001be8: 5b 8b 00 14 sw (sp+20),r11 8001bec: 5b 8c 00 10 sw (sp+16),r12 8001bf0: 5b 8d 00 0c sw (sp+12),r13 8001bf4: 5b 8e 00 08 sw (sp+8),r14 8001bf8: 5b 9d 00 04 sw (sp+4),ra /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001bfc: 37 8c 00 18 addi r12,sp,24 */ int dup2( int fildes, int fildes2 ) { 8001c00: b8 40 68 00 mv r13,r2 /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001c04: b9 80 10 00 mv r2,r12 if ( status == -1 ) return -1; 8001c08: 34 0b ff ff mvi r11,-1 */ int dup2( int fildes, int fildes2 ) { 8001c0c: b8 20 70 00 mv r14,r1 /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001c10: f8 00 01 61 calli 8002194 if ( status == -1 ) 8001c14: 5c 2b 00 09 bne r1,r11,8001c38 /* * This fcntl handles everything else. */ return fcntl( fildes, F_DUPFD, fildes2 ); } 8001c18: b9 60 08 00 mv r1,r11 8001c1c: 2b 9d 00 04 lw ra,(sp+4) 8001c20: 2b 8b 00 14 lw r11,(sp+20) 8001c24: 2b 8c 00 10 lw r12,(sp+16) 8001c28: 2b 8d 00 0c lw r13,(sp+12) 8001c2c: 2b 8e 00 08 lw r14,(sp+8) 8001c30: 37 9c 00 5c addi sp,sp,92 8001c34: c3 a0 00 00 ret /* * If fildes2 is not valid, then we should not do anything either. */ status = fstat( fildes2, &buf ); 8001c38: b9 a0 08 00 mv r1,r13 8001c3c: b9 80 10 00 mv r2,r12 8001c40: f8 00 01 55 calli 8002194 if ( status == -1 ) 8001c44: 44 2b ff f5 be r1,r11,8001c18 <== NEVER TAKEN /* * This fcntl handles everything else. */ return fcntl( fildes, F_DUPFD, fildes2 ); 8001c48: b9 c0 08 00 mv r1,r14 8001c4c: 34 02 00 00 mvi r2,0 8001c50: b9 a0 18 00 mv r3,r13 8001c54: f8 00 00 0b calli 8001c80 8001c58: b8 20 58 00 mv r11,r1 8001c5c: e3 ff ff ef bi 8001c18 =============================================================================== 080052b8 : /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { 80052b8: 37 9c ff f4 addi sp,sp,-12 80052bc: 5b 8b 00 08 sw (sp+8),r11 80052c0: 5b 9d 00 04 sw (sp+4),ra 80052c4: b8 40 58 00 mv r11,r2 if ((tty->termios.c_lflag & ECHOCTL) && 80052c8: 28 42 00 3c lw r2,(r2+60) 80052cc: 20 42 02 00 andi r2,r2,0x200 80052d0: 44 40 00 0b be r2,r0,80052fc <== NEVER TAKEN iscntrl(c) && (c != '\t') && (c != '\n')) { 80052d4: 78 02 08 02 mvhi r2,0x802 80052d8: 38 42 72 94 ori r2,r2,0x7294 80052dc: 28 42 00 00 lw r2,(r2+0) 80052e0: 7c 23 00 09 cmpnei r3,r1,9 80052e4: b4 41 10 00 add r2,r2,r1 80052e8: 40 42 00 01 lbu r2,(r2+1) 80052ec: 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) && 80052f0: 7c 42 00 00 cmpnei r2,r2,0 iscntrl(c) && (c != '\t') && (c != '\n')) { 80052f4: a0 43 10 00 and r2,r2,r3 80052f8: 5c 40 00 07 bne r2,r0,8005314 echobuf[0] = '^'; echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); tty->column += 2; } else { oproc (c, tty); 80052fc: b9 60 10 00 mv r2,r11 8005300: fb ff ff 8c calli 8005130 } } 8005304: 2b 9d 00 04 lw ra,(sp+4) 8005308: 2b 8b 00 08 lw r11,(sp+8) 800530c: 37 9c 00 0c addi sp,sp,12 8005310: c3 a0 00 00 ret */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { 8005314: 34 02 00 0a mvi r2,10 8005318: 44 22 ff f9 be r1,r2,80052fc char echobuf[2]; echobuf[0] = '^'; echobuf[1] = c ^ 0x40; 800531c: 18 24 00 40 xori r4,r1,0x40 { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; 8005320: 34 05 00 5e mvi r5,94 echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); 8005324: 37 81 00 0c addi r1,sp,12 8005328: 34 02 00 02 mvi r2,2 800532c: b9 60 18 00 mv r3,r11 { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; 8005330: 33 85 00 0c sb (sp+12),r5 echobuf[1] = c ^ 0x40; 8005334: 33 84 00 0d sb (sp+13),r4 rtems_termios_puts (echobuf, 2, tty); 8005338: fb ff ff 25 calli 8004fcc tty->column += 2; 800533c: 29 61 00 28 lw r1,(r11+40) 8005340: 34 21 00 02 addi r1,r1,2 8005344: 59 61 00 28 sw (r11+40),r1 } else { oproc (c, tty); } } 8005348: 2b 9d 00 04 lw ra,(sp+4) 800534c: 2b 8b 00 08 lw r11,(sp+8) 8005350: 37 9c 00 0c addi sp,sp,12 8005354: c3 a0 00 00 ret =============================================================================== 08025bd8 : void endgrent(void) { 8025bd8: 37 9c ff fc addi sp,sp,-4 8025bdc: 5b 9d 00 04 sw (sp+4),ra if (group_fp != NULL) 8025be0: 78 01 08 06 mvhi r1,0x806 8025be4: 38 21 d9 ec ori r1,r1,0xd9ec 8025be8: 28 21 00 00 lw r1,(r1+0) 8025bec: 44 20 00 02 be r1,r0,8025bf4 <== NEVER TAKEN fclose(group_fp); 8025bf0: f8 00 5a d4 calli 803c740 } 8025bf4: 2b 9d 00 04 lw ra,(sp+4) 8025bf8: 37 9c 00 04 addi sp,sp,4 8025bfc: c3 a0 00 00 ret =============================================================================== 08025a00 : void endpwent(void) { 8025a00: 37 9c ff fc addi sp,sp,-4 8025a04: 5b 9d 00 04 sw (sp+4),ra if (passwd_fp != NULL) 8025a08: 78 01 08 06 mvhi r1,0x806 8025a0c: 38 21 da c8 ori r1,r1,0xdac8 8025a10: 28 21 00 00 lw r1,(r1+0) 8025a14: 44 20 00 02 be r1,r0,8025a1c <== NEVER TAKEN fclose(passwd_fp); 8025a18: f8 00 5b 4a calli 803c740 } 8025a1c: 2b 9d 00 04 lw ra,(sp+4) 8025a20: 37 9c 00 04 addi sp,sp,4 8025a24: c3 a0 00 00 ret =============================================================================== 08005358 : * 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) { 8005358: 37 9c ff e0 addi sp,sp,-32 800535c: 5b 8b 00 20 sw (sp+32),r11 8005360: 5b 8c 00 1c sw (sp+28),r12 8005364: 5b 8d 00 18 sw (sp+24),r13 8005368: 5b 8e 00 14 sw (sp+20),r14 800536c: 5b 8f 00 10 sw (sp+16),r15 8005370: 5b 90 00 0c sw (sp+12),r16 8005374: 5b 91 00 08 sw (sp+8),r17 8005378: 5b 9d 00 04 sw (sp+4),ra if (tty->ccount == 0) 800537c: 28 24 00 20 lw r4,(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) { 8005380: b8 20 58 00 mv r11,r1 8005384: b8 40 68 00 mv r13,r2 if (tty->ccount == 0) 8005388: 44 80 00 27 be r4,r0,8005424 return; if (lineFlag) { 800538c: 5c 40 00 30 bne r2,r0,800544c echo ('\n', tty); return; } } while (tty->ccount) { 8005390: 28 25 00 3c lw r5,(r1+60) 8005394: 20 a2 00 08 andi r2,r5,0x8 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 8005398: 78 0f 08 02 mvhi r15,0x802 800539c: 78 11 08 02 mvhi r17,0x802 80053a0: 78 0e 08 02 mvhi r14,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') { 80053a4: 34 10 00 09 mvi r16,9 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 80053a8: 39 ef 72 94 ori r15,r15,0x7294 80053ac: 3a 31 47 84 ori r17,r17,0x4784 80053b0: 39 ce 47 80 ori r14,r14,0x4780 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 80053b4: 29 67 00 1c lw r7,(r11+28) 80053b8: 34 84 ff ff addi r4,r4,-1 80053bc: 59 64 00 20 sw (r11+32),r4 80053c0: b4 e4 18 00 add r3,r7,r4 80053c4: 40 63 00 00 lbu r3,(r3+0) if (tty->termios.c_lflag & ECHO) { 80053c8: 44 40 00 0e be r2,r0,8005400 <== NEVER TAKEN if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 80053cc: 5d a0 00 03 bne r13,r0,80053d8 80053d0: 20 a1 00 10 andi r1,r5,0x10 80053d4: 44 2d 00 11 be r1,r13,8005418 <== NEVER TAKEN echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { 80053d8: 44 70 00 45 be r3,r16,80054ec rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 80053dc: 29 e2 00 00 lw r2,(r15+0) 80053e0: 34 6c 00 01 addi r12,r3,1 80053e4: ba 20 08 00 mv r1,r17 80053e8: b4 4c 10 00 add r2,r2,r12 80053ec: 40 42 00 00 lbu r2,(r2+0) 80053f0: 20 42 00 20 andi r2,r2,0x20 80053f4: 44 40 00 36 be r2,r0,80054cc <== ALWAYS TAKEN 80053f8: 20 a5 02 00 andi r5,r5,0x200 <== NOT EXECUTED 80053fc: 5c a0 00 24 bne r5,r0,800548c <== NOT EXECUTED if (tty->column) tty->column--; } } } if (!lineFlag) 8005400: 45 a0 00 09 be r13,r0,8005424 echo ('\n', tty); return; } } while (tty->ccount) { 8005404: 29 64 00 20 lw r4,(r11+32) 8005408: 44 80 00 07 be r4,r0,8005424 } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); if (tty->termios.c_lflag & ECHOK) echo ('\n', tty); 800540c: 29 65 00 3c lw r5,(r11+60) 8005410: 20 a2 00 08 andi r2,r5,0x8 8005414: e3 ff ff e8 bi 80053b4 while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); 8005418: 41 61 00 43 lbu r1,(r11+67) <== NOT EXECUTED 800541c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005420: fb ff ff a6 calli 80052b8 <== NOT EXECUTED } } if (!lineFlag) break; } } 8005424: 2b 9d 00 04 lw ra,(sp+4) 8005428: 2b 8b 00 20 lw r11,(sp+32) 800542c: 2b 8c 00 1c lw r12,(sp+28) 8005430: 2b 8d 00 18 lw r13,(sp+24) 8005434: 2b 8e 00 14 lw r14,(sp+20) 8005438: 2b 8f 00 10 lw r15,(sp+16) 800543c: 2b 90 00 0c lw r16,(sp+12) 8005440: 2b 91 00 08 lw r17,(sp+8) 8005444: 37 9c 00 20 addi sp,sp,32 8005448: c3 a0 00 00 ret erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { 800544c: 28 25 00 3c lw r5,(r1+60) 8005450: 20 a2 00 08 andi r2,r5,0x8 8005454: 44 40 00 48 be r2,r0,8005574 <== NEVER TAKEN tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { 8005458: 20 ac 00 10 andi r12,r5,0x10 800545c: 5d 80 ff cf bne r12,r0,8005398 <== ALWAYS TAKEN tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); 8005460: 40 21 00 44 lbu r1,(r1+68) <== NOT EXECUTED if (!(tty->termios.c_lflag & ECHO)) { tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; 8005464: 59 60 00 20 sw (r11+32),r0 <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 8005468: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 800546c: fb ff ff 93 calli 80052b8 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 8005470: 29 61 00 3c lw r1,(r11+60) <== NOT EXECUTED 8005474: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 8005478: 44 2c ff eb be r1,r12,8005424 <== NOT EXECUTED echo ('\n', tty); 800547c: 34 01 00 0a mvi r1,10 <== NOT EXECUTED 8005480: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005484: fb ff ff 8d calli 80052b8 <== NOT EXECUTED 8005488: e3 ff ff e7 bi 8005424 <== NOT EXECUTED tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 800548c: 34 02 00 03 mvi r2,3 <== NOT EXECUTED 8005490: b9 60 18 00 mv r3,r11 <== NOT EXECUTED 8005494: fb ff fe ce calli 8004fcc <== NOT EXECUTED if (tty->column) 8005498: 29 62 00 28 lw r2,(r11+40) <== NOT EXECUTED tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 800549c: ba 20 08 00 mv r1,r17 <== NOT EXECUTED if (tty->column) 80054a0: 44 40 00 03 be r2,r0,80054ac <== NOT EXECUTED tty->column--; 80054a4: 34 42 ff ff addi r2,r2,-1 <== NOT EXECUTED 80054a8: 59 62 00 28 sw (r11+40),r2 <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 80054ac: 29 e2 00 00 lw r2,(r15+0) <== NOT EXECUTED 80054b0: b4 4c 60 00 add r12,r2,r12 <== NOT EXECUTED 80054b4: 41 82 00 00 lbu r2,(r12+0) <== NOT EXECUTED 80054b8: 20 42 00 20 andi r2,r2,0x20 <== NOT EXECUTED 80054bc: 44 40 00 04 be r2,r0,80054cc <== NOT EXECUTED 80054c0: 29 62 00 3c lw r2,(r11+60) <== NOT EXECUTED 80054c4: 20 42 02 00 andi r2,r2,0x200 <== NOT EXECUTED 80054c8: 44 40 ff ce be r2,r0,8005400 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 80054cc: 34 02 00 03 mvi r2,3 80054d0: b9 60 18 00 mv r3,r11 80054d4: fb ff fe be calli 8004fcc if (tty->column) 80054d8: 29 61 00 28 lw r1,(r11+40) 80054dc: 44 20 ff c9 be r1,r0,8005400 <== NEVER TAKEN tty->column--; 80054e0: 34 21 ff ff addi r1,r1,-1 80054e4: 59 61 00 28 sw (r11+40),r1 80054e8: e3 ff ff c6 bi 8005400 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; 80054ec: 29 6c 00 2c lw r12,(r11+44) int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 80054f0: 44 80 00 0f be r4,r0,800552c c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { 80054f4: 29 e1 00 00 lw r1,(r15+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; 80054f8: 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) 80054fc: 20 a5 02 00 andi r5,r5,0x200 * 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) 8005500: b4 e3 10 00 add r2,r7,r3 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; 8005504: 40 46 00 00 lbu r6,(r2+0) 8005508: 34 63 00 01 addi r3,r3,1 if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { 800550c: b4 26 10 00 add r2,r1,r6 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { 8005510: 44 d0 00 15 be r6,r16,8005564 col = (col | 7) + 1; } else if (iscntrl (c)) { 8005514: 40 42 00 01 lbu r2,(r2+1) 8005518: 20 42 00 20 andi r2,r2,0x20 800551c: 44 40 00 0f be r2,r0,8005558 <== ALWAYS TAKEN if (tty->termios.c_lflag & ECHOCTL) 8005520: 44 a0 00 02 be r5,r0,8005528 <== NOT EXECUTED col += 2; 8005524: 35 8c 00 02 addi r12,r12,2 <== NOT EXECUTED int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 8005528: 5c 83 ff f6 bne r4,r3,8005500 <== NOT EXECUTED } /* * Back up over the tab */ while (tty->column > col) { 800552c: 29 61 00 28 lw r1,(r11+40) 8005530: 4d 81 ff b4 bge r12,r1,8005400 <== NEVER TAKEN rtems_termios_puts ("\b", 1, tty); 8005534: b9 60 18 00 mv r3,r11 8005538: b9 c0 08 00 mv r1,r14 800553c: 34 02 00 01 mvi r2,1 8005540: fb ff fe a3 calli 8004fcc tty->column--; 8005544: 29 63 00 28 lw r3,(r11+40) 8005548: 34 63 ff ff addi r3,r3,-1 800554c: 59 63 00 28 sw (r11+40),r3 } /* * Back up over the tab */ while (tty->column > col) { 8005550: 48 6c ff f9 bg r3,r12,8005534 8005554: e3 ff ff ab bi 8005400 col = (col | 7) + 1; } else if (iscntrl (c)) { if (tty->termios.c_lflag & ECHOCTL) col += 2; } else { col++; 8005558: 35 8c 00 01 addi r12,r12,1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 800555c: 5c 83 ff e9 bne r4,r3,8005500 8005560: e3 ff ff f3 bi 800552c c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; 8005564: 39 8c 00 07 ori r12,r12,0x7 8005568: 35 8c 00 01 addi r12,r12,1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 800556c: 5c 83 ff e5 bne r4,r3,8005500 <== ALWAYS TAKEN 8005570: e3 ff ff ef bi 800552c <== NOT EXECUTED { if (tty->ccount == 0) return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { tty->ccount = 0; 8005574: 58 20 00 20 sw (r1+32),r0 <== NOT EXECUTED return; 8005578: e3 ff ff ab bi 8005424 <== NOT EXECUTED =============================================================================== 08010d28 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 8010d28: 37 9c ff e0 addi sp,sp,-32 8010d2c: 5b 8b 00 20 sw (sp+32),r11 8010d30: 5b 8c 00 1c sw (sp+28),r12 8010d34: 5b 8d 00 18 sw (sp+24),r13 8010d38: 5b 8e 00 14 sw (sp+20),r14 8010d3c: 5b 8f 00 10 sw (sp+16),r15 8010d40: 5b 90 00 0c sw (sp+12),r16 8010d44: 5b 91 00 08 sw (sp+8),r17 8010d48: 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); 8010d4c: 40 2e 00 02 lbu r14,(r1+2) 8010d50: 40 2f 00 0c lbu r15,(r1+12) 8010d54: b8 20 58 00 mv r11,r1 8010d58: b8 40 60 00 mv r12,r2 8010d5c: c9 ee 78 00 sub r15,r15,r14 8010d60: b8 40 08 00 mv r1,r2 8010d64: b9 e0 10 00 mv r2,r15 8010d68: b8 60 88 00 mv r17,r3 8010d6c: b8 80 80 00 mv r16,r4 8010d70: f8 00 73 ee calli 802dd28 <__lshrsi3> 8010d74: 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) 8010d78: 41 61 00 89 lbu r1,(r11+137) 8010d7c: 44 20 00 03 be r1,r0,8010d88 8010d80: 29 61 00 84 lw r1,(r11+132) 8010d84: 44 2c 00 0e be r1,r12,8010dbc { fat_buf_release(fs_info); 8010d88: b9 60 08 00 mv r1,r11 8010d8c: fb ff ff 6c calli 8010b3c if (op_type == FAT_OP_TYPE_READ) 8010d90: 34 01 00 01 mvi r1,1 8010d94: 46 21 00 20 be r17,r1,8010e14 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); 8010d98: 29 61 00 64 lw r1,(r11+100) 8010d9c: b9 a0 10 00 mv r2,r13 8010da0: 35 63 00 8c addi r3,r11,140 8010da4: fb ff f5 9b calli 800e410 if (sc != RTEMS_SUCCESSFUL) 8010da8: 5c 20 00 20 bne r1,r0,8010e28 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(EIO); fs_info->c.blk_num = sec_num; fs_info->c.modified = 0; fs_info->c.state = FAT_CACHE_ACTUAL; 8010dac: 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; 8010db0: 59 6c 00 84 sw (r11+132),r12 fs_info->c.modified = 0; 8010db4: 31 60 00 88 sb (r11+136),r0 fs_info->c.state = FAT_CACHE_ACTUAL; 8010db8: 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); 8010dbc: b9 e0 10 00 mv r2,r15 8010dc0: b9 a0 08 00 mv r1,r13 8010dc4: fb ff c0 e8 calli 8001164 <__ashlsi3> } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 8010dc8: 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); 8010dcc: b9 c0 10 00 mv r2,r14 8010dd0: c9 81 08 00 sub r1,r12,r1 8010dd4: fb ff c0 e4 calli 8001164 <__ashlsi3> 8010dd8: 29 63 00 1c lw r3,(r11+28) return RC_OK; 8010ddc: 34 02 00 00 mvi r2,0 rtems_set_errno_and_return_minus_one(EIO); fs_info->c.blk_num = sec_num; fs_info->c.modified = 0; fs_info->c.state = FAT_CACHE_ACTUAL; } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 8010de0: b4 61 08 00 add r1,r3,r1 8010de4: 5a 01 00 00 sw (r16+0),r1 return RC_OK; } 8010de8: b8 40 08 00 mv r1,r2 8010dec: 2b 9d 00 04 lw ra,(sp+4) 8010df0: 2b 8b 00 20 lw r11,(sp+32) 8010df4: 2b 8c 00 1c lw r12,(sp+28) 8010df8: 2b 8d 00 18 lw r13,(sp+24) 8010dfc: 2b 8e 00 14 lw r14,(sp+20) 8010e00: 2b 8f 00 10 lw r15,(sp+16) 8010e04: 2b 90 00 0c lw r16,(sp+12) 8010e08: 2b 91 00 08 lw r17,(sp+8) 8010e0c: 37 9c 00 20 addi sp,sp,32 8010e10: c3 a0 00 00 ret if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num) { fat_buf_release(fs_info); if (op_type == FAT_OP_TYPE_READ) sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 8010e14: 29 61 00 64 lw r1,(r11+100) 8010e18: b9 a0 10 00 mv r2,r13 8010e1c: 35 63 00 8c addi r3,r11,140 8010e20: fb ff f5 c6 calli 800e538 8010e24: e3 ff ff e1 bi 8010da8 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); 8010e28: f8 00 29 bf calli 801b524 <__errno> <== NOT EXECUTED 8010e2c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8010e30: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8010e34: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8010e38: e3 ff ff ec bi 8010de8 <== NOT EXECUTED =============================================================================== 08010b3c : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 8010b3c: 37 9c ff e0 addi sp,sp,-32 8010b40: 5b 8b 00 1c sw (sp+28),r11 8010b44: 5b 8c 00 18 sw (sp+24),r12 8010b48: 5b 8d 00 14 sw (sp+20),r13 8010b4c: 5b 8e 00 10 sw (sp+16),r14 8010b50: 5b 8f 00 0c sw (sp+12),r15 8010b54: 5b 90 00 08 sw (sp+8),r16 8010b58: 5b 9d 00 04 sw (sp+4),ra 8010b5c: b8 20 58 00 mv r11,r1 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 8010b60: 40 21 00 89 lbu r1,(r1+137) return RC_OK; 8010b64: 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) 8010b68: 44 20 00 44 be r1,r0,8010c78 return RC_OK; if (fs_info->c.modified) 8010b6c: 41 61 00 88 lbu r1,(r11+136) 8010b70: 44 20 00 4c be r1,r0,8010ca0 { uint32_t sec_num = fs_info->c.blk_num; 8010b74: 29 6c 00 84 lw r12,(r11+132) bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 8010b78: 2d 61 00 18 lhu r1,(r11+24) 8010b7c: 34 0d 00 00 mvi r13,0 8010b80: 54 2c 00 08 bgu r1,r12,8010ba0 8010b84: 29 61 00 20 lw r1,(r11+32) 8010b88: 51 81 00 06 bgeu r12,r1,8010ba0 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) 8010b8c: 41 61 00 54 lbu r1,(r11+84) uint32_t ino ) { return (ino >= fs_info->uino_base); } 8010b90: 41 6e 00 02 lbu r14,(r11+2) 8010b94: 41 6f 00 0c lbu r15,(r11+12) return RC_OK; if (fs_info->c.modified) { uint32_t sec_num = fs_info->c.blk_num; bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 8010b98: 34 0d 00 01 mvi r13,1 uint32_t blk = fat_sector_num_to_block_num(fs_info, sec_num); uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info, sec_num, 0); if (sec_of_fat && !fs_info->vol.mirror) 8010b9c: 44 20 00 49 be r1,r0,8010cc0 <== ALWAYS TAKEN memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(fs_info->c.buf); 8010ba0: 29 61 00 8c lw r1,(r11+140) 8010ba4: fb ff f7 31 calli 800e868 if (sc != RTEMS_SUCCESSFUL) 8010ba8: 5c 20 00 41 bne r1,r0,8010cac <== NEVER TAKEN rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; 8010bac: 31 60 00 88 sb (r11+136),r0 if (sec_of_fat && !fs_info->vol.mirror) 8010bb0: 45 a1 00 30 be r13,r1,8010c70 8010bb4: 41 61 00 54 lbu r1,(r11+84) 8010bb8: 5c 20 00 2e bne r1,r0,8010c70 <== NEVER TAKEN { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 8010bbc: 41 61 00 0d lbu r1,(r11+13) 8010bc0: 34 02 00 01 mvi r2,1 8010bc4: 50 41 00 2b bgeu r2,r1,8010c70 <== NEVER TAKEN 8010bc8: 34 0c 00 01 mvi r12,1 { rtems_bdbuf_buffer *bd; sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i, 8010bcc: 29 62 00 1c lw r2,(r11+28) 8010bd0: b9 80 08 00 mv r1,r12 8010bd4: fb ff c1 b2 calli 800129c <__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); 8010bd8: 41 6e 00 02 lbu r14,(r11+2) 8010bdc: 29 6d 00 84 lw r13,(r11+132) 8010be0: 41 6f 00 0c lbu r15,(r11+12) 8010be4: b4 2d 68 00 add r13,r1,r13 8010be8: c9 ee 78 00 sub r15,r15,r14 8010bec: b9 e0 10 00 mv r2,r15 8010bf0: b9 a0 08 00 mv r1,r13 8010bf4: f8 00 74 4d calli 802dd28 <__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); 8010bf8: b9 e0 10 00 mv r2,r15 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); 8010bfc: b8 20 80 00 mv r16,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); 8010c00: fb ff c1 59 calli 8001164 <__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); 8010c04: b9 c0 10 00 mv r2,r14 8010c08: c9 a1 08 00 sub r1,r13,r1 8010c0c: fb ff c1 56 calli 8001164 <__ashlsi3> 8010c10: b8 20 70 00 mv r14,r1 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); 8010c14: ba 00 10 00 mv r2,r16 8010c18: 37 83 00 20 addi r3,sp,32 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 8010c1c: 5c 20 00 04 bne r1,r0,8010c2c && fs_info->vol.bps == fs_info->vol.bytes_per_block) 8010c20: 2d 64 00 00 lhu r4,(r11+0) 8010c24: 2d 61 00 0a lhu r1,(r11+10) 8010c28: 44 81 00 37 be r4,r1,8010d04 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); 8010c2c: 29 61 00 64 lw r1,(r11+100) 8010c30: fb ff f6 42 calli 800e538 8010c34: b8 20 68 00 mv r13,r1 } if ( sc != RTEMS_SUCCESSFUL) 8010c38: 5d a0 00 37 bne r13,r0,8010d14 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 8010c3c: 2b 81 00 20 lw r1,(sp+32) 8010c40: 29 62 00 90 lw r2,(r11+144) 8010c44: 2d 63 00 00 lhu r3,(r11+0) 8010c48: 28 21 00 1c lw r1,(r1+28) if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 8010c4c: 35 8c 00 01 addi r12,r12,1 8010c50: 21 8c 00 ff andi r12,r12,0xff { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); } if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 8010c54: b4 2e 08 00 add r1,r1,r14 8010c58: f8 00 2d 81 calli 801c25c sc = rtems_bdbuf_release_modified(bd); 8010c5c: 2b 81 00 20 lw r1,(sp+32) 8010c60: fb ff f7 02 calli 800e868 if ( sc != RTEMS_SUCCESSFUL) 8010c64: 5c 2d 00 2c bne r1,r13,8010d14 <== NEVER TAKEN if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 8010c68: 41 61 00 0d lbu r1,(r11+13) 8010c6c: 54 2c ff d8 bgu r1,r12,8010bcc <== NEVER TAKEN { sc = rtems_bdbuf_release(fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); } fs_info->c.state = FAT_CACHE_EMPTY; 8010c70: 31 60 00 89 sb (r11+137),r0 return RC_OK; 8010c74: 34 0c 00 00 mvi r12,0 } 8010c78: b9 80 08 00 mv r1,r12 8010c7c: 2b 9d 00 04 lw ra,(sp+4) 8010c80: 2b 8b 00 1c lw r11,(sp+28) 8010c84: 2b 8c 00 18 lw r12,(sp+24) 8010c88: 2b 8d 00 14 lw r13,(sp+20) 8010c8c: 2b 8e 00 10 lw r14,(sp+16) 8010c90: 2b 8f 00 0c lw r15,(sp+12) 8010c94: 2b 90 00 08 lw r16,(sp+8) 8010c98: 37 9c 00 20 addi sp,sp,32 8010c9c: c3 a0 00 00 ret } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 8010ca0: 29 61 00 8c lw r1,(r11+140) 8010ca4: fb ff f6 b6 calli 800e77c if (sc != RTEMS_SUCCESSFUL) 8010ca8: 44 2c ff f2 be r1,r12,8010c70 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EIO); 8010cac: f8 00 2a 1e calli 801b524 <__errno> <== NOT EXECUTED 8010cb0: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8010cb4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8010cb8: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8010cbc: e3 ff ff ef bi 8010c78 <== 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); 8010cc0: c9 ee 78 00 sub r15,r15,r14 8010cc4: b9 e0 10 00 mv r2,r15 8010cc8: b9 80 08 00 mv r1,r12 8010ccc: f8 00 74 17 calli 802dd28 <__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); 8010cd0: b9 e0 10 00 mv r2,r15 8010cd4: fb ff c1 24 calli 8001164 <__ashlsi3> sec_num, 0); if (sec_of_fat && !fs_info->vol.mirror) memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, 8010cd8: 29 6f 00 8c lw r15,(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); 8010cdc: b9 c0 10 00 mv r2,r14 8010ce0: c9 81 08 00 sub r1,r12,r1 8010ce4: fb ff c1 20 calli 8001164 <__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, 8010ce8: 29 e2 00 1c lw r2,(r15+28) 8010cec: 29 64 00 90 lw r4,(r11+144) 8010cf0: 2d 63 00 00 lhu r3,(r11+0) 8010cf4: b4 41 10 00 add r2,r2,r1 8010cf8: b8 80 08 00 mv r1,r4 8010cfc: f8 00 2d 58 calli 801c25c 8010d00: e3 ff ff a8 bi 8010ba0 0); if (blk_ofs == 0 && fs_info->vol.bps == fs_info->vol.bytes_per_block) { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 8010d04: 29 61 00 64 lw r1,(r11+100) 8010d08: fb ff f5 c2 calli 800e410 8010d0c: b8 20 68 00 mv r13,r1 8010d10: e3 ff ff ca bi 8010c38 if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(bd); if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); 8010d14: f8 00 2a 04 calli 801b524 <__errno> <== NOT EXECUTED 8010d18: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8010d1c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8010d20: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8010d24: e3 ff ff d5 bi 8010c78 <== NOT EXECUTED =============================================================================== 08011010 : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 8011010: 37 9c ff cc addi sp,sp,-52 8011014: 5b 8b 00 30 sw (sp+48),r11 8011018: 5b 8c 00 2c sw (sp+44),r12 801101c: 5b 8d 00 28 sw (sp+40),r13 8011020: 5b 8e 00 24 sw (sp+36),r14 8011024: 5b 8f 00 20 sw (sp+32),r15 8011028: 5b 90 00 1c sw (sp+28),r16 801102c: 5b 91 00 18 sw (sp+24),r17 8011030: 5b 92 00 14 sw (sp+20),r18 8011034: 5b 93 00 10 sw (sp+16),r19 8011038: 5b 94 00 0c sw (sp+12),r20 801103c: 5b 95 00 08 sw (sp+8),r21 8011040: 5b 9d 00 04 sw (sp+4),ra 8011044: b8 20 58 00 mv r11,r1 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8011048: 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) { 801104c: b8 60 78 00 mv r15,r3 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8011050: b8 80 70 00 mv r14,r4 8011054: c8 23 08 00 sub r1,r1,r3 fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 8011058: 20 b5 00 ff andi r21,r5,0xff ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 801105c: 50 24 00 02 bgeu r1,r4,8011064 <== ALWAYS TAKEN 8011060: b8 20 70 00 mv r14,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)) ) 8011064: 5c 40 00 04 bne r2,r0,8011074 <== ALWAYS TAKEN 8011068: 41 61 00 0e lbu r1,(r11+14) <== NOT EXECUTED 801106c: 20 21 00 03 andi r1,r1,0x3 <== NOT EXECUTED 8011070: 5c 22 00 5b bne r1,r2,80111dc <== 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); 8011074: 41 63 00 08 lbu r3,(r11+8) 8011078: 41 6c 00 0c lbu r12,(r11+12) 801107c: 34 41 ff fe addi r1,r2,-2 8011080: c8 6c 10 00 sub r2,r3,r12 8011084: fb ff c0 38 calli 8001164 <__ashlsi3> 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); 8011088: 41 62 00 02 lbu r2,(r11+2) 801108c: b8 20 88 00 mv r17,r1 8011090: 29 61 00 34 lw r1,(r11+52) 8011094: c9 82 10 00 sub r2,r12,r2 8011098: f8 00 73 24 calli 802dd28 <__lshrsi3> blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); 801109c: b6 21 88 00 add r17,r17,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; 80110a0: b9 e0 08 00 mv r1,r15 80110a4: b9 80 10 00 mv r2,r12 80110a8: f8 00 73 20 calli 802dd28 <__lshrsi3> uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 80110ac: b9 80 10 00 mv r2,r12 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; 80110b0: b8 20 68 00 mv r13,r1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 80110b4: fb ff c0 2c calli 8001164 <__ashlsi3> const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { ssize_t rc = RC_OK; 80110b8: 34 04 00 00 mvi r4,0 80110bc: 7d d2 00 00 cmpnei r18,r14,0 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 80110c0: 64 83 00 00 cmpei r3,r4,0 { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 80110c4: c9 e1 78 00 sub r15,r15,r1 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 80110c8: a2 43 18 00 and r3,r18,r3 uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; 80110cc: b5 b1 88 00 add r17,r13,r17 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; 80110d0: 34 13 00 00 mvi r19,0 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 80110d4: 34 14 00 01 mvi r20,1 ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 80110d8: 44 60 00 1c be r3,r0,8011148 <== NEVER TAKEN && (0 < bytes_to_write)) { uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 80110dc: 2d 70 00 0a lhu r16,(r11+10) 80110e0: ca 0f 30 00 sub r6,r16,r15 80110e4: b8 c0 60 00 mv r12,r6 80110e8: 51 c6 00 02 bgeu r14,r6,80110f0 <== ALWAYS TAKEN 80110ec: b9 c0 60 00 mv r12,r14 <== 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)); 80110f0: b9 80 68 00 mv r13,r12 80110f4: 50 cc 00 02 bgeu r6,r12,80110fc <== ALWAYS TAKEN 80110f8: b8 c0 68 00 mv r13,r6 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 80110fc: 41 63 00 02 lbu r3,(r11+2) 8011100: 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) 8011104: 45 a0 00 2f be r13,r0,80111c0 <== 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); 8011108: c8 83 10 00 sub r2,r4,r3 801110c: ba 20 08 00 mv r1,r17 8011110: fb ff c0 15 calli 8001164 <__ashlsi3> 8011114: b8 20 10 00 mv r2,r1 { if (bytes_to_write == fs_info->vol.bytes_per_block) 8011118: 46 0d 00 2c be r16,r13,80111c8 { 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); 801111c: b9 60 08 00 mv r1,r11 8011120: 34 03 00 01 mvi r3,1 8011124: 37 84 00 34 addi r4,sp,52 8011128: fb ff ff 00 calli 8010d28 if (RC_OK == rc) 801112c: 44 20 00 1f be r1,r0,80111a8 <== ALWAYS TAKEN cur_blk, ofs_blk, c, pattern); if (c != ret) rc = -1; 8011130: 34 04 ff ff mvi r4,-1 fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) 8011134: 44 2c 00 16 be r1,r12,801118c <== ALWAYS TAKEN rc = -1; else { bytes_to_write -= ret; bytes_written += ret; ++cur_blk; 8011138: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 801113c: 64 83 00 00 cmpei r3,r4,0 8011140: a2 43 18 00 and r3,r18,r3 8011144: 5c 60 ff e6 bne r3,r0,80110dc <== NEVER TAKEN bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 8011148: 5c 83 00 02 bne r4,r3,8011150 <== NEVER TAKEN 801114c: ba 60 20 00 mv r4,r19 return rc; else return bytes_written; } 8011150: b8 80 08 00 mv r1,r4 8011154: 2b 9d 00 04 lw ra,(sp+4) 8011158: 2b 8b 00 30 lw r11,(sp+48) 801115c: 2b 8c 00 2c lw r12,(sp+44) 8011160: 2b 8d 00 28 lw r13,(sp+40) 8011164: 2b 8e 00 24 lw r14,(sp+36) 8011168: 2b 8f 00 20 lw r15,(sp+32) 801116c: 2b 90 00 1c lw r16,(sp+28) 8011170: 2b 91 00 18 lw r17,(sp+24) 8011174: 2b 92 00 14 lw r18,(sp+20) 8011178: 2b 93 00 10 lw r19,(sp+16) 801117c: 2b 94 00 0c lw r20,(sp+12) 8011180: 2b 95 00 08 lw r21,(sp+8) 8011184: 37 9c 00 34 addi sp,sp,52 8011188: c3 a0 00 00 ret pattern); if (c != ret) rc = -1; else { bytes_to_write -= ret; 801118c: c9 c1 70 00 sub r14,r14,r1 8011190: 7d d2 00 00 cmpnei r18,r14,0 bytes_written += ret; 8011194: b6 61 98 00 add r19,r19,r1 ++cur_blk; 8011198: 36 31 00 01 addi r17,r17,1 801119c: 34 04 00 00 mvi r4,0 80111a0: 34 0f 00 00 mvi r15,0 80111a4: e3 ff ff e6 bi 801113c else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); if (RC_OK == rc) { memset(blk_buf + offset, pattern, bytes_to_write); 80111a8: 2b 81 00 34 lw r1,(sp+52) 80111ac: ba a0 10 00 mv r2,r21 80111b0: b9 a0 18 00 mv r3,r13 80111b4: b4 2f 08 00 add r1,r1,r15 80111b8: f8 00 2c 6a calli 801c360 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 80111bc: 31 74 00 88 sb (r11+136),r20 } } if (RC_OK != rc) return rc; else return bytes_to_write; 80111c0: b9 a0 08 00 mv r1,r13 80111c4: e3 ff ff db bi 8011130 if (0 < bytes_to_write) { if (bytes_to_write == fs_info->vol.bytes_per_block) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 80111c8: b9 60 08 00 mv r1,r11 80111cc: 34 03 00 02 mvi r3,2 80111d0: 37 84 00 34 addi r4,sp,52 80111d4: fb ff fe d5 calli 8010d28 80111d8: e3 ff ff d5 bi 801112c 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); 80111dc: 41 6c 00 0c lbu r12,(r11+12) <== NOT EXECUTED 80111e0: 41 62 00 02 lbu r2,(r11+2) <== NOT EXECUTED 80111e4: 29 61 00 20 lw r1,(r11+32) <== NOT EXECUTED 80111e8: c9 82 10 00 sub r2,r12,r2 <== NOT EXECUTED 80111ec: f8 00 72 cf calli 802dd28 <__lshrsi3> <== NOT EXECUTED 80111f0: b8 20 88 00 mv r17,r1 <== NOT EXECUTED 80111f4: e3 ff ff ab bi 80110a0 <== NOT EXECUTED =============================================================================== 080111f8 : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 80111f8: 37 9c ff c8 addi sp,sp,-56 80111fc: 5b 8b 00 34 sw (sp+52),r11 8011200: 5b 8c 00 30 sw (sp+48),r12 8011204: 5b 8d 00 2c sw (sp+44),r13 8011208: 5b 8e 00 28 sw (sp+40),r14 801120c: 5b 8f 00 24 sw (sp+36),r15 8011210: 5b 90 00 20 sw (sp+32),r16 8011214: 5b 91 00 1c sw (sp+28),r17 8011218: 5b 92 00 18 sw (sp+24),r18 801121c: 5b 93 00 14 sw (sp+20),r19 8011220: 5b 94 00 10 sw (sp+16),r20 8011224: 5b 95 00 0c sw (sp+12),r21 8011228: 5b 96 00 08 sw (sp+8),r22 801122c: 5b 9d 00 04 sw (sp+4),ra 8011230: b8 20 58 00 mv r11,r1 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8011234: 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) { 8011238: b8 60 78 00 mv r15,r3 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 801123c: b8 80 68 00 mv r13,r4 8011240: 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) { 8011244: b8 a0 b0 00 mv r22,r5 8011248: 20 d4 00 ff andi r20,r6,0xff ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 801124c: 50 24 00 02 bgeu r1,r4,8011254 <== ALWAYS TAKEN 8011250: b8 20 68 00 mv r13,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)) ) 8011254: 5c 40 00 04 bne r2,r0,8011264 8011258: 41 61 00 0e lbu r1,(r11+14) 801125c: 20 21 00 03 andi r1,r1,0x3 8011260: 5c 22 00 5d bne r1,r2,80113d4 <== ALWAYS TAKEN 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); 8011264: 41 63 00 08 lbu r3,(r11+8) 8011268: 41 6c 00 0c lbu r12,(r11+12) 801126c: 34 41 ff fe addi r1,r2,-2 8011270: c8 6c 10 00 sub r2,r3,r12 8011274: fb ff bf bc calli 8001164 <__ashlsi3> 8011278: 41 62 00 02 lbu r2,(r11+2) 801127c: b8 20 88 00 mv r17,r1 8011280: 29 61 00 34 lw r1,(r11+52) 8011284: c9 82 10 00 sub r2,r12,r2 8011288: f8 00 72 a8 calli 802dd28 <__lshrsi3> blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); 801128c: b6 21 88 00 add r17,r17,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); 8011290: b9 e0 08 00 mv r1,r15 8011294: b9 80 10 00 mv r2,r12 8011298: f8 00 72 a4 calli 802dd28 <__lshrsi3> uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 801129c: b9 80 10 00 mv r2,r12 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); 80112a0: b8 20 70 00 mv r14,r1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 80112a4: fb ff bf b0 calli 8001164 <__ashlsi3> const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { ssize_t rc = RC_OK; 80112a8: 34 02 00 00 mvi r2,0 80112ac: 7d b2 00 00 cmpnei r18,r13,0 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 80112b0: 64 43 00 00 cmpei r3,r2,0 { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 80112b4: c9 e1 78 00 sub r15,r15,r1 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 80112b8: a2 43 18 00 and r3,r18,r3 ssize_t bytes_written = 0; uint8_t *buffer = (uint8_t*)buff; ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; 80112bc: b5 d1 88 00 add r17,r14,r17 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; 80112c0: 34 13 00 00 mvi r19,0 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 80112c4: 34 15 00 01 mvi r21,1 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 80112c8: 44 60 00 1d be r3,r0,801133c <== NEVER TAKEN && (0 < bytes_to_write)) { c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 80112cc: 2d 70 00 0a lhu r16,(r11+10) 80112d0: ca 0f 10 00 sub r2,r16,r15 80112d4: b8 40 60 00 mv r12,r2 80112d8: 51 a2 00 02 bgeu r13,r2,80112e0 80112dc: b9 a0 60 00 mv r12,r13 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)); 80112e0: b9 80 70 00 mv r14,r12 80112e4: 50 4c 00 02 bgeu r2,r12,80112ec <== ALWAYS TAKEN 80112e8: b8 40 70 00 mv r14,r2 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 80112ec: 41 62 00 02 lbu r2,(r11+2) 80112f0: 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) 80112f4: 45 c0 00 31 be r14,r0,80113b8 <== 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); 80112f8: c8 62 10 00 sub r2,r3,r2 80112fc: ba 20 08 00 mv r1,r17 8011300: fb ff bf 99 calli 8001164 <__ashlsi3> 8011304: b8 20 10 00 mv r2,r1 { if ( overwrite_block 8011308: 5e 80 00 2e bne r20,r0,80113c0 || (bytes_to_write == fs_info->vol.bytes_per_block)) 801130c: 46 0e 00 2d be r16,r14,80113c0 { 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); 8011310: b9 60 08 00 mv r1,r11 8011314: 34 03 00 01 mvi r3,1 8011318: 37 84 00 38 addi r4,sp,56 801131c: fb ff fe 83 calli 8010d28 if (RC_OK == rc) 8011320: 44 20 00 20 be r1,r0,80113a0 <== ALWAYS TAKEN ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) rc = -1; 8011324: 34 02 ff ff mvi r2,-1 cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) 8011328: 44 2c 00 17 be r1,r12,8011384 <== ALWAYS TAKEN rc = -1; else { bytes_to_write -= ret; bytes_written += ret; ++cur_blk; 801132c: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 8011330: 64 43 00 00 cmpei r3,r2,0 8011334: a2 43 18 00 and r3,r18,r3 8011338: 5c 60 ff e5 bne r3,r0,80112cc <== NEVER TAKEN bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 801133c: 5c 43 00 02 bne r2,r3,8011344 <== NEVER TAKEN 8011340: ba 60 10 00 mv r2,r19 return rc; else return bytes_written; } 8011344: b8 40 08 00 mv r1,r2 8011348: 2b 9d 00 04 lw ra,(sp+4) 801134c: 2b 8b 00 34 lw r11,(sp+52) 8011350: 2b 8c 00 30 lw r12,(sp+48) 8011354: 2b 8d 00 2c lw r13,(sp+44) 8011358: 2b 8e 00 28 lw r14,(sp+40) 801135c: 2b 8f 00 24 lw r15,(sp+36) 8011360: 2b 90 00 20 lw r16,(sp+32) 8011364: 2b 91 00 1c lw r17,(sp+28) 8011368: 2b 92 00 18 lw r18,(sp+24) 801136c: 2b 93 00 14 lw r19,(sp+20) 8011370: 2b 94 00 10 lw r20,(sp+16) 8011374: 2b 95 00 0c lw r21,(sp+12) 8011378: 2b 96 00 08 lw r22,(sp+8) 801137c: 37 9c 00 38 addi sp,sp,56 8011380: c3 a0 00 00 ret overwrite_cluster); if (c != ret) rc = -1; else { bytes_to_write -= ret; 8011384: c9 a1 68 00 sub r13,r13,r1 8011388: 7d b2 00 00 cmpnei r18,r13,0 bytes_written += ret; 801138c: b6 61 98 00 add r19,r19,r1 ++cur_blk; 8011390: 36 31 00 01 addi r17,r17,1 8011394: 34 02 00 00 mvi r2,0 8011398: 34 0f 00 00 mvi r15,0 801139c: e3 ff ff e5 bi 8011330 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); if (RC_OK == rc) { memcpy(blk_buf + offset, buf, bytes_to_write); 80113a0: 2b 81 00 38 lw r1,(sp+56) 80113a4: b6 d3 10 00 add r2,r22,r19 80113a8: b9 c0 18 00 mv r3,r14 80113ac: b4 2f 08 00 add r1,r1,r15 80113b0: f8 00 2b ab calli 801c25c } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 80113b4: 31 75 00 88 sb (r11+136),r21 } } if (RC_OK != rc) return rc; else return bytes_to_write; 80113b8: b9 c0 08 00 mv r1,r14 80113bc: e3 ff ff da bi 8011324 if (0 < bytes_to_write) { if ( overwrite_block || (bytes_to_write == fs_info->vol.bytes_per_block)) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 80113c0: b9 60 08 00 mv r1,r11 80113c4: 34 03 00 02 mvi r3,2 80113c8: 37 84 00 38 addi r4,sp,56 80113cc: fb ff fe 57 calli 8010d28 80113d0: e3 ff ff d4 bi 8011320 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); 80113d4: 41 6c 00 0c lbu r12,(r11+12) 80113d8: 41 62 00 02 lbu r2,(r11+2) 80113dc: 29 61 00 20 lw r1,(r11+32) 80113e0: c9 82 10 00 sub r2,r12,r2 80113e4: f8 00 72 51 calli 802dd28 <__lshrsi3> 80113e8: b8 20 88 00 mv r17,r1 80113ec: e3 ff ff a9 bi 8011290 =============================================================================== 08010310 : int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 8010310: 37 9c ff f0 addi sp,sp,-16 8010314: 5b 8b 00 10 sw (sp+16),r11 8010318: 5b 8c 00 0c sw (sp+12),r12 801031c: 5b 8d 00 08 sw (sp+8),r13 8010320: 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) 8010324: 28 43 00 08 lw r3,(r2+8) 8010328: 34 04 00 01 mvi r4,1 int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 801032c: b8 40 58 00 mv r11,r2 8010330: b8 20 68 00 mv r13,r1 /* * if links_num field of fat-file descriptor is greater than 1 * decrement the count of links and return */ if (fat_fd->links_num > 1) 8010334: 50 83 00 0b bgeu r4,r3,8010360 { fat_fd->links_num--; 8010338: 34 63 ff ff addi r3,r3,-1 801033c: 58 43 00 08 sw (r2+8),r3 return rc; 8010340: 34 0c 00 00 mvi r12,0 * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); return rc; } 8010344: b9 80 08 00 mv r1,r12 8010348: 2b 9d 00 04 lw ra,(sp+4) 801034c: 2b 8b 00 10 lw r11,(sp+16) 8010350: 2b 8c 00 0c lw r12,(sp+12) 8010354: 2b 8d 00 08 lw r13,(sp+8) 8010358: 37 9c 00 10 addi sp,sp,16 801035c: c3 a0 00 00 ret return rc; } key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); if (fat_fd->flags & FAT_FILE_REMOVED) 8010360: 40 4c 00 30 lbu r12,(r2+48) 8010364: 21 8c 00 01 andi r12,r12,0x1 8010368: 45 80 00 0e be r12,r0,80103a0 { rc = fat_file_truncate(fs_info, fat_fd, 0); 801036c: 34 03 00 00 mvi r3,0 8010370: fb ff ff 9a calli 80101d8 8010374: b8 20 60 00 mv r12,r1 if ( rc != RC_OK ) 8010378: 5c 20 ff f3 bne r1,r0,8010344 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 801037c: b9 60 08 00 mv r1,r11 8010380: f8 00 11 51 calli 80148c4 <_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) ) 8010384: 29 62 00 0c lw r2,(r11+12) 8010388: b9 a0 08 00 mv r1,r13 801038c: f8 00 07 dc calli 80122fc 8010390: 5c 2c 00 15 bne r1,r12,80103e4 <== NEVER TAKEN fat_fd->links_num = 0; } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 8010394: b9 60 08 00 mv r1,r11 8010398: fb ff cb 2c calli 8003048 801039c: e0 00 00 05 bi 80103b0 free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 80103a0: 28 42 00 0c lw r2,(r2+12) 80103a4: f8 00 07 d6 calli 80122fc 80103a8: 44 2c 00 0c be r1,r12,80103d8 { fat_fd->links_num = 0; 80103ac: 59 60 00 08 sw (r11+8),r0 } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 80103b0: b9 a0 08 00 mv r1,r13 80103b4: f8 00 01 e2 calli 8010b3c 80103b8: b8 20 60 00 mv r12,r1 return rc; } 80103bc: b9 80 08 00 mv r1,r12 80103c0: 2b 9d 00 04 lw ra,(sp+4) 80103c4: 2b 8b 00 10 lw r11,(sp+16) 80103c8: 2b 8c 00 0c lw r12,(sp+12) 80103cc: 2b 8d 00 08 lw r13,(sp+8) 80103d0: 37 9c 00 10 addi sp,sp,16 80103d4: c3 a0 00 00 ret 80103d8: b9 60 08 00 mv r1,r11 80103dc: f8 00 11 3a calli 80148c4 <_Chain_Extract> 80103e0: e3 ff ff ed bi 8010394 return rc; _hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd); if ( fat_ino_is_unique(fs_info, fat_fd->ino) ) fat_free_unique_ino(fs_info, fat_fd->ino); 80103e4: 29 62 00 0c lw r2,(r11+12) <== NOT EXECUTED 80103e8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 80103ec: f8 00 07 af calli 80122a8 <== NOT EXECUTED 80103f0: e3 ff ff e9 bi 8010394 <== NOT EXECUTED =============================================================================== 080104e4 : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 80104e4: 37 9c ff c4 addi sp,sp,-60 80104e8: 5b 8b 00 28 sw (sp+40),r11 80104ec: 5b 8c 00 24 sw (sp+36),r12 80104f0: 5b 8d 00 20 sw (sp+32),r13 80104f4: 5b 8e 00 1c sw (sp+28),r14 80104f8: 5b 8f 00 18 sw (sp+24),r15 80104fc: 5b 90 00 14 sw (sp+20),r16 8010500: 5b 91 00 10 sw (sp+16),r17 8010504: 5b 92 00 0c sw (sp+12),r18 8010508: 5b 93 00 08 sw (sp+8),r19 801050c: 5b 9d 00 04 sw (sp+4),ra 8010510: b8 a0 88 00 mv r17,r5 uint32_t last_cl = 0; uint32_t bytes_remain = 0; uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; 8010514: 5a 24 00 00 sw (r17+0),r4 if (new_length <= fat_fd->fat_file_size) 8010518: 28 47 00 18 lw r7,(r2+24) uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; 801051c: 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; 8010520: 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 ) { 8010524: b8 80 68 00 mv r13,r4 8010528: b8 40 58 00 mv r11,r2 801052c: b8 20 70 00 mv r14,r1 8010530: 20 72 00 ff andi r18,r3,0xff ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; 8010534: 34 0c 00 00 mvi r12,0 uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 8010538: 50 e4 00 11 bgeu r7,r4,801057c return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 801053c: 28 42 00 20 lw r2,(r2+32) 8010540: 34 01 00 01 mvi r1,1 8010544: 44 41 00 49 be r2,r1,8010668 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - 8010548: 2d cf 00 06 lhu r15,(r14+6) (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & (fs_info->vol.bpc - 1); bytes2add = new_length - fat_fd->fat_file_size; 801054c: c9 a7 10 00 sub r2,r13,r7 if (bytes2add > bytes_remain) bytes2add -= bytes_remain; else bytes2add = 0; 8010550: 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))) & 8010554: 35 e1 ff ff addi r1,r15,-1 8010558: a0 27 98 00 and r19,r1,r7 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - 801055c: c9 f3 78 00 sub r15,r15,r19 8010560: a1 e1 78 00 and r15,r15,r1 (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & (fs_info->vol.bpc - 1); bytes2add = new_length - fat_fd->fat_file_size; if (bytes2add > bytes_remain) 8010564: 51 e2 00 02 bgeu r15,r2,801056c bytes2add -= bytes_remain; 8010568: c8 4f 80 00 sub r16,r2,r15 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { 801056c: 46 40 00 02 be r18,r0,8010574 8010570: 5d e0 00 48 bne r15,r0,8010690 * 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; 8010574: 34 0c 00 00 mvi r12,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) 8010578: 5e 00 00 0e bne r16,r0,80105b0 *a_length = new_length; fat_fd->fat_file_size = new_length; return RC_OK; } 801057c: b9 80 08 00 mv r1,r12 8010580: 2b 9d 00 04 lw ra,(sp+4) 8010584: 2b 8b 00 28 lw r11,(sp+40) 8010588: 2b 8c 00 24 lw r12,(sp+36) 801058c: 2b 8d 00 20 lw r13,(sp+32) 8010590: 2b 8e 00 1c lw r14,(sp+28) 8010594: 2b 8f 00 18 lw r15,(sp+24) 8010598: 2b 90 00 14 lw r16,(sp+20) 801059c: 2b 91 00 10 lw r17,(sp+16) 80105a0: 2b 92 00 0c lw r18,(sp+12) 80105a4: 2b 93 00 08 lw r19,(sp+8) 80105a8: 37 9c 00 3c addi sp,sp,60 80105ac: c3 a0 00 00 ret * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 80105b0: 41 c2 00 08 lbu r2,(r14+8) 80105b4: 36 01 ff ff addi r1,r16,-1 80105b8: f8 00 75 dc calli 802dd28 <__lshrsi3> 80105bc: 34 33 00 01 addi r19,r1,1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 80105c0: 37 82 00 3c addi r2,sp,60 80105c4: b9 c0 08 00 mv r1,r14 80105c8: ba 60 18 00 mv r3,r19 80105cc: 37 84 00 30 addi r4,sp,48 80105d0: 37 85 00 34 addi r5,sp,52 80105d4: ba 40 30 00 mv r6,r18 80105d8: f8 00 25 01 calli 80199dc 80105dc: b8 20 60 00 mv r12,r1 &cls_added, &last_cl, zero_fill); /* this means that low level I/O error occured */ if (rc != RC_OK) 80105e0: 5c 20 ff e7 bne r1,r0,801057c <== NEVER TAKEN return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) 80105e4: 2b 92 00 30 lw r18,(sp+48) 80105e8: b9 f2 78 00 or r15,r15,r18 80105ec: 45 e1 00 24 be r15,r1,801067c <== NEVER TAKEN rtems_set_errno_and_return_minus_one(ENOSPC); /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 80105f0: 46 72 00 09 be r19,r18,8010614 <== ALWAYS TAKEN { new_length -= bytes2add & (fs_info->vol.bpc - 1); 80105f4: 2d c3 00 06 lhu r3,(r14+6) <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 80105f8: 41 c2 00 08 lbu r2,(r14+8) <== NOT EXECUTED 80105fc: ca 72 08 00 sub r1,r19,r18 <== 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); 8010600: 34 63 ff ff addi r3,r3,-1 <== NOT EXECUTED 8010604: a2 03 80 00 and r16,r16,r3 <== NOT EXECUTED 8010608: c9 b0 68 00 sub r13,r13,r16 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 801060c: fb ff c2 d6 calli 8001164 <__ashlsi3> <== NOT EXECUTED 8010610: c9 a1 68 00 sub r13,r13,r1 <== NOT EXECUTED } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) 8010614: 29 64 00 18 lw r4,(r11+24) 8010618: 5c 80 00 34 bne r4,r0,80106e8 { fat_fd->map.disk_cln = fat_fd->cln = chain; 801061c: 2b 81 00 3c lw r1,(sp+60) fat_fd->map.file_cln = 0; 8010620: 59 60 00 34 sw (r11+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; 8010624: 59 61 00 1c sw (r11+28),r1 8010628: 59 61 00 38 sw (r11+56),r1 } fat_buf_release(fs_info); } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 801062c: 46 40 00 2c be r18,r0,80106dc <== NEVER TAKEN { fat_fd->map.last_cln = last_cl; 8010630: 2b 81 00 34 lw r1,(sp+52) if (fat_fd->fat_file_type == FAT_DIRECTORY) 8010634: 29 6f 00 10 lw r15,(r11+16) } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) { fat_fd->map.last_cln = last_cl; 8010638: 59 61 00 3c sw (r11+60),r1 if (fat_fd->fat_file_type == FAT_DIRECTORY) 801063c: 5d e0 00 28 bne r15,r0,80106dc { rc = fat_init_clusters_chain(fs_info, chain); 8010640: 2b 82 00 3c lw r2,(sp+60) 8010644: b9 c0 08 00 mv r1,r14 8010648: f8 00 06 a2 calli 80120d0 801064c: b8 20 18 00 mv r3,r1 if ( rc != RC_OK ) 8010650: 44 2f 00 23 be r1,r15,80106dc <== ALWAYS TAKEN { fat_free_fat_clusters_chain(fs_info, chain); 8010654: 2b 82 00 3c lw r2,(sp+60) <== NOT EXECUTED 8010658: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED return rc; 801065c: b8 60 60 00 mv r12,r3 <== 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); 8010660: f8 00 24 9d calli 80198d4 <== NOT EXECUTED return rc; 8010664: e3 ff ff c6 bi 801057c <== NOT EXECUTED *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 8010668: 29 61 00 24 lw r1,(r11+36) 801066c: 5c 20 ff b7 bne r1,r0,8010548 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 8010670: 41 c1 00 0e lbu r1,(r14+14) 8010674: 20 21 00 03 andi r1,r1,0x3 *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 8010678: 44 2c ff b4 be r1,r12,8010548 <== NEVER TAKEN if (rc != RC_OK) return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) rtems_set_errno_and_return_minus_one(ENOSPC); 801067c: f8 00 2b aa calli 801b524 <__errno> 8010680: 34 02 00 1c mvi r2,28 8010684: 58 22 00 00 sw (r1+0),r2 8010688: 34 0c ff ff mvi r12,-1 801068c: e3 ff ff bc bi 801057c else bytes2add = 0; if (zero_fill && bytes_remain > 0) { uint32_t start = fat_fd->fat_file_size; uint32_t cl_start = start >> fs_info->vol.bpc_log2; 8010690: 41 c2 00 08 lbu r2,(r14+8) 8010694: b8 e0 08 00 mv r1,r7 8010698: f8 00 75 a4 calli 802dd28 <__lshrsi3> 801069c: 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); 80106a0: b9 60 10 00 mv r2,r11 80106a4: b9 c0 08 00 mv r1,r14 80106a8: 37 84 00 2c addi r4,sp,44 80106ac: fb ff fd 31 calli 800fb70 80106b0: b8 20 60 00 mv r12,r1 if (rc != RC_OK) 80106b4: 5c 20 ff b2 bne r1,r0,801057c <== NEVER TAKEN return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 80106b8: 2b 82 00 2c lw r2,(sp+44) 80106bc: b9 c0 08 00 mv r1,r14 80106c0: ba 60 18 00 mv r3,r19 80106c4: b9 e0 20 00 mv r4,r15 80106c8: 34 05 00 00 mvi r5,0 80106cc: f8 00 02 51 calli 8011010 if (bytes_remain != bytes_written) return -1; 80106d0: 34 0c ff ff mvi r12,-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) 80106d4: 5c 2f ff aa bne r1,r15,801057c <== NEVER TAKEN 80106d8: e3 ff ff a7 bi 8010574 return rc; } } } *a_length = new_length; 80106dc: 5a 2d 00 00 sw (r17+0),r13 fat_fd->fat_file_size = new_length; 80106e0: 59 6d 00 18 sw (r11+24),r13 return RC_OK; 80106e4: e3 ff ff a6 bi 801057c fat_fd->map.disk_cln = fat_fd->cln = chain; fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 80106e8: 29 62 00 3c lw r2,(r11+60) 80106ec: 34 01 ff ff mvi r1,-1 80106f0: 44 41 00 0c be r2,r1,8010720 <== NEVER TAKEN { old_last_cl = fat_fd->map.last_cln; 80106f4: 5b 82 00 38 sw (sp+56),r2 fat_free_fat_clusters_chain(fs_info, chain); return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); 80106f8: 2b 83 00 3c lw r3,(sp+60) 80106fc: b9 c0 08 00 mv r1,r14 8010700: f8 00 23 66 calli 8019498 8010704: b8 20 18 00 mv r3,r1 if ( rc != RC_OK ) 8010708: 5c 20 ff d3 bne r1,r0,8010654 <== NEVER TAKEN { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); 801070c: b9 c0 08 00 mv r1,r14 8010710: f8 00 01 0b calli 8010b3c 8010714: 2b 92 00 30 lw r18,(sp+48) } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 8010718: 46 40 ff f1 be r18,r0,80106dc <== NEVER TAKEN 801071c: e3 ff ff c5 bi 8010630 { old_last_cl = fat_fd->map.last_cln; } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 8010720: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8010724: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8010728: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 801072c: 34 84 ff ff addi r4,r4,-1 <== NOT EXECUTED 8010730: 37 85 00 38 addi r5,sp,56 <== NOT EXECUTED 8010734: fb ff ff 30 calli 80103f4 <== NOT EXECUTED 8010738: b8 20 18 00 mv r3,r1 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 801073c: 5c 20 ff c6 bne r1,r0,8010654 <== NOT EXECUTED { fat_free_fat_clusters_chain(fs_info, chain); return rc; 8010740: 2b 82 00 38 lw r2,(sp+56) <== NOT EXECUTED 8010744: e3 ff ff ed bi 80106f8 <== NOT EXECUTED =============================================================================== 080103f4 : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 80103f4: 37 9c ff d4 addi sp,sp,-44 80103f8: 5b 8b 00 10 sw (sp+16),r11 80103fc: 5b 8c 00 0c sw (sp+12),r12 8010400: 5b 8d 00 08 sw (sp+8),r13 8010404: 5b 9d 00 04 sw (sp+4),ra 8010408: b8 20 60 00 mv r12,r1 801040c: 5b 83 00 18 sw (sp+24),r3 8010410: 5b 84 00 1c sw (sp+28),r4 8010414: 5b 85 00 20 sw (sp+32),r5 8010418: 5b 86 00 24 sw (sp+36),r6 801041c: 5b 87 00 28 sw (sp+40),r7 8010420: 5b 88 00 2c sw (sp+44),r8 int rc = RC_OK; uint32_t cur_cln = 0; 8010424: 5b 80 00 14 sw (sp+20),r0 uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 8010428: 34 01 00 01 mvi r1,1 fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 801042c: b8 40 58 00 mv r11,r2 uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 8010430: 44 61 00 0b be r3,r1,801045c <== ALWAYS TAKEN *ret = cur_cln; break; default: errno = EINVAL; 8010434: f8 00 2c 3c calli 801b524 <__errno> <== NOT EXECUTED 8010438: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 801043c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rc = -1; 8010440: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED break; } va_end(ap); return rc; } 8010444: 2b 9d 00 04 lw ra,(sp+4) 8010448: 2b 8b 00 10 lw r11,(sp+16) 801044c: 2b 8c 00 0c lw r12,(sp+12) 8010450: 2b 8d 00 08 lw r13,(sp+8) 8010454: 37 9c 00 2c addi sp,sp,44 8010458: c3 a0 00 00 ret 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 ) { 801045c: 28 41 00 18 lw r1,(r2+24) switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); 8010460: b8 a0 68 00 mv r13,r5 /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 8010464: 54 24 00 06 bgu r1,r4,801047c <== ALWAYS TAKEN va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); 8010468: f8 00 2c 2f calli 801b524 <__errno> <== NOT EXECUTED 801046c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8010470: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8010474: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8010478: e3 ff ff f3 bi 8010444 <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 801047c: 28 41 00 20 lw r1,(r2+32) 8010480: 44 23 00 12 be r1,r3,80104c8 *ret = 0; rc = RC_OK; break; } cl_start = pos >> fs_info->vol.bpc_log2; 8010484: 41 82 00 08 lbu r2,(r12+8) 8010488: b8 80 08 00 mv r1,r4 801048c: f8 00 76 27 calli 802dd28 <__lshrsi3> 8010490: b8 20 18 00 mv r3,r1 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 8010494: b9 60 10 00 mv r2,r11 8010498: b9 80 08 00 mv r1,r12 801049c: 37 84 00 14 addi r4,sp,20 80104a0: fb ff fd b4 calli 800fb70 if ( rc != RC_OK ) 80104a4: 5c 20 ff e8 bne r1,r0,8010444 <== NEVER TAKEN break; *ret = cur_cln; 80104a8: 2b 82 00 14 lw r2,(sp+20) 80104ac: 59 a2 00 00 sw (r13+0),r2 rc = -1; break; } va_end(ap); return rc; } 80104b0: 2b 9d 00 04 lw ra,(sp+4) 80104b4: 2b 8b 00 10 lw r11,(sp+16) 80104b8: 2b 8c 00 0c lw r12,(sp+12) 80104bc: 2b 8d 00 08 lw r13,(sp+8) 80104c0: 37 9c 00 2c addi sp,sp,44 80104c4: c3 a0 00 00 ret 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)) && 80104c8: 28 41 00 24 lw r1,(r2+36) 80104cc: 5c 20 ff ee bne r1,r0,8010484 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 80104d0: 41 82 00 0e lbu r2,(r12+14) 80104d4: 20 42 00 03 andi r2,r2,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)) && 80104d8: 44 41 ff eb be r2,r1,8010484 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { /* cluster 0 (zero) reserved for root dir */ *ret = 0; 80104dc: 58 a0 00 00 sw (r5+0),r0 rc = RC_OK; break; 80104e0: e3 ff ff d9 bi 8010444 =============================================================================== 0800fb70 : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 800fb70: 37 9c ff e0 addi sp,sp,-32 800fb74: 5b 8b 00 1c sw (sp+28),r11 800fb78: 5b 8c 00 18 sw (sp+24),r12 800fb7c: 5b 8d 00 14 sw (sp+20),r13 800fb80: 5b 8e 00 10 sw (sp+16),r14 800fb84: 5b 8f 00 0c sw (sp+12),r15 800fb88: 5b 90 00 08 sw (sp+8),r16 800fb8c: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 800fb90: 28 4c 00 34 lw r12,(r2+52) fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 800fb94: b8 40 78 00 mv r15,r2 800fb98: b8 60 70 00 mv r14,r3 800fb9c: b8 20 68 00 mv r13,r1 800fba0: b8 80 80 00 mv r16,r4 int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 800fba4: 45 83 00 22 be r12,r3,800fc2c { uint32_t cur_cln; uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) 800fba8: 51 83 00 17 bgeu r12,r3,800fc04 { cur_cln = fat_fd->map.disk_cln; 800fbac: 28 42 00 38 lw r2,(r2+56) count = file_cln - fat_fd->map.file_cln; 800fbb0: c8 6c 60 00 sub r12,r3,r12 uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) { cur_cln = fat_fd->map.disk_cln; 800fbb4: 5b 82 00 20 sw (sp+32),r2 cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 800fbb8: 45 80 00 18 be r12,r0,800fc18 800fbbc: 34 0b 00 00 mvi r11,0 800fbc0: e0 00 00 03 bi 800fbcc 800fbc4: 51 6c 00 14 bgeu r11,r12,800fc14 800fbc8: 2b 82 00 20 lw r2,(sp+32) { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 800fbcc: b9 a0 08 00 mv r1,r13 800fbd0: 37 83 00 20 addi r3,sp,32 800fbd4: f8 00 25 74 calli 80191a4 cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 800fbd8: 35 6b 00 01 addi r11,r11,1 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) 800fbdc: 44 20 ff fa be r1,r0,800fbc4 <== ALWAYS TAKEN fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } 800fbe0: 2b 9d 00 04 lw ra,(sp+4) 800fbe4: 2b 8b 00 1c lw r11,(sp+28) 800fbe8: 2b 8c 00 18 lw r12,(sp+24) 800fbec: 2b 8d 00 14 lw r13,(sp+20) 800fbf0: 2b 8e 00 10 lw r14,(sp+16) 800fbf4: 2b 8f 00 0c lw r15,(sp+12) 800fbf8: 2b 90 00 08 lw r16,(sp+8) 800fbfc: 37 9c 00 20 addi sp,sp,32 800fc00: c3 a0 00 00 ret cur_cln = fat_fd->map.disk_cln; count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; 800fc04: 28 42 00 1c lw r2,(r2+28) 800fc08: b8 60 60 00 mv r12,r3 800fc0c: 5b 82 00 20 sw (sp+32),r2 800fc10: e3 ff ff ea bi 800fbb8 count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 800fc14: 2b 82 00 20 lw r2,(sp+32) if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; 800fc18: 59 ee 00 34 sw (r15+52),r14 fat_fd->map.disk_cln = cur_cln; 800fc1c: 59 e2 00 38 sw (r15+56),r2 *disk_cln = cur_cln; 800fc20: 5a 02 00 00 sw (r16+0),r2 } return RC_OK; 800fc24: 34 01 00 00 mvi r1,0 800fc28: e3 ff ff ee bi 800fbe0 ) { int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) *disk_cln = fat_fd->map.disk_cln; 800fc2c: 28 42 00 38 lw r2,(r2+56) fat_fd->map.file_cln = file_cln; fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; 800fc30: 34 01 00 00 mvi r1,0 ) { int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) *disk_cln = fat_fd->map.disk_cln; 800fc34: 58 82 00 00 sw (r4+0),r2 800fc38: e3 ff ff ea bi 800fbe0 =============================================================================== 0800fc3c : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 800fc3c: 37 9c ff d4 addi sp,sp,-44 800fc40: 5b 8b 00 2c sw (sp+44),r11 800fc44: 5b 8c 00 28 sw (sp+40),r12 800fc48: 5b 8d 00 24 sw (sp+36),r13 800fc4c: 5b 8e 00 20 sw (sp+32),r14 800fc50: 5b 8f 00 1c sw (sp+28),r15 800fc54: 5b 90 00 18 sw (sp+24),r16 800fc58: 5b 91 00 14 sw (sp+20),r17 800fc5c: 5b 92 00 10 sw (sp+16),r18 800fc60: 5b 93 00 0c sw (sp+12),r19 800fc64: 5b 94 00 08 sw (sp+8),r20 800fc68: 5b 9d 00 04 sw (sp+4),ra static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800fc6c: 28 45 00 00 lw r5,(r2+0) 800fc70: b8 20 60 00 mv r12,r1 fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 800fc74: 34 01 00 01 mvi r1,1 800fc78: b8 40 80 00 mv r16,r2 800fc7c: b8 60 a0 00 mv r20,r3 return 1; 800fc80: 34 0b 00 01 mvi r11,1 fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 800fc84: 44 a1 00 0a be r5,r1,800fcac 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)) ) 800fc88: 44 a0 00 58 be r5,r0,800fde8 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800fc8c: 41 82 00 05 lbu r2,(r12+5) 800fc90: 34 a1 ff fe addi r1,r5,-2 800fc94: fb ff c5 34 calli 8001164 <__ashlsi3> 800fc98: 29 82 00 34 lw r2,(r12+52) 800fc9c: b4 22 08 00 add r1,r1,r2 ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 800fca0: 41 82 00 03 lbu r2,(r12+3) 800fca4: fb ff c5 30 calli 8001164 <__ashlsi3> 800fca8: b8 20 58 00 mv r11,r1 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fcac: 2a 0d 00 04 lw r13,(r16+4) 800fcb0: 34 02 00 09 mvi r2,9 800fcb4: b9 a0 08 00 mv r1,r13 800fcb8: f8 00 78 1c calli 802dd28 <__lshrsi3> ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fcbc: 01 a5 00 01 srui r5,r13,1 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800fcc0: b5 61 20 00 add r4,r11,r1 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fcc4: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fcc8: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fccc: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fcd0: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fcd4: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fcd8: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fcdc: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fce0: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fce4: 20 ad 00 0f andi r13,r5,0xf static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800fce8: b4 8d 68 00 add r13,r4,r13 uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { uint32_t mod = (key1) % FAT_HASH_MODULE; 800fcec: 21 a1 00 01 andi r1,r13,0x1 rtems_chain_node *the_node = rtems_chain_first(hash + mod); 800fcf0: b4 21 88 00 add r17,r1,r1 800fcf4: b6 21 88 00 add r17,r17,r1 800fcf8: 29 81 00 6c lw r1,(r12+108) 800fcfc: b6 31 88 00 add r17,r17,r17 800fd00: b6 31 88 00 add r17,r17,r17 800fd04: b4 31 08 00 add r1,r1,r17 fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } 800fd08: 28 2b 00 00 lw r11,(r1+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 )); 800fd0c: 34 32 00 04 addi r18,r1,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) ; ) 800fd10: 45 72 00 3d be r11,r18,800fe04 fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 800fd14: 34 13 00 01 mvi r19,1 800fd18: 29 62 00 20 lw r2,(r11+32) return 1; 800fd1c: 34 0e 00 01 mvi r14,1 ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800fd20: 34 41 ff fe addi r1,r2,-2 fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 800fd24: 44 53 00 09 be r2,r19,800fd48 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)) ) 800fd28: 44 40 00 2b be r2,r0,800fdd4 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800fd2c: 41 82 00 05 lbu r2,(r12+5) 800fd30: fb ff c5 0d calli 8001164 <__ashlsi3> 800fd34: 29 82 00 34 lw r2,(r12+52) 800fd38: b4 22 08 00 add r1,r1,r2 ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 800fd3c: 41 82 00 03 lbu r2,(r12+3) 800fd40: fb ff c5 09 calli 8001164 <__ashlsi3> 800fd44: b8 20 70 00 mv r14,r1 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fd48: 29 6f 00 24 lw r15,(r11+36) 800fd4c: 34 02 00 09 mvi r2,9 800fd50: b9 e0 08 00 mv r1,r15 800fd54: f8 00 77 f5 calli 802dd28 <__lshrsi3> ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fd58: 01 e5 00 01 srui r5,r15,1 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800fd5c: b5 c1 20 00 add r4,r14,r1 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fd60: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fd64: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fd68: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fd6c: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fd70: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fd74: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fd78: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fd7c: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fd80: 20 a5 00 0f andi r5,r5,0xf static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800fd84: b4 85 20 00 add r4,r4,r5 { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); if ( (key1) == ck) 800fd88: 5d a4 00 1d bne r13,r4,800fdfc rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); if ( rc == RC_OK ) { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; lfat_fd->links_num++; 800fd8c: 29 62 00 08 lw r2,(r11+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; 800fd90: 5a 8b 00 00 sw (r20+0),r11 lfat_fd->links_num++; return rc; 800fd94: 34 01 00 00 mvi r1,0 rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); if ( rc == RC_OK ) { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; lfat_fd->links_num++; 800fd98: 34 42 00 01 addi r2,r2,1 800fd9c: 59 62 00 08 sw (r11+8),r2 * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; } 800fda0: 2b 9d 00 04 lw ra,(sp+4) 800fda4: 2b 8b 00 2c lw r11,(sp+44) 800fda8: 2b 8c 00 28 lw r12,(sp+40) 800fdac: 2b 8d 00 24 lw r13,(sp+36) 800fdb0: 2b 8e 00 20 lw r14,(sp+32) 800fdb4: 2b 8f 00 1c lw r15,(sp+28) 800fdb8: 2b 90 00 18 lw r16,(sp+24) 800fdbc: 2b 91 00 14 lw r17,(sp+20) 800fdc0: 2b 92 00 10 lw r18,(sp+16) 800fdc4: 2b 93 00 0c lw r19,(sp+12) 800fdc8: 2b 94 00 08 lw r20,(sp+8) 800fdcc: 37 9c 00 2c addi sp,sp,44 800fdd0: c3 a0 00 00 ret 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)) ) 800fdd4: 41 83 00 0e lbu r3,(r12+14) 800fdd8: 20 63 00 03 andi r3,r3,0x3 800fddc: 44 62 ff d4 be r3,r2,800fd2c <== NEVER TAKEN return fs_info->vol.rdir_loc; 800fde0: 29 81 00 20 lw r1,(r12+32) 800fde4: e3 ff ff d6 bi 800fd3c 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)) ) 800fde8: 41 81 00 0e lbu r1,(r12+14) 800fdec: 20 21 00 03 andi r1,r1,0x3 800fdf0: 44 25 ff a7 be r1,r5,800fc8c <== NEVER TAKEN return fs_info->vol.rdir_loc; 800fdf4: 29 81 00 20 lw r1,(r12+32) 800fdf8: e3 ff ff aa bi 800fca0 { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 800fdfc: 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) ; ) 800fe00: 5d 72 ff c6 bne r11,r18,800fd18 uint32_t key2, fat_file_fd_t **ret ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); 800fe04: 29 93 00 70 lw r19,(r12+112) fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 800fe08: 34 12 00 01 mvi r18,1 800fe0c: b6 71 98 00 add r19,r19,r17 fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } 800fe10: 2a 6b 00 00 lw r11,(r19+0) 800fe14: 36 73 00 04 addi r19,r19,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) ; ) 800fe18: 5e 6b 00 1f bne r19,r11,800fe94 <== NEVER TAKEN 800fe1c: e0 00 00 48 bi 800ff3c 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)) ) 800fe20: 41 82 00 0e lbu r2,(r12+14) <== NOT EXECUTED 800fe24: 20 42 00 03 andi r2,r2,0x3 <== NOT EXECUTED 800fe28: 44 45 00 20 be r2,r5,800fea8 <== NOT EXECUTED return fs_info->vol.rdir_loc; 800fe2c: 29 81 00 20 lw r1,(r12+32) <== NOT EXECUTED ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 800fe30: 41 82 00 03 lbu r2,(r12+3) <== NOT EXECUTED 800fe34: fb ff c4 cc calli 8001164 <__ashlsi3> <== NOT EXECUTED 800fe38: b8 20 70 00 mv r14,r1 <== NOT EXECUTED (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fe3c: 29 6f 00 24 lw r15,(r11+36) <== NOT EXECUTED 800fe40: 34 02 00 09 mvi r2,9 <== NOT EXECUTED 800fe44: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 800fe48: f8 00 77 b8 calli 802dd28 <__lshrsi3> <== NOT EXECUTED ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fe4c: 01 e5 00 01 srui r5,r15,1 <== NOT EXECUTED static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800fe50: b5 c1 20 00 add r4,r14,r1 <== NOT EXECUTED (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fe54: 00 a5 00 01 srui r5,r5,1 <== NOT EXECUTED fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fe58: b4 84 20 00 add r4,r4,r4 <== NOT EXECUTED ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fe5c: 00 a5 00 01 srui r5,r5,1 <== NOT EXECUTED fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fe60: b4 84 20 00 add r4,r4,r4 <== NOT EXECUTED ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fe64: 00 a5 00 01 srui r5,r5,1 <== NOT EXECUTED fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fe68: b4 84 20 00 add r4,r4,r4 <== NOT EXECUTED ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fe6c: 00 a5 00 01 srui r5,r5,1 <== NOT EXECUTED fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fe70: b4 84 20 00 add r4,r4,r4 <== NOT EXECUTED ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fe74: 20 a5 00 0f andi r5,r5,0xf <== NOT EXECUTED static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800fe78: b4 85 20 00 add r4,r4,r5 <== NOT EXECUTED { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); if ( (key1) == ck) 800fe7c: 5d a4 00 04 bne r13,r4,800fe8c <== NOT EXECUTED { if ( ((key2) == 0) || ((key2) == ffd->ino) ) 800fe80: 45 a0 00 0f be r13,r0,800febc <== NOT EXECUTED 800fe84: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED 800fe88: 45 a1 00 0d be r13,r1,800febc <== NOT EXECUTED { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 800fe8c: 29 6b 00 00 lw r11,(r11+0) <== NOT EXECUTED ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 800fe90: 46 6b 00 2b be r19,r11,800ff3c <== NOT EXECUTED 800fe94: 29 65 00 20 lw r5,(r11+32) <== NOT EXECUTED const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) return 1; 800fe98: 34 0e 00 01 mvi r14,1 <== NOT EXECUTED ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800fe9c: 34 a1 ff fe addi r1,r5,-2 <== NOT EXECUTED fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 800fea0: 44 b2 ff e7 be r5,r18,800fe3c <== NOT EXECUTED fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 800fea4: 44 a0 ff df be r5,r0,800fe20 <== NOT EXECUTED return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800fea8: 41 82 00 05 lbu r2,(r12+5) <== NOT EXECUTED 800feac: fb ff c4 ae calli 8001164 <__ashlsi3> <== NOT EXECUTED 800feb0: 29 82 00 34 lw r2,(r12+52) <== NOT EXECUTED 800feb4: b4 22 08 00 add r1,r1,r2 <== NOT EXECUTED 800feb8: e3 ff ff de bi 800fe30 <== NOT EXECUTED if ( (key1) == ck) { if ( ((key2) == 0) || ((key2) == ffd->ino) ) { *ret = (void *)the_node; return 0; 800febc: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED } /* access "removed-but-still-open" hash table */ rc = _hash_search(fs_info, fs_info->rhash, key, key, &lfat_fd); lfat_fd = (*fat_fd) = (fat_file_fd_t*)malloc(sizeof(fat_file_fd_t)); 800fec0: 34 01 00 44 mvi r1,68 800fec4: fb ff ce 07 calli 80036e0 800fec8: 5a 81 00 00 sw (r20+0),r1 800fecc: b8 20 58 00 mv r11,r1 if ( lfat_fd == NULL ) 800fed0: 44 20 00 23 be r1,r0,800ff5c <== NEVER TAKEN rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 800fed4: 34 02 00 00 mvi r2,0 800fed8: 34 03 00 44 mvi r3,68 800fedc: f8 00 31 21 calli 801c360 lfat_fd->links_num = 1; lfat_fd->flags &= ~FAT_FILE_REMOVED; 800fee0: 41 64 00 30 lbu r4,(r11+48) lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; 800fee4: 2a 03 00 00 lw r3,(r16+0) 800fee8: 2a 02 00 04 lw r2,(r16+4) 800feec: 2a 01 00 08 lw r1,(r16+8) 800fef0: 2a 06 00 0c lw r6,(r16+12) 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; 800fef4: 20 84 00 fe andi r4,r4,0xfe if ( lfat_fd == NULL ) rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); lfat_fd->links_num = 1; 800fef8: 34 05 00 01 mvi r5,1 lfat_fd->flags &= ~FAT_FILE_REMOVED; 800fefc: 31 64 00 30 sb (r11+48),r4 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 800ff00: 34 04 ff ff mvi r4,-1 if ( lfat_fd == NULL ) rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); lfat_fd->links_num = 1; 800ff04: 59 65 00 08 sw (r11+8),r5 lfat_fd->flags &= ~FAT_FILE_REMOVED; lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 800ff08: 59 64 00 3c sw (r11+60),r4 lfat_fd->dir_pos = *dir_pos; 800ff0c: 59 63 00 20 sw (r11+32),r3 800ff10: 59 62 00 24 sw (r11+36),r2 800ff14: 59 61 00 28 sw (r11+40),r1 800ff18: 59 66 00 2c sw (r11+44),r6 if ( rc != RC_OK ) 800ff1c: 45 c0 00 0a be r14,r0,800ff44 <== NEVER TAKEN lfat_fd->ino = key; 800ff20: 59 6d 00 0c sw (r11+12),r13 */ 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); 800ff24: 29 81 00 6c lw r1,(r12+108) RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); 800ff28: b9 60 10 00 mv r2,r11 800ff2c: b4 31 08 00 add r1,r1,r17 800ff30: fb ff d9 e8 calli 80066d0 <_Chain_Append> /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; 800ff34: 34 01 00 00 mvi r1,0 800ff38: e3 ff ff 9a bi 800fda0 return 0; } } the_node = the_node->next; } return -1; 800ff3c: 34 0e ff ff mvi r14,-1 800ff40: e3 ff ff e0 bi 800fec0 if ( rc != RC_OK ) lfat_fd->ino = key; else { lfat_fd->ino = fat_get_unique_ino(fs_info); 800ff44: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 800ff48: f8 00 08 85 calli 801215c <== NOT EXECUTED 800ff4c: 59 61 00 0c sw (r11+12),r1 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 800ff50: 5c 2e ff f5 bne r1,r14,800ff24 <== NOT EXECUTED { free((*fat_fd)); 800ff54: 2a 81 00 00 lw r1,(r20+0) <== NOT EXECUTED 800ff58: fb ff cc 3c calli 8003048 <== 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 ); 800ff5c: f8 00 2d 72 calli 801b524 <__errno> <== NOT EXECUTED 800ff60: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 800ff64: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800ff68: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800ff6c: e3 ff ff 8d bi 800fda0 <== NOT EXECUTED =============================================================================== 0800ff88 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 800ff88: 37 9c ff c8 addi sp,sp,-56 800ff8c: 5b 8b 00 34 sw (sp+52),r11 800ff90: 5b 8c 00 30 sw (sp+48),r12 800ff94: 5b 8d 00 2c sw (sp+44),r13 800ff98: 5b 8e 00 28 sw (sp+40),r14 800ff9c: 5b 8f 00 24 sw (sp+36),r15 800ffa0: 5b 90 00 20 sw (sp+32),r16 800ffa4: 5b 91 00 1c sw (sp+28),r17 800ffa8: 5b 92 00 18 sw (sp+24),r18 800ffac: 5b 93 00 14 sw (sp+20),r19 800ffb0: 5b 94 00 10 sw (sp+16),r20 800ffb4: 5b 95 00 0c sw (sp+12),r21 800ffb8: 5b 96 00 08 sw (sp+8),r22 800ffbc: 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; 800ffc0: 5b 80 00 38 sw (sp+56),r0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 800ffc4: b8 80 60 00 mv r12,r4 800ffc8: b8 20 58 00 mv r11,r1 800ffcc: b8 40 78 00 mv r15,r2 800ffd0: b8 60 70 00 mv r14,r3 800ffd4: 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; 800ffd8: 34 0d 00 00 mvi r13,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) 800ffdc: 44 80 00 4b be r4,r0,8010108 <== NEVER TAKEN /* * >= because start is offset and computed from 0 and file_size * computed from 1 */ if ( start >= fat_fd->fat_file_size ) 800ffe0: 28 41 00 18 lw r1,(r2+24) 800ffe4: 50 61 00 49 bgeu r3,r1,8010108 return FAT_EOF; if ((count > fat_fd->fat_file_size) || 800ffe8: 54 81 00 03 bgu r4,r1,800fff4 <== NEVER TAKEN (start > fat_fd->fat_file_size - count)) 800ffec: c8 24 10 00 sub r2,r1,r4 * computed from 1 */ if ( start >= fat_fd->fat_file_size ) return FAT_EOF; if ((count > fat_fd->fat_file_size) || 800fff0: 50 43 00 02 bgeu r2,r3,800fff8 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 800fff4: c8 2e 60 00 sub r12,r1,r14 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 800fff8: 29 e2 00 20 lw r2,(r15+32) 800fffc: 34 01 00 01 mvi r1,1 8010000: 44 41 00 57 be r2,r1,801015c return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 8010004: 41 62 00 08 lbu r2,(r11+8) 8010008: b9 c0 08 00 mv r1,r14 801000c: f8 00 77 47 calli 802dd28 <__lshrsi3> 8010010: b8 20 a8 00 mv r21,r1 save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 8010014: b9 e0 10 00 mv r2,r15 8010018: b9 60 08 00 mv r1,r11 801001c: ba a0 18 00 mv r3,r21 8010020: 37 84 00 38 addi r4,sp,56 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 8010024: 2d 70 00 06 lhu r16,(r11+6) rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 8010028: fb ff fe d2 calli 800fb70 801002c: b8 20 68 00 mv r13,r1 if (rc != RC_OK) 8010030: 5c 20 00 36 bne r1,r0,8010108 <== NEVER TAKEN return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 8010034: 36 10 ff ff addi r16,r16,-1 8010038: a1 d0 b0 00 and r22,r14,r16 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) 801003c: 34 11 00 00 mvi r17,0 8010040: 34 10 00 00 mvi r16,0 8010044: 45 81 00 2a be r12,r1,80100ec <== NEVER TAKEN cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) 8010048: 41 72 00 02 lbu r18,(r11+2) 801004c: 2d 71 00 00 lhu r17,(r11+0) return rc; while (count > 0) 8010050: ba c0 70 00 mv r14,r22 8010054: 34 10 00 00 mvi r16,0 { c = MIN(count, (fs_info->vol.bpc - ofs)); 8010058: 2d 6d 00 06 lhu r13,(r11+6) sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 801005c: 2b 84 00 38 lw r4,(sp+56) if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 8010060: c9 ae 68 00 sub r13,r13,r14 8010064: 34 81 ff fe addi r1,r4,-2 8010068: 51 8d 00 02 bgeu r12,r13,8010070 801006c: b9 80 68 00 mv r13,r12 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)) ) 8010070: 5c 80 00 36 bne r4,r0,8010148 <== ALWAYS TAKEN 8010074: 41 62 00 0e lbu r2,(r11+14) <== NOT EXECUTED 8010078: 20 42 00 03 andi r2,r2,0x3 <== NOT EXECUTED 801007c: 44 44 00 33 be r2,r4,8010148 <== NOT EXECUTED return fs_info->vol.rdir_loc; 8010080: 29 73 00 20 lw r19,(r11+32) <== NOT EXECUTED sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); sec += (ofs >> fs_info->vol.sec_log2); 8010084: ba 40 10 00 mv r2,r18 8010088: b9 c0 08 00 mv r1,r14 801008c: f8 00 77 27 calli 802dd28 <__lshrsi3> byte = ofs & (fs_info->vol.bps - 1); 8010090: 36 24 ff ff addi r4,r17,-1 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); 8010094: b6 61 10 00 add r2,r19,r1 byte = ofs & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 8010098: a0 8e 18 00 and r3,r4,r14 801009c: b6 90 28 00 add r5,r20,r16 80100a0: b9 a0 20 00 mv r4,r13 80100a4: b9 60 08 00 mv r1,r11 80100a8: f8 00 03 65 calli 8010e3c <_fat_block_read> 80100ac: b8 20 10 00 mv r2,r1 return -1; count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 80100b0: 37 83 00 38 addi r3,sp,56 80100b4: b9 60 08 00 mv r1,r11 ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) return -1; count -= c; 80100b8: c9 8d 60 00 sub r12,r12,r13 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); sec += (ofs >> fs_info->vol.sec_log2); byte = ofs & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) 80100bc: 48 02 00 3d bg r0,r2,80101b0 <== NEVER TAKEN return -1; count -= c; cmpltd += c; save_cln = cur_cln; 80100c0: 2b 91 00 38 lw r17,(sp+56) ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) return -1; count -= c; cmpltd += c; 80100c4: b6 0d 80 00 add r16,r16,r13 save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; ofs = 0; 80100c8: 34 0e 00 00 mvi r14,0 return -1; count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 80100cc: ba 20 10 00 mv r2,r17 80100d0: f8 00 24 35 calli 80191a4 if ( rc != RC_OK ) 80100d4: 5c 20 00 39 bne r1,r0,80101b8 <== NEVER TAKEN rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) 80100d8: 45 81 00 04 be r12,r1,80100e8 80100dc: 41 72 00 02 lbu r18,(r11+2) 80100e0: 2d 71 00 00 lhu r17,(r11+0) 80100e4: e3 ff ff dd bi 8010058 save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; ofs = 0; 80100e8: ba 00 68 00 mv r13,r16 } /* 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); 80100ec: 41 62 00 08 lbu r2,(r11+8) 80100f0: 36 c1 ff ff addi r1,r22,-1 80100f4: b4 30 08 00 add r1,r1,r16 80100f8: f8 00 77 0c calli 802dd28 <__lshrsi3> ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 80100fc: b4 35 08 00 add r1,r1,r21 8010100: 59 e1 00 34 sw (r15+52),r1 ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; 8010104: 59 f1 00 38 sw (r15+56),r17 return cmpltd; } 8010108: b9 a0 08 00 mv r1,r13 801010c: 2b 9d 00 04 lw ra,(sp+4) 8010110: 2b 8b 00 34 lw r11,(sp+52) 8010114: 2b 8c 00 30 lw r12,(sp+48) 8010118: 2b 8d 00 2c lw r13,(sp+44) 801011c: 2b 8e 00 28 lw r14,(sp+40) 8010120: 2b 8f 00 24 lw r15,(sp+36) 8010124: 2b 90 00 20 lw r16,(sp+32) 8010128: 2b 91 00 1c lw r17,(sp+28) 801012c: 2b 92 00 18 lw r18,(sp+24) 8010130: 2b 93 00 14 lw r19,(sp+20) 8010134: 2b 94 00 10 lw r20,(sp+16) 8010138: 2b 95 00 0c lw r21,(sp+12) 801013c: 2b 96 00 08 lw r22,(sp+8) 8010140: 37 9c 00 38 addi sp,sp,56 8010144: c3 a0 00 00 ret return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 8010148: 41 62 00 05 lbu r2,(r11+5) 801014c: fb ff c4 06 calli 8001164 <__ashlsi3> 8010150: 29 73 00 34 lw r19,(r11+52) 8010154: b4 33 98 00 add r19,r1,r19 8010158: e3 ff ff cb bi 8010084 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)) && 801015c: 29 e1 00 24 lw r1,(r15+36) 8010160: 5c 20 ff a9 bne r1,r0,8010004 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 8010164: 41 62 00 0e lbu r2,(r11+14) 8010168: 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)) && 801016c: 44 41 ff a6 be r2,r1,8010004 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); 8010170: 29 e1 00 1c lw r1,(r15+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)) ) 8010174: 5c 20 00 13 bne r1,r0,80101c0 <== NEVER TAKEN return fs_info->vol.rdir_loc; 8010178: 29 6d 00 20 lw r13,(r11+32) sec += (start >> fs_info->vol.sec_log2); 801017c: 41 62 00 02 lbu r2,(r11+2) 8010180: b9 c0 08 00 mv r1,r14 8010184: f8 00 76 e9 calli 802dd28 <__lshrsi3> byte = start & (fs_info->vol.bps - 1); 8010188: 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); 801018c: 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); 8010190: 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); 8010194: 34 63 ff ff addi r3,r3,-1 ret = _fat_block_read(fs_info, sec, byte, count, buf); 8010198: b9 60 08 00 mv r1,r11 801019c: a1 c3 18 00 and r3,r14,r3 80101a0: ba 80 28 00 mv r5,r20 80101a4: f8 00 03 26 calli 8010e3c <_fat_block_read> 80101a8: b8 20 68 00 mv r13,r1 if ( ret < 0 ) 80101ac: 4c 20 ff d7 bge r1,r0,8010108 <== ALWAYS TAKEN 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; 80101b0: 34 0d ff ff mvi r13,-1 <== NOT EXECUTED 80101b4: e3 ff ff d5 bi 8010108 <== NOT EXECUTED count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 80101b8: b8 20 68 00 mv r13,r1 <== NOT EXECUTED 80101bc: e3 ff ff d3 bi 8010108 <== NOT EXECUTED return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 80101c0: 41 62 00 05 lbu r2,(r11+5) <== NOT EXECUTED 80101c4: 34 21 ff fe addi r1,r1,-2 <== NOT EXECUTED 80101c8: fb ff c3 e7 calli 8001164 <__ashlsi3> <== NOT EXECUTED 80101cc: 29 6d 00 34 lw r13,(r11+52) <== NOT EXECUTED 80101d0: b4 2d 68 00 add r13,r1,r13 <== NOT EXECUTED 80101d4: e3 ff ff ea bi 801017c <== NOT EXECUTED =============================================================================== 08010a70 : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 8010a70: 37 9c ff ec addi sp,sp,-20 8010a74: 5b 8b 00 10 sw (sp+16),r11 8010a78: 5b 8c 00 0c sw (sp+12),r12 8010a7c: 5b 8d 00 08 sw (sp+8),r13 8010a80: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 8010a84: 28 4d 00 1c lw r13,(r2+28) int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 8010a88: b8 40 60 00 mv r12,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)) && 8010a8c: 28 42 00 20 lw r2,(r2+32) int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 8010a90: b8 20 58 00 mv r11,r1 int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 8010a94: 5b 8d 00 14 sw (sp+20),r13 uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 8010a98: 34 01 00 01 mvi r1,1 8010a9c: 44 41 00 1e be r2,r1,8010b14 return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8010aa0: 29 61 00 10 lw r1,(r11+16) 8010aa4: 29 62 00 14 lw r2,(r11+20) { fat_fd->fat_file_size = fs_info->vol.rdir_size; return rc; } fat_fd->fat_file_size = 0; 8010aa8: 59 80 00 18 sw (r12+24),r0 while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8010aac: a1 a1 08 00 and r1,r13,r1 8010ab0: 50 22 00 21 bgeu r1,r2,8010b34 <== NEVER TAKEN { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 8010ab4: b9 a0 10 00 mv r2,r13 8010ab8: b9 60 08 00 mv r1,r11 8010abc: 37 83 00 14 addi r3,sp,20 8010ac0: f8 00 21 b9 calli 80191a4 if ( rc != RC_OK ) 8010ac4: 5c 20 00 0c bne r1,r0,8010af4 <== NEVER TAKEN return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 8010ac8: 2d 63 00 06 lhu r3,(r11+6) 8010acc: 29 85 00 18 lw r5,(r12+24) return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8010ad0: 29 62 00 10 lw r2,(r11+16) 8010ad4: 2b 81 00 14 lw r1,(sp+20) 8010ad8: 29 64 00 14 lw r4,(r11+20) save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 8010adc: b4 a3 18 00 add r3,r5,r3 8010ae0: 59 83 00 18 sw (r12+24),r3 return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8010ae4: a0 22 10 00 and r2,r1,r2 8010ae8: 54 82 00 09 bgu r4,r2,8010b0c <== NEVER TAKEN if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; 8010aec: 59 8d 00 3c sw (r12+60),r13 return rc; 8010af0: 34 01 00 00 mvi r1,0 } 8010af4: 2b 9d 00 04 lw ra,(sp+4) 8010af8: 2b 8b 00 10 lw r11,(sp+16) 8010afc: 2b 8c 00 0c lw r12,(sp+12) 8010b00: 2b 8d 00 08 lw r13,(sp+8) 8010b04: 37 9c 00 14 addi sp,sp,20 8010b08: c3 a0 00 00 ret return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8010b0c: b8 20 68 00 mv r13,r1 <== NOT EXECUTED 8010b10: e3 ff ff e9 bi 8010ab4 <== NOT EXECUTED 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)) && 8010b14: 29 81 00 24 lw r1,(r12+36) 8010b18: 5c 20 ff e2 bne r1,r0,8010aa0 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 8010b1c: 41 62 00 0e lbu r2,(r11+14) 8010b20: 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)) && 8010b24: 44 41 ff df be r2,r1,8010aa0 <== ALWAYS TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { fat_fd->fat_file_size = fs_info->vol.rdir_size; 8010b28: 29 62 00 2c lw r2,(r11+44) <== NOT EXECUTED 8010b2c: 59 82 00 18 sw (r12+24),r2 <== NOT EXECUTED return rc; 8010b30: e3 ff ff f1 bi 8010af4 <== NOT EXECUTED fat_file_fd_t *fat_fd ) { int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; 8010b34: 34 0d 00 00 mvi r13,0 <== NOT EXECUTED 8010b38: e3 ff ff ed bi 8010aec <== NOT EXECUTED =============================================================================== 080101d8 : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 80101d8: 37 9c ff e0 addi sp,sp,-32 80101dc: 5b 8b 00 18 sw (sp+24),r11 80101e0: 5b 8c 00 14 sw (sp+20),r12 80101e4: 5b 8d 00 10 sw (sp+16),r13 80101e8: 5b 8e 00 0c sw (sp+12),r14 80101ec: 5b 8f 00 08 sw (sp+8),r15 80101f0: 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 ) 80101f4: 28 4b 00 18 lw r11,(r2+24) fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 80101f8: b8 40 68 00 mv r13,r2 int rc = RC_OK; uint32_t cur_cln = 0; uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 80101fc: 34 02 ff ff mvi r2,-1 fat_file_fd_t *fat_fd, uint32_t new_length ) { int rc = RC_OK; uint32_t cur_cln = 0; 8010200: 5b 80 00 20 sw (sp+32),r0 uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 8010204: 5b 82 00 1c sw (sp+28),r2 fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 8010208: b8 20 60 00 mv r12,r1 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 ) 801020c: 50 6b 00 25 bgeu r3,r11,80102a0 return rc; assert(fat_fd->fat_file_size); 8010210: 45 60 00 38 be r11,r0,80102f0 <== NEVER TAKEN cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; 8010214: 2c 21 00 06 lhu r1,(r1+6) 8010218: 41 8f 00 08 lbu r15,(r12+8) 801021c: 34 21 ff ff addi r1,r1,-1 8010220: b4 23 08 00 add r1,r1,r3 8010224: b9 e0 10 00 mv r2,r15 8010228: f8 00 76 c0 calli 802dd28 <__lshrsi3> if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 801022c: 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; 8010230: b8 20 70 00 mv r14,r1 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 8010234: fb ff c3 cc calli 8001164 <__ashlsi3> return RC_OK; 8010238: 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) 801023c: 50 2b 00 10 bgeu r1,r11,801027c return RC_OK; if (cl_start != 0) 8010240: 45 c0 00 08 be r14,r0,8010260 { rc = fat_file_lseek(fs_info, fat_fd, cl_start - 1, &new_last_cln); 8010244: 37 84 00 1c addi r4,sp,28 8010248: b9 80 08 00 mv r1,r12 801024c: b9 a0 10 00 mv r2,r13 8010250: 35 c3 ff ff addi r3,r14,-1 8010254: fb ff fe 47 calli 800fb70 8010258: b8 20 20 00 mv r4,r1 if (rc != RC_OK) 801025c: 5c 20 00 08 bne r1,r0,801027c <== NEVER TAKEN return rc; } rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 8010260: 37 84 00 20 addi r4,sp,32 8010264: b9 80 08 00 mv r1,r12 8010268: b9 a0 10 00 mv r2,r13 801026c: b9 c0 18 00 mv r3,r14 8010270: fb ff fe 40 calli 800fb70 8010274: b8 20 20 00 mv r4,r1 if (rc != RC_OK) 8010278: 44 20 00 0c be r1,r0,80102a8 <== ALWAYS TAKEN 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; } 801027c: b8 80 08 00 mv r1,r4 8010280: 2b 9d 00 04 lw ra,(sp+4) 8010284: 2b 8b 00 18 lw r11,(sp+24) 8010288: 2b 8c 00 14 lw r12,(sp+20) 801028c: 2b 8d 00 10 lw r13,(sp+16) 8010290: 2b 8e 00 0c lw r14,(sp+12) 8010294: 2b 8f 00 08 lw r15,(sp+8) 8010298: 37 9c 00 20 addi sp,sp,32 801029c: c3 a0 00 00 ret uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; if ( new_length >= fat_fd->fat_file_size ) return rc; 80102a0: 34 04 00 00 mvi r4,0 80102a4: e3 ff ff f6 bi 801027c rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; rc = fat_free_fat_clusters_chain(fs_info, cur_cln); 80102a8: 2b 82 00 20 lw r2,(sp+32) 80102ac: b9 80 08 00 mv r1,r12 80102b0: f8 00 25 89 calli 80198d4 80102b4: b8 20 20 00 mv r4,r1 if (rc != RC_OK) 80102b8: 5c 20 ff f1 bne r1,r0,801027c <== NEVER TAKEN return rc; if (cl_start != 0) 80102bc: 45 c1 ff f0 be r14,r1,801027c { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); 80102c0: 2b 82 00 1c lw r2,(sp+28) 80102c4: b9 80 08 00 mv r1,r12 80102c8: 34 03 ff ff mvi r3,-1 80102cc: f8 00 24 73 calli 8019498 80102d0: b8 20 20 00 mv r4,r1 if ( rc != RC_OK ) 80102d4: 5c 20 ff ea bne r1,r0,801027c <== NEVER TAKEN return rc; fat_fd->map.file_cln = cl_start - 1; fat_fd->map.disk_cln = new_last_cln; 80102d8: 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; 80102dc: 35 ce ff ff addi r14,r14,-1 80102e0: 59 ae 00 34 sw (r13+52),r14 fat_fd->map.disk_cln = new_last_cln; 80102e4: 59 a1 00 38 sw (r13+56),r1 fat_fd->map.last_cln = new_last_cln; 80102e8: 59 a1 00 3c sw (r13+60),r1 80102ec: e3 ff ff e4 bi 801027c if ( new_length >= fat_fd->fat_file_size ) return rc; assert(fat_fd->fat_file_size); 80102f0: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 80102f4: 78 03 08 02 mvhi r3,0x802 <== NOT EXECUTED 80102f8: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED 80102fc: 38 21 ef bc ori r1,r1,0xefbc <== NOT EXECUTED 8010300: 34 02 02 d1 mvi r2,721 <== NOT EXECUTED 8010304: 38 63 f0 1c ori r3,r3,0xf01c <== NOT EXECUTED 8010308: 38 84 f0 04 ori r4,r4,0xf004 <== NOT EXECUTED 801030c: f8 00 0a 6e calli 8012cc4 <__assert_func> <== NOT EXECUTED =============================================================================== 08010748 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 8010748: 37 9c ff b4 addi sp,sp,-76 801074c: 5b 8b 00 44 sw (sp+68),r11 8010750: 5b 8c 00 40 sw (sp+64),r12 8010754: 5b 8d 00 3c sw (sp+60),r13 8010758: 5b 8e 00 38 sw (sp+56),r14 801075c: 5b 8f 00 34 sw (sp+52),r15 8010760: 5b 90 00 30 sw (sp+48),r16 8010764: 5b 91 00 2c sw (sp+44),r17 8010768: 5b 92 00 28 sw (sp+40),r18 801076c: 5b 93 00 24 sw (sp+36),r19 8010770: 5b 94 00 20 sw (sp+32),r20 8010774: 5b 95 00 1c sw (sp+28),r21 8010778: 5b 96 00 18 sw (sp+24),r22 801077c: 5b 97 00 14 sw (sp+20),r23 8010780: 5b 98 00 10 sw (sp+16),r24 8010784: 5b 99 00 0c sw (sp+12),r25 8010788: 5b 9b 00 08 sw (sp+8),fp 801078c: 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; 8010790: 5b 80 00 4c sw (sp+76),r0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 8010794: b8 40 58 00 mv r11,r2 8010798: 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; 801079c: 28 55 00 34 lw r21,(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; 80107a0: 28 43 00 18 lw r3,(r2+24) fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 80107a4: b8 20 68 00 mv r13,r1 80107a8: b8 a0 a0 00 mv r20,r5 uint32_t file_cln_initial = fat_fd->map.file_cln; uint32_t cln; if ( count == 0 ) return cmpltd; 80107ac: 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 ) 80107b0: 44 80 00 07 be r4,r0,80107cc <== NEVER TAKEN return cmpltd; if (start >= fat_fd->size_limit) 80107b4: 29 6c 00 14 lw r12,(r11+20) 80107b8: 55 8e 00 19 bgu r12,r14,801081c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EFBIG); 80107bc: f8 00 2b 5a calli 801b524 <__errno> <== NOT EXECUTED 80107c0: 34 02 00 1b mvi r2,27 <== NOT EXECUTED 80107c4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 80107c8: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED } if (RC_OK != rc) return rc; else return cmpltd; } 80107cc: b8 40 08 00 mv r1,r2 80107d0: 2b 9d 00 04 lw ra,(sp+4) 80107d4: 2b 8b 00 44 lw r11,(sp+68) 80107d8: 2b 8c 00 40 lw r12,(sp+64) 80107dc: 2b 8d 00 3c lw r13,(sp+60) 80107e0: 2b 8e 00 38 lw r14,(sp+56) 80107e4: 2b 8f 00 34 lw r15,(sp+52) 80107e8: 2b 90 00 30 lw r16,(sp+48) 80107ec: 2b 91 00 2c lw r17,(sp+44) 80107f0: 2b 92 00 28 lw r18,(sp+40) 80107f4: 2b 93 00 24 lw r19,(sp+36) 80107f8: 2b 94 00 20 lw r20,(sp+32) 80107fc: 2b 95 00 1c lw r21,(sp+28) 8010800: 2b 96 00 18 lw r22,(sp+24) 8010804: 2b 97 00 14 lw r23,(sp+20) 8010808: 2b 98 00 10 lw r24,(sp+16) 801080c: 2b 99 00 0c lw r25,(sp+12) 8010810: 2b 9b 00 08 lw fp,(sp+8) 8010814: 37 9c 00 4c addi sp,sp,76 8010818: c3 a0 00 00 ret return cmpltd; if (start >= fat_fd->size_limit) rtems_set_errno_and_return_minus_one(EFBIG); if (count > fat_fd->size_limit - start) 801081c: c9 8e 60 00 sub r12,r12,r14 if ( count == 0 ) return cmpltd; if (start >= fat_fd->size_limit) rtems_set_errno_and_return_minus_one(EFBIG); 8010820: 50 8c 00 02 bgeu r4,r12,8010828 <== NEVER TAKEN 8010824: b8 80 60 00 mv r12,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); 8010828: b5 8e 78 00 add r15,r12,r14 801082c: f5 c3 18 00 cmpgu r3,r14,r3 8010830: b9 60 10 00 mv r2,r11 8010834: b9 a0 08 00 mv r1,r13 8010838: b9 e0 20 00 mv r4,r15 801083c: 37 85 00 4c addi r5,sp,76 8010840: fb ff ff 29 calli 80104e4 8010844: b8 20 10 00 mv r2,r1 if (RC_OK == rc) 8010848: 5c 20 ff e1 bne r1,r0,80107cc { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) 801084c: 2b 81 00 4c lw r1,(sp+76) 8010850: 45 e1 00 02 be r15,r1,8010858 <== ALWAYS TAKEN count = c - start; 8010854: c8 2e 60 00 sub r12,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)); 8010858: 29 63 00 20 lw r3,(r11+32) 801085c: 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)) 8010860: 41 a2 00 0e lbu r2,(r13+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)); 8010864: 44 61 00 4b be r3,r1,8010990 { 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; 8010868: 41 b0 00 08 lbu r16,(r13+8) 801086c: 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; 8010870: 5b 80 00 48 sw (sp+72),r0 uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; 8010874: ba 00 10 00 mv r2,r16 8010878: f8 00 75 2c calli 802dd28 <__lshrsi3> 801087c: b8 20 c8 00 mv r25,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); 8010880: 37 9b 00 48 addi fp,sp,72 8010884: b9 a0 08 00 mv r1,r13 8010888: b9 60 10 00 mv r2,r11 801088c: bb 20 18 00 mv r3,r25 8010890: bb 60 20 00 mv r4,fp 8010894: fb ff fc b7 calli 800fb70 8010898: b8 20 78 00 mv r15,r1 if (RC_OK == rc) 801089c: 5c 20 00 36 bne r1,r0,8010974 <== NEVER TAKEN 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); 80108a0: ba 00 10 00 mv r2,r16 80108a4: bb 20 08 00 mv r1,r25 80108a8: fb ff c2 2f calli 8001164 <__ashlsi3> 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; 80108ac: 29 62 00 1c lw r2,(r11+28) 80108b0: 2b 92 00 48 lw r18,(sp+72) 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); 80108b4: c9 c1 70 00 sub r14,r14,r1 80108b8: 7d 93 00 00 cmpnei r19,r12,0 80108bc: b9 c0 80 00 mv r16,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; 80108c0: ca 42 90 00 sub r18,r18,r2 80108c4: 34 0f 00 00 mvi r15,0 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; 80108c8: 34 17 00 00 mvi r23,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 */ 80108cc: 34 18 00 00 mvi r24,0 const uint32_t count, const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; 80108d0: 34 11 00 00 mvi r17,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) 80108d4: 65 f6 00 00 cmpei r22,r15,0 && (bytes_to_write > 0)) { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); if (file_cln_initial < file_cln_cnt) 80108d8: ba e0 30 00 mv r6,r23 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) 80108dc: a2 76 b0 00 and r22,r19,r22 80108e0: 46 c0 00 1c be r22,r0,8010950 && (bytes_to_write > 0)) { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); 80108e4: 2d a5 00 06 lhu r5,(r13+6) 80108e8: c8 b0 20 00 sub r4,r5,r16 80108ec: 51 84 00 02 bgeu r12,r4,80108f4 80108f0: b9 80 20 00 mv r4,r12 if (file_cln_initial < file_cln_cnt) 80108f4: 56 55 00 24 bgu r18,r21,8010984 overwrite_cluster = true; ret = fat_cluster_write(fs_info, 80108f8: 2b 82 00 48 lw r2,(sp+72) 80108fc: ba 00 18 00 mv r3,r16 8010900: b6 91 28 00 add r5,r20,r17 8010904: b9 a0 08 00 mv r1,r13 8010908: f8 00 02 3c calli 80111f8 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 801090c: 34 0f ff ff mvi r15,-1 8010910: 48 01 ff f1 bg r0,r1,80108d4 <== NEVER TAKEN rc = -1; if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; 8010914: c9 81 60 00 sub r12,r12,r1 cmpltd += ret; save_cln = cur_cln; 8010918: 2b 98 00 48 lw r24,(sp+72) if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; 801091c: b6 21 88 00 add r17,r17,r1 save_cln = cur_cln; if (0 < bytes_to_write) 8010920: 34 0f 00 00 mvi r15,0 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ofs_cln = 0; 8010924: 34 10 00 00 mvi r16,0 8010928: 34 13 00 00 mvi r19,0 if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 801092c: 36 52 00 01 addi r18,r18,1 bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) 8010930: 45 80 ff e9 be r12,r0,80108d4 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 8010934: b9 a0 08 00 mv r1,r13 8010938: bb 00 10 00 mv r2,r24 801093c: bb 60 18 00 mv r3,fp 8010940: f8 00 22 19 calli 80191a4 8010944: b8 20 78 00 mv r15,r1 8010948: 34 13 00 01 mvi r19,1 801094c: e3 ff ff e2 bi 80108d4 } /* 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); 8010950: 41 a2 00 08 lbu r2,(r13+8) 8010954: 35 ce ff ff addi r14,r14,-1 8010958: b5 d1 08 00 add r1,r14,r17 801095c: f8 00 74 f3 calli 802dd28 <__lshrsi3> } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 8010960: b4 39 08 00 add r1,r1,r25 8010964: 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; 8010968: 59 78 00 38 sw (r11+56),r24 } if (RC_OK != rc) 801096c: 5d f6 00 02 bne r15,r22,8010974 <== NEVER TAKEN return rc; else return cmpltd; 8010970: ba 20 78 00 mv r15,r17 start, count, buf, file_cln_initial); if (0 > ret) rc = -1; 8010974: 34 02 ff ff mvi r2,-1 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 8010978: 48 0f ff 95 bg r0,r15,80107cc <== NEVER TAKEN rc = -1; else cmpltd = ret; 801097c: b9 e0 10 00 mv r2,r15 8010980: e3 ff ff 93 bi 80107cc while ( (RC_OK == rc) && (bytes_to_write > 0)) { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); if (file_cln_initial < file_cln_cnt) 8010984: 34 06 00 01 mvi r6,1 overwrite_cluster = true; 8010988: 34 17 00 01 mvi r23,1 801098c: e3 ff ff db bi 80108f8 */ 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)); 8010990: 29 61 00 24 lw r1,(r11+36) 8010994: 5c 20 ff b5 bne r1,r0,8010868 <== NEVER TAKEN 8010998: 20 42 00 03 andi r2,r2,0x3 801099c: 44 41 ff b3 be r2,r1,8010868 /* 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); 80109a0: 41 a2 00 08 lbu r2,(r13+8) 80109a4: 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; 80109a8: 29 6b 00 1c lw r11,(r11+28) cln += (start >> fs_info->vol.bpc_log2); 80109ac: f8 00 74 df calli 802dd28 <__lshrsi3> byte = start & (fs_info->vol.bpc -1); 80109b0: 2d a3 00 06 lhu r3,(r13+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); 80109b4: b4 2b 10 00 add r2,r1,r11 byte = start & (fs_info->vol.bpc -1); ret = fat_cluster_write(fs_info, 80109b8: b9 80 20 00 mv r4,r12 /* 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); 80109bc: 34 63 ff ff addi r3,r3,-1 ret = fat_cluster_write(fs_info, 80109c0: b9 a0 08 00 mv r1,r13 80109c4: a1 c3 18 00 and r3,r14,r3 80109c8: ba 80 28 00 mv r5,r20 80109cc: 34 06 00 00 mvi r6,0 80109d0: f8 00 02 0a calli 80111f8 byte, count, buf, false); if (0 > ret) rc = -1; 80109d4: 34 02 ff ff mvi r2,-1 cln, byte, count, buf, false); if (0 > ret) 80109d8: 48 01 ff 7d bg r0,r1,80107cc <== NEVER TAKEN rc = -1; else cmpltd = ret; 80109dc: b8 20 10 00 mv r2,r1 80109e0: e3 ff ff 7b bi 80107cc =============================================================================== 080198d4 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 80198d4: 37 9c ff e0 addi sp,sp,-32 80198d8: 5b 8b 00 1c sw (sp+28),r11 80198dc: 5b 8c 00 18 sw (sp+24),r12 80198e0: 5b 8d 00 14 sw (sp+20),r13 80198e4: 5b 8e 00 10 sw (sp+16),r14 80198e8: 5b 8f 00 0c sw (sp+12),r15 80198ec: 5b 90 00 08 sw (sp+8),r16 80198f0: 5b 9d 00 04 sw (sp+4),ra 80198f4: b8 20 58 00 mv r11,r1 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) 80198f8: 28 21 00 10 lw r1,(r1+16) 80198fc: 29 63 00 14 lw r3,(r11+20) uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 8019900: 5b 80 00 20 sw (sp+32),r0 uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8019904: a0 41 08 00 and r1,r2,r1 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 8019908: b8 40 80 00 mv r16,r2 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) 801990c: 50 23 00 31 bgeu r1,r3,80199d0 <== NEVER TAKEN 8019910: b8 40 60 00 mv r12,r2 8019914: 34 0e 00 00 mvi r14,0 8019918: 34 0f 00 00 mvi r15,0 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 801991c: b9 80 10 00 mv r2,r12 8019920: 37 83 00 20 addi r3,sp,32 8019924: b9 60 08 00 mv r1,r11 8019928: fb ff fe 1f calli 80191a4 801992c: b8 20 68 00 mv r13,r1 fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 8019930: b9 80 10 00 mv r2,r12 8019934: b9 60 08 00 mv r1,r11 8019938: 34 03 00 00 mvi r3,0 uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); if ( rc != RC_OK ) 801993c: 5d a0 00 1d bne r13,r0,80199b0 <== NEVER TAKEN fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 8019940: fb ff fe d6 calli 8019498 if ( rc != RC_OK ) rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; 8019944: 2b 8c 00 20 lw r12,(sp+32) fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) 8019948: 44 2d 00 02 be r1,r13,8019950 <== ALWAYS TAKEN 801994c: b8 20 78 00 mv r15,r1 <== NOT EXECUTED 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) 8019950: 29 61 00 10 lw r1,(r11+16) 8019954: 29 63 00 14 lw r3,(r11+20) rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) rc1 = rc; freed_cls_cnt++; 8019958: 35 ce 00 01 addi r14,r14,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) 801995c: a1 81 08 00 and r1,r12,r1 8019960: 54 61 ff ef bgu r3,r1,801991c freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8019964: 29 61 00 44 lw r1,(r11+68) freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; 8019968: 59 70 00 4c sw (r11+76),r16 if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 801996c: 34 02 ff ff mvi r2,-1 8019970: 44 22 00 03 be r1,r2,801997c <== ALWAYS TAKEN fs_info->vol.free_cls += freed_cls_cnt; 8019974: b5 c1 08 00 add r1,r14,r1 <== NOT EXECUTED 8019978: 59 61 00 44 sw (r11+68),r1 <== NOT EXECUTED fat_buf_release(fs_info); 801997c: b9 60 08 00 mv r1,r11 8019980: fb ff dc 6f calli 8010b3c 8019984: b9 e0 68 00 mv r13,r15 if (rc1 != RC_OK) return rc1; return RC_OK; } 8019988: b9 a0 08 00 mv r1,r13 801998c: 2b 9d 00 04 lw ra,(sp+4) 8019990: 2b 8b 00 1c lw r11,(sp+28) 8019994: 2b 8c 00 18 lw r12,(sp+24) 8019998: 2b 8d 00 14 lw r13,(sp+20) 801999c: 2b 8e 00 10 lw r14,(sp+16) 80199a0: 2b 8f 00 0c lw r15,(sp+12) 80199a4: 2b 90 00 08 lw r16,(sp+8) 80199a8: 37 9c 00 20 addi sp,sp,32 80199ac: c3 a0 00 00 ret while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); if ( rc != RC_OK ) { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 80199b0: 29 61 00 44 lw r1,(r11+68) <== NOT EXECUTED 80199b4: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 80199b8: 44 22 00 03 be r1,r2,80199c4 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 80199bc: b5 c1 08 00 add r1,r14,r1 <== NOT EXECUTED 80199c0: 59 61 00 44 sw (r11+68),r1 <== NOT EXECUTED fat_buf_release(fs_info); 80199c4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 80199c8: fb ff dc 5d calli 8010b3c <== NOT EXECUTED return rc; 80199cc: e3 ff ff ef bi 8019988 <== NOT EXECUTED ) { int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; 80199d0: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; 80199d4: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED 80199d8: e3 ff ff e3 bi 8019964 <== NOT EXECUTED =============================================================================== 080122a8 : void fat_free_unique_ino( fat_fs_info_t *fs_info, uint32_t ino ) { 80122a8: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED 80122ac: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED 80122b0: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED FAT_SET_UNIQ_INO_FREE((ino - fs_info->uino_base), fs_info->uino); 80122b4: 28 23 00 80 lw r3,(r1+128) <== NOT EXECUTED 80122b8: 28 2b 00 74 lw r11,(r1+116) <== NOT EXECUTED 80122bc: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 80122c0: c8 43 10 00 sub r2,r2,r3 <== NOT EXECUTED 80122c4: 00 43 00 01 srui r3,r2,1 <== NOT EXECUTED 80122c8: 20 42 00 07 andi r2,r2,0x7 <== NOT EXECUTED 80122cc: 00 63 00 01 srui r3,r3,1 <== NOT EXECUTED 80122d0: 00 63 00 01 srui r3,r3,1 <== NOT EXECUTED 80122d4: b5 63 58 00 add r11,r11,r3 <== NOT EXECUTED 80122d8: fb ff bb a3 calli 8001164 <__ashlsi3> <== NOT EXECUTED 80122dc: 41 62 00 00 lbu r2,(r11+0) <== NOT EXECUTED 80122e0: a4 20 08 00 not r1,r1 <== NOT EXECUTED 80122e4: a0 22 08 00 and r1,r1,r2 <== NOT EXECUTED 80122e8: 31 61 00 00 sb (r11+0),r1 <== NOT EXECUTED } 80122ec: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80122f0: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 80122f4: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 80122f8: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080191a4 : fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 80191a4: 37 9c ff dc addi sp,sp,-36 80191a8: 5b 8b 00 20 sw (sp+32),r11 80191ac: 5b 8c 00 1c sw (sp+28),r12 80191b0: 5b 8d 00 18 sw (sp+24),r13 80191b4: 5b 8e 00 14 sw (sp+20),r14 80191b8: 5b 8f 00 10 sw (sp+16),r15 80191bc: 5b 90 00 0c sw (sp+12),r16 80191c0: 5b 91 00 08 sw (sp+8),r17 80191c4: 5b 9d 00 04 sw (sp+4),ra 80191c8: b8 20 58 00 mv r11,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)) ) 80191cc: 34 01 00 01 mvi r1,1 fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 80191d0: b8 40 60 00 mv r12,r2 80191d4: b8 60 78 00 mv r15,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)) ) 80191d8: 50 22 00 21 bgeu r1,r2,801925c <== NEVER TAKEN 80191dc: 29 61 00 38 lw r1,(r11+56) 80191e0: 34 21 00 01 addi r1,r1,1 80191e4: 50 22 00 02 bgeu r1,r2,80191ec <== ALWAYS TAKEN 80191e8: e0 00 00 1d bi 801925c <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 80191ec: 41 62 00 0e lbu r2,(r11+14) 80191f0: 20 41 00 01 andi r1,r2,0x1 80191f4: 5c 20 00 29 bne r1,r0,8019298 80191f8: 20 42 00 02 andi r2,r2,0x2 80191fc: 44 41 00 2f be r2,r1,80192b8 8019200: 41 62 00 02 lbu r2,(r11+2) 8019204: b5 8c 70 00 add r14,r12,r12 8019208: b9 c0 08 00 mv r1,r14 801920c: f8 00 52 c7 calli 802dd28 <__lshrsi3> 8019210: 29 70 00 58 lw r16,(r11+88) 8019214: 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); rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 8019218: b9 60 08 00 mv r1,r11 801921c: ba 00 10 00 mv r2,r16 8019220: 34 03 00 01 mvi r3,1 8019224: 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); 8019228: 2d 71 00 00 lhu r17,(r11+0) rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 801922c: fb ff de bf calli 8010d28 8019230: b8 20 68 00 mv r13,r1 if (rc != RC_OK) 8019234: 5c 20 00 0e bne r1,r0,801926c <== NEVER TAKEN return rc; switch ( fs_info->vol.type ) 8019238: 41 61 00 0e lbu r1,(r11+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); 801923c: 36 31 ff ff addi r17,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 ) 8019240: 34 02 00 02 mvi r2,2 if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 8019244: a1 d1 70 00 and r14,r14,r17 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 8019248: 44 22 00 24 be r1,r2,80192d8 801924c: 34 02 00 04 mvi r2,4 8019250: 44 22 00 53 be r1,r2,801939c 8019254: 34 02 00 01 mvi r2,1 8019258: 44 22 00 37 be r1,r2,8019334 <== ALWAYS TAKEN *ret_val = *((uint32_t *)(sec_buf + ofs)); *ret_val = CF_LE_L(*ret_val); break; default: rtems_set_errno_and_return_minus_one(EIO); 801925c: f8 00 08 b2 calli 801b524 <__errno> <== NOT EXECUTED 8019260: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8019264: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8019268: 34 0d ff ff mvi r13,-1 <== NOT EXECUTED break; } return RC_OK; } 801926c: b9 a0 08 00 mv r1,r13 8019270: 2b 9d 00 04 lw ra,(sp+4) 8019274: 2b 8b 00 20 lw r11,(sp+32) 8019278: 2b 8c 00 1c lw r12,(sp+28) 801927c: 2b 8d 00 18 lw r13,(sp+24) 8019280: 2b 8e 00 14 lw r14,(sp+20) 8019284: 2b 8f 00 10 lw r15,(sp+16) 8019288: 2b 90 00 0c lw r16,(sp+12) 801928c: 2b 91 00 08 lw r17,(sp+8) 8019290: 37 9c 00 24 addi sp,sp,36 8019294: c3 a0 00 00 ret /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 8019298: 01 8e 00 01 srui r14,r12,1 801929c: 41 62 00 02 lbu r2,(r11+2) 80192a0: b5 cc 70 00 add r14,r14,r12 80192a4: b9 c0 08 00 mv r1,r14 80192a8: f8 00 52 a0 calli 802dd28 <__lshrsi3> 80192ac: 29 70 00 58 lw r16,(r11+88) 80192b0: b4 30 80 00 add r16,r1,r16 80192b4: e3 ff ff d9 bi 8019218 80192b8: b5 8c 70 00 add r14,r12,r12 80192bc: 41 62 00 02 lbu r2,(r11+2) 80192c0: b5 ce 70 00 add r14,r14,r14 80192c4: b9 c0 08 00 mv r1,r14 80192c8: f8 00 52 98 calli 802dd28 <__lshrsi3> 80192cc: 29 70 00 58 lw r16,(r11+88) 80192d0: b4 30 80 00 add r16,r1,r16 80192d4: e3 ff ff d1 bi 8019218 else *ret_val = (*ret_val) & FAT_FAT12_MASK; break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 80192d8: 2b 81 00 24 lw r1,(sp+36) 80192dc: b4 2e 70 00 add r14,r1,r14 80192e0: 2d c2 00 00 lhu r2,(r14+0) * @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; 80192e4: 00 41 00 01 srui r1,r2,1 80192e8: b4 42 10 00 add r2,r2,r2 80192ec: 00 21 00 01 srui r1,r1,1 80192f0: b4 42 10 00 add r2,r2,r2 80192f4: 00 21 00 01 srui r1,r1,1 80192f8: b4 42 10 00 add r2,r2,r2 80192fc: 00 21 00 01 srui r1,r1,1 8019300: b4 42 10 00 add r2,r2,r2 8019304: 00 21 00 01 srui r1,r1,1 8019308: b4 42 10 00 add r2,r2,r2 801930c: 00 21 00 01 srui r1,r1,1 8019310: b4 42 10 00 add r2,r2,r2 8019314: 00 21 00 01 srui r1,r1,1 8019318: b4 42 10 00 add r2,r2,r2 801931c: 00 21 00 01 srui r1,r1,1 8019320: b4 42 10 00 add r2,r2,r2 8019324: b8 41 08 00 or r1,r2,r1 *ret_val = CF_LE_W(*ret_val); 8019328: 20 21 ff ff andi r1,r1,0xffff 801932c: 59 e1 00 00 sw (r15+0),r1 break; 8019330: e3 ff ff cf bi 801926c case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 8019334: 2b 82 00 24 lw r2,(sp+36) if ( ofs == (fs_info->vol.bps - 1) ) 8019338: 2d 63 00 00 lhu r3,(r11+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)); 801933c: b4 4e 10 00 add r2,r2,r14 8019340: 40 41 00 00 lbu r1,(r2+0) if ( ofs == (fs_info->vol.bps - 1) ) 8019344: 34 63 ff ff addi r3,r3,-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)); 8019348: 59 e1 00 00 sw (r15+0),r1 if ( ofs == (fs_info->vol.bps - 1) ) 801934c: 44 6e 00 3d be r3,r14,8019440 <== NEVER TAKEN *ret_val |= *sec_buf << 8; } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 8019350: 40 42 00 01 lbu r2,(r2+1) 8019354: b4 42 10 00 add r2,r2,r2 8019358: b4 42 10 00 add r2,r2,r2 801935c: b4 42 10 00 add r2,r2,r2 8019360: b4 42 10 00 add r2,r2,r2 8019364: b4 42 10 00 add r2,r2,r2 8019368: b4 42 10 00 add r2,r2,r2 801936c: b4 42 10 00 add r2,r2,r2 8019370: b4 42 10 00 add r2,r2,r2 8019374: b8 41 10 00 or r2,r2,r1 8019378: 59 e2 00 00 sw (r15+0),r2 } if ( FAT_CLUSTER_IS_ODD(cln) ) 801937c: 21 8c 00 01 andi r12,r12,0x1 8019380: 45 80 00 2d be r12,r0,8019434 *ret_val = (*ret_val) >> FAT12_SHIFT; 8019384: 00 42 00 01 srui r2,r2,1 8019388: 00 42 00 01 srui r2,r2,1 801938c: 00 42 00 01 srui r2,r2,1 8019390: 00 42 00 01 srui r2,r2,1 8019394: 59 e2 00 00 sw (r15+0),r2 8019398: e3 ff ff b5 bi 801926c *ret_val = *((uint16_t *)(sec_buf + ofs)); *ret_val = CF_LE_W(*ret_val); break; case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); 801939c: 2b 81 00 24 lw r1,(sp+36) byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 80193a0: 34 02 00 18 mvi r2,24 80193a4: b4 2e 70 00 add r14,r1,r14 80193a8: 29 cb 00 00 lw r11,(r14+0) 80193ac: 21 61 00 ff andi r1,r11,0xff 80193b0: fb ff 9f 6d calli 8001164 <__ashlsi3> 80193b4: b8 20 60 00 mv r12,r1 uint32_t value ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; 80193b8: 34 02 00 18 mvi r2,24 80193bc: b9 60 08 00 mv r1,r11 80193c0: f8 00 52 5a calli 802dd28 <__lshrsi3> byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 80193c4: 01 64 00 01 srui r4,r11,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 80193c8: b9 81 60 00 or r12,r12,r1 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 80193cc: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 80193d0: 34 02 00 10 mvi r2,16 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 80193d4: 00 84 00 01 srui r4,r4,1 80193d8: 00 84 00 01 srui r4,r4,1 80193dc: 00 84 00 01 srui r4,r4,1 80193e0: 00 84 00 01 srui r4,r4,1 80193e4: 00 84 00 01 srui r4,r4,1 80193e8: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 80193ec: 20 81 00 ff andi r1,r4,0xff 80193f0: fb ff 9f 5d calli 8001164 <__ashlsi3> 80193f4: b9 81 60 00 or r12,r12,r1 ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; 80193f8: 34 02 00 10 mvi r2,16 80193fc: b9 60 08 00 mv r1,r11 8019400: f8 00 52 4a calli 802dd28 <__lshrsi3> 8019404: 20 22 00 ff andi r2,r1,0xff byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8019408: b4 42 10 00 add r2,r2,r2 801940c: b4 42 10 00 add r2,r2,r2 8019410: b4 42 10 00 add r2,r2,r2 8019414: b4 42 10 00 add r2,r2,r2 8019418: b4 42 10 00 add r2,r2,r2 801941c: b4 42 10 00 add r2,r2,r2 8019420: b4 42 10 00 add r2,r2,r2 8019424: b4 42 10 00 add r2,r2,r2 8019428: b9 82 10 00 or r2,r12,r2 *ret_val = CF_LE_L(*ret_val); 801942c: 59 e2 00 00 sw (r15+0),r2 break; 8019430: e3 ff ff 8f bi 801926c } if ( FAT_CLUSTER_IS_ODD(cln) ) *ret_val = (*ret_val) >> FAT12_SHIFT; else *ret_val = (*ret_val) & FAT_FAT12_MASK; 8019434: 20 42 0f ff andi r2,r2,0xfff 8019438: 59 e2 00 00 sw (r15+0),r2 801943c: e3 ff ff 8c bi 801926c * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 8019440: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8019444: 36 02 00 01 addi r2,r16,1 <== NOT EXECUTED 8019448: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 801944c: 37 84 00 24 addi r4,sp,36 <== NOT EXECUTED 8019450: fb ff de 36 calli 8010d28 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 8019454: 5c 20 00 0f bne r1,r0,8019490 <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; 8019458: 2b 81 00 24 lw r1,(sp+36) <== NOT EXECUTED 801945c: 29 e2 00 00 lw r2,(r15+0) <== NOT EXECUTED 8019460: 40 21 00 00 lbu r1,(r1+0) <== NOT EXECUTED 8019464: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 8019468: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 801946c: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 8019470: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 8019474: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 8019478: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 801947c: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 8019480: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 8019484: b8 22 10 00 or r2,r1,r2 <== NOT EXECUTED 8019488: 59 e2 00 00 sw (r15+0),r2 <== NOT EXECUTED 801948c: e3 ff ff bc bi 801937c <== 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) 8019490: b8 20 68 00 mv r13,r1 <== NOT EXECUTED 8019494: e3 ff ff 76 bi 801926c <== NOT EXECUTED =============================================================================== 0801215c : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 801215c: 37 9c ff d8 addi sp,sp,-40 <== NOT EXECUTED 8012160: 5b 8b 00 28 sw (sp+40),r11 <== NOT EXECUTED 8012164: 5b 8c 00 24 sw (sp+36),r12 <== NOT EXECUTED 8012168: 5b 8d 00 20 sw (sp+32),r13 <== NOT EXECUTED 801216c: 5b 8e 00 1c sw (sp+28),r14 <== NOT EXECUTED 8012170: 5b 8f 00 18 sw (sp+24),r15 <== NOT EXECUTED 8012174: 5b 90 00 14 sw (sp+20),r16 <== NOT EXECUTED 8012178: 5b 91 00 10 sw (sp+16),r17 <== NOT EXECUTED 801217c: 5b 92 00 0c sw (sp+12),r18 <== NOT EXECUTED 8012180: 5b 93 00 08 sw (sp+8),r19 <== NOT EXECUTED 8012184: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 8012188: b8 20 60 00 mv r12,r1 <== NOT EXECUTED 801218c: 28 2e 00 7c lw r14,(r1+124) <== 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)) 8012190: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 8012194: 38 21 f0 30 ori r1,r1,0xf030 <== NOT EXECUTED 8012198: 28 33 00 00 lw r19,(r1+0) <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 801219c: 45 c0 00 15 be r14,r0,80121f0 <== NOT EXECUTED { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 80121a0: 29 8b 00 78 lw r11,(r12+120) <== NOT EXECUTED 80121a4: 29 92 00 74 lw r18,(r12+116) <== NOT EXECUTED 80121a8: 01 6f 00 01 srui r15,r11,1 <== NOT EXECUTED 80121ac: 21 71 00 07 andi r17,r11,0x7 <== NOT EXECUTED 80121b0: 01 ef 00 01 srui r15,r15,1 <== NOT EXECUTED 80121b4: ba 20 10 00 mv r2,r17 <== NOT EXECUTED 80121b8: 01 ef 00 01 srui r15,r15,1 <== NOT EXECUTED 80121bc: b6 4f 78 00 add r15,r18,r15 <== NOT EXECUTED 80121c0: 41 f0 00 00 lbu r16,(r15+0) <== NOT EXECUTED 80121c4: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 80121c8: fb ff bc 0e calli 8001200 <__ashrsi3> <== NOT EXECUTED 80121cc: 20 21 00 01 andi r1,r1,0x1 <== NOT EXECUTED 80121d0: 44 20 00 1f be r1,r0,801224c <== NOT EXECUTED 80121d4: 34 0d 00 00 mvi r13,0 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); return (fs_info->uino_base + fs_info->index); } fs_info->index++; 80121d8: 35 6b 00 01 addi r11,r11,1 <== NOT EXECUTED 80121dc: 59 8b 00 78 sw (r12+120),r11 <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 80121e0: 35 ad 00 01 addi r13,r13,1 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); return (fs_info->uino_base + fs_info->index); } fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) 80121e4: 55 cb 00 02 bgu r14,r11,80121ec <== NOT EXECUTED fs_info->index = 0; 80121e8: 59 80 00 78 sw (r12+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++) 80121ec: 55 cd 00 0c bgu r14,r13,801221c <== 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)) 80121f0: 29 81 00 80 lw r1,(r12+128) <== NOT EXECUTED 80121f4: b5 ce 10 00 add r2,r14,r14 <== NOT EXECUTED 80121f8: ca 61 08 00 sub r1,r19,r1 <== NOT EXECUTED 80121fc: 50 41 00 06 bgeu r2,r1,8012214 <== NOT EXECUTED { fs_info->uino_pool_size <<= 1; fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); 8012200: 29 81 00 74 lw r1,(r12+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; 8012204: 59 82 00 7c sw (r12+124),r2 <== NOT EXECUTED fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); 8012208: fb ff c8 4e calli 8004340 <== NOT EXECUTED 801220c: 59 81 00 74 sw (r12+116),r1 <== NOT EXECUTED if (fs_info->uino != NULL) 8012210: 5c 20 00 23 bne r1,r0,801229c <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 8012214: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8012218: e0 00 00 15 bi 801226c <== NOT EXECUTED while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 801221c: 29 8b 00 78 lw r11,(r12+120) <== NOT EXECUTED 8012220: 01 63 00 01 srui r3,r11,1 <== NOT EXECUTED 8012224: 21 71 00 07 andi r17,r11,0x7 <== NOT EXECUTED 8012228: 00 63 00 01 srui r3,r3,1 <== NOT EXECUTED 801222c: ba 20 10 00 mv r2,r17 <== NOT EXECUTED 8012230: 00 63 00 01 srui r3,r3,1 <== NOT EXECUTED 8012234: b6 43 78 00 add r15,r18,r3 <== NOT EXECUTED 8012238: 41 f0 00 00 lbu r16,(r15+0) <== NOT EXECUTED 801223c: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 8012240: fb ff bb f0 calli 8001200 <__ashrsi3> <== NOT EXECUTED 8012244: 20 21 00 01 andi r1,r1,0x1 <== NOT EXECUTED 8012248: 5c 20 ff e4 bne r1,r0,80121d8 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); 801224c: ba 20 10 00 mv r2,r17 <== NOT EXECUTED 8012250: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8012254: fb ff bb c4 calli 8001164 <__ashlsi3> <== NOT EXECUTED 8012258: b8 30 08 00 or r1,r1,r16 <== NOT EXECUTED 801225c: 31 e1 00 00 sb (r15+0),r1 <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 8012260: 29 82 00 78 lw r2,(r12+120) <== NOT EXECUTED 8012264: 29 81 00 80 lw r1,(r12+128) <== NOT EXECUTED 8012268: b4 41 08 00 add r1,r2,r1 <== NOT EXECUTED } else resrc_unsuff = true; } return 0; } 801226c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8012270: 2b 8b 00 28 lw r11,(sp+40) <== NOT EXECUTED 8012274: 2b 8c 00 24 lw r12,(sp+36) <== NOT EXECUTED 8012278: 2b 8d 00 20 lw r13,(sp+32) <== NOT EXECUTED 801227c: 2b 8e 00 1c lw r14,(sp+28) <== NOT EXECUTED 8012280: 2b 8f 00 18 lw r15,(sp+24) <== NOT EXECUTED 8012284: 2b 90 00 14 lw r16,(sp+20) <== NOT EXECUTED 8012288: 2b 91 00 10 lw r17,(sp+16) <== NOT EXECUTED 801228c: 2b 92 00 0c lw r18,(sp+12) <== NOT EXECUTED 8012290: 2b 93 00 08 lw r19,(sp+8) <== NOT EXECUTED 8012294: 37 9c 00 28 addi sp,sp,40 <== NOT EXECUTED 8012298: c3 a0 00 00 ret <== NOT EXECUTED if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) { fs_info->uino_pool_size <<= 1; fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); if (fs_info->uino != NULL) fs_info->index = fs_info->uino_pool_size; 801229c: 29 8e 00 7c lw r14,(r12+124) <== NOT EXECUTED 80122a0: 59 8e 00 78 sw (r12+120),r14 <== NOT EXECUTED 80122a4: e3 ff ff be bi 801219c <== NOT EXECUTED =============================================================================== 080120d0 : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 80120d0: 37 9c ff f4 addi sp,sp,-12 80120d4: 5b 8b 00 08 sw (sp+8),r11 80120d8: 5b 9d 00 04 sw (sp+4),ra 80120dc: b8 40 20 00 mv r4,r2 80120e0: b8 20 58 00 mv r11,r1 int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 80120e4: 5b 82 00 0c sw (sp+12),r2 while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 80120e8: 29 67 00 10 lw r7,(r11+16) 80120ec: 29 66 00 14 lw r6,(r11+20) { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 80120f0: b8 80 10 00 mv r2,r4 { int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 80120f4: a0 87 20 00 and r4,r4,r7 { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 80120f8: 34 03 00 00 mvi r3,0 80120fc: 34 05 00 00 mvi r5,0 8012100: b9 60 08 00 mv r1,r11 { 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) 8012104: 54 c4 00 06 bgu r6,r4,801211c return rc; } } return rc; 8012108: 34 01 00 00 mvi r1,0 } 801210c: 2b 9d 00 04 lw ra,(sp+4) 8012110: 2b 8b 00 08 lw r11,(sp+8) 8012114: 37 9c 00 0c addi sp,sp,12 8012118: c3 a0 00 00 ret ssize_t ret = 0; uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 801211c: 2d 64 00 06 lhu r4,(r11+6) 8012120: fb ff fb bc calli 8011010 if ( ret != fs_info->vol.bpc ) 8012124: 2d 62 00 06 lhu r2,(r11+6) { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 8012128: 37 83 00 0c addi r3,sp,12 uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); if ( ret != fs_info->vol.bpc ) 801212c: 5c 41 00 07 bne r2,r1,8012148 <== NEVER TAKEN { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 8012130: 2b 82 00 0c lw r2,(sp+12) 8012134: b9 60 08 00 mv r1,r11 8012138: f8 00 1c 1b calli 80191a4 if ( rc != RC_OK ) 801213c: 5c 20 ff f4 bne r1,r0,801210c <== NEVER TAKEN 8012140: 2b 84 00 0c lw r4,(sp+12) 8012144: e3 ff ff e9 bi 80120e8 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; 8012148: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED } } return rc; } 801214c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8012150: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8012154: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 8012158: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080113f0 : * 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) { 80113f0: 37 9c ff 2c addi sp,sp,-212 80113f4: 5b 8b 00 44 sw (sp+68),r11 80113f8: 5b 8c 00 40 sw (sp+64),r12 80113fc: 5b 8d 00 3c sw (sp+60),r13 8011400: 5b 8e 00 38 sw (sp+56),r14 8011404: 5b 8f 00 34 sw (sp+52),r15 8011408: 5b 90 00 30 sw (sp+48),r16 801140c: 5b 91 00 2c sw (sp+44),r17 8011410: 5b 92 00 28 sw (sp+40),r18 8011414: 5b 93 00 24 sw (sp+36),r19 8011418: 5b 94 00 20 sw (sp+32),r20 801141c: 5b 95 00 1c sw (sp+28),r21 8011420: 5b 96 00 18 sw (sp+24),r22 8011424: 5b 97 00 14 sw (sp+20),r23 8011428: 5b 98 00 10 sw (sp+16),r24 801142c: 5b 99 00 0c sw (sp+12),r25 8011430: 5b 9b 00 08 sw (sp+8),fp 8011434: 5b 9d 00 04 sw (sp+4),ra 8011438: b8 20 70 00 mv r14,r1 ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; vol->fd = open(device, O_RDWR); 801143c: b8 40 08 00 mv r1,r2 8011440: 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; 8011444: 5b 80 00 d4 sw (sp+212),r0 vol->fd = open(device, O_RDWR); 8011448: fb ff ca f9 calli 800402c 801144c: 59 c1 00 60 sw (r14+96),r1 if (vol->fd < 0) 8011450: 4c 20 00 19 bge r1,r0,80114b4 <== ALWAYS TAKEN rc = fstat(vol->fd, &stat_buf); if (rc != 0) { close(vol->fd); rtems_set_errno_and_return_minus_one(ENXIO); 8011454: f8 00 28 34 calli 801b524 <__errno> <== NOT EXECUTED 8011458: 34 02 00 06 mvi r2,6 <== NOT EXECUTED 801145c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8011460: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED vol->sectors_per_block = vol->spc; } } return RC_OK; } 8011464: b8 40 08 00 mv r1,r2 8011468: 2b 9d 00 04 lw ra,(sp+4) 801146c: 2b 8b 00 44 lw r11,(sp+68) 8011470: 2b 8c 00 40 lw r12,(sp+64) 8011474: 2b 8d 00 3c lw r13,(sp+60) 8011478: 2b 8e 00 38 lw r14,(sp+56) 801147c: 2b 8f 00 34 lw r15,(sp+52) 8011480: 2b 90 00 30 lw r16,(sp+48) 8011484: 2b 91 00 2c lw r17,(sp+44) 8011488: 2b 92 00 28 lw r18,(sp+40) 801148c: 2b 93 00 24 lw r19,(sp+36) 8011490: 2b 94 00 20 lw r20,(sp+32) 8011494: 2b 95 00 1c lw r21,(sp+28) 8011498: 2b 96 00 18 lw r22,(sp+24) 801149c: 2b 97 00 14 lw r23,(sp+20) 80114a0: 2b 98 00 10 lw r24,(sp+16) 80114a4: 2b 99 00 0c lw r25,(sp+12) 80114a8: 2b 9b 00 08 lw fp,(sp+8) 80114ac: 37 9c 00 d4 addi sp,sp,212 80114b0: c3 a0 00 00 ret if (vol->fd < 0) { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); 80114b4: 37 82 00 80 addi r2,sp,128 80114b8: fb ff c7 12 calli 8003100 if (rc != 0) 80114bc: 5c 20 02 2c bne r1,r0,8011d6c <== NEVER TAKEN close(vol->fd); rtems_set_errno_and_return_minus_one(ENXIO); } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) 80114c0: 2b 83 00 8c lw r3,(sp+140) 80114c4: 34 02 60 00 mvi r2,24576 80114c8: 20 63 f0 00 andi r3,r3,0xf000 80114cc: 5c 62 02 15 bne r3,r2,8011d20 <== 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); 80114d0: 78 03 08 02 mvhi r3,0x802 80114d4: 38 63 ef 34 ori r3,r3,0xef34 80114d8: 28 62 00 00 lw r2,(r3+0) 80114dc: 29 c1 00 60 lw r1,(r14+96) 80114e0: 35 c3 00 64 addi r3,r14,100 80114e4: f8 00 06 ba calli 8012fcc 80114e8: 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) { 80114ec: 5c 20 02 0d bne r1,r0,8011d20 <== 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); 80114f0: 29 c1 00 64 lw r1,(r14+100) 80114f4: 34 02 00 00 mvi r2,0 80114f8: 37 83 00 d4 addi r3,sp,212 80114fc: fb ff f4 0f calli 800e538 8011500: b8 20 68 00 mv r13,r1 if (sc != RTEMS_SUCCESSFUL) 8011504: 5c 2b 02 10 bne r1,r11,8011d44 <== NEVER TAKEN { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 8011508: 2b 82 00 d4 lw r2,(sp+212) 801150c: 28 45 00 1c lw r5,(r2+28) sc = rtems_bdbuf_release( block); 8011510: b8 40 08 00 mv r1,r2 { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 8011514: 40 a4 00 20 lbu r4,(r5+32) 8011518: 40 b1 00 0b lbu r17,(r5+11) 801151c: 40 af 00 0c lbu r15,(r5+12) 8011520: 40 b2 00 0d lbu r18,(r5+13) 8011524: 40 b0 00 0e lbu r16,(r5+14) 8011528: 40 b4 00 0f lbu r20,(r5+15) 801152c: 40 b7 00 10 lbu r23,(r5+16) 8011530: 40 b8 00 11 lbu r24,(r5+17) 8011534: 40 b3 00 12 lbu r19,(r5+18) 8011538: 40 b9 00 13 lbu r25,(r5+19) 801153c: 40 b5 00 14 lbu r21,(r5+20) 8011540: 40 bb 00 16 lbu fp,(r5+22) 8011544: 40 b6 00 17 lbu r22,(r5+23) 8011548: 5b 84 00 54 sw (sp+84),r4 801154c: 40 a2 00 22 lbu r2,(r5+34) 8011550: 40 ab 00 21 lbu r11,(r5+33) 8011554: 5b 82 00 58 sw (sp+88),r2 8011558: 40 a3 00 23 lbu r3,(r5+35) 801155c: 5b 83 00 5c sw (sp+92),r3 8011560: 40 a4 00 24 lbu r4,(r5+36) 8011564: 5b 84 00 60 sw (sp+96),r4 8011568: 40 a2 00 26 lbu r2,(r5+38) 801156c: 40 ac 00 25 lbu r12,(r5+37) 8011570: 5b 82 00 4c sw (sp+76),r2 8011574: 40 a3 00 27 lbu r3,(r5+39) 8011578: 5b 83 00 50 sw (sp+80),r3 801157c: 40 a4 00 28 lbu r4,(r5+40) 8011580: 5b 84 00 7c sw (sp+124),r4 8011584: 40 a2 00 29 lbu r2,(r5+41) 8011588: 5b 82 00 68 sw (sp+104),r2 801158c: 40 a3 00 2c lbu r3,(r5+44) 8011590: 5b 83 00 78 sw (sp+120),r3 8011594: 40 a4 00 2d lbu r4,(r5+45) 8011598: 5b 84 00 64 sw (sp+100),r4 801159c: 40 a2 00 2e lbu r2,(r5+46) 80115a0: 5b 82 00 74 sw (sp+116),r2 80115a4: 40 a3 00 2f lbu r3,(r5+47) 80115a8: 5b 83 00 70 sw (sp+112),r3 80115ac: 40 a4 00 30 lbu r4,(r5+48) 80115b0: 5b 84 00 6c sw (sp+108),r4 80115b4: 40 a5 00 31 lbu r5,(r5+49) 80115b8: 5b 85 00 48 sw (sp+72),r5 sc = rtems_bdbuf_release( block); 80115bc: fb ff f4 70 calli 800e77c if (sc != RTEMS_SUCCESSFUL) 80115c0: 5c 2d 01 e1 bne r1,r13,8011d44 <== NEVER TAKEN close(vol->fd); rtems_set_errno_and_return_minus_one( EIO ); } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 80115c4: b5 ef 30 00 add r6,r15,r15 80115c8: b4 c6 30 00 add r6,r6,r6 80115cc: b4 c6 30 00 add r6,r6,r6 80115d0: b4 c6 30 00 add r6,r6,r6 80115d4: b4 c6 30 00 add r6,r6,r6 80115d8: b4 c6 30 00 add r6,r6,r6 80115dc: b4 c6 30 00 add r6,r6,r6 80115e0: b4 c6 30 00 add r6,r6,r6 80115e4: b8 d1 88 00 or r17,r6,r17 if ( (vol->bps != 512) && 80115e8: 7e 28 04 00 cmpnei r8,r17,1024 80115ec: 7e 27 02 00 cmpnei r7,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); 80115f0: 0d d1 00 00 sh (r14+0),r17 if ( (vol->bps != 512) && 80115f4: a1 07 68 00 and r13,r8,r7 80115f8: 45 a1 00 41 be r13,r1,80116fc <== ALWAYS TAKEN (vol->bps != 1024) && 80115fc: 34 08 08 00 mvi r8,2048 <== NOT EXECUTED 8011600: 46 28 00 03 be r17,r8,801160c <== NOT EXECUTED (vol->bps != 2048) && 8011604: 34 08 10 00 mvi r8,4096 <== NOT EXECUTED 8011608: 5e 28 00 36 bne r17,r8,80116e0 <== 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; 801160c: 31 c0 00 03 sb (r14+3),r0 <== NOT EXECUTED 8011610: ba 20 08 00 mv r1,r17 <== NOT EXECUTED 8011614: 34 02 00 09 mvi r2,9 <== NOT EXECUTED 8011618: f8 00 71 c4 calli 802dd28 <__lshrsi3> <== NOT EXECUTED 801161c: 20 27 ff ff andi r7,r1,0xffff <== NOT EXECUTED 8011620: 41 c6 00 03 lbu r6,(r14+3) <== NOT EXECUTED i >>= 1, vol->sec_mul++); 8011624: 14 e7 00 01 sri r7,r7,1 <== NOT EXECUTED 8011628: 34 c6 00 01 addi r6,r6,1 <== NOT EXECUTED (vol->bps != 4096)) { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; 801162c: 20 e1 00 01 andi r1,r7,0x1 <== NOT EXECUTED i >>= 1, vol->sec_mul++); 8011630: 20 c6 00 ff andi r6,r6,0xff <== NOT EXECUTED (vol->bps != 4096)) { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; 8011634: 44 20 ff fc be r1,r0,8011624 <== NOT EXECUTED 8011638: 31 c6 00 03 sb (r14+3),r6 <== NOT EXECUTED i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 801163c: 31 c0 00 02 sb (r14+2),r0 8011640: 22 28 00 01 andi r8,r17,0x1 8011644: 34 0f 00 00 mvi r15,0 8011648: 5d 00 00 0b bne r8,r0,8011674 <== NEVER TAKEN 801164c: ba 20 38 00 mv r7,r17 8011650: 34 0f 00 01 mvi r15,1 8011654: e0 00 00 02 bi 801165c 8011658: b8 40 78 00 mv r15,r2 i >>= 1, vol->sec_log2++); 801165c: 14 e7 00 01 sri r7,r7,1 8011660: 35 e2 00 01 addi r2,r15,1 close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 8011664: 20 e1 00 01 andi r1,r7,0x1 i >>= 1, vol->sec_log2++); 8011668: 20 42 00 ff andi r2,r2,0xff close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 801166c: 44 20 ff fb be r1,r0,8011658 8011670: 31 cf 00 02 sb (r14+2),r15 i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; vol->bytes_per_block_log2 = vol->sec_log2; vol->sectors_per_block = 1; 8011674: 34 06 00 01 mvi r6,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; 8011678: 0d d1 00 0a sh (r14+10),r17 vol->bytes_per_block_log2 = vol->sec_log2; 801167c: 31 cf 00 0c sb (r14+12),r15 vol->sectors_per_block = 1; 8011680: 31 c6 00 09 sb (r14+9),r6 vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); 8011684: 31 d2 00 04 sb (r14+4),r18 /* * "sectors per cluster" of zero is invalid * (and would hang the following loop) */ if (vol->spc == 0) 8011688: 46 40 00 16 be r18,r0,80116e0 <== NEVER TAKEN { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 801168c: 31 c0 00 05 sb (r14+5),r0 8011690: 22 49 00 01 andi r9,r18,0x1 8011694: ba 40 40 00 mv r8,r18 8011698: 34 07 00 00 mvi r7,0 801169c: 5d 20 00 0a bne r9,r0,80116c4 80116a0: 34 07 00 01 mvi r7,1 80116a4: e0 00 00 02 bi 80116ac 80116a8: b8 40 38 00 mv r7,r2 i >>= 1, vol->spc_log2++); 80116ac: 15 08 00 01 sri r8,r8,1 80116b0: 34 e2 00 01 addi r2,r7,1 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 80116b4: 21 01 00 01 andi r1,r8,0x1 i >>= 1, vol->spc_log2++); 80116b8: 20 42 00 ff andi r2,r2,0xff { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 80116bc: 44 20 ff fb be r1,r0,80116a8 80116c0: 31 c7 00 05 sb (r14+5),r7 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) 80116c4: ba 20 08 00 mv r1,r17 80116c8: b8 e0 10 00 mv r2,r7 80116cc: fb ff be a6 calli 8001164 <__ashlsi3> 80116d0: 20 28 ff ff andi r8,r1,0xffff 80116d4: 0d c8 00 06 sh (r14+6),r8 80116d8: 38 06 80 00 mvu r6,0x8000 80116dc: 50 c8 00 10 bgeu r6,r8,801171c <== ALWAYS TAKEN if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(fs_info); close(vol->fd); 80116e0: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 80116e4: fb ff c6 2a calli 8002f8c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 80116e8: f8 00 27 8f calli 801b524 <__errno> <== NOT EXECUTED 80116ec: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 80116f0: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 80116f4: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 80116f8: e3 ff ff 5b bi 8011464 <== 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; 80116fc: 31 c0 00 03 sb (r14+3),r0 8011700: ba 20 08 00 mv r1,r17 8011704: 34 02 00 09 mvi r2,9 8011708: f8 00 71 88 calli 802dd28 <__lshrsi3> 801170c: 20 27 ff ff andi r7,r1,0xffff 8011710: 20 e8 00 01 andi r8,r7,0x1 8011714: 45 0d ff c3 be r8,r13,8011620 <== NEVER TAKEN 8011718: e3 ff ff c9 bi 801163c { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 801171c: 31 c0 00 08 sb (r14+8),r0 8011720: 21 06 00 01 andi r6,r8,0x1 8011724: 34 07 00 01 mvi r7,1 8011728: 44 c0 00 03 be r6,r0,8011734 <== ALWAYS TAKEN 801172c: e0 00 00 08 bi 801174c <== NOT EXECUTED 8011730: b8 40 38 00 mv r7,r2 i >>= 1, vol->bpc_log2++); 8011734: 15 08 00 01 sri r8,r8,1 8011738: 34 e2 00 01 addi r2,r7,1 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 801173c: 21 01 00 01 andi r1,r8,0x1 i >>= 1, vol->bpc_log2++); 8011740: 20 42 00 ff andi r2,r2,0xff { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 8011744: 44 20 ff fb be r1,r0,8011730 8011748: 31 c7 00 08 sb (r14+8),r7 i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 801174c: b6 73 38 00 add r7,r19,r19 8011750: b4 e7 38 00 add r7,r7,r7 8011754: b4 e7 38 00 add r7,r7,r7 8011758: b4 e7 38 00 add r7,r7,r7 801175c: b4 e7 38 00 add r7,r7,r7 8011760: b4 e7 38 00 add r7,r7,r7 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); 8011764: b6 94 28 00 add r5,r20,r20 8011768: b4 a5 28 00 add r5,r5,r5 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 801176c: b4 e7 38 00 add r7,r7,r7 8011770: b4 e7 38 00 add r7,r7,r7 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); 8011774: b4 a5 28 00 add r5,r5,r5 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 8011778: b8 f8 48 00 or r9,r7,r24 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); 801177c: b4 a5 28 00 add r5,r5,r5 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)) / 8011780: b5 29 38 00 add r7,r9,r9 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); 8011784: b4 a5 28 00 add r5,r5,r5 8011788: b4 a5 28 00 add r5,r5,r5 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)) / 801178c: b4 e7 38 00 add r7,r7,r7 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); 8011790: b4 a5 28 00 add r5,r5,r5 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)) / 8011794: b4 e7 38 00 add r7,r7,r7 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); 8011798: b4 a5 28 00 add r5,r5,r5 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)) / 801179c: b4 e7 38 00 add r7,r7,r7 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); 80117a0: b8 b0 80 00 or r16,r5,r16 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)) / 80117a4: b4 e7 38 00 add r7,r7,r7 80117a8: 36 28 ff ff addi r8,r17,-1 i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 80117ac: 0d c9 00 24 sh (r14+36),r9 /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 80117b0: b5 07 08 00 add r1,r8,r7 80117b4: ba 20 10 00 mv r2,r17 } 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); 80117b8: 31 d7 00 0d sb (r14+13),r23 vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 80117bc: 0d d0 00 18 sh (r14+24),r16 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)) / 80117c0: fb ff be c3 calli 80012cc <__divsi3> vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 80117c4: b9 e0 10 00 mv r2,r15 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)) / 80117c8: 59 c1 00 28 sw (r14+40),r1 80117cc: b8 20 68 00 mv r13,r1 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 80117d0: fb ff be 65 calli 8001164 <__ashlsi3> if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 80117d4: b6 d6 20 00 add r4,r22,r22 80117d8: b4 84 20 00 add r4,r4,r4 80117dc: b4 84 20 00 add r4,r4,r4 80117e0: b4 84 20 00 add r4,r4,r4 80117e4: b4 84 20 00 add r4,r4,r4 80117e8: b4 84 20 00 add r4,r4,r4 80117ec: b4 84 20 00 add r4,r4,r4 80117f0: b4 84 20 00 add r4,r4,r4 /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 80117f4: 59 c1 00 2c sw (r14+44),r1 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 80117f8: 34 02 00 10 mvi r2,16 80117fc: b8 9b 08 00 or r1,r4,fp 8011800: fb ff be 59 calli 8001164 <__ashlsi3> 8011804: 34 02 00 10 mvi r2,16 8011808: fb ff be 7e calli 8001200 <__ashrsi3> 801180c: 44 20 00 94 be r1,r0,8011a5c vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); 8011810: 20 24 ff ff andi r4,r1,0xffff 8011814: 59 c4 00 1c sw (r14+28),r4 else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 8011818: ba e0 10 00 mv r2,r23 801181c: b8 80 08 00 mv r1,r4 8011820: fb ff be 9f calli 800129c <__mulsi3> 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) 8011824: b6 b5 18 00 add r3,r21,r21 8011828: b4 63 18 00 add r3,r3,r3 801182c: b4 63 18 00 add r3,r3,r3 8011830: b4 63 18 00 add r3,r3,r3 8011834: b4 63 18 00 add r3,r3,r3 8011838: b4 63 18 00 add r3,r3,r3 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 + 801183c: b4 30 28 00 add r5,r1,r16 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) 8011840: b4 63 18 00 add r3,r3,r3 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 + 8011844: b4 ad 60 00 add r12,r5,r13 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) 8011848: b4 63 18 00 add r3,r3,r3 801184c: 34 02 00 10 mvi r2,16 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 + 8011850: 59 cc 00 34 sw (r14+52),r12 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; 8011854: 59 c5 00 20 sw (r14+32),r5 if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 8011858: b8 79 08 00 or r1,r3,r25 801185c: fb ff be 42 calli 8001164 <__ashlsi3> 8011860: 34 02 00 10 mvi r2,16 8011864: fb ff be 67 calli 8001200 <__ashrsi3> 8011868: 44 20 00 69 be r1,r0,8011a0c vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); 801186c: 20 24 ff ff andi r4,r1,0xffff 8011870: 59 c4 00 30 sw (r14+48),r4 else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); data_secs = vol->tot_secs - vol->data_fsec; vol->data_cls = data_secs / vol->spc; 8011874: c8 8c 08 00 sub r1,r4,r12 8011878: ba 40 10 00 mv r2,r18 801187c: f8 00 71 7b calli 802de68 <__udivsi3> 8011880: 59 c1 00 38 sw (r14+56),r1 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 8011884: 34 05 0f f4 mvi r5,4084 8011888: 54 25 00 89 bgu r1,r5,8011aac { vol->type = FAT_FAT12; 801188c: 34 02 00 01 mvi r2,1 8011890: 31 c2 00 0e sb (r14+14),r2 vol->mask = FAT_FAT12_MASK; 8011894: 34 02 0f ff mvi r2,4095 8011898: 59 c2 00 10 sw (r14+16),r2 vol->eoc_val = FAT_FAT12_EOC; 801189c: 34 02 0f f8 mvi r2,4088 80118a0: 59 c2 00 14 sw (r14+20),r2 else { vol->rdir_cl = 0; vol->mirror = 0; vol->afat = 0; vol->free_cls = FAT_UNDEFINED_VALUE; 80118a4: 34 02 ff ff mvi r2,-1 } } } else { vol->rdir_cl = 0; 80118a8: 59 c0 00 3c sw (r14+60),r0 vol->mirror = 0; 80118ac: 31 c0 00 54 sb (r14+84),r0 vol->afat = 0; 80118b0: 31 c0 00 5c sb (r14+92),r0 vol->free_cls = FAT_UNDEFINED_VALUE; 80118b4: 59 c2 00 44 sw (r14+68),r2 vol->next_cl = FAT_UNDEFINED_VALUE; 80118b8: 59 c2 00 4c sw (r14+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); 80118bc: b9 c0 08 00 mv r1,r14 80118c0: fb ff fc 9f calli 8010b3c vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 80118c4: 29 c2 00 1c lw r2,(r14+28) 80118c8: 41 c1 00 5c lbu r1,(r14+92) 80118cc: fb ff be 74 calli 800129c <__mulsi3> 80118d0: 2d c3 00 18 lhu r3,(r14+24) /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 80118d4: 34 02 00 0c mvi r2,12 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 80118d8: b4 23 18 00 add r3,r1,r3 80118dc: 59 c3 00 58 sw (r14+88),r3 /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 80118e0: 34 01 00 02 mvi r1,2 80118e4: fb ff c5 8b calli 8002f10 80118e8: 59 c1 00 6c sw (r14+108),r1 80118ec: b8 20 18 00 mv r3,r1 if ( fs_info->vhash == NULL ) 80118f0: 44 20 01 2d be r1,r0,8011da4 <== NEVER TAKEN Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; tail->previous = head; 80118f4: 58 61 00 08 sw (r3+8),r1 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 80118f8: 58 20 00 04 sw (r1+4),r0 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); 80118fc: 34 24 00 0c addi r4,r1,12 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8011900: 34 26 00 04 addi r6,r1,4 8011904: 34 25 00 10 addi r5,r1,16 head->next = tail; 8011908: 58 66 00 00 sw (r3+0),r6 801190c: 58 65 00 0c sw (r3+12),r5 fs_info->rhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 8011910: 34 01 00 02 mvi r1,2 8011914: 34 02 00 0c mvi r2,12 head->previous = NULL; 8011918: 58 80 00 04 sw (r4+4),r0 tail->previous = head; 801191c: 58 84 00 08 sw (r4+8),r4 8011920: fb ff c5 7c calli 8002f10 8011924: 59 c1 00 70 sw (r14+112),r1 8011928: b8 20 18 00 mv r3,r1 if ( fs_info->rhash == NULL ) 801192c: 44 20 01 25 be r1,r0,8011dc0 <== NEVER TAKEN } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->rhash + i); fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE; fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 8011930: 41 c2 00 03 lbu r2,(r14+3) 8011934: 29 c1 00 30 lw r1,(r14+48) rtems_set_errno_and_return_minus_one( ENOMEM ); } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->rhash + i); fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE; 8011938: 34 07 01 00 mvi r7,256 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 801193c: 58 60 00 04 sw (r3+4),r0 tail->previous = head; 8011940: 58 63 00 08 sw (r3+8),r3 8011944: 59 c7 00 7c sw (r14+124),r7 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); 8011948: 34 64 00 0c addi r4,r3,12 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 801194c: 34 66 00 04 addi r6,r3,4 8011950: 34 65 00 10 addi r5,r3,16 head->next = tail; 8011954: 58 66 00 00 sw (r3+0),r6 8011958: 58 65 00 0c sw (r3+12),r5 head->previous = NULL; 801195c: 58 80 00 04 sw (r4+4),r0 tail->previous = head; 8011960: 58 84 00 08 sw (r4+8),r4 fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE; fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 8011964: fb ff be 00 calli 8001164 <__ashlsi3> 8011968: b4 21 10 00 add r2,r1,r1 801196c: b4 42 10 00 add r2,r2,r2 8011970: b4 42 10 00 add r2,r2,r2 8011974: b4 42 10 00 add r2,r2,r2 8011978: 59 c2 00 80 sw (r14+128),r2 fs_info->index = 0; 801197c: 59 c0 00 78 sw (r14+120),r0 fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 8011980: 34 01 01 00 mvi r1,256 8011984: 34 02 00 01 mvi r2,1 8011988: fb ff c5 62 calli 8002f10 801198c: 59 c1 00 74 sw (r14+116),r1 if ( fs_info->uino == NULL ) 8011990: 44 20 00 fa be r1,r0,8011d78 <== NEVER TAKEN close(vol->fd); free(fs_info->vhash); free(fs_info->rhash); rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); 8011994: 2d c1 00 00 lhu r1,(r14+0) 8011998: 34 02 00 01 mvi r2,1 801199c: fb ff c5 5d calli 8002f10 80119a0: 59 c1 00 90 sw (r14+144),r1 if (fs_info->sec_buf == NULL) 80119a4: 44 20 01 0b be r1,r0,8011dd0 <== NEVER TAKEN return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 80119a8: 41 c3 00 04 lbu r3,(r14+4) 80119ac: 29 c4 00 34 lw r4,(r14+52) vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; 80119b0: 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; 80119b4: 34 63 ff ff addi r3,r3,-1 80119b8: 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) 80119bc: 5c 80 fe aa bne r4,r0,8011464 <== NEVER TAKEN && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) 80119c0: 41 c5 00 0e lbu r5,(r14+14) 80119c4: 34 04 00 04 mvi r4,4 80119c8: 44 a4 00 04 be r5,r4,80119d8 return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 80119cc: 29 c1 00 20 lw r1,(r14+32) 80119d0: 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))) 80119d4: 5c 60 fe a4 bne r3,r0,8011464 <== NEVER TAKEN { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 80119d8: 2d c2 00 06 lhu r2,(r14+6) 80119dc: 29 c1 00 64 lw r1,(r14+100) 80119e0: 34 03 00 01 mvi r3,1 80119e4: fb ff f4 c2 calli 800ecec vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; 80119e8: 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) 80119ec: 5c 20 fe 9e bne r1,r0,8011464 <== NEVER TAKEN { vol->bytes_per_block = vol->bpc; 80119f0: 2d c4 00 06 lhu r4,(r14+6) vol->bytes_per_block_log2 = vol->bpc_log2; 80119f4: 41 c3 00 08 lbu r3,(r14+8) vol->sectors_per_block = vol->spc; 80119f8: 41 c1 00 04 lbu r1,(r14+4) && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); if (sc == RTEMS_SUCCESSFUL) { vol->bytes_per_block = vol->bpc; 80119fc: 0d c4 00 0a sh (r14+10),r4 vol->bytes_per_block_log2 = vol->bpc_log2; 8011a00: 31 c3 00 0c sb (r14+12),r3 vol->sectors_per_block = vol->spc; 8011a04: 31 c1 00 09 sb (r14+9),r1 8011a08: e3 ff fe 97 bi 8011464 vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); 8011a0c: b5 6b 58 00 add r11,r11,r11 8011a10: b5 6b 58 00 add r11,r11,r11 8011a14: b5 6b 58 00 add r11,r11,r11 8011a18: b5 6b 58 00 add r11,r11,r11 8011a1c: b5 6b 58 00 add r11,r11,r11 8011a20: 2b 81 00 58 lw r1,(sp+88) 8011a24: b5 6b 58 00 add r11,r11,r11 8011a28: 34 02 00 10 mvi r2,16 8011a2c: b5 6b 58 00 add r11,r11,r11 8011a30: fb ff bd cd calli 8001164 <__ashlsi3> 8011a34: b5 6b 58 00 add r11,r11,r11 8011a38: 2b 84 00 54 lw r4,(sp+84) 8011a3c: b9 61 58 00 or r11,r11,r1 8011a40: 2b 81 00 5c lw r1,(sp+92) 8011a44: 34 02 00 18 mvi r2,24 8011a48: b9 64 58 00 or r11,r11,r4 8011a4c: fb ff bd c6 calli 8001164 <__ashlsi3> 8011a50: b9 61 20 00 or r4,r11,r1 8011a54: 59 c4 00 30 sw (r14+48),r4 8011a58: e3 ff ff 87 bi 8011874 vol->rdir_size = vol->rdir_secs << vol->sec_log2; 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); 8011a5c: b5 8c 60 00 add r12,r12,r12 8011a60: b5 8c 60 00 add r12,r12,r12 8011a64: b5 8c 60 00 add r12,r12,r12 8011a68: b5 8c 60 00 add r12,r12,r12 8011a6c: b5 8c 60 00 add r12,r12,r12 8011a70: 2b 81 00 4c lw r1,(sp+76) 8011a74: b5 8c 60 00 add r12,r12,r12 8011a78: 34 02 00 10 mvi r2,16 8011a7c: b5 8c 60 00 add r12,r12,r12 8011a80: fb ff bd b9 calli 8001164 <__ashlsi3> 8011a84: b5 8c 60 00 add r12,r12,r12 8011a88: b9 81 60 00 or r12,r12,r1 8011a8c: 2b 83 00 60 lw r3,(sp+96) 8011a90: 2b 81 00 50 lw r1,(sp+80) 8011a94: 34 02 00 18 mvi r2,24 8011a98: b9 83 60 00 or r12,r12,r3 8011a9c: fb ff bd b2 calli 8001164 <__ashlsi3> 8011aa0: b9 81 20 00 or r4,r12,r1 8011aa4: 59 c4 00 1c sw (r14+28),r4 8011aa8: e3 ff ff 5c bi 8011818 vol->mask = FAT_FAT12_MASK; vol->eoc_val = FAT_FAT12_EOC; } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 8011aac: 38 05 ff f4 mvu r5,0xfff4 8011ab0: 54 25 00 08 bgu r1,r5,8011ad0 { vol->type = FAT_FAT16; 8011ab4: 34 01 00 02 mvi r1,2 8011ab8: 31 c1 00 0e sb (r14+14),r1 vol->mask = FAT_FAT16_MASK; 8011abc: 38 01 ff ff mvu r1,0xffff 8011ac0: 59 c1 00 10 sw (r14+16),r1 vol->eoc_val = FAT_FAT16_EOC; 8011ac4: 34 21 ff f9 addi r1,r1,-7 8011ac8: 59 c1 00 14 sw (r14+20),r1 8011acc: e3 ff ff 76 bi 80118a4 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011ad0: 2b 81 00 64 lw r1,(sp+100) vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 8011ad4: 78 03 08 02 mvhi r3,0x802 8011ad8: 38 63 f0 30 ori r3,r3,0xf030 vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; 8011adc: 34 04 00 04 mvi r4,4 8011ae0: 31 c4 00 0e sb (r14+14),r4 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011ae4: b4 21 58 00 add r11,r1,r1 vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 8011ae8: 28 64 00 00 lw r4,(r3+0) } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011aec: b5 6b 58 00 add r11,r11,r11 } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; vol->eoc_val = FAT_FAT32_EOC; 8011af0: 78 01 08 02 mvhi r1,0x802 8011af4: 38 21 f0 34 ori r1,r1,0xf034 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011af8: b5 6b 58 00 add r11,r11,r11 vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 8011afc: 59 c4 00 10 sw (r14+16),r4 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011b00: b5 6b 58 00 add r11,r11,r11 } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; vol->eoc_val = FAT_FAT32_EOC; 8011b04: 28 24 00 00 lw r4,(r1+0) } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011b08: b5 6b 58 00 add r11,r11,r11 8011b0c: 2b 81 00 74 lw r1,(sp+116) 8011b10: b5 6b 58 00 add r11,r11,r11 } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; vol->eoc_val = FAT_FAT32_EOC; 8011b14: 59 c4 00 14 sw (r14+20),r4 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011b18: 34 02 00 10 mvi r2,16 8011b1c: b5 6b 58 00 add r11,r11,r11 8011b20: fb ff bd 91 calli 8001164 <__ashlsi3> 8011b24: b5 6b 58 00 add r11,r11,r11 8011b28: 2b 83 00 78 lw r3,(sp+120) 8011b2c: b9 61 58 00 or r11,r11,r1 8011b30: 2b 81 00 70 lw r1,(sp+112) 8011b34: 34 02 00 18 mvi r2,24 8011b38: b9 63 58 00 or r11,r11,r3 8011b3c: fb ff bd 8a calli 8001164 <__ashlsi3> vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 8011b40: 2b 84 00 68 lw r4,(sp+104) 8011b44: 2b 82 00 7c lw r2,(sp+124) } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011b48: b9 61 08 00 or r1,r11,r1 vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 8011b4c: b4 84 18 00 add r3,r4,r4 8011b50: b4 63 18 00 add r3,r3,r3 8011b54: b4 63 18 00 add r3,r3,r3 8011b58: b4 63 18 00 add r3,r3,r3 8011b5c: b4 63 18 00 add r3,r3,r3 8011b60: b4 63 18 00 add r3,r3,r3 8011b64: b4 63 18 00 add r3,r3,r3 8011b68: b4 63 18 00 add r3,r3,r3 8011b6c: b8 62 18 00 or r3,r3,r2 8011b70: 20 63 00 ff andi r3,r3,0xff 8011b74: 20 64 00 80 andi r4,r3,0x80 8011b78: 20 84 00 ff andi r4,r4,0xff } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011b7c: 59 c1 00 3c sw (r14+60),r1 vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 8011b80: 31 c4 00 54 sb (r14+84),r4 if (vol->mirror) 8011b84: 44 80 00 6e be r4,r0,8011d3c <== ALWAYS TAKEN vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 8011b88: 20 63 00 0f andi r3,r3,0xf <== NOT EXECUTED 8011b8c: 31 c3 00 5c sb (r14+92),r3 <== NOT EXECUTED else vol->afat = 0; vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 8011b90: 2b 83 00 48 lw r3,(sp+72) 8011b94: 2b 84 00 6c lw r4,(sp+108) 8011b98: b4 63 10 00 add r2,r3,r3 8011b9c: b4 42 10 00 add r2,r2,r2 8011ba0: b4 42 10 00 add r2,r2,r2 8011ba4: b4 42 10 00 add r2,r2,r2 8011ba8: b4 42 10 00 add r2,r2,r2 8011bac: b4 42 10 00 add r2,r2,r2 8011bb0: b4 42 10 00 add r2,r2,r2 8011bb4: b4 42 10 00 add r2,r2,r2 8011bb8: b8 44 10 00 or r2,r2,r4 8011bbc: 0d c2 00 40 sh (r14+64),r2 if( vol->info_sec == 0 ) 8011bc0: 44 40 fe c8 be r2,r0,80116e0 <== 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); 8011bc4: 37 8c 00 c8 addi r12,sp,200 close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, 8011bc8: b9 c0 08 00 mv r1,r14 8011bcc: 34 03 00 00 mvi r3,0 8011bd0: 34 04 00 04 mvi r4,4 8011bd4: b9 80 28 00 mv r5,r12 8011bd8: fb ff fc 99 calli 8010e3c <_fat_block_read> FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 8011bdc: 4c 20 00 05 bge r1,r0,8011bf0 <== ALWAYS TAKEN 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); 8011be0: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011be4: fb ff c4 ea calli 8002f8c <== NOT EXECUTED return -1; 8011be8: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8011bec: e3 ff fe 1e bi 8011464 <== NOT EXECUTED { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 8011bf0: 43 8b 00 c9 lbu r11,(sp+201) 8011bf4: 43 81 00 ca lbu r1,(sp+202) 8011bf8: 34 02 00 10 mvi r2,16 8011bfc: b5 6b 58 00 add r11,r11,r11 8011c00: b5 6b 58 00 add r11,r11,r11 8011c04: b5 6b 58 00 add r11,r11,r11 8011c08: b5 6b 58 00 add r11,r11,r11 8011c0c: b5 6b 58 00 add r11,r11,r11 8011c10: b5 6b 58 00 add r11,r11,r11 8011c14: b5 6b 58 00 add r11,r11,r11 8011c18: fb ff bd 53 calli 8001164 <__ashlsi3> 8011c1c: b5 6b 58 00 add r11,r11,r11 8011c20: 43 83 00 c8 lbu r3,(sp+200) 8011c24: b9 61 58 00 or r11,r11,r1 8011c28: 43 81 00 cb lbu r1,(sp+203) 8011c2c: 34 02 00 18 mvi r2,24 8011c30: b9 63 58 00 or r11,r11,r3 8011c34: fb ff bd 4c calli 8001164 <__ashlsi3> 8011c38: 78 03 08 02 mvhi r3,0x802 8011c3c: 38 63 f0 38 ori r3,r3,0xf038 8011c40: 28 62 00 00 lw r2,(r3+0) 8011c44: b9 61 08 00 or r1,r11,r1 8011c48: 5c 22 00 46 bne r1,r2,8011d60 <== NEVER TAKEN close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 8011c4c: 2d c2 00 40 lhu r2,(r14+64) 8011c50: b9 c0 08 00 mv r1,r14 8011c54: 34 03 01 e4 mvi r3,484 8011c58: 34 04 00 0c mvi r4,12 8011c5c: b9 80 28 00 mv r5,r12 8011c60: fb ff fc 77 calli 8010e3c <_fat_block_read> FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 8011c64: 4c 20 00 04 bge r1,r0,8011c74 <== 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); 8011c68: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8011c6c: fb ff fb b4 calli 8010b3c <== NOT EXECUTED 8011c70: e3 ff ff dc bi 8011be0 <== NOT EXECUTED close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 8011c74: 43 8b 00 cd lbu r11,(sp+205) 8011c78: 43 81 00 ce lbu r1,(sp+206) 8011c7c: 34 02 00 10 mvi r2,16 8011c80: b5 6b 58 00 add r11,r11,r11 8011c84: b5 6b 58 00 add r11,r11,r11 8011c88: b5 6b 58 00 add r11,r11,r11 8011c8c: b5 6b 58 00 add r11,r11,r11 8011c90: b5 6b 58 00 add r11,r11,r11 8011c94: b5 6b 58 00 add r11,r11,r11 8011c98: b5 6b 58 00 add r11,r11,r11 8011c9c: fb ff bd 32 calli 8001164 <__ashlsi3> 8011ca0: b5 6b 58 00 add r11,r11,r11 8011ca4: b9 61 58 00 or r11,r11,r1 8011ca8: 43 8c 00 cc lbu r12,(sp+204) 8011cac: 43 81 00 cf lbu r1,(sp+207) 8011cb0: 34 02 00 18 mvi r2,24 8011cb4: b9 6c 60 00 or r12,r11,r12 8011cb8: fb ff bd 2b calli 8001164 <__ashlsi3> vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 8011cbc: 43 8b 00 d1 lbu r11,(sp+209) close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 8011cc0: b9 81 18 00 or r3,r12,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); 8011cc4: 43 81 00 d2 lbu r1,(sp+210) 8011cc8: b5 6b 58 00 add r11,r11,r11 8011ccc: b5 6b 58 00 add r11,r11,r11 8011cd0: b5 6b 58 00 add r11,r11,r11 8011cd4: b5 6b 58 00 add r11,r11,r11 8011cd8: b5 6b 58 00 add r11,r11,r11 8011cdc: b5 6b 58 00 add r11,r11,r11 8011ce0: 34 02 00 10 mvi r2,16 _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 8011ce4: 59 c3 00 48 sw (r14+72),r3 FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; 8011ce8: 59 c3 00 44 sw (r14+68),r3 vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 8011cec: b5 6b 58 00 add r11,r11,r11 8011cf0: fb ff bd 1d calli 8001164 <__ashlsi3> 8011cf4: b5 6b 58 00 add r11,r11,r11 8011cf8: b9 61 58 00 or r11,r11,r1 8011cfc: 43 83 00 d0 lbu r3,(sp+208) 8011d00: 43 81 00 d3 lbu r1,(sp+211) 8011d04: 34 02 00 18 mvi r2,24 8011d08: b9 63 58 00 or r11,r11,r3 8011d0c: fb ff bd 16 calli 8001164 <__ashlsi3> 8011d10: b9 61 08 00 or r1,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 = 8011d14: 59 c1 00 50 sw (r14+80),r1 FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); vol->next_cl = vol->next_cl_in_fs_info; 8011d18: 59 c1 00 4c sw (r14+76),r1 8011d1c: e3 ff fe e8 bi 80118bc } /* check that device is registred as block device and lock it */ rc = rtems_disk_fd_get_disk_device(vol->fd, &vol->dd); if (rc != 0) { close(vol->fd); 8011d20: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011d24: fb ff c4 9a calli 8002f8c <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 8011d28: f8 00 25 ff calli 801b524 <__errno> <== NOT EXECUTED 8011d2c: 34 02 00 06 mvi r2,6 <== NOT EXECUTED 8011d30: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8011d34: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8011d38: e3 ff fd cb bi 8011464 <== NOT EXECUTED vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; if (vol->mirror) vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; else vol->afat = 0; 8011d3c: 31 c0 00 5c sb (r14+92),r0 8011d40: e3 ff ff 94 bi 8011b90 memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); sc = rtems_bdbuf_release( block); if (sc != RTEMS_SUCCESSFUL) { close(vol->fd); 8011d44: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011d48: fb ff c4 91 calli 8002f8c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 8011d4c: f8 00 25 f6 calli 801b524 <__errno> <== NOT EXECUTED 8011d50: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8011d54: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8011d58: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8011d5c: e3 ff fd c2 bi 8011464 <== NOT EXECUTED * 0 on success, or -1 if error occured and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) { return fat_buf_release(fs_info); 8011d60: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8011d64: fb ff fb 76 calli 8010b3c <== NOT EXECUTED 8011d68: e3 ff fe 5e bi 80116e0 <== NOT EXECUTED } rc = fstat(vol->fd, &stat_buf); if (rc != 0) { close(vol->fd); 8011d6c: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011d70: fb ff c4 87 calli 8002f8c <== NOT EXECUTED 8011d74: e3 ff fd b8 bi 8011454 <== 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); 8011d78: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011d7c: fb ff c4 84 calli 8002f8c <== NOT EXECUTED free(fs_info->vhash); 8011d80: 29 c1 00 6c lw r1,(r14+108) <== NOT EXECUTED 8011d84: fb ff c4 b1 calli 8003048 <== NOT EXECUTED free(fs_info->rhash); 8011d88: 29 c1 00 70 lw r1,(r14+112) <== NOT EXECUTED if (fs_info->sec_buf == NULL) { close(vol->fd); free(fs_info->vhash); free(fs_info->rhash); free(fs_info->uino); 8011d8c: fb ff c4 af calli 8003048 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 8011d90: f8 00 25 e5 calli 801b524 <__errno> <== NOT EXECUTED 8011d94: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8011d98: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8011d9c: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8011da0: e3 ff fd b1 bi 8011464 <== 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); 8011da4: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011da8: fb ff c4 79 calli 8002f8c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 8011dac: f8 00 25 de calli 801b524 <__errno> <== NOT EXECUTED 8011db0: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8011db4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8011db8: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8011dbc: e3 ff fd aa bi 8011464 <== 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); 8011dc0: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011dc4: fb ff c4 72 calli 8002f8c <== NOT EXECUTED free(fs_info->vhash); 8011dc8: 29 c1 00 6c lw r1,(r14+108) <== NOT EXECUTED 8011dcc: e3 ff ff f0 bi 8011d8c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); if (fs_info->sec_buf == NULL) { close(vol->fd); 8011dd0: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011dd4: fb ff c4 6e calli 8002f8c <== NOT EXECUTED free(fs_info->vhash); 8011dd8: 29 c1 00 6c lw r1,(r14+108) <== NOT EXECUTED 8011ddc: fb ff c4 9b calli 8003048 <== NOT EXECUTED free(fs_info->rhash); 8011de0: 29 c1 00 70 lw r1,(r14+112) <== NOT EXECUTED 8011de4: fb ff c4 99 calli 8003048 <== NOT EXECUTED free(fs_info->uino); 8011de8: 29 c1 00 74 lw r1,(r14+116) <== NOT EXECUTED 8011dec: e3 ff ff e8 bi 8011d8c <== NOT EXECUTED =============================================================================== 080199dc : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 80199dc: 37 9c ff cc addi sp,sp,-52 80199e0: 5b 8b 00 30 sw (sp+48),r11 80199e4: 5b 8c 00 2c sw (sp+44),r12 80199e8: 5b 8d 00 28 sw (sp+40),r13 80199ec: 5b 8e 00 24 sw (sp+36),r14 80199f0: 5b 8f 00 20 sw (sp+32),r15 80199f4: 5b 90 00 1c sw (sp+28),r16 80199f8: 5b 91 00 18 sw (sp+24),r17 80199fc: 5b 92 00 14 sw (sp+20),r18 8019a00: 5b 93 00 10 sw (sp+16),r19 8019a04: 5b 94 00 0c sw (sp+12),r20 8019a08: 5b 95 00 08 sw (sp+8),r21 8019a0c: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 8019a10: 5b 80 00 34 sw (sp+52),r0 uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; 8019a14: 28 30 00 38 lw r16,(r1+56) uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; 8019a18: 58 80 00 00 sw (r4+0),r0 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 8019a1c: b8 20 68 00 mv r13,r1 8019a20: b8 80 70 00 mv r14,r4 8019a24: b8 60 90 00 mv r18,r3 8019a28: b8 40 a0 00 mv r20,r2 8019a2c: b8 a0 a8 00 mv r21,r5 8019a30: 20 d3 00 ff andi r19,r6,0xff ssize_t bytes_written; *cls_added = 0; if (count == 0) return rc; 8019a34: 34 0c 00 00 mvi r12,0 uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) 8019a38: 44 60 00 2e be r3,r0,8019af0 <== NEVER TAKEN return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) 8019a3c: 28 2b 00 4c lw r11,(r1+76) 8019a40: 34 01 ff ff mvi r1,-1 8019a44: 45 61 00 5e be r11,r1,8019bbc { 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; 8019a48: 36 10 00 02 addi r16,r16,2 /* * fs_info->vol.data_cls is exactly the count of data clusters * starting at cluster 2, so the maximum valid cluster number is * (fs_info->vol.data_cls + 1) */ while (i < data_cls_val) 8019a4c: 34 01 00 02 mvi r1,2 8019a50: 50 30 00 75 bgeu r1,r16,8019c24 <== NEVER TAKEN 8019a54: 34 0f 00 02 mvi r15,2 8019a58: 34 11 00 00 mvi r17,0 { rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); 8019a5c: b9 a0 08 00 mv r1,r13 8019a60: b9 60 10 00 mv r2,r11 8019a64: 37 83 00 34 addi r3,sp,52 8019a68: fb ff fd cf calli 80191a4 8019a6c: b8 20 60 00 mv r12,r1 if ( rc != RC_OK ) 8019a70: 5c 20 00 55 bne r1,r0,8019bc4 <== NEVER TAKEN if (*cls_added != 0) fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } if (next_cln == FAT_GENFAT_FREE) 8019a74: 2b 81 00 34 lw r1,(sp+52) 8019a78: 5c 2c 00 0f bne r1,r12,8019ab4 /* * 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) 8019a7c: 29 c1 00 00 lw r1,(r14+0) 8019a80: 5c 20 00 2e bne r1,r0,8019b38 { *chain = cl4find; 8019a84: 5a 8b 00 00 sw (r20+0),r11 rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 8019a88: b9 a0 08 00 mv r1,r13 8019a8c: b9 60 10 00 mv r2,r11 8019a90: 34 03 ff ff mvi r3,-1 8019a94: fb ff fe 81 calli 8019498 if ( rc != RC_OK ) 8019a98: 5c 20 00 5c bne r1,r0,8019c08 <== NEVER TAKEN rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); if ( rc != RC_OK ) goto cleanup; } if (zero_fill) 8019a9c: 5e 60 00 3e bne r19,r0,8019b94 goto cleanup; } } save_cln = cl4find; (*cls_added)++; 8019aa0: 29 c1 00 00 lw r1,(r14+0) 8019aa4: 34 21 00 01 addi r1,r1,1 8019aa8: 59 c1 00 00 sw (r14+0),r1 /* have we satisfied request ? */ if (*cls_added == count) 8019aac: 46 41 00 4c be r18,r1,8019bdc 8019ab0: b9 60 88 00 mv r17,r11 fat_buf_release(fs_info); return rc; } } i++; cl4find++; 8019ab4: 35 6b 00 01 addi r11,r11,1 *last_cl = save_cln; fat_buf_release(fs_info); return rc; } } i++; 8019ab8: 35 ef 00 01 addi r15,r15,1 cl4find++; if (cl4find >= data_cls_val) 8019abc: 51 70 00 1c bgeu r11,r16,8019b2c <== NEVER TAKEN /* * 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) 8019ac0: 56 0f ff e7 bgu r16,r15,8019a5c <== 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) 8019ac4: 29 a1 00 44 lw r1,(r13+68) <== NOT EXECUTED cl4find++; if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; 8019ac8: 59 b1 00 4c sw (r13+76),r17 <== NOT EXECUTED if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8019acc: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8019ad0: 44 22 00 04 be r1,r2,8019ae0 <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); 8019ad4: 29 c2 00 00 lw r2,(r14+0) <== NOT EXECUTED 8019ad8: c8 22 08 00 sub r1,r1,r2 <== NOT EXECUTED 8019adc: 59 a1 00 44 sw (r13+68),r1 <== NOT EXECUTED *last_cl = save_cln; 8019ae0: 5a b1 00 00 sw (r21+0),r17 <== NOT EXECUTED fat_buf_release(fs_info); 8019ae4: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8019ae8: fb ff dc 15 calli 8010b3c <== NOT EXECUTED return RC_OK; 8019aec: 34 0c 00 00 mvi r12,0 <== 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; } 8019af0: b9 80 08 00 mv r1,r12 8019af4: 2b 9d 00 04 lw ra,(sp+4) 8019af8: 2b 8b 00 30 lw r11,(sp+48) 8019afc: 2b 8c 00 2c lw r12,(sp+44) 8019b00: 2b 8d 00 28 lw r13,(sp+40) 8019b04: 2b 8e 00 24 lw r14,(sp+36) 8019b08: 2b 8f 00 20 lw r15,(sp+32) 8019b0c: 2b 90 00 1c lw r16,(sp+28) 8019b10: 2b 91 00 18 lw r17,(sp+24) 8019b14: 2b 92 00 14 lw r18,(sp+20) 8019b18: 2b 93 00 10 lw r19,(sp+16) 8019b1c: 2b 94 00 0c lw r20,(sp+12) 8019b20: 2b 95 00 08 lw r21,(sp+8) 8019b24: 37 9c 00 34 addi sp,sp,52 8019b28: c3 a0 00 00 ret } } i++; cl4find++; if (cl4find >= data_cls_val) cl4find = 2; 8019b2c: 34 0b 00 02 mvi r11,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) 8019b30: 56 0f ff cb bgu r16,r15,8019a5c <== NOT EXECUTED 8019b34: e3 ff ff e4 bi 8019ac4 <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 8019b38: b9 a0 08 00 mv r1,r13 8019b3c: b9 60 10 00 mv r2,r11 8019b40: 34 03 ff ff mvi r3,-1 8019b44: fb ff fe 55 calli 8019498 8019b48: b8 20 20 00 mv r4,r1 if ( rc != RC_OK ) 8019b4c: 5c 20 00 31 bne r1,r0,8019c10 <== NEVER TAKEN /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); 8019b50: b9 a0 08 00 mv r1,r13 8019b54: ba 20 10 00 mv r2,r17 8019b58: b9 60 18 00 mv r3,r11 8019b5c: fb ff fe 4f calli 8019498 8019b60: b8 20 20 00 mv r4,r1 if ( rc != RC_OK ) 8019b64: 44 20 ff ce be r1,r0,8019a9c <== ALWAYS TAKEN return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 8019b68: 2a 82 00 00 lw r2,(r20+0) <== NOT EXECUTED 8019b6c: b9 a0 08 00 mv r1,r13 <== 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; 8019b70: b8 80 60 00 mv r12,r4 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 8019b74: fb ff ff 58 calli 80198d4 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); 8019b78: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8019b7c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8019b80: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 8019b84: fb ff fe 45 calli 8019498 <== NOT EXECUTED fat_buf_release(fs_info); 8019b88: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8019b8c: fb ff db ec calli 8010b3c <== NOT EXECUTED return rc; 8019b90: e3 ff ff d8 bi 8019af0 <== NOT EXECUTED goto cleanup; } if (zero_fill) { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 8019b94: 2d a4 00 06 lhu r4,(r13+6) 8019b98: b9 60 10 00 mv r2,r11 8019b9c: b9 a0 08 00 mv r1,r13 8019ba0: 34 03 00 00 mvi r3,0 8019ba4: 34 05 00 00 mvi r5,0 8019ba8: fb ff dd 1a calli 8011010 if (fs_info->vol.bpc != bytes_written) 8019bac: 2d a2 00 06 lhu r2,(r13+6) 8019bb0: 44 41 ff bc be r2,r1,8019aa0 <== ALWAYS TAKEN { rc = -1; 8019bb4: 34 04 ff ff mvi r4,-1 <== NOT EXECUTED 8019bb8: e3 ff ff ec bi 8019b68 <== NOT EXECUTED uint32_t *last_cl, bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; 8019bbc: 34 0b 00 02 mvi r11,2 8019bc0: e3 ff ff a2 bi 8019a48 while (i < data_cls_val) { rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); if ( rc != RC_OK ) { if (*cls_added != 0) 8019bc4: 29 c1 00 00 lw r1,(r14+0) <== NOT EXECUTED 8019bc8: 44 20 ff ca be r1,r0,8019af0 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); 8019bcc: 2a 82 00 00 lw r2,(r20+0) <== NOT EXECUTED 8019bd0: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8019bd4: fb ff ff 40 calli 80198d4 <== NOT EXECUTED 8019bd8: e3 ff ff c6 bi 8019af0 <== NOT EXECUTED /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8019bdc: 29 a1 00 44 lw r1,(r13+68) (*cls_added)++; /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; 8019be0: 59 ab 00 4c sw (r13+76),r11 if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8019be4: 34 02 ff ff mvi r2,-1 8019be8: 44 22 00 04 be r1,r2,8019bf8 <== ALWAYS TAKEN fs_info->vol.free_cls -= (*cls_added); 8019bec: 29 c2 00 00 lw r2,(r14+0) <== NOT EXECUTED 8019bf0: c8 22 08 00 sub r1,r1,r2 <== NOT EXECUTED 8019bf4: 59 a1 00 44 sw (r13+68),r1 <== NOT EXECUTED *last_cl = save_cln; 8019bf8: 5a ab 00 00 sw (r21+0),r11 fat_buf_release(fs_info); 8019bfc: b9 a0 08 00 mv r1,r13 8019c00: fb ff db cf calli 8010b3c return rc; 8019c04: e3 ff ff bb bi 8019af0 * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 8019c08: b8 20 60 00 mv r12,r1 <== NOT EXECUTED 8019c0c: e3 ff ff b9 bi 8019af0 <== NOT EXECUTED /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 8019c10: 2a 82 00 00 lw r2,(r20+0) <== NOT EXECUTED 8019c14: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 8019c18: b8 80 60 00 mv r12,r4 <== NOT EXECUTED if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 8019c1c: fb ff ff 2e calli 80198d4 <== NOT EXECUTED return rc; 8019c20: e3 ff ff b4 bi 8019af0 <== 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) 8019c24: 34 11 00 00 mvi r17,0 <== NOT EXECUTED 8019c28: e3 ff ff a7 bi 8019ac4 <== NOT EXECUTED =============================================================================== 08010f00 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 8010f00: 37 9c ff d4 addi sp,sp,-44 8010f04: 5b 8b 00 28 sw (sp+40),r11 8010f08: 5b 8c 00 24 sw (sp+36),r12 8010f0c: 5b 8d 00 20 sw (sp+32),r13 8010f10: 5b 8e 00 1c sw (sp+28),r14 8010f14: 5b 8f 00 18 sw (sp+24),r15 8010f18: 5b 90 00 14 sw (sp+20),r16 8010f1c: 5b 91 00 10 sw (sp+16),r17 8010f20: 5b 92 00 0c sw (sp+12),r18 8010f24: 5b 93 00 08 sw (sp+8),r19 8010f28: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; ssize_t cmpltd = 0; 8010f2c: 34 0f 00 00 mvi r15,0 fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 8010f30: b8 80 60 00 mv r12,r4 8010f34: b8 20 68 00 mv r13,r1 8010f38: b8 a0 90 00 mv r18,r5 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 8010f3c: 44 80 00 28 be r4,r0,8010fdc <== NEVER TAKEN 8010f40: b8 60 80 00 mv r16,r3 8010f44: b8 40 70 00 mv r14,r2 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 8010f48: 34 13 00 01 mvi r19,1 8010f4c: e0 00 00 0f bi 8010f88 c = MIN(count, (fs_info->vol.bps - ofs)); if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 8010f50: fb ff ff 76 calli 8010d28 8010f54: b8 20 88 00 mv r17,r1 if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 8010f58: b6 4f 10 00 add r2,r18,r15 8010f5c: b9 60 18 00 mv r3,r11 fat_buf_mark_modified(fs_info); count -= c; 8010f60: c9 8b 60 00 sub r12,r12,r11 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) 8010f64: 5e 20 00 1d bne r17,r0,8010fd8 <== NEVER TAKEN return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 8010f68: 2b 81 00 2c lw r1,(sp+44) fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; 8010f6c: b5 6f 78 00 add r15,r11,r15 sec_num++; 8010f70: 35 ce 00 01 addi r14,r14,1 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 8010f74: b4 30 08 00 add r1,r1,r16 8010f78: f8 00 2c b9 calli 801c25c 8010f7c: 31 b3 00 88 sb (r13+136),r19 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 8010f80: 45 91 00 17 be r12,r17,8010fdc <== ALWAYS TAKEN fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; sec_num++; ofs = 0; 8010f84: 34 10 00 00 mvi r16,0 <== NOT EXECUTED uint8_t *sec_buf; uint32_t c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); 8010f88: 2d ab 00 00 lhu r11,(r13+0) 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); 8010f8c: b9 c0 10 00 mv r2,r14 8010f90: 37 84 00 2c addi r4,sp,44 uint8_t *sec_buf; uint32_t c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); 8010f94: c9 70 58 00 sub r11,r11,r16 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); 8010f98: b9 a0 08 00 mv r1,r13 8010f9c: 34 03 00 01 mvi r3,1 uint8_t *sec_buf; uint32_t c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); 8010fa0: 51 8b 00 02 bgeu r12,r11,8010fa8 8010fa4: b9 80 58 00 mv r11,r12 if (c == fs_info->vol.bytes_per_block) 8010fa8: 2d a6 00 0a lhu r6,(r13+10) 8010fac: 5c cb ff e9 bne r6,r11,8010f50 <== ALWAYS TAKEN rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 8010fb0: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED 8010fb4: 34 03 00 02 mvi r3,2 <== NOT EXECUTED 8010fb8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8010fbc: 37 84 00 2c addi r4,sp,44 <== NOT EXECUTED 8010fc0: fb ff ff 5a calli 8010d28 <== NOT EXECUTED 8010fc4: b8 20 88 00 mv r17,r1 <== NOT EXECUTED else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 8010fc8: b6 4f 10 00 add r2,r18,r15 <== NOT EXECUTED 8010fcc: b9 60 18 00 mv r3,r11 <== NOT EXECUTED fat_buf_mark_modified(fs_info); count -= c; 8010fd0: c9 8b 60 00 sub r12,r12,r11 <== NOT EXECUTED 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) 8010fd4: 46 20 ff e5 be r17,r0,8010f68 <== NOT EXECUTED return -1; 8010fd8: 34 0f ff ff mvi r15,-1 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 8010fdc: b9 e0 08 00 mv r1,r15 8010fe0: 2b 9d 00 04 lw ra,(sp+4) 8010fe4: 2b 8b 00 28 lw r11,(sp+40) 8010fe8: 2b 8c 00 24 lw r12,(sp+36) 8010fec: 2b 8d 00 20 lw r13,(sp+32) 8010ff0: 2b 8e 00 1c lw r14,(sp+28) 8010ff4: 2b 8f 00 18 lw r15,(sp+24) 8010ff8: 2b 90 00 14 lw r16,(sp+20) 8010ffc: 2b 91 00 10 lw r17,(sp+16) 8011000: 2b 92 00 0c lw r18,(sp+12) 8011004: 2b 93 00 08 lw r19,(sp+8) 8011008: 37 9c 00 2c addi sp,sp,44 801100c: c3 a0 00 00 ret =============================================================================== 08019498 : fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 8019498: 37 9c ff d8 addi sp,sp,-40 801949c: 5b 8b 00 24 sw (sp+36),r11 80194a0: 5b 8c 00 20 sw (sp+32),r12 80194a4: 5b 8d 00 1c sw (sp+28),r13 80194a8: 5b 8e 00 18 sw (sp+24),r14 80194ac: 5b 8f 00 14 sw (sp+20),r15 80194b0: 5b 90 00 10 sw (sp+16),r16 80194b4: 5b 91 00 0c sw (sp+12),r17 80194b8: 5b 92 00 08 sw (sp+8),r18 80194bc: 5b 9d 00 04 sw (sp+4),ra 80194c0: 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; 80194c4: 5b 80 00 28 sw (sp+40),r0 /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 80194c8: 34 01 00 01 mvi r1,1 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 80194cc: b8 40 60 00 mv r12,r2 80194d0: b8 60 88 00 mv r17,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)) ) 80194d4: 50 22 00 21 bgeu r1,r2,8019558 <== NEVER TAKEN 80194d8: 29 61 00 38 lw r1,(r11+56) 80194dc: 34 21 00 01 addi r1,r1,1 80194e0: 50 22 00 02 bgeu r1,r2,80194e8 <== ALWAYS TAKEN 80194e4: e0 00 00 1d bi 8019558 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 80194e8: 41 62 00 0e lbu r2,(r11+14) 80194ec: 20 41 00 01 andi r1,r2,0x1 80194f0: 5c 20 00 2a bne r1,r0,8019598 80194f4: 20 42 00 02 andi r2,r2,0x2 80194f8: 44 41 00 30 be r2,r1,80195b8 80194fc: 41 62 00 02 lbu r2,(r11+2) 8019500: b5 8c 70 00 add r14,r12,r12 8019504: b9 c0 08 00 mv r1,r14 8019508: f8 00 52 08 calli 802dd28 <__lshrsi3> 801950c: 29 70 00 58 lw r16,(r11+88) 8019510: 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); rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 8019514: b9 60 08 00 mv r1,r11 8019518: ba 00 10 00 mv r2,r16 801951c: 34 03 00 01 mvi r3,1 8019520: 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); 8019524: 2d 72 00 00 lhu r18,(r11+0) rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 8019528: fb ff de 00 calli 8010d28 801952c: b8 20 68 00 mv r13,r1 if (rc != RC_OK) 8019530: 5c 20 00 0e bne r1,r0,8019568 <== NEVER TAKEN return rc; switch ( fs_info->vol.type ) 8019534: 41 6f 00 0e lbu r15,(r11+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); 8019538: 36 52 ff ff addi r18,r18,-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 ) 801953c: 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); 8019540: a1 d2 70 00 and r14,r14,r18 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 8019544: 45 e1 00 25 be r15,r1,80195d8 8019548: 34 01 00 04 mvi r1,4 801954c: 45 e1 00 63 be r15,r1,80196d8 8019550: 34 01 00 01 mvi r1,1 8019554: 45 e1 00 39 be r15,r1,8019638 <== ALWAYS TAKEN fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); 8019558: f8 00 07 f3 calli 801b524 <__errno> <== NOT EXECUTED 801955c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8019560: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8019564: 34 0d ff ff mvi r13,-1 <== NOT EXECUTED break; } return RC_OK; } 8019568: b9 a0 08 00 mv r1,r13 801956c: 2b 9d 00 04 lw ra,(sp+4) 8019570: 2b 8b 00 24 lw r11,(sp+36) 8019574: 2b 8c 00 20 lw r12,(sp+32) 8019578: 2b 8d 00 1c lw r13,(sp+28) 801957c: 2b 8e 00 18 lw r14,(sp+24) 8019580: 2b 8f 00 14 lw r15,(sp+20) 8019584: 2b 90 00 10 lw r16,(sp+16) 8019588: 2b 91 00 0c lw r17,(sp+12) 801958c: 2b 92 00 08 lw r18,(sp+8) 8019590: 37 9c 00 28 addi sp,sp,40 8019594: c3 a0 00 00 ret /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 8019598: 01 8e 00 01 srui r14,r12,1 801959c: 41 62 00 02 lbu r2,(r11+2) 80195a0: b5 cc 70 00 add r14,r14,r12 80195a4: b9 c0 08 00 mv r1,r14 80195a8: f8 00 51 e0 calli 802dd28 <__lshrsi3> 80195ac: 29 70 00 58 lw r16,(r11+88) 80195b0: b4 30 80 00 add r16,r1,r16 80195b4: e3 ff ff d8 bi 8019514 80195b8: b5 8c 70 00 add r14,r12,r12 80195bc: 41 62 00 02 lbu r2,(r11+2) 80195c0: b5 ce 70 00 add r14,r14,r14 80195c4: b9 c0 08 00 mv r1,r14 80195c8: f8 00 51 d8 calli 802dd28 <__lshrsi3> 80195cc: 29 70 00 58 lw r16,(r11+88) 80195d0: b4 30 80 00 add r16,r1,r16 80195d4: e3 ff ff d0 bi 8019514 } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = (uint16_t )(CT_LE_W(in_val)); 80195d8: 22 23 ff ff andi r3,r17,0xffff * @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; 80195dc: 00 61 00 01 srui r1,r3,1 80195e0: b4 63 18 00 add r3,r3,r3 80195e4: 00 21 00 01 srui r1,r1,1 80195e8: b4 63 18 00 add r3,r3,r3 80195ec: 00 21 00 01 srui r1,r1,1 80195f0: b4 63 18 00 add r3,r3,r3 80195f4: 00 21 00 01 srui r1,r1,1 80195f8: b4 63 18 00 add r3,r3,r3 80195fc: 00 21 00 01 srui r1,r1,1 8019600: b4 63 18 00 add r3,r3,r3 8019604: 00 21 00 01 srui r1,r1,1 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 8019608: 2b 82 00 28 lw r2,(sp+40) 801960c: 00 21 00 01 srui r1,r1,1 8019610: b4 63 18 00 add r3,r3,r3 8019614: 00 21 00 01 srui r1,r1,1 8019618: b4 63 18 00 add r3,r3,r3 801961c: b4 63 18 00 add r3,r3,r3 8019620: b8 61 18 00 or r3,r3,r1 8019624: b4 4e 70 00 add r14,r2,r14 8019628: 0d c3 00 00 sh (r14+0),r3 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 801962c: 34 01 00 01 mvi r1,1 8019630: 31 61 00 88 sb (r11+136),r1 (uint16_t )(CT_LE_W(in_val)); fat_buf_mark_modified(fs_info); break; 8019634: e3 ff ff cd bi 8019568 return rc; switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 8019638: 21 8c 00 01 andi r12,r12,0x1 801963c: 45 80 00 55 be r12,r0,8019790 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 8019640: 2b 81 00 28 lw r1,(sp+40) switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; 8019644: b6 31 88 00 add r17,r17,r17 8019648: b6 31 88 00 add r17,r17,r17 *(sec_buf + ofs) &= 0x0F; 801964c: b4 2e 08 00 add r1,r1,r14 8019650: 40 22 00 00 lbu r2,(r1+0) switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; 8019654: b6 31 88 00 add r17,r17,r17 8019658: b6 31 88 00 add r17,r17,r17 *(sec_buf + ofs) &= 0x0F; 801965c: 20 42 00 0f andi r2,r2,0xf 8019660: 30 22 00 00 sb (r1+0),r2 *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 8019664: 2b 81 00 28 lw r1,(sp+40) switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; 8019668: 22 31 ff ff andi r17,r17,0xffff *(sec_buf + ofs) &= 0x0F; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 801966c: 22 22 ff f0 andi r2,r17,0xfff0 8019670: b4 2e 08 00 add r1,r1,r14 8019674: 40 23 00 00 lbu r3,(r1+0) 8019678: b8 62 10 00 or r2,r3,r2 801967c: 30 22 00 00 sb (r1+0),r2 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 8019680: 2d 61 00 00 lhu r1,(r11+0) 8019684: 31 6f 00 88 sb (r11+136),r15 8019688: 34 21 ff ff addi r1,r1,-1 801968c: 44 2e 00 62 be r1,r14,8019814 <== NEVER TAKEN } else { *(sec_buf + ofs + 1) &= 0x00; *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 8019690: 02 21 00 01 srui r1,r17,1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 8019694: 2b 82 00 28 lw r2,(sp+40) *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 8019698: 00 21 00 01 srui r1,r1,1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 801969c: 35 ce 00 01 addi r14,r14,1 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 80196a0: 00 21 00 01 srui r1,r1,1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 80196a4: b4 4e 10 00 add r2,r2,r14 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 80196a8: 00 21 00 01 srui r1,r1,1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 80196ac: 30 40 00 00 sb (r2+0),r0 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 80196b0: 00 21 00 01 srui r1,r1,1 80196b4: 2b 82 00 28 lw r2,(sp+40) 80196b8: 00 21 00 01 srui r1,r1,1 80196bc: b4 4e 70 00 add r14,r2,r14 80196c0: 00 21 00 01 srui r1,r1,1 80196c4: 41 c2 00 00 lbu r2,(r14+0) 80196c8: 00 21 00 01 srui r1,r1,1 80196cc: b8 41 08 00 or r1,r2,r1 80196d0: 31 c1 00 00 sb (r14+0),r1 80196d4: e3 ff ff a5 bi 8019568 (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)); 80196d8: 78 01 08 02 mvhi r1,0x802 80196dc: 38 21 f0 30 ori r1,r1,0xf030 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 80196e0: 2b 83 00 28 lw r3,(sp+40) (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)); 80196e4: 28 2c 00 00 lw r12,(r1+0) byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 80196e8: 34 02 00 18 mvi r2,24 80196ec: 22 21 00 ff andi r1,r17,0xff *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 80196f0: b4 6e 70 00 add r14,r3,r14 (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)); 80196f4: a2 2c 60 00 and r12,r17,r12 80196f8: fb ff 9e 9b calli 8001164 <__ashlsi3> 80196fc: b8 20 78 00 mv r15,r1 uint32_t value ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; 8019700: 34 02 00 18 mvi r2,24 8019704: b9 80 08 00 mv r1,r12 8019708: f8 00 51 88 calli 802dd28 <__lshrsi3> byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 801970c: 01 83 00 01 srui r3,r12,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8019710: b9 e1 78 00 or r15,r15,r1 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8019714: 00 63 00 01 srui r3,r3,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8019718: 34 02 00 10 mvi r2,16 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 801971c: 00 63 00 01 srui r3,r3,1 8019720: 00 63 00 01 srui r3,r3,1 8019724: 00 63 00 01 srui r3,r3,1 8019728: 00 63 00 01 srui r3,r3,1 801972c: 00 63 00 01 srui r3,r3,1 8019730: 00 63 00 01 srui r3,r3,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8019734: 20 61 00 ff andi r1,r3,0xff 8019738: fb ff 9e 8b calli 8001164 <__ashlsi3> 801973c: b9 e1 78 00 or r15,r15,r1 ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; 8019740: 34 02 00 10 mvi r2,16 8019744: b9 80 08 00 mv r1,r12 8019748: f8 00 51 78 calli 802dd28 <__lshrsi3> 801974c: 20 22 00 ff andi r2,r1,0xff byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8019750: b4 42 10 00 add r2,r2,r2 8019754: b4 42 10 00 add r2,r2,r2 8019758: b4 42 10 00 add r2,r2,r2 801975c: b4 42 10 00 add r2,r2,r2 8019760: b4 42 10 00 add r2,r2,r2 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 8019764: 29 c1 00 00 lw r1,(r14+0) 8019768: b4 42 10 00 add r2,r2,r2 801976c: b4 42 10 00 add r2,r2,r2 8019770: b4 42 10 00 add r2,r2,r2 8019774: 20 21 00 f0 andi r1,r1,0xf0 8019778: b9 e2 10 00 or r2,r15,r2 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 801977c: b8 41 10 00 or r2,r2,r1 8019780: 59 c2 00 00 sw (r14+0),r2 8019784: 34 01 00 01 mvi r1,1 8019788: 31 61 00 88 sb (r11+136),r1 fat_buf_mark_modified(fs_info); break; 801978c: e3 ff ff 77 bi 8019568 } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 8019790: 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; 8019794: 22 31 0f ff andi r17,r17,0xfff *(sec_buf + ofs) &= 0x00; 8019798: b4 2e 08 00 add r1,r1,r14 801979c: 30 20 00 00 sb (r1+0),r0 *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 80197a0: 2b 81 00 28 lw r1,(sp+40) 80197a4: b4 2e 08 00 add r1,r1,r14 80197a8: 40 22 00 00 lbu r2,(r1+0) 80197ac: b8 51 10 00 or r2,r2,r17 80197b0: 30 22 00 00 sb (r1+0),r2 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 80197b4: 2d 61 00 00 lhu r1,(r11+0) 80197b8: 31 6f 00 88 sb (r11+136),r15 80197bc: 34 21 ff ff addi r1,r1,-1 80197c0: 44 2e 00 2c be r1,r14,8019870 <== NEVER TAKEN fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 80197c4: 2b 81 00 28 lw r1,(sp+40) *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 80197c8: 02 31 00 01 srui r17,r17,1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 80197cc: 35 ce 00 01 addi r14,r14,1 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 80197d0: 02 31 00 01 srui r17,r17,1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 80197d4: b4 2e 08 00 add r1,r1,r14 80197d8: 40 22 00 00 lbu r2,(r1+0) *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 80197dc: 02 31 00 01 srui r17,r17,1 80197e0: 02 31 00 01 srui r17,r17,1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 80197e4: 20 42 00 f0 andi r2,r2,0xf0 80197e8: 30 22 00 00 sb (r1+0),r2 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 80197ec: 02 31 00 01 srui r17,r17,1 80197f0: 2b 81 00 28 lw r1,(sp+40) 80197f4: 02 31 00 01 srui r17,r17,1 80197f8: b4 2e 70 00 add r14,r1,r14 80197fc: 02 31 00 01 srui r17,r17,1 8019800: 41 c1 00 00 lbu r1,(r14+0) 8019804: 02 31 00 01 srui r17,r17,1 8019808: b8 31 88 00 or r17,r1,r17 801980c: 31 d1 00 00 sb (r14+0),r17 8019810: e3 ff ff 56 bi 8019568 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 8019814: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8019818: 36 02 00 01 addi r2,r16,1 <== NOT EXECUTED 801981c: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8019820: 37 84 00 28 addi r4,sp,40 <== NOT EXECUTED 8019824: fb ff dd 41 calli 8010d28 <== NOT EXECUTED 8019828: b8 20 68 00 mv r13,r1 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 801982c: 5c 20 ff 4f bne r1,r0,8019568 <== NOT EXECUTED return rc; *sec_buf &= 0x00; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 8019830: 02 31 00 01 srui r17,r17,1 <== 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; 8019834: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 8019838: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 801983c: 02 31 00 01 srui r17,r17,1 <== 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; 8019840: 30 20 00 00 sb (r1+0),r0 <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 8019844: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 8019848: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED 801984c: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 8019850: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 8019854: 40 22 00 00 lbu r2,(r1+0) <== NOT EXECUTED 8019858: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 801985c: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 8019860: ba 22 88 00 or r17,r17,r2 <== NOT EXECUTED 8019864: 30 31 00 00 sb (r1+0),r17 <== NOT EXECUTED 8019868: 31 6f 00 88 sb (r11+136),r15 <== NOT EXECUTED 801986c: e3 ff ff 3f bi 8019568 <== NOT EXECUTED fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 8019870: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8019874: 36 02 00 01 addi r2,r16,1 <== NOT EXECUTED 8019878: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 801987c: 37 84 00 28 addi r4,sp,40 <== NOT EXECUTED 8019880: fb ff dd 2a calli 8010d28 <== NOT EXECUTED 8019884: b8 20 68 00 mv r13,r1 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 8019888: 5c 20 ff 38 bne r1,r0,8019568 <== NOT EXECUTED return rc; *sec_buf &= 0xF0; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 801988c: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; *sec_buf &= 0xF0; 8019890: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 8019894: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 8019898: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; *sec_buf &= 0xF0; 801989c: 40 22 00 00 lbu r2,(r1+0) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 80198a0: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; *sec_buf &= 0xF0; 80198a4: 20 42 00 f0 andi r2,r2,0xf0 <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 80198a8: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; *sec_buf &= 0xF0; 80198ac: 30 22 00 00 sb (r1+0),r2 <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 80198b0: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED 80198b4: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 80198b8: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 80198bc: 40 22 00 00 lbu r2,(r1+0) <== NOT EXECUTED 80198c0: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 80198c4: ba 22 88 00 or r17,r17,r2 <== NOT EXECUTED 80198c8: 30 31 00 00 sb (r1+0),r17 <== NOT EXECUTED 80198cc: 31 6f 00 88 sb (r11+136),r15 <== NOT EXECUTED 80198d0: e3 ff ff 26 bi 8019568 <== NOT EXECUTED =============================================================================== 08011fe8 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 8011fe8: 37 9c ff e8 addi sp,sp,-24 8011fec: 5b 8b 00 18 sw (sp+24),r11 8011ff0: 5b 8c 00 14 sw (sp+20),r12 8011ff4: 5b 8d 00 10 sw (sp+16),r13 8011ff8: 5b 8e 00 0c sw (sp+12),r14 8011ffc: 5b 8f 00 08 sw (sp+8),r15 8012000: 5b 9d 00 04 sw (sp+4),ra 8012004: b8 20 58 00 mv r11,r1 int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 8012008: fb ff ff 7a calli 8011df0 801200c: b8 20 70 00 mv r14,r1 if ( rc != RC_OK ) 8012010: 5c 20 00 2e bne r1,r0,80120c8 <== NEVER TAKEN rc = -1; 8012014: 34 0d 00 00 mvi r13,0 for (i = 0; i < FAT_HASH_SIZE; i++) 8012018: 34 0f 00 18 mvi r15,24 { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; 801201c: 29 6c 00 6c lw r12,(r11+108) 8012020: b5 8d 60 00 add r12,r12,r13 while ( (node = rtems_chain_get(the_chain)) != NULL ) 8012024: e0 00 00 02 bi 801202c free(node); 8012028: fb ff c4 08 calli 8003048 */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 801202c: b9 80 08 00 mv r1,r12 8012030: fb ff d1 b4 calli 8006700 <_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 ) 8012034: 5c 20 ff fd bne r1,r0,8012028 8012038: 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++) 801203c: 5d af ff f8 bne r13,r15,801201c 8012040: 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++) 8012044: 34 0f 00 18 mvi r15,24 { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; 8012048: 29 6c 00 70 lw r12,(r11+112) 801204c: b5 8d 60 00 add r12,r12,r13 while ( (node = rtems_chain_get(the_chain)) != NULL ) 8012050: e0 00 00 02 bi 8012058 free(node); 8012054: fb ff c3 fd calli 8003048 <== NOT EXECUTED 8012058: b9 80 08 00 mv r1,r12 801205c: fb ff d1 a9 calli 8006700 <_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 ) 8012060: 5c 20 ff fd bne r1,r0,8012054 <== NEVER TAKEN 8012064: 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++) 8012068: 5d af ff f8 bne r13,r15,8012048 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); 801206c: 29 61 00 6c lw r1,(r11+108) 8012070: fb ff c3 f6 calli 8003048 free(fs_info->rhash); 8012074: 29 61 00 70 lw r1,(r11+112) 8012078: fb ff c3 f4 calli 8003048 free(fs_info->uino); 801207c: 29 61 00 74 lw r1,(r11+116) 8012080: fb ff c3 f2 calli 8003048 free(fs_info->sec_buf); 8012084: 29 61 00 90 lw r1,(r11+144) 8012088: fb ff c3 f0 calli 8003048 close(fs_info->vol.fd); 801208c: 29 61 00 60 lw r1,(r11+96) 8012090: fb ff c3 bf calli 8002f8c if (rc) 8012094: 45 c0 00 04 be r14,r0,80120a4 <== ALWAYS TAKEN errno = EIO; 8012098: f8 00 25 23 calli 801b524 <__errno> <== NOT EXECUTED 801209c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 80120a0: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED return rc; } 80120a4: b9 c0 08 00 mv r1,r14 80120a8: 2b 9d 00 04 lw ra,(sp+4) 80120ac: 2b 8b 00 18 lw r11,(sp+24) 80120b0: 2b 8c 00 14 lw r12,(sp+20) 80120b4: 2b 8d 00 10 lw r13,(sp+16) 80120b8: 2b 8e 00 0c lw r14,(sp+12) 80120bc: 2b 8f 00 08 lw r15,(sp+8) 80120c0: 37 9c 00 18 addi sp,sp,24 80120c4: c3 a0 00 00 ret int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); if ( rc != RC_OK ) rc = -1; 80120c8: 34 0e ff ff mvi r14,-1 <== NOT EXECUTED 80120cc: e3 ff ff d2 bi 8012014 <== NOT EXECUTED =============================================================================== 08011df0 : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 8011df0: 37 9c ff e8 addi sp,sp,-24 8011df4: 5b 8b 00 14 sw (sp+20),r11 8011df8: 5b 8c 00 10 sw (sp+16),r12 8011dfc: 5b 8d 00 0c sw (sp+12),r13 8011e00: 5b 8e 00 08 sw (sp+8),r14 8011e04: 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) 8011e08: 40 22 00 0e lbu r2,(r1+14) return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 8011e0c: 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) 8011e10: 34 01 00 04 mvi r1,4 8011e14: 44 41 00 0f be r2,r1,8011e50 FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET, sizeof(le_free_count), &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) 8011e18: 34 0c 00 00 mvi r12,0 rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; fat_buf_release(fs_info); 8011e1c: b9 60 08 00 mv r1,r11 8011e20: fb ff fb 47 calli 8010b3c if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 8011e24: 29 61 00 64 lw r1,(r11+100) 8011e28: fb ff f3 16 calli 800ea80 8011e2c: 5c 20 00 6d bne r1,r0,8011fe0 <== NEVER TAKEN rc = -1; return rc; } 8011e30: b9 80 08 00 mv r1,r12 8011e34: 2b 9d 00 04 lw ra,(sp+4) 8011e38: 2b 8b 00 14 lw r11,(sp+20) 8011e3c: 2b 8c 00 10 lw r12,(sp+16) 8011e40: 2b 8d 00 0c lw r13,(sp+12) 8011e44: 2b 8e 00 08 lw r14,(sp+8) 8011e48: 37 9c 00 18 addi sp,sp,24 8011e4c: c3 a0 00 00 ret { ssize_t ret1 = 0, ret2 = 0; if (fs_info->vol.type == FAT_FAT32) { uint32_t free_count = fs_info->vol.free_cls; 8011e50: 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) 8011e54: 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; 8011e58: 29 6c 00 4c lw r12,(r11+76) if (free_count != fs_info->vol.free_cls_in_fs_info) 8011e5c: 34 0e 00 00 mvi r14,0 8011e60: 45 a1 00 2d be r13,r1,8011f14 <== ALWAYS TAKEN byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8011e64: 34 02 00 18 mvi r2,24 <== NOT EXECUTED 8011e68: 21 a1 00 ff andi r1,r13,0xff <== NOT EXECUTED 8011e6c: fb ff bc be calli 8001164 <__ashlsi3> <== NOT EXECUTED 8011e70: b8 20 70 00 mv r14,r1 <== NOT EXECUTED uint32_t value ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; 8011e74: 34 02 00 18 mvi r2,24 <== NOT EXECUTED 8011e78: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8011e7c: f8 00 6f ab calli 802dd28 <__lshrsi3> <== NOT EXECUTED byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8011e80: 01 a4 00 01 srui r4,r13,1 <== NOT EXECUTED byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8011e84: b9 c1 70 00 or r14,r14,r1 <== NOT EXECUTED { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8011e88: 00 84 00 01 srui r4,r4,1 <== NOT EXECUTED byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8011e8c: 34 02 00 10 mvi r2,16 <== NOT EXECUTED { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8011e90: 00 84 00 01 srui r4,r4,1 <== NOT EXECUTED 8011e94: 00 84 00 01 srui r4,r4,1 <== NOT EXECUTED 8011e98: 00 84 00 01 srui r4,r4,1 <== NOT EXECUTED 8011e9c: 00 84 00 01 srui r4,r4,1 <== NOT EXECUTED 8011ea0: 00 84 00 01 srui r4,r4,1 <== NOT EXECUTED 8011ea4: 00 84 00 01 srui r4,r4,1 <== NOT EXECUTED byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8011ea8: 20 81 00 ff andi r1,r4,0xff <== NOT EXECUTED 8011eac: fb ff bc ae calli 8001164 <__ashlsi3> <== NOT EXECUTED 8011eb0: b9 c1 70 00 or r14,r14,r1 <== NOT EXECUTED ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; 8011eb4: 34 02 00 10 mvi r2,16 <== NOT EXECUTED 8011eb8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8011ebc: f8 00 6f 9b calli 802dd28 <__lshrsi3> <== NOT EXECUTED 8011ec0: 20 23 00 ff andi r3,r1,0xff <== NOT EXECUTED byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8011ec4: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED 8011ec8: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED 8011ecc: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED 8011ed0: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED 8011ed4: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED 8011ed8: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED { uint32_t le_free_count = CT_LE_L(free_count); fs_info->vol.free_cls_in_fs_info = free_count; ret1 = fat_sector_write(fs_info, 8011edc: 2d 62 00 40 lhu r2,(r11+64) <== NOT EXECUTED 8011ee0: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED 8011ee4: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED 8011ee8: b9 c3 30 00 or r6,r14,r3 <== NOT EXECUTED 8011eec: 34 04 00 04 mvi r4,4 <== NOT EXECUTED 8011ef0: 34 03 01 e8 mvi r3,488 <== NOT EXECUTED 8011ef4: 37 85 00 18 addi r5,sp,24 <== NOT EXECUTED if (free_count != fs_info->vol.free_cls_in_fs_info) { uint32_t le_free_count = CT_LE_L(free_count); fs_info->vol.free_cls_in_fs_info = free_count; 8011ef8: 59 6d 00 48 sw (r11+72),r13 <== NOT EXECUTED ret1 = fat_sector_write(fs_info, 8011efc: b9 60 08 00 mv r1,r11 <== 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); 8011f00: 5b 86 00 18 sw (sp+24),r6 <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; ret1 = fat_sector_write(fs_info, 8011f04: fb ff fb ff calli 8010f00 <== NOT EXECUTED 8011f08: 34 02 00 1f mvi r2,31 <== NOT EXECUTED 8011f0c: f8 00 6f 87 calli 802dd28 <__lshrsi3> <== NOT EXECUTED 8011f10: 20 2e 00 ff andi r14,r1,0xff <== 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) 8011f14: 29 62 00 50 lw r2,(r11+80) 8011f18: 34 01 00 00 mvi r1,0 8011f1c: 45 82 00 2d be r12,r2,8011fd0 <== NEVER TAKEN 8011f20: 34 02 00 18 mvi r2,24 8011f24: 21 81 00 ff andi r1,r12,0xff 8011f28: fb ff bc 8f calli 8001164 <__ashlsi3> 8011f2c: b8 20 68 00 mv r13,r1 uint32_t value ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; 8011f30: 34 02 00 18 mvi r2,24 8011f34: b9 80 08 00 mv r1,r12 8011f38: f8 00 6f 7c calli 802dd28 <__lshrsi3> byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8011f3c: 01 84 00 01 srui r4,r12,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8011f40: b9 a1 68 00 or r13,r13,r1 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8011f44: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8011f48: 34 02 00 10 mvi r2,16 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8011f4c: 00 84 00 01 srui r4,r4,1 8011f50: 00 84 00 01 srui r4,r4,1 8011f54: 00 84 00 01 srui r4,r4,1 8011f58: 00 84 00 01 srui r4,r4,1 8011f5c: 00 84 00 01 srui r4,r4,1 8011f60: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8011f64: 20 81 00 ff andi r1,r4,0xff 8011f68: fb ff bc 7f calli 8001164 <__ashlsi3> 8011f6c: b9 a1 68 00 or r13,r13,r1 ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; 8011f70: 34 02 00 10 mvi r2,16 8011f74: b9 80 08 00 mv r1,r12 8011f78: f8 00 6f 6c calli 802dd28 <__lshrsi3> 8011f7c: 20 23 00 ff andi r3,r1,0xff byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8011f80: b4 63 18 00 add r3,r3,r3 8011f84: b4 63 18 00 add r3,r3,r3 8011f88: b4 63 18 00 add r3,r3,r3 8011f8c: b4 63 18 00 add r3,r3,r3 8011f90: b4 63 18 00 add r3,r3,r3 8011f94: b4 63 18 00 add r3,r3,r3 { uint32_t le_next_free = CT_LE_L(next_free); fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 8011f98: 2d 62 00 40 lhu r2,(r11+64) 8011f9c: b4 63 18 00 add r3,r3,r3 8011fa0: b4 63 18 00 add r3,r3,r3 8011fa4: b9 a3 30 00 or r6,r13,r3 8011fa8: 34 04 00 04 mvi r4,4 8011fac: 34 03 01 ec mvi r3,492 8011fb0: 37 85 00 18 addi r5,sp,24 if (next_free != fs_info->vol.next_cl_in_fs_info) { uint32_t le_next_free = CT_LE_L(next_free); fs_info->vol.next_cl_in_fs_info = next_free; 8011fb4: 59 6c 00 50 sw (r11+80),r12 ret2 = fat_sector_write(fs_info, 8011fb8: b9 60 08 00 mv r1,r11 &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) { uint32_t le_next_free = CT_LE_L(next_free); 8011fbc: 5b 86 00 18 sw (sp+24),r6 fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 8011fc0: fb ff fb d0 calli 8010f00 8011fc4: 34 02 00 1f mvi r2,31 8011fc8: f8 00 6f 58 calli 802dd28 <__lshrsi3> 8011fcc: 20 21 00 ff andi r1,r1,0xff sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 8011fd0: b8 2e 08 00 or r1,r1,r14 8011fd4: 44 20 ff 91 be r1,r0,8011e18 <== ALWAYS TAKEN { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 8011fd8: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8011fdc: e3 ff ff 90 bi 8011e1c <== NOT EXECUTED fat_buf_release(fs_info); if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) rc = -1; 8011fe0: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8011fe4: e3 ff ff 93 bi 8011e30 <== NOT EXECUTED =============================================================================== 08036b9c : /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { 8036b9c: 37 9c ff 90 addi sp,sp,-112 8036ba0: 5b 8b 00 10 sw (sp+16),r11 8036ba4: 5b 8c 00 0c sw (sp+12),r12 8036ba8: 5b 8d 00 08 sw (sp+8),r13 8036bac: 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 ); 8036bb0: 78 02 08 06 mvhi r2,0x806 8036bb4: 38 42 a0 10 ori r2,r2,0xa010 8036bb8: 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; 8036bbc: 5b 80 00 20 sw (sp+32),r0 st.st_uid = 0; 8036bc0: 0f 80 00 26 sh (sp+38),r0 st.st_gid = 0; 8036bc4: 0f 80 00 28 sh (sp+40),r0 rtems_libio_check_fd( fd ); 8036bc8: 54 41 00 06 bgu r2,r1,8036be0 iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); 8036bcc: f8 00 16 85 calli 803c5e0 <__errno> 8036bd0: 34 02 00 09 mvi r2,9 8036bd4: 58 22 00 00 sw (r1+0),r2 8036bd8: 34 0c ff ff mvi r12,-1 8036bdc: e0 00 00 1f bi 8036c58 st.st_mode = 0; st.st_uid = 0; st.st_gid = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); 8036be0: b4 21 58 00 add r11,r1,r1 8036be4: b5 61 58 00 add r11,r11,r1 8036be8: 78 02 08 06 mvhi r2,0x806 8036bec: b5 6b 58 00 add r11,r11,r11 8036bf0: b5 6b 58 00 add r11,r11,r11 8036bf4: 38 42 de c0 ori r2,r2,0xdec0 8036bf8: c9 61 08 00 sub r1,r11,r1 8036bfc: 28 4b 00 00 lw r11,(r2+0) 8036c00: b4 21 08 00 add r1,r1,r1 8036c04: b4 21 08 00 add r1,r1,r1 8036c08: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open( iop ); 8036c0c: 29 61 00 08 lw r1,(r11+8) 8036c10: 20 21 01 00 andi r1,r1,0x100 8036c14: 44 20 ff ee be r1,r0,8036bcc if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } 8036c18: 29 61 00 20 lw r1,(r11+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 ); 8036c1c: 35 6d 00 0c addi r13,r11,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 ); 8036c20: 28 22 00 0c lw r2,(r1+12) 8036c24: 28 42 00 00 lw r2,(r2+0) 8036c28: d8 40 00 00 call r2 8036c2c: 29 63 00 1c lw r3,(r11+28) 8036c30: b9 a0 08 00 mv r1,r13 8036c34: 37 82 00 14 addi r2,sp,20 8036c38: 28 63 00 18 lw r3,(r3+24) 8036c3c: d8 60 00 00 call r3 8036c40: b8 20 60 00 mv r12,r1 if ( rv == 0 ) { 8036c44: 44 20 00 0c be r1,r0,8036c74 <== ALWAYS TAKEN if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } 8036c48: 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 ); 8036c4c: 28 22 00 0c lw r2,(r1+12) 8036c50: 28 42 00 04 lw r2,(r2+4) 8036c54: d8 40 00 00 call r2 8036c58: b9 80 08 00 mv r1,r12 8036c5c: 2b 9d 00 04 lw ra,(sp+4) 8036c60: 2b 8b 00 10 lw r11,(sp+16) 8036c64: 2b 8c 00 0c lw r12,(sp+12) 8036c68: 2b 8d 00 08 lw r13,(sp+8) 8036c6c: 37 9c 00 70 addi sp,sp,112 8036c70: c3 a0 00 00 ret rtems_libio_check_is_open( iop ); rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, &st ); if ( rv == 0 ) { bool access_ok = rtems_filesystem_check_access( 8036c74: 2b 82 00 20 lw r2,(sp+32) 8036c78: 2f 83 00 26 lhu r3,(sp+38) 8036c7c: 2f 84 00 28 lhu r4,(sp+40) 8036c80: 34 01 00 01 mvi r1,1 8036c84: fb ff 53 5a calli 800b9ec st.st_mode, st.st_uid, st.st_gid ); if ( access_ok ) { 8036c88: 44 2c 00 14 be r1,r12,8036cd8 rtems_filesystem_location_clone( &loc, &iop->pathinfo ); 8036c8c: 37 8c 00 5c addi r12,sp,92 8036c90: b9 a0 10 00 mv r2,r13 8036c94: b9 80 08 00 mv r1,r12 8036c98: fb ff 51 5c calli 800b208 if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } 8036c9c: 29 62 00 20 lw r2,(r11+32) 8036ca0: 28 43 00 0c lw r3,(r2+12) 8036ca4: b8 40 08 00 mv r1,r2 8036ca8: 28 62 00 04 lw r2,(r3+4) 8036cac: d8 40 00 00 call r2 } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); 8036cb0: b9 80 08 00 mv r1,r12 8036cb4: fb ff b6 4e calli 80245ec 8036cb8: b8 20 60 00 mv r12,r1 } return rv; } 8036cbc: b9 80 08 00 mv r1,r12 8036cc0: 2b 9d 00 04 lw ra,(sp+4) 8036cc4: 2b 8b 00 10 lw r11,(sp+16) 8036cc8: 2b 8c 00 0c lw r12,(sp+12) 8036ccc: 2b 8d 00 08 lw r13,(sp+8) 8036cd0: 37 9c 00 70 addi sp,sp,112 8036cd4: c3 a0 00 00 ret ); if ( access_ok ) { rtems_filesystem_location_clone( &loc, &iop->pathinfo ); } else { errno = EACCES; 8036cd8: f8 00 16 42 calli 803c5e0 <__errno> 8036cdc: 34 02 00 0d mvi r2,13 8036ce0: 58 22 00 00 sw (r1+0),r2 rv = -1; 8036ce4: 34 0c ff ff mvi r12,-1 8036ce8: e3 ff ff d8 bi 8036c48 =============================================================================== 08024c4c : /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 8024c4c: 37 9c ff f0 addi sp,sp,-16 8024c50: 5b 8b 00 0c sw (sp+12),r11 8024c54: 5b 8c 00 08 sw (sp+8),r12 8024c58: 5b 9d 00 04 sw (sp+4),ra int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8024c5c: 78 03 08 06 mvhi r3,0x806 8024c60: 38 63 a0 10 ori r3,r3,0xa010 8024c64: 28 63 00 00 lw r3,(r3+0) 8024c68: 54 61 00 06 bgu r3,r1,8024c80 <== NEVER TAKEN iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 8024c6c: f8 00 5e 5d calli 803c5e0 <__errno> 8024c70: 34 02 00 09 mvi r2,9 8024c74: 58 22 00 00 sw (r1+0),r2 8024c78: 34 0c ff ff mvi r12,-1 8024c7c: e0 00 00 21 bi 8024d00 { int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); 8024c80: b4 21 58 00 add r11,r1,r1 8024c84: b5 61 58 00 add r11,r11,r1 8024c88: 78 03 08 06 mvhi r3,0x806 8024c8c: b5 6b 58 00 add r11,r11,r11 8024c90: b5 6b 58 00 add r11,r11,r11 8024c94: 38 63 de c0 ori r3,r3,0xdec0 8024c98: c9 61 08 00 sub r1,r11,r1 8024c9c: 28 6b 00 00 lw r11,(r3+0) 8024ca0: b4 21 08 00 add r1,r1,r1 8024ca4: b4 21 08 00 add r1,r1,r1 8024ca8: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open(iop); 8024cac: 29 61 00 08 lw r1,(r11+8) 8024cb0: 20 21 01 00 andi r1,r1,0x100 8024cb4: 44 20 ff ee be r1,r0,8024c6c <== NEVER TAKEN if (iop->pathinfo.mt_entry->writeable) { 8024cb8: 29 61 00 20 lw r1,(r11+32) 8024cbc: 40 23 00 29 lbu r3,(r1+41) 8024cc0: 44 60 00 16 be r3,r0,8024d18 <== 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 ); 8024cc4: 28 23 00 0c lw r3,(r1+12) 8024cc8: 28 63 00 00 lw r3,(r3+0) 8024ccc: 5b 82 00 10 sw (sp+16),r2 8024cd0: d8 60 00 00 call r3 rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); 8024cd4: 29 63 00 20 lw r3,(r11+32) 8024cd8: 2b 82 00 10 lw r2,(sp+16) 8024cdc: 35 61 00 0c addi r1,r11,12 8024ce0: 28 63 00 0c lw r3,(r3+12) 8024ce4: 28 63 00 20 lw r3,(r3+32) 8024ce8: d8 60 00 00 call r3 8024cec: b8 20 60 00 mv r12,r1 errno = EROFS; rv = -1; } return rv; } 8024cf0: 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 ); 8024cf4: 28 22 00 0c lw r2,(r1+12) 8024cf8: 28 42 00 04 lw r2,(r2+4) 8024cfc: d8 40 00 00 call r2 8024d00: b9 80 08 00 mv r1,r12 8024d04: 2b 9d 00 04 lw ra,(sp+4) 8024d08: 2b 8b 00 0c lw r11,(sp+12) 8024d0c: 2b 8c 00 08 lw r12,(sp+8) 8024d10: 37 9c 00 10 addi sp,sp,16 8024d14: c3 a0 00 00 ret 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; 8024d18: f8 00 5e 32 calli 803c5e0 <__errno> <== NOT EXECUTED 8024d1c: 34 02 00 1e mvi r2,30 <== NOT EXECUTED rv = -1; 8024d20: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 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; 8024d24: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; } return rv; } 8024d28: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8024d2c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8024d30: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED 8024d34: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED 8024d38: 37 9c 00 10 addi sp,sp,16 <== NOT EXECUTED 8024d3c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08024d40 : /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 8024d40: 37 9c ff f0 addi sp,sp,-16 8024d44: 5b 8b 00 10 sw (sp+16),r11 8024d48: 5b 8c 00 0c sw (sp+12),r12 8024d4c: 5b 8d 00 08 sw (sp+8),r13 8024d50: 5b 9d 00 04 sw (sp+4),ra int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8024d54: 78 04 08 06 mvhi r4,0x806 8024d58: 38 84 a0 10 ori r4,r4,0xa010 8024d5c: 28 84 00 00 lw r4,(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 ) { 8024d60: 20 4d ff ff andi r13,r2,0xffff 8024d64: 20 6c ff ff andi r12,r3,0xffff int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8024d68: 54 81 00 06 bgu r4,r1,8024d80 iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 8024d6c: f8 00 5e 1d calli 803c5e0 <__errno> 8024d70: 34 02 00 09 mvi r2,9 8024d74: 58 22 00 00 sw (r1+0),r2 8024d78: 34 0c ff ff mvi r12,-1 8024d7c: e0 00 00 21 bi 8024e00 { int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); 8024d80: b4 21 58 00 add r11,r1,r1 8024d84: b5 61 58 00 add r11,r11,r1 8024d88: 78 04 08 06 mvhi r4,0x806 8024d8c: b5 6b 58 00 add r11,r11,r11 8024d90: b5 6b 58 00 add r11,r11,r11 8024d94: 38 84 de c0 ori r4,r4,0xdec0 8024d98: c9 61 08 00 sub r1,r11,r1 8024d9c: 28 8b 00 00 lw r11,(r4+0) 8024da0: b4 21 08 00 add r1,r1,r1 8024da4: b4 21 08 00 add r1,r1,r1 8024da8: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open(iop); 8024dac: 29 61 00 08 lw r1,(r11+8) 8024db0: 20 21 01 00 andi r1,r1,0x100 8024db4: 44 20 ff ee be r1,r0,8024d6c if (iop->pathinfo.mt_entry->writeable) { 8024db8: 29 61 00 20 lw r1,(r11+32) 8024dbc: 40 24 00 29 lbu r4,(r1+41) 8024dc0: 44 80 00 17 be r4,r0,8024e1c <== 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 ); 8024dc4: 28 22 00 0c lw r2,(r1+12) 8024dc8: 28 42 00 00 lw r2,(r2+0) 8024dcc: d8 40 00 00 call r2 rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( 8024dd0: 29 63 00 20 lw r3,(r11+32) 8024dd4: b9 a0 10 00 mv r2,r13 8024dd8: 35 61 00 0c addi r1,r11,12 8024ddc: 28 64 00 0c lw r4,(r3+12) 8024de0: b9 80 18 00 mv r3,r12 8024de4: 28 84 00 24 lw r4,(r4+36) 8024de8: d8 80 00 00 call r4 8024dec: b8 20 60 00 mv r12,r1 errno = EROFS; rv = -1; } return rv; } 8024df0: 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 ); 8024df4: 28 22 00 0c lw r2,(r1+12) 8024df8: 28 42 00 04 lw r2,(r2+4) 8024dfc: d8 40 00 00 call r2 8024e00: b9 80 08 00 mv r1,r12 8024e04: 2b 9d 00 04 lw ra,(sp+4) 8024e08: 2b 8b 00 10 lw r11,(sp+16) 8024e0c: 2b 8c 00 0c lw r12,(sp+12) 8024e10: 2b 8d 00 08 lw r13,(sp+8) 8024e14: 37 9c 00 10 addi sp,sp,16 8024e18: c3 a0 00 00 ret owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 8024e1c: f8 00 5d f1 calli 803c5e0 <__errno> <== NOT EXECUTED 8024e20: 34 02 00 1e mvi r2,30 <== NOT EXECUTED rv = -1; 8024e24: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 8024e28: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; } return rv; } 8024e2c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8024e30: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8024e34: 2b 8b 00 10 lw r11,(sp+16) <== NOT EXECUTED 8024e38: 2b 8c 00 0c lw r12,(sp+12) <== NOT EXECUTED 8024e3c: 2b 8d 00 08 lw r13,(sp+8) <== NOT EXECUTED 8024e40: 37 9c 00 10 addi sp,sp,16 <== NOT EXECUTED 8024e44: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08035d60 : int fcntl( int fd, int cmd, ... ) { 8035d60: 37 9c ff c8 addi sp,sp,-56 8035d64: 5b 8b 00 1c sw (sp+28),r11 8035d68: 5b 8c 00 18 sw (sp+24),r12 8035d6c: 5b 8d 00 14 sw (sp+20),r13 8035d70: 5b 8e 00 10 sw (sp+16),r14 8035d74: 5b 8f 00 0c sw (sp+12),r15 8035d78: 5b 90 00 08 sw (sp+8),r16 8035d7c: 5b 9d 00 04 sw (sp+4),ra int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8035d80: 78 09 08 03 mvhi r9,0x803 8035d84: 39 29 c0 14 ori r9,r9,0xc014 8035d88: 29 29 00 00 lw r9,(r9+0) int fcntl( int fd, int cmd, ... ) { 8035d8c: 5b 84 00 28 sw (sp+40),r4 8035d90: 5b 82 00 20 sw (sp+32),r2 8035d94: 5b 83 00 24 sw (sp+36),r3 8035d98: 5b 85 00 2c sw (sp+44),r5 8035d9c: 5b 86 00 30 sw (sp+48),r6 8035da0: 5b 87 00 34 sw (sp+52),r7 8035da4: 5b 88 00 38 sw (sp+56),r8 8035da8: b8 40 58 00 mv r11,r2 int ret; va_list ap; va_start( ap, cmd ); 8035dac: 37 84 00 24 addi r4,sp,36 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8035db0: 55 21 00 06 bgu r9,r1,8035dc8 iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 8035db4: fb ff b1 f8 calli 8022594 <__errno> 8035db8: 34 02 00 09 mvi r2,9 8035dbc: 58 22 00 00 sw (r1+0),r2 8035dc0: 34 0d ff ff mvi r13,-1 8035dc4: e0 00 00 1c bi 8035e34 int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); 8035dc8: b4 21 60 00 add r12,r1,r1 8035dcc: b5 81 60 00 add r12,r12,r1 8035dd0: 78 0e 08 04 mvhi r14,0x804 8035dd4: b5 8c 60 00 add r12,r12,r12 8035dd8: b5 8c 60 00 add r12,r12,r12 8035ddc: 39 ce c9 14 ori r14,r14,0xc914 8035de0: c9 81 08 00 sub r1,r12,r1 8035de4: 29 cc 00 00 lw r12,(r14+0) 8035de8: b4 21 08 00 add r1,r1,r1 8035dec: b4 21 08 00 add r1,r1,r1 8035df0: b5 81 60 00 add r12,r12,r1 rtems_libio_check_is_open(iop); 8035df4: 29 81 00 08 lw r1,(r12+8) 8035df8: 20 22 01 00 andi r2,r1,0x100 8035dfc: 44 40 ff ee be r2,r0,8035db4 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 8035e00: 34 02 00 09 mvi r2,9 8035e04: 55 62 00 74 bgu r11,r2,8035fd4 8035e08: 78 03 08 03 mvhi r3,0x803 8035e0c: b5 6b 10 00 add r2,r11,r11 8035e10: 38 63 ba 30 ori r3,r3,0xba30 8035e14: b4 42 10 00 add r2,r2,r2 8035e18: b4 62 10 00 add r2,r3,r2 8035e1c: 28 42 00 00 lw r2,(r2+0) 8035e20: c0 40 00 00 b r2 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 8035e24: fb ff b1 dc calli 8022594 <__errno> 8035e28: 34 02 00 86 mvi r2,134 8035e2c: 58 22 00 00 sw (r1+0),r2 if (ret >= 0) { int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); if (err) { errno = err; ret = -1; 8035e30: 34 0d ff ff mvi r13,-1 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 8035e34: b9 a0 08 00 mv r1,r13 8035e38: 2b 9d 00 04 lw ra,(sp+4) 8035e3c: 2b 8b 00 1c lw r11,(sp+28) 8035e40: 2b 8c 00 18 lw r12,(sp+24) 8035e44: 2b 8d 00 14 lw r13,(sp+20) 8035e48: 2b 8e 00 10 lw r14,(sp+16) 8035e4c: 2b 8f 00 0c lw r15,(sp+12) 8035e50: 2b 90 00 08 lw r16,(sp+8) 8035e54: 37 9c 00 38 addi sp,sp,56 8035e58: c3 a0 00 00 ret case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 8035e5c: 28 81 00 00 lw r1,(r4+0) { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 8035e60: 34 0d 00 00 mvi r13,0 case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 8035e64: fb ff 44 6d calli 8007018 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 8035e68: 29 83 00 08 lw r3,(r12+8) 8035e6c: 34 02 fd fe mvi r2,-514 8035e70: 20 21 02 01 andi r1,r1,0x201 8035e74: a0 43 10 00 and r2,r2,r3 8035e78: b8 22 08 00 or r1,r1,r2 8035e7c: 59 81 00 08 sw (r12+8),r1 * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 8035e80: 29 83 00 1c lw r3,(r12+28) 8035e84: b9 60 10 00 mv r2,r11 8035e88: b9 80 08 00 mv r1,r12 8035e8c: 28 63 00 28 lw r3,(r3+40) 8035e90: d8 60 00 00 call r3 8035e94: b8 20 58 00 mv r11,r1 if (err) { 8035e98: 44 20 ff e7 be r1,r0,8035e34 <== ALWAYS TAKEN errno = err; 8035e9c: fb ff b1 be calli 8022594 <__errno> <== NOT EXECUTED 8035ea0: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED 8035ea4: e3 ff ff e3 bi 8035e30 <== NOT EXECUTED else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 8035ea8: fb ff 44 72 calli 8007070 8035eac: b8 20 68 00 mv r13,r1 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 8035eb0: 48 0d ff e1 bg r0,r13,8035e34 <== NEVER TAKEN 8035eb4: e3 ff ff f3 bi 8035e80 * 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 ) ) 8035eb8: 28 82 00 00 lw r2,(r4+0) 8035ebc: 44 40 00 4a be r2,r0,8035fe4 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 8035ec0: 38 21 08 00 ori r1,r1,0x800 8035ec4: 59 81 00 08 sw (r12+8),r1 { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 8035ec8: 34 0d 00 00 mvi r13,0 8035ecc: e3 ff ff ed bi 8035e80 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); 8035ed0: 20 2d 08 00 andi r13,r1,0x800 8035ed4: 7d ad 00 00 cmpnei r13,r13,0 8035ed8: e3 ff ff ea bi 8035e80 /* * FIXME: We ignore the start value fd2 for the file descriptor search. This * is not POSIX conform. */ rtems_libio_t *diop = rtems_libio_allocate(); 8035edc: fb ff 44 7a calli 80070c4 8035ee0: b8 20 78 00 mv r15,r1 if (diop != NULL) { 8035ee4: 44 20 ff d3 be r1,r0,8035e30 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 8035ee8: 29 81 00 08 lw r1,(r12+8) oflag &= ~O_CREAT; 8035eec: 34 0d fd ff mvi r13,-513 * is not POSIX conform. */ rtems_libio_t *diop = rtems_libio_allocate(); if (diop != NULL) { int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 8035ef0: fb ff 44 60 calli 8007070 oflag &= ~O_CREAT; 8035ef4: a0 2d 68 00 and r13,r1,r13 diop->flags |= rtems_libio_fcntl_flags( oflag ); 8035ef8: b9 a0 08 00 mv r1,r13 8035efc: 29 f0 00 08 lw r16,(r15+8) 8035f00: fb ff 44 46 calli 8007018 int cmd, int arg ) { return fcntl( fd, cmd, arg ); } 8035f04: 29 82 00 20 lw r2,(r12+32) if (diop != NULL) { int oflag = rtems_libio_to_fcntl_flags( iop->flags ); oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); 8035f08: b8 30 08 00 or r1,r1,r16 8035f0c: 59 e1 00 08 sw (r15+8),r1 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 ); 8035f10: 28 43 00 0c lw r3,(r2+12) 8035f14: b8 40 08 00 mv r1,r2 8035f18: 28 62 00 00 lw r2,(r3+0) 8035f1c: d8 40 00 00 call r2 rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); 8035f20: 35 82 00 0c addi r2,r12,12 8035f24: 35 e1 00 0c addi r1,r15,12 8035f28: fb ff 80 4b calli 8016054 int cmd, int arg ) { return fcntl( fd, cmd, arg ); } 8035f2c: 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 ); 8035f30: 28 22 00 0c lw r2,(r1+12) 8035f34: 28 42 00 04 lw r2,(r2+4) 8035f38: 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 ); 8035f3c: 29 e3 00 1c lw r3,(r15+28) 8035f40: b9 e0 08 00 mv r1,r15 8035f44: 34 02 00 00 mvi r2,0 8035f48: 28 65 00 00 lw r5,(r3+0) 8035f4c: 34 04 00 00 mvi r4,0 8035f50: b9 a0 18 00 mv r3,r13 8035f54: d8 a0 00 00 call r5 8035f58: b8 20 68 00 mv r13,r1 if ( rv == 0 ) { 8035f5c: 5c 20 00 27 bne r1,r0,8035ff8 <== NEVER TAKEN rv = diop - rtems_libio_iops; 8035f60: 29 c1 00 00 lw r1,(r14+0) 8035f64: 34 02 00 0f mvi r2,15 8035f68: c9 e1 78 00 sub r15,r15,r1 8035f6c: 15 ef 00 01 sri r15,r15,1 8035f70: 15 ef 00 01 sri r15,r15,1 8035f74: b5 ef 08 00 add r1,r15,r15 8035f78: b4 21 08 00 add r1,r1,r1 8035f7c: b4 21 08 00 add r1,r1,r1 8035f80: b4 21 08 00 add r1,r1,r1 8035f84: b4 21 08 00 add r1,r1,r1 8035f88: b4 21 18 00 add r3,r1,r1 8035f8c: b4 63 18 00 add r3,r3,r3 8035f90: b4 63 18 00 add r3,r3,r3 8035f94: b4 63 18 00 add r3,r3,r3 8035f98: b4 63 18 00 add r3,r3,r3 8035f9c: c8 61 08 00 sub r1,r3,r1 8035fa0: b4 2f 08 00 add r1,r1,r15 8035fa4: b4 21 20 00 add r4,r1,r1 8035fa8: b4 84 20 00 add r4,r4,r4 8035fac: b4 84 20 00 add r4,r4,r4 8035fb0: b4 24 68 00 add r13,r1,r4 8035fb4: b5 ad 68 00 add r13,r13,r13 8035fb8: b5 ad 68 00 add r13,r13,r13 8035fbc: b9 a0 08 00 mv r1,r13 8035fc0: fb ff fe 89 calli 80359e4 <__ashlsi3> 8035fc4: c9 af 68 00 sub r13,r13,r15 8035fc8: c9 a1 68 00 sub r13,r13,r1 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 8035fcc: 48 0d ff 9a bg r0,r13,8035e34 <== NEVER TAKEN 8035fd0: e3 ff ff ac bi 8035e80 errno = ENOTSUP; ret = -1; break; default: errno = EINVAL; 8035fd4: fb ff b1 70 calli 8022594 <__errno> 8035fd8: 34 02 00 16 mvi r2,22 8035fdc: 58 22 00 00 sw (r1+0),r2 8035fe0: e3 ff ff 94 bi 8035e30 */ if ( va_arg( ap, int ) ) iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 8035fe4: 34 02 f7 ff mvi r2,-2049 8035fe8: a0 22 08 00 and r1,r1,r2 8035fec: 59 81 00 08 sw (r12+8),r1 { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 8035ff0: 34 0d 00 00 mvi r13,0 8035ff4: e3 ff ff a3 bi 8035e80 */ rv = (*diop->pathinfo.handlers->open_h)( diop, NULL, oflag, 0 ); if ( rv == 0 ) { rv = diop - rtems_libio_iops; } else { rtems_libio_free( diop ); 8035ff8: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 8035ffc: fb ff 44 56 calli 8007154 <== NOT EXECUTED /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 8036000: 48 0d ff 8d bg r0,r13,8035e34 <== NOT EXECUTED 8036004: e3 ff ff 9f bi 8035e80 <== NOT EXECUTED =============================================================================== 0800a910 : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 800a910: 37 9c ff dc addi sp,sp,-36 800a914: 5b 8b 00 20 sw (sp+32),r11 800a918: 5b 8c 00 1c sw (sp+28),r12 800a91c: 5b 8d 00 18 sw (sp+24),r13 800a920: 5b 8e 00 14 sw (sp+20),r14 800a924: 5b 8f 00 10 sw (sp+16),r15 800a928: 5b 90 00 0c sw (sp+12),r16 800a92c: 5b 91 00 08 sw (sp+8),r17 800a930: 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) { 800a934: 78 0b 08 02 mvhi r11,0x802 800a938: 39 6b 37 0c ori r11,r11,0x370c 800a93c: 29 6c 00 00 lw r12,(r11+0) int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 800a940: b8 20 70 00 mv r14,r1 800a944: b8 40 68 00 mv r13,r2 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 800a948: 45 80 00 2c be r12,r0,800a9f8 rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 800a94c: b9 80 08 00 mv r1,r12 800a950: 34 02 00 00 mvi r2,0 800a954: 34 03 00 00 mvi r3,0 800a958: fb ff ea ee calli 8005510 } if (sc == RTEMS_SUCCESSFUL) { 800a95c: 34 0c ff f4 mvi r12,-12 800a960: 5c 20 00 1b bne r1,r0,800a9cc <== NEVER TAKEN err = pipe_lock(); if (err) return err; pipe = *pipep; 800a964: 29 cb 00 00 lw r11,(r14+0) if (pipe == NULL) { 800a968: 45 61 00 80 be r11,r1,800ab68 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 800a96c: 29 61 00 28 lw r1,(r11+40) 800a970: 34 02 00 00 mvi r2,0 800a974: 34 03 00 00 mvi r3,0 800a978: fb ff ea e6 calli 8005510 800a97c: 7c 21 00 00 cmpnei r1,r1,0 err = -EINTR; if (*pipep == NULL) { 800a980: 29 c2 00 00 lw r2,(r14+0) err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 800a984: c8 01 60 00 sub r12,r0,r1 800a988: 34 03 ff fc mvi r3,-4 800a98c: a1 83 60 00 and r12,r12,r3 err = -EINTR; if (*pipep == NULL) { 800a990: 44 40 00 b7 be r2,r0,800ac6c else *pipep = pipe; } out: pipe_unlock(); 800a994: fb ff ff 89 calli 800a7b8 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 800a998: 5d 80 00 0d bne r12,r0,800a9cc <== NEVER TAKEN return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 800a99c: 29 a1 00 08 lw r1,(r13+8) 800a9a0: 34 02 00 04 mvi r2,4 int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; 800a9a4: 29 cb 00 00 lw r11,(r14+0) switch (LIBIO_ACCMODE(iop)) { 800a9a8: 20 21 00 06 andi r1,r1,0x6 800a9ac: 44 22 00 1f be r1,r2,800aa28 800a9b0: 34 02 00 06 mvi r2,6 800a9b4: 44 22 00 5b be r1,r2,800ab20 800a9b8: 34 02 00 02 mvi r2,2 800a9bc: 44 22 00 3c be r1,r2,800aaac <== ALWAYS TAKEN if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); break; } PIPE_UNLOCK(pipe); 800a9c0: 29 61 00 28 lw r1,(r11+40) return 0; 800a9c4: 34 0c 00 00 mvi r12,0 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); break; } PIPE_UNLOCK(pipe); 800a9c8: fb ff eb 2e calli 8005680 return 0; out_error: pipe_release(pipep, iop); return err; } 800a9cc: b9 80 08 00 mv r1,r12 800a9d0: 2b 9d 00 04 lw ra,(sp+4) 800a9d4: 2b 8b 00 20 lw r11,(sp+32) 800a9d8: 2b 8c 00 1c lw r12,(sp+28) 800a9dc: 2b 8d 00 18 lw r13,(sp+24) 800a9e0: 2b 8e 00 14 lw r14,(sp+20) 800a9e4: 2b 8f 00 10 lw r15,(sp+16) 800a9e8: 2b 90 00 0c lw r16,(sp+12) 800a9ec: 2b 91 00 08 lw r17,(sp+8) 800a9f0: 37 9c 00 24 addi sp,sp,36 800a9f4: c3 a0 00 00 ret */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 800a9f8: 78 0f 08 02 mvhi r15,0x802 800a9fc: 39 ef 37 88 ori r15,r15,0x3788 800aa00: 29 e1 00 00 lw r1,(r15+0) 800aa04: 34 02 00 00 mvi r2,0 800aa08: 34 03 00 00 mvi r3,0 800aa0c: fb ff ea c1 calli 8005510 rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 800aa10: 29 61 00 00 lw r1,(r11+0) 800aa14: 44 2c 00 9a be r1,r12,800ac7c <== ALWAYS TAKEN } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 800aa18: 29 e1 00 00 lw r1,(r15+0) <== NOT EXECUTED 800aa1c: fb ff eb 19 calli 8005680 <== NOT EXECUTED 800aa20: 29 6c 00 00 lw r12,(r11+0) <== NOT EXECUTED 800aa24: e3 ff ff ca bi 800a94c <== NOT EXECUTED } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 800aa28: 29 63 00 24 lw r3,(r11+36) if (pipe->Writers ++ == 0) 800aa2c: 29 61 00 14 lw r1,(r11+20) } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 800aa30: 34 63 00 01 addi r3,r3,1 if (pipe->Writers ++ == 0) 800aa34: 34 22 00 01 addi r2,r1,1 } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 800aa38: 59 63 00 24 sw (r11+36),r3 if (pipe->Writers ++ == 0) 800aa3c: 59 62 00 14 sw (r11+20),r2 800aa40: 44 20 00 a6 be r1,r0,800acd8 <== ALWAYS TAKEN PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 800aa44: 29 61 00 10 lw r1,(r11+16) 800aa48: 5c 20 ff de bne r1,r0,800a9c0 800aa4c: 29 a2 00 08 lw r2,(r13+8) 800aa50: 20 42 00 01 andi r2,r2,0x1 800aa54: 5c 41 00 b1 bne r2,r1,800ad18 err = -ENXIO; goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; 800aa58: 29 6f 00 20 lw r15,(r11+32) 800aa5c: e0 00 00 06 bi 800aa74 err = -EINTR; do { PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) goto out_error; if (! PIPE_LOCK(pipe)) 800aa60: 29 61 00 28 lw r1,(r11+40) 800aa64: fb ff ea ab calli 8005510 800aa68: 5c 2c 00 0c bne r1,r12,800aa98 <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->readerCounter); 800aa6c: 29 61 00 20 lw r1,(r11+32) 800aa70: 5c 2f ff d4 bne r1,r15,800a9c0 <== ALWAYS TAKEN if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); 800aa74: 29 61 00 28 lw r1,(r11+40) 800aa78: fb ff eb 02 calli 8005680 if (! PIPE_WRITEWAIT(pipe)) 800aa7c: 29 61 00 30 lw r1,(r11+48) 800aa80: 34 02 00 00 mvi r2,0 800aa84: f8 00 05 3f calli 800bf80 800aa88: b8 20 60 00 mv r12,r1 goto out_error; if (! PIPE_LOCK(pipe)) 800aa8c: 34 02 00 00 mvi r2,0 800aa90: 34 03 00 00 mvi r3,0 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) 800aa94: 44 20 ff f3 be r1,r0,800aa60 <== ALWAYS TAKEN goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; 800aa98: 34 0c ff fc mvi r12,-4 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 800aa9c: b9 c0 08 00 mv r1,r14 800aaa0: b9 a0 10 00 mv r2,r13 800aaa4: fb ff ff 4e calli 800a7dc return err; 800aaa8: e3 ff ff c9 bi 800a9cc return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; 800aaac: 29 63 00 20 lw r3,(r11+32) if (pipe->Readers ++ == 0) 800aab0: 29 61 00 10 lw r1,(r11+16) return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; 800aab4: 34 63 00 01 addi r3,r3,1 if (pipe->Readers ++ == 0) 800aab8: 34 22 00 01 addi r2,r1,1 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; 800aabc: 59 63 00 20 sw (r11+32),r3 if (pipe->Readers ++ == 0) 800aac0: 59 62 00 10 sw (r11+16),r2 800aac4: 44 20 00 7d be r1,r0,800acb8 <== ALWAYS TAKEN PIPE_WAKEUPWRITERS(pipe); if (pipe->Writers == 0) { 800aac8: 29 61 00 14 lw r1,(r11+20) 800aacc: 5c 20 ff bd bne r1,r0,800a9c0 /* Not an error */ if (LIBIO_NODELAY(iop)) 800aad0: 29 a2 00 08 lw r2,(r13+8) 800aad4: 20 42 00 01 andi r2,r2,0x1 800aad8: 5c 41 ff ba bne r2,r1,800a9c0 break; prevCounter = pipe->writerCounter; 800aadc: 29 6f 00 24 lw r15,(r11+36) 800aae0: e0 00 00 06 bi 800aaf8 /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) goto out_error; if (! PIPE_LOCK(pipe)) 800aae4: 29 61 00 28 lw r1,(r11+40) 800aae8: fb ff ea 8a calli 8005510 800aaec: 5c 2c ff eb bne r1,r12,800aa98 <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->writerCounter); 800aaf0: 29 61 00 24 lw r1,(r11+36) 800aaf4: 5c 2f ff b3 bne r1,r15,800a9c0 <== ALWAYS TAKEN prevCounter = pipe->writerCounter; err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 800aaf8: 29 61 00 28 lw r1,(r11+40) 800aafc: fb ff ea e1 calli 8005680 if (! PIPE_READWAIT(pipe)) 800ab00: 29 61 00 2c lw r1,(r11+44) 800ab04: 34 02 00 00 mvi r2,0 800ab08: f8 00 05 1e calli 800bf80 800ab0c: b8 20 60 00 mv r12,r1 goto out_error; if (! PIPE_LOCK(pipe)) 800ab10: 34 02 00 00 mvi r2,0 800ab14: 34 03 00 00 mvi r3,0 prevCounter = pipe->writerCounter; err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) 800ab18: 44 20 ff f3 be r1,r0,800aae4 <== ALWAYS TAKEN 800ab1c: e3 ff ff df bi 800aa98 <== NOT EXECUTED } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 800ab20: 29 63 00 20 lw r3,(r11+32) if (pipe->Readers ++ == 0) 800ab24: 29 61 00 10 lw r1,(r11+16) } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 800ab28: 34 63 00 01 addi r3,r3,1 if (pipe->Readers ++ == 0) 800ab2c: 34 22 00 01 addi r2,r1,1 } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 800ab30: 59 63 00 20 sw (r11+32),r3 if (pipe->Readers ++ == 0) 800ab34: 59 62 00 10 sw (r11+16),r2 800ab38: 44 20 00 64 be r1,r0,800acc8 <== ALWAYS TAKEN PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; 800ab3c: 29 63 00 24 lw r3,(r11+36) if (pipe->Writers ++ == 0) 800ab40: 29 61 00 14 lw r1,(r11+20) case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; 800ab44: 34 63 00 01 addi r3,r3,1 if (pipe->Writers ++ == 0) 800ab48: 34 22 00 01 addi r2,r1,1 case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; 800ab4c: 59 63 00 24 sw (r11+36),r3 if (pipe->Writers ++ == 0) 800ab50: 59 62 00 14 sw (r11+20),r2 800ab54: 5c 20 ff 9b bne r1,r0,800a9c0 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 800ab58: 29 61 00 2c lw r1,(r11+44) 800ab5c: 37 82 00 24 addi r2,sp,36 800ab60: f8 00 04 e7 calli 800befc 800ab64: e3 ff ff 97 bi 800a9c0 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 800ab68: 34 01 00 34 mvi r1,52 800ab6c: fb ff e0 82 calli 8002d74 800ab70: b8 20 58 00 mv r11,r1 800ab74: b8 20 88 00 mv r17,r1 if (pipe == NULL) 800ab78: 44 20 00 74 be r1,r0,800ad48 return err; memset(pipe, 0, sizeof(pipe_control_t)); 800ab7c: 58 20 00 00 sw (r1+0),r0 800ab80: 58 20 00 08 sw (r1+8),r0 800ab84: 58 20 00 0c sw (r1+12),r0 800ab88: 58 20 00 10 sw (r1+16),r0 800ab8c: 58 20 00 14 sw (r1+20),r0 800ab90: 58 20 00 18 sw (r1+24),r0 800ab94: 58 20 00 1c sw (r1+28),r0 800ab98: 58 20 00 20 sw (r1+32),r0 800ab9c: 58 20 00 24 sw (r1+36),r0 800aba0: 58 20 00 28 sw (r1+40),r0 800aba4: 58 20 00 2c sw (r1+44),r0 800aba8: 58 20 00 30 sw (r1+48),r0 pipe->Size = PIPE_BUF; 800abac: 34 01 02 00 mvi r1,512 800abb0: 59 61 00 04 sw (r11+4),r1 pipe->Buffer = malloc(pipe->Size); 800abb4: fb ff e0 70 calli 8002d74 800abb8: 59 61 00 00 sw (r11+0),r1 if (! pipe->Buffer) 800abbc: 44 20 00 61 be r1,r0,800ad40 <== NEVER TAKEN goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), 800abc0: 78 0c 08 02 mvhi r12,0x802 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 800abc4: 78 05 08 02 mvhi r5,0x802 800abc8: 38 a5 18 b0 ori r5,r5,0x18b0 rtems_build_name ('P', 'I', 'r', c), 800abcc: 39 8c 31 b0 ori r12,r12,0x31b0 800abd0: 41 84 00 00 lbu r4,(r12+0) if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 800abd4: 28 a1 00 00 lw r1,(r5+0) 800abd8: 34 02 00 00 mvi r2,0 800abdc: 34 03 00 00 mvi r3,0 800abe0: b8 81 08 00 or r1,r4,r1 800abe4: 35 64 00 2c addi r4,r11,44 800abe8: f8 00 04 4e calli 800bd20 800abec: b8 20 78 00 mv r15,r1 800abf0: 5c 20 00 52 bne r1,r0,800ad38 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 800abf4: 78 05 08 02 mvhi r5,0x802 800abf8: 38 a5 18 b4 ori r5,r5,0x18b4 rtems_build_name ('P', 'I', 'w', c), 800abfc: 41 84 00 00 lbu r4,(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( 800ac00: 28 a1 00 00 lw r1,(r5+0) 800ac04: 34 02 00 00 mvi r2,0 800ac08: 34 03 00 00 mvi r3,0 800ac0c: b8 81 08 00 or r1,r4,r1 800ac10: 35 64 00 30 addi r4,r11,48 800ac14: f8 00 04 43 calli 800bd20 800ac18: b8 20 80 00 mv r16,r1 800ac1c: 5c 2f 00 45 bne r1,r15,800ad30 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 800ac20: 78 05 08 02 mvhi r5,0x802 800ac24: 38 a5 18 b8 ori r5,r5,0x18b8 rtems_build_name ('P', 'I', 's', c), 1, 800ac28: 41 84 00 00 lbu r4,(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( 800ac2c: 28 a1 00 00 lw r1,(r5+0) 800ac30: 34 02 00 01 mvi r2,1 800ac34: 34 03 00 10 mvi r3,16 800ac38: b8 81 08 00 or r1,r4,r1 800ac3c: 35 65 00 28 addi r5,r11,40 800ac40: 34 04 00 00 mvi r4,0 800ac44: fb ff e9 af calli 8005300 800ac48: 5c 30 00 38 bne r1,r16,800ad28 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 800ac4c: 41 81 00 00 lbu r1,(r12+0) 800ac50: 34 22 00 01 addi r2,r1,1 800ac54: 31 82 00 00 sb (r12+0),r2 800ac58: 34 02 00 7a mvi r2,122 800ac5c: 5c 22 ff 44 bne r1,r2,800a96c c = 'a'; 800ac60: 34 01 00 61 mvi r1,97 800ac64: 31 81 00 00 sb (r12+0),r1 800ac68: e3 ff ff 41 bi 800a96c if (! PIPE_LOCK(pipe)) err = -EINTR; if (*pipep == NULL) { if (err) 800ac6c: 5d 82 00 1f bne r12,r2,800ace8 <== NEVER TAKEN pipe_free(pipe); else *pipep = pipe; 800ac70: 59 cb 00 00 sw (r14+0),r11 } out: pipe_unlock(); 800ac74: fb ff fe d1 calli 800a7b8 800ac78: e3 ff ff 49 bi 800a99c if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { sc = rtems_semaphore_create( 800ac7c: 78 02 08 02 mvhi r2,0x802 800ac80: 38 42 18 ac ori r2,r2,0x18ac 800ac84: 28 41 00 00 lw r1,(r2+0) 800ac88: 34 03 00 54 mvi r3,84 800ac8c: 34 02 00 01 mvi r2,1 800ac90: 34 04 00 00 mvi r4,0 800ac94: b9 60 28 00 mv r5,r11 800ac98: fb ff e9 9a calli 8005300 800ac9c: b8 20 80 00 mv r16,r1 800aca0: 29 e1 00 00 lw r1,(r15+0) } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 800aca4: 34 0c ff f4 mvi r12,-12 800aca8: fb ff ea 76 calli 8005680 800acac: 5e 00 ff 48 bne r16,r0,800a9cc 800acb0: 29 6c 00 00 lw r12,(r11+0) 800acb4: e3 ff ff 26 bi 800a94c switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); 800acb8: 29 61 00 30 lw r1,(r11+48) 800acbc: 37 82 00 24 addi r2,sp,36 800acc0: f8 00 04 8f calli 800befc 800acc4: e3 ff ff 81 bi 800aac8 break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); 800acc8: 29 61 00 30 lw r1,(r11+48) 800accc: 37 82 00 24 addi r2,sp,36 800acd0: f8 00 04 8b calli 800befc 800acd4: e3 ff ff 9a bi 800ab3c case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); 800acd8: 29 61 00 2c lw r1,(r11+44) 800acdc: 37 82 00 24 addi r2,sp,36 800ace0: f8 00 04 87 calli 800befc 800ace4: e3 ff ff 58 bi 800aa44 /* Called with pipe_semaphore held. */ static inline void pipe_free( pipe_control_t *pipe ) { rtems_barrier_delete(pipe->readBarrier); 800ace8: 29 61 00 2c lw r1,(r11+44) <== NOT EXECUTED 800acec: f8 00 04 50 calli 800be2c <== NOT EXECUTED rtems_barrier_delete(pipe->writeBarrier); 800acf0: 29 61 00 30 lw r1,(r11+48) <== NOT EXECUTED 800acf4: f8 00 04 4e calli 800be2c <== NOT EXECUTED rtems_semaphore_delete(pipe->Semaphore); 800acf8: 29 61 00 28 lw r1,(r11+40) <== NOT EXECUTED 800acfc: f8 00 05 82 calli 800c304 <== NOT EXECUTED free(pipe->Buffer); 800ad00: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED 800ad04: fb ff de bc calli 80027f4 <== NOT EXECUTED free(pipe); 800ad08: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800ad0c: fb ff de ba calli 80027f4 <== NOT EXECUTED else *pipep = pipe; } out: pipe_unlock(); 800ad10: fb ff fe aa calli 800a7b8 <== NOT EXECUTED 800ad14: e3 ff ff 2e bi 800a9cc <== NOT EXECUTED if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); 800ad18: 29 61 00 28 lw r1,(r11+40) err = -ENXIO; 800ad1c: 34 0c ff fa mvi r12,-6 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); 800ad20: fb ff ea 58 calli 8005680 err = -ENXIO; goto out_error; 800ad24: e3 ff ff 5e bi 800aa9c if (c ++ == 'z') c = 'a'; return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 800ad28: 29 61 00 30 lw r1,(r11+48) 800ad2c: f8 00 04 40 calli 800be2c err_wbar: rtems_barrier_delete(pipe->readBarrier); 800ad30: 2a 21 00 2c lw r1,(r17+44) 800ad34: f8 00 04 3e calli 800be2c err_rbar: free(pipe->Buffer); 800ad38: 2a 21 00 00 lw r1,(r17+0) 800ad3c: fb ff de ae calli 80027f4 err_buf: free(pipe); 800ad40: ba 20 08 00 mv r1,r17 800ad44: fb ff de ac calli 80027f4 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 800ad48: 34 0c ff f4 mvi r12,-12 else *pipep = pipe; } out: pipe_unlock(); 800ad4c: fb ff fe 9b calli 800a7b8 800ad50: e3 ff ff 1f bi 800a9cc =============================================================================== 08008fb8 : */ long fpathconf( int fd, int name ) { 8008fb8: 37 9c ff fc addi sp,sp,-4 8008fbc: 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); 8008fc0: 78 03 08 01 mvhi r3,0x801 8008fc4: 38 63 30 04 ori r3,r3,0x3004 8008fc8: 28 63 00 00 lw r3,(r3+0) 8008fcc: 54 61 00 06 bgu r3,r1,8008fe4 iop = rtems_libio_iop(fd); rtems_libio_check_is_open(iop); 8008fd0: f8 00 07 89 calli 800adf4 <__errno> 8008fd4: 34 02 00 09 mvi r2,9 8008fd8: 58 22 00 00 sw (r1+0),r2 8008fdc: 34 01 ff ff mvi r1,-1 8008fe0: e0 00 00 1b bi 800904c long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); iop = rtems_libio_iop(fd); 8008fe4: b4 21 18 00 add r3,r1,r1 8008fe8: b4 61 18 00 add r3,r3,r1 8008fec: 78 04 08 01 mvhi r4,0x801 8008ff0: b4 63 18 00 add r3,r3,r3 8008ff4: b4 63 18 00 add r3,r3,r3 8008ff8: 38 84 37 3c ori r4,r4,0x373c 8008ffc: c8 61 08 00 sub r1,r3,r1 8009000: 28 83 00 00 lw r3,(r4+0) 8009004: b4 21 08 00 add r1,r1,r1 8009008: b4 21 08 00 add r1,r1,r1 800900c: b4 61 08 00 add r1,r3,r1 rtems_libio_check_is_open(iop); 8009010: 28 23 00 08 lw r3,(r1+8) 8009014: 20 63 01 00 andi r3,r3,0x100 8009018: 44 60 ff ee be r3,r0,8008fd0 <== NEVER TAKEN /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; 800901c: 28 21 00 20 lw r1,(r1+32) switch ( name ) { 8009020: 34 03 00 0b mvi r3,11 /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; 8009024: 28 21 00 2c lw r1,(r1+44) switch ( name ) { 8009028: 54 43 00 22 bgu r2,r3,80090b0 800902c: 78 03 08 01 mvhi r3,0x801 8009030: b4 42 10 00 add r2,r2,r2 8009034: 38 63 22 b4 ori r3,r3,0x22b4 8009038: b4 42 10 00 add r2,r2,r2 800903c: b4 62 10 00 add r2,r3,r2 8009040: 28 42 00 00 lw r2,(r2+0) 8009044: c0 40 00 00 b r2 break; case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; break; case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 8009048: 28 21 00 24 lw r1,(r1+36) rtems_set_errno_and_return_minus_one( EINVAL ); break; } return return_value; } 800904c: 2b 9d 00 04 lw ra,(sp+4) 8009050: 37 9c 00 04 addi sp,sp,4 8009054: c3 a0 00 00 ret break; case _PC_VDISABLE: return_value = the_limits->posix_vdisable; break; case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 8009058: 28 21 00 18 lw r1,(r1+24) break; 800905c: e3 ff ff fc bi 800904c break; case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; break; case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 8009060: 28 21 00 2c lw r1,(r1+44) break; 8009064: e3 ff ff fa bi 800904c break; case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; break; case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 8009068: 28 21 00 20 lw r1,(r1+32) break; 800906c: e3 ff ff f8 bi 800904c break; case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; break; case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 8009070: 28 21 00 1c lw r1,(r1+28) break; 8009074: e3 ff ff f6 bi 800904c break; case _PC_PATH_MAX: return_value = the_limits->path_max; break; case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 8009078: 28 21 00 14 lw r1,(r1+20) break; 800907c: e3 ff ff f4 bi 800904c break; case _PC_NAME_MAX: return_value = the_limits->name_max; break; case _PC_PATH_MAX: return_value = the_limits->path_max; 8009080: 28 21 00 10 lw r1,(r1+16) break; 8009084: e3 ff ff f2 bi 800904c break; case _PC_MAX_INPUT: return_value = the_limits->max_input; break; case _PC_NAME_MAX: return_value = the_limits->name_max; 8009088: 28 21 00 0c lw r1,(r1+12) break; 800908c: e3 ff ff f0 bi 800904c break; case _PC_MAX_CANON: return_value = the_limits->max_canon; break; case _PC_MAX_INPUT: return_value = the_limits->max_input; 8009090: 28 21 00 08 lw r1,(r1+8) break; 8009094: e3 ff ff ee bi 800904c switch ( name ) { case _PC_LINK_MAX: return_value = the_limits->link_max; break; case _PC_MAX_CANON: return_value = the_limits->max_canon; 8009098: 28 21 00 04 lw r1,(r1+4) break; 800909c: e3 ff ff ec bi 800904c the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { case _PC_LINK_MAX: return_value = the_limits->link_max; 80090a0: 28 21 00 00 lw r1,(r1+0) break; 80090a4: e3 ff ff ea bi 800904c break; case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; break; case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 80090a8: 28 21 00 28 lw r1,(r1+40) break; 80090ac: e3 ff ff e8 bi 800904c default: rtems_set_errno_and_return_minus_one( EINVAL ); 80090b0: f8 00 07 51 calli 800adf4 <__errno> 80090b4: 34 02 00 16 mvi r2,22 80090b8: 58 22 00 00 sw (r1+0),r2 80090bc: 34 01 ff ff mvi r1,-1 80090c0: e3 ff ff e3 bi 800904c =============================================================================== 08001628 : #include void free( void *ptr ) { 8001628: 37 9c ff f4 addi sp,sp,-12 800162c: 5b 8b 00 0c sw (sp+12),r11 8001630: 5b 8c 00 08 sw (sp+8),r12 8001634: 5b 9d 00 04 sw (sp+4),ra MSBUMP(free_calls, 1); 8001638: 78 03 08 01 mvhi r3,0x801 800163c: 38 63 e7 b0 ori r3,r3,0xe7b0 8001640: 28 62 00 0c lw r2,(r3+12) #include void free( void *ptr ) { 8001644: b8 20 58 00 mv r11,r1 MSBUMP(free_calls, 1); 8001648: 34 41 00 01 addi r1,r2,1 800164c: 58 61 00 0c sw (r3+12),r1 if ( !ptr ) 8001650: 45 60 00 1a be r11,r0,80016b8 return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 8001654: 78 01 08 01 mvhi r1,0x801 8001658: 38 21 ea 54 ori r1,r1,0xea54 800165c: 28 22 00 00 lw r2,(r1+0) 8001660: 34 01 00 03 mvi r1,3 8001664: 44 41 00 1a be r2,r1,80016cc <== ALWAYS TAKEN } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 8001668: 78 01 08 01 mvhi r1,0x801 800166c: 38 21 e7 0c ori r1,r1,0xe70c 8001670: 28 21 00 00 lw r1,(r1+0) 8001674: 44 20 00 04 be r1,r0,8001684 (*rtems_malloc_statistics_helpers->at_free)(ptr); 8001678: 28 22 00 08 lw r2,(r1+8) 800167c: b9 60 08 00 mv r1,r11 8001680: d8 40 00 00 call r2 if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { 8001684: 78 0c 08 01 mvhi r12,0x801 8001688: 39 8c e0 54 ori r12,r12,0xe054 800168c: 29 81 00 00 lw r1,(r12+0) 8001690: b9 60 10 00 mv r2,r11 8001694: f8 00 12 1b calli 8005f00 <_Protected_heap_Free> 8001698: 5c 20 00 08 bne r1,r0,80016b8 printk( "Program heap: free of bad pointer %p -- range %p - %p \n", ptr, RTEMS_Malloc_Heap->area_begin, 800169c: 29 82 00 00 lw r2,(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", 80016a0: 78 01 08 01 mvhi r1,0x801 80016a4: 38 21 c0 8c ori r1,r1,0xc08c 80016a8: 28 43 00 18 lw r3,(r2+24) 80016ac: 28 44 00 1c lw r4,(r2+28) 80016b0: b9 60 10 00 mv r2,r11 80016b4: f8 00 04 14 calli 8002704 RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } 80016b8: 2b 9d 00 04 lw ra,(sp+4) 80016bc: 2b 8b 00 0c lw r11,(sp+12) 80016c0: 2b 8c 00 08 lw r12,(sp+8) 80016c4: 37 9c 00 0c addi sp,sp,12 80016c8: c3 a0 00 00 ret /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && !malloc_is_system_state_OK() ) { 80016cc: f8 00 00 7a calli 80018b4 return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 80016d0: 5c 20 ff e6 bne r1,r0,8001668 !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); 80016d4: b9 60 08 00 mv r1,r11 80016d8: f8 00 00 8f calli 8001914 return; 80016dc: e3 ff ff f7 bi 80016b8 =============================================================================== 0801afa0 : int fstat( int fd, struct stat *sbuf ) { 801afa0: 37 9c ff f4 addi sp,sp,-12 801afa4: 5b 8b 00 0c sw (sp+12),r11 801afa8: 5b 8c 00 08 sw (sp+8),r12 801afac: 5b 9d 00 04 sw (sp+4),ra 801afb0: b8 40 58 00 mv r11,r2 rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 801afb4: 44 40 00 26 be r2,r0,801b04c <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 801afb8: 78 03 08 01 mvhi r3,0x801 801afbc: 38 63 e0 10 ori r3,r3,0xe010 801afc0: 28 62 00 00 lw r2,(r3+0) 801afc4: 50 22 00 1d bgeu r1,r2,801b038 801afc8: b4 21 60 00 add r12,r1,r1 801afcc: b5 81 60 00 add r12,r12,r1 801afd0: 78 02 08 01 mvhi r2,0x801 801afd4: b5 8c 60 00 add r12,r12,r12 801afd8: b5 8c 60 00 add r12,r12,r12 801afdc: 38 42 e7 a0 ori r2,r2,0xe7a0 801afe0: c9 81 08 00 sub r1,r12,r1 801afe4: 28 4c 00 00 lw r12,(r2+0) 801afe8: b4 21 08 00 add r1,r1,r1 801afec: b4 21 08 00 add r1,r1,r1 801aff0: b5 81 60 00 add r12,r12,r1 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 801aff4: 29 81 00 08 lw r1,(r12+8) 801aff8: 20 21 01 00 andi r1,r1,0x100 801affc: 44 20 00 0f be r1,r0,801b038 /* * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); 801b000: 34 02 00 00 mvi r2,0 801b004: 34 03 00 48 mvi r3,72 801b008: b9 60 08 00 mv r1,r11 801b00c: fb ff c7 21 calli 800cc90 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 801b010: 29 83 00 1c lw r3,(r12+28) 801b014: 35 81 00 0c addi r1,r12,12 801b018: b9 60 10 00 mv r2,r11 801b01c: 28 63 00 18 lw r3,(r3+24) 801b020: d8 60 00 00 call r3 } 801b024: 2b 9d 00 04 lw ra,(sp+4) 801b028: 2b 8b 00 0c lw r11,(sp+12) 801b02c: 2b 8c 00 08 lw r12,(sp+8) 801b030: 37 9c 00 0c addi sp,sp,12 801b034: c3 a0 00 00 ret /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 801b038: fb ff c3 db calli 800bfa4 <__errno> 801b03c: 34 02 00 09 mvi r2,9 801b040: 58 22 00 00 sw (r1+0),r2 801b044: 34 01 ff ff mvi r1,-1 801b048: e3 ff ff f7 bi 801b024 /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) rtems_set_errno_and_return_minus_one( EFAULT ); 801b04c: fb ff c3 d6 calli 800bfa4 <__errno> <== NOT EXECUTED 801b050: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 801b054: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 801b058: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 801b05c: e3 ff ff f2 bi 801b024 <== NOT EXECUTED =============================================================================== 08008e2c : #include #include int ftruncate( int fd, off_t length ) { 8008e2c: 37 9c ff fc addi sp,sp,-4 8008e30: 5b 9d 00 04 sw (sp+4),ra int rv = 0; if ( length >= 0 ) { 8008e34: 48 02 00 20 bg r0,r2,8008eb4 rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8008e38: 78 03 08 01 mvhi r3,0x801 8008e3c: 38 63 e0 10 ori r3,r3,0xe010 8008e40: 28 63 00 00 lw r3,(r3+0) 8008e44: 54 61 00 06 bgu r3,r1,8008e5c iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); 8008e48: f8 00 0c 57 calli 800bfa4 <__errno> 8008e4c: 34 02 00 09 mvi r2,9 8008e50: 58 22 00 00 sw (r1+0),r2 8008e54: 34 01 ff ff mvi r1,-1 8008e58: e0 00 00 14 bi 8008ea8 if ( length >= 0 ) { rtems_libio_t *iop; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); 8008e5c: b4 21 18 00 add r3,r1,r1 8008e60: b4 61 18 00 add r3,r3,r1 8008e64: 78 04 08 01 mvhi r4,0x801 8008e68: b4 63 18 00 add r3,r3,r3 8008e6c: 38 84 e7 a0 ori r4,r4,0xe7a0 8008e70: b4 63 18 00 add r3,r3,r3 8008e74: c8 61 08 00 sub r1,r3,r1 8008e78: 28 83 00 00 lw r3,(r4+0) 8008e7c: b4 21 08 00 add r1,r1,r1 8008e80: b4 21 08 00 add r1,r1,r1 8008e84: b4 61 08 00 add r1,r3,r1 rtems_libio_check_is_open( iop ); 8008e88: 28 23 00 08 lw r3,(r1+8) 8008e8c: 20 64 01 00 andi r4,r3,0x100 8008e90: 44 80 ff ee be r4,r0,8008e48 <== NEVER TAKEN rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); 8008e94: 20 63 00 04 andi r3,r3,0x4 8008e98: 44 60 00 07 be r3,r0,8008eb4 rv = (*iop->pathinfo.handlers->ftruncate_h)( iop, length ); 8008e9c: 28 23 00 1c lw r3,(r1+28) 8008ea0: 28 63 00 1c lw r3,(r3+28) 8008ea4: d8 60 00 00 call r3 errno = EINVAL; rv = -1; } return rv; } 8008ea8: 2b 9d 00 04 lw ra,(sp+4) 8008eac: 37 9c 00 04 addi sp,sp,4 8008eb0: c3 a0 00 00 ret rtems_libio_check_is_open( iop ); rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); rv = (*iop->pathinfo.handlers->ftruncate_h)( iop, length ); } else { errno = EINVAL; 8008eb4: f8 00 0c 3c calli 800bfa4 <__errno> 8008eb8: 34 02 00 16 mvi r2,22 8008ebc: 58 22 00 00 sw (r1+0),r2 rv = -1; 8008ec0: 34 01 ff ff mvi r1,-1 } return rv; } 8008ec4: 2b 9d 00 04 lw ra,(sp+4) 8008ec8: 37 9c 00 04 addi sp,sp,4 8008ecc: c3 a0 00 00 ret =============================================================================== 080012fc : 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) { 80012fc: 78 04 08 01 mvhi r4,0x801 8001300: 38 84 96 d8 ori r4,r4,0x96d8 8001304: 28 85 00 00 lw r5,(r4+0) return dd; } } return NULL; 8001308: 34 04 00 00 mvi r4,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) { 800130c: 50 25 00 05 bgeu r1,r5,8001320 <== NEVER TAKEN 8001310: 78 05 08 01 mvhi r5,0x801 8001314: 38 a5 96 d4 ori r5,r5,0x96d4 8001318: 28 a5 00 00 lw r5,(r5+0) 800131c: 5c a0 00 03 bne r5,r0,8001328 <== ALWAYS TAKEN return dd; } } return NULL; } 8001320: b8 80 08 00 mv r1,r4 8001324: c3 a0 00 00 ret rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major < disktab_size && disktab != NULL) { rtems_disk_device_table *dtab = disktab + major; 8001328: b4 21 08 00 add r1,r1,r1 800132c: b4 21 08 00 add r1,r1,r1 8001330: b4 21 08 00 add r1,r1,r1 8001334: b4 a1 08 00 add r1,r5,r1 if (minor < dtab->size && dtab->minor != NULL) { 8001338: 28 25 00 04 lw r5,(r1+4) 800133c: 50 45 ff f9 bgeu r2,r5,8001320 <== NEVER TAKEN 8001340: 28 21 00 00 lw r1,(r1+0) 8001344: 44 20 ff f7 be r1,r0,8001320 <== NEVER TAKEN rtems_disk_device *dd = dtab->minor [minor]; 8001348: b4 42 10 00 add r2,r2,r2 800134c: b4 42 10 00 add r2,r2,r2 8001350: b4 22 08 00 add r1,r1,r2 8001354: 28 24 00 00 lw r4,(r1+0) if (dd != NULL && !lookup_only) { 8001358: 44 80 ff f2 be r4,r0,8001320 800135c: 5c 60 ff f1 bne r3,r0,8001320 if (!dd->deleted) { 8001360: 40 81 00 40 lbu r1,(r4+64) 8001364: 5c 23 00 05 bne r1,r3,8001378 ++dd->uses; 8001368: 28 81 00 14 lw r1,(r4+20) 800136c: 34 21 00 01 addi r1,r1,1 8001370: 58 81 00 14 sw (r4+20),r1 8001374: e3 ff ff eb bi 8001320 } else { dd = NULL; 8001378: 34 04 00 00 mvi r4,0 800137c: e3 ff ff e9 bi 8001320 =============================================================================== 08003140 : */ static rtems_status_code get_sector(int fd, uint32_t sector_num, rtems_sector_data_t **sector) { 8003140: 37 9c ff ec addi sp,sp,-20 8003144: 5b 8b 00 14 sw (sp+20),r11 8003148: 5b 8c 00 10 sw (sp+16),r12 800314c: 5b 8d 00 0c sw (sp+12),r13 8003150: 5b 8e 00 08 sw (sp+8),r14 8003154: 5b 9d 00 04 sw (sp+4),ra off_t off; off_t new_off; if (sector == NULL) { return RTEMS_INTERNAL_ERROR; 8003158: 34 04 00 19 mvi r4,25 */ static rtems_status_code get_sector(int fd, uint32_t sector_num, rtems_sector_data_t **sector) { 800315c: b8 60 60 00 mv r12,r3 8003160: b8 20 68 00 mv r13,r1 8003164: b8 40 70 00 mv r14,r2 rtems_sector_data_t *s; ssize_t n; off_t off; off_t new_off; if (sector == NULL) 8003168: 44 60 00 0b be r3,r0,8003194 <== NEVER TAKEN { return RTEMS_INTERNAL_ERROR; } off = sector_num * RTEMS_IDE_SECTOR_SIZE; 800316c: b8 40 08 00 mv r1,r2 8003170: 34 02 00 09 mvi r2,9 8003174: f8 00 87 e1 calli 80250f8 <__ashlsi3> 8003178: b8 20 58 00 mv r11,r1 new_off = lseek(fd, off, SEEK_SET); 800317c: b9 60 10 00 mv r2,r11 8003180: b9 a0 08 00 mv r1,r13 8003184: 34 03 00 00 mvi r3,0 8003188: f8 00 05 b5 calli 800485c if (new_off != off) { return RTEMS_IO_ERROR; 800318c: 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) { 8003190: 44 2b 00 09 be r1,r11,80031b4 <== ALWAYS TAKEN s->sector_num = sector_num; *sector = s; return RTEMS_SUCCESSFUL; } 8003194: b8 80 08 00 mv r1,r4 8003198: 2b 9d 00 04 lw ra,(sp+4) 800319c: 2b 8b 00 14 lw r11,(sp+20) 80031a0: 2b 8c 00 10 lw r12,(sp+16) 80031a4: 2b 8d 00 0c lw r13,(sp+12) 80031a8: 2b 8e 00 08 lw r14,(sp+8) 80031ac: 37 9c 00 14 addi sp,sp,20 80031b0: c3 a0 00 00 ret new_off = lseek(fd, off, SEEK_SET); if (new_off != off) { return RTEMS_IO_ERROR; } s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE); 80031b4: 34 01 02 04 mvi r1,516 80031b8: f8 00 06 30 calli 8004a78 80031bc: b8 20 58 00 mv r11,r1 if (s == NULL) { return RTEMS_NO_MEMORY; 80031c0: 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) 80031c4: 44 20 ff f4 be r1,r0,8003194 <== NEVER TAKEN { return RTEMS_NO_MEMORY; } n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); 80031c8: 35 62 00 04 addi r2,r11,4 80031cc: b9 a0 08 00 mv r1,r13 80031d0: 34 03 02 00 mvi r3,512 80031d4: f8 00 09 41 calli 80056d8 if (n != RTEMS_IDE_SECTOR_SIZE) 80031d8: 34 02 02 00 mvi r2,512 80031dc: 44 22 00 0c be r1,r2,800320c <== ALWAYS TAKEN { free(s); 80031e0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 80031e4: f8 00 04 31 calli 80042a8 <== NOT EXECUTED return RTEMS_IO_ERROR; 80031e8: 34 04 00 1b mvi r4,27 <== NOT EXECUTED s->sector_num = sector_num; *sector = s; return RTEMS_SUCCESSFUL; } 80031ec: b8 80 08 00 mv r1,r4 <== NOT EXECUTED 80031f0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80031f4: 2b 8b 00 14 lw r11,(sp+20) <== NOT EXECUTED 80031f8: 2b 8c 00 10 lw r12,(sp+16) <== NOT EXECUTED 80031fc: 2b 8d 00 0c lw r13,(sp+12) <== NOT EXECUTED 8003200: 2b 8e 00 08 lw r14,(sp+8) <== NOT EXECUTED 8003204: 37 9c 00 14 addi sp,sp,20 <== NOT EXECUTED 8003208: c3 a0 00 00 ret <== NOT EXECUTED { free(s); return RTEMS_IO_ERROR; } s->sector_num = sector_num; 800320c: 59 6e 00 00 sw (r11+0),r14 *sector = s; 8003210: 59 8b 00 00 sw (r12+0),r11 return RTEMS_SUCCESSFUL; 8003214: 34 04 00 00 mvi r4,0 8003218: e3 ff ff df bi 8003194 =============================================================================== 08036048 : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 8036048: 37 9c ff f0 addi sp,sp,-16 803604c: 5b 8b 00 10 sw (sp+16),r11 8036050: 5b 8c 00 0c sw (sp+12),r12 8036054: 5b 8d 00 08 sw (sp+8),r13 8036058: 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 ); 803605c: 78 04 08 03 mvhi r4,0x803 8036060: 38 84 c0 14 ori r4,r4,0xc014 8036064: 28 84 00 00 lw r4,(r4+0) int getdents( int dd_fd, char *dd_buf, int dd_len ) { 8036068: b8 40 68 00 mv r13,r2 803606c: 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 ); 8036070: 34 0b 00 00 mvi r11,0 8036074: 50 24 00 0c bgeu r1,r4,80360a4 <== NEVER TAKEN 8036078: b4 21 58 00 add r11,r1,r1 803607c: b5 61 58 00 add r11,r11,r1 8036080: 78 04 08 04 mvhi r4,0x804 8036084: b5 6b 58 00 add r11,r11,r11 8036088: b5 6b 58 00 add r11,r11,r11 803608c: 38 84 c9 14 ori r4,r4,0xc914 8036090: c9 61 08 00 sub r1,r11,r1 8036094: 28 8b 00 00 lw r11,(r4+0) 8036098: b4 21 08 00 add r1,r1,r1 803609c: b4 21 08 00 add r1,r1,r1 80360a0: b5 61 58 00 add r11,r11,r1 /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); 80360a4: 35 61 00 0c addi r1,r11,12 80360a8: fb ff 4c dd calli 800941c if ( type != RTEMS_FILESYSTEM_DIRECTORY ) 80360ac: 5c 20 00 0d bne r1,r0,80360e0 /* * 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 ); 80360b0: 29 63 00 1c lw r3,(r11+28) 80360b4: b9 60 08 00 mv r1,r11 80360b8: b9 a0 10 00 mv r2,r13 80360bc: 28 64 00 08 lw r4,(r3+8) 80360c0: b9 80 18 00 mv r3,r12 80360c4: d8 80 00 00 call r4 } 80360c8: 2b 9d 00 04 lw ra,(sp+4) 80360cc: 2b 8b 00 10 lw r11,(sp+16) 80360d0: 2b 8c 00 0c lw r12,(sp+12) 80360d4: 2b 8d 00 08 lw r13,(sp+8) 80360d8: 37 9c 00 10 addi sp,sp,16 80360dc: c3 a0 00 00 ret /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); if ( type != RTEMS_FILESYSTEM_DIRECTORY ) rtems_set_errno_and_return_minus_one( ENOTDIR ); 80360e0: fb ff b1 2d calli 8022594 <__errno> 80360e4: 34 02 00 14 mvi r2,20 80360e8: 58 22 00 00 sw (r1+0),r2 80360ec: 34 01 ff ff mvi r1,-1 80360f0: e3 ff ff f6 bi 80360c8 =============================================================================== 080016e0 : */ int gettimeofday( struct timeval *tp, void * __tz __attribute__((unused)) ) { 80016e0: 37 9c ff e8 addi sp,sp,-24 80016e4: 5b 8b 00 10 sw (sp+16),r11 80016e8: 5b 8c 00 0c sw (sp+12),r12 80016ec: 5b 8d 00 08 sw (sp+8),r13 80016f0: 5b 9d 00 04 sw (sp+4),ra 80016f4: b8 20 58 00 mv r11,r1 /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) 80016f8: 44 20 00 21 be r1,r0,800177c <== NEVER TAKEN ) { Timestamp_Control snapshot_as_timestamp; Timestamp_Control *snapshot_as_timestamp_ptr; snapshot_as_timestamp_ptr = 80016fc: 78 02 08 01 mvhi r2,0x801 8001700: 38 42 e8 60 ori r2,r2,0xe860 8001704: 37 81 00 14 addi r1,sp,20 8001708: f8 00 0d b9 calli 8004dec <_TOD_Get_with_nanoseconds> struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); } 800170c: 28 2d 00 00 lw r13,(r1+0) 8001710: 28 2c 00 04 lw r12,(r1+4) static inline void _Timestamp64_implementation_To_timeval( const Timestamp64_Control *_timestamp, struct timeval *_timeval ) { _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U); 8001714: 78 01 08 01 mvhi r1,0x801 8001718: 38 21 c0 c4 ori r1,r1,0xc0c4 800171c: 28 24 00 00 lw r4,(r1+0) 8001720: 34 03 00 00 mvi r3,0 8001724: b9 a0 08 00 mv r1,r13 8001728: b9 80 10 00 mv r2,r12 800172c: f8 00 4f f6 calli 8015704 <__divdi3> _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); 8001730: 78 01 08 01 mvhi r1,0x801 8001734: 38 21 c0 c4 ori r1,r1,0xc0c4 8001738: 28 24 00 00 lw r4,(r1+0) static inline void _Timestamp64_implementation_To_timeval( const Timestamp64_Control *_timestamp, struct timeval *_timeval ) { _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U); 800173c: 59 62 00 00 sw (r11+0),r2 _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); 8001740: 34 03 00 00 mvi r3,0 8001744: b9 a0 08 00 mv r1,r13 8001748: b9 80 10 00 mv r2,r12 800174c: f8 00 51 f0 calli 8015f0c <__moddi3> 8001750: 34 03 00 00 mvi r3,0 8001754: 34 04 03 e8 mvi r4,1000 8001758: f8 00 4f eb calli 8015704 <__divdi3> 800175c: 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; 8001760: 34 01 00 00 mvi r1,0 } 8001764: 2b 9d 00 04 lw ra,(sp+4) 8001768: 2b 8b 00 10 lw r11,(sp+16) 800176c: 2b 8c 00 0c lw r12,(sp+12) 8001770: 2b 8d 00 08 lw r13,(sp+8) 8001774: 37 9c 00 18 addi sp,sp,24 8001778: c3 a0 00 00 ret void * __tz __attribute__((unused)) ) { /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) rtems_set_errno_and_return_minus_one( EFAULT ); 800177c: f8 00 2a 0a calli 800bfa4 <__errno> <== NOT EXECUTED 8001780: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 8001784: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8001788: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800178c: e3 ff ff f6 bi 8001764 <== NOT EXECUTED =============================================================================== 0800b720 : ssize_t imfs_dir_read( rtems_libio_t *iop, void *buffer, size_t count ) { 800b720: 37 9c fe c0 addi sp,sp,-320 800b724: 5b 8b 00 34 sw (sp+52),r11 800b728: 5b 8c 00 30 sw (sp+48),r12 800b72c: 5b 8d 00 2c sw (sp+44),r13 800b730: 5b 8e 00 28 sw (sp+40),r14 800b734: 5b 8f 00 24 sw (sp+36),r15 800b738: 5b 90 00 20 sw (sp+32),r16 800b73c: 5b 91 00 1c sw (sp+28),r17 800b740: 5b 92 00 18 sw (sp+24),r18 800b744: 5b 93 00 14 sw (sp+20),r19 800b748: 5b 94 00 10 sw (sp+16),r20 800b74c: 5b 95 00 0c sw (sp+12),r21 800b750: 5b 96 00 08 sw (sp+8),r22 800b754: 5b 9d 00 04 sw (sp+4),ra 800b758: b8 20 68 00 mv r13,r1 } rtems_filesystem_instance_unlock( &iop->pathinfo ); return bytes_transferred; } 800b75c: 28 21 00 20 lw r1,(r1+32) ssize_t imfs_dir_read( rtems_libio_t *iop, void *buffer, size_t count ) { 800b760: b8 40 98 00 mv r19,r2 800b764: b8 60 58 00 mv r11,r3 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 ); 800b768: 28 22 00 0c lw r2,(r1+12) the_jnode = (IMFS_jnode_t *)iop->pathinfo.node_access; the_chain = &the_jnode->info.directory.Entries; /* Move to the first of the desired directory entries */ bytes_transferred = 0; 800b76c: 34 0e 00 00 mvi r14,0 800b770: 28 42 00 00 lw r2,(r2+0) 800b774: d8 40 00 00 call r2 first_entry = iop->offset; /* protect against using sizes that are not exact multiples of the */ /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); 800b778: b9 60 08 00 mv r1,r11 800b77c: 34 02 01 0c mvi r2,268 800b780: f8 00 3d 6e calli 801ad38 <__udivsi3> 800b784: b4 21 20 00 add r4,r1,r1 800b788: b4 84 20 00 add r4,r4,r4 800b78c: b4 84 18 00 add r3,r4,r4 800b790: b4 63 18 00 add r3,r3,r3 800b794: b4 63 18 00 add r3,r3,r3 800b798: b4 63 18 00 add r3,r3,r3 800b79c: b4 83 80 00 add r16,r4,r3 the_chain = &the_jnode->info.directory.Entries; /* Move to the first of the desired directory entries */ bytes_transferred = 0; first_entry = iop->offset; 800b7a0: 29 af 00 04 lw r15,(r13+4) /* protect against using sizes that are not exact multiples of the */ /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); 800b7a4: ca 01 80 00 sub r16,r16,r1 int last_entry; struct dirent tmp_dirent; rtems_filesystem_instance_lock( &iop->pathinfo ); the_jnode = (IMFS_jnode_t *)iop->pathinfo.node_access; 800b7a8: 29 b1 00 14 lw r17,(r13+20) bytes_transferred = 0; first_entry = iop->offset; /* protect against using sizes that are not exact multiples of the */ /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); 800b7ac: b6 10 80 00 add r16,r16,r16 800b7b0: b6 10 80 00 add r16,r16,r16 800b7b4: b6 0f 80 00 add r16,r16,r15 } rtems_filesystem_instance_unlock( &iop->pathinfo ); return bytes_transferred; } 800b7b8: 2a 2c 00 50 lw r12,(r17+80) /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); /* The directory was not empty so try to move to the desired entry in chain*/ for ( 800b7bc: 4c 10 00 1f bge r0,r16,800b838 <== NEVER TAKEN 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 )); 800b7c0: 36 31 00 54 addi r17,r17,84 current_entry = 0, the_node = rtems_chain_first( the_chain ); current_entry < last_entry && !rtems_chain_is_tail( the_chain, the_node ); 800b7c4: 45 91 00 1d be r12,r17,800b838 800b7c8: 34 0b 00 00 mvi r11,0 the_node = rtems_chain_next( the_node ) ) { if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; tmp_dirent.d_reclen = sizeof( struct dirent ); 800b7cc: 34 16 01 0c mvi r22,268 the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; tmp_dirent.d_namlen = strlen( the_jnode->name ); strcpy( tmp_dirent.d_name, the_jnode->name ); 800b7d0: 37 95 00 38 addi r21,sp,56 800b7d4: 37 94 00 44 addi r20,sp,68 current_entry < last_entry && !rtems_chain_is_tail( the_chain, the_node ); current_entry += sizeof( struct dirent ), the_node = rtems_chain_next( the_node ) ) { if( current_entry >= first_entry ) { 800b7d8: 49 eb 00 14 bg r15,r11,800b828 /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; tmp_dirent.d_reclen = sizeof( struct dirent ); the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; 800b7dc: 29 82 00 38 lw r2,(r12+56) tmp_dirent.d_namlen = strlen( the_jnode->name ); 800b7e0: 35 92 00 0c addi r18,r12,12 800b7e4: ba 40 08 00 mv r1,r18 if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; tmp_dirent.d_reclen = sizeof( struct dirent ); the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; 800b7e8: 5b 82 00 38 sw (sp+56),r2 current_entry += sizeof( struct dirent ), the_node = rtems_chain_next( the_node ) ) { if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; 800b7ec: 5b 8b 00 3c sw (sp+60),r11 tmp_dirent.d_reclen = sizeof( struct dirent ); 800b7f0: 0f 96 00 40 sh (sp+64),r22 the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; tmp_dirent.d_namlen = strlen( the_jnode->name ); 800b7f4: f8 00 08 31 calli 800d8b8 800b7f8: 0f 81 00 42 sh (sp+66),r1 strcpy( tmp_dirent.d_name, the_jnode->name ); 800b7fc: ba 40 10 00 mv r2,r18 800b800: ba 80 08 00 mv r1,r20 800b804: f8 00 06 e4 calli 800d394 memcpy( 800b808: b6 6e 08 00 add r1,r19,r14 800b80c: 34 03 01 0c mvi r3,268 800b810: ba a0 10 00 mv r2,r21 800b814: f8 00 04 de calli 800cb8c buffer + bytes_transferred, (void *)&tmp_dirent, sizeof( struct dirent ) ); iop->offset += sizeof( struct dirent ); 800b818: 29 a3 00 04 lw r3,(r13+4) bytes_transferred += sizeof( struct dirent ); 800b81c: 35 ce 01 0c addi r14,r14,268 memcpy( buffer + bytes_transferred, (void *)&tmp_dirent, sizeof( struct dirent ) ); iop->offset += sizeof( struct dirent ); 800b820: 34 63 01 0c addi r3,r3,268 800b824: 59 a3 00 04 sw (r13+4),r3 #include "imfs.h" #include #include ssize_t imfs_dir_read( 800b828: 35 6b 01 0c addi r11,r11,268 } rtems_filesystem_instance_unlock( &iop->pathinfo ); return bytes_transferred; } 800b82c: 29 8c 00 00 lw r12,(r12+0) /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); /* The directory was not empty so try to move to the desired entry in chain*/ for ( 800b830: 4d 70 00 02 bge r11,r16,800b838 current_entry = 0, the_node = rtems_chain_first( the_chain ); current_entry < last_entry && !rtems_chain_is_tail( the_chain, the_node ); 800b834: 5d 91 ff e9 bne r12,r17,800b7d8 } rtems_filesystem_instance_unlock( &iop->pathinfo ); return bytes_transferred; } 800b838: 29 a1 00 20 lw r1,(r13+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 ); 800b83c: 28 22 00 0c lw r2,(r1+12) 800b840: 28 42 00 04 lw r2,(r2+4) 800b844: d8 40 00 00 call r2 800b848: b9 c0 08 00 mv r1,r14 800b84c: 2b 9d 00 04 lw ra,(sp+4) 800b850: 2b 8b 00 34 lw r11,(sp+52) 800b854: 2b 8c 00 30 lw r12,(sp+48) 800b858: 2b 8d 00 2c lw r13,(sp+44) 800b85c: 2b 8e 00 28 lw r14,(sp+40) 800b860: 2b 8f 00 24 lw r15,(sp+36) 800b864: 2b 90 00 20 lw r16,(sp+32) 800b868: 2b 91 00 1c lw r17,(sp+28) 800b86c: 2b 92 00 18 lw r18,(sp+24) 800b870: 2b 93 00 14 lw r19,(sp+20) 800b874: 2b 94 00 10 lw r20,(sp+16) 800b878: 2b 95 00 0c lw r21,(sp+12) 800b87c: 2b 96 00 08 lw r22,(sp+8) 800b880: 37 9c 01 40 addi sp,sp,320 800b884: c3 a0 00 00 ret =============================================================================== 08025534 : /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 8025534: 37 9c ff ec addi sp,sp,-20 8025538: 5b 8b 00 14 sw (sp+20),r11 802553c: 5b 8c 00 10 sw (sp+16),r12 8025540: 5b 8d 00 0c sw (sp+12),r13 8025544: 5b 8e 00 08 sw (sp+8),r14 8025548: 5b 9d 00 04 sw (sp+4),ra FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 802554c: 78 03 08 06 mvhi r3,0x806 8025550: 38 63 db b0 ori r3,r3,0xdbb0 8025554: 40 6d 00 00 lbu r13,(r3+0) 8025558: 45 a0 00 08 be r13,r0,8025578 fprintf( fp, "root:x:0:root\n" "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); } } 802555c: 2b 9d 00 04 lw ra,(sp+4) 8025560: 2b 8b 00 14 lw r11,(sp+20) 8025564: 2b 8c 00 10 lw r12,(sp+16) 8025568: 2b 8d 00 0c lw r13,(sp+12) 802556c: 2b 8e 00 08 lw r14,(sp+8) 8025570: 37 9c 00 14 addi sp,sp,20 8025574: c3 a0 00 00 ret FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; 8025578: 34 04 00 01 mvi r4,1 mkdir("/etc", 0777); 802557c: 78 01 08 06 mvhi r1,0x806 8025580: 34 02 01 ff mvi r2,511 FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; 8025584: 30 64 00 00 sb (r3+0),r4 mkdir("/etc", 0777); 8025588: 38 21 31 cc ori r1,r1,0x31cc /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 802558c: 78 0c 08 06 mvhi r12,0x806 8025590: 78 0b 08 06 mvhi r11,0x806 static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; mkdir("/etc", 0777); 8025594: fb ff 70 1f calli 8001610 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 8025598: 39 8c 31 d4 ori r12,r12,0x31d4 802559c: 39 6b 21 d0 ori r11,r11,0x21d0 80255a0: b9 80 08 00 mv r1,r12 80255a4: b9 60 10 00 mv r2,r11 80255a8: f8 00 5f 53 calli 803d2f4 80255ac: b8 20 70 00 mv r14,r1 80255b0: 44 2d 00 20 be r1,r13,8025630 } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 80255b4: f8 00 5c 63 calli 803c740 } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 80255b8: 78 0c 08 06 mvhi r12,0x806 80255bc: 39 8c 32 48 ori r12,r12,0x3248 80255c0: b9 60 10 00 mv r2,r11 80255c4: b9 80 08 00 mv r1,r12 80255c8: f8 00 5f 4b calli 803d2f4 80255cc: b8 20 58 00 mv r11,r1 80255d0: 44 20 00 09 be r1,r0,80255f4 } else if ((fp = fopen("/etc/group", "w")) != NULL) { fprintf( fp, "root:x:0:root\n" "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 80255d4: f8 00 5c 5b calli 803c740 } } 80255d8: 2b 9d 00 04 lw ra,(sp+4) 80255dc: 2b 8b 00 14 lw r11,(sp+20) 80255e0: 2b 8c 00 10 lw r12,(sp+16) 80255e4: 2b 8d 00 0c lw r13,(sp+12) 80255e8: 2b 8e 00 08 lw r14,(sp+8) 80255ec: 37 9c 00 14 addi sp,sp,20 80255f0: c3 a0 00 00 ret * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { 80255f4: 78 02 08 05 mvhi r2,0x805 80255f8: b9 80 08 00 mv r1,r12 80255fc: 38 42 e3 f8 ori r2,r2,0xe3f8 8025600: f8 00 5f 3d calli 803d2f4 8025604: b8 20 60 00 mv r12,r1 8025608: 44 2b ff d5 be r1,r11,802555c <== NEVER TAKEN fprintf( fp, "root:x:0:root\n" 802560c: 78 01 08 06 mvhi r1,0x806 8025610: 34 02 00 01 mvi r2,1 8025614: 34 03 00 2a mvi r3,42 8025618: b9 80 20 00 mv r4,r12 802561c: 38 21 32 54 ori r1,r1,0x3254 8025620: f8 00 64 6f calli 803e7dc "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 8025624: b9 80 08 00 mv r1,r12 8025628: f8 00 5c 46 calli 803c740 802562c: e3 ff ff eb bi 80255d8 * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 8025630: 78 02 08 05 mvhi r2,0x805 8025634: b9 80 08 00 mv r1,r12 8025638: 38 42 e3 f8 ori r2,r2,0xe3f8 802563c: f8 00 5f 2e calli 803d2f4 8025640: b8 20 60 00 mv r12,r1 8025644: 44 2e ff dd be r1,r14,80255b8 <== NEVER TAKEN fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 8025648: 78 01 08 06 mvhi r1,0x806 802564c: 38 21 31 e0 ori r1,r1,0x31e0 8025650: 34 02 00 01 mvi r2,1 8025654: 34 03 00 66 mvi r3,102 8025658: b9 80 20 00 mv r4,r12 802565c: f8 00 64 60 calli 803e7dc "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 8025660: b9 80 08 00 mv r1,r12 8025664: e3 ff ff d4 bi 80255b4 =============================================================================== 0800557c : /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 800557c: 37 9c ff f4 addi sp,sp,-12 8005580: 5b 8b 00 0c sw (sp+12),r11 8005584: 5b 8c 00 08 sw (sp+8),r12 8005588: 5b 9d 00 04 sw (sp+4),ra 800558c: b8 40 60 00 mv r12,r2 if (tty->termios.c_iflag & ISTRIP) 8005590: 28 42 00 30 lw r2,(r2+48) /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 8005594: b8 20 58 00 mv r11,r1 if (tty->termios.c_iflag & ISTRIP) 8005598: 20 41 00 20 andi r1,r2,0x20 800559c: 44 20 00 02 be r1,r0,80055a4 <== ALWAYS TAKEN c &= 0x7f; 80055a0: 21 6b 00 7f andi r11,r11,0x7f <== NOT EXECUTED if (tty->termios.c_iflag & IUCLC) 80055a4: 20 41 02 00 andi r1,r2,0x200 80055a8: 44 20 00 0b be r1,r0,80055d4 c = tolower (c); 80055ac: 78 01 08 02 mvhi r1,0x802 80055b0: 38 21 72 94 ori r1,r1,0x7294 80055b4: 28 23 00 00 lw r3,(r1+0) 80055b8: b9 60 08 00 mv r1,r11 80055bc: b4 6b 58 00 add r11,r3,r11 80055c0: 41 64 00 01 lbu r4,(r11+1) 80055c4: 34 03 00 01 mvi r3,1 80055c8: 20 84 00 03 andi r4,r4,0x3 80055cc: 44 83 00 40 be r4,r3,80056cc 80055d0: 20 2b 00 ff andi r11,r1,0xff if (c == '\r') { 80055d4: 34 01 00 0d mvi r1,13 80055d8: 45 61 00 19 be r11,r1,800563c if (tty->termios.c_iflag & IGNCR) return 0; if (tty->termios.c_iflag & ICRNL) c = '\n'; } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 80055dc: 34 01 00 0a mvi r1,10 80055e0: 45 61 00 37 be r11,r1,80056bc c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 80055e4: 5d 60 00 1c bne r11,r0,8005654 <== ALWAYS TAKEN } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 80055e8: 78 01 08 02 mvhi r1,0x802 80055ec: 38 21 71 40 ori r1,r1,0x7140 80055f0: 28 23 00 00 lw r3,(r1+0) 80055f4: 29 82 00 20 lw r2,(r12+32) if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; 80055f8: 34 01 00 00 mvi r1,0 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 80055fc: 34 63 ff ff addi r3,r3,-1 8005600: 50 43 00 0a bgeu r2,r3,8005628 <== NEVER TAKEN if (tty->termios.c_lflag & ECHO) 8005604: 29 81 00 3c lw r1,(r12+60) 8005608: 20 21 00 08 andi r1,r1,0x8 800560c: 5c 20 00 32 bne r1,r0,80056d4 <== ALWAYS TAKEN echo (c, tty); tty->cbuf[tty->ccount++] = c; 8005610: 29 84 00 1c lw r4,(r12+28) 8005614: 34 43 00 01 addi r3,r2,1 } return 0; 8005618: 34 01 00 00 mvi r1,0 * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; 800561c: b4 82 10 00 add r2,r4,r2 8005620: 30 4b 00 00 sb (r2+0),r11 8005624: 59 83 00 20 sw (r12+32),r3 } return 0; } 8005628: 2b 9d 00 04 lw ra,(sp+4) 800562c: 2b 8b 00 0c lw r11,(sp+12) 8005630: 2b 8c 00 08 lw r12,(sp+8) 8005634: 37 9c 00 0c addi sp,sp,12 8005638: c3 a0 00 00 ret if (tty->termios.c_iflag & IUCLC) c = tolower (c); if (c == '\r') { if (tty->termios.c_iflag & IGNCR) 800563c: 20 43 00 80 andi r3,r2,0x80 return 0; 8005640: 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) 8005644: 5c 60 ff f9 bne r3,r0,8005628 <== NEVER TAKEN return 0; if (tty->termios.c_iflag & ICRNL) 8005648: 20 42 01 00 andi r2,r2,0x100 800564c: 44 43 00 02 be r2,r3,8005654 <== NEVER TAKEN c = '\n'; 8005650: 34 0b 00 0a mvi r11,10 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 8005654: 29 82 00 3c lw r2,(r12+60) 8005658: 20 41 00 02 andi r1,r2,0x2 800565c: 44 20 ff e3 be r1,r0,80055e8 if (c == tty->termios.c_cc[VERASE]) { 8005660: 41 81 00 43 lbu r1,(r12+67) 8005664: 44 2b 00 37 be r1,r11,8005740 erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { 8005668: 41 81 00 44 lbu r1,(r12+68) 800566c: 44 2b 00 23 be r1,r11,80056f8 erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { 8005670: 41 83 00 45 lbu r3,(r12+69) return 1; 8005674: 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]) { 8005678: 44 6b ff ec be r3,r11,8005628 <== NEVER TAKEN return 1; } else if (c == '\n') { 800567c: 34 01 00 0a mvi r1,10 8005680: 45 61 00 23 be r11,r1,800570c if (tty->termios.c_lflag & (ECHO | ECHONL)) echo (c, tty); tty->cbuf[tty->ccount++] = c; return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 8005684: 41 81 00 4c lbu r1,(r12+76) 8005688: 44 2b 00 03 be r1,r11,8005694 <== NEVER TAKEN 800568c: 41 81 00 51 lbu r1,(r12+81) 8005690: 5c 2b ff d6 bne r1,r11,80055e8 <== ALWAYS TAKEN (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 8005694: 20 42 00 08 andi r2,r2,0x8 <== NOT EXECUTED 8005698: 5c 40 00 14 bne r2,r0,80056e8 <== NOT EXECUTED echo (c, tty); tty->cbuf[tty->ccount++] = c; 800569c: 29 83 00 20 lw r3,(r12+32) <== NOT EXECUTED 80056a0: 29 84 00 1c lw r4,(r12+28) <== NOT EXECUTED return 1; 80056a4: 34 01 00 01 mvi r1,1 <== NOT EXECUTED return 1; } else if ((c == tty->termios.c_cc[VEOL]) || (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; 80056a8: 34 62 00 01 addi r2,r3,1 <== NOT EXECUTED 80056ac: b4 83 18 00 add r3,r4,r3 <== NOT EXECUTED 80056b0: 30 6b 00 00 sb (r3+0),r11 <== NOT EXECUTED 80056b4: 59 82 00 20 sw (r12+32),r2 <== NOT EXECUTED return 1; 80056b8: e3 ff ff dc bi 8005628 <== NOT EXECUTED if (c == '\r') { if (tty->termios.c_iflag & IGNCR) return 0; if (tty->termios.c_iflag & ICRNL) c = '\n'; } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 80056bc: 20 42 00 40 andi r2,r2,0x40 80056c0: 44 40 ff e5 be r2,r0,8005654 <== ALWAYS TAKEN c = '\r'; 80056c4: 34 0b 00 0d mvi r11,13 <== NOT EXECUTED 80056c8: e3 ff ff e3 bi 8005654 <== NOT EXECUTED { if (tty->termios.c_iflag & ISTRIP) c &= 0x7f; if (tty->termios.c_iflag & IUCLC) c = tolower (c); 80056cc: 34 21 00 20 addi r1,r1,32 80056d0: e3 ff ff c0 bi 80055d0 /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); 80056d4: b9 80 10 00 mv r2,r12 80056d8: b9 60 08 00 mv r1,r11 80056dc: fb ff fe f7 calli 80052b8 80056e0: 29 82 00 20 lw r2,(r12+32) 80056e4: e3 ff ff cb bi 8005610 tty->cbuf[tty->ccount++] = c; return 1; } else if ((c == tty->termios.c_cc[VEOL]) || (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) echo (c, tty); 80056e8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 80056ec: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 80056f0: fb ff fe f2 calli 80052b8 <== NOT EXECUTED 80056f4: e3 ff ff ea bi 800569c <== NOT EXECUTED if (c == tty->termios.c_cc[VERASE]) { erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); 80056f8: b9 80 08 00 mv r1,r12 80056fc: 34 02 00 01 mvi r2,1 8005700: fb ff ff 16 calli 8005358 return 0; 8005704: 34 01 00 00 mvi r1,0 8005708: e3 ff ff c8 bi 8005628 } else if (c == tty->termios.c_cc[VEOF]) { return 1; } else if (c == '\n') { if (tty->termios.c_lflag & (ECHO | ECHONL)) 800570c: 20 42 00 48 andi r2,r2,0x48 8005710: 44 40 00 03 be r2,r0,800571c <== NEVER TAKEN echo (c, tty); 8005714: b9 80 10 00 mv r2,r12 8005718: fb ff fe e8 calli 80052b8 tty->cbuf[tty->ccount++] = c; 800571c: 29 82 00 20 lw r2,(r12+32) 8005720: 29 83 00 1c lw r3,(r12+28) 8005724: 34 41 00 01 addi r1,r2,1 8005728: b4 62 10 00 add r2,r3,r2 800572c: 34 03 00 0a mvi r3,10 8005730: 30 43 00 00 sb (r2+0),r3 8005734: 59 81 00 20 sw (r12+32),r1 return 1; 8005738: 34 01 00 01 mvi r1,1 800573c: e3 ff ff bb bi 8005628 c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { if (c == tty->termios.c_cc[VERASE]) { erase (tty, 0); 8005740: b9 80 08 00 mv r1,r12 8005744: 34 02 00 00 mvi r2,0 8005748: fb ff ff 04 calli 8005358 return 0; 800574c: 34 01 00 00 mvi r1,0 8005750: e3 ff ff b6 bi 8005628 =============================================================================== 0801b0ac : #if !defined(RTEMS_POSIX_API) int kill( pid_t pid, int sig ) { return 0; } 801b0ac: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 801b0b0: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08001fe0 : extern void _wrapup_reent(struct _reent *); extern void _reclaim_reent(struct _reent *); void libc_wrapup(void) { 8001fe0: 37 9c ff f4 addi sp,sp,-12 8001fe4: 5b 8b 00 0c sw (sp+12),r11 8001fe8: 5b 8c 00 08 sw (sp+8),r12 8001fec: 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())) 8001ff0: 78 01 08 01 mvhi r1,0x801 8001ff4: 38 21 ea 54 ori r1,r1,0xea54 8001ff8: 28 22 00 00 lw r2,(r1+0) 8001ffc: 34 01 00 03 mvi r1,3 8002000: 44 41 00 06 be r2,r1,8002018 <== ALWAYS TAKEN */ fclose (stdin); fclose (stdout); fclose (stderr); } 8002004: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8002008: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED 800200c: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED 8002010: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 8002014: c3 a0 00 00 ret <== NOT EXECUTED /* * This was already done if the user called exit() directly . _wrapup_reent(0); */ if (_REENT != _global_impure_ptr) { 8002018: 78 0b 08 01 mvhi r11,0x801 800201c: 78 01 08 01 mvhi r1,0x801 8002020: 39 6b e2 28 ori r11,r11,0xe228 8002024: 38 21 c6 04 ori r1,r1,0xc604 8002028: 29 62 00 00 lw r2,(r11+0) 800202c: 28 2c 00 00 lw r12,(r1+0) 8002030: 44 4c 00 04 be r2,r12,8002040 _wrapup_reent(_global_impure_ptr); 8002034: b9 80 08 00 mv r1,r12 8002038: f8 00 2b f0 calli 800cff8 <_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; 800203c: 59 6c 00 00 sw (r11+0),r12 * * Should this be changed to do *all* file streams? * _fwalk (_REENT, fclose); */ fclose (stdin); 8002040: 29 81 00 04 lw r1,(r12+4) 8002044: f8 00 28 30 calli 800c104 fclose (stdout); 8002048: 29 61 00 00 lw r1,(r11+0) 800204c: 28 21 00 08 lw r1,(r1+8) 8002050: f8 00 28 2d calli 800c104 fclose (stderr); 8002054: 29 61 00 00 lw r1,(r11+0) 8002058: 28 21 00 0c lw r1,(r1+12) 800205c: f8 00 28 2a calli 800c104 } 8002060: 2b 9d 00 04 lw ra,(sp+4) 8002064: 2b 8b 00 0c lw r11,(sp+12) 8002068: 2b 8c 00 08 lw r12,(sp+8) 800206c: 37 9c 00 0c addi sp,sp,12 8002070: c3 a0 00 00 ret =============================================================================== 08001a30 : #include "malloc_p.h" void *malloc( size_t size ) { 8001a30: 37 9c ff f0 addi sp,sp,-16 8001a34: 5b 8b 00 10 sw (sp+16),r11 8001a38: 5b 8c 00 0c sw (sp+12),r12 8001a3c: 5b 8d 00 08 sw (sp+8),r13 8001a40: 5b 9d 00 04 sw (sp+4),ra void *return_this; MSBUMP(malloc_calls, 1); 8001a44: 78 03 08 01 mvhi r3,0x801 8001a48: 38 63 e7 b0 ori r3,r3,0xe7b0 8001a4c: 28 62 00 04 lw r2,(r3+4) #include "malloc_p.h" void *malloc( size_t size ) { 8001a50: b8 20 60 00 mv r12,r1 /* * Validate the parameters */ if ( !size ) return (void *) 0; 8001a54: 34 0b 00 00 mvi r11,0 size_t size ) { void *return_this; MSBUMP(malloc_calls, 1); 8001a58: 34 41 00 01 addi r1,r2,1 8001a5c: 58 61 00 04 sw (r3+4),r1 /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 8001a60: fb ff ff 9f calli 80018dc /* * Validate the parameters */ if ( !size ) 8001a64: 45 80 00 1d be r12,r0,8001ad8 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 8001a68: 78 01 08 01 mvhi r1,0x801 8001a6c: 38 21 ea 54 ori r1,r1,0xea54 8001a70: 28 22 00 00 lw r2,(r1+0) 8001a74: 34 01 00 03 mvi r1,3 8001a78: 44 41 00 2b be r2,r1,8001b24 RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 8001a7c: 78 0d 08 01 mvhi r13,0x801 8001a80: 39 ad e0 54 ori r13,r13,0xe054 8001a84: 29 a1 00 00 lw r1,(r13+0) 8001a88: b9 80 10 00 mv r2,r12 8001a8c: 34 03 00 00 mvi r3,0 8001a90: 34 04 00 00 mvi r4,0 8001a94: f8 00 11 01 calli 8005e98 <_Protected_heap_Allocate_aligned_with_boundary> 8001a98: 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 ) { 8001a9c: 44 20 00 16 be r1,r0,8001af4 } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) 8001aa0: 78 01 08 01 mvhi r1,0x801 8001aa4: 38 21 e7 10 ori r1,r1,0xe710 8001aa8: 28 23 00 00 lw r3,(r1+0) 8001aac: 44 60 00 04 be r3,r0,8001abc (*rtems_malloc_dirty_helper)( return_this, size ); 8001ab0: b9 60 08 00 mv r1,r11 8001ab4: b9 80 10 00 mv r2,r12 8001ab8: d8 60 00 00 call r3 /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 8001abc: 78 01 08 01 mvhi r1,0x801 8001ac0: 38 21 e7 0c ori r1,r1,0xe70c 8001ac4: 28 21 00 00 lw r1,(r1+0) 8001ac8: 44 20 00 04 be r1,r0,8001ad8 (*rtems_malloc_statistics_helpers->at_malloc)(return_this); 8001acc: 28 22 00 04 lw r2,(r1+4) 8001ad0: b9 60 08 00 mv r1,r11 8001ad4: d8 40 00 00 call r2 return return_this; } 8001ad8: b9 60 08 00 mv r1,r11 8001adc: 2b 9d 00 04 lw ra,(sp+4) 8001ae0: 2b 8b 00 10 lw r11,(sp+16) 8001ae4: 2b 8c 00 0c lw r12,(sp+12) 8001ae8: 2b 8d 00 08 lw r13,(sp+8) 8001aec: 37 9c 00 10 addi sp,sp,16 8001af0: c3 a0 00 00 ret */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 8001af4: 78 01 08 01 mvhi r1,0x801 8001af8: 38 21 b9 98 ori r1,r1,0xb998 8001afc: 28 23 00 00 lw r3,(r1+0) 8001b00: 29 a1 00 00 lw r1,(r13+0) 8001b04: b9 80 10 00 mv r2,r12 8001b08: d8 60 00 00 call r3 8001b0c: b8 20 58 00 mv r11,r1 if ( !return_this ) { 8001b10: 5c 20 ff e4 bne r1,r0,8001aa0 <== NEVER TAKEN errno = ENOMEM; 8001b14: f8 00 29 24 calli 800bfa4 <__errno> 8001b18: 34 02 00 0c mvi r2,12 8001b1c: 58 22 00 00 sw (r1+0),r2 return (void *) 0; 8001b20: e3 ff ff ee bi 8001ad8 /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && !malloc_is_system_state_OK() ) 8001b24: fb ff ff 64 calli 80018b4 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 8001b28: 5c 20 ff d5 bne r1,r0,8001a7c <== ALWAYS TAKEN 8001b2c: e3 ff ff eb bi 8001ad8 <== NOT EXECUTED =============================================================================== 0800ae08 : */ static void memfile_free_blocks_in_table( block_p **block_table, int entries ) { 800ae08: 37 9c ff ec addi sp,sp,-20 800ae0c: 5b 8b 00 14 sw (sp+20),r11 800ae10: 5b 8c 00 10 sw (sp+16),r12 800ae14: 5b 8d 00 0c sw (sp+12),r13 800ae18: 5b 8e 00 08 sw (sp+8),r14 800ae1c: 5b 9d 00 04 sw (sp+4),ra 800ae20: b8 20 70 00 mv r14,r1 800ae24: b8 40 68 00 mv r13,r2 IMFS_assert( block_table ); /* * Now go through all the slots in the table and free the memory. */ b = *block_table; 800ae28: 28 2b 00 00 lw r11,(r1+0) for ( i=0 ; i<== NEVER TAKEN 800ae30: 34 0c 00 00 mvi r12,0 if ( b[i] ) { 800ae34: 29 63 00 00 lw r3,(r11+0) /* * Now go through all the slots in the table and free the memory. */ b = *block_table; for ( i=0 ; i memfile_free_block( b[i] ); 800ae44: fb ff ff e6 calli 800addc b[i] = 0; 800ae48: 59 60 00 00 sw (r11+0),r0 /* * Now go through all the slots in the table and free the memory. */ b = *block_table; for ( i=0 ; i 800ae54: 29 cb 00 00 lw r11,(r14+0) /* * Now that all the blocks in the block table are free, we can * free the block table itself. */ memfile_free_block( *block_table ); 800ae58: b9 60 08 00 mv r1,r11 800ae5c: fb ff ff e0 calli 800addc *block_table = 0; 800ae60: 59 c0 00 00 sw (r14+0),r0 } 800ae64: 2b 9d 00 04 lw ra,(sp+4) 800ae68: 2b 8b 00 14 lw r11,(sp+20) 800ae6c: 2b 8c 00 10 lw r12,(sp+16) 800ae70: 2b 8d 00 0c lw r13,(sp+12) 800ae74: 2b 8e 00 08 lw r14,(sp+8) 800ae78: 37 9c 00 14 addi sp,sp,20 800ae7c: c3 a0 00 00 ret =============================================================================== 0800b414 : rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { 800b414: 37 9c ff fc addi sp,sp,-4 800b418: 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) 800b41c: 28 23 00 08 lw r3,(r1+8) mode_t mode ) { IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 800b420: 28 22 00 14 lw r2,(r1+20) if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; 800b424: 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) 800b428: 20 63 00 04 andi r3,r3,0x4 800b42c: 44 60 00 05 be r3,r0,800b440 800b430: 28 43 00 4c lw r3,(r2+76) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { 800b434: 28 64 00 00 lw r4,(r3+0) 800b438: 34 03 00 05 mvi r3,5 800b43c: 44 83 00 04 be r4,r3,800b44c <== NEVER TAKEN && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; } 800b440: 2b 9d 00 04 lw ra,(sp+4) 800b444: 37 9c 00 04 addi sp,sp,4 800b448: c3 a0 00 00 ret /* * 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; 800b44c: 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; 800b450: 78 05 08 01 mvhi r5,0x801 <== NOT EXECUTED 800b454: 38 a5 c4 74 ori r5,r5,0xc474 <== 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; 800b458: 28 43 00 54 lw r3,(r2+84) <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; 800b45c: 58 45 00 4c sw (r2+76),r5 <== NOT EXECUTED the_jnode->info.file.size = 0; 800b460: 58 40 00 50 sw (r2+80),r0 <== NOT EXECUTED the_jnode->info.file.indirect = 0; 800b464: 58 40 00 54 sw (r2+84),r0 <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; 800b468: 58 40 00 58 sw (r2+88),r0 <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; 800b46c: 58 40 00 5c sw (r2+92),r0 <== NOT EXECUTED if ((count != 0) 800b470: 44 80 ff f4 be r4,r0,800b440 <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 800b474: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 800b478: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 800b47c: fb ff ff 61 calli 800b200 <== NOT EXECUTED return -1; } return 0; 800b480: 64 21 ff ff cmpei r1,r1,-1 <== NOT EXECUTED 800b484: c8 01 08 00 sub r1,r0,r1 <== NOT EXECUTED 800b488: e3 ff ff ee bi 800b440 <== NOT EXECUTED =============================================================================== 08001c6c : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8001c6c: 37 9c ff 7c addi sp,sp,-132 8001c70: 5b 8b 00 34 sw (sp+52),r11 8001c74: 5b 8c 00 30 sw (sp+48),r12 8001c78: 5b 8d 00 2c sw (sp+44),r13 8001c7c: 5b 8e 00 28 sw (sp+40),r14 8001c80: 5b 8f 00 24 sw (sp+36),r15 8001c84: 5b 90 00 20 sw (sp+32),r16 8001c88: 5b 91 00 1c sw (sp+28),r17 8001c8c: 5b 92 00 18 sw (sp+24),r18 8001c90: 5b 93 00 14 sw (sp+20),r19 8001c94: 5b 94 00 10 sw (sp+16),r20 8001c98: 5b 95 00 0c sw (sp+12),r21 8001c9c: 5b 96 00 08 sw (sp+8),r22 8001ca0: 5b 9d 00 04 sw (sp+4),ra 8001ca4: b8 20 78 00 mv r15,r1 int rv = 0; if ( 8001ca8: 34 01 00 01 mvi r1,1 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8001cac: b8 80 a0 00 mv r20,r4 8001cb0: b8 40 68 00 mv r13,r2 8001cb4: b8 60 80 00 mv r16,r3 8001cb8: b8 a0 b0 00 mv r22,r5 int rv = 0; if ( 8001cbc: 54 81 00 96 bgu r4,r1,8001f14 options == RTEMS_FILESYSTEM_READ_ONLY || options == RTEMS_FILESYSTEM_READ_WRITE ) { rtems_filesystem_fsmount_me_t fsmount_me_h = 8001cc0: b8 60 08 00 mv r1,r3 8001cc4: f8 00 1d 3c calli 80091b4 8001cc8: b8 20 a8 00 mv r21,r1 rtems_filesystem_get_mount_handler( filesystemtype ); if ( fsmount_me_h != NULL ) { 8001ccc: 44 20 00 92 be r1,r0,8001f14 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 8001cd0: 78 0e 08 01 mvhi r14,0x801 8001cd4: 34 12 00 02 mvi r18,2 8001cd8: 39 ce c0 cc ori r14,r14,0xc0cc 8001cdc: 45 a0 00 05 be r13,r0,8001cf0 } return rv; } int mount( 8001ce0: b9 a0 08 00 mv r1,r13 8001ce4: f8 00 2e f5 calli 800d8b8 8001ce8: 34 32 00 01 addi r18,r1,1 8001cec: b9 a0 70 00 mv r14,r13 const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; 8001cf0: ba 00 08 00 mv r1,r16 8001cf4: f8 00 2e f1 calli 800d8b8 8001cf8: 34 2c 00 01 addi r12,r1,1 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 8001cfc: 34 11 00 00 mvi r17,0 8001d00: 45 e0 00 04 be r15,r0,8001d10 8001d04: b9 e0 08 00 mv r1,r15 8001d08: f8 00 2e ec calli 800d8b8 8001d0c: 34 31 00 01 addi r17,r1,1 size_t target_size = strlen( target ) + 1; size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size 8001d10: 36 43 00 64 addi r3,r18,100 8001d14: b4 6c 18 00 add r3,r3,r12 + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 8001d18: 34 01 00 01 mvi r1,1 8001d1c: b4 71 10 00 add r2,r3,r17 8001d20: fb ff fd 77 calli 80012fc 8001d24: b8 20 58 00 mv r11,r1 if ( mt_entry != NULL ) { 8001d28: 44 20 00 75 be r1,r0,8001efc <== 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 ); 8001d2c: 34 33 00 64 addi r19,r1,100 memcpy( str, filesystemtype, filesystemtype_size ); 8001d30: ba 00 10 00 mv r2,r16 8001d34: b9 80 18 00 mv r3,r12 8001d38: ba 60 08 00 mv r1,r19 8001d3c: f8 00 2b 94 calli 800cb8c mt_entry->type = str; 8001d40: 59 73 00 34 sw (r11+52),r19 + 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 = 8001d44: 35 70 00 40 addi r16,r11,64 ((char *) mt_entry + sizeof( *mt_entry )); char *str = (char *) mt_fs_root + sizeof( *mt_fs_root ); memcpy( str, filesystemtype, filesystemtype_size ); mt_entry->type = str; str += filesystemtype_size; 8001d48: b6 6c 60 00 add r12,r19,r12 if ( source_or_null != NULL ) { 8001d4c: 45 e0 00 07 be r15,r0,8001d68 memcpy( str, source_or_null, source_size ); 8001d50: b9 80 08 00 mv r1,r12 8001d54: b9 e0 10 00 mv r2,r15 8001d58: ba 20 18 00 mv r3,r17 8001d5c: f8 00 2b 8c calli 800cb8c mt_entry->dev = str; 8001d60: 59 6c 00 38 sw (r11+56),r12 str += source_size; 8001d64: b5 91 60 00 add r12,r12,r17 } memcpy( str, target, target_size ); 8001d68: b9 c0 10 00 mv r2,r14 8001d6c: ba 40 18 00 mv r3,r18 8001d70: b9 80 08 00 mv r1,r12 8001d74: f8 00 2b 86 calli 800cb8c 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; 8001d78: 78 03 08 01 mvhi r3,0x801 8001d7c: 38 63 c0 d0 ori r3,r3,0xc0d0 memcpy( str, target, target_size ); mt_entry->target = str; str += target_size; mt_entry->mounted = true; 8001d80: 34 01 00 01 mvi r1,1 mt_entry->dev = str; str += source_size; } memcpy( str, target, target_size ); mt_entry->target = str; 8001d84: 59 6c 00 30 sw (r11+48),r12 str += target_size; mt_entry->mounted = true; 8001d88: 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; 8001d8c: 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; 8001d90: 59 70 00 24 sw (r11+36),r16 mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; mt_fs_root->location.mt_entry = mt_entry; mt_fs_root->reference_count = 1; 8001d94: 34 05 00 01 mvi r5,1 void *starting_address, size_t number_nodes, size_t node_size ) { _Chain_Initialize( the_chain, starting_address, number_nodes, node_size ); 8001d98: 35 61 00 14 addi r1,r11,20 8001d9c: ba 00 10 00 mv r2,r16 8001da0: 34 03 00 01 mvi r3,1 8001da4: 34 04 00 24 mvi r4,36 8001da8: 5a 05 00 18 sw (r16+24),r5 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; 8001dac: 5a 0b 00 14 sw (r16+20),r11 8001db0: f8 00 0a da calli 8004918 <_Chain_Initialize> ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; rv = (*fsmount_me_h)( mt_entry, data ); 8001db4: b9 60 08 00 mv r1,r11 filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 8001db8: 31 74 00 29 sb (r11+41),r20 rv = (*fsmount_me_h)( mt_entry, data ); 8001dbc: ba c0 10 00 mv r2,r22 8001dc0: da a0 00 00 call r21 8001dc4: b8 20 60 00 mv r12,r1 if ( rv == 0 ) { 8001dc8: 5c 20 00 18 bne r1,r0,8001e28 if ( target != NULL ) { 8001dcc: 45 a1 00 5a be r13,r1,8001f34 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 ); 8001dd0: 37 8e 00 38 addi r14,sp,56 { 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 = 8001dd4: b9 a0 10 00 mv r2,r13 8001dd8: 34 03 00 1f mvi r3,31 8001ddc: b9 c0 08 00 mv r1,r14 8001de0: f8 00 03 6a calli 8002b88 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; 8001de4: 28 22 00 14 lw r2,(r1+20) return (*mt_entry->ops->are_nodes_equal_h)( 8001de8: 28 43 00 0c lw r3,(r2+12) 8001dec: 28 42 00 24 lw r2,(r2+36) 8001df0: 28 63 00 10 lw r3,(r3+16) 8001df4: d8 60 00 00 call r3 8001df8: b8 20 78 00 mv r15,r1 rtems_filesystem_eval_path_start( &ctx, target, eval_flags ); if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { 8001dfc: 44 20 00 1d be r1,r0,8001e70 rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); 8001e00: b9 c0 08 00 mv r1,r14 8001e04: 34 02 00 10 mvi r2,16 8001e08: f8 00 02 77 calli 80027e4 rv = -1; 8001e0c: 34 0c ff ff mvi r12,-1 } rtems_filesystem_eval_path_cleanup( &ctx ); 8001e10: b9 c0 08 00 mv r1,r14 8001e14: f8 00 03 b4 calli 8002ce4 } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { (*mt_entry->ops->fsunmount_me_h)( mt_entry ); 8001e18: 29 62 00 0c lw r2,(r11+12) 8001e1c: b9 60 08 00 mv r1,r11 8001e20: 28 42 00 3c lw r2,(r2+60) 8001e24: d8 40 00 00 call r2 } } if ( rv != 0 ) { free( mt_entry ); 8001e28: b9 60 08 00 mv r1,r11 8001e2c: fb ff fd ff calli 8001628 errno = EINVAL; rv = -1; } return rv; } 8001e30: b9 80 08 00 mv r1,r12 8001e34: 2b 9d 00 04 lw ra,(sp+4) 8001e38: 2b 8b 00 34 lw r11,(sp+52) 8001e3c: 2b 8c 00 30 lw r12,(sp+48) 8001e40: 2b 8d 00 2c lw r13,(sp+44) 8001e44: 2b 8e 00 28 lw r14,(sp+40) 8001e48: 2b 8f 00 24 lw r15,(sp+36) 8001e4c: 2b 90 00 20 lw r16,(sp+32) 8001e50: 2b 91 00 1c lw r17,(sp+28) 8001e54: 2b 92 00 18 lw r18,(sp+24) 8001e58: 2b 93 00 14 lw r19,(sp+20) 8001e5c: 2b 94 00 10 lw r20,(sp+16) 8001e60: 2b 95 00 0c lw r21,(sp+12) 8001e64: 2b 96 00 08 lw r22,(sp+8) 8001e68: 37 9c 00 84 addi sp,sp,132 8001e6c: c3 a0 00 00 ret 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 ); 8001e70: 37 8c 00 70 addi r12,sp,112 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( 8001e74: 37 82 00 50 addi r2,sp,80 8001e78: b9 80 08 00 mv r1,r12 8001e7c: f8 00 04 c4 calli 800318c mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc ); 8001e80: b9 80 08 00 mv r1,r12 8001e84: f8 00 05 89 calli 80034a8 mt_entry->mt_point_node = mt_point_node; rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 8001e88: 28 22 00 14 lw r2,(r1+20) if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { rtems_filesystem_location_info_t targetloc; rtems_filesystem_global_location_t *mt_point_node; rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc ); mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc ); 8001e8c: b8 20 68 00 mv r13,r1 mt_entry->mt_point_node = mt_point_node; 8001e90: 59 61 00 20 sw (r11+32),r1 rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 8001e94: 28 42 00 0c lw r2,(r2+12) 8001e98: b9 60 08 00 mv r1,r11 8001e9c: 28 42 00 30 lw r2,(r2+48) 8001ea0: d8 40 00 00 call r2 8001ea4: b8 20 60 00 mv r12,r1 if ( rv == 0 ) { 8001ea8: 5c 2f 00 20 bne r1,r15,8001f28 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 8001eac: 78 0d 08 01 mvhi r13,0x801 8001eb0: 39 ad e7 a8 ori r13,r13,0xe7a8 8001eb4: 29 a1 00 00 lw r1,(r13+0) 8001eb8: 34 02 00 00 mvi r2,0 8001ebc: 34 03 00 00 mvi r3,0 8001ec0: f8 00 07 67 calli 8003c5c Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 8001ec4: 78 02 08 01 mvhi r2,0x801 8001ec8: 38 42 e0 f4 ori r2,r2,0xe0f4 8001ecc: 28 44 00 08 lw r4,(r2+8) the_node->next = tail; 8001ed0: 78 03 08 01 mvhi r3,0x801 8001ed4: 38 63 e0 f8 ori r3,r3,0xe0f8 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 8001ed8: 29 a1 00 00 lw r1,(r13+0) 8001edc: 59 63 00 00 sw (r11+0),r3 tail->previous = the_node; old_last->next = the_node; 8001ee0: 58 8b 00 00 sw (r4+0),r11 { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 8001ee4: 58 4b 00 08 sw (r2+8),r11 old_last->next = the_node; the_node->previous = old_last; 8001ee8: 59 64 00 04 sw (r11+4),r4 8001eec: f8 00 07 b8 calli 8003dcc } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 8001ef0: b9 c0 08 00 mv r1,r14 8001ef4: f8 00 03 7c calli 8002ce4 8001ef8: e3 ff ff ce bi 8001e30 mt_fs_root, 1, sizeof(*mt_fs_root) ); } else { free( mt_entry ); 8001efc: fb ff fd cb calli 8001628 <== NOT EXECUTED if ( rv != 0 ) { free( mt_entry ); } } else { errno = ENOMEM; 8001f00: f8 00 28 29 calli 800bfa4 <__errno> <== NOT EXECUTED 8001f04: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8001f08: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8001f0c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8001f10: e3 ff ff c8 bi 8001e30 <== NOT EXECUTED } else { errno = EINVAL; rv = -1; } } else { errno = EINVAL; 8001f14: f8 00 28 24 calli 800bfa4 <__errno> 8001f18: 34 02 00 16 mvi r2,22 8001f1c: 58 22 00 00 sw (r1+0),r2 rv = -1; 8001f20: 34 0c ff ff mvi r12,-1 8001f24: e3 ff ff c3 bi 8001e30 &rtems_filesystem_mount_table, &mt_entry->mt_node ); rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); 8001f28: b9 a0 08 00 mv r1,r13 8001f2c: f8 00 04 fb calli 8003318 8001f30: e3 ff ff b8 bi 8001e10 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 8001f34: 78 0d 08 01 mvhi r13,0x801 8001f38: 39 ad e7 a8 ori r13,r13,0xe7a8 8001f3c: 29 a1 00 00 lw r1,(r13+0) 8001f40: 34 02 00 00 mvi r2,0 8001f44: 34 03 00 00 mvi r3,0 8001f48: f8 00 07 45 calli 8003c5c errno = EINVAL; rv = -1; } return rv; } 8001f4c: 78 02 08 01 mvhi r2,0x801 8001f50: 38 42 e0 f4 ori r2,r2,0xe0f4 ) { int rv = 0; rtems_filesystem_mt_lock(); if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { 8001f54: 28 43 00 00 lw r3,(r2+0) 8001f58: 78 01 08 01 mvhi r1,0x801 8001f5c: 38 21 e0 f8 ori r1,r1,0xe0f8 8001f60: 44 61 00 08 be r3,r1,8001f80 <== ALWAYS TAKEN rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); } else { errno = EINVAL; 8001f64: f8 00 28 10 calli 800bfa4 <__errno> <== NOT EXECUTED 8001f68: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8001f6c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 8001f70: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED 8001f74: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8001f78: f8 00 07 95 calli 8003dcc <== NOT EXECUTED 8001f7c: e3 ff ff a7 bi 8001e18 <== NOT EXECUTED Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 8001f80: 28 44 00 08 lw r4,(r2+8) 8001f84: 29 a1 00 00 lw r1,(r13+0) the_node->next = tail; 8001f88: 59 63 00 00 sw (r11+0),r3 tail->previous = the_node; old_last->next = the_node; 8001f8c: 58 8b 00 00 sw (r4+0),r11 the_node->previous = old_last; 8001f90: 59 64 00 04 sw (r11+4),r4 { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 8001f94: 58 4b 00 08 sw (r2+8),r11 } 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 ); 8001f98: 35 6d 00 24 addi r13,r11,36 8001f9c: f8 00 07 8c calli 8003dcc rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = 8001fa0: b9 a0 08 00 mv r1,r13 8001fa4: f8 00 05 08 calli 80033c4 8001fa8: 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 = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 8001fac: 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 = 8001fb0: b9 a0 08 00 mv r1,r13 8001fb4: f8 00 05 04 calli 80033c4 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 8001fb8: 39 6b e1 90 ori r11,r11,0xe190 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 = 8001fbc: b8 20 68 00 mv r13,r1 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 8001fc0: 29 61 00 00 lw r1,(r11+0) 8001fc4: b9 c0 10 00 mv r2,r14 8001fc8: 34 21 00 04 addi r1,r1,4 8001fcc: f8 00 04 f0 calli 800338c &rtems_filesystem_root, new_fs_root ); rtems_filesystem_global_location_assign( 8001fd0: 29 61 00 00 lw r1,(r11+0) 8001fd4: b9 a0 10 00 mv r2,r13 8001fd8: f8 00 04 ed calli 800338c 8001fdc: e3 ff ff 95 bi 8001e30 =============================================================================== 08007620 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8007620: 37 9c ff e8 addi sp,sp,-24 8007624: 5b 8b 00 18 sw (sp+24),r11 8007628: 5b 8c 00 14 sw (sp+20),r12 800762c: 5b 8d 00 10 sw (sp+16),r13 8007630: 5b 8e 00 0c sw (sp+12),r14 8007634: 5b 8f 00 08 sw (sp+8),r15 8007638: 5b 9d 00 04 sw (sp+4),ra 800763c: b8 40 58 00 mv r11,r2 8007640: b8 20 78 00 mv r15,r1 8007644: b8 60 70 00 mv r14,r3 8007648: b8 80 68 00 mv r13,r4 800764c: b8 a0 60 00 mv r12,r5 int rv = -1; if (target != NULL) { 8007650: 44 40 00 1b be r2,r0,80076bc rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); 8007654: b8 40 08 00 mv r1,r2 8007658: 34 02 01 ff mvi r2,511 800765c: f8 00 03 67 calli 80083f8 if (rv == 0) { 8007660: 44 20 00 09 be r1,r0,8007684 <== ALWAYS TAKEN } else { errno = EINVAL; } return rv; } 8007664: 2b 9d 00 04 lw ra,(sp+4) 8007668: 2b 8b 00 18 lw r11,(sp+24) 800766c: 2b 8c 00 14 lw r12,(sp+20) 8007670: 2b 8d 00 10 lw r13,(sp+16) 8007674: 2b 8e 00 0c lw r14,(sp+12) 8007678: 2b 8f 00 08 lw r15,(sp+8) 800767c: 37 9c 00 18 addi sp,sp,24 8007680: c3 a0 00 00 ret int rv = -1; if (target != NULL) { rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); if (rv == 0) { rv = mount( 8007684: b9 e0 08 00 mv r1,r15 8007688: b9 60 10 00 mv r2,r11 800768c: b9 c0 18 00 mv r3,r14 8007690: b9 a0 20 00 mv r4,r13 8007694: b9 80 28 00 mv r5,r12 8007698: f8 00 00 0e calli 80076d0 } else { errno = EINVAL; } return rv; } 800769c: 2b 9d 00 04 lw ra,(sp+4) 80076a0: 2b 8b 00 18 lw r11,(sp+24) 80076a4: 2b 8c 00 14 lw r12,(sp+20) 80076a8: 2b 8d 00 10 lw r13,(sp+16) 80076ac: 2b 8e 00 0c lw r14,(sp+12) 80076b0: 2b 8f 00 08 lw r15,(sp+8) 80076b4: 37 9c 00 18 addi sp,sp,24 80076b8: c3 a0 00 00 ret options, data ); } } else { errno = EINVAL; 80076bc: f8 00 6b b6 calli 8022594 <__errno> 80076c0: 34 02 00 16 mvi r2,22 80076c4: 58 22 00 00 sw (r1+0),r2 const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { int rv = -1; 80076c8: 34 01 ff ff mvi r1,-1 80076cc: e3 ff ff e6 bi 8007664 =============================================================================== 08016288 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 8016288: 37 9c ff 24 addi sp,sp,-220 801628c: 5b 8b 00 44 sw (sp+68),r11 8016290: 5b 8c 00 40 sw (sp+64),r12 8016294: 5b 8d 00 3c sw (sp+60),r13 8016298: 5b 8e 00 38 sw (sp+56),r14 801629c: 5b 8f 00 34 sw (sp+52),r15 80162a0: 5b 90 00 30 sw (sp+48),r16 80162a4: 5b 91 00 2c sw (sp+44),r17 80162a8: 5b 92 00 28 sw (sp+40),r18 80162ac: 5b 93 00 24 sw (sp+36),r19 80162b0: 5b 94 00 20 sw (sp+32),r20 80162b4: 5b 95 00 1c sw (sp+28),r21 80162b8: 5b 96 00 18 sw (sp+24),r22 80162bc: 5b 97 00 14 sw (sp+20),r23 80162c0: 5b 98 00 10 sw (sp+16),r24 80162c4: 5b 99 00 0c sw (sp+12),r25 80162c8: 5b 9b 00 08 sw (sp+8),fp 80162cc: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; 80162d0: 28 27 00 14 lw r7,(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); 80162d4: 37 8b 00 a8 addi r11,sp,168 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 80162d8: 37 92 00 48 addi r18,sp,72 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; 80162dc: 28 f5 00 08 lw r21,(r7+8) msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 80162e0: b8 20 98 00 mv r19,r1 fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; dir_pos->sname.ofs = 0; dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 80162e4: 34 0d ff ff mvi r13,-1 80162e8: b8 40 a0 00 mv r20,r2 80162ec: b8 60 78 00 mv r15,r3 uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 80162f0: ba 40 08 00 mv r1,r18 80162f4: 34 03 00 40 mvi r3,64 80162f8: 34 02 00 00 mvi r2,0 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 80162fc: 59 60 00 04 sw (r11+4),r0 8016300: 59 60 00 08 sw (r11+8),r0 8016304: 59 60 00 0c sw (r11+12),r0 8016308: 59 60 00 10 sw (r11+16),r0 801630c: 59 60 00 14 sw (r11+20),r0 8016310: 59 60 00 18 sw (r11+24),r0 8016314: 59 60 00 1c sw (r11+28),r0 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 8016318: b8 80 70 00 mv r14,r4 801631c: 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; 8016320: 2a 76 00 08 lw r22,(r19+8) fat_file_fd_t *fat_fd = NULL; 8016324: 5b 80 00 d8 sw (sp+216),r0 time_t time_ret = 0; uint16_t time_val = 0; 8016328: 0f 80 00 de sh (sp+222),r0 uint16_t date = 0; 801632c: 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; 8016330: 5b 80 00 c8 sw (sp+200),r0 dir_pos->sname.ofs = 0; 8016334: 5b 80 00 cc sw (sp+204),r0 dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 8016338: 5b 8d 00 d0 sw (sp+208),r13 dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 801633c: 5b 8d 00 d4 sw (sp+212),r13 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 8016340: 5b 80 00 a8 sw (sp+168),r0 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 8016344: f8 00 18 07 calli 801c360 if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 8016348: 34 03 01 04 mvi r3,260 801634c: 4c 6e 00 06 bge r3,r14,8016364 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENAMETOOLONG); 8016350: f8 00 14 75 calli 801b524 <__errno> <== NOT EXECUTED 8016354: 34 02 00 5b mvi r2,91 <== NOT EXECUTED 8016358: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 801635c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8016360: e0 00 00 0c bi 8016390 <== NOT EXECUTED } name_type = msdos_long_to_short (name, name_len, 8016364: b9 e0 08 00 mv r1,r15 8016368: b9 c0 10 00 mv r2,r14 801636c: b9 60 18 00 mv r3,r11 8016370: 34 04 00 0b mvi r4,11 8016374: f8 00 02 1d calli 8016be8 8016378: b8 20 80 00 mv r16,r1 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 801637c: 5c 20 00 19 bne r1,r0,80163e0 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EINVAL); 8016380: f8 00 14 69 calli 801b524 <__errno> <== NOT EXECUTED 8016384: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8016388: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 801638c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED err: /* mark the used 32bytes structure on the disk as free */ msdos_set_first_char4file_name(parent_loc->mt_entry, &dir_pos, 0xE5); return rc; } 8016390: b9 80 08 00 mv r1,r12 8016394: 2b 9d 00 04 lw ra,(sp+4) 8016398: 2b 8b 00 44 lw r11,(sp+68) 801639c: 2b 8c 00 40 lw r12,(sp+64) 80163a0: 2b 8d 00 3c lw r13,(sp+60) 80163a4: 2b 8e 00 38 lw r14,(sp+56) 80163a8: 2b 8f 00 34 lw r15,(sp+52) 80163ac: 2b 90 00 30 lw r16,(sp+48) 80163b0: 2b 91 00 2c lw r17,(sp+44) 80163b4: 2b 92 00 28 lw r18,(sp+40) 80163b8: 2b 93 00 24 lw r19,(sp+36) 80163bc: 2b 94 00 20 lw r20,(sp+32) 80163c0: 2b 95 00 1c lw r21,(sp+28) 80163c4: 2b 96 00 18 lw r22,(sp+24) 80163c8: 2b 97 00 14 lw r23,(sp+20) 80163cc: 2b 98 00 10 lw r24,(sp+16) 80163d0: 2b 99 00 0c lw r25,(sp+12) 80163d4: 2b 9b 00 08 lw fp,(sp+8) 80163d8: 37 9c 00 dc addi sp,sp,220 80163dc: c3 a0 00 00 ret /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; /* set up last write date and time */ time_ret = time(NULL); 80163e0: 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; 80163e4: 33 80 00 b4 sb (sp+180),r0 /* set up last write date and time */ time_ret = time(NULL); 80163e8: f8 00 26 02 calli 801fbf0