=============================================================================== 080037e0 : */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 80037e0: 37 9c ff c0 addi sp,sp,-64 80037e4: 5b 8b 00 40 sw (sp+64),r11 80037e8: 5b 8c 00 3c sw (sp+60),r12 80037ec: 5b 8d 00 38 sw (sp+56),r13 80037f0: 5b 8e 00 34 sw (sp+52),r14 80037f4: 5b 8f 00 30 sw (sp+48),r15 80037f8: 5b 90 00 2c sw (sp+44),r16 80037fc: 5b 91 00 28 sw (sp+40),r17 8003800: 5b 92 00 24 sw (sp+36),r18 8003804: 5b 93 00 20 sw (sp+32),r19 8003808: 5b 94 00 1c sw (sp+28),r20 800380c: 5b 95 00 18 sw (sp+24),r21 8003810: 5b 96 00 14 sw (sp+20),r22 8003814: 5b 97 00 10 sw (sp+16),r23 8003818: 5b 98 00 0c sw (sp+12),r24 800381c: 5b 99 00 08 sw (sp+8),r25 8003820: 5b 9d 00 04 sw (sp+4),ra 8003824: 78 0b 08 02 mvhi r11,0x802 8003828: 39 6b 72 78 ori r11,r11,0x7278 the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); 800382c: 78 15 08 02 mvhi r21,0x802 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 8003830: 78 14 08 02 mvhi r20,0x802 ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { 8003834: 78 13 08 02 mvhi r19,0x802 default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); 8003838: 78 12 08 02 mvhi r18,0x802 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 800383c: 78 11 08 02 mvhi r17,0x802 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 8003840: 78 0d 08 02 mvhi r13,0x802 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 8003844: 78 10 08 02 mvhi r16,0x802 fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 8003848: 78 0f 08 02 mvhi r15,0x802 case IMFS_DIRECTORY: fprintf(stdout, "/" ); break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 800384c: 78 0e 08 02 mvhi r14,0x802 */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 8003850: b8 40 c0 00 mv r24,r2 } int IMFS_memfile_maximum_size( void ) { return IMFS_MEMFILE_MAXIMUM_SIZE; } 8003854: 28 2c 00 50 lw r12,(r1+80) RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 8003858: 34 39 00 54 addi r25,r1,84 the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); 800385c: 3a b5 42 9c ori r21,r21,0x429c 8003860: b9 60 b8 00 mv r23,r11 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 8003864: 3a 94 42 fc ori r20,r20,0x42fc ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { 8003868: 3a 73 43 80 ori r19,r19,0x4380 default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); 800386c: 3a 52 3e 6c ori r18,r18,0x3e6c case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 8003870: 3a 31 42 e8 ori r17,r17,0x42e8 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 8003874: 39 ad 42 d4 ori r13,r13,0x42d4 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 8003878: 3a 10 42 c8 ori r16,r16,0x42c8 fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 800387c: 39 ef 42 b8 ori r15,r15,0x42b8 case IMFS_DIRECTORY: fprintf(stdout, "/" ); break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 8003880: 39 ce 42 a4 ori r14,r14,0x42a4 IMFS_assert( level >= 0 ); IMFS_assert( IMFS_is_directory( the_directory ) ); the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); 8003884: e0 00 00 43 bi 8003990 !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) 8003888: 34 16 00 00 mvi r22,0 800388c: e0 00 00 06 bi 80038a4 fprintf(stdout, "...." ); 8003890: 29 62 00 00 lw r2,(r11+0) 8003894: ba a0 08 00 mv r1,r21 !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) 8003898: 36 d6 00 01 addi r22,r22,1 fprintf(stdout, "...." ); 800389c: 28 42 00 08 lw r2,(r2+8) 80038a0: f8 00 37 bd calli 8011794 !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) 80038a4: 4f 16 ff fb bge r24,r22,8003890 IMFS_jnode_t *the_jnode ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 80038a8: 2a e2 00 00 lw r2,(r23+0) 80038ac: 35 81 00 0c addi r1,r12,12 80038b0: 28 42 00 08 lw r2,(r2+8) 80038b4: f8 00 37 b8 calli 8011794 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 80038b8: 29 81 00 4c lw r1,(r12+76) 80038bc: 28 23 00 00 lw r3,(r1+0) switch( IMFS_type( the_jnode ) ) { 80038c0: 34 01 00 06 mvi r1,6 80038c4: 54 61 00 25 bgu r3,r1,8003958 <== NEVER TAKEN 80038c8: b8 60 08 00 mv r1,r3 80038cc: 34 02 00 02 mvi r2,2 80038d0: f8 00 79 f9 calli 80220b4 <__ashlsi3> 80038d4: b6 61 08 00 add r1,r19,r1 80038d8: 28 21 00 00 lw r1,(r1+0) 80038dc: c0 20 00 00 b r1 case IMFS_DIRECTORY: fprintf(stdout, "/" ); 80038e0: 29 62 00 00 lw r2,(r11+0) 80038e4: 34 01 00 2f mvi r1,47 80038e8: 28 42 00 08 lw r2,(r2+8) 80038ec: f8 00 37 66 calli 8011684 80038f0: e0 00 00 1f bi 800396c break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 80038f4: 29 61 00 00 lw r1,(r11+0) 80038f8: b9 c0 10 00 mv r2,r14 80038fc: 28 21 00 08 lw r1,(r1+8) 8003900: e0 00 00 04 bi 8003910 the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 8003904: 29 61 00 00 lw r1,(r11+0) 8003908: b9 e0 10 00 mv r2,r15 800390c: 28 21 00 08 lw r1,(r1+8) 8003910: 29 83 00 50 lw r3,(r12+80) 8003914: 29 84 00 54 lw r4,(r12+84) 8003918: f8 00 37 34 calli 80115e8 800391c: e0 00 00 14 bi 800396c the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 8003920: 29 61 00 00 lw r1,(r11+0) 8003924: 29 83 00 50 lw r3,(r12+80) 8003928: ba 00 10 00 mv r2,r16 800392c: 28 21 00 08 lw r1,(r1+8) 8003930: f8 00 37 2e calli 80115e8 8003934: e0 00 00 0e bi 800396c case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 8003938: 29 62 00 00 lw r2,(r11+0) 800393c: b9 a0 08 00 mv r1,r13 8003940: e0 00 00 03 bi 800394c return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 8003944: 29 62 00 00 lw r2,(r11+0) 8003948: ba 20 08 00 mv r1,r17 800394c: 28 42 00 08 lw r2,(r2+8) 8003950: f8 00 37 91 calli 8011794 8003954: e0 00 00 08 bi 8003974 return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 8003958: 2a e1 00 00 lw r1,(r23+0) <== NOT EXECUTED 800395c: ba 80 10 00 mv r2,r20 <== NOT EXECUTED 8003960: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED 8003964: f8 00 37 21 calli 80115e8 <== NOT EXECUTED 8003968: e0 00 00 03 bi 8003974 <== NOT EXECUTED return; } puts(""); 800396c: ba 40 08 00 mv r1,r18 8003970: f8 00 3f 18 calli 80135d0 } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 8003974: 29 81 00 4c lw r1,(r12+76) the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) 8003978: 28 21 00 00 lw r1,(r1+0) 800397c: 5c 20 00 04 bne r1,r0,800398c IMFS_dump_directory( the_jnode, level + 1 ); 8003980: b9 80 08 00 mv r1,r12 8003984: 37 02 00 01 addi r2,r24,1 8003988: fb ff ff 96 calli 80037e0 the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { 800398c: 29 8c 00 00 lw r12,(r12+0) IMFS_assert( level >= 0 ); IMFS_assert( IMFS_is_directory( the_directory ) ); the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); 8003990: 5d 99 ff be bne r12,r25,8003888 fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) IMFS_dump_directory( the_jnode, level + 1 ); } } 8003994: 2b 9d 00 04 lw ra,(sp+4) 8003998: 2b 8b 00 40 lw r11,(sp+64) 800399c: 2b 8c 00 3c lw r12,(sp+60) 80039a0: 2b 8d 00 38 lw r13,(sp+56) 80039a4: 2b 8e 00 34 lw r14,(sp+52) 80039a8: 2b 8f 00 30 lw r15,(sp+48) 80039ac: 2b 90 00 2c lw r16,(sp+44) 80039b0: 2b 91 00 28 lw r17,(sp+40) 80039b4: 2b 92 00 24 lw r18,(sp+36) 80039b8: 2b 93 00 20 lw r19,(sp+32) 80039bc: 2b 94 00 1c lw r20,(sp+28) 80039c0: 2b 95 00 18 lw r21,(sp+24) 80039c4: 2b 96 00 14 lw r22,(sp+20) 80039c8: 2b 97 00 10 lw r23,(sp+16) 80039cc: 2b 98 00 0c lw r24,(sp+12) 80039d0: 2b 99 00 08 lw r25,(sp+8) 80039d4: 37 9c 00 40 addi sp,sp,64 80039d8: c3 a0 00 00 ret =============================================================================== 0800c8a8 : rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 800c8a8: 37 9c ff e0 addi sp,sp,-32 800c8ac: 5b 8b 00 20 sw (sp+32),r11 800c8b0: 5b 8c 00 1c sw (sp+28),r12 800c8b4: 5b 8d 00 18 sw (sp+24),r13 800c8b8: 5b 8e 00 14 sw (sp+20),r14 800c8bc: 5b 8f 00 10 sw (sp+16),r15 800c8c0: 5b 90 00 0c sw (sp+12),r16 800c8c4: 5b 91 00 08 sw (sp+8),r17 800c8c8: 5b 9d 00 04 sw (sp+4),ra rtems_filesystem_eval_path_generic_status status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE; rtems_filesystem_location_info_t *currentloc = rtems_filesystem_eval_path_get_currentloc( ctx ); IMFS_jnode_t *dir = currentloc->node_access; 800c8cc: 28 2d 00 20 lw r13,(r1+32) rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 800c8d0: b8 60 78 00 mv r15,r3 800c8d4: b8 80 80 00 mv r16,r4 rtems_filesystem_eval_path_generic_status status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE; rtems_filesystem_location_info_t *currentloc = rtems_filesystem_eval_path_get_currentloc( ctx ); IMFS_jnode_t *dir = currentloc->node_access; bool access_ok = rtems_filesystem_eval_path_check_access( 800c8d8: 29 a3 00 30 lw r3,(r13+48) 800c8dc: 2d a4 00 3c lhu r4,(r13+60) 800c8e0: 2d a5 00 3e lhu r5,(r13+62) 800c8e4: 34 02 00 01 mvi r2,1 rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 800c8e8: b8 20 60 00 mv r12,r1 rtems_filesystem_eval_path_generic_status status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE; rtems_filesystem_location_info_t *currentloc = rtems_filesystem_eval_path_get_currentloc( ctx ); IMFS_jnode_t *dir = currentloc->node_access; bool access_ok = rtems_filesystem_eval_path_check_access( 800c8ec: f8 00 03 3e calli 800d5e4 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 800c8f0: 34 0e 00 01 mvi r14,1 dir->st_mode, dir->st_uid, dir->st_gid ); if ( access_ok ) { 800c8f4: 44 20 00 46 be r1,r0,800ca0c static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; 800c8f8: 5e 0e 00 50 bne r16,r14,800ca38 800c8fc: 41 e2 00 00 lbu r2,(r15+0) 800c900: 34 01 00 2e mvi r1,46 800c904: 5c 41 00 4f bne r2,r1,800ca40 800c908: e0 00 00 15 bi 800c95c static inline bool rtems_filesystem_is_parent_directory( const char *token, size_t tokenlen ) { return tokenlen == 2 && token [0] == '.' && token [1] == '.'; 800c90c: 41 e1 00 00 lbu r1,(r15+0) 800c910: 34 02 00 2e mvi r2,46 800c914: 5c 22 00 4b bne r1,r2,800ca40 800c918: 41 e2 00 01 lbu r2,(r15+1) 800c91c: 5c 41 00 49 bne r2,r1,800ca40 <== NEVER TAKEN { if ( rtems_filesystem_is_current_directory( token, tokenlen ) ) { return dir; } else { if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { return dir->Parent; 800c920: 29 ab 00 08 lw r11,(r13+8) 800c924: e0 00 00 0f bi 800c960 rtems_chain_node *current = rtems_chain_first( entries ); rtems_chain_node *tail = rtems_chain_tail( entries ); while ( current != tail ) { IMFS_jnode_t *entry = (IMFS_jnode_t *) current; bool match = strncmp( entry->name, token, tokenlen ) == 0 800c928: 35 c1 00 0c addi r1,r14,12 800c92c: b9 e0 10 00 mv r2,r15 800c930: ba 00 18 00 mv r3,r16 rtems_chain_control *entries = &dir->info.directory.Entries; rtems_chain_node *current = rtems_chain_first( entries ); rtems_chain_node *tail = rtems_chain_tail( entries ); while ( current != tail ) { IMFS_jnode_t *entry = (IMFS_jnode_t *) current; 800c934: b9 c0 58 00 mv r11,r14 bool match = strncmp( entry->name, token, tokenlen ) == 0 800c938: f8 00 19 97 calli 8012f94 && entry->name [tokenlen] == '\0'; 800c93c: 5c 20 00 44 bne r1,r0,800ca4c 800c940: b5 d0 10 00 add r2,r14,r16 800c944: 40 42 00 0c lbu r2,(r2+12) 800c948: 44 41 00 06 be r2,r1,800c960 800c94c: e0 00 00 40 bi 800ca4c } else { rtems_chain_control *entries = &dir->info.directory.Entries; rtems_chain_node *current = rtems_chain_first( entries ); rtems_chain_node *tail = rtems_chain_tail( entries ); while ( current != tail ) { 800c950: 5d d1 ff f6 bne r14,r17,800c928 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; 800c954: 34 0e 00 02 mvi r14,2 800c958: e0 00 00 2d bi 800ca0c static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; 800c95c: b9 a0 58 00 mv r11,r13 800c960: 34 0e 00 02 mvi r14,2 ); if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { 800c964: 45 60 00 2a be r11,r0,800ca0c rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 800c968: 29 61 00 4c lw r1,(r11+76) bool terminal = !rtems_filesystem_eval_path_has_path( ctx ); 800c96c: 29 83 00 04 lw r3,(r12+4) }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 800c970: 29 82 00 10 lw r2,(r12+16) 800c974: 28 21 00 00 lw r1,(r1+0) static inline void rtems_filesystem_eval_path_clear_token( rtems_filesystem_eval_path_context_t *ctx ) { ctx->tokenlen = 0; 800c978: 59 80 00 0c sw (r12+12),r0 if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { bool terminal = !rtems_filesystem_eval_path_has_path( ctx ); 800c97c: 64 63 00 00 cmpei r3,r3,0 bool follow_sym_link = (eval_flags & RTEMS_FS_FOLLOW_SYM_LINK) != 0; IMFS_jnode_types_t type = IMFS_type( entry ); rtems_filesystem_eval_path_clear_token( ctx ); if ( type == IMFS_HARD_LINK && (follow_hard_link || !terminal)) { 800c980: 5c 2e 00 06 bne r1,r14,800c998 IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { bool terminal = !rtems_filesystem_eval_path_has_path( ctx ); int eval_flags = rtems_filesystem_eval_path_get_flags( ctx ); bool follow_hard_link = (eval_flags & RTEMS_FS_FOLLOW_HARD_LINK) != 0; 800c984: 20 42 00 08 andi r2,r2,0x8 bool follow_sym_link = (eval_flags & RTEMS_FS_FOLLOW_SYM_LINK) != 0; IMFS_jnode_types_t type = IMFS_type( entry ); rtems_filesystem_eval_path_clear_token( ctx ); if ( type == IMFS_HARD_LINK && (follow_hard_link || !terminal)) { 800c988: 5c 40 00 02 bne r2,r0,800c990 800c98c: 5c 62 00 32 bne r3,r2,800ca54 <== ALWAYS TAKEN entry = entry->info.hard_link.link_node; 800c990: 29 6b 00 50 lw r11,(r11+80) 800c994: e0 00 00 30 bi 800ca54 } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 800c998: 34 04 00 03 mvi r4,3 800c99c: 5c 24 00 0d bne r1,r4,800c9d0 if ( entry != NULL ) { bool terminal = !rtems_filesystem_eval_path_has_path( ctx ); int eval_flags = rtems_filesystem_eval_path_get_flags( ctx ); bool follow_hard_link = (eval_flags & RTEMS_FS_FOLLOW_HARD_LINK) != 0; bool follow_sym_link = (eval_flags & RTEMS_FS_FOLLOW_SYM_LINK) != 0; 800c9a0: 20 41 00 10 andi r1,r2,0x10 if ( type == IMFS_HARD_LINK && (follow_hard_link || !terminal)) { entry = entry->info.hard_link.link_node; } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 800c9a4: 5c 20 00 02 bne r1,r0,800c9ac 800c9a8: 5c 61 00 2b bne r3,r1,800ca54 const char *target = entry->info.sym_link.name; 800c9ac: 29 6b 00 50 lw r11,(r11+80) void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 800c9b0: 34 0e 00 01 mvi r14,1 } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { const char *target = entry->info.sym_link.name; rtems_filesystem_eval_path_recursive( ctx, target, strlen( target ) ); 800c9b4: b9 60 08 00 mv r1,r11 800c9b8: f8 00 19 48 calli 8012ed8 800c9bc: b8 20 18 00 mv r3,r1 800c9c0: b9 60 10 00 mv r2,r11 800c9c4: b9 80 08 00 mv r1,r12 800c9c8: fb ff de 30 calli 8004288 if ( type == IMFS_HARD_LINK && (follow_hard_link || !terminal)) { entry = entry->info.hard_link.link_node; } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 800c9cc: e0 00 00 10 bi 800ca0c IMFS_jnode_types_t type ) { rtems_filesystem_global_location_t **fs_root_ptr = NULL; if ( type == IMFS_DIRECTORY ) { 800c9d0: 5c 20 00 21 bne r1,r0,800ca54 if ( node->info.directory.mt_fs != NULL ) { 800c9d4: 29 62 00 5c lw r2,(r11+92) 800c9d8: 44 41 00 1f be r2,r1,800ca54 if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( 800c9dc: 29 63 00 30 lw r3,(r11+48) 800c9e0: 2d 64 00 3c lhu r4,(r11+60) 800c9e4: 2d 65 00 3e lhu r5,(r11+62) { rtems_filesystem_global_location_t **fs_root_ptr = NULL; if ( type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { fs_root_ptr = &node->info.directory.mt_fs->mt_fs_root; 800c9e8: 34 4d 00 24 addi r13,r2,36 if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( 800c9ec: b9 80 08 00 mv r1,r12 800c9f0: 34 02 00 01 mvi r2,1 800c9f4: f8 00 02 fc calli 800d5e4 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 800c9f8: 34 0e 00 01 mvi r14,1 RTEMS_FS_PERMS_EXEC, entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { 800c9fc: 44 20 00 04 be r1,r0,800ca0c <== NEVER TAKEN rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); 800ca00: b9 80 08 00 mv r1,r12 800ca04: b9 a0 10 00 mv r2,r13 800ca08: fb ff dd fc calli 80041f8 status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } 800ca0c: b9 c0 08 00 mv r1,r14 800ca10: 2b 9d 00 04 lw ra,(sp+4) 800ca14: 2b 8b 00 20 lw r11,(sp+32) 800ca18: 2b 8c 00 1c lw r12,(sp+28) 800ca1c: 2b 8d 00 18 lw r13,(sp+24) 800ca20: 2b 8e 00 14 lw r14,(sp+20) 800ca24: 2b 8f 00 10 lw r15,(sp+16) 800ca28: 2b 90 00 0c lw r16,(sp+12) 800ca2c: 2b 91 00 08 lw r17,(sp+8) 800ca30: 37 9c 00 20 addi sp,sp,32 800ca34: c3 a0 00 00 ret static inline bool rtems_filesystem_is_parent_directory( const char *token, size_t tokenlen ) { return tokenlen == 2 && token [0] == '.' && token [1] == '.'; 800ca38: 34 01 00 02 mvi r1,2 800ca3c: 46 01 ff b4 be r16,r1,800c90c }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 800ca40: 29 ae 00 50 lw r14,(r13+80) if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { return dir->Parent; } else { rtems_chain_control *entries = &dir->info.directory.Entries; rtems_chain_node *current = rtems_chain_first( entries ); rtems_chain_node *tail = rtems_chain_tail( entries ); 800ca44: 35 b1 00 54 addi r17,r13,84 800ca48: e3 ff ff c2 bi 800c950 }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 800ca4c: 29 ce 00 00 lw r14,(r14+0) 800ca50: e3 ff ff c0 bi 800c950 } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; 800ca54: 2d a1 00 34 lhu r1,(r13+52) void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 800ca58: b8 60 70 00 mv r14,r3 } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; 800ca5c: 34 21 ff ff addi r1,r1,-1 800ca60: 0d a1 00 34 sh (r13+52),r1 ++entry->reference_count; 800ca64: 2d 61 00 34 lhu r1,(r11+52) 800ca68: 34 21 00 01 addi r1,r1,1 800ca6c: 0d 61 00 34 sh (r11+52),r1 static inline void IMFS_Set_handlers( rtems_filesystem_location_info_t *loc ) { IMFS_jnode_t *node = (IMFS_jnode_t *) loc->node_access; loc->handlers = node->control->handlers; 800ca70: 29 61 00 4c lw r1,(r11+76) currentloc->node_access = entry; 800ca74: 59 8b 00 20 sw (r12+32),r11 800ca78: 28 21 00 04 lw r1,(r1+4) 800ca7c: 59 81 00 28 sw (r12+40),r1 800ca80: e3 ff ff e3 bi 800ca0c =============================================================================== 080018ec : static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 80018ec: 37 9c ff ec addi sp,sp,-20 80018f0: 5b 8b 00 0c sw (sp+12),r11 80018f4: 5b 8c 00 08 sw (sp+8),r12 80018f8: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode = iop->pathinfo.node_access; 80018fc: 28 2c 00 14 lw r12,(r1+20) static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 8001900: b8 20 20 00 mv r4,r1 IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 8001904: 29 81 00 50 lw r1,(r12+80) 8001908: f8 00 24 13 calli 800a954 800190c: b8 20 58 00 mv r11,r1 if (err > 0) { 8001910: 4c 01 00 08 bge r0,r1,8001930 IMFS_mtime_ctime_update(jnode); 8001914: 37 81 00 10 addi r1,sp,16 8001918: 34 02 00 00 mvi r2,0 800191c: f8 00 03 db calli 8002888 8001920: 2b 81 00 10 lw r1,(sp+16) 8001924: 59 81 00 44 sw (r12+68),r1 8001928: 59 81 00 48 sw (r12+72),r1 800192c: e0 00 00 06 bi 8001944 } IMFS_FIFO_RETURN(err); 8001930: 44 20 00 05 be r1,r0,8001944 <== NEVER TAKEN 8001934: c8 0b 58 00 sub r11,r0,r11 8001938: f8 00 34 92 calli 800eb80 <__errno> 800193c: 58 2b 00 00 sw (r1+0),r11 8001940: 34 0b ff ff mvi r11,-1 } 8001944: b9 60 08 00 mv r1,r11 8001948: 2b 9d 00 04 lw ra,(sp+4) 800194c: 2b 8b 00 0c lw r11,(sp+12) 8001950: 2b 8c 00 08 lw r12,(sp+8) 8001954: 37 9c 00 14 addi sp,sp,20 8001958: c3 a0 00 00 ret =============================================================================== 0800cb30 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 800cb30: 37 9c ff d8 addi sp,sp,-40 800cb34: 5b 8b 00 10 sw (sp+16),r11 800cb38: 5b 8c 00 0c sw (sp+12),r12 800cb3c: 5b 8d 00 08 sw (sp+8),r13 800cb40: 5b 9d 00 04 sw (sp+4),ra /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; 800cb44: 28 21 00 24 lw r1,(r1+36) next = jnode->Parent; loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { result = IMFS_rmnod( NULL, &loc ); 800cb48: 37 8c 00 14 addi r12,sp,20 /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; 800cb4c: 28 2b 00 08 lw r11,(r1+8) 800cb50: 28 26 00 00 lw r6,(r1+0) 800cb54: 28 25 00 04 lw r5,(r1+4) 800cb58: 28 24 00 0c lw r4,(r1+12) 800cb5c: 28 23 00 10 lw r3,(r1+16) 800cb60: 28 22 00 14 lw r2,(r1+20) 800cb64: 5b 86 00 14 sw (sp+20),r6 800cb68: 5b 85 00 18 sw (sp+24),r5 800cb6c: 5b 8b 00 1c sw (sp+28),r11 800cb70: 5b 84 00 20 sw (sp+32),r4 800cb74: 5b 83 00 24 sw (sp+36),r3 800cb78: 5b 82 00 28 sw (sp+40),r2 /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; 800cb7c: 58 20 00 08 sw (r1+8),r0 800cb80: 29 61 00 4c lw r1,(r11+76) do { next = jnode->Parent; 800cb84: 29 6d 00 08 lw r13,(r11+8) loc.node_access = (void *)jnode; 800cb88: 5b 8b 00 1c sw (sp+28),r11 800cb8c: 28 22 00 04 lw r2,(r1+4) IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { 800cb90: 28 21 00 00 lw r1,(r1+0) 800cb94: 5b 82 00 24 sw (sp+36),r2 800cb98: 5c 20 00 04 bne r1,r0,800cba8 800cb9c: 29 62 00 50 lw r2,(r11+80) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 800cba0: 35 61 00 54 addi r1,r11,84 800cba4: 5c 41 00 0c bne r2,r1,800cbd4 result = IMFS_rmnod( NULL, &loc ); 800cba8: 34 01 00 00 mvi r1,0 800cbac: b9 80 10 00 mv r2,r12 800cbb0: fb ff d6 66 calli 8002548 if ( result != 0 ) 800cbb4: 44 20 00 05 be r1,r0,800cbc8 <== ALWAYS TAKEN rtems_fatal_error_occurred( 0xdeadbeef ); 800cbb8: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 800cbbc: 38 42 88 bc ori r2,r2,0x88bc <== NOT EXECUTED 800cbc0: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 800cbc4: fb ff e2 27 calli 8005460 <== NOT EXECUTED IMFS_node_destroy( jnode ); 800cbc8: b9 60 08 00 mv r1,r11 800cbcc: fb ff d5 7c calli 80021bc jnode = next; 800cbd0: b9 a0 58 00 mv r11,r13 } if ( jnode != NULL ) { 800cbd4: 45 60 00 09 be r11,r0,800cbf8 return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 800cbd8: 29 61 00 4c lw r1,(r11+76) if ( IMFS_is_directory( jnode ) ) { 800cbdc: 28 21 00 00 lw r1,(r1+0) 800cbe0: 5c 20 ff e8 bne r1,r0,800cb80 <== NEVER TAKEN if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); } 800cbe4: 29 61 00 50 lw r1,(r11+80) 800cbe8: 35 62 00 54 addi r2,r11,84 IMFS_node_destroy( jnode ); jnode = next; } if ( jnode != NULL ) { if ( IMFS_is_directory( jnode ) ) { if ( jnode_has_children( jnode ) ) 800cbec: 44 22 ff e5 be r1,r2,800cb80 jnode = jnode_get_first_child( jnode ); 800cbf0: b8 20 58 00 mv r11,r1 } } } while (jnode != NULL); 800cbf4: 5c 20 ff e3 bne r1,r0,800cb80 <== ALWAYS TAKEN } 800cbf8: 2b 9d 00 04 lw ra,(sp+4) 800cbfc: 2b 8b 00 10 lw r11,(sp+16) 800cc00: 2b 8c 00 0c lw r12,(sp+12) 800cc04: 2b 8d 00 08 lw r13,(sp+8) 800cc08: 37 9c 00 28 addi sp,sp,40 800cc0c: c3 a0 00 00 ret =============================================================================== 08002060 : int IMFS_initialize_support( rtems_filesystem_mount_table_entry_t *mt_entry, const rtems_filesystem_operations_table *op_table, const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT] ) { 8002060: 37 9c ff ec addi sp,sp,-20 8002064: 5b 8b 00 14 sw (sp+20),r11 8002068: 5b 8c 00 10 sw (sp+16),r12 800206c: 5b 8d 00 0c sw (sp+12),r13 8002070: 5b 8e 00 08 sw (sp+8),r14 8002074: 5b 9d 00 04 sw (sp+4),ra 8002078: b8 20 68 00 mv r13,r1 800207c: b8 40 70 00 mv r14,r2 static int imfs_instance; int rv = 0; IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); 8002080: 34 01 00 01 mvi r1,1 8002084: 34 02 00 24 mvi r2,36 int IMFS_initialize_support( rtems_filesystem_mount_table_entry_t *mt_entry, const rtems_filesystem_operations_table *op_table, const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT] ) { 8002088: b8 60 58 00 mv r11,r3 static int imfs_instance; int rv = 0; IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); 800208c: f8 00 01 d7 calli 80027e8 8002090: b8 20 60 00 mv r12,r1 if ( fs_info != NULL ) { 8002094: 44 20 00 2d be r1,r0,8002148 IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 8002098: 78 03 08 01 mvhi r3,0x801 800209c: 38 63 a7 64 ori r3,r3,0xa764 80020a0: 28 62 00 00 lw r2,(r3+0) 80020a4: 58 22 00 00 sw (r1+0),r2 80020a8: 34 42 00 01 addi r2,r2,1 80020ac: 58 62 00 00 sw (r3+0),r2 memcpy( 80020b0: 29 62 00 00 lw r2,(r11+0) 80020b4: 29 66 00 10 lw r6,(r11+16) 80020b8: 29 65 00 14 lw r5,(r11+20) 80020bc: 29 64 00 18 lw r4,(r11+24) 80020c0: 29 69 00 04 lw r9,(r11+4) 80020c4: 29 68 00 08 lw r8,(r11+8) 80020c8: 29 67 00 0c lw r7,(r11+12) fs_info->node_controls, 80020cc: 34 23 00 08 addi r3,r1,8 if ( fs_info != NULL ) { IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; memcpy( 80020d0: 58 22 00 08 sw (r1+8),r2 80020d4: 58 66 00 10 sw (r3+16),r6 80020d8: 58 65 00 14 sw (r3+20),r5 80020dc: 58 64 00 18 sw (r3+24),r4 80020e0: 58 69 00 04 sw (r3+4),r9 80020e4: 58 68 00 08 sw (r3+8),r8 80020e8: 58 67 00 0c sw (r3+12),r7 fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( 80020ec: 78 03 08 01 mvhi r3,0x801 80020f0: 38 63 89 9c ori r3,r3,0x899c 80020f4: 34 04 00 00 mvi r4,0 80020f8: 34 05 41 ed mvi r5,16877 80020fc: 34 06 00 00 mvi r6,0 8002100: f8 00 29 8a calli 800c728 "", 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { 8002104: 44 20 00 11 be r1,r0,8002148 <== NEVER TAKEN mt_entry->fs_info = fs_info; mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; 8002108: 78 02 08 01 mvhi r2,0x801 800210c: 38 42 8d 90 ori r2,r2,0x8d90 8002110: 59 a2 00 2c sw (r13+44),r2 mt_entry->mt_fs_root->location.node_access = root_node; 8002114: 29 a2 00 24 lw r2,(r13+36) 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; 8002118: 59 ac 00 08 sw (r13+8),r12 mt_entry->ops = op_table; 800211c: 59 ae 00 0c sw (r13+12),r14 mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; mt_entry->mt_fs_root->location.node_access = root_node; 8002120: 58 41 00 08 sw (r2+8),r1 static inline void IMFS_Set_handlers( rtems_filesystem_location_info_t *loc ) { IMFS_jnode_t *node = (IMFS_jnode_t *) loc->node_access; loc->handlers = node->control->handlers; 8002124: 28 21 00 4c lw r1,(r1+76) errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 8002128: 34 0c 00 06 mvi r12,6 800212c: 28 21 00 04 lw r1,(r1+4) 8002130: 58 41 00 10 sw (r2+16),r1 8002134: 78 01 08 01 mvhi r1,0x801 8002138: 38 21 a0 14 ori r1,r1,0xa014 800213c: 28 2b 00 00 lw r11,(r1+0) int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 8002140: 34 01 00 10 mvi r1,16 8002144: e0 00 00 06 bi 800215c } else { errno = ENOMEM; rv = -1; } } else { errno = ENOMEM; 8002148: f8 00 3e e1 calli 8011ccc <__errno> 800214c: 34 02 00 0c mvi r2,12 8002150: 58 22 00 00 sw (r1+0),r2 8002154: 34 01 ff ff mvi r1,-1 8002158: e0 00 00 0c bi 8002188 /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { if (bit_mask == requested_bytes_per_block) { 800215c: 44 2b 00 07 be r1,r11,8002178 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) 8002160: 48 2b 00 05 bg r1,r11,8002174 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 8002164: 34 02 00 01 mvi r2,1 8002168: 35 8c ff ff addi r12,r12,-1 800216c: f8 00 55 f5 calli 8017940 <__ashlsi3> 8002170: 5d 80 ff fb bne r12,r0,800215c <== ALWAYS TAKEN if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); 8002174: 34 0b 00 80 mvi r11,128 break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) 8002178: 78 01 08 01 mvhi r1,0x801 800217c: 38 21 a7 60 ori r1,r1,0xa760 8002180: 58 2b 00 00 sw (r1+0),r11 const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT] ) { static int imfs_instance; int rv = 0; 8002184: 34 01 00 00 mvi r1,0 IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK ); } return rv; } 8002188: 2b 9d 00 04 lw ra,(sp+4) 800218c: 2b 8b 00 14 lw r11,(sp+20) 8002190: 2b 8c 00 10 lw r12,(sp+16) 8002194: 2b 8d 00 0c lw r13,(sp+12) 8002198: 2b 8e 00 08 lw r14,(sp+8) 800219c: 37 9c 00 14 addi sp,sp,20 80021a0: c3 a0 00 00 ret =============================================================================== 08002cf8 : const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 8002cf8: 37 9c ff 98 addi sp,sp,-104 8002cfc: 5b 8b 00 18 sw (sp+24),r11 8002d00: 5b 8c 00 14 sw (sp+20),r12 8002d04: 5b 8d 00 10 sw (sp+16),r13 8002d08: 5b 8e 00 0c sw (sp+12),r14 8002d0c: 5b 8f 00 08 sw (sp+8),r15 8002d10: 5b 9d 00 04 sw (sp+4),ra int rv = 0; mode &= ~rtems_filesystem_umask; 8002d14: 78 05 08 01 mvhi r5,0x801 8002d18: 38 a5 a1 7c ori r5,r5,0xa17c const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 8002d1c: b8 20 38 00 mv r7,r1 int rv = 0; mode &= ~rtems_filesystem_umask; 8002d20: 28 a1 00 00 lw r1,(r5+0) const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 8002d24: b8 60 58 00 mv r11,r3 8002d28: b8 80 78 00 mv r15,r4 int rv = 0; mode &= ~rtems_filesystem_umask; 8002d2c: 28 2e 00 08 lw r14,(r1+8) switch (mode & S_IFMT) { 8002d30: 34 01 20 00 mvi r1,8192 void *context ) { int rv = 0; mode &= ~rtems_filesystem_umask; 8002d34: a5 c0 70 00 not r14,r14 8002d38: a0 4e 70 00 and r14,r2,r14 switch (mode & S_IFMT) { 8002d3c: 21 c6 f0 00 andi r6,r14,0xf000 8002d40: 44 c1 00 08 be r6,r1,8002d60 8002d44: 54 c1 00 03 bgu r6,r1,8002d50 <== ALWAYS TAKEN 8002d48: 34 01 10 00 mvi r1,4096 <== NOT EXECUTED 8002d4c: e0 00 00 04 bi 8002d5c <== NOT EXECUTED 8002d50: 34 01 60 00 mvi r1,24576 8002d54: 44 c1 00 03 be r6,r1,8002d60 8002d58: 34 21 20 00 addi r1,r1,8192 8002d5c: 5c c1 00 2b bne r6,r1,8002e08 <== ALWAYS TAKEN rv = -1; break; } if ( rv == 0 ) { if ( node_control->imfs_type == IMFS_GENERIC ) { 8002d60: 29 62 00 00 lw r2,(r11+0) 8002d64: 34 01 00 07 mvi r1,7 8002d68: 5c 41 00 28 bne r2,r1,8002e08 rtems_filesystem_eval_path_context_t ctx; int eval_flags = RTEMS_FS_FOLLOW_LINK | RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE; const rtems_filesystem_location_info_t *currentloc = rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); 8002d6c: 37 8c 00 1c addi r12,sp,28 if ( node_control->imfs_type == IMFS_GENERIC ) { rtems_filesystem_eval_path_context_t ctx; int eval_flags = RTEMS_FS_FOLLOW_LINK | RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE; const rtems_filesystem_location_info_t *currentloc = 8002d70: b9 80 08 00 mv r1,r12 8002d74: b8 e0 10 00 mv r2,r7 8002d78: 34 03 00 78 mvi r3,120 8002d7c: f8 00 08 71 calli 8004f40 8002d80: b8 20 68 00 mv r13,r1 rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); if ( IMFS_is_imfs_instance( currentloc ) ) { 8002d84: fb ff ff c8 calli 8002ca4 8002d88: 44 20 00 19 be r1,r0,8002dec IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; new_node = IMFS_create_node_with_control( 8002d8c: 2b 83 00 24 lw r3,(sp+36) 8002d90: 2b 84 00 28 lw r4,(sp+40) 8002d94: b9 60 10 00 mv r2,r11 8002d98: b9 a0 08 00 mv r1,r13 8002d9c: b9 c0 28 00 mv r5,r14 8002da0: 37 86 00 54 addi r6,sp,84 if ( IMFS_is_imfs_instance( currentloc ) ) { IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; 8002da4: 5b 8f 00 54 sw (sp+84),r15 new_node = IMFS_create_node_with_control( 8002da8: f8 00 29 0d calli 800d1dc IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); } else { rv = -1; 8002dac: 34 0b ff ff mvi r11,-1 rtems_filesystem_eval_path_get_tokenlen( &ctx ), mode, &info ); if ( new_node != NULL ) { 8002db0: 44 20 00 13 be r1,r0,8002dfc IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); 8002db4: 37 8c 00 64 addi r12,sp,100 8002db8: 34 02 00 00 mvi r2,0 8002dbc: b9 80 08 00 mv r1,r12 mode, &info ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; 8002dc0: 29 ab 00 08 lw r11,(r13+8) IMFS_update_ctime( parent ); 8002dc4: f8 00 02 2e calli 800367c 8002dc8: 2b 81 00 64 lw r1,(sp+100) IMFS_update_mtime( parent ); 8002dcc: 34 02 00 00 mvi r2,0 ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); 8002dd0: 59 61 00 48 sw (r11+72),r1 IMFS_update_mtime( parent ); 8002dd4: b9 80 08 00 mv r1,r12 8002dd8: f8 00 02 29 calli 800367c 8002ddc: 2b 81 00 64 lw r1,(sp+100) 8002de0: 59 61 00 44 sw (r11+68),r1 8002de4: 34 0b 00 00 mvi r11,0 8002de8: e0 00 00 05 bi 8002dfc } else { rv = -1; } } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); 8002dec: b9 80 08 00 mv r1,r12 8002df0: 34 02 00 86 mvi r2,134 8002df4: f8 00 07 8b calli 8004c20 rv = -1; 8002df8: 34 0b ff ff mvi r11,-1 } rtems_filesystem_eval_path_cleanup( &ctx ); 8002dfc: 37 81 00 1c addi r1,sp,28 8002e00: f8 00 08 9d calli 8005074 8002e04: e0 00 00 05 bi 8002e18 } else { errno = EINVAL; 8002e08: f8 00 3d a4 calli 8012498 <__errno> 8002e0c: 34 02 00 16 mvi r2,22 8002e10: 58 22 00 00 sw (r1+0),r2 rv = -1; 8002e14: 34 0b ff ff mvi r11,-1 } } return rv; } 8002e18: b9 60 08 00 mv r1,r11 8002e1c: 2b 9d 00 04 lw ra,(sp+4) 8002e20: 2b 8b 00 18 lw r11,(sp+24) 8002e24: 2b 8c 00 14 lw r12,(sp+20) 8002e28: 2b 8d 00 10 lw r13,(sp+16) 8002e2c: 2b 8e 00 0c lw r14,(sp+12) 8002e30: 2b 8f 00 08 lw r15,(sp+8) 8002e34: 37 9c 00 68 addi sp,sp,104 8002e38: c3 a0 00 00 ret =============================================================================== 0801081c : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 801081c: 37 9c ff d0 addi sp,sp,-48 8010820: 5b 8b 00 28 sw (sp+40),r11 8010824: 5b 8c 00 24 sw (sp+36),r12 8010828: 5b 8d 00 20 sw (sp+32),r13 801082c: 5b 8e 00 1c sw (sp+28),r14 8010830: 5b 8f 00 18 sw (sp+24),r15 8010834: 5b 90 00 14 sw (sp+20),r16 8010838: 5b 91 00 10 sw (sp+16),r17 801083c: 5b 92 00 0c sw (sp+12),r18 8010840: 5b 93 00 08 sw (sp+8),r19 8010844: 5b 9d 00 04 sw (sp+4),ra IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 8010848: 78 0e 08 01 mvhi r14,0x801 801084c: 39 ce a7 60 ori r14,r14,0xa760 8010850: 29 cb 00 00 lw r11,(r14+0) MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 8010854: b8 20 60 00 mv r12,r1 8010858: 20 52 00 ff andi r18,r2,0xff IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 801085c: b9 60 08 00 mv r1,r11 8010860: 34 02 00 02 mvi r2,2 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 8010864: b8 60 68 00 mv r13,r3 IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 8010868: f8 00 1c 84 calli 8017a78 <__lshrsi3> 801086c: b8 20 78 00 mv r15,r1 8010870: b9 e0 10 00 mv r2,r15 8010874: 34 21 00 01 addi r1,r1,1 8010878: f8 00 1c a7 calli 8017b14 <__mulsi3> 801087c: b9 e0 10 00 mv r2,r15 8010880: 34 21 00 01 addi r1,r1,1 8010884: f8 00 1c a4 calli 8017b14 <__mulsi3> 8010888: 34 21 ff ff addi r1,r1,-1 801088c: b9 60 10 00 mv r2,r11 8010890: f8 00 1c a1 calli 8017b14 <__mulsi3> 8010894: 54 2d 00 04 bgu r1,r13,80108a4 rtems_set_errno_and_return_minus_one( EFBIG ); 8010898: f8 00 05 0d calli 8011ccc <__errno> 801089c: 34 02 00 1b mvi r2,27 80108a0: e0 00 00 2a bi 8010948 /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) 80108a4: 29 8f 00 50 lw r15,(r12+80) return 0; 80108a8: 34 04 00 00 mvi r4,0 rtems_set_errno_and_return_minus_one( EFBIG ); /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) 80108ac: 4d ed 00 39 bge r15,r13,8010990 <== NEVER TAKEN return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 80108b0: b9 60 10 00 mv r2,r11 80108b4: b9 a0 08 00 mv r1,r13 80108b8: f8 00 1c a3 calli 8017b44 <__divsi3> old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 80108bc: b9 60 10 00 mv r2,r11 return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 80108c0: b8 20 88 00 mv r17,r1 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 80108c4: b9 e0 08 00 mv r1,r15 80108c8: f8 00 1c 9f calli 8017b44 <__divsi3> offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK; 80108cc: b9 60 10 00 mv r2,r11 /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 80108d0: b8 20 80 00 mv r16,r1 offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK; 80108d4: f8 00 1c 90 calli 8017b14 <__mulsi3> 80108d8: c9 e1 78 00 sub r15,r15,r1 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 80108dc: ba 00 58 00 mv r11,r16 80108e0: e0 00 00 1e bi 8010958 if ( !IMFS_memfile_addblock( the_jnode, block ) ) { 80108e4: b9 80 08 00 mv r1,r12 80108e8: b9 60 10 00 mv r2,r11 80108ec: fb ff ff 29 calli 8010590 80108f0: b8 20 18 00 mv r3,r1 80108f4: 5c 20 00 12 bne r1,r0,801093c if ( zero_fill ) { 80108f8: 46 41 00 17 be r18,r1,8010954 size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; block_p *block_ptr = 80108fc: b9 60 10 00 mv r2,r11 8010900: b9 80 08 00 mv r1,r12 * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { if ( !IMFS_memfile_addblock( the_jnode, block ) ) { if ( zero_fill ) { size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; 8010904: 29 d3 00 00 lw r19,(r14+0) block_p *block_ptr = 8010908: fb ff fd fa calli 80100f0 IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 801090c: 28 24 00 00 lw r4,(r1+0) * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { if ( !IMFS_memfile_addblock( the_jnode, block ) ) { if ( zero_fill ) { size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; 8010910: ca 6f 98 00 sub r19,r19,r15 block_p *block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 8010914: 34 02 00 00 mvi r2,0 8010918: b4 8f 08 00 add r1,r4,r15 801091c: ba 60 18 00 mv r3,r19 8010920: f8 00 08 04 calli 8012930 offset = 0; 8010924: 34 0f 00 00 mvi r15,0 8010928: e0 00 00 0b bi 8010954 } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); 801092c: b9 60 10 00 mv r2,r11 8010930: b9 80 08 00 mv r1,r12 8010934: fb ff ff ae calli 80107ec memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 8010938: 35 6b ff ff addi r11,r11,-1 801093c: 51 70 ff fc bgeu r11,r16,801092c IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 8010940: f8 00 04 e3 calli 8011ccc <__errno> 8010944: 34 02 00 1c mvi r2,28 8010948: 58 22 00 00 sw (r1+0),r2 801094c: 34 04 ff ff mvi r4,-1 8010950: e0 00 00 10 bi 8010990 offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK; /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 8010954: 35 6b 00 01 addi r11,r11,1 8010958: 52 2b ff e3 bgeu r17,r11,80108e4 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); 801095c: 37 8b 00 2c addi r11,sp,44 8010960: 34 02 00 00 mvi r2,0 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; 8010964: 59 8d 00 50 sw (r12+80),r13 IMFS_update_ctime(the_jnode); 8010968: b9 60 08 00 mv r1,r11 801096c: fb ff c8 17 calli 80029c8 8010970: 2b 81 00 2c lw r1,(sp+44) IMFS_update_mtime(the_jnode); 8010974: 34 02 00 00 mvi r2,0 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); 8010978: 59 81 00 48 sw (r12+72),r1 IMFS_update_mtime(the_jnode); 801097c: b9 60 08 00 mv r1,r11 8010980: fb ff c8 12 calli 80029c8 8010984: 2b 81 00 2c lw r1,(sp+44) return 0; 8010988: 34 04 00 00 mvi r4,0 * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); IMFS_update_mtime(the_jnode); 801098c: 59 81 00 44 sw (r12+68),r1 return 0; } 8010990: b8 80 08 00 mv r1,r4 8010994: 2b 9d 00 04 lw ra,(sp+4) 8010998: 2b 8b 00 28 lw r11,(sp+40) 801099c: 2b 8c 00 24 lw r12,(sp+36) 80109a0: 2b 8d 00 20 lw r13,(sp+32) 80109a4: 2b 8e 00 1c lw r14,(sp+28) 80109a8: 2b 8f 00 18 lw r15,(sp+24) 80109ac: 2b 90 00 14 lw r16,(sp+20) 80109b0: 2b 91 00 10 lw r17,(sp+16) 80109b4: 2b 92 00 0c lw r18,(sp+12) 80109b8: 2b 93 00 08 lw r19,(sp+8) 80109bc: 37 9c 00 30 addi sp,sp,48 80109c0: c3 a0 00 00 ret =============================================================================== 080100f0 : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 80100f0: 37 9c ff e0 addi sp,sp,-32 80100f4: 5b 8b 00 20 sw (sp+32),r11 80100f8: 5b 8c 00 1c sw (sp+28),r12 80100fc: 5b 8d 00 18 sw (sp+24),r13 8010100: 5b 8e 00 14 sw (sp+20),r14 8010104: 5b 8f 00 10 sw (sp+16),r15 8010108: 5b 90 00 0c sw (sp+12),r16 801010c: 5b 91 00 08 sw (sp+8),r17 8010110: 5b 9d 00 04 sw (sp+4),ra 8010114: b8 20 68 00 mv r13,r1 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 8010118: 78 01 08 01 mvhi r1,0x801 801011c: 38 21 a7 60 ori r1,r1,0xa760 8010120: 28 21 00 00 lw r1,(r1+0) #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 8010124: b8 40 70 00 mv r14,r2 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 8010128: 34 02 00 02 mvi r2,2 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 801012c: b8 60 78 00 mv r15,r3 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 8010130: f8 00 1e 52 calli 8017a78 <__lshrsi3> 8010134: b8 20 60 00 mv r12,r1 8010138: 34 21 ff ff addi r1,r1,-1 801013c: 55 c1 00 12 bgu r14,r1,8010184 p = info->indirect; 8010140: 29 ac 00 54 lw r12,(r13+84) if ( malloc_it ) { 8010144: 45 e0 00 0c be r15,r0,8010174 if ( !p ) { 8010148: 5d 80 00 05 bne r12,r0,801015c p = memfile_alloc_block(); 801014c: fb ff ff d9 calli 80100b0 if ( !p ) return 0; 8010150: 34 0b 00 00 mvi r11,0 if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) 8010154: 44 2c 00 81 be r1,r12,8010358 <== NEVER TAKEN return 0; info->indirect = p; 8010158: 59 a1 00 54 sw (r13+84),r1 } return &info->indirect[ my_block ]; 801015c: b9 c0 08 00 mv r1,r14 8010160: 34 02 00 02 mvi r2,2 8010164: f8 00 1d f7 calli 8017940 <__ashlsi3> 8010168: 29 ab 00 54 lw r11,(r13+84) 801016c: b5 61 58 00 add r11,r11,r1 8010170: e0 00 00 7a bi 8010358 } if ( !p ) return 0; 8010174: 34 0b 00 00 mvi r11,0 return &info->indirect[ my_block ]; 8010178: b9 c0 08 00 mv r1,r14 info->indirect = p; } return &info->indirect[ my_block ]; } if ( !p ) 801017c: 5d 8b 00 74 bne r12,r11,801034c <== ALWAYS TAKEN 8010180: e0 00 00 76 bi 8010358 <== NOT EXECUTED /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 8010184: 35 81 00 01 addi r1,r12,1 8010188: b9 80 10 00 mv r2,r12 801018c: f8 00 1e 62 calli 8017b14 <__mulsi3> 8010190: b8 20 80 00 mv r16,r1 8010194: 34 21 ff ff addi r1,r1,-1 8010198: 55 c1 00 2b bgu r14,r1,8010244 my_block -= FIRST_DOUBLY_INDIRECT; 801019c: c9 cc 70 00 sub r14,r14,r12 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 80101a0: b9 80 10 00 mv r2,r12 80101a4: b9 c0 08 00 mv r1,r14 80101a8: f8 00 1e d0 calli 8017ce8 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 80101ac: b9 80 10 00 mv r2,r12 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 80101b0: b8 20 80 00 mv r16,r1 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 80101b4: b9 c0 08 00 mv r1,r14 80101b8: f8 00 1e bc calli 8017ca8 <__udivsi3> 80101bc: b8 20 70 00 mv r14,r1 p = info->doubly_indirect; 80101c0: 29 ac 00 58 lw r12,(r13+88) if ( malloc_it ) { 80101c4: 45 e0 00 17 be r15,r0,8010220 if ( !p ) { 80101c8: 5d 80 00 06 bne r12,r0,80101e0 p = memfile_alloc_block(); 80101cc: fb ff ff b9 calli 80100b0 80101d0: b8 20 60 00 mv r12,r1 if ( !p ) return 0; 80101d4: 34 0b 00 00 mvi r11,0 p = info->doubly_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) 80101d8: 44 20 00 60 be r1,r0,8010358 <== NEVER TAKEN return 0; info->doubly_indirect = p; 80101dc: 59 a1 00 58 sw (r13+88),r1 } p1 = (block_p *)p[ doubly ]; 80101e0: b9 c0 08 00 mv r1,r14 80101e4: 34 02 00 02 mvi r2,2 80101e8: f8 00 1d d6 calli 8017940 <__ashlsi3> 80101ec: b5 81 60 00 add r12,r12,r1 80101f0: 29 8d 00 00 lw r13,(r12+0) if ( !p1 ) { 80101f4: 5d a0 00 06 bne r13,r0,801020c p1 = memfile_alloc_block(); 80101f8: fb ff ff ae calli 80100b0 80101fc: b8 20 68 00 mv r13,r1 if ( !p1 ) return 0; 8010200: 34 0b 00 00 mvi r11,0 } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) 8010204: 44 20 00 55 be r1,r0,8010358 <== NEVER TAKEN return 0; p[ doubly ] = (block_p) p1; 8010208: 59 81 00 00 sw (r12+0),r1 } return (block_p *)&p1[ singly ]; 801020c: ba 00 08 00 mv r1,r16 8010210: 34 02 00 02 mvi r2,2 8010214: f8 00 1d cb calli 8017940 <__ashlsi3> 8010218: b5 a1 58 00 add r11,r13,r1 801021c: e0 00 00 4f bi 8010358 } if ( !p ) return 0; 8010220: 34 0b 00 00 mvi r11,0 } return (block_p *)&p1[ singly ]; } if ( !p ) 8010224: 45 8b 00 4d be r12,r11,8010358 <== NEVER TAKEN return 0; p = (block_p *)p[ doubly ]; 8010228: 34 02 00 02 mvi r2,2 801022c: f8 00 1d c5 calli 8017940 <__ashlsi3> 8010230: b5 81 08 00 add r1,r12,r1 8010234: 28 2c 00 00 lw r12,(r1+0) if ( !p ) return 0; return (block_p *)&p[ singly ]; 8010238: ba 00 08 00 mv r1,r16 if ( !p ) return 0; p = (block_p *)p[ doubly ]; if ( !p ) 801023c: 5d 80 00 44 bne r12,r0,801034c <== ALWAYS TAKEN 8010240: e0 00 00 46 bi 8010358 <== NOT EXECUTED } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 8010244: 36 01 00 01 addi r1,r16,1 8010248: b9 80 10 00 mv r2,r12 801024c: f8 00 1e 32 calli 8017b14 <__mulsi3> 8010250: 34 21 ff ff addi r1,r1,-1 } /* * This means the requested block number is out of range. */ return 0; 8010254: 34 0b 00 00 mvi r11,0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 8010258: 55 c1 00 40 bgu r14,r1,8010358 <== NEVER TAKEN my_block -= FIRST_TRIPLY_INDIRECT; 801025c: c9 d0 70 00 sub r14,r14,r16 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 8010260: b9 80 10 00 mv r2,r12 8010264: b9 c0 08 00 mv r1,r14 8010268: f8 00 1e a0 calli 8017ce8 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 801026c: b9 80 10 00 mv r2,r12 * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 8010270: b8 20 88 00 mv r17,r1 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 8010274: b9 c0 08 00 mv r1,r14 8010278: f8 00 1e 8c calli 8017ca8 <__udivsi3> triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 801027c: b9 80 10 00 mv r2,r12 */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 8010280: b8 20 70 00 mv r14,r1 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 8010284: f8 00 1e 89 calli 8017ca8 <__udivsi3> doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 8010288: b9 80 10 00 mv r2,r12 if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 801028c: b8 20 80 00 mv r16,r1 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 8010290: b9 c0 08 00 mv r1,r14 8010294: f8 00 1e 95 calli 8017ce8 <__umodsi3> 8010298: b8 20 70 00 mv r14,r1 p = info->triply_indirect; 801029c: 29 ac 00 5c lw r12,(r13+92) if ( malloc_it ) { 80102a0: 45 e0 00 1d be r15,r0,8010314 if ( !p ) { 80102a4: 5d 80 00 05 bne r12,r0,80102b8 p = memfile_alloc_block(); 80102a8: fb ff ff 82 calli 80100b0 80102ac: b8 20 60 00 mv r12,r1 if ( !p ) 80102b0: 44 20 00 2a be r1,r0,8010358 <== NEVER TAKEN return 0; info->triply_indirect = p; 80102b4: 59 a1 00 5c sw (r13+92),r1 } p1 = (block_p *) p[ triply ]; 80102b8: ba 00 08 00 mv r1,r16 80102bc: 34 02 00 02 mvi r2,2 80102c0: f8 00 1d a0 calli 8017940 <__ashlsi3> 80102c4: b5 81 60 00 add r12,r12,r1 80102c8: 29 8d 00 00 lw r13,(r12+0) if ( !p1 ) { 80102cc: 5d a0 00 06 bne r13,r0,80102e4 p1 = memfile_alloc_block(); 80102d0: fb ff ff 78 calli 80100b0 80102d4: b8 20 68 00 mv r13,r1 if ( !p1 ) return 0; 80102d8: 34 0b 00 00 mvi r11,0 } p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) 80102dc: 44 20 00 1f be r1,r0,8010358 <== NEVER TAKEN return 0; p[ triply ] = (block_p) p1; 80102e0: 59 81 00 00 sw (r12+0),r1 } p2 = (block_p *)p1[ doubly ]; 80102e4: b9 c0 08 00 mv r1,r14 80102e8: 34 02 00 02 mvi r2,2 80102ec: f8 00 1d 95 calli 8017940 <__ashlsi3> 80102f0: b5 a1 68 00 add r13,r13,r1 80102f4: 29 ac 00 00 lw r12,(r13+0) if ( !p2 ) { 80102f8: 5d 80 00 14 bne r12,r0,8010348 p2 = memfile_alloc_block(); 80102fc: fb ff ff 6d calli 80100b0 8010300: b8 20 60 00 mv r12,r1 if ( !p2 ) return 0; 8010304: 34 0b 00 00 mvi r11,0 } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); if ( !p2 ) 8010308: 44 20 00 14 be r1,r0,8010358 <== NEVER TAKEN return 0; p1[ doubly ] = (block_p) p2; 801030c: 59 a1 00 00 sw (r13+0),r1 8010310: e0 00 00 0e bi 8010348 } return (block_p *)&p2[ singly ]; } if ( !p ) 8010314: 45 8b 00 11 be r12,r11,8010358 <== NEVER TAKEN return 0; p1 = (block_p *) p[ triply ]; 8010318: ba 00 08 00 mv r1,r16 801031c: 34 02 00 02 mvi r2,2 8010320: f8 00 1d 88 calli 8017940 <__ashlsi3> 8010324: b5 81 08 00 add r1,r12,r1 8010328: 28 2c 00 00 lw r12,(r1+0) if ( !p1 ) 801032c: 45 80 00 0b be r12,r0,8010358 <== NEVER TAKEN return 0; p2 = (block_p *)p1[ doubly ]; 8010330: b9 c0 08 00 mv r1,r14 8010334: 34 02 00 02 mvi r2,2 8010338: f8 00 1d 82 calli 8017940 <__ashlsi3> 801033c: b5 81 08 00 add r1,r12,r1 8010340: 28 2c 00 00 lw r12,(r1+0) if ( !p2 ) 8010344: 45 80 00 05 be r12,r0,8010358 <== NEVER TAKEN return 0; return (block_p *)&p2[ singly ]; 8010348: ba 20 08 00 mv r1,r17 801034c: 34 02 00 02 mvi r2,2 8010350: f8 00 1d 7c calli 8017940 <__ashlsi3> 8010354: b5 81 58 00 add r11,r12,r1 /* * This means the requested block number is out of range. */ return 0; } 8010358: b9 60 08 00 mv r1,r11 801035c: 2b 9d 00 04 lw ra,(sp+4) 8010360: 2b 8b 00 20 lw r11,(sp+32) 8010364: 2b 8c 00 1c lw r12,(sp+28) 8010368: 2b 8d 00 18 lw r13,(sp+24) 801036c: 2b 8e 00 14 lw r14,(sp+20) 8010370: 2b 8f 00 10 lw r15,(sp+16) 8010374: 2b 90 00 0c lw r16,(sp+12) 8010378: 2b 91 00 08 lw r17,(sp+8) 801037c: 37 9c 00 20 addi sp,sp,32 8010380: c3 a0 00 00 ret =============================================================================== 08010384 : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 8010384: 37 9c ff d4 addi sp,sp,-44 8010388: 5b 8b 00 24 sw (sp+36),r11 801038c: 5b 8c 00 20 sw (sp+32),r12 8010390: 5b 8d 00 1c sw (sp+28),r13 8010394: 5b 8e 00 18 sw (sp+24),r14 8010398: 5b 8f 00 14 sw (sp+20),r15 801039c: 5b 90 00 10 sw (sp+16),r16 80103a0: 5b 91 00 0c sw (sp+12),r17 80103a4: 5b 92 00 08 sw (sp+8),r18 80103a8: 5b 9d 00 04 sw (sp+4),ra 80103ac: b8 20 58 00 mv r11,r1 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 80103b0: 28 21 00 4c lw r1,(r1+76) 80103b4: b8 40 70 00 mv r14,r2 80103b8: b8 60 80 00 mv r16,r3 * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) { 80103bc: 28 22 00 00 lw r2,(r1+0) 80103c0: 34 01 00 05 mvi r1,5 80103c4: 5c 41 00 0b bne r2,r1,80103f0 unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) 80103c8: 29 6d 00 50 lw r13,(r11+80) 80103cc: c9 ae 68 00 sub r13,r13,r14 * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) { 80103d0: 50 8d 00 02 bgeu r4,r13,80103d8 <== ALWAYS TAKEN 80103d4: b8 80 68 00 mv r13,r4 <== NOT EXECUTED file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) my_length = the_jnode->info.linearfile.size - start; memcpy(dest, &file_ptr[start], my_length); 80103d8: 29 62 00 54 lw r2,(r11+84) 80103dc: ba 00 08 00 mv r1,r16 80103e0: b9 a0 18 00 mv r3,r13 80103e4: b4 4e 10 00 add r2,r2,r14 80103e8: f8 00 09 11 calli 801282c 80103ec: e0 00 00 46 bi 8010504 /* * If the last byte we are supposed to read is past the end of this * in memory file, then shorten the length to read. */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) 80103f0: 29 61 00 50 lw r1,(r11+80) /* * If the last byte we are supposed to read is past the end of this * in memory file, then shorten the length to read. */ last_byte = start + length; 80103f4: b4 8e 10 00 add r2,r4,r14 if ( last_byte > the_jnode->info.file.size ) 80103f8: b8 80 60 00 mv r12,r4 80103fc: 50 22 00 02 bgeu r1,r2,8010404 my_length = the_jnode->info.file.size - start; 8010400: c8 2e 60 00 sub r12,r1,r14 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 8010404: 78 01 08 01 mvhi r1,0x801 8010408: 38 21 a7 60 ori r1,r1,0xa760 801040c: 28 32 00 00 lw r18,(r1+0) 8010410: b9 c0 08 00 mv r1,r14 unsigned int last_byte; unsigned int copied; unsigned int start_offset; unsigned char *dest; dest = destination; 8010414: ba 00 78 00 mv r15,r16 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 8010418: ba 40 10 00 mv r2,r18 801041c: f8 00 1d fa calli 8017c04 <__modsi3> 8010420: b8 20 88 00 mv r17,r1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 8010424: ba 40 10 00 mv r2,r18 8010428: b9 c0 08 00 mv r1,r14 801042c: f8 00 1d c6 calli 8017b44 <__divsi3> 8010430: b8 20 70 00 mv r14,r1 */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) my_length = the_jnode->info.file.size - start; copied = 0; 8010434: 34 0d 00 00 mvi r13,0 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { 8010438: 46 20 00 12 be r17,r0,8010480 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 801043c: b9 60 08 00 mv r1,r11 8010440: b9 c0 10 00 mv r2,r14 8010444: 34 03 00 00 mvi r3,0 8010448: fb ff ff 2a calli 80100f0 if ( !block_ptr ) 801044c: 44 20 00 33 be r1,r0,8010518 <== NEVER TAKEN * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 8010450: ca 51 90 00 sub r18,r18,r17 8010454: b9 80 68 00 mv r13,r12 8010458: 52 4c 00 02 bgeu r18,r12,8010460 801045c: ba 40 68 00 mv r13,r18 if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); 8010460: 28 22 00 00 lw r2,(r1+0) 8010464: b9 a0 18 00 mv r3,r13 8010468: ba 00 08 00 mv r1,r16 801046c: b4 51 10 00 add r2,r2,r17 8010470: f8 00 08 ef calli 801282c dest += to_copy; 8010474: b6 0d 78 00 add r15,r16,r13 block++; 8010478: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 801047c: c9 8d 60 00 sub r12,r12,r13 } /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 8010480: 78 01 08 01 mvhi r1,0x801 8010484: 38 21 a7 60 ori r1,r1,0xa760 8010488: 28 30 00 00 lw r16,(r1+0) while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 801048c: b8 20 88 00 mv r17,r1 8010490: e0 00 00 0f bi 80104cc block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 8010494: b9 c0 10 00 mv r2,r14 8010498: b9 60 08 00 mv r1,r11 801049c: 34 03 00 00 mvi r3,0 80104a0: fb ff ff 14 calli 80100f0 80104a4: b8 20 10 00 mv r2,r1 if ( !block_ptr ) 80104a8: 44 20 00 1c be r1,r0,8010518 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 80104ac: 28 42 00 00 lw r2,(r2+0) 80104b0: b9 e0 08 00 mv r1,r15 80104b4: ba 00 18 00 mv r3,r16 80104b8: f8 00 08 dd calli 801282c dest += to_copy; 80104bc: b5 f0 78 00 add r15,r15,r16 block++; 80104c0: 35 ce 00 01 addi r14,r14,1 my_length -= to_copy; 80104c4: c9 90 60 00 sub r12,r12,r16 copied += to_copy; 80104c8: b5 b0 68 00 add r13,r13,r16 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 80104cc: 2a 21 00 00 lw r1,(r17+0) 80104d0: 51 81 ff f1 bgeu r12,r1,8010494 /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { 80104d4: 45 80 00 0c be r12,r0,8010504 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 80104d8: b9 c0 10 00 mv r2,r14 80104dc: b9 60 08 00 mv r1,r11 80104e0: 34 03 00 00 mvi r3,0 80104e4: fb ff ff 03 calli 80100f0 80104e8: b8 20 10 00 mv r2,r1 if ( !block_ptr ) 80104ec: 44 20 00 0b be r1,r0,8010518 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 80104f0: 28 42 00 00 lw r2,(r2+0) 80104f4: b9 e0 08 00 mv r1,r15 80104f8: b9 80 18 00 mv r3,r12 80104fc: f8 00 08 cc calli 801282c copied += my_length; 8010500: b5 8d 68 00 add r13,r12,r13 } IMFS_update_atime( the_jnode ); 8010504: 37 81 00 28 addi r1,sp,40 8010508: 34 02 00 00 mvi r2,0 801050c: fb ff c9 2f calli 80029c8 8010510: 2b 81 00 28 lw r1,(sp+40) 8010514: 59 61 00 40 sw (r11+64),r1 return copied; } 8010518: b9 a0 08 00 mv r1,r13 801051c: 2b 9d 00 04 lw ra,(sp+4) 8010520: 2b 8b 00 24 lw r11,(sp+36) 8010524: 2b 8c 00 20 lw r12,(sp+32) 8010528: 2b 8d 00 1c lw r13,(sp+28) 801052c: 2b 8e 00 18 lw r14,(sp+24) 8010530: 2b 8f 00 14 lw r15,(sp+20) 8010534: 2b 90 00 10 lw r16,(sp+16) 8010538: 2b 91 00 0c lw r17,(sp+12) 801053c: 2b 92 00 08 lw r18,(sp+8) 8010540: 37 9c 00 2c addi sp,sp,44 8010544: c3 a0 00 00 ret =============================================================================== 08010680 : * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 8010680: 37 9c ff e0 addi sp,sp,-32 8010684: 5b 8b 00 20 sw (sp+32),r11 8010688: 5b 8c 00 1c sw (sp+28),r12 801068c: 5b 8d 00 18 sw (sp+24),r13 8010690: 5b 8e 00 14 sw (sp+20),r14 8010694: 5b 8f 00 10 sw (sp+16),r15 8010698: 5b 90 00 0c sw (sp+12),r16 801069c: 5b 91 00 08 sw (sp+8),r17 80106a0: 5b 9d 00 04 sw (sp+4),ra 80106a4: b8 20 58 00 mv r11,r1 /* * Eventually this could be set smarter at each call to * memfile_free_blocks_in_table to greatly speed this up. */ to_free = IMFS_MEMFILE_BLOCK_SLOTS; 80106a8: 78 01 08 01 mvhi r1,0x801 80106ac: 38 21 a7 60 ori r1,r1,0xa760 80106b0: 28 21 00 00 lw r1,(r1+0) 80106b4: 34 02 00 02 mvi r2,2 80106b8: f8 00 1c f0 calli 8017a78 <__lshrsi3> 80106bc: b8 20 60 00 mv r12,r1 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 80106c0: 29 61 00 54 lw r1,(r11+84) 80106c4: 44 20 00 04 be r1,r0,80106d4 memfile_free_blocks_in_table( &info->indirect, to_free ); 80106c8: 35 61 00 54 addi r1,r11,84 80106cc: b9 80 10 00 mv r2,r12 80106d0: fb ff ff d0 calli 8010610 } if ( info->doubly_indirect ) { 80106d4: 29 61 00 58 lw r1,(r11+88) 80106d8: 44 20 00 15 be r1,r0,801072c for ( i=0 ; iindirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { 80106e0: 34 0f 00 00 mvi r15,0 80106e4: 34 0e 00 00 mvi r14,0 for ( i=0 ; i if ( info->doubly_indirect[i] ) { 80106f0: 29 61 00 58 lw r1,(r11+88) 80106f4: b4 2f 08 00 add r1,r1,r15 80106f8: 28 22 00 00 lw r2,(r1+0) 80106fc: 44 40 00 03 be r2,r0,8010708 <== NEVER TAKEN memfile_free_blocks_in_table( 8010700: b9 80 10 00 mv r2,r12 8010704: fb ff ff c3 calli 8010610 if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i 801071c: 54 2e ff f5 bgu r1,r14,80106f0 if ( info->doubly_indirect[i] ) { memfile_free_blocks_in_table( (block_p **)&info->doubly_indirect[i], to_free ); } } memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); 8010720: 35 61 00 58 addi r1,r11,88 8010724: b9 80 10 00 mv r2,r12 8010728: fb ff ff ba calli 8010610 } if ( info->triply_indirect ) { 801072c: 29 61 00 5c lw r1,(r11+92) 8010730: 44 20 00 24 be r1,r0,80107c0 for ( i=0 ; idoubly_indirect, to_free ); } if ( info->triply_indirect ) { 8010738: 34 0f 00 00 mvi r15,0 801073c: 34 10 00 00 mvi r16,0 for ( i=0 ; i p = (block_p *) info->triply_indirect[i]; 8010748: 29 61 00 5c lw r1,(r11+92) 801074c: b4 2f 08 00 add r1,r1,r15 8010750: 28 2d 00 00 lw r13,(r1+0) if ( !p ) /* ensure we have a valid pointer */ 8010754: 45 a0 00 18 be r13,r0,80107b4 <== NEVER TAKEN 8010758: 34 11 00 00 mvi r17,0 801075c: e0 00 00 08 bi 801077c break; for ( j=0 ; j <== NEVER TAKEN memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 8010768: b9 a0 08 00 mv r1,r13 801076c: b9 80 10 00 mv r2,r12 8010770: fb ff ff a8 calli 8010610 if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j 8010788: 54 31 ff f6 bgu r1,r17,8010760 if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( 801078c: 29 61 00 5c lw r1,(r11+92) 8010790: b9 80 10 00 mv r2,r12 memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i 80107b0: 54 30 ff e6 bgu r1,r16,8010748 } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( 80107b4: 35 61 00 5c addi r1,r11,92 80107b8: b9 80 10 00 mv r2,r12 80107bc: fb ff ff 95 calli 8010610 (block_p **)&info->triply_indirect, to_free ); } return the_jnode; } 80107c0: b9 60 08 00 mv r1,r11 80107c4: 2b 9d 00 04 lw ra,(sp+4) 80107c8: 2b 8b 00 20 lw r11,(sp+32) 80107cc: 2b 8c 00 1c lw r12,(sp+28) 80107d0: 2b 8d 00 18 lw r13,(sp+24) 80107d4: 2b 8e 00 14 lw r14,(sp+20) 80107d8: 2b 8f 00 10 lw r15,(sp+16) 80107dc: 2b 90 00 0c lw r16,(sp+12) 80107e0: 2b 91 00 08 lw r17,(sp+8) 80107e4: 37 9c 00 20 addi sp,sp,32 80107e8: c3 a0 00 00 ret =============================================================================== 080109c4 : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 80109c4: 37 9c ff d0 addi sp,sp,-48 80109c8: 5b 8b 00 28 sw (sp+40),r11 80109cc: 5b 8c 00 24 sw (sp+36),r12 80109d0: 5b 8d 00 20 sw (sp+32),r13 80109d4: 5b 8e 00 1c sw (sp+28),r14 80109d8: 5b 8f 00 18 sw (sp+24),r15 80109dc: 5b 90 00 14 sw (sp+20),r16 80109e0: 5b 91 00 10 sw (sp+16),r17 80109e4: 5b 92 00 0c sw (sp+12),r18 80109e8: 5b 93 00 08 sw (sp+8),r19 80109ec: 5b 9d 00 04 sw (sp+4),ra 80109f0: b8 40 60 00 mv r12,r2 80109f4: b8 60 88 00 mv r17,r3 /* * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + my_length; 80109f8: b4 82 18 00 add r3,r4,r2 if ( last_byte > the_jnode->info.file.size ) { 80109fc: 28 22 00 50 lw r2,(r1+80) IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 8010a00: b8 20 70 00 mv r14,r1 8010a04: b8 80 80 00 mv r16,r4 * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + my_length; if ( last_byte > the_jnode->info.file.size ) { 8010a08: 50 43 00 05 bgeu r2,r3,8010a1c bool zero_fill = start > the_jnode->info.file.size; status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); 8010a0c: e9 82 10 00 cmpg r2,r12,r2 8010a10: fb ff ff 83 calli 801081c 8010a14: b8 20 28 00 mv r5,r1 if ( status ) 8010a18: 5c 20 00 48 bne r1,r0,8010b38 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 8010a1c: 78 01 08 01 mvhi r1,0x801 8010a20: 38 21 a7 60 ori r1,r1,0xa760 8010a24: 28 33 00 00 lw r19,(r1+0) 8010a28: b9 80 08 00 mv r1,r12 unsigned int last_byte; unsigned int start_offset; int copied; const unsigned char *src; src = source; 8010a2c: ba 20 78 00 mv r15,r17 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 8010a30: ba 60 10 00 mv r2,r19 8010a34: f8 00 1c 74 calli 8017c04 <__modsi3> 8010a38: b8 20 90 00 mv r18,r1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 8010a3c: ba 60 10 00 mv r2,r19 8010a40: b9 80 08 00 mv r1,r12 8010a44: f8 00 1c 40 calli 8017b44 <__divsi3> 8010a48: b8 20 68 00 mv r13,r1 if ( start_offset ) { 8010a4c: ba 00 60 00 mv r12,r16 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); if ( status ) return status; } copied = 0; 8010a50: 34 0b 00 00 mvi r11,0 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { 8010a54: 46 40 00 12 be r18,r0,8010a9c to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 8010a58: b9 c0 08 00 mv r1,r14 8010a5c: b9 a0 10 00 mv r2,r13 8010a60: 34 03 00 00 mvi r3,0 8010a64: fb ff fd a3 calli 80100f0 if ( !block_ptr ) return copied; 8010a68: 34 05 00 00 mvi r5,0 if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) 8010a6c: 44 20 00 33 be r1,r0,8010b38 <== NEVER TAKEN * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; 8010a70: ca 72 58 00 sub r11,r19,r18 8010a74: 52 0b 00 02 bgeu r16,r11,8010a7c 8010a78: ba 00 58 00 mv r11,r16 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 8010a7c: 28 21 00 00 lw r1,(r1+0) 8010a80: ba 20 10 00 mv r2,r17 8010a84: b9 60 18 00 mv r3,r11 8010a88: b4 32 08 00 add r1,r1,r18 8010a8c: f8 00 07 68 calli 801282c src += to_copy; 8010a90: b6 2b 78 00 add r15,r17,r11 block++; 8010a94: 35 ad 00 01 addi r13,r13,1 my_length -= to_copy; 8010a98: ca 0b 60 00 sub r12,r16,r11 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; 8010a9c: 78 01 08 01 mvhi r1,0x801 8010aa0: 38 21 a7 60 ori r1,r1,0xa760 8010aa4: 28 30 00 00 lw r16,(r1+0) while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 8010aa8: b8 20 88 00 mv r17,r1 8010aac: e0 00 00 0e bi 8010ae4 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 8010ab0: b9 c0 08 00 mv r1,r14 8010ab4: b9 a0 10 00 mv r2,r13 8010ab8: 34 03 00 00 mvi r3,0 8010abc: fb ff fd 8d calli 80100f0 if ( !block_ptr ) 8010ac0: 44 20 00 1d be r1,r0,8010b34 <== NEVER TAKEN return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, to_copy ); 8010ac4: 28 21 00 00 lw r1,(r1+0) 8010ac8: b9 e0 10 00 mv r2,r15 8010acc: ba 00 18 00 mv r3,r16 8010ad0: f8 00 07 57 calli 801282c src += to_copy; 8010ad4: b5 f0 78 00 add r15,r15,r16 block++; 8010ad8: 35 ad 00 01 addi r13,r13,1 my_length -= to_copy; 8010adc: c9 90 60 00 sub r12,r12,r16 * IMFS_memfile_write * * This routine writes the specified data buffer into the in memory * file pointed to by the_jnode. The file is extended as needed. */ MEMFILE_STATIC ssize_t IMFS_memfile_write( 8010ae0: b5 70 58 00 add r11,r11,r16 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 8010ae4: 2a 21 00 00 lw r1,(r17+0) 8010ae8: 51 81 ff f2 bgeu r12,r1,8010ab0 * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); to_copy = my_length; if ( my_length ) { 8010aec: 45 80 00 0c be r12,r0,8010b1c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 8010af0: b9 c0 08 00 mv r1,r14 8010af4: b9 a0 10 00 mv r2,r13 8010af8: 34 03 00 00 mvi r3,0 8010afc: fb ff fd 7d calli 80100f0 if ( !block_ptr ) 8010b00: b9 60 28 00 mv r5,r11 8010b04: 44 20 00 0d be r1,r0,8010b38 <== NEVER TAKEN return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, my_length ); 8010b08: 28 21 00 00 lw r1,(r1+0) 8010b0c: b9 e0 10 00 mv r2,r15 8010b10: b9 80 18 00 mv r3,r12 8010b14: f8 00 07 46 calli 801282c my_length = 0; copied += to_copy; 8010b18: b5 6c 58 00 add r11,r11,r12 } IMFS_mtime_ctime_update( the_jnode ); 8010b1c: 37 81 00 2c addi r1,sp,44 8010b20: 34 02 00 00 mvi r2,0 8010b24: fb ff c7 a9 calli 80029c8 8010b28: 2b 81 00 2c lw r1,(sp+44) 8010b2c: 59 c1 00 44 sw (r14+68),r1 8010b30: 59 c1 00 48 sw (r14+72),r1 */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) 8010b34: b9 60 28 00 mv r5,r11 } IMFS_mtime_ctime_update( the_jnode ); return copied; } 8010b38: b8 a0 08 00 mv r1,r5 8010b3c: 2b 9d 00 04 lw ra,(sp+4) 8010b40: 2b 8b 00 28 lw r11,(sp+40) 8010b44: 2b 8c 00 24 lw r12,(sp+36) 8010b48: 2b 8d 00 20 lw r13,(sp+32) 8010b4c: 2b 8e 00 1c lw r14,(sp+28) 8010b50: 2b 8f 00 18 lw r15,(sp+24) 8010b54: 2b 90 00 14 lw r16,(sp+20) 8010b58: 2b 91 00 10 lw r17,(sp+16) 8010b5c: 2b 92 00 0c lw r18,(sp+12) 8010b60: 2b 93 00 08 lw r19,(sp+8) 8010b64: 37 9c 00 30 addi sp,sp,48 8010b68: c3 a0 00 00 ret =============================================================================== 080022b0 : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 80022b0: 37 9c ff d0 addi sp,sp,-48 80022b4: 5b 8b 00 18 sw (sp+24),r11 80022b8: 5b 8c 00 14 sw (sp+20),r12 80022bc: 5b 8d 00 10 sw (sp+16),r13 80022c0: 5b 8e 00 0c sw (sp+12),r14 80022c4: 5b 8f 00 08 sw (sp+8),r15 80022c8: 5b 9d 00 04 sw (sp+4),ra 80022cc: b8 20 58 00 mv r11,r1 dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 80022d0: 20 87 f0 00 andi r7,r4,0xf000 80022d4: 34 01 40 00 mvi r1,16384 const char *name, size_t namelen, mode_t mode, dev_t dev ) { 80022d8: b8 40 70 00 mv r14,r2 80022dc: b8 60 68 00 mv r13,r3 80022e0: b8 80 60 00 mv r12,r4 IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; 80022e4: 34 08 00 00 mvi r8,0 dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 80022e8: 44 e1 00 11 be r7,r1,800232c *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { 80022ec: 34 21 40 00 addi r1,r1,16384 80022f0: 44 e1 00 0c be r7,r1,8002320 *type = IMFS_MEMORY_FILE; } else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) { 80022f4: 64 e2 20 00 cmpei r2,r7,8192 80022f8: 64 e1 60 00 cmpei r1,r7,24576 80022fc: b8 41 08 00 or r1,r2,r1 8002300: 44 20 00 05 be r1,r0,8002314 *type = IMFS_DEVICE; rtems_filesystem_split_dev_t( 8002304: 5b 85 00 1c sw (sp+28),r5 8002308: 5b 86 00 20 sw (sp+32),r6 if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { *type = IMFS_MEMORY_FILE; } else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) { *type = IMFS_DEVICE; 800230c: 34 08 00 01 mvi r8,1 8002310: e0 00 00 07 bi 800232c rtems_filesystem_split_dev_t( dev, info->device.major, info->device.minor ); } else if (S_ISFIFO( mode )) { 8002314: 34 01 10 00 mvi r1,4096 8002318: 5c e1 00 05 bne r7,r1,800232c <== NEVER TAKEN 800231c: e0 00 00 03 bi 8002328 ) { if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { *type = IMFS_MEMORY_FILE; 8002320: 34 08 00 04 mvi r8,4 8002324: e0 00 00 02 bi 800232c dev, info->device.major, info->device.minor ); } else if (S_ISFIFO( mode )) { *type = IMFS_FIFO; 8002328: 34 08 00 06 mvi r8,6 mode_t mode, const IMFS_types_union *info ) { const IMFS_fs_info_t *fs_info = (const IMFS_fs_info_t *) parentloc->mt_entry->fs_info; 800232c: 29 61 00 14 lw r1,(r11+20) return IMFS_create_node_with_control( 8002330: 34 02 00 02 mvi r2,2 8002334: 28 2f 00 08 lw r15,(r1+8) 8002338: 35 01 00 02 addi r1,r8,2 800233c: f8 00 55 81 calli 8017940 <__ashlsi3> 8002340: b5 e1 28 00 add r5,r15,r1 8002344: 28 a2 00 00 lw r2,(r5+0) 8002348: b9 60 08 00 mv r1,r11 800234c: b9 c0 18 00 mv r3,r14 8002350: b9 a0 20 00 mv r4,r13 8002354: b9 80 28 00 mv r5,r12 8002358: 37 86 00 1c addi r6,sp,28 800235c: f8 00 29 3a calli 800c844 IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); } else { rv = -1; 8002360: 34 02 ff ff mvi r2,-1 IMFS_jnode_t *new_node; get_type_and_info_by_mode_and_dev( mode, dev, &type, &info ); new_node = IMFS_create_node( parentloc, type, name, namelen, mode, &info ); if ( new_node != NULL ) { 8002364: 44 20 00 0e be r1,r0,800239c IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); 8002368: 37 8c 00 2c addi r12,sp,44 800236c: 34 02 00 00 mvi r2,0 8002370: b9 80 08 00 mv r1,r12 get_type_and_info_by_mode_and_dev( mode, dev, &type, &info ); new_node = IMFS_create_node( parentloc, type, name, namelen, mode, &info ); if ( new_node != NULL ) { IMFS_jnode_t *parent = parentloc->node_access; 8002374: 29 6b 00 08 lw r11,(r11+8) IMFS_update_ctime( parent ); 8002378: f8 00 01 94 calli 80029c8 800237c: 2b 81 00 2c lw r1,(sp+44) IMFS_update_mtime( parent ); 8002380: 34 02 00 00 mvi r2,0 new_node = IMFS_create_node( parentloc, type, name, namelen, mode, &info ); if ( new_node != NULL ) { IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); 8002384: 59 61 00 48 sw (r11+72),r1 IMFS_update_mtime( parent ); 8002388: b9 80 08 00 mv r1,r12 800238c: f8 00 01 8f calli 80029c8 8002390: 2b 81 00 2c lw r1,(sp+44) size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 8002394: 34 02 00 00 mvi r2,0 new_node = IMFS_create_node( parentloc, type, name, namelen, mode, &info ); if ( new_node != NULL ) { IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); 8002398: 59 61 00 44 sw (r11+68),r1 } else { rv = -1; } return rv; } 800239c: b8 40 08 00 mv r1,r2 80023a0: 2b 9d 00 04 lw ra,(sp+4) 80023a4: 2b 8b 00 18 lw r11,(sp+24) 80023a8: 2b 8c 00 14 lw r12,(sp+20) 80023ac: 2b 8d 00 10 lw r13,(sp+16) 80023b0: 2b 8e 00 0c lw r14,(sp+12) 80023b4: 2b 8f 00 08 lw r15,(sp+8) 80023b8: 37 9c 00 30 addi sp,sp,48 80023bc: c3 a0 00 00 ret =============================================================================== 080023c0 : #endif #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 80023c0: 37 9c ff fc addi sp,sp,-4 80023c4: 5b 9d 00 04 sw (sp+4),ra int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 80023c8: 28 22 00 20 lw r2,(r1+32) 80023cc: 28 42 00 08 lw r2,(r2+8) return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 80023d0: 28 43 00 4c lw r3,(r2+76) if ( IMFS_is_directory( node ) ) { 80023d4: 28 63 00 00 lw r3,(r3+0) 80023d8: 5c 60 00 09 bne r3,r0,80023fc if ( node->info.directory.mt_fs == NULL ) { 80023dc: 28 44 00 5c lw r4,(r2+92) 80023e0: 5c 83 00 04 bne r4,r3,80023f0 <== NEVER TAKEN node->info.directory.mt_fs = mt_entry; 80023e4: 58 41 00 5c sw (r2+92),r1 #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 80023e8: 34 01 00 00 mvi r1,0 80023ec: e0 00 00 08 bi 800240c if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == NULL ) { node->info.directory.mt_fs = mt_entry; } else { errno = EBUSY; 80023f0: f8 00 3e 37 calli 8011ccc <__errno> <== NOT EXECUTED 80023f4: 34 02 00 10 mvi r2,16 <== NOT EXECUTED 80023f8: e0 00 00 03 bi 8002404 <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; 80023fc: f8 00 3e 34 calli 8011ccc <__errno> 8002400: 34 02 00 14 mvi r2,20 8002404: 58 22 00 00 sw (r1+0),r2 rv = -1; 8002408: 34 01 ff ff mvi r1,-1 } return rv; } 800240c: 2b 9d 00 04 lw ra,(sp+4) 8002410: 37 9c 00 04 addi sp,sp,4 8002414: c3 a0 00 00 ret =============================================================================== 0800cca4 : } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { 800cca4: 37 9c ff fc addi sp,sp,-4 800cca8: 5b 9d 00 04 sw (sp+4),ra if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 800ccac: 28 23 00 50 lw r3,(r1+80) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 800ccb0: 34 22 00 54 addi r2,r1,84 800ccb4: 44 62 00 04 be r3,r2,800ccc4 errno = ENOTEMPTY; 800ccb8: f8 00 14 05 calli 8011ccc <__errno> 800ccbc: 34 02 00 5a mvi r2,90 800ccc0: e0 00 00 05 bi 800ccd4 node = NULL; } else if ( IMFS_is_mount_point( node ) ) { 800ccc4: 28 22 00 5c lw r2,(r1+92) 800ccc8: 44 40 00 05 be r2,r0,800ccdc <== ALWAYS TAKEN errno = EBUSY; 800cccc: f8 00 14 00 calli 8011ccc <__errno> <== NOT EXECUTED 800ccd0: 34 02 00 10 mvi r2,16 <== NOT EXECUTED 800ccd4: 58 22 00 00 sw (r1+0),r2 node = NULL; 800ccd8: 34 01 00 00 mvi r1,0 } return node; } 800ccdc: 2b 9d 00 04 lw ra,(sp+4) 800cce0: 37 9c 00 04 addi sp,sp,4 800cce4: c3 a0 00 00 ret =============================================================================== 08002418 : rtems_filesystem_node_types_t IMFS_node_type( const rtems_filesystem_location_info_t *loc ) { const IMFS_jnode_t *node = loc->node_access; 8002418: 28 21 00 08 lw r1,(r1+8) IMFS_jnode_types_t imfs_type = IMFS_type( node ); rtems_filesystem_node_types_t type; switch ( imfs_type ) { 800241c: 34 03 00 02 mvi r3,2 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 8002420: 28 22 00 4c lw r2,(r1+76) 8002424: 28 42 00 00 lw r2,(r2+0) 8002428: 44 43 00 05 be r2,r3,800243c 800242c: 34 03 00 05 mvi r3,5 case IMFS_HARD_LINK: type = IMFS_type( node->info.hard_link.link_node ); break; case IMFS_LINEAR_FILE: type = RTEMS_FILESYSTEM_MEMORY_FILE; 8002430: 34 01 00 04 mvi r1,4 { const IMFS_jnode_t *node = loc->node_access; IMFS_jnode_types_t imfs_type = IMFS_type( node ); rtems_filesystem_node_types_t type; switch ( imfs_type ) { 8002434: 5c 43 00 06 bne r2,r3,800244c <== ALWAYS TAKEN 8002438: c3 a0 00 00 ret <== NOT EXECUTED type = imfs_type; break; } return type; } 800243c: 28 21 00 50 lw r1,(r1+80) 8002440: 28 21 00 4c lw r1,(r1+76) 8002444: 28 21 00 00 lw r1,(r1+0) rtems_filesystem_node_types_t type; switch ( imfs_type ) { case IMFS_HARD_LINK: type = IMFS_type( node->info.hard_link.link_node ); break; 8002448: c3 a0 00 00 ret 800244c: b8 40 08 00 mv r1,r2 type = imfs_type; break; } return type; } 8002450: c3 a0 00 00 ret =============================================================================== 08002484 : const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 8002484: 37 9c ff e8 addi sp,sp,-24 8002488: 5b 8b 00 10 sw (sp+16),r11 800248c: 5b 8c 00 0c sw (sp+12),r12 8002490: 5b 8d 00 08 sw (sp+8),r13 8002494: 5b 9d 00 04 sw (sp+4),ra int rv = 0; IMFS_jnode_t *node = oldloc->node_access; 8002498: 28 4b 00 08 lw r11,(r2+8) const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 800249c: b8 a0 68 00 mv r13,r5 int rv = 0; IMFS_jnode_t *node = oldloc->node_access; IMFS_jnode_t *new_parent = newparentloc->node_access; 80024a0: 28 6c 00 08 lw r12,(r3+8) /* * FIXME: Due to insufficient checks we can create inaccessible nodes with * this operation. */ if ( node->Parent != NULL ) { 80024a4: 29 61 00 08 lw r1,(r11+8) 80024a8: 44 20 00 1e be r1,r0,8002520 <== NEVER TAKEN if ( namelen < IMFS_NAME_MAX ) { 80024ac: 34 01 00 1f mvi r1,31 80024b0: 54 a1 00 19 bgu r5,r1,8002514 <== NEVER TAKEN memcpy( node->name, name, namelen ); 80024b4: b8 80 10 00 mv r2,r4 80024b8: b8 a0 18 00 mv r3,r5 80024bc: 35 61 00 0c addi r1,r11,12 80024c0: f8 00 40 db calli 801282c ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 80024c4: 29 62 00 00 lw r2,(r11+0) previous = the_node->previous; 80024c8: 29 61 00 04 lw r1,(r11+4) node->name [namelen] = '\0'; 80024cc: b5 6d 68 00 add r13,r11,r13 80024d0: 31 a0 00 0c sb (r13+12),r0 next->previous = previous; 80024d4: 58 41 00 04 sw (r2+4),r1 previous->next = next; 80024d8: 58 22 00 00 sw (r1+0),r2 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 80024dc: 29 81 00 58 lw r1,(r12+88) RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 80024e0: 35 82 00 54 addi r2,r12,84 Chain_Node *old_last = tail->previous; the_node->next = tail; 80024e4: 59 62 00 00 sw (r11+0),r2 static inline void IMFS_add_to_directory( IMFS_jnode_t *dir, IMFS_jnode_t *node ) { node->Parent = dir; 80024e8: 59 6c 00 08 sw (r11+8),r12 tail->previous = the_node; old_last->next = the_node; 80024ec: 58 2b 00 00 sw (r1+0),r11 the_node->previous = old_last; 80024f0: 59 61 00 04 sw (r11+4),r1 { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 80024f4: 59 8b 00 58 sw (r12+88),r11 IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); 80024f8: 37 81 00 14 addi r1,sp,20 80024fc: 34 02 00 00 mvi r2,0 8002500: f8 00 01 32 calli 80029c8 8002504: 2b 81 00 14 lw r1,(sp+20) 8002508: 59 61 00 48 sw (r11+72),r1 const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { int rv = 0; 800250c: 34 01 00 00 mvi r1,0 8002510: e0 00 00 08 bi 8002530 IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); } else { errno = ENAMETOOLONG; 8002514: f8 00 3d ee calli 8011ccc <__errno> <== NOT EXECUTED 8002518: 34 02 00 5b mvi r2,91 <== NOT EXECUTED 800251c: e0 00 00 03 bi 8002528 <== NOT EXECUTED rv = -1; } } else { errno = EINVAL; 8002520: f8 00 3d eb calli 8011ccc <__errno> <== NOT EXECUTED 8002524: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8002528: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 800252c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED } return rv; } 8002530: 2b 9d 00 04 lw ra,(sp+4) 8002534: 2b 8b 00 10 lw r11,(sp+16) 8002538: 2b 8c 00 0c lw r12,(sp+12) 800253c: 2b 8d 00 08 lw r13,(sp+8) 8002540: 37 9c 00 18 addi sp,sp,24 8002544: c3 a0 00 00 ret =============================================================================== 08002640 : #endif #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 8002640: 37 9c ff fc addi sp,sp,-4 8002644: 5b 9d 00 04 sw (sp+4),ra int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 8002648: 28 22 00 20 lw r2,(r1+32) 800264c: 28 42 00 08 lw r2,(r2+8) return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 8002650: 28 43 00 4c lw r3,(r2+76) if ( IMFS_is_directory( node ) ) { 8002654: 28 63 00 00 lw r3,(r3+0) 8002658: 5c 60 00 09 bne r3,r0,800267c <== NEVER TAKEN if ( node->info.directory.mt_fs == mt_entry ) { 800265c: 28 43 00 5c lw r3,(r2+92) 8002660: 5c 61 00 04 bne r3,r1,8002670 <== NEVER TAKEN node->info.directory.mt_fs = NULL; 8002664: 58 40 00 5c sw (r2+92),r0 #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 8002668: 34 01 00 00 mvi r1,0 800266c: e0 00 00 08 bi 800268c if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == mt_entry ) { node->info.directory.mt_fs = NULL; } else { errno = EINVAL; 8002670: f8 00 3d 97 calli 8011ccc <__errno> <== NOT EXECUTED 8002674: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8002678: e0 00 00 03 bi 8002684 <== NOT EXECUTED rv = -1; } } else { errno = ENOTDIR; 800267c: f8 00 3d 94 calli 8011ccc <__errno> <== NOT EXECUTED 8002680: 34 02 00 14 mvi r2,20 <== NOT EXECUTED 8002684: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8002688: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED } return rv; } 800268c: 2b 9d 00 04 lw ra,(sp+4) 8002690: 37 9c 00 04 addi sp,sp,4 8002694: c3 a0 00 00 ret =============================================================================== 08002e54 : void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8002e54: 37 9c ff e4 addi sp,sp,-28 8002e58: 5b 8b 00 1c sw (sp+28),r11 8002e5c: 5b 8c 00 18 sw (sp+24),r12 8002e60: 5b 8d 00 14 sw (sp+20),r13 8002e64: 5b 8e 00 10 sw (sp+16),r14 8002e68: 5b 8f 00 0c sw (sp+12),r15 8002e6c: 5b 90 00 08 sw (sp+8),r16 8002e70: 5b 9d 00 04 sw (sp+4),ra Heap_Control *heap = RTEMS_Malloc_Heap; 8002e74: 78 04 08 01 mvhi r4,0x801 8002e78: 38 84 a0 54 ori r4,r4,0xa054 8002e7c: 28 8e 00 00 lw r14,(r4+0) if ( !rtems_configuration_get_unified_work_area() ) { 8002e80: 78 04 08 01 mvhi r4,0x801 8002e84: 38 84 87 ec ori r4,r4,0x87ec void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8002e88: b8 40 78 00 mv r15,r2 Heap_Control *heap = RTEMS_Malloc_Heap; if ( !rtems_configuration_get_unified_work_area() ) { 8002e8c: 40 82 00 31 lbu r2,(r4+49) void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8002e90: b8 60 80 00 mv r16,r3 Heap_Control *heap = RTEMS_Malloc_Heap; if ( !rtems_configuration_get_unified_work_area() ) { 8002e94: 5c 40 00 17 bne r2,r0,8002ef0 8002e98: 78 0b 08 00 mvhi r11,0x800 8002e9c: b8 20 60 00 mv r12,r1 8002ea0: 34 0d 00 00 mvi r13,0 8002ea4: 39 6b 62 44 ori r11,r11,0x6244 8002ea8: e0 00 00 0a bi 8002ed0 uintptr_t page_size = CPU_HEAP_ALIGNMENT; size_t i; for (i = 0; i < area_count; ++i) { const Heap_Area *area = &areas [i]; uintptr_t space_available = (*init_or_extend)( 8002eac: 29 82 00 00 lw r2,(r12+0) 8002eb0: 29 83 00 04 lw r3,(r12+4) 8002eb4: b9 c0 08 00 mv r1,r14 8002eb8: 34 04 00 04 mvi r4,4 8002ebc: d9 60 00 00 call r11 area->begin, area->size, page_size ); if ( space_available > 0 ) { 8002ec0: 44 20 00 02 be r1,r0,8002ec8 <== NEVER TAKEN init_or_extend = extend; 8002ec4: ba 00 58 00 mv r11,r16 if ( !rtems_configuration_get_unified_work_area() ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t page_size = CPU_HEAP_ALIGNMENT; size_t i; for (i = 0; i < area_count; ++i) { 8002ec8: 35 ad 00 01 addi r13,r13,1 8002ecc: 35 8c 00 08 addi r12,r12,8 8002ed0: 55 ed ff f7 bgu r15,r13,8002eac if ( space_available > 0 ) { init_or_extend = extend; } } if ( init_or_extend == _Heap_Initialize ) { 8002ed4: 78 02 08 00 mvhi r2,0x800 8002ed8: 38 42 62 44 ori r2,r2,0x6244 8002edc: 5d 62 00 05 bne r11,r2,8002ef0 _Internal_error_Occurred( 8002ee0: 34 01 00 00 mvi r1,0 8002ee4: 34 02 00 01 mvi r2,1 8002ee8: 34 03 00 17 mvi r3,23 8002eec: f8 00 0d 86 calli 8006504 <_Internal_error_Occurred> } /* * If configured, initialize the statistics support */ if ( rtems_malloc_statistics_helpers != NULL ) { 8002ef0: 78 02 08 01 mvhi r2,0x801 8002ef4: 38 42 a7 0c ori r2,r2,0xa70c 8002ef8: 28 41 00 00 lw r1,(r2+0) 8002efc: 44 20 00 03 be r1,r0,8002f08 (*rtems_malloc_statistics_helpers->initialize)(); 8002f00: 28 21 00 00 lw r1,(r1+0) 8002f04: d8 20 00 00 call r1 } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); 8002f08: 78 0b 08 01 mvhi r11,0x801 8002f0c: 39 6b a8 88 ori r11,r11,0xa888 8002f10: 29 6c 00 00 lw r12,(r11+0) 8002f14: b9 c0 08 00 mv r1,r14 8002f18: f8 00 10 26 calli 8006fb0 <_Protected_heap_Get_size> 8002f1c: b4 2c 08 00 add r1,r1,r12 8002f20: 59 61 00 00 sw (r11+0),r1 } 8002f24: 2b 9d 00 04 lw ra,(sp+4) 8002f28: 2b 8b 00 1c lw r11,(sp+28) 8002f2c: 2b 8c 00 18 lw r12,(sp+24) 8002f30: 2b 8d 00 14 lw r13,(sp+20) 8002f34: 2b 8e 00 10 lw r14,(sp+16) 8002f38: 2b 8f 00 0c lw r15,(sp+12) 8002f3c: 2b 90 00 08 lw r16,(sp+8) 8002f40: 37 9c 00 1c addi sp,sp,28 8002f44: c3 a0 00 00 ret =============================================================================== 08020fec : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 8020fec: 37 9c ff d4 addi sp,sp,-44 8020ff0: 5b 8b 00 24 sw (sp+36),r11 8020ff4: 5b 8c 00 20 sw (sp+32),r12 8020ff8: 5b 8d 00 1c sw (sp+28),r13 8020ffc: 5b 8e 00 18 sw (sp+24),r14 8021000: 5b 8f 00 14 sw (sp+20),r15 8021004: 5b 90 00 10 sw (sp+16),r16 8021008: 5b 91 00 0c sw (sp+12),r17 802100c: 5b 92 00 08 sw (sp+8),r18 8021010: 5b 9d 00 04 sw (sp+4),ra 8021014: b8 20 68 00 mv r13,r1 /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { 8021018: 34 01 ff ff mvi r1,-1 802101c: 5d a1 00 08 bne r13,r1,802103c if (!Stack_check_Interrupt_stack.area) 8021020: 78 0c 08 06 mvhi r12,0x806 8021024: 39 8c aa a4 ori r12,r12,0xaaa4 8021028: 29 81 00 04 lw r1,(r12+4) return; stack = &Stack_check_Interrupt_stack; the_thread = 0; current = 0; 802102c: 34 10 00 00 mvi r16,0 #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { if (!Stack_check_Interrupt_stack.area) return; stack = &Stack_check_Interrupt_stack; the_thread = 0; 8021030: 34 0d 00 00 mvi r13,0 /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { if (!Stack_check_Interrupt_stack.area) 8021034: 5c 20 00 04 bne r1,r0,8021044 <== ALWAYS TAKEN 8021038: e0 00 00 54 bi 8021188 <== NOT EXECUTED current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); 802103c: 29 b0 01 04 lw r16,(r13+260) the_thread = 0; current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; 8021040: 35 ac 00 b4 addi r12,r13,180 current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); 8021044: 29 8f 00 00 lw r15,(r12+0) { const uint32_t *base, *ebase; uint32_t length; base = s; length = n/4; 8021048: 34 02 00 02 mvi r2,2 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 802104c: 29 8b 00 04 lw r11,(r12+4) size = Stack_check_usable_stack_size(stack); 8021050: 35 ef ff f0 addi r15,r15,-16 { const uint32_t *base, *ebase; uint32_t length; base = s; length = n/4; 8021054: b9 e0 08 00 mv r1,r15 8021058: f8 00 dd 6d calli 805860c <__lshrsi3> * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 802105c: 34 02 00 02 mvi r2,2 8021060: fb ff 7c 66 calli 80001f8 <__ashlsi3> if (*base != U32_PATTERN) 8021064: 78 03 08 05 mvhi r3,0x805 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 8021068: 35 71 00 10 addi r17,r11,16 * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) if (*base != U32_PATTERN) 802106c: 38 63 ee c8 ori r3,r3,0xeec8 /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 8021070: 35 6b 00 20 addi r11,r11,32 for (ebase = base + length; base < ebase; base++) 8021074: b5 61 08 00 add r1,r11,r1 if (*base != U32_PATTERN) 8021078: 28 62 00 00 lw r2,(r3+0) 802107c: e0 00 00 04 bi 802108c 8021080: 29 63 00 00 lw r3,(r11+0) 8021084: 5c 62 00 05 bne r3,r2,8021098 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 8021088: 35 6b 00 04 addi r11,r11,4 802108c: 54 2b ff fd bgu r1,r11,8021080 <== ALWAYS TAKEN high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) used = Stack_check_Calculate_used( low, size, high_water_mark ); else used = 0; 8021090: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED 8021094: e0 00 00 05 bi 80210a8 <== NOT EXECUTED 8021098: 34 0e 00 00 mvi r14,0 low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) 802109c: 45 60 00 03 be r11,r0,80210a8 <== NEVER TAKEN used = Stack_check_Calculate_used( low, size, high_water_mark ); 80210a0: b6 2f 70 00 add r14,r17,r15 80210a4: c9 cb 70 00 sub r14,r14,r11 80210a8: 78 04 08 06 mvhi r4,0x806 80210ac: 78 02 08 06 mvhi r2,0x806 80210b0: 38 84 9a 74 ori r4,r4,0x9a74 80210b4: 38 42 9a 70 ori r2,r2,0x9a70 else used = 0; #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 80210b8: 45 a0 00 0f be r13,r0,80210f4 #endif { (*print_handler)( 80210bc: 29 ab 00 08 lw r11,(r13+8) 80210c0: 28 52 00 00 lw r18,(r2+0) 80210c4: 37 83 00 28 addi r3,sp,40 80210c8: b9 60 08 00 mv r1,r11 80210cc: 34 02 00 05 mvi r2,5 80210d0: 28 91 00 00 lw r17,(r4+0) 80210d4: fb ff ac 69 calli 800c278 80210d8: 78 02 08 05 mvhi r2,0x805 80210dc: b8 20 20 00 mv r4,r1 80210e0: 38 42 ed 3c ori r2,r2,0xed3c 80210e4: ba 40 08 00 mv r1,r18 80210e8: b9 60 18 00 mv r3,r11 80210ec: da 20 00 00 call r17 80210f0: e0 00 00 07 bi 802110c rtems_object_get_name( the_thread->Object.id, sizeof(name), name ) ); } #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); 80210f4: 28 41 00 00 lw r1,(r2+0) 80210f8: 28 84 00 00 lw r4,(r4+0) 80210fc: 78 02 08 05 mvhi r2,0x805 8021100: 38 42 ed 4c ori r2,r2,0xed4c 8021104: 34 03 ff ff mvi r3,-1 8021108: d8 80 00 00 call r4 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 802110c: 29 84 00 00 lw r4,(r12+0) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 8021110: 78 0b 08 06 mvhi r11,0x806 8021114: 78 0d 08 06 mvhi r13,0x806 print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 8021118: 29 83 00 04 lw r3,(r12+4) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 802111c: 39 6b 9a 74 ori r11,r11,0x9a74 8021120: 39 ad 9a 70 ori r13,r13,0x9a70 8021124: 29 67 00 00 lw r7,(r11+0) 8021128: 29 a1 00 00 lw r1,(r13+0) print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 802112c: 34 84 ff ff addi r4,r4,-1 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 8021130: 78 02 08 05 mvhi r2,0x805 8021134: 38 42 ed 5c ori r2,r2,0xed5c 8021138: b4 64 20 00 add r4,r3,r4 802113c: ba 00 28 00 mv r5,r16 8021140: b9 e0 30 00 mv r6,r15 8021144: d8 e0 00 00 call r7 stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 8021148: 78 01 08 06 mvhi r1,0x806 802114c: 38 21 9a 78 ori r1,r1,0x9a78 8021150: 28 21 00 00 lw r1,(r1+0) 8021154: 5c 20 00 07 bne r1,r0,8021170 <== ALWAYS TAKEN (*print_handler)( print_context, "Unavailable\n" ); 8021158: 29 63 00 00 lw r3,(r11+0) <== NOT EXECUTED 802115c: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED 8021160: 78 02 08 05 mvhi r2,0x805 <== NOT EXECUTED 8021164: 38 42 ed 7c ori r2,r2,0xed7c <== NOT EXECUTED 8021168: d8 60 00 00 call r3 <== NOT EXECUTED 802116c: e0 00 00 07 bi 8021188 <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 8021170: 29 64 00 00 lw r4,(r11+0) 8021174: 29 a1 00 00 lw r1,(r13+0) 8021178: 78 02 08 05 mvhi r2,0x805 802117c: 38 42 ed 8c ori r2,r2,0xed8c 8021180: b9 c0 18 00 mv r3,r14 8021184: d8 80 00 00 call r4 } } 8021188: 2b 9d 00 04 lw ra,(sp+4) 802118c: 2b 8b 00 24 lw r11,(sp+36) 8021190: 2b 8c 00 20 lw r12,(sp+32) 8021194: 2b 8d 00 1c lw r13,(sp+28) 8021198: 2b 8e 00 18 lw r14,(sp+24) 802119c: 2b 8f 00 14 lw r15,(sp+20) 80211a0: 2b 90 00 10 lw r16,(sp+16) 80211a4: 2b 91 00 0c lw r17,(sp+12) 80211a8: 2b 92 00 08 lw r18,(sp+8) 80211ac: 37 9c 00 2c addi sp,sp,44 80211b0: c3 a0 00 00 ret =============================================================================== 080212c0 : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 80212c0: 37 9c ff d0 addi sp,sp,-48 80212c4: 5b 8b 00 10 sw (sp+16),r11 80212c8: 5b 8c 00 0c sw (sp+12),r12 80212cc: 5b 8d 00 08 sw (sp+8),r13 80212d0: 5b 9d 00 04 sw (sp+4),ra 80212d4: b8 20 58 00 mv r11,r1 Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); 80212d8: 28 2c 00 b8 lw r12,(r1+184) char name[32]; printk("BLOWN STACK!!!\n"); 80212dc: 78 01 08 05 mvhi r1,0x805 80212e0: 38 21 ed 94 ori r1,r1,0xed94 Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 80212e4: 20 4d 00 ff andi r13,r2,0xff Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); char name[32]; printk("BLOWN STACK!!!\n"); 80212e8: fb ff 83 49 calli 800200c printk("task control block: 0x%08" PRIxPTR "\n", running); 80212ec: 78 01 08 05 mvhi r1,0x805 80212f0: 38 21 ed a4 ori r1,r1,0xeda4 80212f4: b9 60 10 00 mv r2,r11 80212f8: fb ff 83 45 calli 800200c printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); 80212fc: 29 62 00 08 lw r2,(r11+8) 8021300: 78 01 08 05 mvhi r1,0x805 8021304: 38 21 ed c0 ori r1,r1,0xedc0 8021308: fb ff 83 41 calli 800200c printk( 802130c: 29 62 00 0c lw r2,(r11+12) 8021310: 78 01 08 05 mvhi r1,0x805 8021314: 38 21 ed d4 ori r1,r1,0xedd4 8021318: fb ff 83 3d calli 800200c "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( 802131c: 29 61 00 08 lw r1,(r11+8) 8021320: 37 83 00 14 addi r3,sp,20 8021324: 34 02 00 20 mvi r2,32 8021328: fb ff ab d4 calli 800c278 802132c: b8 20 10 00 mv r2,r1 8021330: 78 01 08 05 mvhi r1,0x805 8021334: 38 21 ed e8 ori r1,r1,0xede8 8021338: fb ff 83 35 calli 800200c ); printk( "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) 802133c: 29 63 00 b8 lw r3,(r11+184) 8021340: 29 62 00 b4 lw r2,(r11+180) ); printk( "task name string: %s\n", rtems_object_get_name(running->Object.id, sizeof(name), name) ); printk( 8021344: 78 01 08 05 mvhi r1,0x805 8021348: 38 21 ee 00 ori r1,r1,0xee00 802134c: b4 62 20 00 add r4,r3,r2 8021350: fb ff 83 2f calli 800200c "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) ); if (!pattern_ok) { 8021354: 5d a0 00 07 bne r13,r0,8021370 <== NEVER TAKEN printk( 8021358: 78 01 08 05 mvhi r1,0x805 802135c: 38 21 ee 30 ori r1,r1,0xee30 8021360: 34 02 00 10 mvi r2,16 8021364: 35 83 00 08 addi r3,r12,8 8021368: 35 84 00 18 addi r4,r12,24 802136c: fb ff 83 28 calli 800200c rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal( 8021370: 29 62 00 0c lw r2,(r11+12) 8021374: 34 01 00 09 mvi r1,9 8021378: fb ff 89 05 calli 800378c =============================================================================== 08005938 <_API_extensions_Add_post_switch>: */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 8005938: 28 22 00 00 lw r2,(r1+0) 800593c: 5c 40 00 0c bne r2,r0,800596c <_API_extensions_Add_post_switch+0x34> 8005940: 28 23 00 04 lw r3,(r1+4) 8005944: 5c 62 00 0a bne r3,r2,800596c <_API_extensions_Add_post_switch+0x34><== NEVER TAKEN Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 8005948: 78 02 08 01 mvhi r2,0x801 800594c: 38 42 a9 e8 ori r2,r2,0xa9e8 8005950: 28 44 00 08 lw r4,(r2+8) the_node->next = tail; 8005954: 78 03 08 01 mvhi r3,0x801 8005958: 38 63 a9 ec ori r3,r3,0xa9ec 800595c: 58 23 00 00 sw (r1+0),r3 tail->previous = the_node; 8005960: 58 41 00 08 sw (r2+8),r1 old_last->next = the_node; 8005964: 58 81 00 00 sw (r4+0),r1 the_node->previous = old_last; 8005968: 58 24 00 04 sw (r1+4),r4 800596c: c3 a0 00 00 ret =============================================================================== 0800699c <_CORE_RWLock_Release>: #include CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 800699c: 37 9c ff f4 addi sp,sp,-12 80069a0: 5b 8b 00 0c sw (sp+12),r11 80069a4: 5b 8c 00 08 sw (sp+8),r12 80069a8: 5b 9d 00 04 sw (sp+4),ra 80069ac: b8 20 58 00 mv r11,r1 ISR_Level level; Thread_Control *executing = _Thread_Executing; 80069b0: 78 01 08 01 mvhi r1,0x801 80069b4: 38 21 9d a0 ori r1,r1,0x9da0 80069b8: 28 22 00 10 lw r2,(r1+16) * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 80069bc: 90 00 08 00 rcsr r1,IE 80069c0: 34 03 ff fe mvi r3,-2 80069c4: a0 23 18 00 and r3,r1,r3 80069c8: d0 03 00 00 wcsr IE,r3 if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 80069cc: 29 63 00 44 lw r3,(r11+68) 80069d0: 5c 60 00 05 bne r3,r0,80069e4 <_CORE_RWLock_Release+0x48> _ISR_Enable( level ); 80069d4: d0 01 00 00 wcsr IE,r1 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 80069d8: 34 01 00 02 mvi r1,2 80069dc: 58 41 00 34 sw (r2+52),r1 return CORE_RWLOCK_SUCCESSFUL; 80069e0: e0 00 00 26 bi 8006a78 <_CORE_RWLock_Release+0xdc> } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 80069e4: 34 04 00 01 mvi r4,1 80069e8: 5c 64 00 07 bne r3,r4,8006a04 <_CORE_RWLock_Release+0x68> the_rwlock->number_of_readers -= 1; 80069ec: 29 63 00 48 lw r3,(r11+72) 80069f0: 34 63 ff ff addi r3,r3,-1 80069f4: 59 63 00 48 sw (r11+72),r3 if ( the_rwlock->number_of_readers != 0 ) { 80069f8: 44 60 00 03 be r3,r0,8006a04 <_CORE_RWLock_Release+0x68> /* must be unlocked again */ _ISR_Enable( level ); 80069fc: d0 01 00 00 wcsr IE,r1 return CORE_RWLOCK_SUCCESSFUL; 8006a00: e0 00 00 1e bi 8006a78 <_CORE_RWLock_Release+0xdc> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 8006a04: 58 40 00 34 sw (r2+52),r0 /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 8006a08: 59 60 00 44 sw (r11+68),r0 _ISR_Enable( level ); 8006a0c: d0 01 00 00 wcsr IE,r1 next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 8006a10: b9 60 08 00 mv r1,r11 8006a14: f8 00 08 86 calli 8008c2c <_Thread_queue_Dequeue> if ( next ) { 8006a18: 44 20 00 18 be r1,r0,8006a78 <_CORE_RWLock_Release+0xdc> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 8006a1c: 28 22 00 30 lw r2,(r1+48) 8006a20: 34 01 00 01 mvi r1,1 8006a24: 5c 41 00 04 bne r2,r1,8006a34 <_CORE_RWLock_Release+0x98> the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 8006a28: 34 01 00 02 mvi r1,2 8006a2c: 59 61 00 44 sw (r11+68),r1 return CORE_RWLOCK_SUCCESSFUL; 8006a30: e0 00 00 12 bi 8006a78 <_CORE_RWLock_Release+0xdc> } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 8006a34: 29 62 00 48 lw r2,(r11+72) the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 8006a38: 59 61 00 44 sw (r11+68),r1 /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); if ( !next || 8006a3c: 34 0c 00 01 mvi r12,1 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 8006a40: 34 42 00 01 addi r2,r2,1 8006a44: 59 62 00 48 sw (r11+72),r2 /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 8006a48: b9 60 08 00 mv r1,r11 8006a4c: f8 00 09 f9 calli 8009230 <_Thread_queue_First> 8006a50: b8 20 10 00 mv r2,r1 if ( !next || 8006a54: 44 20 00 09 be r1,r0,8006a78 <_CORE_RWLock_Release+0xdc> 8006a58: 28 21 00 30 lw r1,(r1+48) 8006a5c: 44 2c 00 07 be r1,r12,8006a78 <_CORE_RWLock_Release+0xdc> <== NEVER TAKEN next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 8006a60: 29 61 00 48 lw r1,(r11+72) 8006a64: 34 21 00 01 addi r1,r1,1 8006a68: 59 61 00 48 sw (r11+72),r1 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 8006a6c: b9 60 08 00 mv r1,r11 8006a70: f8 00 09 a8 calli 8009110 <_Thread_queue_Extract> } 8006a74: e3 ff ff f5 bi 8006a48 <_CORE_RWLock_Release+0xac> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 8006a78: 34 01 00 00 mvi r1,0 8006a7c: 2b 9d 00 04 lw ra,(sp+4) 8006a80: 2b 8b 00 0c lw r11,(sp+12) 8006a84: 2b 8c 00 08 lw r12,(sp+8) 8006a88: 37 9c 00 0c addi sp,sp,12 8006a8c: c3 a0 00 00 ret =============================================================================== 08006a90 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 8006a90: 37 9c ff f8 addi sp,sp,-8 8006a94: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 8006a98: 37 82 00 08 addi r2,sp,8 8006a9c: f8 00 07 70 calli 800885c <_Thread_Get> switch ( location ) { 8006aa0: 2b 82 00 08 lw r2,(sp+8) 8006aa4: 5c 40 00 07 bne r2,r0,8006ac0 <_CORE_RWLock_Timeout+0x30> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 8006aa8: f8 00 0a 3c calli 8009398 <_Thread_queue_Process_timeout> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 8006aac: 78 01 08 01 mvhi r1,0x801 8006ab0: 38 21 99 08 ori r1,r1,0x9908 8006ab4: 28 22 00 00 lw r2,(r1+0) --level; 8006ab8: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 8006abc: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 8006ac0: 2b 9d 00 04 lw ra,(sp+4) 8006ac4: 37 9c 00 08 addi sp,sp,8 8006ac8: c3 a0 00 00 ret =============================================================================== 0800e320 <_CORE_message_queue_Seize>: void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800e320: 37 9c ff f0 addi sp,sp,-16 800e324: 5b 8b 00 10 sw (sp+16),r11 800e328: 5b 8c 00 0c sw (sp+12),r12 800e32c: 5b 8d 00 08 sw (sp+8),r13 800e330: 5b 9d 00 04 sw (sp+4),ra ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 800e334: 78 07 08 02 mvhi r7,0x802 800e338: 38 e7 8f 20 ori r7,r7,0x8f20 800e33c: 28 e7 00 10 lw r7,(r7+16) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800e340: b8 20 58 00 mv r11,r1 800e344: 20 a5 00 ff andi r5,r5,0xff ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 800e348: 58 e0 00 34 sw (r7+52),r0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800e34c: b8 60 08 00 mv r1,r3 CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 800e350: 90 00 40 00 rcsr r8,IE 800e354: 34 03 ff fe mvi r3,-2 800e358: a1 03 18 00 and r3,r8,r3 800e35c: d0 03 00 00 wcsr IE,r3 executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 800e360: 29 6c 00 50 lw r12,(r11+80) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 800e364: 35 63 00 54 addi r3,r11,84 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 800e368: 45 83 00 07 be r12,r3,800e384 <_CORE_message_queue_Seize+0x64> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 800e36c: 29 83 00 00 lw r3,(r12+0) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 800e370: 35 69 00 50 addi r9,r11,80 Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 800e374: 59 63 00 50 sw (r11+80),r3 new_first->previous = head; 800e378: 58 69 00 04 sw (r3+4),r9 executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 800e37c: 5d 80 00 04 bne r12,r0,800e38c <_CORE_message_queue_Seize+0x6c><== ALWAYS TAKEN 800e380: e0 00 00 25 bi 800e414 <_CORE_message_queue_Seize+0xf4> <== NOT EXECUTED ) { if ( !_Chain_Is_empty(the_chain)) return _Chain_Get_first_unprotected(the_chain); else return NULL; 800e384: 34 0c 00 00 mvi r12,0 800e388: e0 00 00 23 bi 800e414 <_CORE_message_queue_Seize+0xf4> the_message_queue->number_of_pending_messages -= 1; 800e38c: 29 62 00 48 lw r2,(r11+72) 800e390: 34 42 ff ff addi r2,r2,-1 800e394: 59 62 00 48 sw (r11+72),r2 _ISR_Enable( level ); 800e398: d0 08 00 00 wcsr IE,r8 *size_p = the_message->Contents.size; 800e39c: 29 83 00 0c lw r3,(r12+12) _Thread_Executing->Wait.count = 800e3a0: 78 02 08 02 mvhi r2,0x802 800e3a4: 38 42 8f 20 ori r2,r2,0x8f20 the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; _ISR_Enable( level ); *size_p = the_message->Contents.size; 800e3a8: 58 83 00 00 sw (r4+0),r3 _Thread_Executing->Wait.count = 800e3ac: 29 84 00 08 lw r4,(r12+8) 800e3b0: 28 42 00 10 lw r2,(r2+16) _CORE_message_queue_Get_message_priority( the_message ); _CORE_message_queue_Copy_buffer( the_message->Contents.buffer, 800e3b4: 35 8d 00 10 addi r13,r12,16 if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; _ISR_Enable( level ); *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 800e3b8: 58 44 00 24 sw (r2+36),r4 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 800e3bc: b9 a0 10 00 mv r2,r13 800e3c0: f8 00 25 ac calli 8017a70 * is not, then we can go ahead and free the buffer. * * NOTE: If we note that the queue was not full before this receive, * then we can avoid this dequeue. */ the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 800e3c4: b9 60 08 00 mv r1,r11 800e3c8: f8 00 0a 97 calli 8010e24 <_Thread_queue_Dequeue> 800e3cc: b8 20 20 00 mv r4,r1 if ( !the_thread ) { 800e3d0: 5c 20 00 05 bne r1,r0,800e3e4 <_CORE_message_queue_Seize+0xc4> RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer ( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message ) { _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node ); 800e3d4: 35 61 00 68 addi r1,r11,104 800e3d8: b9 80 10 00 mv r2,r12 800e3dc: fb ff ff 6b calli 800e188 <_Chain_Append> _CORE_message_queue_Free_message_buffer( the_message_queue, the_message ); return; 800e3e0: e0 00 00 1e bi 800e458 <_CORE_message_queue_Seize+0x138> CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 800e3e4: 28 21 00 24 lw r1,(r1+36) */ _CORE_message_queue_Set_message_priority( the_message, the_thread->Wait.count ); the_message->Contents.size = (size_t) the_thread->Wait.option; 800e3e8: 28 83 00 30 lw r3,(r4+48) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 800e3ec: 28 82 00 2c lw r2,(r4+44) CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 800e3f0: 59 81 00 08 sw (r12+8),r1 800e3f4: 59 83 00 0c sw (r12+12),r3 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 800e3f8: b9 a0 08 00 mv r1,r13 800e3fc: f8 00 25 9d calli 8017a70 the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 800e400: 29 83 00 08 lw r3,(r12+8) 800e404: b9 60 08 00 mv r1,r11 800e408: b9 80 10 00 mv r2,r12 800e40c: f8 00 18 8c calli 801463c <_CORE_message_queue_Insert_message> the_message_queue, the_message, _CORE_message_queue_Get_message_priority( the_message ) ); return; 800e410: e0 00 00 12 bi 800e458 <_CORE_message_queue_Seize+0x138> } #endif } if ( !wait ) { 800e414: 5c ac 00 05 bne r5,r12,800e428 <_CORE_message_queue_Seize+0x108> _ISR_Enable( level ); 800e418: d0 08 00 00 wcsr IE,r8 executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 800e41c: 34 01 00 04 mvi r1,4 800e420: 58 e1 00 34 sw (r7+52),r1 return; 800e424: e0 00 00 0d bi 800e458 <_CORE_message_queue_Seize+0x138> RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 800e428: 34 03 00 01 mvi r3,1 800e42c: 59 63 00 30 sw (r11+48),r3 } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 800e430: 58 eb 00 44 sw (r7+68),r11 executing->Wait.id = id; 800e434: 58 e2 00 20 sw (r7+32),r2 executing->Wait.return_argument_second.mutable_object = buffer; 800e438: 58 e1 00 2c sw (r7+44),r1 executing->Wait.return_argument = size_p; 800e43c: 58 e4 00 28 sw (r7+40),r4 /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 800e440: d0 08 00 00 wcsr IE,r8 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 800e444: 78 03 08 01 mvhi r3,0x801 800e448: b9 60 08 00 mv r1,r11 800e44c: b8 c0 10 00 mv r2,r6 800e450: 38 63 14 cc ori r3,r3,0x14cc 800e454: f8 00 0a e7 calli 8010ff0 <_Thread_queue_Enqueue_with_handler> } 800e458: 2b 9d 00 04 lw ra,(sp+4) 800e45c: 2b 8b 00 10 lw r11,(sp+16) 800e460: 2b 8c 00 0c lw r12,(sp+12) 800e464: 2b 8d 00 08 lw r13,(sp+8) 800e468: 37 9c 00 10 addi sp,sp,16 800e46c: c3 a0 00 00 ret =============================================================================== 08005b38 <_CORE_mutex_Initialize>: CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 8005b38: 37 9c ff fc addi sp,sp,-4 8005b3c: 5b 9d 00 04 sw (sp+4),ra /* Add this to the RTEMS environment later ????????? rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; 8005b40: 28 47 00 00 lw r7,(r2+0) 8005b44: 28 46 00 04 lw r6,(r2+4) 8005b48: 28 44 00 08 lw r4,(r2+8) 8005b4c: 28 45 00 0c lw r5,(r2+12) 8005b50: 58 27 00 40 sw (r1+64),r7 8005b54: 58 26 00 44 sw (r1+68),r6 8005b58: 58 24 00 48 sw (r1+72),r4 8005b5c: 58 25 00 4c sw (r1+76),r5 the_mutex->lock = initial_lock; 8005b60: 58 23 00 50 sw (r1+80),r3 the_mutex->blocked_count = 0; 8005b64: 58 20 00 58 sw (r1+88),r0 if ( initial_lock == CORE_MUTEX_LOCKED ) { 8005b68: 5c 60 00 15 bne r3,r0,8005bbc <_CORE_mutex_Initialize+0x84> the_mutex->nest_count = 1; 8005b6c: 34 03 00 01 mvi r3,1 8005b70: 58 23 00 54 sw (r1+84),r3 the_mutex->holder = _Thread_Executing; 8005b74: 78 03 08 01 mvhi r3,0x801 8005b78: 38 63 ae 00 ori r3,r3,0xae00 8005b7c: 28 63 00 10 lw r3,(r3+16) the_mutex->holder_id = _Thread_Executing->Object.id; 8005b80: 28 65 00 08 lw r5,(r3+8) the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { the_mutex->nest_count = 1; the_mutex->holder = _Thread_Executing; 8005b84: 58 23 00 5c sw (r1+92),r3 the_mutex->holder_id = _Thread_Executing->Object.id; 8005b88: 58 25 00 60 sw (r1+96),r5 if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 8005b8c: 34 05 00 02 mvi r5,2 8005b90: 44 85 00 03 be r4,r5,8005b9c <_CORE_mutex_Initialize+0x64> 8005b94: 34 05 00 03 mvi r5,3 8005b98: 5c 85 00 0c bne r4,r5,8005bc8 <_CORE_mutex_Initialize+0x90> _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { if ( _Thread_Executing->current_priority < 8005b9c: 28 65 00 14 lw r5,(r3+20) 8005ba0: 28 26 00 4c lw r6,(r1+76) the_mutex->Attributes.priority_ceiling ) return CORE_MUTEX_STATUS_CEILING_VIOLATED; 8005ba4: 34 04 00 06 mvi r4,6 the_mutex->holder = _Thread_Executing; the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { if ( _Thread_Executing->current_priority < 8005ba8: 54 c5 00 0e bgu r6,r5,8005be0 <_CORE_mutex_Initialize+0xa8><== NEVER TAKEN _Chain_Prepend_unprotected( &_Thread_Executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = _Thread_Executing->current_priority; #endif _Thread_Executing->resource_count++; 8005bac: 28 64 00 1c lw r4,(r3+28) 8005bb0: 34 84 00 01 addi r4,r4,1 8005bb4: 58 64 00 1c sw (r3+28),r4 8005bb8: e0 00 00 04 bi 8005bc8 <_CORE_mutex_Initialize+0x90> } } else { the_mutex->nest_count = 0; 8005bbc: 58 20 00 54 sw (r1+84),r0 the_mutex->holder = NULL; 8005bc0: 58 20 00 5c sw (r1+92),r0 the_mutex->holder_id = 0; 8005bc4: 58 20 00 60 sw (r1+96),r0 } _Thread_queue_Initialize( 8005bc8: 28 42 00 08 lw r2,(r2+8) 8005bcc: 34 04 00 05 mvi r4,5 8005bd0: 34 03 04 00 mvi r3,1024 8005bd4: 7c 42 00 00 cmpnei r2,r2,0 8005bd8: f8 00 09 c4 calli 80082e8 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY, STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; 8005bdc: 34 04 00 00 mvi r4,0 } 8005be0: b8 80 08 00 mv r1,r4 8005be4: 2b 9d 00 04 lw ra,(sp+4) 8005be8: 37 9c 00 04 addi sp,sp,4 8005bec: c3 a0 00 00 ret =============================================================================== 08005f04 <_CORE_semaphore_Surrender>: CORE_semaphore_Status _CORE_semaphore_Surrender( CORE_semaphore_Control *the_semaphore, Objects_Id id, CORE_semaphore_API_mp_support_callout api_semaphore_mp_support ) { 8005f04: 37 9c ff f8 addi sp,sp,-8 8005f08: 5b 8b 00 08 sw (sp+8),r11 8005f0c: 5b 9d 00 04 sw (sp+4),ra 8005f10: b8 20 58 00 mv r11,r1 ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 8005f14: f8 00 07 ab calli 8007dc0 <_Thread_queue_Dequeue> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 8005f18: 34 02 00 00 mvi r2,0 if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 8005f1c: 5c 20 00 0d bne r1,r0,8005f50 <_CORE_semaphore_Surrender+0x4c> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 8005f20: 90 00 08 00 rcsr r1,IE 8005f24: 34 02 ff fe mvi r2,-2 8005f28: a0 22 10 00 and r2,r1,r2 8005f2c: d0 02 00 00 wcsr IE,r2 if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 8005f30: 29 63 00 48 lw r3,(r11+72) 8005f34: 29 64 00 40 lw r4,(r11+64) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 8005f38: 34 02 00 04 mvi r2,4 (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 8005f3c: 50 64 00 04 bgeu r3,r4,8005f4c <_CORE_semaphore_Surrender+0x48><== NEVER TAKEN the_semaphore->count += 1; 8005f40: 34 63 00 01 addi r3,r3,1 8005f44: 59 63 00 48 sw (r11+72),r3 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 8005f48: 34 02 00 00 mvi r2,0 _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 8005f4c: d0 01 00 00 wcsr IE,r1 } return status; } 8005f50: b8 40 08 00 mv r1,r2 8005f54: 2b 9d 00 04 lw ra,(sp+4) 8005f58: 2b 8b 00 08 lw r11,(sp+8) 8005f5c: 37 9c 00 08 addi sp,sp,8 8005f60: c3 a0 00 00 ret =============================================================================== 0800e56c <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 800e56c: 37 9c ff f4 addi sp,sp,-12 800e570: 5b 8b 00 0c sw (sp+12),r11 800e574: 5b 8c 00 08 sw (sp+8),r12 800e578: 5b 9d 00 04 sw (sp+4),ra rtems_event_set pending_events; rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; 800e57c: 28 2a 00 30 lw r10,(r1+48) rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 800e580: b8 20 58 00 mv r11,r1 rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; _ISR_Disable( level ); 800e584: 90 00 08 00 rcsr r1,IE 800e588: 34 09 ff fe mvi r9,-2 800e58c: a0 29 48 00 and r9,r1,r9 800e590: d0 09 00 00 wcsr IE,r9 RTEMS_INLINE_ROUTINE void _Event_sets_Post( rtems_event_set the_new_events, rtems_event_set *the_event_set ) { *the_event_set |= the_new_events; 800e594: 28 66 00 00 lw r6,(r3+0) _Event_sets_Post( event_in, &event->pending_events ); pending_events = event->pending_events; event_condition = the_thread->Wait.count; 800e598: 29 68 00 24 lw r8,(r11+36) 800e59c: b8 46 10 00 or r2,r2,r6 800e5a0: 58 62 00 00 sw (r3+0),r2 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 800e5a4: a0 48 30 00 and r6,r2,r8 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 800e5a8: 44 c0 00 35 be r6,r0,800e67c <_Event_Surrender+0x110> /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 800e5ac: 78 07 08 01 mvhi r7,0x801 800e5b0: 38 e7 ae 00 ori r7,r7,0xae00 800e5b4: 28 ec 00 08 lw r12,(r7+8) 800e5b8: 45 80 00 13 be r12,r0,800e604 <_Event_Surrender+0x98> 800e5bc: 28 e7 00 10 lw r7,(r7+16) 800e5c0: 5d 67 00 11 bne r11,r7,800e604 <_Event_Surrender+0x98> _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 800e5c4: 28 8c 00 00 lw r12,(r4+0) /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && 800e5c8: 34 07 00 01 mvi r7,1 ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 800e5cc: 35 8c ff ff addi r12,r12,-1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && 800e5d0: 55 87 00 0d bgu r12,r7,800e604 <_Event_Surrender+0x98> ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 800e5d4: 44 c8 00 03 be r6,r8,800e5e0 <_Event_Surrender+0x74> */ RTEMS_INLINE_ROUTINE bool _Options_Is_any ( rtems_option option_set ) { return (option_set & RTEMS_EVENT_ANY) ? true : false; 800e5d8: 21 4a 00 02 andi r10,r10,0x2 800e5dc: 45 40 00 28 be r10,r0,800e67c <_Event_Surrender+0x110> <== NEVER TAKEN RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 800e5e0: a4 c0 28 00 not r5,r6 800e5e4: a0 a2 10 00 and r2,r5,r2 event->pending_events = _Event_sets_Clear( 800e5e8: 58 62 00 00 sw (r3+0),r2 pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800e5ec: 29 62 00 28 lw r2,(r11+40) if ( seized_events == event_condition || _Options_Is_any(option_set) ) { event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; 800e5f0: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800e5f4: 58 46 00 00 sw (r2+0),r6 *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 800e5f8: 34 02 00 03 mvi r2,3 800e5fc: 58 82 00 00 sw (r4+0),r2 800e600: e0 00 00 1f bi 800e67c <_Event_Surrender+0x110> RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 800e604: 29 64 00 10 lw r4,(r11+16) 800e608: a0 a4 28 00 and r5,r5,r4 } /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { 800e60c: 44 a0 00 1c be r5,r0,800e67c <_Event_Surrender+0x110> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 800e610: 44 c8 00 03 be r6,r8,800e61c <_Event_Surrender+0xb0> 800e614: 21 4a 00 02 andi r10,r10,0x2 800e618: 45 40 00 19 be r10,r0,800e67c <_Event_Surrender+0x110> <== NEVER TAKEN 800e61c: a4 c0 20 00 not r4,r6 800e620: a0 82 10 00 and r2,r4,r2 event->pending_events = _Event_sets_Clear( 800e624: 58 62 00 00 sw (r3+0),r2 pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800e628: 29 62 00 28 lw r2,(r11+40) if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; 800e62c: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800e630: 58 46 00 00 sw (r2+0),r6 _ISR_Flash( level ); 800e634: d0 01 00 00 wcsr IE,r1 800e638: d0 09 00 00 wcsr IE,r9 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 800e63c: 29 63 00 50 lw r3,(r11+80) 800e640: 34 02 00 02 mvi r2,2 800e644: 44 62 00 03 be r3,r2,800e650 <_Event_Surrender+0xe4> _ISR_Enable( level ); 800e648: d0 01 00 00 wcsr IE,r1 800e64c: e0 00 00 06 bi 800e664 <_Event_Surrender+0xf8> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 800e650: 34 02 00 03 mvi r2,3 800e654: 59 62 00 50 sw (r11+80),r2 _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 800e658: d0 01 00 00 wcsr IE,r1 (void) _Watchdog_Remove( &the_thread->Timer ); 800e65c: 35 61 00 48 addi r1,r11,72 800e660: fb ff e8 fc calli 8008a50 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800e664: 78 03 08 01 mvhi r3,0x801 800e668: 38 63 8c 94 ori r3,r3,0x8c94 800e66c: 28 62 00 00 lw r2,(r3+0) 800e670: b9 60 08 00 mv r1,r11 800e674: f8 00 04 c9 calli 800f998 <_Thread_Clear_state> 800e678: e0 00 00 02 bi 800e680 <_Event_Surrender+0x114> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 800e67c: d0 01 00 00 wcsr IE,r1 } 800e680: 2b 9d 00 04 lw ra,(sp+4) 800e684: 2b 8b 00 0c lw r11,(sp+12) 800e688: 2b 8c 00 08 lw r12,(sp+8) 800e68c: 37 9c 00 0c addi sp,sp,12 800e690: c3 a0 00 00 ret =============================================================================== 0800e694 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 800e694: 37 9c ff f4 addi sp,sp,-12 800e698: 5b 8b 00 08 sw (sp+8),r11 800e69c: 5b 9d 00 04 sw (sp+4),ra 800e6a0: b8 40 58 00 mv r11,r2 ISR_Level level; Thread_blocking_operation_States *sync_state; sync_state = arg; the_thread = _Thread_Get( id, &location ); 800e6a4: 37 82 00 0c addi r2,sp,12 800e6a8: fb ff e4 d2 calli 80079f0 <_Thread_Get> switch ( location ) { 800e6ac: 2b 82 00 0c lw r2,(sp+12) 800e6b0: 5c 40 00 1b bne r2,r0,800e71c <_Event_Timeout+0x88> <== NEVER TAKEN * * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ _ISR_Disable( level ); 800e6b4: 90 00 10 00 rcsr r2,IE 800e6b8: 34 03 ff fe mvi r3,-2 800e6bc: a0 43 18 00 and r3,r2,r3 800e6c0: d0 03 00 00 wcsr IE,r3 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800e6c4: 78 03 08 01 mvhi r3,0x801 800e6c8: 38 63 ae 00 ori r3,r3,0xae00 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 800e6cc: 28 63 00 10 lw r3,(r3+16) _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 800e6d0: 58 20 00 24 sw (r1+36),r0 if ( _Thread_Is_executing( the_thread ) ) { 800e6d4: 5c 23 00 06 bne r1,r3,800e6ec <_Event_Timeout+0x58> if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800e6d8: 29 64 00 00 lw r4,(r11+0) 800e6dc: 34 03 00 01 mvi r3,1 800e6e0: 5c 83 00 03 bne r4,r3,800e6ec <_Event_Timeout+0x58> *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800e6e4: 34 03 00 02 mvi r3,2 800e6e8: 59 63 00 00 sw (r11+0),r3 } the_thread->Wait.return_code = RTEMS_TIMEOUT; 800e6ec: 34 03 00 06 mvi r3,6 800e6f0: 58 23 00 34 sw (r1+52),r3 _ISR_Enable( level ); 800e6f4: d0 02 00 00 wcsr IE,r2 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800e6f8: 78 03 08 01 mvhi r3,0x801 800e6fc: 38 63 8c 94 ori r3,r3,0x8c94 800e700: 28 62 00 00 lw r2,(r3+0) 800e704: f8 00 04 a5 calli 800f998 <_Thread_Clear_state> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 800e708: 78 01 08 01 mvhi r1,0x801 800e70c: 38 21 a9 78 ori r1,r1,0xa978 800e710: 28 22 00 00 lw r2,(r1+0) --level; 800e714: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 800e718: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800e71c: 2b 9d 00 04 lw ra,(sp+4) 800e720: 2b 8b 00 08 lw r11,(sp+8) 800e724: 37 9c 00 0c addi sp,sp,12 800e728: c3 a0 00 00 ret =============================================================================== 0800f440 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 800f440: 37 9c ff f4 addi sp,sp,-12 800f444: 5b 8b 00 0c sw (sp+12),r11 800f448: 5b 8c 00 08 sw (sp+8),r12 800f44c: 5b 9d 00 04 sw (sp+4),ra 800f450: b8 20 58 00 mv r11,r1 * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { return true; 800f454: 34 01 00 01 mvi r1,1 /* * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { 800f458: 44 40 00 73 be r2,r0,800f624 <_Heap_Free+0x1e4> 800f45c: 34 4c ff f8 addi r12,r2,-8 800f460: b8 40 08 00 mv r1,r2 800f464: 29 62 00 10 lw r2,(r11+16) 800f468: f8 00 22 20 calli 8017ce8 <__umodsi3> RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 800f46c: 29 67 00 20 lw r7,(r11+32) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800f470: c9 81 18 00 sub r3,r12,r1 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 800f474: 34 01 00 00 mvi r1,0 800f478: 54 e3 00 03 bgu r7,r3,800f484 <_Heap_Free+0x44> 800f47c: 29 61 00 24 lw r1,(r11+36) 800f480: f0 23 08 00 cmpgeu r1,r1,r3 } alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { 800f484: b8 20 10 00 mv r2,r1 return false; 800f488: 34 01 00 00 mvi r1,0 } alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { 800f48c: 44 40 00 66 be r2,r0,800f624 <_Heap_Free+0x1e4> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800f490: 28 66 00 04 lw r6,(r3+4) - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 800f494: 34 04 ff fe mvi r4,-2 800f498: a0 c4 20 00 and r4,r6,r4 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800f49c: b4 64 10 00 add r2,r3,r4 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 800f4a0: 54 e2 00 03 bgu r7,r2,800f4ac <_Heap_Free+0x6c> <== NEVER TAKEN 800f4a4: 29 61 00 24 lw r1,(r11+36) 800f4a8: f0 22 08 00 cmpgeu r1,r1,r2 _Heap_Protection_block_check( heap, block ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 800f4ac: b8 20 28 00 mv r5,r1 return false; 800f4b0: 34 01 00 00 mvi r1,0 _Heap_Protection_block_check( heap, block ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 800f4b4: 44 a0 00 5c be r5,r0,800f624 <_Heap_Free+0x1e4> <== NEVER TAKEN --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800f4b8: 28 45 00 04 lw r5,(r2+4) block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 800f4bc: 20 a8 00 01 andi r8,r5,0x1 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 800f4c0: 45 00 00 59 be r8,r0,800f624 <_Heap_Free+0x1e4> if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 800f4c4: 29 69 00 24 lw r9,(r11+36) - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 800f4c8: 34 01 ff fe mvi r1,-2 800f4cc: a0 a1 28 00 and r5,r5,r1 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 800f4d0: 34 08 00 00 mvi r8,0 800f4d4: 45 22 00 05 be r9,r2,800f4e8 <_Heap_Free+0xa8> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800f4d8: b4 45 08 00 add r1,r2,r5 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 800f4dc: 28 28 00 04 lw r8,(r1+4) 800f4e0: 21 08 00 01 andi r8,r8,0x1 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 800f4e4: 65 08 00 00 cmpei r8,r8,0 800f4e8: 20 c6 00 01 andi r6,r6,0x1 if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 800f4ec: 21 08 00 ff andi r8,r8,0xff && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 800f4f0: 5c c0 00 24 bne r6,r0,800f580 <_Heap_Free+0x140> uintptr_t const prev_size = block->prev_size; 800f4f4: 28 66 00 00 lw r6,(r3+0) const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 800f4f8: 34 01 00 00 mvi r1,0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800f4fc: c8 66 18 00 sub r3,r3,r6 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 800f500: 54 e3 00 02 bgu r7,r3,800f508 <_Heap_Free+0xc8> <== NEVER TAKEN 800f504: f1 23 08 00 cmpgeu r1,r9,r3 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 800f508: b8 20 38 00 mv r7,r1 _HAssert( false ); return( false ); 800f50c: 34 01 00 00 mvi r1,0 if ( !_Heap_Is_prev_used( block ) ) { uintptr_t const prev_size = block->prev_size; Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 800f510: 44 e0 00 45 be r7,r0,800f624 <_Heap_Free+0x1e4> <== NEVER TAKEN block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 800f514: 28 67 00 04 lw r7,(r3+4) 800f518: 20 e7 00 01 andi r7,r7,0x1 return( false ); } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { 800f51c: 44 e0 00 42 be r7,r0,800f624 <_Heap_Free+0x1e4> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 800f520: 45 00 00 0f be r8,r0,800f55c <_Heap_Free+0x11c> return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 800f524: 28 41 00 08 lw r1,(r2+8) Heap_Block *prev = block->prev; 800f528: 28 42 00 0c lw r2,(r2+12) uintptr_t const size = block_size + prev_size + next_block_size; 800f52c: b4 85 28 00 add r5,r4,r5 800f530: b4 a6 30 00 add r6,r5,r6 prev->next = next; 800f534: 58 41 00 08 sw (r2+8),r1 next->prev = prev; 800f538: 58 22 00 0c sw (r1+12),r2 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 800f53c: 29 61 00 38 lw r1,(r11+56) 800f540: 34 21 ff ff addi r1,r1,-1 800f544: 59 61 00 38 sw (r11+56),r1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800f548: 38 c1 00 01 ori r1,r6,0x1 800f54c: 58 61 00 04 sw (r3+4),r1 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 800f550: b4 66 18 00 add r3,r3,r6 800f554: 58 66 00 00 sw (r3+0),r6 800f558: e0 00 00 29 bi 800f5fc <_Heap_Free+0x1bc> } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 800f55c: b4 86 30 00 add r6,r4,r6 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800f560: 38 c1 00 01 ori r1,r6,0x1 800f564: 58 61 00 04 sw (r3+4),r1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800f568: 28 43 00 04 lw r3,(r2+4) 800f56c: 34 01 ff fe mvi r1,-2 next_block->prev_size = size; 800f570: 58 46 00 00 sw (r2+0),r6 _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800f574: a0 61 08 00 and r1,r3,r1 800f578: 58 41 00 04 sw (r2+4),r1 800f57c: e0 00 00 20 bi 800f5fc <_Heap_Free+0x1bc> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 800f580: 45 00 00 0d be r8,r0,800f5b4 <_Heap_Free+0x174> uintptr_t const size = block_size + next_block_size; 800f584: b4 a4 08 00 add r1,r5,r4 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 800f588: 28 45 00 08 lw r5,(r2+8) Heap_Block *prev = old_block->prev; 800f58c: 28 42 00 0c lw r2,(r2+12) new_block->next = next; 800f590: 58 65 00 08 sw (r3+8),r5 new_block->prev = prev; 800f594: 58 62 00 0c sw (r3+12),r2 next->prev = new_block; prev->next = new_block; 800f598: 58 43 00 08 sw (r2+8),r3 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800f59c: 38 22 00 01 ori r2,r1,0x1 Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 800f5a0: 58 a3 00 0c sw (r5+12),r3 800f5a4: 58 62 00 04 sw (r3+4),r2 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 800f5a8: b4 61 18 00 add r3,r3,r1 800f5ac: 58 61 00 00 sw (r3+0),r1 800f5b0: e0 00 00 13 bi 800f5fc <_Heap_Free+0x1bc> RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 800f5b4: 29 61 00 08 lw r1,(r11+8) new_block->next = next; new_block->prev = block_before; 800f5b8: 58 6b 00 0c sw (r3+12),r11 /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; 800f5bc: 58 44 00 00 sw (r2+0),r4 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 800f5c0: 58 61 00 08 sw (r3+8),r1 new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 800f5c4: 58 23 00 0c sw (r1+12),r3 next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 800f5c8: 38 81 00 01 ori r1,r4,0x1 800f5cc: 58 61 00 04 sw (r3+4),r1 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 800f5d0: 59 63 00 08 sw (r11+8),r3 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800f5d4: 28 43 00 04 lw r3,(r2+4) 800f5d8: 34 01 ff fe mvi r1,-2 800f5dc: a0 61 08 00 and r1,r3,r1 800f5e0: 58 41 00 04 sw (r2+4),r1 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 800f5e4: 29 61 00 38 lw r1,(r11+56) if ( stats->max_free_blocks < stats->free_blocks ) { 800f5e8: 29 62 00 3c lw r2,(r11+60) block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 800f5ec: 34 21 00 01 addi r1,r1,1 800f5f0: 59 61 00 38 sw (r11+56),r1 if ( stats->max_free_blocks < stats->free_blocks ) { 800f5f4: 50 41 00 02 bgeu r2,r1,800f5fc <_Heap_Free+0x1bc> stats->max_free_blocks = stats->free_blocks; 800f5f8: 59 61 00 3c sw (r11+60),r1 } } /* Statistics */ --stats->used_blocks; 800f5fc: 29 61 00 40 lw r1,(r11+64) 800f600: 34 21 ff ff addi r1,r1,-1 800f604: 59 61 00 40 sw (r11+64),r1 ++stats->frees; 800f608: 29 61 00 50 lw r1,(r11+80) 800f60c: 34 21 00 01 addi r1,r1,1 800f610: 59 61 00 50 sw (r11+80),r1 stats->free_size += block_size; 800f614: 29 61 00 30 lw r1,(r11+48) 800f618: b4 24 20 00 add r4,r1,r4 800f61c: 59 64 00 30 sw (r11+48),r4 return( true ); 800f620: 34 01 00 01 mvi r1,1 } 800f624: 2b 9d 00 04 lw ra,(sp+4) 800f628: 2b 8b 00 0c lw r11,(sp+12) 800f62c: 2b 8c 00 08 lw r12,(sp+8) 800f630: 37 9c 00 0c addi sp,sp,12 800f634: c3 a0 00 00 ret =============================================================================== 08006ddc <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 8006ddc: 37 9c ff e4 addi sp,sp,-28 8006de0: 5b 8b 00 1c sw (sp+28),r11 8006de4: 5b 8c 00 18 sw (sp+24),r12 8006de8: 5b 8d 00 14 sw (sp+20),r13 8006dec: 5b 8e 00 10 sw (sp+16),r14 8006df0: 5b 8f 00 0c sw (sp+12),r15 8006df4: 5b 90 00 08 sw (sp+8),r16 8006df8: 5b 9d 00 04 sw (sp+4),ra Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 8006dfc: 34 0b 00 00 mvi r11,0 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 8006e00: b8 20 68 00 mv r13,r1 8006e04: b8 60 78 00 mv r15,r3 Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 8006e08: b8 40 70 00 mv r14,r2 Heap_Block *allocated_blocks = NULL; 8006e0c: 34 0c 00 00 mvi r12,0 Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 8006e10: e0 00 00 0f bi 8006e4c <_Heap_Greedy_allocate+0x70> * @brief See _Heap_Allocate_aligned_with_boundary() with alignment and * boundary equals zero. */ RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 8006e14: 29 c2 00 00 lw r2,(r14+0) 8006e18: b9 a0 08 00 mv r1,r13 8006e1c: 34 03 00 00 mvi r3,0 8006e20: 34 04 00 00 mvi r4,0 8006e24: f8 00 23 2f calli 800fae0 <_Heap_Allocate_aligned_with_boundary> void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 8006e28: 44 20 00 07 be r1,r0,8006e44 <_Heap_Greedy_allocate+0x68> <== NEVER TAKEN RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8006e2c: 29 a2 00 10 lw r2,(r13+16) 8006e30: 34 30 ff f8 addi r16,r1,-8 8006e34: f8 00 45 f5 calli 8018608 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 8006e38: ca 01 08 00 sub r1,r16,r1 Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; 8006e3c: 58 2c 00 08 sw (r1+8),r12 8006e40: b8 20 60 00 mv r12,r1 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 8006e44: 35 6b 00 01 addi r11,r11,1 8006e48: 35 ce 00 04 addi r14,r14,4 8006e4c: 55 eb ff f2 bgu r15,r11,8006e14 <_Heap_Greedy_allocate+0x38> 8006e50: 34 0e 00 00 mvi r14,0 } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8006e54: 34 0f ff fe mvi r15,-2 8006e58: e0 00 00 0a bi 8006e80 <_Heap_Greedy_allocate+0xa4> 8006e5c: 29 64 00 04 lw r4,(r11+4) allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { _Heap_Block_allocate( 8006e60: b9 a0 08 00 mv r1,r13 8006e64: b9 60 10 00 mv r2,r11 8006e68: a1 e4 20 00 and r4,r15,r4 8006e6c: 35 63 00 08 addi r3,r11,8 8006e70: 34 84 ff f8 addi r4,r4,-8 8006e74: f8 00 01 09 calli 8007298 <_Heap_Block_allocate> current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 8006e78: 59 6e 00 08 sw (r11+8),r14 8006e7c: b9 60 70 00 mv r14,r11 Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 8006e80: 29 ab 00 08 lw r11,(r13+8) next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 8006e84: 5d 6d ff f6 bne r11,r13,8006e5c <_Heap_Greedy_allocate+0x80> 8006e88: e0 00 00 06 bi 8006ea0 <_Heap_Greedy_allocate+0xc4> blocks = current; } while ( allocated_blocks != NULL ) { current = allocated_blocks; allocated_blocks = allocated_blocks->next; 8006e8c: 29 8b 00 08 lw r11,(r12+8) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 8006e90: 35 82 00 08 addi r2,r12,8 8006e94: b9 a0 08 00 mv r1,r13 8006e98: f8 00 23 98 calli 800fcf8 <_Heap_Free> blocks = current; } while ( allocated_blocks != NULL ) { current = allocated_blocks; allocated_blocks = allocated_blocks->next; 8006e9c: b9 60 60 00 mv r12,r11 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 8006ea0: 5d 80 ff fb bne r12,r0,8006e8c <_Heap_Greedy_allocate+0xb0> allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 8006ea4: b9 c0 08 00 mv r1,r14 8006ea8: 2b 9d 00 04 lw ra,(sp+4) 8006eac: 2b 8b 00 1c lw r11,(sp+28) 8006eb0: 2b 8c 00 18 lw r12,(sp+24) 8006eb4: 2b 8d 00 14 lw r13,(sp+20) 8006eb8: 2b 8e 00 10 lw r14,(sp+16) 8006ebc: 2b 8f 00 0c lw r15,(sp+12) 8006ec0: 2b 90 00 08 lw r16,(sp+8) 8006ec4: 37 9c 00 1c addi sp,sp,28 8006ec8: c3 a0 00 00 ret =============================================================================== 080104c4 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 80104c4: 37 9c ff e8 addi sp,sp,-24 80104c8: 5b 8b 00 18 sw (sp+24),r11 80104cc: 5b 8c 00 14 sw (sp+20),r12 80104d0: 5b 8d 00 10 sw (sp+16),r13 80104d4: 5b 8e 00 0c sw (sp+12),r14 80104d8: 5b 8f 00 08 sw (sp+8),r15 80104dc: 5b 9d 00 04 sw (sp+4),ra 80104e0: b8 20 28 00 mv r5,r1 80104e4: b8 40 78 00 mv r15,r2 80104e8: b8 60 70 00 mv r14,r3 Heap_Block *current = heap->first_block; 80104ec: 28 21 00 20 lw r1,(r1+32) Heap_Block *end = heap->last_block; 80104f0: 28 ad 00 24 lw r13,(r5+36) 80104f4: 34 0c ff fe mvi r12,-2 80104f8: e0 00 00 0a bi 8010520 <_Heap_Iterate+0x5c> 80104fc: 28 22 00 04 lw r2,(r1+4) while ( !stop && current != end ) { uintptr_t size = _Heap_Block_size( current ); Heap_Block *next = _Heap_Block_at( current, size ); bool used = _Heap_Is_prev_used( next ); stop = (*visitor)( current, size, used, visitor_arg ); 8010500: b9 c0 20 00 mv r4,r14 8010504: a1 82 10 00 and r2,r12,r2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8010508: b4 22 58 00 add r11,r1,r2 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 801050c: 29 63 00 04 lw r3,(r11+4) 8010510: 20 63 00 01 andi r3,r3,0x1 8010514: d9 e0 00 00 call r15 { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 8010518: 5c 20 00 03 bne r1,r0,8010524 <_Heap_Iterate+0x60> <== NEVER TAKEN 801051c: b9 60 08 00 mv r1,r11 8010520: 5c 2d ff f7 bne r1,r13,80104fc <_Heap_Iterate+0x38> stop = (*visitor)( current, size, used, visitor_arg ); current = next; } } 8010524: 2b 9d 00 04 lw ra,(sp+4) 8010528: 2b 8b 00 18 lw r11,(sp+24) 801052c: 2b 8c 00 14 lw r12,(sp+20) 8010530: 2b 8d 00 10 lw r13,(sp+16) 8010534: 2b 8e 00 0c lw r14,(sp+12) 8010538: 2b 8f 00 08 lw r15,(sp+8) 801053c: 37 9c 00 18 addi sp,sp,24 8010540: c3 a0 00 00 ret =============================================================================== 0800f794 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 800f794: 37 9c ff ec addi sp,sp,-20 800f798: 5b 8b 00 14 sw (sp+20),r11 800f79c: 5b 8c 00 10 sw (sp+16),r12 800f7a0: 5b 8d 00 0c sw (sp+12),r13 800f7a4: 5b 8e 00 08 sw (sp+8),r14 800f7a8: 5b 9d 00 04 sw (sp+4),ra 800f7ac: b8 20 58 00 mv r11,r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800f7b0: 34 4e ff f8 addi r14,r2,-8 800f7b4: b8 40 08 00 mv r1,r2 800f7b8: b8 40 60 00 mv r12,r2 800f7bc: 29 62 00 10 lw r2,(r11+16) 800f7c0: b8 60 68 00 mv r13,r3 800f7c4: f8 00 21 49 calli 8017ce8 <__umodsi3> RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 800f7c8: 29 62 00 20 lw r2,(r11+32) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800f7cc: c9 c1 20 00 sub r4,r14,r1 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 800f7d0: 34 01 00 00 mvi r1,0 800f7d4: 54 44 00 03 bgu r2,r4,800f7e0 <_Heap_Size_of_alloc_area+0x4c> 800f7d8: 29 61 00 24 lw r1,(r11+36) 800f7dc: f0 24 08 00 cmpgeu r1,r1,r4 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 800f7e0: b8 20 18 00 mv r3,r1 return false; 800f7e4: 34 01 00 00 mvi r1,0 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 800f7e8: 44 60 00 13 be r3,r0,800f834 <_Heap_Size_of_alloc_area+0xa0> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 800f7ec: 28 83 00 04 lw r3,(r4+4) 800f7f0: 34 01 ff fe mvi r1,-2 800f7f4: a0 23 08 00 and r1,r1,r3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800f7f8: b4 81 20 00 add r4,r4,r1 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 800f7fc: 34 01 00 00 mvi r1,0 800f800: 54 44 00 03 bgu r2,r4,800f80c <_Heap_Size_of_alloc_area+0x78><== NEVER TAKEN 800f804: 29 61 00 24 lw r1,(r11+36) 800f808: f0 24 08 00 cmpgeu r1,r1,r4 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 800f80c: b8 20 10 00 mv r2,r1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 800f810: 34 01 00 00 mvi r1,0 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 800f814: 44 40 00 08 be r2,r0,800f834 <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 800f818: 28 82 00 04 lw r2,(r4+4) 800f81c: 20 42 00 01 andi r2,r2,0x1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 800f820: 44 40 00 05 be r2,r0,800f834 <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 800f824: c8 8c 20 00 sub r4,r4,r12 800f828: 34 84 00 04 addi r4,r4,4 800f82c: 59 a4 00 00 sw (r13+0),r4 return true; 800f830: 34 01 00 01 mvi r1,1 } 800f834: 2b 9d 00 04 lw ra,(sp+4) 800f838: 2b 8b 00 14 lw r11,(sp+20) 800f83c: 2b 8c 00 10 lw r12,(sp+16) 800f840: 2b 8d 00 0c lw r13,(sp+12) 800f844: 2b 8e 00 08 lw r14,(sp+8) 800f848: 37 9c 00 14 addi sp,sp,20 800f84c: c3 a0 00 00 ret =============================================================================== 080054dc <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 80054dc: 37 9c ff a0 addi sp,sp,-96 80054e0: 5b 8b 00 50 sw (sp+80),r11 80054e4: 5b 8c 00 4c sw (sp+76),r12 80054e8: 5b 8d 00 48 sw (sp+72),r13 80054ec: 5b 8e 00 44 sw (sp+68),r14 80054f0: 5b 8f 00 40 sw (sp+64),r15 80054f4: 5b 90 00 3c sw (sp+60),r16 80054f8: 5b 91 00 38 sw (sp+56),r17 80054fc: 5b 92 00 34 sw (sp+52),r18 8005500: 5b 93 00 30 sw (sp+48),r19 8005504: 5b 94 00 2c sw (sp+44),r20 8005508: 5b 95 00 28 sw (sp+40),r21 800550c: 5b 96 00 24 sw (sp+36),r22 8005510: 5b 97 00 20 sw (sp+32),r23 8005514: 5b 98 00 1c sw (sp+28),r24 8005518: 5b 99 00 18 sw (sp+24),r25 800551c: 5b 9b 00 14 sw (sp+20),fp 8005520: 5b 9d 00 10 sw (sp+16),ra uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8005524: 78 0d 08 00 mvhi r13,0x800 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8005528: 20 63 00 ff andi r3,r3,0xff 800552c: b8 20 60 00 mv r12,r1 8005530: b8 40 70 00 mv r14,r2 uintptr_t const page_size = heap->page_size; 8005534: 28 33 00 10 lw r19,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8005538: 28 35 00 14 lw r21,(r1+20) Heap_Block *const first_block = heap->first_block; 800553c: 28 34 00 20 lw r20,(r1+32) Heap_Block *const last_block = heap->last_block; 8005540: 28 36 00 24 lw r22,(r1+36) Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8005544: 39 ad 54 44 ori r13,r13,0x5444 8005548: 44 60 00 03 be r3,r0,8005554 <_Heap_Walk+0x78> 800554c: 78 0d 08 00 mvhi r13,0x800 8005550: 39 ad 54 68 ori r13,r13,0x5468 if ( !_System_state_Is_up( _System_state_Get() ) ) { 8005554: 78 03 08 01 mvhi r3,0x801 8005558: 38 63 7e 00 ori r3,r3,0x7e00 800555c: 28 67 00 00 lw r7,(r3+0) 8005560: 34 02 00 03 mvi r2,3 return true; 8005564: 34 03 00 01 mvi r3,1 Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 8005568: 5c e2 01 08 bne r7,r2,8005988 <_Heap_Walk+0x4ac> Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; (*printer)( 800556c: 29 81 00 08 lw r1,(r12+8) 8005570: 29 86 00 18 lw r6,(r12+24) 8005574: 29 87 00 1c lw r7,(r12+28) 8005578: 5b 81 00 08 sw (sp+8),r1 800557c: 29 81 00 0c lw r1,(r12+12) 8005580: 78 03 08 01 mvhi r3,0x801 8005584: 5b 96 00 04 sw (sp+4),r22 8005588: 5b 81 00 0c sw (sp+12),r1 800558c: 34 02 00 00 mvi r2,0 8005590: b9 c0 08 00 mv r1,r14 8005594: 38 63 48 4c ori r3,r3,0x484c 8005598: ba 60 20 00 mv r4,r19 800559c: ba a0 28 00 mv r5,r21 80055a0: ba 80 40 00 mv r8,r20 80055a4: d9 a0 00 00 call r13 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 80055a8: 5e 60 00 06 bne r19,r0,80055c0 <_Heap_Walk+0xe4> (*printer)( source, true, "page size is zero\n" ); 80055ac: 78 03 08 01 mvhi r3,0x801 80055b0: b9 c0 08 00 mv r1,r14 80055b4: 34 02 00 01 mvi r2,1 80055b8: 38 63 48 e0 ori r3,r3,0x48e0 80055bc: e0 00 00 25 bi 8005650 <_Heap_Walk+0x174> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 80055c0: 22 6f 00 03 andi r15,r19,0x3 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 80055c4: 45 e0 00 07 be r15,r0,80055e0 <_Heap_Walk+0x104> (*printer)( 80055c8: 78 03 08 01 mvhi r3,0x801 80055cc: b9 c0 08 00 mv r1,r14 80055d0: 34 02 00 01 mvi r2,1 80055d4: 38 63 48 f4 ori r3,r3,0x48f4 80055d8: ba 60 20 00 mv r4,r19 80055dc: e0 00 01 04 bi 80059ec <_Heap_Walk+0x510> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 80055e0: ba a0 08 00 mv r1,r21 80055e4: ba 60 10 00 mv r2,r19 80055e8: fb ff ed 70 calli 8000ba8 <__umodsi3> 80055ec: b8 20 58 00 mv r11,r1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 80055f0: 44 2f 00 07 be r1,r15,800560c <_Heap_Walk+0x130> (*printer)( 80055f4: 78 03 08 01 mvhi r3,0x801 80055f8: b9 c0 08 00 mv r1,r14 80055fc: 34 02 00 01 mvi r2,1 8005600: 38 63 49 14 ori r3,r3,0x4914 8005604: ba a0 20 00 mv r4,r21 8005608: e0 00 00 f9 bi 80059ec <_Heap_Walk+0x510> 800560c: 36 81 00 08 addi r1,r20,8 8005610: ba 60 10 00 mv r2,r19 8005614: fb ff ed 65 calli 8000ba8 <__umodsi3> ); return false; } if ( 8005618: 44 2b 00 07 be r1,r11,8005634 <_Heap_Walk+0x158> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 800561c: 78 03 08 01 mvhi r3,0x801 8005620: b9 c0 08 00 mv r1,r14 8005624: 34 02 00 01 mvi r2,1 8005628: 38 63 49 38 ori r3,r3,0x4938 800562c: ba 80 20 00 mv r4,r20 8005630: e0 00 00 ef bi 80059ec <_Heap_Walk+0x510> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 8005634: 2a 82 00 04 lw r2,(r20+4) 8005638: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 800563c: 5c 41 00 07 bne r2,r1,8005658 <_Heap_Walk+0x17c> (*printer)( 8005640: 78 03 08 01 mvhi r3,0x801 8005644: b9 c0 08 00 mv r1,r14 8005648: 34 02 00 01 mvi r2,1 800564c: 38 63 49 6c ori r3,r3,0x496c 8005650: d9 a0 00 00 call r13 8005654: e0 00 00 40 bi 8005754 <_Heap_Walk+0x278> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8005658: 2a cf 00 04 lw r15,(r22+4) 800565c: 34 02 ff fe mvi r2,-2 8005660: a0 4f 78 00 and r15,r2,r15 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8005664: b6 cf 78 00 add r15,r22,r15 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 8005668: 29 e2 00 04 lw r2,(r15+4) 800566c: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( _Heap_Is_free( last_block ) ) { 8005670: 5c 41 00 06 bne r2,r1,8005688 <_Heap_Walk+0x1ac> (*printer)( 8005674: 78 03 08 01 mvhi r3,0x801 8005678: b9 c0 08 00 mv r1,r14 800567c: 34 02 00 01 mvi r2,1 8005680: 38 63 49 9c ori r3,r3,0x499c 8005684: e3 ff ff f3 bi 8005650 <_Heap_Walk+0x174> ); return false; } if ( 8005688: 45 f4 00 06 be r15,r20,80056a0 <_Heap_Walk+0x1c4> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 800568c: 78 03 08 01 mvhi r3,0x801 8005690: b9 c0 08 00 mv r1,r14 8005694: 34 02 00 01 mvi r2,1 8005698: 38 63 49 b4 ori r3,r3,0x49b4 800569c: e3 ff ff ed bi 8005650 <_Heap_Walk+0x174> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 80056a0: 29 92 00 10 lw r18,(r12+16) block = next_block; } while ( block != first_block ); return true; } 80056a4: 29 8b 00 08 lw r11,(r12+8) Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 80056a8: b9 80 80 00 mv r16,r12 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 80056ac: 34 11 ff fe mvi r17,-2 80056b0: e0 00 00 2d bi 8005764 <_Heap_Walk+0x288> const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 80056b4: 29 83 00 20 lw r3,(r12+32) 80056b8: 34 01 00 00 mvi r1,0 80056bc: 54 6b 00 03 bgu r3,r11,80056c8 <_Heap_Walk+0x1ec> 80056c0: 29 81 00 24 lw r1,(r12+36) 80056c4: f0 2b 08 00 cmpgeu r1,r1,r11 const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 80056c8: 5c 20 00 06 bne r1,r0,80056e0 <_Heap_Walk+0x204> (*printer)( 80056cc: 78 03 08 01 mvhi r3,0x801 80056d0: b9 c0 08 00 mv r1,r14 80056d4: 34 02 00 01 mvi r2,1 80056d8: 38 63 49 e4 ori r3,r3,0x49e4 80056dc: e0 00 00 14 bi 800572c <_Heap_Walk+0x250> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 80056e0: 35 61 00 08 addi r1,r11,8 80056e4: ba 40 10 00 mv r2,r18 80056e8: fb ff ed 30 calli 8000ba8 <__umodsi3> ); return false; } if ( 80056ec: 44 20 00 06 be r1,r0,8005704 <_Heap_Walk+0x228> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 80056f0: 78 03 08 01 mvhi r3,0x801 80056f4: b9 c0 08 00 mv r1,r14 80056f8: 34 02 00 01 mvi r2,1 80056fc: 38 63 4a 04 ori r3,r3,0x4a04 8005700: e0 00 00 0b bi 800572c <_Heap_Walk+0x250> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8005704: 29 63 00 04 lw r3,(r11+4) 8005708: a2 23 18 00 and r3,r17,r3 block = next_block; } while ( block != first_block ); return true; } 800570c: b5 63 18 00 add r3,r11,r3 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 8005710: 28 63 00 04 lw r3,(r3+4) 8005714: 20 63 00 01 andi r3,r3,0x1 ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005718: 44 61 00 07 be r3,r1,8005734 <_Heap_Walk+0x258> (*printer)( 800571c: 78 03 08 01 mvhi r3,0x801 8005720: b9 c0 08 00 mv r1,r14 8005724: 34 02 00 01 mvi r2,1 8005728: 38 63 4a 34 ori r3,r3,0x4a34 800572c: b9 60 20 00 mv r4,r11 8005730: e0 00 00 af bi 80059ec <_Heap_Walk+0x510> ); return false; } if ( free_block->prev != prev_block ) { 8005734: 29 65 00 0c lw r5,(r11+12) 8005738: 44 b0 00 09 be r5,r16,800575c <_Heap_Walk+0x280> (*printer)( 800573c: 78 03 08 01 mvhi r3,0x801 8005740: b9 c0 08 00 mv r1,r14 8005744: 34 02 00 01 mvi r2,1 8005748: 38 63 4a 50 ori r3,r3,0x4a50 800574c: b9 60 20 00 mv r4,r11 8005750: d9 a0 00 00 call r13 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005754: 34 03 00 00 mvi r3,0 8005758: e0 00 00 8c bi 8005988 <_Heap_Walk+0x4ac> return false; } prev_block = free_block; free_block = free_block->next; 800575c: b9 60 80 00 mv r16,r11 8005760: 29 6b 00 08 lw r11,(r11+8) const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 8005764: 5d 6c ff d4 bne r11,r12,80056b4 <_Heap_Walk+0x1d8> 8005768: e0 00 00 03 bi 8005774 <_Heap_Walk+0x298> block->prev_size ); } block = next_block; } while ( block != first_block ); 800576c: ba 20 78 00 mv r15,r17 8005770: e0 00 00 15 bi 80057c4 <_Heap_Walk+0x2e8> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8005774: 78 01 08 01 mvhi r1,0x801 8005778: 38 21 4c 00 ori r1,r1,0x4c00 800577c: 5b 81 00 54 sw (sp+84),r1 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 8005780: 78 01 08 01 mvhi r1,0x801 8005784: 38 21 4b e8 ori r1,r1,0x4be8 8005788: 5b 81 00 58 sw (sp+88),r1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 800578c: 78 01 08 01 mvhi r1,0x801 8005790: 38 21 48 14 ori r1,r1,0x4814 8005794: 5b 81 00 5c sw (sp+92),r1 8005798: 78 01 08 01 mvhi r1,0x801 800579c: 38 21 48 30 ori r1,r1,0x4830 80057a0: 78 1b 08 01 mvhi fp,0x801 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 80057a4: 78 17 08 01 mvhi r23,0x801 80057a8: 78 19 08 01 mvhi r25,0x801 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 80057ac: 78 18 08 01 mvhi r24,0x801 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 80057b0: 5b 81 00 60 sw (sp+96),r1 80057b4: 3b 7b 4b 44 ori fp,fp,0x4b44 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 80057b8: 3a f7 4b b4 ori r23,r23,0x4bb4 80057bc: 3b 39 48 40 ori r25,r25,0x4840 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 80057c0: 3b 18 48 24 ori r24,r24,0x4824 block = next_block; } while ( block != first_block ); return true; } 80057c4: 29 f2 00 04 lw r18,(r15+4) - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 80057c8: 34 01 ff fe mvi r1,-2 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 80057cc: 29 84 00 20 lw r4,(r12+32) - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 80057d0: a2 41 80 00 and r16,r18,r1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 80057d4: b5 f0 88 00 add r17,r15,r16 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 80057d8: 34 06 00 00 mvi r6,0 80057dc: 54 91 00 03 bgu r4,r17,80057e8 <_Heap_Walk+0x30c> <== NEVER TAKEN 80057e0: 29 86 00 24 lw r6,(r12+36) 80057e4: f0 d1 30 00 cmpgeu r6,r6,r17 bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 80057e8: 5c c0 00 06 bne r6,r0,8005800 <_Heap_Walk+0x324> (*printer)( 80057ec: 78 03 08 01 mvhi r3,0x801 80057f0: b9 c0 08 00 mv r1,r14 80057f4: 34 02 00 01 mvi r2,1 80057f8: 38 63 4a 84 ori r3,r3,0x4a84 80057fc: e0 00 00 1f bi 8005878 <_Heap_Walk+0x39c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005800: ba 00 08 00 mv r1,r16 8005804: ba 60 10 00 mv r2,r19 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; 8005808: fd f6 58 00 cmpne r11,r15,r22 800580c: fb ff ec e7 calli 8000ba8 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 8005810: 44 20 00 09 be r1,r0,8005834 <_Heap_Walk+0x358> 8005814: 45 60 00 08 be r11,r0,8005834 <_Heap_Walk+0x358> (*printer)( 8005818: 78 03 08 01 mvhi r3,0x801 800581c: b9 c0 08 00 mv r1,r14 8005820: 34 02 00 01 mvi r2,1 8005824: 38 63 4a b4 ori r3,r3,0x4ab4 8005828: b9 e0 20 00 mv r4,r15 800582c: ba 00 28 00 mv r5,r16 8005830: e3 ff ff c8 bi 8005750 <_Heap_Walk+0x274> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 8005834: 52 15 00 0b bgeu r16,r21,8005860 <_Heap_Walk+0x384> 8005838: 45 60 00 0a be r11,r0,8005860 <_Heap_Walk+0x384> <== NEVER TAKEN (*printer)( 800583c: 78 03 08 01 mvhi r3,0x801 8005840: b9 c0 08 00 mv r1,r14 8005844: 34 02 00 01 mvi r2,1 8005848: 38 63 4a e4 ori r3,r3,0x4ae4 800584c: b9 e0 20 00 mv r4,r15 8005850: ba 00 28 00 mv r5,r16 8005854: ba a0 30 00 mv r6,r21 8005858: d9 a0 00 00 call r13 800585c: e3 ff ff be bi 8005754 <_Heap_Walk+0x278> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 8005860: 56 2f 00 09 bgu r17,r15,8005884 <_Heap_Walk+0x3a8> 8005864: 45 60 00 08 be r11,r0,8005884 <_Heap_Walk+0x3a8> (*printer)( 8005868: 78 03 08 01 mvhi r3,0x801 800586c: b9 c0 08 00 mv r1,r14 8005870: 34 02 00 01 mvi r2,1 8005874: 38 63 4b 10 ori r3,r3,0x4b10 8005878: b9 e0 20 00 mv r4,r15 800587c: ba 20 28 00 mv r5,r17 8005880: e3 ff ff b4 bi 8005750 <_Heap_Walk+0x274> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 8005884: 2a 24 00 04 lw r4,(r17+4) 8005888: 22 52 00 01 andi r18,r18,0x1 800588c: 20 84 00 01 andi r4,r4,0x1 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 8005890: 5c 80 00 2d bne r4,r0,8005944 <_Heap_Walk+0x468> false, "block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n", block, block_size, block->prev, block->prev == first_free_block ? 8005894: 29 e6 00 0c lw r6,(r15+12) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8005898: 29 85 00 08 lw r5,(r12+8) block = next_block; } while ( block != first_block ); return true; } 800589c: 29 84 00 0c lw r4,(r12+12) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 80058a0: 2b 87 00 5c lw r7,(sp+92) 80058a4: 44 c5 00 04 be r6,r5,80058b4 <_Heap_Walk+0x3d8> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 80058a8: ba e0 38 00 mv r7,r23 80058ac: 5c cc 00 02 bne r6,r12,80058b4 <_Heap_Walk+0x3d8> 80058b0: bb 00 38 00 mv r7,r24 block->next, block->next == last_free_block ? 80058b4: 29 e8 00 08 lw r8,(r15+8) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 80058b8: 2b 89 00 60 lw r9,(sp+96) 80058bc: 45 04 00 04 be r8,r4,80058cc <_Heap_Walk+0x3f0> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 80058c0: ba e0 48 00 mv r9,r23 80058c4: 5d 0c 00 02 bne r8,r12,80058cc <_Heap_Walk+0x3f0> 80058c8: bb 20 48 00 mv r9,r25 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 80058cc: 5b 89 00 04 sw (sp+4),r9 80058d0: b9 c0 08 00 mv r1,r14 80058d4: 34 02 00 00 mvi r2,0 80058d8: bb 60 18 00 mv r3,fp 80058dc: b9 e0 20 00 mv r4,r15 80058e0: ba 00 28 00 mv r5,r16 80058e4: d9 a0 00 00 call r13 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 80058e8: 2a 26 00 00 lw r6,(r17+0) 80058ec: 46 06 00 0a be r16,r6,8005914 <_Heap_Walk+0x438> (*printer)( 80058f0: 78 03 08 01 mvhi r3,0x801 80058f4: b9 c0 08 00 mv r1,r14 80058f8: 34 02 00 01 mvi r2,1 80058fc: 38 63 4b 7c ori r3,r3,0x4b7c 8005900: b9 e0 20 00 mv r4,r15 8005904: ba 00 28 00 mv r5,r16 8005908: ba 20 38 00 mv r7,r17 800590c: d9 a0 00 00 call r13 8005910: e3 ff ff 91 bi 8005754 <_Heap_Walk+0x278> ); return false; } if ( !prev_used ) { 8005914: 5e 40 00 06 bne r18,r0,800592c <_Heap_Walk+0x450> (*printer)( 8005918: 78 03 08 01 mvhi r3,0x801 800591c: b9 c0 08 00 mv r1,r14 8005920: 34 02 00 01 mvi r2,1 8005924: 38 63 4b b8 ori r3,r3,0x4bb8 8005928: e0 00 00 30 bi 80059e8 <_Heap_Walk+0x50c> block = next_block; } while ( block != first_block ); return true; } 800592c: 29 85 00 08 lw r5,(r12+8) 8005930: e0 00 00 03 bi 800593c <_Heap_Walk+0x460> { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { if ( free_block == block ) { 8005934: 44 af 00 13 be r5,r15,8005980 <_Heap_Walk+0x4a4> return true; } free_block = free_block->next; 8005938: 28 a5 00 08 lw r5,(r5+8) ) { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { 800593c: 5c ac ff fe bne r5,r12,8005934 <_Heap_Walk+0x458> 8005940: e0 00 00 26 bi 80059d8 <_Heap_Walk+0x4fc> if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 8005944: 46 40 00 08 be r18,r0,8005964 <_Heap_Walk+0x488> (*printer)( 8005948: 2b 83 00 58 lw r3,(sp+88) 800594c: b9 c0 08 00 mv r1,r14 8005950: 34 02 00 00 mvi r2,0 8005954: b9 e0 20 00 mv r4,r15 8005958: ba 00 28 00 mv r5,r16 800595c: d9 a0 00 00 call r13 8005960: e0 00 00 08 bi 8005980 <_Heap_Walk+0x4a4> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8005964: 2b 83 00 54 lw r3,(sp+84) 8005968: 29 e6 00 00 lw r6,(r15+0) 800596c: b9 c0 08 00 mv r1,r14 8005970: 34 02 00 00 mvi r2,0 8005974: b9 e0 20 00 mv r4,r15 8005978: ba 00 28 00 mv r5,r16 800597c: d9 a0 00 00 call r13 block->prev_size ); } block = next_block; } while ( block != first_block ); 8005980: 5e 91 ff 7b bne r20,r17,800576c <_Heap_Walk+0x290> return true; 8005984: 34 03 00 01 mvi r3,1 } 8005988: b8 60 08 00 mv r1,r3 800598c: 2b 9d 00 10 lw ra,(sp+16) 8005990: 2b 8b 00 50 lw r11,(sp+80) 8005994: 2b 8c 00 4c lw r12,(sp+76) 8005998: 2b 8d 00 48 lw r13,(sp+72) 800599c: 2b 8e 00 44 lw r14,(sp+68) 80059a0: 2b 8f 00 40 lw r15,(sp+64) 80059a4: 2b 90 00 3c lw r16,(sp+60) 80059a8: 2b 91 00 38 lw r17,(sp+56) 80059ac: 2b 92 00 34 lw r18,(sp+52) 80059b0: 2b 93 00 30 lw r19,(sp+48) 80059b4: 2b 94 00 2c lw r20,(sp+44) 80059b8: 2b 95 00 28 lw r21,(sp+40) 80059bc: 2b 96 00 24 lw r22,(sp+36) 80059c0: 2b 97 00 20 lw r23,(sp+32) 80059c4: 2b 98 00 1c lw r24,(sp+28) 80059c8: 2b 99 00 18 lw r25,(sp+24) 80059cc: 2b 9b 00 14 lw fp,(sp+20) 80059d0: 37 9c 00 60 addi sp,sp,96 80059d4: c3 a0 00 00 ret return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 80059d8: 78 03 08 01 mvhi r3,0x801 80059dc: b9 c0 08 00 mv r1,r14 80059e0: 34 02 00 01 mvi r2,1 80059e4: 38 63 4c 28 ori r3,r3,0x4c28 80059e8: b9 e0 20 00 mv r4,r15 80059ec: d9 a0 00 00 call r13 80059f0: e3 ff ff 59 bi 8005754 <_Heap_Walk+0x278> =============================================================================== 08005478 <_IO_Manager_initialization>: #include #include void _IO_Manager_initialization(void) { 8005478: 37 9c ff e8 addi sp,sp,-24 800547c: 5b 8b 00 18 sw (sp+24),r11 8005480: 5b 8c 00 14 sw (sp+20),r12 8005484: 5b 8d 00 10 sw (sp+16),r13 8005488: 5b 8e 00 0c sw (sp+12),r14 800548c: 5b 8f 00 08 sw (sp+8),r15 8005490: 5b 9d 00 04 sw (sp+4),ra uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = rtems_configuration_get_device_driver_table(); 8005494: 78 01 08 01 mvhi r1,0x801 8005498: 38 21 87 ec ori r1,r1,0x87ec drivers_in_table = rtems_configuration_get_number_of_device_drivers(); 800549c: 28 2d 00 38 lw r13,(r1+56) number_of_drivers = rtems_configuration_get_maximum_drivers(); 80054a0: 28 2b 00 34 lw r11,(r1+52) uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = rtems_configuration_get_device_driver_table(); 80054a4: 28 2e 00 3c lw r14,(r1+60) /* * If the user claims there are less drivers than are actually in * the table, then let's just go with the table's count. */ if ( number_of_drivers <= drivers_in_table ) 80054a8: 51 ab 00 03 bgeu r13,r11,80054b4 <_IO_Manager_initialization+0x3c> /* * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { 80054ac: 5d 6d 00 0a bne r11,r13,80054d4 <_IO_Manager_initialization+0x5c><== ALWAYS TAKEN 80054b0: e0 00 00 02 bi 80054b8 <_IO_Manager_initialization+0x40> <== NOT EXECUTED /* * If the user claims there are less drivers than are actually in * the table, then let's just go with the table's count. */ if ( number_of_drivers <= drivers_in_table ) 80054b4: b9 a0 58 00 mv r11,r13 * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { _IO_Driver_address_table = driver_table; 80054b8: 78 01 08 01 mvhi r1,0x801 80054bc: 38 21 b2 b4 ori r1,r1,0xb2b4 80054c0: 58 2e 00 00 sw (r1+0),r14 _IO_Number_of_drivers = number_of_drivers; 80054c4: 78 01 08 01 mvhi r1,0x801 80054c8: 38 21 b2 b0 ori r1,r1,0xb2b0 80054cc: 58 2b 00 00 sw (r1+0),r11 return; 80054d0: e0 00 00 27 bi 800556c <_IO_Manager_initialization+0xf4> * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) 80054d4: 34 02 00 01 mvi r2,1 80054d8: b9 60 08 00 mv r1,r11 80054dc: f8 00 49 19 calli 8017940 <__ashlsi3> 80054e0: 34 02 00 03 mvi r2,3 80054e4: b4 2b 08 00 add r1,r1,r11 80054e8: f8 00 49 16 calli 8017940 <__ashlsi3> 80054ec: b8 20 78 00 mv r15,r1 * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( 80054f0: f8 00 0d ed calli 8008ca4 <_Workspace_Allocate_or_fatal_error> sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 80054f4: 78 02 08 01 mvhi r2,0x801 80054f8: 38 42 b2 b0 ori r2,r2,0xb2b0 /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 80054fc: 78 0c 08 01 mvhi r12,0x801 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 8005500: 58 4b 00 00 sw (r2+0),r11 memset( 8005504: b9 e0 18 00 mv r3,r15 /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 8005508: 39 8c b2 b4 ori r12,r12,0xb2b4 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 800550c: 34 02 00 00 mvi r2,0 /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 8005510: 59 81 00 00 sw (r12+0),r1 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 8005514: f8 00 35 07 calli 8012930 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8005518: 34 03 00 00 mvi r3,0 800551c: 34 04 00 00 mvi r4,0 8005520: e0 00 00 12 bi 8005568 <_IO_Manager_initialization+0xf0> _IO_Driver_address_table[index] = driver_table[index]; 8005524: 29 82 00 00 lw r2,(r12+0) #include #include #include void _IO_Manager_initialization(void) 8005528: b5 c3 08 00 add r1,r14,r3 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; 800552c: 28 29 00 00 lw r9,(r1+0) 8005530: 28 28 00 04 lw r8,(r1+4) 8005534: 28 27 00 08 lw r7,(r1+8) 8005538: 28 26 00 0c lw r6,(r1+12) 800553c: 28 25 00 10 lw r5,(r1+16) 8005540: 28 21 00 14 lw r1,(r1+20) 8005544: b4 43 10 00 add r2,r2,r3 8005548: 58 49 00 00 sw (r2+0),r9 800554c: 58 48 00 04 sw (r2+4),r8 8005550: 58 47 00 08 sw (r2+8),r7 8005554: 58 46 00 0c sw (r2+12),r6 8005558: 58 45 00 10 sw (r2+16),r5 800555c: 58 41 00 14 sw (r2+20),r1 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8005560: 34 84 00 01 addi r4,r4,1 8005564: 34 63 00 18 addi r3,r3,24 8005568: 55 a4 ff ef bgu r13,r4,8005524 <_IO_Manager_initialization+0xac> _IO_Driver_address_table[index] = driver_table[index]; } 800556c: 2b 9d 00 04 lw ra,(sp+4) 8005570: 2b 8b 00 18 lw r11,(sp+24) 8005574: 2b 8c 00 14 lw r12,(sp+20) 8005578: 2b 8d 00 10 lw r13,(sp+16) 800557c: 2b 8e 00 0c lw r14,(sp+12) 8005580: 2b 8f 00 08 lw r15,(sp+8) 8005584: 37 9c 00 18 addi sp,sp,24 8005588: c3 a0 00 00 ret =============================================================================== 080065f4 <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 80065f4: 37 9c ff ec addi sp,sp,-20 80065f8: 5b 8b 00 14 sw (sp+20),r11 80065fc: 5b 8c 00 10 sw (sp+16),r12 8006600: 5b 8d 00 0c sw (sp+12),r13 8006604: 5b 8e 00 08 sw (sp+8),r14 8006608: 5b 9d 00 04 sw (sp+4),ra 800660c: b8 20 58 00 mv r11,r1 * If the application is using the optional manager stubs and * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) 8006610: 28 21 00 18 lw r1,(r1+24) return NULL; 8006614: 34 0c 00 00 mvi r12,0 * If the application is using the optional manager stubs and * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) 8006618: 44 20 00 1e be r1,r0,8006690 <_Objects_Allocate+0x9c> <== NEVER TAKEN /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 800661c: 35 6d 00 20 addi r13,r11,32 8006620: b9 a0 08 00 mv r1,r13 8006624: fb ff fd 23 calli 8005ab0 <_Chain_Get> 8006628: b8 20 60 00 mv r12,r1 800662c: b8 20 70 00 mv r14,r1 if ( information->auto_extend ) { 8006630: 41 61 00 12 lbu r1,(r11+18) 8006634: 44 20 00 17 be r1,r0,8006690 <_Objects_Allocate+0x9c> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 8006638: 5d 80 00 07 bne r12,r0,8006654 <_Objects_Allocate+0x60> _Objects_Extend_information( information ); 800663c: b9 60 08 00 mv r1,r11 8006640: f8 00 00 32 calli 8006708 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 8006644: b9 a0 08 00 mv r1,r13 8006648: fb ff fd 1a calli 8005ab0 <_Chain_Get> 800664c: b8 20 60 00 mv r12,r1 } if ( the_object ) { 8006650: 44 2e 00 10 be r1,r14,8006690 <_Objects_Allocate+0x9c> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 8006654: 2d 82 00 0a lhu r2,(r12+10) 8006658: 2d 61 00 0a lhu r1,(r11+10) _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 800665c: c8 41 08 00 sub r1,r2,r1 8006660: 2d 62 00 14 lhu r2,(r11+20) 8006664: f8 00 45 91 calli 8017ca8 <__udivsi3> information->inactive_per_block[ block ]--; 8006668: 34 02 00 02 mvi r2,2 800666c: f8 00 44 b5 calli 8017940 <__ashlsi3> 8006670: 29 62 00 30 lw r2,(r11+48) 8006674: b4 41 08 00 add r1,r2,r1 8006678: 28 22 00 00 lw r2,(r1+0) 800667c: 34 42 ff ff addi r2,r2,-1 8006680: 58 22 00 00 sw (r1+0),r2 information->inactive--; 8006684: 2d 61 00 2c lhu r1,(r11+44) 8006688: 34 21 ff ff addi r1,r1,-1 800668c: 0d 61 00 2c sh (r11+44),r1 ); } #endif return the_object; } 8006690: b9 80 08 00 mv r1,r12 8006694: 2b 9d 00 04 lw ra,(sp+4) 8006698: 2b 8b 00 14 lw r11,(sp+20) 800669c: 2b 8c 00 10 lw r12,(sp+16) 80066a0: 2b 8d 00 0c lw r13,(sp+12) 80066a4: 2b 8e 00 08 lw r14,(sp+8) 80066a8: 37 9c 00 14 addi sp,sp,20 80066ac: c3 a0 00 00 ret =============================================================================== 0800f89c <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 800f89c: 37 9c ff ec addi sp,sp,-20 800f8a0: 5b 8b 00 14 sw (sp+20),r11 800f8a4: 5b 8c 00 10 sw (sp+16),r12 800f8a8: 5b 8d 00 0c sw (sp+12),r13 800f8ac: 5b 8e 00 08 sw (sp+8),r14 800f8b0: 5b 9d 00 04 sw (sp+4),ra 800f8b4: 20 4c ff ff andi r12,r2,0xffff 800f8b8: b8 20 70 00 mv r14,r1 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) return NULL; 800f8bc: 34 0b 00 00 mvi r11,0 ) { Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 800f8c0: 45 80 00 16 be r12,r0,800f918 <_Objects_Get_information+0x7c> /* * This call implicitly validates the_api so we do not call * _Objects_Is_api_valid above here. */ the_class_api_maximum = _Objects_API_maximum_class( the_api ); 800f8c4: f8 00 08 4b calli 80119f0 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 800f8c8: 44 20 00 14 be r1,r0,800f918 <_Objects_Get_information+0x7c> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 800f8cc: 55 81 00 13 bgu r12,r1,800f918 <_Objects_Get_information+0x7c> return NULL; if ( !_Objects_Information_table[ the_api ] ) 800f8d0: 78 0d 08 01 mvhi r13,0x801 800f8d4: b9 c0 08 00 mv r1,r14 800f8d8: 34 02 00 02 mvi r2,2 800f8dc: 39 ad a9 14 ori r13,r13,0xa914 800f8e0: f8 00 20 18 calli 8017940 <__ashlsi3> 800f8e4: b5 a1 08 00 add r1,r13,r1 800f8e8: 28 2d 00 00 lw r13,(r1+0) 800f8ec: 45 a0 00 0b be r13,r0,800f918 <_Objects_Get_information+0x7c><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 800f8f0: b9 80 08 00 mv r1,r12 800f8f4: 34 02 00 02 mvi r2,2 800f8f8: f8 00 20 12 calli 8017940 <__ashlsi3> 800f8fc: b5 a1 08 00 add r1,r13,r1 800f900: 28 2b 00 00 lw r11,(r1+0) if ( !info ) 800f904: 45 60 00 05 be r11,r0,800f918 <_Objects_Get_information+0x7c><== NEVER TAKEN * In a multprocessing configuration, we may access remote objects. * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) 800f908: 2d 61 00 10 lhu r1,(r11+16) return NULL; 800f90c: 7c 21 00 00 cmpnei r1,r1,0 800f910: c8 01 08 00 sub r1,r0,r1 800f914: a1 61 58 00 and r11,r11,r1 #endif return info; } 800f918: b9 60 08 00 mv r1,r11 800f91c: 2b 9d 00 04 lw ra,(sp+4) 800f920: 2b 8b 00 14 lw r11,(sp+20) 800f924: 2b 8c 00 10 lw r12,(sp+16) 800f928: 2b 8d 00 0c lw r13,(sp+12) 800f92c: 2b 8e 00 08 lw r14,(sp+8) 800f930: 37 9c 00 14 addi sp,sp,20 800f934: c3 a0 00 00 ret =============================================================================== 08018980 <_Objects_Get_no_protection>: Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 8018980: 37 9c ff f4 addi sp,sp,-12 8018984: 5b 8b 00 0c sw (sp+12),r11 8018988: 5b 8c 00 08 sw (sp+8),r12 801898c: 5b 9d 00 04 sw (sp+4),ra 8018990: b8 20 20 00 mv r4,r1 /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 8018994: 28 21 00 08 lw r1,(r1+8) Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 8018998: b8 60 58 00 mv r11,r3 /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 801899c: c8 41 08 00 sub r1,r2,r1 if ( information->maximum >= index ) { 80189a0: 2c 82 00 10 lhu r2,(r4+16) /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 80189a4: 34 21 00 01 addi r1,r1,1 if ( information->maximum >= index ) { 80189a8: 54 22 00 09 bgu r1,r2,80189cc <_Objects_Get_no_protection+0x4c> if ( (the_object = information->local_table[ index ]) != NULL ) { 80189ac: 28 8c 00 1c lw r12,(r4+28) 80189b0: 34 02 00 02 mvi r2,2 80189b4: fb ff d5 e3 calli 800e140 <__ashlsi3> 80189b8: b5 81 08 00 add r1,r12,r1 80189bc: 28 21 00 00 lw r1,(r1+0) 80189c0: 44 20 00 03 be r1,r0,80189cc <_Objects_Get_no_protection+0x4c><== NEVER TAKEN *location = OBJECTS_LOCAL; 80189c4: 59 60 00 00 sw (r11+0),r0 return the_object; 80189c8: e0 00 00 04 bi 80189d8 <_Objects_Get_no_protection+0x58> /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 80189cc: 34 01 00 01 mvi r1,1 80189d0: 59 61 00 00 sw (r11+0),r1 return NULL; 80189d4: 34 01 00 00 mvi r1,0 } 80189d8: 2b 9d 00 04 lw ra,(sp+4) 80189dc: 2b 8b 00 0c lw r11,(sp+12) 80189e0: 2b 8c 00 08 lw r12,(sp+8) 80189e4: 37 9c 00 0c addi sp,sp,12 80189e8: c3 a0 00 00 ret =============================================================================== 0800a45c <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 800a45c: 37 9c ff e8 addi sp,sp,-24 800a460: 5b 8b 00 14 sw (sp+20),r11 800a464: 5b 8c 00 10 sw (sp+16),r12 800a468: 5b 8d 00 0c sw (sp+12),r13 800a46c: 5b 8e 00 08 sw (sp+8),r14 800a470: 5b 9d 00 04 sw (sp+4),ra 800a474: b8 40 70 00 mv r14,r2 /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 800a478: b8 20 58 00 mv r11,r1 800a47c: 5c 20 00 05 bne r1,r0,800a490 <_Objects_Id_to_name+0x34> 800a480: 78 01 08 03 mvhi r1,0x803 800a484: 38 21 17 00 ori r1,r1,0x1700 800a488: 28 21 00 10 lw r1,(r1+16) 800a48c: 28 2b 00 08 lw r11,(r1+8) */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 800a490: 34 02 00 18 mvi r2,24 800a494: b9 60 08 00 mv r1,r11 800a498: f8 00 80 d9 calli 802a7fc <__lshrsi3> 800a49c: 20 21 00 07 andi r1,r1,0x7 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 800a4a0: 34 23 ff ff addi r3,r1,-1 800a4a4: 34 02 00 02 mvi r2,2 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 800a4a8: 34 0d 00 03 mvi r13,3 800a4ac: 54 62 00 14 bgu r3,r2,800a4fc <_Objects_Id_to_name+0xa0> 800a4b0: e0 00 00 1b bi 800a51c <_Objects_Id_to_name+0xc0> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 800a4b4: 34 02 00 1b mvi r2,27 800a4b8: b9 60 08 00 mv r1,r11 800a4bc: f8 00 80 d0 calli 802a7fc <__lshrsi3> if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 800a4c0: 34 02 00 02 mvi r2,2 800a4c4: f8 00 80 80 calli 802a6c4 <__ashlsi3> 800a4c8: b5 81 08 00 add r1,r12,r1 800a4cc: 28 21 00 00 lw r1,(r1+0) if ( !information ) 800a4d0: 44 20 00 0b be r1,r0,800a4fc <_Objects_Id_to_name+0xa0> <== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 800a4d4: 40 2c 00 38 lbu r12,(r1+56) 800a4d8: 5d 80 00 09 bne r12,r0,800a4fc <_Objects_Id_to_name+0xa0> <== NEVER TAKEN return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 800a4dc: b9 60 10 00 mv r2,r11 800a4e0: 37 83 00 18 addi r3,sp,24 800a4e4: fb ff ff b8 calli 800a3c4 <_Objects_Get> if ( !the_object ) 800a4e8: 44 2c 00 05 be r1,r12,800a4fc <_Objects_Id_to_name+0xa0> return OBJECTS_INVALID_ID; *name = the_object->name; 800a4ec: 28 21 00 0c lw r1,(r1+12) _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 800a4f0: 34 0d 00 00 mvi r13,0 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; 800a4f4: 59 c1 00 00 sw (r14+0),r1 _Thread_Enable_dispatch(); 800a4f8: f8 00 04 5b calli 800b664 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 800a4fc: b9 a0 08 00 mv r1,r13 800a500: 2b 9d 00 04 lw ra,(sp+4) 800a504: 2b 8b 00 14 lw r11,(sp+20) 800a508: 2b 8c 00 10 lw r12,(sp+16) 800a50c: 2b 8d 00 0c lw r13,(sp+12) 800a510: 2b 8e 00 08 lw r14,(sp+8) 800a514: 37 9c 00 18 addi sp,sp,24 800a518: c3 a0 00 00 ret the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 800a51c: 78 0c 08 03 mvhi r12,0x803 800a520: 34 02 00 02 mvi r2,2 800a524: 39 8c 11 d4 ori r12,r12,0x11d4 800a528: f8 00 80 67 calli 802a6c4 <__ashlsi3> 800a52c: b5 81 08 00 add r1,r12,r1 800a530: 28 2c 00 00 lw r12,(r1+0) 800a534: 5d 80 ff e0 bne r12,r0,800a4b4 <_Objects_Id_to_name+0x58> 800a538: e3 ff ff f1 bi 800a4fc <_Objects_Id_to_name+0xa0> =============================================================================== 0801120c <_POSIX_Keys_Run_destructors>: */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 801120c: 37 9c ff dc addi sp,sp,-36 8011210: 5b 8b 00 24 sw (sp+36),r11 8011214: 5b 8c 00 20 sw (sp+32),r12 8011218: 5b 8d 00 1c sw (sp+28),r13 801121c: 5b 8e 00 18 sw (sp+24),r14 8011220: 5b 8f 00 14 sw (sp+20),r15 8011224: 5b 90 00 10 sw (sp+16),r16 8011228: 5b 91 00 0c sw (sp+12),r17 801122c: 5b 92 00 08 sw (sp+8),r18 8011230: 5b 9d 00 04 sw (sp+4),ra Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); 8011234: 28 2b 00 08 lw r11,(r1+8) 8011238: 34 02 00 18 mvi r2,24 801123c: b9 60 08 00 mv r1,r11 8011240: f8 00 1a 0e calli 8017a78 <__lshrsi3> 8011244: 20 30 00 07 andi r16,r1,0x7 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 8011248: 34 02 00 02 mvi r2,2 801124c: 21 61 ff ff andi r1,r11,0xffff 8011250: f8 00 19 bc calli 8017940 <__ashlsi3> * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 8011254: 78 0b 08 01 mvhi r11,0x801 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 8011258: b8 20 88 00 mv r17,r1 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 801125c: 39 6b ac cc ori r11,r11,0xaccc for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 8011260: 36 10 00 04 addi r16,r16,4 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 8011264: 2d 72 00 10 lhu r18,(r11+16) done = true; for ( index = 1 ; index <= max ; ++index ) { 8011268: 34 0c 00 01 mvi r12,1 */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; 801126c: 34 0e 00 01 mvi r14,1 for ( index = 1 ; index <= max ; ++index ) { 8011270: e0 00 00 18 bi 80112d0 <_POSIX_Keys_Run_destructors+0xc4> POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; 8011274: 29 6d 00 1c lw r13,(r11+28) 8011278: 34 02 00 02 mvi r2,2 801127c: b9 80 08 00 mv r1,r12 8011280: f8 00 19 b0 calli 8017940 <__ashlsi3> 8011284: b5 a1 10 00 add r2,r13,r1 Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) 8011288: 28 4d 00 00 lw r13,(r2+0) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { 801128c: 45 a0 00 0f be r13,r0,80112c8 <_POSIX_Keys_Run_destructors+0xbc> 8011290: 29 af 00 10 lw r15,(r13+16) 8011294: 45 e0 00 0d be r15,r0,80112c8 <_POSIX_Keys_Run_destructors+0xbc> void *value = key->Values [ thread_api ][ thread_index ]; 8011298: 34 02 00 02 mvi r2,2 801129c: ba 00 08 00 mv r1,r16 80112a0: f8 00 19 a8 calli 8017940 <__ashlsi3> 80112a4: b5 a1 68 00 add r13,r13,r1 80112a8: 29 a3 00 04 lw r3,(r13+4) 80112ac: b4 71 18 00 add r3,r3,r17 80112b0: 28 62 00 00 lw r2,(r3+0) if ( value != NULL ) { 80112b4: 44 40 00 05 be r2,r0,80112c8 <_POSIX_Keys_Run_destructors+0xbc><== ALWAYS TAKEN key->Values [ thread_api ][ thread_index ] = NULL; 80112b8: 58 60 00 00 sw (r3+0),r0 <== NOT EXECUTED (*key->destructor)( value ); 80112bc: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 80112c0: d9 e0 00 00 call r15 <== NOT EXECUTED done = false; 80112c4: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 80112c8: 35 8c 00 01 addi r12,r12,1 80112cc: 21 8c ff ff andi r12,r12,0xffff 80112d0: 52 4c ff e9 bgeu r18,r12,8011274 <_POSIX_Keys_Run_destructors+0x68> * number of iterations. An infinite loop may happen if destructors set * thread specific data. This can be considered dubious. * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { 80112d4: 45 c0 ff e4 be r14,r0,8011264 <_POSIX_Keys_Run_destructors+0x58><== NEVER TAKEN done = false; } } } } } 80112d8: 2b 9d 00 04 lw ra,(sp+4) 80112dc: 2b 8b 00 24 lw r11,(sp+36) 80112e0: 2b 8c 00 20 lw r12,(sp+32) 80112e4: 2b 8d 00 1c lw r13,(sp+28) 80112e8: 2b 8e 00 18 lw r14,(sp+24) 80112ec: 2b 8f 00 14 lw r15,(sp+20) 80112f0: 2b 90 00 10 lw r16,(sp+16) 80112f4: 2b 91 00 0c lw r17,(sp+12) 80112f8: 2b 92 00 08 lw r18,(sp+8) 80112fc: 37 9c 00 24 addi sp,sp,36 8011300: c3 a0 00 00 ret =============================================================================== 08009320 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 8009320: 37 9c ff dc addi sp,sp,-36 8009324: 5b 8b 00 18 sw (sp+24),r11 8009328: 5b 8c 00 14 sw (sp+20),r12 800932c: 5b 8d 00 10 sw (sp+16),r13 8009330: 5b 8e 00 0c sw (sp+12),r14 8009334: 5b 8f 00 08 sw (sp+8),r15 8009338: 5b 9d 00 04 sw (sp+4),ra 800933c: b8 20 60 00 mv r12,r1 RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( mqd_t id, Objects_Locations *location ) { return (POSIX_Message_queue_Control_fd *) _Objects_Get( 8009340: 78 01 08 02 mvhi r1,0x802 8009344: b8 40 68 00 mv r13,r2 8009348: b8 60 78 00 mv r15,r3 800934c: b9 80 10 00 mv r2,r12 8009350: 38 21 a2 40 ori r1,r1,0xa240 8009354: 37 83 00 24 addi r3,sp,36 8009358: 5b 86 00 1c sw (sp+28),r6 800935c: b8 80 58 00 mv r11,r4 8009360: 20 ae 00 ff andi r14,r5,0xff 8009364: f8 00 0d 3e calli 800c85c <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 8009368: 2b 82 00 24 lw r2,(sp+36) 800936c: 2b 86 00 1c lw r6,(sp+28) 8009370: 5c 40 00 33 bne r2,r0,800943c <_POSIX_Message_queue_Receive_support+0x11c> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 8009374: 28 24 00 14 lw r4,(r1+20) 8009378: 34 02 00 01 mvi r2,1 800937c: 20 83 00 03 andi r3,r4,0x3 8009380: 5c 62 00 03 bne r3,r2,800938c <_POSIX_Message_queue_Receive_support+0x6c> _Thread_Enable_dispatch(); 8009384: f8 00 11 76 calli 800d95c <_Thread_Enable_dispatch> 8009388: e0 00 00 2d bi 800943c <_POSIX_Message_queue_Receive_support+0x11c> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 800938c: 28 27 00 10 lw r7,(r1+16) if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 8009390: 28 e1 00 68 lw r1,(r7+104) 8009394: 51 e1 00 05 bgeu r15,r1,80093a8 <_POSIX_Message_queue_Receive_support+0x88> _Thread_Enable_dispatch(); 8009398: f8 00 11 71 calli 800d95c <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 800939c: f8 00 2c 04 calli 80143ac <__errno> 80093a0: 34 02 00 7a mvi r2,122 80093a4: e0 00 00 28 bi 8009444 <_POSIX_Message_queue_Receive_support+0x124> /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 80093a8: 34 01 ff ff mvi r1,-1 80093ac: 5b 81 00 20 sw (sp+32),r1 /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 80093b0: 34 05 00 00 mvi r5,0 80093b4: 45 c0 00 03 be r14,r0,80093c0 <_POSIX_Message_queue_Receive_support+0xa0> do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 80093b8: 20 85 40 00 andi r5,r4,0x4000 80093bc: 64 a5 00 00 cmpei r5,r5,0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 80093c0: 34 e1 00 1c addi r1,r7,28 80093c4: b9 80 10 00 mv r2,r12 80093c8: b9 a0 18 00 mv r3,r13 80093cc: 37 84 00 20 addi r4,sp,32 80093d0: f8 00 07 dc calli 800b340 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 80093d4: f8 00 11 62 calli 800d95c <_Thread_Enable_dispatch> if (msg_prio) { 80093d8: 45 60 00 0b be r11,r0,8009404 <_POSIX_Message_queue_Receive_support+0xe4><== NEVER TAKEN *msg_prio = _POSIX_Message_queue_Priority_from_core( _Thread_Executing->Wait.count 80093dc: 78 01 08 02 mvhi r1,0x802 80093e0: 38 21 a2 c0 ori r1,r1,0xa2c0 80093e4: 28 2c 00 10 lw r12,(r1+16) RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( CORE_message_queue_Submit_types priority ) { /* absolute value without a library dependency */ return (unsigned int) ((priority >= 0) ? priority : -priority); 80093e8: 34 02 00 1f mvi r2,31 80093ec: 29 81 00 24 lw r1,(r12+36) 80093f0: f8 00 6d d3 calli 8024b3c <__ashrsi3> 80093f4: 29 82 00 24 lw r2,(r12+36) 80093f8: 98 22 10 00 xor r2,r1,r2 80093fc: c8 41 08 00 sub r1,r2,r1 timeout ); _Thread_Enable_dispatch(); if (msg_prio) { *msg_prio = _POSIX_Message_queue_Priority_from_core( 8009400: 59 61 00 00 sw (r11+0),r1 _Thread_Executing->Wait.count ); } if ( !_Thread_Executing->Wait.return_code ) 8009404: 78 0b 08 02 mvhi r11,0x802 8009408: 39 6b a2 c0 ori r11,r11,0xa2c0 800940c: 29 61 00 10 lw r1,(r11+16) 8009410: 28 21 00 34 lw r1,(r1+52) 8009414: 5c 20 00 03 bne r1,r0,8009420 <_POSIX_Message_queue_Receive_support+0x100> return length_out; 8009418: 2b 81 00 20 lw r1,(sp+32) 800941c: e0 00 00 0c bi 800944c <_POSIX_Message_queue_Receive_support+0x12c> rtems_set_errno_and_return_minus_one( 8009420: f8 00 2b e3 calli 80143ac <__errno> 8009424: b8 20 60 00 mv r12,r1 8009428: 29 61 00 10 lw r1,(r11+16) 800942c: 28 21 00 34 lw r1,(r1+52) 8009430: f8 00 00 b9 calli 8009714 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 8009434: 59 81 00 00 sw (r12+0),r1 8009438: e0 00 00 04 bi 8009448 <_POSIX_Message_queue_Receive_support+0x128> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 800943c: f8 00 2b dc calli 80143ac <__errno> 8009440: 34 02 00 09 mvi r2,9 8009444: 58 22 00 00 sw (r1+0),r2 8009448: 34 01 ff ff mvi r1,-1 } 800944c: 2b 9d 00 04 lw ra,(sp+4) 8009450: 2b 8b 00 18 lw r11,(sp+24) 8009454: 2b 8c 00 14 lw r12,(sp+20) 8009458: 2b 8d 00 10 lw r13,(sp+16) 800945c: 2b 8e 00 0c lw r14,(sp+12) 8009460: 2b 8f 00 08 lw r15,(sp+8) 8009464: 37 9c 00 24 addi sp,sp,36 8009468: c3 a0 00 00 ret =============================================================================== 0800beec <_POSIX_Semaphore_Create_support>: size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { 800beec: 37 9c ff e0 addi sp,sp,-32 800bef0: 5b 8b 00 1c sw (sp+28),r11 800bef4: 5b 8c 00 18 sw (sp+24),r12 800bef8: 5b 8d 00 14 sw (sp+20),r13 800befc: 5b 8e 00 10 sw (sp+16),r14 800bf00: 5b 8f 00 0c sw (sp+12),r15 800bf04: 5b 90 00 08 sw (sp+8),r16 800bf08: 5b 9d 00 04 sw (sp+4),ra 800bf0c: b8 20 60 00 mv r12,r1 800bf10: b8 60 70 00 mv r14,r3 800bf14: b8 80 80 00 mv r16,r4 800bf18: b8 a0 78 00 mv r15,r5 POSIX_Semaphore_Control *the_semaphore; CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) 800bf1c: 44 60 00 04 be r3,r0,800bf2c <_POSIX_Semaphore_Create_support+0x40> rtems_set_errno_and_return_minus_one( ENOSYS ); 800bf20: f8 00 0b f0 calli 800eee0 <__errno> 800bf24: 34 02 00 58 mvi r2,88 800bf28: e0 00 00 11 bi 800bf6c <_POSIX_Semaphore_Create_support+0x80> * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 800bf2c: 78 06 08 02 mvhi r6,0x802 800bf30: 38 c6 43 28 ori r6,r6,0x4328 800bf34: 28 c1 00 00 lw r1,(r6+0) ++level; 800bf38: 34 21 00 01 addi r1,r1,1 _Thread_Dispatch_disable_level = level; 800bf3c: 58 c1 00 00 sw (r6+0),r1 */ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) { return (POSIX_Semaphore_Control *) _Objects_Allocate( &_POSIX_Semaphore_Information ); 800bf40: 78 0d 08 02 mvhi r13,0x802 800bf44: 39 ad 45 64 ori r13,r13,0x4564 800bf48: b9 a0 08 00 mv r1,r13 800bf4c: 5b 82 00 20 sw (sp+32),r2 800bf50: fb ff ec 60 calli 80070d0 <_Objects_Allocate> 800bf54: b8 20 58 00 mv r11,r1 _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { 800bf58: 2b 82 00 20 lw r2,(sp+32) 800bf5c: 5c 2e 00 07 bne r1,r14,800bf78 <_POSIX_Semaphore_Create_support+0x8c> _Thread_Enable_dispatch(); 800bf60: fb ff f1 fd calli 8008754 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSPC ); 800bf64: f8 00 0b df calli 800eee0 <__errno> 800bf68: 34 02 00 1c mvi r2,28 800bf6c: 58 22 00 00 sw (r1+0),r2 800bf70: 34 01 ff ff mvi r1,-1 800bf74: e0 00 00 2c bi 800c024 <_POSIX_Semaphore_Create_support+0x138> /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ if ( name_arg != NULL ) { 800bf78: 45 80 00 0c be r12,r0,800bfa8 <_POSIX_Semaphore_Create_support+0xbc> name = _Workspace_String_duplicate( name_arg, name_len ); 800bf7c: b9 80 08 00 mv r1,r12 800bf80: f8 00 05 09 calli 800d3a4 <_Workspace_String_duplicate> 800bf84: b8 20 60 00 mv r12,r1 if ( !name ) { 800bf88: 5c 20 00 09 bne r1,r0,800bfac <_POSIX_Semaphore_Create_support+0xc0><== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( POSIX_Semaphore_Control *the_semaphore ) { _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); 800bf8c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 800bf90: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 800bf94: fb ff ed 4f calli 80074d0 <_Objects_Free> <== NOT EXECUTED _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 800bf98: fb ff f1 ef calli 8008754 <_Thread_Enable_dispatch> <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 800bf9c: f8 00 0b d1 calli 800eee0 <__errno> <== NOT EXECUTED 800bfa0: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 800bfa4: e3 ff ff f2 bi 800bf6c <_POSIX_Semaphore_Create_support+0x80><== NOT EXECUTED } } else { name = NULL; 800bfa8: 34 0c 00 00 mvi r12,0 } the_semaphore->process_shared = pshared; 800bfac: 59 60 00 10 sw (r11+16),r0 if ( name ) { 800bfb0: 45 80 00 07 be r12,r0,800bfcc <_POSIX_Semaphore_Create_support+0xe0> the_semaphore->named = true; 800bfb4: 34 01 00 01 mvi r1,1 800bfb8: 31 61 00 14 sb (r11+20),r1 the_semaphore->open_count = 1; 800bfbc: 34 01 00 01 mvi r1,1 800bfc0: 59 61 00 18 sw (r11+24),r1 the_semaphore->linked = true; 800bfc4: 31 61 00 15 sb (r11+21),r1 800bfc8: e0 00 00 04 bi 800bfd8 <_POSIX_Semaphore_Create_support+0xec> } else { the_semaphore->named = false; 800bfcc: 31 60 00 14 sb (r11+20),r0 the_semaphore->open_count = 0; 800bfd0: 59 60 00 18 sw (r11+24),r0 the_semaphore->linked = false; 800bfd4: 31 60 00 15 sb (r11+21),r0 the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 800bfd8: 34 01 ff ff mvi r1,-1 _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 800bfdc: ba 00 18 00 mv r3,r16 the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 800bfe0: 59 61 00 5c sw (r11+92),r1 _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 800bfe4: 35 62 00 5c addi r2,r11,92 800bfe8: 35 61 00 1c addi r1,r11,28 * blocking tasks on this semaphore should be. It could somehow * be derived from the current scheduling policy. One * thing is certain, no matter what we decide, it won't be * the same as all other POSIX implementations. :) */ the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; 800bfec: 59 60 00 60 sw (r11+96),r0 /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 800bff0: fb ff ea 3b calli 80068dc <_CORE_semaphore_Initialize> *the_sem = the_semaphore; _Thread_Enable_dispatch(); return 0; } 800bff4: 78 01 08 02 mvhi r1,0x802 800bff8: 38 21 45 64 ori r1,r1,0x4564 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 800bffc: 28 2d 00 1c lw r13,(r1+28) 800c000: 2d 61 00 0a lhu r1,(r11+10) 800c004: 34 02 00 02 mvi r2,2 800c008: fb ff d3 05 calli 8000c1c <__ashlsi3> 800c00c: b5 a1 08 00 add r1,r13,r1 800c010: 58 2b 00 00 sw (r1+0),r11 the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 800c014: 59 6c 00 0c sw (r11+12),r12 &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; 800c018: 59 eb 00 00 sw (r15+0),r11 _Thread_Enable_dispatch(); 800c01c: fb ff f1 ce calli 8008754 <_Thread_Enable_dispatch> return 0; 800c020: 34 01 00 00 mvi r1,0 } 800c024: 2b 9d 00 04 lw ra,(sp+4) 800c028: 2b 8b 00 1c lw r11,(sp+28) 800c02c: 2b 8c 00 18 lw r12,(sp+24) 800c030: 2b 8d 00 14 lw r13,(sp+20) 800c034: 2b 8e 00 10 lw r14,(sp+16) 800c038: 2b 8f 00 0c lw r15,(sp+12) 800c03c: 2b 90 00 08 lw r16,(sp+8) 800c040: 37 9c 00 20 addi sp,sp,32 800c044: c3 a0 00 00 ret =============================================================================== 08008aa8 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 8008aa8: 37 9c ff fc addi sp,sp,-4 8008aac: 5b 9d 00 04 sw (sp+4),ra POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 8008ab0: 28 22 01 1c lw r2,(r1+284) if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 8008ab4: 28 43 00 d8 lw r3,(r2+216) 8008ab8: 5c 60 00 0e bne r3,r0,8008af0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48><== NEVER TAKEN 8008abc: 28 44 00 dc lw r4,(r2+220) 8008ac0: 34 03 00 01 mvi r3,1 8008ac4: 5c 83 00 0b bne r4,r3,8008af0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48> thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 8008ac8: 28 42 00 e0 lw r2,(r2+224) 8008acc: 44 40 00 09 be r2,r0,8008af0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 8008ad0: 78 02 08 01 mvhi r2,0x801 8008ad4: 38 42 68 e8 ori r2,r2,0x68e8 8008ad8: 28 43 00 00 lw r3,(r2+0) --level; 8008adc: 34 63 ff ff addi r3,r3,-1 _Thread_Dispatch_disable_level = level; 8008ae0: 58 43 00 00 sw (r2+0),r3 thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 8008ae4: 34 02 ff ff mvi r2,-1 8008ae8: f8 00 02 72 calli 80094b0 <_POSIX_Thread_Exit> 8008aec: e0 00 00 02 bi 8008af4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x4c> } else _Thread_Enable_dispatch(); 8008af0: fb ff f5 42 calli 8005ff8 <_Thread_Enable_dispatch> } 8008af4: 2b 9d 00 04 lw ra,(sp+4) 8008af8: 37 9c 00 04 addi sp,sp,4 8008afc: c3 a0 00 00 ret =============================================================================== 0800a55c <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 800a55c: 37 9c ff e8 addi sp,sp,-24 800a560: 5b 8b 00 18 sw (sp+24),r11 800a564: 5b 8c 00 14 sw (sp+20),r12 800a568: 5b 8d 00 10 sw (sp+16),r13 800a56c: 5b 8e 00 0c sw (sp+12),r14 800a570: 5b 8f 00 08 sw (sp+8),r15 800a574: 5b 9d 00 04 sw (sp+4),ra 800a578: b8 20 68 00 mv r13,r1 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 800a57c: 28 41 00 00 lw r1,(r2+0) int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 800a580: b8 40 58 00 mv r11,r2 800a584: b8 60 70 00 mv r14,r3 800a588: b8 80 78 00 mv r15,r4 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 800a58c: fb ff ff ec calli 800a53c <_POSIX_Priority_Is_valid> return EINVAL; 800a590: 34 0c 00 16 mvi r12,22 struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 800a594: 44 20 00 2a be r1,r0,800a63c <_POSIX_Thread_Translate_sched_param+0xe0><== NEVER TAKEN return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 800a598: 59 c0 00 00 sw (r14+0),r0 *budget_callout = NULL; 800a59c: 59 e0 00 00 sw (r15+0),r0 if ( policy == SCHED_OTHER ) { 800a5a0: 5d a0 00 04 bne r13,r0,800a5b0 <_POSIX_Thread_Translate_sched_param+0x54> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 800a5a4: 34 01 00 01 mvi r1,1 800a5a8: 59 c1 00 00 sw (r14+0),r1 800a5ac: e0 00 00 23 bi 800a638 <_POSIX_Thread_Translate_sched_param+0xdc> return 0; } if ( policy == SCHED_FIFO ) { 800a5b0: 34 01 00 01 mvi r1,1 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; 800a5b4: 34 0c 00 00 mvi r12,0 if ( policy == SCHED_OTHER ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; return 0; } if ( policy == SCHED_FIFO ) { 800a5b8: 45 a1 00 21 be r13,r1,800a63c <_POSIX_Thread_Translate_sched_param+0xe0> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 800a5bc: 34 01 00 02 mvi r1,2 800a5c0: 5d a1 00 03 bne r13,r1,800a5cc <_POSIX_Thread_Translate_sched_param+0x70> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 800a5c4: 59 cd 00 00 sw (r14+0),r13 return 0; 800a5c8: e0 00 00 1d bi 800a63c <_POSIX_Thread_Translate_sched_param+0xe0> } if ( policy == SCHED_SPORADIC ) { 800a5cc: 34 01 00 04 mvi r1,4 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; 800a5d0: 34 0c 00 16 mvi r12,22 if ( policy == SCHED_RR ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; return 0; } if ( policy == SCHED_SPORADIC ) { 800a5d4: 5d a1 00 1a bne r13,r1,800a63c <_POSIX_Thread_Translate_sched_param+0xe0> if ( (param->sched_ss_repl_period.tv_sec == 0) && 800a5d8: 29 61 00 08 lw r1,(r11+8) 800a5dc: 5c 20 00 03 bne r1,r0,800a5e8 <_POSIX_Thread_Translate_sched_param+0x8c> 800a5e0: 29 62 00 0c lw r2,(r11+12) 800a5e4: 44 41 00 16 be r2,r1,800a63c <_POSIX_Thread_Translate_sched_param+0xe0> (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 800a5e8: 29 61 00 10 lw r1,(r11+16) 800a5ec: 5c 20 00 04 bne r1,r0,800a5fc <_POSIX_Thread_Translate_sched_param+0xa0> 800a5f0: 29 62 00 14 lw r2,(r11+20) (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; 800a5f4: 34 0c 00 16 mvi r12,22 if ( policy == SCHED_SPORADIC ) { if ( (param->sched_ss_repl_period.tv_sec == 0) && (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 800a5f8: 44 41 00 11 be r2,r1,800a63c <_POSIX_Thread_Translate_sched_param+0xe0> (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 800a5fc: 35 61 00 08 addi r1,r11,8 800a600: fb ff f6 39 calli 8007ee4 <_Timespec_To_ticks> 800a604: b8 20 68 00 mv r13,r1 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 800a608: 35 61 00 10 addi r1,r11,16 800a60c: fb ff f6 36 calli 8007ee4 <_Timespec_To_ticks> return EINVAL; 800a610: 34 0c 00 16 mvi r12,22 if ( (param->sched_ss_init_budget.tv_sec == 0) && (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 800a614: 54 2d 00 0a bgu r1,r13,800a63c <_POSIX_Thread_Translate_sched_param+0xe0> _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 800a618: 29 61 00 04 lw r1,(r11+4) 800a61c: fb ff ff c8 calli 800a53c <_POSIX_Priority_Is_valid> 800a620: 44 20 00 07 be r1,r0,800a63c <_POSIX_Thread_Translate_sched_param+0xe0> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 800a624: 34 01 00 03 mvi r1,3 800a628: 59 c1 00 00 sw (r14+0),r1 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 800a62c: 78 01 08 00 mvhi r1,0x800 800a630: 38 21 40 90 ori r1,r1,0x4090 800a634: 59 e1 00 00 sw (r15+0),r1 return 0; 800a638: 34 0c 00 00 mvi r12,0 } return EINVAL; } 800a63c: b9 80 08 00 mv r1,r12 800a640: 2b 9d 00 04 lw ra,(sp+4) 800a644: 2b 8b 00 18 lw r11,(sp+24) 800a648: 2b 8c 00 14 lw r12,(sp+20) 800a64c: 2b 8d 00 10 lw r13,(sp+16) 800a650: 2b 8e 00 0c lw r14,(sp+12) 800a654: 2b 8f 00 08 lw r15,(sp+8) 800a658: 37 9c 00 18 addi sp,sp,24 800a65c: c3 a0 00 00 ret =============================================================================== 0800df24 <_POSIX_Threads_Delete_extension>: */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { 800df24: 37 9c ff ec addi sp,sp,-20 800df28: 5b 8b 00 14 sw (sp+20),r11 800df2c: 5b 8c 00 10 sw (sp+16),r12 800df30: 5b 8d 00 0c sw (sp+12),r13 800df34: 5b 8e 00 08 sw (sp+8),r14 800df38: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = deleted->API_Extensions[ THREAD_API_POSIX ]; 800df3c: 28 4b 01 1c lw r11,(r2+284) /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 800df40: b8 40 08 00 mv r1,r2 */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { 800df44: b8 40 60 00 mv r12,r2 api = deleted->API_Extensions[ THREAD_API_POSIX ]; /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 800df48: f8 00 0c 8e calli 8011180 <_POSIX_Threads_cancel_run> /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); 800df4c: b9 80 08 00 mv r1,r12 800df50: f8 00 0c af calli 801120c <_POSIX_Keys_Run_destructors> /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 800df54: 35 6d 00 44 addi r13,r11,68 _POSIX_Keys_Run_destructors( deleted ); /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; 800df58: 29 8e 00 28 lw r14,(r12+40) while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 800df5c: e0 00 00 03 bi 800df68 <_POSIX_Threads_Delete_extension+0x44> *(void **)the_thread->Wait.return_argument = value_ptr; 800df60: 28 21 00 28 lw r1,(r1+40) <== NOT EXECUTED 800df64: 58 2e 00 00 sw (r1+0),r14 <== NOT EXECUTED /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 800df68: b9 a0 08 00 mv r1,r13 800df6c: fb ff e7 95 calli 8007dc0 <_Thread_queue_Dequeue> 800df70: 5c 20 ff fc bne r1,r0,800df60 <_POSIX_Threads_Delete_extension+0x3c><== NEVER TAKEN *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) 800df74: 29 62 00 84 lw r2,(r11+132) 800df78: 34 01 00 04 mvi r1,4 800df7c: 5c 41 00 03 bne r2,r1,800df88 <_POSIX_Threads_Delete_extension+0x64> (void) _Watchdog_Remove( &api->Sporadic_timer ); 800df80: 35 61 00 a8 addi r1,r11,168 800df84: fb ff ea b3 calli 8008a50 <_Watchdog_Remove> deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; 800df88: 59 80 01 1c sw (r12+284),r0 _Workspace_Free( api ); 800df8c: b9 60 08 00 mv r1,r11 800df90: fb ff eb 3c calli 8008c80 <_Workspace_Free> } 800df94: 2b 9d 00 04 lw ra,(sp+4) 800df98: 2b 8b 00 14 lw r11,(sp+20) 800df9c: 2b 8c 00 10 lw r12,(sp+16) 800dfa0: 2b 8d 00 0c lw r13,(sp+12) 800dfa4: 2b 8e 00 08 lw r14,(sp+8) 800dfa8: 37 9c 00 14 addi sp,sp,20 800dfac: c3 a0 00 00 ret =============================================================================== 08003d14 <_POSIX_Threads_Initialize_user_threads_body>: #include #include #include void _POSIX_Threads_Initialize_user_threads_body(void) { 8003d14: 37 9c ff a8 addi sp,sp,-88 8003d18: 5b 8b 00 14 sw (sp+20),r11 8003d1c: 5b 8c 00 10 sw (sp+16),r12 8003d20: 5b 8d 00 0c sw (sp+12),r13 8003d24: 5b 8e 00 08 sw (sp+8),r14 8003d28: 5b 9d 00 04 sw (sp+4),ra uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 8003d2c: 78 01 08 02 mvhi r1,0x802 8003d30: 38 21 00 c0 ori r1,r1,0xc0 maximum = Configuration_POSIX_API.number_of_initialization_threads; 8003d34: 28 2e 00 30 lw r14,(r1+48) uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 8003d38: 28 2c 00 34 lw r12,(r1+52) maximum = Configuration_POSIX_API.number_of_initialization_threads; if ( !user_threads || maximum == 0 ) 8003d3c: 34 0d 00 00 mvi r13,0 8003d40: 65 c2 00 00 cmpei r2,r14,0 8003d44: 65 81 00 00 cmpei r1,r12,0 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 8003d48: 37 8b 00 18 addi r11,sp,24 pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; maximum = Configuration_POSIX_API.number_of_initialization_threads; if ( !user_threads || maximum == 0 ) 8003d4c: b8 41 08 00 or r1,r2,r1 8003d50: 44 20 00 16 be r1,r0,8003da8 <_POSIX_Threads_Initialize_user_threads_body+0x94><== ALWAYS TAKEN 8003d54: e0 00 00 16 bi 8003dac <_POSIX_Threads_Initialize_user_threads_body+0x98><== NOT EXECUTED for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 8003d58: b9 60 08 00 mv r1,r11 8003d5c: f8 00 1a 41 calli 800a660 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 8003d60: 34 02 00 02 mvi r2,2 8003d64: b9 60 08 00 mv r1,r11 8003d68: f8 00 1a 4b calli 800a694 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 8003d6c: 29 82 00 04 lw r2,(r12+4) 8003d70: b9 60 08 00 mv r1,r11 8003d74: f8 00 1a 54 calli 800a6c4 status = pthread_create( 8003d78: 29 83 00 00 lw r3,(r12+0) 8003d7c: 37 81 00 58 addi r1,sp,88 8003d80: b9 60 10 00 mv r2,r11 8003d84: 34 04 00 00 mvi r4,0 8003d88: fb ff fe cd calli 80038bc 8003d8c: b8 20 18 00 mv r3,r1 8003d90: 35 8c 00 08 addi r12,r12,8 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 8003d94: 44 20 00 04 be r1,r0,8003da4 <_POSIX_Threads_Initialize_user_threads_body+0x90> _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 8003d98: 34 01 00 02 mvi r1,2 8003d9c: 34 02 00 01 mvi r2,1 8003da0: f8 00 07 3f calli 8005a9c <_Internal_error_Occurred> * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 8003da4: 35 ad 00 01 addi r13,r13,1 8003da8: 55 cd ff ec bgu r14,r13,8003d58 <_POSIX_Threads_Initialize_user_threads_body+0x44> NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 8003dac: 2b 9d 00 04 lw ra,(sp+4) 8003db0: 2b 8b 00 14 lw r11,(sp+20) 8003db4: 2b 8c 00 10 lw r12,(sp+16) 8003db8: 2b 8d 00 0c lw r13,(sp+12) 8003dbc: 2b 8e 00 08 lw r14,(sp+8) 8003dc0: 37 9c 00 58 addi sp,sp,88 8003dc4: c3 a0 00 00 ret =============================================================================== 0800e0fc <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 800e0fc: 37 9c ff f4 addi sp,sp,-12 800e100: 5b 8b 00 0c sw (sp+12),r11 800e104: 5b 8c 00 08 sw (sp+8),r12 800e108: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800e10c: 28 4c 01 1c lw r12,(r2+284) */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 800e110: b8 40 58 00 mv r11,r2 the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 800e114: 35 81 00 98 addi r1,r12,152 800e118: f8 00 07 b0 calli 800ffd8 <_Timespec_To_ticks> the_thread->cpu_time_budget = ticks; 800e11c: 59 61 00 74 sw (r11+116),r1 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 800e120: 78 01 08 01 mvhi r1,0x801 800e124: 38 21 a0 c0 ori r1,r1,0xa0c0 800e128: 40 21 00 00 lbu r1,(r1+0) 800e12c: 29 82 00 88 lw r2,(r12+136) 800e130: c8 22 10 00 sub r2,r1,r2 */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 800e134: 29 61 00 1c lw r1,(r11+28) ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); the_thread->cpu_time_budget = ticks; new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; 800e138: 59 62 00 18 sw (r11+24),r2 */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 800e13c: 5c 20 00 06 bne r1,r0,800e154 <_POSIX_Threads_Sporadic_budget_TSR+0x58><== NEVER TAKEN /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 800e140: 29 61 00 14 lw r1,(r11+20) 800e144: 50 41 00 04 bgeu r2,r1,800e154 <_POSIX_Threads_Sporadic_budget_TSR+0x58> _Thread_Change_priority( the_thread, new_priority, true ); 800e148: b9 60 08 00 mv r1,r11 800e14c: 34 03 00 01 mvi r3,1 800e150: fb ff e5 98 calli 80077b0 <_Thread_Change_priority> #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 800e154: 35 81 00 90 addi r1,r12,144 800e158: f8 00 07 a0 calli 800ffd8 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 800e15c: 59 81 00 b4 sw (r12+180),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800e160: 78 01 08 01 mvhi r1,0x801 800e164: 38 21 aa 10 ori r1,r1,0xaa10 800e168: 35 82 00 a8 addi r2,r12,168 800e16c: fb ff e9 dc calli 80088dc <_Watchdog_Insert> _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } 800e170: 2b 9d 00 04 lw ra,(sp+4) 800e174: 2b 8b 00 0c lw r11,(sp+12) 800e178: 2b 8c 00 08 lw r12,(sp+8) 800e17c: 37 9c 00 0c addi sp,sp,12 800e180: c3 a0 00 00 ret =============================================================================== 0800e184 <_POSIX_Threads_Sporadic_budget_callout>: * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 800e184: 37 9c ff fc addi sp,sp,-4 800e188: 5b 9d 00 04 sw (sp+4),ra /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 800e18c: 34 02 ff ff mvi r2,-1 ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800e190: 28 25 01 1c lw r5,(r1+284) /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 800e194: 58 22 00 74 sw (r1+116),r2 800e198: 78 02 08 01 mvhi r2,0x801 800e19c: 38 42 a0 c0 ori r2,r2,0xa0c0 800e1a0: 40 44 00 00 lbu r4,(r2+0) 800e1a4: 28 a2 00 8c lw r2,(r5+140) 800e1a8: c8 82 10 00 sub r2,r4,r2 */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 800e1ac: 28 24 00 1c lw r4,(r1+28) * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 800e1b0: 58 22 00 18 sw (r1+24),r2 */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 800e1b4: 5c 80 00 05 bne r4,r0,800e1c8 <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN /* * Make sure we are actually lowering it. If they have lowered it * to logically lower than sched_ss_low_priority, then we do not want to * change it. */ if ( the_thread->current_priority < new_priority ) { 800e1b8: 28 23 00 14 lw r3,(r1+20) 800e1bc: 50 62 00 03 bgeu r3,r2,800e1c8 <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, true ); 800e1c0: 34 03 00 01 mvi r3,1 800e1c4: fb ff e5 7b calli 80077b0 <_Thread_Change_priority> #if 0 printk( "lower priority\n" ); #endif } } } 800e1c8: 2b 9d 00 04 lw ra,(sp+4) 800e1cc: 37 9c 00 04 addi sp,sp,4 800e1d0: c3 a0 00 00 ret =============================================================================== 08003a24 <_POSIX_Timer_TSR>: * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { 8003a24: 37 9c ff e8 addi sp,sp,-24 8003a28: 5b 8b 00 10 sw (sp+16),r11 8003a2c: 5b 8c 00 0c sw (sp+12),r12 8003a30: 5b 8d 00 08 sw (sp+8),r13 8003a34: 5b 9d 00 04 sw (sp+4),ra bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 8003a38: 28 41 00 68 lw r1,(r2+104) * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { 8003a3c: b8 40 58 00 mv r11,r2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 8003a40: 34 21 00 01 addi r1,r1,1 8003a44: 58 41 00 68 sw (r2+104),r1 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 8003a48: 28 41 00 54 lw r1,(r2+84) 8003a4c: 5c 20 00 03 bne r1,r0,8003a58 <_POSIX_Timer_TSR+0x34> 8003a50: 28 42 00 58 lw r2,(r2+88) 8003a54: 44 41 00 21 be r2,r1,8003ad8 <_POSIX_Timer_TSR+0xb4> <== NEVER TAKEN ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 8003a58: 29 62 00 64 lw r2,(r11+100) 8003a5c: 29 63 00 08 lw r3,(r11+8) 8003a60: 78 04 08 00 mvhi r4,0x800 8003a64: 35 61 00 10 addi r1,r11,16 8003a68: 38 84 3a 24 ori r4,r4,0x3a24 8003a6c: b9 60 28 00 mv r5,r11 8003a70: f8 00 19 91 calli 800a0b4 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 8003a74: 44 20 00 1f be r1,r0,8003af0 <_POSIX_Timer_TSR+0xcc> <== NEVER TAKEN ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 8003a78: 78 02 08 02 mvhi r2,0x802 8003a7c: 38 42 08 c8 ori r2,r2,0x8c8 8003a80: 37 81 00 14 addi r1,sp,20 8003a84: f8 00 04 c0 calli 8004d84 <_TOD_Get_with_nanoseconds> static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 8003a88: 78 05 08 01 mvhi r5,0x801 /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; } 8003a8c: 28 2c 00 04 lw r12,(r1+4) 8003a90: 28 2d 00 00 lw r13,(r1+0) 8003a94: 38 a5 dd 38 ori r5,r5,0xdd38 8003a98: 28 a4 00 00 lw r4,(r5+0) 8003a9c: 34 03 00 00 mvi r3,0 8003aa0: b9 a0 08 00 mv r1,r13 8003aa4: b9 80 10 00 mv r2,r12 8003aa8: f8 00 4d 3b calli 8016f94 <__divdi3> _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 8003aac: 78 05 08 01 mvhi r5,0x801 8003ab0: 38 a5 dd 38 ori r5,r5,0xdd38 8003ab4: 28 a4 00 00 lw r4,(r5+0) static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 8003ab8: 59 62 00 6c sw (r11+108),r2 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 8003abc: b9 a0 08 00 mv r1,r13 8003ac0: b9 80 10 00 mv r2,r12 8003ac4: 34 03 00 00 mvi r3,0 8003ac8: f8 00 4f 35 calli 801779c <__moddi3> 8003acc: 59 62 00 70 sw (r11+112),r2 /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 8003ad0: 34 01 00 03 mvi r1,3 8003ad4: e0 00 00 02 bi 8003adc <_POSIX_Timer_TSR+0xb8> } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 8003ad8: 34 01 00 04 mvi r1,4 <== NOT EXECUTED 8003adc: 31 61 00 3c sb (r11+60),r1 /* * The sending of the signal to the process running the handling function * specified for that signal is simulated */ if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) { 8003ae0: 29 62 00 44 lw r2,(r11+68) 8003ae4: 29 61 00 38 lw r1,(r11+56) 8003ae8: f8 00 18 26 calli 8009b80 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 8003aec: 59 60 00 68 sw (r11+104),r0 } 8003af0: 2b 9d 00 04 lw ra,(sp+4) 8003af4: 2b 8b 00 10 lw r11,(sp+16) 8003af8: 2b 8c 00 0c lw r12,(sp+12) 8003afc: 2b 8d 00 08 lw r13,(sp+8) 8003b00: 37 9c 00 18 addi sp,sp,24 8003b04: c3 a0 00 00 ret =============================================================================== 08011304 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 8011304: 37 9c ff b0 addi sp,sp,-80 8011308: 5b 8b 00 1c sw (sp+28),r11 801130c: 5b 8c 00 18 sw (sp+24),r12 8011310: 5b 8d 00 14 sw (sp+20),r13 8011314: 5b 8e 00 10 sw (sp+16),r14 8011318: 5b 8f 00 0c sw (sp+12),r15 801131c: 5b 90 00 08 sw (sp+8),r16 8011320: 5b 9d 00 04 sw (sp+4),ra siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 8011324: 37 90 00 48 addi r16,sp,72 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 8011328: 20 64 00 ff andi r4,r3,0xff siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 801132c: 34 05 00 01 mvi r5,1 8011330: ba 00 18 00 mv r3,r16 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 8011334: b8 20 68 00 mv r13,r1 8011338: b8 40 58 00 mv r11,r2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 801133c: f8 00 00 37 calli 8011418 <_POSIX_signals_Clear_signals> is_global, true ) ) return false; 8011340: 34 0f 00 00 mvi r15,0 { siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 8011344: 44 20 00 2b be r1,r0,80113f0 <_POSIX_signals_Check_signal+0xec> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 8011348: 34 02 00 01 mvi r2,1 801134c: b9 60 08 00 mv r1,r11 8011350: f8 00 19 7c calli 8017940 <__ashlsi3> 8011354: 78 0c 08 01 mvhi r12,0x801 8011358: b4 2b 08 00 add r1,r1,r11 801135c: 34 02 00 02 mvi r2,2 8011360: f8 00 19 78 calli 8017940 <__ashlsi3> 8011364: 39 8c ae 88 ori r12,r12,0xae88 8011368: b5 81 60 00 add r12,r12,r1 801136c: 29 8e 00 08 lw r14,(r12+8) 8011370: 34 01 00 01 mvi r1,1 8011374: 45 c1 00 1f be r14,r1,80113f0 <_POSIX_signals_Check_signal+0xec><== NEVER TAKEN return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 8011378: 29 af 00 d0 lw r15,(r13+208) api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 801137c: 29 81 00 04 lw r1,(r12+4) /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 8011380: 34 03 00 28 mvi r3,40 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 8011384: b8 2f 08 00 or r1,r1,r15 8011388: 59 a1 00 d0 sw (r13+208),r1 /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 801138c: 78 01 08 01 mvhi r1,0x801 8011390: 38 21 ae 00 ori r1,r1,0xae00 8011394: 28 22 00 10 lw r2,(r1+16) 8011398: 37 81 00 20 addi r1,sp,32 801139c: 34 42 00 20 addi r2,r2,32 80113a0: f8 00 05 23 calli 801282c sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 80113a4: 29 82 00 00 lw r2,(r12+0) 80113a8: 34 01 00 02 mvi r1,2 80113ac: 5c 41 00 06 bne r2,r1,80113c4 <_POSIX_signals_Check_signal+0xc0> case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 80113b0: b9 60 08 00 mv r1,r11 80113b4: ba 00 10 00 mv r2,r16 80113b8: 34 03 00 00 mvi r3,0 80113bc: d9 c0 00 00 call r14 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 80113c0: e0 00 00 03 bi 80113cc <_POSIX_signals_Check_signal+0xc8> default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 80113c4: b9 60 08 00 mv r1,r11 80113c8: d9 c0 00 00 call r14 } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, 80113cc: 78 01 08 01 mvhi r1,0x801 80113d0: 38 21 ae 00 ori r1,r1,0xae00 80113d4: 28 21 00 10 lw r1,(r1+16) 80113d8: 37 82 00 20 addi r2,sp,32 80113dc: 34 03 00 28 mvi r3,40 80113e0: 34 21 00 20 addi r1,r1,32 80113e4: f8 00 05 12 calli 801282c sizeof( Thread_Wait_information )); /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 80113e8: 59 af 00 d0 sw (r13+208),r15 return true; 80113ec: 34 0f 00 01 mvi r15,1 } 80113f0: b9 e0 08 00 mv r1,r15 80113f4: 2b 9d 00 04 lw ra,(sp+4) 80113f8: 2b 8b 00 1c lw r11,(sp+28) 80113fc: 2b 8c 00 18 lw r12,(sp+24) 8011400: 2b 8d 00 14 lw r13,(sp+20) 8011404: 2b 8e 00 10 lw r14,(sp+16) 8011408: 2b 8f 00 0c lw r15,(sp+12) 801140c: 2b 90 00 08 lw r16,(sp+8) 8011410: 37 9c 00 50 addi sp,sp,80 8011414: c3 a0 00 00 ret =============================================================================== 08011b64 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 8011b64: 37 9c ff ec addi sp,sp,-20 8011b68: 5b 8b 00 14 sw (sp+20),r11 8011b6c: 5b 8c 00 10 sw (sp+16),r12 8011b70: 5b 8d 00 0c sw (sp+12),r13 8011b74: 5b 8e 00 08 sw (sp+8),r14 8011b78: 5b 9d 00 04 sw (sp+4),ra 8011b7c: b8 20 60 00 mv r12,r1 clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 8011b80: 90 00 68 00 rcsr r13,IE 8011b84: 34 01 ff fe mvi r1,-2 8011b88: a1 a1 08 00 and r1,r13,r1 8011b8c: d0 01 00 00 wcsr IE,r1 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 8011b90: 34 02 00 01 mvi r2,1 8011b94: b9 80 08 00 mv r1,r12 8011b98: f8 00 17 6a calli 8017940 <__ashlsi3> 8011b9c: b4 2c 70 00 add r14,r1,r12 8011ba0: 34 02 00 02 mvi r2,2 8011ba4: 78 0b 08 01 mvhi r11,0x801 8011ba8: b9 c0 08 00 mv r1,r14 8011bac: f8 00 17 65 calli 8017940 <__ashlsi3> 8011bb0: 39 6b ae 88 ori r11,r11,0xae88 8011bb4: b5 61 08 00 add r1,r11,r1 8011bb8: 28 22 00 00 lw r2,(r1+0) 8011bbc: 34 01 00 02 mvi r1,2 8011bc0: 5c 41 00 0a bne r2,r1,8011be8 <_POSIX_signals_Clear_process_signals+0x84> } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; } _ISR_Enable( level ); } 8011bc4: 34 02 00 02 mvi r2,2 8011bc8: 78 0b 08 01 mvhi r11,0x801 8011bcc: b9 c0 08 00 mv r1,r14 8011bd0: f8 00 17 5c calli 8017940 <__ashlsi3> 8011bd4: 39 6b b0 80 ori r11,r11,0xb080 8011bd8: b5 61 08 00 add r1,r11,r1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8011bdc: 34 22 00 04 addi r2,r1,4 ISR_Level level; _ISR_Disable( level ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 8011be0: 28 21 00 00 lw r1,(r1+0) 8011be4: 5c 22 00 0a bne r1,r2,8011c0c <_POSIX_signals_Clear_process_signals+0xa8><== NEVER TAKEN 8011be8: 35 82 ff ff addi r2,r12,-1 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 8011bec: 78 0b 08 01 mvhi r11,0x801 8011bf0: 34 01 00 01 mvi r1,1 8011bf4: f8 00 17 53 calli 8017940 <__ashlsi3> 8011bf8: 39 6b b0 7c ori r11,r11,0xb07c 8011bfc: 29 62 00 00 lw r2,(r11+0) 8011c00: a4 20 08 00 not r1,r1 8011c04: a0 22 08 00 and r1,r1,r2 8011c08: 59 61 00 00 sw (r11+0),r1 } _ISR_Enable( level ); 8011c0c: d0 0d 00 00 wcsr IE,r13 } 8011c10: 2b 9d 00 04 lw ra,(sp+4) 8011c14: 2b 8b 00 14 lw r11,(sp+20) 8011c18: 2b 8c 00 10 lw r12,(sp+16) 8011c1c: 2b 8d 00 0c lw r13,(sp+12) 8011c20: 2b 8e 00 08 lw r14,(sp+8) 8011c24: 37 9c 00 14 addi sp,sp,20 8011c28: c3 a0 00 00 ret =============================================================================== 0800473c <_POSIX_signals_Get_lowest>: #include static int _POSIX_signals_Get_lowest( sigset_t set ) { 800473c: 37 9c ff f0 addi sp,sp,-16 8004740: 5b 8b 00 10 sw (sp+16),r11 8004744: 5b 8c 00 0c sw (sp+12),r12 8004748: 5b 8d 00 08 sw (sp+8),r13 800474c: 5b 9d 00 04 sw (sp+4),ra int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8004750: 34 0b 00 1b mvi r11,27 #include static int _POSIX_signals_Get_lowest( sigset_t set ) { 8004754: b8 20 60 00 mv r12,r1 int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8004758: 34 0d 00 20 mvi r13,32 800475c: 34 01 00 01 mvi r1,1 8004760: 35 62 ff ff addi r2,r11,-1 8004764: f8 00 46 45 calli 8016078 <__ashlsi3> if ( set & signo_to_mask( signo ) ) { 8004768: a0 2c 08 00 and r1,r1,r12 800476c: 5c 20 00 0c bne r1,r0,800479c <_POSIX_signals_Get_lowest+0x60><== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8004770: 35 6b 00 01 addi r11,r11,1 8004774: 5d 6d ff fa bne r11,r13,800475c <_POSIX_signals_Get_lowest+0x20> 8004778: 34 0b 00 01 mvi r11,1 */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 800477c: 34 0d 00 1b mvi r13,27 8004780: 34 01 00 01 mvi r1,1 8004784: 35 62 ff ff addi r2,r11,-1 8004788: f8 00 46 3c calli 8016078 <__ashlsi3> if ( set & signo_to_mask( signo ) ) { 800478c: a0 2c 08 00 and r1,r1,r12 8004790: 5c 20 00 03 bne r1,r0,800479c <_POSIX_signals_Get_lowest+0x60> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 8004794: 35 6b 00 01 addi r11,r11,1 8004798: 5d 6d ff fa bne r11,r13,8004780 <_POSIX_signals_Get_lowest+0x44><== ALWAYS TAKEN * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 800479c: b9 60 08 00 mv r1,r11 80047a0: 2b 9d 00 04 lw ra,(sp+4) 80047a4: 2b 8b 00 10 lw r11,(sp+16) 80047a8: 2b 8c 00 0c lw r12,(sp+12) 80047ac: 2b 8d 00 08 lw r13,(sp+8) 80047b0: 37 9c 00 10 addi sp,sp,16 80047b4: c3 a0 00 00 ret =============================================================================== 0800dae0 <_POSIX_signals_Post_switch_hook>: */ static void _POSIX_signals_Post_switch_hook( Thread_Control *the_thread ) { 800dae0: 37 9c ff e0 addi sp,sp,-32 800dae4: 5b 8b 00 20 sw (sp+32),r11 800dae8: 5b 8c 00 1c sw (sp+28),r12 800daec: 5b 8d 00 18 sw (sp+24),r13 800daf0: 5b 8e 00 14 sw (sp+20),r14 800daf4: 5b 8f 00 10 sw (sp+16),r15 800daf8: 5b 90 00 0c sw (sp+12),r16 800dafc: 5b 91 00 08 sw (sp+8),r17 800db00: 5b 9d 00 04 sw (sp+4),ra POSIX_API_Control *api; int signo; ISR_Level level; int hold_errno; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800db04: 28 2b 01 1c lw r11,(r1+284) /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; 800db08: 78 01 08 01 mvhi r1,0x801 800db0c: 38 21 ae 00 ori r1,r1,0xae00 800db10: 28 21 00 10 lw r1,(r1+16) 800db14: 28 2e 00 34 lw r14,(r1+52) /* * api may be NULL in case of a thread close in progress */ if ( !api ) 800db18: 45 60 00 2e be r11,r0,800dbd0 <_POSIX_signals_Post_switch_hook+0xf0><== NEVER TAKEN * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 800db1c: 78 0d 08 01 mvhi r13,0x801 * * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); 800db20: 34 11 ff fe mvi r17,-2 if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 800db24: 39 ad b0 7c ori r13,r13,0xb07c _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 800db28: 34 10 00 1b mvi r16,27 800db2c: 34 0f 00 20 mvi r15,32 * * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); 800db30: 90 00 08 00 rcsr r1,IE 800db34: a0 31 10 00 and r2,r1,r17 800db38: d0 02 00 00 wcsr IE,r2 if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 800db3c: 29 a3 00 00 lw r3,(r13+0) 800db40: 29 62 00 d4 lw r2,(r11+212) 800db44: b8 62 10 00 or r2,r3,r2 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 800db48: 29 63 00 d0 lw r3,(r11+208) 800db4c: a4 60 18 00 not r3,r3 800db50: a0 43 10 00 and r2,r2,r3 800db54: 5c 40 00 07 bne r2,r0,800db70 <_POSIX_signals_Post_switch_hook+0x90> (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 800db58: d0 01 00 00 wcsr IE,r1 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } _Thread_Executing->Wait.return_code = hold_errno; 800db5c: 78 01 08 01 mvhi r1,0x801 800db60: 38 21 ae 00 ori r1,r1,0xae00 800db64: 28 21 00 10 lw r1,(r1+16) 800db68: 58 2e 00 34 sw (r1+52),r14 800db6c: e0 00 00 19 bi 800dbd0 <_POSIX_signals_Post_switch_hook+0xf0> if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); break; } _ISR_Enable( level ); 800db70: d0 01 00 00 wcsr IE,r1 for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 800db74: 34 0c 00 1b mvi r12,27 _POSIX_signals_Check_signal( api, signo, false ); 800db78: b9 80 10 00 mv r2,r12 800db7c: 34 03 00 00 mvi r3,0 800db80: b9 60 08 00 mv r1,r11 800db84: f8 00 0d e0 calli 8011304 <_POSIX_signals_Check_signal> _POSIX_signals_Check_signal( api, signo, true ); 800db88: b9 80 10 00 mv r2,r12 800db8c: b9 60 08 00 mv r1,r11 800db90: 34 03 00 01 mvi r3,1 _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 800db94: 35 8c 00 01 addi r12,r12,1 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 800db98: f8 00 0d db calli 8011304 <_POSIX_signals_Check_signal> _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 800db9c: 5d 8f ff f7 bne r12,r15,800db78 <_POSIX_signals_Post_switch_hook+0x98> 800dba0: 34 0c 00 01 mvi r12,1 _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 800dba4: b9 80 10 00 mv r2,r12 800dba8: 34 03 00 00 mvi r3,0 800dbac: b9 60 08 00 mv r1,r11 800dbb0: f8 00 0d d5 calli 8011304 <_POSIX_signals_Check_signal> _POSIX_signals_Check_signal( api, signo, true ); 800dbb4: b9 80 10 00 mv r2,r12 800dbb8: b9 60 08 00 mv r1,r11 800dbbc: 34 03 00 01 mvi r3,1 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 800dbc0: 35 8c 00 01 addi r12,r12,1 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 800dbc4: f8 00 0d d0 calli 8011304 <_POSIX_signals_Check_signal> _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 800dbc8: 5d 90 ff f7 bne r12,r16,800dba4 <_POSIX_signals_Post_switch_hook+0xc4> 800dbcc: e3 ff ff d9 bi 800db30 <_POSIX_signals_Post_switch_hook+0x50> _POSIX_signals_Check_signal( api, signo, true ); } } _Thread_Executing->Wait.return_code = hold_errno; } 800dbd0: 2b 9d 00 04 lw ra,(sp+4) 800dbd4: 2b 8b 00 20 lw r11,(sp+32) 800dbd8: 2b 8c 00 1c lw r12,(sp+28) 800dbdc: 2b 8d 00 18 lw r13,(sp+24) 800dbe0: 2b 8e 00 14 lw r14,(sp+20) 800dbe4: 2b 8f 00 10 lw r15,(sp+16) 800dbe8: 2b 90 00 0c lw r16,(sp+12) 800dbec: 2b 91 00 08 lw r17,(sp+8) 800dbf0: 37 9c 00 20 addi sp,sp,32 800dbf4: c3 a0 00 00 ret =============================================================================== 0802615c <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 802615c: 37 9c ff ec addi sp,sp,-20 8026160: 5b 8b 00 14 sw (sp+20),r11 8026164: 5b 8c 00 10 sw (sp+16),r12 8026168: 5b 8d 00 0c sw (sp+12),r13 802616c: 5b 8e 00 08 sw (sp+8),r14 8026170: 5b 9d 00 04 sw (sp+4),ra 8026174: b8 20 58 00 mv r11,r1 8026178: b8 40 70 00 mv r14,r2 POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 802617c: 28 2c 01 1c lw r12,(r1+284) 8026180: 34 42 ff ff addi r2,r2,-1 8026184: 34 01 00 01 mvi r1,1 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 8026188: b8 60 68 00 mv r13,r3 802618c: fb ff 6f 28 calli 8001e2c <__ashlsi3> /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 8026190: 78 03 08 02 mvhi r3,0x802 8026194: 38 63 7a 20 ori r3,r3,0x7a20 8026198: 29 64 00 10 lw r4,(r11+16) 802619c: 28 62 00 00 lw r2,(r3+0) 80261a0: a0 82 18 00 and r3,r4,r2 80261a4: 5c 62 00 1c bne r3,r2,8026214 <_POSIX_signals_Unblock_thread+0xb8> if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 80261a8: 29 62 00 30 lw r2,(r11+48) 80261ac: a0 22 10 00 and r2,r1,r2 80261b0: 5c 40 00 06 bne r2,r0,80261c8 <_POSIX_signals_Unblock_thread+0x6c> 80261b4: 29 82 00 d0 lw r2,(r12+208) /* * This should only be reached via pthread_kill(). */ return false; 80261b8: 34 0c 00 00 mvi r12,0 * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 80261bc: a4 40 10 00 not r2,r2 80261c0: a0 22 08 00 and r1,r1,r2 80261c4: 44 2c 00 39 be r1,r12,80262a8 <_POSIX_signals_Unblock_thread+0x14c> the_thread->Wait.return_code = EINTR; 80261c8: 34 01 00 04 mvi r1,4 80261cc: 59 61 00 34 sw (r11+52),r1 the_info = (siginfo_t *) the_thread->Wait.return_argument; 80261d0: 29 61 00 28 lw r1,(r11+40) if ( !info ) { 80261d4: 5d a0 00 06 bne r13,r0,80261ec <_POSIX_signals_Unblock_thread+0x90> the_info->si_signo = signo; the_info->si_code = SI_USER; 80261d8: 34 02 00 01 mvi r2,1 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 80261dc: 58 2e 00 00 sw (r1+0),r14 the_info->si_code = SI_USER; 80261e0: 58 22 00 04 sw (r1+4),r2 the_info->si_value.sival_int = 0; 80261e4: 58 20 00 08 sw (r1+8),r0 80261e8: e0 00 00 07 bi 8026204 <_POSIX_signals_Unblock_thread+0xa8> } else { *the_info = *info; 80261ec: 29 a3 00 00 lw r3,(r13+0) 80261f0: 29 a2 00 04 lw r2,(r13+4) 80261f4: 29 a4 00 08 lw r4,(r13+8) 80261f8: 58 23 00 00 sw (r1+0),r3 80261fc: 58 22 00 04 sw (r1+4),r2 8026200: 58 24 00 08 sw (r1+8),r4 } _Thread_queue_Extract_with_proxy( the_thread ); 8026204: b9 60 08 00 mv r1,r11 8026208: fb ff 9c 93 calli 800d454 <_Thread_queue_Extract_with_proxy> return true; 802620c: 34 0c 00 01 mvi r12,1 8026210: e0 00 00 26 bi 80262a8 <_POSIX_signals_Unblock_thread+0x14c> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 8026214: 29 82 00 d0 lw r2,(r12+208) } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 8026218: 34 0c 00 00 mvi r12,0 } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 802621c: a4 40 10 00 not r2,r2 8026220: a0 22 08 00 and r1,r1,r2 8026224: 44 20 00 21 be r1,r0,80262a8 <_POSIX_signals_Unblock_thread+0x14c> 8026228: 78 01 10 00 mvhi r1,0x1000 802622c: a0 81 08 00 and r1,r4,r1 * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) { 8026230: 44 20 00 15 be r1,r0,8026284 <_POSIX_signals_Unblock_thread+0x128> */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 8026234: 78 02 08 02 mvhi r2,0x802 the_thread->Wait.return_code = EINTR; 8026238: 34 01 00 04 mvi r1,4 802623c: 38 42 77 dc ori r2,r2,0x77dc 8026240: 59 61 00 34 sw (r11+52),r1 8026244: 28 41 00 00 lw r1,(r2+0) 8026248: a0 81 08 00 and r1,r4,r1 /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) 802624c: 44 20 00 04 be r1,r0,802625c <_POSIX_signals_Unblock_thread+0x100> _Thread_queue_Extract_with_proxy( the_thread ); 8026250: b9 60 08 00 mv r1,r11 8026254: fb ff 9c 80 calli 800d454 <_Thread_queue_Extract_with_proxy> 8026258: e0 00 00 14 bi 80262a8 <_POSIX_signals_Unblock_thread+0x14c> */ RTEMS_INLINE_ROUTINE bool _States_Is_delaying ( States_Control the_states ) { return (the_states & STATES_DELAYING); 802625c: 20 84 00 08 andi r4,r4,0x8 else if ( _States_Is_delaying(the_thread->current_state) ) { 8026260: 44 8c 00 12 be r4,r12,80262a8 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); 8026264: 35 61 00 48 addi r1,r11,72 8026268: fb ff 9e 76 calli 800dc40 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 802626c: 78 03 08 02 mvhi r3,0x802 8026270: 38 63 76 50 ori r3,r3,0x7650 8026274: 28 62 00 00 lw r2,(r3+0) 8026278: b9 60 08 00 mv r1,r11 802627c: fb ff 99 23 calli 800c708 <_Thread_Clear_state> 8026280: e0 00 00 0a bi 80262a8 <_POSIX_signals_Unblock_thread+0x14c> _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 8026284: 5c 8c 00 09 bne r4,r12,80262a8 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 8026288: 78 01 08 02 mvhi r1,0x802 802628c: 38 21 9f 00 ori r1,r1,0x9f00 8026290: 28 22 00 08 lw r2,(r1+8) 8026294: 44 4c 00 05 be r2,r12,80262a8 <_POSIX_signals_Unblock_thread+0x14c> 8026298: 28 22 00 10 lw r2,(r1+16) 802629c: 5d 62 00 03 bne r11,r2,80262a8 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN _Thread_Dispatch_necessary = true; 80262a0: 34 02 00 01 mvi r2,1 80262a4: 30 22 00 0c sb (r1+12),r2 } } return false; } 80262a8: b9 80 08 00 mv r1,r12 80262ac: 2b 9d 00 04 lw ra,(sp+4) 80262b0: 2b 8b 00 14 lw r11,(sp+20) 80262b4: 2b 8c 00 10 lw r12,(sp+16) 80262b8: 2b 8d 00 0c lw r13,(sp+12) 80262bc: 2b 8e 00 08 lw r14,(sp+8) 80262c0: 37 9c 00 14 addi sp,sp,20 80262c4: c3 a0 00 00 ret =============================================================================== 0800636c <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 800636c: 37 9c ff e4 addi sp,sp,-28 8006370: 5b 8b 00 1c sw (sp+28),r11 8006374: 5b 8c 00 18 sw (sp+24),r12 8006378: 5b 8d 00 14 sw (sp+20),r13 800637c: 5b 8e 00 10 sw (sp+16),r14 8006380: 5b 8f 00 0c sw (sp+12),r15 8006384: 5b 90 00 08 sw (sp+8),r16 8006388: 5b 9d 00 04 sw (sp+4),ra 800638c: b8 20 70 00 mv r14,r1 8006390: b8 40 58 00 mv r11,r2 RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 8006394: 44 40 00 53 be r2,r0,80064e0 <_RBTree_Extract_unprotected+0x174> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 8006398: 28 21 00 08 lw r1,(r1+8) 800639c: 5c 41 00 05 bne r2,r1,80063b0 <_RBTree_Extract_unprotected+0x44> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); 80063a0: b8 40 08 00 mv r1,r2 80063a4: 34 02 00 01 mvi r2,1 80063a8: f8 00 01 36 calli 8006880 <_RBTree_Next_unprotected> RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 80063ac: 59 c1 00 08 sw (r14+8),r1 } /* Check if max needs to be updated. min=max for 1 element trees so * do not use else if here. */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 80063b0: 29 c1 00 0c lw r1,(r14+12) 80063b4: 5d 61 00 05 bne r11,r1,80063c8 <_RBTree_Extract_unprotected+0x5c> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); 80063b8: b9 60 08 00 mv r1,r11 80063bc: 34 02 00 00 mvi r2,0 80063c0: f8 00 01 30 calli 8006880 <_RBTree_Next_unprotected> RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 80063c4: 59 c1 00 0c sw (r14+12),r1 * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 80063c8: 29 6c 00 04 lw r12,(r11+4) 80063cc: 29 6d 00 08 lw r13,(r11+8) 80063d0: 45 80 00 2b be r12,r0,800647c <_RBTree_Extract_unprotected+0x110> 80063d4: 5d a0 00 03 bne r13,r0,80063e0 <_RBTree_Extract_unprotected+0x74> 80063d8: e0 00 00 2b bi 8006484 <_RBTree_Extract_unprotected+0x118> target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 80063dc: b8 20 60 00 mv r12,r1 80063e0: 29 81 00 08 lw r1,(r12+8) 80063e4: 5c 20 ff fe bne r1,r0,80063dc <_RBTree_Extract_unprotected+0x70> * target's position (target is the right child of target->parent) * when target vacates it. if there is no child, then target->parent * should become NULL. This may cause the coloring to be violated. * For now we store the color of the node being deleted in victim_color. */ leaf = target->child[RBT_LEFT]; 80063e8: 29 8d 00 04 lw r13,(r12+4) if(leaf) { 80063ec: 45 a1 00 04 be r13,r1,80063fc <_RBTree_Extract_unprotected+0x90> leaf->parent = target->parent; 80063f0: 29 81 00 00 lw r1,(r12+0) 80063f4: 59 a1 00 00 sw (r13+0),r1 80063f8: e0 00 00 03 bi 8006404 <_RBTree_Extract_unprotected+0x98> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 80063fc: b9 80 08 00 mv r1,r12 8006400: fb ff ff 70 calli 80061c0 <_RBTree_Extract_validate_unprotected> } victim_color = target->color; dir = target != target->parent->child[0]; 8006404: 29 90 00 00 lw r16,(r12+0) target->parent->child[dir] = leaf; 8006408: 34 02 00 02 mvi r2,2 leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; 800640c: 29 8f 00 0c lw r15,(r12+12) dir = target != target->parent->child[0]; 8006410: 2a 01 00 04 lw r1,(r16+4) target->parent->child[dir] = leaf; 8006414: fd 81 08 00 cmpne r1,r12,r1 8006418: fb ff ea 3b calli 8000d04 <__ashlsi3> 800641c: b6 01 08 00 add r1,r16,r1 /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 8006420: 29 70 00 00 lw r16,(r11+0) /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; dir = target != target->parent->child[0]; target->parent->child[dir] = leaf; 8006424: 58 2d 00 04 sw (r1+4),r13 /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = target; 8006428: 34 02 00 02 mvi r2,2 victim_color = target->color; dir = target != target->parent->child[0]; target->parent->child[dir] = leaf; /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 800642c: 2a 01 00 04 lw r1,(r16+4) the_node->parent->child[dir] = target; 8006430: fd 61 08 00 cmpne r1,r11,r1 8006434: fb ff ea 34 calli 8000d04 <__ashlsi3> 8006438: b6 01 08 00 add r1,r16,r1 800643c: 58 2c 00 04 sw (r1+4),r12 /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 8006440: 29 61 00 08 lw r1,(r11+8) 8006444: 59 81 00 08 sw (r12+8),r1 if (the_node->child[RBT_RIGHT]) 8006448: 29 61 00 08 lw r1,(r11+8) 800644c: 44 20 00 02 be r1,r0,8006454 <_RBTree_Extract_unprotected+0xe8><== NEVER TAKEN the_node->child[RBT_RIGHT]->parent = target; 8006450: 58 2c 00 00 sw (r1+0),r12 target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 8006454: 29 61 00 04 lw r1,(r11+4) 8006458: 59 81 00 04 sw (r12+4),r1 if (the_node->child[RBT_LEFT]) 800645c: 29 61 00 04 lw r1,(r11+4) 8006460: 44 20 00 02 be r1,r0,8006468 <_RBTree_Extract_unprotected+0xfc> the_node->child[RBT_LEFT]->parent = target; 8006464: 58 2c 00 00 sw (r1+0),r12 /* finally, update the parent node and recolor. target has completely * replaced the_node, and target's child has moved up the tree if needed. * the_node is no longer part of the tree, although it has valid pointers * still. */ target->parent = the_node->parent; 8006468: 29 61 00 00 lw r1,(r11+0) 800646c: 59 81 00 00 sw (r12+0),r1 target->color = the_node->color; 8006470: 29 61 00 0c lw r1,(r11+12) 8006474: 59 81 00 0c sw (r12+12),r1 8006478: e0 00 00 11 bi 80064bc <_RBTree_Extract_unprotected+0x150> * violated. We will fix it later. * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { 800647c: 5d ac 00 03 bne r13,r12,8006488 <_RBTree_Extract_unprotected+0x11c> 8006480: e0 00 00 05 bi 8006494 <_RBTree_Extract_unprotected+0x128> * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 8006484: b9 80 68 00 mv r13,r12 * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { leaf->parent = the_node->parent; 8006488: 29 61 00 00 lw r1,(r11+0) 800648c: 59 a1 00 00 sw (r13+0),r1 8006490: e0 00 00 03 bi 800649c <_RBTree_Extract_unprotected+0x130> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 8006494: b9 60 08 00 mv r1,r11 8006498: fb ff ff 4a calli 80061c0 <_RBTree_Extract_validate_unprotected> } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 800649c: 29 6c 00 00 lw r12,(r11+0) the_node->parent->child[dir] = leaf; 80064a0: 34 02 00 02 mvi r2,2 leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; 80064a4: 29 6f 00 0c lw r15,(r11+12) /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 80064a8: 29 81 00 04 lw r1,(r12+4) the_node->parent->child[dir] = leaf; 80064ac: fd 61 08 00 cmpne r1,r11,r1 80064b0: fb ff ea 15 calli 8000d04 <__ashlsi3> 80064b4: b5 81 08 00 add r1,r12,r1 80064b8: 58 2d 00 04 sw (r1+4),r13 /* fix coloring. leaf has moved up the tree. The color of the deleted * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 80064bc: 5d e0 00 03 bne r15,r0,80064c8 <_RBTree_Extract_unprotected+0x15c> if (leaf) { 80064c0: 45 af 00 02 be r13,r15,80064c8 <_RBTree_Extract_unprotected+0x15c> leaf->color = RBT_BLACK; /* case 2 */ 80064c4: 59 a0 00 0c sw (r13+12),r0 /* Wipe the_node */ _RBTree_Set_off_rbtree(the_node); /* set root to black, if it exists */ if (the_rbtree->root) the_rbtree->root->color = RBT_BLACK; 80064c8: 29 c1 00 04 lw r1,(r14+4) */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; 80064cc: 59 60 00 08 sw (r11+8),r0 80064d0: 59 60 00 04 sw (r11+4),r0 80064d4: 59 60 00 00 sw (r11+0),r0 80064d8: 44 20 00 02 be r1,r0,80064e0 <_RBTree_Extract_unprotected+0x174> 80064dc: 58 20 00 0c sw (r1+12),r0 } 80064e0: 2b 9d 00 04 lw ra,(sp+4) 80064e4: 2b 8b 00 1c lw r11,(sp+28) 80064e8: 2b 8c 00 18 lw r12,(sp+24) 80064ec: 2b 8d 00 14 lw r13,(sp+20) 80064f0: 2b 8e 00 10 lw r14,(sp+16) 80064f4: 2b 8f 00 0c lw r15,(sp+12) 80064f8: 2b 90 00 08 lw r16,(sp+8) 80064fc: 37 9c 00 1c addi sp,sp,28 8006500: c3 a0 00 00 ret =============================================================================== 08006fa0 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 8006fa0: 37 9c ff ec addi sp,sp,-20 8006fa4: 5b 8b 00 14 sw (sp+20),r11 8006fa8: 5b 8c 00 10 sw (sp+16),r12 8006fac: 5b 8d 00 0c sw (sp+12),r13 8006fb0: 5b 8e 00 08 sw (sp+8),r14 8006fb4: 5b 9d 00 04 sw (sp+4),ra 8006fb8: b8 20 58 00 mv r11,r1 8006fbc: b8 80 68 00 mv r13,r4 8006fc0: b8 a0 70 00 mv r14,r5 8006fc4: 20 c6 00 ff andi r6,r6,0xff size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 8006fc8: 44 20 00 0f be r1,r0,8007004 <_RBTree_Initialize+0x64> <== NEVER TAKEN RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 8006fcc: 58 20 00 00 sw (r1+0),r0 the_rbtree->root = NULL; 8006fd0: 58 20 00 04 sw (r1+4),r0 the_rbtree->first[0] = NULL; 8006fd4: 58 20 00 08 sw (r1+8),r0 the_rbtree->first[1] = NULL; 8006fd8: 58 20 00 0c sw (r1+12),r0 the_rbtree->compare_function = compare_function; 8006fdc: 58 22 00 10 sw (r1+16),r2 the_rbtree->is_unique = is_unique; 8006fe0: 30 26 00 14 sb (r1+20),r6 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; 8006fe4: b8 60 60 00 mv r12,r3 while ( count-- ) { 8006fe8: e0 00 00 06 bi 8007000 <_RBTree_Initialize+0x60> _RBTree_Insert_unprotected(the_rbtree, next); 8006fec: b9 80 10 00 mv r2,r12 8006ff0: b9 60 08 00 mv r1,r11 8006ff4: fb ff ff 22 calli 8006c7c <_RBTree_Insert_unprotected> #include #include #include #include void _RBTree_Initialize( 8006ff8: b5 8e 60 00 add r12,r12,r14 8006ffc: 35 ad ff ff addi r13,r13,-1 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 8007000: 5d a0 ff fb bne r13,r0,8006fec <_RBTree_Initialize+0x4c> <== NEVER TAKEN _RBTree_Insert_unprotected(the_rbtree, next); next = (RBTree_Node *) _Addresses_Add_offset( (void *) next, node_size ); } } 8007004: 2b 9d 00 04 lw ra,(sp+4) 8007008: 2b 8b 00 14 lw r11,(sp+20) 800700c: 2b 8c 00 10 lw r12,(sp+16) 8007010: 2b 8d 00 0c lw r13,(sp+12) 8007014: 2b 8e 00 08 lw r14,(sp+8) 8007018: 37 9c 00 14 addi sp,sp,20 800701c: c3 a0 00 00 ret =============================================================================== 080065ec <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 80065ec: 37 9c ff e8 addi sp,sp,-24 80065f0: 5b 8b 00 18 sw (sp+24),r11 80065f4: 5b 8c 00 14 sw (sp+20),r12 80065f8: 5b 8d 00 10 sw (sp+16),r13 80065fc: 5b 8e 00 0c sw (sp+12),r14 8006600: 5b 8f 00 08 sw (sp+8),r15 8006604: 5b 9d 00 04 sw (sp+4),ra if(!the_node) return (RBTree_Node*)-1; 8006608: 34 0d ff ff mvi r13,-1 */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 800660c: b8 20 60 00 mv r12,r1 8006610: b8 40 58 00 mv r11,r2 if(!the_node) return (RBTree_Node*)-1; 8006614: 44 40 00 5a be r2,r0,800677c <_RBTree_Insert_unprotected+0x190> RBTree_Node *iter_node = the_rbtree->root; 8006618: 28 2d 00 04 lw r13,(r1+4) int compare_result; if (!iter_node) { /* special case: first node inserted */ 800661c: b9 a0 78 00 mv r15,r13 8006620: 5d a0 00 2d bne r13,r0,80066d4 <_RBTree_Insert_unprotected+0xe8> the_node->color = RBT_BLACK; 8006624: 58 40 00 0c sw (r2+12),r0 the_rbtree->root = the_node; 8006628: 59 82 00 04 sw (r12+4),r2 the_rbtree->first[0] = the_rbtree->first[1] = the_node; 800662c: 59 82 00 0c sw (r12+12),r2 8006630: 59 82 00 08 sw (r12+8),r2 the_node->parent = (RBTree_Node *) the_rbtree; 8006634: 59 61 00 00 sw (r11+0),r1 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 8006638: 58 40 00 08 sw (r2+8),r0 800663c: 58 40 00 04 sw (r2+4),r0 8006640: e0 00 00 4f bi 800677c <_RBTree_Insert_unprotected+0x190> } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 8006644: 44 20 00 4e be r1,r0,800677c <_RBTree_Insert_unprotected+0x190> return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 8006648: 34 02 00 1f mvi r2,31 800664c: a4 20 08 00 not r1,r1 8006650: fb ff e9 d4 calli 8000da0 <__lshrsi3> if (!iter_node->child[dir]) { 8006654: 34 02 00 02 mvi r2,2 /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 8006658: b8 20 70 00 mv r14,r1 if (!iter_node->child[dir]) { 800665c: fb ff e9 aa calli 8000d04 <__ashlsi3> 8006660: b5 a1 08 00 add r1,r13,r1 8006664: 28 2d 00 04 lw r13,(r1+4) 8006668: 34 22 00 04 addi r2,r1,4 800666c: 5d a0 00 19 bne r13,r0,80066d0 <_RBTree_Insert_unprotected+0xe4> the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 8006670: 59 60 00 08 sw (r11+8),r0 8006674: 59 60 00 04 sw (r11+4),r0 the_node->color = RBT_RED; 8006678: 34 01 00 01 mvi r1,1 800667c: 59 61 00 0c sw (r11+12),r1 iter_node->child[dir] = the_node; 8006680: 58 4b 00 00 sw (r2+0),r11 the_node->parent = iter_node; 8006684: 59 6f 00 00 sw (r11+0),r15 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 8006688: 34 02 00 02 mvi r2,2 800668c: 35 c1 00 02 addi r1,r14,2 8006690: fb ff e9 9d calli 8000d04 <__ashlsi3> 8006694: b5 81 10 00 add r2,r12,r1 /* update min/max */ compare_result = the_rbtree->compare_function( 8006698: 29 83 00 10 lw r3,(r12+16) 800669c: 28 42 00 00 lw r2,(r2+0) 80066a0: b9 60 08 00 mv r1,r11 80066a4: d8 60 00 00 call r3 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 80066a8: 5d cd 00 03 bne r14,r13,80066b4 <_RBTree_Insert_unprotected+0xc8> 80066ac: 49 a1 00 03 bg r13,r1,80066b8 <_RBTree_Insert_unprotected+0xcc> 80066b0: e0 00 00 2b bi 800675c <_RBTree_Insert_unprotected+0x170> (dir && _RBTree_Is_greater(compare_result)) ) { 80066b4: 4c 01 00 2a bge r0,r1,800675c <_RBTree_Insert_unprotected+0x170> the_rbtree->first[dir] = the_node; 80066b8: 35 c1 00 02 addi r1,r14,2 80066bc: 34 02 00 02 mvi r2,2 80066c0: fb ff e9 91 calli 8000d04 <__ashlsi3> 80066c4: b5 81 08 00 add r1,r12,r1 80066c8: 58 2b 00 00 sw (r1+0),r11 80066cc: e0 00 00 24 bi 800675c <_RBTree_Insert_unprotected+0x170> while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { 80066d0: b9 a0 78 00 mv r15,r13 the_node->parent = (RBTree_Node *) the_rbtree; the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); 80066d4: 29 83 00 10 lw r3,(r12+16) 80066d8: b9 a0 10 00 mv r2,r13 80066dc: b9 60 08 00 mv r1,r11 80066e0: d8 60 00 00 call r3 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 80066e4: 41 82 00 14 lbu r2,(r12+20) 80066e8: 5c 40 ff d7 bne r2,r0,8006644 <_RBTree_Insert_unprotected+0x58> 80066ec: e3 ff ff d7 bi 8006648 <_RBTree_Insert_unprotected+0x5c> ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(!(the_node->parent->parent->parent)) return NULL; 80066f0: 29 82 00 00 lw r2,(r12+0) 80066f4: 44 40 00 2b be r2,r0,80067a0 <_RBTree_Insert_unprotected+0x1b4><== NEVER TAKEN { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) 80066f8: 29 82 00 04 lw r2,(r12+4) 80066fc: 5c 22 00 02 bne r1,r2,8006704 <_RBTree_Insert_unprotected+0x118> return the_node->parent->child[RBT_RIGHT]; 8006700: 29 82 00 08 lw r2,(r12+8) */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8006704: 44 40 00 27 be r2,r0,80067a0 <_RBTree_Insert_unprotected+0x1b4> 8006708: 28 43 00 0c lw r3,(r2+12) 800670c: 5c 6e 00 25 bne r3,r14,80067a0 <_RBTree_Insert_unprotected+0x1b4> u = _RBTree_Parent_sibling(the_node); g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { the_node->parent->color = RBT_BLACK; 8006710: 58 20 00 0c sw (r1+12),r0 u->color = RBT_BLACK; 8006714: 58 40 00 0c sw (r2+12),r0 g->color = RBT_RED; 8006718: 59 8e 00 0c sw (r12+12),r14 800671c: b9 80 58 00 mv r11,r12 8006720: e0 00 00 10 bi 8006760 <_RBTree_Insert_unprotected+0x174> RBTree_Direction dir = the_node != the_node->parent->child[0]; RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { _RBTree_Rotate(the_node->parent, pdir); 8006724: b9 e0 10 00 mv r2,r15 8006728: fb ff ff 84 calli 8006538 <_RBTree_Rotate> the_node = the_node->child[pdir]; 800672c: b9 e0 08 00 mv r1,r15 8006730: 34 02 00 02 mvi r2,2 8006734: fb ff e9 74 calli 8000d04 <__ashlsi3> 8006738: b5 61 08 00 add r1,r11,r1 800673c: 28 2b 00 04 lw r11,(r1+4) } the_node->parent->color = RBT_BLACK; 8006740: 29 61 00 00 lw r1,(r11+0) g->color = RBT_RED; /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 8006744: c9 cf 10 00 sub r2,r14,r15 /* ensure node is on the same branch direction as parent */ if (dir != pdir) { _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; } the_node->parent->color = RBT_BLACK; 8006748: 58 20 00 0c sw (r1+12),r0 g->color = RBT_RED; 800674c: 59 8e 00 0c sw (r12+12),r14 /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 8006750: b9 80 08 00 mv r1,r12 8006754: fb ff ff 79 calli 8006538 <_RBTree_Rotate> 8006758: e0 00 00 02 bi 8006760 <_RBTree_Insert_unprotected+0x174> 800675c: 34 0e 00 01 mvi r14,1 _ISR_Disable( level ); return_node = _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); return return_node; } 8006760: 29 61 00 00 lw r1,(r11+0) */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 8006764: 28 2c 00 00 lw r12,(r1+0) 8006768: 45 80 00 04 be r12,r0,8006778 <_RBTree_Insert_unprotected+0x18c> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 800676c: 28 22 00 0c lw r2,(r1+12) 8006770: 5c 4e 00 03 bne r2,r14,800677c <_RBTree_Insert_unprotected+0x190> 8006774: e3 ff ff df bi 80066f0 <_RBTree_Insert_unprotected+0x104> /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 8006778: 59 60 00 0c sw (r11+12),r0 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 800677c: b9 a0 08 00 mv r1,r13 8006780: 2b 9d 00 04 lw ra,(sp+4) 8006784: 2b 8b 00 18 lw r11,(sp+24) 8006788: 2b 8c 00 14 lw r12,(sp+20) 800678c: 2b 8d 00 10 lw r13,(sp+16) 8006790: 2b 8e 00 0c lw r14,(sp+12) 8006794: 2b 8f 00 08 lw r15,(sp+8) 8006798: 37 9c 00 18 addi sp,sp,24 800679c: c3 a0 00 00 ret u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; RBTree_Direction pdir = the_node->parent != g->child[0]; 80067a0: 29 8f 00 04 lw r15,(r12+4) the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 80067a4: 28 22 00 04 lw r2,(r1+4) RBTree_Direction pdir = the_node->parent != g->child[0]; 80067a8: fc 2f 78 00 cmpne r15,r1,r15 the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 80067ac: fd 62 10 00 cmpne r2,r11,r2 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 80067b0: 5c 4f ff dd bne r2,r15,8006724 <_RBTree_Insert_unprotected+0x138> 80067b4: e3 ff ff e3 bi 8006740 <_RBTree_Insert_unprotected+0x154> =============================================================================== 080067ec <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 80067ec: 37 9c ff e8 addi sp,sp,-24 80067f0: 5b 8b 00 18 sw (sp+24),r11 80067f4: 5b 8c 00 14 sw (sp+20),r12 80067f8: 5b 8d 00 10 sw (sp+16),r13 80067fc: 5b 8e 00 0c sw (sp+12),r14 8006800: 5b 8f 00 08 sw (sp+8),r15 8006804: 5b 9d 00 04 sw (sp+4),ra 8006808: b8 40 60 00 mv r12,r2 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 800680c: 64 42 00 00 cmpei r2,r2,0 8006810: b8 20 58 00 mv r11,r1 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 8006814: 34 41 00 02 addi r1,r2,2 8006818: 34 02 00 02 mvi r2,2 800681c: b8 60 70 00 mv r14,r3 8006820: b8 80 68 00 mv r13,r4 8006824: fb ff e9 38 calli 8000d04 <__ashlsi3> 8006828: b5 61 08 00 add r1,r11,r1 800682c: 28 2b 00 00 lw r11,(r1+0) 8006830: e0 00 00 0b bi 800685c <_RBTree_Iterate_unprotected+0x70> RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { stop = (*visitor)( current, dir, visitor_arg ); 8006834: b9 60 08 00 mv r1,r11 8006838: b9 80 10 00 mv r2,r12 800683c: b9 a0 18 00 mv r3,r13 8006840: d9 c0 00 00 call r14 8006844: b8 20 78 00 mv r15,r1 current = _RBTree_Next_unprotected( current, dir ); 8006848: b9 80 10 00 mv r2,r12 800684c: b9 60 08 00 mv r1,r11 8006850: f8 00 00 0c calli 8006880 <_RBTree_Next_unprotected> 8006854: b8 20 58 00 mv r11,r1 { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 8006858: 5d e0 00 02 bne r15,r0,8006860 <_RBTree_Iterate_unprotected+0x74><== NEVER TAKEN 800685c: 5d 60 ff f6 bne r11,r0,8006834 <_RBTree_Iterate_unprotected+0x48> stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); } } 8006860: 2b 9d 00 04 lw ra,(sp+4) 8006864: 2b 8b 00 18 lw r11,(sp+24) 8006868: 2b 8c 00 14 lw r12,(sp+20) 800686c: 2b 8d 00 10 lw r13,(sp+16) 8006870: 2b 8e 00 0c lw r14,(sp+12) 8006874: 2b 8f 00 08 lw r15,(sp+8) 8006878: 37 9c 00 18 addi sp,sp,24 800687c: c3 a0 00 00 ret =============================================================================== 080060e0 <_RBTree_Sibling>: * exists, and NULL if not. */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { 80060e0: b8 20 18 00 mv r3,r1 if(!the_node) return NULL; 80060e4: 34 01 00 00 mvi r1,0 80060e8: 44 60 00 08 be r3,r0,8006108 <_RBTree_Sibling+0x28> if(!(the_node->parent)) return NULL; 80060ec: 28 62 00 00 lw r2,(r3+0) 80060f0: 44 40 00 06 be r2,r0,8006108 <_RBTree_Sibling+0x28> <== NEVER TAKEN if(!(the_node->parent->parent)) return NULL; 80060f4: 28 44 00 00 lw r4,(r2+0) 80060f8: 44 80 00 04 be r4,r0,8006108 <_RBTree_Sibling+0x28> if(the_node == the_node->parent->child[RBT_LEFT]) 80060fc: 28 41 00 04 lw r1,(r2+4) 8006100: 5c 61 00 02 bne r3,r1,8006108 <_RBTree_Sibling+0x28> return the_node->parent->child[RBT_RIGHT]; 8006104: 28 41 00 08 lw r1,(r2+8) else return the_node->parent->child[RBT_LEFT]; } 8006108: c3 a0 00 00 ret =============================================================================== 08004afc <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 8004afc: 37 9c ff f0 addi sp,sp,-16 8004b00: 5b 8b 00 0c sw (sp+12),r11 8004b04: 5b 8c 00 08 sw (sp+8),r12 8004b08: 5b 9d 00 04 sw (sp+4),ra RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 8004b0c: 28 2b 01 18 lw r11,(r1+280) if ( !api ) 8004b10: 45 60 00 1a be r11,r0,8004b78 <_RTEMS_signal_Post_switch_hook+0x7c><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 8004b14: 90 00 08 00 rcsr r1,IE 8004b18: 34 02 ff fe mvi r2,-2 8004b1c: a0 22 10 00 and r2,r1,r2 8004b20: d0 02 00 00 wcsr IE,r2 signal_set = asr->signals_posted; 8004b24: 29 6c 00 14 lw r12,(r11+20) asr->signals_posted = 0; 8004b28: 59 60 00 14 sw (r11+20),r0 _ISR_Enable( level ); 8004b2c: d0 01 00 00 wcsr IE,r1 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 8004b30: 45 80 00 12 be r12,r0,8004b78 <_RTEMS_signal_Post_switch_hook+0x7c> return; asr->nest_level += 1; 8004b34: 29 61 00 1c lw r1,(r11+28) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004b38: 37 83 00 10 addi r3,sp,16 8004b3c: 38 02 ff ff mvu r2,0xffff if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 8004b40: 34 21 00 01 addi r1,r1,1 8004b44: 59 61 00 1c sw (r11+28),r1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004b48: 29 61 00 10 lw r1,(r11+16) 8004b4c: f8 00 01 27 calli 8004fe8 (*asr->handler)( signal_set ); 8004b50: 29 62 00 0c lw r2,(r11+12) 8004b54: b9 80 08 00 mv r1,r12 8004b58: d8 40 00 00 call r2 asr->nest_level -= 1; 8004b5c: 29 61 00 1c lw r1,(r11+28) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004b60: 38 02 ff ff mvu r2,0xffff 8004b64: 37 83 00 10 addi r3,sp,16 asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; 8004b68: 34 21 ff ff addi r1,r1,-1 8004b6c: 59 61 00 1c sw (r11+28),r1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004b70: 2b 81 00 10 lw r1,(sp+16) 8004b74: f8 00 01 1d calli 8004fe8 } 8004b78: 2b 9d 00 04 lw ra,(sp+4) 8004b7c: 2b 8b 00 0c lw r11,(sp+12) 8004b80: 2b 8c 00 08 lw r12,(sp+8) 8004b84: 37 9c 00 10 addi sp,sp,16 8004b88: c3 a0 00 00 ret =============================================================================== 08034370 <_Rate_monotonic_Get_status>: bool _Rate_monotonic_Get_status( Rate_monotonic_Control *the_period, Rate_monotonic_Period_time_t *wall_since_last_period, Thread_CPU_usage_t *cpu_since_last_period ) { 8034370: 37 9c ff e4 addi sp,sp,-28 8034374: 5b 8b 00 14 sw (sp+20),r11 8034378: 5b 8c 00 10 sw (sp+16),r12 803437c: 5b 8d 00 0c sw (sp+12),r13 8034380: 5b 8e 00 08 sw (sp+8),r14 8034384: 5b 9d 00 04 sw (sp+4),ra 8034388: b8 40 70 00 mv r14,r2 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 803438c: 78 02 08 06 mvhi r2,0x806 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 8034390: 28 2c 00 40 lw r12,(r1+64) bool _Rate_monotonic_Get_status( Rate_monotonic_Control *the_period, Rate_monotonic_Period_time_t *wall_since_last_period, Thread_CPU_usage_t *cpu_since_last_period ) { 8034394: b8 20 58 00 mv r11,r1 8034398: 38 42 9f e8 ori r2,r2,0x9fe8 803439c: 37 81 00 18 addi r1,sp,24 80343a0: b8 60 68 00 mv r13,r3 80343a4: fb ff 3f 1f calli 8004020 <_TOD_Get_with_nanoseconds> const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 80343a8: 29 61 00 54 lw r1,(r11+84) case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80343ac: 2b 85 00 1c lw r5,(sp+28) 80343b0: 29 62 00 50 lw r2,(r11+80) 80343b4: 2b 83 00 18 lw r3,(sp+24) 80343b8: c8 a1 08 00 sub r1,r5,r1 80343bc: f4 25 20 00 cmpgu r4,r1,r5 80343c0: c8 62 10 00 sub r2,r3,r2 80343c4: c8 44 10 00 sub r2,r2,r4 80343c8: 59 c2 00 00 sw (r14+0),r2 * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 80343cc: 78 02 08 06 mvhi r2,0x806 80343d0: 38 42 a5 00 ori r2,r2,0xa500 80343d4: 28 47 00 10 lw r7,(r2+16) 80343d8: 59 c1 00 04 sw (r14+4),r1 #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 80343dc: 29 86 00 80 lw r6,(r12+128) 80343e0: 29 84 00 84 lw r4,(r12+132) if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 80343e4: 34 01 00 01 mvi r1,1 * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 80343e8: 5d 87 00 19 bne r12,r7,803444c <_Rate_monotonic_Get_status+0xdc> static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 80343ec: 28 41 00 24 lw r1,(r2+36) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 80343f0: b4 85 28 00 add r5,r4,r5 80343f4: b4 c3 18 00 add r3,r6,r3 80343f8: f4 85 20 00 cmpgu r4,r4,r5 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 80343fc: 28 46 00 20 lw r6,(r2+32) 8034400: c8 a1 08 00 sub r1,r5,r1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8034404: b4 83 20 00 add r4,r4,r3 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8034408: f4 25 28 00 cmpgu r5,r1,r5 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 803440c: 29 62 00 48 lw r2,(r11+72) 8034410: c8 86 20 00 sub r4,r4,r6 8034414: c8 85 20 00 sub r4,r4,r5 8034418: 29 63 00 4c lw r3,(r11+76) /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 803441c: 48 44 00 0b bg r2,r4,8034448 <_Rate_monotonic_Get_status+0xd8><== NEVER TAKEN 8034420: 5c 44 00 02 bne r2,r4,8034428 <_Rate_monotonic_Get_status+0xb8> 8034424: 54 61 00 09 bgu r3,r1,8034448 <_Rate_monotonic_Get_status+0xd8> const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8034428: c8 23 18 00 sub r3,r1,r3 803442c: f4 61 08 00 cmpgu r1,r3,r1 8034430: c8 82 10 00 sub r2,r4,r2 8034434: c8 41 08 00 sub r1,r2,r1 8034438: 59 a1 00 00 sw (r13+0),r1 803443c: 59 a3 00 04 sw (r13+4),r3 if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 8034440: 34 01 00 01 mvi r1,1 8034444: e0 00 00 02 bi 803444c <_Rate_monotonic_Get_status+0xdc> /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) return false; 8034448: 34 01 00 00 mvi r1,0 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 803444c: 2b 9d 00 04 lw ra,(sp+4) 8034450: 2b 8b 00 14 lw r11,(sp+20) 8034454: 2b 8c 00 10 lw r12,(sp+16) 8034458: 2b 8d 00 0c lw r13,(sp+12) 803445c: 2b 8e 00 08 lw r14,(sp+8) 8034460: 37 9c 00 1c addi sp,sp,28 8034464: c3 a0 00 00 ret =============================================================================== 08034838 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 8034838: 37 9c ff f4 addi sp,sp,-12 803483c: 5b 8b 00 08 sw (sp+8),r11 8034840: 5b 9d 00 04 sw (sp+4),ra 8034844: b8 20 10 00 mv r2,r1 8034848: 78 01 08 06 mvhi r1,0x806 803484c: 38 21 ab 30 ori r1,r1,0xab30 8034850: 37 83 00 0c addi r3,sp,12 8034854: fb ff 41 16 calli 8004cac <_Objects_Get> /* * When we get here, the Timer is already off the chain so we do not * have to worry about that -- hence no _Watchdog_Remove(). */ the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 8034858: 2b 82 00 0c lw r2,(sp+12) 803485c: b8 20 58 00 mv r11,r1 8034860: 5c 40 00 22 bne r2,r0,80348e8 <_Rate_monotonic_Timeout+0xb0><== NEVER TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 8034864: 28 21 00 40 lw r1,(r1+64) */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_PERIOD); 8034868: 28 23 00 10 lw r3,(r1+16) 803486c: 20 63 40 00 andi r3,r3,0x4000 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 8034870: 44 62 00 09 be r3,r2,8034894 <_Rate_monotonic_Timeout+0x5c> 8034874: 28 23 00 20 lw r3,(r1+32) 8034878: 29 62 00 08 lw r2,(r11+8) 803487c: 5c 62 00 06 bne r3,r2,8034894 <_Rate_monotonic_Timeout+0x5c> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 8034880: 78 03 08 05 mvhi r3,0x805 8034884: 38 63 97 00 ori r3,r3,0x9700 8034888: 28 62 00 00 lw r2,(r3+0) 803488c: fb ff 62 0a calli 800d0b4 <_Thread_Clear_state> 8034890: e0 00 00 06 bi 80348a8 <_Rate_monotonic_Timeout+0x70> _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { 8034894: 29 62 00 38 lw r2,(r11+56) 8034898: 34 01 00 01 mvi r1,1 803489c: 5c 41 00 0c bne r2,r1,80348cc <_Rate_monotonic_Timeout+0x94> the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 80348a0: 34 01 00 03 mvi r1,3 80348a4: 59 61 00 38 sw (r11+56),r1 _Rate_monotonic_Initiate_statistics( the_period ); 80348a8: b9 60 08 00 mv r1,r11 80348ac: fb ff ff 39 calli 8034590 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 80348b0: 29 61 00 3c lw r1,(r11+60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 80348b4: 35 62 00 10 addi r2,r11,16 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 80348b8: 59 61 00 1c sw (r11+28),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 80348bc: 78 01 08 06 mvhi r1,0x806 80348c0: 38 21 a0 f8 ori r1,r1,0xa0f8 80348c4: fb ff 48 79 calli 8006aa8 <_Watchdog_Insert> 80348c8: e0 00 00 03 bi 80348d4 <_Rate_monotonic_Timeout+0x9c> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 80348cc: 34 01 00 04 mvi r1,4 80348d0: 59 61 00 38 sw (r11+56),r1 * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 80348d4: 78 01 08 06 mvhi r1,0x806 80348d8: 38 21 a0 60 ori r1,r1,0xa060 80348dc: 28 22 00 00 lw r2,(r1+0) --level; 80348e0: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 80348e4: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 80348e8: 2b 9d 00 04 lw ra,(sp+4) 80348ec: 2b 8b 00 08 lw r11,(sp+8) 80348f0: 37 9c 00 0c addi sp,sp,12 80348f4: c3 a0 00 00 ret =============================================================================== 08034468 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 8034468: 37 9c ff e8 addi sp,sp,-24 803446c: 5b 8b 00 08 sw (sp+8),r11 8034470: 5b 9d 00 04 sw (sp+4),ra 8034474: b8 20 58 00 mv r11,r1 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8034478: 28 21 00 58 lw r1,(r1+88) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 803447c: 29 62 00 38 lw r2,(r11+56) /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8034480: 34 21 00 01 addi r1,r1,1 8034484: 59 61 00 58 sw (r11+88),r1 if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 8034488: 34 01 00 04 mvi r1,4 803448c: 5c 41 00 04 bne r2,r1,803449c <_Rate_monotonic_Update_statistics+0x34> stats->missed_count++; 8034490: 29 61 00 5c lw r1,(r11+92) 8034494: 34 21 00 01 addi r1,r1,1 8034498: 59 61 00 5c sw (r11+92),r1 /* * Grab status for time statistics. */ valid_status = 803449c: b9 60 08 00 mv r1,r11 80344a0: 37 82 00 0c addi r2,sp,12 80344a4: 37 83 00 14 addi r3,sp,20 80344a8: fb ff ff b2 calli 8034370 <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 80344ac: 44 20 00 35 be r1,r0,8034580 <_Rate_monotonic_Update_statistics+0x118><== NEVER TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80344b0: 2b 82 00 18 lw r2,(sp+24) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 80344b4: 29 63 00 74 lw r3,(r11+116) 80344b8: 29 64 00 70 lw r4,(r11+112) 80344bc: 2b 81 00 14 lw r1,(sp+20) 80344c0: b4 43 18 00 add r3,r2,r3 80344c4: f4 43 28 00 cmpgu r5,r2,r3 80344c8: b4 24 20 00 add r4,r1,r4 80344cc: 59 63 00 74 sw (r11+116),r3 * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 80344d0: 29 63 00 60 lw r3,(r11+96) 80344d4: b4 a4 20 00 add r4,r5,r4 80344d8: 59 64 00 70 sw (r11+112),r4 80344dc: 48 61 00 05 bg r3,r1,80344f0 <_Rate_monotonic_Update_statistics+0x88> 80344e0: 5c 61 00 06 bne r3,r1,80344f8 <_Rate_monotonic_Update_statistics+0x90><== NEVER TAKEN 80344e4: 29 63 00 64 lw r3,(r11+100) 80344e8: 54 62 00 02 bgu r3,r2,80344f0 <_Rate_monotonic_Update_statistics+0x88> 80344ec: e0 00 00 03 bi 80344f8 <_Rate_monotonic_Update_statistics+0x90> stats->min_cpu_time = executed; 80344f0: 59 61 00 60 sw (r11+96),r1 80344f4: 59 62 00 64 sw (r11+100),r2 if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 80344f8: 29 63 00 68 lw r3,(r11+104) 80344fc: 48 23 00 05 bg r1,r3,8034510 <_Rate_monotonic_Update_statistics+0xa8><== NEVER TAKEN 8034500: 5c 61 00 06 bne r3,r1,8034518 <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN 8034504: 29 63 00 6c lw r3,(r11+108) 8034508: 54 43 00 02 bgu r2,r3,8034510 <_Rate_monotonic_Update_statistics+0xa8> 803450c: e0 00 00 03 bi 8034518 <_Rate_monotonic_Update_statistics+0xb0> stats->max_cpu_time = executed; 8034510: 59 61 00 68 sw (r11+104),r1 8034514: 59 62 00 6c sw (r11+108),r2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8034518: 2b 82 00 10 lw r2,(sp+16) 803451c: 29 63 00 8c lw r3,(r11+140) 8034520: 29 64 00 88 lw r4,(r11+136) 8034524: 2b 81 00 0c lw r1,(sp+12) 8034528: b4 43 18 00 add r3,r2,r3 803452c: f4 43 28 00 cmpgu r5,r2,r3 8034530: b4 24 20 00 add r4,r1,r4 8034534: 59 63 00 8c sw (r11+140),r3 * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 8034538: 29 63 00 78 lw r3,(r11+120) 803453c: b4 a4 20 00 add r4,r5,r4 8034540: 59 64 00 88 sw (r11+136),r4 8034544: 48 61 00 05 bg r3,r1,8034558 <_Rate_monotonic_Update_statistics+0xf0> 8034548: 5c 61 00 06 bne r3,r1,8034560 <_Rate_monotonic_Update_statistics+0xf8><== NEVER TAKEN 803454c: 29 63 00 7c lw r3,(r11+124) 8034550: 54 62 00 02 bgu r3,r2,8034558 <_Rate_monotonic_Update_statistics+0xf0> 8034554: e0 00 00 03 bi 8034560 <_Rate_monotonic_Update_statistics+0xf8> stats->min_wall_time = since_last_period; 8034558: 59 61 00 78 sw (r11+120),r1 803455c: 59 62 00 7c sw (r11+124),r2 if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 8034560: 29 63 00 80 lw r3,(r11+128) 8034564: 48 23 00 05 bg r1,r3,8034578 <_Rate_monotonic_Update_statistics+0x110><== NEVER TAKEN 8034568: 5c 61 00 06 bne r3,r1,8034580 <_Rate_monotonic_Update_statistics+0x118><== NEVER TAKEN 803456c: 29 63 00 84 lw r3,(r11+132) 8034570: 54 43 00 02 bgu r2,r3,8034578 <_Rate_monotonic_Update_statistics+0x110> 8034574: e0 00 00 03 bi 8034580 <_Rate_monotonic_Update_statistics+0x118> stats->max_wall_time = since_last_period; 8034578: 59 61 00 80 sw (r11+128),r1 803457c: 59 62 00 84 sw (r11+132),r2 stats->min_wall_time = since_last_period; if ( since_last_period > stats->max_wall_time ) stats->max_wall_time = since_last_period; #endif } 8034580: 2b 9d 00 04 lw ra,(sp+4) 8034584: 2b 8b 00 08 lw r11,(sp+8) 8034588: 37 9c 00 18 addi sp,sp,24 803458c: c3 a0 00 00 ret =============================================================================== 0800677c <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 800677c: 37 9c ff f8 addi sp,sp,-8 8006780: 5b 8b 00 08 sw (sp+8),r11 8006784: 5b 9d 00 04 sw (sp+4),ra 8006788: b8 20 58 00 mv r11,r1 void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 800678c: 34 01 00 1c mvi r1,28 8006790: f8 00 07 c0 calli 8008690 <_Workspace_Allocate> if ( sched ) { 8006794: 44 20 00 06 be r1,r0,80067ac <_Scheduler_CBS_Allocate+0x30><== NEVER TAKEN the_thread->scheduler_info = sched; 8006798: 59 61 00 88 sw (r11+136),r1 schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 800679c: 34 02 00 02 mvi r2,2 sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); if ( sched ) { the_thread->scheduler_info = sched; schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 80067a0: 58 2b 00 00 sw (r1+0),r11 schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 80067a4: 58 22 00 14 sw (r1+20),r2 schinfo->cbs_server = NULL; 80067a8: 58 20 00 18 sw (r1+24),r0 } return sched; } 80067ac: 2b 9d 00 04 lw ra,(sp+4) 80067b0: 2b 8b 00 08 lw r11,(sp+8) 80067b4: 37 9c 00 08 addi sp,sp,8 80067b8: c3 a0 00 00 ret =============================================================================== 08007f08 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 8007f08: 37 9c ff f4 addi sp,sp,-12 8007f0c: 5b 8b 00 08 sw (sp+8),r11 8007f10: 5b 9d 00 04 sw (sp+4),ra 8007f14: b8 20 58 00 mv r11,r1 Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server_id server_id; /* Put violating task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 8007f18: 28 22 00 ac lw r2,(r1+172) if ( the_thread->real_priority != new_priority ) 8007f1c: 28 21 00 18 lw r1,(r1+24) 8007f20: 44 22 00 02 be r1,r2,8007f28 <_Scheduler_CBS_Budget_callout+0x20><== NEVER TAKEN the_thread->real_priority = new_priority; 8007f24: 59 62 00 18 sw (r11+24),r2 if ( the_thread->current_priority != new_priority ) 8007f28: 29 61 00 14 lw r1,(r11+20) 8007f2c: 44 22 00 04 be r1,r2,8007f3c <_Scheduler_CBS_Budget_callout+0x34><== NEVER TAKEN _Thread_Change_priority(the_thread, new_priority, true); 8007f30: b9 60 08 00 mv r1,r11 8007f34: 34 03 00 01 mvi r3,1 8007f38: f8 00 01 a8 calli 80085d8 <_Thread_Change_priority> /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 8007f3c: 29 6b 00 88 lw r11,(r11+136) if ( sched_info->cbs_server->cbs_budget_overrun ) { 8007f40: 29 61 00 18 lw r1,(r11+24) 8007f44: 28 22 00 0c lw r2,(r1+12) 8007f48: 44 40 00 08 be r2,r0,8007f68 <_Scheduler_CBS_Budget_callout+0x60><== NEVER TAKEN _Scheduler_CBS_Get_server_id( 8007f4c: 28 21 00 00 lw r1,(r1+0) 8007f50: 37 82 00 0c addi r2,sp,12 8007f54: fb ff ff d9 calli 8007eb8 <_Scheduler_CBS_Get_server_id> sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); 8007f58: 29 61 00 18 lw r1,(r11+24) 8007f5c: 28 22 00 0c lw r2,(r1+12) 8007f60: 2b 81 00 0c lw r1,(sp+12) 8007f64: d8 40 00 00 call r2 } } 8007f68: 2b 9d 00 04 lw ra,(sp+4) 8007f6c: 2b 8b 00 08 lw r11,(sp+8) 8007f70: 37 9c 00 0c addi sp,sp,12 8007f74: c3 a0 00 00 ret =============================================================================== 080079d8 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 80079d8: 37 9c ff e8 addi sp,sp,-24 80079dc: 5b 8b 00 18 sw (sp+24),r11 80079e0: 5b 8c 00 14 sw (sp+20),r12 80079e4: 5b 8d 00 10 sw (sp+16),r13 80079e8: 5b 8e 00 0c sw (sp+12),r14 80079ec: 5b 8f 00 08 sw (sp+8),r15 80079f0: 5b 9d 00 04 sw (sp+4),ra 80079f4: b8 20 58 00 mv r11,r1 unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 80079f8: 28 21 00 04 lw r1,(r1+4) int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 80079fc: b8 40 70 00 mv r14,r2 8007a00: b8 60 68 00 mv r13,r3 if ( params->budget <= 0 || params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 8007a04: 34 04 ff ee mvi r4,-18 ) { unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 8007a08: 4c 01 00 2c bge r0,r1,8007ab8 <_Scheduler_CBS_Create_server+0xe0> 8007a0c: 29 61 00 00 lw r1,(r11+0) 8007a10: 4c 01 00 2a bge r0,r1,8007ab8 <_Scheduler_CBS_Create_server+0xe0> params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007a14: 78 01 08 02 mvhi r1,0x802 8007a18: 38 21 30 18 ori r1,r1,0x3018 8007a1c: 28 23 00 00 lw r3,(r1+0) 8007a20: 78 01 08 02 mvhi r1,0x802 8007a24: 38 21 3e e8 ori r1,r1,0x3ee8 8007a28: 28 24 00 00 lw r4,(r1+0) if ( !_Scheduler_CBS_Server_list[i] ) 8007a2c: 34 01 00 00 mvi r1,0 8007a30: e0 00 00 05 bi 8007a44 <_Scheduler_CBS_Create_server+0x6c> 8007a34: 28 82 00 00 lw r2,(r4+0) 8007a38: 34 84 00 04 addi r4,r4,4 8007a3c: 44 40 00 03 be r2,r0,8007a48 <_Scheduler_CBS_Create_server+0x70> params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007a40: 34 21 00 01 addi r1,r1,1 8007a44: 54 61 ff fc bgu r3,r1,8007a34 <_Scheduler_CBS_Create_server+0x5c> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 8007a48: 34 04 ff e6 mvi r4,-26 for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) 8007a4c: 44 23 00 1b be r1,r3,8007ab8 <_Scheduler_CBS_Create_server+0xe0> return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 8007a50: 78 0c 08 02 mvhi r12,0x802 8007a54: 34 02 00 02 mvi r2,2 8007a58: 39 8c 3e e8 ori r12,r12,0x3ee8 } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 8007a5c: 59 a1 00 00 sw (r13+0),r1 _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 8007a60: fb ff e7 4f calli 800179c <__ashlsi3> 8007a64: 29 8f 00 00 lw r15,(r12+0) 8007a68: b5 e1 78 00 add r15,r15,r1 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 8007a6c: 34 01 00 10 mvi r1,16 8007a70: f8 00 09 15 calli 8009ec4 <_Workspace_Allocate> if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 8007a74: 59 e1 00 00 sw (r15+0),r1 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 8007a78: 29 a1 00 00 lw r1,(r13+0) 8007a7c: 29 8c 00 00 lw r12,(r12+0) 8007a80: 34 02 00 02 mvi r2,2 8007a84: fb ff e7 46 calli 800179c <__ashlsi3> 8007a88: b5 81 08 00 add r1,r12,r1 8007a8c: 28 21 00 00 lw r1,(r1+0) if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 8007a90: 34 04 ff ef mvi r4,-17 *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) 8007a94: 44 20 00 09 be r1,r0,8007ab8 <_Scheduler_CBS_Create_server+0xe0><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 8007a98: 29 62 00 00 lw r2,(r11+0) the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 8007a9c: 34 04 00 00 mvi r4,0 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 8007aa0: 58 22 00 04 sw (r1+4),r2 8007aa4: 29 62 00 04 lw r2,(r11+4) the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; 8007aa8: 58 2e 00 0c sw (r1+12),r14 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 8007aac: 58 22 00 08 sw (r1+8),r2 the_server->task_id = -1; 8007ab0: 34 02 ff ff mvi r2,-1 8007ab4: 58 22 00 00 sw (r1+0),r2 the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 8007ab8: b8 80 08 00 mv r1,r4 8007abc: 2b 9d 00 04 lw ra,(sp+4) 8007ac0: 2b 8b 00 18 lw r11,(sp+24) 8007ac4: 2b 8c 00 14 lw r12,(sp+20) 8007ac8: 2b 8d 00 10 lw r13,(sp+16) 8007acc: 2b 8e 00 0c lw r14,(sp+12) 8007ad0: 2b 8f 00 08 lw r15,(sp+8) 8007ad4: 37 9c 00 18 addi sp,sp,24 8007ad8: c3 a0 00 00 ret =============================================================================== 08007b8c <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 8007b8c: 37 9c ff e8 addi sp,sp,-24 8007b90: 5b 8b 00 14 sw (sp+20),r11 8007b94: 5b 8c 00 10 sw (sp+16),r12 8007b98: 5b 8d 00 0c sw (sp+12),r13 8007b9c: 5b 8e 00 08 sw (sp+8),r14 8007ba0: 5b 9d 00 04 sw (sp+4),ra 8007ba4: b8 20 68 00 mv r13,r1 8007ba8: b8 40 60 00 mv r12,r2 Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 8007bac: b8 40 08 00 mv r1,r2 8007bb0: 37 82 00 18 addi r2,sp,24 8007bb4: f8 00 03 f8 calli 8008b94 <_Thread_Get> 8007bb8: b8 20 58 00 mv r11,r1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 8007bbc: 44 20 00 02 be r1,r0,8007bc4 <_Scheduler_CBS_Detach_thread+0x38> _Thread_Enable_dispatch(); 8007bc0: f8 00 03 e9 calli 8008b64 <_Thread_Enable_dispatch> } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 8007bc4: 78 03 08 02 mvhi r3,0x802 8007bc8: 38 63 30 18 ori r3,r3,0x3018 8007bcc: 28 61 00 00 lw r1,(r3+0) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 8007bd0: 34 03 ff ee mvi r3,-18 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { _Thread_Enable_dispatch(); } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 8007bd4: 51 a1 00 1a bgeu r13,r1,8007c3c <_Scheduler_CBS_Detach_thread+0xb0> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 8007bd8: 45 60 00 19 be r11,r0,8007c3c <_Scheduler_CBS_Detach_thread+0xb0> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 8007bdc: 78 03 08 02 mvhi r3,0x802 8007be0: 38 63 3e e8 ori r3,r3,0x3ee8 8007be4: 28 6e 00 00 lw r14,(r3+0) 8007be8: b9 a0 08 00 mv r1,r13 8007bec: 34 02 00 02 mvi r2,2 8007bf0: fb ff e6 eb calli 800179c <__ashlsi3> 8007bf4: b5 c1 08 00 add r1,r14,r1 8007bf8: 28 24 00 00 lw r4,(r1+0) return SCHEDULER_CBS_ERROR_NOSERVER; 8007bfc: 34 03 ff e7 mvi r3,-25 if ( server_id >= _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 8007c00: 44 80 00 0f be r4,r0,8007c3c <_Scheduler_CBS_Detach_thread+0xb0> return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 8007c04: 28 81 00 00 lw r1,(r4+0) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 8007c08: 34 03 ff ee mvi r3,-18 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 8007c0c: 5c 2c 00 0c bne r1,r12,8007c3c <_Scheduler_CBS_Detach_thread+0xb0><== NEVER TAKEN return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 8007c10: 34 01 ff ff mvi r1,-1 8007c14: 58 81 00 00 sw (r4+0),r1 sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 8007c18: 29 61 00 88 lw r1,(r11+136) the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->is_preemptible = the_thread->Start.is_preemptible; return SCHEDULER_CBS_OK; 8007c1c: 34 03 00 00 mvi r3,0 if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 8007c20: 58 20 00 18 sw (r1+24),r0 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 8007c24: 29 61 00 a0 lw r1,(r11+160) 8007c28: 59 61 00 78 sw (r11+120),r1 the_thread->budget_callout = the_thread->Start.budget_callout; 8007c2c: 29 61 00 a4 lw r1,(r11+164) 8007c30: 59 61 00 7c sw (r11+124),r1 the_thread->is_preemptible = the_thread->Start.is_preemptible; 8007c34: 41 61 00 9c lbu r1,(r11+156) 8007c38: 31 61 00 70 sb (r11+112),r1 return SCHEDULER_CBS_OK; } 8007c3c: b8 60 08 00 mv r1,r3 8007c40: 2b 9d 00 04 lw ra,(sp+4) 8007c44: 2b 8b 00 14 lw r11,(sp+20) 8007c48: 2b 8c 00 10 lw r12,(sp+16) 8007c4c: 2b 8d 00 0c lw r13,(sp+12) 8007c50: 2b 8e 00 08 lw r14,(sp+8) 8007c54: 37 9c 00 18 addi sp,sp,24 8007c58: c3 a0 00 00 ret =============================================================================== 08007f78 <_Scheduler_CBS_Initialize>: int _Scheduler_CBS_Initialize(void) { 8007f78: 37 9c ff f8 addi sp,sp,-8 8007f7c: 5b 8b 00 08 sw (sp+8),r11 8007f80: 5b 9d 00 04 sw (sp+4),ra unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); 8007f84: 78 0b 08 02 mvhi r11,0x802 8007f88: 39 6b 30 18 ori r11,r11,0x3018 8007f8c: 29 61 00 00 lw r1,(r11+0) 8007f90: 34 02 00 02 mvi r2,2 8007f94: fb ff e6 02 calli 800179c <__ashlsi3> } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 8007f98: f8 00 07 cb calli 8009ec4 <_Workspace_Allocate> 8007f9c: 78 02 08 02 mvhi r2,0x802 8007fa0: 38 42 3e e8 ori r2,r2,0x3ee8 8007fa4: 58 41 00 00 sw (r2+0),r1 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 8007fa8: 34 02 ff ef mvi r2,-17 int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 8007fac: 44 20 00 09 be r1,r0,8007fd0 <_Scheduler_CBS_Initialize+0x58><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 8007fb0: 29 63 00 00 lw r3,(r11+0) 8007fb4: 34 02 00 00 mvi r2,0 8007fb8: e0 00 00 04 bi 8007fc8 <_Scheduler_CBS_Initialize+0x50> _Scheduler_CBS_Server_list[i] = NULL; 8007fbc: 58 20 00 00 sw (r1+0),r0 unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 8007fc0: 34 42 00 01 addi r2,r2,1 8007fc4: 34 21 00 04 addi r1,r1,4 8007fc8: 54 62 ff fd bgu r3,r2,8007fbc <_Scheduler_CBS_Initialize+0x44> _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 8007fcc: 34 02 00 00 mvi r2,0 } 8007fd0: b8 40 08 00 mv r1,r2 8007fd4: 2b 9d 00 04 lw ra,(sp+4) 8007fd8: 2b 8b 00 08 lw r11,(sp+8) 8007fdc: 37 9c 00 08 addi sp,sp,8 8007fe0: c3 a0 00 00 ret =============================================================================== 080067bc <_Scheduler_CBS_Release_job>: void _Scheduler_CBS_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 80067bc: 37 9c ff fc addi sp,sp,-4 80067c0: 5b 9d 00 04 sw (sp+4),ra 80067c4: b8 40 20 00 mv r4,r2 Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 80067c8: 28 22 00 88 lw r2,(r1+136) ) { Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = 80067cc: 28 43 00 18 lw r3,(r2+24) (Scheduler_CBS_Server *) sched_info->cbs_server; if (deadline) { 80067d0: 44 80 00 13 be r4,r0,800681c <_Scheduler_CBS_Release_job+0x60> 80067d4: 78 02 08 02 mvhi r2,0x802 80067d8: 38 42 1a c8 ori r2,r2,0x1ac8 /* Initializing or shifting deadline. */ if (serv_info) 80067dc: 44 60 00 09 be r3,r0,8006800 <_Scheduler_CBS_Release_job+0x44> new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 80067e0: 28 64 00 04 lw r4,(r3+4) 80067e4: 28 42 00 00 lw r2,(r2+0) 80067e8: 78 05 08 01 mvhi r5,0x801 80067ec: 38 a5 f1 a4 ori r5,r5,0xf1a4 80067f0: b4 44 10 00 add r2,r2,r4 80067f4: 28 a4 00 00 lw r4,(r5+0) 80067f8: a0 44 10 00 and r2,r2,r4 80067fc: e0 00 00 0a bi 8006824 <_Scheduler_CBS_Release_job+0x68> & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 8006800: 28 42 00 00 lw r2,(r2+0) 8006804: b4 82 10 00 add r2,r4,r2 8006808: 78 04 08 01 mvhi r4,0x801 800680c: 38 84 f1 a4 ori r4,r4,0xf1a4 8006810: 28 83 00 00 lw r3,(r4+0) 8006814: a0 43 10 00 and r2,r2,r3 8006818: e0 00 00 05 bi 800682c <_Scheduler_CBS_Release_job+0x70> & ~SCHEDULER_EDF_PRIO_MSB; } else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; 800681c: 28 22 00 ac lw r2,(r1+172) } /* Budget replenishment for the next job. */ if (serv_info) 8006820: 44 64 00 03 be r3,r4,800682c <_Scheduler_CBS_Release_job+0x70><== NEVER TAKEN the_thread->cpu_time_budget = serv_info->parameters.budget; 8006824: 28 63 00 08 lw r3,(r3+8) 8006828: 58 23 00 74 sw (r1+116),r3 the_thread->real_priority = new_priority; 800682c: 58 22 00 18 sw (r1+24),r2 _Thread_Change_priority(the_thread, new_priority, true); 8006830: 34 03 00 01 mvi r3,1 8006834: f8 00 01 3c calli 8006d24 <_Thread_Change_priority> } 8006838: 2b 9d 00 04 lw ra,(sp+4) 800683c: 37 9c 00 04 addi sp,sp,4 8006840: c3 a0 00 00 ret =============================================================================== 08006844 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 8006844: 37 9c ff ec addi sp,sp,-20 8006848: 5b 8b 00 14 sw (sp+20),r11 800684c: 5b 8c 00 10 sw (sp+16),r12 8006850: 5b 8d 00 0c sw (sp+12),r13 8006854: 5b 8e 00 08 sw (sp+8),r14 8006858: 5b 9d 00 04 sw (sp+4),ra 800685c: b8 20 58 00 mv r11,r1 Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server *serv_info; Priority_Control new_priority; _Scheduler_EDF_Enqueue(the_thread); 8006860: f8 00 00 4d calli 8006994 <_Scheduler_EDF_Enqueue> /* TODO: flash critical section? */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 8006864: 29 61 00 88 lw r1,(r11+136) 8006868: 28 2c 00 18 lw r12,(r1+24) * Late unblock rule for deadline-driven tasks. The remaining time to * deadline must be sufficient to serve the remaining computation time * without increased utilization of this task. It might cause a deadline * miss of another task. */ if (serv_info) { 800686c: 45 80 00 15 be r12,r0,80068c0 <_Scheduler_CBS_Unblock+0x7c> time_t deadline = serv_info->parameters.deadline; time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - 8006870: 78 01 08 02 mvhi r1,0x802 8006874: 38 21 1a c8 ori r1,r1,0x1ac8 8006878: 28 21 00 00 lw r1,(r1+0) 800687c: 29 6d 00 18 lw r13,(r11+24) _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 8006880: 29 82 00 04 lw r2,(r12+4) 8006884: c9 a1 08 00 sub r1,r13,r1 8006888: fb ff e8 d2 calli 8000bd0 <__mulsi3> 800688c: b8 20 70 00 mv r14,r1 8006890: 29 82 00 08 lw r2,(r12+8) 8006894: 29 61 00 74 lw r1,(r11+116) 8006898: fb ff e8 ce calli 8000bd0 <__mulsi3> 800689c: 4c 2e 00 09 bge r1,r14,80068c0 <_Scheduler_CBS_Unblock+0x7c> /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 80068a0: 29 62 00 ac lw r2,(r11+172) if ( the_thread->real_priority != new_priority ) 80068a4: 45 a2 00 02 be r13,r2,80068ac <_Scheduler_CBS_Unblock+0x68> the_thread->real_priority = new_priority; 80068a8: 59 62 00 18 sw (r11+24),r2 if ( the_thread->current_priority != new_priority ) 80068ac: 29 61 00 14 lw r1,(r11+20) 80068b0: 44 22 00 04 be r1,r2,80068c0 <_Scheduler_CBS_Unblock+0x7c> _Thread_Change_priority(the_thread, new_priority, true); 80068b4: b9 60 08 00 mv r1,r11 80068b8: 34 03 00 01 mvi r3,1 80068bc: f8 00 01 1a calli 8006d24 <_Thread_Change_priority> * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, 80068c0: 78 0c 08 02 mvhi r12,0x802 80068c4: 39 8c 1e 80 ori r12,r12,0x1e80 80068c8: 29 82 00 14 lw r2,(r12+20) 80068cc: 78 01 08 02 mvhi r1,0x802 80068d0: 38 21 10 1c ori r1,r1,0x101c 80068d4: 28 23 00 30 lw r3,(r1+48) 80068d8: 28 42 00 14 lw r2,(r2+20) 80068dc: 29 61 00 14 lw r1,(r11+20) 80068e0: d8 60 00 00 call r3 80068e4: 4c 01 00 0b bge r0,r1,8006910 <_Scheduler_CBS_Unblock+0xcc> _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 80068e8: 29 81 00 10 lw r1,(r12+16) * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; 80068ec: 59 8b 00 14 sw (r12+20),r11 if ( _Thread_Executing->is_preemptible || 80068f0: 40 21 00 70 lbu r1,(r1+112) 80068f4: 5c 20 00 03 bne r1,r0,8006900 <_Scheduler_CBS_Unblock+0xbc> 80068f8: 29 62 00 14 lw r2,(r11+20) 80068fc: 5c 41 00 05 bne r2,r1,8006910 <_Scheduler_CBS_Unblock+0xcc><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 8006900: 78 01 08 02 mvhi r1,0x802 8006904: 38 21 1e 80 ori r1,r1,0x1e80 8006908: 34 02 00 01 mvi r2,1 800690c: 30 22 00 0c sb (r1+12),r2 } } 8006910: 2b 9d 00 04 lw ra,(sp+4) 8006914: 2b 8b 00 14 lw r11,(sp+20) 8006918: 2b 8c 00 10 lw r12,(sp+16) 800691c: 2b 8d 00 0c lw r13,(sp+12) 8006920: 2b 8e 00 08 lw r14,(sp+8) 8006924: 37 9c 00 14 addi sp,sp,20 8006928: c3 a0 00 00 ret =============================================================================== 0800677c <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 800677c: 37 9c ff f8 addi sp,sp,-8 8006780: 5b 8b 00 08 sw (sp+8),r11 8006784: 5b 9d 00 04 sw (sp+4),ra 8006788: b8 20 58 00 mv r11,r1 void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 800678c: 34 01 00 18 mvi r1,24 8006790: f8 00 07 95 calli 80085e4 <_Workspace_Allocate> if ( sched ) { 8006794: 44 20 00 05 be r1,r0,80067a8 <_Scheduler_EDF_Allocate+0x2c><== NEVER TAKEN the_thread->scheduler_info = sched; 8006798: 59 61 00 88 sw (r11+136),r1 schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 800679c: 34 02 00 02 mvi r2,2 sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); if ( sched ) { the_thread->scheduler_info = sched; schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 80067a0: 58 2b 00 00 sw (r1+0),r11 schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 80067a4: 58 22 00 14 sw (r1+20),r2 } return sched; } 80067a8: 2b 9d 00 04 lw ra,(sp+4) 80067ac: 2b 8b 00 08 lw r11,(sp+8) 80067b0: 37 9c 00 08 addi sp,sp,8 80067b4: c3 a0 00 00 ret =============================================================================== 080069c4 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 80069c4: 37 9c ff f4 addi sp,sp,-12 80069c8: 5b 8b 00 0c sw (sp+12),r11 80069cc: 5b 8c 00 08 sw (sp+8),r12 80069d0: 5b 9d 00 04 sw (sp+4),ra * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( 80069d4: 78 0b 08 02 mvhi r11,0x802 #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 80069d8: b8 20 60 00 mv r12,r1 * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( 80069dc: 39 6b 1e 80 ori r11,r11,0x1e80 void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { _Scheduler_EDF_Enqueue(the_thread); 80069e0: fb ff ff 90 calli 8006820 <_Scheduler_EDF_Enqueue> * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( 80069e4: 29 62 00 14 lw r2,(r11+20) 80069e8: 78 01 08 02 mvhi r1,0x802 80069ec: 38 21 10 18 ori r1,r1,0x1018 80069f0: 28 23 00 30 lw r3,(r1+48) 80069f4: 28 41 00 14 lw r1,(r2+20) 80069f8: 29 82 00 14 lw r2,(r12+20) 80069fc: d8 60 00 00 call r3 8006a00: 4c 20 00 0b bge r1,r0,8006a2c <_Scheduler_EDF_Unblock+0x68> _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 8006a04: 29 61 00 10 lw r1,(r11+16) * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; 8006a08: 59 6c 00 14 sw (r11+20),r12 if ( _Thread_Executing->is_preemptible || 8006a0c: 40 21 00 70 lbu r1,(r1+112) 8006a10: 5c 20 00 03 bne r1,r0,8006a1c <_Scheduler_EDF_Unblock+0x58> 8006a14: 29 82 00 14 lw r2,(r12+20) 8006a18: 5c 41 00 05 bne r2,r1,8006a2c <_Scheduler_EDF_Unblock+0x68><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 8006a1c: 78 01 08 02 mvhi r1,0x802 8006a20: 38 21 1e 80 ori r1,r1,0x1e80 8006a24: 34 02 00 01 mvi r2,1 8006a28: 30 22 00 0c sb (r1+12),r2 } } 8006a2c: 2b 9d 00 04 lw ra,(sp+4) 8006a30: 2b 8b 00 0c lw r11,(sp+12) 8006a34: 2b 8c 00 08 lw r12,(sp+8) 8006a38: 37 9c 00 0c addi sp,sp,12 8006a3c: c3 a0 00 00 ret =============================================================================== 08007070 <_Scheduler_priority_Block>: #include void _Scheduler_priority_Block( Thread_Control *the_thread ) { 8007070: 37 9c ff ec addi sp,sp,-20 8007074: 5b 8b 00 14 sw (sp+20),r11 8007078: 5b 8c 00 10 sw (sp+16),r12 800707c: 5b 8d 00 0c sw (sp+12),r13 8007080: 5b 8e 00 08 sw (sp+8),r14 8007084: 5b 9d 00 04 sw (sp+4),ra 8007088: b8 20 60 00 mv r12,r1 ) { Scheduler_priority_Per_thread *sched_info; Chain_Control *ready; sched_info = (Scheduler_priority_Per_thread *) the_thread->scheduler_info; 800708c: 28 21 00 88 lw r1,(r1+136) ready = sched_info->ready_chain; 8007090: 28 22 00 00 lw r2,(r1+0) if ( _Chain_Has_only_one_node( ready ) ) { 8007094: 28 44 00 00 lw r4,(r2+0) 8007098: 28 43 00 08 lw r3,(r2+8) 800709c: 5c 83 00 12 bne r4,r3,80070e4 <_Scheduler_priority_Block+0x74> RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 80070a0: 34 43 00 04 addi r3,r2,4 head->next = tail; 80070a4: 58 43 00 00 sw (r2+0),r3 RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 80070a8: 28 23 00 04 lw r3,(r1+4) head->previous = NULL; 80070ac: 58 40 00 04 sw (r2+4),r0 tail->previous = head; 80070b0: 58 42 00 08 sw (r2+8),r2 80070b4: 2c 24 00 0e lhu r4,(r1+14) 80070b8: 2c 62 00 00 lhu r2,(r3+0) 80070bc: a0 44 10 00 and r2,r2,r4 80070c0: 0c 62 00 00 sh (r3+0),r2 if ( *the_priority_map->minor == 0 ) 80070c4: 5c 40 00 0c bne r2,r0,80070f4 <_Scheduler_priority_Block+0x84> _Priority_Major_bit_map &= the_priority_map->block_major; 80070c8: 78 02 08 01 mvhi r2,0x801 80070cc: 38 42 ae 40 ori r2,r2,0xae40 80070d0: 2c 43 00 00 lhu r3,(r2+0) 80070d4: 2c 21 00 0c lhu r1,(r1+12) 80070d8: a0 23 08 00 and r1,r1,r3 80070dc: 0c 41 00 00 sh (r2+0),r1 80070e0: e0 00 00 05 bi 80070f4 <_Scheduler_priority_Block+0x84> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 80070e4: 29 82 00 00 lw r2,(r12+0) previous = the_node->previous; 80070e8: 29 81 00 04 lw r1,(r12+4) next->previous = previous; 80070ec: 58 41 00 04 sw (r2+4),r1 previous->next = next; 80070f0: 58 22 00 00 sw (r1+0),r2 RTEMS_INLINE_ROUTINE bool _Thread_Is_heir ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Heir ); 80070f4: 78 01 08 01 mvhi r1,0x801 80070f8: 38 21 ae 00 ori r1,r1,0xae00 _Scheduler_priority_Ready_queue_extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) 80070fc: 28 21 00 14 lw r1,(r1+20) 8007100: 5d 81 00 3b bne r12,r1,80071ec <_Scheduler_priority_Block+0x17c> * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( (Chain_Control *) _Scheduler.information 8007104: 78 01 08 01 mvhi r1,0x801 RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 8007108: 78 02 08 01 mvhi r2,0x801 800710c: 38 21 a0 18 ori r1,r1,0xa018 8007110: 38 42 ae 40 ori r2,r2,0xae40 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 8007114: 28 2e 00 00 lw r14,(r1+0) 8007118: 2c 41 00 00 lhu r1,(r2+0) 800711c: 78 0b 08 01 mvhi r11,0x801 8007120: 34 02 00 ff mvi r2,255 8007124: 20 21 ff ff andi r1,r1,0xffff 8007128: 39 6b 8b 3c ori r11,r11,0x8b3c 800712c: 54 22 00 05 bgu r1,r2,8007140 <_Scheduler_priority_Block+0xd0> 8007130: b5 61 58 00 add r11,r11,r1 8007134: 41 6d 00 00 lbu r13,(r11+0) 8007138: 35 ad 00 08 addi r13,r13,8 800713c: e0 00 00 05 bi 8007150 <_Scheduler_priority_Block+0xe0> 8007140: 34 02 00 08 mvi r2,8 8007144: f8 00 42 4d calli 8017a78 <__lshrsi3> 8007148: b5 61 58 00 add r11,r11,r1 800714c: 41 6d 00 00 lbu r13,(r11+0) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8007150: 34 02 00 01 mvi r2,1 8007154: 78 0b 08 01 mvhi r11,0x801 8007158: b9 a0 08 00 mv r1,r13 800715c: f8 00 41 f9 calli 8017940 <__ashlsi3> 8007160: 39 6b ae 60 ori r11,r11,0xae60 8007164: b5 61 58 00 add r11,r11,r1 8007168: 2d 62 00 00 lhu r2,(r11+0) 800716c: 34 01 00 ff mvi r1,255 8007170: 78 0b 08 01 mvhi r11,0x801 8007174: 39 6b 8b 3c ori r11,r11,0x8b3c 8007178: 54 41 00 05 bgu r2,r1,800718c <_Scheduler_priority_Block+0x11c> 800717c: b5 62 58 00 add r11,r11,r2 8007180: 41 6b 00 00 lbu r11,(r11+0) 8007184: 35 6b 00 08 addi r11,r11,8 8007188: e0 00 00 06 bi 80071a0 <_Scheduler_priority_Block+0x130> 800718c: b8 40 08 00 mv r1,r2 8007190: 34 02 00 08 mvi r2,8 8007194: f8 00 42 39 calli 8017a78 <__lshrsi3> 8007198: b5 61 58 00 add r11,r11,r1 800719c: 41 6b 00 00 lbu r11,(r11+0) return (_Priority_Bits_index( major ) << 4) + 80071a0: 34 02 00 04 mvi r2,4 80071a4: b9 a0 08 00 mv r1,r13 80071a8: f8 00 41 e6 calli 8017940 <__ashlsi3> 80071ac: b5 61 58 00 add r11,r11,r1 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 80071b0: 34 02 00 01 mvi r2,1 80071b4: b9 60 08 00 mv r1,r11 80071b8: f8 00 41 e2 calli 8017940 <__ashlsi3> 80071bc: 34 02 00 02 mvi r2,2 80071c0: b4 2b 08 00 add r1,r1,r11 80071c4: f8 00 41 df calli 8017940 <__ashlsi3> 80071c8: b5 c1 08 00 add r1,r14,r1 _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } 80071cc: 28 23 00 00 lw r3,(r1+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 80071d0: 34 21 00 04 addi r1,r1,4 return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 80071d4: 34 02 00 00 mvi r2,0 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 80071d8: 44 61 00 02 be r3,r1,80071e0 <_Scheduler_priority_Block+0x170><== NEVER TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); 80071dc: b8 60 10 00 mv r2,r3 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 80071e0: 78 01 08 01 mvhi r1,0x801 80071e4: 38 21 ae 00 ori r1,r1,0xae00 80071e8: 58 22 00 14 sw (r1+20),r2 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 80071ec: 78 01 08 01 mvhi r1,0x801 80071f0: 38 21 ae 00 ori r1,r1,0xae00 /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) 80071f4: 28 22 00 10 lw r2,(r1+16) 80071f8: 5d 82 00 03 bne r12,r2,8007204 <_Scheduler_priority_Block+0x194> _Thread_Dispatch_necessary = true; 80071fc: 34 02 00 01 mvi r2,1 8007200: 30 22 00 0c sb (r1+12),r2 } 8007204: 2b 9d 00 04 lw ra,(sp+4) 8007208: 2b 8b 00 14 lw r11,(sp+20) 800720c: 2b 8c 00 10 lw r12,(sp+16) 8007210: 2b 8d 00 0c lw r13,(sp+12) 8007214: 2b 8e 00 08 lw r14,(sp+8) 8007218: 37 9c 00 14 addi sp,sp,20 800721c: c3 a0 00 00 ret =============================================================================== 08007400 <_Scheduler_priority_Schedule>: #include #include #include void _Scheduler_priority_Schedule(void) { 8007400: 37 9c ff f0 addi sp,sp,-16 8007404: 5b 8b 00 10 sw (sp+16),r11 8007408: 5b 8c 00 0c sw (sp+12),r12 800740c: 5b 8d 00 08 sw (sp+8),r13 8007410: 5b 9d 00 04 sw (sp+4),ra * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( (Chain_Control *) _Scheduler.information 8007414: 78 01 08 01 mvhi r1,0x801 RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 8007418: 78 02 08 01 mvhi r2,0x801 800741c: 38 21 a0 18 ori r1,r1,0xa018 8007420: 38 42 ae 40 ori r2,r2,0xae40 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 8007424: 28 2d 00 00 lw r13,(r1+0) 8007428: 2c 41 00 00 lhu r1,(r2+0) 800742c: 78 0b 08 01 mvhi r11,0x801 8007430: 34 02 00 ff mvi r2,255 8007434: 20 21 ff ff andi r1,r1,0xffff 8007438: 39 6b 8b 3c ori r11,r11,0x8b3c 800743c: 54 22 00 05 bgu r1,r2,8007450 <_Scheduler_priority_Schedule+0x50> 8007440: b5 61 58 00 add r11,r11,r1 8007444: 41 6c 00 00 lbu r12,(r11+0) 8007448: 35 8c 00 08 addi r12,r12,8 800744c: e0 00 00 05 bi 8007460 <_Scheduler_priority_Schedule+0x60> 8007450: 34 02 00 08 mvi r2,8 8007454: f8 00 41 89 calli 8017a78 <__lshrsi3> 8007458: b5 61 58 00 add r11,r11,r1 800745c: 41 6c 00 00 lbu r12,(r11+0) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8007460: 34 02 00 01 mvi r2,1 8007464: 78 0b 08 01 mvhi r11,0x801 8007468: b9 80 08 00 mv r1,r12 800746c: f8 00 41 35 calli 8017940 <__ashlsi3> 8007470: 39 6b ae 60 ori r11,r11,0xae60 8007474: b5 61 58 00 add r11,r11,r1 8007478: 2d 62 00 00 lhu r2,(r11+0) 800747c: 34 01 00 ff mvi r1,255 8007480: 78 0b 08 01 mvhi r11,0x801 8007484: 39 6b 8b 3c ori r11,r11,0x8b3c 8007488: 54 41 00 05 bgu r2,r1,800749c <_Scheduler_priority_Schedule+0x9c> 800748c: b5 62 58 00 add r11,r11,r2 8007490: 41 6b 00 00 lbu r11,(r11+0) 8007494: 35 6b 00 08 addi r11,r11,8 8007498: e0 00 00 06 bi 80074b0 <_Scheduler_priority_Schedule+0xb0> 800749c: b8 40 08 00 mv r1,r2 80074a0: 34 02 00 08 mvi r2,8 80074a4: f8 00 41 75 calli 8017a78 <__lshrsi3> 80074a8: b5 61 58 00 add r11,r11,r1 80074ac: 41 6b 00 00 lbu r11,(r11+0) return (_Priority_Bits_index( major ) << 4) + 80074b0: 34 02 00 04 mvi r2,4 80074b4: b9 80 08 00 mv r1,r12 80074b8: f8 00 41 22 calli 8017940 <__ashlsi3> 80074bc: b5 61 58 00 add r11,r11,r1 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 80074c0: 34 02 00 01 mvi r2,1 80074c4: b9 60 08 00 mv r1,r11 80074c8: f8 00 41 1e calli 8017940 <__ashlsi3> 80074cc: 34 02 00 02 mvi r2,2 80074d0: b4 2b 08 00 add r1,r1,r11 80074d4: f8 00 41 1b calli 8017940 <__ashlsi3> 80074d8: b5 a1 08 00 add r1,r13,r1 _Scheduler_priority_Schedule_body(); } 80074dc: 28 23 00 00 lw r3,(r1+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 80074e0: 34 21 00 04 addi r1,r1,4 return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 80074e4: 34 02 00 00 mvi r2,0 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 80074e8: 44 61 00 02 be r3,r1,80074f0 <_Scheduler_priority_Schedule+0xf0><== NEVER TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); 80074ec: b8 60 10 00 mv r2,r3 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 80074f0: 78 01 08 01 mvhi r1,0x801 80074f4: 38 21 ae 00 ori r1,r1,0xae00 80074f8: 58 22 00 14 sw (r1+20),r2 80074fc: 2b 9d 00 04 lw ra,(sp+4) 8007500: 2b 8b 00 10 lw r11,(sp+16) 8007504: 2b 8c 00 0c lw r12,(sp+12) 8007508: 2b 8d 00 08 lw r13,(sp+8) 800750c: 37 9c 00 10 addi sp,sp,16 8007510: c3 a0 00 00 ret =============================================================================== 08007514 <_Scheduler_priority_Tick>: #include #include void _Scheduler_priority_Tick( void ) { 8007514: 37 9c ff f8 addi sp,sp,-8 8007518: 5b 8b 00 08 sw (sp+8),r11 800751c: 5b 9d 00 04 sw (sp+4),ra Thread_Control *executing; executing = _Thread_Executing; 8007520: 78 01 08 01 mvhi r1,0x801 8007524: 38 21 ae 00 ori r1,r1,0xae00 8007528: 28 2b 00 10 lw r11,(r1+16) /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 800752c: 41 61 00 70 lbu r1,(r11+112) 8007530: 44 20 00 1e be r1,r0,80075a8 <_Scheduler_priority_Tick+0x94> return; if ( !_States_Is_ready( executing->current_state ) ) 8007534: 29 61 00 10 lw r1,(r11+16) 8007538: 5c 20 00 1c bne r1,r0,80075a8 <_Scheduler_priority_Tick+0x94> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 800753c: 29 61 00 78 lw r1,(r11+120) 8007540: 44 20 00 1a be r1,r0,80075a8 <_Scheduler_priority_Tick+0x94> 8007544: 34 02 00 02 mvi r2,2 8007548: 50 41 00 04 bgeu r2,r1,8007558 <_Scheduler_priority_Tick+0x44> 800754c: 34 02 00 03 mvi r2,3 8007550: 5c 22 00 16 bne r1,r2,80075a8 <_Scheduler_priority_Tick+0x94><== NEVER TAKEN 8007554: e0 00 00 0e bi 800758c <_Scheduler_priority_Tick+0x78> case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: #endif if ( (int)(--executing->cpu_time_budget) <= 0 ) { 8007558: 29 61 00 74 lw r1,(r11+116) 800755c: 34 21 ff ff addi r1,r1,-1 8007560: 59 61 00 74 sw (r11+116),r1 8007564: 48 20 00 11 bg r1,r0,80075a8 <_Scheduler_priority_Tick+0x94> * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield(); 8007568: 78 01 08 01 mvhi r1,0x801 800756c: 38 21 a0 18 ori r1,r1,0xa018 8007570: 28 21 00 0c lw r1,(r1+12) 8007574: d8 20 00 00 call r1 * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Scheduler_Yield(); executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 8007578: 78 01 08 01 mvhi r1,0x801 800757c: 38 21 a9 10 ori r1,r1,0xa910 8007580: 28 21 00 00 lw r1,(r1+0) 8007584: 59 61 00 74 sw (r11+116),r1 8007588: e0 00 00 08 bi 80075a8 <_Scheduler_priority_Tick+0x94> } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 800758c: 29 61 00 74 lw r1,(r11+116) 8007590: 34 21 ff ff addi r1,r1,-1 8007594: 59 61 00 74 sw (r11+116),r1 8007598: 5c 20 00 04 bne r1,r0,80075a8 <_Scheduler_priority_Tick+0x94> (*executing->budget_callout)( executing ); 800759c: 29 62 00 7c lw r2,(r11+124) 80075a0: b9 60 08 00 mv r1,r11 80075a4: d8 40 00 00 call r2 break; #endif } } 80075a8: 2b 9d 00 04 lw ra,(sp+4) 80075ac: 2b 8b 00 08 lw r11,(sp+8) 80075b0: 37 9c 00 08 addi sp,sp,8 80075b4: c3 a0 00 00 ret =============================================================================== 08004c00 <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 8004c00: 37 9c ff f0 addi sp,sp,-16 8004c04: 5b 8b 00 10 sw (sp+16),r11 8004c08: 5b 8c 00 0c sw (sp+12),r12 8004c0c: 5b 8d 00 08 sw (sp+8),r13 8004c10: 5b 9d 00 04 sw (sp+4),ra 8004c14: b8 20 58 00 mv r11,r1 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 8004c18: 78 01 08 01 mvhi r1,0x801 8004c1c: 38 21 f0 30 ori r1,r1,0xf030 8004c20: 28 22 00 0c lw r2,(r1+12) (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 8004c24: 34 0c 00 00 mvi r12,0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 8004c28: 45 60 00 22 be r11,r0,8004cb0 <_TOD_Validate+0xb0> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 8004c2c: 78 03 08 01 mvhi r3,0x801 8004c30: 38 63 f3 b0 ori r3,r3,0xf3b0 8004c34: 28 61 00 00 lw r1,(r3+0) 8004c38: f8 00 64 49 calli 801dd5c <__udivsi3> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 8004c3c: 29 62 00 18 lw r2,(r11+24) 8004c40: 50 41 00 1c bgeu r2,r1,8004cb0 <_TOD_Validate+0xb0> (the_tod->ticks >= ticks_per_second) || 8004c44: 29 62 00 14 lw r2,(r11+20) 8004c48: 34 01 00 3b mvi r1,59 8004c4c: 54 41 00 19 bgu r2,r1,8004cb0 <_TOD_Validate+0xb0> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 8004c50: 29 62 00 10 lw r2,(r11+16) 8004c54: 54 41 00 17 bgu r2,r1,8004cb0 <_TOD_Validate+0xb0> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 8004c58: 29 62 00 0c lw r2,(r11+12) 8004c5c: 34 01 00 17 mvi r1,23 8004c60: 54 41 00 14 bgu r2,r1,8004cb0 <_TOD_Validate+0xb0> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 8004c64: 29 61 00 04 lw r1,(r11+4) rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || 8004c68: 44 20 00 12 be r1,r0,8004cb0 <_TOD_Validate+0xb0> <== NEVER TAKEN (the_tod->month == 0) || 8004c6c: 34 02 00 0c mvi r2,12 8004c70: 54 22 00 10 bgu r1,r2,8004cb0 <_TOD_Validate+0xb0> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 8004c74: 29 62 00 00 lw r2,(r11+0) (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || 8004c78: 34 03 07 c3 mvi r3,1987 8004c7c: 50 62 00 0d bgeu r3,r2,8004cb0 <_TOD_Validate+0xb0> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 8004c80: 29 6d 00 08 lw r13,(r11+8) (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 8004c84: 45 a0 00 0b be r13,r0,8004cb0 <_TOD_Validate+0xb0> <== NEVER TAKEN 8004c88: 78 0b 08 01 mvhi r11,0x801 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 8004c8c: 20 42 00 03 andi r2,r2,0x3 8004c90: 39 6b fd 38 ori r11,r11,0xfd38 8004c94: 5c 40 00 02 bne r2,r0,8004c9c <_TOD_Validate+0x9c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 8004c98: 34 21 00 0d addi r1,r1,13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 8004c9c: 34 02 00 02 mvi r2,2 8004ca0: fb ff f1 7c calli 8001290 <__ashlsi3> 8004ca4: b5 61 08 00 add r1,r11,r1 8004ca8: 28 2c 00 00 lw r12,(r1+0) const uint32_t _TOD_Days_per_month[ 2 ][ 13 ] = { { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } }; bool _TOD_Validate( 8004cac: f1 8d 60 00 cmpgeu r12,r12,r13 if ( the_tod->day > days_in_month ) return false; return true; } 8004cb0: b9 80 08 00 mv r1,r12 8004cb4: 2b 9d 00 04 lw ra,(sp+4) 8004cb8: 2b 8b 00 10 lw r11,(sp+16) 8004cbc: 2b 8c 00 0c lw r12,(sp+12) 8004cc0: 2b 8d 00 08 lw r13,(sp+8) 8004cc4: 37 9c 00 10 addi sp,sp,16 8004cc8: c3 a0 00 00 ret =============================================================================== 080077b0 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 80077b0: 37 9c ff e8 addi sp,sp,-24 80077b4: 5b 8b 00 18 sw (sp+24),r11 80077b8: 5b 8c 00 14 sw (sp+20),r12 80077bc: 5b 8d 00 10 sw (sp+16),r13 80077c0: 5b 8e 00 0c sw (sp+12),r14 80077c4: 5b 8f 00 08 sw (sp+8),r15 80077c8: 5b 9d 00 04 sw (sp+4),ra 80077cc: b8 20 58 00 mv r11,r1 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 80077d0: 28 2f 00 10 lw r15,(r1+16) void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 80077d4: b8 40 60 00 mv r12,r2 80077d8: 20 6e 00 ff andi r14,r3,0xff /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 80077dc: f8 00 03 42 calli 80084e4 <_Thread_Set_transient> /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) 80077e0: 29 61 00 14 lw r1,(r11+20) 80077e4: 44 2c 00 04 be r1,r12,80077f4 <_Thread_Change_priority+0x44> _Thread_Set_priority( the_thread, new_priority ); 80077e8: b9 60 08 00 mv r1,r11 80077ec: b9 80 10 00 mv r2,r12 80077f0: f8 00 03 1d calli 8008464 <_Thread_Set_priority> _ISR_Disable( level ); 80077f4: 90 00 60 00 rcsr r12,IE 80077f8: 34 0d ff fe mvi r13,-2 80077fc: a1 8d 68 00 and r13,r12,r13 8007800: d0 0d 00 00 wcsr IE,r13 /* * If the thread has more than STATES_TRANSIENT set, then it is blocked, * If it is blocked on a thread queue, then we need to requeue it. */ state = the_thread->current_state; 8007804: 29 61 00 10 lw r1,(r11+16) if ( state != STATES_TRANSIENT ) { 8007808: 34 03 00 04 mvi r3,4 800780c: 21 e2 00 04 andi r2,r15,0x4 8007810: 44 23 00 0f be r1,r3,800784c <_Thread_Change_priority+0x9c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 8007814: 5c 40 00 04 bne r2,r0,8007824 <_Thread_Change_priority+0x74><== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 8007818: 34 02 ff fb mvi r2,-5 800781c: a0 22 10 00 and r2,r1,r2 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 8007820: 59 62 00 10 sw (r11+16),r2 _ISR_Enable( level ); 8007824: d0 0c 00 00 wcsr IE,r12 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 8007828: 78 03 08 01 mvhi r3,0x801 800782c: 38 63 8c 8c ori r3,r3,0x8c8c 8007830: 28 62 00 00 lw r2,(r3+0) 8007834: a0 22 08 00 and r1,r1,r2 if ( _States_Is_waiting_on_thread_queue( state ) ) { 8007838: 44 20 00 1f be r1,r0,80078b4 <_Thread_Change_priority+0x104> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 800783c: 29 61 00 44 lw r1,(r11+68) 8007840: b9 60 10 00 mv r2,r11 8007844: f8 00 02 d3 calli 8008390 <_Thread_queue_Requeue> 8007848: e0 00 00 1b bi 80078b4 <_Thread_Change_priority+0x104> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 800784c: 5c 40 00 0a bne r2,r0,8007874 <_Thread_Change_priority+0xc4><== NEVER TAKEN 8007850: 78 01 08 01 mvhi r1,0x801 * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 8007854: 59 60 00 10 sw (r11+16),r0 8007858: 38 21 a0 18 ori r1,r1,0xa018 if ( prepend_it ) 800785c: 45 c2 00 03 be r14,r2,8007868 <_Thread_Change_priority+0xb8> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 8007860: 28 22 00 28 lw r2,(r1+40) 8007864: e0 00 00 02 bi 800786c <_Thread_Change_priority+0xbc> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 8007868: 28 22 00 24 lw r2,(r1+36) 800786c: b9 60 08 00 mv r1,r11 8007870: d8 40 00 00 call r2 _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 8007874: d0 0c 00 00 wcsr IE,r12 8007878: d0 0d 00 00 wcsr IE,r13 * This kernel routine implements the scheduling decision logic for * the scheduler. It does NOT dispatch. */ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void ) { _Scheduler.Operations.schedule(); 800787c: 78 01 08 01 mvhi r1,0x801 8007880: 38 21 a0 18 ori r1,r1,0xa018 8007884: 28 21 00 08 lw r1,(r1+8) 8007888: d8 20 00 00 call r1 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 800788c: 78 01 08 01 mvhi r1,0x801 8007890: 38 21 ae 00 ori r1,r1,0xae00 8007894: 28 22 00 10 lw r2,(r1+16) * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Scheduler_Schedule(); if ( !_Thread_Is_executing_also_the_heir() && 8007898: 28 23 00 14 lw r3,(r1+20) 800789c: 44 43 00 05 be r2,r3,80078b0 <_Thread_Change_priority+0x100> 80078a0: 40 42 00 70 lbu r2,(r2+112) 80078a4: 44 40 00 03 be r2,r0,80078b0 <_Thread_Change_priority+0x100> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 80078a8: 34 02 00 01 mvi r2,1 80078ac: 30 22 00 0c sb (r1+12),r2 _ISR_Enable( level ); 80078b0: d0 0c 00 00 wcsr IE,r12 } 80078b4: 2b 9d 00 04 lw ra,(sp+4) 80078b8: 2b 8b 00 18 lw r11,(sp+24) 80078bc: 2b 8c 00 14 lw r12,(sp+20) 80078c0: 2b 8d 00 10 lw r13,(sp+16) 80078c4: 2b 8e 00 0c lw r14,(sp+12) 80078c8: 2b 8f 00 08 lw r15,(sp+8) 80078cc: 37 9c 00 18 addi sp,sp,24 80078d0: c3 a0 00 00 ret =============================================================================== 0800c930 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 800c930: 37 9c ff f8 addi sp,sp,-8 800c934: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 800c938: 37 82 00 08 addi r2,sp,8 800c93c: f8 00 00 99 calli 800cba0 <_Thread_Get> switch ( location ) { 800c940: 2b 82 00 08 lw r2,(sp+8) 800c944: 5c 40 00 0a bne r2,r0,800c96c <_Thread_Delay_ended+0x3c> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 800c948: 78 03 08 02 mvhi r3,0x802 800c94c: 38 63 77 e4 ori r3,r3,0x77e4 800c950: 28 62 00 00 lw r2,(r3+0) 800c954: fb ff ff 6d calli 800c708 <_Thread_Clear_state> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 800c958: 78 01 08 02 mvhi r1,0x802 800c95c: 38 21 9a 78 ori r1,r1,0x9a78 800c960: 28 22 00 00 lw r2,(r1+0) --level; 800c964: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 800c968: 58 22 00 00 sw (r1+0),r2 | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 800c96c: 2b 9d 00 04 lw ra,(sp+4) 800c970: 37 9c 00 08 addi sp,sp,8 800c974: c3 a0 00 00 ret =============================================================================== 0800fad4 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 800fad4: 37 9c ff c0 addi sp,sp,-64 800fad8: 5b 8b 00 38 sw (sp+56),r11 800fadc: 5b 8c 00 34 sw (sp+52),r12 800fae0: 5b 8d 00 30 sw (sp+48),r13 800fae4: 5b 8e 00 2c sw (sp+44),r14 800fae8: 5b 8f 00 28 sw (sp+40),r15 800faec: 5b 90 00 24 sw (sp+36),r16 800faf0: 5b 91 00 20 sw (sp+32),r17 800faf4: 5b 92 00 1c sw (sp+28),r18 800faf8: 5b 93 00 18 sw (sp+24),r19 800fafc: 5b 94 00 14 sw (sp+20),r20 800fb00: 5b 95 00 10 sw (sp+16),r21 800fb04: 5b 96 00 0c sw (sp+12),r22 800fb08: 5b 97 00 08 sw (sp+8),r23 800fb0c: 5b 9d 00 04 sw (sp+4),ra #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; 800fb10: 78 01 08 01 mvhi r1,0x801 800fb14: 38 21 ae 00 ori r1,r1,0xae00 800fb18: 28 2c 00 10 lw r12,(r1+16) _ISR_Disable( level ); 800fb1c: 90 00 18 00 rcsr r3,IE 800fb20: 34 01 ff fe mvi r1,-2 800fb24: a0 61 08 00 and r1,r3,r1 800fb28: d0 01 00 00 wcsr IE,r1 while ( _Thread_Dispatch_necessary == true ) { 800fb2c: 78 0b 08 01 mvhi r11,0x801 * This routine sets thread dispatch level to the * value passed in. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value) { _Thread_Dispatch_disable_level = value; 800fb30: 78 14 08 01 mvhi r20,0x801 #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 800fb34: 78 0f 08 01 mvhi r15,0x801 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 800fb38: 78 13 08 01 mvhi r19,0x801 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 800fb3c: 78 12 08 01 mvhi r18,0x801 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 800fb40: 78 11 08 01 mvhi r17,0x801 { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 800fb44: 78 10 08 01 mvhi r16,0x801 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 800fb48: 39 6b ae 00 ori r11,r11,0xae00 800fb4c: 3a 94 a9 78 ori r20,r20,0xa978 800fb50: 34 15 00 01 mvi r21,1 #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 800fb54: 39 ef a9 10 ori r15,r15,0xa910 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 800fb58: 37 97 00 3c addi r23,sp,60 800fb5c: 3a 73 a9 00 ori r19,r19,0xa900 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 800fb60: 3a 52 a9 e4 ori r18,r18,0xa9e4 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 800fb64: 3a 31 a1 88 ori r17,r17,0xa188 800fb68: 3a 10 a1 8c ori r16,r16,0xa18c #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 800fb6c: 34 16 ff fe mvi r22,-2 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 800fb70: e0 00 00 35 bi 800fc44 <_Thread_Dispatch+0x170> heir = _Thread_Heir; 800fb74: 29 6d 00 14 lw r13,(r11+20) 800fb78: 5a 95 00 00 sw (r20+0),r21 #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 800fb7c: 31 60 00 0c sb (r11+12),r0 _Thread_Executing = heir; 800fb80: 59 6d 00 10 sw (r11+16),r13 /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 800fb84: 45 ac 00 33 be r13,r12,800fc50 <_Thread_Dispatch+0x17c> */ #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) 800fb88: 29 a1 00 78 lw r1,(r13+120) 800fb8c: 5c 35 00 03 bne r1,r21,800fb98 <_Thread_Dispatch+0xc4> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 800fb90: 29 e1 00 00 lw r1,(r15+0) 800fb94: 59 a1 00 74 sw (r13+116),r1 _ISR_Enable( level ); 800fb98: d0 03 00 00 wcsr IE,r3 800fb9c: ba 60 10 00 mv r2,r19 800fba0: ba e0 08 00 mv r1,r23 800fba4: fb ff d8 f0 calli 8005f64 <_TOD_Get_with_nanoseconds> #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 800fba8: 2b 83 00 40 lw r3,(sp+64) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 800fbac: 29 82 00 84 lw r2,(r12+132) 800fbb0: 29 85 00 80 lw r5,(r12+128) 800fbb4: 2b 81 00 3c lw r1,(sp+60) 800fbb8: b4 62 10 00 add r2,r3,r2 800fbbc: f4 62 20 00 cmpgu r4,r3,r2 800fbc0: b4 25 28 00 add r5,r1,r5 800fbc4: b4 85 28 00 add r5,r4,r5 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 800fbc8: 29 64 00 24 lw r4,(r11+36) 800fbcc: 29 66 00 20 lw r6,(r11+32) 800fbd0: c8 44 20 00 sub r4,r2,r4 800fbd4: f4 82 10 00 cmpgu r2,r4,r2 800fbd8: c8 a6 28 00 sub r5,r5,r6 800fbdc: c8 a2 10 00 sub r2,r5,r2 800fbe0: 59 82 00 80 sw (r12+128),r2 800fbe4: 59 84 00 84 sw (r12+132),r4 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 800fbe8: 59 63 00 24 sw (r11+36),r3 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 800fbec: 2a 43 00 00 lw r3,(r18+0) &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 800fbf0: 59 61 00 20 sw (r11+32),r1 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 800fbf4: 44 60 00 05 be r3,r0,800fc08 <_Thread_Dispatch+0x134> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 800fbf8: 28 61 00 00 lw r1,(r3+0) 800fbfc: 59 81 01 14 sw (r12+276),r1 *_Thread_libc_reent = heir->libc_reent; 800fc00: 29 a1 01 14 lw r1,(r13+276) 800fc04: 58 61 00 00 sw (r3+0),r1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 800fc08: 2a 2e 00 00 lw r14,(r17+0) 800fc0c: e0 00 00 06 bi 800fc24 <_Thread_Dispatch+0x150> const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 800fc10: 29 c3 00 08 lw r3,(r14+8) 800fc14: b9 80 08 00 mv r1,r12 800fc18: b9 a0 10 00 mv r2,r13 800fc1c: d8 60 00 00 call r3 800fc20: 29 ce 00 00 lw r14,(r14+0) { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 800fc24: 5d d0 ff fb bne r14,r16,800fc10 <_Thread_Dispatch+0x13c> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 800fc28: 35 81 00 c0 addi r1,r12,192 800fc2c: 35 a2 00 c0 addi r2,r13,192 800fc30: fb ff e4 2c calli 8008ce0 <_CPU_Context_switch> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 800fc34: 29 6c 00 10 lw r12,(r11+16) _ISR_Disable( level ); 800fc38: 90 00 18 00 rcsr r3,IE 800fc3c: a0 76 08 00 and r1,r3,r22 800fc40: d0 01 00 00 wcsr IE,r1 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 800fc44: 41 61 00 0c lbu r1,(r11+12) 800fc48: 20 21 00 ff andi r1,r1,0xff 800fc4c: 5c 20 ff ca bne r1,r0,800fb74 <_Thread_Dispatch+0xa0> 800fc50: 78 01 08 01 mvhi r1,0x801 800fc54: 38 21 a9 78 ori r1,r1,0xa978 800fc58: 58 20 00 00 sw (r1+0),r0 post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 800fc5c: d0 03 00 00 wcsr IE,r3 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 800fc60: 78 01 08 01 mvhi r1,0x801 800fc64: 38 21 a9 e8 ori r1,r1,0xa9e8 { const Chain_Control *chain = &_API_extensions_Post_switch_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 800fc68: 78 0d 08 01 mvhi r13,0x801 800fc6c: 28 2b 00 00 lw r11,(r1+0) 800fc70: 39 ad a9 ec ori r13,r13,0xa9ec 800fc74: e0 00 00 05 bi 800fc88 <_Thread_Dispatch+0x1b4> const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 800fc78: 29 62 00 08 lw r2,(r11+8) 800fc7c: b9 80 08 00 mv r1,r12 800fc80: d8 40 00 00 call r2 800fc84: 29 6b 00 00 lw r11,(r11+0) { const Chain_Control *chain = &_API_extensions_Post_switch_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 800fc88: 5d 6d ff fc bne r11,r13,800fc78 <_Thread_Dispatch+0x1a4> 800fc8c: 2b 9d 00 04 lw ra,(sp+4) 800fc90: 2b 8b 00 38 lw r11,(sp+56) 800fc94: 2b 8c 00 34 lw r12,(sp+52) 800fc98: 2b 8d 00 30 lw r13,(sp+48) 800fc9c: 2b 8e 00 2c lw r14,(sp+44) 800fca0: 2b 8f 00 28 lw r15,(sp+40) 800fca4: 2b 90 00 24 lw r16,(sp+36) 800fca8: 2b 91 00 20 lw r17,(sp+32) 800fcac: 2b 92 00 1c lw r18,(sp+28) 800fcb0: 2b 93 00 18 lw r19,(sp+24) 800fcb4: 2b 94 00 14 lw r20,(sp+20) 800fcb8: 2b 95 00 10 lw r21,(sp+16) 800fcbc: 2b 96 00 0c lw r22,(sp+12) 800fcc0: 2b 97 00 08 lw r23,(sp+8) 800fcc4: 37 9c 00 40 addi sp,sp,64 800fcc8: c3 a0 00 00 ret =============================================================================== 08011a38 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 8011a38: 37 9c ff f4 addi sp,sp,-12 8011a3c: 5b 8b 00 0c sw (sp+12),r11 8011a40: 5b 8c 00 08 sw (sp+8),r12 8011a44: 5b 9d 00 04 sw (sp+4),ra #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 8011a48: 78 01 08 01 mvhi r1,0x801 8011a4c: 38 21 ae 00 ori r1,r1,0xae00 8011a50: 28 2b 00 10 lw r11,(r1+16) /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 8011a54: 29 61 00 a8 lw r1,(r11+168) _ISR_Set_level(level); 8011a58: 64 21 00 00 cmpei r1,r1,0 8011a5c: d0 01 00 00 wcsr IE,r1 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 8011a60: 78 01 08 01 mvhi r1,0x801 8011a64: 38 21 a8 10 ori r1,r1,0xa810 8011a68: 40 2c 00 00 lbu r12,(r1+0) doneConstructors = true; 8011a6c: 34 02 00 01 mvi r2,1 8011a70: 30 22 00 00 sb (r1+0),r2 ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 8011a74: 78 02 08 00 mvhi r2,0x800 8011a78: b9 60 08 00 mv r1,r11 8011a7c: 38 42 87 18 ori r2,r2,0x8718 8011a80: fb ff db 42 calli 8008788 <_User_extensions_Iterate> _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 8011a84: fb ff d7 cf calli 80079c0 <_Thread_Enable_dispatch> /* * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (doCons) /* && (volatile void *)_init) */ { 8011a88: 5d 80 00 02 bne r12,r0,8011a90 <_Thread_Handler+0x58> INIT_NAME (); 8011a8c: fb ff b9 5d calli 8000000 _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 8011a90: 29 61 00 90 lw r1,(r11+144) 8011a94: 5c 20 00 04 bne r1,r0,8011aa4 <_Thread_Handler+0x6c> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 8011a98: 29 62 00 8c lw r2,(r11+140) 8011a9c: 29 61 00 98 lw r1,(r11+152) 8011aa0: e0 00 00 05 bi 8011ab4 <_Thread_Handler+0x7c> executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 8011aa4: 34 02 00 01 mvi r2,1 8011aa8: 5c 22 00 05 bne r1,r2,8011abc <_Thread_Handler+0x84> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 8011aac: 29 62 00 8c lw r2,(r11+140) 8011ab0: 29 61 00 94 lw r1,(r11+148) 8011ab4: d8 40 00 00 call r2 executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 8011ab8: 59 61 00 28 sw (r11+40),r1 } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 8011abc: 78 02 08 00 mvhi r2,0x800 8011ac0: b9 60 08 00 mv r1,r11 8011ac4: 38 42 87 38 ori r2,r2,0x8738 8011ac8: fb ff db 30 calli 8008788 <_User_extensions_Iterate> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 8011acc: 34 01 00 00 mvi r1,0 8011ad0: 34 02 00 01 mvi r2,1 8011ad4: 34 03 00 05 mvi r3,5 8011ad8: fb ff d2 8b calli 8006504 <_Internal_error_Occurred> =============================================================================== 08007d0c <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 8007d0c: 37 9c ff f4 addi sp,sp,-12 8007d10: 5b 8b 00 0c sw (sp+12),r11 8007d14: 5b 8c 00 08 sw (sp+8),r12 8007d18: 5b 9d 00 04 sw (sp+4),ra uint32_t ticks_per_timeslice = 8007d1c: 78 01 08 01 mvhi r1,0x801 8007d20: 38 21 87 ec ori r1,r1,0x87ec #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 8007d24: 28 23 00 28 lw r3,(r1+40) #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = 8007d28: 28 2b 00 14 lw r11,(r1+20) rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 8007d2c: 28 2c 00 08 lw r12,(r1+8) rtems_configuration_get_maximum_extensions(); rtems_stack_allocate_init_hook stack_allocate_init_hook = 8007d30: 28 22 00 24 lw r2,(r1+36) #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 8007d34: 44 60 00 03 be r3,r0,8007d40 <_Thread_Handler_initialization+0x34><== NEVER TAKEN 8007d38: 28 23 00 2c lw r3,(r1+44) 8007d3c: 5c 60 00 05 bne r3,r0,8007d50 <_Thread_Handler_initialization+0x44> rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 8007d40: 34 01 00 00 mvi r1,0 8007d44: 34 02 00 01 mvi r2,1 8007d48: 34 03 00 0e mvi r3,14 8007d4c: fb ff f9 ee calli 8006504 <_Internal_error_Occurred> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 8007d50: 44 40 00 03 be r2,r0,8007d5c <_Thread_Handler_initialization+0x50> (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 8007d54: 28 21 00 04 lw r1,(r1+4) 8007d58: d8 40 00 00 call r2 _Thread_Dispatch_necessary = false; 8007d5c: 78 01 08 01 mvhi r1,0x801 8007d60: 38 21 ae 00 ori r1,r1,0xae00 8007d64: 30 20 00 0c sb (r1+12),r0 _Thread_Executing = NULL; 8007d68: 58 20 00 10 sw (r1+16),r0 _Thread_Heir = NULL; 8007d6c: 58 20 00 14 sw (r1+20),r0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 8007d70: 78 01 08 01 mvhi r1,0x801 8007d74: 38 21 a9 f4 ori r1,r1,0xa9f4 8007d78: 58 2c 00 00 sw (r1+0),r12 _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8007d7c: 78 01 08 01 mvhi r1,0x801 8007d80: 38 21 a9 10 ori r1,r1,0xa910 8007d84: 58 2b 00 00 sw (r1+0),r11 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 8007d88: 78 01 08 01 mvhi r1,0x801 8007d8c: 38 21 aa 68 ori r1,r1,0xaa68 8007d90: 34 02 00 01 mvi r2,1 8007d94: 34 03 00 01 mvi r3,1 8007d98: 34 04 00 01 mvi r4,1 8007d9c: 34 05 01 28 mvi r5,296 8007da0: 34 06 00 00 mvi r6,0 8007da4: 34 07 00 08 mvi r7,8 8007da8: fb ff fb a2 calli 8006c30 <_Objects_Initialize_information> false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 8007dac: 2b 9d 00 04 lw ra,(sp+4) 8007db0: 2b 8b 00 0c lw r11,(sp+12) 8007db4: 2b 8c 00 08 lw r12,(sp+8) 8007db8: 37 9c 00 0c addi sp,sp,12 8007dbc: c3 a0 00 00 ret =============================================================================== 08008598 <_Thread_Stack_Free>: #include void _Thread_Stack_Free( Thread_Control *the_thread ) { 8008598: 37 9c ff fc addi sp,sp,-4 800859c: 5b 9d 00 04 sw (sp+4),ra #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 80085a0: 40 23 00 b0 lbu r3,(r1+176) void _Thread_Stack_Free( Thread_Control *the_thread ) { rtems_stack_free_hook stack_free_hook = 80085a4: 78 02 08 01 mvhi r2,0x801 80085a8: 38 42 87 ec ori r2,r2,0x87ec 80085ac: 28 42 00 2c lw r2,(r2+44) #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 80085b0: 44 60 00 03 be r3,r0,80085bc <_Thread_Stack_Free+0x24> <== NEVER TAKEN * Call ONLY the CPU table stack free hook, or the * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ (*stack_free_hook)( the_thread->Start.Initial_stack.area ); 80085b4: 28 21 00 b8 lw r1,(r1+184) 80085b8: d8 40 00 00 call r2 } 80085bc: 2b 9d 00 04 lw ra,(sp+4) 80085c0: 37 9c 00 04 addi sp,sp,4 80085c4: c3 a0 00 00 ret =============================================================================== 08008050 <_Thread_queue_Enqueue_priority>: Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 8008050: 37 9c ff cc addi sp,sp,-52 8008054: 5b 8b 00 34 sw (sp+52),r11 8008058: 5b 8c 00 30 sw (sp+48),r12 800805c: 5b 8d 00 2c sw (sp+44),r13 8008060: 5b 8e 00 28 sw (sp+40),r14 8008064: 5b 8f 00 24 sw (sp+36),r15 8008068: 5b 90 00 20 sw (sp+32),r16 800806c: 5b 91 00 1c sw (sp+28),r17 8008070: 5b 92 00 18 sw (sp+24),r18 8008074: 5b 93 00 14 sw (sp+20),r19 8008078: 5b 94 00 10 sw (sp+16),r20 800807c: 5b 95 00 0c sw (sp+12),r21 8008080: 5b 96 00 08 sw (sp+8),r22 8008084: 5b 9d 00 04 sw (sp+4),ra Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 8008088: 28 50 00 14 lw r16,(r2+20) Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 800808c: b8 20 68 00 mv r13,r1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8008090: 34 41 00 3c addi r1,r2,60 head->next = tail; 8008094: 58 41 00 38 sw (r2+56),r1 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 8008098: 34 41 00 38 addi r1,r2,56 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; tail->previous = head; 800809c: 58 41 00 40 sw (r2+64),r1 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 80080a0: 58 40 00 3c sw (r2+60),r0 80080a4: b8 40 60 00 mv r12,r2 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 80080a8: ba 00 08 00 mv r1,r16 80080ac: 34 02 00 06 mvi r2,6 80080b0: b8 60 a8 00 mv r21,r3 80080b4: f8 00 3e 71 calli 8017a78 <__lshrsi3> 80080b8: b8 20 70 00 mv r14,r1 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 80080bc: 78 12 08 01 mvhi r18,0x801 RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_reverse_search ( Priority_Control the_priority ) { return ( the_priority & TASK_QUEUE_DATA_REVERSE_SEARCH_MASK ); 80080c0: 22 01 00 20 andi r1,r16,0x20 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; 80080c4: 29 b3 00 38 lw r19,(r13+56) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 80080c8: 3a 52 a0 c0 ori r18,r18,0xa0c0 _ISR_Disable( level ); 80080cc: 34 16 ff fe mvi r22,-2 priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 80080d0: 5c 20 00 2e bne r1,r0,8008188 <_Thread_queue_Enqueue_priority+0x138> goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 80080d4: 34 14 ff fe mvi r20,-2 80080d8: 90 00 78 00 rcsr r15,IE 80080dc: a1 f4 90 00 and r18,r15,r20 80080e0: d0 12 00 00 wcsr IE,r18 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 80080e4: 34 02 00 01 mvi r2,1 80080e8: b9 c0 08 00 mv r1,r14 80080ec: f8 00 3e 15 calli 8017940 <__ashlsi3> 80080f0: b4 2e 08 00 add r1,r1,r14 80080f4: 34 02 00 02 mvi r2,2 80080f8: f8 00 3e 12 calli 8017940 <__ashlsi3> 80080fc: b5 a1 08 00 add r1,r13,r1 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); 8008100: 28 2b 00 00 lw r11,(r1+0) if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 8008104: 34 11 ff ff mvi r17,-1 _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 8008108: e0 00 00 0b bi 8008134 <_Thread_queue_Enqueue_priority+0xe4> search_priority = search_thread->current_priority; 800810c: 29 71 00 14 lw r17,(r11+20) if ( priority <= search_priority ) 8008110: 52 30 00 12 bgeu r17,r16,8008158 <_Thread_queue_Enqueue_priority+0x108> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 8008114: d0 0f 00 00 wcsr IE,r15 8008118: d0 12 00 00 wcsr IE,r18 RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 800811c: 29 61 00 10 lw r1,(r11+16) 8008120: a2 61 08 00 and r1,r19,r1 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8008124: 5c 20 00 03 bne r1,r0,8008130 <_Thread_queue_Enqueue_priority+0xe0><== ALWAYS TAKEN _ISR_Enable( level ); 8008128: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED goto restart_forward_search; 800812c: e3 ff ff eb bi 80080d8 <_Thread_queue_Enqueue_priority+0x88><== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 8008130: 29 6b 00 00 lw r11,(r11+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 8008134: 34 02 00 01 mvi r2,1 8008138: b9 c0 08 00 mv r1,r14 800813c: f8 00 3e 01 calli 8017940 <__ashlsi3> 8008140: b4 2e 08 00 add r1,r1,r14 8008144: 34 02 00 02 mvi r2,2 8008148: f8 00 3d fe calli 8017940 <__ashlsi3> 800814c: b5 a1 08 00 add r1,r13,r1 8008150: 34 21 00 04 addi r1,r1,4 restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 8008154: 5d 61 ff ee bne r11,r1,800810c <_Thread_queue_Enqueue_priority+0xbc> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 8008158: 29 a3 00 30 lw r3,(r13+48) 800815c: 34 02 00 01 mvi r2,1 8008160: b9 e0 08 00 mv r1,r15 8008164: 5c 62 00 3f bne r3,r2,8008260 <_Thread_queue_Enqueue_priority+0x210><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8008168: 59 a0 00 30 sw (r13+48),r0 if ( priority == search_priority ) 800816c: 46 11 00 36 be r16,r17,8008244 <_Thread_queue_Enqueue_priority+0x1f4> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 8008170: 29 61 00 04 lw r1,(r11+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8008174: 59 8b 00 00 sw (r12+0),r11 the_node->previous = previous_node; 8008178: 59 81 00 04 sw (r12+4),r1 previous_node->next = the_node; 800817c: 58 2c 00 00 sw (r1+0),r12 search_node->previous = the_node; 8008180: 59 6c 00 04 sw (r11+4),r12 8008184: e0 00 00 2c bi 8008234 <_Thread_queue_Enqueue_priority+0x1e4> the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 8008188: 42 51 00 00 lbu r17,(r18+0) 800818c: 36 31 00 01 addi r17,r17,1 _ISR_Disable( level ); 8008190: 90 00 78 00 rcsr r15,IE 8008194: a1 f6 a0 00 and r20,r15,r22 8008198: d0 14 00 00 wcsr IE,r20 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 800819c: 34 02 00 01 mvi r2,1 80081a0: b9 c0 08 00 mv r1,r14 80081a4: f8 00 3d e7 calli 8017940 <__ashlsi3> 80081a8: b4 2e 08 00 add r1,r1,r14 80081ac: 34 02 00 02 mvi r2,2 80081b0: f8 00 3d e4 calli 8017940 <__ashlsi3> 80081b4: b5 a1 08 00 add r1,r13,r1 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); 80081b8: 28 2b 00 08 lw r11,(r1+8) while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 80081bc: e0 00 00 0b bi 80081e8 <_Thread_queue_Enqueue_priority+0x198> search_priority = search_thread->current_priority; 80081c0: 29 71 00 14 lw r17,(r11+20) if ( priority >= search_priority ) 80081c4: 52 11 00 11 bgeu r16,r17,8008208 <_Thread_queue_Enqueue_priority+0x1b8> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 80081c8: d0 0f 00 00 wcsr IE,r15 80081cc: d0 14 00 00 wcsr IE,r20 80081d0: 29 61 00 10 lw r1,(r11+16) 80081d4: a2 61 08 00 and r1,r19,r1 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 80081d8: 5c 20 00 03 bne r1,r0,80081e4 <_Thread_queue_Enqueue_priority+0x194><== ALWAYS TAKEN _ISR_Enable( level ); 80081dc: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED goto restart_reverse_search; 80081e0: e3 ff ff ea bi 8008188 <_Thread_queue_Enqueue_priority+0x138><== NOT EXECUTED } search_thread = (Thread_Control *) search_thread->Object.Node.previous; 80081e4: 29 6b 00 04 lw r11,(r11+4) RTEMS_INLINE_ROUTINE bool _Chain_Is_head( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_head( the_chain )); 80081e8: 34 02 00 01 mvi r2,1 80081ec: b9 c0 08 00 mv r1,r14 80081f0: f8 00 3d d4 calli 8017940 <__ashlsi3> 80081f4: b4 2e 08 00 add r1,r1,r14 80081f8: 34 02 00 02 mvi r2,2 80081fc: f8 00 3d d1 calli 8017940 <__ashlsi3> 8008200: b5 a1 08 00 add r1,r13,r1 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8008204: 5d 61 ff ef bne r11,r1,80081c0 <_Thread_queue_Enqueue_priority+0x170> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 8008208: 29 a3 00 30 lw r3,(r13+48) 800820c: 34 02 00 01 mvi r2,1 8008210: b9 e0 08 00 mv r1,r15 8008214: 5c 62 00 13 bne r3,r2,8008260 <_Thread_queue_Enqueue_priority+0x210><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8008218: 59 a0 00 30 sw (r13+48),r0 if ( priority == search_priority ) 800821c: 46 11 00 0a be r16,r17,8008244 <_Thread_queue_Enqueue_priority+0x1f4> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 8008220: 29 61 00 00 lw r1,(r11+0) the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 8008224: 59 8b 00 04 sw (r12+4),r11 search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 8008228: 59 81 00 00 sw (r12+0),r1 the_node->previous = search_node; search_node->next = the_node; 800822c: 59 6c 00 00 sw (r11+0),r12 next_node->previous = the_node; 8008230: 58 2c 00 04 sw (r1+4),r12 the_thread->Wait.queue = the_thread_queue; 8008234: 59 8d 00 44 sw (r12+68),r13 _ISR_Enable( level ); 8008238: d0 0f 00 00 wcsr IE,r15 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 800823c: 34 01 00 01 mvi r1,1 8008240: e0 00 00 0a bi 8008268 <_Thread_queue_Enqueue_priority+0x218> equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 8008244: 29 61 00 40 lw r1,(r11+64) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); 8008248: 35 62 00 3c addi r2,r11,60 previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; 800824c: 59 82 00 00 sw (r12+0),r2 the_node->previous = previous_node; 8008250: 59 81 00 04 sw (r12+4),r1 previous_node->next = the_node; 8008254: 58 2c 00 00 sw (r1+0),r12 search_node->previous = the_node; 8008258: 59 6c 00 40 sw (r11+64),r12 800825c: e3 ff ff f6 bi 8008234 <_Thread_queue_Enqueue_priority+0x1e4> * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 8008260: 5a a1 00 00 sw (r21+0),r1 <== NOT EXECUTED return the_thread_queue->sync_state; 8008264: 29 a1 00 30 lw r1,(r13+48) <== NOT EXECUTED } 8008268: 2b 9d 00 04 lw ra,(sp+4) 800826c: 2b 8b 00 34 lw r11,(sp+52) 8008270: 2b 8c 00 30 lw r12,(sp+48) 8008274: 2b 8d 00 2c lw r13,(sp+44) 8008278: 2b 8e 00 28 lw r14,(sp+40) 800827c: 2b 8f 00 24 lw r15,(sp+36) 8008280: 2b 90 00 20 lw r16,(sp+32) 8008284: 2b 91 00 1c lw r17,(sp+28) 8008288: 2b 92 00 18 lw r18,(sp+24) 800828c: 2b 93 00 14 lw r19,(sp+20) 8008290: 2b 94 00 10 lw r20,(sp+16) 8008294: 2b 95 00 0c lw r21,(sp+12) 8008298: 2b 96 00 08 lw r22,(sp+8) 800829c: 37 9c 00 34 addi sp,sp,52 80082a0: c3 a0 00 00 ret =============================================================================== 0800fe08 <_Thread_queue_Extract_priority_helper>: void _Thread_queue_Extract_priority_helper( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread, bool requeuing ) { 800fe08: 37 9c ff f8 addi sp,sp,-8 800fe0c: 5b 8b 00 08 sw (sp+8),r11 800fe10: 5b 9d 00 04 sw (sp+4),ra 800fe14: b8 40 58 00 mv r11,r2 800fe18: 20 63 00 ff andi r3,r3,0xff Chain_Node *new_first_node; Chain_Node *new_second_node; Chain_Node *last_node; the_node = (Chain_Node *) the_thread; _ISR_Disable( level ); 800fe1c: 90 00 10 00 rcsr r2,IE 800fe20: 34 01 ff fe mvi r1,-2 800fe24: a0 41 08 00 and r1,r2,r1 800fe28: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 800fe2c: 78 05 08 01 mvhi r5,0x801 800fe30: 38 a5 8c 8c ori r5,r5,0x8c8c 800fe34: 29 64 00 10 lw r4,(r11+16) 800fe38: 28 a1 00 00 lw r1,(r5+0) 800fe3c: a0 81 08 00 and r1,r4,r1 if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 800fe40: 44 20 00 19 be r1,r0,800fea4 <_Thread_queue_Extract_priority_helper+0x9c><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 800fe44: 29 61 00 38 lw r1,(r11+56) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 800fe48: 35 66 00 3c addi r6,r11,60 /* * The thread was actually waiting on a thread queue so let's remove it. */ next_node = the_node->next; 800fe4c: 29 64 00 00 lw r4,(r11+0) previous_node = the_node->previous; 800fe50: 29 65 00 04 lw r5,(r11+4) if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { 800fe54: 44 26 00 11 be r1,r6,800fe98 <_Thread_queue_Extract_priority_helper+0x90> #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 800fe58: 29 66 00 40 lw r6,(r11+64) if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { new_first_node = _Chain_First( &the_thread->Wait.Block2n ); new_first_thread = (Thread_Control *) new_first_node; last_node = _Chain_Last( &the_thread->Wait.Block2n ); new_second_node = new_first_node->next; 800fe5c: 28 27 00 00 lw r7,(r1+0) previous_node->next = new_first_node; next_node->previous = new_first_node; 800fe60: 58 81 00 04 sw (r4+4),r1 new_first_node = _Chain_First( &the_thread->Wait.Block2n ); new_first_thread = (Thread_Control *) new_first_node; last_node = _Chain_Last( &the_thread->Wait.Block2n ); new_second_node = new_first_node->next; previous_node->next = new_first_node; 800fe64: 58 a1 00 00 sw (r5+0),r1 next_node->previous = new_first_node; new_first_node->next = next_node; 800fe68: 58 24 00 00 sw (r1+0),r4 new_first_node->previous = previous_node; 800fe6c: 58 25 00 04 sw (r1+4),r5 if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 800fe70: 29 64 00 40 lw r4,(r11+64) 800fe74: 29 65 00 38 lw r5,(r11+56) 800fe78: 44 a4 00 0a be r5,r4,800fea0 <_Thread_queue_Extract_priority_helper+0x98> /* > two threads on 2-n */ head = _Chain_Head( &new_first_thread->Wait.Block2n ); 800fe7c: 34 24 00 38 addi r4,r1,56 tail = _Chain_Tail( &new_first_thread->Wait.Block2n ); new_second_node->previous = head; 800fe80: 58 e4 00 04 sw (r7+4),r4 head->next = new_second_node; 800fe84: 58 27 00 38 sw (r1+56),r7 tail->previous = last_node; 800fe88: 58 26 00 40 sw (r1+64),r6 new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { /* > two threads on 2-n */ head = _Chain_Head( &new_first_thread->Wait.Block2n ); tail = _Chain_Tail( &new_first_thread->Wait.Block2n ); 800fe8c: 34 21 00 3c addi r1,r1,60 new_second_node->previous = head; head->next = new_second_node; tail->previous = last_node; last_node->next = tail; 800fe90: 58 c1 00 00 sw (r6+0),r1 800fe94: e0 00 00 03 bi 800fea0 <_Thread_queue_Extract_priority_helper+0x98> } } else { previous_node->next = next_node; 800fe98: 58 a4 00 00 sw (r5+0),r4 next_node->previous = previous_node; 800fe9c: 58 85 00 04 sw (r4+4),r5 /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 800fea0: 44 60 00 03 be r3,r0,800feac <_Thread_queue_Extract_priority_helper+0xa4> _ISR_Enable( level ); 800fea4: d0 02 00 00 wcsr IE,r2 return; 800fea8: e0 00 00 10 bi 800fee8 <_Thread_queue_Extract_priority_helper+0xe0> } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 800feac: 29 63 00 50 lw r3,(r11+80) 800feb0: 34 01 00 02 mvi r1,2 800feb4: 44 61 00 03 be r3,r1,800fec0 <_Thread_queue_Extract_priority_helper+0xb8> _ISR_Enable( level ); 800feb8: d0 02 00 00 wcsr IE,r2 800febc: e0 00 00 06 bi 800fed4 <_Thread_queue_Extract_priority_helper+0xcc> 800fec0: 34 01 00 03 mvi r1,3 800fec4: 59 61 00 50 sw (r11+80),r1 } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 800fec8: d0 02 00 00 wcsr IE,r2 (void) _Watchdog_Remove( &the_thread->Timer ); 800fecc: 35 61 00 48 addi r1,r11,72 800fed0: fb ff e2 e0 calli 8008a50 <_Watchdog_Remove> 800fed4: 78 03 08 01 mvhi r3,0x801 800fed8: 38 63 8c 94 ori r3,r3,0x8c94 800fedc: 28 62 00 00 lw r2,(r3+0) 800fee0: b9 60 08 00 mv r1,r11 800fee4: fb ff fe ad calli 800f998 <_Thread_Clear_state> #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 800fee8: 2b 9d 00 04 lw ra,(sp+4) 800feec: 2b 8b 00 08 lw r11,(sp+8) 800fef0: 37 9c 00 08 addi sp,sp,8 800fef4: c3 a0 00 00 ret =============================================================================== 0800ff38 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 800ff38: 37 9c ff fc addi sp,sp,-4 800ff3c: 5b 9d 00 04 sw (sp+4),ra 800ff40: b8 20 10 00 mv r2,r1 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 800ff44: 28 21 00 44 lw r1,(r1+68) * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && 800ff48: 28 24 00 30 lw r4,(r1+48) 800ff4c: 44 80 00 0c be r4,r0,800ff7c <_Thread_queue_Process_timeout+0x44> RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800ff50: 78 03 08 01 mvhi r3,0x801 800ff54: 38 63 ae 00 ori r3,r3,0xae00 800ff58: 28 63 00 10 lw r3,(r3+16) 800ff5c: 5c 43 00 08 bne r2,r3,800ff7c <_Thread_queue_Process_timeout+0x44><== NEVER TAKEN _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 800ff60: 34 03 00 03 mvi r3,3 800ff64: 44 83 00 09 be r4,r3,800ff88 <_Thread_queue_Process_timeout+0x50><== ALWAYS TAKEN the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800ff68: 28 23 00 3c lw r3,(r1+60) <== NOT EXECUTED 800ff6c: 58 43 00 34 sw (r2+52),r3 <== NOT EXECUTED the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800ff70: 34 02 00 02 mvi r2,2 <== NOT EXECUTED 800ff74: 58 22 00 30 sw (r1+48),r2 <== NOT EXECUTED 800ff78: e0 00 00 04 bi 800ff88 <_Thread_queue_Process_timeout+0x50><== NOT EXECUTED } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800ff7c: 28 23 00 3c lw r3,(r1+60) 800ff80: 58 43 00 34 sw (r2+52),r3 _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 800ff84: f8 00 06 d6 calli 8011adc <_Thread_queue_Extract> } } 800ff88: 2b 9d 00 04 lw ra,(sp+4) 800ff8c: 37 9c 00 04 addi sp,sp,4 800ff90: c3 a0 00 00 ret =============================================================================== 08008390 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 8008390: 37 9c ff ec addi sp,sp,-20 8008394: 5b 8b 00 10 sw (sp+16),r11 8008398: 5b 8c 00 0c sw (sp+12),r12 800839c: 5b 8d 00 08 sw (sp+8),r13 80083a0: 5b 9d 00 04 sw (sp+4),ra 80083a4: b8 20 58 00 mv r11,r1 80083a8: b8 40 60 00 mv r12,r2 /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 80083ac: 44 20 00 19 be r1,r0,8008410 <_Thread_queue_Requeue+0x80> <== NEVER TAKEN /* * If queueing by FIFO, there is nothing to do. This only applies to * priority blocking discipline. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 80083b0: 28 22 00 34 lw r2,(r1+52) 80083b4: 34 01 00 01 mvi r1,1 80083b8: 5c 41 00 16 bne r2,r1,8008410 <_Thread_queue_Requeue+0x80> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 80083bc: 90 00 68 00 rcsr r13,IE 80083c0: 34 01 ff fe mvi r1,-2 80083c4: a1 a1 08 00 and r1,r13,r1 80083c8: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 80083cc: 78 03 08 01 mvhi r3,0x801 80083d0: 38 63 8c 8c ori r3,r3,0x8c8c 80083d4: 29 82 00 10 lw r2,(r12+16) 80083d8: 28 61 00 00 lw r1,(r3+0) 80083dc: a0 41 08 00 and r1,r2,r1 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 80083e0: 44 20 00 0b be r1,r0,800840c <_Thread_queue_Requeue+0x7c> <== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 80083e4: 34 01 00 01 mvi r1,1 80083e8: 59 61 00 30 sw (r11+48),r1 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 80083ec: b9 80 10 00 mv r2,r12 80083f0: b9 60 08 00 mv r1,r11 80083f4: 34 03 00 01 mvi r3,1 80083f8: f8 00 1e 84 calli 800fe08 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 80083fc: b9 60 08 00 mv r1,r11 8008400: b9 80 10 00 mv r2,r12 8008404: 37 83 00 14 addi r3,sp,20 8008408: fb ff ff 12 calli 8008050 <_Thread_queue_Enqueue_priority> } _ISR_Enable( level ); 800840c: d0 0d 00 00 wcsr IE,r13 } } 8008410: 2b 9d 00 04 lw ra,(sp+4) 8008414: 2b 8b 00 10 lw r11,(sp+16) 8008418: 2b 8c 00 0c lw r12,(sp+12) 800841c: 2b 8d 00 08 lw r13,(sp+8) 8008420: 37 9c 00 14 addi sp,sp,20 8008424: c3 a0 00 00 ret =============================================================================== 08008428 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 8008428: 37 9c ff f8 addi sp,sp,-8 800842c: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 8008430: 37 82 00 08 addi r2,sp,8 8008434: fb ff fd 6f calli 80079f0 <_Thread_Get> switch ( location ) { 8008438: 2b 82 00 08 lw r2,(sp+8) 800843c: 5c 40 00 07 bne r2,r0,8008458 <_Thread_queue_Timeout+0x30> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 8008440: f8 00 1e be calli 800ff38 <_Thread_queue_Process_timeout> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 8008444: 78 01 08 01 mvhi r1,0x801 8008448: 38 21 a9 78 ori r1,r1,0xa978 800844c: 28 22 00 00 lw r2,(r1+0) --level; 8008450: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 8008454: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 8008458: 2b 9d 00 04 lw ra,(sp+4) 800845c: 37 9c 00 08 addi sp,sp,8 8008460: c3 a0 00 00 ret =============================================================================== 08015648 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 8015648: 37 9c ff a8 addi sp,sp,-88 801564c: 5b 8b 00 40 sw (sp+64),r11 8015650: 5b 8c 00 3c sw (sp+60),r12 8015654: 5b 8d 00 38 sw (sp+56),r13 8015658: 5b 8e 00 34 sw (sp+52),r14 801565c: 5b 8f 00 30 sw (sp+48),r15 8015660: 5b 90 00 2c sw (sp+44),r16 8015664: 5b 91 00 28 sw (sp+40),r17 8015668: 5b 92 00 24 sw (sp+36),r18 801566c: 5b 93 00 20 sw (sp+32),r19 8015670: 5b 94 00 1c sw (sp+28),r20 8015674: 5b 95 00 18 sw (sp+24),r21 8015678: 5b 96 00 14 sw (sp+20),r22 801567c: 5b 97 00 10 sw (sp+16),r23 8015680: 5b 98 00 0c sw (sp+12),r24 8015684: 5b 99 00 08 sw (sp+8),r25 8015688: 5b 9d 00 04 sw (sp+4),ra static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 801568c: 78 10 08 03 mvhi r16,0x803 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 8015690: b8 20 58 00 mv r11,r1 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8015694: 37 82 00 54 addi r2,sp,84 8015698: 37 81 00 50 addi r1,sp,80 801569c: 37 8f 00 44 addi r15,sp,68 80156a0: 37 91 00 48 addi r17,sp,72 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 80156a4: 78 0d 08 03 mvhi r13,0x803 80156a8: 5b 82 00 50 sw (sp+80),r2 head->previous = NULL; 80156ac: 5b 80 00 54 sw (sp+84),r0 tail->previous = head; 80156b0: 5b 81 00 58 sw (sp+88),r1 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 80156b4: 5b 91 00 44 sw (sp+68),r17 head->previous = NULL; 80156b8: 5b 80 00 48 sw (sp+72),r0 tail->previous = head; 80156bc: 5b 8f 00 4c sw (sp+76),r15 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 80156c0: b8 20 c8 00 mv r25,r1 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 80156c4: 3a 10 fe 38 ori r16,r16,0xfe38 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 80156c8: 35 73 00 30 addi r19,r11,48 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 80156cc: 39 ad fc d0 ori r13,r13,0xfcd0 /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 80156d0: 35 6e 00 68 addi r14,r11,104 Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 80156d4: 34 18 00 03 mvi r24,3 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 80156d8: 34 12 ff fe mvi r18,-2 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail( const Chain_Control *the_chain ) { return &the_chain->Tail.Node; 80156dc: b8 40 b8 00 mv r23,r2 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 80156e0: 34 16 00 01 mvi r22,1 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 80156e4: 35 75 00 08 addi r21,r11,8 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 80156e8: 35 74 00 40 addi r20,r11,64 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 80156ec: 59 79 00 78 sw (r11+120),r25 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 80156f0: 2a 02 00 00 lw r2,(r16+0) /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 80156f4: 29 63 00 3c lw r3,(r11+60) watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 80156f8: ba 60 08 00 mv r1,r19 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 80156fc: 59 62 00 3c sw (r11+60),r2 _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8015700: c8 43 10 00 sub r2,r2,r3 8015704: b9 e0 18 00 mv r3,r15 8015708: f8 00 15 5a calli 801ac70 <_Watchdog_Adjust_to_chain> 801570c: 78 05 08 03 mvhi r5,0x803 8015710: 38 a5 88 cc ori r5,r5,0x88cc 8015714: 28 a4 00 00 lw r4,(r5+0) 8015718: 29 a1 00 00 lw r1,(r13+0) 801571c: 29 a2 00 04 lw r2,(r13+4) 8015720: 34 03 00 00 mvi r3,0 8015724: f8 00 56 04 calli 802af34 <__divdi3> Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 8015728: 29 64 00 74 lw r4,(r11+116) 801572c: b8 40 60 00 mv r12,r2 /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 8015730: 50 82 00 06 bgeu r4,r2,8015748 <_Timer_server_Body+0x100> /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8015734: b9 c0 08 00 mv r1,r14 8015738: c8 44 10 00 sub r2,r2,r4 801573c: b9 e0 18 00 mv r3,r15 8015740: f8 00 15 4c calli 801ac70 <_Watchdog_Adjust_to_chain> 8015744: e0 00 00 06 bi 801575c <_Timer_server_Body+0x114> } else if ( snapshot < last_snapshot ) { 8015748: 50 44 00 05 bgeu r2,r4,801575c <_Timer_server_Body+0x114> /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 801574c: b9 c0 08 00 mv r1,r14 8015750: 34 02 00 01 mvi r2,1 8015754: c8 8c 18 00 sub r3,r4,r12 8015758: f8 00 15 0f calli 801ab94 <_Watchdog_Adjust> } watchdogs->last_snapshot = snapshot; 801575c: 59 6c 00 74 sw (r11+116),r12 static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8015760: 34 0c 00 01 mvi r12,1 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 8015764: 29 63 00 78 lw r3,(r11+120) 8015768: b8 60 08 00 mv r1,r3 801576c: f8 00 03 8a calli 8016594 <_Chain_Get> 8015770: b8 20 10 00 mv r2,r1 if ( timer == NULL ) { 8015774: 44 20 00 09 be r1,r0,8015798 <_Timer_server_Body+0x150> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8015778: 28 23 00 38 lw r3,(r1+56) _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 801577c: ba 60 08 00 mv r1,r19 static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8015780: 44 6c 00 03 be r3,r12,801578c <_Timer_server_Body+0x144> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8015784: 5c 78 ff f8 bne r3,r24,8015764 <_Timer_server_Body+0x11c> <== NEVER TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8015788: b9 c0 08 00 mv r1,r14 801578c: 34 42 00 10 addi r2,r2,16 8015790: f8 00 15 5a calli 801acf8 <_Watchdog_Insert> 8015794: e3 ff ff f4 bi 8015764 <_Timer_server_Body+0x11c> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 8015798: 90 00 10 00 rcsr r2,IE 801579c: a0 52 08 00 and r1,r2,r18 80157a0: d0 01 00 00 wcsr IE,r1 if ( _Chain_Is_empty( insert_chain ) ) { 80157a4: 2b 81 00 50 lw r1,(sp+80) 80157a8: 5c 37 00 06 bne r1,r23,80157c0 <_Timer_server_Body+0x178> <== NEVER TAKEN ts->insert_chain = NULL; 80157ac: 59 60 00 78 sw (r11+120),r0 _ISR_Enable( level ); 80157b0: d0 02 00 00 wcsr IE,r2 _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 80157b4: 2b 81 00 44 lw r1,(sp+68) 80157b8: 5c 31 00 04 bne r1,r17,80157c8 <_Timer_server_Body+0x180> 80157bc: e0 00 00 15 bi 8015810 <_Timer_server_Body+0x1c8> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 80157c0: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED 80157c4: e3 ff ff cb bi 80156f0 <_Timer_server_Body+0xa8> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 80157c8: 90 00 18 00 rcsr r3,IE 80157cc: a0 72 08 00 and r1,r3,r18 80157d0: d0 01 00 00 wcsr IE,r1 initialized = false; } #endif return status; } 80157d4: 2b 82 00 44 lw r2,(sp+68) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 80157d8: 44 51 00 0c be r2,r17,8015808 <_Timer_server_Body+0x1c0> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 80157dc: 28 44 00 00 lw r4,(r2+0) head->next = new_first; 80157e0: 5b 84 00 44 sw (sp+68),r4 new_first->previous = head; 80157e4: 58 8f 00 04 sw (r4+4),r15 * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 80157e8: 44 40 00 08 be r2,r0,8015808 <_Timer_server_Body+0x1c0> <== NEVER TAKEN watchdog->state = WATCHDOG_INACTIVE; 80157ec: 58 40 00 08 sw (r2+8),r0 _ISR_Enable( level ); 80157f0: d0 03 00 00 wcsr IE,r3 /* * The timer server may block here and wait for resources or time. * The system watchdogs are inactive and will remain inactive since * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); 80157f4: 28 43 00 1c lw r3,(r2+28) 80157f8: 28 41 00 20 lw r1,(r2+32) 80157fc: 28 42 00 24 lw r2,(r2+36) 8015800: d8 60 00 00 call r3 } 8015804: e3 ff ff f1 bi 80157c8 <_Timer_server_Body+0x180> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 8015808: d0 03 00 00 wcsr IE,r3 801580c: e3 ff ff b8 bi 80156ec <_Timer_server_Body+0xa4> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 8015810: 31 60 00 7c sb (r11+124),r0 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); 8015814: fb ff ff 4d calli 8015548 <_Thread_Disable_dispatch> _Thread_Set_state( ts->thread, STATES_DELAYING ); 8015818: 29 61 00 00 lw r1,(r11+0) 801581c: 34 02 00 08 mvi r2,8 8015820: f8 00 13 c9 calli 801a744 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 8015824: b9 60 08 00 mv r1,r11 8015828: fb ff ff 4e calli 8015560 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 801582c: b9 60 08 00 mv r1,r11 8015830: fb ff ff 69 calli 80155d4 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 8015834: f8 00 10 de calli 8019bac <_Thread_Enable_dispatch> static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8015838: ba a0 08 00 mv r1,r21 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 801583c: 31 76 00 7c sb (r11+124),r22 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8015840: f8 00 15 8b calli 801ae6c <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 8015844: ba 80 08 00 mv r1,r20 8015848: f8 00 15 89 calli 801ae6c <_Watchdog_Remove> 801584c: e3 ff ff a8 bi 80156ec <_Timer_server_Body+0xa4> =============================================================================== 08015850 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8015850: 37 9c ff f0 addi sp,sp,-16 8015854: 5b 8b 00 10 sw (sp+16),r11 8015858: 5b 8c 00 0c sw (sp+12),r12 801585c: 5b 8d 00 08 sw (sp+8),r13 8015860: 5b 9d 00 04 sw (sp+4),ra 8015864: b8 20 58 00 mv r11,r1 if ( ts->insert_chain == NULL ) { 8015868: 28 21 00 78 lw r1,(r1+120) static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 801586c: b8 40 60 00 mv r12,r2 if ( ts->insert_chain == NULL ) { 8015870: 5c 20 00 49 bne r1,r0,8015994 <_Timer_server_Schedule_operation_method+0x144> * is the reference point for the delta chain. Thus if we do not update the * reference point we have to add DT to the initial delta of the watchdog * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); 8015874: fb ff ff 35 calli 8015548 <_Thread_Disable_dispatch> if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8015878: 29 81 00 38 lw r1,(r12+56) 801587c: 34 02 00 01 mvi r2,1 8015880: 5c 22 00 1d bne r1,r2,80158f4 <_Timer_server_Schedule_operation_method+0xa4> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8015884: 90 00 10 00 rcsr r2,IE 8015888: 34 01 ff fe mvi r1,-2 801588c: a0 41 08 00 and r1,r2,r1 8015890: d0 01 00 00 wcsr IE,r1 snapshot = _Watchdog_Ticks_since_boot; 8015894: 78 01 08 03 mvhi r1,0x803 8015898: 38 21 fe 38 ori r1,r1,0xfe38 801589c: 28 23 00 00 lw r3,(r1+0) initialized = false; } #endif return status; } 80158a0: 29 61 00 30 lw r1,(r11+48) * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = _Watchdog_Ticks_since_boot; last_snapshot = ts->Interval_watchdogs.last_snapshot; 80158a4: 29 65 00 3c lw r5,(r11+60) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 80158a8: 35 64 00 34 addi r4,r11,52 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 80158ac: 44 24 00 07 be r1,r4,80158c8 <_Timer_server_Schedule_operation_method+0x78> /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 80158b0: 28 26 00 10 lw r6,(r1+16) first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 80158b4: c8 65 28 00 sub r5,r3,r5 delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 80158b8: 34 04 00 00 mvi r4,0 * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { 80158bc: 50 a6 00 02 bgeu r5,r6,80158c4 <_Timer_server_Schedule_operation_method+0x74> delta_interval -= delta; 80158c0: c8 c5 20 00 sub r4,r6,r5 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 80158c4: 58 24 00 10 sw (r1+16),r4 } ts->Interval_watchdogs.last_snapshot = snapshot; 80158c8: 59 63 00 3c sw (r11+60),r3 _ISR_Enable( level ); 80158cc: d0 02 00 00 wcsr IE,r2 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 80158d0: 35 61 00 30 addi r1,r11,48 80158d4: 35 82 00 10 addi r2,r12,16 80158d8: f8 00 15 08 calli 801acf8 <_Watchdog_Insert> if ( !ts->active ) { 80158dc: 41 61 00 7c lbu r1,(r11+124) 80158e0: 20 21 00 ff andi r1,r1,0xff 80158e4: 5c 20 00 2a bne r1,r0,801598c <_Timer_server_Schedule_operation_method+0x13c> _Timer_server_Reset_interval_system_watchdog( ts ); 80158e8: b9 60 08 00 mv r1,r11 80158ec: fb ff ff 1d calli 8015560 <_Timer_server_Reset_interval_system_watchdog> 80158f0: e0 00 00 27 bi 801598c <_Timer_server_Schedule_operation_method+0x13c> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 80158f4: 34 02 00 03 mvi r2,3 80158f8: 5c 22 00 25 bne r1,r2,801598c <_Timer_server_Schedule_operation_method+0x13c> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 80158fc: 90 00 68 00 rcsr r13,IE 8015900: 34 01 ff fe mvi r1,-2 8015904: a1 a1 08 00 and r1,r13,r1 8015908: d0 01 00 00 wcsr IE,r1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 801590c: 78 03 08 03 mvhi r3,0x803 8015910: 78 05 08 03 mvhi r5,0x803 8015914: 38 63 fc d0 ori r3,r3,0xfcd0 8015918: 38 a5 88 cc ori r5,r5,0x88cc 801591c: 28 61 00 00 lw r1,(r3+0) 8015920: 28 62 00 04 lw r2,(r3+4) 8015924: 28 a4 00 00 lw r4,(r5+0) 8015928: 34 03 00 00 mvi r3,0 801592c: f8 00 55 82 calli 802af34 <__divdi3> initialized = false; } #endif return status; } 8015930: 29 61 00 68 lw r1,(r11+104) * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; 8015934: 29 65 00 74 lw r5,(r11+116) 8015938: 35 63 00 6c addi r3,r11,108 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 801593c: 44 23 00 0a be r1,r3,8015964 <_Timer_server_Schedule_operation_method+0x114> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 8015940: 28 24 00 10 lw r4,(r1+16) } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 8015944: b4 85 18 00 add r3,r4,r5 delta_interval += delta; 8015948: c8 62 18 00 sub r3,r3,r2 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 801594c: 50 a2 00 05 bgeu r5,r2,8015960 <_Timer_server_Schedule_operation_method+0x110> /* * We advanced in time. */ delta = snapshot - last_snapshot; 8015950: c8 45 28 00 sub r5,r2,r5 if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 8015954: 34 03 00 00 mvi r3,0 if ( snapshot > last_snapshot ) { /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { 8015958: 50 a4 00 02 bgeu r5,r4,8015960 <_Timer_server_Schedule_operation_method+0x110><== NEVER TAKEN delta_interval -= delta; 801595c: c8 85 18 00 sub r3,r4,r5 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 8015960: 58 23 00 10 sw (r1+16),r3 } ts->TOD_watchdogs.last_snapshot = snapshot; 8015964: 59 62 00 74 sw (r11+116),r2 _ISR_Enable( level ); 8015968: d0 0d 00 00 wcsr IE,r13 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 801596c: 35 61 00 68 addi r1,r11,104 8015970: 35 82 00 10 addi r2,r12,16 8015974: f8 00 14 e1 calli 801acf8 <_Watchdog_Insert> if ( !ts->active ) { 8015978: 41 61 00 7c lbu r1,(r11+124) 801597c: 20 21 00 ff andi r1,r1,0xff 8015980: 5c 20 00 03 bne r1,r0,801598c <_Timer_server_Schedule_operation_method+0x13c> _Timer_server_Reset_tod_system_watchdog( ts ); 8015984: b9 60 08 00 mv r1,r11 8015988: fb ff ff 13 calli 80155d4 <_Timer_server_Reset_tod_system_watchdog> } } _Thread_Enable_dispatch(); 801598c: f8 00 10 88 calli 8019bac <_Thread_Enable_dispatch> 8015990: e0 00 00 03 bi 801599c <_Timer_server_Schedule_operation_method+0x14c> * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 8015994: 29 61 00 78 lw r1,(r11+120) 8015998: f8 00 02 f3 calli 8016564 <_Chain_Append> } } 801599c: 2b 9d 00 04 lw ra,(sp+4) 80159a0: 2b 8b 00 10 lw r11,(sp+16) 80159a4: 2b 8c 00 0c lw r12,(sp+12) 80159a8: 2b 8d 00 08 lw r13,(sp+8) 80159ac: 37 9c 00 10 addi sp,sp,16 80159b0: c3 a0 00 00 ret =============================================================================== 08008880 <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 8008880: 37 9c ff f4 addi sp,sp,-12 8008884: 5b 8b 00 08 sw (sp+8),r11 8008888: 5b 9d 00 04 sw (sp+4),ra uint32_t number_of_initial_extensions = 800888c: 78 01 08 01 mvhi r1,0x801 8008890: 38 21 87 ec ori r1,r1,0x87ec 8008894: 28 2b 00 40 lw r11,(r1+64) rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 8008898: 45 60 00 0d be r11,r0,80088cc <_User_extensions_Handler_initialization+0x4c><== NEVER TAKEN User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) 800889c: 34 02 00 01 mvi r2,1 80088a0: b9 60 08 00 mv r1,r11 80088a4: f8 00 3c 27 calli 8017940 <__ashlsi3> 80088a8: 34 02 00 02 mvi r2,2 80088ac: b4 2b 08 00 add r1,r1,r11 80088b0: f8 00 3c 24 calli 8017940 <__ashlsi3> uint32_t number_of_initial_extensions = rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( 80088b4: f8 00 00 fc calli 8008ca4 <_Workspace_Allocate_or_fatal_error> number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) ); User_extensions_Switch_context ctx = { initial_extension_switch_controls }; _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 80088b8: 78 02 08 00 mvhi r2,0x800 User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) ); User_extensions_Switch_context ctx = { initial_extension_switch_controls }; 80088bc: 5b 81 00 0c sw (sp+12),r1 _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 80088c0: 38 42 88 40 ori r2,r2,0x8840 80088c4: 37 81 00 0c addi r1,sp,12 80088c8: fb ff ff b0 calli 8008788 <_User_extensions_Iterate> } } 80088cc: 2b 9d 00 04 lw ra,(sp+4) 80088d0: 2b 8b 00 08 lw r11,(sp+8) 80088d4: 37 9c 00 0c addi sp,sp,12 80088d8: c3 a0 00 00 ret =============================================================================== 080091f8 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 80091f8: 37 9c ff e4 addi sp,sp,-28 80091fc: 5b 8b 00 1c sw (sp+28),r11 8009200: 5b 8c 00 18 sw (sp+24),r12 8009204: 5b 8d 00 14 sw (sp+20),r13 8009208: 5b 8e 00 10 sw (sp+16),r14 800920c: 5b 8f 00 0c sw (sp+12),r15 8009210: 5b 90 00 08 sw (sp+8),r16 8009214: 5b 9d 00 04 sw (sp+4),ra 8009218: b8 20 60 00 mv r12,r1 800921c: b8 60 58 00 mv r11,r3 ISR_Level level; _ISR_Disable( level ); 8009220: 90 00 08 00 rcsr r1,IE 8009224: 34 03 ff fe mvi r3,-2 8009228: a0 23 18 00 and r3,r1,r3 800922c: d0 03 00 00 wcsr IE,r3 } } _ISR_Enable( level ); } 8009230: 29 83 00 00 lw r3,(r12+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8009234: 35 8e 00 04 addi r14,r12,4 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 8009238: 44 6e 00 1d be r3,r14,80092ac <_Watchdog_Adjust+0xb4> switch ( direction ) { 800923c: 44 40 00 04 be r2,r0,800924c <_Watchdog_Adjust+0x54> 8009240: 34 04 00 01 mvi r4,1 8009244: 5c 44 00 1a bne r2,r4,80092ac <_Watchdog_Adjust+0xb4> <== NEVER TAKEN 8009248: e0 00 00 04 bi 8009258 <_Watchdog_Adjust+0x60> if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 800924c: 34 10 00 01 mvi r16,1 _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8009250: 34 0f ff fe mvi r15,-2 8009254: e0 00 00 15 bi 80092a8 <_Watchdog_Adjust+0xb0> * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 8009258: 28 62 00 10 lw r2,(r3+16) 800925c: b4 4b 58 00 add r11,r2,r11 8009260: 58 6b 00 10 sw (r3+16),r11 break; 8009264: e0 00 00 12 bi 80092ac <_Watchdog_Adjust+0xb4> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) _Chain_First( header ) ); 8009268: 29 82 00 00 lw r2,(r12+0) case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 800926c: 28 4d 00 10 lw r13,(r2+16) 8009270: 51 6d 00 04 bgeu r11,r13,8009280 <_Watchdog_Adjust+0x88> _Watchdog_First( header )->delta_interval -= units; 8009274: c9 ab 58 00 sub r11,r13,r11 8009278: 58 4b 00 10 sw (r2+16),r11 break; 800927c: e0 00 00 0c bi 80092ac <_Watchdog_Adjust+0xb4> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 8009280: 58 50 00 10 sw (r2+16),r16 _ISR_Enable( level ); 8009284: d0 01 00 00 wcsr IE,r1 _Watchdog_Tickle( header ); 8009288: b9 80 08 00 mv r1,r12 800928c: f8 00 00 98 calli 80094ec <_Watchdog_Tickle> _ISR_Disable( level ); 8009290: 90 00 08 00 rcsr r1,IE 8009294: a0 2f 10 00 and r2,r1,r15 8009298: d0 02 00 00 wcsr IE,r2 if ( _Chain_Is_empty( header ) ) 800929c: 29 82 00 00 lw r2,(r12+0) 80092a0: 44 4e 00 03 be r2,r14,80092ac <_Watchdog_Adjust+0xb4> while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 80092a4: c9 6d 58 00 sub r11,r11,r13 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 80092a8: 5d 60 ff f0 bne r11,r0,8009268 <_Watchdog_Adjust+0x70> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 80092ac: d0 01 00 00 wcsr IE,r1 } 80092b0: 2b 9d 00 04 lw ra,(sp+4) 80092b4: 2b 8b 00 1c lw r11,(sp+28) 80092b8: 2b 8c 00 18 lw r12,(sp+24) 80092bc: 2b 8d 00 14 lw r13,(sp+20) 80092c0: 2b 8e 00 10 lw r14,(sp+16) 80092c4: 2b 8f 00 0c lw r15,(sp+12) 80092c8: 2b 90 00 08 lw r16,(sp+8) 80092cc: 37 9c 00 1c addi sp,sp,28 80092d0: c3 a0 00 00 ret =============================================================================== 08008a50 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 8008a50: 90 00 28 00 rcsr r5,IE 8008a54: 34 02 ff fe mvi r2,-2 8008a58: a0 a2 10 00 and r2,r5,r2 8008a5c: d0 02 00 00 wcsr IE,r2 previous_state = the_watchdog->state; 8008a60: 28 23 00 08 lw r3,(r1+8) switch ( previous_state ) { 8008a64: 34 02 00 01 mvi r2,1 8008a68: 44 62 00 05 be r3,r2,8008a7c <_Watchdog_Remove+0x2c> 8008a6c: 44 60 00 1b be r3,r0,8008ad8 <_Watchdog_Remove+0x88> 8008a70: 34 02 00 03 mvi r2,3 8008a74: 54 62 00 19 bgu r3,r2,8008ad8 <_Watchdog_Remove+0x88> <== NEVER TAKEN 8008a78: e0 00 00 03 bi 8008a84 <_Watchdog_Remove+0x34> /* * It is not actually on the chain so just change the state and * the Insert operation we interrupted will be aborted. */ the_watchdog->state = WATCHDOG_INACTIVE; 8008a7c: 58 20 00 08 sw (r1+8),r0 break; 8008a80: e0 00 00 16 bi 8008ad8 <_Watchdog_Remove+0x88> } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 8008a84: 28 22 00 00 lw r2,(r1+0) break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 8008a88: 58 20 00 08 sw (r1+8),r0 next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 8008a8c: 28 44 00 00 lw r4,(r2+0) 8008a90: 44 80 00 05 be r4,r0,8008aa4 <_Watchdog_Remove+0x54> next_watchdog->delta_interval += the_watchdog->delta_interval; 8008a94: 28 46 00 10 lw r6,(r2+16) 8008a98: 28 24 00 10 lw r4,(r1+16) 8008a9c: b4 c4 20 00 add r4,r6,r4 8008aa0: 58 44 00 10 sw (r2+16),r4 if ( _Watchdog_Sync_count ) 8008aa4: 78 04 08 01 mvhi r4,0x801 8008aa8: 38 84 aa 5c ori r4,r4,0xaa5c 8008aac: 28 84 00 00 lw r4,(r4+0) 8008ab0: 44 80 00 07 be r4,r0,8008acc <_Watchdog_Remove+0x7c> _Watchdog_Sync_level = _ISR_Nest_level; 8008ab4: 78 04 08 01 mvhi r4,0x801 8008ab8: 38 84 ae 00 ori r4,r4,0xae00 8008abc: 28 86 00 08 lw r6,(r4+8) 8008ac0: 78 04 08 01 mvhi r4,0x801 8008ac4: 38 84 a9 fc ori r4,r4,0xa9fc 8008ac8: 58 86 00 00 sw (r4+0),r6 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 8008acc: 28 24 00 04 lw r4,(r1+4) next->previous = previous; 8008ad0: 58 44 00 04 sw (r2+4),r4 previous->next = next; 8008ad4: 58 82 00 00 sw (r4+0),r2 _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8008ad8: 78 02 08 01 mvhi r2,0x801 8008adc: 38 42 aa 60 ori r2,r2,0xaa60 8008ae0: 28 42 00 00 lw r2,(r2+0) 8008ae4: 58 22 00 18 sw (r1+24),r2 _ISR_Enable( level ); 8008ae8: d0 05 00 00 wcsr IE,r5 return( previous_state ); } 8008aec: b8 60 08 00 mv r1,r3 8008af0: c3 a0 00 00 ret =============================================================================== 08008e0c <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 8008e0c: 37 9c ff ec addi sp,sp,-20 8008e10: 5b 8b 00 14 sw (sp+20),r11 8008e14: 5b 8c 00 10 sw (sp+16),r12 8008e18: 5b 8d 00 0c sw (sp+12),r13 8008e1c: 5b 8e 00 08 sw (sp+8),r14 8008e20: 5b 9d 00 04 sw (sp+4),ra 8008e24: b8 20 70 00 mv r14,r1 8008e28: b8 40 60 00 mv r12,r2 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 8008e2c: 90 00 68 00 rcsr r13,IE 8008e30: 34 01 ff fe mvi r1,-2 8008e34: a1 a1 08 00 and r1,r13,r1 8008e38: d0 01 00 00 wcsr IE,r1 printk( "Watchdog Chain: %s %p\n", name, header ); 8008e3c: 78 01 08 01 mvhi r1,0x801 8008e40: b9 80 18 00 mv r3,r12 8008e44: 38 21 f6 64 ori r1,r1,0xf664 8008e48: b9 c0 10 00 mv r2,r14 8008e4c: fb ff e8 93 calli 8003098 printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); } 8008e50: 29 8b 00 00 lw r11,(r12+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8008e54: 35 8c 00 04 addi r12,r12,4 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { 8008e58: 45 6c 00 0b be r11,r12,8008e84 <_Watchdog_Report_chain+0x78> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 8008e5c: b9 60 10 00 mv r2,r11 8008e60: 34 01 00 00 mvi r1,0 8008e64: f8 00 00 13 calli 8008eb0 <_Watchdog_Report> _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; node != _Chain_Tail(header) ; node = node->next ) 8008e68: 29 6b 00 00 lw r11,(r11+0) Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; 8008e6c: 5d 6c ff fc bne r11,r12,8008e5c <_Watchdog_Report_chain+0x50><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 8008e70: 78 01 08 01 mvhi r1,0x801 8008e74: 38 21 f6 7c ori r1,r1,0xf67c 8008e78: b9 c0 10 00 mv r2,r14 8008e7c: fb ff e8 87 calli 8003098 8008e80: e0 00 00 04 bi 8008e90 <_Watchdog_Report_chain+0x84> } else { printk( "Chain is empty\n" ); 8008e84: 78 01 08 01 mvhi r1,0x801 8008e88: 38 21 f6 8c ori r1,r1,0xf68c 8008e8c: fb ff e8 83 calli 8003098 } _ISR_Enable( level ); 8008e90: d0 0d 00 00 wcsr IE,r13 } 8008e94: 2b 9d 00 04 lw ra,(sp+4) 8008e98: 2b 8b 00 14 lw r11,(sp+20) 8008e9c: 2b 8c 00 10 lw r12,(sp+16) 8008ea0: 2b 8d 00 0c lw r13,(sp+12) 8008ea4: 2b 8e 00 08 lw r14,(sp+8) 8008ea8: 37 9c 00 14 addi sp,sp,20 8008eac: c3 a0 00 00 ret =============================================================================== 0800cce8 <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 800cce8: 37 9c ff e4 addi sp,sp,-28 800ccec: 5b 8b 00 1c sw (sp+28),r11 800ccf0: 5b 8c 00 18 sw (sp+24),r12 800ccf4: 5b 8d 00 14 sw (sp+20),r13 800ccf8: 5b 8e 00 10 sw (sp+16),r14 800ccfc: 5b 8f 00 0c sw (sp+12),r15 800cd00: 5b 90 00 08 sw (sp+8),r16 800cd04: 5b 9d 00 04 sw (sp+4),ra 800cd08: b8 20 60 00 mv r12,r1 * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 800cd0c: 90 00 18 00 rcsr r3,IE 800cd10: 34 01 ff fe mvi r1,-2 800cd14: a0 61 08 00 and r1,r3,r1 800cd18: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 800cd1c: 29 8b 00 00 lw r11,(r12+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 800cd20: 35 8e 00 04 addi r14,r12,4 * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 800cd24: b8 60 10 00 mv r2,r3 if ( _Chain_Is_empty( header ) ) 800cd28: 45 6e 00 1a be r11,r14,800cd90 <_Watchdog_Tickle+0xa8> * to be inserted has already had its delta_interval adjusted to 0, and * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { 800cd2c: 29 61 00 10 lw r1,(r11+16) 800cd30: 44 20 00 04 be r1,r0,800cd40 <_Watchdog_Tickle+0x58> <== NEVER TAKEN the_watchdog->delta_interval--; 800cd34: 34 21 ff ff addi r1,r1,-1 800cd38: 59 61 00 10 sw (r11+16),r1 if ( the_watchdog->delta_interval != 0 ) 800cd3c: 5c 20 00 15 bne r1,r0,800cd90 <_Watchdog_Tickle+0xa8> #include void _Watchdog_Tickle( Chain_Control *header ) { 800cd40: b8 60 68 00 mv r13,r3 do { watchdog_state = _Watchdog_Remove( the_watchdog ); _ISR_Enable( level ); switch( watchdog_state ) { 800cd44: 34 10 00 02 mvi r16,2 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 800cd48: 34 0f ff fe mvi r15,-2 800cd4c: e0 00 00 02 bi 800cd54 <_Watchdog_Tickle+0x6c> 800cd50: b8 40 68 00 mv r13,r2 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 800cd54: b9 60 08 00 mv r1,r11 800cd58: fb ff ff bb calli 800cc44 <_Watchdog_Remove> _ISR_Enable( level ); 800cd5c: d0 0d 00 00 wcsr IE,r13 switch( watchdog_state ) { 800cd60: 5c 30 00 05 bne r1,r16,800cd74 <_Watchdog_Tickle+0x8c> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 800cd64: 29 63 00 1c lw r3,(r11+28) 800cd68: 29 61 00 20 lw r1,(r11+32) 800cd6c: 29 62 00 24 lw r2,(r11+36) 800cd70: d8 60 00 00 call r3 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 800cd74: 90 00 10 00 rcsr r2,IE 800cd78: a0 4f 08 00 and r1,r2,r15 800cd7c: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 800cd80: 29 8b 00 00 lw r11,(r12+0) _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 800cd84: 45 6e 00 03 be r11,r14,800cd90 <_Watchdog_Tickle+0xa8> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 800cd88: 29 61 00 10 lw r1,(r11+16) 800cd8c: 44 20 ff f1 be r1,r0,800cd50 <_Watchdog_Tickle+0x68> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 800cd90: d0 02 00 00 wcsr IE,r2 } 800cd94: 2b 9d 00 04 lw ra,(sp+4) 800cd98: 2b 8b 00 1c lw r11,(sp+28) 800cd9c: 2b 8c 00 18 lw r12,(sp+24) 800cda0: 2b 8d 00 14 lw r13,(sp+20) 800cda4: 2b 8e 00 10 lw r14,(sp+16) 800cda8: 2b 8f 00 0c lw r15,(sp+12) 800cdac: 2b 90 00 08 lw r16,(sp+8) 800cdb0: 37 9c 00 1c addi sp,sp,28 800cdb4: c3 a0 00 00 ret =============================================================================== 08008af4 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8008af4: 37 9c ff d0 addi sp,sp,-48 8008af8: 5b 8b 00 30 sw (sp+48),r11 8008afc: 5b 8c 00 2c sw (sp+44),r12 8008b00: 5b 8d 00 28 sw (sp+40),r13 8008b04: 5b 8e 00 24 sw (sp+36),r14 8008b08: 5b 8f 00 20 sw (sp+32),r15 8008b0c: 5b 90 00 1c sw (sp+28),r16 8008b10: 5b 91 00 18 sw (sp+24),r17 8008b14: 5b 92 00 14 sw (sp+20),r18 8008b18: 5b 93 00 10 sw (sp+16),r19 8008b1c: 5b 94 00 0c sw (sp+12),r20 8008b20: 5b 95 00 08 sw (sp+8),r21 8008b24: 5b 9d 00 04 sw (sp+4),ra Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 8008b28: 78 04 08 01 mvhi r4,0x801 8008b2c: 38 84 87 ec ori r4,r4,0x87ec void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8008b30: b8 40 a8 00 mv r21,r2 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 8008b34: 40 82 00 32 lbu r2,(r4+50) void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8008b38: b8 60 90 00 mv r18,r3 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 8008b3c: 28 8c 00 00 lw r12,(r4+0) 8008b40: 34 05 00 00 mvi r5,0 8008b44: 5c 40 00 02 bne r2,r0,8008b4c <_Workspace_Handler_initialization+0x58> 8008b48: 28 85 00 04 lw r5,(r4+4) bool do_zero = rtems_configuration_get_do_zero_of_workspace(); 8008b4c: 78 04 08 01 mvhi r4,0x801 8008b50: 38 84 87 ec ori r4,r4,0x87ec Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 8008b54: 78 0e 08 00 mvhi r14,0x800 } else { size = 0; } } space_available = (*init_or_extend)( 8008b58: 78 0f 08 01 mvhi r15,0x801 size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 8008b5c: b4 ac 60 00 add r12,r5,r12 bool do_zero = rtems_configuration_get_do_zero_of_workspace(); 8008b60: 40 94 00 30 lbu r20,(r4+48) bool unified = rtems_configuration_get_unified_work_area(); 8008b64: 40 91 00 31 lbu r17,(r4+49) 8008b68: b8 20 58 00 mv r11,r1 uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 8008b6c: 34 10 00 00 mvi r16,0 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 8008b70: 39 ce 62 44 ori r14,r14,0x6244 if ( do_zero ) { memset( area->begin, 0, area->size ); } if ( area->size > overhead ) { 8008b74: 34 13 00 0e mvi r19,14 } else { size = 0; } } space_available = (*init_or_extend)( 8008b78: 39 ef a9 88 ori r15,r15,0xa988 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 8008b7c: e0 00 00 22 bi 8008c04 <_Workspace_Handler_initialization+0x110> Heap_Area *area = &areas [i]; if ( do_zero ) { 8008b80: 46 80 00 05 be r20,r0,8008b94 <_Workspace_Handler_initialization+0xa0> memset( area->begin, 0, area->size ); 8008b84: 29 61 00 00 lw r1,(r11+0) 8008b88: 29 63 00 04 lw r3,(r11+4) 8008b8c: 34 02 00 00 mvi r2,0 8008b90: f8 00 27 68 calli 8012930 } if ( area->size > overhead ) { 8008b94: 29 6d 00 04 lw r13,(r11+4) 8008b98: 52 6d 00 19 bgeu r19,r13,8008bfc <_Workspace_Handler_initialization+0x108><== NEVER TAKEN uintptr_t space_available; uintptr_t size; if ( unified ) { 8008b9c: 5e 20 00 07 bne r17,r0,8008bb8 <_Workspace_Handler_initialization+0xc4> size = area->size; } else { if ( remaining > 0 ) { 8008ba0: 45 91 00 05 be r12,r17,8008bb4 <_Workspace_Handler_initialization+0xc0><== NEVER TAKEN size = remaining < area->size - overhead ? 8008ba4: 35 a1 ff f2 addi r1,r13,-14 remaining + overhead : area->size; 8008ba8: 51 81 00 04 bgeu r12,r1,8008bb8 <_Workspace_Handler_initialization+0xc4><== NEVER TAKEN 8008bac: 35 8d 00 0e addi r13,r12,14 8008bb0: e0 00 00 02 bi 8008bb8 <_Workspace_Handler_initialization+0xc4> } else { size = 0; 8008bb4: 34 0d 00 00 mvi r13,0 <== NOT EXECUTED } } space_available = (*init_or_extend)( 8008bb8: 29 62 00 00 lw r2,(r11+0) 8008bbc: b9 a0 18 00 mv r3,r13 8008bc0: b9 e0 08 00 mv r1,r15 8008bc4: 34 04 00 04 mvi r4,4 8008bc8: d9 c0 00 00 call r14 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 8008bcc: 29 62 00 00 lw r2,(r11+0) 8008bd0: b4 4d 10 00 add r2,r2,r13 8008bd4: 59 62 00 00 sw (r11+0),r2 area->size -= size; 8008bd8: 29 62 00 04 lw r2,(r11+4) 8008bdc: c8 4d 68 00 sub r13,r2,r13 8008be0: 59 6d 00 04 sw (r11+4),r13 if ( space_available < remaining ) { 8008be4: 50 2c 00 04 bgeu r1,r12,8008bf4 <_Workspace_Handler_initialization+0x100><== ALWAYS TAKEN remaining -= space_available; 8008be8: c9 81 60 00 sub r12,r12,r1 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 8008bec: ba 40 70 00 mv r14,r18 <== NOT EXECUTED 8008bf0: e0 00 00 03 bi 8008bfc <_Workspace_Handler_initialization+0x108><== NOT EXECUTED 8008bf4: ba 40 70 00 mv r14,r18 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 8008bf8: 34 0c 00 00 mvi r12,0 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 8008bfc: 36 10 00 01 addi r16,r16,1 8008c00: 35 6b 00 08 addi r11,r11,8 8008c04: 56 b0 ff df bgu r21,r16,8008b80 <_Workspace_Handler_initialization+0x8c> init_or_extend = extend; } } if ( remaining > 0 ) { 8008c08: 45 80 00 05 be r12,r0,8008c1c <_Workspace_Handler_initialization+0x128> _Internal_error_Occurred( 8008c0c: 34 01 00 00 mvi r1,0 8008c10: 34 02 00 01 mvi r2,1 8008c14: 34 03 00 02 mvi r3,2 8008c18: fb ff f6 3b calli 8006504 <_Internal_error_Occurred> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } } 8008c1c: 2b 9d 00 04 lw ra,(sp+4) 8008c20: 2b 8b 00 30 lw r11,(sp+48) 8008c24: 2b 8c 00 2c lw r12,(sp+44) 8008c28: 2b 8d 00 28 lw r13,(sp+40) 8008c2c: 2b 8e 00 24 lw r14,(sp+36) 8008c30: 2b 8f 00 20 lw r15,(sp+32) 8008c34: 2b 90 00 1c lw r16,(sp+28) 8008c38: 2b 91 00 18 lw r17,(sp+24) 8008c3c: 2b 92 00 14 lw r18,(sp+20) 8008c40: 2b 93 00 10 lw r19,(sp+16) 8008c44: 2b 94 00 0c lw r20,(sp+12) 8008c48: 2b 95 00 08 lw r21,(sp+8) 8008c4c: 37 9c 00 30 addi sp,sp,48 8008c50: c3 a0 00 00 ret =============================================================================== 08010184 <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 8010184: 37 9c ff dc addi sp,sp,-36 8010188: 5b 8b 00 20 sw (sp+32),r11 801018c: 5b 8c 00 1c sw (sp+28),r12 8010190: 5b 8d 00 18 sw (sp+24),r13 8010194: 5b 8e 00 14 sw (sp+20),r14 8010198: 5b 8f 00 10 sw (sp+16),r15 801019c: 5b 90 00 0c sw (sp+12),r16 80101a0: 5b 91 00 08 sw (sp+8),r17 80101a4: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; ssize_t cmpltd = 0; 80101a8: 34 0b 00 00 mvi r11,0 uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 80101ac: b8 20 80 00 mv r16,r1 80101b0: b8 80 60 00 mv r12,r4 80101b4: b8 a0 88 00 mv r17,r5 int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; uint32_t ofs = offset; 80101b8: b8 60 78 00 mv r15,r3 void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; 80101bc: b8 40 70 00 mv r14,r2 uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 80101c0: e0 00 00 14 bi 8010210 <_fat_block_read+0x8c> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 80101c4: ba 00 08 00 mv r1,r16 80101c8: b9 c0 10 00 mv r2,r14 80101cc: 34 03 00 01 mvi r3,1 80101d0: 37 84 00 24 addi r4,sp,36 80101d4: fb ff ff aa calli 801007c if (rc != RC_OK) 80101d8: 5c 20 00 10 bne r1,r0,8010218 <_fat_block_read+0x94> <== NEVER TAKEN return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 80101dc: 2e 0d 00 00 lhu r13,(r16+0) 80101e0: c9 af 68 00 sub r13,r13,r15 80101e4: 51 8d 00 02 bgeu r12,r13,80101ec <_fat_block_read+0x68> 80101e8: b9 80 68 00 mv r13,r12 memcpy((buff + cmpltd), (sec_buf + ofs), c); 80101ec: 2b 82 00 24 lw r2,(sp+36) 80101f0: b6 2b 08 00 add r1,r17,r11 80101f4: b9 a0 18 00 mv r3,r13 80101f8: b4 4f 10 00 add r2,r2,r15 80101fc: f8 00 2d e4 calli 801b98c count -= c; 8010200: c9 8d 60 00 sub r12,r12,r13 cmpltd += c; 8010204: b5 ab 58 00 add r11,r13,r11 sec_num++; 8010208: 35 ce 00 01 addi r14,r14,1 ofs = 0; 801020c: 34 0f 00 00 mvi r15,0 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 8010210: 5d 80 ff ed bne r12,r0,80101c4 <_fat_block_read+0x40> 8010214: e0 00 00 02 bi 801021c <_fat_block_read+0x98> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; 8010218: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } 801021c: b9 60 08 00 mv r1,r11 8010220: 2b 9d 00 04 lw ra,(sp+4) 8010224: 2b 8b 00 20 lw r11,(sp+32) 8010228: 2b 8c 00 1c lw r12,(sp+28) 801022c: 2b 8d 00 18 lw r13,(sp+24) 8010230: 2b 8e 00 14 lw r14,(sp+20) 8010234: 2b 8f 00 10 lw r15,(sp+16) 8010238: 2b 90 00 0c lw r16,(sp+12) 801023c: 2b 91 00 08 lw r17,(sp+8) 8010240: 37 9c 00 24 addi sp,sp,36 8010244: c3 a0 00 00 ret =============================================================================== 0800eff0 <_hash_search>: rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { 800eff0: 37 9c ff e4 addi sp,sp,-28 800eff4: 5b 8b 00 1c sw (sp+28),r11 800eff8: 5b 8c 00 18 sw (sp+24),r12 800effc: 5b 8d 00 14 sw (sp+20),r13 800f000: 5b 8e 00 10 sw (sp+16),r14 800f004: 5b 8f 00 0c sw (sp+12),r15 800f008: 5b 90 00 08 sw (sp+8),r16 800f00c: 5b 9d 00 04 sw (sp+4),ra uint32_t mod = (key1) % FAT_HASH_MODULE; 800f010: 20 6b 00 01 andi r11,r3,0x1 rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { 800f014: b8 40 78 00 mv r15,r2 800f018: b8 20 80 00 mv r16,r1 uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); 800f01c: 34 02 00 01 mvi r2,1 800f020: b9 60 08 00 mv r1,r11 rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { 800f024: b8 60 60 00 mv r12,r3 800f028: b8 80 68 00 mv r13,r4 800f02c: b8 a0 70 00 mv r14,r5 uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); 800f030: fb ff c8 6e calli 80011e8 <__ashlsi3> 800f034: b4 2b 08 00 add r1,r1,r11 800f038: 34 02 00 02 mvi r2,2 800f03c: fb ff c8 6b calli 80011e8 <__ashlsi3> 800f040: b5 e1 10 00 add r2,r15,r1 fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } 800f044: 28 4b 00 00 lw r11,(r2+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 800f048: 34 4f 00 04 addi r15,r2,4 ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 800f04c: e0 00 00 0c bi 800f07c <_hash_search+0x8c> { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); 800f050: ba 00 08 00 mv r1,r16 800f054: 35 62 00 20 addi r2,r11,32 800f058: fb ff ff ba calli 800ef40 if ( (key1) == ck) 800f05c: 5d 81 00 07 bne r12,r1,800f078 <_hash_search+0x88> { if ( ((key2) == 0) || ((key2) == ffd->ino) ) 800f060: 45 a0 00 03 be r13,r0,800f06c <_hash_search+0x7c> <== ALWAYS TAKEN 800f064: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED 800f068: 5d a1 00 04 bne r13,r1,800f078 <_hash_search+0x88> <== NOT EXECUTED { *ret = (void *)the_node; 800f06c: 59 cb 00 00 sw (r14+0),r11 return 0; 800f070: 34 01 00 00 mvi r1,0 800f074: e0 00 00 04 bi 800f084 <_hash_search+0x94> } } the_node = the_node->next; 800f078: 29 6b 00 00 lw r11,(r11+0) ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 800f07c: 5d 6f ff f5 bne r11,r15,800f050 <_hash_search+0x60> return 0; } } the_node = the_node->next; } return -1; 800f080: 34 01 ff ff mvi r1,-1 } 800f084: 2b 9d 00 04 lw ra,(sp+4) 800f088: 2b 8b 00 1c lw r11,(sp+28) 800f08c: 2b 8c 00 18 lw r12,(sp+24) 800f090: 2b 8d 00 14 lw r13,(sp+20) 800f094: 2b 8e 00 10 lw r14,(sp+16) 800f098: 2b 8f 00 0c lw r15,(sp+12) 800f09c: 2b 90 00 08 lw r16,(sp+8) 800f0a0: 37 9c 00 1c addi sp,sp,28 800f0a4: c3 a0 00 00 ret =============================================================================== 080022d0 <_lstat_r>: int _STAT_R_NAME( struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { 80022d0: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 80022d4: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return _STAT_NAME( path, buf ); 80022d8: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 80022dc: b8 60 10 00 mv r2,r3 <== NOT EXECUTED 80022e0: fb ff ff dc calli 8002250 <== NOT EXECUTED } 80022e4: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80022e8: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 80022ec: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08003cb4 <_stat_r>: int _STAT_R_NAME( struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { 8003cb4: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 8003cb8: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return _STAT_NAME( path, buf ); 8003cbc: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 8003cc0: b8 60 10 00 mv r2,r3 <== NOT EXECUTED 8003cc4: fb ff ff dc calli 8003c34 <== NOT EXECUTED } 8003cc8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8003ccc: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 8003cd0: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08003a8c : #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 8003a8c: 37 9c ff e8 addi sp,sp,-24 8003a90: 5b 8b 00 18 sw (sp+24),r11 8003a94: 5b 8c 00 14 sw (sp+20),r12 8003a98: 5b 8d 00 10 sw (sp+16),r13 8003a9c: 5b 8e 00 0c sw (sp+12),r14 8003aa0: 5b 8f 00 08 sw (sp+8),r15 8003aa4: 5b 9d 00 04 sw (sp+4),ra rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 8003aa8: 78 0b 08 01 mvhi r11,0x801 8003aac: 39 6b 78 40 ori r11,r11,0x7840 #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 8003ab0: b8 20 70 00 mv r14,r1 rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 8003ab4: b9 60 08 00 mv r1,r11 #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 8003ab8: b8 40 60 00 mv r12,r2 rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 8003abc: f8 00 04 dc calli 8004e2c if (fcntl (fildes, F_GETFD) < 0) { 8003ac0: b9 c0 08 00 mv r1,r14 8003ac4: 34 02 00 01 mvi r2,1 8003ac8: f8 00 1c 56 calli 800ac20 8003acc: 4c 20 00 06 bge r1,r0,8003ae4 pthread_mutex_unlock(&aio_request_queue.mutex); 8003ad0: b9 60 08 00 mv r1,r11 8003ad4: f8 00 05 09 calli 8004ef8 rtems_set_errno_and_return_minus_one (EBADF); 8003ad8: f8 00 2c 97 calli 800ed34 <__errno> 8003adc: 34 02 00 09 mvi r2,9 8003ae0: e0 00 00 32 bi 8003ba8 } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { 8003ae4: 5d 80 00 2b bne r12,r0,8003b90 AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 8003ae8: 78 01 08 01 mvhi r1,0x801 8003aec: 38 21 78 88 ori r1,r1,0x7888 8003af0: b9 c0 10 00 mv r2,r14 8003af4: 34 03 00 00 mvi r3,0 8003af8: f8 00 01 86 calli 8004110 8003afc: b8 20 68 00 mv r13,r1 if (r_chain == NULL) { 8003b00: 5c 2c 00 17 bne r1,r12,8003b5c AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 8003b04: 29 62 00 54 lw r2,(r11+84) 8003b08: 78 01 08 01 mvhi r1,0x801 8003b0c: 38 21 78 98 ori r1,r1,0x7898 8003b10: 44 41 00 3f be r2,r1,8003c0c <== NEVER TAKEN r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 8003b14: 78 01 08 01 mvhi r1,0x801 8003b18: 38 21 78 94 ori r1,r1,0x7894 8003b1c: b9 c0 10 00 mv r2,r14 8003b20: 34 03 00 00 mvi r3,0 8003b24: f8 00 01 7b calli 8004110 8003b28: b8 20 60 00 mv r12,r1 if (r_chain == NULL) { 8003b2c: 44 2d 00 38 be r1,r13,8003c0c */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 8003b30: f8 00 0a 89 calli 8006554 <_Chain_Extract> } AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 8003b34: b9 80 08 00 mv r1,r12 8003b38: f8 00 01 ac calli 80041e8 pthread_mutex_destroy (&r_chain->mutex); 8003b3c: 35 8d 00 1c addi r13,r12,28 8003b40: b9 a0 08 00 mv r1,r13 8003b44: f8 00 04 00 calli 8004b44 pthread_cond_destroy (&r_chain->mutex); 8003b48: b9 a0 08 00 mv r1,r13 8003b4c: f8 00 02 ff calli 8004748 free (r_chain); 8003b50: b9 80 08 00 mv r1,r12 8003b54: fb ff f7 62 calli 80018dc 8003b58: e0 00 00 0a bi 8003b80 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 8003b5c: 34 2c 00 1c addi r12,r1,28 8003b60: b9 80 08 00 mv r1,r12 8003b64: f8 00 04 b2 calli 8004e2c 8003b68: b9 a0 08 00 mv r1,r13 8003b6c: f8 00 0a 7a calli 8006554 <_Chain_Extract> rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 8003b70: b9 a0 08 00 mv r1,r13 8003b74: f8 00 01 9d calli 80041e8 pthread_mutex_unlock (&r_chain->mutex); 8003b78: b9 80 08 00 mv r1,r12 8003b7c: f8 00 04 df calli 8004ef8 pthread_mutex_unlock (&aio_request_queue.mutex); 8003b80: b9 60 08 00 mv r1,r11 8003b84: f8 00 04 dd calli 8004ef8 return AIO_CANCELED; 8003b88: 34 0c 00 00 mvi r12,0 8003b8c: e0 00 00 2f bi 8003c48 } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { 8003b90: 29 8f 00 00 lw r15,(r12+0) 8003b94: 45 ee 00 08 be r15,r14,8003bb4 pthread_mutex_unlock (&aio_request_queue.mutex); 8003b98: b9 60 08 00 mv r1,r11 8003b9c: f8 00 04 d7 calli 8004ef8 rtems_set_errno_and_return_minus_one (EINVAL); 8003ba0: f8 00 2c 65 calli 800ed34 <__errno> 8003ba4: 34 02 00 16 mvi r2,22 8003ba8: 58 22 00 00 sw (r1+0),r2 8003bac: 34 0c ff ff mvi r12,-1 8003bb0: e0 00 00 26 bi 8003c48 } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 8003bb4: 78 01 08 01 mvhi r1,0x801 8003bb8: 38 21 78 88 ori r1,r1,0x7888 8003bbc: b9 e0 10 00 mv r2,r15 8003bc0: 34 03 00 00 mvi r3,0 8003bc4: f8 00 01 53 calli 8004110 8003bc8: b8 20 68 00 mv r13,r1 if (r_chain == NULL) { 8003bcc: 5c 20 00 14 bne r1,r0,8003c1c if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 8003bd0: 29 62 00 54 lw r2,(r11+84) 8003bd4: 78 01 08 01 mvhi r1,0x801 8003bd8: 38 21 78 98 ori r1,r1,0x7898 8003bdc: 44 41 00 0c be r2,r1,8003c0c <== NEVER TAKEN r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 8003be0: 78 01 08 01 mvhi r1,0x801 8003be4: 38 21 78 94 ori r1,r1,0x7894 8003be8: b9 e0 10 00 mv r2,r15 8003bec: 34 03 00 00 mvi r3,0 8003bf0: f8 00 01 48 calli 8004110 if (r_chain == NULL) { 8003bf4: 44 20 ff e9 be r1,r0,8003b98 rtems_set_errno_and_return_minus_one (EINVAL); } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 8003bf8: b9 80 10 00 mv r2,r12 8003bfc: 34 21 00 08 addi r1,r1,8 8003c00: f8 00 01 95 calli 8004254 8003c04: b8 20 60 00 mv r12,r1 8003c08: e0 00 00 0e bi 8003c40 pthread_mutex_unlock (&aio_request_queue.mutex); return result; } else { pthread_mutex_unlock (&aio_request_queue.mutex); 8003c0c: b9 60 08 00 mv r1,r11 8003c10: f8 00 04 ba calli 8004ef8 return AIO_ALLDONE; 8003c14: 34 0c 00 02 mvi r12,2 8003c18: e0 00 00 0c bi 8003c48 } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 8003c1c: 34 2e 00 1c addi r14,r1,28 8003c20: b9 c0 08 00 mv r1,r14 8003c24: f8 00 04 82 calli 8004e2c result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 8003c28: b9 80 10 00 mv r2,r12 8003c2c: 35 a1 00 08 addi r1,r13,8 8003c30: f8 00 01 89 calli 8004254 8003c34: b8 20 60 00 mv r12,r1 pthread_mutex_unlock (&r_chain->mutex); 8003c38: b9 c0 08 00 mv r1,r14 8003c3c: f8 00 04 af calli 8004ef8 pthread_mutex_unlock (&aio_request_queue.mutex); 8003c40: b9 60 08 00 mv r1,r11 8003c44: f8 00 04 ad calli 8004ef8 return result; } return AIO_ALLDONE; } 8003c48: b9 80 08 00 mv r1,r12 8003c4c: 2b 9d 00 04 lw ra,(sp+4) 8003c50: 2b 8b 00 18 lw r11,(sp+24) 8003c54: 2b 8c 00 14 lw r12,(sp+20) 8003c58: 2b 8d 00 10 lw r13,(sp+16) 8003c5c: 2b 8e 00 0c lw r14,(sp+12) 8003c60: 2b 8f 00 08 lw r15,(sp+8) 8003c64: 37 9c 00 18 addi sp,sp,24 8003c68: c3 a0 00 00 ret =============================================================================== 08003c74 : int aio_fsync( int op, struct aiocb *aiocbp ) { 8003c74: 37 9c ff f4 addi sp,sp,-12 8003c78: 5b 8b 00 0c sw (sp+12),r11 8003c7c: 5b 8c 00 08 sw (sp+8),r12 8003c80: 5b 9d 00 04 sw (sp+4),ra 8003c84: b8 40 58 00 mv r11,r2 rtems_aio_request *req; int mode; if (op != O_SYNC) 8003c88: 34 02 20 00 mvi r2,8192 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 8003c8c: 34 0c 00 16 mvi r12,22 ) { rtems_aio_request *req; int mode; if (op != O_SYNC) 8003c90: 5c 22 00 09 bne r1,r2,8003cb4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 8003c94: 29 61 00 00 lw r1,(r11+0) 8003c98: 34 02 00 03 mvi r2,3 8003c9c: f8 00 1b e1 calli 800ac20 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 8003ca0: 20 21 00 03 andi r1,r1,0x3 8003ca4: 34 21 ff ff addi r1,r1,-1 8003ca8: 34 02 00 01 mvi r2,1 8003cac: 50 41 00 09 bgeu r2,r1,8003cd0 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 8003cb0: 34 0c 00 09 mvi r12,9 8003cb4: 34 01 ff ff mvi r1,-1 8003cb8: 59 6c 00 2c sw (r11+44),r12 8003cbc: 59 61 00 30 sw (r11+48),r1 8003cc0: f8 00 2c 1d calli 800ed34 <__errno> 8003cc4: 58 2c 00 00 sw (r1+0),r12 8003cc8: 34 01 ff ff mvi r1,-1 8003ccc: e0 00 00 09 bi 8003cf0 req = malloc (sizeof (rtems_aio_request)); 8003cd0: 34 01 00 18 mvi r1,24 8003cd4: fb ff f8 67 calli 8001e70 if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 8003cd8: 34 0c 00 0b mvi r12,11 mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) 8003cdc: 44 20 ff f6 be r1,r0,8003cb4 <== NEVER TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 8003ce0: 58 2b 00 14 sw (r1+20),r11 req->aiocbp->aio_lio_opcode = LIO_SYNC; 8003ce4: 34 02 00 03 mvi r2,3 8003ce8: 59 62 00 28 sw (r11+40),r2 return rtems_aio_enqueue (req); 8003cec: f8 00 01 76 calli 80042c4 } 8003cf0: 2b 9d 00 04 lw ra,(sp+4) 8003cf4: 2b 8b 00 0c lw r11,(sp+12) 8003cf8: 2b 8c 00 08 lw r12,(sp+8) 8003cfc: 37 9c 00 0c addi sp,sp,12 8003d00: c3 a0 00 00 ret =============================================================================== 0800451c : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 800451c: 37 9c ff f4 addi sp,sp,-12 8004520: 5b 8b 00 0c sw (sp+12),r11 8004524: 5b 8c 00 08 sw (sp+8),r12 8004528: 5b 9d 00 04 sw (sp+4),ra 800452c: b8 20 58 00 mv r11,r1 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 8004530: 28 21 00 00 lw r1,(r1+0) 8004534: 34 02 00 03 mvi r2,3 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 8004538: 34 0c 00 09 mvi r12,9 aio_read (struct aiocb *aiocbp) { rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 800453c: f8 00 19 b9 calli 800ac20 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 8004540: 20 21 00 03 andi r1,r1,0x3 8004544: 7c 22 00 02 cmpnei r2,r1,2 8004548: 7c 21 00 00 cmpnei r1,r1,0 800454c: a0 41 08 00 and r1,r2,r1 8004550: 5c 20 00 04 bne r1,r0,8004560 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 8004554: 29 6c 00 10 lw r12,(r11+16) 8004558: 45 81 00 09 be r12,r1,800457c rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 800455c: 34 0c 00 16 mvi r12,22 8004560: 34 01 ff ff mvi r1,-1 8004564: 59 6c 00 2c sw (r11+44),r12 8004568: 59 61 00 30 sw (r11+48),r1 800456c: f8 00 29 f2 calli 800ed34 <__errno> 8004570: 58 2c 00 00 sw (r1+0),r12 8004574: 34 01 ff ff mvi r1,-1 8004578: e0 00 00 0d bi 80045ac if (aiocbp->aio_offset < 0) 800457c: 29 61 00 04 lw r1,(r11+4) 8004580: 4c 2c 00 02 bge r1,r12,8004588 8004584: e3 ff ff f6 bi 800455c rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 8004588: 34 01 00 18 mvi r1,24 800458c: fb ff f6 39 calli 8001e70 if (req == NULL) 8004590: 5c 2c 00 03 bne r1,r12,800459c <== ALWAYS TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 8004594: 34 0c 00 0b mvi r12,11 <== NOT EXECUTED 8004598: e3 ff ff f2 bi 8004560 <== NOT EXECUTED req->aiocbp = aiocbp; 800459c: 58 2b 00 14 sw (r1+20),r11 req->aiocbp->aio_lio_opcode = LIO_READ; 80045a0: 34 02 00 01 mvi r2,1 80045a4: 59 62 00 28 sw (r11+40),r2 return rtems_aio_enqueue (req); 80045a8: fb ff ff 47 calli 80042c4 } 80045ac: 2b 9d 00 04 lw ra,(sp+4) 80045b0: 2b 8b 00 0c lw r11,(sp+12) 80045b4: 2b 8c 00 08 lw r12,(sp+8) 80045b8: 37 9c 00 0c addi sp,sp,12 80045bc: c3 a0 00 00 ret =============================================================================== 080045c8 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 80045c8: 37 9c ff f4 addi sp,sp,-12 80045cc: 5b 8b 00 0c sw (sp+12),r11 80045d0: 5b 8c 00 08 sw (sp+8),r12 80045d4: 5b 9d 00 04 sw (sp+4),ra 80045d8: b8 20 58 00 mv r11,r1 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 80045dc: 28 21 00 00 lw r1,(r1+0) 80045e0: 34 02 00 03 mvi r2,3 80045e4: f8 00 19 8f calli 800ac20 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 80045e8: 20 21 00 03 andi r1,r1,0x3 80045ec: 34 21 ff ff addi r1,r1,-1 80045f0: 34 02 00 01 mvi r2,1 80045f4: 50 41 00 03 bgeu r2,r1,8004600 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 80045f8: 34 0c 00 09 mvi r12,9 80045fc: e0 00 00 04 bi 800460c if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 8004600: 29 61 00 10 lw r1,(r11+16) 8004604: 44 20 00 09 be r1,r0,8004628 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 8004608: 34 0c 00 16 mvi r12,22 800460c: 34 01 ff ff mvi r1,-1 8004610: 59 6c 00 2c sw (r11+44),r12 8004614: 59 61 00 30 sw (r11+48),r1 8004618: f8 00 29 c7 calli 800ed34 <__errno> 800461c: 58 2c 00 00 sw (r1+0),r12 8004620: 34 01 ff ff mvi r1,-1 8004624: e0 00 00 0c bi 8004654 if (aiocbp->aio_offset < 0) 8004628: 29 62 00 04 lw r2,(r11+4) 800462c: 4c 41 00 02 bge r2,r1,8004634 8004630: e3 ff ff f6 bi 8004608 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 8004634: 34 01 00 18 mvi r1,24 8004638: fb ff f6 0e calli 8001e70 if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 800463c: 34 0c 00 0b mvi r12,11 if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) 8004640: 44 20 ff f3 be r1,r0,800460c <== NEVER TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 8004644: 58 2b 00 14 sw (r1+20),r11 req->aiocbp->aio_lio_opcode = LIO_WRITE; 8004648: 34 02 00 02 mvi r2,2 800464c: 59 62 00 28 sw (r11+40),r2 return rtems_aio_enqueue (req); 8004650: fb ff ff 1d calli 80042c4 } 8004654: 2b 9d 00 04 lw ra,(sp+4) 8004658: 2b 8b 00 0c lw r11,(sp+12) 800465c: 2b 8c 00 08 lw r12,(sp+8) 8004660: 37 9c 00 0c addi sp,sp,12 8004664: c3 a0 00 00 ret =============================================================================== 08001f10 : #include #include int chroot( const char *path ) { 8001f10: 37 9c ff 9c addi sp,sp,-100 8001f14: 5b 8b 00 10 sw (sp+16),r11 8001f18: 5b 8c 00 0c sw (sp+12),r12 8001f1c: 5b 8d 00 08 sw (sp+8),r13 8001f20: 5b 9d 00 04 sw (sp+4),ra /* * We use the global environment for path evaluation. This makes it possible * to escape from a chroot environment referencing an unmounted file system. */ rtems_filesystem_eval_path_start_with_root_and_current( 8001f24: 78 04 08 01 mvhi r4,0x801 8001f28: 78 05 08 01 mvhi r5,0x801 #include #include int chroot( const char *path ) { 8001f2c: b8 20 10 00 mv r2,r1 /* * We use the global environment for path evaluation. This makes it possible * to escape from a chroot environment referencing an unmounted file system. */ rtems_filesystem_eval_path_start_with_root_and_current( 8001f30: 34 03 00 19 mvi r3,25 8001f34: 38 84 41 20 ori r4,r4,0x4120 8001f38: 38 a5 41 1c ori r5,r5,0x411c 8001f3c: 37 81 00 14 addi r1,sp,20 8001f40: f8 00 05 11 calli 8003384 eval_flags, &rtems_global_user_env.root_directory, &rtems_global_user_env.current_directory ); rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc ); 8001f44: 37 8b 00 4c addi r11,sp,76 8001f48: b9 60 08 00 mv r1,r11 8001f4c: 37 82 00 2c addi r2,sp,44 8001f50: f8 00 06 6d calli 8003904 new_current_loc = rtems_filesystem_location_transform_to_global( &loc ); 8001f54: b9 60 08 00 mv r1,r11 8001f58: f8 00 07 09 calli 8003b7c 8001f5c: 5b 81 00 64 sw (sp+100),r1 if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { 8001f60: 28 21 00 10 lw r1,(r1+16) 8001f64: 78 0c 08 01 mvhi r12,0x801 8001f68: 39 8c 2a 94 ori r12,r12,0x2a94 if ( rv != 0 ) { rtems_filesystem_global_location_release( new_root_loc ); } } else { rv = -1; 8001f6c: 34 0b ff ff mvi r11,-1 &rtems_global_user_env.current_directory ); rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc ); new_current_loc = rtems_filesystem_location_transform_to_global( &loc ); if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { 8001f70: 44 2c 00 24 be r1,r12,8002000 rtems_filesystem_global_location_t *new_root_loc = 8001f74: 37 81 00 64 addi r1,sp,100 8001f78: f8 00 06 c7 calli 8003a94 rtems_filesystem_global_location_obtain( &new_current_loc ); rtems_filesystem_node_types_t type = (*new_root_loc->location.mt_entry->ops->node_type_h)( 8001f7c: 28 22 00 14 lw r2,(r1+20) ); rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc ); new_current_loc = rtems_filesystem_location_transform_to_global( &loc ); if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { rtems_filesystem_global_location_t *new_root_loc = 8001f80: b8 20 58 00 mv r11,r1 rtems_filesystem_global_location_obtain( &new_current_loc ); rtems_filesystem_node_types_t type = (*new_root_loc->location.mt_entry->ops->node_type_h)( 8001f84: 28 42 00 0c lw r2,(r2+12) rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc ); new_current_loc = rtems_filesystem_location_transform_to_global( &loc ); if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { rtems_filesystem_global_location_t *new_root_loc = rtems_filesystem_global_location_obtain( &new_current_loc ); rtems_filesystem_node_types_t type = 8001f88: 28 42 00 14 lw r2,(r2+20) 8001f8c: d8 40 00 00 call r2 8001f90: b8 20 68 00 mv r13,r1 (*new_root_loc->location.mt_entry->ops->node_type_h)( &new_root_loc->location ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { 8001f94: 5c 20 00 13 bne r1,r0,8001fe0 sc = rtems_libio_set_private_env(); 8001f98: f8 00 02 fd calli 8002b8c if (sc == RTEMS_SUCCESSFUL) { 8001f9c: 5c 2d 00 0c bne r1,r13,8001fcc rtems_filesystem_global_location_assign( 8001fa0: 78 0c 08 01 mvhi r12,0x801 8001fa4: 39 8c 41 48 ori r12,r12,0x4148 8001fa8: 29 81 00 00 lw r1,(r12+0) 8001fac: b9 60 10 00 mv r2,r11 &rtems_filesystem_root, new_root_loc ); rtems_filesystem_global_location_assign( 8001fb0: 34 0b 00 00 mvi r11,0 ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { sc = rtems_libio_set_private_env(); if (sc == RTEMS_SUCCESSFUL) { rtems_filesystem_global_location_assign( 8001fb4: 34 21 00 04 addi r1,r1,4 8001fb8: f8 00 06 a9 calli 8003a5c &rtems_filesystem_root, new_root_loc ); rtems_filesystem_global_location_assign( 8001fbc: 29 81 00 00 lw r1,(r12+0) 8001fc0: 2b 82 00 64 lw r2,(sp+100) 8001fc4: f8 00 06 a6 calli 8003a5c 8001fc8: e0 00 00 0e bi 8002000 &rtems_filesystem_current, new_current_loc ); } else { if (sc != RTEMS_UNSATISFIED) { 8001fcc: 34 02 00 0d mvi r2,13 8001fd0: 44 22 00 09 be r1,r2,8001ff4 <== NEVER TAKEN errno = ENOMEM; 8001fd4: f8 00 26 11 calli 800b818 <__errno> 8001fd8: 34 02 00 0c mvi r2,12 8001fdc: e0 00 00 05 bi 8001ff0 static inline void rtems_filesystem_location_error( const rtems_filesystem_location_info_t *loc, int eno ) { if ( !rtems_filesystem_location_is_null( loc ) ) { 8001fe0: 29 61 00 10 lw r1,(r11+16) 8001fe4: 44 2c 00 04 be r1,r12,8001ff4 <== NEVER TAKEN errno = eno; 8001fe8: f8 00 26 0c calli 800b818 <__errno> 8001fec: 34 02 00 14 mvi r2,20 8001ff0: 58 22 00 00 sw (r1+0),r2 rtems_filesystem_location_error( &new_root_loc->location, ENOTDIR ); rv = -1; } if ( rv != 0 ) { rtems_filesystem_global_location_release( new_root_loc ); 8001ff4: b9 60 08 00 mv r1,r11 8001ff8: f8 00 06 7e calli 80039f0 8001ffc: 34 0b ff ff mvi r11,-1 } } else { rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 8002000: 37 81 00 14 addi r1,sp,20 8002004: f8 00 05 48 calli 8003524 if ( rv != 0 ) { 8002008: 45 60 00 03 be r11,r0,8002014 rtems_filesystem_global_location_release( new_current_loc ); 800200c: 2b 81 00 64 lw r1,(sp+100) 8002010: f8 00 06 78 calli 80039f0 } return rv; } 8002014: b9 60 08 00 mv r1,r11 8002018: 2b 9d 00 04 lw ra,(sp+4) 800201c: 2b 8b 00 10 lw r11,(sp+16) 8002020: 2b 8c 00 0c lw r12,(sp+12) 8002024: 2b 8d 00 08 lw r13,(sp+8) 8002028: 37 9c 00 64 addi sp,sp,100 800202c: c3 a0 00 00 ret =============================================================================== 080035c8 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 80035c8: 37 9c ff e8 addi sp,sp,-24 80035cc: 5b 8b 00 10 sw (sp+16),r11 80035d0: 5b 8c 00 0c sw (sp+12),r12 80035d4: 5b 8d 00 08 sw (sp+8),r13 80035d8: 5b 9d 00 04 sw (sp+4),ra 80035dc: b8 20 18 00 mv r3,r1 80035e0: b8 40 58 00 mv r11,r2 if ( !tp ) 80035e4: 44 40 00 27 be r2,r0,8003680 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 80035e8: 34 01 00 01 mvi r1,1 80035ec: 5c 61 00 18 bne r3,r1,800364c ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 80035f0: 78 02 08 01 mvhi r2,0x801 80035f4: 38 42 88 b8 ori r2,r2,0x88b8 80035f8: 37 81 00 14 addi r1,sp,20 80035fc: f8 00 07 52 calli 8005344 <_TOD_Get_with_nanoseconds> static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 8003600: 78 05 08 01 mvhi r5,0x801 #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 8003604: 28 2c 00 04 lw r12,(r1+4) 8003608: 28 2d 00 00 lw r13,(r1+0) 800360c: 38 a5 6e 60 ori r5,r5,0x6e60 8003610: 28 a4 00 00 lw r4,(r5+0) 8003614: 34 03 00 00 mvi r3,0 8003618: b9 a0 08 00 mv r1,r13 800361c: b9 80 10 00 mv r2,r12 8003620: f8 00 41 18 calli 8013a80 <__divdi3> _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 8003624: 78 05 08 01 mvhi r5,0x801 8003628: 38 a5 6e 60 ori r5,r5,0x6e60 800362c: 28 a4 00 00 lw r4,(r5+0) static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 8003630: 59 62 00 00 sw (r11+0),r2 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 8003634: b9 a0 08 00 mv r1,r13 8003638: b9 80 10 00 mv r2,r12 800363c: 34 03 00 00 mvi r3,0 8003640: f8 00 43 12 calli 8014288 <__moddi3> 8003644: 59 62 00 04 sw (r11+4),r2 8003648: e0 00 00 07 bi 8003664 if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 800364c: 34 01 00 04 mvi r1,4 8003650: 44 61 00 03 be r3,r1,800365c <== NEVER TAKEN return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { 8003654: 34 01 00 02 mvi r1,2 8003658: 5c 61 00 05 bne r3,r1,800366c _TOD_Get_uptime_as_timespec( tp ); 800365c: b9 60 08 00 mv r1,r11 8003660: f8 00 07 57 calli 80053bc <_TOD_Get_uptime_as_timespec> return 0; 8003664: 34 01 00 00 mvi r1,0 8003668: e0 00 00 0a bi 8003690 } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 800366c: 34 01 00 03 mvi r1,3 8003670: 5c 61 00 04 bne r3,r1,8003680 rtems_set_errno_and_return_minus_one( ENOSYS ); 8003674: f8 00 28 52 calli 800d7bc <__errno> 8003678: 34 02 00 58 mvi r2,88 800367c: e0 00 00 03 bi 8003688 #endif rtems_set_errno_and_return_minus_one( EINVAL ); 8003680: f8 00 28 4f calli 800d7bc <__errno> 8003684: 34 02 00 16 mvi r2,22 8003688: 58 22 00 00 sw (r1+0),r2 800368c: 34 01 ff ff mvi r1,-1 return 0; } 8003690: 2b 9d 00 04 lw ra,(sp+4) 8003694: 2b 8b 00 10 lw r11,(sp+16) 8003698: 2b 8c 00 0c lw r12,(sp+12) 800369c: 2b 8d 00 08 lw r13,(sp+8) 80036a0: 37 9c 00 18 addi sp,sp,24 80036a4: c3 a0 00 00 ret =============================================================================== 08025394 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 8025394: 37 9c ff e8 addi sp,sp,-24 8025398: 5b 8b 00 10 sw (sp+16),r11 802539c: 5b 8c 00 0c sw (sp+12),r12 80253a0: 5b 8d 00 08 sw (sp+8),r13 80253a4: 5b 9d 00 04 sw (sp+4),ra 80253a8: b8 40 58 00 mv r11,r2 if ( !tp ) 80253ac: 44 40 00 30 be r2,r0,802546c <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 80253b0: 34 02 00 01 mvi r2,1 80253b4: 5c 22 00 27 bne r1,r2,8025450 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 80253b8: 78 03 08 05 mvhi r3,0x805 80253bc: 38 63 f7 8c ori r3,r3,0xf78c 80253c0: 29 62 00 00 lw r2,(r11+0) 80253c4: 28 61 00 00 lw r1,(r3+0) 80253c8: 54 41 00 02 bgu r2,r1,80253d0 80253cc: e0 00 00 28 bi 802546c * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 80253d0: 78 01 08 06 mvhi r1,0x806 80253d4: 38 21 a0 60 ori r1,r1,0xa060 80253d8: 28 22 00 00 lw r2,(r1+0) ++level; 80253dc: 34 42 00 01 addi r2,r2,1 _Thread_Dispatch_disable_level = level; 80253e0: 58 22 00 00 sw (r1+0),r2 const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 80253e4: 29 6c 00 00 lw r12,(r11+0) 80253e8: 34 02 00 1f mvi r2,31 80253ec: b9 80 08 00 mv r1,r12 80253f0: f8 00 cc 60 calli 8058570 <__ashrsi3> Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; 80253f4: 78 05 08 05 mvhi r5,0x805 80253f8: 38 a5 94 90 ori r5,r5,0x9490 80253fc: 28 a4 00 00 lw r4,(r5+0) 8025400: 34 03 00 00 mvi r3,0 8025404: b9 80 10 00 mv r2,r12 8025408: f8 00 b4 d1 calli 805274c <__muldi3> 802540c: 29 6b 00 04 lw r11,(r11+4) 8025410: b8 40 60 00 mv r12,r2 8025414: b8 20 68 00 mv r13,r1 8025418: 34 02 00 1f mvi r2,31 802541c: b9 60 08 00 mv r1,r11 8025420: f8 00 cc 54 calli 8058570 <__ashrsi3> 8025424: b5 8b 18 00 add r3,r12,r11 8025428: f5 83 60 00 cmpgu r12,r12,r3 802542c: b5 a1 08 00 add r1,r13,r1 8025430: b5 81 08 00 add r1,r12,r1 8025434: 5b 81 00 14 sw (sp+20),r1 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 8025438: 37 81 00 14 addi r1,sp,20 802543c: 5b 83 00 18 sw (sp+24),r3 8025440: f8 00 05 9b calli 8026aac <_TOD_Set_with_timestamp> rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); 8025444: fb ff 81 e3 calli 8005bd0 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 8025448: 34 01 00 00 mvi r1,0 802544c: e0 00 00 0c bi 802547c _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) 8025450: 34 02 00 02 mvi r2,2 8025454: 44 22 00 03 be r1,r2,8025460 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 8025458: 34 02 00 03 mvi r2,3 802545c: 5c 22 00 04 bne r1,r2,802546c rtems_set_errno_and_return_minus_one( ENOSYS ); 8025460: f8 00 4e 4b calli 8038d8c <__errno> 8025464: 34 02 00 58 mvi r2,88 8025468: e0 00 00 03 bi 8025474 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 802546c: f8 00 4e 48 calli 8038d8c <__errno> 8025470: 34 02 00 16 mvi r2,22 8025474: 58 22 00 00 sw (r1+0),r2 8025478: 34 01 ff ff mvi r1,-1 return 0; } 802547c: 2b 9d 00 04 lw ra,(sp+4) 8025480: 2b 8b 00 10 lw r11,(sp+16) 8025484: 2b 8c 00 0c lw r12,(sp+12) 8025488: 2b 8d 00 08 lw r13,(sp+8) 802548c: 37 9c 00 18 addi sp,sp,24 8025490: c3 a0 00 00 ret =============================================================================== 0800155c : dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 800155c: 37 9c ff d4 addi sp,sp,-44 8001560: 5b 8b 00 2c sw (sp+44),r11 8001564: 5b 8c 00 28 sw (sp+40),r12 8001568: 5b 8d 00 24 sw (sp+36),r13 800156c: 5b 8e 00 20 sw (sp+32),r14 8001570: 5b 8f 00 1c sw (sp+28),r15 8001574: 5b 90 00 18 sw (sp+24),r16 8001578: 5b 91 00 14 sw (sp+20),r17 800157c: 5b 92 00 10 sw (sp+16),r18 8001580: 5b 93 00 0c sw (sp+12),r19 8001584: 5b 94 00 08 sw (sp+8),r20 8001588: 5b 9d 00 04 sw (sp+4),ra 800158c: b8 40 68 00 mv r13,r2 rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { 8001590: 78 02 08 01 mvhi r2,0x801 8001594: 38 42 a7 54 ori r2,r2,0xa754 8001598: 28 4f 00 00 lw r15,(r2+0) dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 800159c: b8 20 70 00 mv r14,r1 80015a0: b8 60 90 00 mv r18,r3 80015a4: b8 80 98 00 mv r19,r4 80015a8: b8 a0 a0 00 mv r20,r5 rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { 80015ac: 55 e1 00 24 bgu r15,r1,800163c rtems_disk_device_table *table = disktab; 80015b0: 78 02 08 01 mvhi r2,0x801 80015b4: 38 42 a7 50 ori r2,r2,0xa750 80015b8: 28 4b 00 00 lw r11,(r2+0) rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; 80015bc: b9 e0 08 00 mv r1,r15 80015c0: 34 02 00 01 mvi r2,1 80015c4: f8 00 58 df calli 8017940 <__ashlsi3> 80015c8: b8 20 60 00 mv r12,r1 if (major >= new_size) { 80015cc: 54 2e 00 02 bgu r1,r14,80015d4 <== NEVER TAKEN new_size = major + 1; 80015d0: 35 cc 00 01 addi r12,r14,1 } table = realloc(table, new_size * sizeof(*table)); 80015d4: 34 02 00 03 mvi r2,3 80015d8: b9 80 08 00 mv r1,r12 80015dc: f8 00 58 d9 calli 8017940 <__ashlsi3> 80015e0: b8 20 10 00 mv r2,r1 80015e4: b9 60 08 00 mv r1,r11 80015e8: f8 00 09 40 calli 8003ae8 80015ec: b8 20 80 00 mv r16,r1 rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { return RTEMS_NO_MEMORY; 80015f0: 34 0b 00 1a mvi r11,26 if (major >= new_size) { new_size = major + 1; } table = realloc(table, new_size * sizeof(*table)); if (table == NULL) { 80015f4: 44 20 00 68 be r1,r0,8001794 <== ALWAYS TAKEN return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 80015f8: 34 02 00 03 mvi r2,3 <== NOT EXECUTED 80015fc: c9 8f 08 00 sub r1,r12,r15 <== NOT EXECUTED 8001600: f8 00 58 d0 calli 8017940 <__ashlsi3> <== NOT EXECUTED 8001604: b8 20 58 00 mv r11,r1 <== NOT EXECUTED 8001608: 34 02 00 03 mvi r2,3 <== NOT EXECUTED 800160c: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 8001610: f8 00 58 cc calli 8017940 <__ashlsi3> <== NOT EXECUTED 8001614: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 8001618: b6 01 08 00 add r1,r16,r1 <== NOT EXECUTED 800161c: b9 60 18 00 mv r3,r11 <== NOT EXECUTED 8001620: f8 00 44 c4 calli 8012930 <== NOT EXECUTED disktab = table; 8001624: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8001628: 38 42 a7 50 ori r2,r2,0xa750 <== NOT EXECUTED 800162c: 58 50 00 00 sw (r2+0),r16 <== NOT EXECUTED disktab_size = new_size; 8001630: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8001634: 38 42 a7 54 ori r2,r2,0xa754 <== NOT EXECUTED 8001638: 58 4c 00 00 sw (r2+0),r12 <== NOT EXECUTED } if (disktab [major].minor == NULL || minor >= disktab[major].size) { 800163c: 34 02 00 03 mvi r2,3 8001640: b9 c0 08 00 mv r1,r14 8001644: f8 00 58 bf calli 8017940 <__ashlsi3> 8001648: 78 02 08 01 mvhi r2,0x801 800164c: 38 42 a7 50 ori r2,r2,0xa750 8001650: 28 42 00 00 lw r2,(r2+0) 8001654: b8 20 80 00 mv r16,r1 8001658: b4 41 10 00 add r2,r2,r1 800165c: 28 4b 00 00 lw r11,(r2+0) 8001660: 45 60 00 03 be r11,r0,800166c 8001664: 28 41 00 04 lw r1,(r2+4) 8001668: 54 2d 00 24 bgu r1,r13,80016f8 rtems_disk_device **table = disktab [major].minor; rtems_device_minor_number old_size = disktab [major].size; 800166c: 28 4f 00 04 lw r15,(r2+4) rtems_device_minor_number new_size = 0; if (old_size == 0) { new_size = DISKTAB_INITIAL_SIZE; 8001670: 34 0c 00 08 mvi r12,8 if (disktab [major].minor == NULL || minor >= disktab[major].size) { rtems_disk_device **table = disktab [major].minor; rtems_device_minor_number old_size = disktab [major].size; rtems_device_minor_number new_size = 0; if (old_size == 0) { 8001674: 45 e0 00 05 be r15,r0,8001688 new_size = DISKTAB_INITIAL_SIZE; } else { new_size = 2 * old_size; 8001678: b9 e0 08 00 mv r1,r15 800167c: 34 02 00 01 mvi r2,1 8001680: f8 00 58 b0 calli 8017940 <__ashlsi3> 8001684: b8 20 60 00 mv r12,r1 } if (minor >= new_size) { 8001688: 55 8d 00 02 bgu r12,r13,8001690 new_size = minor + 1; 800168c: 35 ac 00 01 addi r12,r13,1 } table = realloc(table, new_size * sizeof(*table)); 8001690: 34 02 00 02 mvi r2,2 8001694: b9 80 08 00 mv r1,r12 8001698: f8 00 58 aa calli 8017940 <__ashlsi3> 800169c: b8 20 10 00 mv r2,r1 80016a0: b9 60 08 00 mv r1,r11 80016a4: f8 00 09 11 calli 8003ae8 80016a8: b8 20 88 00 mv r17,r1 rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { return RTEMS_NO_MEMORY; 80016ac: 34 0b 00 1a mvi r11,26 if (minor >= new_size) { new_size = minor + 1; } table = realloc(table, new_size * sizeof(*table)); if (table == NULL) { 80016b0: 44 20 00 39 be r1,r0,8001794 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 80016b4: 34 02 00 02 mvi r2,2 80016b8: c9 8f 08 00 sub r1,r12,r15 80016bc: f8 00 58 a1 calli 8017940 <__ashlsi3> 80016c0: b8 20 58 00 mv r11,r1 80016c4: 34 02 00 02 mvi r2,2 80016c8: b9 e0 08 00 mv r1,r15 80016cc: f8 00 58 9d calli 8017940 <__ashlsi3> 80016d0: 34 02 00 00 mvi r2,0 80016d4: b6 21 08 00 add r1,r17,r1 80016d8: b9 60 18 00 mv r3,r11 80016dc: f8 00 44 95 calli 8012930 disktab [major].minor = table; 80016e0: 78 02 08 01 mvhi r2,0x801 80016e4: 38 42 a7 50 ori r2,r2,0xa750 80016e8: 28 41 00 00 lw r1,(r2+0) 80016ec: b4 30 08 00 add r1,r1,r16 80016f0: 58 31 00 00 sw (r1+0),r17 disktab [major].size = new_size; 80016f4: 58 2c 00 04 sw (r1+4),r12 } return disktab [major].minor + minor; 80016f8: 78 02 08 01 mvhi r2,0x801 80016fc: 38 42 a7 50 ori r2,r2,0xa750 8001700: 28 41 00 00 lw r1,(r2+0) 8001704: 34 02 00 02 mvi r2,2 rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { return RTEMS_NO_MEMORY; 8001708: 34 0b 00 1a mvi r11,26 memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); disktab [major].minor = table; disktab [major].size = new_size; } return disktab [major].minor + minor; 800170c: b4 30 80 00 add r16,r1,r16 8001710: b9 a0 08 00 mv r1,r13 8001714: f8 00 58 8b calli 8017940 <__ashlsi3> 8001718: 2a 0f 00 00 lw r15,(r16+0) 800171c: b5 e1 78 00 add r15,r15,r1 { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { 8001720: 45 e0 00 1d be r15,r0,8001794 <== NEVER TAKEN return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { 8001724: 29 f0 00 00 lw r16,(r15+0) return RTEMS_RESOURCE_IN_USE; 8001728: 34 0b 00 0c mvi r11,12 if (dd_entry == NULL) { return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { 800172c: 5e 00 00 1a bne r16,r0,8001794 return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); 8001730: 34 01 00 78 mvi r1,120 8001734: f8 00 06 05 calli 8002f48 8001738: b8 20 60 00 mv r12,r1 if (dd == NULL) { return RTEMS_NO_MEMORY; 800173c: 34 0b 00 1a mvi r11,26 if (*dd_entry != NULL) { return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); if (dd == NULL) { 8001740: 44 30 00 15 be r1,r16,8001794 <== NEVER TAKEN return RTEMS_NO_MEMORY; } if (name != NULL) { 8001744: 46 40 00 0f be r18,r0,8001780 alloc_name = strdup(name); 8001748: ba 40 08 00 mv r1,r18 800174c: f8 00 45 c0 calli 8012e4c 8001750: b8 20 80 00 mv r16,r1 8001754: b8 20 88 00 mv r17,r1 if (alloc_name == NULL) { 8001758: 5c 20 00 1d bne r1,r0,80017cc <== ALWAYS TAKEN free(dd); 800175c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8001760: f8 00 04 6c calli 8002910 <== NOT EXECUTED return RTEMS_NO_MEMORY; 8001764: e0 00 00 0c bi 8001794 <== NOT EXECUTED } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { free(alloc_name); 8001768: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 800176c: f8 00 04 69 calli 8002910 <== NOT EXECUTED free(dd); 8001770: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8001774: f8 00 04 67 calli 8002910 <== NOT EXECUTED return RTEMS_UNSATISFIED; 8001778: 34 0b 00 0d mvi r11,13 <== NOT EXECUTED 800177c: e0 00 00 06 bi 8001794 <== NOT EXECUTED char **alloc_name_ptr ) { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; 8001780: 34 11 00 00 mvi r17,0 free(dd); return RTEMS_UNSATISFIED; } } *dd_entry = dd; 8001784: 59 ec 00 00 sw (r15+0),r12 *dd_ptr = dd; 8001788: 5a 6c 00 00 sw (r19+0),r12 *alloc_name_ptr = alloc_name; 800178c: 5a 91 00 00 sw (r20+0),r17 return RTEMS_SUCCESSFUL; 8001790: 34 0b 00 00 mvi r11,0 } 8001794: b9 60 08 00 mv r1,r11 8001798: 2b 9d 00 04 lw ra,(sp+4) 800179c: 2b 8b 00 2c lw r11,(sp+44) 80017a0: 2b 8c 00 28 lw r12,(sp+40) 80017a4: 2b 8d 00 24 lw r13,(sp+36) 80017a8: 2b 8e 00 20 lw r14,(sp+32) 80017ac: 2b 8f 00 1c lw r15,(sp+28) 80017b0: 2b 90 00 18 lw r16,(sp+24) 80017b4: 2b 91 00 14 lw r17,(sp+20) 80017b8: 2b 92 00 10 lw r18,(sp+16) 80017bc: 2b 93 00 0c lw r19,(sp+12) 80017c0: 2b 94 00 08 lw r20,(sp+8) 80017c4: 37 9c 00 2c addi sp,sp,44 80017c8: c3 a0 00 00 ret return RTEMS_NO_MEMORY; } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { 80017cc: 34 02 61 ff mvi r2,25087 80017d0: b9 c0 18 00 mv r3,r14 80017d4: b9 a0 20 00 mv r4,r13 80017d8: f8 00 06 44 calli 80030e8 80017dc: 48 01 ff e3 bg r0,r1,8001768 <== NEVER TAKEN 80017e0: e3 ff ff e9 bi 8001784 =============================================================================== 08001114 : * ctermid() - POSIX 1003.1b 4.7.1 - Generate Terminal Pathname */ char *ctermid( char *s ) { 8001114: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED 8001118: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED 800111c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 8001120: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8001124: b8 20 58 00 mv r11,r1 <== NOT EXECUTED 8001128: 38 42 08 78 ori r2,r2,0x878 <== NOT EXECUTED if ( !s ) 800112c: 44 20 00 03 be r1,r0,8001138 <== NOT EXECUTED /* * We have no way of knowing the length of the user provided buffer. * It may not be large enough but there is no way to know that. :( * So this is a potential buffer owerrun that we can do nothing about. */ strcpy( s, ctermid_name ); 8001130: f8 00 2a c5 calli 800bc44 <== NOT EXECUTED return s; 8001134: e0 00 00 02 bi 800113c <== NOT EXECUTED char *ctermid( char *s ) { if ( !s ) return ctermid_name; 8001138: b8 40 58 00 mv r11,r2 <== NOT EXECUTED * It may not be large enough but there is no way to know that. :( * So this is a potential buffer owerrun that we can do nothing about. */ strcpy( s, ctermid_name ); return s; } 800113c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8001140: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8001144: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8001148: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 800114c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08003078 : * RTEMS_NO_MEMOTY, if cannot allocate memory for part_desc_t strucure; * RTEMS_INTERNAL_ERROR, if other error occurs. */ static rtems_status_code data_to_part_desc(uint8_t *data, rtems_part_desc_t **new_part_desc) { 8003078: 37 9c ff e4 addi sp,sp,-28 800307c: 5b 8b 00 18 sw (sp+24),r11 8003080: 5b 8c 00 14 sw (sp+20),r12 8003084: 5b 8d 00 10 sw (sp+16),r13 8003088: 5b 8e 00 0c sw (sp+12),r14 800308c: 5b 8f 00 08 sw (sp+8),r15 8003090: 5b 9d 00 04 sw (sp+4),ra 8003094: b8 20 60 00 mv r12,r1 8003098: b8 40 70 00 mv r14,r2 rtems_part_desc_t *part_desc; uint32_t temp; if (new_part_desc == NULL) { return RTEMS_INTERNAL_ERROR; 800309c: 34 01 00 19 mvi r1,25 data_to_part_desc(uint8_t *data, rtems_part_desc_t **new_part_desc) { rtems_part_desc_t *part_desc; uint32_t temp; if (new_part_desc == NULL) 80030a0: 44 40 00 35 be r2,r0,8003174 <== NEVER TAKEN { return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; 80030a4: 58 40 00 00 sw (r2+0),r0 if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) 80030a8: 34 01 00 01 mvi r1,1 80030ac: 34 02 00 28 mvi r2,40 80030b0: f8 00 03 70 calli 8003e70 80030b4: b8 20 58 00 mv r11,r1 { return RTEMS_NO_MEMORY; 80030b8: 34 01 00 1a mvi r1,26 return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) 80030bc: 45 60 00 2e be r11,r0,8003174 <== NEVER TAKEN { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); 80030c0: 41 81 00 00 lbu r1,(r12+0) 80030c4: 31 61 00 00 sb (r11+0),r1 part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); 80030c8: 41 8d 00 04 lbu r13,(r12+4) /* read the offset start position and partition size in sectors */ /* due to incorrect data alignment one have to align data first */ memcpy(&temp, data + RTEMS_IDE_PARTITION_START_OFFSET, sizeof(uint32_t)); 80030cc: 35 81 00 08 addi r1,r12,8 { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); 80030d0: 31 6d 00 01 sb (r11+1),r13 /* read the offset start position and partition size in sectors */ /* due to incorrect data alignment one have to align data first */ memcpy(&temp, data + RTEMS_IDE_PARTITION_START_OFFSET, sizeof(uint32_t)); 80030d4: 41 84 00 08 lbu r4,(r12+8) 80030d8: 40 23 00 01 lbu r3,(r1+1) 80030dc: 40 22 00 02 lbu r2,(r1+2) 80030e0: 40 21 00 03 lbu r1,(r1+3) 80030e4: 33 84 00 1c sb (sp+28),r4 80030e8: 33 83 00 1d sb (sp+29),r3 80030ec: 33 82 00 1e sb (sp+30),r2 80030f0: 33 81 00 1f sb (sp+31),r1 part_desc->start = LE_TO_CPU_U32(temp); 80030f4: 2b 81 00 1c lw r1,(sp+28) * true if partition type is extended, false otherwise */ static bool is_extended(uint8_t type) { return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED)); 80030f8: 65 af 00 85 cmpei r15,r13,133 /* read the offset start position and partition size in sectors */ /* due to incorrect data alignment one have to align data first */ memcpy(&temp, data + RTEMS_IDE_PARTITION_START_OFFSET, sizeof(uint32_t)); part_desc->start = LE_TO_CPU_U32(temp); 80030fc: fb ff ff 60 calli 8002e7c 8003100: 59 61 00 04 sw (r11+4),r1 memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); 8003104: 35 81 00 0c addi r1,r12,12 8003108: 41 84 00 0c lbu r4,(r12+12) 800310c: 40 23 00 01 lbu r3,(r1+1) 8003110: 40 22 00 02 lbu r2,(r1+2) 8003114: 40 21 00 03 lbu r1,(r1+3) 8003118: 33 84 00 1c sb (sp+28),r4 800311c: 33 83 00 1d sb (sp+29),r3 8003120: 33 82 00 1e sb (sp+30),r2 8003124: 33 81 00 1f sb (sp+31),r1 part_desc->size = LE_TO_CPU_U32(temp); 8003128: 2b 81 00 1c lw r1,(sp+28) 800312c: fb ff ff 54 calli 8002e7c 8003130: b8 20 60 00 mv r12,r1 8003134: 59 61 00 08 sw (r11+8),r1 * true if partition type is extended, false otherwise */ static bool is_extended(uint8_t type) { return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED)); 8003138: 65 a1 00 05 cmpei r1,r13,5 800313c: b9 e1 78 00 or r15,r15,r1 * use partitions that are * - extended * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || 8003140: 5d e0 00 08 bne r15,r0,8003160 DOS_P32MB_PARTITION, FAT32_PARTITION ,FAT32_LBA_PARTITION, FAT16_LBA_PARTITION }; return (NULL != memchr(fat_part_types,type,sizeof(fat_part_types))); 8003144: 78 01 08 02 mvhi r1,0x802 8003148: 38 21 64 dc ori r1,r1,0x64dc 800314c: b9 a0 10 00 mv r2,r13 8003150: 34 03 00 06 mvi r3,6 8003154: f8 00 43 f5 calli 8014128 * use partitions that are * - extended * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || 8003158: 44 2f 00 04 be r1,r15,8003168 ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { 800315c: 45 80 00 03 be r12,r0,8003168 <== NEVER TAKEN *new_part_desc = part_desc; 8003160: 59 cb 00 00 sw (r14+0),r11 8003164: e0 00 00 03 bi 8003170 } else { /* empty partition */ free(part_desc); 8003168: b9 60 08 00 mv r1,r11 800316c: f8 00 03 8b calli 8003f98 } return RTEMS_SUCCESSFUL; 8003170: 34 01 00 00 mvi r1,0 } 8003174: 2b 9d 00 04 lw ra,(sp+4) 8003178: 2b 8b 00 18 lw r11,(sp+24) 800317c: 2b 8c 00 14 lw r12,(sp+20) 8003180: 2b 8d 00 10 lw r13,(sp+16) 8003184: 2b 8e 00 0c lw r14,(sp+12) 8003188: 2b 8f 00 08 lw r15,(sp+8) 800318c: 37 9c 00 1c addi sp,sp,28 8003190: c3 a0 00 00 ret =============================================================================== 080008c0 : #endif #include "devfs.h" void devFS_Show(void) { 80008c0: 37 9c ff dc addi sp,sp,-36 80008c4: 5b 8b 00 24 sw (sp+36),r11 80008c8: 5b 8c 00 20 sw (sp+32),r12 80008cc: 5b 8d 00 1c sw (sp+28),r13 80008d0: 5b 8e 00 18 sw (sp+24),r14 80008d4: 5b 8f 00 14 sw (sp+20),r15 80008d8: 5b 90 00 10 sw (sp+16),r16 80008dc: 5b 91 00 0c sw (sp+12),r17 80008e0: 5b 92 00 08 sw (sp+8),r18 80008e4: 5b 9d 00 04 sw (sp+4),ra rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; 80008e8: 78 01 08 01 mvhi r1,0x801 80008ec: 38 21 11 80 ori r1,r1,0x1180 80008f0: 28 21 00 00 lw r1,(r1+0) 80008f4: 28 21 00 04 lw r1,(r1+4) if (rootloc->mt_entry->ops == &devFS_ops) { 80008f8: 28 22 00 14 lw r2,(r1+20) 80008fc: 78 01 08 01 mvhi r1,0x801 8000900: 38 21 01 d8 ori r1,r1,0x1d8 8000904: 28 43 00 0c lw r3,(r2+12) 8000908: 5c 61 00 21 bne r3,r1,800098c <== NEVER TAKEN static inline const devFS_data *devFS_get_data( const rtems_filesystem_location_info_t *loc ) { return (const devFS_data *) loc->mt_entry->immutable_fs_info; 800090c: 28 41 00 10 lw r1,(r2+16) if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); 8000910: 78 0f 08 01 mvhi r15,0x801 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); 8000914: 78 0e 08 01 mvhi r14,0x801 } printk( 8000918: 78 0d 08 01 mvhi r13,0x801 rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; if (rootloc->mt_entry->ops == &devFS_ops) { const devFS_data *data = devFS_get_data(rootloc); size_t i = 0; size_t n = data->count; 800091c: 28 31 00 04 lw r17,(r1+4) 8000920: 28 2b 00 00 lw r11,(r1+0) devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { 8000924: 34 10 00 00 mvi r16,0 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); 8000928: 39 ef 02 58 ori r15,r15,0x258 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); 800092c: 39 ce 02 5c ori r14,r14,0x25c } printk( 8000930: 39 ad 02 60 ori r13,r13,0x260 const devFS_data *data = devFS_get_data(rootloc); size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { 8000934: e0 00 00 15 bi 8000988 devFS_node *current = nodes + i; if (current->name != NULL) { 8000938: 29 61 00 00 lw r1,(r11+0) 800093c: 44 20 00 11 be r1,r0,8000980 size_t j = 0; size_t m = current->namelen; printk("/"); 8000940: b9 e0 08 00 mv r1,r15 for (i = 0; i < n; ++i) { devFS_node *current = nodes + i; if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; 8000944: 29 72 00 04 lw r18,(r11+4) printk("/"); for (j = 0; j < m; ++j) { 8000948: 34 0c 00 00 mvi r12,0 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); 800094c: f8 00 03 e2 calli 80018d4 for (j = 0; j < m; ++j) { 8000950: e0 00 00 07 bi 800096c printk("%c", current->name [j]); 8000954: 29 62 00 00 lw r2,(r11+0) 8000958: b9 c0 08 00 mv r1,r14 800095c: b4 4c 10 00 add r2,r2,r12 8000960: 40 42 00 00 lbu r2,(r2+0) if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); for (j = 0; j < m; ++j) { 8000964: 35 8c 00 01 addi r12,r12,1 printk("%c", current->name [j]); 8000968: f8 00 03 db calli 80018d4 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); for (j = 0; j < m; ++j) { 800096c: 56 4c ff fa bgu r18,r12,8000954 printk("%c", current->name [j]); } printk( 8000970: 29 62 00 08 lw r2,(r11+8) 8000974: 29 63 00 0c lw r3,(r11+12) 8000978: b9 a0 08 00 mv r1,r13 800097c: f8 00 03 d6 calli 80018d4 const devFS_data *data = devFS_get_data(rootloc); size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { 8000980: 36 10 00 01 addi r16,r16,1 8000984: 35 6b 00 14 addi r11,r11,20 8000988: 56 30 ff ec bgu r17,r16,8000938 (unsigned long) current->minor ); } } } } 800098c: 2b 9d 00 04 lw ra,(sp+4) 8000990: 2b 8b 00 24 lw r11,(sp+36) 8000994: 2b 8c 00 20 lw r12,(sp+32) 8000998: 2b 8d 00 1c lw r13,(sp+28) 800099c: 2b 8e 00 18 lw r14,(sp+24) 80009a0: 2b 8f 00 14 lw r15,(sp+20) 80009a4: 2b 90 00 10 lw r16,(sp+16) 80009a8: 2b 91 00 0c lw r17,(sp+12) 80009ac: 2b 92 00 08 lw r18,(sp+8) 80009b0: 37 9c 00 24 addi sp,sp,36 80009b4: c3 a0 00 00 ret =============================================================================== 08009c84 : } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { 8009c84: 37 9c ff dc addi sp,sp,-36 8009c88: 5b 8b 00 24 sw (sp+36),r11 8009c8c: 5b 8c 00 20 sw (sp+32),r12 8009c90: 5b 8d 00 1c sw (sp+28),r13 8009c94: 5b 8e 00 18 sw (sp+24),r14 8009c98: 5b 8f 00 14 sw (sp+20),r15 8009c9c: 5b 90 00 10 sw (sp+16),r16 8009ca0: 5b 91 00 0c sw (sp+12),r17 8009ca4: 5b 92 00 08 sw (sp+8),r18 8009ca8: 5b 9d 00 04 sw (sp+4),ra 8009cac: b8 20 58 00 mv r11,r1 static inline const devFS_data *devFS_get_data( const rtems_filesystem_location_info_t *loc ) { return (const devFS_data *) loc->mt_entry->immutable_fs_info; 8009cb0: 28 21 00 2c lw r1,(r1+44) } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } 8009cb4: 29 71 00 00 lw r17,(r11+0) 8009cb8: 29 6f 00 04 lw r15,(r11+4) 8009cbc: 28 21 00 10 lw r1,(r1+16) { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; 8009cc0: 34 0d 00 00 mvi r13,0 ) { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; 8009cc4: 34 0e 00 00 mvi r14,0 size_t pathlen, devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; 8009cc8: 28 32 00 04 lw r18,(r1+4) 8009ccc: 28 2c 00 00 lw r12,(r1+0) devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 8009cd0: 34 10 00 00 mvi r16,0 8009cd4: e0 00 00 0f bi 8009d10 devFS_node *current = nodes + i; if (current->name != NULL) { 8009cd8: 29 81 00 00 lw r1,(r12+0) 8009cdc: 44 20 00 08 be r1,r0,8009cfc if ( 8009ce0: 29 82 00 04 lw r2,(r12+4) 8009ce4: 5c 4f 00 09 bne r2,r15,8009d08 current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 8009ce8: ba 20 10 00 mv r2,r17 8009cec: b9 e0 18 00 mv r3,r15 8009cf0: f8 00 11 d5 calli 800e444 8009cf4: 44 20 00 04 be r1,r0,8009d04 8009cf8: e0 00 00 04 bi 8009d08 devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { devFS_node *current = nodes + i; if (current->name != NULL) { 8009cfc: b9 80 68 00 mv r13,r12 8009d00: e0 00 00 02 bi 8009d08 if ( current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 8009d04: b9 80 70 00 mv r14,r12 size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 8009d08: 36 10 00 01 addi r16,r16,1 8009d0c: 35 8c 00 14 addi r12,r12,20 8009d10: 65 c2 00 00 cmpei r2,r14,0 8009d14: 65 a1 00 00 cmpei r1,r13,0 8009d18: b8 41 08 00 or r1,r2,r1 8009d1c: 44 20 00 02 be r1,r0,8009d24 8009d20: 56 50 ff ee bgu r18,r16,8009cd8 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } 8009d24: 29 61 00 10 lw r1,(r11+16) rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { 8009d28: 45 c0 00 08 be r14,r0,8009d48 if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { 8009d2c: 20 21 00 40 andi r1,r1,0x40 8009d30: 5c 20 00 03 bne r1,r0,8009d3c currentloc->node_access = node; 8009d34: 59 6e 00 20 sw (r11+32),r14 8009d38: e0 00 00 0c bi 8009d68 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); 8009d3c: b9 60 08 00 mv r1,r11 8009d40: 34 02 00 11 mvi r2,17 8009d44: e0 00 00 10 bi 8009d84 } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { 8009d48: 20 21 00 20 andi r1,r1,0x20 8009d4c: 44 2e 00 0c be r1,r14,8009d7c <== NEVER TAKEN if (free_node != NULL) { 8009d50: 45 a0 00 08 be r13,r0,8009d70 free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; 8009d54: 34 01 01 ff mvi r1,511 8009d58: 59 a1 00 10 sw (r13+16),r1 currentloc->node_access = free_node; 8009d5c: 59 6d 00 20 sw (r11+32),r13 rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; 8009d60: 59 71 00 08 sw (r11+8),r17 ctx->tokenlen = tokenlen; 8009d64: 59 6f 00 0c sw (r11+12),r15 static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; 8009d68: 59 60 00 04 sw (r11+4),r0 8009d6c: e0 00 00 07 bi 8009d88 rtems_filesystem_eval_path_get_path(ctx), rtems_filesystem_eval_path_get_pathlen(ctx) ); rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, ENOSPC); 8009d70: b9 60 08 00 mv r1,r11 8009d74: 34 02 00 1c mvi r2,28 8009d78: e0 00 00 03 bi 8009d84 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); 8009d7c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8009d80: 34 02 00 02 mvi r2,2 <== NOT EXECUTED 8009d84: fb ff ea f7 calli 8004960 } } } 8009d88: 2b 9d 00 04 lw ra,(sp+4) 8009d8c: 2b 8b 00 24 lw r11,(sp+36) 8009d90: 2b 8c 00 20 lw r12,(sp+32) 8009d94: 2b 8d 00 1c lw r13,(sp+28) 8009d98: 2b 8e 00 18 lw r14,(sp+24) 8009d9c: 2b 8f 00 14 lw r15,(sp+20) 8009da0: 2b 90 00 10 lw r16,(sp+16) 8009da4: 2b 91 00 0c lw r17,(sp+12) 8009da8: 2b 92 00 08 lw r18,(sp+8) 8009dac: 37 9c 00 24 addi sp,sp,36 8009db0: c3 a0 00 00 ret =============================================================================== 08003690 : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 8003690: 37 9c ff e4 addi sp,sp,-28 8003694: 5b 8b 00 14 sw (sp+20),r11 8003698: 5b 8c 00 10 sw (sp+16),r12 800369c: 5b 8d 00 0c sw (sp+12),r13 80036a0: 5b 8e 00 08 sw (sp+8),r14 80036a4: 5b 9d 00 04 sw (sp+4),ra 80036a8: b8 20 70 00 mv r14,r1 int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { 80036ac: 34 01 00 03 mvi r1,3 const char *name, size_t namelen, mode_t mode, dev_t dev ) { 80036b0: b8 80 58 00 mv r11,r4 80036b4: b8 a0 68 00 mv r13,r5 80036b8: b8 c0 60 00 mv r12,r6 int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { 80036bc: 5c 61 00 0a bne r3,r1,80036e4 80036c0: 40 44 00 00 lbu r4,(r2+0) 80036c4: 34 01 00 64 mvi r1,100 80036c8: 5c 81 00 07 bne r4,r1,80036e4 <== NEVER TAKEN 80036cc: 40 44 00 01 lbu r4,(r2+1) 80036d0: 34 01 00 65 mvi r1,101 80036d4: 5c 81 00 04 bne r4,r1,80036e4 <== NEVER TAKEN 80036d8: 40 44 00 02 lbu r4,(r2+2) 80036dc: 34 01 00 76 mvi r1,118 80036e0: 44 81 00 19 be r4,r1,8003744 <== ALWAYS TAKEN if (S_ISBLK(mode) || S_ISCHR(mode)) { 80036e4: 21 64 f0 00 andi r4,r11,0xf000 80036e8: 64 81 20 00 cmpei r1,r4,8192 80036ec: 64 84 60 00 cmpei r4,r4,24576 80036f0: b8 24 20 00 or r4,r1,r4 80036f4: 44 80 00 18 be r4,r0,8003754 char *dupname = malloc(namelen); 80036f8: b8 60 08 00 mv r1,r3 80036fc: 5b 82 00 1c sw (sp+28),r2 8003700: 5b 83 00 18 sw (sp+24),r3 8003704: f8 00 01 0f calli 8003b40 if (dupname != NULL) { 8003708: 2b 82 00 1c lw r2,(sp+28) 800370c: 2b 83 00 18 lw r3,(sp+24) 8003710: 44 20 00 0a be r1,r0,8003738 devFS_node *node = parentloc->node_access; 8003714: 29 c7 00 08 lw r7,(r14+8) node->name = dupname; 8003718: 58 e1 00 00 sw (r7+0),r1 node->namelen = namelen; 800371c: 58 e3 00 04 sw (r7+4),r3 node->major = rtems_filesystem_dev_major_t(dev); 8003720: 58 ed 00 08 sw (r7+8),r13 node->minor = rtems_filesystem_dev_minor_t(dev); 8003724: 58 ec 00 0c sw (r7+12),r12 node->mode = mode; 8003728: 58 eb 00 10 sw (r7+16),r11 memcpy(dupname, name, namelen); 800372c: f8 00 2b 67 calli 800e4c8 size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 8003730: 34 01 00 00 mvi r1,0 8003734: e0 00 00 0c bi 8003764 node->major = rtems_filesystem_dev_major_t(dev); node->minor = rtems_filesystem_dev_minor_t(dev); node->mode = mode; memcpy(dupname, name, namelen); } else { errno = ENOMEM; 8003738: f8 00 26 99 calli 800d19c <__errno> 800373c: 34 02 00 0c mvi r2,12 8003740: e0 00 00 07 bi 800375c } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { 8003744: 21 6b f0 00 andi r11,r11,0xf000 8003748: 34 02 40 00 mvi r2,16384 size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 800374c: 34 01 00 00 mvi r1,0 } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { 8003750: 45 62 00 05 be r11,r2,8003764 <== ALWAYS TAKEN errno = ENOTSUP; 8003754: f8 00 26 92 calli 800d19c <__errno> 8003758: 34 02 00 86 mvi r2,134 800375c: 58 22 00 00 sw (r1+0),r2 rv = -1; 8003760: 34 01 ff ff mvi r1,-1 } } return rv; } 8003764: 2b 9d 00 04 lw ra,(sp+4) 8003768: 2b 8b 00 14 lw r11,(sp+20) 800376c: 2b 8c 00 10 lw r12,(sp+16) 8003770: 2b 8d 00 0c lw r13,(sp+12) 8003774: 2b 8e 00 08 lw r14,(sp+8) 8003778: 37 9c 00 1c addi sp,sp,28 800377c: c3 a0 00 00 ret =============================================================================== 080014cc : */ static volatile bool diskdevs_protected; static rtems_status_code disk_lock(void) { 80014cc: 37 9c ff fc addi sp,sp,-4 80014d0: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 80014d4: 78 01 08 01 mvhi r1,0x801 80014d8: 38 21 a7 58 ori r1,r1,0xa758 80014dc: 28 21 00 00 lw r1,(r1+0) 80014e0: 34 02 00 00 mvi r2,0 80014e4: 34 03 00 00 mvi r3,0 80014e8: f8 00 0e 91 calli 8004f2c if (sc == RTEMS_SUCCESSFUL) { diskdevs_protected = true; return RTEMS_SUCCESSFUL; } else { return RTEMS_NOT_CONFIGURED; 80014ec: 34 02 00 16 mvi r2,22 disk_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc == RTEMS_SUCCESSFUL) { 80014f0: 5c 20 00 06 bne r1,r0,8001508 <== NEVER TAKEN diskdevs_protected = true; 80014f4: 78 01 08 01 mvhi r1,0x801 80014f8: 34 02 00 01 mvi r2,1 80014fc: 38 21 a7 5c ori r1,r1,0xa75c 8001500: 30 22 00 00 sb (r1+0),r2 return RTEMS_SUCCESSFUL; 8001504: 34 02 00 00 mvi r2,0 } else { return RTEMS_NOT_CONFIGURED; } } 8001508: b8 40 08 00 mv r1,r2 800150c: 2b 9d 00 04 lw ra,(sp+4) 8001510: 37 9c 00 04 addi sp,sp,4 8001514: c3 a0 00 00 ret =============================================================================== 08001518 : static void disk_unlock(void) { 8001518: 37 9c ff fc addi sp,sp,-4 800151c: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 8001520: 78 01 08 01 mvhi r1,0x801 8001524: 38 21 a7 5c ori r1,r1,0xa75c 8001528: 30 20 00 00 sb (r1+0),r0 sc = rtems_semaphore_release(diskdevs_mutex); 800152c: 78 01 08 01 mvhi r1,0x801 8001530: 38 21 a7 58 ori r1,r1,0xa758 8001534: 28 21 00 00 lw r1,(r1+0) 8001538: f8 00 0e cd calli 800506c if (sc != RTEMS_SUCCESSFUL) { 800153c: 44 20 00 05 be r1,r0,8001550 <== ALWAYS TAKEN /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); 8001540: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8001544: 38 42 88 bc ori r2,r2,0x88bc <== NOT EXECUTED 8001548: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 800154c: f8 00 0f c5 calli 8005460 <== NOT EXECUTED } } 8001550: 2b 9d 00 04 lw ra,(sp+4) 8001554: 37 9c 00 04 addi sp,sp,4 8001558: c3 a0 00 00 ret =============================================================================== 08003e40 : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) { 8003e40: 37 9c ff f0 addi sp,sp,-16 8003e44: 5b 8b 00 10 sw (sp+16),r11 8003e48: 5b 8c 00 0c sw (sp+12),r12 8003e4c: 5b 8d 00 08 sw (sp+8),r13 8003e50: 5b 9d 00 04 sw (sp+4),ra 8003e54: b8 20 58 00 mv r11,r1 rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { 8003e58: 28 21 00 b4 lw r1,(r1+180) 8003e5c: 44 20 00 17 be r1,r0,8003eb8 rtems_interrupt_disable (level); 8003e60: 90 00 08 00 rcsr r1,IE 8003e64: 34 02 ff fe mvi r2,-2 8003e68: a0 22 10 00 and r2,r1,r2 8003e6c: d0 02 00 00 wcsr IE,r2 while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; 8003e70: 34 0d 00 02 mvi r13,2 rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); 8003e74: 34 0c ff fe mvi r12,-2 rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { 8003e78: e0 00 00 0c bi 8003ea8 tty->rawOutBufState = rob_wait; 8003e7c: 59 6d 00 94 sw (r11+148),r13 <== NOT EXECUTED rtems_interrupt_enable (level); 8003e80: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED sc = rtems_semaphore_obtain( 8003e84: 29 61 00 8c lw r1,(r11+140) <== NOT EXECUTED 8003e88: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 8003e8c: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 8003e90: f8 00 09 ab calli 800653c <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 8003e94: 44 20 00 02 be r1,r0,8003e9c <== NOT EXECUTED rtems_fatal_error_occurred (sc); 8003e98: f8 00 0c 1d calli 8006f0c <== NOT EXECUTED rtems_interrupt_disable (level); 8003e9c: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 8003ea0: a0 2c 10 00 and r2,r1,r12 <== NOT EXECUTED 8003ea4: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { 8003ea8: 29 63 00 84 lw r3,(r11+132) 8003eac: 29 62 00 80 lw r2,(r11+128) 8003eb0: 5c 62 ff f3 bne r3,r2,8003e7c <== NEVER TAKEN tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } rtems_interrupt_enable (level); 8003eb4: d0 01 00 00 wcsr IE,r1 } } 8003eb8: 2b 9d 00 04 lw ra,(sp+4) 8003ebc: 2b 8b 00 10 lw r11,(sp+16) 8003ec0: 2b 8c 00 0c lw r12,(sp+12) 8003ec4: 2b 8d 00 08 lw r13,(sp+8) 8003ec8: 37 9c 00 10 addi sp,sp,16 8003ecc: c3 a0 00 00 ret =============================================================================== 08001ab0 : */ int dup2( int fildes, int fildes2 ) { 8001ab0: 37 9c ff a4 addi sp,sp,-92 8001ab4: 5b 8b 00 14 sw (sp+20),r11 8001ab8: 5b 8c 00 10 sw (sp+16),r12 8001abc: 5b 8d 00 0c sw (sp+12),r13 8001ac0: 5b 8e 00 08 sw (sp+8),r14 8001ac4: 5b 9d 00 04 sw (sp+4),ra /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001ac8: 37 8d 00 18 addi r13,sp,24 */ int dup2( int fildes, int fildes2 ) { 8001acc: b8 40 60 00 mv r12,r2 /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001ad0: b9 a0 10 00 mv r2,r13 */ int dup2( int fildes, int fildes2 ) { 8001ad4: b8 20 70 00 mv r14,r1 * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); if ( status == -1 ) return -1; 8001ad8: 34 0b ff ff mvi r11,-1 /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001adc: f8 00 01 43 calli 8001fe8 if ( status == -1 ) 8001ae0: 44 2b 00 0a be r1,r11,8001b08 /* * If fildes2 is not valid, then we should not do anything either. */ status = fstat( fildes2, &buf ); 8001ae4: b9 80 08 00 mv r1,r12 8001ae8: b9 a0 10 00 mv r2,r13 8001aec: f8 00 01 3f calli 8001fe8 if ( status == -1 ) 8001af0: 44 2b 00 06 be r1,r11,8001b08 <== NEVER TAKEN /* * This fcntl handles everything else. */ return fcntl( fildes, F_DUPFD, fildes2 ); 8001af4: b9 c0 08 00 mv r1,r14 8001af8: 34 02 00 00 mvi r2,0 8001afc: b9 80 18 00 mv r3,r12 8001b00: f8 00 00 12 calli 8001b48 8001b04: b8 20 58 00 mv r11,r1 } 8001b08: b9 60 08 00 mv r1,r11 8001b0c: 2b 9d 00 04 lw ra,(sp+4) 8001b10: 2b 8b 00 14 lw r11,(sp+20) 8001b14: 2b 8c 00 10 lw r12,(sp+16) 8001b18: 2b 8d 00 0c lw r13,(sp+12) 8001b1c: 2b 8e 00 08 lw r14,(sp+8) 8001b20: 37 9c 00 5c addi sp,sp,92 8001b24: c3 a0 00 00 ret =============================================================================== 08004d04 : /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { 8004d04: 37 9c ff f4 addi sp,sp,-12 8004d08: 5b 8b 00 08 sw (sp+8),r11 8004d0c: 5b 9d 00 04 sw (sp+4),ra 8004d10: b8 40 58 00 mv r11,r2 if ((tty->termios.c_lflag & ECHOCTL) && 8004d14: 28 42 00 3c lw r2,(r2+60) 8004d18: 20 42 02 00 andi r2,r2,0x200 8004d1c: 44 40 00 19 be r2,r0,8004d80 <== NEVER TAKEN iscntrl(c) && (c != '\t') && (c != '\n')) { 8004d20: 78 02 08 02 mvhi r2,0x802 8004d24: 38 42 82 e0 ori r2,r2,0x82e0 8004d28: 28 42 00 00 lw r2,(r2+0) 8004d2c: 7c 23 00 09 cmpnei r3,r1,9 8004d30: b4 41 10 00 add r2,r2,r1 8004d34: 40 42 00 01 lbu r2,(r2+1) 8004d38: 20 42 00 20 andi r2,r2,0x20 * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { if ((tty->termios.c_lflag & ECHOCTL) && 8004d3c: 7c 42 00 00 cmpnei r2,r2,0 iscntrl(c) && (c != '\t') && (c != '\n')) { 8004d40: a0 43 10 00 and r2,r2,r3 8004d44: 44 40 00 0f be r2,r0,8004d80 8004d48: 34 02 00 0a mvi r2,10 8004d4c: 44 22 00 0d be r1,r2,8004d80 char echobuf[2]; echobuf[0] = '^'; 8004d50: 34 02 00 5e mvi r2,94 echobuf[1] = c ^ 0x40; 8004d54: 18 21 00 40 xori r1,r1,0x40 { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; 8004d58: 33 82 00 0c sb (sp+12),r2 echobuf[1] = c ^ 0x40; 8004d5c: 33 81 00 0d sb (sp+13),r1 rtems_termios_puts (echobuf, 2, tty); 8004d60: 34 02 00 02 mvi r2,2 8004d64: 37 81 00 0c addi r1,sp,12 8004d68: b9 60 18 00 mv r3,r11 8004d6c: fb ff ff 37 calli 8004a48 tty->column += 2; 8004d70: 29 61 00 28 lw r1,(r11+40) 8004d74: 34 21 00 02 addi r1,r1,2 8004d78: 59 61 00 28 sw (r11+40),r1 */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { 8004d7c: e0 00 00 03 bi 8004d88 echobuf[0] = '^'; echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); tty->column += 2; } else { oproc (c, tty); 8004d80: b9 60 10 00 mv r2,r11 8004d84: fb ff ff 84 calli 8004b94 } } 8004d88: 2b 9d 00 04 lw ra,(sp+4) 8004d8c: 2b 8b 00 08 lw r11,(sp+8) 8004d90: 37 9c 00 0c addi sp,sp,12 8004d94: c3 a0 00 00 ret =============================================================================== 08023ecc : void endgrent(void) { 8023ecc: 37 9c ff fc addi sp,sp,-4 8023ed0: 5b 9d 00 04 sw (sp+4),ra if (group_fp != NULL) 8023ed4: 78 01 08 06 mvhi r1,0x806 8023ed8: 38 21 9a 8c ori r1,r1,0x9a8c 8023edc: 28 21 00 00 lw r1,(r1+0) 8023ee0: 44 20 00 02 be r1,r0,8023ee8 <== NEVER TAKEN fclose(group_fp); 8023ee4: f8 00 54 02 calli 8038eec } 8023ee8: 2b 9d 00 04 lw ra,(sp+4) 8023eec: 37 9c 00 04 addi sp,sp,4 8023ef0: c3 a0 00 00 ret =============================================================================== 08023d04 : void endpwent(void) { 8023d04: 37 9c ff fc addi sp,sp,-4 8023d08: 5b 9d 00 04 sw (sp+4),ra if (passwd_fp != NULL) 8023d0c: 78 01 08 06 mvhi r1,0x806 8023d10: 38 21 9b 68 ori r1,r1,0x9b68 8023d14: 28 21 00 00 lw r1,(r1+0) 8023d18: 44 20 00 02 be r1,r0,8023d20 <== NEVER TAKEN fclose(passwd_fp); 8023d1c: f8 00 54 74 calli 8038eec } 8023d20: 2b 9d 00 04 lw ra,(sp+4) 8023d24: 37 9c 00 04 addi sp,sp,4 8023d28: c3 a0 00 00 ret =============================================================================== 08004d98 : * FIXME: Needs support for WERASE and ECHOPRT. * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { 8004d98: 37 9c ff e0 addi sp,sp,-32 8004d9c: 5b 8b 00 20 sw (sp+32),r11 8004da0: 5b 8c 00 1c sw (sp+28),r12 8004da4: 5b 8d 00 18 sw (sp+24),r13 8004da8: 5b 8e 00 14 sw (sp+20),r14 8004dac: 5b 8f 00 10 sw (sp+16),r15 8004db0: 5b 90 00 0c sw (sp+12),r16 8004db4: 5b 91 00 08 sw (sp+8),r17 8004db8: 5b 9d 00 04 sw (sp+4),ra 8004dbc: b8 20 58 00 mv r11,r1 if (tty->ccount == 0) 8004dc0: 28 21 00 20 lw r1,(r1+32) * FIXME: Needs support for WERASE and ECHOPRT. * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { 8004dc4: b8 40 78 00 mv r15,r2 if (tty->ccount == 0) 8004dc8: 44 20 00 6c be r1,r0,8004f78 return; if (lineFlag) { 8004dcc: 44 40 00 62 be r2,r0,8004f54 if (!(tty->termios.c_lflag & ECHO)) { 8004dd0: 29 6c 00 3c lw r12,(r11+60) 8004dd4: 21 81 00 08 andi r1,r12,0x8 8004dd8: 5c 20 00 03 bne r1,r0,8004de4 <== ALWAYS TAKEN tty->ccount = 0; 8004ddc: 59 60 00 20 sw (r11+32),r0 <== NOT EXECUTED return; 8004de0: e0 00 00 66 bi 8004f78 <== NOT EXECUTED } if (!(tty->termios.c_lflag & ECHOE)) { 8004de4: 21 8c 00 10 andi r12,r12,0x10 8004de8: 5d 80 00 5b bne r12,r0,8004f54 <== ALWAYS TAKEN tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); 8004dec: 41 61 00 44 lbu r1,(r11+68) <== NOT EXECUTED if (!(tty->termios.c_lflag & ECHO)) { tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; 8004df0: 59 60 00 20 sw (r11+32),r0 <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 8004df4: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8004df8: fb ff ff c3 calli 8004d04 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 8004dfc: 29 61 00 3c lw r1,(r11+60) <== NOT EXECUTED 8004e00: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 8004e04: 44 2c 00 5d be r1,r12,8004f78 <== NOT EXECUTED echo ('\n', tty); 8004e08: 34 01 00 0a mvi r1,10 <== NOT EXECUTED 8004e0c: e0 00 00 0d bi 8004e40 <== NOT EXECUTED return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 8004e10: 29 64 00 1c lw r4,(r11+28) 8004e14: 34 21 ff ff addi r1,r1,-1 8004e18: 59 61 00 20 sw (r11+32),r1 8004e1c: b4 81 10 00 add r2,r4,r1 8004e20: 40 4c 00 00 lbu r12,(r2+0) if (tty->termios.c_lflag & ECHO) { 8004e24: 29 62 00 3c lw r2,(r11+60) 8004e28: 20 43 00 08 andi r3,r2,0x8 8004e2c: 44 60 00 48 be r3,r0,8004f4c <== NEVER TAKEN if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 8004e30: 5d e0 00 07 bne r15,r0,8004e4c 8004e34: 20 43 00 10 andi r3,r2,0x10 8004e38: 5c 6f 00 05 bne r3,r15,8004e4c <== ALWAYS TAKEN echo (tty->termios.c_cc[VERASE], tty); 8004e3c: 41 61 00 43 lbu r1,(r11+67) <== NOT EXECUTED 8004e40: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8004e44: fb ff ff b0 calli 8004d04 <== NOT EXECUTED 8004e48: e0 00 00 4c bi 8004f78 <== NOT EXECUTED } else if (c == '\t') { 8004e4c: 5d 91 00 20 bne r12,r17,8004ecc int col = tty->read_start_column; 8004e50: 29 6c 00 2c lw r12,(r11+44) */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { 8004e54: 29 a6 00 00 lw r6,(r13+0) if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { int col = tty->read_start_column; int i = 0; 8004e58: 34 03 00 00 mvi r3,0 while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { if (tty->termios.c_lflag & ECHOCTL) 8004e5c: 20 42 02 00 andi r2,r2,0x200 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 8004e60: e0 00 00 0f bi 8004e9c * Erase a character or line * FIXME: Needs support for WERASE and ECHOPRT. * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) 8004e64: b4 83 28 00 add r5,r4,r3 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; 8004e68: 40 a5 00 00 lbu r5,(r5+0) 8004e6c: 34 63 00 01 addi r3,r3,1 if (c == '\t') { 8004e70: 5c b1 00 03 bne r5,r17,8004e7c col = (col | 7) + 1; 8004e74: 39 8c 00 07 ori r12,r12,0x7 8004e78: e0 00 00 08 bi 8004e98 } else if (iscntrl (c)) { 8004e7c: b4 c5 28 00 add r5,r6,r5 8004e80: 40 a5 00 01 lbu r5,(r5+1) 8004e84: 20 a5 00 20 andi r5,r5,0x20 8004e88: 44 a0 00 04 be r5,r0,8004e98 <== ALWAYS TAKEN if (tty->termios.c_lflag & ECHOCTL) 8004e8c: 44 40 00 04 be r2,r0,8004e9c <== NOT EXECUTED col += 2; 8004e90: 35 8c 00 02 addi r12,r12,2 <== NOT EXECUTED 8004e94: e0 00 00 02 bi 8004e9c <== NOT EXECUTED } else { col++; 8004e98: 35 8c 00 01 addi r12,r12,1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 8004e9c: 5c 61 ff f2 bne r3,r1,8004e64 8004ea0: e0 00 00 08 bi 8004ec0 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 8004ea4: ba 00 08 00 mv r1,r16 8004ea8: 34 02 00 01 mvi r2,1 8004eac: b9 60 18 00 mv r3,r11 8004eb0: fb ff fe e6 calli 8004a48 tty->column--; 8004eb4: 29 61 00 28 lw r1,(r11+40) 8004eb8: 34 21 ff ff addi r1,r1,-1 8004ebc: 59 61 00 28 sw (r11+40),r1 } /* * Back up over the tab */ while (tty->column > col) { 8004ec0: 29 61 00 28 lw r1,(r11+40) 8004ec4: 48 2c ff f8 bg r1,r12,8004ea4 8004ec8: e0 00 00 21 bi 8004f4c rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 8004ecc: 29 a1 00 00 lw r1,(r13+0) 8004ed0: 35 8c 00 01 addi r12,r12,1 8004ed4: b4 2c 08 00 add r1,r1,r12 8004ed8: 40 21 00 00 lbu r1,(r1+0) 8004edc: 20 21 00 20 andi r1,r1,0x20 8004ee0: 44 20 00 0b be r1,r0,8004f0c <== ALWAYS TAKEN 8004ee4: 20 42 02 00 andi r2,r2,0x200 <== NOT EXECUTED 8004ee8: 44 40 00 09 be r2,r0,8004f0c <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 8004eec: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8004ef0: 34 02 00 03 mvi r2,3 <== NOT EXECUTED 8004ef4: b9 60 18 00 mv r3,r11 <== NOT EXECUTED 8004ef8: fb ff fe d4 calli 8004a48 <== NOT EXECUTED if (tty->column) 8004efc: 29 61 00 28 lw r1,(r11+40) <== NOT EXECUTED 8004f00: 44 20 00 03 be r1,r0,8004f0c <== NOT EXECUTED tty->column--; 8004f04: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED 8004f08: 59 61 00 28 sw (r11+40),r1 <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 8004f0c: 29 a1 00 00 lw r1,(r13+0) 8004f10: b4 2c 60 00 add r12,r1,r12 8004f14: 41 81 00 00 lbu r1,(r12+0) 8004f18: 20 21 00 20 andi r1,r1,0x20 8004f1c: 44 20 00 04 be r1,r0,8004f2c <== ALWAYS TAKEN 8004f20: 29 61 00 3c lw r1,(r11+60) <== NOT EXECUTED 8004f24: 20 21 02 00 andi r1,r1,0x200 <== NOT EXECUTED 8004f28: 44 20 00 09 be r1,r0,8004f4c <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 8004f2c: b9 c0 08 00 mv r1,r14 8004f30: 34 02 00 03 mvi r2,3 8004f34: b9 60 18 00 mv r3,r11 8004f38: fb ff fe c4 calli 8004a48 if (tty->column) 8004f3c: 29 61 00 28 lw r1,(r11+40) 8004f40: 44 20 00 03 be r1,r0,8004f4c <== NEVER TAKEN tty->column--; 8004f44: 34 21 ff ff addi r1,r1,-1 8004f48: 59 61 00 28 sw (r11+40),r1 } } } if (!lineFlag) 8004f4c: 5d e0 00 09 bne r15,r0,8004f70 8004f50: e0 00 00 0a bi 8004f78 8004f54: 78 0d 08 02 mvhi r13,0x802 rtems_termios_puts ("\b \b", 3, tty); if (tty->column) tty->column--; } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 8004f58: 78 0e 08 02 mvhi r14,0x802 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 8004f5c: 78 10 08 02 mvhi r16,0x802 unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { 8004f60: 34 11 00 09 mvi r17,9 8004f64: 39 ad 82 e0 ori r13,r13,0x82e0 rtems_termios_puts ("\b \b", 3, tty); if (tty->column) tty->column--; } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 8004f68: 39 ce 54 7c ori r14,r14,0x547c /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 8004f6c: 3a 10 54 78 ori r16,r16,0x5478 echo ('\n', tty); return; } } while (tty->ccount) { 8004f70: 29 61 00 20 lw r1,(r11+32) 8004f74: 5c 20 ff a7 bne r1,r0,8004e10 } } if (!lineFlag) break; } } 8004f78: 2b 9d 00 04 lw ra,(sp+4) 8004f7c: 2b 8b 00 20 lw r11,(sp+32) 8004f80: 2b 8c 00 1c lw r12,(sp+28) 8004f84: 2b 8d 00 18 lw r13,(sp+24) 8004f88: 2b 8e 00 14 lw r14,(sp+20) 8004f8c: 2b 8f 00 10 lw r15,(sp+16) 8004f90: 2b 90 00 0c lw r16,(sp+12) 8004f94: 2b 91 00 08 lw r17,(sp+8) 8004f98: 37 9c 00 20 addi sp,sp,32 8004f9c: c3 a0 00 00 ret =============================================================================== 0801007c : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 801007c: 37 9c ff e0 addi sp,sp,-32 8010080: 5b 8b 00 20 sw (sp+32),r11 8010084: 5b 8c 00 1c sw (sp+28),r12 8010088: 5b 8d 00 18 sw (sp+24),r13 801008c: 5b 8e 00 14 sw (sp+20),r14 8010090: 5b 8f 00 10 sw (sp+16),r15 8010094: 5b 90 00 0c sw (sp+12),r16 8010098: 5b 91 00 08 sw (sp+8),r17 801009c: 5b 9d 00 04 sw (sp+4),ra static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 80100a0: 40 2e 00 02 lbu r14,(r1+2) 80100a4: 40 2f 00 0c lbu r15,(r1+12) 80100a8: b8 20 58 00 mv r11,r1 80100ac: b8 40 60 00 mv r12,r2 80100b0: c9 ee 78 00 sub r15,r15,r14 80100b4: b8 40 08 00 mv r1,r2 80100b8: b9 e0 10 00 mv r2,r15 80100bc: b8 60 88 00 mv r17,r3 80100c0: b8 80 80 00 mv r16,r4 80100c4: f8 00 74 e5 calli 802d458 <__lshrsi3> 80100c8: b8 20 68 00 mv r13,r1 sec_num); uint32_t blk_ofs = fat_sector_offset_to_block_offset (fs_info, sec_num, 0); if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num) 80100cc: 41 61 00 89 lbu r1,(r11+137) 80100d0: 44 20 00 03 be r1,r0,80100dc 80100d4: 29 61 00 84 lw r1,(r11+132) 80100d8: 44 2c 00 16 be r1,r12,8010130 { fat_buf_release(fs_info); 80100dc: b9 60 08 00 mv r1,r11 80100e0: fb ff ff 69 calli 800fe84 if (op_type == FAT_OP_TYPE_READ) 80100e4: 34 02 00 01 mvi r2,1 80100e8: 29 61 00 64 lw r1,(r11+100) 80100ec: 35 63 00 8c addi r3,r11,140 80100f0: 5e 22 00 04 bne r17,r2,8010100 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 80100f4: b9 a0 10 00 mv r2,r13 80100f8: fb ff f6 65 calli 800da8c 80100fc: e0 00 00 03 bi 8010108 else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); 8010100: b9 a0 10 00 mv r2,r13 8010104: fb ff f6 23 calli 800d990 if (sc != RTEMS_SUCCESSFUL) 8010108: 44 20 00 06 be r1,r0,8010120 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EIO); 801010c: f8 00 2a d2 calli 801ac54 <__errno> <== NOT EXECUTED 8010110: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8010114: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8010118: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 801011c: e0 00 00 10 bi 801015c <== NOT EXECUTED fs_info->c.blk_num = sec_num; fs_info->c.modified = 0; fs_info->c.state = FAT_CACHE_ACTUAL; 8010120: 34 01 00 01 mvi r1,1 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); fs_info->c.blk_num = sec_num; 8010124: 59 6c 00 84 sw (r11+132),r12 fs_info->c.modified = 0; 8010128: 31 60 00 88 sb (r11+136),r0 fs_info->c.state = FAT_CACHE_ACTUAL; 801012c: 31 61 00 89 sb (r11+137),r1 static inline uint32_t fat_block_num_to_sector_num (const fat_fs_info_t *fs_info, const uint32_t block_number) { return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 8010130: b9 e0 10 00 mv r2,r15 8010134: b9 a0 08 00 mv r1,r13 8010138: fb ff c4 2c calli 80011e8 <__ashlsi3> } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 801013c: 29 6b 00 8c lw r11,(r11+140) { return sector_offset + ((sector - fat_block_num_to_sector_num (fs_info, fat_sector_num_to_block_num (fs_info, sector))) << fs_info->vol.sec_log2); 8010140: b9 c0 10 00 mv r2,r14 8010144: c9 81 08 00 sub r1,r12,r1 8010148: fb ff c4 28 calli 80011e8 <__ashlsi3> 801014c: 29 62 00 1c lw r2,(r11+28) 8010150: b4 41 08 00 add r1,r2,r1 8010154: 5a 01 00 00 sw (r16+0),r1 return RC_OK; 8010158: 34 01 00 00 mvi r1,0 } 801015c: 2b 9d 00 04 lw ra,(sp+4) 8010160: 2b 8b 00 20 lw r11,(sp+32) 8010164: 2b 8c 00 1c lw r12,(sp+28) 8010168: 2b 8d 00 18 lw r13,(sp+24) 801016c: 2b 8e 00 14 lw r14,(sp+20) 8010170: 2b 8f 00 10 lw r15,(sp+16) 8010174: 2b 90 00 0c lw r16,(sp+12) 8010178: 2b 91 00 08 lw r17,(sp+8) 801017c: 37 9c 00 20 addi sp,sp,32 8010180: c3 a0 00 00 ret =============================================================================== 0800fe84 : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 800fe84: 37 9c ff d8 addi sp,sp,-40 800fe88: 5b 8b 00 24 sw (sp+36),r11 800fe8c: 5b 8c 00 20 sw (sp+32),r12 800fe90: 5b 8d 00 1c sw (sp+28),r13 800fe94: 5b 8e 00 18 sw (sp+24),r14 800fe98: 5b 8f 00 14 sw (sp+20),r15 800fe9c: 5b 90 00 10 sw (sp+16),r16 800fea0: 5b 91 00 0c sw (sp+12),r17 800fea4: 5b 92 00 08 sw (sp+8),r18 800fea8: 5b 9d 00 04 sw (sp+4),ra 800feac: b8 20 58 00 mv r11,r1 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 800feb0: 40 21 00 89 lbu r1,(r1+137) return RC_OK; 800feb4: 34 0c 00 00 mvi r12,0 int fat_buf_release(fat_fs_info_t *fs_info) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 800feb8: 44 20 00 65 be r1,r0,801004c return RC_OK; if (fs_info->c.modified) 800febc: 41 61 00 88 lbu r1,(r11+136) 800fec0: 44 20 00 5b be r1,r0,801002c { uint32_t sec_num = fs_info->c.blk_num; 800fec4: 29 6c 00 84 lw r12,(r11+132) bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 800fec8: 2d 61 00 18 lhu r1,(r11+24) 800fecc: 34 0d 00 00 mvi r13,0 800fed0: 54 2c 00 03 bgu r1,r12,800fedc 800fed4: 29 6d 00 20 lw r13,(r11+32) 800fed8: f5 ac 68 00 cmpgu r13,r13,r12 800fedc: 21 ad 00 ff andi r13,r13,0xff uint32_t ino ) { return (ino >= fs_info->uino_base); } 800fee0: 41 6e 00 02 lbu r14,(r11+2) 800fee4: 41 6f 00 0c lbu r15,(r11+12) uint32_t blk = fat_sector_num_to_block_num(fs_info, sec_num); uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info, sec_num, 0); if (sec_of_fat && !fs_info->vol.mirror) 800fee8: 45 a0 00 14 be r13,r0,800ff38 800feec: 41 61 00 54 lbu r1,(r11+84) 800fef0: 5c 20 00 12 bne r1,r0,800ff38 <== NEVER TAKEN static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 800fef4: c9 ee 78 00 sub r15,r15,r14 800fef8: b9 e0 10 00 mv r2,r15 800fefc: b9 80 08 00 mv r1,r12 800ff00: f8 00 75 56 calli 802d458 <__lshrsi3> static inline uint32_t fat_block_num_to_sector_num (const fat_fs_info_t *fs_info, const uint32_t block_number) { return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 800ff04: b9 e0 10 00 mv r2,r15 800ff08: fb ff c4 b8 calli 80011e8 <__ashlsi3> memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, 800ff0c: 29 72 00 8c lw r18,(r11+140) { return sector_offset + ((sector - fat_block_num_to_sector_num (fs_info, fat_sector_num_to_block_num (fs_info, sector))) << fs_info->vol.sec_log2); 800ff10: b9 c0 10 00 mv r2,r14 800ff14: c9 81 08 00 sub r1,r12,r1 800ff18: fb ff c4 b4 calli 80011e8 <__ashlsi3> uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info, sec_num, 0); if (sec_of_fat && !fs_info->vol.mirror) memcpy(fs_info->sec_buf, 800ff1c: 29 71 00 90 lw r17,(r11+144) 800ff20: 2d 70 00 00 lhu r16,(r11+0) 800ff24: 2a 42 00 1c lw r2,(r18+28) 800ff28: ba 00 18 00 mv r3,r16 800ff2c: b4 41 10 00 add r2,r2,r1 800ff30: ba 20 08 00 mv r1,r17 800ff34: f8 00 2e 96 calli 801b98c fs_info->c.buf->buffer + blk_ofs, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(fs_info->c.buf); 800ff38: 29 61 00 8c lw r1,(r11+140) 800ff3c: fb ff f7 93 calli 800dd88 if (sc != RTEMS_SUCCESSFUL) 800ff40: 5c 20 00 3e bne r1,r0,8010038 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; 800ff44: 31 60 00 88 sb (r11+136),r0 if (sec_of_fat && !fs_info->vol.mirror) 800ff48: 45 a1 00 3f be r13,r1,8010044 800ff4c: 41 61 00 54 lbu r1,(r11+84) 800ff50: 34 0c 00 01 mvi r12,1 800ff54: 44 20 00 33 be r1,r0,8010020 <== ALWAYS TAKEN 800ff58: e0 00 00 3b bi 8010044 <== NOT EXECUTED for (i = 1; i < fs_info->vol.fats; i++) { rtems_bdbuf_buffer *bd; sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i, 800ff5c: 29 62 00 1c lw r2,(r11+28) 800ff60: b9 80 08 00 mv r1,r12 800ff64: fb ff c4 ef calli 8001320 <__mulsi3> static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 800ff68: 41 6e 00 02 lbu r14,(r11+2) 800ff6c: 29 6f 00 84 lw r15,(r11+132) 800ff70: 41 70 00 0c lbu r16,(r11+12) 800ff74: b4 2f 78 00 add r15,r1,r15 800ff78: ca 0e 80 00 sub r16,r16,r14 800ff7c: ba 00 10 00 mv r2,r16 800ff80: b9 e0 08 00 mv r1,r15 800ff84: f8 00 75 35 calli 802d458 <__lshrsi3> static inline uint32_t fat_block_num_to_sector_num (const fat_fs_info_t *fs_info, const uint32_t block_number) { return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 800ff88: ba 00 10 00 mv r2,r16 static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 800ff8c: b8 20 68 00 mv r13,r1 static inline uint32_t fat_block_num_to_sector_num (const fat_fs_info_t *fs_info, const uint32_t block_number) { return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 800ff90: fb ff c4 96 calli 80011e8 <__ashlsi3> { return sector_offset + ((sector - fat_block_num_to_sector_num (fs_info, fat_sector_num_to_block_num (fs_info, sector))) << fs_info->vol.sec_log2); 800ff94: b9 c0 10 00 mv r2,r14 800ff98: c9 e1 08 00 sub r1,r15,r1 800ff9c: fb ff c4 93 calli 80011e8 <__ashlsi3> 800ffa0: b8 20 70 00 mv r14,r1 blk = fat_sector_num_to_block_num(fs_info, sec_num); blk_ofs = fat_sector_offset_to_block_offset(fs_info, sec_num, 0); if (blk_ofs == 0 800ffa4: 5c 20 00 09 bne r1,r0,800ffc8 && fs_info->vol.bps == fs_info->vol.bytes_per_block) 800ffa8: 2d 62 00 00 lhu r2,(r11+0) 800ffac: 2d 61 00 0a lhu r1,(r11+10) 800ffb0: 5c 41 00 06 bne r2,r1,800ffc8 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 800ffb4: 29 61 00 64 lw r1,(r11+100) 800ffb8: b9 a0 10 00 mv r2,r13 800ffbc: 37 83 00 28 addi r3,sp,40 800ffc0: fb ff f6 74 calli 800d990 800ffc4: e0 00 00 05 bi 800ffd8 } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); 800ffc8: 29 61 00 64 lw r1,(r11+100) 800ffcc: b9 a0 10 00 mv r2,r13 800ffd0: 37 83 00 28 addi r3,sp,40 800ffd4: fb ff f6 ae calli 800da8c 800ffd8: b8 20 68 00 mv r13,r1 } if ( sc != RTEMS_SUCCESSFUL) 800ffdc: 44 20 00 06 be r1,r0,800fff4 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENOMEM); 800ffe0: f8 00 2b 1d calli 801ac54 <__errno> <== NOT EXECUTED 800ffe4: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 800ffe8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800ffec: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 800fff0: e0 00 00 17 bi 801004c <== NOT EXECUTED memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 800fff4: 2b 81 00 28 lw r1,(sp+40) 800fff8: 29 62 00 90 lw r2,(r11+144) 800fffc: 2d 63 00 00 lhu r3,(r11+0) 8010000: 28 21 00 1c lw r1,(r1+28) 8010004: b4 2e 08 00 add r1,r1,r14 8010008: f8 00 2e 61 calli 801b98c sc = rtems_bdbuf_release_modified(bd); 801000c: 2b 81 00 28 lw r1,(sp+40) 8010010: fb ff f7 5e calli 800dd88 if ( sc != RTEMS_SUCCESSFUL) 8010014: 5c 2d ff f3 bne r1,r13,800ffe0 <== NEVER TAKEN if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 8010018: 35 8c 00 01 addi r12,r12,1 801001c: 21 8c 00 ff andi r12,r12,0xff 8010020: 41 61 00 0d lbu r1,(r11+13) 8010024: 54 2c ff ce bgu r1,r12,800ff5c 8010028: e0 00 00 07 bi 8010044 } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 801002c: 29 61 00 8c lw r1,(r11+140) 8010030: fb ff f7 21 calli 800dcb4 if (sc != RTEMS_SUCCESSFUL) 8010034: 44 2c 00 04 be r1,r12,8010044 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EIO); 8010038: f8 00 2b 07 calli 801ac54 <__errno> <== NOT EXECUTED 801003c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8010040: e3 ff ff ea bi 800ffe8 <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; 8010044: 31 60 00 89 sb (r11+137),r0 return RC_OK; 8010048: 34 0c 00 00 mvi r12,0 } 801004c: b9 80 08 00 mv r1,r12 8010050: 2b 9d 00 04 lw ra,(sp+4) 8010054: 2b 8b 00 24 lw r11,(sp+36) 8010058: 2b 8c 00 20 lw r12,(sp+32) 801005c: 2b 8d 00 1c lw r13,(sp+28) 8010060: 2b 8e 00 18 lw r14,(sp+24) 8010064: 2b 8f 00 14 lw r15,(sp+20) 8010068: 2b 90 00 10 lw r16,(sp+16) 801006c: 2b 91 00 0c lw r17,(sp+12) 8010070: 2b 92 00 08 lw r18,(sp+8) 8010074: 37 9c 00 28 addi sp,sp,40 8010078: c3 a0 00 00 ret =============================================================================== 08016444 : static inline uint32_t fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { 8016444: 37 9c ff f8 addi sp,sp,-8 8016448: 5b 8b 00 08 sw (sp+8),r11 801644c: 5b 9d 00 04 sw (sp+4),ra 8016450: b8 20 58 00 mv r11,r1 if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 8016454: 5c 40 00 06 bne r2,r0,801646c 8016458: 40 21 00 0e lbu r1,(r1+14) 801645c: 20 21 00 03 andi r1,r1,0x3 8016460: 44 22 00 03 be r1,r2,801646c <== NEVER TAKEN return fs_info->vol.rdir_loc; 8016464: 29 61 00 20 lw r1,(r11+32) 8016468: e0 00 00 06 bi 8016480 return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 801646c: 34 41 ff fe addi r1,r2,-2 8016470: 41 62 00 05 lbu r2,(r11+5) 8016474: fb ff ab 5d calli 80011e8 <__ashlsi3> 8016478: 29 62 00 34 lw r2,(r11+52) 801647c: b4 22 08 00 add r1,r1,r2 fs_info->vol.data_fsec); } 8016480: 2b 9d 00 04 lw ra,(sp+4) 8016484: 2b 8b 00 08 lw r11,(sp+8) 8016488: 37 9c 00 08 addi sp,sp,8 801648c: c3 a0 00 00 ret =============================================================================== 08010334 : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 8010334: 37 9c ff d0 addi sp,sp,-48 8010338: 5b 8b 00 2c sw (sp+44),r11 801033c: 5b 8c 00 28 sw (sp+40),r12 8010340: 5b 8d 00 24 sw (sp+36),r13 8010344: 5b 8e 00 20 sw (sp+32),r14 8010348: 5b 8f 00 1c sw (sp+28),r15 801034c: 5b 90 00 18 sw (sp+24),r16 8010350: 5b 91 00 14 sw (sp+20),r17 8010354: 5b 92 00 10 sw (sp+16),r18 8010358: 5b 93 00 0c sw (sp+12),r19 801035c: 5b 94 00 08 sw (sp+8),r20 8010360: 5b 9d 00 04 sw (sp+4),ra 8010364: b8 20 58 00 mv r11,r1 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8010368: 2c 21 00 06 lhu r1,(r1+6) fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 801036c: b8 60 88 00 mv r17,r3 8010370: 20 b4 00 ff andi r20,r5,0xff ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8010374: c8 23 08 00 sub r1,r1,r3 8010378: b8 80 60 00 mv r12,r4 801037c: 50 24 00 02 bgeu r1,r4,8010384 <== ALWAYS TAKEN 8010380: b8 20 60 00 mv r12,r1 <== NOT EXECUTED fat_cluster_num_to_block_num (const fat_fs_info_t *fs_info, uint32_t cln) { uint32_t blk; if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 8010384: 5c 40 00 0b bne r2,r0,80103b0 <== ALWAYS TAKEN 8010388: 41 61 00 0e lbu r1,(r11+14) <== NOT EXECUTED 801038c: 20 21 00 03 andi r1,r1,0x3 <== NOT EXECUTED 8010390: 44 22 00 08 be r1,r2,80103b0 <== NOT EXECUTED static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 8010394: 41 64 00 0c lbu r4,(r11+12) <== NOT EXECUTED 8010398: 41 63 00 02 lbu r3,(r11+2) <== NOT EXECUTED 801039c: 29 61 00 20 lw r1,(r11+32) <== NOT EXECUTED 80103a0: c8 83 10 00 sub r2,r4,r3 <== NOT EXECUTED 80103a4: f8 00 74 2d calli 802d458 <__lshrsi3> <== NOT EXECUTED 80103a8: b8 20 80 00 mv r16,r1 <== NOT EXECUTED 80103ac: e0 00 00 0c bi 80103dc <== NOT EXECUTED blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc); else { cln -= FAT_RSRVD_CLN; blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 80103b0: 41 63 00 08 lbu r3,(r11+8) 80103b4: 41 6d 00 0c lbu r13,(r11+12) 80103b8: 34 41 ff fe addi r1,r2,-2 80103bc: c8 6d 10 00 sub r2,r3,r13 80103c0: fb ff c3 8a calli 80011e8 <__ashlsi3> 80103c4: 41 63 00 02 lbu r3,(r11+2) 80103c8: b8 20 80 00 mv r16,r1 80103cc: 29 61 00 34 lw r1,(r11+52) 80103d0: c9 a3 10 00 sub r2,r13,r3 80103d4: f8 00 74 21 calli 802d458 <__lshrsi3> blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); 80103d8: b6 01 80 00 add r16,r16,r1 const uint8_t pattern) { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; 80103dc: 41 6d 00 0c lbu r13,(r11+12) 80103e0: ba 20 08 00 mv r1,r17 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; 80103e4: 34 0f 00 00 mvi r15,0 const uint8_t pattern) { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; 80103e8: b9 a0 10 00 mv r2,r13 80103ec: f8 00 74 1b calli 802d458 <__lshrsi3> uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 80103f0: b9 a0 10 00 mv r2,r13 const uint8_t pattern) { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; 80103f4: b8 20 70 00 mv r14,r1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 80103f8: fb ff c3 7c calli 80011e8 <__ashlsi3> 80103fc: ca 21 88 00 sub r17,r17,r1 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; 8010400: b6 0e 80 00 add r16,r16,r14 const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { ssize_t rc = RC_OK; 8010404: 34 04 00 00 mvi r4,0 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 8010408: 34 13 00 01 mvi r19,1 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 801040c: e0 00 00 26 bi 80104a4 && (0 < bytes_to_write)) { uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 8010410: 2d 72 00 0a lhu r18,(r11+10) 8010414: ca 51 20 00 sub r4,r18,r17 8010418: b8 80 68 00 mv r13,r4 801041c: 51 84 00 02 bgeu r12,r4,8010424 <== ALWAYS TAKEN 8010420: b9 80 68 00 mv r13,r12 <== NOT EXECUTED const uint32_t offset, const uint32_t count, const uint8_t pattern) { int rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset)); 8010424: b9 a0 70 00 mv r14,r13 8010428: 50 8d 00 02 bgeu r4,r13,8010430 <== ALWAYS TAKEN 801042c: b8 80 70 00 mv r14,r4 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 8010430: 41 63 00 02 lbu r3,(r11+2) 8010434: 41 64 00 0c lbu r4,(r11+12) int rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset)); uint8_t *blk_buf; uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) 8010438: 45 c0 00 13 be r14,r0,8010484 <== NEVER TAKEN static inline uint32_t fat_block_num_to_sector_num (const fat_fs_info_t *fs_info, const uint32_t block_number) { return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 801043c: c8 83 10 00 sub r2,r4,r3 8010440: ba 00 08 00 mv r1,r16 8010444: fb ff c3 69 calli 80011e8 <__ashlsi3> 8010448: b8 20 10 00 mv r2,r1 { if (bytes_to_write == fs_info->vol.bytes_per_block) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 801044c: 34 03 00 02 mvi r3,2 8010450: b9 60 08 00 mv r1,r11 uint8_t *blk_buf; uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) { if (bytes_to_write == fs_info->vol.bytes_per_block) 8010454: 45 d2 00 03 be r14,r18,8010460 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 8010458: b9 60 08 00 mv r1,r11 801045c: 34 03 00 01 mvi r3,1 8010460: 37 84 00 30 addi r4,sp,48 8010464: fb ff ff 06 calli 801007c if (RC_OK == rc) 8010468: 5c 20 00 08 bne r1,r0,8010488 <== NEVER TAKEN { memset(blk_buf + offset, pattern, bytes_to_write); 801046c: 2b 81 00 30 lw r1,(sp+48) 8010470: ba 80 10 00 mv r2,r20 8010474: b9 c0 18 00 mv r3,r14 8010478: b4 31 08 00 add r1,r1,r17 801047c: f8 00 2d 85 calli 801ba90 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 8010480: 31 73 00 88 sb (r11+136),r19 } } if (RC_OK != rc) return rc; else return bytes_to_write; 8010484: b9 c0 08 00 mv r1,r14 cur_blk, ofs_blk, c, pattern); if (c != ret) rc = -1; 8010488: 34 04 ff ff mvi r4,-1 fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) 801048c: 5d a1 00 05 bne r13,r1,80104a0 <== NEVER TAKEN rc = -1; else { bytes_to_write -= ret; 8010490: c9 8d 60 00 sub r12,r12,r13 bytes_written += ret; 8010494: b5 ed 78 00 add r15,r15,r13 ++cur_blk; 8010498: 36 10 00 01 addi r16,r16,1 801049c: 34 04 00 00 mvi r4,0 80104a0: 34 11 00 00 mvi r17,0 ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) 80104a4: 7d 82 00 00 cmpnei r2,r12,0 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 80104a8: 64 81 00 00 cmpei r1,r4,0 80104ac: a0 41 08 00 and r1,r2,r1 80104b0: 5c 20 ff d8 bne r1,r0,8010410 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 80104b4: 5c 81 00 02 bne r4,r1,80104bc <== NEVER TAKEN 80104b8: b9 e0 20 00 mv r4,r15 return rc; else return bytes_written; } 80104bc: b8 80 08 00 mv r1,r4 80104c0: 2b 9d 00 04 lw ra,(sp+4) 80104c4: 2b 8b 00 2c lw r11,(sp+44) 80104c8: 2b 8c 00 28 lw r12,(sp+40) 80104cc: 2b 8d 00 24 lw r13,(sp+36) 80104d0: 2b 8e 00 20 lw r14,(sp+32) 80104d4: 2b 8f 00 1c lw r15,(sp+28) 80104d8: 2b 90 00 18 lw r16,(sp+24) 80104dc: 2b 91 00 14 lw r17,(sp+20) 80104e0: 2b 92 00 10 lw r18,(sp+16) 80104e4: 2b 93 00 0c lw r19,(sp+12) 80104e8: 2b 94 00 08 lw r20,(sp+8) 80104ec: 37 9c 00 30 addi sp,sp,48 80104f0: c3 a0 00 00 ret =============================================================================== 080104f4 : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 80104f4: 37 9c ff cc addi sp,sp,-52 80104f8: 5b 8b 00 30 sw (sp+48),r11 80104fc: 5b 8c 00 2c sw (sp+44),r12 8010500: 5b 8d 00 28 sw (sp+40),r13 8010504: 5b 8e 00 24 sw (sp+36),r14 8010508: 5b 8f 00 20 sw (sp+32),r15 801050c: 5b 90 00 1c sw (sp+28),r16 8010510: 5b 91 00 18 sw (sp+24),r17 8010514: 5b 92 00 14 sw (sp+20),r18 8010518: 5b 93 00 10 sw (sp+16),r19 801051c: 5b 94 00 0c sw (sp+12),r20 8010520: 5b 95 00 08 sw (sp+8),r21 8010524: 5b 9d 00 04 sw (sp+4),ra 8010528: b8 20 58 00 mv r11,r1 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 801052c: 2c 21 00 06 lhu r1,(r1+6) const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 8010530: b8 60 88 00 mv r17,r3 8010534: b8 a0 a0 00 mv r20,r5 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8010538: c8 23 08 00 sub r1,r1,r3 const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 801053c: 20 d5 00 ff andi r21,r6,0xff ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8010540: b8 80 60 00 mv r12,r4 8010544: 50 24 00 02 bgeu r1,r4,801054c <== ALWAYS TAKEN 8010548: b8 20 60 00 mv r12,r1 <== NOT EXECUTED fat_cluster_num_to_block_num (const fat_fs_info_t *fs_info, uint32_t cln) { uint32_t blk; if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 801054c: 5c 40 00 0b bne r2,r0,8010578 8010550: 41 61 00 0e lbu r1,(r11+14) 8010554: 20 21 00 03 andi r1,r1,0x3 8010558: 44 22 00 08 be r1,r2,8010578 <== NEVER TAKEN static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 801055c: 41 63 00 0c lbu r3,(r11+12) 8010560: 41 62 00 02 lbu r2,(r11+2) 8010564: 29 61 00 20 lw r1,(r11+32) 8010568: c8 62 10 00 sub r2,r3,r2 801056c: f8 00 73 bb calli 802d458 <__lshrsi3> 8010570: b8 20 80 00 mv r16,r1 8010574: e0 00 00 0c bi 80105a4 blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc); else { cln -= FAT_RSRVD_CLN; blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 8010578: 41 63 00 08 lbu r3,(r11+8) 801057c: 41 6d 00 0c lbu r13,(r11+12) 8010580: 34 41 ff fe addi r1,r2,-2 8010584: c8 6d 10 00 sub r2,r3,r13 8010588: fb ff c3 18 calli 80011e8 <__ashlsi3> 801058c: 41 62 00 02 lbu r2,(r11+2) 8010590: b8 20 80 00 mv r16,r1 8010594: 29 61 00 34 lw r1,(r11+52) 8010598: c9 a2 10 00 sub r2,r13,r2 801059c: f8 00 73 af calli 802d458 <__lshrsi3> blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); 80105a0: b6 01 80 00 add r16,r16,r1 const bool overwrite_cluster) { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); 80105a4: 41 6d 00 0c lbu r13,(r11+12) 80105a8: ba 20 08 00 mv r1,r17 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; 80105ac: 34 0f 00 00 mvi r15,0 const bool overwrite_cluster) { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); 80105b0: b9 a0 10 00 mv r2,r13 80105b4: f8 00 73 a9 calli 802d458 <__lshrsi3> uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 80105b8: b9 a0 10 00 mv r2,r13 const bool overwrite_cluster) { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); 80105bc: b8 20 70 00 mv r14,r1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 80105c0: fb ff c3 0a calli 80011e8 <__ashlsi3> 80105c4: ca 21 88 00 sub r17,r17,r1 ssize_t bytes_written = 0; uint8_t *buffer = (uint8_t*)buff; ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; 80105c8: b6 0e 80 00 add r16,r16,r14 const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { ssize_t rc = RC_OK; 80105cc: 34 02 00 00 mvi r2,0 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 80105d0: 34 13 00 01 mvi r19,1 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 80105d4: e0 00 00 27 bi 8010670 && (0 < bytes_to_write)) { c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 80105d8: 2d 72 00 0a lhu r18,(r11+10) 80105dc: ca 51 10 00 sub r2,r18,r17 80105e0: b8 40 68 00 mv r13,r2 80105e4: 51 82 00 02 bgeu r12,r2,80105ec 80105e8: b9 80 68 00 mv r13,r12 const uint32_t count, const void *buf, const bool overwrite_block) { int rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset)); 80105ec: b9 a0 70 00 mv r14,r13 80105f0: 50 4d 00 02 bgeu r2,r13,80105f8 <== ALWAYS TAKEN 80105f4: b8 40 70 00 mv r14,r2 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 80105f8: 41 62 00 02 lbu r2,(r11+2) 80105fc: 41 63 00 0c lbu r3,(r11+12) int rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset)); uint8_t *blk_buf; uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) 8010600: 45 c0 00 14 be r14,r0,8010650 <== NEVER TAKEN static inline uint32_t fat_block_num_to_sector_num (const fat_fs_info_t *fs_info, const uint32_t block_number) { return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 8010604: c8 62 10 00 sub r2,r3,r2 8010608: ba 00 08 00 mv r1,r16 801060c: fb ff c2 f7 calli 80011e8 <__ashlsi3> 8010610: b8 20 10 00 mv r2,r1 { if ( overwrite_block 8010614: 5e a0 00 04 bne r21,r0,8010624 || (bytes_to_write == fs_info->vol.bytes_per_block)) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 8010618: b9 60 08 00 mv r1,r11 801061c: 34 03 00 01 mvi r3,1 uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) { if ( overwrite_block || (bytes_to_write == fs_info->vol.bytes_per_block)) 8010620: 5d d2 00 03 bne r14,r18,801062c { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 8010624: b9 60 08 00 mv r1,r11 8010628: 34 03 00 02 mvi r3,2 } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 801062c: 37 84 00 34 addi r4,sp,52 8010630: fb ff fe 93 calli 801007c if (RC_OK == rc) 8010634: 5c 20 00 08 bne r1,r0,8010654 <== NEVER TAKEN { memcpy(blk_buf + offset, buf, bytes_to_write); 8010638: 2b 81 00 34 lw r1,(sp+52) 801063c: b6 8f 10 00 add r2,r20,r15 8010640: b9 c0 18 00 mv r3,r14 8010644: b4 31 08 00 add r1,r1,r17 8010648: f8 00 2c d1 calli 801b98c } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 801064c: 31 73 00 88 sb (r11+136),r19 } } if (RC_OK != rc) return rc; else return bytes_to_write; 8010650: b9 c0 08 00 mv r1,r14 ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) rc = -1; 8010654: 34 02 ff ff mvi r2,-1 cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) 8010658: 5d a1 00 05 bne r13,r1,801066c <== NEVER TAKEN rc = -1; else { bytes_to_write -= ret; 801065c: c9 8d 60 00 sub r12,r12,r13 bytes_written += ret; 8010660: b5 ed 78 00 add r15,r15,r13 ++cur_blk; 8010664: 36 10 00 01 addi r16,r16,1 8010668: 34 02 00 00 mvi r2,0 801066c: 34 11 00 00 mvi r17,0 uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) && (0 < bytes_to_write)) 8010670: 7d 83 00 00 cmpnei r3,r12,0 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 8010674: 64 41 00 00 cmpei r1,r2,0 8010678: a0 61 08 00 and r1,r3,r1 801067c: 5c 20 ff d7 bne r1,r0,80105d8 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 8010680: 5c 41 00 02 bne r2,r1,8010688 <== NEVER TAKEN 8010684: b9 e0 10 00 mv r2,r15 return rc; else return bytes_written; } 8010688: b8 40 08 00 mv r1,r2 801068c: 2b 9d 00 04 lw ra,(sp+4) 8010690: 2b 8b 00 30 lw r11,(sp+48) 8010694: 2b 8c 00 2c lw r12,(sp+44) 8010698: 2b 8d 00 28 lw r13,(sp+40) 801069c: 2b 8e 00 24 lw r14,(sp+36) 80106a0: 2b 8f 00 20 lw r15,(sp+32) 80106a4: 2b 90 00 1c lw r16,(sp+28) 80106a8: 2b 91 00 18 lw r17,(sp+24) 80106ac: 2b 92 00 14 lw r18,(sp+20) 80106b0: 2b 93 00 10 lw r19,(sp+16) 80106b4: 2b 94 00 0c lw r20,(sp+12) 80106b8: 2b 95 00 08 lw r21,(sp+8) 80106bc: 37 9c 00 34 addi sp,sp,52 80106c0: c3 a0 00 00 ret =============================================================================== 0800ef40 : */ static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { 800ef40: 37 9c ff f0 addi sp,sp,-16 800ef44: 5b 8b 00 10 sw (sp+16),r11 800ef48: 5b 8c 00 0c sw (sp+12),r12 800ef4c: 5b 8d 00 08 sw (sp+8),r13 800ef50: 5b 9d 00 04 sw (sp+4),ra return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800ef54: 28 43 00 00 lw r3,(r2+0) */ static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { 800ef58: b8 20 58 00 mv r11,r1 fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 800ef5c: 34 01 00 01 mvi r1,1 800ef60: b8 40 68 00 mv r13,r2 return 1; 800ef64: 34 0c 00 01 mvi r12,1 fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 800ef68: 44 61 00 0f be r3,r1,800efa4 fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 800ef6c: 5c 60 00 06 bne r3,r0,800ef84 800ef70: 41 61 00 0e lbu r1,(r11+14) 800ef74: 20 21 00 03 andi r1,r1,0x3 800ef78: 44 23 00 03 be r1,r3,800ef84 <== NEVER TAKEN return fs_info->vol.rdir_loc; 800ef7c: 29 61 00 20 lw r1,(r11+32) 800ef80: e0 00 00 06 bi 800ef98 return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800ef84: 41 62 00 05 lbu r2,(r11+5) 800ef88: 34 61 ff fe addi r1,r3,-2 800ef8c: fb ff c8 97 calli 80011e8 <__ashlsi3> 800ef90: 29 62 00 34 lw r2,(r11+52) 800ef94: b4 22 08 00 add r1,r1,r2 ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 800ef98: 41 62 00 03 lbu r2,(r11+3) 800ef9c: fb ff c8 93 calli 80011e8 <__ashlsi3> 800efa0: b8 20 60 00 mv r12,r1 return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800efa4: 29 ab 00 04 lw r11,(r13+4) 800efa8: 34 02 00 09 mvi r2,9 800efac: b9 60 08 00 mv r1,r11 800efb0: f8 00 79 2a calli 802d458 <__lshrsi3> 800efb4: b5 81 08 00 add r1,r12,r1 800efb8: 34 02 00 04 mvi r2,4 800efbc: fb ff c8 8b calli 80011e8 <__ashlsi3> 800efc0: b8 20 60 00 mv r12,r1 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800efc4: 34 02 00 05 mvi r2,5 800efc8: b9 60 08 00 mv r1,r11 800efcc: f8 00 79 23 calli 802d458 <__lshrsi3> 800efd0: 20 22 00 0f andi r2,r1,0xf } 800efd4: b5 82 08 00 add r1,r12,r2 800efd8: 2b 9d 00 04 lw ra,(sp+4) 800efdc: 2b 8b 00 10 lw r11,(sp+16) 800efe0: 2b 8c 00 0c lw r12,(sp+12) 800efe4: 2b 8d 00 08 lw r13,(sp+8) 800efe8: 37 9c 00 10 addi sp,sp,16 800efec: c3 a0 00 00 ret =============================================================================== 0800f648 : int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 800f648: 37 9c ff f0 addi sp,sp,-16 800f64c: 5b 8b 00 10 sw (sp+16),r11 800f650: 5b 8c 00 0c sw (sp+12),r12 800f654: 5b 8d 00 08 sw (sp+8),r13 800f658: 5b 9d 00 04 sw (sp+4),ra /* * if links_num field of fat-file descriptor is greater than 1 * decrement the count of links and return */ if (fat_fd->links_num > 1) 800f65c: 28 43 00 08 lw r3,(r2+8) 800f660: 34 04 00 01 mvi r4,1 int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 800f664: b8 20 68 00 mv r13,r1 800f668: b8 40 58 00 mv r11,r2 /* * if links_num field of fat-file descriptor is greater than 1 * decrement the count of links and return */ if (fat_fd->links_num > 1) 800f66c: 50 83 00 05 bgeu r4,r3,800f680 { fat_fd->links_num--; 800f670: 34 63 ff ff addi r3,r3,-1 800f674: 58 43 00 08 sw (r2+8),r3 return rc; 800f678: 34 0c 00 00 mvi r12,0 800f67c: e0 00 00 1e bi 800f6f4 } key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); if (fat_fd->flags & FAT_FILE_REMOVED) 800f680: 40 4c 00 30 lbu r12,(r2+48) 800f684: 21 8c 00 01 andi r12,r12,0x1 800f688: 45 80 00 0f be r12,r0,800f6c4 { rc = fat_file_truncate(fs_info, fat_fd, 0); 800f68c: 34 03 00 00 mvi r3,0 800f690: fb ff ff a1 calli 800f514 800f694: b8 20 60 00 mv r12,r1 if ( rc != RC_OK ) 800f698: 5c 20 00 17 bne r1,r0,800f6f4 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 800f69c: b9 60 08 00 mv r1,r11 800f6a0: f8 00 12 c9 calli 80141c4 <_Chain_Extract> return rc; _hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd); if ( fat_ino_is_unique(fs_info, fat_fd->ino) ) 800f6a4: 29 62 00 0c lw r2,(r11+12) 800f6a8: b9 a0 08 00 mv r1,r13 800f6ac: f8 00 07 21 calli 8011330 800f6b0: 44 2c 00 0c be r1,r12,800f6e0 <== ALWAYS TAKEN fat_free_unique_ino(fs_info, fat_fd->ino); 800f6b4: 29 62 00 0c lw r2,(r11+12) <== NOT EXECUTED 800f6b8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 800f6bc: f8 00 07 05 calli 80112d0 <== NOT EXECUTED 800f6c0: e0 00 00 08 bi 800f6e0 <== NOT EXECUTED free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 800f6c4: 28 42 00 0c lw r2,(r2+12) 800f6c8: f8 00 07 1a calli 8011330 800f6cc: 44 2c 00 03 be r1,r12,800f6d8 { fat_fd->links_num = 0; 800f6d0: 59 60 00 08 sw (r11+8),r0 800f6d4: e0 00 00 05 bi 800f6e8 800f6d8: b9 60 08 00 mv r1,r11 800f6dc: f8 00 12 ba calli 80141c4 <_Chain_Extract> } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 800f6e0: b9 60 08 00 mv r1,r11 800f6e4: fb ff ce 3a calli 8002fcc } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 800f6e8: b9 a0 08 00 mv r1,r13 800f6ec: f8 00 01 e6 calli 800fe84 800f6f0: b8 20 60 00 mv r12,r1 return rc; } 800f6f4: b9 80 08 00 mv r1,r12 800f6f8: 2b 9d 00 04 lw ra,(sp+4) 800f6fc: 2b 8b 00 10 lw r11,(sp+16) 800f700: 2b 8c 00 0c lw r12,(sp+12) 800f704: 2b 8d 00 08 lw r13,(sp+8) 800f708: 37 9c 00 10 addi sp,sp,16 800f70c: c3 a0 00 00 ret =============================================================================== 0800f7e8 : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 800f7e8: 37 9c ff c4 addi sp,sp,-60 800f7ec: 5b 8b 00 28 sw (sp+40),r11 800f7f0: 5b 8c 00 24 sw (sp+36),r12 800f7f4: 5b 8d 00 20 sw (sp+32),r13 800f7f8: 5b 8e 00 1c sw (sp+28),r14 800f7fc: 5b 8f 00 18 sw (sp+24),r15 800f800: 5b 90 00 14 sw (sp+20),r16 800f804: 5b 91 00 10 sw (sp+16),r17 800f808: 5b 92 00 0c sw (sp+12),r18 800f80c: 5b 93 00 08 sw (sp+8),r19 800f810: 5b 9d 00 04 sw (sp+4),ra 800f814: b8 a0 90 00 mv r18,r5 uint32_t last_cl = 0; uint32_t bytes_remain = 0; uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; 800f818: 5a 44 00 00 sw (r18+0),r4 fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 800f81c: b8 20 58 00 mv r11,r1 uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 800f820: 28 41 00 18 lw r1,(r2+24) uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; 800f824: 5b 80 00 3c sw (sp+60),r0 uint32_t bytes2add = 0; uint32_t cls2add = 0; uint32_t old_last_cl; uint32_t last_cl = 0; 800f828: 5b 80 00 34 sw (sp+52),r0 fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 800f82c: b8 40 60 00 mv r12,r2 800f830: b8 80 70 00 mv r14,r4 800f834: 20 73 00 ff andi r19,r3,0xff ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; 800f838: 34 0d 00 00 mvi r13,0 uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 800f83c: 50 24 00 73 bgeu r1,r4,800fa08 return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 800f840: 28 43 00 20 lw r3,(r2+32) 800f844: 34 02 00 01 mvi r2,1 800f848: 5c 62 00 06 bne r3,r2,800f860 800f84c: 29 82 00 24 lw r2,(r12+36) 800f850: 5c 40 00 04 bne r2,r0,800f860 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 800f854: 41 62 00 0e lbu r2,(r11+14) 800f858: 20 42 00 03 andi r2,r2,0x3 *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 800f85c: 5c 4d 00 2f bne r2,r13,800f918 <== ALWAYS TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - 800f860: 2d 6f 00 06 lhu r15,(r11+6) bytes2add = new_length - fat_fd->fat_file_size; if (bytes2add > bytes_remain) bytes2add -= bytes_remain; else bytes2add = 0; 800f864: 34 10 00 00 mvi r16,0 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & 800f868: 35 e2 ff ff addi r2,r15,-1 800f86c: a0 41 88 00 and r17,r2,r1 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - 800f870: c9 f1 78 00 sub r15,r15,r17 800f874: a1 e2 78 00 and r15,r15,r2 (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & (fs_info->vol.bpc - 1); bytes2add = new_length - fat_fd->fat_file_size; 800f878: c9 c1 10 00 sub r2,r14,r1 if (bytes2add > bytes_remain) 800f87c: 51 e2 00 02 bgeu r15,r2,800f884 bytes2add -= bytes_remain; 800f880: c8 4f 80 00 sub r16,r2,r15 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { 800f884: 46 60 00 13 be r19,r0,800f8d0 800f888: 45 e0 00 12 be r15,r0,800f8d0 uint32_t start = fat_fd->fat_file_size; uint32_t cl_start = start >> fs_info->vol.bpc_log2; 800f88c: 41 62 00 08 lbu r2,(r11+8) 800f890: f8 00 76 f2 calli 802d458 <__lshrsi3> 800f894: b8 20 18 00 mv r3,r1 uint32_t ofs = start & (fs_info->vol.bpc - 1); uint32_t cur_cln; rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 800f898: b9 80 10 00 mv r2,r12 800f89c: b9 60 08 00 mv r1,r11 800f8a0: 37 84 00 2c addi r4,sp,44 800f8a4: fb ff fe 01 calli 800f0a8 800f8a8: b8 20 68 00 mv r13,r1 if (rc != RC_OK) 800f8ac: 5c 20 00 57 bne r1,r0,800fa08 <== NEVER TAKEN return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 800f8b0: 2b 82 00 2c lw r2,(sp+44) 800f8b4: b9 60 08 00 mv r1,r11 800f8b8: ba 20 18 00 mv r3,r17 800f8bc: b9 e0 20 00 mv r4,r15 800f8c0: 34 05 00 00 mvi r5,0 800f8c4: f8 00 02 9c calli 8010334 if (bytes_remain != bytes_written) return -1; 800f8c8: 34 0d ff ff mvi r13,-1 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); if (bytes_remain != bytes_written) 800f8cc: 5d e1 00 4f bne r15,r1,800fa08 <== NEVER TAKEN * if in last cluster allocated for the file there is enough room to * handle extention (hence we don't need to add even one cluster to the * file ) - return */ if (bytes2add == 0) return RC_OK; 800f8d0: 34 0d 00 00 mvi r13,0 /* * if in last cluster allocated for the file there is enough room to * handle extention (hence we don't need to add even one cluster to the * file ) - return */ if (bytes2add == 0) 800f8d4: 46 00 00 4d be r16,r0,800fa08 <== NEVER TAKEN return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 800f8d8: 41 62 00 08 lbu r2,(r11+8) 800f8dc: 36 01 ff ff addi r1,r16,-1 800f8e0: f8 00 76 de calli 802d458 <__lshrsi3> 800f8e4: 34 31 00 01 addi r17,r1,1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 800f8e8: 37 82 00 3c addi r2,sp,60 800f8ec: b9 60 08 00 mv r1,r11 800f8f0: ba 20 18 00 mv r3,r17 800f8f4: 37 84 00 30 addi r4,sp,48 800f8f8: 37 85 00 34 addi r5,sp,52 800f8fc: ba 60 30 00 mv r6,r19 800f900: f8 00 24 b7 calli 8018bdc 800f904: b8 20 68 00 mv r13,r1 &cls_added, &last_cl, zero_fill); /* this means that low level I/O error occured */ if (rc != RC_OK) 800f908: 5c 20 00 40 bne r1,r0,800fa08 <== NEVER TAKEN return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) 800f90c: 2b 82 00 30 lw r2,(sp+48) 800f910: b9 e2 78 00 or r15,r15,r2 800f914: 5d e1 00 06 bne r15,r1,800f92c <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENOSPC); 800f918: f8 00 2c cf calli 801ac54 <__errno> 800f91c: 34 02 00 1c mvi r2,28 800f920: 58 22 00 00 sw (r1+0),r2 800f924: 34 0d ff ff mvi r13,-1 800f928: e0 00 00 38 bi 800fa08 /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 800f92c: 46 22 00 09 be r17,r2,800f950 <== ALWAYS TAKEN { new_length -= bytes2add & (fs_info->vol.bpc - 1); 800f930: 2d 61 00 06 lhu r1,(r11+6) <== NOT EXECUTED 800f934: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED 800f938: a2 01 80 00 and r16,r16,r1 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 800f93c: ca 22 08 00 sub r1,r17,r2 <== NOT EXECUTED 800f940: 41 62 00 08 lbu r2,(r11+8) <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOSPC); /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) { new_length -= bytes2add & (fs_info->vol.bpc - 1); 800f944: c9 d0 70 00 sub r14,r14,r16 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 800f948: fb ff c6 28 calli 80011e8 <__ashlsi3> <== NOT EXECUTED 800f94c: c9 c1 70 00 sub r14,r14,r1 <== NOT EXECUTED } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) 800f950: 29 84 00 18 lw r4,(r12+24) 800f954: 5c 80 00 06 bne r4,r0,800f96c { fat_fd->map.disk_cln = fat_fd->cln = chain; 800f958: 2b 81 00 3c lw r1,(sp+60) fat_fd->map.file_cln = 0; 800f95c: 59 80 00 34 sw (r12+52),r0 } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) { fat_fd->map.disk_cln = fat_fd->cln = chain; 800f960: 59 81 00 1c sw (r12+28),r1 800f964: 59 81 00 38 sw (r12+56),r1 800f968: e0 00 00 16 bi 800f9c0 fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 800f96c: 29 81 00 3c lw r1,(r12+60) 800f970: 34 02 ff ff mvi r2,-1 800f974: 44 22 00 03 be r1,r2,800f980 <== NEVER TAKEN { old_last_cl = fat_fd->map.last_cln; 800f978: 5b 81 00 38 sw (sp+56),r1 800f97c: e0 00 00 09 bi 800f9a0 } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 800f980: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800f984: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 800f988: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 800f98c: 34 84 ff ff addi r4,r4,-1 <== NOT EXECUTED 800f990: 37 85 00 38 addi r5,sp,56 <== NOT EXECUTED 800f994: fb ff ff 5f calli 800f710 <== NOT EXECUTED 800f998: b8 20 78 00 mv r15,r1 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 800f99c: 5c 20 00 14 bne r1,r0,800f9ec <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, chain); return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); 800f9a0: 2b 82 00 38 lw r2,(sp+56) 800f9a4: 2b 83 00 3c lw r3,(sp+60) 800f9a8: b9 60 08 00 mv r1,r11 800f9ac: f8 00 23 7e calli 80187a4 800f9b0: b8 20 78 00 mv r15,r1 if ( rc != RC_OK ) 800f9b4: 5c 20 00 0e bne r1,r0,800f9ec <== NEVER TAKEN { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); 800f9b8: b9 60 08 00 mv r1,r11 800f9bc: f8 00 01 32 calli 800fe84 } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 800f9c0: 2b 81 00 30 lw r1,(sp+48) 800f9c4: 44 20 00 0f be r1,r0,800fa00 <== NEVER TAKEN { fat_fd->map.last_cln = last_cl; 800f9c8: 2b 81 00 34 lw r1,(sp+52) if (fat_fd->fat_file_type == FAT_DIRECTORY) 800f9cc: 29 90 00 10 lw r16,(r12+16) } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) { fat_fd->map.last_cln = last_cl; 800f9d0: 59 81 00 3c sw (r12+60),r1 if (fat_fd->fat_file_type == FAT_DIRECTORY) 800f9d4: 5e 00 00 0b bne r16,r0,800fa00 { rc = fat_init_clusters_chain(fs_info, chain); 800f9d8: 2b 82 00 3c lw r2,(sp+60) 800f9dc: b9 60 08 00 mv r1,r11 800f9e0: f8 00 05 d6 calli 8011138 800f9e4: b8 20 78 00 mv r15,r1 if ( rc != RC_OK ) 800f9e8: 44 30 00 06 be r1,r16,800fa00 <== ALWAYS TAKEN { fat_free_fat_clusters_chain(fs_info, chain); 800f9ec: 2b 82 00 3c lw r2,(sp+60) <== NOT EXECUTED 800f9f0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED return rc; 800f9f4: b9 e0 68 00 mv r13,r15 <== NOT EXECUTED if (fat_fd->fat_file_type == FAT_DIRECTORY) { rc = fat_init_clusters_chain(fs_info, chain); if ( rc != RC_OK ) { fat_free_fat_clusters_chain(fs_info, chain); 800f9f8: f8 00 24 3d calli 8018aec <== NOT EXECUTED return rc; 800f9fc: e0 00 00 03 bi 800fa08 <== NOT EXECUTED } } } *a_length = new_length; 800fa00: 5a 4e 00 00 sw (r18+0),r14 fat_fd->fat_file_size = new_length; 800fa04: 59 8e 00 18 sw (r12+24),r14 return RC_OK; } 800fa08: b9 a0 08 00 mv r1,r13 800fa0c: 2b 9d 00 04 lw ra,(sp+4) 800fa10: 2b 8b 00 28 lw r11,(sp+40) 800fa14: 2b 8c 00 24 lw r12,(sp+36) 800fa18: 2b 8d 00 20 lw r13,(sp+32) 800fa1c: 2b 8e 00 1c lw r14,(sp+28) 800fa20: 2b 8f 00 18 lw r15,(sp+24) 800fa24: 2b 90 00 14 lw r16,(sp+20) 800fa28: 2b 91 00 10 lw r17,(sp+16) 800fa2c: 2b 92 00 0c lw r18,(sp+12) 800fa30: 2b 93 00 08 lw r19,(sp+8) 800fa34: 37 9c 00 3c addi sp,sp,60 800fa38: c3 a0 00 00 ret =============================================================================== 0800f710 : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 800f710: 37 9c ff d4 addi sp,sp,-44 800f714: 5b 8b 00 10 sw (sp+16),r11 800f718: 5b 8c 00 0c sw (sp+12),r12 800f71c: 5b 8d 00 08 sw (sp+8),r13 800f720: 5b 9d 00 04 sw (sp+4),ra 800f724: b8 20 60 00 mv r12,r1 800f728: 5b 83 00 18 sw (sp+24),r3 800f72c: 5b 84 00 1c sw (sp+28),r4 800f730: 5b 85 00 20 sw (sp+32),r5 800f734: 5b 86 00 24 sw (sp+36),r6 800f738: 5b 87 00 28 sw (sp+40),r7 800f73c: 5b 88 00 2c sw (sp+44),r8 int rc = RC_OK; uint32_t cur_cln = 0; 800f740: 5b 80 00 14 sw (sp+20),r0 uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 800f744: 34 01 00 01 mvi r1,1 fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 800f748: b8 40 58 00 mv r11,r2 uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 800f74c: 5c 61 00 1d bne r3,r1,800f7c0 <== NEVER TAKEN case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 800f750: 28 42 00 18 lw r2,(r2+24) va_start(ap, cmd); switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); 800f754: b8 80 08 00 mv r1,r4 ret = va_arg(ap, uint32_t *); 800f758: b8 a0 68 00 mv r13,r5 /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 800f75c: 54 44 00 04 bgu r2,r4,800f76c <== ALWAYS TAKEN va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); 800f760: f8 00 2d 3d calli 801ac54 <__errno> <== NOT EXECUTED 800f764: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 800f768: e0 00 00 18 bi 800f7c8 <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 800f76c: 29 62 00 20 lw r2,(r11+32) 800f770: 5c 43 00 09 bne r2,r3,800f794 800f774: 29 62 00 24 lw r2,(r11+36) 800f778: 5c 40 00 07 bne r2,r0,800f794 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 800f77c: 41 83 00 0e lbu r3,(r12+14) 800f780: 20 63 00 03 andi r3,r3,0x3 if ( pos >= fat_fd->fat_file_size ) { va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 800f784: 44 62 00 04 be r3,r2,800f794 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { /* cluster 0 (zero) reserved for root dir */ *ret = 0; 800f788: 58 a0 00 00 sw (r5+0),r0 rc = RC_OK; 800f78c: 34 01 00 00 mvi r1,0 break; 800f790: e0 00 00 10 bi 800f7d0 } cl_start = pos >> fs_info->vol.bpc_log2; 800f794: 41 82 00 08 lbu r2,(r12+8) 800f798: f8 00 77 30 calli 802d458 <__lshrsi3> 800f79c: b8 20 18 00 mv r3,r1 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 800f7a0: b9 60 10 00 mv r2,r11 800f7a4: b9 80 08 00 mv r1,r12 800f7a8: 37 84 00 14 addi r4,sp,20 800f7ac: fb ff fe 3f calli 800f0a8 if ( rc != RC_OK ) 800f7b0: 5c 20 00 08 bne r1,r0,800f7d0 <== NEVER TAKEN break; *ret = cur_cln; 800f7b4: 2b 82 00 14 lw r2,(sp+20) 800f7b8: 59 a2 00 00 sw (r13+0),r2 break; 800f7bc: e0 00 00 05 bi 800f7d0 default: errno = EINVAL; 800f7c0: f8 00 2d 25 calli 801ac54 <__errno> <== NOT EXECUTED 800f7c4: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 800f7c8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rc = -1; 800f7cc: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED break; } va_end(ap); return rc; } 800f7d0: 2b 9d 00 04 lw ra,(sp+4) 800f7d4: 2b 8b 00 10 lw r11,(sp+16) 800f7d8: 2b 8c 00 0c lw r12,(sp+12) 800f7dc: 2b 8d 00 08 lw r13,(sp+8) 800f7e0: 37 9c 00 2c addi sp,sp,44 800f7e4: c3 a0 00 00 ret =============================================================================== 0800f0a8 : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 800f0a8: 37 9c ff e0 addi sp,sp,-32 800f0ac: 5b 8b 00 1c sw (sp+28),r11 800f0b0: 5b 8c 00 18 sw (sp+24),r12 800f0b4: 5b 8d 00 14 sw (sp+20),r13 800f0b8: 5b 8e 00 10 sw (sp+16),r14 800f0bc: 5b 8f 00 0c sw (sp+12),r15 800f0c0: 5b 90 00 08 sw (sp+8),r16 800f0c4: 5b 9d 00 04 sw (sp+4),ra 800f0c8: b8 40 58 00 mv r11,r2 int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 800f0cc: 28 42 00 34 lw r2,(r2+52) fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 800f0d0: b8 20 80 00 mv r16,r1 800f0d4: b8 60 60 00 mv r12,r3 800f0d8: b8 80 70 00 mv r14,r4 int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 800f0dc: 5c 62 00 04 bne r3,r2,800f0ec *disk_cln = fat_fd->map.disk_cln; 800f0e0: 29 61 00 38 lw r1,(r11+56) 800f0e4: 58 81 00 00 sw (r4+0),r1 800f0e8: e0 00 00 15 bi 800f13c { uint32_t cur_cln; uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) 800f0ec: 50 43 00 05 bgeu r2,r3,800f100 { cur_cln = fat_fd->map.disk_cln; 800f0f0: 29 61 00 38 lw r1,(r11+56) count = file_cln - fat_fd->map.file_cln; 800f0f4: c8 62 78 00 sub r15,r3,r2 uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) { cur_cln = fat_fd->map.disk_cln; 800f0f8: 5b 81 00 20 sw (sp+32),r1 800f0fc: e0 00 00 04 bi 800f10c count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; 800f100: 29 61 00 1c lw r1,(r11+28) 800f104: b8 60 78 00 mv r15,r3 800f108: 5b 81 00 20 sw (sp+32),r1 count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 800f10c: 34 0d 00 00 mvi r13,0 800f110: e0 00 00 06 bi 800f128 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 800f114: ba 00 08 00 mv r1,r16 800f118: 37 83 00 20 addi r3,sp,32 800f11c: f8 00 25 17 calli 8018578 if ( rc != RC_OK ) 800f120: 5c 20 00 08 bne r1,r0,800f140 <== NEVER TAKEN cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 800f124: 35 ad 00 01 addi r13,r13,1 800f128: 2b 82 00 20 lw r2,(sp+32) 800f12c: 55 ed ff fa bgu r15,r13,800f114 if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; 800f130: 59 6c 00 34 sw (r11+52),r12 fat_fd->map.disk_cln = cur_cln; 800f134: 59 62 00 38 sw (r11+56),r2 *disk_cln = cur_cln; 800f138: 59 c2 00 00 sw (r14+0),r2 } return RC_OK; 800f13c: 34 01 00 00 mvi r1,0 } 800f140: 2b 9d 00 04 lw ra,(sp+4) 800f144: 2b 8b 00 1c lw r11,(sp+28) 800f148: 2b 8c 00 18 lw r12,(sp+24) 800f14c: 2b 8d 00 14 lw r13,(sp+20) 800f150: 2b 8e 00 10 lw r14,(sp+16) 800f154: 2b 8f 00 0c lw r15,(sp+12) 800f158: 2b 90 00 08 lw r16,(sp+8) 800f15c: 37 9c 00 20 addi sp,sp,32 800f160: c3 a0 00 00 ret =============================================================================== 0800f164 : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 800f164: 37 9c ff e0 addi sp,sp,-32 800f168: 5b 8b 00 1c sw (sp+28),r11 800f16c: 5b 8c 00 18 sw (sp+24),r12 800f170: 5b 8d 00 14 sw (sp+20),r13 800f174: 5b 8e 00 10 sw (sp+16),r14 800f178: 5b 8f 00 0c sw (sp+12),r15 800f17c: 5b 90 00 08 sw (sp+8),r16 800f180: 5b 9d 00 04 sw (sp+4),ra 800f184: b8 20 68 00 mv r13,r1 800f188: b8 40 60 00 mv r12,r2 800f18c: b8 60 78 00 mv r15,r3 int rc = RC_OK; fat_file_fd_t *lfat_fd = NULL; 800f190: 5b 80 00 20 sw (sp+32),r0 uint32_t key = 0; /* construct key */ key = fat_construct_key(fs_info, &dir_pos->sname); 800f194: fb ff ff 6b calli 800ef40 /* access "valid" hash table */ rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); 800f198: 29 a2 00 6c lw r2,(r13+108) int rc = RC_OK; fat_file_fd_t *lfat_fd = NULL; uint32_t key = 0; /* construct key */ key = fat_construct_key(fs_info, &dir_pos->sname); 800f19c: b8 20 70 00 mv r14,r1 /* access "valid" hash table */ rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); 800f1a0: b9 c0 18 00 mv r3,r14 800f1a4: b9 a0 08 00 mv r1,r13 800f1a8: 34 04 00 00 mvi r4,0 800f1ac: 37 85 00 20 addi r5,sp,32 800f1b0: fb ff ff 90 calli 800eff0 <_hash_search> 800f1b4: b8 20 10 00 mv r2,r1 if ( rc == RC_OK ) 800f1b8: 5c 20 00 07 bne r1,r0,800f1d4 { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; 800f1bc: 2b 81 00 20 lw r1,(sp+32) lfat_fd->links_num++; 800f1c0: 28 23 00 08 lw r3,(r1+8) /* access "valid" hash table */ rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); if ( rc == RC_OK ) { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; 800f1c4: 59 e1 00 00 sw (r15+0),r1 lfat_fd->links_num++; 800f1c8: 34 63 00 01 addi r3,r3,1 800f1cc: 58 23 00 08 sw (r1+8),r3 return rc; 800f1d0: e0 00 00 3c bi 800f2c0 } /* access "removed-but-still-open" hash table */ rc = _hash_search(fs_info, fs_info->rhash, key, key, &lfat_fd); 800f1d4: 29 a2 00 70 lw r2,(r13+112) 800f1d8: b9 c0 18 00 mv r3,r14 800f1dc: b9 c0 20 00 mv r4,r14 800f1e0: 37 85 00 20 addi r5,sp,32 800f1e4: b9 a0 08 00 mv r1,r13 800f1e8: fb ff ff 82 calli 800eff0 <_hash_search> 800f1ec: b8 20 80 00 mv r16,r1 lfat_fd = (*fat_fd) = (fat_file_fd_t*)malloc(sizeof(fat_file_fd_t)); 800f1f0: 34 01 00 44 mvi r1,68 800f1f4: fb ff d1 0c calli 8003624 800f1f8: 59 e1 00 00 sw (r15+0),r1 800f1fc: 5b 81 00 20 sw (sp+32),r1 800f200: b8 20 58 00 mv r11,r1 if ( lfat_fd == NULL ) 800f204: 44 20 00 1e be r1,r0,800f27c <== NEVER TAKEN rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 800f208: 34 02 00 00 mvi r2,0 800f20c: 34 03 00 44 mvi r3,68 800f210: f8 00 32 20 calli 801ba90 lfat_fd->links_num = 1; 800f214: 34 01 00 01 mvi r1,1 800f218: 59 61 00 08 sw (r11+8),r1 lfat_fd->flags &= ~FAT_FILE_REMOVED; 800f21c: 41 61 00 30 lbu r1,(r11+48) lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; 800f220: 29 84 00 00 lw r4,(r12+0) 800f224: 29 83 00 04 lw r3,(r12+4) rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); lfat_fd->links_num = 1; lfat_fd->flags &= ~FAT_FILE_REMOVED; 800f228: 20 21 00 fe andi r1,r1,0xfe 800f22c: 31 61 00 30 sb (r11+48),r1 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 800f230: 34 01 ff ff mvi r1,-1 800f234: 59 61 00 3c sw (r11+60),r1 lfat_fd->dir_pos = *dir_pos; 800f238: 29 82 00 08 lw r2,(r12+8) 800f23c: 29 81 00 0c lw r1,(r12+12) 800f240: 59 64 00 20 sw (r11+32),r4 800f244: 59 63 00 24 sw (r11+36),r3 800f248: 59 62 00 28 sw (r11+40),r2 800f24c: 59 61 00 2c sw (r11+44),r1 if ( rc != RC_OK ) 800f250: 46 00 00 03 be r16,r0,800f25c <== NEVER TAKEN lfat_fd->ino = key; 800f254: 59 6e 00 0c sw (r11+12),r14 800f258: e0 00 00 0e bi 800f290 else { lfat_fd->ino = fat_get_unique_ino(fs_info); 800f25c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 800f260: f8 00 07 d4 calli 80111b0 <== NOT EXECUTED 800f264: 59 61 00 0c sw (r11+12),r1 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 800f268: 2b 81 00 20 lw r1,(sp+32) <== NOT EXECUTED 800f26c: 28 21 00 0c lw r1,(r1+12) <== NOT EXECUTED 800f270: 5c 30 00 08 bne r1,r16,800f290 <== NOT EXECUTED { free((*fat_fd)); 800f274: 29 e1 00 00 lw r1,(r15+0) <== NOT EXECUTED 800f278: fb ff cf 55 calli 8002fcc <== NOT EXECUTED /* * XXX: kernel resource is unsufficient, but not the memory, * but there is no suitable errno :( */ rtems_set_errno_and_return_minus_one( ENOMEM ); 800f27c: f8 00 2e 76 calli 801ac54 <__errno> <== NOT EXECUTED 800f280: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 800f284: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800f288: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 800f28c: e0 00 00 0d bi 800f2c0 <== NOT EXECUTED */ static inline void _hash_insert(rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t *el) { rtems_chain_append((hash) + ((key1) % FAT_HASH_MODULE), &(el)->link); 800f290: 21 ce 00 01 andi r14,r14,0x1 800f294: 34 02 00 01 mvi r2,1 800f298: b9 c0 08 00 mv r1,r14 800f29c: fb ff c7 d3 calli 80011e8 <__ashlsi3> 800f2a0: 34 02 00 02 mvi r2,2 800f2a4: b4 2e 08 00 add r1,r1,r14 800f2a8: fb ff c7 d0 calli 80011e8 <__ashlsi3> 800f2ac: 29 a2 00 6c lw r2,(r13+108) RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); 800f2b0: b4 41 08 00 add r1,r2,r1 800f2b4: 2b 82 00 20 lw r2,(sp+32) 800f2b8: fb ff db d4 calli 8006208 <_Chain_Append> /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; 800f2bc: 34 02 00 00 mvi r2,0 } 800f2c0: b8 40 08 00 mv r1,r2 800f2c4: 2b 9d 00 04 lw ra,(sp+4) 800f2c8: 2b 8b 00 1c lw r11,(sp+28) 800f2cc: 2b 8c 00 18 lw r12,(sp+24) 800f2d0: 2b 8d 00 14 lw r13,(sp+20) 800f2d4: 2b 8e 00 10 lw r14,(sp+16) 800f2d8: 2b 8f 00 0c lw r15,(sp+12) 800f2dc: 2b 90 00 08 lw r16,(sp+8) 800f2e0: 37 9c 00 20 addi sp,sp,32 800f2e4: c3 a0 00 00 ret =============================================================================== 0800f2fc : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 800f2fc: 37 9c ff d0 addi sp,sp,-48 800f300: 5b 8b 00 2c sw (sp+44),r11 800f304: 5b 8c 00 28 sw (sp+40),r12 800f308: 5b 8d 00 24 sw (sp+36),r13 800f30c: 5b 8e 00 20 sw (sp+32),r14 800f310: 5b 8f 00 1c sw (sp+28),r15 800f314: 5b 90 00 18 sw (sp+24),r16 800f318: 5b 91 00 14 sw (sp+20),r17 800f31c: 5b 92 00 10 sw (sp+16),r18 800f320: 5b 93 00 0c sw (sp+12),r19 800f324: 5b 94 00 08 sw (sp+8),r20 800f328: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; ssize_t ret = 0; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 800f32c: 5b 80 00 30 sw (sp+48),r0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 800f330: b8 20 58 00 mv r11,r1 800f334: b8 40 68 00 mv r13,r2 800f338: b8 60 70 00 mv r14,r3 800f33c: b8 80 60 00 mv r12,r4 800f340: b8 a0 a0 00 mv r20,r5 uint32_t byte = 0; uint32_t c = 0; /* it couldn't be removed - otherwise cache update will be broken */ if (count == 0) return cmpltd; 800f344: 34 01 00 00 mvi r1,0 uint32_t sec = 0; uint32_t byte = 0; uint32_t c = 0; /* it couldn't be removed - otherwise cache update will be broken */ if (count == 0) 800f348: 44 80 00 66 be r4,r0,800f4e0 <== NEVER TAKEN /* * >= because start is offset and computed from 0 and file_size * computed from 1 */ if ( start >= fat_fd->fat_file_size ) 800f34c: 28 42 00 18 lw r2,(r2+24) 800f350: 50 62 00 64 bgeu r3,r2,800f4e0 return FAT_EOF; if ((count > fat_fd->fat_file_size) || 800f354: 54 82 00 03 bgu r4,r2,800f360 <== NEVER TAKEN (start > fat_fd->fat_file_size - count)) 800f358: c8 44 08 00 sub r1,r2,r4 * computed from 1 */ if ( start >= fat_fd->fat_file_size ) return FAT_EOF; if ((count > fat_fd->fat_file_size) || 800f35c: 50 23 00 02 bgeu r1,r3,800f364 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 800f360: c8 4e 60 00 sub r12,r2,r14 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 800f364: 29 a2 00 20 lw r2,(r13+32) 800f368: 34 01 00 01 mvi r1,1 800f36c: 5c 41 00 1c bne r2,r1,800f3dc 800f370: 29 a1 00 24 lw r1,(r13+36) 800f374: 5c 20 00 1a bne r1,r0,800f3dc <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 800f378: 41 62 00 0e lbu r2,(r11+14) 800f37c: 20 42 00 03 andi r2,r2,0x3 if ((count > fat_fd->fat_file_size) || (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 800f380: 44 41 00 17 be r2,r1,800f3dc (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); 800f384: 29 a1 00 1c lw r1,(r13+28) fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 800f388: 5c 20 00 03 bne r1,r0,800f394 <== NEVER TAKEN return fs_info->vol.rdir_loc; 800f38c: 29 6d 00 20 lw r13,(r11+32) 800f390: e0 00 00 06 bi 800f3a8 return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800f394: 41 62 00 05 lbu r2,(r11+5) <== NOT EXECUTED 800f398: 34 21 ff fe addi r1,r1,-2 <== NOT EXECUTED 800f39c: fb ff c7 93 calli 80011e8 <__ashlsi3> <== NOT EXECUTED 800f3a0: 29 6d 00 34 lw r13,(r11+52) <== NOT EXECUTED 800f3a4: b4 2d 68 00 add r13,r1,r13 <== NOT EXECUTED sec += (start >> fs_info->vol.sec_log2); 800f3a8: 41 62 00 02 lbu r2,(r11+2) 800f3ac: b9 c0 08 00 mv r1,r14 800f3b0: f8 00 78 2a calli 802d458 <__lshrsi3> byte = start & (fs_info->vol.bps - 1); 800f3b4: 2d 63 00 00 lhu r3,(r11+0) if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); sec += (start >> fs_info->vol.sec_log2); 800f3b8: b5 a1 10 00 add r2,r13,r1 byte = start & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, count, buf); 800f3bc: b9 80 20 00 mv r4,r12 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); sec += (start >> fs_info->vol.sec_log2); byte = start & (fs_info->vol.bps - 1); 800f3c0: 34 63 ff ff addi r3,r3,-1 ret = _fat_block_read(fs_info, sec, byte, count, buf); 800f3c4: b9 60 08 00 mv r1,r11 800f3c8: a1 c3 18 00 and r3,r14,r3 800f3cc: ba 80 28 00 mv r5,r20 800f3d0: f8 00 03 6d calli 8010184 <_fat_block_read> if ( ret < 0 ) 800f3d4: 4c 20 00 43 bge r1,r0,800f4e0 <== ALWAYS TAKEN 800f3d8: e0 00 00 41 bi 800f4dc <== NOT EXECUTED return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 800f3dc: 41 62 00 08 lbu r2,(r11+8) 800f3e0: b9 c0 08 00 mv r1,r14 800f3e4: f8 00 78 1d calli 802d458 <__lshrsi3> 800f3e8: b8 20 98 00 mv r19,r1 save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 800f3ec: b9 a0 10 00 mv r2,r13 800f3f0: b9 60 08 00 mv r1,r11 800f3f4: ba 60 18 00 mv r3,r19 800f3f8: 37 84 00 30 addi r4,sp,48 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 800f3fc: 2d 6f 00 06 lhu r15,(r11+6) rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 800f400: fb ff ff 2a calli 800f0a8 if (rc != RC_OK) 800f404: 5c 20 00 37 bne r1,r0,800f4e0 <== NEVER TAKEN return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 800f408: 35 e1 ff ff addi r1,r15,-1 800f40c: a1 c1 70 00 and r14,r14,r1 800f410: b9 c0 88 00 mv r17,r14 800f414: 34 12 00 00 mvi r18,0 800f418: 34 0f 00 00 mvi r15,0 800f41c: e0 00 00 26 bi 800f4b4 if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 800f420: 2d 70 00 06 lhu r16,(r11+6) 800f424: ca 11 80 00 sub r16,r16,r17 800f428: 51 90 00 02 bgeu r12,r16,800f430 800f42c: b9 80 80 00 mv r16,r12 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 800f430: 2b 82 00 30 lw r2,(sp+48) fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 800f434: 5c 40 00 06 bne r2,r0,800f44c <== ALWAYS TAKEN 800f438: 41 61 00 0e lbu r1,(r11+14) <== NOT EXECUTED 800f43c: 20 21 00 03 andi r1,r1,0x3 <== NOT EXECUTED 800f440: 44 22 00 03 be r1,r2,800f44c <== NOT EXECUTED return fs_info->vol.rdir_loc; 800f444: 29 72 00 20 lw r18,(r11+32) <== NOT EXECUTED 800f448: e0 00 00 06 bi 800f460 <== NOT EXECUTED return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800f44c: 34 41 ff fe addi r1,r2,-2 800f450: 41 62 00 05 lbu r2,(r11+5) 800f454: fb ff c7 65 calli 80011e8 <__ashlsi3> 800f458: 29 72 00 34 lw r18,(r11+52) 800f45c: b4 32 90 00 add r18,r1,r18 sec += (ofs >> fs_info->vol.sec_log2); 800f460: 41 62 00 02 lbu r2,(r11+2) 800f464: ba 20 08 00 mv r1,r17 800f468: f8 00 77 fc calli 802d458 <__lshrsi3> byte = ofs & (fs_info->vol.bps - 1); 800f46c: 2d 63 00 00 lhu r3,(r11+0) while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); sec += (ofs >> fs_info->vol.sec_log2); 800f470: b6 41 10 00 add r2,r18,r1 byte = ofs & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 800f474: ba 00 20 00 mv r4,r16 { c = MIN(count, (fs_info->vol.bpc - ofs)); sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); sec += (ofs >> fs_info->vol.sec_log2); byte = ofs & (fs_info->vol.bps - 1); 800f478: 34 63 ff ff addi r3,r3,-1 ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 800f47c: b9 60 08 00 mv r1,r11 800f480: a2 23 18 00 and r3,r17,r3 800f484: b6 8f 28 00 add r5,r20,r15 800f488: f8 00 03 3f calli 8010184 <_fat_block_read> if ( ret < 0 ) 800f48c: 48 01 00 14 bg r0,r1,800f4dc <== NEVER TAKEN return -1; count -= c; cmpltd += c; save_cln = cur_cln; 800f490: 2b 92 00 30 lw r18,(sp+48) rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 800f494: b9 60 08 00 mv r1,r11 800f498: 37 83 00 30 addi r3,sp,48 800f49c: ba 40 10 00 mv r2,r18 800f4a0: f8 00 24 36 calli 8018578 if ( rc != RC_OK ) 800f4a4: 5c 20 00 0f bne r1,r0,800f4e0 <== NEVER TAKEN ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) return -1; count -= c; 800f4a8: c9 90 60 00 sub r12,r12,r16 cmpltd += c; 800f4ac: b5 f0 78 00 add r15,r15,r16 save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; ofs = 0; 800f4b0: 34 11 00 00 mvi r17,0 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) 800f4b4: 5d 80 ff db bne r12,r0,800f420 } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); 800f4b8: 41 62 00 08 lbu r2,(r11+8) 800f4bc: 35 ce ff ff addi r14,r14,-1 800f4c0: b5 cf 08 00 add r1,r14,r15 800f4c4: f8 00 77 e5 calli 802d458 <__lshrsi3> ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 800f4c8: b4 33 08 00 add r1,r1,r19 800f4cc: 59 a1 00 34 sw (r13+52),r1 ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; 800f4d0: 59 b2 00 38 sw (r13+56),r18 return cmpltd; 800f4d4: b9 e0 08 00 mv r1,r15 800f4d8: e0 00 00 02 bi 800f4e0 sec += (ofs >> fs_info->vol.sec_log2); byte = ofs & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) return -1; 800f4dc: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED fat_fd->map.file_cln = cl_start + ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; return cmpltd; } 800f4e0: 2b 9d 00 04 lw ra,(sp+4) 800f4e4: 2b 8b 00 2c lw r11,(sp+44) 800f4e8: 2b 8c 00 28 lw r12,(sp+40) 800f4ec: 2b 8d 00 24 lw r13,(sp+36) 800f4f0: 2b 8e 00 20 lw r14,(sp+32) 800f4f4: 2b 8f 00 1c lw r15,(sp+28) 800f4f8: 2b 90 00 18 lw r16,(sp+24) 800f4fc: 2b 91 00 14 lw r17,(sp+20) 800f500: 2b 92 00 10 lw r18,(sp+16) 800f504: 2b 93 00 0c lw r19,(sp+12) 800f508: 2b 94 00 08 lw r20,(sp+8) 800f50c: 37 9c 00 30 addi sp,sp,48 800f510: c3 a0 00 00 ret =============================================================================== 0800fd4c : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 800fd4c: 37 9c ff ec addi sp,sp,-20 800fd50: 5b 8b 00 10 sw (sp+16),r11 800fd54: 5b 8c 00 0c sw (sp+12),r12 800fd58: 5b 8d 00 08 sw (sp+8),r13 800fd5c: 5b 9d 00 04 sw (sp+4),ra 800fd60: b8 20 60 00 mv r12,r1 int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 800fd64: 28 41 00 1c lw r1,(r2+28) int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 800fd68: b8 40 58 00 mv r11,r2 int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 800fd6c: 28 42 00 20 lw r2,(r2+32) fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 800fd70: 5b 81 00 14 sw (sp+20),r1 uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 800fd74: 34 01 00 01 mvi r1,1 800fd78: 5c 41 00 09 bne r2,r1,800fd9c 800fd7c: 29 61 00 24 lw r1,(r11+36) 800fd80: 5c 20 00 07 bne r1,r0,800fd9c <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 800fd84: 41 82 00 0e lbu r2,(r12+14) 800fd88: 20 42 00 03 andi r2,r2,0x3 int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 800fd8c: 44 41 00 04 be r2,r1,800fd9c <== ALWAYS TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { fat_fd->fat_file_size = fs_info->vol.rdir_size; 800fd90: 29 81 00 2c lw r1,(r12+44) <== NOT EXECUTED 800fd94: 59 61 00 18 sw (r11+24),r1 <== NOT EXECUTED 800fd98: e0 00 00 14 bi 800fde8 <== NOT EXECUTED return rc; } fat_fd->fat_file_size = 0; 800fd9c: 59 60 00 18 sw (r11+24),r0 fat_file_fd_t *fat_fd ) { int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; 800fda0: 34 01 00 00 mvi r1,0 return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 800fda4: e0 00 00 0b bi 800fdd0 { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 800fda8: b9 80 08 00 mv r1,r12 800fdac: b9 a0 10 00 mv r2,r13 800fdb0: 37 83 00 14 addi r3,sp,20 800fdb4: f8 00 21 f1 calli 8018578 if ( rc != RC_OK ) 800fdb8: 5c 20 00 0d bne r1,r0,800fdec <== NEVER TAKEN return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 800fdbc: 2d 81 00 06 lhu r1,(r12+6) 800fdc0: 29 62 00 18 lw r2,(r11+24) 800fdc4: b4 41 08 00 add r1,r2,r1 800fdc8: 59 61 00 18 sw (r11+24),r1 fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { save_cln = cur_cln; 800fdcc: b9 a0 08 00 mv r1,r13 return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 800fdd0: 2b 8d 00 14 lw r13,(sp+20) 800fdd4: 29 82 00 10 lw r2,(r12+16) 800fdd8: 29 83 00 14 lw r3,(r12+20) 800fddc: a1 a2 10 00 and r2,r13,r2 800fde0: 54 62 ff f2 bgu r3,r2,800fda8 if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; 800fde4: 59 61 00 3c sw (r11+60),r1 return rc; 800fde8: 34 01 00 00 mvi r1,0 } 800fdec: 2b 9d 00 04 lw ra,(sp+4) 800fdf0: 2b 8b 00 10 lw r11,(sp+16) 800fdf4: 2b 8c 00 0c lw r12,(sp+12) 800fdf8: 2b 8d 00 08 lw r13,(sp+8) 800fdfc: 37 9c 00 14 addi sp,sp,20 800fe00: c3 a0 00 00 ret =============================================================================== 0800f514 : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 800f514: 37 9c ff e0 addi sp,sp,-32 800f518: 5b 8b 00 18 sw (sp+24),r11 800f51c: 5b 8c 00 14 sw (sp+20),r12 800f520: 5b 8d 00 10 sw (sp+16),r13 800f524: 5b 8e 00 0c sw (sp+12),r14 800f528: 5b 8f 00 08 sw (sp+8),r15 800f52c: 5b 9d 00 04 sw (sp+4),ra uint32_t cur_cln = 0; uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; if ( new_length >= fat_fd->fat_file_size ) 800f530: 28 4e 00 18 lw r14,(r2+24) fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 800f534: b8 20 60 00 mv r12,r1 int rc = RC_OK; uint32_t cur_cln = 0; uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 800f538: 34 01 ff ff mvi r1,-1 fat_file_fd_t *fat_fd, uint32_t new_length ) { int rc = RC_OK; uint32_t cur_cln = 0; 800f53c: 5b 80 00 20 sw (sp+32),r0 uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 800f540: 5b 81 00 1c sw (sp+28),r1 fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 800f544: b8 40 58 00 mv r11,r2 uint32_t cur_cln = 0; uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; if ( new_length >= fat_fd->fat_file_size ) 800f548: 50 6e 00 36 bgeu r3,r14,800f620 return rc; assert(fat_fd->fat_file_size); 800f54c: 5d c0 00 09 bne r14,r0,800f570 <== ALWAYS TAKEN 800f550: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 800f554: 78 03 08 02 mvhi r3,0x802 <== NOT EXECUTED 800f558: 78 04 08 02 mvhi r4,0x802 <== NOT EXECUTED 800f55c: 38 21 e6 fc ori r1,r1,0xe6fc <== NOT EXECUTED 800f560: 34 02 02 d1 mvi r2,721 <== NOT EXECUTED 800f564: 38 63 e7 5c ori r3,r3,0xe75c <== NOT EXECUTED 800f568: 38 84 e7 44 ori r4,r4,0xe744 <== NOT EXECUTED 800f56c: f8 00 09 ea calli 8011d14 <__assert_func> <== NOT EXECUTED cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; 800f570: 2d 81 00 06 lhu r1,(r12+6) 800f574: 41 8f 00 08 lbu r15,(r12+8) 800f578: 34 21 ff ff addi r1,r1,-1 800f57c: b4 23 08 00 add r1,r1,r3 800f580: b9 e0 10 00 mv r2,r15 800f584: f8 00 77 b5 calli 802d458 <__lshrsi3> if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 800f588: b9 e0 10 00 mv r2,r15 if ( new_length >= fat_fd->fat_file_size ) return rc; assert(fat_fd->fat_file_size); cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; 800f58c: b8 20 68 00 mv r13,r1 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 800f590: fb ff c7 16 calli 80011e8 <__ashlsi3> return RC_OK; 800f594: 34 04 00 00 mvi r4,0 assert(fat_fd->fat_file_size); cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 800f598: 50 2e 00 23 bgeu r1,r14,800f624 return RC_OK; if (cl_start != 0) 800f59c: 45 a0 00 08 be r13,r0,800f5bc { rc = fat_file_lseek(fs_info, fat_fd, cl_start - 1, &new_last_cln); 800f5a0: 37 84 00 1c addi r4,sp,28 800f5a4: b9 80 08 00 mv r1,r12 800f5a8: b9 60 10 00 mv r2,r11 800f5ac: 35 a3 ff ff addi r3,r13,-1 800f5b0: fb ff fe be calli 800f0a8 800f5b4: b8 20 20 00 mv r4,r1 if (rc != RC_OK) 800f5b8: 5c 20 00 1b bne r1,r0,800f624 <== NEVER TAKEN return rc; } rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 800f5bc: 37 84 00 20 addi r4,sp,32 800f5c0: b9 80 08 00 mv r1,r12 800f5c4: b9 60 10 00 mv r2,r11 800f5c8: b9 a0 18 00 mv r3,r13 800f5cc: fb ff fe b7 calli 800f0a8 800f5d0: b8 20 20 00 mv r4,r1 if (rc != RC_OK) 800f5d4: 5c 20 00 14 bne r1,r0,800f624 <== NEVER TAKEN return rc; rc = fat_free_fat_clusters_chain(fs_info, cur_cln); 800f5d8: 2b 82 00 20 lw r2,(sp+32) 800f5dc: b9 80 08 00 mv r1,r12 800f5e0: f8 00 25 43 calli 8018aec 800f5e4: b8 20 20 00 mv r4,r1 if (rc != RC_OK) 800f5e8: 5c 20 00 0f bne r1,r0,800f624 <== NEVER TAKEN return rc; if (cl_start != 0) 800f5ec: 45 a1 00 0e be r13,r1,800f624 { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); 800f5f0: 2b 82 00 1c lw r2,(sp+28) 800f5f4: b9 80 08 00 mv r1,r12 800f5f8: 34 03 ff ff mvi r3,-1 800f5fc: f8 00 24 6a calli 80187a4 800f600: b8 20 20 00 mv r4,r1 if ( rc != RC_OK ) 800f604: 5c 20 00 08 bne r1,r0,800f624 <== NEVER TAKEN return rc; fat_fd->map.file_cln = cl_start - 1; fat_fd->map.disk_cln = new_last_cln; 800f608: 2b 81 00 1c lw r1,(sp+28) if (cl_start != 0) { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); if ( rc != RC_OK ) return rc; fat_fd->map.file_cln = cl_start - 1; 800f60c: 35 ad ff ff addi r13,r13,-1 800f610: 59 6d 00 34 sw (r11+52),r13 fat_fd->map.disk_cln = new_last_cln; 800f614: 59 61 00 38 sw (r11+56),r1 fat_fd->map.last_cln = new_last_cln; 800f618: 59 61 00 3c sw (r11+60),r1 800f61c: e0 00 00 02 bi 800f624 uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; if ( new_length >= fat_fd->fat_file_size ) return rc; 800f620: 34 04 00 00 mvi r4,0 fat_fd->map.file_cln = cl_start - 1; fat_fd->map.disk_cln = new_last_cln; fat_fd->map.last_cln = new_last_cln; } return RC_OK; } 800f624: b8 80 08 00 mv r1,r4 800f628: 2b 9d 00 04 lw ra,(sp+4) 800f62c: 2b 8b 00 18 lw r11,(sp+24) 800f630: 2b 8c 00 14 lw r12,(sp+20) 800f634: 2b 8d 00 10 lw r13,(sp+16) 800f638: 2b 8e 00 0c lw r14,(sp+12) 800f63c: 2b 8f 00 08 lw r15,(sp+8) 800f640: 37 9c 00 20 addi sp,sp,32 800f644: c3 a0 00 00 ret =============================================================================== 0800fa3c : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 800fa3c: 37 9c ff b8 addi sp,sp,-72 800fa40: 5b 8b 00 40 sw (sp+64),r11 800fa44: 5b 8c 00 3c sw (sp+60),r12 800fa48: 5b 8d 00 38 sw (sp+56),r13 800fa4c: 5b 8e 00 34 sw (sp+52),r14 800fa50: 5b 8f 00 30 sw (sp+48),r15 800fa54: 5b 90 00 2c sw (sp+44),r16 800fa58: 5b 91 00 28 sw (sp+40),r17 800fa5c: 5b 92 00 24 sw (sp+36),r18 800fa60: 5b 93 00 20 sw (sp+32),r19 800fa64: 5b 94 00 1c sw (sp+28),r20 800fa68: 5b 95 00 18 sw (sp+24),r21 800fa6c: 5b 96 00 14 sw (sp+20),r22 800fa70: 5b 97 00 10 sw (sp+16),r23 800fa74: 5b 98 00 0c sw (sp+12),r24 800fa78: 5b 99 00 08 sw (sp+8),r25 800fa7c: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; 800fa80: 5b 80 00 48 sw (sp+72),r0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 800fa84: b8 40 58 00 mv r11,r2 800fa88: b8 60 70 00 mv r14,r3 ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; bool zero_fill = start > fat_fd->fat_file_size; uint32_t file_cln_initial = fat_fd->map.file_cln; 800fa8c: 28 59 00 34 lw r25,(r2+52) int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; bool zero_fill = start > fat_fd->fat_file_size; 800fa90: 28 43 00 18 lw r3,(r2+24) fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 800fa94: b8 20 60 00 mv r12,r1 800fa98: b8 a0 b0 00 mv r22,r5 uint32_t file_cln_initial = fat_fd->map.file_cln; uint32_t cln; if ( count == 0 ) return cmpltd; 800fa9c: 34 02 00 00 mvi r2,0 bool zero_fill = start > fat_fd->fat_file_size; uint32_t file_cln_initial = fat_fd->map.file_cln; uint32_t cln; if ( count == 0 ) 800faa0: 44 80 00 69 be r4,r0,800fc44 <== NEVER TAKEN return cmpltd; if (start >= fat_fd->size_limit) 800faa4: 29 6d 00 14 lw r13,(r11+20) 800faa8: 55 ae 00 06 bgu r13,r14,800fac0 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EFBIG); 800faac: f8 00 2c 6a calli 801ac54 <__errno> <== NOT EXECUTED 800fab0: 34 02 00 1b mvi r2,27 <== NOT EXECUTED 800fab4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800fab8: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 800fabc: e0 00 00 62 bi 800fc44 <== NOT EXECUTED if (count > fat_fd->size_limit - start) 800fac0: c9 ae 68 00 sub r13,r13,r14 if ( count == 0 ) return cmpltd; if (start >= fat_fd->size_limit) rtems_set_errno_and_return_minus_one(EFBIG); 800fac4: 50 8d 00 02 bgeu r4,r13,800facc <== NEVER TAKEN 800fac8: b8 80 68 00 mv r13,r4 if (count > fat_fd->size_limit - start) count = fat_fd->size_limit - start; rc = fat_file_extend(fs_info, fat_fd, zero_fill, start + count, &c); 800facc: b5 ae 78 00 add r15,r13,r14 800fad0: f5 c3 18 00 cmpgu r3,r14,r3 800fad4: b9 60 10 00 mv r2,r11 800fad8: b9 80 08 00 mv r1,r12 800fadc: b9 e0 20 00 mv r4,r15 800fae0: 37 85 00 48 addi r5,sp,72 800fae4: fb ff ff 41 calli 800f7e8 800fae8: b8 20 10 00 mv r2,r1 if (RC_OK == rc) 800faec: 5c 20 00 56 bne r1,r0,800fc44 { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) 800faf0: 2b 81 00 48 lw r1,(sp+72) 800faf4: 44 2f 00 02 be r1,r15,800fafc <== ALWAYS TAKEN count = c - start; 800faf8: c8 2e 68 00 sub r13,r1,r14 <== NOT EXECUTED */ static bool fat_is_fat12_or_fat16_root_dir (const fat_file_fd_t *fat_fd, const uint8_t volume_type) { return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16)); 800fafc: 29 63 00 20 lw r3,(r11+32) 800fb00: 34 01 00 01 mvi r1,1 */ if (c != (start + count)) count = c - start; /* for the root directory of FAT12 and FAT16 we need this special handling */ if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type)) 800fb04: 41 82 00 0e lbu r2,(r12+14) */ static bool fat_is_fat12_or_fat16_root_dir (const fat_file_fd_t *fat_fd, const uint8_t volume_type) { return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16)); 800fb08: 5c 61 00 62 bne r3,r1,800fc90 800fb0c: 29 61 00 24 lw r1,(r11+36) 800fb10: 5c 20 00 60 bne r1,r0,800fc90 <== NEVER TAKEN 800fb14: 20 42 00 03 andi r2,r2,0x3 800fb18: 44 41 00 5e be r2,r1,800fc90 /* for the root directory of FAT12 and FAT16 we need this special handling */ if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type)) { cln = fat_fd->cln; cln += (start >> fs_info->vol.bpc_log2); 800fb1c: 41 82 00 08 lbu r2,(r12+8) 800fb20: b9 c0 08 00 mv r1,r14 count = c - start; /* for the root directory of FAT12 and FAT16 we need this special handling */ if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type)) { cln = fat_fd->cln; 800fb24: 29 6b 00 1c lw r11,(r11+28) cln += (start >> fs_info->vol.bpc_log2); 800fb28: f8 00 76 4c calli 802d458 <__lshrsi3> byte = start & (fs_info->vol.bpc -1); 800fb2c: 2d 83 00 06 lhu r3,(r12+6) /* for the root directory of FAT12 and FAT16 we need this special handling */ if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type)) { cln = fat_fd->cln; cln += (start >> fs_info->vol.bpc_log2); 800fb30: b4 2b 10 00 add r2,r1,r11 byte = start & (fs_info->vol.bpc -1); ret = fat_cluster_write(fs_info, 800fb34: b9 a0 20 00 mv r4,r13 /* for the root directory of FAT12 and FAT16 we need this special handling */ if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type)) { cln = fat_fd->cln; cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); 800fb38: 34 63 ff ff addi r3,r3,-1 ret = fat_cluster_write(fs_info, 800fb3c: b9 80 08 00 mv r1,r12 800fb40: a1 c3 18 00 and r3,r14,r3 800fb44: ba c0 28 00 mv r5,r22 800fb48: 34 06 00 00 mvi r6,0 800fb4c: f8 00 02 6a calli 80104f4 byte, count, buf, false); if (0 > ret) rc = -1; 800fb50: 34 02 ff ff mvi r2,-1 cln, byte, count, buf, false); if (0 > ret) 800fb54: 48 01 00 3c bg r0,r1,800fc44 <== NEVER TAKEN rc = -1; else cmpltd = ret; 800fb58: b8 20 10 00 mv r2,r1 800fb5c: e0 00 00 3a bi 800fc44 int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; uint32_t ofs_cln = start - (start_cln << fs_info->vol.bpc_log2); 800fb60: b9 e0 10 00 mv r2,r15 800fb64: ba 20 08 00 mv r1,r17 800fb68: fb ff c5 a0 calli 80011e8 <__ashlsi3> 800fb6c: c9 c1 70 00 sub r14,r14,r1 bool overwrite_cluster = false; rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); if (RC_OK == rc) { file_cln_cnt = cur_cln - fat_fd->cln; 800fb70: 2b 94 00 44 lw r20,(sp+68) 800fb74: 29 61 00 1c lw r1,(r11+28) int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; uint32_t ofs_cln = start - (start_cln << fs_info->vol.bpc_log2); 800fb78: b9 c0 98 00 mv r19,r14 bool overwrite_cluster = false; rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); if (RC_OK == rc) { file_cln_cnt = cur_cln - fat_fd->cln; 800fb7c: 34 10 00 00 mvi r16,0 800fb80: ca 81 a0 00 sub r20,r20,r1 uint32_t ofs_cln_save = ofs_cln; uint32_t bytes_to_write = count; uint32_t file_cln_cnt; ssize_t ret; uint32_t c; bool overwrite_cluster = false; 800fb84: 34 18 00 00 mvi r24,0 const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ 800fb88: 34 12 00 00 mvi r18,0 const uint32_t count, const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; 800fb8c: 34 0f 00 00 mvi r15,0 800fb90: e0 00 00 1c bi 800fc00 { file_cln_cnt = cur_cln - fat_fd->cln; while ( (RC_OK == rc) && (bytes_to_write > 0)) { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); 800fb94: 2d 84 00 06 lhu r4,(r12+6) 800fb98: c8 93 20 00 sub r4,r4,r19 800fb9c: 51 a4 00 02 bgeu r13,r4,800fba4 800fba0: b9 a0 20 00 mv r4,r13 if (file_cln_initial < file_cln_cnt) 800fba4: 56 99 00 02 bgu r20,r25,800fbac 800fba8: e0 00 00 02 bi 800fbb0 overwrite_cluster = true; 800fbac: 34 18 00 01 mvi r24,1 ret = fat_cluster_write(fs_info, 800fbb0: 2b 82 00 44 lw r2,(sp+68) 800fbb4: b9 80 08 00 mv r1,r12 800fbb8: ba 60 18 00 mv r3,r19 800fbbc: b6 cf 28 00 add r5,r22,r15 800fbc0: bb 00 30 00 mv r6,r24 800fbc4: f8 00 02 4c calli 80104f4 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 800fbc8: 34 10 ff ff mvi r16,-1 800fbcc: 48 01 00 0d bg r0,r1,800fc00 <== NEVER TAKEN rc = -1; if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; 800fbd0: c9 a1 68 00 sub r13,r13,r1 if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 800fbd4: 36 94 00 01 addi r20,r20,1 bytes_to_write -= ret; cmpltd += ret; 800fbd8: b5 e1 78 00 add r15,r15,r1 save_cln = cur_cln; 800fbdc: 2b 92 00 44 lw r18,(sp+68) if (0 < bytes_to_write) 800fbe0: 34 10 00 00 mvi r16,0 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ofs_cln = 0; 800fbe4: 34 13 00 00 mvi r19,0 { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) 800fbe8: 45 a0 00 06 be r13,r0,800fc00 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 800fbec: b9 80 08 00 mv r1,r12 800fbf0: ba 40 10 00 mv r2,r18 800fbf4: ba a0 18 00 mv r3,r21 800fbf8: f8 00 22 60 calli 8018578 800fbfc: b8 20 80 00 mv r16,r1 rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); if (RC_OK == rc) { file_cln_cnt = cur_cln - fat_fd->cln; while ( (RC_OK == rc) && (bytes_to_write > 0)) 800fc00: 7d b7 00 00 cmpnei r23,r13,0 rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); if (RC_OK == rc) { file_cln_cnt = cur_cln - fat_fd->cln; while ( (RC_OK == rc) 800fc04: 66 01 00 00 cmpei r1,r16,0 800fc08: a2 e1 b8 00 and r23,r23,r1 800fc0c: 5e e0 ff e2 bne r23,r0,800fb94 } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); 800fc10: 41 82 00 08 lbu r2,(r12+8) 800fc14: 35 ce ff ff addi r14,r14,-1 800fc18: b5 cf 08 00 add r1,r14,r15 800fc1c: f8 00 76 0f calli 802d458 <__lshrsi3> } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 800fc20: b4 31 08 00 add r1,r1,r17 800fc24: 59 61 00 34 sw (r11+52),r1 ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; 800fc28: 59 72 00 38 sw (r11+56),r18 } if (RC_OK != rc) 800fc2c: ba 00 30 00 mv r6,r16 800fc30: 5e 17 00 02 bne r16,r23,800fc38 <== NEVER TAKEN return rc; else return cmpltd; 800fc34: b9 e0 30 00 mv r6,r15 start, count, buf, file_cln_initial); if (0 > ret) rc = -1; 800fc38: 34 02 ff ff mvi r2,-1 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 800fc3c: 48 06 00 02 bg r0,r6,800fc44 <== NEVER TAKEN rc = -1; else cmpltd = ret; 800fc40: b8 c0 10 00 mv r2,r6 } if (RC_OK != rc) return rc; else return cmpltd; } 800fc44: b8 40 08 00 mv r1,r2 800fc48: 2b 9d 00 04 lw ra,(sp+4) 800fc4c: 2b 8b 00 40 lw r11,(sp+64) 800fc50: 2b 8c 00 3c lw r12,(sp+60) 800fc54: 2b 8d 00 38 lw r13,(sp+56) 800fc58: 2b 8e 00 34 lw r14,(sp+52) 800fc5c: 2b 8f 00 30 lw r15,(sp+48) 800fc60: 2b 90 00 2c lw r16,(sp+44) 800fc64: 2b 91 00 28 lw r17,(sp+40) 800fc68: 2b 92 00 24 lw r18,(sp+36) 800fc6c: 2b 93 00 20 lw r19,(sp+32) 800fc70: 2b 94 00 1c lw r20,(sp+28) 800fc74: 2b 95 00 18 lw r21,(sp+24) 800fc78: 2b 96 00 14 lw r22,(sp+20) 800fc7c: 2b 97 00 10 lw r23,(sp+16) 800fc80: 2b 98 00 0c lw r24,(sp+12) 800fc84: 2b 99 00 08 lw r25,(sp+8) 800fc88: 37 9c 00 48 addi sp,sp,72 800fc8c: c3 a0 00 00 ret { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; 800fc90: 41 8f 00 08 lbu r15,(r12+8) 800fc94: b9 c0 08 00 mv r1,r14 const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 800fc98: 5b 80 00 44 sw (sp+68),r0 uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; 800fc9c: b9 e0 10 00 mv r2,r15 800fca0: f8 00 75 ee calli 802d458 <__lshrsi3> 800fca4: b8 20 88 00 mv r17,r1 uint32_t file_cln_cnt; ssize_t ret; uint32_t c; bool overwrite_cluster = false; rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); 800fca8: 37 95 00 44 addi r21,sp,68 800fcac: b9 80 08 00 mv r1,r12 800fcb0: b9 60 10 00 mv r2,r11 800fcb4: ba 20 18 00 mv r3,r17 800fcb8: ba a0 20 00 mv r4,r21 800fcbc: fb ff fc fb calli 800f0a8 800fcc0: b8 20 30 00 mv r6,r1 if (RC_OK == rc) 800fcc4: 44 20 ff a7 be r1,r0,800fb60 <== ALWAYS TAKEN 800fcc8: e3 ff ff dc bi 800fc38 <== NOT EXECUTED =============================================================================== 08018aec : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 8018aec: 37 9c ff e0 addi sp,sp,-32 8018af0: 5b 8b 00 1c sw (sp+28),r11 8018af4: 5b 8c 00 18 sw (sp+24),r12 8018af8: 5b 8d 00 14 sw (sp+20),r13 8018afc: 5b 8e 00 10 sw (sp+16),r14 8018b00: 5b 8f 00 0c sw (sp+12),r15 8018b04: 5b 90 00 08 sw (sp+8),r16 8018b08: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; 8018b0c: 34 0d 00 00 mvi r13,0 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 8018b10: b8 20 58 00 mv r11,r1 8018b14: b8 40 80 00 mv r16,r2 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 8018b18: 5b 80 00 20 sw (sp+32),r0 fat_fs_info_t *fs_info, uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; 8018b1c: b8 40 70 00 mv r14,r2 fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; 8018b20: 34 0f 00 00 mvi r15,0 uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8018b24: e0 00 00 17 bi 8018b80 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 8018b28: b9 60 08 00 mv r1,r11 8018b2c: b9 c0 10 00 mv r2,r14 8018b30: 37 83 00 20 addi r3,sp,32 8018b34: fb ff fe 91 calli 8018578 8018b38: b8 20 60 00 mv r12,r1 if ( rc != RC_OK ) 8018b3c: 44 20 00 09 be r1,r0,8018b60 <== ALWAYS TAKEN { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8018b40: 29 61 00 44 lw r1,(r11+68) <== NOT EXECUTED 8018b44: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8018b48: 44 22 00 03 be r1,r2,8018b54 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 8018b4c: b5 a1 68 00 add r13,r13,r1 <== NOT EXECUTED 8018b50: 59 6d 00 44 sw (r11+68),r13 <== NOT EXECUTED fat_buf_release(fs_info); 8018b54: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8018b58: fb ff dc cb calli 800fe84 <== NOT EXECUTED return rc; 8018b5c: e0 00 00 16 bi 8018bb4 <== NOT EXECUTED } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 8018b60: b9 60 08 00 mv r1,r11 8018b64: b9 c0 10 00 mv r2,r14 8018b68: 34 03 00 00 mvi r3,0 8018b6c: fb ff ff 0e calli 80187a4 if ( rc != RC_OK ) 8018b70: 44 2c 00 02 be r1,r12,8018b78 <== ALWAYS TAKEN 8018b74: b8 20 78 00 mv r15,r1 <== NOT EXECUTED rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; 8018b78: 2b 8e 00 20 lw r14,(sp+32) rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) rc1 = rc; freed_cls_cnt++; 8018b7c: 35 ad 00 01 addi r13,r13,1 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8018b80: 29 61 00 10 lw r1,(r11+16) 8018b84: 29 62 00 14 lw r2,(r11+20) 8018b88: a1 c1 08 00 and r1,r14,r1 8018b8c: 54 41 ff e7 bgu r2,r1,8018b28 freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8018b90: 29 61 00 44 lw r1,(r11+68) freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; 8018b94: 59 70 00 4c sw (r11+76),r16 if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8018b98: 34 02 ff ff mvi r2,-1 8018b9c: 44 22 00 03 be r1,r2,8018ba8 <== ALWAYS TAKEN fs_info->vol.free_cls += freed_cls_cnt; 8018ba0: b5 a1 68 00 add r13,r13,r1 <== NOT EXECUTED 8018ba4: 59 6d 00 44 sw (r11+68),r13 <== NOT EXECUTED fat_buf_release(fs_info); 8018ba8: b9 60 08 00 mv r1,r11 8018bac: fb ff dc b6 calli 800fe84 8018bb0: b9 e0 60 00 mv r12,r15 if (rc1 != RC_OK) return rc1; return RC_OK; } 8018bb4: b9 80 08 00 mv r1,r12 8018bb8: 2b 9d 00 04 lw ra,(sp+4) 8018bbc: 2b 8b 00 1c lw r11,(sp+28) 8018bc0: 2b 8c 00 18 lw r12,(sp+24) 8018bc4: 2b 8d 00 14 lw r13,(sp+20) 8018bc8: 2b 8e 00 10 lw r14,(sp+16) 8018bcc: 2b 8f 00 0c lw r15,(sp+12) 8018bd0: 2b 90 00 08 lw r16,(sp+8) 8018bd4: 37 9c 00 20 addi sp,sp,32 8018bd8: c3 a0 00 00 ret =============================================================================== 080112d0 : void fat_free_unique_ino( fat_fs_info_t *fs_info, uint32_t ino ) { 80112d0: 37 9c ff f4 addi sp,sp,-12 <== NOT EXECUTED 80112d4: 5b 8b 00 0c sw (sp+12),r11 <== NOT EXECUTED 80112d8: 5b 8c 00 08 sw (sp+8),r12 <== NOT EXECUTED 80112dc: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED FAT_SET_UNIQ_INO_FREE((ino - fs_info->uino_base), fs_info->uino); 80112e0: 28 2c 00 80 lw r12,(r1+128) <== NOT EXECUTED void fat_free_unique_ino( fat_fs_info_t *fs_info, uint32_t ino ) { 80112e4: b8 20 58 00 mv r11,r1 <== NOT EXECUTED FAT_SET_UNIQ_INO_FREE((ino - fs_info->uino_base), fs_info->uino); 80112e8: c8 4c 60 00 sub r12,r2,r12 <== NOT EXECUTED 80112ec: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 80112f0: 34 02 00 03 mvi r2,3 <== NOT EXECUTED 80112f4: f8 00 70 59 calli 802d458 <__lshrsi3> <== NOT EXECUTED 80112f8: 29 6b 00 74 lw r11,(r11+116) <== NOT EXECUTED 80112fc: 21 82 00 07 andi r2,r12,0x7 <== NOT EXECUTED 8011300: b5 61 58 00 add r11,r11,r1 <== NOT EXECUTED 8011304: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8011308: fb ff bf b8 calli 80011e8 <__ashlsi3> <== NOT EXECUTED 801130c: 41 62 00 00 lbu r2,(r11+0) <== NOT EXECUTED 8011310: a4 20 08 00 not r1,r1 <== NOT EXECUTED 8011314: a0 22 08 00 and r1,r1,r2 <== NOT EXECUTED 8011318: 31 61 00 00 sb (r11+0),r1 <== NOT EXECUTED } 801131c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8011320: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED 8011324: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED 8011328: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 801132c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08018578 : fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 8018578: 37 9c ff dc addi sp,sp,-36 801857c: 5b 8b 00 20 sw (sp+32),r11 8018580: 5b 8c 00 1c sw (sp+28),r12 8018584: 5b 8d 00 18 sw (sp+24),r13 8018588: 5b 8e 00 14 sw (sp+20),r14 801858c: 5b 8f 00 10 sw (sp+16),r15 8018590: 5b 90 00 0c sw (sp+12),r16 8018594: 5b 91 00 08 sw (sp+8),r17 8018598: 5b 9d 00 04 sw (sp+4),ra 801859c: b8 20 68 00 mv r13,r1 uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 80185a0: 34 01 00 01 mvi r1,1 fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 80185a4: b8 40 60 00 mv r12,r2 80185a8: b8 60 58 00 mv r11,r3 uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 80185ac: 50 22 00 6d bgeu r1,r2,8018760 <== NEVER TAKEN 80185b0: 29 a1 00 38 lw r1,(r13+56) 80185b4: 34 21 00 01 addi r1,r1,1 80185b8: 50 22 00 02 bgeu r1,r2,80185c0 <== ALWAYS TAKEN 80185bc: e0 00 00 69 bi 8018760 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 80185c0: 41 af 00 0e lbu r15,(r13+14) 80185c4: 21 ee 00 01 andi r14,r15,0x1 80185c8: 45 c0 00 06 be r14,r0,80185e0 80185cc: b8 40 08 00 mv r1,r2 80185d0: 34 02 00 01 mvi r2,1 80185d4: f8 00 53 a1 calli 802d458 <__lshrsi3> 80185d8: b4 2c 08 00 add r1,r1,r12 80185dc: e0 00 00 09 bi 8018600 80185e0: 21 e1 00 02 andi r1,r15,0x2 80185e4: 44 2e 00 04 be r1,r14,80185f4 80185e8: b8 40 08 00 mv r1,r2 80185ec: 34 02 00 01 mvi r2,1 80185f0: e0 00 00 03 bi 80185fc 80185f4: b8 40 08 00 mv r1,r2 80185f8: 34 02 00 02 mvi r2,2 80185fc: fb ff a2 fb calli 80011e8 <__ashlsi3> 8018600: 41 a2 00 02 lbu r2,(r13+2) 8018604: f8 00 53 95 calli 802d458 <__lshrsi3> 8018608: 29 b0 00 58 lw r16,(r13+88) 801860c: b4 30 80 00 add r16,r1,r16 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 8018610: 45 c0 00 06 be r14,r0,8018628 8018614: b9 80 08 00 mv r1,r12 8018618: 34 02 00 01 mvi r2,1 801861c: f8 00 53 8f calli 802d458 <__lshrsi3> 8018620: b4 2c 78 00 add r15,r1,r12 8018624: e0 00 00 09 bi 8018648 8018628: 21 ef 00 02 andi r15,r15,0x2 801862c: b9 80 08 00 mv r1,r12 8018630: 34 02 00 01 mvi r2,1 8018634: 5d ee 00 03 bne r15,r14,8018640 8018638: b9 80 08 00 mv r1,r12 801863c: 34 02 00 02 mvi r2,2 8018640: fb ff a2 ea calli 80011e8 <__ashlsi3> 8018644: b8 20 78 00 mv r15,r1 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 8018648: b9 a0 08 00 mv r1,r13 801864c: ba 00 10 00 mv r2,r16 8018650: 34 03 00 01 mvi r3,1 8018654: 37 84 00 24 addi r4,sp,36 if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 8018658: 2d b1 00 00 lhu r17,(r13+0) rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 801865c: fb ff de 88 calli 801007c 8018660: b8 20 70 00 mv r14,r1 if (rc != RC_OK) 8018664: 5c 20 00 45 bne r1,r0,8018778 <== NEVER TAKEN return rc; switch ( fs_info->vol.type ) 8018668: 41 a4 00 0e lbu r4,(r13+14) if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 801866c: 36 23 ff ff addi r3,r17,-1 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 8018670: 34 01 00 02 mvi r1,2 if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 8018674: a1 e3 18 00 and r3,r15,r3 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 8018678: 44 81 00 27 be r4,r1,8018714 801867c: 34 01 00 04 mvi r1,4 8018680: 44 81 00 32 be r4,r1,8018748 8018684: 34 01 00 01 mvi r1,1 8018688: 5c 81 00 36 bne r4,r1,8018760 <== NEVER TAKEN case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 801868c: 2b 84 00 24 lw r4,(sp+36) if ( ofs == (fs_info->vol.bps - 1) ) 8018690: 2d a1 00 00 lhu r1,(r13+0) case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 8018694: b4 83 20 00 add r4,r4,r3 8018698: 40 8f 00 00 lbu r15,(r4+0) if ( ofs == (fs_info->vol.bps - 1) ) 801869c: 34 21 ff ff addi r1,r1,-1 case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 80186a0: 59 6f 00 00 sw (r11+0),r15 if ( ofs == (fs_info->vol.bps - 1) ) 80186a4: 5c 61 00 0e bne r3,r1,80186dc <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 80186a8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 80186ac: 36 02 00 01 addi r2,r16,1 <== NOT EXECUTED 80186b0: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 80186b4: 37 84 00 24 addi r4,sp,36 <== NOT EXECUTED 80186b8: fb ff de 71 calli 801007c <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 80186bc: 5c 20 00 2e bne r1,r0,8018774 <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; 80186c0: 2b 81 00 24 lw r1,(sp+36) <== NOT EXECUTED 80186c4: 34 02 00 08 mvi r2,8 <== NOT EXECUTED 80186c8: 40 21 00 00 lbu r1,(r1+0) <== NOT EXECUTED 80186cc: fb ff a2 c7 calli 80011e8 <__ashlsi3> <== NOT EXECUTED 80186d0: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED 80186d4: b8 41 08 00 or r1,r2,r1 <== NOT EXECUTED 80186d8: e0 00 00 05 bi 80186ec <== NOT EXECUTED } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 80186dc: 40 81 00 01 lbu r1,(r4+1) 80186e0: 34 02 00 08 mvi r2,8 80186e4: fb ff a2 c1 calli 80011e8 <__ashlsi3> 80186e8: b8 2f 08 00 or r1,r1,r15 80186ec: 59 61 00 00 sw (r11+0),r1 } if ( FAT_CLUSTER_IS_ODD(cln) ) 80186f0: 21 8c 00 01 andi r12,r12,0x1 80186f4: 45 80 00 05 be r12,r0,8018708 *ret_val = (*ret_val) >> FAT12_SHIFT; 80186f8: 29 61 00 00 lw r1,(r11+0) 80186fc: 34 02 00 04 mvi r2,4 8018700: f8 00 53 56 calli 802d458 <__lshrsi3> 8018704: e0 00 00 15 bi 8018758 else *ret_val = (*ret_val) & FAT_FAT12_MASK; 8018708: 29 61 00 00 lw r1,(r11+0) 801870c: 20 21 0f ff andi r1,r1,0xfff 8018710: e0 00 00 12 bi 8018758 break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 8018714: 2b 81 00 24 lw r1,(sp+36) * @param[in] value is the value to be swapped * @return the value after being endian swapped */ static inline uint16_t CPU_swap_u16(uint16_t v) { return v << 8 | v >> 8; 8018718: 34 02 00 08 mvi r2,8 801871c: b4 23 18 00 add r3,r1,r3 8018720: 2c 6c 00 00 lhu r12,(r3+0) 8018724: b9 80 08 00 mv r1,r12 8018728: fb ff a2 b0 calli 80011e8 <__ashlsi3> 801872c: b8 20 68 00 mv r13,r1 8018730: 34 02 00 08 mvi r2,8 8018734: b9 80 08 00 mv r1,r12 8018738: f8 00 53 48 calli 802d458 <__lshrsi3> 801873c: b9 a1 08 00 or r1,r13,r1 *ret_val = CF_LE_W(*ret_val); 8018740: 20 21 ff ff andi r1,r1,0xffff 8018744: e0 00 00 05 bi 8018758 break; case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); 8018748: 2b 81 00 24 lw r1,(sp+36) 801874c: b4 23 18 00 add r3,r1,r3 *ret_val = CF_LE_L(*ret_val); 8018750: 28 61 00 00 lw r1,(r3+0) 8018754: fb ff ff 69 calli 80184f8 8018758: 59 61 00 00 sw (r11+0),r1 break; 801875c: e0 00 00 07 bi 8018778 default: rtems_set_errno_and_return_minus_one(EIO); 8018760: f8 00 09 3d calli 801ac54 <__errno> <== NOT EXECUTED 8018764: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8018768: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 801876c: 34 0e ff ff mvi r14,-1 <== NOT EXECUTED 8018770: e0 00 00 02 bi 8018778 <== NOT EXECUTED *ret_val = (*(sec_buf + ofs)); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) 8018774: b8 20 70 00 mv r14,r1 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } 8018778: b9 c0 08 00 mv r1,r14 801877c: 2b 9d 00 04 lw ra,(sp+4) 8018780: 2b 8b 00 20 lw r11,(sp+32) 8018784: 2b 8c 00 1c lw r12,(sp+28) 8018788: 2b 8d 00 18 lw r13,(sp+24) 801878c: 2b 8e 00 14 lw r14,(sp+20) 8018790: 2b 8f 00 10 lw r15,(sp+16) 8018794: 2b 90 00 0c lw r16,(sp+12) 8018798: 2b 91 00 08 lw r17,(sp+8) 801879c: 37 9c 00 24 addi sp,sp,36 80187a0: c3 a0 00 00 ret =============================================================================== 080111b0 : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 80111b0: 37 9c ff dc addi sp,sp,-36 <== NOT EXECUTED 80111b4: 5b 8b 00 24 sw (sp+36),r11 <== NOT EXECUTED 80111b8: 5b 8c 00 20 sw (sp+32),r12 <== NOT EXECUTED 80111bc: 5b 8d 00 1c sw (sp+28),r13 <== NOT EXECUTED 80111c0: 5b 8e 00 18 sw (sp+24),r14 <== NOT EXECUTED 80111c4: 5b 8f 00 14 sw (sp+20),r15 <== NOT EXECUTED 80111c8: 5b 90 00 10 sw (sp+16),r16 <== NOT EXECUTED 80111cc: 5b 91 00 0c sw (sp+12),r17 <== NOT EXECUTED 80111d0: 5b 92 00 08 sw (sp+8),r18 <== NOT EXECUTED 80111d4: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 80111d8: b8 20 58 00 mv r11,r1 <== NOT EXECUTED fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) fs_info->index = 0; } if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) 80111dc: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 80111e0: 38 21 e7 70 ori r1,r1,0xe770 <== NOT EXECUTED 80111e4: 28 32 00 00 lw r18,(r1+0) <== NOT EXECUTED fat_get_unique_ino(fat_fs_info_t *fs_info) { uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) 80111e8: e0 00 00 2b bi 8011294 <== NOT EXECUTED { for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 80111ec: 29 6e 00 78 lw r14,(r11+120) <== NOT EXECUTED 80111f0: 34 02 00 03 mvi r2,3 <== NOT EXECUTED 80111f4: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 80111f8: f8 00 70 98 calli 802d458 <__lshrsi3> <== NOT EXECUTED 80111fc: 29 6f 00 74 lw r15,(r11+116) <== NOT EXECUTED 8011200: 21 d1 00 07 andi r17,r14,0x7 <== NOT EXECUTED 8011204: ba 20 10 00 mv r2,r17 <== NOT EXECUTED 8011208: b5 e1 78 00 add r15,r15,r1 <== NOT EXECUTED 801120c: 41 f0 00 00 lbu r16,(r15+0) <== NOT EXECUTED 8011210: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 8011214: fb ff c0 1c calli 8001284 <__ashrsi3> <== NOT EXECUTED 8011218: 20 21 00 01 andi r1,r1,0x1 <== NOT EXECUTED 801121c: 5c 20 00 0a bne r1,r0,8011244 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); 8011220: ba 20 10 00 mv r2,r17 <== NOT EXECUTED 8011224: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8011228: fb ff bf f0 calli 80011e8 <__ashlsi3> <== NOT EXECUTED 801122c: b8 30 08 00 or r1,r1,r16 <== NOT EXECUTED 8011230: 31 e1 00 00 sb (r15+0),r1 <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 8011234: 29 62 00 78 lw r2,(r11+120) <== NOT EXECUTED 8011238: 29 61 00 80 lw r1,(r11+128) <== NOT EXECUTED 801123c: b4 41 08 00 add r1,r2,r1 <== NOT EXECUTED 8011240: e0 00 00 19 bi 80112a4 <== NOT EXECUTED } fs_info->index++; 8011244: 35 ce 00 01 addi r14,r14,1 <== NOT EXECUTED 8011248: 59 6e 00 78 sw (r11+120),r14 <== NOT EXECUTED if (fs_info->index >= fs_info->uino_pool_size) 801124c: 55 ae 00 02 bgu r13,r14,8011254 <== NOT EXECUTED fs_info->index = 0; 8011250: 59 60 00 78 sw (r11+120),r0 <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 8011254: 35 8c 00 01 addi r12,r12,1 <== NOT EXECUTED 8011258: 55 ac ff e5 bgu r13,r12,80111ec <== NOT EXECUTED fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) fs_info->index = 0; } if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) 801125c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8011260: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8011264: fb ff bf e1 calli 80011e8 <__ashlsi3> <== NOT EXECUTED 8011268: b8 20 10 00 mv r2,r1 <== NOT EXECUTED 801126c: 29 61 00 80 lw r1,(r11+128) <== NOT EXECUTED 8011270: ca 41 08 00 sub r1,r18,r1 <== NOT EXECUTED 8011274: 50 41 00 0b bgeu r2,r1,80112a0 <== NOT EXECUTED { fs_info->uino_pool_size <<= 1; fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); 8011278: 29 61 00 74 lw r1,(r11+116) <== NOT EXECUTED fs_info->index = 0; } if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) { fs_info->uino_pool_size <<= 1; 801127c: 59 62 00 7c sw (r11+124),r2 <== NOT EXECUTED fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); 8011280: fb ff cb d1 calli 80041c4 <== NOT EXECUTED 8011284: 59 61 00 74 sw (r11+116),r1 <== NOT EXECUTED if (fs_info->uino != NULL) 8011288: 44 20 00 06 be r1,r0,80112a0 <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; 801128c: 29 61 00 7c lw r1,(r11+124) <== NOT EXECUTED 8011290: 59 61 00 78 sw (r11+120),r1 <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 8011294: 29 6d 00 7c lw r13,(r11+124) <== NOT EXECUTED 8011298: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED 801129c: e3 ff ff ef bi 8011258 <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 80112a0: 34 01 00 00 mvi r1,0 <== NOT EXECUTED } 80112a4: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80112a8: 2b 8b 00 24 lw r11,(sp+36) <== NOT EXECUTED 80112ac: 2b 8c 00 20 lw r12,(sp+32) <== NOT EXECUTED 80112b0: 2b 8d 00 1c lw r13,(sp+28) <== NOT EXECUTED 80112b4: 2b 8e 00 18 lw r14,(sp+24) <== NOT EXECUTED 80112b8: 2b 8f 00 14 lw r15,(sp+20) <== NOT EXECUTED 80112bc: 2b 90 00 10 lw r16,(sp+16) <== NOT EXECUTED 80112c0: 2b 91 00 0c lw r17,(sp+12) <== NOT EXECUTED 80112c4: 2b 92 00 08 lw r18,(sp+8) <== NOT EXECUTED 80112c8: 37 9c 00 24 addi sp,sp,36 <== NOT EXECUTED 80112cc: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08011138 : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 8011138: 37 9c ff f4 addi sp,sp,-12 801113c: 5b 8b 00 08 sw (sp+8),r11 8011140: 5b 9d 00 04 sw (sp+4),ra 8011144: b8 20 58 00 mv r11,r1 int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 8011148: 5b 82 00 0c sw (sp+12),r2 while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 801114c: e0 00 00 0d bi 8011180 { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 8011150: 2d 64 00 06 lhu r4,(r11+6) 8011154: b9 60 08 00 mv r1,r11 8011158: 34 03 00 00 mvi r3,0 801115c: 34 05 00 00 mvi r5,0 8011160: fb ff fc 75 calli 8010334 if ( ret != fs_info->vol.bpc ) 8011164: 2d 62 00 06 lhu r2,(r11+6) 8011168: 5c 22 00 0d bne r1,r2,801119c <== NEVER TAKEN { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 801116c: 2b 82 00 0c lw r2,(sp+12) 8011170: b9 60 08 00 mv r1,r11 8011174: 37 83 00 0c addi r3,sp,12 8011178: f8 00 1d 00 calli 8018578 if ( rc != RC_OK ) 801117c: 5c 20 00 09 bne r1,r0,80111a0 <== NEVER TAKEN { int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8011180: 2b 82 00 0c lw r2,(sp+12) 8011184: 29 61 00 10 lw r1,(r11+16) 8011188: 29 63 00 14 lw r3,(r11+20) 801118c: a0 41 08 00 and r1,r2,r1 8011190: 54 61 ff f0 bgu r3,r1,8011150 return rc; } } return rc; 8011194: 34 01 00 00 mvi r1,0 8011198: e0 00 00 02 bi 80111a0 while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); if ( ret != fs_info->vol.bpc ) { return -1; 801119c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED } } return rc; } 80111a0: 2b 9d 00 04 lw ra,(sp+4) 80111a4: 2b 8b 00 08 lw r11,(sp+8) 80111a8: 37 9c 00 0c addi sp,sp,12 80111ac: c3 a0 00 00 ret =============================================================================== 080106c4 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_init_volume_info(fat_fs_info_t *fs_info, const char *device) { 80106c4: 37 9c ff 24 addi sp,sp,-220 80106c8: 5b 8b 00 44 sw (sp+68),r11 80106cc: 5b 8c 00 40 sw (sp+64),r12 80106d0: 5b 8d 00 3c sw (sp+60),r13 80106d4: 5b 8e 00 38 sw (sp+56),r14 80106d8: 5b 8f 00 34 sw (sp+52),r15 80106dc: 5b 90 00 30 sw (sp+48),r16 80106e0: 5b 91 00 2c sw (sp+44),r17 80106e4: 5b 92 00 28 sw (sp+40),r18 80106e8: 5b 93 00 24 sw (sp+36),r19 80106ec: 5b 94 00 20 sw (sp+32),r20 80106f0: 5b 95 00 1c sw (sp+28),r21 80106f4: 5b 96 00 18 sw (sp+24),r22 80106f8: 5b 97 00 14 sw (sp+20),r23 80106fc: 5b 98 00 10 sw (sp+16),r24 8010700: 5b 99 00 0c sw (sp+12),r25 8010704: 5b 9b 00 08 sw (sp+8),fp 8010708: 5b 9d 00 04 sw (sp+4),ra 801070c: b8 20 78 00 mv r15,r1 ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; vol->fd = open(device, O_RDWR); 8010710: b8 40 08 00 mv r1,r2 8010714: 34 02 00 02 mvi r2,2 char boot_rec[FAT_MAX_BPB_SIZE]; char fs_info_sector[FAT_USEFUL_INFO_SIZE]; ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; 8010718: 5b 80 00 dc sw (sp+220),r0 vol->fd = open(device, O_RDWR); 801071c: fb ff ce 02 calli 8003f24 8010720: 59 e1 00 60 sw (r15+96),r1 if (vol->fd < 0) 8010724: 4c 20 00 02 bge r1,r0,801072c <== ALWAYS TAKEN 8010728: e0 00 00 06 bi 8010740 <== NOT EXECUTED { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); 801072c: 37 82 00 88 addi r2,sp,136 8010730: fb ff ca 55 calli 8003084 if (rc != 0) 8010734: 44 20 00 08 be r1,r0,8010754 <== ALWAYS TAKEN { close(vol->fd); 8010738: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 801073c: fb ff c9 f9 calli 8002f20 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 8010740: f8 00 29 45 calli 801ac54 <__errno> <== NOT EXECUTED 8010744: 34 02 00 06 mvi r2,6 <== NOT EXECUTED 8010748: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 801074c: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8010750: e0 00 01 eb bi 8010efc <== NOT EXECUTED } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) 8010754: 2b 84 00 94 lw r4,(sp+148) 8010758: 29 e2 00 60 lw r2,(r15+96) 801075c: 34 03 60 00 mvi r3,24576 8010760: 20 84 f0 00 andi r4,r4,0xf000 { close(vol->fd); 8010764: b8 40 08 00 mv r1,r2 close(vol->fd); rtems_set_errno_and_return_minus_one(ENXIO); } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) 8010768: 5c 83 ff f5 bne r4,r3,801073c <== NEVER TAKEN static inline int rtems_disk_fd_get_disk_device( int fd, rtems_disk_device **dd_ptr ) { return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr); 801076c: 78 03 08 02 mvhi r3,0x802 8010770: 38 63 e6 74 ori r3,r3,0xe674 8010774: b8 40 08 00 mv r1,r2 8010778: 28 62 00 00 lw r2,(r3+0) 801077c: 35 e3 00 64 addi r3,r15,100 8010780: f8 00 06 20 calli 8012000 8010784: b8 20 58 00 mv r11,r1 rtems_set_errno_and_return_minus_one(ENXIO); } /* check that device is registred as block device and lock it */ rc = rtems_disk_fd_get_disk_device(vol->fd, &vol->dd); if (rc != 0) { 8010788: 5c 20 ff ec bne r1,r0,8010738 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(ENXIO); } /* Read boot record */ /* FIXME: Asserts FAT_MAX_BPB_SIZE < bdbuf block size */ sc = rtems_bdbuf_read( vol->dd, 0, &block); 801078c: 29 e1 00 64 lw r1,(r15+100) 8010790: 34 02 00 00 mvi r2,0 8010794: 37 83 00 dc addi r3,sp,220 8010798: fb ff f4 bd calli 800da8c 801079c: b8 20 70 00 mv r14,r1 if (sc != RTEMS_SUCCESSFUL) 80107a0: 5c 2b 00 33 bne r1,r11,801086c <== NEVER TAKEN { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 80107a4: 2b 8a 00 dc lw r10,(sp+220) 80107a8: 29 43 00 1c lw r3,(r10+28) 80107ac: 40 61 00 13 lbu r1,(r3+19) 80107b0: 40 72 00 0b lbu r18,(r3+11) 80107b4: 40 71 00 0c lbu r17,(r3+12) 80107b8: 40 73 00 0d lbu r19,(r3+13) 80107bc: 40 76 00 0e lbu r22,(r3+14) 80107c0: 40 75 00 0f lbu r21,(r3+15) 80107c4: 40 74 00 10 lbu r20,(r3+16) 80107c8: 40 78 00 11 lbu r24,(r3+17) 80107cc: 40 77 00 12 lbu r23,(r3+18) 80107d0: 5b 81 00 6c sw (sp+108),r1 80107d4: 40 62 00 14 lbu r2,(r3+20) 80107d8: 5b 82 00 70 sw (sp+112),r2 80107dc: 40 61 00 16 lbu r1,(r3+22) 80107e0: 5b 81 00 74 sw (sp+116),r1 80107e4: 40 62 00 17 lbu r2,(r3+23) 80107e8: 5b 82 00 78 sw (sp+120),r2 80107ec: 40 61 00 21 lbu r1,(r3+33) 80107f0: 40 6c 00 20 lbu r12,(r3+32) 80107f4: 5b 81 00 7c sw (sp+124),r1 80107f8: 40 62 00 22 lbu r2,(r3+34) 80107fc: 5b 82 00 80 sw (sp+128),r2 8010800: 40 61 00 23 lbu r1,(r3+35) 8010804: 5b 81 00 84 sw (sp+132),r1 8010808: 40 62 00 25 lbu r2,(r3+37) 801080c: 40 6d 00 24 lbu r13,(r3+36) 8010810: 5b 82 00 5c sw (sp+92),r2 8010814: 40 61 00 26 lbu r1,(r3+38) 8010818: 5b 81 00 60 sw (sp+96),r1 801081c: 40 62 00 27 lbu r2,(r3+39) 8010820: 5b 82 00 64 sw (sp+100),r2 8010824: 40 61 00 28 lbu r1,(r3+40) 8010828: 5b 81 00 68 sw (sp+104),r1 801082c: 40 62 00 29 lbu r2,(r3+41) 8010830: 5b 82 00 54 sw (sp+84),r2 8010834: 40 61 00 2c lbu r1,(r3+44) 8010838: 5b 81 00 58 sw (sp+88),r1 801083c: 40 62 00 2d lbu r2,(r3+45) 8010840: 5b 82 00 4c sw (sp+76),r2 8010844: 40 61 00 2e lbu r1,(r3+46) 8010848: 5b 81 00 50 sw (sp+80),r1 801084c: 40 62 00 2f lbu r2,(r3+47) sc = rtems_bdbuf_release( block); 8010850: b9 40 08 00 mv r1,r10 { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 8010854: 5b 82 00 48 sw (sp+72),r2 8010858: 40 7b 00 30 lbu fp,(r3+48) 801085c: 40 79 00 31 lbu r25,(r3+49) sc = rtems_bdbuf_release( block); 8010860: fb ff f5 15 calli 800dcb4 8010864: b8 20 80 00 mv r16,r1 if (sc != RTEMS_SUCCESSFUL) 8010868: 44 2e 00 06 be r1,r14,8010880 <== ALWAYS TAKEN { close(vol->fd); 801086c: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010870: fb ff c9 ac calli 8002f20 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 8010874: f8 00 28 f8 calli 801ac54 <__errno> <== NOT EXECUTED 8010878: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 801087c: e3 ff ff b3 bi 8010748 <== NOT EXECUTED } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 8010880: ba 20 08 00 mv r1,r17 8010884: 34 02 00 08 mvi r2,8 8010888: fb ff c2 58 calli 80011e8 <__ashlsi3> 801088c: b8 32 48 00 or r9,r1,r18 8010890: 21 31 ff ff andi r17,r9,0xffff if ( (vol->bps != 512) && 8010894: 7e 2e 04 00 cmpnei r14,r17,1024 8010898: 7e 2a 02 00 cmpnei r10,r17,512 close(vol->fd); rtems_set_errno_and_return_minus_one( EIO ); } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 801089c: 0d f1 00 00 sh (r15+0),r17 if ( (vol->bps != 512) && 80108a0: a1 ca 50 00 and r10,r14,r10 80108a4: 45 50 00 05 be r10,r16,80108b8 <== ALWAYS TAKEN (vol->bps != 1024) && 80108a8: 34 0a 08 00 mvi r10,2048 <== NOT EXECUTED 80108ac: 46 2a 00 03 be r17,r10,80108b8 <== NOT EXECUTED (vol->bps != 2048) && 80108b0: 34 0a 10 00 mvi r10,4096 <== NOT EXECUTED 80108b4: 5e 2a 00 f0 bne r17,r10,8010c74 <== NOT EXECUTED (vol->bps != 4096)) { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; 80108b8: 31 e0 00 03 sb (r15+3),r0 80108bc: ba 20 08 00 mv r1,r17 80108c0: 34 02 00 09 mvi r2,9 80108c4: f8 00 72 e5 calli 802d458 <__lshrsi3> 80108c8: 20 2a ff ff andi r10,r1,0xffff 80108cc: b9 40 08 00 mv r1,r10 80108d0: e0 00 00 06 bi 80108e8 i >>= 1, vol->sec_mul++); 80108d4: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 80108d8: fb ff c2 6b calli 8001284 <__ashrsi3> <== NOT EXECUTED 80108dc: 41 e2 00 03 lbu r2,(r15+3) <== NOT EXECUTED 80108e0: 34 42 00 01 addi r2,r2,1 <== NOT EXECUTED 80108e4: 31 e2 00 03 sb (r15+3),r2 <== NOT EXECUTED (vol->bps != 4096)) { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; 80108e8: 20 22 00 01 andi r2,r1,0x1 80108ec: 44 40 ff fa be r2,r0,80108d4 <== NEVER TAKEN i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 80108f0: 31 e0 00 02 sb (r15+2),r0 80108f4: ba 20 08 00 mv r1,r17 80108f8: e0 00 00 06 bi 8010910 i >>= 1, vol->sec_log2++); 80108fc: 34 02 00 01 mvi r2,1 8010900: fb ff c2 61 calli 8001284 <__ashrsi3> 8010904: 41 e2 00 02 lbu r2,(r15+2) 8010908: 34 42 00 01 addi r2,r2,1 801090c: 31 e2 00 02 sb (r15+2),r2 close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 8010910: 20 22 00 01 andi r2,r1,0x1 8010914: 44 40 ff fa be r2,r0,80108fc i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; vol->bytes_per_block_log2 = vol->sec_log2; 8010918: 41 f2 00 02 lbu r18,(r15+2) vol->sectors_per_block = 1; 801091c: 34 0a 00 01 mvi r10,1 for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; 8010920: 0d f1 00 0a sh (r15+10),r17 vol->bytes_per_block_log2 = vol->sec_log2; 8010924: 31 f2 00 0c sb (r15+12),r18 vol->sectors_per_block = 1; 8010928: 31 ea 00 09 sb (r15+9),r10 vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); 801092c: 31 f3 00 04 sb (r15+4),r19 /* * "sectors per cluster" of zero is invalid * (and would hang the following loop) */ if (vol->spc == 0) 8010930: 46 60 00 d1 be r19,r0,8010c74 <== NEVER TAKEN { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 8010934: 31 e0 00 05 sb (r15+5),r0 8010938: ba 60 08 00 mv r1,r19 801093c: e0 00 00 06 bi 8010954 i >>= 1, vol->spc_log2++); 8010940: 34 02 00 01 mvi r2,1 8010944: fb ff c2 50 calli 8001284 <__ashrsi3> 8010948: 41 e2 00 05 lbu r2,(r15+5) 801094c: 34 42 00 01 addi r2,r2,1 8010950: 31 e2 00 05 sb (r15+5),r2 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 8010954: 20 22 00 01 andi r2,r1,0x1 8010958: 44 40 ff fa be r2,r0,8010940 i >>= 1, vol->spc_log2++); /* * "bytes per cluster" value greater than 32K is invalid */ if ((vol->bpc = vol->bps << vol->spc_log2) > MS_BYTES_PER_CLUSTER_LIMIT) 801095c: 41 e2 00 05 lbu r2,(r15+5) 8010960: ba 20 08 00 mv r1,r17 8010964: fb ff c2 21 calli 80011e8 <__ashlsi3> 8010968: 20 2e ff ff andi r14,r1,0xffff 801096c: 0d ee 00 06 sh (r15+6),r14 8010970: 38 0a 80 00 mvu r10,0x8000 8010974: 51 4e 00 02 bgeu r10,r14,801097c <== ALWAYS TAKEN 8010978: e0 00 00 bf bi 8010c74 <== NOT EXECUTED { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 801097c: 31 e0 00 08 sb (r15+8),r0 8010980: b9 c0 08 00 mv r1,r14 8010984: e0 00 00 06 bi 801099c i >>= 1, vol->bpc_log2++); 8010988: 34 02 00 01 mvi r2,1 801098c: fb ff c2 3e calli 8001284 <__ashrsi3> 8010990: 41 e2 00 08 lbu r2,(r15+8) 8010994: 34 42 00 01 addi r2,r2,1 8010998: 31 e2 00 08 sb (r15+8),r2 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 801099c: 20 22 00 01 andi r2,r1,0x1 80109a0: 44 40 ff fa be r2,r0,8010988 i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 80109a4: 34 02 00 08 mvi r2,8 } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); 80109a8: 31 f4 00 0d sb (r15+13),r20 vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 80109ac: ba a0 08 00 mv r1,r21 80109b0: fb ff c2 0e calli 80011e8 <__ashlsi3> 80109b4: b8 36 40 00 or r8,r1,r22 80109b8: 21 10 ff ff andi r16,r8,0xffff vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 80109bc: 34 02 00 08 mvi r2,8 for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 80109c0: 0d f0 00 18 sh (r15+24),r16 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 80109c4: ba e0 08 00 mv r1,r23 80109c8: fb ff c2 08 calli 80011e8 <__ashlsi3> 80109cc: b8 38 38 00 or r7,r1,r24 80109d0: 20 e7 ff ff andi r7,r7,0xffff 80109d4: 0d e7 00 24 sh (r15+36),r7 /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 80109d8: b8 e0 08 00 mv r1,r7 80109dc: 34 02 00 05 mvi r2,5 80109e0: fb ff c2 02 calli 80011e8 <__ashlsi3> 80109e4: 36 2e ff ff addi r14,r17,-1 80109e8: ba 20 10 00 mv r2,r17 80109ec: b5 c1 08 00 add r1,r14,r1 80109f0: fb ff c2 58 calli 8001350 <__divsi3> vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 80109f4: ba 40 10 00 mv r2,r18 vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 80109f8: 59 e1 00 28 sw (r15+40),r1 80109fc: b8 20 58 00 mv r11,r1 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 8010a00: fb ff c1 fa calli 80011e8 <__ashlsi3> 8010a04: 59 e1 00 2c sw (r15+44),r1 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 8010a08: 2b 81 00 78 lw r1,(sp+120) 8010a0c: 34 02 00 08 mvi r2,8 8010a10: fb ff c1 f6 calli 80011e8 <__ashlsi3> 8010a14: 2b 83 00 74 lw r3,(sp+116) 8010a18: 34 02 00 10 mvi r2,16 8010a1c: b8 23 08 00 or r1,r1,r3 8010a20: fb ff c1 f2 calli 80011e8 <__ashlsi3> 8010a24: 34 02 00 10 mvi r2,16 8010a28: fb ff c2 17 calli 8001284 <__ashrsi3> vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); 8010a2c: 20 26 ff ff andi r6,r1,0xffff vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 8010a30: 5c 20 00 0e bne r1,r0,8010a68 vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); 8010a34: 2b 81 00 5c lw r1,(sp+92) 8010a38: 34 02 00 08 mvi r2,8 8010a3c: fb ff c1 eb calli 80011e8 <__ashlsi3> 8010a40: b8 20 70 00 mv r14,r1 8010a44: 2b 81 00 60 lw r1,(sp+96) 8010a48: 34 02 00 10 mvi r2,16 8010a4c: fb ff c1 e7 calli 80011e8 <__ashlsi3> 8010a50: b9 c1 30 00 or r6,r14,r1 8010a54: 2b 81 00 64 lw r1,(sp+100) 8010a58: 34 02 00 18 mvi r2,24 8010a5c: b8 cd 68 00 or r13,r6,r13 8010a60: fb ff c1 e2 calli 80011e8 <__ashlsi3> 8010a64: b9 a1 30 00 or r6,r13,r1 8010a68: 59 e6 00 1c sw (r15+28),r6 vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 8010a6c: 29 e2 00 1c lw r2,(r15+28) 8010a70: ba 80 08 00 mv r1,r20 8010a74: fb ff c2 2b calli 8001320 <__mulsi3> 8010a78: b6 01 18 00 add r3,r16,r1 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 8010a7c: 2b 81 00 70 lw r1,(sp+112) if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 8010a80: b5 63 58 00 add r11,r11,r3 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; 8010a84: 59 e3 00 20 sw (r15+32),r3 if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 8010a88: 34 02 00 08 mvi r2,8 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 8010a8c: 59 eb 00 34 sw (r15+52),r11 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 8010a90: fb ff c1 d6 calli 80011e8 <__ashlsi3> 8010a94: 2b 82 00 6c lw r2,(sp+108) 8010a98: b8 22 08 00 or r1,r1,r2 8010a9c: 34 02 00 10 mvi r2,16 8010aa0: fb ff c1 d2 calli 80011e8 <__ashlsi3> 8010aa4: 34 02 00 10 mvi r2,16 8010aa8: fb ff c1 f7 calli 8001284 <__ashrsi3> vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); 8010aac: 20 25 ff ff andi r5,r1,0xffff vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 8010ab0: 5c 20 00 0e bne r1,r0,8010ae8 vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); 8010ab4: 2b 81 00 7c lw r1,(sp+124) 8010ab8: 34 02 00 08 mvi r2,8 8010abc: fb ff c1 cb calli 80011e8 <__ashlsi3> 8010ac0: b8 20 68 00 mv r13,r1 8010ac4: 2b 81 00 80 lw r1,(sp+128) 8010ac8: 34 02 00 10 mvi r2,16 8010acc: fb ff c1 c7 calli 80011e8 <__ashlsi3> 8010ad0: b9 a1 28 00 or r5,r13,r1 8010ad4: 2b 81 00 84 lw r1,(sp+132) 8010ad8: 34 02 00 18 mvi r2,24 8010adc: b8 ac 60 00 or r12,r5,r12 8010ae0: fb ff c1 c2 calli 80011e8 <__ashlsi3> 8010ae4: b9 81 28 00 or r5,r12,r1 8010ae8: 59 e5 00 30 sw (r15+48),r5 data_secs = vol->tot_secs - vol->data_fsec; 8010aec: 29 e5 00 30 lw r5,(r15+48) vol->data_cls = data_secs / vol->spc; 8010af0: ba 60 10 00 mv r2,r19 8010af4: c8 ab 08 00 sub r1,r5,r11 8010af8: f8 00 72 a8 calli 802d598 <__udivsi3> 8010afc: 59 e1 00 38 sw (r15+56),r1 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 8010b00: 34 05 0f f4 mvi r5,4084 8010b04: 54 25 00 07 bgu r1,r5,8010b20 { vol->type = FAT_FAT12; 8010b08: 34 05 00 01 mvi r5,1 8010b0c: 31 e5 00 0e sb (r15+14),r5 vol->mask = FAT_FAT12_MASK; 8010b10: 34 05 0f ff mvi r5,4095 8010b14: 59 e5 00 10 sw (r15+16),r5 vol->eoc_val = FAT_FAT12_EOC; 8010b18: 34 05 0f f8 mvi r5,4088 8010b1c: e0 00 00 12 bi 8010b64 } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 8010b20: 38 05 ff f4 mvu r5,0xfff4 8010b24: 54 25 00 07 bgu r1,r5,8010b40 { vol->type = FAT_FAT16; 8010b28: 34 05 00 02 mvi r5,2 8010b2c: 31 e5 00 0e sb (r15+14),r5 vol->mask = FAT_FAT16_MASK; 8010b30: 38 05 ff ff mvu r5,0xffff 8010b34: 59 e5 00 10 sw (r15+16),r5 vol->eoc_val = FAT_FAT16_EOC; 8010b38: 34 a5 ff f9 addi r5,r5,-7 8010b3c: e0 00 00 0a bi 8010b64 } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 8010b40: 78 03 08 02 mvhi r3,0x802 vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; 8010b44: 34 05 00 04 mvi r5,4 vol->mask = FAT_FAT32_MASK; 8010b48: 38 63 e7 70 ori r3,r3,0xe770 vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; 8010b4c: 31 e5 00 0e sb (r15+14),r5 vol->mask = FAT_FAT32_MASK; 8010b50: 28 65 00 00 lw r5,(r3+0) vol->eoc_val = FAT_FAT32_EOC; 8010b54: 78 01 08 02 mvhi r1,0x802 8010b58: 38 21 e7 74 ori r1,r1,0xe774 vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 8010b5c: 59 e5 00 10 sw (r15+16),r5 vol->eoc_val = FAT_FAT32_EOC; 8010b60: 28 25 00 00 lw r5,(r1+0) } } if (vol->type == FAT_FAT32) 8010b64: 41 e6 00 0e lbu r6,(r15+14) } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; vol->eoc_val = FAT_FAT32_EOC; 8010b68: 59 e5 00 14 sw (r15+20),r5 } } if (vol->type == FAT_FAT32) 8010b6c: 34 05 00 04 mvi r5,4 8010b70: 5c c5 00 72 bne r6,r5,8010d38 { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8010b74: 2b 81 00 4c lw r1,(sp+76) 8010b78: 34 02 00 08 mvi r2,8 8010b7c: fb ff c1 9b calli 80011e8 <__ashlsi3> 8010b80: b8 20 60 00 mv r12,r1 8010b84: 2b 81 00 50 lw r1,(sp+80) 8010b88: 34 02 00 10 mvi r2,16 8010b8c: fb ff c1 97 calli 80011e8 <__ashlsi3> 8010b90: 2b 82 00 58 lw r2,(sp+88) 8010b94: b9 81 20 00 or r4,r12,r1 8010b98: 2b 81 00 48 lw r1,(sp+72) 8010b9c: b8 82 58 00 or r11,r4,r2 8010ba0: 34 02 00 18 mvi r2,24 8010ba4: fb ff c1 91 calli 80011e8 <__ashlsi3> 8010ba8: b9 61 20 00 or r4,r11,r1 vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 8010bac: 2b 81 00 54 lw r1,(sp+84) } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8010bb0: 59 e4 00 3c sw (r15+60),r4 vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 8010bb4: 34 02 00 08 mvi r2,8 8010bb8: fb ff c1 8c calli 80011e8 <__ashlsi3> 8010bbc: 2b 82 00 68 lw r2,(sp+104) 8010bc0: b8 22 18 00 or r3,r1,r2 8010bc4: 20 63 00 ff andi r3,r3,0xff 8010bc8: 20 64 00 80 andi r4,r3,0x80 8010bcc: 20 84 00 ff andi r4,r4,0xff 8010bd0: 31 e4 00 54 sb (r15+84),r4 if (vol->mirror) 8010bd4: 44 80 00 04 be r4,r0,8010be4 <== ALWAYS TAKEN vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 8010bd8: 20 63 00 0f andi r3,r3,0xf <== NOT EXECUTED 8010bdc: 31 e3 00 5c sb (r15+92),r3 <== NOT EXECUTED 8010be0: e0 00 00 02 bi 8010be8 <== NOT EXECUTED else vol->afat = 0; 8010be4: 31 e0 00 5c sb (r15+92),r0 vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 8010be8: 34 02 00 08 mvi r2,8 8010bec: bb 20 08 00 mv r1,r25 8010bf0: fb ff c1 7e calli 80011e8 <__ashlsi3> 8010bf4: b8 3b 10 00 or r2,r1,fp 8010bf8: 20 42 ff ff andi r2,r2,0xffff 8010bfc: 0d e2 00 40 sh (r15+64),r2 if( vol->info_sec == 0 ) 8010c00: 44 40 00 1d be r2,r0,8010c74 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, FAT_FSI_LEADSIG_SIZE, fs_info_sector); 8010c04: 37 8b 00 d0 addi r11,sp,208 close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, 8010c08: b9 e0 08 00 mv r1,r15 8010c0c: 34 03 00 00 mvi r3,0 8010c10: 34 04 00 04 mvi r4,4 8010c14: b9 60 28 00 mv r5,r11 8010c18: fb ff fd 5b calli 8010184 <_fat_block_read> FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 8010c1c: 4c 20 00 02 bge r1,r0,8010c24 <== ALWAYS TAKEN 8010c20: e0 00 00 23 bi 8010cac <== NOT EXECUTED { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 8010c24: 43 81 00 d1 lbu r1,(sp+209) 8010c28: 34 02 00 08 mvi r2,8 8010c2c: fb ff c1 6f calli 80011e8 <__ashlsi3> 8010c30: b8 20 60 00 mv r12,r1 8010c34: 43 81 00 d2 lbu r1,(sp+210) 8010c38: 34 02 00 10 mvi r2,16 8010c3c: fb ff c1 6b calli 80011e8 <__ashlsi3> 8010c40: b9 81 10 00 or r2,r12,r1 8010c44: 43 8c 00 d0 lbu r12,(sp+208) 8010c48: 43 81 00 d3 lbu r1,(sp+211) 8010c4c: b8 4c 60 00 or r12,r2,r12 8010c50: 34 02 00 18 mvi r2,24 8010c54: fb ff c1 65 calli 80011e8 <__ashlsi3> 8010c58: b9 81 10 00 or r2,r12,r1 8010c5c: 78 01 08 02 mvhi r1,0x802 8010c60: 38 21 e7 78 ori r1,r1,0xe778 8010c64: 28 23 00 00 lw r3,(r1+0) 8010c68: 44 43 00 08 be r2,r3,8010c88 <== ALWAYS TAKEN * 0 on success, or -1 if error occured and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) { return fat_buf_release(fs_info); 8010c6c: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 8010c70: fb ff fc 85 calli 800fe84 <== NOT EXECUTED if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(fs_info); close(vol->fd); 8010c74: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010c78: fb ff c8 aa calli 8002f20 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 8010c7c: f8 00 27 f6 calli 801ac54 <__errno> <== NOT EXECUTED 8010c80: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8010c84: e3 ff fe b1 bi 8010748 <== NOT EXECUTED } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 8010c88: 2d e2 00 40 lhu r2,(r15+64) 8010c8c: b9 e0 08 00 mv r1,r15 8010c90: 34 03 01 e4 mvi r3,484 8010c94: 34 04 00 0c mvi r4,12 8010c98: b9 60 28 00 mv r5,r11 8010c9c: fb ff fd 3a calli 8010184 <_fat_block_read> FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 8010ca0: 4c 20 00 06 bge r1,r0,8010cb8 <== ALWAYS TAKEN * 0 on success, or -1 if error occured and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) { return fat_buf_release(fs_info); 8010ca4: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 8010ca8: fb ff fc 77 calli 800fe84 <== NOT EXECUTED ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) { _fat_block_release(fs_info); close(vol->fd); 8010cac: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010cb0: fb ff c8 9c calli 8002f20 <== NOT EXECUTED 8010cb4: e3 ff fe a6 bi 801074c <== NOT EXECUTED return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 8010cb8: 43 81 00 d5 lbu r1,(sp+213) 8010cbc: 34 02 00 08 mvi r2,8 8010cc0: fb ff c1 4a calli 80011e8 <__ashlsi3> 8010cc4: b8 20 58 00 mv r11,r1 8010cc8: 43 81 00 d6 lbu r1,(sp+214) 8010ccc: 34 02 00 10 mvi r2,16 8010cd0: fb ff c1 46 calli 80011e8 <__ashlsi3> 8010cd4: b9 61 10 00 or r2,r11,r1 8010cd8: 43 8b 00 d4 lbu r11,(sp+212) 8010cdc: 43 81 00 d7 lbu r1,(sp+215) 8010ce0: b8 4b 58 00 or r11,r2,r11 8010ce4: 34 02 00 18 mvi r2,24 8010ce8: fb ff c1 40 calli 80011e8 <__ashlsi3> 8010cec: b9 61 10 00 or r2,r11,r1 vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 8010cf0: 43 81 00 d9 lbu r1,(sp+217) _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 8010cf4: 59 e2 00 48 sw (r15+72),r2 FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; 8010cf8: 59 e2 00 44 sw (r15+68),r2 vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 8010cfc: 34 02 00 08 mvi r2,8 8010d00: fb ff c1 3a calli 80011e8 <__ashlsi3> 8010d04: b8 20 58 00 mv r11,r1 8010d08: 43 81 00 da lbu r1,(sp+218) 8010d0c: 34 02 00 10 mvi r2,16 8010d10: fb ff c1 36 calli 80011e8 <__ashlsi3> 8010d14: b9 61 10 00 or r2,r11,r1 8010d18: 43 8b 00 d8 lbu r11,(sp+216) 8010d1c: 43 81 00 db lbu r1,(sp+219) 8010d20: b8 4b 58 00 or r11,r2,r11 8010d24: 34 02 00 18 mvi r2,24 8010d28: fb ff c1 30 calli 80011e8 <__ashlsi3> 8010d2c: b9 61 10 00 or r2,r11,r1 } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = 8010d30: 59 e2 00 50 sw (r15+80),r2 8010d34: e0 00 00 06 bi 8010d4c else { vol->rdir_cl = 0; vol->mirror = 0; vol->afat = 0; vol->free_cls = FAT_UNDEFINED_VALUE; 8010d38: 34 02 ff ff mvi r2,-1 } } } else { vol->rdir_cl = 0; 8010d3c: 59 e0 00 3c sw (r15+60),r0 vol->mirror = 0; 8010d40: 31 e0 00 54 sb (r15+84),r0 vol->afat = 0; 8010d44: 31 e0 00 5c sb (r15+92),r0 vol->free_cls = FAT_UNDEFINED_VALUE; 8010d48: 59 e2 00 44 sw (r15+68),r2 vol->next_cl = FAT_UNDEFINED_VALUE; 8010d4c: 59 e2 00 4c sw (r15+76),r2 * 0 on success, or -1 if error occured and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) { return fat_buf_release(fs_info); 8010d50: b9 e0 08 00 mv r1,r15 8010d54: fb ff fc 4c calli 800fe84 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 8010d58: 29 e2 00 1c lw r2,(r15+28) 8010d5c: 41 e1 00 5c lbu r1,(r15+92) 8010d60: fb ff c1 70 calli 8001320 <__mulsi3> 8010d64: 2d e2 00 18 lhu r2,(r15+24) 8010d68: b4 22 10 00 add r2,r1,r2 8010d6c: 59 e2 00 58 sw (r15+88),r2 /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 8010d70: 34 01 00 02 mvi r1,2 8010d74: 34 02 00 0c mvi r2,12 8010d78: fb ff c8 4b calli 8002ea4 8010d7c: 59 e1 00 6c sw (r15+108),r1 8010d80: b8 20 10 00 mv r2,r1 if ( fs_info->vhash == NULL ) 8010d84: 44 20 00 11 be r1,r0,8010dc8 <== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8010d88: 34 23 00 04 addi r3,r1,4 head->next = tail; head->previous = NULL; tail->previous = head; 8010d8c: 58 41 00 08 sw (r2+8),r1 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 8010d90: 58 20 00 04 sw (r1+4),r0 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8010d94: 58 23 00 00 sw (r1+0),r3 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8010d98: 34 24 00 10 addi r4,r1,16 close(vol->fd); rtems_set_errno_and_return_minus_one( ENOMEM ); } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->vhash + i); 8010d9c: 34 23 00 0c addi r3,r1,12 head->next = tail; 8010da0: 58 24 00 0c sw (r1+12),r4 fs_info->rhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 8010da4: 34 02 00 0c mvi r2,12 head->previous = NULL; 8010da8: 58 60 00 04 sw (r3+4),r0 tail->previous = head; 8010dac: 58 63 00 08 sw (r3+8),r3 8010db0: 34 01 00 02 mvi r1,2 8010db4: fb ff c8 3c calli 8002ea4 8010db8: 59 e1 00 70 sw (r15+112),r1 8010dbc: b8 20 10 00 mv r2,r1 if ( fs_info->rhash == NULL ) 8010dc0: 5c 20 00 05 bne r1,r0,8010dd4 <== ALWAYS TAKEN 8010dc4: e0 00 00 1c bi 8010e34 <== NOT EXECUTED /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); if ( fs_info->vhash == NULL ) { close(vol->fd); 8010dc8: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010dcc: fb ff c8 55 calli 8002f20 <== NOT EXECUTED 8010dd0: e0 00 00 30 bi 8010e90 <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8010dd4: 34 23 00 04 addi r3,r1,4 head->next = tail; head->previous = NULL; tail->previous = head; 8010dd8: 58 41 00 08 sw (r2+8),r1 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 8010ddc: 58 20 00 04 sw (r1+4),r0 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8010de0: 58 23 00 00 sw (r1+0),r3 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8010de4: 34 24 00 10 addi r4,r1,16 close(vol->fd); free(fs_info->vhash); rtems_set_errno_and_return_minus_one( ENOMEM ); } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->rhash + i); 8010de8: 34 23 00 0c addi r3,r1,12 head->next = tail; 8010dec: 58 24 00 0c sw (r1+12),r4 head->previous = NULL; 8010df0: 58 60 00 04 sw (r3+4),r0 tail->previous = head; 8010df4: 58 63 00 08 sw (r3+8),r3 fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE; 8010df8: 34 02 01 00 mvi r2,256 8010dfc: 59 e2 00 7c sw (r15+124),r2 fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 8010e00: 29 e1 00 30 lw r1,(r15+48) 8010e04: 41 e2 00 03 lbu r2,(r15+3) 8010e08: fb ff c0 f8 calli 80011e8 <__ashlsi3> 8010e0c: 34 02 00 04 mvi r2,4 8010e10: fb ff c0 f6 calli 80011e8 <__ashlsi3> 8010e14: 59 e1 00 80 sw (r15+128),r1 fs_info->index = 0; 8010e18: 59 e0 00 78 sw (r15+120),r0 fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 8010e1c: 34 01 01 00 mvi r1,256 8010e20: 34 02 00 01 mvi r2,1 8010e24: fb ff c8 20 calli 8002ea4 8010e28: 59 e1 00 74 sw (r15+116),r1 if ( fs_info->uino == NULL ) 8010e2c: 5c 20 00 0c bne r1,r0,8010e5c <== ALWAYS TAKEN 8010e30: e0 00 00 05 bi 8010e44 <== NOT EXECUTED rtems_chain_initialize_empty(fs_info->vhash + i); fs_info->rhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); if ( fs_info->rhash == NULL ) { close(vol->fd); 8010e34: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010e38: fb ff c8 3a calli 8002f20 <== NOT EXECUTED free(fs_info->vhash); 8010e3c: 29 e1 00 6c lw r1,(r15+108) <== NOT EXECUTED 8010e40: e0 00 00 13 bi 8010e8c <== NOT EXECUTED fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); if ( fs_info->uino == NULL ) { close(vol->fd); 8010e44: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010e48: fb ff c8 36 calli 8002f20 <== NOT EXECUTED free(fs_info->vhash); 8010e4c: 29 e1 00 6c lw r1,(r15+108) <== NOT EXECUTED 8010e50: fb ff c8 5f calli 8002fcc <== NOT EXECUTED free(fs_info->rhash); 8010e54: 29 e1 00 70 lw r1,(r15+112) <== NOT EXECUTED 8010e58: e0 00 00 0d bi 8010e8c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); 8010e5c: 2d e1 00 00 lhu r1,(r15+0) 8010e60: 34 02 00 01 mvi r2,1 8010e64: fb ff c8 10 calli 8002ea4 8010e68: 59 e1 00 90 sw (r15+144),r1 if (fs_info->sec_buf == NULL) 8010e6c: 5c 20 00 0c bne r1,r0,8010e9c <== ALWAYS TAKEN { close(vol->fd); 8010e70: 29 e1 00 60 lw r1,(r15+96) <== NOT EXECUTED 8010e74: fb ff c8 2b calli 8002f20 <== NOT EXECUTED free(fs_info->vhash); 8010e78: 29 e1 00 6c lw r1,(r15+108) <== NOT EXECUTED 8010e7c: fb ff c8 54 calli 8002fcc <== NOT EXECUTED free(fs_info->rhash); 8010e80: 29 e1 00 70 lw r1,(r15+112) <== NOT EXECUTED 8010e84: fb ff c8 52 calli 8002fcc <== NOT EXECUTED free(fs_info->uino); 8010e88: 29 e1 00 74 lw r1,(r15+116) <== NOT EXECUTED 8010e8c: fb ff c8 50 calli 8002fcc <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 8010e90: f8 00 27 71 calli 801ac54 <__errno> <== NOT EXECUTED 8010e94: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8010e98: e3 ff fe 2c bi 8010748 <== NOT EXECUTED return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 8010e9c: 41 e3 00 04 lbu r3,(r15+4) 8010ea0: 29 e4 00 34 lw r4,(r15+52) vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; 8010ea4: 34 02 00 00 mvi r2,0 return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 8010ea8: 34 63 ff ff addi r3,r3,-1 8010eac: a0 64 20 00 and r4,r3,r4 /* * If possible we will use the cluster size as bdbuf block size for faster * file access. This requires that certain sectors are aligned to cluster * borders. */ if (is_cluster_aligned(vol, vol->data_fsec) 8010eb0: 5c 80 00 13 bne r4,r0,8010efc <== NEVER TAKEN && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) 8010eb4: 41 e5 00 0e lbu r5,(r15+14) 8010eb8: 34 04 00 04 mvi r4,4 8010ebc: 44 a4 00 04 be r5,r4,8010ecc return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 8010ec0: 29 e1 00 20 lw r1,(r15+32) 8010ec4: a0 61 18 00 and r3,r3,r1 * If possible we will use the cluster size as bdbuf block size for faster * file access. This requires that certain sectors are aligned to cluster * borders. */ if (is_cluster_aligned(vol, vol->data_fsec) && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) 8010ec8: 5c 60 00 0d bne r3,r0,8010efc <== NEVER TAKEN { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 8010ecc: 2d e2 00 06 lhu r2,(r15+6) 8010ed0: 29 e1 00 64 lw r1,(r15+100) 8010ed4: 34 03 00 01 mvi r3,1 8010ed8: fb ff f4 b2 calli 800e1a0 vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; 8010edc: 34 02 00 00 mvi r2,0 */ if (is_cluster_aligned(vol, vol->data_fsec) && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); if (sc == RTEMS_SUCCESSFUL) 8010ee0: 5c 20 00 07 bne r1,r0,8010efc <== NEVER TAKEN { vol->bytes_per_block = vol->bpc; 8010ee4: 2d e1 00 06 lhu r1,(r15+6) 8010ee8: 0d e1 00 0a sh (r15+10),r1 vol->bytes_per_block_log2 = vol->bpc_log2; 8010eec: 41 e1 00 08 lbu r1,(r15+8) 8010ef0: 31 e1 00 0c sb (r15+12),r1 vol->sectors_per_block = vol->spc; 8010ef4: 41 e1 00 04 lbu r1,(r15+4) 8010ef8: 31 e1 00 09 sb (r15+9),r1 } } return RC_OK; } 8010efc: b8 40 08 00 mv r1,r2 8010f00: 2b 9d 00 04 lw ra,(sp+4) 8010f04: 2b 8b 00 44 lw r11,(sp+68) 8010f08: 2b 8c 00 40 lw r12,(sp+64) 8010f0c: 2b 8d 00 3c lw r13,(sp+60) 8010f10: 2b 8e 00 38 lw r14,(sp+56) 8010f14: 2b 8f 00 34 lw r15,(sp+52) 8010f18: 2b 90 00 30 lw r16,(sp+48) 8010f1c: 2b 91 00 2c lw r17,(sp+44) 8010f20: 2b 92 00 28 lw r18,(sp+40) 8010f24: 2b 93 00 24 lw r19,(sp+36) 8010f28: 2b 94 00 20 lw r20,(sp+32) 8010f2c: 2b 95 00 1c lw r21,(sp+28) 8010f30: 2b 96 00 18 lw r22,(sp+24) 8010f34: 2b 97 00 14 lw r23,(sp+20) 8010f38: 2b 98 00 10 lw r24,(sp+16) 8010f3c: 2b 99 00 0c lw r25,(sp+12) 8010f40: 2b 9b 00 08 lw fp,(sp+8) 8010f44: 37 9c 00 dc addi sp,sp,220 8010f48: c3 a0 00 00 ret =============================================================================== 08018bdc : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 8018bdc: 37 9c ff c8 addi sp,sp,-56 8018be0: 5b 8b 00 34 sw (sp+52),r11 8018be4: 5b 8c 00 30 sw (sp+48),r12 8018be8: 5b 8d 00 2c sw (sp+44),r13 8018bec: 5b 8e 00 28 sw (sp+40),r14 8018bf0: 5b 8f 00 24 sw (sp+36),r15 8018bf4: 5b 90 00 20 sw (sp+32),r16 8018bf8: 5b 91 00 1c sw (sp+28),r17 8018bfc: 5b 92 00 18 sw (sp+24),r18 8018c00: 5b 93 00 14 sw (sp+20),r19 8018c04: 5b 94 00 10 sw (sp+16),r20 8018c08: 5b 95 00 0c sw (sp+12),r21 8018c0c: 5b 96 00 08 sw (sp+8),r22 8018c10: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; 8018c14: 28 34 00 38 lw r20,(r1+56) bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 8018c18: 5b 80 00 38 sw (sp+56),r0 uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; 8018c1c: 58 80 00 00 sw (r4+0),r0 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 8018c20: b8 20 58 00 mv r11,r1 8018c24: b8 40 78 00 mv r15,r2 8018c28: b8 60 a8 00 mv r21,r3 8018c2c: b8 80 68 00 mv r13,r4 8018c30: b8 a0 90 00 mv r18,r5 8018c34: 20 d6 00 ff andi r22,r6,0xff int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; 8018c38: 36 94 00 02 addi r20,r20,2 ssize_t bytes_written; *cls_added = 0; if (count == 0) return rc; 8018c3c: 34 0e 00 00 mvi r14,0 uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) 8018c40: 44 60 00 68 be r3,r0,8018de0 <== NEVER TAKEN return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) 8018c44: 28 2c 00 4c lw r12,(r1+76) 8018c48: 34 01 ff ff mvi r1,-1 8018c4c: 5d 81 00 02 bne r12,r1,8018c54 uint32_t *last_cl, bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; 8018c50: 34 0c 00 02 mvi r12,2 } } i++; cl4find++; if (cl4find >= data_cls_val) cl4find = 2; 8018c54: 34 11 00 02 mvi r17,2 8018c58: 34 10 00 00 mvi r16,0 8018c5c: e0 00 00 47 bi 8018d78 * starting at cluster 2, so the maximum valid cluster number is * (fs_info->vol.data_cls + 1) */ while (i < data_cls_val) { rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); 8018c60: b9 60 08 00 mv r1,r11 8018c64: b9 80 10 00 mv r2,r12 8018c68: 37 83 00 38 addi r3,sp,56 8018c6c: fb ff fe 43 calli 8018578 8018c70: b8 20 70 00 mv r14,r1 if ( rc != RC_OK ) 8018c74: 44 20 00 07 be r1,r0,8018c90 <== ALWAYS TAKEN { if (*cls_added != 0) 8018c78: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED 8018c7c: 44 20 00 59 be r1,r0,8018de0 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); 8018c80: 29 e2 00 00 lw r2,(r15+0) <== NOT EXECUTED 8018c84: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8018c88: fb ff ff 99 calli 8018aec <== NOT EXECUTED 8018c8c: e0 00 00 55 bi 8018de0 <== NOT EXECUTED return rc; } if (next_cln == FAT_GENFAT_FREE) 8018c90: 2b 81 00 38 lw r1,(sp+56) 8018c94: 5c 2e 00 34 bne r1,r14,8018d64 /* * We are enforced to process allocation of the first free cluster * by separate 'if' statement because otherwise undo function * wouldn't work properly */ if (*cls_added == 0) 8018c98: 29 a1 00 00 lw r1,(r13+0) 8018c9c: 5c 20 00 08 bne r1,r0,8018cbc { *chain = cl4find; 8018ca0: 59 ec 00 00 sw (r15+0),r12 rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 8018ca4: b9 60 08 00 mv r1,r11 8018ca8: b9 80 10 00 mv r2,r12 8018cac: 34 03 ff ff mvi r3,-1 8018cb0: fb ff fe bd calli 80187a4 if ( rc != RC_OK ) 8018cb4: 44 20 00 13 be r1,r0,8018d00 <== ALWAYS TAKEN 8018cb8: e0 00 00 49 bi 8018ddc <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 8018cbc: b9 60 08 00 mv r1,r11 8018cc0: b9 80 10 00 mv r2,r12 8018cc4: 34 03 ff ff mvi r3,-1 8018cc8: fb ff fe b7 calli 80187a4 8018ccc: b8 20 98 00 mv r19,r1 if ( rc != RC_OK ) 8018cd0: 44 20 00 06 be r1,r0,8018ce8 <== ALWAYS TAKEN { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 8018cd4: 29 e2 00 00 lw r2,(r15+0) <== NOT EXECUTED 8018cd8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 8018cdc: ba 60 70 00 mv r14,r19 <== NOT EXECUTED if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 8018ce0: fb ff ff 83 calli 8018aec <== NOT EXECUTED return rc; 8018ce4: e0 00 00 3f bi 8018de0 <== NOT EXECUTED } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); 8018ce8: ba 00 10 00 mv r2,r16 8018cec: b9 60 08 00 mv r1,r11 8018cf0: b9 80 18 00 mv r3,r12 8018cf4: fb ff fe ac calli 80187a4 8018cf8: b8 20 80 00 mv r16,r1 if ( rc != RC_OK ) 8018cfc: 5c 20 00 2d bne r1,r0,8018db0 <== NEVER TAKEN goto cleanup; } if (zero_fill) 8018d00: 46 c0 00 09 be r22,r0,8018d24 { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 8018d04: 2d 64 00 06 lhu r4,(r11+6) 8018d08: b9 80 10 00 mv r2,r12 8018d0c: b9 60 08 00 mv r1,r11 8018d10: 34 03 00 00 mvi r3,0 8018d14: 34 05 00 00 mvi r5,0 8018d18: fb ff dd 87 calli 8010334 if (fs_info->vol.bpc != bytes_written) 8018d1c: 2d 62 00 06 lhu r2,(r11+6) 8018d20: 5c 41 00 23 bne r2,r1,8018dac <== NEVER TAKEN goto cleanup; } } save_cln = cl4find; (*cls_added)++; 8018d24: 29 a1 00 00 lw r1,(r13+0) 8018d28: 34 21 00 01 addi r1,r1,1 8018d2c: 59 a1 00 00 sw (r13+0),r1 /* have we satisfied request ? */ if (*cls_added == count) 8018d30: 5c 35 00 0c bne r1,r21,8018d60 { fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8018d34: 29 61 00 44 lw r1,(r11+68) (*cls_added)++; /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; 8018d38: 59 6c 00 4c sw (r11+76),r12 if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8018d3c: 34 02 ff ff mvi r2,-1 8018d40: 44 22 00 04 be r1,r2,8018d50 <== ALWAYS TAKEN fs_info->vol.free_cls -= (*cls_added); 8018d44: 29 a2 00 00 lw r2,(r13+0) <== NOT EXECUTED 8018d48: c8 22 08 00 sub r1,r1,r2 <== NOT EXECUTED 8018d4c: 59 61 00 44 sw (r11+68),r1 <== NOT EXECUTED *last_cl = save_cln; 8018d50: 5a 4c 00 00 sw (r18+0),r12 fat_buf_release(fs_info); 8018d54: b9 60 08 00 mv r1,r11 8018d58: fb ff dc 4b calli 800fe84 return rc; 8018d5c: e0 00 00 21 bi 8018de0 save_cln = cl4find; (*cls_added)++; /* have we satisfied request ? */ if (*cls_added == count) 8018d60: b9 80 80 00 mv r16,r12 fat_buf_release(fs_info); return rc; } } i++; cl4find++; 8018d64: 35 8c 00 01 addi r12,r12,1 *last_cl = save_cln; fat_buf_release(fs_info); return rc; } } i++; 8018d68: 36 31 00 01 addi r17,r17,1 cl4find++; if (cl4find >= data_cls_val) 8018d6c: 51 94 00 02 bgeu r12,r20,8018d74 <== NEVER TAKEN 8018d70: e0 00 00 02 bi 8018d78 cl4find = 2; 8018d74: 34 0c 00 02 mvi r12,2 <== NOT EXECUTED /* * fs_info->vol.data_cls is exactly the count of data clusters * starting at cluster 2, so the maximum valid cluster number is * (fs_info->vol.data_cls + 1) */ while (i < data_cls_val) 8018d78: 56 91 ff ba bgu r20,r17,8018c60 <== ALWAYS TAKEN if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8018d7c: 29 61 00 44 lw r1,(r11+68) <== NOT EXECUTED cl4find++; if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; 8018d80: 59 70 00 4c sw (r11+76),r16 <== NOT EXECUTED if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 8018d84: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8018d88: 44 22 00 04 be r1,r2,8018d98 <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); 8018d8c: 29 a2 00 00 lw r2,(r13+0) <== NOT EXECUTED 8018d90: c8 22 08 00 sub r1,r1,r2 <== NOT EXECUTED 8018d94: 59 61 00 44 sw (r11+68),r1 <== NOT EXECUTED *last_cl = save_cln; 8018d98: 5a 50 00 00 sw (r18+0),r16 <== NOT EXECUTED fat_buf_release(fs_info); 8018d9c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8018da0: fb ff dc 39 calli 800fe84 <== NOT EXECUTED return RC_OK; 8018da4: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED 8018da8: e0 00 00 0e bi 8018de0 <== NOT EXECUTED if (zero_fill) { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); if (fs_info->vol.bpc != bytes_written) { rc = -1; 8018dac: 34 10 ff ff mvi r16,-1 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 8018db0: 29 e2 00 00 lw r2,(r15+0) <== NOT EXECUTED 8018db4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); fat_buf_release(fs_info); return rc; 8018db8: ba 00 70 00 mv r14,r16 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 8018dbc: fb ff ff 4c calli 8018aec <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); 8018dc0: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 8018dc4: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 8018dc8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8018dcc: fb ff fe 76 calli 80187a4 <== NOT EXECUTED fat_buf_release(fs_info); 8018dd0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8018dd4: fb ff dc 2c calli 800fe84 <== NOT EXECUTED return rc; 8018dd8: e0 00 00 02 bi 8018de0 <== NOT EXECUTED * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 8018ddc: b8 20 70 00 mv r14,r1 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); fat_buf_release(fs_info); return rc; } 8018de0: b9 c0 08 00 mv r1,r14 8018de4: 2b 9d 00 04 lw ra,(sp+4) 8018de8: 2b 8b 00 34 lw r11,(sp+52) 8018dec: 2b 8c 00 30 lw r12,(sp+48) 8018df0: 2b 8d 00 2c lw r13,(sp+44) 8018df4: 2b 8e 00 28 lw r14,(sp+40) 8018df8: 2b 8f 00 24 lw r15,(sp+36) 8018dfc: 2b 90 00 20 lw r16,(sp+32) 8018e00: 2b 91 00 1c lw r17,(sp+28) 8018e04: 2b 92 00 18 lw r18,(sp+24) 8018e08: 2b 93 00 14 lw r19,(sp+20) 8018e0c: 2b 94 00 10 lw r20,(sp+16) 8018e10: 2b 95 00 0c lw r21,(sp+12) 8018e14: 2b 96 00 08 lw r22,(sp+8) 8018e18: 37 9c 00 38 addi sp,sp,56 8018e1c: c3 a0 00 00 ret =============================================================================== 08010248 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 8010248: 37 9c ff d8 addi sp,sp,-40 801024c: 5b 8b 00 24 sw (sp+36),r11 8010250: 5b 8c 00 20 sw (sp+32),r12 8010254: 5b 8d 00 1c sw (sp+28),r13 8010258: 5b 8e 00 18 sw (sp+24),r14 801025c: 5b 8f 00 14 sw (sp+20),r15 8010260: 5b 90 00 10 sw (sp+16),r16 8010264: 5b 91 00 0c sw (sp+12),r17 8010268: 5b 92 00 08 sw (sp+8),r18 801026c: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; ssize_t cmpltd = 0; 8010270: 34 0c 00 00 mvi r12,0 fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 8010274: b8 20 70 00 mv r14,r1 8010278: b8 80 68 00 mv r13,r4 801027c: b8 a0 90 00 mv r18,r5 int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; uint32_t ofs = offset; 8010280: b8 60 80 00 mv r16,r3 uint32_t count, const void *buff) { int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; 8010284: b8 40 78 00 mv r15,r2 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 8010288: 34 11 00 01 mvi r17,1 uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 801028c: e0 00 00 1b bi 80102f8 { c = MIN(count, (fs_info->vol.bps - ofs)); 8010290: 2d cb 00 00 lhu r11,(r14+0) 8010294: c9 70 58 00 sub r11,r11,r16 8010298: 51 ab 00 02 bgeu r13,r11,80102a0 801029c: b9 a0 58 00 mv r11,r13 if (c == fs_info->vol.bytes_per_block) 80102a0: 2d c1 00 0a lhu r1,(r14+10) 80102a4: 5d 61 00 05 bne r11,r1,80102b8 <== ALWAYS TAKEN rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 80102a8: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 80102ac: b9 e0 10 00 mv r2,r15 <== NOT EXECUTED 80102b0: 34 03 00 02 mvi r3,2 <== NOT EXECUTED 80102b4: e0 00 00 04 bi 80102c4 <== NOT EXECUTED else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 80102b8: b9 c0 08 00 mv r1,r14 80102bc: b9 e0 10 00 mv r2,r15 80102c0: 34 03 00 01 mvi r3,1 80102c4: 37 84 00 28 addi r4,sp,40 80102c8: fb ff ff 6d calli 801007c if (rc != RC_OK) 80102cc: 5c 20 00 0d bne r1,r0,8010300 <== NEVER TAKEN return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 80102d0: 2b 81 00 28 lw r1,(sp+40) 80102d4: b6 4c 10 00 add r2,r18,r12 80102d8: b9 60 18 00 mv r3,r11 80102dc: b4 30 08 00 add r1,r1,r16 80102e0: f8 00 2d ab calli 801b98c fat_buf_mark_modified(fs_info); count -= c; 80102e4: c9 ab 68 00 sub r13,r13,r11 80102e8: 31 d1 00 88 sb (r14+136),r17 cmpltd +=c; 80102ec: b5 6c 60 00 add r12,r11,r12 sec_num++; 80102f0: 35 ef 00 01 addi r15,r15,1 ofs = 0; 80102f4: 34 10 00 00 mvi r16,0 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 80102f8: 5d a0 ff e6 bne r13,r0,8010290 80102fc: e0 00 00 02 bi 8010304 if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; 8010300: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 8010304: b9 80 08 00 mv r1,r12 8010308: 2b 9d 00 04 lw ra,(sp+4) 801030c: 2b 8b 00 24 lw r11,(sp+36) 8010310: 2b 8c 00 20 lw r12,(sp+32) 8010314: 2b 8d 00 1c lw r13,(sp+28) 8010318: 2b 8e 00 18 lw r14,(sp+24) 801031c: 2b 8f 00 14 lw r15,(sp+20) 8010320: 2b 90 00 10 lw r16,(sp+16) 8010324: 2b 91 00 0c lw r17,(sp+12) 8010328: 2b 92 00 08 lw r18,(sp+8) 801032c: 37 9c 00 28 addi sp,sp,40 8010330: c3 a0 00 00 ret =============================================================================== 080187a4 : fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 80187a4: 37 9c ff d8 addi sp,sp,-40 80187a8: 5b 8b 00 24 sw (sp+36),r11 80187ac: 5b 8c 00 20 sw (sp+32),r12 80187b0: 5b 8d 00 1c sw (sp+28),r13 80187b4: 5b 8e 00 18 sw (sp+24),r14 80187b8: 5b 8f 00 14 sw (sp+20),r15 80187bc: 5b 90 00 10 sw (sp+16),r16 80187c0: 5b 91 00 0c sw (sp+12),r17 80187c4: 5b 92 00 08 sw (sp+8),r18 80187c8: 5b 9d 00 04 sw (sp+4),ra 80187cc: b8 20 58 00 mv r11,r1 int rc = RC_OK; uint32_t sec = 0; uint32_t ofs = 0; uint16_t fat16_clv = 0; uint32_t fat32_clv = 0; uint8_t *sec_buf = NULL; 80187d0: 5b 80 00 28 sw (sp+40),r0 /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 80187d4: 34 01 00 01 mvi r1,1 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 80187d8: b8 40 60 00 mv r12,r2 80187dc: b8 60 80 00 mv r16,r3 uint16_t fat16_clv = 0; uint32_t fat32_clv = 0; uint8_t *sec_buf = NULL; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 80187e0: 50 22 00 b3 bgeu r1,r2,8018aac <== NEVER TAKEN 80187e4: 29 61 00 38 lw r1,(r11+56) 80187e8: 34 21 00 01 addi r1,r1,1 80187ec: 50 22 00 02 bgeu r1,r2,80187f4 <== ALWAYS TAKEN 80187f0: e0 00 00 af bi 8018aac <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 80187f4: 41 6e 00 0e lbu r14,(r11+14) 80187f8: 21 cd 00 01 andi r13,r14,0x1 80187fc: 45 a0 00 06 be r13,r0,8018814 8018800: b8 40 08 00 mv r1,r2 8018804: 34 02 00 01 mvi r2,1 8018808: f8 00 53 14 calli 802d458 <__lshrsi3> 801880c: b4 2c 08 00 add r1,r1,r12 8018810: e0 00 00 09 bi 8018834 8018814: 21 c1 00 02 andi r1,r14,0x2 8018818: 44 2d 00 04 be r1,r13,8018828 801881c: b8 40 08 00 mv r1,r2 8018820: 34 02 00 01 mvi r2,1 8018824: e0 00 00 03 bi 8018830 8018828: b8 40 08 00 mv r1,r2 801882c: 34 02 00 02 mvi r2,2 8018830: fb ff a2 6e calli 80011e8 <__ashlsi3> 8018834: 41 62 00 02 lbu r2,(r11+2) 8018838: f8 00 53 08 calli 802d458 <__lshrsi3> 801883c: 29 71 00 58 lw r17,(r11+88) 8018840: b4 31 88 00 add r17,r1,r17 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 8018844: 45 a0 00 06 be r13,r0,801885c 8018848: b9 80 08 00 mv r1,r12 801884c: 34 02 00 01 mvi r2,1 8018850: f8 00 53 02 calli 802d458 <__lshrsi3> 8018854: b4 2c 78 00 add r15,r1,r12 8018858: e0 00 00 09 bi 801887c 801885c: 21 ce 00 02 andi r14,r14,0x2 8018860: b9 80 08 00 mv r1,r12 8018864: 34 02 00 01 mvi r2,1 8018868: 5d cd 00 03 bne r14,r13,8018874 801886c: b9 80 08 00 mv r1,r12 8018870: 34 02 00 02 mvi r2,2 8018874: fb ff a2 5d calli 80011e8 <__ashlsi3> 8018878: b8 20 78 00 mv r15,r1 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 801887c: b9 60 08 00 mv r1,r11 8018880: ba 20 10 00 mv r2,r17 8018884: 34 03 00 01 mvi r3,1 8018888: 37 84 00 28 addi r4,sp,40 if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 801888c: 2d 6d 00 00 lhu r13,(r11+0) rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 8018890: fb ff dd fb calli 801007c 8018894: b8 20 70 00 mv r14,r1 if (rc != RC_OK) 8018898: 5c 20 00 89 bne r1,r0,8018abc <== NEVER TAKEN if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 801889c: 35 ad ff ff addi r13,r13,-1 80188a0: a1 ed 68 00 and r13,r15,r13 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 80188a4: 41 6f 00 0e lbu r15,(r11+14) 80188a8: 34 01 00 02 mvi r1,2 80188ac: 45 e1 00 62 be r15,r1,8018a34 80188b0: 34 01 00 04 mvi r1,4 80188b4: 45 e1 00 6d be r15,r1,8018a68 80188b8: 34 01 00 01 mvi r1,1 80188bc: 5d e1 00 7c bne r15,r1,8018aac <== NEVER TAKEN { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 80188c0: 21 8c 00 01 andi r12,r12,0x1 80188c4: 2b 92 00 28 lw r18,(sp+40) 80188c8: 45 80 00 2c be r12,r0,8018978 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; 80188cc: 34 02 00 04 mvi r2,4 80188d0: ba 00 08 00 mv r1,r16 80188d4: fb ff a2 45 calli 80011e8 <__ashlsi3> 80188d8: 20 2c ff ff andi r12,r1,0xffff *(sec_buf + ofs) &= 0x0F; 80188dc: b6 4d 08 00 add r1,r18,r13 80188e0: 40 22 00 00 lbu r2,(r1+0) 80188e4: 20 42 00 0f andi r2,r2,0xf 80188e8: 30 22 00 00 sb (r1+0),r2 *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 80188ec: 2b 81 00 28 lw r1,(sp+40) 80188f0: 21 82 ff f0 andi r2,r12,0xfff0 80188f4: b4 2d 08 00 add r1,r1,r13 80188f8: 40 23 00 00 lbu r3,(r1+0) 80188fc: b8 62 10 00 or r2,r3,r2 8018900: 30 22 00 00 sb (r1+0),r2 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 8018904: 2d 61 00 00 lhu r1,(r11+0) } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 8018908: 31 6f 00 88 sb (r11+136),r15 801890c: 34 21 ff ff addi r1,r1,-1 8018910: 5d a1 00 12 bne r13,r1,8018958 <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 8018914: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8018918: 36 22 00 01 addi r2,r17,1 <== NOT EXECUTED 801891c: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8018920: 37 84 00 28 addi r4,sp,40 <== NOT EXECUTED 8018924: fb ff dd d6 calli 801007c <== NOT EXECUTED 8018928: b8 20 70 00 mv r14,r1 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 801892c: 5c 20 00 64 bne r1,r0,8018abc <== NOT EXECUTED return rc; *sec_buf &= 0x00; 8018930: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 8018934: 34 02 00 08 mvi r2,8 <== NOT EXECUTED rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; *sec_buf &= 0x00; 8018938: 30 20 00 00 sb (r1+0),r0 <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 801893c: 2b 8d 00 28 lw r13,(sp+40) <== NOT EXECUTED 8018940: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8018944: f8 00 52 c5 calli 802d458 <__lshrsi3> <== NOT EXECUTED 8018948: 41 a2 00 00 lbu r2,(r13+0) <== NOT EXECUTED 801894c: b8 22 08 00 or r1,r1,r2 <== NOT EXECUTED 8018950: 31 a1 00 00 sb (r13+0),r1 <== NOT EXECUTED 8018954: e0 00 00 27 bi 80189f0 <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 8018958: 2b 81 00 28 lw r1,(sp+40) 801895c: 35 ad 00 01 addi r13,r13,1 8018960: b4 2d 08 00 add r1,r1,r13 8018964: 30 20 00 00 sb (r1+0),r0 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 8018968: 2b 81 00 28 lw r1,(sp+40) 801896c: b4 2d 68 00 add r13,r1,r13 8018970: b9 80 08 00 mv r1,r12 8018974: e0 00 00 2a bi 8018a1c } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 8018978: b6 4d 90 00 add r18,r18,r13 801897c: 32 40 00 00 sb (r18+0),r0 *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 8018980: 2b 81 00 28 lw r1,(sp+40) *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; 8018984: 22 10 0f ff andi r16,r16,0xfff *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 8018988: b4 2d 08 00 add r1,r1,r13 801898c: 40 22 00 00 lbu r2,(r1+0) 8018990: b8 50 10 00 or r2,r2,r16 8018994: 30 22 00 00 sb (r1+0),r2 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 8018998: 2d 61 00 00 lhu r1,(r11+0) 801899c: 31 6f 00 88 sb (r11+136),r15 80189a0: 34 21 ff ff addi r1,r1,-1 80189a4: 5d a1 00 15 bne r13,r1,80189f8 <== ALWAYS TAKEN { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 80189a8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 80189ac: 36 22 00 01 addi r2,r17,1 <== NOT EXECUTED 80189b0: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 80189b4: 37 84 00 28 addi r4,sp,40 <== NOT EXECUTED 80189b8: fb ff dd b1 calli 801007c <== NOT EXECUTED 80189bc: b8 20 70 00 mv r14,r1 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 80189c0: 5c 20 00 3f bne r1,r0,8018abc <== NOT EXECUTED return rc; *sec_buf &= 0xF0; 80189c4: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED 80189c8: 40 22 00 00 lbu r2,(r1+0) <== NOT EXECUTED 80189cc: 20 42 00 f0 andi r2,r2,0xf0 <== NOT EXECUTED 80189d0: 30 22 00 00 sb (r1+0),r2 <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 80189d4: 2b 8c 00 28 lw r12,(sp+40) <== NOT EXECUTED 80189d8: 34 02 00 08 mvi r2,8 <== NOT EXECUTED 80189dc: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 80189e0: f8 00 52 9e calli 802d458 <__lshrsi3> <== NOT EXECUTED 80189e4: 41 82 00 00 lbu r2,(r12+0) <== NOT EXECUTED 80189e8: b8 22 08 00 or r1,r1,r2 <== NOT EXECUTED 80189ec: 31 81 00 00 sb (r12+0),r1 <== NOT EXECUTED 80189f0: 31 6f 00 88 sb (r11+136),r15 <== NOT EXECUTED 80189f4: e0 00 00 32 bi 8018abc <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 80189f8: 2b 81 00 28 lw r1,(sp+40) 80189fc: 35 ad 00 01 addi r13,r13,1 8018a00: b4 2d 08 00 add r1,r1,r13 8018a04: 40 22 00 00 lbu r2,(r1+0) 8018a08: 20 42 00 f0 andi r2,r2,0xf0 8018a0c: 30 22 00 00 sb (r1+0),r2 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 8018a10: 2b 81 00 28 lw r1,(sp+40) 8018a14: b4 2d 68 00 add r13,r1,r13 8018a18: ba 00 08 00 mv r1,r16 8018a1c: 34 02 00 08 mvi r2,8 8018a20: f8 00 52 8e calli 802d458 <__lshrsi3> 8018a24: 41 a2 00 00 lbu r2,(r13+0) 8018a28: b8 22 08 00 or r1,r1,r2 8018a2c: 31 a1 00 00 sb (r13+0),r1 8018a30: e0 00 00 23 bi 8018abc } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 8018a34: 2b 81 00 28 lw r1,(sp+40) (uint16_t )(CT_LE_W(in_val)); 8018a38: 22 10 ff ff andi r16,r16,0xffff 8018a3c: 34 02 00 08 mvi r2,8 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 8018a40: b4 2d 68 00 add r13,r1,r13 8018a44: ba 00 08 00 mv r1,r16 8018a48: fb ff a1 e8 calli 80011e8 <__ashlsi3> 8018a4c: b8 20 60 00 mv r12,r1 8018a50: 34 02 00 08 mvi r2,8 8018a54: ba 00 08 00 mv r1,r16 8018a58: f8 00 52 80 calli 802d458 <__lshrsi3> 8018a5c: b9 81 08 00 or r1,r12,r1 8018a60: 0d a1 00 00 sh (r13+0),r1 8018a64: e0 00 00 0f bi 8018aa0 (uint16_t )(CT_LE_W(in_val)); fat_buf_mark_modified(fs_info); break; case FAT_FAT32: fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK)); 8018a68: 78 02 08 02 mvhi r2,0x802 8018a6c: 38 42 e7 70 ori r2,r2,0xe770 8018a70: 28 41 00 00 lw r1,(r2+0) 8018a74: a2 01 08 00 and r1,r16,r1 8018a78: fb ff fe a0 calli 80184f8 8018a7c: b8 20 60 00 mv r12,r1 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 8018a80: 2b 81 00 28 lw r1,(sp+40) 8018a84: b4 2d 68 00 add r13,r1,r13 8018a88: 78 01 f0 00 mvhi r1,0xf000 8018a8c: fb ff fe 9b calli 80184f8 8018a90: 29 a2 00 00 lw r2,(r13+0) 8018a94: a0 22 10 00 and r2,r1,r2 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 8018a98: b8 4c 10 00 or r2,r2,r12 8018a9c: 59 a2 00 00 sw (r13+0),r2 8018aa0: 34 01 00 01 mvi r1,1 8018aa4: 31 61 00 88 sb (r11+136),r1 fat_buf_mark_modified(fs_info); break; 8018aa8: e0 00 00 05 bi 8018abc default: rtems_set_errno_and_return_minus_one(EIO); 8018aac: f8 00 08 6a calli 801ac54 <__errno> <== NOT EXECUTED 8018ab0: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8018ab4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8018ab8: 34 0e ff ff mvi r14,-1 <== NOT EXECUTED break; } return RC_OK; } 8018abc: b9 c0 08 00 mv r1,r14 8018ac0: 2b 9d 00 04 lw ra,(sp+4) 8018ac4: 2b 8b 00 24 lw r11,(sp+36) 8018ac8: 2b 8c 00 20 lw r12,(sp+32) 8018acc: 2b 8d 00 1c lw r13,(sp+28) 8018ad0: 2b 8e 00 18 lw r14,(sp+24) 8018ad4: 2b 8f 00 14 lw r15,(sp+20) 8018ad8: 2b 90 00 10 lw r16,(sp+16) 8018adc: 2b 91 00 0c lw r17,(sp+12) 8018ae0: 2b 92 00 08 lw r18,(sp+8) 8018ae4: 37 9c 00 28 addi sp,sp,40 8018ae8: c3 a0 00 00 ret =============================================================================== 08011054 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 8011054: 37 9c ff e8 addi sp,sp,-24 8011058: 5b 8b 00 18 sw (sp+24),r11 801105c: 5b 8c 00 14 sw (sp+20),r12 8011060: 5b 8d 00 10 sw (sp+16),r13 8011064: 5b 8e 00 0c sw (sp+12),r14 8011068: 5b 8f 00 08 sw (sp+8),r15 801106c: 5b 9d 00 04 sw (sp+4),ra 8011070: b8 20 58 00 mv r11,r1 int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 8011074: fb ff ff b6 calli 8010f4c 8011078: b8 20 60 00 mv r12,r1 if ( rc != RC_OK ) 801107c: 44 20 00 02 be r1,r0,8011084 <== ALWAYS TAKEN rc = -1; 8011080: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8011084: 34 0d 00 00 mvi r13,0 for (i = 0; i < FAT_HASH_SIZE; i++) 8011088: 34 0e 00 18 mvi r14,24 { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; 801108c: 29 6f 00 6c lw r15,(r11+108) 8011090: b5 ed 78 00 add r15,r15,r13 while ( (node = rtems_chain_get(the_chain)) != NULL ) 8011094: e0 00 00 02 bi 801109c free(node); 8011098: fb ff c7 cd calli 8002fcc */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 801109c: b9 e0 08 00 mv r1,r15 80110a0: fb ff d4 66 calli 8006238 <_Chain_Get> for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; while ( (node = rtems_chain_get(the_chain)) != NULL ) 80110a4: 5c 20 ff fd bne r1,r0,8011098 80110a8: 35 ad 00 0c addi r13,r13,12 rc = fat_sync(fs_info); if ( rc != RC_OK ) rc = -1; for (i = 0; i < FAT_HASH_SIZE; i++) 80110ac: 5d ae ff f8 bne r13,r14,801108c 80110b0: 34 0d 00 00 mvi r13,0 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } for (i = 0; i < FAT_HASH_SIZE; i++) 80110b4: 34 0e 00 18 mvi r14,24 { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; 80110b8: 29 6f 00 70 lw r15,(r11+112) 80110bc: b5 ed 78 00 add r15,r15,r13 while ( (node = rtems_chain_get(the_chain)) != NULL ) 80110c0: e0 00 00 02 bi 80110c8 free(node); 80110c4: fb ff c7 c2 calli 8002fcc <== NOT EXECUTED 80110c8: b9 e0 08 00 mv r1,r15 80110cc: fb ff d4 5b calli 8006238 <_Chain_Get> for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; while ( (node = rtems_chain_get(the_chain)) != NULL ) 80110d0: 5c 20 ff fd bne r1,r0,80110c4 <== NEVER TAKEN 80110d4: 35 ad 00 0c addi r13,r13,12 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } for (i = 0; i < FAT_HASH_SIZE; i++) 80110d8: 5d ae ff f8 bne r13,r14,80110b8 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); 80110dc: 29 61 00 6c lw r1,(r11+108) 80110e0: fb ff c7 bb calli 8002fcc free(fs_info->rhash); 80110e4: 29 61 00 70 lw r1,(r11+112) 80110e8: fb ff c7 b9 calli 8002fcc free(fs_info->uino); 80110ec: 29 61 00 74 lw r1,(r11+116) 80110f0: fb ff c7 b7 calli 8002fcc free(fs_info->sec_buf); 80110f4: 29 61 00 90 lw r1,(r11+144) 80110f8: fb ff c7 b5 calli 8002fcc close(fs_info->vol.fd); 80110fc: 29 61 00 60 lw r1,(r11+96) 8011100: fb ff c7 88 calli 8002f20 if (rc) 8011104: 45 80 00 04 be r12,r0,8011114 <== ALWAYS TAKEN errno = EIO; 8011108: f8 00 26 d3 calli 801ac54 <__errno> <== NOT EXECUTED 801110c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8011110: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED return rc; } 8011114: b9 80 08 00 mv r1,r12 8011118: 2b 9d 00 04 lw ra,(sp+4) 801111c: 2b 8b 00 18 lw r11,(sp+24) 8011120: 2b 8c 00 14 lw r12,(sp+20) 8011124: 2b 8d 00 10 lw r13,(sp+16) 8011128: 2b 8e 00 0c lw r14,(sp+12) 801112c: 2b 8f 00 08 lw r15,(sp+8) 8011130: 37 9c 00 18 addi sp,sp,24 8011134: c3 a0 00 00 ret =============================================================================== 08010f4c : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 8010f4c: 37 9c ff e8 addi sp,sp,-24 8010f50: 5b 8b 00 14 sw (sp+20),r11 8010f54: 5b 8c 00 10 sw (sp+16),r12 8010f58: 5b 8d 00 0c sw (sp+12),r13 8010f5c: 5b 8e 00 08 sw (sp+8),r14 8010f60: 5b 9d 00 04 sw (sp+4),ra static int fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info) { ssize_t ret1 = 0, ret2 = 0; if (fs_info->vol.type == FAT_FAT32) 8010f64: 40 23 00 0e lbu r3,(r1+14) return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 8010f68: b8 20 58 00 mv r11,r1 static int fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info) { ssize_t ret1 = 0, ret2 = 0; if (fs_info->vol.type == FAT_FAT32) 8010f6c: 34 01 00 04 mvi r1,4 * RC_OK on success, or -1 if error occured (errno set appropriately) */ static int fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info) { ssize_t ret1 = 0, ret2 = 0; 8010f70: 34 02 00 00 mvi r2,0 8010f74: 34 0e 00 00 mvi r14,0 if (fs_info->vol.type == FAT_FAT32) 8010f78: 5c 61 00 1e bne r3,r1,8010ff0 { uint32_t free_count = fs_info->vol.free_cls; 8010f7c: 29 6d 00 44 lw r13,(r11+68) uint32_t next_free = fs_info->vol.next_cl; if (free_count != fs_info->vol.free_cls_in_fs_info) 8010f80: 29 61 00 48 lw r1,(r11+72) ssize_t ret1 = 0, ret2 = 0; if (fs_info->vol.type == FAT_FAT32) { uint32_t free_count = fs_info->vol.free_cls; uint32_t next_free = fs_info->vol.next_cl; 8010f84: 29 6c 00 4c lw r12,(r11+76) if (free_count != fs_info->vol.free_cls_in_fs_info) 8010f88: 45 a1 00 0c be r13,r1,8010fb8 <== ALWAYS TAKEN { uint32_t le_free_count = CT_LE_L(free_count); 8010f8c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8010f90: fb ff fb 9d calli 800fe04 <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; ret1 = fat_sector_write(fs_info, 8010f94: 2d 62 00 40 lhu r2,(r11+64) <== NOT EXECUTED uint32_t free_count = fs_info->vol.free_cls; uint32_t next_free = fs_info->vol.next_cl; if (free_count != fs_info->vol.free_cls_in_fs_info) { uint32_t le_free_count = CT_LE_L(free_count); 8010f98: 5b 81 00 18 sw (sp+24),r1 <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; 8010f9c: 59 6d 00 48 sw (r11+72),r13 <== NOT EXECUTED ret1 = fat_sector_write(fs_info, 8010fa0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8010fa4: 34 03 01 e8 mvi r3,488 <== NOT EXECUTED 8010fa8: 34 04 00 04 mvi r4,4 <== NOT EXECUTED 8010fac: 37 85 00 18 addi r5,sp,24 <== NOT EXECUTED 8010fb0: fb ff fc a6 calli 8010248 <== NOT EXECUTED 8010fb4: b8 20 70 00 mv r14,r1 <== NOT EXECUTED FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET, sizeof(le_free_count), &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) 8010fb8: 29 61 00 50 lw r1,(r11+80) * RC_OK on success, or -1 if error occured (errno set appropriately) */ static int fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info) { ssize_t ret1 = 0, ret2 = 0; 8010fbc: 34 02 00 00 mvi r2,0 FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET, sizeof(le_free_count), &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) 8010fc0: 45 81 00 0c be r12,r1,8010ff0 <== NEVER TAKEN { uint32_t le_next_free = CT_LE_L(next_free); 8010fc4: b9 80 08 00 mv r1,r12 8010fc8: fb ff fb 8f calli 800fe04 fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 8010fcc: 2d 62 00 40 lhu r2,(r11+64) &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) { uint32_t le_next_free = CT_LE_L(next_free); 8010fd0: 5b 81 00 18 sw (sp+24),r1 fs_info->vol.next_cl_in_fs_info = next_free; 8010fd4: 59 6c 00 50 sw (r11+80),r12 ret2 = fat_sector_write(fs_info, 8010fd8: b9 60 08 00 mv r1,r11 8010fdc: 34 03 01 ec mvi r3,492 8010fe0: 34 04 00 04 mvi r4,4 8010fe4: 37 85 00 18 addi r5,sp,24 8010fe8: fb ff fc 98 calli 8010248 8010fec: b8 20 10 00 mv r2,r1 sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 8010ff0: b8 40 08 00 mv r1,r2 8010ff4: 34 02 00 1f mvi r2,31 8010ff8: f8 00 71 18 calli 802d458 <__lshrsi3> 8010ffc: b8 20 60 00 mv r12,r1 8011000: 34 02 00 1f mvi r2,31 8011004: b9 c0 08 00 mv r1,r14 8011008: f8 00 71 14 calli 802d458 <__lshrsi3> 801100c: b9 81 08 00 or r1,r12,r1 8011010: 20 2c 00 ff andi r12,r1,0xff rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; fat_buf_release(fs_info); 8011014: b9 60 08 00 mv r1,r11 8011018: fb ff fb 9b calli 800fe84 if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 801101c: 29 61 00 64 lw r1,(r11+100) { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 8011020: 65 8c 00 00 cmpei r12,r12,0 8011024: 35 8c ff ff addi r12,r12,-1 fat_buf_release(fs_info); if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 8011028: fb ff f3 ca calli 800df50 801102c: 44 20 00 02 be r1,r0,8011034 <== ALWAYS TAKEN rc = -1; 8011030: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED return rc; } 8011034: b9 80 08 00 mv r1,r12 8011038: 2b 9d 00 04 lw ra,(sp+4) 801103c: 2b 8b 00 14 lw r11,(sp+20) 8011040: 2b 8c 00 10 lw r12,(sp+16) 8011044: 2b 8d 00 0c lw r13,(sp+12) 8011048: 2b 8e 00 08 lw r14,(sp+8) 801104c: 37 9c 00 18 addi sp,sp,24 8011050: c3 a0 00 00 ret =============================================================================== 08033ab8 : /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { 8033ab8: 37 9c ff 90 addi sp,sp,-112 8033abc: 5b 8b 00 10 sw (sp+16),r11 8033ac0: 5b 8c 00 0c sw (sp+12),r12 8033ac4: 5b 8d 00 08 sw (sp+8),r13 8033ac8: 5b 9d 00 04 sw (sp+4),ra st.st_mode = 0; st.st_uid = 0; st.st_gid = 0; rtems_libio_check_fd( fd ); 8033acc: 78 02 08 06 mvhi r2,0x806 8033ad0: 38 42 60 10 ori r2,r2,0x6010 8033ad4: 28 42 00 00 lw r2,(r2+0) int rv = 0; rtems_libio_t *iop; struct stat st; rtems_filesystem_location_info_t loc; st.st_mode = 0; 8033ad8: 5b 80 00 20 sw (sp+32),r0 st.st_uid = 0; 8033adc: 0f 80 00 26 sh (sp+38),r0 st.st_gid = 0; 8033ae0: 0f 80 00 28 sh (sp+40),r0 rtems_libio_check_fd( fd ); 8033ae4: 54 41 00 02 bgu r2,r1,8033aec 8033ae8: e0 00 00 0a bi 8033b10 iop = rtems_libio_iop( fd ); 8033aec: 78 0b 08 06 mvhi r11,0x806 8033af0: 39 6b 9f 60 ori r11,r11,0x9f60 8033af4: 34 02 00 2c mvi r2,44 8033af8: f8 00 92 ec calli 80586a8 <__mulsi3> 8033afc: 29 6c 00 00 lw r12,(r11+0) 8033b00: b5 81 60 00 add r12,r12,r1 rtems_libio_check_is_open( iop ); 8033b04: 29 81 00 08 lw r1,(r12+8) 8033b08: 20 21 01 00 andi r1,r1,0x100 8033b0c: 5c 20 00 06 bne r1,r0,8033b24 8033b10: f8 00 14 9f calli 8038d8c <__errno> 8033b14: 34 02 00 09 mvi r2,9 8033b18: 58 22 00 00 sw (r1+0),r2 8033b1c: 34 0b ff ff mvi r11,-1 8033b20: e0 00 00 23 bi 8033bac if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } 8033b24: 29 81 00 20 lw r1,(r12+32) rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, &st ); 8033b28: 35 8d 00 0c addi r13,r12,12 const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->lock_h)( mt_entry ); 8033b2c: 28 22 00 0c lw r2,(r1+12) 8033b30: 28 42 00 00 lw r2,(r2+0) 8033b34: d8 40 00 00 call r2 8033b38: 29 81 00 1c lw r1,(r12+28) 8033b3c: 37 82 00 14 addi r2,sp,20 8033b40: 28 23 00 18 lw r3,(r1+24) 8033b44: b9 a0 08 00 mv r1,r13 8033b48: d8 60 00 00 call r3 8033b4c: b8 20 58 00 mv r11,r1 if ( rv == 0 ) { 8033b50: 5c 20 00 0f bne r1,r0,8033b8c <== NEVER TAKEN bool access_ok = rtems_filesystem_check_access( 8033b54: 2b 82 00 20 lw r2,(sp+32) 8033b58: 2f 83 00 26 lhu r3,(sp+38) 8033b5c: 2f 84 00 28 lhu r4,(sp+40) 8033b60: 34 01 00 01 mvi r1,1 8033b64: fb ff 5d 10 calli 800afa4 st.st_mode, st.st_uid, st.st_gid ); if ( access_ok ) { 8033b68: 44 2b 00 05 be r1,r11,8033b7c rtems_filesystem_location_clone( &loc, &iop->pathinfo ); 8033b6c: 37 81 00 5c addi r1,sp,92 8033b70: b9 a0 10 00 mv r2,r13 8033b74: fb ff 5b 2a calli 800a81c 8033b78: e0 00 00 05 bi 8033b8c } else { errno = EACCES; 8033b7c: f8 00 14 84 calli 8038d8c <__errno> 8033b80: 34 02 00 0d mvi r2,13 8033b84: 58 22 00 00 sw (r1+0),r2 rv = -1; 8033b88: 34 0b ff ff mvi r11,-1 if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } 8033b8c: 29 81 00 20 lw r1,(r12+32) const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->unlock_h)( mt_entry ); 8033b90: 28 22 00 0c lw r2,(r1+12) 8033b94: 28 42 00 04 lw r2,(r2+4) 8033b98: d8 40 00 00 call r2 rv = -1; } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { 8033b9c: 5d 60 00 04 bne r11,r0,8033bac rv = rtems_filesystem_chdir( &loc ); 8033ba0: 37 81 00 5c addi r1,sp,92 8033ba4: fb ff bb 95 calli 80229f8 8033ba8: b8 20 58 00 mv r11,r1 } return rv; } 8033bac: b9 60 08 00 mv r1,r11 8033bb0: 2b 9d 00 04 lw ra,(sp+4) 8033bb4: 2b 8b 00 10 lw r11,(sp+16) 8033bb8: 2b 8c 00 0c lw r12,(sp+12) 8033bbc: 2b 8d 00 08 lw r13,(sp+8) 8033bc0: 37 9c 00 70 addi sp,sp,112 8033bc4: c3 a0 00 00 ret =============================================================================== 08023054 : /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 8023054: 37 9c ff f4 addi sp,sp,-12 8023058: 5b 8b 00 0c sw (sp+12),r11 802305c: 5b 8c 00 08 sw (sp+8),r12 8023060: 5b 9d 00 04 sw (sp+4),ra int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8023064: 78 03 08 06 mvhi r3,0x806 8023068: 38 63 60 10 ori r3,r3,0x6010 /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 802306c: b8 40 60 00 mv r12,r2 int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8023070: 28 62 00 00 lw r2,(r3+0) 8023074: 54 41 00 02 bgu r2,r1,802307c 8023078: e0 00 00 0a bi 80230a0 iop = rtems_libio_iop( fd ); 802307c: 78 0b 08 06 mvhi r11,0x806 8023080: 39 6b 9f 60 ori r11,r11,0x9f60 8023084: 34 02 00 2c mvi r2,44 8023088: f8 00 d5 88 calli 80586a8 <__mulsi3> 802308c: 29 6b 00 00 lw r11,(r11+0) 8023090: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open(iop); 8023094: 29 61 00 08 lw r1,(r11+8) 8023098: 20 21 01 00 andi r1,r1,0x100 802309c: 5c 20 00 04 bne r1,r0,80230ac 80230a0: f8 00 57 3b calli 8038d8c <__errno> 80230a4: 34 02 00 09 mvi r2,9 80230a8: e0 00 00 15 bi 80230fc if (iop->pathinfo.mt_entry->writeable) { 80230ac: 29 61 00 20 lw r1,(r11+32) 80230b0: 40 22 00 29 lbu r2,(r1+41) 80230b4: 44 40 00 10 be r2,r0,80230f4 <== NEVER TAKEN const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->lock_h)( mt_entry ); 80230b8: 28 22 00 0c lw r2,(r1+12) 80230bc: 28 42 00 00 lw r2,(r2+0) 80230c0: d8 40 00 00 call r2 rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); 80230c4: 29 61 00 20 lw r1,(r11+32) 80230c8: b9 80 10 00 mv r2,r12 80230cc: 28 21 00 0c lw r1,(r1+12) 80230d0: 28 23 00 20 lw r3,(r1+32) 80230d4: 35 61 00 0c addi r1,r11,12 80230d8: d8 60 00 00 call r3 80230dc: b8 20 60 00 mv r12,r1 errno = EROFS; rv = -1; } return rv; } 80230e0: 29 61 00 20 lw r1,(r11+32) const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->unlock_h)( mt_entry ); 80230e4: 28 22 00 0c lw r2,(r1+12) 80230e8: 28 42 00 04 lw r2,(r2+4) 80230ec: d8 40 00 00 call r2 80230f0: e0 00 00 05 bi 8023104 if (iop->pathinfo.mt_entry->writeable) { rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 80230f4: f8 00 57 26 calli 8038d8c <__errno> <== NOT EXECUTED 80230f8: 34 02 00 1e mvi r2,30 <== NOT EXECUTED 80230fc: 58 22 00 00 sw (r1+0),r2 rv = -1; 8023100: 34 0c ff ff mvi r12,-1 } return rv; } 8023104: b9 80 08 00 mv r1,r12 8023108: 2b 9d 00 04 lw ra,(sp+4) 802310c: 2b 8b 00 0c lw r11,(sp+12) 8023110: 2b 8c 00 08 lw r12,(sp+8) 8023114: 37 9c 00 0c addi sp,sp,12 8023118: c3 a0 00 00 ret =============================================================================== 0802311c : /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 802311c: 37 9c ff f0 addi sp,sp,-16 8023120: 5b 8b 00 10 sw (sp+16),r11 8023124: 5b 8c 00 0c sw (sp+12),r12 8023128: 5b 8d 00 08 sw (sp+8),r13 802312c: 5b 9d 00 04 sw (sp+4),ra int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8023130: 78 04 08 06 mvhi r4,0x806 8023134: 38 84 60 10 ori r4,r4,0x6010 /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 8023138: 20 4d ff ff andi r13,r2,0xffff int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 802313c: 28 82 00 00 lw r2,(r4+0) /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 8023140: 20 6c ff ff andi r12,r3,0xffff int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8023144: 54 41 00 02 bgu r2,r1,802314c 8023148: e0 00 00 0a bi 8023170 iop = rtems_libio_iop( fd ); 802314c: 78 0b 08 06 mvhi r11,0x806 8023150: 39 6b 9f 60 ori r11,r11,0x9f60 8023154: 34 02 00 2c mvi r2,44 8023158: f8 00 d5 54 calli 80586a8 <__mulsi3> 802315c: 29 6b 00 00 lw r11,(r11+0) 8023160: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open(iop); 8023164: 29 61 00 08 lw r1,(r11+8) 8023168: 20 21 01 00 andi r1,r1,0x100 802316c: 5c 20 00 04 bne r1,r0,802317c 8023170: f8 00 57 07 calli 8038d8c <__errno> 8023174: 34 02 00 09 mvi r2,9 8023178: e0 00 00 16 bi 80231d0 if (iop->pathinfo.mt_entry->writeable) { 802317c: 29 61 00 20 lw r1,(r11+32) 8023180: 40 22 00 29 lbu r2,(r1+41) 8023184: 44 40 00 11 be r2,r0,80231c8 <== NEVER TAKEN const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->lock_h)( mt_entry ); 8023188: 28 22 00 0c lw r2,(r1+12) 802318c: 28 42 00 00 lw r2,(r2+0) 8023190: d8 40 00 00 call r2 rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( 8023194: 29 61 00 20 lw r1,(r11+32) 8023198: b9 a0 10 00 mv r2,r13 802319c: b9 80 18 00 mv r3,r12 80231a0: 28 21 00 0c lw r1,(r1+12) 80231a4: 28 24 00 24 lw r4,(r1+36) 80231a8: 35 61 00 0c addi r1,r11,12 80231ac: d8 80 00 00 call r4 80231b0: b8 20 60 00 mv r12,r1 errno = EROFS; rv = -1; } return rv; } 80231b4: 29 61 00 20 lw r1,(r11+32) const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->unlock_h)( mt_entry ); 80231b8: 28 22 00 0c lw r2,(r1+12) 80231bc: 28 42 00 04 lw r2,(r2+4) 80231c0: d8 40 00 00 call r2 80231c4: e0 00 00 05 bi 80231d8 owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 80231c8: f8 00 56 f1 calli 8038d8c <__errno> <== NOT EXECUTED 80231cc: 34 02 00 1e mvi r2,30 <== NOT EXECUTED 80231d0: 58 22 00 00 sw (r1+0),r2 rv = -1; 80231d4: 34 0c ff ff mvi r12,-1 } return rv; } 80231d8: b9 80 08 00 mv r1,r12 80231dc: 2b 9d 00 04 lw ra,(sp+4) 80231e0: 2b 8b 00 10 lw r11,(sp+16) 80231e4: 2b 8c 00 0c lw r12,(sp+12) 80231e8: 2b 8d 00 08 lw r13,(sp+8) 80231ec: 37 9c 00 10 addi sp,sp,16 80231f0: c3 a0 00 00 ret =============================================================================== 080343e4 : int fcntl( int fd, int cmd, ... ) { 80343e4: 37 9c ff cc addi sp,sp,-52 80343e8: 5b 8b 00 18 sw (sp+24),r11 80343ec: 5b 8c 00 14 sw (sp+20),r12 80343f0: 5b 8d 00 10 sw (sp+16),r13 80343f4: 5b 8e 00 0c sw (sp+12),r14 80343f8: 5b 8f 00 08 sw (sp+8),r15 80343fc: 5b 9d 00 04 sw (sp+4),ra 8034400: 5b 82 00 1c sw (sp+28),r2 8034404: b8 40 70 00 mv r14,r2 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8034408: 78 02 08 03 mvhi r2,0x803 int fcntl( int fd, int cmd, ... ) { 803440c: 5b 83 00 20 sw (sp+32),r3 8034410: 5b 84 00 24 sw (sp+36),r4 8034414: 5b 85 00 28 sw (sp+40),r5 8034418: 5b 86 00 2c sw (sp+44),r6 803441c: 5b 87 00 30 sw (sp+48),r7 8034420: 5b 88 00 34 sw (sp+52),r8 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8034424: 38 42 b0 14 ori r2,r2,0xb014 8034428: 28 42 00 00 lw r2,(r2+0) ... ) { int ret; va_list ap; va_start( ap, cmd ); 803442c: 37 8f 00 20 addi r15,sp,32 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8034430: 54 41 00 02 bgu r2,r1,8034438 8034434: e0 00 00 0a bi 803445c iop = rtems_libio_iop( fd ); 8034438: 78 0b 08 04 mvhi r11,0x804 803443c: 39 6b b9 8c ori r11,r11,0xb98c 8034440: 34 02 00 2c mvi r2,44 8034444: fb ff 34 75 calli 8001618 <__mulsi3> 8034448: 29 6b 00 00 lw r11,(r11+0) 803444c: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open(iop); 8034450: 29 6c 00 08 lw r12,(r11+8) 8034454: 21 81 01 00 andi r1,r12,0x100 8034458: 5c 20 00 04 bne r1,r0,8034468 803445c: fb ff b2 2b calli 8020d08 <__errno> 8034460: 34 02 00 09 mvi r2,9 8034464: e0 00 00 57 bi 80345c0 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 8034468: 34 01 00 09 mvi r1,9 803446c: 55 c1 00 53 bgu r14,r1,80345b8 8034470: 78 0d 08 03 mvhi r13,0x803 8034474: b9 c0 08 00 mv r1,r14 8034478: 34 02 00 02 mvi r2,2 803447c: fb ff 34 19 calli 80014e0 <__ashlsi3> 8034480: 39 ad a7 c0 ori r13,r13,0xa7c0 8034484: b5 a1 08 00 add r1,r13,r1 8034488: 28 21 00 00 lw r1,(r1+0) 803448c: c0 20 00 00 b r1 /* * FIXME: We ignore the start value fd2 for the file descriptor search. This * is not POSIX conform. */ rtems_libio_t *diop = rtems_libio_allocate(); 8034490: fb ff 49 35 calli 8006964 8034494: b8 20 68 00 mv r13,r1 if (diop != NULL) { 8034498: 44 20 00 56 be r1,r0,80345f0 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 803449c: 29 61 00 08 lw r1,(r11+8) oflag &= ~O_CREAT; 80344a0: 34 0c fd ff mvi r12,-513 * is not POSIX conform. */ rtems_libio_t *diop = rtems_libio_allocate(); if (diop != NULL) { int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 80344a4: fb ff 49 1c calli 8006914 oflag &= ~O_CREAT; 80344a8: a0 2c 60 00 and r12,r1,r12 diop->flags |= rtems_libio_fcntl_flags( oflag ); 80344ac: 29 af 00 08 lw r15,(r13+8) 80344b0: b9 80 08 00 mv r1,r12 80344b4: fb ff 49 02 calli 80068bc 80344b8: b8 2f 08 00 or r1,r1,r15 80344bc: 59 a1 00 08 sw (r13+8),r1 int cmd, int arg ) { return fcntl( fd, cmd, arg ); } 80344c0: 29 61 00 20 lw r1,(r11+32) const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->lock_h)( mt_entry ); 80344c4: 28 22 00 0c lw r2,(r1+12) 80344c8: 28 42 00 00 lw r2,(r2+0) 80344cc: d8 40 00 00 call r2 oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); 80344d0: 35 a1 00 0c addi r1,r13,12 80344d4: 35 62 00 0c addi r2,r11,12 80344d8: fb ff 81 4a calli 8014a00 int cmd, int arg ) { return fcntl( fd, cmd, arg ); } 80344dc: 29 61 00 20 lw r1,(r11+32) const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->unlock_h)( mt_entry ); 80344e0: 28 22 00 0c lw r2,(r1+12) 80344e4: 28 42 00 04 lw r2,(r2+4) 80344e8: d8 40 00 00 call r2 /* * XXX: We call the open handler here to have a proper open and close pair. * * FIXME: What to do with the path? */ rv = (*diop->pathinfo.handlers->open_h)( diop, NULL, oflag, 0 ); 80344ec: 29 a1 00 1c lw r1,(r13+28) 80344f0: b9 80 18 00 mv r3,r12 80344f4: 34 02 00 00 mvi r2,0 80344f8: 28 25 00 00 lw r5,(r1+0) 80344fc: 34 04 00 00 mvi r4,0 8034500: b9 a0 08 00 mv r1,r13 8034504: d8 a0 00 00 call r5 8034508: b8 20 60 00 mv r12,r1 if ( rv == 0 ) { 803450c: 5c 20 00 0c bne r1,r0,803453c <== NEVER TAKEN rv = diop - rtems_libio_iops; 8034510: 78 01 08 04 mvhi r1,0x804 8034514: 38 21 b9 8c ori r1,r1,0xb98c 8034518: 28 21 00 00 lw r1,(r1+0) 803451c: 34 02 00 02 mvi r2,2 8034520: c9 a1 08 00 sub r1,r13,r1 8034524: fb ff fe f8 calli 8034104 <__ashrsi3> 8034528: 78 03 08 03 mvhi r3,0x803 803452c: 38 63 61 a4 ori r3,r3,0x61a4 8034530: 28 62 00 00 lw r2,(r3+0) 8034534: fb ff 34 39 calli 8001618 <__mulsi3> 8034538: e0 00 00 11 bi 803457c } else { rtems_libio_free( diop ); 803453c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8034540: fb ff 49 1f calli 80069bc <== NOT EXECUTED 8034544: e0 00 00 21 bi 80345c8 <== NOT EXECUTED fd2 = va_arg( ap, int ); ret = duplicate_iop( iop, fd2 ); break; case F_GETFD: /* get f_flags */ ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0); 8034548: 21 8c 08 00 andi r12,r12,0x800 803454c: 7d 8c 00 00 cmpnei r12,r12,0 8034550: e0 00 00 1f bi 80345cc * if a new process is exec()'ed. Since RTEMS does not support * processes, then we can ignore this one except to make * F_GETFD work. */ if ( va_arg( ap, int ) ) 8034554: 29 e1 00 00 lw r1,(r15+0) 8034558: 44 20 00 03 be r1,r0,8034564 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 803455c: 39 8c 08 00 ori r12,r12,0x800 8034560: e0 00 00 03 bi 803456c else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 8034564: 34 01 f7 ff mvi r1,-2049 8034568: a1 81 60 00 and r12,r12,r1 803456c: 59 6c 00 08 sw (r11+8),r12 8034570: e0 00 00 0d bi 80345a4 break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 8034574: b9 80 08 00 mv r1,r12 8034578: fb ff 48 e7 calli 8006914 803457c: b8 20 60 00 mv r12,r1 8034580: e0 00 00 12 bi 80345c8 break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 8034584: 29 e1 00 00 lw r1,(r15+0) 8034588: fb ff 48 cd calli 80068bc /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 803458c: 29 63 00 08 lw r3,(r11+8) 8034590: 34 02 fd fe mvi r2,-514 8034594: 20 21 02 01 andi r1,r1,0x201 8034598: a0 43 10 00 and r2,r2,r3 803459c: b8 22 08 00 or r1,r1,r2 80345a0: 59 61 00 08 sw (r11+8),r1 { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 80345a4: 34 0c 00 00 mvi r12,0 80345a8: e0 00 00 09 bi 80345cc errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 80345ac: fb ff b1 d7 calli 8020d08 <__errno> 80345b0: 34 02 00 86 mvi r2,134 80345b4: e0 00 00 03 bi 80345c0 ret = -1; break; default: errno = EINVAL; 80345b8: fb ff b1 d4 calli 8020d08 <__errno> 80345bc: 34 02 00 16 mvi r2,22 80345c0: 58 22 00 00 sw (r1+0),r2 80345c4: e0 00 00 0b bi 80345f0 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 80345c8: 48 0c 00 0b bg r0,r12,80345f4 <== NEVER TAKEN int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 80345cc: 29 61 00 1c lw r1,(r11+28) 80345d0: b9 c0 10 00 mv r2,r14 80345d4: 28 23 00 28 lw r3,(r1+40) 80345d8: b9 60 08 00 mv r1,r11 80345dc: d8 60 00 00 call r3 80345e0: b8 20 58 00 mv r11,r1 if (err) { 80345e4: 44 20 00 04 be r1,r0,80345f4 <== ALWAYS TAKEN errno = err; 80345e8: fb ff b1 c8 calli 8020d08 <__errno> <== NOT EXECUTED 80345ec: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED ret = -1; 80345f0: 34 0c ff ff mvi r12,-1 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 80345f4: b9 80 08 00 mv r1,r12 80345f8: 2b 9d 00 04 lw ra,(sp+4) 80345fc: 2b 8b 00 18 lw r11,(sp+24) 8034600: 2b 8c 00 14 lw r12,(sp+20) 8034604: 2b 8d 00 10 lw r13,(sp+16) 8034608: 2b 8e 00 0c lw r14,(sp+12) 803460c: 2b 8f 00 08 lw r15,(sp+8) 8034610: 37 9c 00 34 addi sp,sp,52 8034614: c3 a0 00 00 ret =============================================================================== 0800a380 : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 800a380: 37 9c ff d8 addi sp,sp,-40 800a384: 5b 8b 00 20 sw (sp+32),r11 800a388: 5b 8c 00 1c sw (sp+28),r12 800a38c: 5b 8d 00 18 sw (sp+24),r13 800a390: 5b 8e 00 14 sw (sp+20),r14 800a394: 5b 8f 00 10 sw (sp+16),r15 800a398: 5b 90 00 0c sw (sp+12),r16 800a39c: 5b 91 00 08 sw (sp+8),r17 800a3a0: 5b 9d 00 04 sw (sp+4),ra static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 800a3a4: 78 0b 08 02 mvhi r11,0x802 800a3a8: 39 6b 47 a8 ori r11,r11,0x47a8 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 800a3ac: b8 20 70 00 mv r14,r1 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 800a3b0: 29 61 00 00 lw r1,(r11+0) int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 800a3b4: b8 40 68 00 mv r13,r2 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 800a3b8: 5c 20 00 19 bne r1,r0,800a41c */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 800a3bc: 78 01 08 02 mvhi r1,0x802 800a3c0: 38 21 48 24 ori r1,r1,0x4824 800a3c4: 28 21 00 00 lw r1,(r1+0) 800a3c8: 34 02 00 00 mvi r2,0 800a3cc: 34 03 00 00 mvi r3,0 800a3d0: fb ff eb 38 calli 80050b0 rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 800a3d4: 29 61 00 00 lw r1,(r11+0) free(pipe); } static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; 800a3d8: 34 0f 00 00 mvi r15,0 if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 800a3dc: 5c 2f 00 0a bne r1,r15,800a404 <== NEVER TAKEN sc = rtems_semaphore_create( 800a3e0: 78 02 08 02 mvhi r2,0x802 800a3e4: 38 42 28 e4 ori r2,r2,0x28e4 800a3e8: 28 41 00 00 lw r1,(r2+0) 800a3ec: 34 03 00 54 mvi r3,84 800a3f0: 34 02 00 01 mvi r2,1 800a3f4: 34 04 00 00 mvi r4,0 800a3f8: b9 60 28 00 mv r5,r11 800a3fc: fb ff ea b0 calli 8004ebc 800a400: b8 20 78 00 mv r15,r1 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 800a404: 78 01 08 02 mvhi r1,0x802 800a408: 38 21 48 24 ori r1,r1,0x4824 800a40c: 28 21 00 00 lw r1,(r1+0) } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 800a410: 34 0c ff f4 mvi r12,-12 800a414: fb ff eb 77 calli 80051f0 800a418: 5d e0 00 d8 bne r15,r0,800a778 sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 800a41c: 78 01 08 02 mvhi r1,0x802 800a420: 38 21 47 a8 ori r1,r1,0x47a8 800a424: 28 21 00 00 lw r1,(r1+0) 800a428: 34 02 00 00 mvi r2,0 800a42c: 34 03 00 00 mvi r3,0 800a430: fb ff eb 20 calli 80050b0 } if (sc == RTEMS_SUCCESSFUL) { 800a434: 34 0c ff f4 mvi r12,-12 800a438: 5c 20 00 d0 bne r1,r0,800a778 <== NEVER TAKEN err = pipe_lock(); if (err) return err; pipe = *pipep; 800a43c: 29 cb 00 00 lw r11,(r14+0) if (pipe == NULL) { 800a440: 5d 61 00 57 bne r11,r1,800a59c { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 800a444: 34 01 00 34 mvi r1,52 800a448: fb ff e2 38 calli 8002d28 800a44c: b8 20 58 00 mv r11,r1 800a450: b8 20 78 00 mv r15,r1 if (pipe == NULL) 800a454: 44 20 00 50 be r1,r0,800a594 return err; memset(pipe, 0, sizeof(pipe_control_t)); 800a458: 34 02 00 00 mvi r2,0 800a45c: 34 03 00 34 mvi r3,52 800a460: f8 00 17 4d calli 8010194 pipe->Size = PIPE_BUF; 800a464: 34 01 02 00 mvi r1,512 800a468: 59 61 00 04 sw (r11+4),r1 pipe->Buffer = malloc(pipe->Size); 800a46c: fb ff e2 2f calli 8002d28 800a470: 59 61 00 00 sw (r11+0),r1 if (! pipe->Buffer) 800a474: 44 20 00 46 be r1,r0,800a58c <== NEVER TAKEN goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), 800a478: 78 0c 08 02 mvhi r12,0x802 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 800a47c: 78 03 08 02 mvhi r3,0x802 800a480: 38 63 28 e8 ori r3,r3,0x28e8 rtems_build_name ('P', 'I', 'r', c), 800a484: 39 8c 41 b0 ori r12,r12,0x41b0 800a488: 41 82 00 00 lbu r2,(r12+0) if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 800a48c: 28 61 00 00 lw r1,(r3+0) 800a490: 35 64 00 2c addi r4,r11,44 800a494: 34 03 00 00 mvi r3,0 800a498: b8 41 08 00 or r1,r2,r1 800a49c: 34 02 00 00 mvi r2,0 800a4a0: f8 00 06 e6 calli 800c038 800a4a4: b8 20 88 00 mv r17,r1 800a4a8: 5c 20 00 37 bne r1,r0,800a584 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 800a4ac: 78 03 08 02 mvhi r3,0x802 800a4b0: 38 63 28 ec ori r3,r3,0x28ec rtems_build_name ('P', 'I', 'w', c), 800a4b4: 41 82 00 00 lbu r2,(r12+0) if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 800a4b8: 28 61 00 00 lw r1,(r3+0) 800a4bc: 35 64 00 30 addi r4,r11,48 800a4c0: 34 03 00 00 mvi r3,0 800a4c4: b8 41 08 00 or r1,r2,r1 800a4c8: 34 02 00 00 mvi r2,0 800a4cc: f8 00 06 db calli 800c038 800a4d0: b8 20 80 00 mv r16,r1 800a4d4: 5c 31 00 2a bne r1,r17,800a57c rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 800a4d8: 78 03 08 02 mvhi r3,0x802 800a4dc: 38 63 28 f0 ori r3,r3,0x28f0 rtems_build_name ('P', 'I', 's', c), 1, 800a4e0: 41 82 00 00 lbu r2,(r12+0) if (rtems_barrier_create( rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 800a4e4: 28 61 00 00 lw r1,(r3+0) 800a4e8: 34 04 00 00 mvi r4,0 800a4ec: 34 03 00 10 mvi r3,16 800a4f0: b8 41 08 00 or r1,r2,r1 800a4f4: 35 65 00 28 addi r5,r11,40 800a4f8: 34 02 00 01 mvi r2,1 800a4fc: fb ff ea 70 calli 8004ebc 800a500: 5c 30 00 1d bne r1,r16,800a574 Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) _Objects_Get( &_Barrier_Information, id, location ); 800a504: 29 62 00 2c lw r2,(r11+44) 800a508: 78 0f 08 02 mvhi r15,0x802 800a50c: 39 ef 51 c8 ori r15,r15,0x51c8 /* Set barriers to be interruptible by signals. */ static void pipe_interruptible(pipe_control_t *pipe) { Objects_Locations location; _Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state 800a510: 37 91 00 24 addi r17,sp,36 800a514: ba 20 18 00 mv r3,r17 800a518: b9 e0 08 00 mv r1,r15 800a51c: fb ff f1 e1 calli 8006ca0 <_Objects_Get> |= STATES_INTERRUPTIBLE_BY_SIGNAL; 800a520: 28 22 00 4c lw r2,(r1+76) 800a524: 78 10 10 00 mvhi r16,0x1000 800a528: b8 50 10 00 or r2,r2,r16 800a52c: 58 22 00 4c sw (r1+76),r2 _Thread_Enable_dispatch(); 800a530: fb ff f5 a5 calli 8007bc4 <_Thread_Enable_dispatch> 800a534: 29 62 00 30 lw r2,(r11+48) 800a538: ba 20 18 00 mv r3,r17 800a53c: b9 e0 08 00 mv r1,r15 800a540: fb ff f1 d8 calli 8006ca0 <_Objects_Get> _Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 800a544: 28 22 00 4c lw r2,(r1+76) 800a548: b8 50 80 00 or r16,r2,r16 800a54c: 58 30 00 4c sw (r1+76),r16 _Thread_Enable_dispatch(); 800a550: fb ff f5 9d calli 8007bc4 <_Thread_Enable_dispatch> #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 800a554: 41 81 00 00 lbu r1,(r12+0) 800a558: 34 22 00 01 addi r2,r1,1 800a55c: 31 82 00 00 sb (r12+0),r2 800a560: 34 02 00 7a mvi r2,122 800a564: 5c 22 00 0e bne r1,r2,800a59c c = 'a'; 800a568: 34 01 00 61 mvi r1,97 800a56c: 31 81 00 00 sb (r12+0),r1 800a570: e0 00 00 0b bi 800a59c return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 800a574: 29 61 00 30 lw r1,(r11+48) 800a578: f8 00 06 ec calli 800c128 err_wbar: rtems_barrier_delete(pipe->readBarrier); 800a57c: 29 e1 00 2c lw r1,(r15+44) 800a580: f8 00 06 ea calli 800c128 err_rbar: free(pipe->Buffer); 800a584: 29 e1 00 00 lw r1,(r15+0) 800a588: fb ff e0 8d calli 80027bc err_buf: free(pipe); 800a58c: b9 e0 08 00 mv r1,r15 800a590: fb ff e0 8b calli 80027bc if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; 800a594: 34 0c ff f4 mvi r12,-12 800a598: e0 00 00 10 bi 800a5d8 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 800a59c: 29 61 00 28 lw r1,(r11+40) 800a5a0: 34 02 00 00 mvi r2,0 800a5a4: 34 03 00 00 mvi r3,0 800a5a8: fb ff ea c2 calli 80050b0 800a5ac: 7c 21 00 00 cmpnei r1,r1,0 800a5b0: 34 02 ff fc mvi r2,-4 800a5b4: c8 01 60 00 sub r12,r0,r1 err = -EINTR; if (*pipep == NULL) { 800a5b8: 29 c1 00 00 lw r1,(r14+0) err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 800a5bc: a1 82 60 00 and r12,r12,r2 err = -EINTR; if (*pipep == NULL) { 800a5c0: 5c 20 00 06 bne r1,r0,800a5d8 if (err) 800a5c4: 45 81 00 04 be r12,r1,800a5d4 <== ALWAYS TAKEN pipe_free(pipe); 800a5c8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800a5cc: fb ff ff 29 calli 800a270 <== NOT EXECUTED 800a5d0: e0 00 00 02 bi 800a5d8 <== NOT EXECUTED else *pipep = pipe; 800a5d4: 59 cb 00 00 sw (r14+0),r11 } out: pipe_unlock(); 800a5d8: fb ff ff 1d calli 800a24c pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 800a5dc: 5d 80 00 67 bne r12,r0,800a778 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 800a5e0: 29 a1 00 08 lw r1,(r13+8) 800a5e4: 34 02 00 04 mvi r2,4 int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; 800a5e8: 29 cb 00 00 lw r11,(r14+0) switch (LIBIO_ACCMODE(iop)) { 800a5ec: 20 21 00 06 andi r1,r1,0x6 800a5f0: 44 22 00 24 be r1,r2,800a680 800a5f4: 34 02 00 06 mvi r2,6 800a5f8: 44 22 00 45 be r1,r2,800a70c 800a5fc: 34 02 00 02 mvi r2,2 800a600: 5c 22 00 57 bne r1,r2,800a75c <== NEVER TAKEN case LIBIO_FLAGS_READ: pipe->readerCounter ++; 800a604: 29 61 00 20 lw r1,(r11+32) 800a608: 34 21 00 01 addi r1,r1,1 800a60c: 59 61 00 20 sw (r11+32),r1 if (pipe->Readers ++ == 0) 800a610: 29 61 00 10 lw r1,(r11+16) 800a614: 34 22 00 01 addi r2,r1,1 800a618: 59 62 00 10 sw (r11+16),r2 800a61c: 5c 20 00 04 bne r1,r0,800a62c <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); 800a620: 29 61 00 30 lw r1,(r11+48) 800a624: 37 82 00 28 addi r2,sp,40 800a628: f8 00 06 f0 calli 800c1e8 if (pipe->Writers == 0) { 800a62c: 29 61 00 14 lw r1,(r11+20) 800a630: 5c 20 00 4b bne r1,r0,800a75c /* Not an error */ if (LIBIO_NODELAY(iop)) 800a634: 29 a2 00 08 lw r2,(r13+8) 800a638: 20 42 00 01 andi r2,r2,0x1 800a63c: 5c 41 00 48 bne r2,r1,800a75c break; prevCounter = pipe->writerCounter; 800a640: 29 70 00 24 lw r16,(r11+36) err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 800a644: 29 61 00 28 lw r1,(r11+40) 800a648: fb ff ea ea calli 80051f0 if (! PIPE_READWAIT(pipe)) 800a64c: 29 61 00 2c lw r1,(r11+44) 800a650: 34 02 00 00 mvi r2,0 800a654: f8 00 07 02 calli 800c25c 800a658: b8 20 78 00 mv r15,r1 800a65c: 5c 20 00 43 bne r1,r0,800a768 <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) 800a660: 29 61 00 28 lw r1,(r11+40) 800a664: 34 02 00 00 mvi r2,0 800a668: 34 03 00 00 mvi r3,0 800a66c: fb ff ea 91 calli 80050b0 800a670: 5c 2f 00 3e bne r1,r15,800a768 <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->writerCounter); 800a674: 29 61 00 24 lw r1,(r11+36) 800a678: 46 01 ff f3 be r16,r1,800a644 <== NEVER TAKEN 800a67c: e0 00 00 38 bi 800a75c } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 800a680: 29 61 00 24 lw r1,(r11+36) 800a684: 34 21 00 01 addi r1,r1,1 800a688: 59 61 00 24 sw (r11+36),r1 if (pipe->Writers ++ == 0) 800a68c: 29 61 00 14 lw r1,(r11+20) 800a690: 34 22 00 01 addi r2,r1,1 800a694: 59 62 00 14 sw (r11+20),r2 800a698: 5c 20 00 04 bne r1,r0,800a6a8 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 800a69c: 29 61 00 2c lw r1,(r11+44) 800a6a0: 37 82 00 28 addi r2,sp,40 800a6a4: f8 00 06 d1 calli 800c1e8 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 800a6a8: 29 61 00 10 lw r1,(r11+16) 800a6ac: 5c 20 00 2c bne r1,r0,800a75c 800a6b0: 29 a2 00 08 lw r2,(r13+8) 800a6b4: 20 42 00 01 andi r2,r2,0x1 800a6b8: 44 41 00 05 be r2,r1,800a6cc PIPE_UNLOCK(pipe); 800a6bc: 29 61 00 28 lw r1,(r11+40) err = -ENXIO; 800a6c0: 34 0c ff fa mvi r12,-6 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); 800a6c4: fb ff ea cb calli 80051f0 err = -ENXIO; goto out_error; 800a6c8: e0 00 00 29 bi 800a76c } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; 800a6cc: 29 70 00 20 lw r16,(r11+32) err = -EINTR; do { PIPE_UNLOCK(pipe); 800a6d0: 29 61 00 28 lw r1,(r11+40) 800a6d4: fb ff ea c7 calli 80051f0 if (! PIPE_WRITEWAIT(pipe)) 800a6d8: 29 61 00 30 lw r1,(r11+48) 800a6dc: 34 02 00 00 mvi r2,0 800a6e0: f8 00 06 df calli 800c25c 800a6e4: b8 20 78 00 mv r15,r1 800a6e8: 5c 20 00 20 bne r1,r0,800a768 <== NEVER TAKEN goto out_error; if (! PIPE_LOCK(pipe)) 800a6ec: 29 61 00 28 lw r1,(r11+40) 800a6f0: 34 02 00 00 mvi r2,0 800a6f4: 34 03 00 00 mvi r3,0 800a6f8: fb ff ea 6e calli 80050b0 800a6fc: 5c 2f 00 1b bne r1,r15,800a768 <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->readerCounter); 800a700: 29 61 00 20 lw r1,(r11+32) 800a704: 46 01 ff f3 be r16,r1,800a6d0 <== NEVER TAKEN 800a708: e0 00 00 15 bi 800a75c } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 800a70c: 29 61 00 20 lw r1,(r11+32) 800a710: 34 21 00 01 addi r1,r1,1 800a714: 59 61 00 20 sw (r11+32),r1 if (pipe->Readers ++ == 0) 800a718: 29 61 00 10 lw r1,(r11+16) 800a71c: 34 22 00 01 addi r2,r1,1 800a720: 59 62 00 10 sw (r11+16),r2 800a724: 5c 20 00 04 bne r1,r0,800a734 <== NEVER TAKEN PIPE_WAKEUPWRITERS(pipe); 800a728: 29 61 00 30 lw r1,(r11+48) 800a72c: 37 82 00 28 addi r2,sp,40 800a730: f8 00 06 ae calli 800c1e8 pipe->writerCounter ++; 800a734: 29 61 00 24 lw r1,(r11+36) 800a738: 34 21 00 01 addi r1,r1,1 800a73c: 59 61 00 24 sw (r11+36),r1 if (pipe->Writers ++ == 0) 800a740: 29 61 00 14 lw r1,(r11+20) 800a744: 34 22 00 01 addi r2,r1,1 800a748: 59 62 00 14 sw (r11+20),r2 800a74c: 5c 20 00 04 bne r1,r0,800a75c <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 800a750: 29 61 00 2c lw r1,(r11+44) 800a754: 37 82 00 28 addi r2,sp,40 800a758: f8 00 06 a4 calli 800c1e8 break; } PIPE_UNLOCK(pipe); 800a75c: 29 61 00 28 lw r1,(r11+40) 800a760: fb ff ea a4 calli 80051f0 return 0; 800a764: e0 00 00 05 bi 800a778 goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; 800a768: 34 0c ff fc mvi r12,-4 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 800a76c: b9 c0 08 00 mv r1,r14 800a770: b9 a0 10 00 mv r2,r13 800a774: fb ff fe d1 calli 800a2b8 return err; } 800a778: b9 80 08 00 mv r1,r12 800a77c: 2b 9d 00 04 lw ra,(sp+4) 800a780: 2b 8b 00 20 lw r11,(sp+32) 800a784: 2b 8c 00 1c lw r12,(sp+28) 800a788: 2b 8d 00 18 lw r13,(sp+24) 800a78c: 2b 8e 00 14 lw r14,(sp+20) 800a790: 2b 8f 00 10 lw r15,(sp+16) 800a794: 2b 90 00 0c lw r16,(sp+12) 800a798: 2b 91 00 08 lw r17,(sp+8) 800a79c: 37 9c 00 28 addi sp,sp,40 800a7a0: c3 a0 00 00 ret =============================================================================== 08008838 : */ long fpathconf( int fd, int name ) { 8008838: 37 9c ff f0 addi sp,sp,-16 800883c: 5b 8b 00 10 sw (sp+16),r11 8008840: 5b 8c 00 0c sw (sp+12),r12 8008844: 5b 8d 00 08 sw (sp+8),r13 8008848: 5b 9d 00 04 sw (sp+4),ra long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 800884c: 78 03 08 01 mvhi r3,0x801 8008850: 38 63 40 04 ori r3,r3,0x4004 */ long fpathconf( int fd, int name ) { 8008854: b8 40 68 00 mv r13,r2 long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 8008858: 28 62 00 00 lw r2,(r3+0) 800885c: 54 41 00 02 bgu r2,r1,8008864 8008860: e0 00 00 0a bi 8008888 iop = rtems_libio_iop(fd); 8008864: 78 0b 08 01 mvhi r11,0x801 8008868: 34 02 00 2c mvi r2,44 800886c: f8 00 1e f9 calli 8010450 <__mulsi3> 8008870: 39 6b 47 b8 ori r11,r11,0x47b8 8008874: 29 63 00 00 lw r3,(r11+0) 8008878: b4 61 18 00 add r3,r3,r1 rtems_libio_check_is_open(iop); 800887c: 28 61 00 08 lw r1,(r3+8) 8008880: 20 21 01 00 andi r1,r1,0x100 8008884: 5c 20 00 04 bne r1,r0,8008894 <== ALWAYS TAKEN 8008888: f8 00 0b e4 calli 800b818 <__errno> 800888c: 34 02 00 09 mvi r2,9 8008890: e0 00 00 27 bi 800892c /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; 8008894: 28 61 00 20 lw r1,(r3+32) 8008898: 28 2b 00 2c lw r11,(r1+44) switch ( name ) { 800889c: 34 01 00 0b mvi r1,11 80088a0: 55 a1 00 21 bgu r13,r1,8008924 80088a4: 78 0c 08 01 mvhi r12,0x801 80088a8: b9 a0 08 00 mv r1,r13 80088ac: 34 02 00 02 mvi r2,2 80088b0: f8 00 1e 73 calli 801027c <__ashlsi3> 80088b4: 39 8c 2c bc ori r12,r12,0x2cbc 80088b8: b5 81 08 00 add r1,r12,r1 80088bc: 28 21 00 00 lw r1,(r1+0) 80088c0: c0 20 00 00 b r1 case _PC_LINK_MAX: return_value = the_limits->link_max; 80088c4: 29 61 00 00 lw r1,(r11+0) break; 80088c8: e0 00 00 1b bi 8008934 case _PC_MAX_CANON: return_value = the_limits->max_canon; 80088cc: 29 61 00 04 lw r1,(r11+4) break; 80088d0: e0 00 00 19 bi 8008934 case _PC_MAX_INPUT: return_value = the_limits->max_input; 80088d4: 29 61 00 08 lw r1,(r11+8) break; 80088d8: e0 00 00 17 bi 8008934 case _PC_NAME_MAX: return_value = the_limits->name_max; 80088dc: 29 61 00 0c lw r1,(r11+12) break; 80088e0: e0 00 00 15 bi 8008934 case _PC_PATH_MAX: return_value = the_limits->path_max; 80088e4: 29 61 00 10 lw r1,(r11+16) break; 80088e8: e0 00 00 13 bi 8008934 case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 80088ec: 29 61 00 14 lw r1,(r11+20) break; 80088f0: e0 00 00 11 bi 8008934 case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 80088f4: 29 61 00 1c lw r1,(r11+28) break; 80088f8: e0 00 00 0f bi 8008934 case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 80088fc: 29 61 00 20 lw r1,(r11+32) break; 8008900: e0 00 00 0d bi 8008934 case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 8008904: 29 61 00 2c lw r1,(r11+44) break; 8008908: e0 00 00 0b bi 8008934 case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 800890c: 29 61 00 18 lw r1,(r11+24) break; 8008910: e0 00 00 09 bi 8008934 case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 8008914: 29 61 00 24 lw r1,(r11+36) break; 8008918: e0 00 00 07 bi 8008934 case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 800891c: 29 61 00 28 lw r1,(r11+40) break; 8008920: e0 00 00 05 bi 8008934 default: rtems_set_errno_and_return_minus_one( EINVAL ); 8008924: f8 00 0b bd calli 800b818 <__errno> 8008928: 34 02 00 16 mvi r2,22 800892c: 58 22 00 00 sw (r1+0),r2 8008930: 34 01 ff ff mvi r1,-1 break; } return return_value; } 8008934: 2b 9d 00 04 lw ra,(sp+4) 8008938: 2b 8b 00 10 lw r11,(sp+16) 800893c: 2b 8c 00 0c lw r12,(sp+12) 8008940: 2b 8d 00 08 lw r13,(sp+8) 8008944: 37 9c 00 10 addi sp,sp,16 8008948: c3 a0 00 00 ret =============================================================================== 08002910 : #include void free( void *ptr ) { 8002910: 37 9c ff f4 addi sp,sp,-12 8002914: 5b 8b 00 0c sw (sp+12),r11 8002918: 5b 8c 00 08 sw (sp+8),r12 800291c: 5b 9d 00 04 sw (sp+4),ra 8002920: b8 20 58 00 mv r11,r1 MSBUMP(free_calls, 1); 8002924: 78 01 08 01 mvhi r1,0x801 8002928: 38 21 a8 88 ori r1,r1,0xa888 800292c: 28 22 00 0c lw r2,(r1+12) 8002930: 34 42 00 01 addi r2,r2,1 8002934: 58 22 00 0c sw (r1+12),r2 if ( !ptr ) 8002938: 45 60 00 1f be r11,r0,80029b4 return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 800293c: 78 01 08 01 mvhi r1,0x801 8002940: 38 21 ad f8 ori r1,r1,0xadf8 8002944: 28 22 00 00 lw r2,(r1+0) 8002948: 34 01 00 03 mvi r1,3 800294c: 5c 41 00 06 bne r2,r1,8002964 <== NEVER TAKEN !malloc_is_system_state_OK() ) { 8002950: f8 00 01 20 calli 8002dd0 return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 8002954: 5c 20 00 04 bne r1,r0,8002964 !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); 8002958: b9 60 08 00 mv r1,r11 800295c: f8 00 01 35 calli 8002e30 return; 8002960: e0 00 00 15 bi 80029b4 } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 8002964: 78 01 08 01 mvhi r1,0x801 8002968: 38 21 a7 0c ori r1,r1,0xa70c 800296c: 28 21 00 00 lw r1,(r1+0) 8002970: 44 20 00 04 be r1,r0,8002980 (*rtems_malloc_statistics_helpers->at_free)(ptr); 8002974: 28 22 00 08 lw r2,(r1+8) 8002978: b9 60 08 00 mv r1,r11 800297c: d8 40 00 00 call r2 if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { 8002980: 78 0c 08 01 mvhi r12,0x801 8002984: 39 8c a0 54 ori r12,r12,0xa054 8002988: 29 81 00 00 lw r1,(r12+0) 800298c: b9 60 10 00 mv r2,r11 8002990: f8 00 11 5a calli 8006ef8 <_Protected_heap_Free> 8002994: 5c 20 00 08 bne r1,r0,80029b4 printk( "Program heap: free of bad pointer %p -- range %p - %p \n", ptr, RTEMS_Malloc_Heap->area_begin, 8002998: 29 84 00 00 lw r4,(r12+0) */ if ( rtems_malloc_statistics_helpers ) (*rtems_malloc_statistics_helpers->at_free)(ptr); if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { printk( "Program heap: free of bad pointer %p -- range %p - %p \n", 800299c: 78 01 08 01 mvhi r1,0x801 80029a0: 38 21 89 58 ori r1,r1,0x8958 80029a4: 28 83 00 18 lw r3,(r4+24) 80029a8: 28 84 00 1c lw r4,(r4+28) 80029ac: b9 60 10 00 mv r2,r11 80029b0: f8 00 04 3f calli 8003aac RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } 80029b4: 2b 9d 00 04 lw ra,(sp+4) 80029b8: 2b 8b 00 0c lw r11,(sp+12) 80029bc: 2b 8c 00 08 lw r12,(sp+8) 80029c0: 37 9c 00 0c addi sp,sp,12 80029c4: c3 a0 00 00 ret =============================================================================== 08017db4 : int fstat( int fd, struct stat *sbuf ) { 8017db4: 37 9c ff f4 addi sp,sp,-12 8017db8: 5b 8b 00 0c sw (sp+12),r11 8017dbc: 5b 8c 00 08 sw (sp+8),r12 8017dc0: 5b 9d 00 04 sw (sp+4),ra 8017dc4: b8 40 60 00 mv r12,r2 rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 8017dc8: 5c 40 00 04 bne r2,r0,8017dd8 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); 8017dcc: fb ff e7 c0 calli 8011ccc <__errno> <== NOT EXECUTED 8017dd0: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 8017dd4: e0 00 00 10 bi 8017e14 <== NOT EXECUTED /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 8017dd8: 78 02 08 01 mvhi r2,0x801 8017ddc: 38 42 a0 10 ori r2,r2,0xa010 8017de0: 28 42 00 00 lw r2,(r2+0) 8017de4: 50 22 00 0a bgeu r1,r2,8017e0c 8017de8: 78 0b 08 01 mvhi r11,0x801 8017dec: 39 6b a8 7c ori r11,r11,0xa87c 8017df0: 34 02 00 2c mvi r2,44 8017df4: fb ff ff 48 calli 8017b14 <__mulsi3> 8017df8: 29 6b 00 00 lw r11,(r11+0) 8017dfc: b5 61 58 00 add r11,r11,r1 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 8017e00: 29 61 00 08 lw r1,(r11+8) 8017e04: 20 21 01 00 andi r1,r1,0x100 8017e08: 5c 20 00 06 bne r1,r0,8017e20 /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); rtems_libio_check_fd( fd ); 8017e0c: fb ff e7 b0 calli 8011ccc <__errno> 8017e10: 34 02 00 09 mvi r2,9 8017e14: 58 22 00 00 sw (r1+0),r2 8017e18: 34 01 ff ff mvi r1,-1 8017e1c: e0 00 00 0a bi 8017e44 /* * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); 8017e20: 34 02 00 00 mvi r2,0 8017e24: 34 03 00 48 mvi r3,72 8017e28: b9 80 08 00 mv r1,r12 8017e2c: fb ff ea c1 calli 8012930 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 8017e30: 29 61 00 1c lw r1,(r11+28) 8017e34: b9 80 10 00 mv r2,r12 8017e38: 28 23 00 18 lw r3,(r1+24) 8017e3c: 35 61 00 0c addi r1,r11,12 8017e40: d8 60 00 00 call r3 } 8017e44: 2b 9d 00 04 lw ra,(sp+4) 8017e48: 2b 8b 00 0c lw r11,(sp+12) 8017e4c: 2b 8c 00 08 lw r12,(sp+8) 8017e50: 37 9c 00 0c addi sp,sp,12 8017e54: c3 a0 00 00 ret =============================================================================== 080013b0 : } } static rtems_disk_device * get_disk_entry(dev_t dev, bool lookup_only) { 80013b0: 37 9c ff ec addi sp,sp,-20 80013b4: 5b 8b 00 14 sw (sp+20),r11 80013b8: 5b 8c 00 10 sw (sp+16),r12 80013bc: 5b 8d 00 0c sw (sp+12),r13 80013c0: 5b 8e 00 08 sw (sp+8),r14 80013c4: 5b 9d 00 04 sw (sp+4),ra rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major < disktab_size && disktab != NULL) { 80013c8: 78 04 08 01 mvhi r4,0x801 80013cc: 38 84 a7 54 ori r4,r4,0xa754 } } static rtems_disk_device * get_disk_entry(dev_t dev, bool lookup_only) { 80013d0: b8 40 70 00 mv r14,r2 rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major < disktab_size && disktab != NULL) { 80013d4: 28 82 00 00 lw r2,(r4+0) } } static rtems_disk_device * get_disk_entry(dev_t dev, bool lookup_only) { 80013d8: b8 60 60 00 mv r12,r3 return dd; } } return NULL; 80013dc: 34 0b 00 00 mvi r11,0 rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major < disktab_size && disktab != NULL) { 80013e0: 50 22 00 1a bgeu r1,r2,8001448 <== NEVER TAKEN 80013e4: 78 04 08 01 mvhi r4,0x801 80013e8: 38 84 a7 50 ori r4,r4,0xa750 80013ec: 28 8d 00 00 lw r13,(r4+0) 80013f0: 45 a0 00 16 be r13,r0,8001448 <== NEVER TAKEN rtems_disk_device_table *dtab = disktab + major; 80013f4: 34 02 00 03 mvi r2,3 80013f8: f8 00 59 52 calli 8017940 <__ashlsi3> 80013fc: b5 a1 20 00 add r4,r13,r1 if (minor < dtab->size && dtab->minor != NULL) { 8001400: 28 81 00 04 lw r1,(r4+4) 8001404: 51 c1 00 11 bgeu r14,r1,8001448 <== NEVER TAKEN 8001408: 28 8d 00 00 lw r13,(r4+0) 800140c: 45 a0 00 0f be r13,r0,8001448 <== NEVER TAKEN rtems_disk_device *dd = dtab->minor [minor]; 8001410: b9 c0 08 00 mv r1,r14 8001414: 34 02 00 02 mvi r2,2 8001418: f8 00 59 4a calli 8017940 <__ashlsi3> 800141c: b5 a1 08 00 add r1,r13,r1 8001420: 28 2b 00 00 lw r11,(r1+0) if (dd != NULL && !lookup_only) { 8001424: 45 60 00 09 be r11,r0,8001448 8001428: 5d 80 00 08 bne r12,r0,8001448 if (!dd->deleted) { 800142c: 41 61 00 40 lbu r1,(r11+64) 8001430: 5c 2c 00 05 bne r1,r12,8001444 ++dd->uses; 8001434: 29 61 00 14 lw r1,(r11+20) 8001438: 34 21 00 01 addi r1,r1,1 800143c: 59 61 00 14 sw (r11+20),r1 8001440: e0 00 00 02 bi 8001448 } else { dd = NULL; 8001444: 34 0b 00 00 mvi r11,0 return dd; } } return NULL; } 8001448: b9 60 08 00 mv r1,r11 800144c: 2b 9d 00 04 lw ra,(sp+4) 8001450: 2b 8b 00 14 lw r11,(sp+20) 8001454: 2b 8c 00 10 lw r12,(sp+16) 8001458: 2b 8d 00 0c lw r13,(sp+12) 800145c: 2b 8e 00 08 lw r14,(sp+8) 8001460: 37 9c 00 14 addi sp,sp,20 8001464: c3 a0 00 00 ret =============================================================================== 08002fbc : */ static rtems_status_code get_sector(int fd, uint32_t sector_num, rtems_sector_data_t **sector) { 8002fbc: 37 9c ff ec addi sp,sp,-20 8002fc0: 5b 8b 00 14 sw (sp+20),r11 8002fc4: 5b 8c 00 10 sw (sp+16),r12 8002fc8: 5b 8d 00 0c sw (sp+12),r13 8002fcc: 5b 8e 00 08 sw (sp+8),r14 8002fd0: 5b 9d 00 04 sw (sp+4),ra off_t off; off_t new_off; if (sector == NULL) { return RTEMS_INTERNAL_ERROR; 8002fd4: 34 04 00 19 mvi r4,25 */ static rtems_status_code get_sector(int fd, uint32_t sector_num, rtems_sector_data_t **sector) { 8002fd8: b8 20 70 00 mv r14,r1 8002fdc: b8 40 68 00 mv r13,r2 8002fe0: b8 60 60 00 mv r12,r3 rtems_sector_data_t *s; ssize_t n; off_t off; off_t new_off; if (sector == NULL) 8002fe4: 44 60 00 1d be r3,r0,8003058 <== NEVER TAKEN { return RTEMS_INTERNAL_ERROR; } off = sector_num * RTEMS_IDE_SECTOR_SIZE; 8002fe8: b8 40 08 00 mv r1,r2 8002fec: 34 02 00 09 mvi r2,9 8002ff0: fb ff f5 cd calli 8000724 <__ashlsi3> 8002ff4: b8 20 58 00 mv r11,r1 new_off = lseek(fd, off, SEEK_SET); 8002ff8: b9 60 10 00 mv r2,r11 8002ffc: b9 c0 08 00 mv r1,r14 8003000: 34 03 00 00 mvi r3,0 8003004: f8 00 05 46 calli 800451c if (new_off != off) { return RTEMS_IO_ERROR; 8003008: 34 04 00 1b mvi r4,27 return RTEMS_INTERNAL_ERROR; } off = sector_num * RTEMS_IDE_SECTOR_SIZE; new_off = lseek(fd, off, SEEK_SET); if (new_off != off) { 800300c: 5c 2b 00 13 bne r1,r11,8003058 <== NEVER TAKEN return RTEMS_IO_ERROR; } s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE); 8003010: 34 01 02 04 mvi r1,516 8003014: f8 00 05 cc calli 8004744 8003018: b8 20 58 00 mv r11,r1 if (s == NULL) { return RTEMS_NO_MEMORY; 800301c: 34 04 00 1a mvi r4,26 if (new_off != off) { return RTEMS_IO_ERROR; } s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE); if (s == NULL) 8003020: 44 20 00 0e be r1,r0,8003058 <== NEVER TAKEN { return RTEMS_NO_MEMORY; } n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); 8003024: 35 62 00 04 addi r2,r11,4 8003028: b9 c0 08 00 mv r1,r14 800302c: 34 03 02 00 mvi r3,512 8003030: f8 00 08 ad calli 80052e4 if (n != RTEMS_IDE_SECTOR_SIZE) 8003034: 34 02 02 00 mvi r2,512 8003038: 44 22 00 05 be r1,r2,800304c <== ALWAYS TAKEN { free(s); 800303c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8003040: f8 00 03 d6 calli 8003f98 <== NOT EXECUTED return RTEMS_IO_ERROR; 8003044: 34 04 00 1b mvi r4,27 <== NOT EXECUTED 8003048: e0 00 00 04 bi 8003058 <== NOT EXECUTED } s->sector_num = sector_num; 800304c: 59 6d 00 00 sw (r11+0),r13 *sector = s; 8003050: 59 8b 00 00 sw (r12+0),r11 return RTEMS_SUCCESSFUL; 8003054: 34 04 00 00 mvi r4,0 } 8003058: b8 80 08 00 mv r1,r4 800305c: 2b 9d 00 04 lw ra,(sp+4) 8003060: 2b 8b 00 14 lw r11,(sp+20) 8003064: 2b 8c 00 10 lw r12,(sp+16) 8003068: 2b 8d 00 0c lw r13,(sp+12) 800306c: 2b 8e 00 08 lw r14,(sp+8) 8003070: 37 9c 00 14 addi sp,sp,20 8003074: c3 a0 00 00 ret =============================================================================== 08034658 : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 8034658: 37 9c ff f0 addi sp,sp,-16 803465c: 5b 8b 00 10 sw (sp+16),r11 8034660: 5b 8c 00 0c sw (sp+12),r12 8034664: 5b 8d 00 08 sw (sp+8),r13 8034668: 5b 9d 00 04 sw (sp+4),ra rtems_filesystem_node_types_t type; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); 803466c: 78 04 08 03 mvhi r4,0x803 8034670: 38 84 b0 14 ori r4,r4,0xb014 int getdents( int dd_fd, char *dd_buf, int dd_len ) { 8034674: b8 40 68 00 mv r13,r2 rtems_filesystem_node_types_t type; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); 8034678: 28 82 00 00 lw r2,(r4+0) int getdents( int dd_fd, char *dd_buf, int dd_len ) { 803467c: b8 60 60 00 mv r12,r3 rtems_filesystem_node_types_t type; /* * Get the file control block structure associated with the file descriptor */ iop = rtems_libio_iop( dd_fd ); 8034680: 34 0b 00 00 mvi r11,0 8034684: 50 22 00 07 bgeu r1,r2,80346a0 <== NEVER TAKEN 8034688: 78 0b 08 04 mvhi r11,0x804 803468c: 39 6b b9 8c ori r11,r11,0xb98c 8034690: 34 02 00 2c mvi r2,44 8034694: fb ff 33 e1 calli 8001618 <__mulsi3> 8034698: 29 6b 00 00 lw r11,(r11+0) 803469c: b5 61 58 00 add r11,r11,r1 /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); 80346a0: 35 61 00 0c addi r1,r11,12 80346a4: fb ff 50 8f calli 80088e0 if ( type != RTEMS_FILESYSTEM_DIRECTORY ) 80346a8: 44 20 00 06 be r1,r0,80346c0 rtems_set_errno_and_return_minus_one( ENOTDIR ); 80346ac: fb ff b1 97 calli 8020d08 <__errno> 80346b0: 34 02 00 14 mvi r2,20 80346b4: 58 22 00 00 sw (r1+0),r2 80346b8: 34 01 ff ff mvi r1,-1 80346bc: e0 00 00 07 bi 80346d8 /* * Return the number of bytes that were actually transfered as a result * of the read attempt. */ return (*iop->pathinfo.handlers->read_h)( iop, dd_buf, dd_len ); 80346c0: 29 61 00 1c lw r1,(r11+28) 80346c4: b9 a0 10 00 mv r2,r13 80346c8: b9 80 18 00 mv r3,r12 80346cc: 28 24 00 08 lw r4,(r1+8) 80346d0: b9 60 08 00 mv r1,r11 80346d4: d8 80 00 00 call r4 } 80346d8: 2b 9d 00 04 lw ra,(sp+4) 80346dc: 2b 8b 00 10 lw r11,(sp+16) 80346e0: 2b 8c 00 0c lw r12,(sp+12) 80346e4: 2b 8d 00 08 lw r13,(sp+8) 80346e8: 37 9c 00 10 addi sp,sp,16 80346ec: c3 a0 00 00 ret =============================================================================== 08023890 : /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 8023890: 37 9c ff f0 addi sp,sp,-16 8023894: 5b 8b 00 10 sw (sp+16),r11 8023898: 5b 8c 00 0c sw (sp+12),r12 802389c: 5b 8d 00 08 sw (sp+8),r13 80238a0: 5b 9d 00 04 sw (sp+4),ra FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 80238a4: 78 01 08 06 mvhi r1,0x806 80238a8: 38 21 9c 50 ori r1,r1,0x9c50 80238ac: 40 2d 00 00 lbu r13,(r1+0) 80238b0: 5d a0 00 2f bne r13,r0,802396c return; etc_passwd_initted = 1; 80238b4: 34 02 00 01 mvi r2,1 80238b8: 30 22 00 00 sb (r1+0),r2 mkdir("/etc", 0777); 80238bc: 78 01 08 05 mvhi r1,0x805 80238c0: 34 02 01 ff mvi r2,511 80238c4: 38 21 f6 20 ori r1,r1,0xf620 80238c8: fb ff 77 37 calli 80015a4 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 80238cc: 78 0b 08 05 mvhi r11,0x805 80238d0: 39 6b f6 28 ori r11,r11,0xf628 80238d4: 78 02 08 05 mvhi r2,0x805 80238d8: b9 60 08 00 mv r1,r11 80238dc: 38 42 e6 20 ori r2,r2,0xe620 80238e0: f8 00 58 70 calli 8039aa0 80238e4: b8 20 60 00 mv r12,r1 80238e8: 5c 2d 00 0c bne r1,r13,8023918 fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 80238ec: 78 02 08 05 mvhi r2,0x805 80238f0: b9 60 08 00 mv r1,r11 80238f4: 38 42 b3 34 ori r2,r2,0xb334 80238f8: f8 00 58 6a calli 8039aa0 80238fc: b8 20 58 00 mv r11,r1 8023900: 44 2c 00 07 be r1,r12,802391c <== NEVER TAKEN fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 8023904: 78 01 08 05 mvhi r1,0x805 8023908: 38 21 f6 34 ori r1,r1,0xf634 802390c: b9 60 10 00 mv r2,r11 8023910: f8 00 58 e8 calli 8039cb0 "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 8023914: b9 60 08 00 mv r1,r11 8023918: f8 00 55 75 calli 8038eec } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 802391c: 78 0b 08 05 mvhi r11,0x805 8023920: 39 6b f6 9c ori r11,r11,0xf69c 8023924: 78 02 08 05 mvhi r2,0x805 8023928: b9 60 08 00 mv r1,r11 802392c: 38 42 e6 20 ori r2,r2,0xe620 8023930: f8 00 58 5c calli 8039aa0 8023934: b8 20 60 00 mv r12,r1 8023938: 5c 20 00 0c bne r1,r0,8023968 fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { 802393c: 78 02 08 05 mvhi r2,0x805 8023940: b9 60 08 00 mv r1,r11 8023944: 38 42 b3 34 ori r2,r2,0xb334 8023948: f8 00 58 56 calli 8039aa0 802394c: b8 20 58 00 mv r11,r1 8023950: 44 2c 00 07 be r1,r12,802396c <== NEVER TAKEN fprintf( fp, "root:x:0:root\n" 8023954: 78 01 08 05 mvhi r1,0x805 8023958: 38 21 f6 a8 ori r1,r1,0xf6a8 802395c: b9 60 10 00 mv r2,r11 8023960: f8 00 58 d4 calli 8039cb0 "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 8023964: b9 60 08 00 mv r1,r11 8023968: f8 00 55 61 calli 8038eec } } 802396c: 2b 9d 00 04 lw ra,(sp+4) 8023970: 2b 8b 00 10 lw r11,(sp+16) 8023974: 2b 8c 00 0c lw r12,(sp+12) 8023978: 2b 8d 00 08 lw r13,(sp+8) 802397c: 37 9c 00 10 addi sp,sp,16 8023980: c3 a0 00 00 ret =============================================================================== 08002ab0 : int ioctl( int fd, ioctl_command_t command, ... ) { 8002ab0: 37 9c ff d8 addi sp,sp,-40 8002ab4: 5b 8b 00 0c sw (sp+12),r11 8002ab8: 5b 8c 00 08 sw (sp+8),r12 8002abc: 5b 9d 00 04 sw (sp+4),ra 8002ac0: 5b 83 00 14 sw (sp+20),r3 va_list ap; int rc; rtems_libio_t *iop; void *buffer; rtems_libio_check_fd( fd ); 8002ac4: 78 03 08 01 mvhi r3,0x801 int ioctl( int fd, ioctl_command_t command, ... ) { 8002ac8: 5b 82 00 10 sw (sp+16),r2 8002acc: 5b 84 00 18 sw (sp+24),r4 8002ad0: 5b 85 00 1c sw (sp+28),r5 8002ad4: 5b 86 00 20 sw (sp+32),r6 8002ad8: 5b 87 00 24 sw (sp+36),r7 8002adc: 5b 88 00 28 sw (sp+40),r8 va_list ap; int rc; rtems_libio_t *iop; void *buffer; rtems_libio_check_fd( fd ); 8002ae0: 38 63 a0 10 ori r3,r3,0xa010 int ioctl( int fd, ioctl_command_t command, ... ) { 8002ae4: b8 40 60 00 mv r12,r2 va_list ap; int rc; rtems_libio_t *iop; void *buffer; rtems_libio_check_fd( fd ); 8002ae8: 28 62 00 00 lw r2,(r3+0) 8002aec: 54 41 00 02 bgu r2,r1,8002af4 8002af0: e0 00 00 0a bi 8002b18 iop = rtems_libio_iop( fd ); 8002af4: 34 02 00 2c mvi r2,44 8002af8: 78 0b 08 01 mvhi r11,0x801 8002afc: f8 00 54 06 calli 8017b14 <__mulsi3> 8002b00: 39 6b a8 7c ori r11,r11,0xa87c 8002b04: 29 62 00 00 lw r2,(r11+0) 8002b08: b4 41 08 00 add r1,r2,r1 rtems_libio_check_is_open(iop); 8002b0c: 28 22 00 08 lw r2,(r1+8) 8002b10: 20 42 01 00 andi r2,r2,0x100 8002b14: 5c 40 00 06 bne r2,r0,8002b2c <== ALWAYS TAKEN 8002b18: f8 00 3c 6d calli 8011ccc <__errno> 8002b1c: 34 02 00 09 mvi r2,9 8002b20: 58 22 00 00 sw (r1+0),r2 8002b24: 34 01 ff ff mvi r1,-1 8002b28: e0 00 00 06 bi 8002b40 buffer = va_arg(ap, void *); /* * Now process the ioctl(). */ rc = (*iop->pathinfo.handlers->ioctl_h)( iop, command, buffer ); 8002b2c: 28 22 00 1c lw r2,(r1+28) 8002b30: 2b 83 00 14 lw r3,(sp+20) 8002b34: 28 44 00 10 lw r4,(r2+16) 8002b38: b9 80 10 00 mv r2,r12 8002b3c: d8 80 00 00 call r4 va_end( ap ); return rc; } 8002b40: 2b 9d 00 04 lw ra,(sp+4) 8002b44: 2b 8b 00 0c lw r11,(sp+12) 8002b48: 2b 8c 00 08 lw r12,(sp+8) 8002b4c: 37 9c 00 28 addi sp,sp,40 8002b50: c3 a0 00 00 ret =============================================================================== 08004fa0 : /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 8004fa0: 37 9c ff f4 addi sp,sp,-12 8004fa4: 5b 8b 00 0c sw (sp+12),r11 8004fa8: 5b 8c 00 08 sw (sp+8),r12 8004fac: 5b 9d 00 04 sw (sp+4),ra 8004fb0: b8 40 58 00 mv r11,r2 if (tty->termios.c_iflag & ISTRIP) 8004fb4: 28 42 00 30 lw r2,(r2+48) /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 8004fb8: b8 20 60 00 mv r12,r1 if (tty->termios.c_iflag & ISTRIP) 8004fbc: 20 41 00 20 andi r1,r2,0x20 8004fc0: 44 20 00 02 be r1,r0,8004fc8 <== ALWAYS TAKEN c &= 0x7f; 8004fc4: 21 8c 00 7f andi r12,r12,0x7f <== NOT EXECUTED if (tty->termios.c_iflag & IUCLC) 8004fc8: 20 41 02 00 andi r1,r2,0x200 8004fcc: 44 20 00 0b be r1,r0,8004ff8 c = tolower (c); 8004fd0: 78 01 08 02 mvhi r1,0x802 8004fd4: 38 21 82 e0 ori r1,r1,0x82e0 8004fd8: 28 21 00 00 lw r1,(r1+0) 8004fdc: b4 2c 08 00 add r1,r1,r12 8004fe0: 40 23 00 01 lbu r3,(r1+1) 8004fe4: 34 01 00 01 mvi r1,1 8004fe8: 20 63 00 03 andi r3,r3,0x3 8004fec: 5c 61 00 02 bne r3,r1,8004ff4 8004ff0: 35 8c 00 20 addi r12,r12,32 8004ff4: 21 8c 00 ff andi r12,r12,0xff if (c == '\r') { 8004ff8: 34 01 00 0d mvi r1,13 8004ffc: 5d 81 00 08 bne r12,r1,800501c if (tty->termios.c_iflag & IGNCR) 8005000: 20 43 00 80 andi r3,r2,0x80 return 0; 8005004: 34 01 00 00 mvi r1,0 if (tty->termios.c_iflag & IUCLC) c = tolower (c); if (c == '\r') { if (tty->termios.c_iflag & IGNCR) 8005008: 5c 60 00 4e bne r3,r0,8005140 <== NEVER TAKEN return 0; if (tty->termios.c_iflag & ICRNL) 800500c: 20 42 01 00 andi r2,r2,0x100 8005010: 44 43 00 0a be r2,r3,8005038 <== NEVER TAKEN c = '\n'; 8005014: 34 0c 00 0a mvi r12,10 8005018: e0 00 00 08 bi 8005038 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 800501c: 34 01 00 0a mvi r1,10 8005020: 5d 81 00 05 bne r12,r1,8005034 8005024: 20 42 00 40 andi r2,r2,0x40 8005028: 44 40 00 04 be r2,r0,8005038 <== ALWAYS TAKEN c = '\r'; 800502c: 34 0c 00 0d mvi r12,13 <== NOT EXECUTED 8005030: e0 00 00 02 bi 8005038 <== NOT EXECUTED } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 8005034: 45 80 00 2f be r12,r0,80050f0 <== NEVER TAKEN 8005038: 29 62 00 3c lw r2,(r11+60) 800503c: 20 41 00 02 andi r1,r2,0x2 8005040: 44 20 00 2c be r1,r0,80050f0 if (c == tty->termios.c_cc[VERASE]) { 8005044: 41 61 00 43 lbu r1,(r11+67) 8005048: 5c 2c 00 04 bne r1,r12,8005058 erase (tty, 0); 800504c: b9 60 08 00 mv r1,r11 8005050: 34 02 00 00 mvi r2,0 8005054: e0 00 00 05 bi 8005068 return 0; } else if (c == tty->termios.c_cc[VKILL]) { 8005058: 41 61 00 44 lbu r1,(r11+68) 800505c: 5c 2c 00 05 bne r1,r12,8005070 erase (tty, 1); 8005060: b9 60 08 00 mv r1,r11 8005064: 34 02 00 01 mvi r2,1 8005068: fb ff ff 4c calli 8004d98 800506c: e0 00 00 34 bi 800513c return 0; } else if (c == tty->termios.c_cc[VEOF]) { 8005070: 41 63 00 45 lbu r3,(r11+69) return 1; 8005074: 34 01 00 01 mvi r1,1 } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { 8005078: 44 6c 00 32 be r3,r12,8005140 <== NEVER TAKEN return 1; } else if (c == '\n') { 800507c: 34 01 00 0a mvi r1,10 8005080: 5d 81 00 0b bne r12,r1,80050ac if (tty->termios.c_lflag & (ECHO | ECHONL)) 8005084: 20 42 00 48 andi r2,r2,0x48 8005088: 44 40 00 03 be r2,r0,8005094 <== NEVER TAKEN echo (c, tty); 800508c: b9 60 10 00 mv r2,r11 8005090: fb ff ff 1d calli 8004d04 tty->cbuf[tty->ccount++] = c; 8005094: 29 61 00 20 lw r1,(r11+32) 8005098: 29 62 00 1c lw r2,(r11+28) 800509c: 34 03 00 0a mvi r3,10 80050a0: b4 41 10 00 add r2,r2,r1 80050a4: 30 43 00 00 sb (r2+0),r3 80050a8: e0 00 00 0e bi 80050e0 return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 80050ac: 41 61 00 4c lbu r1,(r11+76) 80050b0: 44 2c 00 03 be r1,r12,80050bc <== NEVER TAKEN 80050b4: 41 61 00 51 lbu r1,(r11+81) 80050b8: 5c 2c 00 0e bne r1,r12,80050f0 <== ALWAYS TAKEN (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 80050bc: 20 42 00 08 andi r2,r2,0x8 <== NOT EXECUTED 80050c0: 44 40 00 04 be r2,r0,80050d0 <== NOT EXECUTED echo (c, tty); 80050c4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 80050c8: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 80050cc: fb ff ff 0e calli 8004d04 <== NOT EXECUTED tty->cbuf[tty->ccount++] = c; 80050d0: 29 61 00 20 lw r1,(r11+32) <== NOT EXECUTED 80050d4: 29 62 00 1c lw r2,(r11+28) <== NOT EXECUTED 80050d8: b4 41 10 00 add r2,r2,r1 <== NOT EXECUTED 80050dc: 30 4c 00 00 sb (r2+0),r12 <== NOT EXECUTED 80050e0: 34 21 00 01 addi r1,r1,1 80050e4: 59 61 00 20 sw (r11+32),r1 return 1; 80050e8: 34 01 00 01 mvi r1,1 80050ec: e0 00 00 15 bi 8005140 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 80050f0: 78 01 08 02 mvhi r1,0x802 80050f4: 38 21 81 40 ori r1,r1,0x8140 80050f8: 28 22 00 00 lw r2,(r1+0) 80050fc: 29 63 00 20 lw r3,(r11+32) if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; 8005100: 34 01 00 00 mvi r1,0 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 8005104: 34 42 ff ff addi r2,r2,-1 8005108: 50 62 00 0e bgeu r3,r2,8005140 <== NEVER TAKEN if (tty->termios.c_lflag & ECHO) 800510c: 29 61 00 3c lw r1,(r11+60) 8005110: 20 21 00 08 andi r1,r1,0x8 8005114: 44 20 00 04 be r1,r0,8005124 <== NEVER TAKEN echo (c, tty); 8005118: b9 80 08 00 mv r1,r12 800511c: b9 60 10 00 mv r2,r11 8005120: fb ff fe f9 calli 8004d04 tty->cbuf[tty->ccount++] = c; 8005124: 29 61 00 20 lw r1,(r11+32) 8005128: 29 62 00 1c lw r2,(r11+28) 800512c: b4 41 10 00 add r2,r2,r1 8005130: 30 4c 00 00 sb (r2+0),r12 8005134: 34 21 00 01 addi r1,r1,1 8005138: 59 61 00 20 sw (r11+32),r1 } return 0; 800513c: 34 01 00 00 mvi r1,0 } 8005140: 2b 9d 00 04 lw ra,(sp+4) 8005144: 2b 8b 00 0c lw r11,(sp+12) 8005148: 2b 8c 00 08 lw r12,(sp+8) 800514c: 37 9c 00 0c addi sp,sp,12 8005150: c3 a0 00 00 ret =============================================================================== 08025e38 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 8025e38: 37 9c ff dc addi sp,sp,-36 8025e3c: 5b 8b 00 18 sw (sp+24),r11 8025e40: 5b 8c 00 14 sw (sp+20),r12 8025e44: 5b 8d 00 10 sw (sp+16),r13 8025e48: 5b 8e 00 0c sw (sp+12),r14 8025e4c: 5b 8f 00 08 sw (sp+8),r15 8025e50: 5b 9d 00 04 sw (sp+4),ra 8025e54: b8 20 60 00 mv r12,r1 8025e58: b8 40 58 00 mv r11,r2 8025e5c: b8 60 68 00 mv r13,r3 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 8025e60: fb ff ff 3d calli 8025b54 8025e64: 45 81 00 04 be r12,r1,8025e74 rtems_set_errno_and_return_minus_one( ESRCH ); 8025e68: fb ff b4 7c calli 8013058 <__errno> 8025e6c: 34 02 00 03 mvi r2,3 8025e70: e0 00 00 04 bi 8025e80 /* * Validate the signal passed. */ if ( !sig ) 8025e74: 5d 60 00 06 bne r11,r0,8025e8c rtems_set_errno_and_return_minus_one( EINVAL ); 8025e78: fb ff b4 78 calli 8013058 <__errno> 8025e7c: 34 02 00 16 mvi r2,22 8025e80: 58 22 00 00 sw (r1+0),r2 8025e84: 34 01 ff ff mvi r1,-1 8025e88: e0 00 00 a2 bi 8026110 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 8025e8c: 35 6f ff ff addi r15,r11,-1 if ( !is_valid_signo(sig) ) 8025e90: 34 01 00 1f mvi r1,31 8025e94: 50 2f 00 02 bgeu r1,r15,8025e9c 8025e98: e3 ff ff f8 bi 8025e78 rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 8025e9c: 34 02 00 01 mvi r2,1 8025ea0: b9 60 08 00 mv r1,r11 8025ea4: fb ff 6f e2 calli 8001e2c <__ashlsi3> 8025ea8: 34 02 00 02 mvi r2,2 8025eac: 78 0c 08 02 mvhi r12,0x802 8025eb0: b4 2b 08 00 add r1,r1,r11 8025eb4: fb ff 6f de calli 8001e2c <__ashlsi3> 8025eb8: 39 8c 9f 88 ori r12,r12,0x9f88 8025ebc: b5 81 08 00 add r1,r12,r1 8025ec0: 28 22 00 08 lw r2,(r1+8) 8025ec4: 34 0e 00 01 mvi r14,1 return 0; 8025ec8: 34 01 00 00 mvi r1,0 rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 8025ecc: 44 4e 00 91 be r2,r14,8026110 <== NEVER TAKEN /* * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) 8025ed0: 65 62 00 04 cmpei r2,r11,4 8025ed4: 65 61 00 08 cmpei r1,r11,8 8025ed8: b8 41 08 00 or r1,r2,r1 8025edc: 5c 20 00 03 bne r1,r0,8025ee8 8025ee0: 34 01 00 0b mvi r1,11 8025ee4: 5d 61 00 05 bne r11,r1,8025ef8 return pthread_kill( pthread_self(), sig ); 8025ee8: f8 00 01 3c calli 80263d8 8025eec: b9 60 10 00 mv r2,r11 8025ef0: f8 00 00 f6 calli 80262c8 8025ef4: e0 00 00 87 bi 8026110 static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 8025ef8: 34 01 00 01 mvi r1,1 8025efc: b9 e0 10 00 mv r2,r15 8025f00: fb ff 6f cb calli 8001e2c <__ashlsi3> /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 8025f04: 5b 8b 00 1c sw (sp+28),r11 siginfo->si_code = SI_USER; 8025f08: 5b 8e 00 20 sw (sp+32),r14 8025f0c: b8 20 60 00 mv r12,r1 if ( !value ) { 8025f10: 5d a0 00 03 bne r13,r0,8025f1c siginfo->si_value.sival_int = 0; 8025f14: 5b 80 00 24 sw (sp+36),r0 8025f18: e0 00 00 03 bi 8025f24 } else { siginfo->si_value = *value; 8025f1c: 29 a1 00 00 lw r1,(r13+0) 8025f20: 5b 81 00 24 sw (sp+36),r1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 8025f24: 78 01 08 02 mvhi r1,0x802 8025f28: 38 21 9a 78 ori r1,r1,0x9a78 8025f2c: 28 22 00 00 lw r2,(r1+0) ++level; 8025f30: 34 42 00 01 addi r2,r2,1 _Thread_Dispatch_disable_level = level; 8025f34: 58 22 00 00 sw (r1+0),r2 */ void _POSIX_signals_Manager_Initialization(void); static inline void _POSIX_signals_Add_post_switch_extension(void) { _API_extensions_Add_post_switch( &_POSIX_signals_Post_switch ); 8025f38: 78 01 08 02 mvhi r1,0x802 8025f3c: 38 21 91 d4 ori r1,r1,0x91d4 8025f40: fb ff 91 4d calli 800a474 <_API_extensions_Add_post_switch> /* * Is the currently executing thread interested? If so then it will * get it an execute it as soon as the dispatcher executes. */ the_thread = _Thread_Executing; 8025f44: 78 01 08 02 mvhi r1,0x802 8025f48: 38 21 9f 00 ori r1,r1,0x9f00 8025f4c: 28 23 00 10 lw r3,(r1+16) api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 8025f50: 28 61 01 1c lw r1,(r3+284) 8025f54: 28 21 00 d0 lw r1,(r1+208) 8025f58: a4 20 08 00 not r1,r1 8025f5c: a1 81 08 00 and r1,r12,r1 8025f60: 5c 20 00 3f bne r1,r0,802605c } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 8025f64: 78 01 08 02 mvhi r1,0x802 8025f68: 38 21 a1 14 ori r1,r1,0xa114 8025f6c: 28 22 00 00 lw r2,(r1+0) /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 8025f70: 78 01 08 02 mvhi r1,0x802 8025f74: 38 21 a1 18 ori r1,r1,0xa118 8025f78: e0 00 00 0b bi 8025fa4 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 8025f7c: 28 44 00 30 lw r4,(r2+48) for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; 8025f80: b8 40 18 00 mv r3,r2 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 8025f84: 28 45 01 1c lw r5,(r2+284) #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 8025f88: a1 84 20 00 and r4,r12,r4 8025f8c: 5c 80 00 34 bne r4,r0,802605c /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 8025f90: 28 a5 00 d0 lw r5,(r5+208) 8025f94: a4 a0 28 00 not r5,r5 8025f98: a1 85 28 00 and r5,r12,r5 8025f9c: 5c a4 00 30 bne r5,r4,802605c the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 8025fa0: 28 42 00 00 lw r2,(r2+0) /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 8025fa4: 5c 41 ff f6 bne r2,r1,8025f7c * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 8025fa8: 78 01 08 02 mvhi r1,0x802 8025fac: 38 21 90 d8 ori r1,r1,0x90d8 8025fb0: 40 21 00 00 lbu r1,(r1+0) */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 8025fb4: 78 02 08 02 mvhi r2,0x802 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 8025fb8: 78 04 08 02 mvhi r4,0x802 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 8025fbc: 38 42 9a 14 ori r2,r2,0x9a14 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 8025fc0: 34 21 00 01 addi r1,r1,1 8025fc4: 38 84 9a 1c ori r4,r4,0x9a1c */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 8025fc8: 34 4d 00 10 addi r13,r2,16 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 8025fcc: 34 03 00 00 mvi r3,0 */ RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal ( States_Control the_states ) { return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL); 8025fd0: 78 08 10 00 mvhi r8,0x1000 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 8025fd4: 28 85 00 00 lw r5,(r4+0) 8025fd8: 44 a0 00 1e be r5,r0,8026050 <== NEVER TAKEN continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 8025fdc: 28 a5 00 04 lw r5,(r5+4) #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 8025fe0: 34 06 00 01 mvi r6,1 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 8025fe4: 2c ae 00 10 lhu r14,(r5+16) 8025fe8: 28 a7 00 1c lw r7,(r5+28) object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 8025fec: e0 00 00 18 bi 802604c the_thread = (Thread_Control *) object_table[ index ]; 8025ff0: 28 e2 00 04 lw r2,(r7+4) if ( !the_thread ) 8025ff4: 44 40 00 14 be r2,r0,8026044 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 8025ff8: 28 45 00 14 lw r5,(r2+20) 8025ffc: 54 a1 00 12 bgu r5,r1,8026044 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 8026000: 28 49 01 1c lw r9,(r2+284) 8026004: 29 29 00 d0 lw r9,(r9+208) 8026008: a5 20 48 00 not r9,r9 802600c: a1 89 48 00 and r9,r12,r9 8026010: 45 20 00 0d be r9,r0,8026044 * * NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1 * so we never have to worry about deferencing a NULL * interested thread. */ if ( the_thread->current_priority < interested_priority ) { 8026014: 54 25 00 0a bgu r1,r5,802603c * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { 8026018: 44 60 00 0b be r3,r0,8026044 <== NEVER TAKEN 802601c: 28 69 00 10 lw r9,(r3+16) 8026020: 45 20 00 09 be r9,r0,8026044 <== NEVER TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 8026024: 28 4a 00 10 lw r10,(r2+16) 8026028: 45 40 00 05 be r10,r0,802603c 802602c: a1 28 48 00 and r9,r9,r8 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 8026030: 5d 20 00 05 bne r9,r0,8026044 8026034: a1 48 50 00 and r10,r10,r8 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 8026038: 45 49 00 03 be r10,r9,8026044 */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 802603c: b8 a0 08 00 mv r1,r5 8026040: b8 40 18 00 mv r3,r2 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 8026044: 34 c6 00 01 addi r6,r6,1 8026048: 34 e7 00 04 addi r7,r7,4 802604c: 51 c6 ff e9 bgeu r14,r6,8025ff0 8026050: 34 84 00 04 addi r4,r4,4 * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 8026054: 5c 8d ff e0 bne r4,r13,8025fd4 } } } } if ( interested ) { 8026058: 44 60 00 06 be r3,r0,8026070 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 802605c: b8 60 08 00 mv r1,r3 8026060: b9 60 10 00 mv r2,r11 8026064: 37 83 00 1c addi r3,sp,28 8026068: f8 00 00 3d calli 802615c <_POSIX_signals_Unblock_thread> 802606c: 5c 20 00 27 bne r1,r0,8026108 /* * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); 8026070: b9 80 08 00 mv r1,r12 8026074: f8 00 00 2f calli 8026130 <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 8026078: b9 60 08 00 mv r1,r11 802607c: 34 02 00 01 mvi r2,1 8026080: fb ff 6f 6b calli 8001e2c <__ashlsi3> 8026084: b4 2b 58 00 add r11,r1,r11 8026088: 34 02 00 02 mvi r2,2 802608c: 78 0c 08 02 mvhi r12,0x802 8026090: b9 60 08 00 mv r1,r11 8026094: fb ff 6f 66 calli 8001e2c <__ashlsi3> 8026098: 39 8c 9f 88 ori r12,r12,0x9f88 802609c: b5 81 08 00 add r1,r12,r1 80260a0: 28 22 00 00 lw r2,(r1+0) 80260a4: 34 01 00 02 mvi r1,2 80260a8: 5c 41 00 18 bne r2,r1,8026108 psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); 80260ac: 78 01 08 02 mvhi r1,0x802 80260b0: 38 21 a1 08 ori r1,r1,0xa108 80260b4: fb ff 91 77 calli 800a690 <_Chain_Get> 80260b8: b8 20 60 00 mv r12,r1 if ( !psiginfo ) { 80260bc: 5c 20 00 05 bne r1,r0,80260d0 _Thread_Enable_dispatch(); 80260c0: fb ff 9a ac calli 800cb70 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 80260c4: fb ff b3 e5 calli 8013058 <__errno> 80260c8: 34 02 00 0b mvi r2,11 80260cc: e3 ff ff 6d bi 8025e80 } psiginfo->Info = *siginfo; 80260d0: 2b 81 00 1c lw r1,(sp+28) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 80260d4: 34 02 00 02 mvi r2,2 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 80260d8: 59 81 00 08 sw (r12+8),r1 80260dc: 2b 81 00 20 lw r1,(sp+32) 80260e0: 59 81 00 0c sw (r12+12),r1 80260e4: 2b 81 00 24 lw r1,(sp+36) 80260e8: 59 81 00 10 sw (r12+16),r1 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 80260ec: b9 60 08 00 mv r1,r11 80260f0: fb ff 6f 4f calli 8001e2c <__ashlsi3> 80260f4: 78 02 08 02 mvhi r2,0x802 80260f8: 38 42 a1 80 ori r2,r2,0xa180 80260fc: b4 22 08 00 add r1,r1,r2 8026100: b9 80 10 00 mv r2,r12 8026104: fb ff 91 4d calli 800a638 <_Chain_Append> } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 8026108: fb ff 9a 9a calli 800cb70 <_Thread_Enable_dispatch> return 0; 802610c: 34 01 00 00 mvi r1,0 } 8026110: 2b 9d 00 04 lw ra,(sp+4) 8026114: 2b 8b 00 18 lw r11,(sp+24) 8026118: 2b 8c 00 14 lw r12,(sp+20) 802611c: 2b 8d 00 10 lw r13,(sp+16) 8026120: 2b 8e 00 0c lw r14,(sp+12) 8026124: 2b 8f 00 08 lw r15,(sp+8) 8026128: 37 9c 00 24 addi sp,sp,36 802612c: c3 a0 00 00 ret =============================================================================== 08017f60 : extern void _wrapup_reent(struct _reent *); extern void _reclaim_reent(struct _reent *); void libc_wrapup(void) { 8017f60: 37 9c ff f4 addi sp,sp,-12 8017f64: 5b 8b 00 0c sw (sp+12),r11 8017f68: 5b 8c 00 08 sw (sp+8),r12 8017f6c: 5b 9d 00 04 sw (sp+4),ra /* * In case RTEMS is already down, don't do this. It could be * dangerous. */ if (!_System_state_Is_up(_System_state_Get())) 8017f70: 78 01 08 01 mvhi r1,0x801 8017f74: 38 21 ad f8 ori r1,r1,0xadf8 8017f78: 28 22 00 00 lw r2,(r1+0) 8017f7c: 34 01 00 03 mvi r1,3 8017f80: 5c 41 00 16 bne r2,r1,8017fd8 <== NEVER TAKEN /* * This was already done if the user called exit() directly . _wrapup_reent(0); */ if (_REENT != _global_impure_ptr) { 8017f84: 78 01 08 01 mvhi r1,0x801 8017f88: 78 0b 08 01 mvhi r11,0x801 8017f8c: 38 21 91 4c ori r1,r1,0x914c 8017f90: 39 6b a2 30 ori r11,r11,0xa230 8017f94: 28 2c 00 00 lw r12,(r1+0) 8017f98: 29 61 00 00 lw r1,(r11+0) 8017f9c: 44 2c 00 04 be r1,r12,8017fac _wrapup_reent(_global_impure_ptr); 8017fa0: b9 80 08 00 mv r1,r12 8017fa4: f8 00 01 02 calli 80183ac <_wrapup_reent> /* Don't reclaim this one, just in case we do printfs * on the way out to ROM. */ _reclaim_reent(&libc_global_reent); #endif _REENT = _global_impure_ptr; 8017fa8: 59 6c 00 00 sw (r11+0),r12 * * Should this be changed to do *all* file streams? * _fwalk (_REENT, fclose); */ fclose (stdin); 8017fac: 78 0b 08 01 mvhi r11,0x801 8017fb0: 39 6b a2 30 ori r11,r11,0xa230 8017fb4: 29 61 00 00 lw r1,(r11+0) 8017fb8: 28 21 00 04 lw r1,(r1+4) 8017fbc: fb ff e7 9c calli 8011e2c fclose (stdout); 8017fc0: 29 61 00 00 lw r1,(r11+0) 8017fc4: 28 21 00 08 lw r1,(r1+8) 8017fc8: fb ff e7 99 calli 8011e2c fclose (stderr); 8017fcc: 29 61 00 00 lw r1,(r11+0) 8017fd0: 28 21 00 0c lw r1,(r1+12) 8017fd4: fb ff e7 96 calli 8011e2c } 8017fd8: 2b 9d 00 04 lw ra,(sp+4) 8017fdc: 2b 8b 00 0c lw r11,(sp+12) 8017fe0: 2b 8c 00 08 lw r12,(sp+8) 8017fe4: 37 9c 00 0c addi sp,sp,12 8017fe8: c3 a0 00 00 ret =============================================================================== 08002f48 : #include "malloc_p.h" void *malloc( size_t size ) { 8002f48: 37 9c ff f0 addi sp,sp,-16 8002f4c: 5b 8b 00 10 sw (sp+16),r11 8002f50: 5b 8c 00 0c sw (sp+12),r12 8002f54: 5b 8d 00 08 sw (sp+8),r13 8002f58: 5b 9d 00 04 sw (sp+4),ra void *return_this; MSBUMP(malloc_calls, 1); 8002f5c: 78 03 08 01 mvhi r3,0x801 8002f60: 38 63 a8 88 ori r3,r3,0xa888 #include "malloc_p.h" void *malloc( size_t size ) { 8002f64: b8 20 60 00 mv r12,r1 void *return_this; MSBUMP(malloc_calls, 1); 8002f68: 28 61 00 04 lw r1,(r3+4) /* * Validate the parameters */ if ( !size ) return (void *) 0; 8002f6c: 34 0b 00 00 mvi r11,0 size_t size ) { void *return_this; MSBUMP(malloc_calls, 1); 8002f70: 34 21 00 01 addi r1,r1,1 8002f74: 58 61 00 04 sw (r3+4),r1 /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 8002f78: fb ff ff a0 calli 8002df8 /* * Validate the parameters */ if ( !size ) 8002f7c: 45 80 00 2b be r12,r0,8003028 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 8002f80: 78 01 08 01 mvhi r1,0x801 8002f84: 38 21 ad f8 ori r1,r1,0xadf8 8002f88: 28 22 00 00 lw r2,(r1+0) 8002f8c: 34 01 00 03 mvi r1,3 8002f90: 5c 41 00 03 bne r2,r1,8002f9c !malloc_is_system_state_OK() ) 8002f94: fb ff ff 8f calli 8002dd0 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 8002f98: 44 20 00 24 be r1,r0,8003028 <== NEVER TAKEN RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 8002f9c: 78 0d 08 01 mvhi r13,0x801 8002fa0: 39 ad a0 54 ori r13,r13,0xa054 8002fa4: 29 a1 00 00 lw r1,(r13+0) 8002fa8: b9 80 10 00 mv r2,r12 8002fac: 34 03 00 00 mvi r3,0 8002fb0: 34 04 00 00 mvi r4,0 8002fb4: f8 00 0f b7 calli 8006e90 <_Protected_heap_Allocate_aligned_with_boundary> 8002fb8: b8 20 58 00 mv r11,r1 * If this fails then return a NULL pointer. */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { 8002fbc: 5c 20 00 0d bne r1,r0,8002ff0 return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 8002fc0: 78 01 08 01 mvhi r1,0x801 8002fc4: 38 21 87 b8 ori r1,r1,0x87b8 8002fc8: 28 23 00 00 lw r3,(r1+0) 8002fcc: 29 a1 00 00 lw r1,(r13+0) 8002fd0: b9 80 10 00 mv r2,r12 8002fd4: d8 60 00 00 call r3 8002fd8: b8 20 58 00 mv r11,r1 if ( !return_this ) { 8002fdc: 5c 20 00 05 bne r1,r0,8002ff0 <== NEVER TAKEN errno = ENOMEM; 8002fe0: f8 00 3b 3b calli 8011ccc <__errno> 8002fe4: 34 02 00 0c mvi r2,12 8002fe8: 58 22 00 00 sw (r1+0),r2 return (void *) 0; 8002fec: e0 00 00 0f bi 8003028 } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) 8002ff0: 78 01 08 01 mvhi r1,0x801 8002ff4: 38 21 a7 10 ori r1,r1,0xa710 8002ff8: 28 23 00 00 lw r3,(r1+0) 8002ffc: 44 60 00 04 be r3,r0,800300c (*rtems_malloc_dirty_helper)( return_this, size ); 8003000: b9 60 08 00 mv r1,r11 8003004: b9 80 10 00 mv r2,r12 8003008: d8 60 00 00 call r3 /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 800300c: 78 01 08 01 mvhi r1,0x801 8003010: 38 21 a7 0c ori r1,r1,0xa70c 8003014: 28 21 00 00 lw r1,(r1+0) 8003018: 44 20 00 04 be r1,r0,8003028 (*rtems_malloc_statistics_helpers->at_malloc)(return_this); 800301c: 28 22 00 04 lw r2,(r1+4) 8003020: b9 60 08 00 mv r1,r11 8003024: d8 40 00 00 call r2 return return_this; } 8003028: b9 60 08 00 mv r1,r11 800302c: 2b 9d 00 04 lw ra,(sp+4) 8003030: 2b 8b 00 10 lw r11,(sp+16) 8003034: 2b 8c 00 0c lw r12,(sp+12) 8003038: 2b 8d 00 08 lw r13,(sp+8) 800303c: 37 9c 00 10 addi sp,sp,16 8003040: c3 a0 00 00 ret =============================================================================== 08010bc8 : rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { 8010bc8: 37 9c ff fc addi sp,sp,-4 8010bcc: 5b 9d 00 04 sw (sp+4),ra the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) 8010bd0: 28 23 00 08 lw r3,(r1+8) mode_t mode ) { IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 8010bd4: 28 22 00 14 lw r2,(r1+20) if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; 8010bd8: 34 01 00 00 mvi r1,0 the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) 8010bdc: 20 63 00 04 andi r3,r3,0x4 8010be0: 44 60 00 14 be r3,r0,8010c30 8010be4: 28 43 00 4c lw r3,(r2+76) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { 8010be8: 28 64 00 00 lw r4,(r3+0) 8010bec: 34 03 00 05 mvi r3,5 8010bf0: 5c 83 00 10 bne r4,r3,8010c30 <== ALWAYS TAKEN uint32_t count = the_jnode->info.linearfile.size; 8010bf4: 28 44 00 50 lw r4,(r2+80) <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; the_jnode->control = &IMFS_node_control_memfile; 8010bf8: 78 05 08 01 mvhi r5,0x801 <== NOT EXECUTED 8010bfc: 38 a5 8e 9c ori r5,r5,0x8e9c <== NOT EXECUTED * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { uint32_t count = the_jnode->info.linearfile.size; const unsigned char *buffer = the_jnode->info.linearfile.direct; 8010c00: 28 43 00 54 lw r3,(r2+84) <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; 8010c04: 58 45 00 4c sw (r2+76),r5 <== NOT EXECUTED the_jnode->info.file.size = 0; 8010c08: 58 40 00 50 sw (r2+80),r0 <== NOT EXECUTED the_jnode->info.file.indirect = 0; 8010c0c: 58 40 00 54 sw (r2+84),r0 <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; 8010c10: 58 40 00 58 sw (r2+88),r0 <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; 8010c14: 58 40 00 5c sw (r2+92),r0 <== NOT EXECUTED if ((count != 0) 8010c18: 44 80 00 06 be r4,r0,8010c30 <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 8010c1c: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 8010c20: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 8010c24: fb ff ff 68 calli 80109c4 <== NOT EXECUTED return -1; } return 0; 8010c28: 64 21 ff ff cmpei r1,r1,-1 <== NOT EXECUTED 8010c2c: c8 01 08 00 sub r1,r0,r1 <== NOT EXECUTED } 8010c30: 2b 9d 00 04 lw ra,(sp+4) 8010c34: 37 9c 00 04 addi sp,sp,4 8010c38: c3 a0 00 00 ret =============================================================================== 080031cc : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 80031cc: 37 9c ff 78 addi sp,sp,-136 80031d0: 5b 8b 00 38 sw (sp+56),r11 80031d4: 5b 8c 00 34 sw (sp+52),r12 80031d8: 5b 8d 00 30 sw (sp+48),r13 80031dc: 5b 8e 00 2c sw (sp+44),r14 80031e0: 5b 8f 00 28 sw (sp+40),r15 80031e4: 5b 90 00 24 sw (sp+36),r16 80031e8: 5b 91 00 20 sw (sp+32),r17 80031ec: 5b 92 00 1c sw (sp+28),r18 80031f0: 5b 93 00 18 sw (sp+24),r19 80031f4: 5b 94 00 14 sw (sp+20),r20 80031f8: 5b 95 00 10 sw (sp+16),r21 80031fc: 5b 96 00 0c sw (sp+12),r22 8003200: 5b 97 00 08 sw (sp+8),r23 8003204: 5b 9d 00 04 sw (sp+4),ra 8003208: b8 20 88 00 mv r17,r1 int rv = 0; if ( 800320c: 34 01 00 01 mvi r1,1 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8003210: b8 40 70 00 mv r14,r2 8003214: b8 60 98 00 mv r19,r3 8003218: b8 80 a8 00 mv r21,r4 800321c: b8 a0 b8 00 mv r23,r5 int rv = 0; if ( 8003220: 54 81 00 a7 bgu r4,r1,80034bc options == RTEMS_FILESYSTEM_READ_ONLY || options == RTEMS_FILESYSTEM_READ_WRITE ) { rtems_filesystem_fsmount_me_t fsmount_me_h = 8003224: b8 60 08 00 mv r1,r3 8003228: f8 00 28 2a calli 800d2d0 800322c: b8 20 a0 00 mv r20,r1 rtems_filesystem_get_mount_handler( filesystemtype ); if ( fsmount_me_h != NULL ) { 8003230: 44 20 00 a3 be r1,r0,80034bc const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 8003234: b9 c0 68 00 mv r13,r14 8003238: 5d c0 00 03 bne r14,r0,8003244 800323c: 78 0d 08 01 mvhi r13,0x801 8003240: 39 ad 8a 30 ori r13,r13,0x8a30 size_t filesystemtype_size = strlen( filesystemtype ) + 1; 8003244: ba 60 08 00 mv r1,r19 8003248: f8 00 3f 24 calli 8012ed8 800324c: 34 2c 00 01 addi r12,r1,1 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 8003250: 34 10 00 00 mvi r16,0 8003254: 46 20 00 04 be r17,r0,8003264 8003258: ba 20 08 00 mv r1,r17 800325c: f8 00 3f 1f calli 8012ed8 8003260: 34 30 00 01 addi r16,r1,1 size_t target_size = strlen( target ) + 1; 8003264: b9 a0 08 00 mv r1,r13 8003268: f8 00 3f 1c calli 8012ed8 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size 800326c: 35 83 00 64 addi r3,r12,100 { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; size_t target_size = strlen( target ) + 1; 8003270: 34 36 00 01 addi r22,r1,1 size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size 8003274: b4 70 18 00 add r3,r3,r16 + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 8003278: 34 01 00 01 mvi r1,1 800327c: b4 76 10 00 add r2,r3,r22 8003280: fb ff fd 5a calli 80027e8 8003284: b8 20 58 00 mv r11,r1 if ( mt_entry != NULL ) { 8003288: 44 20 00 2a be r1,r0,8003330 <== NEVER TAKEN rtems_filesystem_global_location_t *mt_fs_root = (rtems_filesystem_global_location_t *) ((char *) mt_entry + sizeof( *mt_entry )); char *str = (char *) mt_fs_root + sizeof( *mt_fs_root ); 800328c: 34 32 00 64 addi r18,r1,100 memcpy( str, filesystemtype, filesystemtype_size ); 8003290: b9 80 18 00 mv r3,r12 + filesystemtype_size + source_size + target_size + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); if ( mt_entry != NULL ) { rtems_filesystem_global_location_t *mt_fs_root = 8003294: 34 2f 00 40 addi r15,r1,64 (rtems_filesystem_global_location_t *) ((char *) mt_entry + sizeof( *mt_entry )); char *str = (char *) mt_fs_root + sizeof( *mt_fs_root ); memcpy( str, filesystemtype, filesystemtype_size ); 8003298: ba 60 10 00 mv r2,r19 800329c: ba 40 08 00 mv r1,r18 80032a0: f8 00 3d 63 calli 801282c mt_entry->type = str; 80032a4: 59 72 00 34 sw (r11+52),r18 str += filesystemtype_size; 80032a8: b6 4c 60 00 add r12,r18,r12 if ( source_or_null != NULL ) { 80032ac: 46 20 00 07 be r17,r0,80032c8 memcpy( str, source_or_null, source_size ); 80032b0: b9 80 08 00 mv r1,r12 80032b4: ba 20 10 00 mv r2,r17 80032b8: ba 00 18 00 mv r3,r16 80032bc: f8 00 3d 5c calli 801282c mt_entry->dev = str; 80032c0: 59 6c 00 38 sw (r11+56),r12 str += source_size; 80032c4: b5 90 60 00 add r12,r12,r16 } memcpy( str, target, target_size ); 80032c8: b9 80 08 00 mv r1,r12 80032cc: b9 a0 10 00 mv r2,r13 80032d0: ba c0 18 00 mv r3,r22 80032d4: f8 00 3d 56 calli 801282c mt_entry->target = str; str += target_size; mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; 80032d8: 78 03 08 01 mvhi r3,0x801 memcpy( str, target, target_size ); mt_entry->target = str; str += target_size; mt_entry->mounted = true; 80032dc: 34 01 00 01 mvi r1,1 mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; 80032e0: 38 63 8a 34 ori r3,r3,0x8a34 mt_entry->dev = str; str += source_size; } memcpy( str, target, target_size ); mt_entry->target = str; 80032e4: 59 6c 00 30 sw (r11+48),r12 str += target_size; mt_entry->mounted = true; 80032e8: 31 61 00 28 sb (r11+40),r1 mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; 80032ec: 59 63 00 2c sw (r11+44),r3 memcpy( str, target, target_size ); mt_entry->target = str; str += target_size; mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; 80032f0: 59 6f 00 24 sw (r11+36),r15 mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; mt_fs_root->location.mt_entry = mt_entry; mt_fs_root->reference_count = 1; 80032f4: 34 01 00 01 mvi r1,1 80032f8: 59 e1 00 18 sw (r15+24),r1 void *starting_address, size_t number_nodes, size_t node_size ) { _Chain_Initialize( the_chain, starting_address, number_nodes, node_size ); 80032fc: b9 e0 10 00 mv r2,r15 8003300: 35 61 00 14 addi r1,r11,20 8003304: 34 03 00 01 mvi r3,1 8003308: 34 04 00 24 mvi r4,36 mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; mt_fs_root->location.mt_entry = mt_entry; 800330c: 59 eb 00 14 sw (r15+20),r11 8003310: f8 00 09 f7 calli 8005aec <_Chain_Initialize> ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; rv = (*fsmount_me_h)( mt_entry, data ); 8003314: b9 60 08 00 mv r1,r11 filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 8003318: 31 75 00 29 sb (r11+41),r21 rv = (*fsmount_me_h)( mt_entry, data ); 800331c: ba e0 10 00 mv r2,r23 8003320: da 80 00 00 call r20 8003324: b8 20 60 00 mv r12,r1 if ( rv == 0 ) { 8003328: 44 20 00 06 be r1,r0,8003340 800332c: e0 00 00 61 bi 80034b0 mt_fs_root, 1, sizeof(*mt_fs_root) ); } else { free( mt_entry ); 8003330: fb ff fd 78 calli 8002910 <== NOT EXECUTED if ( rv != 0 ) { free( mt_entry ); } } else { errno = ENOMEM; 8003334: f8 00 3a 66 calli 8011ccc <__errno> <== NOT EXECUTED 8003338: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 800333c: e0 00 00 62 bi 80034c4 <== NOT EXECUTED if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; rv = (*fsmount_me_h)( mt_entry, data ); if ( rv == 0 ) { if ( target != NULL ) { 8003340: 45 c1 00 33 be r14,r1,800340c int rv = 0; rtems_filesystem_eval_path_context_t ctx; int eval_flags = RTEMS_FS_PERMS_RWX | RTEMS_FS_FOLLOW_LINK; rtems_filesystem_location_info_t *currentloc = rtems_filesystem_eval_path_start( &ctx, target, eval_flags ); 8003344: 37 8c 00 3c addi r12,sp,60 { int rv = 0; rtems_filesystem_eval_path_context_t ctx; int eval_flags = RTEMS_FS_PERMS_RWX | RTEMS_FS_FOLLOW_LINK; rtems_filesystem_location_info_t *currentloc = 8003348: b9 c0 10 00 mv r2,r14 800334c: 34 03 00 1f mvi r3,31 8003350: b9 80 08 00 mv r1,r12 8003354: f8 00 03 3d calli 8004048 static inline bool rtems_filesystem_location_is_instance_root( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 8003358: 28 22 00 14 lw r2,(r1+20) return (*mt_entry->ops->are_nodes_equal_h)( 800335c: 28 43 00 0c lw r3,(r2+12) 8003360: 28 42 00 24 lw r2,(r2+36) 8003364: 28 63 00 10 lw r3,(r3+16) 8003368: d8 60 00 00 call r3 800336c: b8 20 70 00 mv r14,r1 rtems_filesystem_eval_path_start( &ctx, target, eval_flags ); if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { 8003370: 5c 20 00 1f bne r1,r0,80033ec rtems_filesystem_location_info_t targetloc; rtems_filesystem_global_location_t *mt_point_node; rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc ); 8003374: 37 8c 00 74 addi r12,sp,116 static inline void rtems_filesystem_eval_path_extract_currentloc( rtems_filesystem_eval_path_context_t *ctx, rtems_filesystem_location_info_t *get ) { rtems_filesystem_location_copy_and_detach( 8003378: b9 80 08 00 mv r1,r12 800337c: 37 82 00 54 addi r2,sp,84 8003380: f8 00 04 62 calli 8004508 mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc ); 8003384: b9 80 08 00 mv r1,r12 8003388: f8 00 04 fe calli 8004780 mt_entry->mt_point_node = mt_point_node; 800338c: 59 61 00 20 sw (r11+32),r1 if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { rtems_filesystem_location_info_t targetloc; rtems_filesystem_global_location_t *mt_point_node; rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc ); mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc ); 8003390: b8 20 68 00 mv r13,r1 mt_entry->mt_point_node = mt_point_node; rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 8003394: 28 21 00 14 lw r1,(r1+20) 8003398: 28 21 00 0c lw r1,(r1+12) 800339c: 28 22 00 30 lw r2,(r1+48) 80033a0: b9 60 08 00 mv r1,r11 80033a4: d8 40 00 00 call r2 80033a8: b8 20 60 00 mv r12,r1 if ( rv == 0 ) { 80033ac: 5c 2e 00 0d bne r1,r14,80033e0 rtems_filesystem_mt_lock(); 80033b0: fb ff ff 73 calli 800317c Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 80033b4: 78 01 08 01 mvhi r1,0x801 80033b8: 38 21 a0 dc ori r1,r1,0xa0dc 80033bc: 28 23 00 08 lw r3,(r1+8) the_node->next = tail; 80033c0: 78 02 08 01 mvhi r2,0x801 80033c4: 38 42 a0 e0 ori r2,r2,0xa0e0 80033c8: 59 62 00 00 sw (r11+0),r2 tail->previous = the_node; 80033cc: 58 2b 00 08 sw (r1+8),r11 old_last->next = the_node; 80033d0: 58 6b 00 00 sw (r3+0),r11 the_node->previous = old_last; 80033d4: 59 63 00 04 sw (r11+4),r3 rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); rtems_filesystem_mt_unlock(); 80033d8: fb ff ff 74 calli 80031a8 80033dc: e0 00 00 08 bi 80033fc } else { rtems_filesystem_global_location_release( mt_point_node ); 80033e0: b9 a0 08 00 mv r1,r13 80033e4: f8 00 04 84 calli 80045f4 80033e8: e0 00 00 05 bi 80033fc } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); 80033ec: b9 80 08 00 mv r1,r12 80033f0: 34 02 00 10 mvi r2,16 80033f4: f8 00 02 4d calli 8003d28 rv = -1; 80033f8: 34 0c ff ff mvi r12,-1 } rtems_filesystem_eval_path_cleanup( &ctx ); 80033fc: 37 81 00 3c addi r1,sp,60 8003400: f8 00 03 5f calli 800417c rv = register_subordinate_file_system( mt_entry, target ); } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { 8003404: 45 80 00 32 be r12,r0,80034cc 8003408: e0 00 00 26 bi 80034a0 rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; rtems_filesystem_mt_lock(); 800340c: fb ff ff 5c calli 800317c errno = EINVAL; rv = -1; } return rv; } 8003410: 78 01 08 01 mvhi r1,0x801 8003414: 38 21 a0 dc ori r1,r1,0xa0dc ) { int rv = 0; rtems_filesystem_mt_lock(); if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { 8003418: 28 23 00 00 lw r3,(r1+0) 800341c: 78 02 08 01 mvhi r2,0x801 8003420: 38 42 a0 e0 ori r2,r2,0xa0e0 8003424: 5c 62 00 07 bne r3,r2,8003440 <== NEVER TAKEN Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 8003428: 28 22 00 08 lw r2,(r1+8) the_node->next = tail; 800342c: 59 63 00 00 sw (r11+0),r3 tail->previous = the_node; 8003430: 58 2b 00 08 sw (r1+8),r11 old_last->next = the_node; 8003434: 58 4b 00 00 sw (r2+0),r11 the_node->previous = old_last; 8003438: 59 62 00 04 sw (r11+4),r2 800343c: e0 00 00 05 bi 8003450 rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); } else { errno = EINVAL; 8003440: f8 00 3a 23 calli 8011ccc <__errno> <== NOT EXECUTED 8003444: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8003448: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 800344c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED } rtems_filesystem_mt_unlock(); 8003450: fb ff ff 56 calli 80031a8 if ( rv == 0 ) { 8003454: 5d 80 00 12 bne r12,r0,800349c <== NEVER TAKEN rtems_filesystem_global_location_t *new_fs_root = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); 8003458: 35 6b 00 24 addi r11,r11,36 rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = 800345c: b9 60 08 00 mv r1,r11 8003460: f8 00 04 8e calli 8004698 8003464: b8 20 70 00 mv r14,r1 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = 8003468: b9 60 08 00 mv r1,r11 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 800346c: 78 0b 08 01 mvhi r11,0x801 rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = 8003470: f8 00 04 8a calli 8004698 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 8003474: 39 6b a1 78 ori r11,r11,0xa178 rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = 8003478: b8 20 68 00 mv r13,r1 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 800347c: 29 61 00 00 lw r1,(r11+0) 8003480: b9 c0 10 00 mv r2,r14 8003484: 34 21 00 04 addi r1,r1,4 8003488: f8 00 04 76 calli 8004660 &rtems_filesystem_root, new_fs_root ); rtems_filesystem_global_location_assign( 800348c: 29 61 00 00 lw r1,(r11+0) 8003490: b9 a0 10 00 mv r2,r13 8003494: f8 00 04 73 calli 8004660 8003498: e0 00 00 0d bi 80034cc errno = EINVAL; rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { 800349c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { (*mt_entry->ops->fsunmount_me_h)( mt_entry ); 80034a0: 29 61 00 0c lw r1,(r11+12) 80034a4: 28 22 00 3c lw r2,(r1+60) 80034a8: b9 60 08 00 mv r1,r11 80034ac: d8 40 00 00 call r2 } } if ( rv != 0 ) { free( mt_entry ); 80034b0: b9 60 08 00 mv r1,r11 80034b4: fb ff fd 17 calli 8002910 80034b8: e0 00 00 05 bi 80034cc } else { errno = EINVAL; rv = -1; } } else { errno = EINVAL; 80034bc: f8 00 3a 04 calli 8011ccc <__errno> 80034c0: 34 02 00 16 mvi r2,22 80034c4: 58 22 00 00 sw (r1+0),r2 rv = -1; 80034c8: 34 0c ff ff mvi r12,-1 } return rv; } 80034cc: b9 80 08 00 mv r1,r12 80034d0: 2b 9d 00 04 lw ra,(sp+4) 80034d4: 2b 8b 00 38 lw r11,(sp+56) 80034d8: 2b 8c 00 34 lw r12,(sp+52) 80034dc: 2b 8d 00 30 lw r13,(sp+48) 80034e0: 2b 8e 00 2c lw r14,(sp+44) 80034e4: 2b 8f 00 28 lw r15,(sp+40) 80034e8: 2b 90 00 24 lw r16,(sp+36) 80034ec: 2b 91 00 20 lw r17,(sp+32) 80034f0: 2b 92 00 1c lw r18,(sp+28) 80034f4: 2b 93 00 18 lw r19,(sp+24) 80034f8: 2b 94 00 14 lw r20,(sp+20) 80034fc: 2b 95 00 10 lw r21,(sp+16) 8003500: 2b 96 00 0c lw r22,(sp+12) 8003504: 2b 97 00 08 lw r23,(sp+8) 8003508: 37 9c 00 88 addi sp,sp,136 800350c: c3 a0 00 00 ret =============================================================================== 08006e6c : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8006e6c: 37 9c ff e8 addi sp,sp,-24 8006e70: 5b 8b 00 0c sw (sp+12),r11 8006e74: 5b 8c 00 08 sw (sp+8),r12 8006e78: 5b 9d 00 04 sw (sp+4),ra 8006e7c: b8 20 60 00 mv r12,r1 8006e80: b8 40 58 00 mv r11,r2 int rv = -1; if (target != NULL) { 8006e84: 44 40 00 0f be r2,r0,8006ec0 rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); 8006e88: b8 40 08 00 mv r1,r2 8006e8c: 34 02 01 ff mvi r2,511 8006e90: 5b 83 00 18 sw (sp+24),r3 8006e94: 5b 84 00 14 sw (sp+20),r4 8006e98: 5b 85 00 10 sw (sp+16),r5 8006e9c: f8 00 03 2b calli 8007b48 if (rv == 0) { 8006ea0: 2b 83 00 18 lw r3,(sp+24) 8006ea4: 2b 84 00 14 lw r4,(sp+20) 8006ea8: 2b 85 00 10 lw r5,(sp+16) 8006eac: 5c 20 00 09 bne r1,r0,8006ed0 <== NEVER TAKEN rv = mount( 8006eb0: b9 80 08 00 mv r1,r12 8006eb4: b9 60 10 00 mv r2,r11 8006eb8: f8 00 00 1f calli 8006f34 8006ebc: e0 00 00 05 bi 8006ed0 options, data ); } } else { errno = EINVAL; 8006ec0: f8 00 67 92 calli 8020d08 <__errno> 8006ec4: 34 02 00 16 mvi r2,22 8006ec8: 58 22 00 00 sw (r1+0),r2 const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { int rv = -1; 8006ecc: 34 01 ff ff mvi r1,-1 } else { errno = EINVAL; } return rv; } 8006ed0: 2b 9d 00 04 lw ra,(sp+4) 8006ed4: 2b 8b 00 0c lw r11,(sp+12) 8006ed8: 2b 8c 00 08 lw r12,(sp+8) 8006edc: 37 9c 00 18 addi sp,sp,24 8006ee0: c3 a0 00 00 ret =============================================================================== 08015b70 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 8015b70: 37 9c ff 24 addi sp,sp,-220 8015b74: 5b 8b 00 44 sw (sp+68),r11 8015b78: 5b 8c 00 40 sw (sp+64),r12 8015b7c: 5b 8d 00 3c sw (sp+60),r13 8015b80: 5b 8e 00 38 sw (sp+56),r14 8015b84: 5b 8f 00 34 sw (sp+52),r15 8015b88: 5b 90 00 30 sw (sp+48),r16 8015b8c: 5b 91 00 2c sw (sp+44),r17 8015b90: 5b 92 00 28 sw (sp+40),r18 8015b94: 5b 93 00 24 sw (sp+36),r19 8015b98: 5b 94 00 20 sw (sp+32),r20 8015b9c: 5b 95 00 1c sw (sp+28),r21 8015ba0: 5b 96 00 18 sw (sp+24),r22 8015ba4: 5b 97 00 14 sw (sp+20),r23 8015ba8: 5b 98 00 10 sw (sp+16),r24 8015bac: 5b 99 00 0c sw (sp+12),r25 8015bb0: 5b 9b 00 08 sw (sp+8),fp 8015bb4: 5b 9d 00 04 sw (sp+4),ra 8015bb8: b8 60 80 00 mv r16,r3 int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; 8015bbc: 28 23 00 14 lw r3,(r1+20) uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 8015bc0: 37 8d 00 a8 addi r13,sp,168 const fat_file_fd_t *link_fd) { int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; fat_file_fd_t *parent_fat_fd = parent_loc->node_access; 8015bc4: 28 36 00 08 lw r22,(r1+8) mode_t mode, const fat_file_fd_t *link_fd) { int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; 8015bc8: 28 73 00 08 lw r19,(r3+8) fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; dir_pos->sname.ofs = 0; dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 8015bcc: 34 0c ff ff mvi r12,-1 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 8015bd0: 34 03 00 20 mvi r3,32 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 8015bd4: b8 20 a0 00 mv r20,r1 8015bd8: b8 40 a8 00 mv r21,r2 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 8015bdc: b9 a0 08 00 mv r1,r13 8015be0: 34 02 00 00 mvi r2,0 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 8015be4: b8 80 70 00 mv r14,r4 8015be8: b8 c0 88 00 mv r17,r6 int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; fat_file_fd_t *parent_fat_fd = parent_loc->node_access; fat_file_fd_t *fat_fd = NULL; 8015bec: 5b 80 00 d8 sw (sp+216),r0 time_t time_ret = 0; uint16_t time_val = 0; 8015bf0: 0f 80 00 de sh (sp+222),r0 uint16_t date = 0; 8015bf4: 0f 80 00 dc sh (sp+220),r0 static inline void fat_dir_pos_init( fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; 8015bf8: 5b 80 00 c8 sw (sp+200),r0 dir_pos->sname.ofs = 0; 8015bfc: 5b 80 00 cc sw (sp+204),r0 dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 8015c00: 5b 8c 00 d0 sw (sp+208),r12 dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 8015c04: 5b 8c 00 d4 sw (sp+212),r12 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 8015c08: f8 00 17 a2 calli 801ba90 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 8015c0c: 34 03 00 40 mvi r3,64 8015c10: 37 81 00 48 addi r1,sp,72 8015c14: 34 02 00 00 mvi r2,0 8015c18: f8 00 17 9e calli 801ba90 if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 8015c1c: 34 03 01 04 mvi r3,260 8015c20: 4c 6e 00 04 bge r3,r14,8015c30 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENAMETOOLONG); 8015c24: f8 00 14 0c calli 801ac54 <__errno> <== NOT EXECUTED 8015c28: 34 02 00 5b mvi r2,91 <== NOT EXECUTED 8015c2c: e0 00 00 0a bi 8015c54 <== NOT EXECUTED } name_type = msdos_long_to_short (name, name_len, 8015c30: ba 00 08 00 mv r1,r16 8015c34: b9 c0 10 00 mv r2,r14 8015c38: b9 a0 18 00 mv r3,r13 8015c3c: 34 04 00 0b mvi r4,11 8015c40: f8 00 02 14 calli 8016490 8015c44: b8 20 78 00 mv r15,r1 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 8015c48: 5c 20 00 06 bne r1,r0,8015c60 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EINVAL); 8015c4c: f8 00 14 02 calli 801ac54 <__errno> <== NOT EXECUTED 8015c50: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8015c54: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8015c58: 34 0b ff ff mvi r11,-1 <== NOT EXECUTED 8015c5c: e0 00 01 6d bi 8016210 <== NOT EXECUTED /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; /* set up last write date and time */ time_ret = time(NULL); 8015c60: 34 01 00 00 mvi r1,0 if (name_type == MSDOS_NAME_INVALID) { rtems_set_errno_and_return_minus_one(EINVAL); } /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; 8015c64: 33 80 00 b4 sb (sp+180),r0 /* set up last write date and time */ time_ret = time(NULL); 8015c68: f8 00 25 ae calli 801f320