=============================================================================== 08003760 : */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 8003760: 37 9c ff bc addi sp,sp,-68 8003764: 5b 8b 00 44 sw (sp+68),r11 8003768: 5b 8c 00 40 sw (sp+64),r12 800376c: 5b 8d 00 3c sw (sp+60),r13 8003770: 5b 8e 00 38 sw (sp+56),r14 8003774: 5b 8f 00 34 sw (sp+52),r15 8003778: 5b 90 00 30 sw (sp+48),r16 800377c: 5b 91 00 2c sw (sp+44),r17 8003780: 5b 92 00 28 sw (sp+40),r18 8003784: 5b 93 00 24 sw (sp+36),r19 8003788: 5b 94 00 20 sw (sp+32),r20 800378c: 5b 95 00 1c sw (sp+28),r21 8003790: 5b 96 00 18 sw (sp+24),r22 8003794: 5b 97 00 14 sw (sp+20),r23 8003798: 5b 98 00 10 sw (sp+16),r24 800379c: 5b 99 00 0c sw (sp+12),r25 80037a0: 5b 9b 00 08 sw (sp+8),fp 80037a4: 5b 9d 00 04 sw (sp+4),ra } int IMFS_memfile_maximum_size( void ) { return IMFS_MEMFILE_MAXIMUM_SIZE; } 80037a8: 28 2d 00 50 lw r13,(r1+80) RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 80037ac: 34 30 00 54 addi r16,r1,84 */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 80037b0: b8 40 70 00 mv r14,r2 IMFS_assert( level >= 0 ); IMFS_assert( IMFS_is_directory( the_directory ) ); the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); 80037b4: 45 b0 00 38 be r13,r16,8003894 80037b8: 78 0b 08 02 mvhi r11,0x802 80037bc: 78 0f 08 02 mvhi r15,0x802 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 80037c0: 78 19 08 02 mvhi r25,0x802 ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { 80037c4: 78 12 08 02 mvhi r18,0x802 default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); 80037c8: 78 11 08 02 mvhi r17,0x802 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 80037cc: 78 18 08 02 mvhi r24,0x802 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 80037d0: 78 14 08 02 mvhi r20,0x802 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 80037d4: 78 17 08 02 mvhi r23,0x802 fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 80037d8: 78 16 08 02 mvhi r22,0x802 case IMFS_DIRECTORY: fprintf(stdout, "/" ); break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 80037dc: 78 15 08 02 mvhi r21,0x802 80037e0: 39 6b 72 78 ori r11,r11,0x7278 80037e4: 39 ef 4d ec ori r15,r15,0x4dec ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { 80037e8: 34 13 00 06 mvi r19,6 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 80037ec: 3b 39 4e 4c ori r25,r25,0x4e4c ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { 80037f0: 3a 52 4e d0 ori r18,r18,0x4ed0 default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); 80037f4: 3a 31 49 bc ori r17,r17,0x49bc case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 80037f8: 3b 18 4e 38 ori r24,r24,0x4e38 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 80037fc: 3a 94 4e 24 ori r20,r20,0x4e24 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 8003800: 3a f7 4e 18 ori r23,r23,0x4e18 fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 8003804: 3a d6 4e 08 ori r22,r22,0x4e08 case IMFS_DIRECTORY: fprintf(stdout, "/" ); break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 8003808: 3a b5 4d f4 ori r21,r21,0x4df4 for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) IMFS_dump_directory( the_jnode, level + 1 ); 800380c: 34 5b 00 01 addi fp,r2,1 !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) 8003810: 48 0e 00 0a bg r0,r14,8003838 <== NEVER TAKEN 8003814: 34 0c 00 00 mvi r12,0 fprintf(stdout, "...." ); 8003818: 29 63 00 00 lw r3,(r11+0) !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) 800381c: 35 8c 00 01 addi r12,r12,1 fprintf(stdout, "...." ); 8003820: b9 e0 08 00 mv r1,r15 8003824: 28 64 00 08 lw r4,(r3+8) 8003828: 34 02 00 01 mvi r2,1 800382c: 34 03 00 04 mvi r3,4 8003830: f8 00 3d b4 calli 8012f00 !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) 8003834: 4d cc ff f9 bge r14,r12,8003818 IMFS_jnode_t *the_jnode ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 8003838: 29 63 00 00 lw r3,(r11+0) 800383c: 35 a1 00 0c addi r1,r13,12 8003840: 28 62 00 08 lw r2,(r3+8) 8003844: f8 00 3a 75 calli 8012218 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 8003848: 29 a3 00 4c lw r3,(r13+76) 800384c: 28 63 00 00 lw r3,(r3+0) switch( IMFS_type( the_jnode ) ) { 8003850: 54 73 00 4c bgu r3,r19,8003980 <== NEVER TAKEN 8003854: b4 63 18 00 add r3,r3,r3 8003858: b4 63 18 00 add r3,r3,r3 800385c: b6 43 18 00 add r3,r18,r3 8003860: 28 63 00 00 lw r3,(r3+0) 8003864: c0 60 00 00 b r3 case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 8003868: 29 63 00 00 lw r3,(r11+0) 800386c: ba 80 08 00 mv r1,r20 8003870: 34 02 00 01 mvi r2,1 8003874: 28 64 00 08 lw r4,(r3+8) 8003878: 34 03 00 13 mvi r3,19 800387c: f8 00 3d a1 calli 8012f00 } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 8003880: 29 a3 00 4c lw r3,(r13+76) the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) 8003884: 28 63 00 00 lw r3,(r3+0) 8003888: 44 60 00 21 be r3,r0,800390c <== NEVER TAKEN the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { 800388c: 29 ad 00 00 lw r13,(r13+0) IMFS_assert( level >= 0 ); IMFS_assert( IMFS_is_directory( the_directory ) ); the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); 8003890: 5d b0 ff e0 bne r13,r16,8003810 fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) IMFS_dump_directory( the_jnode, level + 1 ); } } 8003894: 2b 9d 00 04 lw ra,(sp+4) 8003898: 2b 8b 00 44 lw r11,(sp+68) 800389c: 2b 8c 00 40 lw r12,(sp+64) 80038a0: 2b 8d 00 3c lw r13,(sp+60) 80038a4: 2b 8e 00 38 lw r14,(sp+56) 80038a8: 2b 8f 00 34 lw r15,(sp+52) 80038ac: 2b 90 00 30 lw r16,(sp+48) 80038b0: 2b 91 00 2c lw r17,(sp+44) 80038b4: 2b 92 00 28 lw r18,(sp+40) 80038b8: 2b 93 00 24 lw r19,(sp+36) 80038bc: 2b 94 00 20 lw r20,(sp+32) 80038c0: 2b 95 00 1c lw r21,(sp+28) 80038c4: 2b 96 00 18 lw r22,(sp+24) 80038c8: 2b 97 00 14 lw r23,(sp+20) 80038cc: 2b 98 00 10 lw r24,(sp+16) 80038d0: 2b 99 00 0c lw r25,(sp+12) 80038d4: 2b 9b 00 08 lw fp,(sp+8) 80038d8: 37 9c 00 44 addi sp,sp,68 80038dc: c3 a0 00 00 ret fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 80038e0: 29 61 00 00 lw r1,(r11+0) 80038e4: 29 a3 00 50 lw r3,(r13+80) 80038e8: 29 a4 00 54 lw r4,(r13+84) 80038ec: 28 21 00 08 lw r1,(r1+8) 80038f0: ba c0 10 00 mv r2,r22 80038f4: f8 00 39 de calli 801206c default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); 80038f8: ba 20 08 00 mv r1,r17 80038fc: f8 00 42 22 calli 8014184 8003900: 29 a3 00 4c lw r3,(r13+76) the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) 8003904: 28 63 00 00 lw r3,(r3+0) 8003908: 5c 60 ff e1 bne r3,r0,800388c IMFS_dump_directory( the_jnode, level + 1 ); 800390c: b9 a0 08 00 mv r1,r13 8003910: bb 60 10 00 mv r2,fp 8003914: fb ff ff 93 calli 8003760 8003918: e3 ff ff dd bi 800388c case IMFS_DIRECTORY: fprintf(stdout, "/" ); break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 800391c: 29 61 00 00 lw r1,(r11+0) 8003920: 29 a3 00 50 lw r3,(r13+80) 8003924: 29 a4 00 54 lw r4,(r13+84) 8003928: 28 21 00 08 lw r1,(r1+8) 800392c: ba a0 10 00 mv r2,r21 8003930: f8 00 39 cf calli 801206c 8003934: e3 ff ff f1 bi 80038f8 IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { case IMFS_DIRECTORY: fprintf(stdout, "/" ); 8003938: 29 62 00 00 lw r2,(r11+0) 800393c: 34 01 00 2f mvi r1,47 8003940: 28 42 00 08 lw r2,(r2+8) 8003944: f8 00 39 f1 calli 8012108 8003948: e3 ff ff ec bi 80038f8 case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 800394c: 29 63 00 00 lw r3,(r11+0) 8003950: bb 00 08 00 mv r1,r24 8003954: 34 02 00 01 mvi r2,1 8003958: 28 64 00 08 lw r4,(r3+8) 800395c: 34 03 00 12 mvi r3,18 8003960: f8 00 3d 68 calli 8012f00 8003964: e3 ff ff c7 bi 8003880 the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 8003968: 29 61 00 00 lw r1,(r11+0) 800396c: 29 a3 00 50 lw r3,(r13+80) 8003970: ba e0 10 00 mv r2,r23 8003974: 28 21 00 08 lw r1,(r1+8) 8003978: f8 00 39 bd calli 801206c 800397c: e3 ff ff df bi 80038f8 case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 8003980: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED 8003984: bb 20 10 00 mv r2,r25 <== NOT EXECUTED 8003988: 28 21 00 08 lw r1,(r1+8) <== NOT EXECUTED 800398c: f8 00 39 b8 calli 801206c <== NOT EXECUTED 8003990: e3 ff ff bc bi 8003880 <== NOT EXECUTED =============================================================================== 0800871c : rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 800871c: 37 9c ff e4 addi sp,sp,-28 8008720: 5b 8b 00 1c sw (sp+28),r11 8008724: 5b 8c 00 18 sw (sp+24),r12 8008728: 5b 8d 00 14 sw (sp+20),r13 800872c: 5b 8e 00 10 sw (sp+16),r14 8008730: 5b 8f 00 0c sw (sp+12),r15 8008734: 5b 90 00 08 sw (sp+8),r16 8008738: 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; 800873c: 28 2c 00 20 lw r12,(r1+32) rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 8008740: b8 60 78 00 mv r15,r3 8008744: b8 80 70 00 mv r14,r4 rtems_filesystem_eval_path_generic_status status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE; rtems_filesystem_location_info_t *currentloc = rtems_filesystem_eval_path_get_currentloc( ctx ); IMFS_jnode_t *dir = currentloc->node_access; bool access_ok = rtems_filesystem_eval_path_check_access( 8008748: 29 83 00 30 lw r3,(r12+48) 800874c: 2d 84 00 3c lhu r4,(r12+60) 8008750: 2d 85 00 3e lhu r5,(r12+62) 8008754: 34 02 00 01 mvi r2,1 rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen ) { 8008758: b8 20 68 00 mv r13,r1 rtems_filesystem_eval_path_generic_status status = 800875c: 34 0b 00 01 mvi r11,1 RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE; rtems_filesystem_location_info_t *currentloc = rtems_filesystem_eval_path_get_currentloc( ctx ); IMFS_jnode_t *dir = currentloc->node_access; bool access_ok = rtems_filesystem_eval_path_check_access( 8008760: f8 00 03 a8 calli 8009600 dir->st_mode, dir->st_uid, dir->st_gid ); if ( access_ok ) { 8008764: 44 20 00 27 be r1,r0,8008800 static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; 8008768: 45 cb 00 44 be r14,r11,8008878 static inline bool rtems_filesystem_is_parent_directory( const char *token, size_t tokenlen ) { return tokenlen == 2 && token [0] == '.' && token [1] == '.'; 800876c: 34 01 00 02 mvi r1,2 8008770: 45 c1 00 57 be r14,r1,80088cc }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 8008774: 29 8b 00 50 lw r11,(r12+80) if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { return dir->Parent; } else { rtems_chain_control *entries = &dir->info.directory.Entries; rtems_chain_node *current = rtems_chain_first( entries ); rtems_chain_node *tail = rtems_chain_tail( entries ); 8008778: 35 90 00 54 addi r16,r12,84 while ( current != tail ) { 800877c: 45 70 00 2d be r11,r16,8008830 IMFS_jnode_t *entry = (IMFS_jnode_t *) current; bool match = strncmp( entry->name, token, tokenlen ) == 0 8008780: b9 e0 10 00 mv r2,r15 8008784: 35 61 00 0c addi r1,r11,12 8008788: b9 c0 18 00 mv r3,r14 800878c: f8 00 19 2e calli 800ec44 && entry->name [tokenlen] == '\0'; 8008790: b5 6e 10 00 add r2,r11,r14 rtems_chain_control *entries = &dir->info.directory.Entries; rtems_chain_node *current = rtems_chain_first( entries ); rtems_chain_node *tail = rtems_chain_tail( entries ); while ( current != tail ) { IMFS_jnode_t *entry = (IMFS_jnode_t *) current; 8008794: b9 60 28 00 mv r5,r11 bool match = strncmp( entry->name, token, tokenlen ) == 0 && entry->name [tokenlen] == '\0'; 8008798: 5c 20 00 24 bne r1,r0,8008828 800879c: 40 42 00 0c lbu r2,(r2+12) 80087a0: 5c 41 00 22 bne r2,r1,8008828 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; 80087a4: 34 0b 00 02 mvi r11,2 ); if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { 80087a8: 44 a0 00 16 be r5,r0,8008800 }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 80087ac: 28 a3 00 4c lw r3,(r5+76) if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { bool terminal = !rtems_filesystem_eval_path_has_path( ctx ); 80087b0: 29 a4 00 04 lw r4,(r13+4) }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 80087b4: 29 a2 00 10 lw r2,(r13+16) rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 80087b8: 28 61 00 00 lw r1,(r3+0) static inline void rtems_filesystem_eval_path_clear_token( rtems_filesystem_eval_path_context_t *ctx ) { ctx->tokenlen = 0; 80087bc: 59 a0 00 0c sw (r13+12),r0 if ( access_ok ) { IMFS_jnode_t *entry = IMFS_search_in_directory( dir, token, tokenlen ); if ( entry != NULL ) { bool terminal = !rtems_filesystem_eval_path_has_path( ctx ); 80087c0: 64 84 00 00 cmpei r4,r4,0 bool follow_sym_link = (eval_flags & RTEMS_FS_FOLLOW_SYM_LINK) != 0; IMFS_jnode_types_t type = IMFS_type( entry ); rtems_filesystem_eval_path_clear_token( ctx ); if ( type == IMFS_HARD_LINK && (follow_hard_link || !terminal)) { 80087c4: 44 2b 00 1d be r1,r11,8008838 entry = entry->info.hard_link.link_node; } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 80087c8: 34 06 00 03 mvi r6,3 80087cc: 44 26 00 34 be r1,r6,800889c IMFS_jnode_types_t type ) { rtems_filesystem_global_location_t **fs_root_ptr = NULL; if ( type == IMFS_DIRECTORY ) { 80087d0: 5c 20 00 1f bne r1,r0,800884c if ( node->info.directory.mt_fs != NULL ) { 80087d4: 28 a6 00 5c lw r6,(r5+92) 80087d8: 44 c1 00 1d be r6,r1,800884c if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( 80087dc: 28 a3 00 30 lw r3,(r5+48) 80087e0: 2c a4 00 3c lhu r4,(r5+60) 80087e4: 2c a5 00 3e lhu r5,(r5+62) 80087e8: b9 a0 08 00 mv r1,r13 80087ec: 34 02 00 01 mvi r2,1 { rtems_filesystem_global_location_t **fs_root_ptr = NULL; if ( type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { fs_root_ptr = &node->info.directory.mt_fs->mt_fs_root; 80087f0: 34 cc 00 24 addi r12,r6,36 if ( !terminal ) { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE; } } else { access_ok = rtems_filesystem_eval_path_check_access( 80087f4: f8 00 03 83 calli 8009600 void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 80087f8: 34 0b 00 01 mvi r11,1 RTEMS_FS_PERMS_EXEC, entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { 80087fc: 5c 20 00 24 bne r1,r0,800888c <== ALWAYS TAKEN status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; } } return status; } 8008800: b9 60 08 00 mv r1,r11 8008804: 2b 9d 00 04 lw ra,(sp+4) 8008808: 2b 8b 00 1c lw r11,(sp+28) 800880c: 2b 8c 00 18 lw r12,(sp+24) 8008810: 2b 8d 00 14 lw r13,(sp+20) 8008814: 2b 8e 00 10 lw r14,(sp+16) 8008818: 2b 8f 00 0c lw r15,(sp+12) 800881c: 2b 90 00 08 lw r16,(sp+8) 8008820: 37 9c 00 1c addi sp,sp,28 8008824: c3 a0 00 00 ret }; void IMFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { rtems_filesystem_eval_path_generic( ctx, NULL, &IMFS_eval_config ); } 8008828: 29 6b 00 00 lw r11,(r11+0) } else { rtems_chain_control *entries = &dir->info.directory.Entries; rtems_chain_node *current = rtems_chain_first( entries ); rtems_chain_node *tail = rtems_chain_tail( entries ); while ( current != tail ) { 800882c: 5e 0b ff d5 bne r16,r11,8008780 rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); } } } } else { status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY; 8008830: 34 0b 00 02 mvi r11,2 8008834: e3 ff ff f3 bi 8008800 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; 8008838: 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)) { 800883c: 5c 40 00 02 bne r2,r0,8008844 8008840: 5c 82 00 02 bne r4,r2,8008848 <== ALWAYS TAKEN entry = entry->info.hard_link.link_node; 8008844: 28 a5 00 50 lw r5,(r5+80) } else { rtems_chain_control *entries = &dir->info.directory.Entries; rtems_chain_node *current = rtems_chain_first( entries ); rtems_chain_node *tail = rtems_chain_tail( entries ); while ( current != tail ) { 8008848: 28 a3 00 4c lw r3,(r5+76) } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; 800884c: 2d 81 00 34 lhu r1,(r12+52) static inline void IMFS_Set_handlers( rtems_filesystem_location_info_t *loc ) { IMFS_jnode_t *node = (IMFS_jnode_t *) loc->node_access; loc->handlers = node->control->handlers; 8008850: 28 62 00 04 lw r2,(r3+4) void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 8008854: b8 80 58 00 mv r11,r4 } else { rtems_filesystem_global_location_t **fs_root_ptr = IMFS_is_mount_point( entry, type ); if ( fs_root_ptr == NULL ) { --dir->reference_count; 8008858: 34 21 ff ff addi r1,r1,-1 800885c: 0d 81 00 34 sh (r12+52),r1 ++entry->reference_count; 8008860: 2c a1 00 34 lhu r1,(r5+52) 8008864: 34 21 00 01 addi r1,r1,1 8008868: 0c a1 00 34 sh (r5+52),r1 currentloc->node_access = entry; 800886c: 59 a5 00 20 sw (r13+32),r5 8008870: 59 a2 00 28 sw (r13+40),r2 8008874: e3 ff ff e3 bi 8008800 static inline bool rtems_filesystem_is_current_directory( const char *token, size_t tokenlen ) { return tokenlen == 1 && token [0] == '.'; 8008878: 41 e2 00 00 lbu r2,(r15+0) 800887c: 34 01 00 2e mvi r1,46 8008880: 5c 41 ff bd bne r2,r1,8008774 8008884: b9 80 28 00 mv r5,r12 8008888: e3 ff ff c7 bi 80087a4 entry->st_mode, entry->st_uid, entry->st_gid ); if ( access_ok ) { rtems_filesystem_eval_path_restart( ctx, fs_root_ptr ); 800888c: b9 a0 08 00 mv r1,r13 8008890: b9 80 10 00 mv r2,r12 8008894: fb ff e9 4e calli 8002dcc 8008898: e3 ff ff da bi 8008800 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; 800889c: 20 42 00 10 andi r2,r2,0x10 if ( type == IMFS_HARD_LINK && (follow_hard_link || !terminal)) { entry = entry->info.hard_link.link_node; } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 80088a0: 5c 40 00 02 bne r2,r0,80088a8 80088a4: 5c 82 ff ea bne r4,r2,800884c const char *target = entry->info.sym_link.name; 80088a8: 28 ac 00 50 lw r12,(r5+80) void *arg, const char *token, size_t tokenlen ) { rtems_filesystem_eval_path_generic_status status = 80088ac: 34 0b 00 01 mvi r11,1 } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { const char *target = entry->info.sym_link.name; rtems_filesystem_eval_path_recursive( ctx, target, strlen( target ) ); 80088b0: b9 80 08 00 mv r1,r12 80088b4: f8 00 18 b5 calli 800eb88 80088b8: b8 20 18 00 mv r3,r1 80088bc: b9 80 10 00 mv r2,r12 80088c0: b9 a0 08 00 mv r1,r13 80088c4: fb ff e9 72 calli 8002e8c if ( type == IMFS_HARD_LINK && (follow_hard_link || !terminal)) { entry = entry->info.hard_link.link_node; } if ( type == IMFS_SYM_LINK && (follow_sym_link || !terminal)) { 80088c8: e3 ff ff ce bi 8008800 static inline bool rtems_filesystem_is_parent_directory( const char *token, size_t tokenlen ) { return tokenlen == 2 && token [0] == '.' && token [1] == '.'; 80088cc: 41 e1 00 00 lbu r1,(r15+0) 80088d0: 34 02 00 2e mvi r2,46 80088d4: 5c 22 ff a8 bne r1,r2,8008774 80088d8: 41 e2 00 01 lbu r2,(r15+1) 80088dc: 5c 41 ff a6 bne r2,r1,8008774 <== NEVER TAKEN { if ( rtems_filesystem_is_current_directory( token, tokenlen ) ) { return dir; } else { if ( rtems_filesystem_is_parent_directory( token, tokenlen ) ) { return dir->Parent; 80088e0: 29 85 00 08 lw r5,(r12+8) 80088e4: e3 ff ff b0 bi 80087a4 =============================================================================== 080019c0 : static ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { 80019c0: 37 9c ff ec addi sp,sp,-20 80019c4: 5b 8b 00 0c sw (sp+12),r11 80019c8: 5b 8c 00 08 sw (sp+8),r12 80019cc: 5b 9d 00 04 sw (sp+4),ra IMFS_jnode_t *jnode = iop->pathinfo.node_access; 80019d0: 28 2c 00 14 lw r12,(r1+20) int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); 80019d4: b8 20 20 00 mv r4,r1 80019d8: 29 81 00 50 lw r1,(r12+80) 80019dc: f8 00 25 ec calli 800b18c 80019e0: b8 20 58 00 mv r11,r1 if (err > 0) { 80019e4: 4c 01 00 0d bge r0,r1,8001a18 IMFS_mtime_ctime_update(jnode); 80019e8: 37 81 00 10 addi r1,sp,16 80019ec: 34 02 00 00 mvi r2,0 80019f0: f8 00 04 09 calli 8002a14 80019f4: 2b 81 00 10 lw r1,(sp+16) 80019f8: 59 81 00 44 sw (r12+68),r1 80019fc: 59 81 00 48 sw (r12+72),r1 } IMFS_FIFO_RETURN(err); } 8001a00: b9 60 08 00 mv r1,r11 8001a04: 2b 9d 00 04 lw ra,(sp+4) 8001a08: 2b 8b 00 0c lw r11,(sp+12) 8001a0c: 2b 8c 00 08 lw r12,(sp+8) 8001a10: 37 9c 00 14 addi sp,sp,20 8001a14: c3 a0 00 00 ret int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); if (err > 0) { IMFS_mtime_ctime_update(jnode); } IMFS_FIFO_RETURN(err); 8001a18: 44 20 ff fa be r1,r0,8001a00 <== NEVER TAKEN 8001a1c: c8 0b 58 00 sub r11,r0,r11 8001a20: f8 00 36 d8 calli 800f580 <__errno> 8001a24: 58 2b 00 00 sw (r1+0),r11 8001a28: 34 0b ff ff mvi r11,-1 8001a2c: e3 ff ff f5 bi 8001a00 =============================================================================== 08008994 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { 8008994: 37 9c ff d8 addi sp,sp,-40 8008998: 5b 8b 00 10 sw (sp+16),r11 800899c: 5b 8c 00 0c sw (sp+12),r12 80089a0: 5b 8d 00 08 sw (sp+8),r13 80089a4: 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; 80089a8: 28 24 00 24 lw r4,(r1+36) next = jnode->Parent; loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { result = IMFS_rmnod( NULL, &loc ); 80089ac: 37 8d 00 14 addi r13,sp,20 /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; 80089b0: 28 82 00 08 lw r2,(r4+8) 80089b4: 28 89 00 00 lw r9,(r4+0) 80089b8: 28 88 00 04 lw r8,(r4+4) 80089bc: 28 87 00 0c lw r7,(r4+12) 80089c0: 28 86 00 10 lw r6,(r4+16) 80089c4: 28 85 00 14 lw r5,(r4+20) /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; 80089c8: 28 41 00 4c lw r1,(r2+76) * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; jnode = (IMFS_jnode_t *)loc.node_access; 80089cc: b8 40 58 00 mv r11,r2 /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; 80089d0: 28 23 00 00 lw r3,(r1+0) /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; 80089d4: 5b 89 00 14 sw (sp+20),r9 80089d8: 5b 88 00 18 sw (sp+24),r8 80089dc: 5b 82 00 1c sw (sp+28),r2 80089e0: 5b 87 00 20 sw (sp+32),r7 80089e4: 5b 86 00 24 sw (sp+36),r6 80089e8: 5b 85 00 28 sw (sp+40),r5 /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; 80089ec: 58 80 00 08 sw (r4+8),r0 80089f0: 28 21 00 04 lw r1,(r1+4) do { next = jnode->Parent; 80089f4: 29 6c 00 08 lw r12,(r11+8) loc.node_access = (void *)jnode; 80089f8: 5b 8b 00 1c sw (sp+28),r11 80089fc: 5b 81 00 24 sw (sp+36),r1 IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { 8008a00: 5c 60 00 14 bne r3,r0,8008a50 <== NEVER TAKEN 8008a04: 29 63 00 50 lw r3,(r11+80) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8008a08: 35 61 00 54 addi r1,r11,84 8008a0c: 44 61 00 11 be r3,r1,8008a50 if ( result != 0 ) rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); jnode = next; } if ( jnode != NULL ) { 8008a10: 45 60 00 18 be r11,r0,8008a70 <== NEVER TAKEN if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); } 8008a14: 29 61 00 4c lw r1,(r11+76) return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 8008a18: 28 23 00 00 lw r3,(r1+0) rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); jnode = next; } if ( jnode != NULL ) { if ( IMFS_is_directory( jnode ) ) { 8008a1c: 5c 60 ff f5 bne r3,r0,80089f0 <== NEVER TAKEN if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); } 8008a20: 29 64 00 50 lw r4,(r11+80) 8008a24: 35 65 00 54 addi r5,r11,84 IMFS_node_destroy( jnode ); jnode = next; } if ( jnode != NULL ) { if ( IMFS_is_directory( jnode ) ) { if ( jnode_has_children( jnode ) ) 8008a28: 44 85 ff f2 be r4,r5,80089f0 jnode = jnode_get_first_child( jnode ); 8008a2c: b8 80 58 00 mv r11,r4 } } } while (jnode != NULL); 8008a30: 44 80 00 10 be r4,r0,8008a70 <== NEVER TAKEN 8008a34: 28 81 00 4c lw r1,(r4+76) */ temp_mt_entry->mt_fs_root->location.node_access = NULL; do { next = jnode->Parent; 8008a38: 29 6c 00 08 lw r12,(r11+8) if ( IMFS_is_directory( jnode ) ) { if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); 8008a3c: 28 23 00 00 lw r3,(r1+0) static inline void IMFS_Set_handlers( rtems_filesystem_location_info_t *loc ) { IMFS_jnode_t *node = (IMFS_jnode_t *) loc->node_access; loc->handlers = node->control->handlers; 8008a40: 28 21 00 04 lw r1,(r1+4) temp_mt_entry->mt_fs_root->location.node_access = NULL; do { next = jnode->Parent; loc.node_access = (void *)jnode; 8008a44: 5b 8b 00 1c sw (sp+28),r11 8008a48: 5b 81 00 24 sw (sp+36),r1 IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { 8008a4c: 44 60 ff ee be r3,r0,8008a04 result = IMFS_rmnod( NULL, &loc ); 8008a50: 34 01 00 00 mvi r1,0 8008a54: b9 a0 10 00 mv r2,r13 8008a58: fb ff e1 76 calli 8001030 if ( result != 0 ) 8008a5c: 5c 20 00 0b bne r1,r0,8008a88 <== NEVER TAKEN rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); 8008a60: b9 60 08 00 mv r1,r11 jnode = next; 8008a64: b9 80 58 00 mv r11,r12 if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { result = IMFS_rmnod( NULL, &loc ); if ( result != 0 ) rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); 8008a68: fb ff e0 8c calli 8000c98 jnode = next; } if ( jnode != NULL ) { 8008a6c: 5d 60 ff ea bne r11,r0,8008a14 if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); } 8008a70: 2b 9d 00 04 lw ra,(sp+4) 8008a74: 2b 8b 00 10 lw r11,(sp+16) 8008a78: 2b 8c 00 0c lw r12,(sp+12) 8008a7c: 2b 8d 00 08 lw r13,(sp+8) 8008a80: 37 9c 00 28 addi sp,sp,40 8008a84: c3 a0 00 00 ret IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { result = IMFS_rmnod( NULL, &loc ); if ( result != 0 ) rtems_fatal_error_occurred( 0xdeadbeef ); 8008a88: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 8008a8c: 38 42 d9 e0 ori r2,r2,0xd9e0 <== NOT EXECUTED 8008a90: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 8008a94: fb ff ee 85 calli 80044a8 <== NOT EXECUTED =============================================================================== 08000b2c : int IMFS_initialize_support( rtems_filesystem_mount_table_entry_t *mt_entry, const rtems_filesystem_operations_table *op_table, const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT] ) { 8000b2c: 37 9c ff ec addi sp,sp,-20 8000b30: 5b 8b 00 14 sw (sp+20),r11 8000b34: 5b 8c 00 10 sw (sp+16),r12 8000b38: 5b 8d 00 0c sw (sp+12),r13 8000b3c: 5b 8e 00 08 sw (sp+8),r14 8000b40: 5b 9d 00 04 sw (sp+4),ra 8000b44: b8 20 68 00 mv r13,r1 8000b48: b8 40 70 00 mv r14,r2 static int imfs_instance; int rv = 0; IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); 8000b4c: 34 01 00 01 mvi r1,1 8000b50: 34 02 00 24 mvi r2,36 int IMFS_initialize_support( rtems_filesystem_mount_table_entry_t *mt_entry, const rtems_filesystem_operations_table *op_table, const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT] ) { 8000b54: b8 60 58 00 mv r11,r3 static int imfs_instance; int rv = 0; IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); 8000b58: f8 00 01 e9 calli 80012fc 8000b5c: b8 20 60 00 mv r12,r1 if ( fs_info != NULL ) { 8000b60: 44 20 00 43 be r1,r0,8000c6c <== NEVER TAKEN IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 8000b64: 78 04 08 02 mvhi r4,0x802 8000b68: 38 84 07 94 ori r4,r4,0x794 8000b6c: 28 87 00 00 lw r7,(r4+0) memcpy( fs_info->node_controls, 8000b70: 34 23 00 08 addi r3,r1,8 IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); if ( fs_info != NULL ) { IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 8000b74: 34 e2 00 01 addi r2,r7,1 8000b78: 58 82 00 00 sw (r4+0),r2 memcpy( 8000b7c: 29 6a 00 00 lw r10,(r11+0) 8000b80: 29 66 00 0c lw r6,(r11+12) 8000b84: 29 65 00 10 lw r5,(r11+16) 8000b88: 29 64 00 14 lw r4,(r11+20) 8000b8c: 29 62 00 18 lw r2,(r11+24) 8000b90: 29 69 00 04 lw r9,(r11+4) 8000b94: 29 68 00 08 lw r8,(r11+8) 8000b98: 58 2a 00 08 sw (r1+8),r10 8000b9c: 58 66 00 0c sw (r3+12),r6 8000ba0: 58 65 00 10 sw (r3+16),r5 8000ba4: 58 64 00 14 sw (r3+20),r4 8000ba8: 58 69 00 04 sw (r3+4),r9 8000bac: 58 68 00 08 sw (r3+8),r8 8000bb0: 58 62 00 18 sw (r3+24),r2 fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( 8000bb4: 28 22 00 08 lw r2,(r1+8) 8000bb8: 78 03 08 01 mvhi r3,0x801 8000bbc: 34 04 00 00 mvi r4,0 8000bc0: 38 63 d3 8c ori r3,r3,0xd38c 8000bc4: 34 05 41 ed mvi r5,16877 8000bc8: 34 06 00 00 mvi r6,0 IMFS_fs_info_t *fs_info = calloc( 1, sizeof( *fs_info ) ); if ( fs_info != NULL ) { IMFS_jnode_t *root_node; fs_info->instance = imfs_instance++; 8000bcc: 58 27 00 00 sw (r1+0),r7 fs_info->node_controls, node_controls, sizeof( fs_info->node_controls ) ); root_node = IMFS_allocate_node( 8000bd0: f8 00 1e 71 calli 8008594 8000bd4: b8 20 20 00 mv r4,r1 "", 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { 8000bd8: 44 20 00 25 be r1,r0,8000c6c <== NEVER TAKEN static inline void IMFS_Set_handlers( rtems_filesystem_location_info_t *loc ) { IMFS_jnode_t *node = (IMFS_jnode_t *) loc->node_access; loc->handlers = node->control->handlers; 8000bdc: 28 22 00 4c lw r2,(r1+76) errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 8000be0: 78 03 08 02 mvhi r3,0x802 ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; mt_entry->mt_fs_root->location.node_access = root_node; 8000be4: 29 a5 00 24 lw r5,(r13+36) 8000be8: 28 42 00 04 lw r2,(r2+4) NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; 8000bec: 78 01 08 01 mvhi r1,0x801 errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 8000bf0: 38 63 00 14 ori r3,r3,0x14 NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; 8000bf4: 38 21 dc 3c ori r1,r1,0xdc3c errno = ENOMEM; rv = -1; } if ( rv == 0 ) { IMFS_determine_bytes_per_block( 8000bf8: 28 63 00 00 lw r3,(r3+0) NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; mt_entry->ops = op_table; mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; 8000bfc: 59 a1 00 2c sw (r13+44),r1 0, (S_IFDIR | 0755), NULL ); if ( root_node != NULL ) { mt_entry->fs_info = fs_info; 8000c00: 59 ac 00 08 sw (r13+8),r12 mt_entry->ops = op_table; 8000c04: 59 ae 00 0c sw (r13+12),r14 mt_entry->pathconf_limits_and_options = &IMFS_LIMITS_AND_OPTIONS; mt_entry->mt_fs_root->location.node_access = root_node; 8000c08: 58 a4 00 08 sw (r5+8),r4 8000c0c: 58 a2 00 10 sw (r5+16),r2 /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { if (bit_mask == requested_bytes_per_block) { 8000c10: 34 01 00 10 mvi r1,16 8000c14: 44 61 00 0b be r3,r1,8000c40 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) 8000c18: 34 01 00 0f mvi r1,15 8000c1c: 4c 23 00 08 bge r1,r3,8000c3c 8000c20: 34 02 00 05 mvi r2,5 8000c24: 34 01 00 20 mvi r1,32 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 8000c28: 34 42 ff ff addi r2,r2,-1 if (bit_mask == requested_bytes_per_block) { 8000c2c: 44 61 00 05 be r3,r1,8000c40 is_valid = true; break; } if(bit_mask > requested_bytes_per_block) 8000c30: 48 23 00 03 bg r1,r3,8000c3c <== NEVER TAKEN int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { 8000c34: b4 21 08 00 add r1,r1,r1 8000c38: 5c 40 ff fc bne r2,r0,8000c28 <== ALWAYS TAKEN if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); 8000c3c: 34 03 00 80 mvi r3,128 break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) 8000c40: 78 01 08 02 mvhi r1,0x802 8000c44: 38 21 07 90 ori r1,r1,0x790 8000c48: 58 23 00 00 sw (r1+0),r3 const IMFS_node_control *const node_controls [IMFS_TYPE_COUNT] ) { static int imfs_instance; int rv = 0; 8000c4c: 34 01 00 00 mvi r1,0 IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK ); } return rv; } 8000c50: 2b 9d 00 04 lw ra,(sp+4) 8000c54: 2b 8b 00 14 lw r11,(sp+20) 8000c58: 2b 8c 00 10 lw r12,(sp+16) 8000c5c: 2b 8d 00 0c lw r13,(sp+12) 8000c60: 2b 8e 00 08 lw r14,(sp+8) 8000c64: 37 9c 00 14 addi sp,sp,20 8000c68: c3 a0 00 00 ret } else { errno = ENOMEM; rv = -1; } } else { errno = ENOMEM; 8000c6c: f8 00 31 82 calli 800d274 <__errno> 8000c70: 34 02 00 0c mvi r2,12 8000c74: 58 22 00 00 sw (r1+0),r2 8000c78: 34 01 ff ff mvi r1,-1 8000c7c: e3 ff ff f5 bi 8000c50 =============================================================================== 08002c00 : const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 8002c00: 37 9c ff 98 addi sp,sp,-104 8002c04: 5b 8b 00 18 sw (sp+24),r11 8002c08: 5b 8c 00 14 sw (sp+20),r12 8002c0c: 5b 8d 00 10 sw (sp+16),r13 8002c10: 5b 8e 00 0c sw (sp+12),r14 8002c14: 5b 8f 00 08 sw (sp+8),r15 8002c18: 5b 9d 00 04 sw (sp+4),ra int rv = 0; mode &= ~rtems_filesystem_umask; 8002c1c: 78 05 08 01 mvhi r5,0x801 8002c20: 38 a5 b1 7c ori r5,r5,0xb17c 8002c24: 28 a5 00 00 lw r5,(r5+0) switch (mode & S_IFMT) { 8002c28: 34 07 20 00 mvi r7,8192 const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 8002c2c: b8 20 40 00 mv r8,r1 int rv = 0; mode &= ~rtems_filesystem_umask; 8002c30: 28 ad 00 08 lw r13,(r5+8) const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 8002c34: b8 60 58 00 mv r11,r3 8002c38: b8 80 70 00 mv r14,r4 int rv = 0; mode &= ~rtems_filesystem_umask; 8002c3c: a5 a0 68 00 not r13,r13 8002c40: a0 4d 68 00 and r13,r2,r13 switch (mode & S_IFMT) { 8002c44: 21 a6 f0 00 andi r6,r13,0xf000 8002c48: 44 c7 00 15 be r6,r7,8002c9c 8002c4c: 54 c7 00 10 bgu r6,r7,8002c8c <== ALWAYS TAKEN 8002c50: 34 01 10 00 mvi r1,4096 <== NOT EXECUTED 8002c54: 44 c1 00 12 be r6,r1,8002c9c <== NOT EXECUTED rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); } else { errno = EINVAL; 8002c58: f8 00 40 7c calli 8012e48 <__errno> 8002c5c: 34 02 00 16 mvi r2,22 8002c60: 58 22 00 00 sw (r1+0),r2 rv = -1; 8002c64: 34 0b ff ff mvi r11,-1 } } return rv; } 8002c68: b9 60 08 00 mv r1,r11 8002c6c: 2b 9d 00 04 lw ra,(sp+4) 8002c70: 2b 8b 00 18 lw r11,(sp+24) 8002c74: 2b 8c 00 14 lw r12,(sp+20) 8002c78: 2b 8d 00 10 lw r13,(sp+16) 8002c7c: 2b 8e 00 0c lw r14,(sp+12) 8002c80: 2b 8f 00 08 lw r15,(sp+8) 8002c84: 37 9c 00 68 addi sp,sp,104 8002c88: c3 a0 00 00 ret { int rv = 0; mode &= ~rtems_filesystem_umask; switch (mode & S_IFMT) { 8002c8c: 34 01 60 00 mvi r1,24576 8002c90: 44 c1 00 03 be r6,r1,8002c9c 8002c94: 34 21 20 00 addi r1,r1,8192 8002c98: 5c c1 ff f0 bne r6,r1,8002c58 <== ALWAYS TAKEN rv = -1; break; } if ( rv == 0 ) { if ( node_control->imfs_type == IMFS_GENERIC ) { 8002c9c: 29 62 00 00 lw r2,(r11+0) 8002ca0: 34 01 00 07 mvi r1,7 8002ca4: 5c 41 ff ed bne r2,r1,8002c58 rtems_filesystem_eval_path_context_t ctx; int eval_flags = RTEMS_FS_FOLLOW_LINK | RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE; const rtems_filesystem_location_info_t *currentloc = rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); 8002ca8: 37 8c 00 1c addi r12,sp,28 if ( node_control->imfs_type == IMFS_GENERIC ) { rtems_filesystem_eval_path_context_t ctx; int eval_flags = RTEMS_FS_FOLLOW_LINK | RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE; const rtems_filesystem_location_info_t *currentloc = 8002cac: b9 80 08 00 mv r1,r12 8002cb0: b9 00 10 00 mv r2,r8 8002cb4: 34 03 00 78 mvi r3,120 8002cb8: f8 00 08 bd calli 8004fac 8002cbc: b8 20 78 00 mv r15,r1 rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); if ( IMFS_is_imfs_instance( currentloc ) ) { 8002cc0: fb ff ff bb calli 8002bac 8002cc4: 44 20 00 1b be r1,r0,8002d30 IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; new_node = IMFS_create_node_with_control( 8002cc8: 2b 83 00 24 lw r3,(sp+36) 8002ccc: 2b 84 00 28 lw r4,(sp+40) 8002cd0: b9 60 10 00 mv r2,r11 8002cd4: b9 e0 08 00 mv r1,r15 8002cd8: b9 a0 28 00 mv r5,r13 8002cdc: 37 86 00 54 addi r6,sp,84 if ( IMFS_is_imfs_instance( currentloc ) ) { IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; 8002ce0: 5b 8e 00 54 sw (sp+84),r14 new_node = IMFS_create_node_with_control( 8002ce4: f8 00 2a f4 calli 800d8b4 IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); } else { rv = -1; 8002ce8: 34 0b ff ff mvi r11,-1 rtems_filesystem_eval_path_get_tokenlen( &ctx ), mode, &info ); if ( new_node != NULL ) { 8002cec: 44 20 00 0e be r1,r0,8002d24 IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); 8002cf0: 37 8b 00 64 addi r11,sp,100 8002cf4: 34 02 00 00 mvi r2,0 8002cf8: b9 60 08 00 mv r1,r11 mode, &info ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; 8002cfc: 29 ed 00 08 lw r13,(r15+8) IMFS_update_ctime( parent ); 8002d00: f8 00 02 3c calli 80035f0 8002d04: 2b 83 00 64 lw r3,(sp+100) IMFS_update_mtime( parent ); 8002d08: b9 60 08 00 mv r1,r11 8002d0c: 34 02 00 00 mvi r2,0 ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); 8002d10: 59 a3 00 48 sw (r13+72),r3 IMFS_update_mtime( parent ); 8002d14: f8 00 02 37 calli 80035f0 8002d18: 2b 81 00 64 lw r1,(sp+100) 8002d1c: 34 0b 00 00 mvi r11,0 8002d20: 59 a1 00 44 sw (r13+68),r1 } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 8002d24: b9 80 08 00 mv r1,r12 8002d28: f8 00 08 f8 calli 8005108 8002d2c: e3 ff ff cf bi 8002c68 IMFS_update_mtime( parent ); } else { rv = -1; } } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); 8002d30: b9 80 08 00 mv r1,r12 8002d34: 34 02 00 86 mvi r2,134 8002d38: f8 00 07 b4 calli 8004c08 rv = -1; 8002d3c: 34 0b ff ff mvi r11,-1 8002d40: e3 ff ff f9 bi 8002d24 =============================================================================== 0800bc7c : MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 800bc7c: 37 9c ff d0 addi sp,sp,-48 800bc80: 5b 8b 00 28 sw (sp+40),r11 800bc84: 5b 8c 00 24 sw (sp+36),r12 800bc88: 5b 8d 00 20 sw (sp+32),r13 800bc8c: 5b 8e 00 1c sw (sp+28),r14 800bc90: 5b 8f 00 18 sw (sp+24),r15 800bc94: 5b 90 00 14 sw (sp+20),r16 800bc98: 5b 91 00 10 sw (sp+16),r17 800bc9c: 5b 92 00 0c sw (sp+12),r18 800bca0: 5b 93 00 08 sw (sp+8),r19 800bca4: 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 ) 800bca8: 78 0d 08 02 mvhi r13,0x802 800bcac: 39 ad 07 90 ori r13,r13,0x790 800bcb0: 29 b2 00 00 lw r18,(r13+0) MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 800bcb4: b8 20 60 00 mv r12,r1 800bcb8: 20 51 00 ff andi r17,r2,0xff IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 800bcbc: 02 4b 00 01 srui r11,r18,1 MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, bool zero_fill, off_t new_length ) { 800bcc0: b8 60 98 00 mv r19,r3 IMFS_assert( IMFS_type( the_jnode ) == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) 800bcc4: 01 6b 00 01 srui r11,r11,1 800bcc8: b9 60 10 00 mv r2,r11 800bccc: 35 61 00 01 addi r1,r11,1 800bcd0: f8 00 40 69 calli 801be74 <__mulsi3> 800bcd4: b9 60 10 00 mv r2,r11 800bcd8: 34 21 00 01 addi r1,r1,1 800bcdc: f8 00 40 66 calli 801be74 <__mulsi3> 800bce0: 34 21 ff ff addi r1,r1,-1 800bce4: ba 40 10 00 mv r2,r18 800bce8: f8 00 40 63 calli 801be74 <__mulsi3> 800bcec: 54 33 00 11 bgu r1,r19,800bd30 rtems_set_errno_and_return_minus_one( EFBIG ); 800bcf0: f8 00 05 61 calli 800d274 <__errno> 800bcf4: 34 02 00 1b mvi r2,27 800bcf8: 58 22 00 00 sw (r1+0),r2 800bcfc: 34 01 ff ff mvi r1,-1 the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); IMFS_update_mtime(the_jnode); return 0; } 800bd00: 2b 9d 00 04 lw ra,(sp+4) 800bd04: 2b 8b 00 28 lw r11,(sp+40) 800bd08: 2b 8c 00 24 lw r12,(sp+36) 800bd0c: 2b 8d 00 20 lw r13,(sp+32) 800bd10: 2b 8e 00 1c lw r14,(sp+28) 800bd14: 2b 8f 00 18 lw r15,(sp+24) 800bd18: 2b 90 00 14 lw r16,(sp+20) 800bd1c: 2b 91 00 10 lw r17,(sp+16) 800bd20: 2b 92 00 0c lw r18,(sp+12) 800bd24: 2b 93 00 08 lw r19,(sp+8) 800bd28: 37 9c 00 30 addi sp,sp,48 800bd2c: c3 a0 00 00 ret rtems_set_errno_and_return_minus_one( EFBIG ); /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) 800bd30: 29 8e 00 50 lw r14,(r12+80) return 0; 800bd34: 34 01 00 00 mvi r1,0 rtems_set_errno_and_return_minus_one( EFBIG ); /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) 800bd38: 4d d3 ff f2 bge r14,r19,800bd00 <== NEVER TAKEN return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; 800bd3c: ba 40 10 00 mv r2,r18 800bd40: ba 60 08 00 mv r1,r19 800bd44: f8 00 40 58 calli 801bea4 <__divsi3> 800bd48: b8 20 80 00 mv r16,r1 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; 800bd4c: ba 40 10 00 mv r2,r18 800bd50: b9 c0 08 00 mv r1,r14 800bd54: f8 00 40 54 calli 801bea4 <__divsi3> 800bd58: b8 20 78 00 mv r15,r1 offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK; /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { 800bd5c: 54 30 00 0c bgu r1,r16,800bd8c <== NEVER TAKEN /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; offset = the_jnode->info.file.size - old_blocks * IMFS_MEMFILE_BYTES_PER_BLOCK; 800bd60: ba 40 10 00 mv r2,r18 800bd64: f8 00 40 44 calli 801be74 <__mulsi3> 800bd68: c9 c1 70 00 sub r14,r14,r1 800bd6c: b9 e0 58 00 mv r11,r15 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { if ( !IMFS_memfile_addblock( the_jnode, block ) ) { 800bd70: b9 60 10 00 mv r2,r11 800bd74: b9 80 08 00 mv r1,r12 800bd78: fb ff ff 0b calli 800b9a4 800bd7c: 5c 20 00 16 bne r1,r0,800bdd4 if ( zero_fill ) { 800bd80: 5e 21 00 1b bne r17,r1,800bdec 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++ ) { 800bd84: 35 6b 00 01 addi r11,r11,1 800bd88: 52 0b ff fa bgeu r16,r11,800bd70 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); 800bd8c: 37 8b 00 2c addi r11,sp,44 800bd90: 34 02 00 00 mvi r2,0 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; 800bd94: 59 93 00 50 sw (r12+80),r19 IMFS_update_ctime(the_jnode); 800bd98: b9 60 08 00 mv r1,r11 800bd9c: fb ff d6 51 calli 80016e0 800bda0: 2b 83 00 2c lw r3,(sp+44) IMFS_update_mtime(the_jnode); 800bda4: 34 02 00 00 mvi r2,0 800bda8: b9 60 08 00 mv r1,r11 /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); 800bdac: 59 83 00 48 sw (r12+72),r3 IMFS_update_mtime(the_jnode); 800bdb0: fb ff d6 4c calli 80016e0 800bdb4: 2b 82 00 2c lw r2,(sp+44) return 0; 800bdb8: 34 01 00 00 mvi r1,0 * Set the new length of the file. */ the_jnode->info.file.size = new_length; IMFS_update_ctime(the_jnode); IMFS_update_mtime(the_jnode); 800bdbc: 59 82 00 44 sw (r12+68),r2 return 0; 800bdc0: e3 ff ff d0 bi 800bd00 memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); 800bdc4: b9 60 10 00 mv r2,r11 800bdc8: b9 80 08 00 mv r1,r12 memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 800bdcc: 35 6b ff ff addi r11,r11,-1 IMFS_memfile_remove_block( the_jnode, block ); 800bdd0: fb ff ff 9f calli 800bc4c memset( &(*block_ptr) [offset], 0, count); offset = 0; } } else { for ( ; block>=old_blocks ; block-- ) { 800bdd4: 51 6f ff fc bgeu r11,r15,800bdc4 IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); 800bdd8: f8 00 05 27 calli 800d274 <__errno> 800bddc: 34 02 00 1c mvi r2,28 800bde0: 58 22 00 00 sw (r1+0),r2 800bde4: 34 01 ff ff mvi r1,-1 800bde8: e3 ff ff c6 bi 800bd00 */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { if ( !IMFS_memfile_addblock( the_jnode, block ) ) { if ( zero_fill ) { size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; block_p *block_ptr = 800bdec: b9 60 10 00 mv r2,r11 800bdf0: 34 03 00 00 mvi r3,0 800bdf4: 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; 800bdf8: 29 b2 00 00 lw r18,(r13+0) block_p *block_ptr = 800bdfc: fb ff fd bc calli 800b4ec IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 800be00: 28 21 00 00 lw r1,(r1+0) * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { if ( !IMFS_memfile_addblock( the_jnode, block ) ) { if ( zero_fill ) { size_t count = IMFS_MEMFILE_BYTES_PER_BLOCK - offset; 800be04: ca 4e 90 00 sub r18,r18,r14 block_p *block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); memset( &(*block_ptr) [offset], 0, count); 800be08: 34 02 00 00 mvi r2,0 800be0c: b4 2e 08 00 add r1,r1,r14 800be10: ba 40 18 00 mv r3,r18 800be14: f8 00 08 53 calli 800df60 offset = 0; 800be18: 34 0e 00 00 mvi r14,0 800be1c: e3 ff ff da bi 800bd84 =============================================================================== 0800b4ec : #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 800b4ec: 37 9c ff dc addi sp,sp,-36 800b4f0: 5b 8b 00 20 sw (sp+32),r11 800b4f4: 5b 8c 00 1c sw (sp+28),r12 800b4f8: 5b 8d 00 18 sw (sp+24),r13 800b4fc: 5b 8e 00 14 sw (sp+20),r14 800b500: 5b 8f 00 10 sw (sp+16),r15 800b504: 5b 90 00 0c sw (sp+12),r16 800b508: 5b 91 00 08 sw (sp+8),r17 800b50c: 5b 9d 00 04 sw (sp+4),ra my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 800b510: 78 04 08 02 mvhi r4,0x802 800b514: 38 84 07 90 ori r4,r4,0x790 800b518: 28 8b 00 00 lw r11,(r4+0) #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 800b51c: b8 20 70 00 mv r14,r1 800b520: b8 40 60 00 mv r12,r2 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 800b524: 01 6b 00 01 srui r11,r11,1 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { 800b528: b8 60 78 00 mv r15,r3 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { 800b52c: 01 6b 00 01 srui r11,r11,1 800b530: 35 61 ff ff addi r1,r11,-1 800b534: 54 41 00 08 bgu r2,r1,800b554 p = info->indirect; 800b538: 29 c2 00 54 lw r2,(r14+84) if ( malloc_it ) { 800b53c: 44 60 00 2b be r3,r0,800b5e8 if ( !p ) { 800b540: 44 40 00 5f be r2,r0,800b6bc } if ( !p ) return 0; return &info->indirect[ my_block ]; 800b544: b5 8c 60 00 add r12,r12,r12 800b548: b5 8c 60 00 add r12,r12,r12 800b54c: b4 4c 68 00 add r13,r2,r12 800b550: e0 00 00 1b bi 800b5bc /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { 800b554: 35 61 00 01 addi r1,r11,1 800b558: b9 60 10 00 mv r2,r11 800b55c: f8 00 42 46 calli 801be74 <__mulsi3> 800b560: b8 20 80 00 mv r16,r1 800b564: 34 21 ff ff addi r1,r1,-1 800b568: 55 81 00 23 bgu r12,r1,800b5f4 my_block -= FIRST_DOUBLY_INDIRECT; 800b56c: c9 8b 60 00 sub r12,r12,r11 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 800b570: b9 60 10 00 mv r2,r11 800b574: b9 80 08 00 mv r1,r12 800b578: f8 00 42 b4 calli 801c048 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800b57c: b9 60 10 00 mv r2,r11 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 800b580: b8 20 80 00 mv r16,r1 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800b584: b9 80 08 00 mv r1,r12 800b588: f8 00 42 a0 calli 801c008 <__udivsi3> 800b58c: b8 20 10 00 mv r2,r1 p = info->doubly_indirect; 800b590: 29 c3 00 58 lw r3,(r14+88) if ( malloc_it ) { 800b594: 45 e0 00 3f be r15,r0,800b690 if ( !p ) { 800b598: 44 60 00 4f be r3,r0,800b6d4 if ( !p ) return 0; info->doubly_indirect = p; } p1 = (block_p *)p[ doubly ]; 800b59c: b4 42 10 00 add r2,r2,r2 800b5a0: b4 42 10 00 add r2,r2,r2 800b5a4: b4 62 10 00 add r2,r3,r2 800b5a8: 28 41 00 00 lw r1,(r2+0) if ( !p1 ) { 800b5ac: 44 20 00 52 be r1,r0,800b6f4 if ( !p1 ) return 0; p[ doubly ] = (block_p) p1; } return (block_p *)&p1[ singly ]; 800b5b0: b6 10 68 00 add r13,r16,r16 800b5b4: b5 ad 68 00 add r13,r13,r13 800b5b8: b4 2d 68 00 add r13,r1,r13 /* * This means the requested block number is out of range. */ return 0; } 800b5bc: b9 a0 08 00 mv r1,r13 800b5c0: 2b 9d 00 04 lw ra,(sp+4) 800b5c4: 2b 8b 00 20 lw r11,(sp+32) 800b5c8: 2b 8c 00 1c lw r12,(sp+28) 800b5cc: 2b 8d 00 18 lw r13,(sp+24) 800b5d0: 2b 8e 00 14 lw r14,(sp+20) 800b5d4: 2b 8f 00 10 lw r15,(sp+16) 800b5d8: 2b 90 00 0c lw r16,(sp+12) 800b5dc: 2b 91 00 08 lw r17,(sp+8) 800b5e0: 37 9c 00 24 addi sp,sp,36 800b5e4: c3 a0 00 00 ret } return &info->indirect[ my_block ]; } if ( !p ) return 0; 800b5e8: 34 0d 00 00 mvi r13,0 info->indirect = p; } return &info->indirect[ my_block ]; } if ( !p ) 800b5ec: 5c 4d ff d6 bne r2,r13,800b544 <== ALWAYS TAKEN 800b5f0: e3 ff ff f3 bi 800b5bc <== NOT EXECUTED } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 800b5f4: 36 01 00 01 addi r1,r16,1 800b5f8: b9 60 10 00 mv r2,r11 800b5fc: f8 00 42 1e calli 801be74 <__mulsi3> 800b600: 34 21 ff ff addi r1,r1,-1 } /* * This means the requested block number is out of range. */ return 0; 800b604: 34 0d 00 00 mvi r13,0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { 800b608: 55 81 ff ed bgu r12,r1,800b5bc <== NEVER TAKEN my_block -= FIRST_TRIPLY_INDIRECT; 800b60c: c9 90 80 00 sub r16,r12,r16 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 800b610: b9 60 10 00 mv r2,r11 800b614: ba 00 08 00 mv r1,r16 800b618: f8 00 42 8c calli 801c048 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800b61c: b9 60 10 00 mv r2,r11 * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; 800b620: b8 20 60 00 mv r12,r1 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800b624: ba 00 08 00 mv r1,r16 800b628: f8 00 42 78 calli 801c008 <__udivsi3> triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 800b62c: b9 60 10 00 mv r2,r11 */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; 800b630: b8 20 88 00 mv r17,r1 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 800b634: f8 00 42 75 calli 801c008 <__udivsi3> doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 800b638: b9 60 10 00 mv r2,r11 if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; 800b63c: b8 20 80 00 mv r16,r1 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; 800b640: ba 20 08 00 mv r1,r17 800b644: f8 00 42 81 calli 801c048 <__umodsi3> 800b648: b8 20 58 00 mv r11,r1 p = info->triply_indirect; 800b64c: 29 c4 00 5c lw r4,(r14+92) if ( malloc_it ) { 800b650: 45 e0 00 30 be r15,r0,800b710 if ( !p ) { 800b654: 44 80 00 3e be r4,r0,800b74c if ( !p ) return 0; info->triply_indirect = p; } p1 = (block_p *) p[ triply ]; 800b658: b6 10 18 00 add r3,r16,r16 800b65c: b4 63 18 00 add r3,r3,r3 800b660: b4 83 70 00 add r14,r4,r3 800b664: 29 c1 00 00 lw r1,(r14+0) if ( !p1 ) { 800b668: 44 20 00 43 be r1,r0,800b774 if ( !p1 ) return 0; p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; 800b66c: b5 6b 10 00 add r2,r11,r11 800b670: b4 42 10 00 add r2,r2,r2 800b674: b4 22 58 00 add r11,r1,r2 800b678: 29 61 00 00 lw r1,(r11+0) if ( !p2 ) { 800b67c: 44 20 00 39 be r1,r0,800b760 p2 = memfile_alloc_block(); if ( !p2 ) return 0; p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; 800b680: b5 8c 68 00 add r13,r12,r12 800b684: b5 ad 68 00 add r13,r13,r13 800b688: b4 2d 68 00 add r13,r1,r13 800b68c: e3 ff ff cc bi 800b5bc return (block_p *)&p1[ singly ]; } if ( !p ) return 0; 800b690: 34 0d 00 00 mvi r13,0 } return (block_p *)&p1[ singly ]; } if ( !p ) 800b694: 44 6d ff ca be r3,r13,800b5bc <== NEVER TAKEN return 0; p = (block_p *)p[ doubly ]; 800b698: b4 21 10 00 add r2,r1,r1 800b69c: b4 42 10 00 add r2,r2,r2 800b6a0: b4 62 10 00 add r2,r3,r2 800b6a4: 28 41 00 00 lw r1,(r2+0) if ( !p ) 800b6a8: 44 20 ff c5 be r1,r0,800b5bc <== NEVER TAKEN return 0; return (block_p *)&p[ singly ]; 800b6ac: b6 10 80 00 add r16,r16,r16 800b6b0: b6 10 80 00 add r16,r16,r16 800b6b4: b4 30 68 00 add r13,r1,r16 800b6b8: e3 ff ff c1 bi 800b5bc p = info->indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); 800b6bc: fb ff ff 7c calli 800b4ac 800b6c0: b8 20 10 00 mv r2,r1 if ( !p ) return 0; 800b6c4: 34 0d 00 00 mvi r13,0 if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) 800b6c8: 44 20 ff bd be r1,r0,800b5bc <== NEVER TAKEN return 0; info->indirect = p; 800b6cc: 59 c1 00 54 sw (r14+84),r1 800b6d0: e3 ff ff 9d bi 800b544 p = info->doubly_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); 800b6d4: 5b 81 00 24 sw (sp+36),r1 800b6d8: fb ff ff 75 calli 800b4ac 800b6dc: b8 20 18 00 mv r3,r1 if ( !p ) return 0; 800b6e0: 34 0d 00 00 mvi r13,0 p = info->doubly_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) 800b6e4: 2b 82 00 24 lw r2,(sp+36) 800b6e8: 44 20 ff b5 be r1,r0,800b5bc <== NEVER TAKEN return 0; info->doubly_indirect = p; 800b6ec: 59 c1 00 58 sw (r14+88),r1 800b6f0: e3 ff ff ab bi 800b59c } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); 800b6f4: 5b 82 00 24 sw (sp+36),r2 800b6f8: fb ff ff 6d calli 800b4ac if ( !p1 ) return 0; 800b6fc: 34 0d 00 00 mvi r13,0 } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) 800b700: 2b 82 00 24 lw r2,(sp+36) 800b704: 44 20 ff ae be r1,r0,800b5bc <== NEVER TAKEN return 0; p[ doubly ] = (block_p) p1; 800b708: 58 41 00 00 sw (r2+0),r1 800b70c: e3 ff ff a9 bi 800b5b0 p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; } if ( !p ) 800b710: 44 8d ff ab be r4,r13,800b5bc <== NEVER TAKEN return 0; p1 = (block_p *) p[ triply ]; 800b714: b6 10 80 00 add r16,r16,r16 800b718: b6 10 80 00 add r16,r16,r16 800b71c: b4 90 20 00 add r4,r4,r16 800b720: 28 81 00 00 lw r1,(r4+0) if ( !p1 ) 800b724: 44 20 ff a6 be r1,r0,800b5bc <== NEVER TAKEN return 0; p2 = (block_p *)p1[ doubly ]; 800b728: b5 6b 58 00 add r11,r11,r11 800b72c: b5 6b 58 00 add r11,r11,r11 800b730: b4 2b 08 00 add r1,r1,r11 800b734: 28 21 00 00 lw r1,(r1+0) if ( !p2 ) 800b738: 44 20 ff a1 be r1,r0,800b5bc <== NEVER TAKEN return 0; return (block_p *)&p2[ singly ]; 800b73c: b5 8c 60 00 add r12,r12,r12 800b740: b5 8c 60 00 add r12,r12,r12 800b744: b4 2c 68 00 add r13,r1,r12 800b748: e3 ff ff 9d bi 800b5bc p = info->triply_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); 800b74c: fb ff ff 58 calli 800b4ac 800b750: b8 20 20 00 mv r4,r1 if ( !p ) 800b754: 44 20 ff 9a be r1,r0,800b5bc <== NEVER TAKEN return 0; info->triply_indirect = p; 800b758: 59 c1 00 5c sw (r14+92),r1 800b75c: e3 ff ff bf bi 800b658 p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); 800b760: fb ff ff 53 calli 800b4ac if ( !p2 ) return 0; 800b764: 34 0d 00 00 mvi r13,0 } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); if ( !p2 ) 800b768: 44 20 ff 95 be r1,r0,800b5bc <== NEVER TAKEN return 0; p1[ doubly ] = (block_p) p2; 800b76c: 59 61 00 00 sw (r11+0),r1 800b770: e3 ff ff c4 bi 800b680 info->triply_indirect = p; } p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); 800b774: fb ff ff 4e calli 800b4ac if ( !p1 ) return 0; 800b778: 34 0d 00 00 mvi r13,0 } p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) 800b77c: 44 20 ff 90 be r1,r0,800b5bc <== NEVER TAKEN return 0; p[ triply ] = (block_p) p1; 800b780: 59 c1 00 00 sw (r14+0),r1 800b784: e3 ff ff ba bi 800b66c =============================================================================== 0800b788 : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { 800b788: 37 9c ff d0 addi sp,sp,-48 800b78c: 5b 8b 00 28 sw (sp+40),r11 800b790: 5b 8c 00 24 sw (sp+36),r12 800b794: 5b 8d 00 20 sw (sp+32),r13 800b798: 5b 8e 00 1c sw (sp+28),r14 800b79c: 5b 8f 00 18 sw (sp+24),r15 800b7a0: 5b 90 00 14 sw (sp+20),r16 800b7a4: 5b 91 00 10 sw (sp+16),r17 800b7a8: 5b 92 00 0c sw (sp+12),r18 800b7ac: 5b 93 00 08 sw (sp+8),r19 800b7b0: 5b 9d 00 04 sw (sp+4),ra 800b7b4: b8 20 80 00 mv r16,r1 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 800b7b8: 28 21 00 4c lw r1,(r1+76) 800b7bc: b8 40 68 00 mv r13,r2 800b7c0: b8 60 90 00 mv r18,r3 * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) { 800b7c4: 28 22 00 00 lw r2,(r1+0) 800b7c8: 34 01 00 05 mvi r1,5 800b7cc: 44 41 00 55 be r2,r1,800b920 /* * 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 ) 800b7d0: 2a 01 00 50 lw r1,(r16+80) /* * If the last byte we are supposed to read is past the end of this * in memory file, then shorten the length to read. */ last_byte = start + length; 800b7d4: b4 8d 10 00 add r2,r4,r13 if ( last_byte > the_jnode->info.file.size ) 800b7d8: b8 80 60 00 mv r12,r4 800b7dc: 50 22 00 02 bgeu r1,r2,800b7e4 my_length = the_jnode->info.file.size - start; 800b7e0: c8 2d 60 00 sub r12,r1,r13 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800b7e4: 78 11 08 02 mvhi r17,0x802 800b7e8: 3a 31 07 90 ori r17,r17,0x790 800b7ec: 2a 2b 00 00 lw r11,(r17+0) 800b7f0: b9 a0 08 00 mv r1,r13 unsigned int last_byte; unsigned int copied; unsigned int start_offset; unsigned char *dest; dest = destination; 800b7f4: ba 40 70 00 mv r14,r18 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800b7f8: b9 60 10 00 mv r2,r11 800b7fc: f8 00 41 da calli 801bf64 <__modsi3> 800b800: b8 20 98 00 mv r19,r1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 800b804: b9 60 10 00 mv r2,r11 800b808: b9 a0 08 00 mv r1,r13 800b80c: f8 00 41 a6 calli 801bea4 <__divsi3> 800b810: b8 20 68 00 mv r13,r1 */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) my_length = the_jnode->info.file.size - start; copied = 0; 800b814: 34 0f 00 00 mvi r15,0 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { 800b818: 5e 60 00 2f bne r19,r0,800b8d4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800b81c: 55 6c 00 11 bgu r11,r12,800b860 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800b820: b9 a0 10 00 mv r2,r13 800b824: 34 03 00 00 mvi r3,0 800b828: ba 00 08 00 mv r1,r16 800b82c: fb ff ff 30 calli 800b4ec 800b830: b8 20 10 00 mv r2,r1 if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 800b834: b9 60 18 00 mv r3,r11 800b838: b9 c0 08 00 mv r1,r14 dest += to_copy; block++; my_length -= to_copy; 800b83c: c9 8b 60 00 sub r12,r12,r11 * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) 800b840: 44 40 00 18 be r2,r0,800b8a0 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 800b844: 28 42 00 00 lw r2,(r2+0) dest += to_copy; 800b848: b5 cb 70 00 add r14,r14,r11 block++; 800b84c: 35 ad 00 01 addi r13,r13,1 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); 800b850: f8 00 09 83 calli 800de5c /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800b854: 2a 21 00 00 lw r1,(r17+0) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); dest += to_copy; block++; my_length -= to_copy; copied += to_copy; 800b858: b5 eb 78 00 add r15,r15,r11 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800b85c: 51 81 ff f1 bgeu r12,r1,800b820 /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { 800b860: 45 80 00 0b be r12,r0,800b88c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800b864: ba 00 08 00 mv r1,r16 800b868: b9 a0 10 00 mv r2,r13 800b86c: 34 03 00 00 mvi r3,0 800b870: fb ff ff 1f calli 800b4ec if ( !block_ptr ) 800b874: 44 20 00 0b be r1,r0,800b8a0 <== NEVER TAKEN return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); 800b878: 28 22 00 00 lw r2,(r1+0) 800b87c: b9 80 18 00 mv r3,r12 800b880: b9 c0 08 00 mv r1,r14 800b884: f8 00 09 76 calli 800de5c copied += my_length; 800b888: b5 ec 78 00 add r15,r15,r12 } IMFS_update_atime( the_jnode ); 800b88c: 37 81 00 2c addi r1,sp,44 800b890: 34 02 00 00 mvi r2,0 800b894: fb ff d7 93 calli 80016e0 800b898: 2b 81 00 2c lw r1,(sp+44) 800b89c: 5a 01 00 40 sw (r16+64),r1 return copied; } 800b8a0: b9 e0 08 00 mv r1,r15 800b8a4: 2b 9d 00 04 lw ra,(sp+4) 800b8a8: 2b 8b 00 28 lw r11,(sp+40) 800b8ac: 2b 8c 00 24 lw r12,(sp+36) 800b8b0: 2b 8d 00 20 lw r13,(sp+32) 800b8b4: 2b 8e 00 1c lw r14,(sp+28) 800b8b8: 2b 8f 00 18 lw r15,(sp+24) 800b8bc: 2b 90 00 14 lw r16,(sp+20) 800b8c0: 2b 91 00 10 lw r17,(sp+16) 800b8c4: 2b 92 00 0c lw r18,(sp+12) 800b8c8: 2b 93 00 08 lw r19,(sp+8) 800b8cc: 37 9c 00 30 addi sp,sp,48 800b8d0: c3 a0 00 00 ret block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800b8d4: ba 00 08 00 mv r1,r16 800b8d8: b9 a0 10 00 mv r2,r13 800b8dc: 34 03 00 00 mvi r3,0 800b8e0: fb ff ff 03 calli 800b4ec if ( !block_ptr ) 800b8e4: 44 20 ff ef be r1,r0,800b8a0 <== 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; 800b8e8: c9 73 58 00 sub r11,r11,r19 800b8ec: b9 80 78 00 mv r15,r12 800b8f0: 51 6c 00 02 bgeu r11,r12,800b8f8 800b8f4: b9 60 78 00 mv r15,r11 if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); 800b8f8: 28 22 00 00 lw r2,(r1+0) 800b8fc: b9 e0 18 00 mv r3,r15 800b900: ba 40 08 00 mv r1,r18 800b904: b4 53 10 00 add r2,r2,r19 800b908: f8 00 09 55 calli 800de5c dest += to_copy; 800b90c: b6 4f 70 00 add r14,r18,r15 block++; my_length -= to_copy; 800b910: 2a 2b 00 00 lw r11,(r17+0) block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); dest += to_copy; block++; 800b914: 35 ad 00 01 addi r13,r13,1 my_length -= to_copy; 800b918: c9 8f 60 00 sub r12,r12,r15 800b91c: e3 ff ff c0 bi 800b81c if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) 800b920: 2a 0f 00 50 lw r15,(r16+80) 800b924: c9 ed 78 00 sub r15,r15,r13 * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) { 800b928: 50 8f 00 02 bgeu r4,r15,800b930 <== ALWAYS TAKEN 800b92c: b8 80 78 00 mv r15,r4 <== NOT EXECUTED file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) my_length = the_jnode->info.linearfile.size - start; memcpy(dest, &file_ptr[start], my_length); 800b930: 2a 02 00 54 lw r2,(r16+84) 800b934: b9 e0 18 00 mv r3,r15 800b938: ba 40 08 00 mv r1,r18 800b93c: b4 4d 10 00 add r2,r2,r13 800b940: f8 00 09 47 calli 800de5c return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); 800b944: 37 81 00 2c addi r1,sp,44 800b948: 34 02 00 00 mvi r2,0 800b94c: fb ff d7 65 calli 80016e0 800b950: 2b 81 00 2c lw r1,(sp+44) 800b954: 5a 01 00 40 sw (r16+64),r1 800b958: e3 ff ff d2 bi 800b8a0 =============================================================================== 0800baa0 : * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 800baa0: 37 9c ff dc addi sp,sp,-36 800baa4: 5b 8b 00 24 sw (sp+36),r11 800baa8: 5b 8c 00 20 sw (sp+32),r12 800baac: 5b 8d 00 1c sw (sp+28),r13 800bab0: 5b 8e 00 18 sw (sp+24),r14 800bab4: 5b 8f 00 14 sw (sp+20),r15 800bab8: 5b 90 00 10 sw (sp+16),r16 800babc: 5b 91 00 0c sw (sp+12),r17 800bac0: 5b 92 00 08 sw (sp+8),r18 800bac4: 5b 9d 00 04 sw (sp+4),ra /* * Eventually this could be set smarter at each call to * memfile_free_blocks_in_table to greatly speed this up. */ to_free = IMFS_MEMFILE_BLOCK_SLOTS; 800bac8: 78 0c 08 02 mvhi r12,0x802 800bacc: 39 8c 07 90 ori r12,r12,0x790 800bad0: 29 8d 00 00 lw r13,(r12+0) * is better to stick to simple, easy to understand algorithms. */ IMFS_jnode_t *IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { 800bad4: b8 20 78 00 mv r15,r1 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 800bad8: 28 21 00 54 lw r1,(r1+84) /* * Eventually this could be set smarter at each call to * memfile_free_blocks_in_table to greatly speed this up. */ to_free = IMFS_MEMFILE_BLOCK_SLOTS; 800badc: 01 ad 00 01 srui r13,r13,1 800bae0: 01 ad 00 01 srui r13,r13,1 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { 800bae4: 44 20 00 04 be r1,r0,800baf4 memfile_free_blocks_in_table( &info->indirect, to_free ); 800bae8: 35 e1 00 54 addi r1,r15,84 800baec: b9 a0 10 00 mv r2,r13 800baf0: fb ff ff ce calli 800ba28 } if ( info->doubly_indirect ) { 800baf4: 29 e2 00 58 lw r2,(r15+88) 800baf8: 44 40 00 19 be r2,r0,800bb5c for ( i=0 ; i <== NEVER TAKEN if ( info->doubly_indirect[i] ) { 800bb14: b4 21 08 00 add r1,r1,r1 800bb18: b4 21 08 00 add r1,r1,r1 800bb1c: b4 41 08 00 add r1,r2,r1 800bb20: 28 23 00 00 lw r3,(r1+0) if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; idoubly_indirect[i] ) { memfile_free_blocks_in_table( 800bb28: b9 a0 10 00 mv r2,r13 memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; idoubly_indirect[i] ) { 800bb2c: 44 60 00 02 be r3,r0,800bb34 <== NEVER TAKEN memfile_free_blocks_in_table( 800bb30: fb ff ff be calli 800ba28 if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i 800bb48: 29 e2 00 58 lw r2,(r15+88) 800bb4c: e3 ff ff f2 bi 800bb14 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 ); 800bb50: 35 e1 00 58 addi r1,r15,88 800bb54: b9 a0 10 00 mv r2,r13 800bb58: fb ff ff b4 calli 800ba28 } if ( info->triply_indirect ) { 800bb5c: 29 e1 00 5c lw r1,(r15+92) 800bb60: 44 20 00 27 be r1,r0,800bbfc for ( i=0 ; i <== NEVER TAKEN p = (block_p *) info->triply_indirect[i]; 800bb74: 28 2e 00 00 lw r14,(r1+0) if ( !p ) /* ensure we have a valid pointer */ 800bb78: 34 10 00 04 mvi r16,4 } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 800bb7c: 34 12 00 00 mvi r18,0 if ( !p ) /* ensure we have a valid pointer */ 800bb80: 34 11 00 00 mvi r17,0 800bb84: 45 c0 00 1b be r14,r0,800bbf0 <== NEVER TAKEN break; for ( j=0 ; j <== NEVER TAKEN 800bb90: 34 03 00 00 mvi r3,0 800bb94: 34 0b 00 00 mvi r11,0 if ( p[j] ) { 800bb98: b4 63 18 00 add r3,r3,r3 800bb9c: b4 63 18 00 add r3,r3,r3 800bba0: b5 c3 08 00 add r1,r14,r3 800bba4: 28 23 00 00 lw r3,(r1+0) if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; jtriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j <== NEVER TAKEN memfile_free_blocks_in_table( (block_p **)&p[j], to_free); 800bbb4: fb ff ff 9d calli 800ba28 if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j 800bbcc: 29 e1 00 5c lw r1,(r15+92) if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( 800bbd0: b4 32 08 00 add r1,r1,r18 800bbd4: b9 a0 10 00 mv r2,r13 800bbd8: fb ff ff 94 calli 800ba28 memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( 800bbf0: 35 e1 00 5c addi r1,r15,92 800bbf4: b9 a0 10 00 mv r2,r13 800bbf8: fb ff ff 8c calli 800ba28 (block_p **)&info->triply_indirect, to_free ); } return the_jnode; } 800bbfc: b9 e0 08 00 mv r1,r15 800bc00: 2b 9d 00 04 lw ra,(sp+4) 800bc04: 2b 8b 00 24 lw r11,(sp+36) 800bc08: 2b 8c 00 20 lw r12,(sp+32) 800bc0c: 2b 8d 00 1c lw r13,(sp+28) 800bc10: 2b 8e 00 18 lw r14,(sp+24) 800bc14: 2b 8f 00 14 lw r15,(sp+20) 800bc18: 2b 90 00 10 lw r16,(sp+16) 800bc1c: 2b 91 00 0c lw r17,(sp+12) 800bc20: 2b 92 00 08 lw r18,(sp+8) 800bc24: 37 9c 00 24 addi sp,sp,36 800bc28: c3 a0 00 00 ret } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 800bc2c: 29 e1 00 5c lw r1,(r15+92) 800bc30: 36 04 00 04 addi r4,r16,4 800bc34: b4 30 18 00 add r3,r1,r16 800bc38: 28 6e 00 00 lw r14,(r3+0) if ( !p ) /* ensure we have a valid pointer */ 800bc3c: 45 c0 ff ed be r14,r0,800bbf0 <== NEVER TAKEN } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; 800bc40: ba 00 90 00 mv r18,r16 if ( !p ) /* ensure we have a valid pointer */ 800bc44: b8 80 80 00 mv r16,r4 800bc48: e3 ff ff d0 bi 800bb88 =============================================================================== 0800be20 : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 800be20: 37 9c ff cc addi sp,sp,-52 800be24: 5b 8b 00 2c sw (sp+44),r11 800be28: 5b 8c 00 28 sw (sp+40),r12 800be2c: 5b 8d 00 24 sw (sp+36),r13 800be30: 5b 8e 00 20 sw (sp+32),r14 800be34: 5b 8f 00 1c sw (sp+28),r15 800be38: 5b 90 00 18 sw (sp+24),r16 800be3c: 5b 91 00 14 sw (sp+20),r17 800be40: 5b 92 00 10 sw (sp+16),r18 800be44: 5b 93 00 0c sw (sp+12),r19 800be48: 5b 94 00 08 sw (sp+8),r20 800be4c: 5b 9d 00 04 sw (sp+4),ra * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + my_length; if ( last_byte > the_jnode->info.file.size ) { 800be50: 28 25 00 50 lw r5,(r1+80) IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 800be54: b8 80 90 00 mv r18,r4 /* * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + my_length; 800be58: b4 82 20 00 add r4,r4,r2 IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { 800be5c: b8 20 88 00 mv r17,r1 800be60: b8 40 60 00 mv r12,r2 800be64: b8 60 98 00 mv r19,r3 * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + my_length; if ( last_byte > the_jnode->info.file.size ) { 800be68: 50 a4 00 06 bgeu r5,r4,800be80 bool zero_fill = start > the_jnode->info.file.size; status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); 800be6c: e8 45 10 00 cmpg r2,r2,r5 800be70: b8 80 18 00 mv r3,r4 800be74: fb ff ff 82 calli 800bc7c 800be78: b8 20 28 00 mv r5,r1 if ( status ) 800be7c: 5c 20 00 33 bne r1,r0,800bf48 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800be80: 78 10 08 02 mvhi r16,0x802 800be84: 3a 10 07 90 ori r16,r16,0x790 800be88: 2a 0b 00 00 lw r11,(r16+0) 800be8c: b9 80 08 00 mv r1,r12 unsigned int last_byte; unsigned int start_offset; int copied; const unsigned char *src; src = source; 800be90: ba 60 70 00 mv r14,r19 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; 800be94: b9 60 10 00 mv r2,r11 800be98: f8 00 40 33 calli 801bf64 <__modsi3> 800be9c: b8 20 a0 00 mv r20,r1 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; 800bea0: b9 60 10 00 mv r2,r11 800bea4: b9 80 08 00 mv r1,r12 800bea8: f8 00 3f ff calli 801bea4 <__divsi3> 800beac: b8 20 68 00 mv r13,r1 if ( start_offset ) { 800beb0: ba 40 60 00 mv r12,r18 status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); if ( status ) return status; } copied = 0; 800beb4: 34 0f 00 00 mvi r15,0 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { 800beb8: 5e 80 00 32 bne r20,r0,800bf80 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800bebc: 55 6c 00 10 bgu r11,r12,800befc block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800bec0: b9 a0 10 00 mv r2,r13 800bec4: 34 03 00 00 mvi r3,0 800bec8: ba 20 08 00 mv r1,r17 800becc: fb ff fd 88 calli 800b4ec if ( !block_ptr ) return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, to_copy ); 800bed0: b9 c0 10 00 mv r2,r14 800bed4: b9 60 18 00 mv r3,r11 src += to_copy; block++; my_length -= to_copy; 800bed8: c9 8b 60 00 sub r12,r12,r11 */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) 800bedc: 44 20 00 3c be r1,r0,800bfcc <== 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 ); 800bee0: 28 21 00 00 lw r1,(r1+0) src += to_copy; 800bee4: b5 cb 70 00 add r14,r14,r11 block++; 800bee8: 35 ad 00 01 addi r13,r13,1 if ( !block_ptr ) return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, to_copy ); 800beec: f8 00 07 dc calli 800de5c /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800bef0: 2a 01 00 00 lw r1,(r16+0) * IMFS_memfile_write * * This routine writes the specified data buffer into the in memory * file pointed to by the_jnode. The file is extended as needed. */ MEMFILE_STATIC ssize_t IMFS_memfile_write( 800bef4: b5 eb 78 00 add r15,r15,r11 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { 800bef8: 51 81 ff f2 bgeu r12,r1,800bec0 * 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 ) { 800befc: 45 80 00 0c be r12,r0,800bf2c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800bf00: ba 20 08 00 mv r1,r17 800bf04: b9 a0 10 00 mv r2,r13 800bf08: 34 03 00 00 mvi r3,0 800bf0c: fb ff fd 78 calli 800b4ec if ( !block_ptr ) 800bf10: b9 e0 28 00 mv r5,r15 800bf14: 44 20 00 0d be r1,r0,800bf48 <== 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 ); 800bf18: 28 21 00 00 lw r1,(r1+0) 800bf1c: b9 c0 10 00 mv r2,r14 800bf20: b9 80 18 00 mv r3,r12 800bf24: f8 00 07 ce calli 800de5c my_length = 0; copied += to_copy; 800bf28: b5 ec 78 00 add r15,r15,r12 } IMFS_mtime_ctime_update( the_jnode ); 800bf2c: 37 81 00 30 addi r1,sp,48 800bf30: 34 02 00 00 mvi r2,0 800bf34: fb ff d5 eb calli 80016e0 800bf38: 2b 81 00 30 lw r1,(sp+48) return copied; 800bf3c: b9 e0 28 00 mv r5,r15 memcpy( &(*block_ptr)[ 0 ], src, my_length ); my_length = 0; copied += to_copy; } IMFS_mtime_ctime_update( the_jnode ); 800bf40: 5a 21 00 44 sw (r17+68),r1 800bf44: 5a 21 00 48 sw (r17+72),r1 return copied; } 800bf48: b8 a0 08 00 mv r1,r5 800bf4c: 2b 9d 00 04 lw ra,(sp+4) 800bf50: 2b 8b 00 2c lw r11,(sp+44) 800bf54: 2b 8c 00 28 lw r12,(sp+40) 800bf58: 2b 8d 00 24 lw r13,(sp+36) 800bf5c: 2b 8e 00 20 lw r14,(sp+32) 800bf60: 2b 8f 00 1c lw r15,(sp+28) 800bf64: 2b 90 00 18 lw r16,(sp+24) 800bf68: 2b 91 00 14 lw r17,(sp+20) 800bf6c: 2b 92 00 10 lw r18,(sp+16) 800bf70: 2b 93 00 0c lw r19,(sp+12) 800bf74: 2b 94 00 08 lw r20,(sp+8) 800bf78: 37 9c 00 34 addi sp,sp,52 800bf7c: c3 a0 00 00 ret block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); 800bf80: ba 20 08 00 mv r1,r17 800bf84: b9 a0 10 00 mv r2,r13 800bf88: 34 03 00 00 mvi r3,0 800bf8c: fb ff fd 58 calli 800b4ec if ( !block_ptr ) return copied; 800bf90: 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 ) 800bf94: 44 20 ff ed be r1,r0,800bf48 <== 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; 800bf98: c9 74 78 00 sub r15,r11,r20 800bf9c: 52 4f 00 02 bgeu r18,r15,800bfa4 800bfa0: ba 40 78 00 mv r15,r18 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); 800bfa4: 28 21 00 00 lw r1,(r1+0) 800bfa8: ba 60 10 00 mv r2,r19 800bfac: b9 e0 18 00 mv r3,r15 800bfb0: b4 34 08 00 add r1,r1,r20 800bfb4: f8 00 07 aa calli 800de5c src += to_copy; 800bfb8: b6 6f 70 00 add r14,r19,r15 block++; my_length -= to_copy; copied += to_copy; 800bfbc: 2a 0b 00 00 lw r11,(r16+0) src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); src += to_copy; block++; 800bfc0: 35 ad 00 01 addi r13,r13,1 my_length -= to_copy; 800bfc4: ca 4f 60 00 sub r12,r18,r15 800bfc8: e3 ff ff bd bi 800bebc */ 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 ) 800bfcc: b9 e0 28 00 mv r5,r15 <== NOT EXECUTED 800bfd0: e3 ff ff de bi 800bf48 <== NOT EXECUTED =============================================================================== 08000d94 : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 8000d94: 37 9c ff dc addi sp,sp,-36 8000d98: 5b 8b 00 0c sw (sp+12),r11 8000d9c: 5b 8c 00 08 sw (sp+8),r12 8000da0: 5b 9d 00 04 sw (sp+4),ra dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 8000da4: 20 87 f0 00 andi r7,r4,0xf000 const char *name, size_t namelen, mode_t mode, dev_t dev ) { 8000da8: b8 40 48 00 mv r9,r2 dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 8000dac: 34 02 40 00 mvi r2,16384 const char *name, size_t namelen, mode_t mode, dev_t dev ) { 8000db0: b8 80 40 00 mv r8,r4 8000db4: b8 20 58 00 mv r11,r1 8000db8: b8 60 20 00 mv r4,r3 IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; 8000dbc: 34 01 00 00 mvi r1,0 dev_t dev, IMFS_jnode_types_t *type, IMFS_types_union *info ) { if ( S_ISDIR( mode ) ) { 8000dc0: 44 e2 00 0a be r7,r2,8000de8 *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { 8000dc4: 34 42 40 00 addi r2,r2,16384 8000dc8: 44 e2 00 2d be r7,r2,8000e7c *type = IMFS_MEMORY_FILE; } else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) { 8000dcc: 64 e3 20 00 cmpei r3,r7,8192 8000dd0: 64 e2 60 00 cmpei r2,r7,24576 8000dd4: b8 62 10 00 or r2,r3,r2 8000dd8: 44 40 00 25 be r2,r0,8000e6c *type = IMFS_DEVICE; rtems_filesystem_split_dev_t( 8000ddc: 5b 85 00 10 sw (sp+16),r5 8000de0: 5b 86 00 14 sw (sp+20),r6 if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { *type = IMFS_MEMORY_FILE; } else if ( S_ISBLK( mode ) || S_ISCHR( mode ) ) { *type = IMFS_DEVICE; 8000de4: 34 01 00 01 mvi r1,1 mode_t mode, const IMFS_types_union *info ) { const IMFS_fs_info_t *fs_info = (const IMFS_fs_info_t *) parentloc->mt_entry->fs_info; 8000de8: 29 62 00 14 lw r2,(r11+20) return IMFS_create_node_with_control( 8000dec: 34 26 00 02 addi r6,r1,2 8000df0: b4 c6 30 00 add r6,r6,r6 8000df4: 28 42 00 08 lw r2,(r2+8) 8000df8: b4 c6 30 00 add r6,r6,r6 8000dfc: b9 60 08 00 mv r1,r11 8000e00: b4 46 30 00 add r6,r2,r6 8000e04: 28 c2 00 00 lw r2,(r6+0) 8000e08: b9 20 18 00 mv r3,r9 8000e0c: b9 00 28 00 mv r5,r8 8000e10: 37 86 00 10 addi r6,sp,16 8000e14: f8 00 1e 29 calli 80086b8 IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); } else { rv = -1; 8000e18: 34 02 ff ff mvi r2,-1 IMFS_jnode_t *new_node; get_type_and_info_by_mode_and_dev( mode, dev, &type, &info ); new_node = IMFS_create_node( parentloc, type, name, namelen, mode, &info ); if ( new_node != NULL ) { 8000e1c: 44 20 00 0e be r1,r0,8000e54 IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); 8000e20: 37 8c 00 20 addi r12,sp,32 8000e24: 34 02 00 00 mvi r2,0 8000e28: b9 80 08 00 mv r1,r12 get_type_and_info_by_mode_and_dev( mode, dev, &type, &info ); new_node = IMFS_create_node( parentloc, type, name, namelen, mode, &info ); if ( new_node != NULL ) { IMFS_jnode_t *parent = parentloc->node_access; 8000e2c: 29 6b 00 08 lw r11,(r11+8) IMFS_update_ctime( parent ); 8000e30: f8 00 02 2c calli 80016e0 8000e34: 2b 83 00 20 lw r3,(sp+32) IMFS_update_mtime( parent ); 8000e38: 34 02 00 00 mvi r2,0 8000e3c: b9 80 08 00 mv r1,r12 new_node = IMFS_create_node( parentloc, type, name, namelen, mode, &info ); if ( new_node != NULL ) { IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); 8000e40: 59 63 00 48 sw (r11+72),r3 IMFS_update_mtime( parent ); 8000e44: f8 00 02 27 calli 80016e0 8000e48: 2b 81 00 20 lw r1,(sp+32) size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 8000e4c: 34 02 00 00 mvi r2,0 new_node = IMFS_create_node( parentloc, type, name, namelen, mode, &info ); if ( new_node != NULL ) { IMFS_jnode_t *parent = parentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); 8000e50: 59 61 00 44 sw (r11+68),r1 } else { rv = -1; } return rv; } 8000e54: b8 40 08 00 mv r1,r2 8000e58: 2b 9d 00 04 lw ra,(sp+4) 8000e5c: 2b 8b 00 0c lw r11,(sp+12) 8000e60: 2b 8c 00 08 lw r12,(sp+8) 8000e64: 37 9c 00 24 addi sp,sp,36 8000e68: c3 a0 00 00 ret rtems_filesystem_split_dev_t( dev, info->device.major, info->device.minor ); } else if (S_ISFIFO( mode )) { 8000e6c: 34 02 10 00 mvi r2,4096 8000e70: 5c e2 ff de bne r7,r2,8000de8 <== NEVER TAKEN *type = IMFS_FIFO; 8000e74: 34 01 00 06 mvi r1,6 8000e78: e3 ff ff dc bi 8000de8 ) { if ( S_ISDIR( mode ) ) { *type = IMFS_DIRECTORY; } else if ( S_ISREG( mode ) ) { *type = IMFS_MEMORY_FILE; 8000e7c: 34 01 00 04 mvi r1,4 8000e80: e3 ff ff da bi 8000de8 =============================================================================== 08000e84 : #endif #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 8000e84: 37 9c ff fc addi sp,sp,-4 8000e88: 5b 9d 00 04 sw (sp+4),ra int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 8000e8c: 28 22 00 20 lw r2,(r1+32) 8000e90: 28 42 00 08 lw r2,(r2+8) return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 8000e94: 28 43 00 4c lw r3,(r2+76) if ( IMFS_is_directory( node ) ) { 8000e98: 28 63 00 00 lw r3,(r3+0) 8000e9c: 5c 60 00 0d bne r3,r0,8000ed0 if ( node->info.directory.mt_fs == NULL ) { 8000ea0: 28 44 00 5c lw r4,(r2+92) 8000ea4: 5c 83 00 06 bne r4,r3,8000ebc <== NEVER TAKEN node->info.directory.mt_fs = mt_entry; 8000ea8: 58 41 00 5c sw (r2+92),r1 #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 8000eac: 34 01 00 00 mvi r1,0 errno = ENOTDIR; rv = -1; } return rv; } 8000eb0: 2b 9d 00 04 lw ra,(sp+4) 8000eb4: 37 9c 00 04 addi sp,sp,4 8000eb8: c3 a0 00 00 ret if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == NULL ) { node->info.directory.mt_fs = mt_entry; } else { errno = EBUSY; 8000ebc: f8 00 30 ee calli 800d274 <__errno> <== NOT EXECUTED 8000ec0: 34 02 00 10 mvi r2,16 <== NOT EXECUTED 8000ec4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8000ec8: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8000ecc: e3 ff ff f9 bi 8000eb0 <== NOT EXECUTED } } else { errno = ENOTDIR; 8000ed0: f8 00 30 e9 calli 800d274 <__errno> 8000ed4: 34 02 00 14 mvi r2,20 8000ed8: 58 22 00 00 sw (r1+0),r2 rv = -1; 8000edc: 34 01 ff ff mvi r1,-1 8000ee0: e3 ff ff f4 bi 8000eb0 =============================================================================== 08008b2c : } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { 8008b2c: 37 9c ff fc addi sp,sp,-4 8008b30: 5b 9d 00 04 sw (sp+4),ra if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 8008b34: 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 ); 8008b38: 34 22 00 54 addi r2,r1,84 8008b3c: 5c 62 00 06 bne r3,r2,8008b54 errno = ENOTEMPTY; node = NULL; } else if ( IMFS_is_mount_point( node ) ) { 8008b40: 28 22 00 5c lw r2,(r1+92) 8008b44: 5c 40 00 0b bne r2,r0,8008b70 <== NEVER TAKEN errno = EBUSY; node = NULL; } return node; } 8008b48: 2b 9d 00 04 lw ra,(sp+4) 8008b4c: 37 9c 00 04 addi sp,sp,4 8008b50: c3 a0 00 00 ret static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { errno = ENOTEMPTY; 8008b54: f8 00 11 c8 calli 800d274 <__errno> 8008b58: 34 02 00 5a mvi r2,90 8008b5c: 58 22 00 00 sw (r1+0),r2 node = NULL; 8008b60: 34 01 00 00 mvi r1,0 errno = EBUSY; node = NULL; } return node; } 8008b64: 2b 9d 00 04 lw ra,(sp+4) 8008b68: 37 9c 00 04 addi sp,sp,4 8008b6c: c3 a0 00 00 ret { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { errno = ENOTEMPTY; node = NULL; } else if ( IMFS_is_mount_point( node ) ) { errno = EBUSY; 8008b70: f8 00 11 c1 calli 800d274 <__errno> <== NOT EXECUTED 8008b74: 34 02 00 10 mvi r2,16 <== NOT EXECUTED 8008b78: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED node = NULL; 8008b7c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED } return node; } 8008b80: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8008b84: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 8008b88: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08000ee4 : rtems_filesystem_node_types_t IMFS_node_type( const rtems_filesystem_location_info_t *loc ) { const IMFS_jnode_t *node = loc->node_access; 8000ee4: 28 21 00 08 lw r1,(r1+8) IMFS_jnode_types_t imfs_type = IMFS_type( node ); rtems_filesystem_node_types_t type; switch ( imfs_type ) { 8000ee8: 34 03 00 02 mvi r3,2 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 8000eec: 28 22 00 4c lw r2,(r1+76) 8000ef0: 28 42 00 00 lw r2,(r2+0) 8000ef4: 44 43 00 06 be r2,r3,8000f0c 8000ef8: 34 03 00 05 mvi r3,5 case IMFS_HARD_LINK: type = IMFS_type( node->info.hard_link.link_node ); break; case IMFS_LINEAR_FILE: type = RTEMS_FILESYSTEM_MEMORY_FILE; 8000efc: 34 01 00 04 mvi r1,4 { const IMFS_jnode_t *node = loc->node_access; IMFS_jnode_types_t imfs_type = IMFS_type( node ); rtems_filesystem_node_types_t type; switch ( imfs_type ) { 8000f00: 44 43 00 07 be r2,r3,8000f1c <== NEVER TAKEN 8000f04: b8 40 08 00 mv r1,r2 type = imfs_type; break; } return type; } 8000f08: c3 a0 00 00 ret 8000f0c: 28 21 00 50 lw r1,(r1+80) 8000f10: 28 21 00 4c lw r1,(r1+76) 8000f14: 28 21 00 00 lw r1,(r1+0) rtems_filesystem_node_types_t type; switch ( imfs_type ) { case IMFS_HARD_LINK: type = IMFS_type( node->info.hard_link.link_node ); break; 8000f18: c3 a0 00 00 ret 8000f1c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08000f20 : ) { IMFS_jnode_t *node; ssize_t i; node = loc->node_access; 8000f20: 28 25 00 08 lw r5,(r1+8) IMFS_assert( node->control->imfs_type == IMFS_SYM_LINK ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) 8000f24: 34 01 00 00 mvi r1,0 8000f28: 44 60 00 0e be r3,r0,8000f60 <== NEVER TAKEN 8000f2c: 28 a4 00 50 lw r4,(r5+80) 8000f30: 40 84 00 00 lbu r4,(r4+0) 8000f34: 44 80 00 0b be r4,r0,8000f60 <== NEVER TAKEN 8000f38: 34 06 00 00 mvi r6,0 buf[i] = node->info.sym_link.name[i]; 8000f3c: b4 46 30 00 add r6,r2,r6 8000f40: 30 c4 00 00 sb (r6+0),r4 node = loc->node_access; IMFS_assert( node->control->imfs_type == IMFS_SYM_LINK ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) 8000f44: 34 21 00 01 addi r1,r1,1 8000f48: b8 20 30 00 mv r6,r1 8000f4c: 50 23 00 05 bgeu r1,r3,8000f60 8000f50: 28 a4 00 50 lw r4,(r5+80) 8000f54: b4 81 20 00 add r4,r4,r1 8000f58: 40 84 00 00 lbu r4,(r4+0) 8000f5c: 5c 80 ff f8 bne r4,r0,8000f3c buf[i] = node->info.sym_link.name[i]; return i; } 8000f60: c3 a0 00 00 ret =============================================================================== 08000f64 : const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 8000f64: 37 9c ff e8 addi sp,sp,-24 8000f68: 5b 8b 00 10 sw (sp+16),r11 8000f6c: 5b 8c 00 0c sw (sp+12),r12 8000f70: 5b 8d 00 08 sw (sp+8),r13 8000f74: 5b 9d 00 04 sw (sp+4),ra int rv = 0; IMFS_jnode_t *node = oldloc->node_access; 8000f78: 28 4b 00 08 lw r11,(r2+8) const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 8000f7c: b8 a0 68 00 mv r13,r5 int rv = 0; IMFS_jnode_t *node = oldloc->node_access; IMFS_jnode_t *new_parent = newparentloc->node_access; 8000f80: 28 6c 00 08 lw r12,(r3+8) /* * FIXME: Due to insufficient checks we can create inaccessible nodes with * this operation. */ if ( node->Parent != NULL ) { 8000f84: 29 61 00 08 lw r1,(r11+8) 8000f88: 44 20 00 25 be r1,r0,800101c <== NEVER TAKEN if ( namelen < IMFS_NAME_MAX ) { 8000f8c: 34 01 00 1f mvi r1,31 8000f90: 54 a1 00 1e bgu r5,r1,8001008 <== NEVER TAKEN memcpy( node->name, name, namelen ); 8000f94: b8 80 10 00 mv r2,r4 8000f98: b8 a0 18 00 mv r3,r5 8000f9c: 35 61 00 0c addi r1,r11,12 8000fa0: f8 00 33 af calli 800de5c ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 8000fa4: 29 63 00 00 lw r3,(r11+0) previous = the_node->previous; 8000fa8: 29 61 00 04 lw r1,(r11+4) node->name [namelen] = '\0'; 8000fac: b5 6d 68 00 add r13,r11,r13 8000fb0: 31 a0 00 0c sb (r13+12),r0 next->previous = previous; 8000fb4: 58 61 00 04 sw (r3+4),r1 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 8000fb8: 29 82 00 58 lw r2,(r12+88) Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; previous->next = next; 8000fbc: 58 23 00 00 sw (r1+0),r3 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 8000fc0: 35 81 00 54 addi r1,r12,84 Chain_Node *old_last = tail->previous; the_node->next = tail; 8000fc4: 59 61 00 00 sw (r11+0),r1 static inline void IMFS_add_to_directory( IMFS_jnode_t *dir, IMFS_jnode_t *node ) { node->Parent = dir; 8000fc8: 59 6c 00 08 sw (r11+8),r12 tail->previous = the_node; old_last->next = the_node; 8000fcc: 58 4b 00 00 sw (r2+0),r11 the_node->previous = old_last; 8000fd0: 59 62 00 04 sw (r11+4),r2 { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 8000fd4: 59 8b 00 58 sw (r12+88),r11 IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); 8000fd8: 34 02 00 00 mvi r2,0 8000fdc: 37 81 00 14 addi r1,sp,20 8000fe0: f8 00 01 c0 calli 80016e0 8000fe4: 2b 82 00 14 lw r2,(sp+20) const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { int rv = 0; 8000fe8: 34 01 00 00 mvi r1,0 memcpy( node->name, name, namelen ); node->name [namelen] = '\0'; IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); 8000fec: 59 62 00 48 sw (r11+72),r2 errno = EINVAL; rv = -1; } return rv; } 8000ff0: 2b 9d 00 04 lw ra,(sp+4) 8000ff4: 2b 8b 00 10 lw r11,(sp+16) 8000ff8: 2b 8c 00 0c lw r12,(sp+12) 8000ffc: 2b 8d 00 08 lw r13,(sp+8) 8001000: 37 9c 00 18 addi sp,sp,24 8001004: c3 a0 00 00 ret IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); } else { errno = ENAMETOOLONG; 8001008: f8 00 30 9b calli 800d274 <__errno> <== NOT EXECUTED 800100c: 34 02 00 5b mvi r2,91 <== NOT EXECUTED 8001010: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8001014: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8001018: e3 ff ff f6 bi 8000ff0 <== NOT EXECUTED } } else { errno = EINVAL; 800101c: f8 00 30 96 calli 800d274 <__errno> <== NOT EXECUTED 8001020: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8001024: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8001028: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800102c: e3 ff ff f1 bi 8000ff0 <== NOT EXECUTED =============================================================================== 0800112c : #endif #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 800112c: 37 9c ff fc addi sp,sp,-4 8001130: 5b 9d 00 04 sw (sp+4),ra int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 8001134: 28 22 00 20 lw r2,(r1+32) 8001138: 28 42 00 08 lw r2,(r2+8) return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 800113c: 28 43 00 4c lw r3,(r2+76) if ( IMFS_is_directory( node ) ) { 8001140: 28 63 00 00 lw r3,(r3+0) 8001144: 5c 60 00 0d bne r3,r0,8001178 <== NEVER TAKEN if ( node->info.directory.mt_fs == mt_entry ) { 8001148: 28 43 00 5c lw r3,(r2+92) 800114c: 5c 61 00 06 bne r3,r1,8001164 <== NEVER TAKEN node->info.directory.mt_fs = NULL; 8001150: 58 40 00 5c sw (r2+92),r0 #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 8001154: 34 01 00 00 mvi r1,0 errno = ENOTDIR; rv = -1; } return rv; } 8001158: 2b 9d 00 04 lw ra,(sp+4) 800115c: 37 9c 00 04 addi sp,sp,4 8001160: c3 a0 00 00 ret if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == mt_entry ) { node->info.directory.mt_fs = NULL; } else { errno = EINVAL; 8001164: f8 00 30 44 calli 800d274 <__errno> <== NOT EXECUTED 8001168: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 800116c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8001170: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8001174: e3 ff ff f9 bi 8001158 <== NOT EXECUTED } } else { errno = ENOTDIR; 8001178: f8 00 30 3f calli 800d274 <__errno> <== NOT EXECUTED 800117c: 34 02 00 14 mvi r2,20 <== NOT EXECUTED 8001180: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8001184: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8001188: e3 ff ff f4 bi 8001158 <== NOT EXECUTED =============================================================================== 08001938 : void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8001938: 37 9c ff e0 addi sp,sp,-32 800193c: 5b 8b 00 20 sw (sp+32),r11 8001940: 5b 8c 00 1c sw (sp+28),r12 8001944: 5b 8d 00 18 sw (sp+24),r13 8001948: 5b 8e 00 14 sw (sp+20),r14 800194c: 5b 8f 00 10 sw (sp+16),r15 8001950: 5b 90 00 0c sw (sp+12),r16 8001954: 5b 91 00 08 sw (sp+8),r17 8001958: 5b 9d 00 04 sw (sp+4),ra Heap_Control *heap = RTEMS_Malloc_Heap; if ( !rtems_configuration_get_unified_work_area() ) { 800195c: 78 04 08 01 mvhi r4,0x801 8001960: 38 84 d2 6c ori r4,r4,0xd26c 8001964: 40 85 00 31 lbu r5,(r4+49) const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Control *heap = RTEMS_Malloc_Heap; 8001968: 78 04 08 02 mvhi r4,0x802 800196c: 38 84 00 54 ori r4,r4,0x54 void RTEMS_Malloc_Initialize( const Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8001970: b8 40 78 00 mv r15,r2 8001974: b8 60 80 00 mv r16,r3 Heap_Control *heap = RTEMS_Malloc_Heap; 8001978: 28 8e 00 00 lw r14,(r4+0) if ( !rtems_configuration_get_unified_work_area() ) { 800197c: 5c a0 00 12 bne r5,r0,80019c4 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t page_size = CPU_HEAP_ALIGNMENT; size_t i; for (i = 0; i < area_count; ++i) { 8001980: 44 45 00 28 be r2,r5,8001a20 8001984: 78 11 08 00 mvhi r17,0x800 8001988: 3a 31 51 d8 ori r17,r17,0x51d8 800198c: b8 20 58 00 mv r11,r1 8001990: 34 0c 00 00 mvi r12,0 8001994: ba 20 68 00 mv r13,r17 const Heap_Area *area = &areas [i]; uintptr_t space_available = (*init_or_extend)( 8001998: 29 62 00 00 lw r2,(r11+0) 800199c: 29 63 00 04 lw r3,(r11+4) 80019a0: b9 c0 08 00 mv r1,r14 80019a4: 34 04 00 04 mvi r4,4 80019a8: d9 a0 00 00 call r13 area->begin, area->size, page_size ); if ( space_available > 0 ) { 80019ac: 44 20 00 02 be r1,r0,80019b4 <== NEVER TAKEN init_or_extend = extend; 80019b0: ba 00 68 00 mv r13,r16 if ( !rtems_configuration_get_unified_work_area() ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t page_size = CPU_HEAP_ALIGNMENT; size_t i; for (i = 0; i < area_count; ++i) { 80019b4: 35 8c 00 01 addi r12,r12,1 80019b8: 35 6b 00 08 addi r11,r11,8 80019bc: 55 ec ff f7 bgu r15,r12,8001998 <== NEVER TAKEN if ( space_available > 0 ) { init_or_extend = extend; } } if ( init_or_extend == _Heap_Initialize ) { 80019c0: 45 b1 00 18 be r13,r17,8001a20 <== NEVER TAKEN } /* * If configured, initialize the statistics support */ if ( rtems_malloc_statistics_helpers != NULL ) { 80019c4: 78 01 08 02 mvhi r1,0x802 80019c8: 38 21 07 4c ori r1,r1,0x74c 80019cc: 28 21 00 00 lw r1,(r1+0) 80019d0: 44 20 00 03 be r1,r0,80019dc (*rtems_malloc_statistics_helpers->initialize)(); 80019d4: 28 21 00 00 lw r1,(r1+0) 80019d8: d8 20 00 00 call r1 } MSBUMP( space_available, _Protected_heap_Get_size( heap ) ); 80019dc: 78 0b 08 02 mvhi r11,0x802 80019e0: 39 6b 08 28 ori r11,r11,0x828 80019e4: 29 6c 00 00 lw r12,(r11+0) 80019e8: b9 c0 08 00 mv r1,r14 80019ec: f8 00 11 72 calli 8005fb4 <_Protected_heap_Get_size> 80019f0: b4 2c 08 00 add r1,r1,r12 80019f4: 59 61 00 00 sw (r11+0),r1 } 80019f8: 2b 9d 00 04 lw ra,(sp+4) 80019fc: 2b 8b 00 20 lw r11,(sp+32) 8001a00: 2b 8c 00 1c lw r12,(sp+28) 8001a04: 2b 8d 00 18 lw r13,(sp+24) 8001a08: 2b 8e 00 14 lw r14,(sp+20) 8001a0c: 2b 8f 00 10 lw r15,(sp+16) 8001a10: 2b 90 00 0c lw r16,(sp+12) 8001a14: 2b 91 00 08 lw r17,(sp+8) 8001a18: 37 9c 00 20 addi sp,sp,32 8001a1c: c3 a0 00 00 ret init_or_extend = extend; } } if ( init_or_extend == _Heap_Initialize ) { _Internal_error_Occurred( 8001a20: 34 01 00 00 mvi r1,0 8001a24: 34 02 00 01 mvi r2,1 8001a28: 34 03 00 17 mvi r3,23 8001a2c: f8 00 0e 9c calli 800549c <_Internal_error_Occurred> =============================================================================== 08023778 : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 8023778: 37 9c ff d0 addi sp,sp,-48 802377c: 5b 8b 00 28 sw (sp+40),r11 8023780: 5b 8c 00 24 sw (sp+36),r12 8023784: 5b 8d 00 20 sw (sp+32),r13 8023788: 5b 8e 00 1c sw (sp+28),r14 802378c: 5b 8f 00 18 sw (sp+24),r15 8023790: 5b 90 00 14 sw (sp+20),r16 8023794: 5b 91 00 10 sw (sp+16),r17 8023798: 5b 92 00 0c sw (sp+12),r18 802379c: 5b 93 00 08 sw (sp+8),r19 80237a0: 5b 9d 00 04 sw (sp+4),ra /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { 80237a4: 34 02 ff ff mvi r2,-1 80237a8: 44 22 00 62 be r1,r2,8023930 current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); 80237ac: 28 31 01 04 lw r17,(r1+260) 80237b0: 28 27 00 b8 lw r7,(r1+184) the_thread = 0; current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; 80237b4: 34 2d 00 b4 addi r13,r1,180 current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); 80237b8: 29 ae 00 00 lw r14,(r13+0) /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 80237bc: 34 e2 00 20 addi r2,r7,32 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 80237c0: 34 e6 00 10 addi r6,r7,16 size = Stack_check_usable_stack_size(stack); 80237c4: 35 ce ff f0 addi r14,r14,-16 { const uint32_t *base, *ebase; uint32_t length; base = s; length = n/4; 80237c8: 01 c4 00 01 srui r4,r14,1 high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) used = Stack_check_Calculate_used( low, size, high_water_mark ); else used = 0; 80237cc: 34 0f 00 00 mvi r15,0 { const uint32_t *base, *ebase; uint32_t length; base = s; length = n/4; 80237d0: 00 84 00 01 srui r4,r4,1 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 80237d4: b4 84 20 00 add r4,r4,r4 80237d8: b4 84 20 00 add r4,r4,r4 80237dc: b4 44 20 00 add r4,r2,r4 80237e0: 50 44 00 09 bgeu r2,r4,8023804 <== NEVER TAKEN if (*base != U32_PATTERN) 80237e4: 28 e3 00 20 lw r3,(r7+32) 80237e8: 78 07 08 06 mvhi r7,0x806 80237ec: 38 e7 45 4c ori r7,r7,0x454c 80237f0: 28 e5 00 00 lw r5,(r7+0) 80237f4: 5c 65 00 39 bne r3,r5,80238d8 <== NEVER TAKEN * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 80237f8: 34 42 00 04 addi r2,r2,4 80237fc: 54 82 00 35 bgu r4,r2,80238d0 <== 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; 8023800: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 8023804: 44 20 00 3a be r1,r0,80238ec <== NOT EXECUTED #endif { (*print_handler)( 8023808: 28 30 00 08 lw r16,(r1+8) 802380c: 78 0c 08 06 mvhi r12,0x806 8023810: 39 8c ea 70 ori r12,r12,0xea70 8023814: 78 0b 08 06 mvhi r11,0x806 8023818: 29 93 00 00 lw r19,(r12+0) 802381c: 37 83 00 2c addi r3,sp,44 8023820: 34 02 00 05 mvi r2,5 8023824: 39 6b ea 74 ori r11,r11,0xea74 8023828: ba 00 08 00 mv r1,r16 802382c: 29 72 00 00 lw r18,(r11+0) 8023830: fb ff a5 b7 calli 800cf0c 8023834: 78 02 08 06 mvhi r2,0x806 8023838: b8 20 20 00 mv r4,r1 802383c: 38 42 43 c0 ori r2,r2,0x43c0 8023840: ba 60 08 00 mv r1,r19 8023844: ba 00 18 00 mv r3,r16 8023848: da 40 00 00 call r18 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 802384c: 29 a4 00 00 lw r4,(r13+0) 8023850: 29 a3 00 04 lw r3,(r13+4) else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 8023854: 29 67 00 00 lw r7,(r11+0) 8023858: 29 81 00 00 lw r1,(r12+0) print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 802385c: 34 84 ff ff addi r4,r4,-1 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 8023860: 78 02 08 06 mvhi r2,0x806 8023864: 38 42 43 e0 ori r2,r2,0x43e0 8023868: b4 64 20 00 add r4,r3,r4 802386c: ba 20 28 00 mv r5,r17 8023870: b9 c0 30 00 mv r6,r14 8023874: d8 e0 00 00 call r7 stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 8023878: 78 01 08 06 mvhi r1,0x806 802387c: 38 21 ea 78 ori r1,r1,0xea78 8023880: 28 21 00 00 lw r1,(r1+0) 8023884: 44 20 00 25 be r1,r0,8023918 <== NEVER TAKEN (*print_handler)( print_context, "Unavailable\n" ); } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 8023888: 29 64 00 00 lw r4,(r11+0) 802388c: 29 81 00 00 lw r1,(r12+0) 8023890: 78 02 08 06 mvhi r2,0x806 8023894: 38 42 44 10 ori r2,r2,0x4410 8023898: b9 e0 18 00 mv r3,r15 802389c: d8 80 00 00 call r4 } } 80238a0: 2b 9d 00 04 lw ra,(sp+4) 80238a4: 2b 8b 00 28 lw r11,(sp+40) 80238a8: 2b 8c 00 24 lw r12,(sp+36) 80238ac: 2b 8d 00 20 lw r13,(sp+32) 80238b0: 2b 8e 00 1c lw r14,(sp+28) 80238b4: 2b 8f 00 18 lw r15,(sp+24) 80238b8: 2b 90 00 14 lw r16,(sp+20) 80238bc: 2b 91 00 10 lw r17,(sp+16) 80238c0: 2b 92 00 0c lw r18,(sp+12) 80238c4: 2b 93 00 08 lw r19,(sp+8) 80238c8: 37 9c 00 30 addi sp,sp,48 80238cc: c3 a0 00 00 ret * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) if (*base != U32_PATTERN) 80238d0: 28 47 00 00 lw r7,(r2+0) 80238d4: 44 e3 ff c9 be r7,r3,80237f8 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; 80238d8: 34 0f 00 00 mvi r15,0 low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) 80238dc: 44 40 ff ca be r2,r0,8023804 <== NEVER TAKEN used = Stack_check_Calculate_used( low, size, high_water_mark ); 80238e0: b4 ce 78 00 add r15,r6,r14 80238e4: c9 e2 78 00 sub r15,r15,r2 else used = 0; #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) 80238e8: 5c 20 ff c8 bne r1,r0,8023808 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 ); 80238ec: 78 0b 08 06 mvhi r11,0x806 80238f0: 78 0c 08 06 mvhi r12,0x806 80238f4: 39 6b ea 74 ori r11,r11,0xea74 80238f8: 39 8c ea 70 ori r12,r12,0xea70 80238fc: 29 64 00 00 lw r4,(r11+0) 8023900: 29 81 00 00 lw r1,(r12+0) 8023904: 78 02 08 06 mvhi r2,0x806 8023908: 38 42 43 d0 ori r2,r2,0x43d0 802390c: 34 03 ff ff mvi r3,-1 8023910: d8 80 00 00 call r4 8023914: e3 ff ff ce bi 802384c current, size ); if (Stack_check_Initialized == 0) { (*print_handler)( print_context, "Unavailable\n" ); 8023918: 29 63 00 00 lw r3,(r11+0) <== NOT EXECUTED 802391c: 29 81 00 00 lw r1,(r12+0) <== NOT EXECUTED 8023920: 78 02 08 06 mvhi r2,0x806 <== NOT EXECUTED 8023924: 38 42 44 00 ori r2,r2,0x4400 <== NOT EXECUTED 8023928: d8 60 00 00 call r3 <== NOT EXECUTED 802392c: e3 ff ff dd bi 80238a0 <== NOT EXECUTED /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { if (!Stack_check_Interrupt_stack.area) 8023930: 78 0d 08 06 mvhi r13,0x806 8023934: 39 ad fa a4 ori r13,r13,0xfaa4 8023938: 29 a7 00 04 lw r7,(r13+4) return; stack = &Stack_check_Interrupt_stack; the_thread = 0; current = 0; 802393c: 34 11 00 00 mvi r17,0 #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { if (!Stack_check_Interrupt_stack.area) return; stack = &Stack_check_Interrupt_stack; the_thread = 0; 8023940: 34 01 00 00 mvi r1,0 /* * Obtain interrupt stack information */ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if (the_thread == (Thread_Control *) -1) { if (!Stack_check_Interrupt_stack.area) 8023944: 5c e0 ff 9d bne r7,r0,80237b8 <== ALWAYS TAKEN 8023948: e3 ff ff d6 bi 80238a0 <== NOT EXECUTED =============================================================================== 08023a60 : Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 8023a60: 37 9c ff d0 addi sp,sp,-48 8023a64: 5b 8b 00 10 sw (sp+16),r11 8023a68: 5b 8c 00 0c sw (sp+12),r12 8023a6c: 5b 8d 00 08 sw (sp+8),r13 8023a70: 5b 9d 00 04 sw (sp+4),ra 8023a74: b8 20 58 00 mv r11,r1 Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); char name[32]; printk("BLOWN STACK!!!\n"); 8023a78: 78 01 08 06 mvhi r1,0x806 8023a7c: 38 21 44 18 ori r1,r1,0x4418 Thread_Control *running, bool pattern_ok ) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; void Stack_check_report_blown_task(Thread_Control *running, bool pattern_ok) { 8023a80: 20 4c 00 ff andi r12,r2,0xff Stack_Control *stack = &running->Start.Initial_stack; void *pattern_area = Stack_check_Get_pattern(stack); 8023a84: 29 6d 00 b8 lw r13,(r11+184) char name[32]; printk("BLOWN STACK!!!\n"); 8023a88: fb ff 79 ab calli 8002134 printk("task control block: 0x%08" PRIxPTR "\n", running); 8023a8c: 78 01 08 06 mvhi r1,0x806 8023a90: 38 21 44 28 ori r1,r1,0x4428 8023a94: b9 60 10 00 mv r2,r11 8023a98: fb ff 79 a7 calli 8002134 printk("task ID: 0x%08lx\n", (unsigned long) running->Object.id); 8023a9c: 29 62 00 08 lw r2,(r11+8) 8023aa0: 78 01 08 06 mvhi r1,0x806 8023aa4: 38 21 44 44 ori r1,r1,0x4444 8023aa8: fb ff 79 a3 calli 8002134 printk( 8023aac: 29 62 00 0c lw r2,(r11+12) 8023ab0: 78 01 08 06 mvhi r1,0x806 8023ab4: 38 21 44 58 ori r1,r1,0x4458 8023ab8: fb ff 79 9f calli 8002134 "task name: 0x%08" PRIx32 "\n", running->Object.name.name_u32 ); printk( 8023abc: 29 61 00 08 lw r1,(r11+8) 8023ac0: 37 83 00 14 addi r3,sp,20 8023ac4: 34 02 00 20 mvi r2,32 8023ac8: fb ff a5 11 calli 800cf0c 8023acc: b8 20 10 00 mv r2,r1 8023ad0: 78 01 08 06 mvhi r1,0x806 8023ad4: 38 21 44 6c ori r1,r1,0x446c 8023ad8: fb ff 79 97 calli 8002134 ); printk( "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) 8023adc: 29 63 00 b8 lw r3,(r11+184) 8023ae0: 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( 8023ae4: 78 01 08 06 mvhi r1,0x806 8023ae8: 38 21 44 84 ori r1,r1,0x4484 8023aec: b4 62 20 00 add r4,r3,r2 8023af0: fb ff 79 91 calli 8002134 "task stack area (%lu Bytes): 0x%08" PRIxPTR " .. 0x%08" PRIxPTR "\n", (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) ); if (!pattern_ok) { 8023af4: 45 80 00 04 be r12,r0,8023b04 <== ALWAYS TAKEN rtems_configuration_get_user_multiprocessing_table()->node ); } #endif rtems_fatal( 8023af8: 29 62 00 0c lw r2,(r11+12) 8023afc: 34 01 00 09 mvi r1,9 8023b00: fb ff 80 42 calli 8003c08 (unsigned long) stack->size, stack->area, ((char *) stack->area + stack->size) ); if (!pattern_ok) { printk( 8023b04: 78 01 08 06 mvhi r1,0x806 8023b08: 38 21 44 b4 ori r1,r1,0x44b4 8023b0c: 34 02 00 10 mvi r2,16 8023b10: 35 a3 00 08 addi r3,r13,8 8023b14: 35 a4 00 18 addi r4,r13,24 8023b18: fb ff 79 87 calli 8002134 8023b1c: e3 ff ff f7 bi 8023af8 =============================================================================== 0800473c <_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); 800473c: 28 22 00 00 lw r2,(r1+0) 8004740: 44 40 00 02 be r2,r0,8004748 <_API_extensions_Add_post_switch+0xc> 8004744: c3 a0 00 00 ret 8004748: 28 23 00 04 lw r3,(r1+4) 800474c: 5c 62 ff fe bne r3,r2,8004744 <_API_extensions_Add_post_switch+0x8><== NEVER TAKEN Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 8004750: 78 02 08 02 mvhi r2,0x802 8004754: 38 42 09 c8 ori r2,r2,0x9c8 8004758: 28 44 00 08 lw r4,(r2+8) the_node->next = tail; 800475c: 78 03 08 02 mvhi r3,0x802 8004760: 38 63 09 cc ori r3,r3,0x9cc 8004764: 58 23 00 00 sw (r1+0),r3 tail->previous = the_node; 8004768: 58 41 00 08 sw (r2+8),r1 old_last->next = the_node; 800476c: 58 81 00 00 sw (r4+0),r1 the_node->previous = old_last; 8004770: 58 24 00 04 sw (r1+4),r4 8004774: c3 a0 00 00 ret =============================================================================== 08004778 <_API_extensions_Run_postdriver>: } } #endif void _API_extensions_Run_postdriver( void ) { 8004778: 37 9c ff f4 addi sp,sp,-12 800477c: 5b 8b 00 0c sw (sp+12),r11 8004780: 5b 8c 00 08 sw (sp+8),r12 8004784: 5b 9d 00 04 sw (sp+4),ra #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); } } 8004788: 78 01 08 02 mvhi r1,0x802 800478c: 38 21 0a 88 ori r1,r1,0xa88 8004790: 28 2b 00 00 lw r11,(r1+0) void _API_extensions_Run_postdriver( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 8004794: 78 0c 08 02 mvhi r12,0x802 8004798: 39 8c 0a 8c ori r12,r12,0xa8c 800479c: 45 6c 00 05 be r11,r12,80047b0 <_API_extensions_Run_postdriver+0x38><== NEVER TAKEN * Currently all APIs configure this hook so it is always non-NULL. */ #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); 80047a0: 29 61 00 08 lw r1,(r11+8) 80047a4: d8 20 00 00 call r1 Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { 80047a8: 29 6b 00 00 lw r11,(r11+0) void _API_extensions_Run_postdriver( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 80047ac: 5d 6c ff fd bne r11,r12,80047a0 <_API_extensions_Run_postdriver+0x28> #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); } } 80047b0: 2b 9d 00 04 lw ra,(sp+4) 80047b4: 2b 8b 00 0c lw r11,(sp+12) 80047b8: 2b 8c 00 08 lw r12,(sp+8) 80047bc: 37 9c 00 0c addi sp,sp,12 80047c0: c3 a0 00 00 ret =============================================================================== 08006fe8 <_CORE_RWLock_Release>: #include CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 8006fe8: 37 9c ff f4 addi sp,sp,-12 8006fec: 5b 8b 00 0c sw (sp+12),r11 8006ff0: 5b 8c 00 08 sw (sp+8),r12 8006ff4: 5b 9d 00 04 sw (sp+4),ra ISR_Level level; Thread_Control *executing = _Thread_Executing; 8006ff8: 78 02 08 01 mvhi r2,0x801 8006ffc: 38 42 9d a0 ori r2,r2,0x9da0 8007000: 28 43 00 10 lw r3,(r2+16) #include CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 8007004: b8 20 58 00 mv r11,r1 * 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 ); 8007008: 90 00 08 00 rcsr r1,IE 800700c: 34 02 ff fe mvi r2,-2 8007010: a0 22 10 00 and r2,r1,r2 8007014: d0 02 00 00 wcsr IE,r2 if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 8007018: 29 62 00 44 lw r2,(r11+68) 800701c: 44 40 00 2f be r2,r0,80070d8 <_CORE_RWLock_Release+0xf0> _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 8007020: 34 04 00 01 mvi r4,1 8007024: 44 44 00 22 be r2,r4,80070ac <_CORE_RWLock_Release+0xc4> return CORE_RWLOCK_SUCCESSFUL; } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 8007028: 58 60 00 34 sw (r3+52),r0 /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 800702c: 59 60 00 44 sw (r11+68),r0 _ISR_Enable( level ); 8007030: d0 01 00 00 wcsr IE,r1 next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 8007034: b9 60 08 00 mv r1,r11 8007038: f8 00 08 a5 calli 80092cc <_Thread_queue_Dequeue> if ( next ) { 800703c: 44 20 00 16 be r1,r0,8007094 <_CORE_RWLock_Release+0xac> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 8007040: 28 22 00 30 lw r2,(r1+48) 8007044: 34 01 00 01 mvi r1,1 8007048: 44 41 00 2d be r2,r1,80070fc <_CORE_RWLock_Release+0x114> } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 800704c: 29 62 00 48 lw r2,(r11+72) the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 8007050: 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 || 8007054: 34 0c 00 01 mvi r12,1 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 8007058: 34 41 00 01 addi r1,r2,1 800705c: 59 61 00 48 sw (r11+72),r1 8007060: e0 00 00 07 bi 800707c <_CORE_RWLock_Release+0x94> /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); if ( !next || 8007064: 28 63 00 30 lw r3,(r3+48) 8007068: 44 6c 00 0b be r3,r12,8007094 <_CORE_RWLock_Release+0xac> <== NEVER TAKEN next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 800706c: 29 63 00 48 lw r3,(r11+72) 8007070: 34 63 00 01 addi r3,r3,1 8007074: 59 63 00 48 sw (r11+72),r3 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 8007078: f8 00 09 bd calli 800976c <_Thread_queue_Extract> /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 800707c: b9 60 08 00 mv r1,r11 8007080: f8 00 0a 09 calli 80098a4 <_Thread_queue_First> 8007084: b8 20 18 00 mv r3,r1 if ( !next || next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 8007088: b8 20 10 00 mv r2,r1 800708c: b9 60 08 00 mv r1,r11 /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); if ( !next || 8007090: 5c 60 ff f5 bne r3,r0,8007064 <_CORE_RWLock_Release+0x7c> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 8007094: 34 01 00 00 mvi r1,0 8007098: 2b 9d 00 04 lw ra,(sp+4) 800709c: 2b 8b 00 0c lw r11,(sp+12) 80070a0: 2b 8c 00 08 lw r12,(sp+8) 80070a4: 37 9c 00 0c addi sp,sp,12 80070a8: c3 a0 00 00 ret _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { the_rwlock->number_of_readers -= 1; 80070ac: 29 62 00 48 lw r2,(r11+72) 80070b0: 34 42 ff ff addi r2,r2,-1 80070b4: 59 62 00 48 sw (r11+72),r2 if ( the_rwlock->number_of_readers != 0 ) { 80070b8: 44 40 ff dc be r2,r0,8007028 <_CORE_RWLock_Release+0x40> /* must be unlocked again */ _ISR_Enable( level ); 80070bc: d0 01 00 00 wcsr IE,r1 } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 80070c0: 34 01 00 00 mvi r1,0 80070c4: 2b 9d 00 04 lw ra,(sp+4) 80070c8: 2b 8b 00 0c lw r11,(sp+12) 80070cc: 2b 8c 00 08 lw r12,(sp+8) 80070d0: 37 9c 00 0c addi sp,sp,12 80070d4: c3 a0 00 00 ret * If any thread is waiting, then we wait. */ _ISR_Disable( level ); if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ _ISR_Enable( level ); 80070d8: d0 01 00 00 wcsr IE,r1 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 80070dc: 34 01 00 02 mvi r1,2 80070e0: 58 61 00 34 sw (r3+52),r1 } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 80070e4: 34 01 00 00 mvi r1,0 80070e8: 2b 9d 00 04 lw ra,(sp+4) 80070ec: 2b 8b 00 0c lw r11,(sp+12) 80070f0: 2b 8c 00 08 lw r12,(sp+8) 80070f4: 37 9c 00 0c addi sp,sp,12 80070f8: c3 a0 00 00 ret next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); if ( next ) { if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 80070fc: 34 01 00 02 mvi r1,2 8007100: 59 61 00 44 sw (r11+68),r1 return CORE_RWLOCK_SUCCESSFUL; 8007104: e3 ff ff e4 bi 8007094 <_CORE_RWLock_Release+0xac> =============================================================================== 08007108 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 8007108: 37 9c ff f8 addi sp,sp,-8 800710c: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 8007110: 37 82 00 08 addi r2,sp,8 8007114: f8 00 07 6b calli 8008ec0 <_Thread_Get> switch ( location ) { 8007118: 2b 82 00 08 lw r2,(sp+8) 800711c: 5c 40 00 07 bne r2,r0,8007138 <_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 ); 8007120: f8 00 0a 1f calli 800999c <_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; 8007124: 78 01 08 01 mvhi r1,0x801 8007128: 38 21 99 08 ori r1,r1,0x9908 800712c: 28 22 00 00 lw r2,(r1+0) --level; 8007130: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 8007134: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 8007138: 2b 9d 00 04 lw ra,(sp+4) 800713c: 37 9c 00 08 addi sp,sp,8 8007140: c3 a0 00 00 ret =============================================================================== 0800f690 <_CORE_message_queue_Initialize>: CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 800f690: 37 9c ff e8 addi sp,sp,-24 800f694: 5b 8b 00 18 sw (sp+24),r11 800f698: 5b 8c 00 14 sw (sp+20),r12 800f69c: 5b 8d 00 10 sw (sp+16),r13 800f6a0: 5b 8e 00 0c sw (sp+12),r14 800f6a4: 5b 8f 00 08 sw (sp+8),r15 800f6a8: 5b 9d 00 04 sw (sp+4),ra 800f6ac: b8 20 58 00 mv r11,r1 size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; the_message_queue->number_of_pending_messages = 0; 800f6b0: 58 20 00 48 sw (r1+72),r0 the_message_queue->maximum_message_size = maximum_message_size; 800f6b4: 58 24 00 4c sw (r1+76),r4 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 800f6b8: 58 20 00 60 sw (r1+96),r0 the_message_queue->notify_argument = the_argument; 800f6bc: 58 20 00 64 sw (r1+100),r0 ) { size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 800f6c0: 59 63 00 44 sw (r11+68),r3 /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 800f6c4: 20 81 00 03 andi r1,r4,0x3 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 800f6c8: b8 60 60 00 mv r12,r3 800f6cc: b8 40 78 00 mv r15,r2 /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 800f6d0: b8 80 28 00 mv r5,r4 800f6d4: 44 20 00 06 be r1,r0,800f6ec <_CORE_message_queue_Initialize+0x5c> allocated_message_size += sizeof(uintptr_t); 800f6d8: 34 85 00 04 addi r5,r4,4 allocated_message_size &= ~(sizeof(uintptr_t) - 1); 800f6dc: 34 01 ff fc mvi r1,-4 800f6e0: a0 a1 28 00 and r5,r5,r1 /* * Check for an overflow. It can occur while increasing allocated_message_size * to multiplicity of uintptr_t above. */ if (allocated_message_size < maximum_message_size) return false; 800f6e4: 34 0d 00 00 mvi r13,0 /* * Check for an overflow. It can occur while increasing allocated_message_size * to multiplicity of uintptr_t above. */ if (allocated_message_size < maximum_message_size) 800f6e8: 54 85 00 1f bgu r4,r5,800f764 <_CORE_message_queue_Initialize+0xd4> /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ if ( !size_t_mult32_with_overflow( 800f6ec: 34 ae 00 14 addi r14,r5,20 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 800f6f0: 34 01 00 00 mvi r1,0 800f6f4: b9 c0 10 00 mv r2,r14 800f6f8: 34 03 00 00 mvi r3,0 800f6fc: b9 80 20 00 mv r4,r12 800f700: f8 00 48 05 calli 8021714 <__muldi3> */ if ( !size_t_mult32_with_overflow( (size_t) maximum_pending_messages, allocated_message_size + sizeof(CORE_message_queue_Buffer_control), &message_buffering_required ) ) return false; 800f704: 34 0d 00 00 mvi r13,0 size_t *c ) { long long x = (long long)a*b; if ( x > SIZE_MAX ) 800f708: 48 20 00 17 bg r1,r0,800f764 <_CORE_message_queue_Initialize+0xd4> /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 800f70c: b8 40 08 00 mv r1,r2 800f710: f8 00 0e f4 calli 80132e0 <_Workspace_Allocate> return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 800f714: 59 61 00 5c sw (r11+92),r1 _Workspace_Allocate( message_buffering_required ); 800f718: b8 20 18 00 mv r3,r1 if (the_message_queue->message_buffers == 0) 800f71c: 44 20 00 12 be r1,r0,800f764 <_CORE_message_queue_Initialize+0xd4><== NEVER TAKEN /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 800f720: b8 60 10 00 mv r2,r3 800f724: 35 61 00 68 addi r1,r11,104 800f728: b9 80 18 00 mv r3,r12 800f72c: b9 c0 20 00 mv r4,r14 800f730: fb ff ff b7 calli 800f60c <_Chain_Initialize> RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 800f734: 35 62 00 54 addi r2,r11,84 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 800f738: 35 61 00 50 addi r1,r11,80 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; tail->previous = head; 800f73c: 59 61 00 58 sw (r11+88),r1 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 800f740: 59 62 00 50 sw (r11+80),r2 head->previous = NULL; 800f744: 59 60 00 54 sw (r11+84),r0 allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 800f748: 29 e2 00 00 lw r2,(r15+0) 800f74c: b9 60 08 00 mv r1,r11 800f750: 34 03 00 80 mvi r3,128 800f754: 64 42 00 01 cmpei r2,r2,1 800f758: 34 04 00 06 mvi r4,6 800f75c: f8 00 0c 34 calli 801282c <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 800f760: 34 0d 00 01 mvi r13,1 } 800f764: b9 a0 08 00 mv r1,r13 800f768: 2b 9d 00 04 lw ra,(sp+4) 800f76c: 2b 8b 00 18 lw r11,(sp+24) 800f770: 2b 8c 00 14 lw r12,(sp+20) 800f774: 2b 8d 00 10 lw r13,(sp+16) 800f778: 2b 8e 00 0c lw r14,(sp+12) 800f77c: 2b 8f 00 08 lw r15,(sp+8) 800f780: 37 9c 00 18 addi sp,sp,24 800f784: c3 a0 00 00 ret =============================================================================== 08004dd0 <_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 ) { 8004dd0: 37 9c ff f8 addi sp,sp,-8 8004dd4: 5b 8b 00 08 sw (sp+8),r11 8004dd8: 5b 9d 00 04 sw (sp+4),ra 8004ddc: 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)) ) { 8004de0: f8 00 08 a4 calli 8007070 <_Thread_queue_Dequeue> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 8004de4: 34 02 00 00 mvi r2,0 if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 8004de8: 44 20 00 06 be r1,r0,8004e00 <_CORE_semaphore_Surrender+0x30> status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 8004dec: b8 40 08 00 mv r1,r2 8004df0: 2b 9d 00 04 lw ra,(sp+4) 8004df4: 2b 8b 00 08 lw r11,(sp+8) 8004df8: 37 9c 00 08 addi sp,sp,8 8004dfc: c3 a0 00 00 ret if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 8004e00: 90 00 08 00 rcsr r1,IE 8004e04: 34 02 ff fe mvi r2,-2 8004e08: a0 22 10 00 and r2,r1,r2 8004e0c: d0 02 00 00 wcsr IE,r2 if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 8004e10: 29 63 00 48 lw r3,(r11+72) 8004e14: 29 64 00 40 lw r4,(r11+64) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 8004e18: 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 ) 8004e1c: 50 64 00 04 bgeu r3,r4,8004e2c <_CORE_semaphore_Surrender+0x5c><== NEVER TAKEN the_semaphore->count += 1; 8004e20: 34 63 00 01 addi r3,r3,1 8004e24: 59 63 00 48 sw (r11+72),r3 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 8004e28: 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 ); 8004e2c: d0 01 00 00 wcsr IE,r1 } return status; } 8004e30: b8 40 08 00 mv r1,r2 8004e34: 2b 9d 00 04 lw ra,(sp+4) 8004e38: 2b 8b 00 08 lw r11,(sp+8) 8004e3c: 37 9c 00 08 addi sp,sp,8 8004e40: c3 a0 00 00 ret =============================================================================== 08004970 <_Chain_Initialize>: Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 8004970: 37 9c ff f0 addi sp,sp,-16 8004974: 5b 8b 00 10 sw (sp+16),r11 8004978: 5b 8c 00 0c sw (sp+12),r12 800497c: 5b 8d 00 08 sw (sp+8),r13 8004980: 5b 9d 00 04 sw (sp+4),ra Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; 8004984: 58 20 00 04 sw (r1+4),r0 Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 8004988: b8 20 58 00 mv r11,r1 800498c: b8 40 60 00 mv r12,r2 size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8004990: 34 2d 00 04 addi r13,r1,4 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 8004994: 44 60 00 10 be r3,r0,80049d4 <_Chain_Initialize+0x64> <== NEVER TAKEN 8004998: 34 63 ff ff addi r3,r3,-1 800499c: b8 60 10 00 mv r2,r3 { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; Chain_Node *next = starting_address; 80049a0: b9 80 28 00 mv r5,r12 ) { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; 80049a4: b9 60 30 00 mv r6,r11 80049a8: e0 00 00 04 bi 80049b8 <_Chain_Initialize+0x48> Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 80049ac: b8 a0 30 00 mv r6,r5 80049b0: 34 63 ff ff addi r3,r3,-1 current->next = next; next->previous = current; current = next; next = (Chain_Node *) 80049b4: b8 e0 28 00 mv r5,r7 Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { current->next = next; 80049b8: 58 c5 00 00 sw (r6+0),r5 next->previous = current; 80049bc: 58 a6 00 04 sw (r5+4),r6 #include #include #include #include void _Chain_Initialize( 80049c0: b4 a4 38 00 add r7,r5,r4 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 80049c4: 5c 60 ff fa bne r3,r0,80049ac <_Chain_Initialize+0x3c> #include #include #include #include void _Chain_Initialize( 80049c8: b8 80 08 00 mv r1,r4 80049cc: f8 00 5d 2a calli 801be74 <__mulsi3> Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 80049d0: b5 81 08 00 add r1,r12,r1 current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = tail; 80049d4: 58 2d 00 00 sw (r1+0),r13 tail->previous = current; 80049d8: 59 61 00 08 sw (r11+8),r1 } 80049dc: 2b 9d 00 04 lw ra,(sp+4) 80049e0: 2b 8b 00 10 lw r11,(sp+16) 80049e4: 2b 8c 00 0c lw r12,(sp+12) 80049e8: 2b 8d 00 08 lw r13,(sp+8) 80049ec: 37 9c 00 10 addi sp,sp,16 80049f0: c3 a0 00 00 ret =============================================================================== 0800ec9c <_Event_Seize>: Thread_Control *executing, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 800ec9c: 37 9c ff f0 addi sp,sp,-16 800eca0: 5b 8b 00 0c sw (sp+12),r11 800eca4: 5b 8c 00 08 sw (sp+8),r12 800eca8: 5b 9d 00 04 sw (sp+4),ra rtems_event_set seized_events; rtems_event_set pending_events; ISR_Level level; Thread_blocking_operation_States current_sync_state; executing->Wait.return_code = RTEMS_SUCCESSFUL; 800ecac: 58 a0 00 34 sw (r5+52),r0 Thread_Control *executing, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 800ecb0: b8 a0 58 00 mv r11,r5 800ecb4: b8 e0 60 00 mv r12,r7 ISR_Level level; Thread_blocking_operation_States current_sync_state; executing->Wait.return_code = RTEMS_SUCCESSFUL; _ISR_Disable( level ); 800ecb8: 90 00 48 00 rcsr r9,IE 800ecbc: 34 05 ff fe mvi r5,-2 800ecc0: a1 25 28 00 and r5,r9,r5 800ecc4: d0 05 00 00 wcsr IE,r5 pending_events = event->pending_events; 800ecc8: 28 c7 00 00 lw r7,(r6+0) 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 ); 800eccc: a0 27 28 00 and r5,r1,r7 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 800ecd0: 44 a0 00 04 be r5,r0,800ece0 <_Event_Seize+0x44> 800ecd4: 44 25 00 27 be r1,r5,800ed70 <_Event_Seize+0xd4> */ RTEMS_INLINE_ROUTINE bool _Options_Is_any ( rtems_option option_set ) { return (option_set & RTEMS_EVENT_ANY) ? true : false; 800ecd8: 20 4a 00 02 andi r10,r2,0x2 (seized_events == event_in || _Options_Is_any( option_set )) ) { 800ecdc: 5d 40 00 25 bne r10,r0,800ed70 <_Event_Seize+0xd4> */ RTEMS_INLINE_ROUTINE bool _Options_Is_no_wait ( rtems_option option_set ) { return (option_set & RTEMS_NO_WAIT) ? true : false; 800ece0: 20 46 00 01 andi r6,r2,0x1 _ISR_Enable( level ); *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 800ece4: 5c c0 00 1a bne r6,r0,800ed4c <_Event_Seize+0xb0> * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = option_set; executing->Wait.count = event_in; 800ece8: 59 61 00 24 sw (r11+36),r1 * set properly when we are marked as in the event critical section. * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = option_set; 800ecec: 59 62 00 30 sw (r11+48),r2 executing->Wait.count = event_in; executing->Wait.return_argument = event_out; 800ecf0: 59 64 00 28 sw (r11+40),r4 *sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 800ecf4: 34 01 00 01 mvi r1,1 800ecf8: 59 81 00 00 sw (r12+0),r1 _ISR_Enable( level ); 800ecfc: d0 09 00 00 wcsr IE,r9 if ( ticks ) { 800ed00: 5c 60 00 2c bne r3,r0,800edb0 <_Event_Seize+0x114> sync_state ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, wait_state ); 800ed04: b9 60 08 00 mv r1,r11 800ed08: b9 00 10 00 mv r2,r8 800ed0c: fb ff e6 d6 calli 8008864 <_Thread_Set_state> _ISR_Disable( level ); 800ed10: 90 00 18 00 rcsr r3,IE 800ed14: 34 01 ff fe mvi r1,-2 800ed18: a0 61 08 00 and r1,r3,r1 800ed1c: d0 01 00 00 wcsr IE,r1 current_sync_state = *sync_state; 800ed20: 29 81 00 00 lw r1,(r12+0) *sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( current_sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 800ed24: 34 02 00 01 mvi r2,1 _Thread_Set_state( executing, wait_state ); _ISR_Disable( level ); current_sync_state = *sync_state; *sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 800ed28: 59 80 00 00 sw (r12+0),r0 if ( current_sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 800ed2c: 44 22 00 1b be r1,r2,800ed98 <_Event_Seize+0xfc> <== ALWAYS TAKEN * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Entering with interrupts disabled and returning with interrupts * enabled! */ _Thread_blocking_operation_Cancel( current_sync_state, executing, level ); 800ed30: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 800ed34: f8 00 05 40 calli 8010234 <_Thread_blocking_operation_Cancel><== NOT EXECUTED } 800ed38: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800ed3c: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED 800ed40: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED 800ed44: 37 9c 00 10 addi sp,sp,16 <== NOT EXECUTED 800ed48: c3 a0 00 00 ret <== NOT EXECUTED *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { _ISR_Enable( level ); 800ed4c: d0 09 00 00 wcsr IE,r9 executing->Wait.return_code = RTEMS_UNSATISFIED; 800ed50: 34 01 00 0d mvi r1,13 800ed54: 59 61 00 34 sw (r11+52),r1 *event_out = seized_events; 800ed58: 58 85 00 00 sw (r4+0),r5 * * WARNING! Entering with interrupts disabled and returning with interrupts * enabled! */ _Thread_blocking_operation_Cancel( current_sync_state, executing, level ); } 800ed5c: 2b 9d 00 04 lw ra,(sp+4) 800ed60: 2b 8b 00 0c lw r11,(sp+12) 800ed64: 2b 8c 00 08 lw r12,(sp+8) 800ed68: 37 9c 00 10 addi sp,sp,16 800ed6c: c3 a0 00 00 ret 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) ); 800ed70: a4 a0 08 00 not r1,r5 800ed74: a0 27 38 00 and r7,r1,r7 pending_events = event->pending_events; seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && (seized_events == event_in || _Options_Is_any( option_set )) ) { event->pending_events = 800ed78: 58 c7 00 00 sw (r6+0),r7 _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 800ed7c: d0 09 00 00 wcsr IE,r9 *event_out = seized_events; 800ed80: 58 85 00 00 sw (r4+0),r5 * * WARNING! Entering with interrupts disabled and returning with interrupts * enabled! */ _Thread_blocking_operation_Cancel( current_sync_state, executing, level ); } 800ed84: 2b 9d 00 04 lw ra,(sp+4) 800ed88: 2b 8b 00 0c lw r11,(sp+12) 800ed8c: 2b 8c 00 08 lw r12,(sp+8) 800ed90: 37 9c 00 10 addi sp,sp,16 800ed94: c3 a0 00 00 ret _ISR_Disable( level ); current_sync_state = *sync_state; *sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( current_sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { _ISR_Enable( level ); 800ed98: d0 03 00 00 wcsr IE,r3 * * WARNING! Entering with interrupts disabled and returning with interrupts * enabled! */ _Thread_blocking_operation_Cancel( current_sync_state, executing, level ); } 800ed9c: 2b 9d 00 04 lw ra,(sp+4) 800eda0: 2b 8b 00 0c lw r11,(sp+12) 800eda4: 2b 8c 00 08 lw r12,(sp+8) 800eda8: 37 9c 00 10 addi sp,sp,16 800edac: c3 a0 00 00 ret *sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; _ISR_Enable( level ); if ( ticks ) { _Watchdog_Initialize( 800edb0: 29 62 00 08 lw r2,(r11+8) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 800edb4: 78 01 08 00 mvhi r1,0x800 800edb8: 38 21 ef 98 ori r1,r1,0xef98 800edbc: 59 61 00 64 sw (r11+100),r1 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800edc0: 78 01 08 01 mvhi r1,0x801 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 800edc4: 59 62 00 68 sw (r11+104),r2 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 800edc8: 59 60 00 50 sw (r11+80),r0 the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 800edcc: 59 6c 00 6c sw (r11+108),r12 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 800edd0: 59 63 00 54 sw (r11+84),r3 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800edd4: 38 21 aa 10 ori r1,r1,0xaa10 800edd8: 35 62 00 48 addi r2,r11,72 800eddc: 5b 88 00 10 sw (sp+16),r8 800ede0: fb ff e7 b9 calli 8008cc4 <_Watchdog_Insert> 800ede4: 2b 88 00 10 lw r8,(sp+16) 800ede8: e3 ff ff c7 bi 800ed04 <_Event_Seize+0x68> =============================================================================== 0800a400 <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 800a400: 37 9c ff f4 addi sp,sp,-12 800a404: 5b 8b 00 0c sw (sp+12),r11 800a408: 5b 8c 00 08 sw (sp+8),r12 800a40c: 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; 800a410: 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 ) { 800a414: 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 ); 800a418: 90 00 08 00 rcsr r1,IE 800a41c: 34 09 ff fe mvi r9,-2 800a420: a0 29 48 00 and r9,r1,r9 800a424: 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; 800a428: 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; 800a42c: 29 68 00 24 lw r8,(r11+36) 800a430: b8 46 10 00 or r2,r2,r6 800a434: 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 ); 800a438: 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 ) ) { 800a43c: 44 c0 00 32 be r6,r0,800a504 <_Event_Surrender+0x104> /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 800a440: 78 07 08 02 mvhi r7,0x802 800a444: 38 e7 0d e0 ori r7,r7,0xde0 800a448: 28 ec 00 08 lw r12,(r7+8) 800a44c: 45 80 00 03 be r12,r0,800a458 <_Event_Surrender+0x58> 800a450: 28 e7 00 10 lw r7,(r7+16) 800a454: 45 67 00 1d be r11,r7,800a4c8 <_Event_Surrender+0xc8> <== NEVER TAKEN RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 800a458: 29 64 00 10 lw r4,(r11+16) 800a45c: 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 ) ) { 800a460: 44 a0 00 29 be r5,r0,800a504 <_Event_Surrender+0x104> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 800a464: 45 06 00 03 be r8,r6,800a470 <_Event_Surrender+0x70> */ RTEMS_INLINE_ROUTINE bool _Options_Is_any ( rtems_option option_set ) { return (option_set & RTEMS_EVENT_ANY) ? true : false; 800a468: 21 4a 00 02 andi r10,r10,0x2 800a46c: 45 40 00 26 be r10,r0,800a504 <_Event_Surrender+0x104> <== NEVER TAKEN RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 800a470: a4 c0 20 00 not r4,r6 event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800a474: 29 65 00 28 lw r5,(r11+40) 800a478: a0 82 10 00 and r2,r4,r2 /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { event->pending_events = _Event_sets_Clear( 800a47c: 58 62 00 00 sw (r3+0),r2 pending_events, seized_events ); the_thread->Wait.count = 0; 800a480: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800a484: 58 a6 00 00 sw (r5+0),r6 _ISR_Flash( level ); 800a488: d0 01 00 00 wcsr IE,r1 800a48c: d0 09 00 00 wcsr IE,r9 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 800a490: 29 63 00 50 lw r3,(r11+80) 800a494: 34 02 00 02 mvi r2,2 800a498: 44 62 00 21 be r3,r2,800a51c <_Event_Surrender+0x11c> _ISR_Enable( level ); 800a49c: d0 01 00 00 wcsr IE,r1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800a4a0: 78 01 08 01 mvhi r1,0x801 800a4a4: 38 21 dc 0c ori r1,r1,0xdc0c 800a4a8: 28 22 00 00 lw r2,(r1+0) 800a4ac: b9 60 08 00 mv r1,r11 800a4b0: f8 00 02 da calli 800b018 <_Thread_Clear_state> } return; } } _ISR_Enable( level ); } 800a4b4: 2b 9d 00 04 lw ra,(sp+4) 800a4b8: 2b 8b 00 0c lw r11,(sp+12) 800a4bc: 2b 8c 00 08 lw r12,(sp+8) 800a4c0: 37 9c 00 0c addi sp,sp,12 800a4c4: c3 a0 00 00 ret * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 800a4c8: 28 8c 00 00 lw r12,(r4+0) <== NOT EXECUTED /* * 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 ) && 800a4cc: 34 07 00 01 mvi r7,1 <== NOT EXECUTED ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 800a4d0: 35 8c ff ff addi r12,r12,-1 <== NOT EXECUTED /* * 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 ) && 800a4d4: 55 87 ff e1 bgu r12,r7,800a458 <_Event_Surrender+0x58> <== NOT EXECUTED ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 800a4d8: 45 06 00 03 be r8,r6,800a4e4 <_Event_Surrender+0xe4> <== NOT EXECUTED 800a4dc: 21 4a 00 02 andi r10,r10,0x2 <== NOT EXECUTED 800a4e0: 45 40 00 09 be r10,r0,800a504 <_Event_Surrender+0x104> <== NOT EXECUTED 800a4e4: a4 c0 38 00 not r7,r6 <== NOT EXECUTED event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800a4e8: 29 65 00 28 lw r5,(r11+40) <== NOT EXECUTED 800a4ec: a0 e2 10 00 and r2,r7,r2 <== NOT EXECUTED if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { event->pending_events = _Event_sets_Clear( 800a4f0: 58 62 00 00 sw (r3+0),r2 <== NOT EXECUTED pending_events, seized_events ); the_thread->Wait.count = 0; 800a4f4: 59 60 00 24 sw (r11+36),r0 <== NOT EXECUTED *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800a4f8: 58 a6 00 00 sw (r5+0),r6 <== NOT EXECUTED *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 800a4fc: 34 02 00 03 mvi r2,3 <== NOT EXECUTED 800a500: 58 82 00 00 sw (r4+0),r2 <== NOT EXECUTED _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 800a504: d0 01 00 00 wcsr IE,r1 } 800a508: 2b 9d 00 04 lw ra,(sp+4) 800a50c: 2b 8b 00 0c lw r11,(sp+12) 800a510: 2b 8c 00 08 lw r12,(sp+8) 800a514: 37 9c 00 0c addi sp,sp,12 800a518: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 800a51c: 34 02 00 03 mvi r2,3 800a520: 59 62 00 50 sw (r11+80),r2 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 800a524: d0 01 00 00 wcsr IE,r1 (void) _Watchdog_Remove( &the_thread->Timer ); 800a528: 35 61 00 48 addi r1,r11,72 800a52c: fb ff f5 e9 calli 8007cd0 <_Watchdog_Remove> 800a530: 78 03 08 01 mvhi r3,0x801 800a534: 38 63 dc 0c ori r3,r3,0xdc0c 800a538: 28 62 00 00 lw r2,(r3+0) 800a53c: b9 60 08 00 mv r1,r11 800a540: f8 00 02 b6 calli 800b018 <_Thread_Clear_state> 800a544: e3 ff ff f1 bi 800a508 <_Event_Surrender+0x108> =============================================================================== 0800ef98 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 800ef98: 37 9c ff f4 addi sp,sp,-12 800ef9c: 5b 8b 00 08 sw (sp+8),r11 800efa0: 5b 9d 00 04 sw (sp+4),ra 800efa4: 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 ); 800efa8: 37 82 00 0c addi r2,sp,12 800efac: fb ff e3 91 calli 8007df0 <_Thread_Get> switch ( location ) { 800efb0: 2b 82 00 0c lw r2,(sp+12) 800efb4: 44 40 00 05 be r2,r0,800efc8 <_Event_Timeout+0x30> <== ALWAYS TAKEN case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800efb8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800efbc: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 800efc0: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 800efc4: c3 a0 00 00 ret <== NOT EXECUTED * * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ _ISR_Disable( level ); 800efc8: 90 00 20 00 rcsr r4,IE 800efcc: 34 03 ff fe mvi r3,-2 800efd0: a0 83 18 00 and r3,r4,r3 800efd4: d0 03 00 00 wcsr IE,r3 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800efd8: 78 03 08 01 mvhi r3,0x801 800efdc: 38 63 ae 00 ori r3,r3,0xae00 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 800efe0: 28 63 00 10 lw r3,(r3+16) _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 800efe4: 58 20 00 24 sw (r1+36),r0 if ( _Thread_Is_executing( the_thread ) ) { 800efe8: 44 23 00 11 be r1,r3,800f02c <_Event_Timeout+0x94> <== NEVER TAKEN if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 800efec: 34 02 00 06 mvi r2,6 800eff0: 58 22 00 34 sw (r1+52),r2 _ISR_Enable( level ); 800eff4: d0 04 00 00 wcsr IE,r4 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800eff8: 78 03 08 01 mvhi r3,0x801 800effc: 38 63 96 90 ori r3,r3,0x9690 800f000: 28 62 00 00 lw r2,(r3+0) 800f004: f8 00 04 a4 calli 8010294 <_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; 800f008: 78 01 08 01 mvhi r1,0x801 800f00c: 38 21 a9 78 ori r1,r1,0xa978 800f010: 28 22 00 00 lw r2,(r1+0) --level; 800f014: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 800f018: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800f01c: 2b 9d 00 04 lw ra,(sp+4) 800f020: 2b 8b 00 08 lw r11,(sp+8) 800f024: 37 9c 00 0c addi sp,sp,12 800f028: c3 a0 00 00 ret } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800f02c: 29 63 00 00 lw r3,(r11+0) <== NOT EXECUTED 800f030: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 800f034: 5c 62 ff ee bne r3,r2,800efec <_Event_Timeout+0x54> <== NOT EXECUTED *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800f038: 34 02 00 02 mvi r2,2 <== NOT EXECUTED 800f03c: 59 62 00 00 sw (r11+0),r2 <== NOT EXECUTED 800f040: e3 ff ff eb bi 800efec <_Event_Timeout+0x54> <== NOT EXECUTED =============================================================================== 0800ab2c <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 800ab2c: 37 9c ff bc addi sp,sp,-68 800ab30: 5b 8b 00 44 sw (sp+68),r11 800ab34: 5b 8c 00 40 sw (sp+64),r12 800ab38: 5b 8d 00 3c sw (sp+60),r13 800ab3c: 5b 8e 00 38 sw (sp+56),r14 800ab40: 5b 8f 00 34 sw (sp+52),r15 800ab44: 5b 90 00 30 sw (sp+48),r16 800ab48: 5b 91 00 2c sw (sp+44),r17 800ab4c: 5b 92 00 28 sw (sp+40),r18 800ab50: 5b 93 00 24 sw (sp+36),r19 800ab54: 5b 94 00 20 sw (sp+32),r20 800ab58: 5b 95 00 1c sw (sp+28),r21 800ab5c: 5b 96 00 18 sw (sp+24),r22 800ab60: 5b 97 00 14 sw (sp+20),r23 800ab64: 5b 98 00 10 sw (sp+16),r24 800ab68: 5b 99 00 0c sw (sp+12),r25 800ab6c: 5b 9b 00 08 sw (sp+8),fp 800ab70: 5b 9d 00 04 sw (sp+4),ra Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE 800ab74: 34 54 00 04 addi r20,r2,4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 800ab78: b8 20 78 00 mv r15,r1 Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_ALLOC_BONUS; uintptr_t const page_size = heap->page_size; 800ab7c: 28 37 00 10 lw r23,(r1+16) Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 800ab80: b8 40 70 00 mv r14,r2 800ab84: b8 60 80 00 mv r16,r3 800ab88: b8 80 90 00 mv r18,r4 uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { /* Integer overflow occured */ return NULL; 800ab8c: 34 01 00 00 mvi r1,0 Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { 800ab90: 54 54 00 5b bgu r2,r20,800acfc <_Heap_Allocate_aligned_with_boundary+0x1d0> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 800ab94: 5c 80 00 6f bne r4,r0,800ad50 <_Heap_Allocate_aligned_with_boundary+0x224> if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 800ab98: 29 ec 00 08 lw r12,(r15+8) do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 800ab9c: 34 01 00 00 mvi r1,0 800aba0: 45 ec 00 57 be r15,r12,800acfc <_Heap_Allocate_aligned_with_boundary+0x1d0> uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 800aba4: 34 18 00 04 mvi r24,4 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 800aba8: 34 11 00 01 mvi r17,1 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 800abac: 34 1b ff fe mvi fp,-2 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 800abb0: 36 f9 00 07 addi r25,r23,7 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 800abb4: cb 0e c0 00 sub r24,r24,r14 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 800abb8: 29 81 00 04 lw r1,(r12+4) 800abbc: 52 81 00 3b bgeu r20,r1,800aca8 <_Heap_Allocate_aligned_with_boundary+0x17c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 800abc0: 35 8b 00 08 addi r11,r12,8 if ( alignment == 0 ) { 800abc4: 46 00 00 3e be r16,r0,800acbc <_Heap_Allocate_aligned_with_boundary+0x190> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 800abc8: a0 3b 68 00 and r13,r1,fp if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 800abcc: 29 f5 00 14 lw r21,(r15+20) uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 800abd0: b5 8d 68 00 add r13,r12,r13 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; uintptr_t alloc_begin = alloc_end - alloc_size; 800abd4: b7 0d 58 00 add r11,r24,r13 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 800abd8: cb 35 18 00 sub r3,r25,r21 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800abdc: b9 60 08 00 mv r1,r11 800abe0: ba 00 10 00 mv r2,r16 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 800abe4: b4 6d 68 00 add r13,r3,r13 800abe8: f8 00 45 18 calli 801c048 <__umodsi3> 800abec: c9 61 58 00 sub r11,r11,r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 800abf0: 35 96 00 08 addi r22,r12,8 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 800abf4: 51 ab 00 05 bgeu r13,r11,800ac08 <_Heap_Allocate_aligned_with_boundary+0xdc> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800abf8: b9 a0 08 00 mv r1,r13 800abfc: ba 00 10 00 mv r2,r16 800ac00: f8 00 45 12 calli 801c048 <__umodsi3> 800ac04: c9 a1 58 00 sub r11,r13,r1 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 800ac08: 46 40 00 1c be r18,r0,800ac78 <_Heap_Allocate_aligned_with_boundary+0x14c> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 800ac0c: b5 6e 68 00 add r13,r11,r14 800ac10: b9 a0 08 00 mv r1,r13 800ac14: ba 40 10 00 mv r2,r18 800ac18: f8 00 45 0c calli 801c048 <__umodsi3> 800ac1c: c9 a1 28 00 sub r5,r13,r1 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 800ac20: f5 a5 68 00 cmpgu r13,r13,r5 800ac24: f4 ab 08 00 cmpgu r1,r5,r11 800ac28: a1 a1 68 00 and r13,r13,r1 800ac2c: 45 a0 00 13 be r13,r0,800ac78 <_Heap_Allocate_aligned_with_boundary+0x14c> alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 800ac30: b6 ce 98 00 add r19,r22,r14 uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 800ac34: 56 65 00 1d bgu r19,r5,800aca8 <_Heap_Allocate_aligned_with_boundary+0x17c> 800ac38: e0 00 00 02 bi 800ac40 <_Heap_Allocate_aligned_with_boundary+0x114> 800ac3c: 56 65 00 1b bgu r19,r5,800aca8 <_Heap_Allocate_aligned_with_boundary+0x17c><== NEVER TAKEN return 0; } alloc_begin = boundary_line - alloc_size; 800ac40: c8 ae 58 00 sub r11,r5,r14 800ac44: ba 00 10 00 mv r2,r16 800ac48: b9 60 08 00 mv r1,r11 800ac4c: f8 00 44 ff calli 801c048 <__umodsi3> 800ac50: c9 61 58 00 sub r11,r11,r1 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 800ac54: b5 6e 68 00 add r13,r11,r14 800ac58: b9 a0 08 00 mv r1,r13 800ac5c: ba 40 10 00 mv r2,r18 800ac60: f8 00 44 fa calli 801c048 <__umodsi3> 800ac64: c9 a1 28 00 sub r5,r13,r1 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 800ac68: f5 a5 68 00 cmpgu r13,r13,r5 800ac6c: f4 ab 08 00 cmpgu r1,r5,r11 800ac70: a1 a1 68 00 and r13,r13,r1 800ac74: 5d a0 ff f2 bne r13,r0,800ac3c <_Heap_Allocate_aligned_with_boundary+0x110> boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { 800ac78: 56 cb 00 0c bgu r22,r11,800aca8 <_Heap_Allocate_aligned_with_boundary+0x17c> 800ac7c: 34 01 ff f8 mvi r1,-8 800ac80: c8 2c 68 00 sub r13,r1,r12 800ac84: ba e0 10 00 mv r2,r23 800ac88: b9 60 08 00 mv r1,r11 800ac8c: f8 00 44 ef calli 801c048 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800ac90: b5 ab 68 00 add r13,r13,r11 uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; 800ac94: c9 a1 08 00 sub r1,r13,r1 if ( free_size >= min_block_size || free_size == 0 ) { 800ac98: 64 22 00 00 cmpei r2,r1,0 800ac9c: f0 35 a8 00 cmpgeu r21,r1,r21 800aca0: b8 55 08 00 or r1,r2,r21 800aca4: 5c 20 00 06 bne r1,r0,800acbc <_Heap_Allocate_aligned_with_boundary+0x190> if ( alloc_begin != 0 ) { break; } block = block->next; 800aca8: 29 8c 00 08 lw r12,(r12+8) 800acac: 36 21 00 01 addi r1,r17,1 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 800acb0: 45 ec 00 26 be r15,r12,800ad48 <_Heap_Allocate_aligned_with_boundary+0x21c> 800acb4: b8 20 88 00 mv r17,r1 800acb8: e3 ff ff c0 bi 800abb8 <_Heap_Allocate_aligned_with_boundary+0x8c> } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { 800acbc: 45 60 ff fb be r11,r0,800aca8 <_Heap_Allocate_aligned_with_boundary+0x17c><== NEVER TAKEN search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 800acc0: 29 e3 00 48 lw r3,(r15+72) stats->searches += search_count; 800acc4: 29 e2 00 4c lw r2,(r15+76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 800acc8: b9 e0 08 00 mv r1,r15 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 800accc: 34 63 00 01 addi r3,r3,1 stats->searches += search_count; 800acd0: b4 51 10 00 add r2,r2,r17 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 800acd4: 59 e3 00 48 sw (r15+72),r3 stats->searches += search_count; 800acd8: 59 e2 00 4c sw (r15+76),r2 block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 800acdc: b9 60 18 00 mv r3,r11 800ace0: b9 80 10 00 mv r2,r12 800ace4: b9 c0 20 00 mv r4,r14 800ace8: fb ff e9 91 calli 800532c <_Heap_Block_allocate> 800acec: b9 60 08 00 mv r1,r11 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 800acf0: 29 e2 00 44 lw r2,(r15+68) 800acf4: 50 51 00 02 bgeu r2,r17,800acfc <_Heap_Allocate_aligned_with_boundary+0x1d0> stats->max_search = search_count; 800acf8: 59 f1 00 44 sw (r15+68),r17 } return (void *) alloc_begin; } 800acfc: 2b 9d 00 04 lw ra,(sp+4) 800ad00: 2b 8b 00 44 lw r11,(sp+68) 800ad04: 2b 8c 00 40 lw r12,(sp+64) 800ad08: 2b 8d 00 3c lw r13,(sp+60) 800ad0c: 2b 8e 00 38 lw r14,(sp+56) 800ad10: 2b 8f 00 34 lw r15,(sp+52) 800ad14: 2b 90 00 30 lw r16,(sp+48) 800ad18: 2b 91 00 2c lw r17,(sp+44) 800ad1c: 2b 92 00 28 lw r18,(sp+40) 800ad20: 2b 93 00 24 lw r19,(sp+36) 800ad24: 2b 94 00 20 lw r20,(sp+32) 800ad28: 2b 95 00 1c lw r21,(sp+28) 800ad2c: 2b 96 00 18 lw r22,(sp+24) 800ad30: 2b 97 00 14 lw r23,(sp+20) 800ad34: 2b 98 00 10 lw r24,(sp+16) 800ad38: 2b 99 00 0c lw r25,(sp+12) 800ad3c: 2b 9b 00 08 lw fp,(sp+8) 800ad40: 37 9c 00 44 addi sp,sp,68 800ad44: c3 a0 00 00 ret do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 800ad48: 34 01 00 00 mvi r1,0 800ad4c: e3 ff ff e9 bi 800acf0 <_Heap_Allocate_aligned_with_boundary+0x1c4> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { 800ad50: 54 44 ff eb bgu r2,r4,800acfc <_Heap_Allocate_aligned_with_boundary+0x1d0> return NULL; } if ( alignment == 0 ) { 800ad54: 5c 60 ff 91 bne r3,r0,800ab98 <_Heap_Allocate_aligned_with_boundary+0x6c> alignment = page_size; 800ad58: ba e0 80 00 mv r16,r23 800ad5c: e3 ff ff 8f bi 800ab98 <_Heap_Allocate_aligned_with_boundary+0x6c> =============================================================================== 0800a7e0 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { 800a7e0: 37 9c ff bc addi sp,sp,-68 800a7e4: 5b 8b 00 3c sw (sp+60),r11 800a7e8: 5b 8c 00 38 sw (sp+56),r12 800a7ec: 5b 8d 00 34 sw (sp+52),r13 800a7f0: 5b 8e 00 30 sw (sp+48),r14 800a7f4: 5b 8f 00 2c sw (sp+44),r15 800a7f8: 5b 90 00 28 sw (sp+40),r16 800a7fc: 5b 91 00 24 sw (sp+36),r17 800a800: 5b 92 00 20 sw (sp+32),r18 800a804: 5b 93 00 1c sw (sp+28),r19 800a808: 5b 94 00 18 sw (sp+24),r20 800a80c: 5b 95 00 14 sw (sp+20),r21 800a810: 5b 96 00 10 sw (sp+16),r22 800a814: 5b 97 00 0c sw (sp+12),r23 800a818: 5b 98 00 08 sw (sp+8),r24 800a81c: 5b 9d 00 04 sw (sp+4),ra Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; 800a820: 5b 80 00 44 sw (sp+68),r0 Heap_Block *extend_last_block = NULL; 800a824: 5b 80 00 40 sw (sp+64),r0 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; 800a828: b4 43 70 00 add r14,r2,r3 Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { 800a82c: b8 40 68 00 mv r13,r2 800a830: b8 20 58 00 mv r11,r1 Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 800a834: 28 30 00 20 lw r16,(r1+32) Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; 800a838: 28 32 00 10 lw r18,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 800a83c: 28 24 00 14 lw r4,(r1+20) uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; 800a840: 28 37 00 30 lw r23,(r1+48) uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { return 0; 800a844: 34 0c 00 00 mvi r12,0 uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 800a848: 54 4e 00 72 bgu r2,r14,800aa10 <_Heap_Extend+0x230> return 0; } extend_area_ok = _Heap_Get_first_and_last_block( 800a84c: b8 40 08 00 mv r1,r2 800a850: 37 85 00 44 addi r5,sp,68 800a854: b8 60 10 00 mv r2,r3 800a858: 37 86 00 40 addi r6,sp,64 800a85c: ba 40 18 00 mv r3,r18 800a860: fb ff e9 3c calli 8004d50 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 800a864: 44 20 00 6b be r1,r0,800aa10 <_Heap_Extend+0x230> 800a868: ba 00 60 00 mv r12,r16 800a86c: 34 16 00 00 mvi r22,0 800a870: 34 18 00 00 mvi r24,0 800a874: 34 11 00 00 mvi r17,0 800a878: 34 14 00 00 mvi r20,0 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 800a87c: 34 15 ff fe mvi r21,-2 800a880: e0 00 00 0d bi 800a8b4 <_Heap_Extend+0xd4> return 0; } if ( extend_area_end == sub_area_begin ) { merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 800a884: 55 ee 00 77 bgu r15,r14,800aa60 <_Heap_Extend+0x280> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800a888: b9 e0 08 00 mv r1,r15 800a88c: ba 40 10 00 mv r2,r18 800a890: 35 f3 ff f8 addi r19,r15,-8 800a894: f8 00 22 23 calli 8013120 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800a898: ca 61 08 00 sub r1,r19,r1 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 800a89c: 45 af 00 15 be r13,r15,800a8f0 <_Heap_Extend+0x110> start_block->prev_size = extend_area_end; merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 800a8a0: 55 af 00 6e bgu r13,r15,800aa58 <_Heap_Extend+0x278> } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 800a8a4: 28 2c 00 04 lw r12,(r1+4) 800a8a8: a2 ac 60 00 and r12,r21,r12 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800a8ac: b4 2c 60 00 add r12,r1,r12 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 800a8b0: 46 0c 00 16 be r16,r12,800a908 <_Heap_Extend+0x128> return 0; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 800a8b4: b9 80 08 00 mv r1,r12 800a8b8: 45 90 00 6c be r12,r16,800aa68 <_Heap_Extend+0x288> uintptr_t const sub_area_end = start_block->prev_size; 800a8bc: 29 8f 00 00 lw r15,(r12+0) Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin 800a8c0: f5 c1 28 00 cmpgu r5,r14,r1 800a8c4: f5 ed 20 00 cmpgu r4,r15,r13 (uintptr_t) start_block : heap->area_begin; uintptr_t const sub_area_end = start_block->prev_size; Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 800a8c8: a0 a4 20 00 and r4,r5,r4 800a8cc: 5c 80 00 71 bne r4,r0,800aa90 <_Heap_Extend+0x2b0> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return 0; } if ( extend_area_end == sub_area_begin ) { 800a8d0: 5c 2e ff ed bne r1,r14,800a884 <_Heap_Extend+0xa4> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800a8d4: b9 e0 08 00 mv r1,r15 800a8d8: ba 40 10 00 mv r2,r18 800a8dc: 35 f3 ff f8 addi r19,r15,-8 800a8e0: f8 00 22 10 calli 8013120 <__umodsi3> 800a8e4: b9 80 a0 00 mv r20,r12 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800a8e8: ca 61 08 00 sub r1,r19,r1 merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 800a8ec: 5d af ff ed bne r13,r15,800a8a0 <_Heap_Extend+0xc0> <== ALWAYS TAKEN start_block->prev_size = extend_area_end; 800a8f0: 59 8e 00 00 sw (r12+0),r14 } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 800a8f4: 28 2c 00 04 lw r12,(r1+4) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 800a8f8: b8 20 88 00 mv r17,r1 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 800a8fc: a2 ac 60 00 and r12,r21,r12 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800a900: b4 2c 60 00 add r12,r1,r12 } else if ( sub_area_end < extend_area_begin ) { link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 800a904: 5e 0c ff ec bne r16,r12,800a8b4 <_Heap_Extend+0xd4> <== NEVER TAKEN if ( extend_area_begin < heap->area_begin ) { 800a908: 29 61 00 18 lw r1,(r11+24) 800a90c: 51 a1 00 5d bgeu r13,r1,800aa80 <_Heap_Extend+0x2a0> heap->area_begin = extend_area_begin; 800a910: 59 6d 00 18 sw (r11+24),r13 } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 800a914: 2b 81 00 40 lw r1,(sp+64) 800a918: 2b 82 00 44 lw r2,(sp+68) extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 800a91c: 29 65 00 20 lw r5,(r11+32) heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 800a920: c8 22 18 00 sub r3,r1,r2 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 800a924: 38 64 00 01 ori r4,r3,0x1 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; 800a928: 58 4e 00 00 sw (r2+0),r14 extend_first_block->size_and_flag = 800a92c: 58 44 00 04 sw (r2+4),r4 extend_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; 800a930: 58 23 00 00 sw (r1+0),r3 extend_last_block->size_and_flag = 0; 800a934: 58 20 00 04 sw (r1+4),r0 _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 800a938: 50 45 00 4e bgeu r2,r5,800aa70 <_Heap_Extend+0x290> heap->first_block = extend_first_block; 800a93c: 59 62 00 20 sw (r11+32),r2 } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { 800a940: 46 80 00 66 be r20,r0,800aad8 <_Heap_Extend+0x2f8> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 800a944: 29 6c 00 10 lw r12,(r11+16) uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); 800a948: 35 ad 00 08 addi r13,r13,8 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 800a94c: b9 a0 08 00 mv r1,r13 800a950: b9 80 10 00 mv r2,r12 800a954: f8 00 21 f3 calli 8013120 <__umodsi3> if ( remainder != 0 ) { 800a958: 44 20 00 03 be r1,r0,800a964 <_Heap_Extend+0x184> return value - remainder + alignment; 800a95c: b5 ac 68 00 add r13,r13,r12 800a960: c9 a1 68 00 sub r13,r13,r1 uintptr_t const new_first_block_begin = 800a964: 35 a2 ff f8 addi r2,r13,-8 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 800a968: 2a 83 00 00 lw r3,(r20+0) uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = 800a96c: ca 82 08 00 sub r1,r20,r2 first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 800a970: 38 21 00 01 ori r1,r1,0x1 800a974: 58 41 00 04 sw (r2+4),r1 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 800a978: 59 a3 ff f8 sw (r13+-8),r3 new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Free_block( heap, new_first_block ); 800a97c: b9 60 08 00 mv r1,r11 800a980: fb ff ff 7e calli 800a778 <_Heap_Free_block> link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 800a984: 46 20 00 45 be r17,r0,800aa98 <_Heap_Extend+0x2b8> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800a988: 29 62 00 10 lw r2,(r11+16) ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE, 800a98c: 35 ce ff f8 addi r14,r14,-8 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( 800a990: c9 d1 70 00 sub r14,r14,r17 800a994: b9 c0 08 00 mv r1,r14 800a998: f8 00 21 e2 calli 8013120 <__umodsi3> ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) 800a99c: 2a 22 00 04 lw r2,(r17+4) 800a9a0: c9 c1 70 00 sub r14,r14,r1 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 800a9a4: b5 d1 08 00 add r1,r14,r17 (last_block->size_and_flag - last_block_new_size) 800a9a8: c8 4e 10 00 sub r2,r2,r14 | HEAP_PREV_BLOCK_USED; 800a9ac: 38 42 00 01 ori r2,r2,0x1 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 800a9b0: 58 22 00 04 sw (r1+4),r2 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 800a9b4: 2a 23 00 04 lw r3,(r17+4) (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 800a9b8: b9 60 08 00 mv r1,r11 800a9bc: ba 20 10 00 mv r2,r17 800a9c0: 20 63 00 01 andi r3,r3,0x1 block->size_and_flag = size | flag; 800a9c4: b9 c3 70 00 or r14,r14,r3 800a9c8: 5a 2e 00 04 sw (r17+4),r14 800a9cc: fb ff ff 6b calli 800a778 <_Heap_Free_block> extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 800a9d0: 66 31 00 00 cmpei r17,r17,0 800a9d4: 66 94 00 00 cmpei r20,r20,0 800a9d8: a2 34 88 00 and r17,r17,r20 800a9dc: 5e 20 00 3b bne r17,r0,800aac8 <_Heap_Extend+0x2e8> /* Statistics */ stats->size += extended_size; return extended_size; } 800a9e0: 29 61 00 24 lw r1,(r11+36) * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 800a9e4: 29 63 00 20 lw r3,(r11+32) _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 800a9e8: 29 6c 00 30 lw r12,(r11+48) RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 800a9ec: 28 22 00 04 lw r2,(r1+4) /* Statistics */ stats->size += extended_size; 800a9f0: 29 64 00 2c lw r4,(r11+44) * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 800a9f4: c8 61 18 00 sub r3,r3,r1 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 800a9f8: 20 42 00 01 andi r2,r2,0x1 block->size_and_flag = size | flag; 800a9fc: b8 62 10 00 or r2,r3,r2 _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 800aa00: c9 97 60 00 sub r12,r12,r23 800aa04: 58 22 00 04 sw (r1+4),r2 /* Statistics */ stats->size += extended_size; 800aa08: b4 8c 08 00 add r1,r4,r12 800aa0c: 59 61 00 2c sw (r11+44),r1 return extended_size; } 800aa10: b9 80 08 00 mv r1,r12 800aa14: 2b 9d 00 04 lw ra,(sp+4) 800aa18: 2b 8b 00 3c lw r11,(sp+60) 800aa1c: 2b 8c 00 38 lw r12,(sp+56) 800aa20: 2b 8d 00 34 lw r13,(sp+52) 800aa24: 2b 8e 00 30 lw r14,(sp+48) 800aa28: 2b 8f 00 2c lw r15,(sp+44) 800aa2c: 2b 90 00 28 lw r16,(sp+40) 800aa30: 2b 91 00 24 lw r17,(sp+36) 800aa34: 2b 92 00 20 lw r18,(sp+32) 800aa38: 2b 93 00 1c lw r19,(sp+28) 800aa3c: 2b 94 00 18 lw r20,(sp+24) 800aa40: 2b 95 00 14 lw r21,(sp+20) 800aa44: 2b 96 00 10 lw r22,(sp+16) 800aa48: 2b 97 00 0c lw r23,(sp+12) 800aa4c: 2b 98 00 08 lw r24,(sp+8) 800aa50: 37 9c 00 44 addi sp,sp,68 800aa54: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 800aa58: b8 20 b0 00 mv r22,r1 800aa5c: e3 ff ff 92 bi 800a8a4 <_Heap_Extend+0xc4> return 0; } if ( extend_area_end == sub_area_begin ) { merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 800aa60: b9 80 c0 00 mv r24,r12 800aa64: e3 ff ff 89 bi 800a888 <_Heap_Extend+0xa8> return 0; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 800aa68: 29 61 00 18 lw r1,(r11+24) 800aa6c: e3 ff ff 94 bi 800a8bc <_Heap_Extend+0xdc> extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { heap->first_block = extend_first_block; } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 800aa70: 29 62 00 24 lw r2,(r11+36) 800aa74: 50 41 ff b3 bgeu r2,r1,800a940 <_Heap_Extend+0x160> heap->last_block = extend_last_block; 800aa78: 59 61 00 24 sw (r11+36),r1 800aa7c: e3 ff ff b1 bi 800a940 <_Heap_Extend+0x160> start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); if ( extend_area_begin < heap->area_begin ) { heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { 800aa80: 29 61 00 1c lw r1,(r11+28) 800aa84: 50 2e ff a4 bgeu r1,r14,800a914 <_Heap_Extend+0x134> <== NEVER TAKEN heap->area_end = extend_area_end; 800aa88: 59 6e 00 1c sw (r11+28),r14 800aa8c: e3 ff ff a2 bi 800a914 <_Heap_Extend+0x134> _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return 0; 800aa90: 34 0c 00 00 mvi r12,0 800aa94: e3 ff ff df bi 800aa10 <_Heap_Extend+0x230> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 800aa98: 46 d1 ff ce be r22,r17,800a9d0 <_Heap_Extend+0x1f0> RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 800aa9c: 2a c3 00 04 lw r3,(r22+4) ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 800aaa0: 2b 82 00 44 lw r2,(sp+68) } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { _Heap_Link_above( 800aaa4: 2b 81 00 40 lw r1,(sp+64) 800aaa8: 20 63 00 01 andi r3,r3,0x1 ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 800aaac: c8 56 10 00 sub r2,r2,r22 block->size_and_flag = size | flag; 800aab0: b8 43 10 00 or r2,r2,r3 800aab4: 5a c2 00 04 sw (r22+4),r2 last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 800aab8: 28 22 00 04 lw r2,(r1+4) 800aabc: 38 42 00 01 ori r2,r2,0x1 800aac0: 58 22 00 04 sw (r1+4),r2 800aac4: e3 ff ff c3 bi 800a9d0 <_Heap_Extend+0x1f0> extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { _Heap_Free_block( heap, extend_first_block ); 800aac8: 2b 82 00 44 lw r2,(sp+68) 800aacc: b9 60 08 00 mv r1,r11 800aad0: fb ff ff 2a calli 800a778 <_Heap_Free_block> 800aad4: e3 ff ff c3 bi 800a9e0 <_Heap_Extend+0x200> heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { 800aad8: 47 14 ff ab be r24,r20,800a984 <_Heap_Extend+0x1a4> { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; 800aadc: cb 01 c0 00 sub r24,r24,r1 800aae0: 3b 18 00 01 ori r24,r24,0x1 ) { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = 800aae4: 58 38 00 04 sw (r1+4),r24 800aae8: e3 ff ff a7 bi 800a984 <_Heap_Extend+0x1a4> =============================================================================== 0800ad60 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 800ad60: 37 9c ff f4 addi sp,sp,-12 800ad64: 5b 8b 00 0c sw (sp+12),r11 800ad68: 5b 8c 00 08 sw (sp+8),r12 800ad6c: 5b 9d 00 04 sw (sp+4),ra 800ad70: b8 20 58 00 mv r11,r1 800ad74: b8 40 18 00 mv r3,r2 * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { return true; 800ad78: 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 ) { 800ad7c: 44 40 00 4b be r2,r0,800aea8 <_Heap_Free+0x148> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800ad80: 29 62 00 10 lw r2,(r11+16) 800ad84: b8 60 08 00 mv r1,r3 800ad88: 34 6c ff f8 addi r12,r3,-8 800ad8c: f8 00 44 af calli 801c048 <__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 800ad90: 29 64 00 20 lw r4,(r11+32) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800ad94: c9 81 10 00 sub r2,r12,r1 alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { return false; 800ad98: 34 01 00 00 mvi r1,0 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 800ad9c: 54 82 00 43 bgu r4,r2,800aea8 <_Heap_Free+0x148> 800ada0: 29 65 00 24 lw r5,(r11+36) 800ada4: 54 45 00 41 bgu r2,r5,800aea8 <_Heap_Free+0x148> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800ada8: 28 48 00 04 lw r8,(r2+4) - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 800adac: 34 07 ff fe mvi r7,-2 800adb0: a1 07 30 00 and r6,r8,r7 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800adb4: b4 46 18 00 add r3,r2,r6 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 800adb8: 54 83 00 3c bgu r4,r3,800aea8 <_Heap_Free+0x148> <== NEVER TAKEN 800adbc: 54 65 00 3b bgu r3,r5,800aea8 <_Heap_Free+0x148> <== NEVER TAKEN 800adc0: 28 69 00 04 lw r9,(r3+4) block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 800adc4: 21 2a 00 01 andi r10,r9,0x1 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 800adc8: 45 40 00 38 be r10,r0,800aea8 <_Heap_Free+0x148> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 800adcc: a1 27 48 00 and r9,r9,r7 return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 800add0: 34 07 00 00 mvi r7,0 800add4: 44 a3 00 05 be r5,r3,800ade8 <_Heap_Free+0x88> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800add8: b4 69 08 00 add r1,r3,r9 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 800addc: 28 27 00 04 lw r7,(r1+4) 800ade0: 20 e7 00 01 andi r7,r7,0x1 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 800ade4: 18 e7 00 01 xori r7,r7,0x1 800ade8: 21 08 00 01 andi r8,r8,0x1 next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 800adec: 5d 00 00 19 bne r8,r0,800ae50 <_Heap_Free+0xf0> uintptr_t const prev_size = block->prev_size; 800adf0: 28 4a 00 00 lw r10,(r2+0) Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { _HAssert( false ); return( false ); 800adf4: 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); 800adf8: c8 4a 10 00 sub r2,r2,r10 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 800adfc: 54 82 00 2b bgu r4,r2,800aea8 <_Heap_Free+0x148> <== NEVER TAKEN 800ae00: b9 00 08 00 mv r1,r8 800ae04: 54 45 00 29 bgu r2,r5,800aea8 <_Heap_Free+0x148> <== NEVER TAKEN block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 800ae08: 28 44 00 04 lw r4,(r2+4) 800ae0c: 20 84 00 01 andi r4,r4,0x1 } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { 800ae10: 44 80 00 26 be r4,r0,800aea8 <_Heap_Free+0x148> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 800ae14: 44 e0 00 3d be r7,r0,800af08 <_Heap_Free+0x1a8> uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 800ae18: 29 64 00 38 lw r4,(r11+56) --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800ae1c: 28 61 00 08 lw r1,(r3+8) 800ae20: 28 63 00 0c lw r3,(r3+12) _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 800ae24: b4 c9 48 00 add r9,r6,r9 800ae28: b5 2a 50 00 add r10,r9,r10 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 800ae2c: 58 61 00 08 sw (r3+8),r1 next->prev = prev; 800ae30: 58 23 00 0c sw (r1+12),r3 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 800ae34: 34 81 ff ff addi r1,r4,-1 800ae38: 59 61 00 38 sw (r11+56),r1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800ae3c: 39 43 00 01 ori r3,r10,0x1 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 800ae40: b4 4a 08 00 add r1,r2,r10 if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800ae44: 58 43 00 04 sw (r2+4),r3 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 800ae48: 58 2a 00 00 sw (r1+0),r10 800ae4c: e0 00 00 0d bi 800ae80 <_Heap_Free+0x120> uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 800ae50: 44 e0 00 1b be r7,r0,800aebc <_Heap_Free+0x15c> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800ae54: 28 64 00 08 lw r4,(r3+8) 800ae58: 28 61 00 0c lw r1,(r3+12) prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; 800ae5c: b5 26 48 00 add r9,r9,r6 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 800ae60: 58 44 00 08 sw (r2+8),r4 new_block->prev = prev; 800ae64: 58 41 00 0c sw (r2+12),r1 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800ae68: 39 25 00 01 ori r5,r9,0x1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 800ae6c: b4 49 18 00 add r3,r2,r9 next->prev = new_block; 800ae70: 58 82 00 0c sw (r4+12),r2 prev->next = new_block; 800ae74: 58 22 00 08 sw (r1+8),r2 next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800ae78: 58 45 00 04 sw (r2+4),r5 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 800ae7c: 58 69 00 00 sw (r3+0),r9 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 800ae80: 29 62 00 40 lw r2,(r11+64) ++stats->frees; 800ae84: 29 61 00 50 lw r1,(r11+80) stats->free_size += block_size; 800ae88: 29 63 00 30 lw r3,(r11+48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 800ae8c: 34 42 ff ff addi r2,r2,-1 ++stats->frees; 800ae90: 34 21 00 01 addi r1,r1,1 stats->free_size += block_size; 800ae94: b4 66 30 00 add r6,r3,r6 } } /* Statistics */ --stats->used_blocks; ++stats->frees; 800ae98: 59 61 00 50 sw (r11+80),r1 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 800ae9c: 59 62 00 40 sw (r11+64),r2 ++stats->frees; stats->free_size += block_size; 800aea0: 59 66 00 30 sw (r11+48),r6 return( true ); 800aea4: 34 01 00 01 mvi r1,1 } 800aea8: 2b 9d 00 04 lw ra,(sp+4) 800aeac: 2b 8b 00 0c lw r11,(sp+12) 800aeb0: 2b 8c 00 08 lw r12,(sp+8) 800aeb4: 37 9c 00 0c addi sp,sp,12 800aeb8: c3 a0 00 00 ret next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 800aebc: 38 c1 00 01 ori r1,r6,0x1 800aec0: 58 41 00 04 sw (r2+4),r1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800aec4: 28 67 00 04 lw r7,(r3+4) next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 800aec8: 29 61 00 38 lw r1,(r11+56) RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 800aecc: 29 64 00 08 lw r4,(r11+8) } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800aed0: 34 05 ff fe mvi r5,-2 new_block->next = next; new_block->prev = block_before; 800aed4: 58 4b 00 0c sw (r2+12),r11 800aed8: a0 e5 28 00 and r5,r7,r5 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { 800aedc: 29 67 00 3c lw r7,(r11+60) block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 800aee0: 34 21 00 01 addi r1,r1,1 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 800aee4: 58 44 00 08 sw (r2+8),r4 new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 800aee8: 58 82 00 0c sw (r4+12),r2 } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800aeec: 58 65 00 04 sw (r3+4),r5 next_block->prev_size = block_size; 800aef0: 58 66 00 00 sw (r3+0),r6 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 800aef4: 59 62 00 08 sw (r11+8),r2 /* Statistics */ ++stats->free_blocks; 800aef8: 59 61 00 38 sw (r11+56),r1 if ( stats->max_free_blocks < stats->free_blocks ) { 800aefc: 50 e1 ff e1 bgeu r7,r1,800ae80 <_Heap_Free+0x120> stats->max_free_blocks = stats->free_blocks; 800af00: 59 61 00 3c sw (r11+60),r1 800af04: e3 ff ff df bi 800ae80 <_Heap_Free+0x120> prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 800af08: b4 ca 50 00 add r10,r6,r10 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800af0c: 39 41 00 01 ori r1,r10,0x1 800af10: 58 41 00 04 sw (r2+4),r1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800af14: 28 62 00 04 lw r2,(r3+4) 800af18: 34 01 ff fe mvi r1,-2 next_block->prev_size = size; 800af1c: 58 6a 00 00 sw (r3+0),r10 _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800af20: a0 41 08 00 and r1,r2,r1 800af24: 58 61 00 04 sw (r3+4),r1 800af28: e3 ff ff d6 bi 800ae80 <_Heap_Free+0x120> =============================================================================== 080111cc <_Heap_Get_free_information>: info->number++; info->total += the_size; if ( info->largest < the_size ) info->largest = the_size; } } 80111cc: 28 23 00 08 lw r3,(r1+8) ) { Heap_Block *the_block; Heap_Block *const tail = _Heap_Free_list_tail(the_heap); info->number = 0; 80111d0: 58 40 00 00 sw (r2+0),r0 info->largest = 0; 80111d4: 58 40 00 04 sw (r2+4),r0 info->total = 0; 80111d8: 58 40 00 08 sw (r2+8),r0 for(the_block = _Heap_Free_list_first(the_heap); 80111dc: 44 23 00 12 be r1,r3,8011224 <_Heap_Get_free_information+0x58><== NEVER TAKEN 80111e0: 34 06 00 01 mvi r6,1 80111e4: 34 07 00 00 mvi r7,0 80111e8: 34 05 00 00 mvi r5,0 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 80111ec: 34 09 ff fe mvi r9,-2 80111f0: e0 00 00 03 bi 80111fc <_Heap_Get_free_information+0x30> 80111f4: 28 47 00 04 lw r7,(r2+4) 80111f8: b9 00 30 00 mv r6,r8 80111fc: 28 64 00 04 lw r4,(r3+4) the_block != tail; the_block = the_block->next) 8011200: 34 c8 00 01 addi r8,r6,1 8011204: a1 24 20 00 and r4,r9,r4 /* As we always coalesce free blocks, prev block must have been used. */ _HAssert(_Heap_Is_prev_used(the_block)); info->number++; info->total += the_size; 8011208: b4 a4 28 00 add r5,r5,r4 if ( info->largest < the_size ) 801120c: 50 e4 00 02 bgeu r7,r4,8011214 <_Heap_Get_free_information+0x48> info->largest = the_size; 8011210: 58 44 00 04 sw (r2+4),r4 info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); the_block != tail; the_block = the_block->next) 8011214: 28 63 00 08 lw r3,(r3+8) info->number = 0; info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); 8011218: 5c 23 ff f7 bne r1,r3,80111f4 <_Heap_Get_free_information+0x28> 801121c: 58 46 00 00 sw (r2+0),r6 8011220: 58 45 00 08 sw (r2+8),r5 8011224: c3 a0 00 00 ret =============================================================================== 08007228 <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 8007228: 37 9c ff e4 addi sp,sp,-28 800722c: 5b 8b 00 1c sw (sp+28),r11 8007230: 5b 8c 00 18 sw (sp+24),r12 8007234: 5b 8d 00 14 sw (sp+20),r13 8007238: 5b 8e 00 10 sw (sp+16),r14 800723c: 5b 8f 00 0c sw (sp+12),r15 8007240: 5b 90 00 08 sw (sp+8),r16 8007244: 5b 9d 00 04 sw (sp+4),ra Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *allocated_blocks = NULL; 8007248: 34 0d 00 00 mvi r13,0 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 800724c: b8 60 80 00 mv r16,r3 8007250: 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) { 8007254: 44 60 00 12 be r3,r0,800729c <_Heap_Greedy_allocate+0x74> 8007258: b8 40 70 00 mv r14,r2 800725c: 34 0b 00 00 mvi r11,0 * @brief See _Heap_Allocate_aligned_with_boundary() with alignment and * boundary equals zero. */ RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 8007260: 29 c2 00 00 lw r2,(r14+0) 8007264: 34 03 00 00 mvi r3,0 8007268: 34 04 00 00 mvi r4,0 800726c: b9 80 08 00 mv r1,r12 8007270: f8 00 24 5e calli 80103e8 <_Heap_Allocate_aligned_with_boundary> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8007274: 34 2f ff f8 addi r15,r1,-8 8007278: 35 6b 00 01 addi r11,r11,1 void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 800727c: 44 20 00 06 be r1,r0,8007294 <_Heap_Greedy_allocate+0x6c> <== NEVER TAKEN 8007280: 29 82 00 10 lw r2,(r12+16) 8007284: f8 00 47 74 calli 8019054 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 8007288: c9 e1 08 00 sub r1,r15,r1 Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; 800728c: 58 2d 00 08 sw (r1+8),r13 8007290: b8 20 68 00 mv r13,r1 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 8007294: 35 ce 00 04 addi r14,r14,4 8007298: 56 0b ff f2 bgu r16,r11,8007260 <_Heap_Greedy_allocate+0x38> Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 800729c: 29 8b 00 08 lw r11,(r12+8) next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 80072a0: 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; 80072a4: 34 0f ff fe mvi r15,-2 80072a8: 5d 8b 00 03 bne r12,r11,80072b4 <_Heap_Greedy_allocate+0x8c><== ALWAYS TAKEN 80072ac: e0 00 00 0d bi 80072e0 <_Heap_Greedy_allocate+0xb8> <== NOT EXECUTED Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 80072b0: b8 20 58 00 mv r11,r1 80072b4: 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( 80072b8: b9 60 10 00 mv r2,r11 80072bc: 35 63 00 08 addi r3,r11,8 80072c0: a1 e4 20 00 and r4,r15,r4 80072c4: b9 80 08 00 mv r1,r12 80072c8: 34 84 ff f8 addi r4,r4,-8 80072cc: f8 00 01 0b calli 80076f8 <_Heap_Block_allocate> current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 80072d0: 59 6e 00 08 sw (r11+8),r14 Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 80072d4: 29 81 00 08 lw r1,(r12+8) next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 80072d8: b9 60 70 00 mv r14,r11 80072dc: 5d 81 ff f5 bne r12,r1,80072b0 <_Heap_Greedy_allocate+0x88> current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 80072e0: 5d a0 00 03 bne r13,r0,80072ec <_Heap_Greedy_allocate+0xc4> 80072e4: e0 00 00 07 bi 8007300 <_Heap_Greedy_allocate+0xd8> current = allocated_blocks; allocated_blocks = allocated_blocks->next; 80072e8: b9 60 68 00 mv r13,r11 80072ec: 29 ab 00 08 lw r11,(r13+8) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 80072f0: 35 a2 00 08 addi r2,r13,8 80072f4: b9 80 08 00 mv r1,r12 80072f8: f8 00 24 c9 calli 801061c <_Heap_Free> current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 80072fc: 5d 60 ff fb bne r11,r0,80072e8 <_Heap_Greedy_allocate+0xc0> allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 8007300: b9 c0 08 00 mv r1,r14 8007304: 2b 9d 00 04 lw ra,(sp+4) 8007308: 2b 8b 00 1c lw r11,(sp+28) 800730c: 2b 8c 00 18 lw r12,(sp+24) 8007310: 2b 8d 00 14 lw r13,(sp+20) 8007314: 2b 8e 00 10 lw r14,(sp+16) 8007318: 2b 8f 00 0c lw r15,(sp+12) 800731c: 2b 90 00 08 lw r16,(sp+8) 8007320: 37 9c 00 1c addi sp,sp,28 8007324: c3 a0 00 00 ret =============================================================================== 08007328 <_Heap_Greedy_free>: void _Heap_Greedy_free( Heap_Control *heap, Heap_Block *blocks ) { 8007328: 37 9c ff f4 addi sp,sp,-12 800732c: 5b 8b 00 0c sw (sp+12),r11 8007330: 5b 8c 00 08 sw (sp+8),r12 8007334: 5b 9d 00 04 sw (sp+4),ra 8007338: b8 20 60 00 mv r12,r1 while ( blocks != NULL ) { 800733c: 5c 40 00 03 bne r2,r0,8007348 <_Heap_Greedy_free+0x20> <== ALWAYS TAKEN 8007340: e0 00 00 07 bi 800735c <_Heap_Greedy_free+0x34> <== NOT EXECUTED Heap_Block *current = blocks; blocks = blocks->next; 8007344: b9 60 10 00 mv r2,r11 8007348: 28 4b 00 08 lw r11,(r2+8) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 800734c: b9 80 08 00 mv r1,r12 8007350: 34 42 00 08 addi r2,r2,8 8007354: f8 00 24 b2 calli 801061c <_Heap_Free> void _Heap_Greedy_free( Heap_Control *heap, Heap_Block *blocks ) { while ( blocks != NULL ) { 8007358: 5d 60 ff fb bne r11,r0,8007344 <_Heap_Greedy_free+0x1c> Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 800735c: 2b 9d 00 04 lw ra,(sp+4) 8007360: 2b 8b 00 0c lw r11,(sp+12) 8007364: 2b 8c 00 08 lw r12,(sp+8) 8007368: 37 9c 00 0c addi sp,sp,12 800736c: c3 a0 00 00 ret =============================================================================== 0801129c <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 801129c: 37 9c ff e8 addi sp,sp,-24 80112a0: 5b 8b 00 18 sw (sp+24),r11 80112a4: 5b 8c 00 14 sw (sp+20),r12 80112a8: 5b 8d 00 10 sw (sp+16),r13 80112ac: 5b 8e 00 0c sw (sp+12),r14 80112b0: 5b 8f 00 08 sw (sp+8),r15 80112b4: 5b 9d 00 04 sw (sp+4),ra Heap_Block *current = heap->first_block; 80112b8: 28 25 00 20 lw r5,(r1+32) Heap_Block *end = heap->last_block; 80112bc: 28 2c 00 24 lw r12,(r1+36) void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 80112c0: b8 40 68 00 mv r13,r2 80112c4: b8 60 70 00 mv r14,r3 80112c8: 34 0f ff fe mvi r15,-2 Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 80112cc: 5c ac 00 04 bne r5,r12,80112dc <_Heap_Iterate+0x40> <== ALWAYS TAKEN 80112d0: e0 00 00 0c bi 8011300 <_Heap_Iterate+0x64> <== NOT EXECUTED 80112d4: 45 8b 00 0b be r12,r11,8011300 <_Heap_Iterate+0x64> 80112d8: b9 60 28 00 mv r5,r11 80112dc: 28 a2 00 04 lw r2,(r5+4) uintptr_t size = _Heap_Block_size( current ); Heap_Block *next = _Heap_Block_at( current, size ); bool used = _Heap_Is_prev_used( next ); stop = (*visitor)( current, size, used, visitor_arg ); 80112e0: b8 a0 08 00 mv r1,r5 80112e4: b9 c0 20 00 mv r4,r14 80112e8: a1 e2 10 00 and r2,r15,r2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 80112ec: b4 a2 58 00 add r11,r5,r2 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 80112f0: 29 63 00 04 lw r3,(r11+4) 80112f4: 20 63 00 01 andi r3,r3,0x1 80112f8: d9 a0 00 00 call r13 { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 80112fc: 44 20 ff f6 be r1,r0,80112d4 <_Heap_Iterate+0x38> <== ALWAYS TAKEN stop = (*visitor)( current, size, used, visitor_arg ); current = next; } } 8011300: 2b 9d 00 04 lw ra,(sp+4) 8011304: 2b 8b 00 18 lw r11,(sp+24) 8011308: 2b 8c 00 14 lw r12,(sp+20) 801130c: 2b 8d 00 10 lw r13,(sp+16) 8011310: 2b 8e 00 0c lw r14,(sp+12) 8011314: 2b 8f 00 08 lw r15,(sp+8) 8011318: 37 9c 00 18 addi sp,sp,24 801131c: c3 a0 00 00 ret =============================================================================== 0801cf7c <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 801cf7c: 37 9c ff f0 addi sp,sp,-16 801cf80: 5b 8b 00 10 sw (sp+16),r11 801cf84: 5b 8c 00 0c sw (sp+12),r12 801cf88: 5b 8d 00 08 sw (sp+8),r13 801cf8c: 5b 9d 00 04 sw (sp+4),ra 801cf90: b8 40 60 00 mv r12,r2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 801cf94: 28 22 00 10 lw r2,(r1+16) 801cf98: b8 20 58 00 mv r11,r1 801cf9c: b9 80 08 00 mv r1,r12 801cfa0: b8 60 68 00 mv r13,r3 801cfa4: fb ff fc 29 calli 801c048 <__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 801cfa8: 29 62 00 20 lw r2,(r11+32) RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 801cfac: 35 84 ff f8 addi r4,r12,-8 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 801cfb0: c8 81 20 00 sub r4,r4,r1 Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { return false; 801cfb4: 34 01 00 00 mvi r1,0 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 801cfb8: 54 44 00 10 bgu r2,r4,801cff8 <_Heap_Size_of_alloc_area+0x7c> 801cfbc: 29 65 00 24 lw r5,(r11+36) 801cfc0: 54 85 00 0e bgu r4,r5,801cff8 <_Heap_Size_of_alloc_area+0x7c><== NEVER TAKEN - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 801cfc4: 28 86 00 04 lw r6,(r4+4) 801cfc8: 34 03 ff fe mvi r3,-2 801cfcc: a0 66 18 00 and r3,r3,r6 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 801cfd0: b4 83 20 00 add r4,r4,r3 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 801cfd4: 54 44 00 09 bgu r2,r4,801cff8 <_Heap_Size_of_alloc_area+0x7c><== NEVER TAKEN 801cfd8: 54 85 00 08 bgu r4,r5,801cff8 <_Heap_Size_of_alloc_area+0x7c><== NEVER TAKEN block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 801cfdc: 28 82 00 04 lw r2,(r4+4) 801cfe0: 20 42 00 01 andi r2,r2,0x1 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 801cfe4: 44 40 00 05 be r2,r0,801cff8 <_Heap_Size_of_alloc_area+0x7c><== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 801cfe8: c8 8c 20 00 sub r4,r4,r12 801cfec: 34 84 00 04 addi r4,r4,4 801cff0: 59 a4 00 00 sw (r13+0),r4 return true; 801cff4: 34 01 00 01 mvi r1,1 } 801cff8: 2b 9d 00 04 lw ra,(sp+4) 801cffc: 2b 8b 00 10 lw r11,(sp+16) 801d000: 2b 8c 00 0c lw r12,(sp+12) 801d004: 2b 8d 00 08 lw r13,(sp+8) 801d008: 37 9c 00 10 addi sp,sp,16 801d00c: c3 a0 00 00 ret =============================================================================== 08005918 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8005918: 37 9c ff 9c addi sp,sp,-100 800591c: 5b 8b 00 50 sw (sp+80),r11 8005920: 5b 8c 00 4c sw (sp+76),r12 8005924: 5b 8d 00 48 sw (sp+72),r13 8005928: 5b 8e 00 44 sw (sp+68),r14 800592c: 5b 8f 00 40 sw (sp+64),r15 8005930: 5b 90 00 3c sw (sp+60),r16 8005934: 5b 91 00 38 sw (sp+56),r17 8005938: 5b 92 00 34 sw (sp+52),r18 800593c: 5b 93 00 30 sw (sp+48),r19 8005940: 5b 94 00 2c sw (sp+44),r20 8005944: 5b 95 00 28 sw (sp+40),r21 8005948: 5b 96 00 24 sw (sp+36),r22 800594c: 5b 97 00 20 sw (sp+32),r23 8005950: 5b 98 00 1c sw (sp+28),r24 8005954: 5b 99 00 18 sw (sp+24),r25 8005958: 5b 9b 00 14 sw (sp+20),fp 800595c: 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; 8005960: 78 0f 08 00 mvhi r15,0x800 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8005964: 20 63 00 ff andi r3,r3,0xff 8005968: b8 20 68 00 mv r13,r1 800596c: b8 40 98 00 mv r19,r2 uintptr_t const page_size = heap->page_size; 8005970: 28 35 00 10 lw r21,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8005974: 28 36 00 14 lw r22,(r1+20) Heap_Block *const first_block = heap->first_block; 8005978: 28 34 00 20 lw r20,(r1+32) Heap_Block *const last_block = heap->last_block; 800597c: 28 37 00 24 lw r23,(r1+36) Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8005980: 39 ef 58 70 ori r15,r15,0x5870 8005984: 44 60 00 03 be r3,r0,8005990 <_Heap_Walk+0x78> 8005988: 78 0f 08 00 mvhi r15,0x800 800598c: 39 ef 58 94 ori r15,r15,0x5894 if ( !_System_state_Is_up( _System_state_Get() ) ) { 8005990: 78 03 08 01 mvhi r3,0x801 8005994: 38 63 7e 00 ori r3,r3,0x7e00 8005998: 28 69 00 00 lw r9,(r3+0) 800599c: 34 07 00 03 mvi r7,3 return true; 80059a0: 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() ) ) { 80059a4: 45 27 00 15 be r9,r7,80059f8 <_Heap_Walk+0xe0> block = next_block; } while ( block != first_block ); return true; } 80059a8: b8 60 08 00 mv r1,r3 80059ac: 2b 9d 00 10 lw ra,(sp+16) 80059b0: 2b 8b 00 50 lw r11,(sp+80) 80059b4: 2b 8c 00 4c lw r12,(sp+76) 80059b8: 2b 8d 00 48 lw r13,(sp+72) 80059bc: 2b 8e 00 44 lw r14,(sp+68) 80059c0: 2b 8f 00 40 lw r15,(sp+64) 80059c4: 2b 90 00 3c lw r16,(sp+60) 80059c8: 2b 91 00 38 lw r17,(sp+56) 80059cc: 2b 92 00 34 lw r18,(sp+52) 80059d0: 2b 93 00 30 lw r19,(sp+48) 80059d4: 2b 94 00 2c lw r20,(sp+44) 80059d8: 2b 95 00 28 lw r21,(sp+40) 80059dc: 2b 96 00 24 lw r22,(sp+36) 80059e0: 2b 97 00 20 lw r23,(sp+32) 80059e4: 2b 98 00 1c lw r24,(sp+28) 80059e8: 2b 99 00 18 lw r25,(sp+24) 80059ec: 2b 9b 00 14 lw fp,(sp+20) 80059f0: 37 9c 00 64 addi sp,sp,100 80059f4: c3 a0 00 00 ret Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; (*printer)( 80059f8: 29 a2 00 08 lw r2,(r13+8) 80059fc: 29 a1 00 0c lw r1,(r13+12) 8005a00: 29 a6 00 18 lw r6,(r13+24) 8005a04: 29 a7 00 1c lw r7,(r13+28) 8005a08: 78 03 08 01 mvhi r3,0x801 8005a0c: 5b 82 00 08 sw (sp+8),r2 8005a10: 5b 81 00 0c sw (sp+12),r1 8005a14: 5b 97 00 04 sw (sp+4),r23 8005a18: ba 60 08 00 mv r1,r19 8005a1c: 34 02 00 00 mvi r2,0 8005a20: 38 63 50 d8 ori r3,r3,0x50d8 8005a24: ba a0 20 00 mv r4,r21 8005a28: ba c0 28 00 mv r5,r22 8005a2c: ba 80 40 00 mv r8,r20 8005a30: d9 e0 00 00 call r15 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 8005a34: 46 a0 00 26 be r21,r0,8005acc <_Heap_Walk+0x1b4> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 8005a38: 22 ab 00 03 andi r11,r21,0x3 (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 8005a3c: 5d 60 00 2b bne r11,r0,8005ae8 <_Heap_Walk+0x1d0> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005a40: ba c0 08 00 mv r1,r22 8005a44: ba a0 10 00 mv r2,r21 8005a48: fb ff eb f6 calli 8000a20 <__umodsi3> 8005a4c: b8 20 60 00 mv r12,r1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 8005a50: 5c 2b 00 2e bne r1,r11,8005b08 <_Heap_Walk+0x1f0> 8005a54: 36 81 00 08 addi r1,r20,8 8005a58: ba a0 10 00 mv r2,r21 8005a5c: fb ff eb f1 calli 8000a20 <__umodsi3> 8005a60: b8 20 18 00 mv r3,r1 ); return false; } if ( 8005a64: 5c 2c 00 31 bne r1,r12,8005b28 <_Heap_Walk+0x210> block = next_block; } while ( block != first_block ); return true; } 8005a68: 2a 8c 00 04 lw r12,(r20+4) block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 8005a6c: 21 81 00 01 andi r1,r12,0x1 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 8005a70: 44 23 00 fe be r1,r3,8005e68 <_Heap_Walk+0x550> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8005a74: 2a e2 00 04 lw r2,(r23+4) 8005a78: 34 01 ff fe mvi r1,-2 8005a7c: a0 22 08 00 and r1,r1,r2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8005a80: b6 e1 08 00 add r1,r23,r1 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 8005a84: 28 22 00 04 lw r2,(r1+4) 8005a88: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( _Heap_Is_free( last_block ) ) { 8005a8c: 44 43 00 09 be r2,r3,8005ab0 <_Heap_Walk+0x198> ); return false; } if ( 8005a90: 46 81 00 2e be r20,r1,8005b48 <_Heap_Walk+0x230> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 8005a94: 78 03 08 01 mvhi r3,0x801 8005a98: 38 63 52 40 ori r3,r3,0x5240 8005a9c: ba 60 08 00 mv r1,r19 8005aa0: 34 02 00 01 mvi r2,1 8005aa4: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005aa8: 34 03 00 00 mvi r3,0 8005aac: e3 ff ff bf bi 80059a8 <_Heap_Walk+0x90> return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 8005ab0: 78 03 08 01 mvhi r3,0x801 8005ab4: 38 63 52 28 ori r3,r3,0x5228 8005ab8: ba 60 08 00 mv r1,r19 8005abc: 34 02 00 01 mvi r2,1 8005ac0: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005ac4: 34 03 00 00 mvi r3,0 8005ac8: e3 ff ff b8 bi 80059a8 <_Heap_Walk+0x90> first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" ); 8005acc: 78 03 08 01 mvhi r3,0x801 8005ad0: 38 63 51 6c ori r3,r3,0x516c 8005ad4: ba 60 08 00 mv r1,r19 8005ad8: 34 02 00 01 mvi r2,1 8005adc: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005ae0: 34 03 00 00 mvi r3,0 8005ae4: e3 ff ff b1 bi 80059a8 <_Heap_Walk+0x90> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 8005ae8: 78 03 08 01 mvhi r3,0x801 8005aec: 38 63 51 80 ori r3,r3,0x5180 8005af0: ba 60 08 00 mv r1,r19 8005af4: 34 02 00 01 mvi r2,1 8005af8: ba a0 20 00 mv r4,r21 8005afc: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005b00: 34 03 00 00 mvi r3,0 8005b04: e3 ff ff a9 bi 80059a8 <_Heap_Walk+0x90> return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 8005b08: 78 03 08 01 mvhi r3,0x801 8005b0c: 38 63 51 a0 ori r3,r3,0x51a0 8005b10: ba 60 08 00 mv r1,r19 8005b14: 34 02 00 01 mvi r2,1 8005b18: ba c0 20 00 mv r4,r22 8005b1c: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005b20: 34 03 00 00 mvi r3,0 8005b24: e3 ff ff a1 bi 80059a8 <_Heap_Walk+0x90> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 8005b28: 78 03 08 01 mvhi r3,0x801 8005b2c: 38 63 51 c4 ori r3,r3,0x51c4 8005b30: ba 60 08 00 mv r1,r19 8005b34: 34 02 00 01 mvi r2,1 8005b38: ba 80 20 00 mv r4,r20 8005b3c: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005b40: 34 03 00 00 mvi r3,0 8005b44: e3 ff ff 99 bi 80059a8 <_Heap_Walk+0x90> block = next_block; } while ( block != first_block ); return true; } 8005b48: 29 ab 00 08 lw r11,(r13+8) int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 8005b4c: 29 b2 00 10 lw r18,(r13+16) const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 8005b50: 45 ab 00 2f be r13,r11,8005c0c <_Heap_Walk+0x2f4> block = next_block; } while ( block != first_block ); return true; } 8005b54: 29 ae 00 20 lw r14,(r13+32) const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 8005b58: 55 cb 00 dd bgu r14,r11,8005ecc <_Heap_Walk+0x5b4> <== NEVER TAKEN 8005b5c: 29 b8 00 24 lw r24,(r13+36) 8005b60: 55 78 00 db bgu r11,r24,8005ecc <_Heap_Walk+0x5b4> <== NEVER TAKEN RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005b64: 35 61 00 08 addi r1,r11,8 8005b68: ba 40 10 00 mv r2,r18 8005b6c: fb ff eb ad calli 8000a20 <__umodsi3> ); return false; } if ( 8005b70: 5c 20 00 df bne r1,r0,8005eec <_Heap_Walk+0x5d4> <== NEVER TAKEN - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8005b74: 29 63 00 04 lw r3,(r11+4) 8005b78: 34 02 ff fe mvi r2,-2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005b7c: b9 60 80 00 mv r16,r11 8005b80: a0 43 10 00 and r2,r2,r3 block = next_block; } while ( block != first_block ); return true; } 8005b84: b5 62 10 00 add r2,r11,r2 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 8005b88: 28 42 00 04 lw r2,(r2+4) ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005b8c: b9 a0 18 00 mv r3,r13 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8005b90: 34 11 ff fe mvi r17,-2 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 8005b94: 20 42 00 01 andi r2,r2,0x1 8005b98: 44 41 00 12 be r2,r1,8005be0 <_Heap_Walk+0x2c8> <== ALWAYS TAKEN 8005b9c: e0 00 00 dc bi 8005f0c <_Heap_Walk+0x5f4> <== NOT EXECUTED return false; } prev_block = free_block; free_block = free_block->next; 8005ba0: 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 ) { 8005ba4: 45 ab 00 1b be r13,r11,8005c10 <_Heap_Walk+0x2f8> const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 8005ba8: 55 cb 00 c9 bgu r14,r11,8005ecc <_Heap_Walk+0x5b4> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005bac: 35 61 00 08 addi r1,r11,8 8005bb0: ba 40 10 00 mv r2,r18 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 8005bb4: 55 78 00 c6 bgu r11,r24,8005ecc <_Heap_Walk+0x5b4> <== NEVER TAKEN RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005bb8: fb ff eb 9a calli 8000a20 <__umodsi3> ); return false; } if ( 8005bbc: 5c 20 00 cc bne r1,r0,8005eec <_Heap_Walk+0x5d4> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8005bc0: 29 64 00 04 lw r4,(r11+4) ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005bc4: ba 00 18 00 mv r3,r16 8005bc8: b9 60 80 00 mv r16,r11 8005bcc: a2 24 20 00 and r4,r17,r4 block = next_block; } while ( block != first_block ); return true; } 8005bd0: b4 8b 20 00 add r4,r4,r11 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 8005bd4: 28 84 00 04 lw r4,(r4+4) 8005bd8: 20 84 00 01 andi r4,r4,0x1 ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005bdc: 5c 81 00 cc bne r4,r1,8005f0c <_Heap_Walk+0x5f4> ); return false; } if ( free_block->prev != prev_block ) { 8005be0: 29 67 00 0c lw r7,(r11+12) 8005be4: 44 e3 ff ef be r7,r3,8005ba0 <_Heap_Walk+0x288> (*printer)( 8005be8: 78 03 08 01 mvhi r3,0x801 8005bec: 38 63 52 dc ori r3,r3,0x52dc 8005bf0: ba 60 08 00 mv r1,r19 8005bf4: 34 02 00 01 mvi r2,1 8005bf8: b9 60 20 00 mv r4,r11 8005bfc: b8 e0 28 00 mv r5,r7 8005c00: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005c04: 34 03 00 00 mvi r3,0 8005c08: e3 ff ff 68 bi 80059a8 <_Heap_Walk+0x90> const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 8005c0c: 29 ae 00 20 lw r14,(r13+32) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8005c10: 78 01 08 01 mvhi r1,0x801 8005c14: 5b 81 00 54 sw (sp+84),r1 8005c18: 78 01 08 01 mvhi r1,0x801 8005c1c: 5b 81 00 58 sw (sp+88),r1 8005c20: 78 01 08 01 mvhi r1,0x801 8005c24: 5b 81 00 5c sw (sp+92),r1 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005c28: 78 01 08 01 mvhi r1,0x801 8005c2c: 5b 81 00 60 sw (sp+96),r1 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005c30: 78 01 08 01 mvhi r1,0x801 8005c34: 5b 81 00 64 sw (sp+100),r1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8005c38: 2b 81 00 54 lw r1,(sp+84) "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8005c3c: 78 1b 08 01 mvhi fp,0x801 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 8005c40: 78 19 08 01 mvhi r25,0x801 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8005c44: 38 21 50 a0 ori r1,r1,0x50a0 8005c48: 5b 81 00 54 sw (sp+84),r1 8005c4c: 2b 81 00 58 lw r1,(sp+88) " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005c50: 78 18 08 01 mvhi r24,0x801 ); return false; } if ( _Heap_Is_used( free_block ) ) { 8005c54: ba 80 88 00 mv r17,r20 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8005c58: 38 21 50 bc ori r1,r1,0x50bc 8005c5c: 5b 81 00 58 sw (sp+88),r1 8005c60: 2b 81 00 5c lw r1,(sp+92) "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8005c64: 3b 7b 54 8c ori fp,fp,0x548c if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 8005c68: 3b 39 54 74 ori r25,r25,0x5474 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)( 8005c6c: 38 21 53 d0 ori r1,r1,0x53d0 8005c70: 5b 81 00 5c sw (sp+92),r1 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005c74: 2b 81 00 60 lw r1,(sp+96) 8005c78: 3b 18 54 40 ori r24,r24,0x5440 8005c7c: 38 21 50 cc ori r1,r1,0x50cc 8005c80: 5b 81 00 60 sw (sp+96),r1 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005c84: 2b 81 00 64 lw r1,(sp+100) 8005c88: 38 21 50 b0 ori r1,r1,0x50b0 8005c8c: 5b 81 00 64 sw (sp+100),r1 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 8005c90: 34 01 ff fe mvi r1,-2 8005c94: a1 81 90 00 and r18,r12,r1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8005c98: b6 51 80 00 add r16,r18,r17 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 8005c9c: 55 d0 00 7a bgu r14,r16,8005e84 <_Heap_Walk+0x56c> <== NEVER TAKEN 8005ca0: 29 a4 00 24 lw r4,(r13+36) 8005ca4: 56 04 00 78 bgu r16,r4,8005e84 <_Heap_Walk+0x56c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8005ca8: ba 40 08 00 mv r1,r18 8005cac: ba a0 10 00 mv r2,r21 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; 8005cb0: fe 37 58 00 cmpne r11,r17,r23 8005cb4: fb ff eb 5b calli 8000a20 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 8005cb8: 44 20 00 02 be r1,r0,8005cc0 <_Heap_Walk+0x3a8> 8005cbc: 5d 60 00 15 bne r11,r0,8005d10 <_Heap_Walk+0x3f8> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 8005cc0: 52 56 00 02 bgeu r18,r22,8005cc8 <_Heap_Walk+0x3b0> 8005cc4: 5d 60 00 1c bne r11,r0,8005d34 <_Heap_Walk+0x41c> <== ALWAYS TAKEN ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 8005cc8: 56 11 00 02 bgu r16,r17,8005cd0 <_Heap_Walk+0x3b8> 8005ccc: 5d 60 00 77 bne r11,r0,8005ea8 <_Heap_Walk+0x590> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 8005cd0: 2a 06 00 04 lw r6,(r16+4) 8005cd4: 21 8c 00 01 andi r12,r12,0x1 8005cd8: 20 c6 00 01 andi r6,r6,0x1 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 8005cdc: 44 c0 00 28 be r6,r0,8005d7c <_Heap_Walk+0x464> if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 8005ce0: 45 80 00 1f be r12,r0,8005d5c <_Heap_Walk+0x444> (*printer)( 8005ce4: ba 60 08 00 mv r1,r19 8005ce8: 34 02 00 00 mvi r2,0 8005cec: bb 20 18 00 mv r3,r25 8005cf0: ba 20 20 00 mv r4,r17 8005cf4: ba 40 28 00 mv r5,r18 8005cf8: d9 e0 00 00 call r15 block->prev_size ); } block = next_block; } while ( block != first_block ); 8005cfc: 46 90 00 43 be r20,r16,8005e08 <_Heap_Walk+0x4f0> 8005d00: 2a 0c 00 04 lw r12,(r16+4) 8005d04: 29 ae 00 20 lw r14,(r13+32) 8005d08: ba 00 88 00 mv r17,r16 8005d0c: e3 ff ff e1 bi 8005c90 <_Heap_Walk+0x378> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { (*printer)( 8005d10: 78 03 08 01 mvhi r3,0x801 8005d14: 38 63 53 40 ori r3,r3,0x5340 8005d18: ba 60 08 00 mv r1,r19 8005d1c: 34 02 00 01 mvi r2,1 8005d20: ba 20 20 00 mv r4,r17 8005d24: ba 40 28 00 mv r5,r18 8005d28: d9 e0 00 00 call r15 "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 8005d2c: 34 03 00 00 mvi r3,0 8005d30: e3 ff ff 1e bi 80059a8 <_Heap_Walk+0x90> } if ( block_size < min_block_size && is_not_last_block ) { (*printer)( 8005d34: 78 03 08 01 mvhi r3,0x801 8005d38: 38 63 53 70 ori r3,r3,0x5370 8005d3c: ba 60 08 00 mv r1,r19 8005d40: 34 02 00 01 mvi r2,1 8005d44: ba 20 20 00 mv r4,r17 8005d48: ba 40 28 00 mv r5,r18 8005d4c: ba c0 30 00 mv r6,r22 8005d50: d9 e0 00 00 call r15 block, block_size, min_block_size ); return false; 8005d54: 34 03 00 00 mvi r3,0 8005d58: e3 ff ff 14 bi 80059a8 <_Heap_Walk+0x90> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8005d5c: 2a 26 00 00 lw r6,(r17+0) 8005d60: ba 20 20 00 mv r4,r17 8005d64: ba 60 08 00 mv r1,r19 8005d68: 34 02 00 00 mvi r2,0 8005d6c: bb 60 18 00 mv r3,fp 8005d70: ba 40 28 00 mv r5,r18 8005d74: d9 e0 00 00 call r15 8005d78: e3 ff ff e1 bi 8005cfc <_Heap_Walk+0x3e4> false, "block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n", block, block_size, block->prev, block->prev == first_free_block ? 8005d7c: 2a 26 00 0c lw r6,(r17+12) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8005d80: 29 a4 00 08 lw r4,(r13+8) block = next_block; } while ( block != first_block ); return true; } 8005d84: 29 a5 00 0c lw r5,(r13+12) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8005d88: 2b 87 00 54 lw r7,(sp+84) 8005d8c: 44 86 00 03 be r4,r6,8005d98 <_Heap_Walk+0x480> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005d90: bb 00 38 00 mv r7,r24 8005d94: 45 a6 00 29 be r13,r6,8005e38 <_Heap_Walk+0x520> block->next, block->next == last_free_block ? 8005d98: 2a 28 00 08 lw r8,(r17+8) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8005d9c: 2b 84 00 58 lw r4,(sp+88) 8005da0: 44 a8 00 03 be r5,r8,8005dac <_Heap_Walk+0x494> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005da4: bb 00 20 00 mv r4,r24 8005da8: 45 a8 00 26 be r13,r8,8005e40 <_Heap_Walk+0x528> Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 8005dac: 2b 83 00 5c lw r3,(sp+92) 8005db0: 5b 84 00 04 sw (sp+4),r4 8005db4: ba 60 08 00 mv r1,r19 8005db8: 34 02 00 00 mvi r2,0 8005dbc: ba 20 20 00 mv r4,r17 8005dc0: ba 40 28 00 mv r5,r18 8005dc4: d9 e0 00 00 call r15 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 8005dc8: 2a 06 00 00 lw r6,(r16+0) 8005dcc: 5e 46 00 11 bne r18,r6,8005e10 <_Heap_Walk+0x4f8> ); return false; } if ( !prev_used ) { 8005dd0: 45 80 00 1e be r12,r0,8005e48 <_Heap_Walk+0x530> block = next_block; } while ( block != first_block ); return true; } 8005dd4: 29 a5 00 08 lw r5,(r13+8) ) { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { 8005dd8: 45 a5 00 04 be r13,r5,8005de8 <_Heap_Walk+0x4d0> <== NEVER TAKEN if ( free_block == block ) { 8005ddc: 46 25 ff c8 be r17,r5,8005cfc <_Heap_Walk+0x3e4> return true; } free_block = free_block->next; 8005de0: 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 ) { 8005de4: 5d a5 ff fe bne r13,r5,8005ddc <_Heap_Walk+0x4c4> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 8005de8: 78 03 08 01 mvhi r3,0x801 8005dec: 38 63 54 b4 ori r3,r3,0x54b4 8005df0: ba 60 08 00 mv r1,r19 8005df4: 34 02 00 01 mvi r2,1 8005df8: ba 20 20 00 mv r4,r17 8005dfc: d9 e0 00 00 call r15 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 8005e00: 34 03 00 00 mvi r3,0 8005e04: e3 ff fe e9 bi 80059a8 <_Heap_Walk+0x90> } block = next_block; } while ( block != first_block ); return true; 8005e08: 34 03 00 01 mvi r3,1 8005e0c: e3 ff fe e7 bi 80059a8 <_Heap_Walk+0x90> " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { (*printer)( 8005e10: 78 03 08 01 mvhi r3,0x801 8005e14: 38 63 54 08 ori r3,r3,0x5408 8005e18: ba 60 08 00 mv r1,r19 8005e1c: 34 02 00 01 mvi r2,1 8005e20: ba 20 20 00 mv r4,r17 8005e24: ba 40 28 00 mv r5,r18 8005e28: ba 00 38 00 mv r7,r16 8005e2c: d9 e0 00 00 call r15 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 8005e30: 34 03 00 00 mvi r3,0 8005e34: e3 ff fe dd bi 80059a8 <_Heap_Walk+0x90> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8005e38: 2b 87 00 64 lw r7,(sp+100) 8005e3c: e3 ff ff d7 bi 8005d98 <_Heap_Walk+0x480> block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8005e40: 2b 84 00 60 lw r4,(sp+96) 8005e44: e3 ff ff da bi 8005dac <_Heap_Walk+0x494> return false; } if ( !prev_used ) { (*printer)( 8005e48: 78 03 08 01 mvhi r3,0x801 8005e4c: 38 63 54 44 ori r3,r3,0x5444 8005e50: ba 60 08 00 mv r1,r19 8005e54: 34 02 00 01 mvi r2,1 8005e58: ba 20 20 00 mv r4,r17 8005e5c: d9 e0 00 00 call r15 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 8005e60: 34 03 00 00 mvi r3,0 8005e64: e3 ff fe d1 bi 80059a8 <_Heap_Walk+0x90> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 8005e68: 78 03 08 01 mvhi r3,0x801 8005e6c: 38 63 51 f8 ori r3,r3,0x51f8 8005e70: ba 60 08 00 mv r1,r19 8005e74: 34 02 00 01 mvi r2,1 8005e78: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005e7c: 34 03 00 00 mvi r3,0 8005e80: e3 ff fe ca bi 80059a8 <_Heap_Walk+0x90> Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( 8005e84: 78 03 08 01 mvhi r3,0x801 8005e88: 38 63 53 10 ori r3,r3,0x5310 8005e8c: ba 60 08 00 mv r1,r19 8005e90: 34 02 00 01 mvi r2,1 8005e94: ba 20 20 00 mv r4,r17 8005e98: ba 00 28 00 mv r5,r16 8005e9c: d9 e0 00 00 call r15 "block 0x%08x: next block 0x%08x not in heap\n", block, next_block ); return false; 8005ea0: 34 03 00 00 mvi r3,0 8005ea4: e3 ff fe c1 bi 80059a8 <_Heap_Walk+0x90> return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { (*printer)( 8005ea8: 78 03 08 01 mvhi r3,0x801 8005eac: 38 63 53 9c ori r3,r3,0x539c 8005eb0: ba 60 08 00 mv r1,r19 8005eb4: 34 02 00 01 mvi r2,1 8005eb8: ba 20 20 00 mv r4,r17 8005ebc: ba 00 28 00 mv r5,r16 8005ec0: d9 e0 00 00 call r15 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 8005ec4: 34 03 00 00 mvi r3,0 8005ec8: e3 ff fe b8 bi 80059a8 <_Heap_Walk+0x90> const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { (*printer)( 8005ecc: 78 03 08 01 mvhi r3,0x801 8005ed0: 38 63 52 70 ori r3,r3,0x5270 8005ed4: ba 60 08 00 mv r1,r19 8005ed8: 34 02 00 01 mvi r2,1 8005edc: b9 60 20 00 mv r4,r11 8005ee0: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005ee4: 34 03 00 00 mvi r3,0 8005ee8: e3 ff fe b0 bi 80059a8 <_Heap_Walk+0x90> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 8005eec: 78 03 08 01 mvhi r3,0x801 8005ef0: 38 63 52 90 ori r3,r3,0x5290 8005ef4: ba 60 08 00 mv r1,r19 8005ef8: 34 02 00 01 mvi r2,1 8005efc: b9 60 20 00 mv r4,r11 8005f00: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005f04: 34 03 00 00 mvi r3,0 8005f08: e3 ff fe a8 bi 80059a8 <_Heap_Walk+0x90> return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 8005f0c: 78 03 08 01 mvhi r3,0x801 8005f10: 38 63 52 c0 ori r3,r3,0x52c0 8005f14: ba 60 08 00 mv r1,r19 8005f18: 34 02 00 01 mvi r2,1 8005f1c: b9 60 20 00 mv r4,r11 8005f20: d9 e0 00 00 call r15 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8005f24: 34 03 00 00 mvi r3,0 8005f28: e3 ff fe a0 bi 80059a8 <_Heap_Walk+0x90> =============================================================================== 080045e0 <_IO_Initialize_all_drivers>: void _IO_Initialize_all_drivers( void ) { 80045e0: 37 9c ff f4 addi sp,sp,-12 80045e4: 5b 8b 00 0c sw (sp+12),r11 80045e8: 5b 8c 00 08 sw (sp+8),r12 80045ec: 5b 9d 00 04 sw (sp+4),ra rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 80045f0: 78 0c 08 02 mvhi r12,0x802 80045f4: 39 8c 12 50 ori r12,r12,0x1250 80045f8: 29 81 00 00 lw r1,(r12+0) 80045fc: 44 20 00 09 be r1,r0,8004620 <_IO_Initialize_all_drivers+0x40><== NEVER TAKEN 8004600: 34 0b 00 00 mvi r11,0 (void) rtems_io_initialize( major, 0, NULL ); 8004604: b9 60 08 00 mv r1,r11 8004608: 34 02 00 00 mvi r2,0 800460c: 34 03 00 00 mvi r3,0 8004610: f8 00 18 d6 calli 800a968 void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 8004614: 29 81 00 00 lw r1,(r12+0) 8004618: 35 6b 00 01 addi r11,r11,1 800461c: 54 2b ff fa bgu r1,r11,8004604 <_IO_Initialize_all_drivers+0x24> (void) rtems_io_initialize( major, 0, NULL ); } 8004620: 2b 9d 00 04 lw ra,(sp+4) 8004624: 2b 8b 00 0c lw r11,(sp+12) 8004628: 2b 8c 00 08 lw r12,(sp+8) 800462c: 37 9c 00 0c addi sp,sp,12 8004630: c3 a0 00 00 ret =============================================================================== 080044c0 <_IO_Manager_initialization>: #include #include void _IO_Manager_initialization(void) { 80044c0: 37 9c ff e8 addi sp,sp,-24 80044c4: 5b 8b 00 18 sw (sp+24),r11 80044c8: 5b 8c 00 14 sw (sp+20),r12 80044cc: 5b 8d 00 10 sw (sp+16),r13 80044d0: 5b 8e 00 0c sw (sp+12),r14 80044d4: 5b 8f 00 08 sw (sp+8),r15 80044d8: 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(); 80044dc: 78 01 08 01 mvhi r1,0x801 80044e0: 38 21 d2 6c ori r1,r1,0xd26c drivers_in_table = rtems_configuration_get_number_of_device_drivers(); 80044e4: 28 2b 00 38 lw r11,(r1+56) number_of_drivers = rtems_configuration_get_maximum_drivers(); 80044e8: 28 2e 00 34 lw r14,(r1+52) uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = rtems_configuration_get_device_driver_table(); 80044ec: 28 2d 00 3c lw r13,(r1+60) /* * If the user claims there are less drivers than are actually in * the table, then let's just go with the table's count. */ if ( number_of_drivers <= drivers_in_table ) 80044f0: 51 6e 00 2e bgeu r11,r14,80045a8 <_IO_Manager_initialization+0xe8> * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) 80044f4: b5 ce 60 00 add r12,r14,r14 80044f8: b5 8e 60 00 add r12,r12,r14 80044fc: b5 8c 60 00 add r12,r12,r12 8004500: b5 8c 60 00 add r12,r12,r12 8004504: b5 8c 60 00 add r12,r12,r12 * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( 8004508: b9 80 08 00 mv r1,r12 800450c: f8 00 0e d2 calli 8008054 <_Workspace_Allocate_or_fatal_error> sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 8004510: 78 04 08 02 mvhi r4,0x802 /* * 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 *) 8004514: 78 0f 08 02 mvhi r15,0x802 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 8004518: 38 84 12 50 ori r4,r4,0x1250 /* * 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 *) 800451c: 39 ef 12 54 ori r15,r15,0x1254 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 8004520: 34 02 00 00 mvi r2,0 8004524: b9 80 18 00 mv r3,r12 _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 8004528: 58 8e 00 00 sw (r4+0),r14 /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 800452c: 59 e1 00 00 sw (r15+0),r1 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 8004530: f8 00 26 8c calli 800df60 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8004534: 45 60 00 15 be r11,r0,8004588 <_IO_Manager_initialization+0xc8><== NEVER TAKEN 8004538: 29 e5 00 00 lw r5,(r15+0) 800453c: 34 03 00 00 mvi r3,0 8004540: 34 04 00 00 mvi r4,0 #include #include #include void _IO_Manager_initialization(void) 8004544: b5 a3 08 00 add r1,r13,r3 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; 8004548: 28 26 00 00 lw r6,(r1+0) #include #include #include void _IO_Manager_initialization(void) 800454c: b4 a3 10 00 add r2,r5,r3 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 8004550: 34 84 00 01 addi r4,r4,1 _IO_Driver_address_table[index] = driver_table[index]; 8004554: 58 46 00 00 sw (r2+0),r6 8004558: 28 26 00 04 lw r6,(r1+4) memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 800455c: 34 63 00 18 addi r3,r3,24 _IO_Driver_address_table[index] = driver_table[index]; 8004560: 58 46 00 04 sw (r2+4),r6 8004564: 28 26 00 08 lw r6,(r1+8) 8004568: 58 46 00 08 sw (r2+8),r6 800456c: 28 26 00 0c lw r6,(r1+12) 8004570: 58 46 00 0c sw (r2+12),r6 8004574: 28 26 00 10 lw r6,(r1+16) 8004578: 58 46 00 10 sw (r2+16),r6 800457c: 28 21 00 14 lw r1,(r1+20) 8004580: 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++ ) 8004584: 55 64 ff f0 bgu r11,r4,8004544 <_IO_Manager_initialization+0x84> _IO_Driver_address_table[index] = driver_table[index]; } 8004588: 2b 9d 00 04 lw ra,(sp+4) 800458c: 2b 8b 00 18 lw r11,(sp+24) 8004590: 2b 8c 00 14 lw r12,(sp+20) 8004594: 2b 8d 00 10 lw r13,(sp+16) 8004598: 2b 8e 00 0c lw r14,(sp+12) 800459c: 2b 8f 00 08 lw r15,(sp+8) 80045a0: 37 9c 00 18 addi sp,sp,24 80045a4: c3 a0 00 00 ret * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { _IO_Driver_address_table = driver_table; 80045a8: 78 02 08 02 mvhi r2,0x802 _IO_Number_of_drivers = number_of_drivers; 80045ac: 78 01 08 02 mvhi r1,0x802 * 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; 80045b0: 38 42 12 54 ori r2,r2,0x1254 _IO_Number_of_drivers = number_of_drivers; 80045b4: 38 21 12 50 ori r1,r1,0x1250 * 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; 80045b8: 58 4d 00 00 sw (r2+0),r13 _IO_Number_of_drivers = number_of_drivers; 80045bc: 58 2b 00 00 sw (r1+0),r11 sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; } 80045c0: 2b 9d 00 04 lw ra,(sp+4) 80045c4: 2b 8b 00 18 lw r11,(sp+24) 80045c8: 2b 8c 00 14 lw r12,(sp+20) 80045cc: 2b 8d 00 10 lw r13,(sp+16) 80045d0: 2b 8e 00 0c lw r14,(sp+12) 80045d4: 2b 8f 00 08 lw r15,(sp+8) 80045d8: 37 9c 00 18 addi sp,sp,24 80045dc: c3 a0 00 00 ret =============================================================================== 0800558c <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 800558c: 37 9c ff ec addi sp,sp,-20 8005590: 5b 8b 00 14 sw (sp+20),r11 8005594: 5b 8c 00 10 sw (sp+16),r12 8005598: 5b 8d 00 0c sw (sp+12),r13 800559c: 5b 8e 00 08 sw (sp+8),r14 80055a0: 5b 9d 00 04 sw (sp+4),ra 80055a4: 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 ) 80055a8: 28 21 00 18 lw r1,(r1+24) return NULL; 80055ac: 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 ) 80055b0: 5c 20 00 09 bne r1,r0,80055d4 <_Objects_Allocate+0x48> <== ALWAYS TAKEN ); } #endif return the_object; } 80055b4: b9 80 08 00 mv r1,r12 80055b8: 2b 9d 00 04 lw ra,(sp+4) 80055bc: 2b 8b 00 14 lw r11,(sp+20) 80055c0: 2b 8c 00 10 lw r12,(sp+16) 80055c4: 2b 8d 00 0c lw r13,(sp+12) 80055c8: 2b 8e 00 08 lw r14,(sp+8) 80055cc: 37 9c 00 14 addi sp,sp,20 80055d0: c3 a0 00 00 ret /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 80055d4: 35 6d 00 20 addi r13,r11,32 80055d8: b9 a0 08 00 mv r1,r13 80055dc: fb ff fc d4 calli 800492c <_Chain_Get> 80055e0: b8 20 60 00 mv r12,r1 if ( information->auto_extend ) { 80055e4: 41 61 00 12 lbu r1,(r11+18) /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 80055e8: b9 80 70 00 mv r14,r12 if ( information->auto_extend ) { 80055ec: 44 20 ff f2 be r1,r0,80055b4 <_Objects_Allocate+0x28> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 80055f0: 45 80 00 18 be r12,r0,8005650 <_Objects_Allocate+0xc4> } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 80055f4: 2d 83 00 0a lhu r3,(r12+10) 80055f8: 2d 61 00 0a lhu r1,(r11+10) _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 80055fc: 2d 62 00 14 lhu r2,(r11+20) 8005600: c8 61 08 00 sub r1,r3,r1 8005604: f8 00 5a 81 calli 801c008 <__udivsi3> information->inactive_per_block[ block ]--; 8005608: 29 62 00 30 lw r2,(r11+48) 800560c: b4 21 08 00 add r1,r1,r1 8005610: b4 21 08 00 add r1,r1,r1 8005614: b4 41 08 00 add r1,r2,r1 8005618: 28 22 00 00 lw r2,(r1+0) information->inactive--; 800561c: 2d 63 00 2c lhu r3,(r11+44) block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 8005620: 34 42 ff ff addi r2,r2,-1 8005624: 58 22 00 00 sw (r1+0),r2 information->inactive--; 8005628: 34 61 ff ff addi r1,r3,-1 800562c: 0d 61 00 2c sh (r11+44),r1 ); } #endif return the_object; } 8005630: b9 80 08 00 mv r1,r12 8005634: 2b 9d 00 04 lw ra,(sp+4) 8005638: 2b 8b 00 14 lw r11,(sp+20) 800563c: 2b 8c 00 10 lw r12,(sp+16) 8005640: 2b 8d 00 0c lw r13,(sp+12) 8005644: 2b 8e 00 08 lw r14,(sp+8) 8005648: 37 9c 00 14 addi sp,sp,20 800564c: c3 a0 00 00 ret * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { _Objects_Extend_information( information ); 8005650: b9 60 08 00 mv r1,r11 8005654: f8 00 00 06 calli 800566c <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 8005658: b9 a0 08 00 mv r1,r13 800565c: fb ff fc b4 calli 800492c <_Chain_Get> 8005660: b8 20 60 00 mv r12,r1 } if ( the_object ) { 8005664: 44 2e ff d4 be r1,r14,80055b4 <_Objects_Allocate+0x28> 8005668: e3 ff ff e3 bi 80055f4 <_Objects_Allocate+0x68> =============================================================================== 0800566c <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 800566c: 37 9c ff c8 addi sp,sp,-56 8005670: 5b 8b 00 2c sw (sp+44),r11 8005674: 5b 8c 00 28 sw (sp+40),r12 8005678: 5b 8d 00 24 sw (sp+36),r13 800567c: 5b 8e 00 20 sw (sp+32),r14 8005680: 5b 8f 00 1c sw (sp+28),r15 8005684: 5b 90 00 18 sw (sp+24),r16 8005688: 5b 91 00 14 sw (sp+20),r17 800568c: 5b 92 00 10 sw (sp+16),r18 8005690: 5b 93 00 0c sw (sp+12),r19 8005694: 5b 94 00 08 sw (sp+8),r20 8005698: 5b 9d 00 04 sw (sp+4),ra minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 800569c: 28 2c 00 34 lw r12,(r1+52) */ void _Objects_Extend_information( Objects_Information *information ) { 80056a0: b8 20 58 00 mv r11,r1 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 80056a4: 2c 30 00 0a lhu r16,(r1+10) index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 80056a8: 45 80 00 9f be r12,r0,8005924 <_Objects_Extend_information+0x2b8> block_count = 0; else { block_count = information->maximum / information->allocation_size; 80056ac: 2c 2f 00 14 lhu r15,(r1+20) 80056b0: 2c 31 00 10 lhu r17,(r1+16) 80056b4: b9 e0 10 00 mv r2,r15 80056b8: ba 20 08 00 mv r1,r17 80056bc: f8 00 5a 53 calli 801c008 <__udivsi3> 80056c0: 20 2e ff ff andi r14,r1,0xffff for ( ; block < block_count; block++ ) { 80056c4: 45 c0 00 b3 be r14,r0,8005990 <_Objects_Extend_information+0x324><== NEVER TAKEN if ( information->object_blocks[ block ] == NULL ) { 80056c8: 29 81 00 00 lw r1,(r12+0) 80056cc: 44 20 00 b6 be r1,r0,80059a4 <_Objects_Extend_information+0x338><== NEVER TAKEN 80056d0: b9 80 18 00 mv r3,r12 80056d4: b9 e0 08 00 mv r1,r15 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 80056d8: ba 00 68 00 mv r13,r16 index_base = minimum_index; block = 0; 80056dc: 34 0c 00 00 mvi r12,0 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 80056e0: 35 8c 00 01 addi r12,r12,1 if ( information->object_blocks[ block ] == NULL ) { do_extend = false; break; } else index_base += information->allocation_size; 80056e4: b5 af 68 00 add r13,r13,r15 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 80056e8: 55 cc 00 83 bgu r14,r12,80058f4 <_Objects_Extend_information+0x288> /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 80056ec: 34 0f 00 01 mvi r15,1 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 80056f0: b6 21 88 00 add r17,r17,r1 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 80056f4: 38 02 ff ff mvu r2,0xffff 80056f8: 56 22 00 72 bgu r17,r2,80058c0 <_Objects_Extend_information+0x254><== NEVER TAKEN /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 80056fc: 29 62 00 18 lw r2,(r11+24) 8005700: f8 00 59 dd calli 801be74 <__mulsi3> if ( information->auto_extend ) { 8005704: 41 62 00 12 lbu r2,(r11+18) 8005708: 44 40 00 80 be r2,r0,8005908 <_Objects_Extend_information+0x29c> new_object_block = _Workspace_Allocate( block_size ); 800570c: f8 00 0a 3e calli 8008004 <_Workspace_Allocate> 8005710: b8 20 90 00 mv r18,r1 if ( !new_object_block ) 8005714: 44 20 00 6b be r1,r0,80058c0 <_Objects_Extend_information+0x254> } /* * Do we need to grow the tables? */ if ( do_extend ) { 8005718: 45 e0 00 43 be r15,r0,8005824 <_Objects_Extend_information+0x1b8> */ /* * Up the block count and maximum */ block_count++; 800571c: 35 c1 00 01 addi r1,r14,1 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 8005720: b4 21 98 00 add r19,r1,r1 8005724: b6 61 18 00 add r3,r19,r1 ((maximum + minimum_index) * sizeof(Objects_Control *)); 8005728: b6 23 18 00 add r3,r17,r3 if ( information->auto_extend ) { 800572c: 41 62 00 12 lbu r2,(r11+18) /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 8005730: b4 70 18 00 add r3,r3,r16 block_count++; /* * Allocate the tables and break it up. */ block_size = block_count * 8005734: b4 63 18 00 add r3,r3,r3 8005738: b4 63 18 00 add r3,r3,r3 (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 800573c: 44 40 00 76 be r2,r0,8005914 <_Objects_Extend_information+0x2a8> object_blocks = _Workspace_Allocate( block_size ); 8005740: b8 60 08 00 mv r1,r3 8005744: f8 00 0a 30 calli 8008004 <_Workspace_Allocate> 8005748: b8 20 78 00 mv r15,r1 if ( !object_blocks ) { 800574c: 44 20 00 8e be r1,r0,8005984 <_Objects_Extend_information+0x318> * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 8005750: 2d 61 00 10 lhu r1,(r11+16) /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( object_blocks, block_count * sizeof(void*) ); 8005754: b6 73 a0 00 add r20,r19,r19 8005758: b5 f4 98 00 add r19,r15,r20 800575c: b6 74 a0 00 add r20,r19,r20 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 8005760: 54 30 00 77 bgu r1,r16,800593c <_Objects_Extend_information+0x2d0> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 8005764: ba 80 20 00 mv r4,r20 8005768: 34 03 00 00 mvi r3,0 800576c: 46 00 00 05 be r16,r0,8005780 <_Objects_Extend_information+0x114><== NEVER TAKEN local_table[ index ] = NULL; 8005770: 58 80 00 00 sw (r4+0),r0 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 8005774: 34 63 00 01 addi r3,r3,1 8005778: 34 84 00 04 addi r4,r4,4 800577c: 56 03 ff fd bgu r16,r3,8005770 <_Objects_Extend_information+0x104><== NEVER TAKEN 8005780: b5 ce 70 00 add r14,r14,r14 8005784: b5 ce 70 00 add r14,r14,r14 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 8005788: 2d 65 00 14 lhu r5,(r11+20) } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 800578c: b5 ee 08 00 add r1,r15,r14 8005790: 58 20 00 00 sw (r1+0),r0 inactive_per_block[block_count] = 0; 8005794: b6 6e 70 00 add r14,r19,r14 8005798: 59 c0 00 00 sw (r14+0),r0 for ( index=index_base ; index < ( information->allocation_size + index_base ); 800579c: b5 a5 28 00 add r5,r13,r5 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 80057a0: 51 a5 00 09 bgeu r13,r5,80057c4 <_Objects_Extend_information+0x158><== NEVER TAKEN * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 80057a4: b5 ad 20 00 add r4,r13,r13 80057a8: b4 84 20 00 add r4,r4,r4 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 80057ac: b6 84 20 00 add r4,r20,r4 * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 80057b0: b9 a0 18 00 mv r3,r13 inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 80057b4: 58 80 00 00 sw (r4+0),r0 object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 80057b8: 34 63 00 01 addi r3,r3,1 80057bc: 34 84 00 04 addi r4,r4,4 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 80057c0: 54 a3 ff fd bgu r5,r3,80057b4 <_Objects_Extend_information+0x148> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 80057c4: 90 00 70 00 rcsr r14,IE 80057c8: 34 01 ff fe mvi r1,-2 80057cc: a1 c1 08 00 and r1,r14,r1 80057d0: d0 01 00 00 wcsr IE,r1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 80057d4: 29 61 00 00 lw r1,(r11+0) old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 80057d8: 22 31 ff ff andi r17,r17,0xffff 80057dc: 0d 71 00 10 sh (r11+16),r17 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 80057e0: 29 70 00 34 lw r16,(r11+52) information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 80057e4: 59 73 00 30 sw (r11+48),r19 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 80057e8: 59 6f 00 34 sw (r11+52),r15 information->inactive_per_block = inactive_per_block; information->local_table = local_table; 80057ec: 59 74 00 1c sw (r11+28),r20 80057f0: 34 02 00 18 mvi r2,24 80057f4: f8 00 59 2b calli 801bca0 <__ashlsi3> 80057f8: 78 0f 00 01 mvhi r15,0x1 80057fc: b8 2f 78 00 or r15,r1,r15 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 8005800: 2d 61 00 04 lhu r1,(r11+4) 8005804: 34 02 00 1b mvi r2,27 8005808: f8 00 59 26 calli 801bca0 <__ashlsi3> 800580c: b9 e1 10 00 or r2,r15,r1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 8005810: b8 51 88 00 or r17,r2,r17 information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 8005814: 59 71 00 0c sw (r11+12),r17 information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 8005818: d0 0e 00 00 wcsr IE,r14 _Workspace_Free( old_tables ); 800581c: ba 00 08 00 mv r1,r16 8005820: f8 00 0a 04 calli 8008030 <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 8005824: 29 61 00 34 lw r1,(r11+52) 8005828: b5 8c 60 00 add r12,r12,r12 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 800582c: 2d 63 00 14 lhu r3,(r11+20) 8005830: 29 64 00 18 lw r4,(r11+24) } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 8005834: b5 8c 60 00 add r12,r12,r12 8005838: b4 2c 08 00 add r1,r1,r12 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 800583c: 37 90 00 30 addi r16,sp,48 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 8005840: 58 32 00 00 sw (r1+0),r18 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 8005844: ba 40 10 00 mv r2,r18 8005848: ba 00 08 00 mv r1,r16 800584c: fb ff fc 49 calli 8004970 <_Chain_Initialize> 8005850: 78 12 00 01 mvhi r18,0x1 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 8005854: 35 71 00 20 addi r17,r11,32 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 8005858: e0 00 00 0e bi 8005890 <_Objects_Extend_information+0x224> 800585c: 29 61 00 00 lw r1,(r11+0) 8005860: f8 00 59 10 calli 801bca0 <__ashlsi3> 8005864: b8 32 78 00 or r15,r1,r18 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 8005868: 2d 61 00 04 lhu r1,(r11+4) 800586c: 34 02 00 1b mvi r2,27 8005870: f8 00 59 0c calli 801bca0 <__ashlsi3> 8005874: b9 e1 10 00 or r2,r15,r1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 8005878: b8 4d 10 00 or r2,r2,r13 the_object->id = _Objects_Build_id( 800587c: 59 c2 00 08 sw (r14+8),r2 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 8005880: ba 20 08 00 mv r1,r17 8005884: b9 c0 10 00 mv r2,r14 8005888: fb ff fc 1d calli 80048fc <_Chain_Append> index++; 800588c: 35 ad 00 01 addi r13,r13,1 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 8005890: ba 00 08 00 mv r1,r16 8005894: fb ff fc 26 calli 800492c <_Chain_Get> 8005898: b8 20 70 00 mv r14,r1 800589c: 34 02 00 18 mvi r2,24 80058a0: 5c 20 ff ef bne r1,r0,800585c <_Objects_Extend_information+0x1f0> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 80058a4: 29 63 00 30 lw r3,(r11+48) information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 80058a8: 2d 62 00 2c lhu r2,(r11+44) _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 80058ac: 2d 61 00 14 lhu r1,(r11+20) 80058b0: b4 6c 60 00 add r12,r3,r12 80058b4: 59 81 00 00 sw (r12+0),r1 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 80058b8: b4 22 08 00 add r1,r1,r2 index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = 80058bc: 0d 61 00 2c sh (r11+44),r1 (Objects_Maximum)(information->inactive + information->allocation_size); } 80058c0: 2b 9d 00 04 lw ra,(sp+4) 80058c4: 2b 8b 00 2c lw r11,(sp+44) 80058c8: 2b 8c 00 28 lw r12,(sp+40) 80058cc: 2b 8d 00 24 lw r13,(sp+36) 80058d0: 2b 8e 00 20 lw r14,(sp+32) 80058d4: 2b 8f 00 1c lw r15,(sp+28) 80058d8: 2b 90 00 18 lw r16,(sp+24) 80058dc: 2b 91 00 14 lw r17,(sp+20) 80058e0: 2b 92 00 10 lw r18,(sp+16) 80058e4: 2b 93 00 0c lw r19,(sp+12) 80058e8: 2b 94 00 08 lw r20,(sp+8) 80058ec: 37 9c 00 38 addi sp,sp,56 80058f0: c3 a0 00 00 ret block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { 80058f4: 28 62 00 04 lw r2,(r3+4) 80058f8: 34 63 00 04 addi r3,r3,4 80058fc: 5c 40 ff 79 bne r2,r0,80056e0 <_Objects_Extend_information+0x74> do_extend = false; 8005900: 34 0f 00 00 mvi r15,0 8005904: e3 ff ff 7b bi 80056f0 <_Objects_Extend_information+0x84> if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 8005908: f8 00 09 d3 calli 8008054 <_Workspace_Allocate_or_fatal_error> 800590c: b8 20 90 00 mv r18,r1 8005910: e3 ff ff 82 bi 8005718 <_Objects_Extend_information+0xac> if ( !object_blocks ) { _Workspace_Free( new_object_block ); return; } } else { object_blocks = _Workspace_Allocate_or_fatal_error( block_size ); 8005914: b8 60 08 00 mv r1,r3 8005918: f8 00 09 cf calli 8008054 <_Workspace_Allocate_or_fatal_error> 800591c: b8 20 78 00 mv r15,r1 8005920: e3 ff ff 8c bi 8005750 <_Objects_Extend_information+0xe4> minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 8005924: 2c 31 00 10 lhu r17,(r1+16) /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 8005928: ba 00 68 00 mv r13,r16 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 800592c: 2c 21 00 14 lhu r1,(r1+20) /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 8005930: 34 0f 00 01 mvi r15,1 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; 8005934: 34 0e 00 00 mvi r14,0 8005938: e3 ff ff 6e bi 80056f0 <_Objects_Extend_information+0x84> /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 800593c: 29 62 00 34 lw r2,(r11+52) information->object_blocks, block_count * sizeof(void*) ); 8005940: b5 ce 70 00 add r14,r14,r14 8005944: b5 ce 70 00 add r14,r14,r14 /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 8005948: b9 c0 18 00 mv r3,r14 800594c: b9 e0 08 00 mv r1,r15 8005950: f8 00 21 43 calli 800de5c information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 8005954: 29 62 00 30 lw r2,(r11+48) 8005958: b9 c0 18 00 mv r3,r14 800595c: ba 60 08 00 mv r1,r19 8005960: f8 00 21 3f calli 800de5c information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 8005964: 2d 63 00 10 lhu r3,(r11+16) information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 8005968: 29 62 00 1c lw r2,(r11+28) 800596c: ba 80 08 00 mv r1,r20 information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 8005970: b6 03 18 00 add r3,r16,r3 8005974: b4 63 18 00 add r3,r3,r3 8005978: b4 63 18 00 add r3,r3,r3 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 800597c: f8 00 21 38 calli 800de5c 8005980: e3 ff ff 82 bi 8005788 <_Objects_Extend_information+0x11c> (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { object_blocks = _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block ); 8005984: ba 40 08 00 mv r1,r18 8005988: f8 00 09 aa calli 8008030 <_Workspace_Free> return; 800598c: e3 ff ff cd bi 80058c0 <_Objects_Extend_information+0x254> if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 8005990: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 8005994: ba 00 68 00 mv r13,r16 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 8005998: 34 0f 00 01 mvi r15,1 <== NOT EXECUTED minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 800599c: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED 80059a0: e3 ff ff 54 bi 80056f0 <_Objects_Extend_information+0x84> <== NOT EXECUTED block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { 80059a4: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 80059a8: ba 00 68 00 mv r13,r16 <== NOT EXECUTED else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { do_extend = false; 80059ac: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 80059b0: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED 80059b4: e3 ff ff 4f bi 80056f0 <_Objects_Extend_information+0x84> <== NOT EXECUTED =============================================================================== 08005aa0 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 8005aa0: 37 9c ff f0 addi sp,sp,-16 8005aa4: 5b 8b 00 10 sw (sp+16),r11 8005aa8: 5b 8c 00 0c sw (sp+12),r12 8005aac: 5b 8d 00 08 sw (sp+8),r13 8005ab0: 5b 9d 00 04 sw (sp+4),ra 8005ab4: 20 4c ff ff andi r12,r2,0xffff 8005ab8: b8 20 68 00 mv r13,r1 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) return NULL; 8005abc: 34 0b 00 00 mvi r11,0 ) { Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 8005ac0: 5d 80 00 08 bne r12,r0,8005ae0 <_Objects_Get_information+0x40> if ( info->maximum == 0 ) return NULL; #endif return info; } 8005ac4: b9 60 08 00 mv r1,r11 8005ac8: 2b 9d 00 04 lw ra,(sp+4) 8005acc: 2b 8b 00 10 lw r11,(sp+16) 8005ad0: 2b 8c 00 0c lw r12,(sp+12) 8005ad4: 2b 8d 00 08 lw r13,(sp+8) 8005ad8: 37 9c 00 10 addi sp,sp,16 8005adc: c3 a0 00 00 ret /* * This call implicitly validates the_api so we do not call * _Objects_Is_api_valid above here. */ the_class_api_maximum = _Objects_API_maximum_class( the_api ); 8005ae0: f8 00 15 13 calli 800af2c <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 8005ae4: 44 20 ff f8 be r1,r0,8005ac4 <_Objects_Get_information+0x24> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 8005ae8: 55 81 ff f7 bgu r12,r1,8005ac4 <_Objects_Get_information+0x24> return NULL; if ( !_Objects_Information_table[ the_api ] ) 8005aec: 78 01 08 02 mvhi r1,0x802 8005af0: b5 ad 68 00 add r13,r13,r13 8005af4: 38 21 08 f4 ori r1,r1,0x8f4 8005af8: b5 ad 68 00 add r13,r13,r13 8005afc: b4 2d 08 00 add r1,r1,r13 8005b00: 28 21 00 00 lw r1,(r1+0) 8005b04: 44 20 ff f0 be r1,r0,8005ac4 <_Objects_Get_information+0x24><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 8005b08: b5 8c 60 00 add r12,r12,r12 8005b0c: b5 8c 60 00 add r12,r12,r12 8005b10: b4 2c 08 00 add r1,r1,r12 8005b14: 28 2b 00 00 lw r11,(r1+0) if ( !info ) 8005b18: 45 60 ff eb be r11,r0,8005ac4 <_Objects_Get_information+0x24><== NEVER TAKEN * In a multprocessing configuration, we may access remote objects. * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) 8005b1c: 2d 61 00 10 lhu r1,(r11+16) return NULL; 8005b20: 7c 21 00 00 cmpnei r1,r1,0 8005b24: c8 01 08 00 sub r1,r0,r1 8005b28: a1 61 58 00 and r11,r11,r1 8005b2c: e3 ff ff e6 bi 8005ac4 <_Objects_Get_information+0x24> =============================================================================== 0801624c <_Objects_Get_name_as_string>: char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { 801624c: 37 9c ff e0 addi sp,sp,-32 8016250: 5b 8b 00 14 sw (sp+20),r11 8016254: 5b 8c 00 10 sw (sp+16),r12 8016258: 5b 8d 00 0c sw (sp+12),r13 801625c: 5b 8e 00 08 sw (sp+8),r14 8016260: 5b 9d 00 04 sw (sp+4),ra 8016264: b8 40 60 00 mv r12,r2 8016268: b8 60 58 00 mv r11,r3 char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) 801626c: 5c 40 00 0a bne r2,r0,8016294 <_Objects_Get_name_as_string+0x48> #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* not supported */ #endif case OBJECTS_ERROR: return NULL; 8016270: 34 0b 00 00 mvi r11,0 _Thread_Enable_dispatch(); return name; } return NULL; /* unreachable path */ } 8016274: b9 60 08 00 mv r1,r11 8016278: 2b 9d 00 04 lw ra,(sp+4) 801627c: 2b 8b 00 14 lw r11,(sp+20) 8016280: 2b 8c 00 10 lw r12,(sp+16) 8016284: 2b 8d 00 0c lw r13,(sp+12) 8016288: 2b 8e 00 08 lw r14,(sp+8) 801628c: 37 9c 00 20 addi sp,sp,32 8016290: c3 a0 00 00 ret Objects_Id tmpId; if ( length == 0 ) return NULL; if ( name == NULL ) 8016294: 44 60 ff f8 be r3,r0,8016274 <_Objects_Get_name_as_string+0x28> return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 8016298: b8 20 68 00 mv r13,r1 801629c: 5c 20 00 05 bne r1,r0,80162b0 <_Objects_Get_name_as_string+0x64> 80162a0: 78 01 08 03 mvhi r1,0x803 80162a4: 38 21 57 00 ori r1,r1,0x5700 80162a8: 28 21 00 10 lw r1,(r1+16) 80162ac: 28 2d 00 08 lw r13,(r1+8) information = _Objects_Get_information_id( tmpId ); 80162b0: b9 a0 08 00 mv r1,r13 80162b4: fb ff db 1c calli 800cf24 <_Objects_Get_information_id> 80162b8: b8 20 70 00 mv r14,r1 if ( !information ) 80162bc: 44 20 ff ed be r1,r0,8016270 <_Objects_Get_name_as_string+0x24> return NULL; the_object = _Objects_Get( information, tmpId, &location ); 80162c0: b9 a0 10 00 mv r2,r13 80162c4: 37 83 00 20 addi r3,sp,32 80162c8: fb ff db 69 calli 800d06c <_Objects_Get> switch ( location ) { 80162cc: 2b 82 00 20 lw r2,(sp+32) 80162d0: 5c 40 ff e8 bne r2,r0,8016270 <_Objects_Get_name_as_string+0x24> return NULL; case OBJECTS_LOCAL: #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 80162d4: 41 c3 00 38 lbu r3,(r14+56) 80162d8: 44 62 00 1c be r3,r2,8016348 <_Objects_Get_name_as_string+0xfc> s = the_object->name.name_p; 80162dc: 28 27 00 0c lw r7,(r1+12) lname[ 4 ] = '\0'; s = lname; } d = name; if ( s ) { 80162e0: b9 60 10 00 mv r2,r11 80162e4: 44 e0 00 16 be r7,r0,801633c <_Objects_Get_name_as_string+0xf0> for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 80162e8: 35 8c ff ff addi r12,r12,-1 80162ec: b9 60 10 00 mv r2,r11 80162f0: 45 80 00 13 be r12,r0,801633c <_Objects_Get_name_as_string+0xf0><== NEVER TAKEN 80162f4: 40 e1 00 00 lbu r1,(r7+0) 80162f8: 44 20 00 11 be r1,r0,801633c <_Objects_Get_name_as_string+0xf0> 80162fc: 78 04 08 03 mvhi r4,0x803 8016300: 34 03 00 00 mvi r3,0 8016304: 38 84 44 48 ori r4,r4,0x4448 *d = (isprint((unsigned char)*s)) ? *s : '*'; 8016308: 28 85 00 00 lw r5,(r4+0) s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 801630c: 34 63 00 01 addi r3,r3,1 * This method objects the name of an object and returns its name * in the form of a C string. It attempts to be careful about * overflowing the user's string and about returning unprintable characters. */ char *_Objects_Get_name_as_string( 8016310: b4 e3 30 00 add r6,r7,r3 } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { *d = (isprint((unsigned char)*s)) ? *s : '*'; 8016314: b4 a1 28 00 add r5,r5,r1 8016318: 40 a5 00 01 lbu r5,(r5+1) 801631c: 20 a5 00 97 andi r5,r5,0x97 8016320: 5c a0 00 02 bne r5,r0,8016328 <_Objects_Get_name_as_string+0xdc> 8016324: 34 01 00 2a mvi r1,42 8016328: 30 41 00 00 sb (r2+0),r1 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 801632c: 34 42 00 01 addi r2,r2,1 8016330: 50 6c 00 03 bgeu r3,r12,801633c <_Objects_Get_name_as_string+0xf0> 8016334: 40 c1 00 00 lbu r1,(r6+0) 8016338: 5c 20 ff f4 bne r1,r0,8016308 <_Objects_Get_name_as_string+0xbc> *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; 801633c: 30 40 00 00 sb (r2+0),r0 _Thread_Enable_dispatch(); 8016340: fb ff e0 02 calli 800e348 <_Thread_Enable_dispatch> return name; 8016344: e3 ff ff cc bi 8016274 <_Objects_Get_name_as_string+0x28> if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 8016348: 28 2d 00 0c lw r13,(r1+12) lname[ 0 ] = (u32_name >> 24) & 0xff; 801634c: 34 02 00 18 mvi r2,24 8016350: b9 a0 08 00 mv r1,r13 8016354: f8 00 5e ed calli 802df08 <__lshrsi3> 8016358: 33 81 00 18 sb (sp+24),r1 lname[ 1 ] = (u32_name >> 16) & 0xff; 801635c: 34 02 00 10 mvi r2,16 8016360: b9 a0 08 00 mv r1,r13 8016364: f8 00 5e e9 calli 802df08 <__lshrsi3> lname[ 2 ] = (u32_name >> 8) & 0xff; 8016368: 01 a2 00 01 srui r2,r13,1 #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 801636c: 33 81 00 19 sb (sp+25),r1 lname[ 2 ] = (u32_name >> 8) & 0xff; 8016370: 00 42 00 01 srui r2,r2,1 lname[ 3 ] = (u32_name >> 0) & 0xff; 8016374: 33 8d 00 1b sb (sp+27),r13 { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 8016378: 00 42 00 01 srui r2,r2,1 lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 801637c: 33 80 00 1c sb (sp+28),r0 { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 8016380: 00 42 00 01 srui r2,r2,1 lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; s = lname; 8016384: 37 87 00 18 addi r7,sp,24 { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 8016388: 00 42 00 01 srui r2,r2,1 801638c: 00 42 00 01 srui r2,r2,1 8016390: 00 42 00 01 srui r2,r2,1 8016394: 00 42 00 01 srui r2,r2,1 8016398: 33 82 00 1a sb (sp+26),r2 801639c: e3 ff ff d3 bi 80162e8 <_Objects_Get_name_as_string+0x9c> =============================================================================== 08018ca4 <_Objects_Get_no_protection>: /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 8018ca4: 28 25 00 08 lw r5,(r1+8) if ( information->maximum >= index ) { 8018ca8: 2c 24 00 10 lhu r4,(r1+16) /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 8018cac: c8 45 10 00 sub r2,r2,r5 8018cb0: 34 42 00 01 addi r2,r2,1 if ( information->maximum >= index ) { 8018cb4: 54 44 00 09 bgu r2,r4,8018cd8 <_Objects_Get_no_protection+0x34> if ( (the_object = information->local_table[ index ]) != NULL ) { 8018cb8: 28 24 00 1c lw r4,(r1+28) 8018cbc: b4 42 08 00 add r1,r2,r2 8018cc0: b4 21 08 00 add r1,r1,r1 8018cc4: b4 81 08 00 add r1,r4,r1 8018cc8: 28 21 00 00 lw r1,(r1+0) 8018ccc: 44 20 00 03 be r1,r0,8018cd8 <_Objects_Get_no_protection+0x34><== NEVER TAKEN *location = OBJECTS_LOCAL; 8018cd0: 58 60 00 00 sw (r3+0),r0 return the_object; 8018cd4: c3 a0 00 00 ret /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 8018cd8: 34 01 00 01 mvi r1,1 8018cdc: 58 61 00 00 sw (r3+0),r1 return NULL; 8018ce0: 34 01 00 00 mvi r1,0 } 8018ce4: c3 a0 00 00 ret =============================================================================== 0800d104 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 800d104: 37 9c ff e8 addi sp,sp,-24 800d108: 5b 8b 00 14 sw (sp+20),r11 800d10c: 5b 8c 00 10 sw (sp+16),r12 800d110: 5b 8d 00 0c sw (sp+12),r13 800d114: 5b 8e 00 08 sw (sp+8),r14 800d118: 5b 9d 00 04 sw (sp+4),ra /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 800d11c: b8 20 58 00 mv r11,r1 Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 800d120: b8 40 70 00 mv r14,r2 /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 800d124: 5c 20 00 05 bne r1,r0,800d138 <_Objects_Id_to_name+0x34> 800d128: 78 01 08 03 mvhi r1,0x803 800d12c: 38 21 57 00 ori r1,r1,0x5700 800d130: 28 21 00 10 lw r1,(r1+16) 800d134: 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); 800d138: b9 60 08 00 mv r1,r11 800d13c: 34 02 00 18 mvi r2,24 800d140: f8 00 83 72 calli 802df08 <__lshrsi3> 800d144: 20 23 00 07 andi r3,r1,0x7 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 800d148: 34 64 ff ff addi r4,r3,-1 800d14c: 34 01 00 02 mvi r1,2 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 800d150: 34 0c 00 03 mvi r12,3 800d154: 54 81 00 12 bgu r4,r1,800d19c <_Objects_Id_to_name+0x98> if ( !_Objects_Information_table[ the_api ] ) 800d158: 78 04 08 03 mvhi r4,0x803 800d15c: b4 63 18 00 add r3,r3,r3 800d160: 38 84 51 d4 ori r4,r4,0x51d4 800d164: b4 63 18 00 add r3,r3,r3 800d168: b4 83 18 00 add r3,r4,r3 800d16c: 28 6d 00 00 lw r13,(r3+0) 800d170: 45 a0 00 0b be r13,r0,800d19c <_Objects_Id_to_name+0x98> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 800d174: b9 60 08 00 mv r1,r11 800d178: 34 02 00 1b mvi r2,27 800d17c: f8 00 83 63 calli 802df08 <__lshrsi3> return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 800d180: b4 21 18 00 add r3,r1,r1 800d184: b4 63 18 00 add r3,r3,r3 800d188: b5 a3 18 00 add r3,r13,r3 800d18c: 28 63 00 00 lw r3,(r3+0) if ( !information ) 800d190: 44 60 00 03 be r3,r0,800d19c <_Objects_Id_to_name+0x98> <== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 800d194: 40 6d 00 38 lbu r13,(r3+56) 800d198: 45 a0 00 09 be r13,r0,800d1bc <_Objects_Id_to_name+0xb8> <== ALWAYS TAKEN return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 800d19c: b9 80 08 00 mv r1,r12 800d1a0: 2b 9d 00 04 lw ra,(sp+4) 800d1a4: 2b 8b 00 14 lw r11,(sp+20) 800d1a8: 2b 8c 00 10 lw r12,(sp+16) 800d1ac: 2b 8d 00 0c lw r13,(sp+12) 800d1b0: 2b 8e 00 08 lw r14,(sp+8) 800d1b4: 37 9c 00 18 addi sp,sp,24 800d1b8: c3 a0 00 00 ret #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 800d1bc: b8 60 08 00 mv r1,r3 800d1c0: b9 60 10 00 mv r2,r11 800d1c4: 37 83 00 18 addi r3,sp,24 800d1c8: fb ff ff a9 calli 800d06c <_Objects_Get> if ( !the_object ) 800d1cc: 44 2d ff f4 be r1,r13,800d19c <_Objects_Id_to_name+0x98> return OBJECTS_INVALID_ID; *name = the_object->name; 800d1d0: 28 21 00 0c lw r1,(r1+12) _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 800d1d4: 34 0c 00 00 mvi r12,0 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; 800d1d8: 59 c1 00 00 sw (r14+0),r1 _Thread_Enable_dispatch(); 800d1dc: f8 00 04 5b calli 800e348 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 800d1e0: b9 80 08 00 mv r1,r12 800d1e4: 2b 9d 00 04 lw ra,(sp+4) 800d1e8: 2b 8b 00 14 lw r11,(sp+20) 800d1ec: 2b 8c 00 10 lw r12,(sp+16) 800d1f0: 2b 8d 00 0c lw r13,(sp+12) 800d1f4: 2b 8e 00 08 lw r14,(sp+8) 800d1f8: 37 9c 00 18 addi sp,sp,24 800d1fc: c3 a0 00 00 ret =============================================================================== 08005de4 <_Objects_Shrink_information>: #include void _Objects_Shrink_information( Objects_Information *information ) { 8005de4: 37 9c ff ec addi sp,sp,-20 8005de8: 5b 8b 00 14 sw (sp+20),r11 8005dec: 5b 8c 00 10 sw (sp+16),r12 8005df0: 5b 8d 00 0c sw (sp+12),r13 8005df4: 5b 8e 00 08 sw (sp+8),r14 8005df8: 5b 9d 00 04 sw (sp+4),ra /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 8005dfc: 2c 2c 00 0a lhu r12,(r1+10) block_count = (information->maximum - index_base) / 8005e00: 2c 2d 00 14 lhu r13,(r1+20) #include void _Objects_Shrink_information( Objects_Information *information ) { 8005e04: b8 20 70 00 mv r14,r1 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / 8005e08: 2c 21 00 10 lhu r1,(r1+16) 8005e0c: b9 a0 10 00 mv r2,r13 8005e10: c8 2c 08 00 sub r1,r1,r12 8005e14: f8 00 58 7d calli 801c008 <__udivsi3> information->allocation_size; for ( block = 0; block < block_count; block++ ) { 8005e18: 44 20 00 09 be r1,r0,8005e3c <_Objects_Shrink_information+0x58><== NEVER TAKEN if ( information->inactive_per_block[ block ] == 8005e1c: 29 c5 00 30 lw r5,(r14+48) 8005e20: 34 0b 00 04 mvi r11,4 8005e24: 34 03 00 00 mvi r3,0 8005e28: 28 a2 00 00 lw r2,(r5+0) 8005e2c: 45 a2 00 11 be r13,r2,8005e70 <_Objects_Shrink_information+0x8c><== NEVER TAKEN index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 8005e30: 34 63 00 01 addi r3,r3,1 #include #include #include #include void _Objects_Shrink_information( 8005e34: b4 ab 10 00 add r2,r5,r11 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 8005e38: 54 23 00 08 bgu r1,r3,8005e58 <_Objects_Shrink_information+0x74> return; } index_base += information->allocation_size; } } 8005e3c: 2b 9d 00 04 lw ra,(sp+4) 8005e40: 2b 8b 00 14 lw r11,(sp+20) 8005e44: 2b 8c 00 10 lw r12,(sp+16) 8005e48: 2b 8d 00 0c lw r13,(sp+12) 8005e4c: 2b 8e 00 08 lw r14,(sp+8) 8005e50: 37 9c 00 14 addi sp,sp,20 8005e54: c3 a0 00 00 ret index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 8005e58: 28 42 00 00 lw r2,(r2+0) information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 8005e5c: 35 64 00 04 addi r4,r11,4 8005e60: b5 8d 60 00 add r12,r12,r13 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 8005e64: 45 a2 00 04 be r13,r2,8005e74 <_Objects_Shrink_information+0x90> 8005e68: b8 80 58 00 mv r11,r4 8005e6c: e3 ff ff f1 bi 8005e30 <_Objects_Shrink_information+0x4c> 8005e70: 34 0b 00 00 mvi r11,0 <== NOT EXECUTED information->allocation_size ) { /* * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) _Chain_First( &information->Inactive ); 8005e74: 29 c1 00 20 lw r1,(r14+32) do { index = _Objects_Get_index( the_object->id ); 8005e78: 2c 22 00 0a lhu r2,(r1+10) /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 8005e7c: 28 2d 00 00 lw r13,(r1+0) if ((index >= index_base) && 8005e80: 55 82 00 05 bgu r12,r2,8005e94 <_Objects_Shrink_information+0xb0> (index < (index_base + information->allocation_size))) { 8005e84: 2d c3 00 14 lhu r3,(r14+20) 8005e88: b5 83 18 00 add r3,r12,r3 /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && 8005e8c: 50 43 00 02 bgeu r2,r3,8005e94 <_Objects_Shrink_information+0xb0> (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 8005e90: f8 00 12 cf calli 800a9cc <_Chain_Extract> } } while ( the_object ); 8005e94: 45 a0 00 03 be r13,r0,8005ea0 <_Objects_Shrink_information+0xbc> index = _Objects_Get_index( the_object->id ); /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 8005e98: b9 a0 08 00 mv r1,r13 8005e9c: e3 ff ff f7 bi 8005e78 <_Objects_Shrink_information+0x94> while ( the_object ); /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 8005ea0: 29 c1 00 34 lw r1,(r14+52) 8005ea4: b4 2b 08 00 add r1,r1,r11 8005ea8: 28 21 00 00 lw r1,(r1+0) 8005eac: f8 00 08 61 calli 8008030 <_Workspace_Free> information->object_blocks[ block ] = NULL; 8005eb0: 29 c2 00 34 lw r2,(r14+52) information->inactive_per_block[ block ] = 0; 8005eb4: 29 c4 00 30 lw r4,(r14+48) information->inactive -= information->allocation_size; 8005eb8: 2d c3 00 2c lhu r3,(r14+44) 8005ebc: 2d c1 00 14 lhu r1,(r14+20) /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 8005ec0: b4 4b 10 00 add r2,r2,r11 8005ec4: 58 40 00 00 sw (r2+0),r0 information->inactive_per_block[ block ] = 0; 8005ec8: b4 8b 58 00 add r11,r4,r11 8005ecc: 59 60 00 00 sw (r11+0),r0 information->inactive -= information->allocation_size; 8005ed0: c8 61 08 00 sub r1,r3,r1 8005ed4: 0d c1 00 2c sh (r14+44),r1 return; } index_base += information->allocation_size; } } 8005ed8: 2b 9d 00 04 lw ra,(sp+4) 8005edc: 2b 8b 00 14 lw r11,(sp+20) 8005ee0: 2b 8c 00 10 lw r12,(sp+16) 8005ee4: 2b 8d 00 0c lw r13,(sp+12) 8005ee8: 2b 8e 00 08 lw r14,(sp+8) 8005eec: 37 9c 00 14 addi sp,sp,20 8005ef0: c3 a0 00 00 ret =============================================================================== 0800c854 <_POSIX_Keys_Run_destructors>: */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 800c854: 37 9c ff e8 addi sp,sp,-24 800c858: 5b 8b 00 18 sw (sp+24),r11 800c85c: 5b 8c 00 14 sw (sp+20),r12 800c860: 5b 8d 00 10 sw (sp+16),r13 800c864: 5b 8e 00 0c sw (sp+12),r14 800c868: 5b 8f 00 08 sw (sp+8),r15 800c86c: 5b 9d 00 04 sw (sp+4),ra Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); 800c870: 28 2e 00 08 lw r14,(r1+8) 800c874: 34 02 00 18 mvi r2,24 800c878: 78 0b 08 02 mvhi r11,0x802 800c87c: b9 c0 08 00 mv r1,r14 800c880: f8 00 3d 56 calli 801bdd8 <__lshrsi3> 800c884: 20 21 00 07 andi r1,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 ]; 800c888: 21 ce ff ff andi r14,r14,0xffff 800c88c: 34 21 00 04 addi r1,r1,4 800c890: b5 ce 70 00 add r14,r14,r14 800c894: b4 21 08 00 add r1,r1,r1 800c898: b5 ce 70 00 add r14,r14,r14 800c89c: 39 6b 0c ac ori r11,r11,0xcac 800c8a0: b4 21 78 00 add r15,r1,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; 800c8a4: 2d 6c 00 10 lhu r12,(r11+16) done = true; for ( index = 1 ; index <= max ; ++index ) { 800c8a8: 5d 80 00 09 bne r12,r0,800c8cc <_POSIX_Keys_Run_destructors+0x78> done = false; } } } } } 800c8ac: 2b 9d 00 04 lw ra,(sp+4) 800c8b0: 2b 8b 00 18 lw r11,(sp+24) 800c8b4: 2b 8c 00 14 lw r12,(sp+20) 800c8b8: 2b 8d 00 10 lw r13,(sp+16) 800c8bc: 2b 8e 00 0c lw r14,(sp+12) 800c8c0: 2b 8f 00 08 lw r15,(sp+8) 800c8c4: 37 9c 00 18 addi sp,sp,24 800c8c8: c3 a0 00 00 ret Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 800c8cc: 34 0d 00 01 mvi r13,1 800c8d0: 34 03 00 01 mvi r3,1 POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; 800c8d4: 29 62 00 1c lw r2,(r11+28) 800c8d8: b5 ad 08 00 add r1,r13,r13 800c8dc: b4 21 08 00 add r1,r1,r1 800c8e0: b4 41 08 00 add r1,r2,r1 Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) 800c8e4: 28 21 00 00 lw r1,(r1+0) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 800c8e8: b4 2f 10 00 add r2,r1,r15 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 ) { 800c8ec: 44 20 00 0b be r1,r0,800c918 <_POSIX_Keys_Run_destructors+0xc4> 800c8f0: 28 24 00 10 lw r4,(r1+16) 800c8f4: 44 80 00 09 be r4,r0,800c918 <_POSIX_Keys_Run_destructors+0xc4> void *value = key->Values [ thread_api ][ thread_index ]; 800c8f8: 28 42 00 04 lw r2,(r2+4) 800c8fc: b4 4e 10 00 add r2,r2,r14 800c900: 28 45 00 00 lw r5,(r2+0) if ( value != NULL ) { key->Values [ thread_api ][ thread_index ] = NULL; (*key->destructor)( value ); 800c904: b8 a0 08 00 mv r1,r5 _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; if ( value != NULL ) { 800c908: 44 a0 00 04 be r5,r0,800c918 <_POSIX_Keys_Run_destructors+0xc4><== ALWAYS TAKEN key->Values [ thread_api ][ thread_index ] = NULL; 800c90c: 58 40 00 00 sw (r2+0),r0 <== NOT EXECUTED (*key->destructor)( value ); 800c910: d8 80 00 00 call r4 <== NOT EXECUTED done = false; 800c914: 34 03 00 00 mvi r3,0 <== NOT EXECUTED Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 800c918: 35 ad 00 01 addi r13,r13,1 800c91c: 21 ad ff ff andi r13,r13,0xffff 800c920: 51 8d ff ed bgeu r12,r13,800c8d4 <_POSIX_Keys_Run_destructors+0x80> * 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 ) { 800c924: 44 60 ff e0 be r3,r0,800c8a4 <_POSIX_Keys_Run_destructors+0x50><== NEVER TAKEN 800c928: e3 ff ff e1 bi 800c8ac <_POSIX_Keys_Run_destructors+0x58> =============================================================================== 0800bd9c <_POSIX_Message_queue_Create_support>: size_t name_len, int pshared, struct mq_attr *attr_ptr, POSIX_Message_queue_Control **message_queue ) { 800bd9c: 37 9c ff dc addi sp,sp,-36 800bda0: 5b 8b 00 20 sw (sp+32),r11 800bda4: 5b 8c 00 1c sw (sp+28),r12 800bda8: 5b 8d 00 18 sw (sp+24),r13 800bdac: 5b 8e 00 14 sw (sp+20),r14 800bdb0: 5b 8f 00 10 sw (sp+16),r15 800bdb4: 5b 90 00 0c sw (sp+12),r16 800bdb8: 5b 91 00 08 sw (sp+8),r17 800bdbc: 5b 9d 00 04 sw (sp+4),ra * * 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; 800bdc0: 78 06 08 02 mvhi r6,0x802 800bdc4: 38 c6 53 28 ori r6,r6,0x5328 800bdc8: 28 c7 00 00 lw r7,(r6+0) 800bdcc: b8 20 68 00 mv r13,r1 800bdd0: b8 60 80 00 mv r16,r3 ++level; 800bdd4: 34 e7 00 01 addi r7,r7,1 _Thread_Dispatch_disable_level = level; 800bdd8: 58 c7 00 00 sw (r6+0),r7 800bddc: b8 a0 88 00 mv r17,r5 * There is no real basis for the default values. They will work * but were not compared against any existing implementation for * compatibility. See README.mqueue for an example program we * think will print out the defaults. Report anything you find with it. */ if ( attr_ptr == NULL ) { 800bde0: 44 80 00 0c be r4,r0,800be10 <_POSIX_Message_queue_Create_support+0x74> attr.mq_maxmsg = 10; attr.mq_msgsize = 16; } else { if ( attr_ptr->mq_maxmsg <= 0 ){ 800bde4: 28 8e 00 04 lw r14,(r4+4) 800bde8: 49 c0 00 07 bg r14,r0,800be04 <_POSIX_Message_queue_Create_support+0x68> _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EINVAL ); } if ( attr_ptr->mq_msgsize <= 0 ){ _Thread_Enable_dispatch(); 800bdec: fb ff f3 f8 calli 8008dcc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EINVAL ); 800bdf0: f8 00 0e 72 calli 800f7b8 <__errno> 800bdf4: 34 02 00 16 mvi r2,22 800bdf8: 58 22 00 00 sw (r1+0),r2 800bdfc: 34 01 ff ff mvi r1,-1 800be00: e0 00 00 29 bi 800bea4 <_POSIX_Message_queue_Create_support+0x108> if ( attr_ptr->mq_maxmsg <= 0 ){ _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EINVAL ); } if ( attr_ptr->mq_msgsize <= 0 ){ 800be04: 28 8f 00 08 lw r15,(r4+8) 800be08: 49 e0 00 04 bg r15,r0,800be18 <_POSIX_Message_queue_Create_support+0x7c> 800be0c: e3 ff ff f8 bi 800bdec <_POSIX_Message_queue_Create_support+0x50> * compatibility. See README.mqueue for an example program we * think will print out the defaults. Report anything you find with it. */ if ( attr_ptr == NULL ) { attr.mq_maxmsg = 10; attr.mq_msgsize = 16; 800be10: 34 0f 00 10 mvi r15,16 * but were not compared against any existing implementation for * compatibility. See README.mqueue for an example program we * think will print out the defaults. Report anything you find with it. */ if ( attr_ptr == NULL ) { attr.mq_maxmsg = 10; 800be14: 34 0e 00 0a mvi r14,10 RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void ) { return (POSIX_Message_queue_Control *) _Objects_Allocate( &_POSIX_Message_queue_Information ); 800be18: 78 0c 08 02 mvhi r12,0x802 800be1c: 39 8c 55 e4 ori r12,r12,0x55e4 800be20: b9 80 08 00 mv r1,r12 800be24: 5b 82 00 24 sw (sp+36),r2 800be28: fb ff ee 50 calli 8007768 <_Objects_Allocate> 800be2c: b8 20 58 00 mv r11,r1 attr = *attr_ptr; } the_mq = _POSIX_Message_queue_Allocate(); if ( !the_mq ) { 800be30: 2b 82 00 24 lw r2,(sp+36) 800be34: 44 20 00 3a be r1,r0,800bf1c <_POSIX_Message_queue_Create_support+0x180><== NEVER TAKEN /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ name = _Workspace_String_duplicate( name_arg, name_len ); 800be38: b9 a0 08 00 mv r1,r13 800be3c: f8 00 07 66 calli 800dbd4 <_Workspace_String_duplicate> 800be40: b8 20 68 00 mv r13,r1 if ( !name ) { 800be44: 44 20 00 2d be r1,r0,800bef8 <_POSIX_Message_queue_Create_support+0x15c> rtems_set_errno_and_return_minus_one( ENOMEM ); } the_mq->process_shared = pshared; the_mq->named = true; the_mq->open_count = 1; 800be48: 34 01 00 01 mvi r1,1 _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENOMEM ); } the_mq->process_shared = pshared; the_mq->named = true; 800be4c: 34 02 00 01 mvi r2,1 800be50: 31 62 00 14 sb (r11+20),r2 the_mq->open_count = 1; 800be54: 59 61 00 18 sw (r11+24),r1 the_mq->linked = true; 800be58: 31 61 00 15 sb (r11+21),r1 _POSIX_Message_queue_Free( the_mq ); _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENOMEM ); } the_mq->process_shared = pshared; 800be5c: 59 70 00 10 sw (r11+16),r16 * * Joel: Cite POSIX or OpenGroup on above statement so we can determine * if it is a real requirement. */ the_mq_attr = &the_mq->Message_queue.Attributes; the_mq_attr->discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; 800be60: 59 60 00 5c sw (r11+92),r0 if ( !_CORE_message_queue_Initialize( 800be64: 35 61 00 1c addi r1,r11,28 800be68: 35 62 00 5c addi r2,r11,92 800be6c: b9 c0 18 00 mv r3,r14 800be70: b9 e0 20 00 mv r4,r15 800be74: f8 00 04 35 calli 800cf48 <_CORE_message_queue_Initialize> 800be78: 44 20 00 15 be r1,r0,800becc <_POSIX_Message_queue_Create_support+0x130><== NEVER TAKEN Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 800be7c: 2d 62 00 0a lhu r2,(r11+10) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 800be80: 29 81 00 1c lw r1,(r12+28) 800be84: b4 42 10 00 add r2,r2,r2 800be88: b4 42 10 00 add r2,r2,r2 800be8c: b4 22 10 00 add r2,r1,r2 800be90: 58 4b 00 00 sw (r2+0),r11 the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 800be94: 59 6d 00 0c sw (r11+12),r13 &_POSIX_Message_queue_Information, &the_mq->Object, name ); *message_queue = the_mq; 800be98: 5a 2b 00 00 sw (r17+0),r11 _Thread_Enable_dispatch(); 800be9c: fb ff f3 cc calli 8008dcc <_Thread_Enable_dispatch> return 0; 800bea0: 34 01 00 00 mvi r1,0 } 800bea4: 2b 9d 00 04 lw ra,(sp+4) 800bea8: 2b 8b 00 20 lw r11,(sp+32) 800beac: 2b 8c 00 1c lw r12,(sp+28) 800beb0: 2b 8d 00 18 lw r13,(sp+24) 800beb4: 2b 8e 00 14 lw r14,(sp+20) 800beb8: 2b 8f 00 10 lw r15,(sp+16) 800bebc: 2b 90 00 0c lw r16,(sp+12) 800bec0: 2b 91 00 08 lw r17,(sp+8) 800bec4: 37 9c 00 24 addi sp,sp,36 800bec8: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free ( POSIX_Message_queue_Control *the_mq ) { _Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object ); 800becc: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 800bed0: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 800bed4: fb ff ef 30 calli 8007b94 <_Objects_Free> <== NOT EXECUTED attr.mq_maxmsg, attr.mq_msgsize ) ) { _POSIX_Message_queue_Free( the_mq ); _Workspace_Free(name); 800bed8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 800bedc: fb ff f8 e1 calli 800a260 <_Workspace_Free> <== NOT EXECUTED _Thread_Enable_dispatch(); 800bee0: fb ff f3 bb calli 8008dcc <_Thread_Enable_dispatch> <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOSPC ); 800bee4: f8 00 0e 35 calli 800f7b8 <__errno> <== NOT EXECUTED 800bee8: 34 02 00 1c mvi r2,28 <== NOT EXECUTED 800beec: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800bef0: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800bef4: e3 ff ff ec bi 800bea4 <_POSIX_Message_queue_Create_support+0x108><== NOT EXECUTED 800bef8: b9 60 10 00 mv r2,r11 800befc: b9 80 08 00 mv r1,r12 800bf00: fb ff ef 25 calli 8007b94 <_Objects_Free> * dynamically constructed. */ name = _Workspace_String_duplicate( name_arg, name_len ); if ( !name ) { _POSIX_Message_queue_Free( the_mq ); _Thread_Enable_dispatch(); 800bf04: fb ff f3 b2 calli 8008dcc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOMEM ); 800bf08: f8 00 0e 2c calli 800f7b8 <__errno> 800bf0c: 34 02 00 0c mvi r2,12 800bf10: 58 22 00 00 sw (r1+0),r2 800bf14: 34 01 ff ff mvi r1,-1 800bf18: e3 ff ff e3 bi 800bea4 <_POSIX_Message_queue_Create_support+0x108> attr = *attr_ptr; } the_mq = _POSIX_Message_queue_Allocate(); if ( !the_mq ) { _Thread_Enable_dispatch(); 800bf1c: fb ff f3 ac calli 8008dcc <_Thread_Enable_dispatch> <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENFILE ); 800bf20: f8 00 0e 26 calli 800f7b8 <__errno> <== NOT EXECUTED 800bf24: 34 02 00 17 mvi r2,23 <== NOT EXECUTED 800bf28: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800bf2c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800bf30: e3 ff ff dd bi 800bea4 <_POSIX_Message_queue_Create_support+0x108><== NOT EXECUTED =============================================================================== 08009a70 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 8009a70: 37 9c ff dc addi sp,sp,-36 8009a74: 5b 8b 00 1c sw (sp+28),r11 8009a78: 5b 8c 00 18 sw (sp+24),r12 8009a7c: 5b 8d 00 14 sw (sp+20),r13 8009a80: 5b 8e 00 10 sw (sp+16),r14 8009a84: 5b 8f 00 0c sw (sp+12),r15 8009a88: 5b 90 00 08 sw (sp+8),r16 8009a8c: 5b 9d 00 04 sw (sp+4),ra 8009a90: b8 20 58 00 mv r11,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( 8009a94: 78 01 08 02 mvhi r1,0x802 8009a98: b8 40 78 00 mv r15,r2 8009a9c: b8 60 60 00 mv r12,r3 8009aa0: b9 60 10 00 mv r2,r11 8009aa4: 38 21 b2 40 ori r1,r1,0xb240 8009aa8: 37 83 00 24 addi r3,sp,36 8009aac: b8 80 68 00 mv r13,r4 8009ab0: b8 c0 70 00 mv r14,r6 8009ab4: 20 b0 00 ff andi r16,r5,0xff 8009ab8: f8 00 0d bb calli 800d1a4 <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 8009abc: 2b 82 00 24 lw r2,(sp+36) 8009ac0: 44 40 00 0e be r2,r0,8009af8 <_POSIX_Message_queue_Receive_support+0x88> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 8009ac4: f8 00 2d 56 calli 801501c <__errno> 8009ac8: 34 02 00 09 mvi r2,9 8009acc: 58 22 00 00 sw (r1+0),r2 8009ad0: 34 01 ff ff mvi r1,-1 } 8009ad4: 2b 9d 00 04 lw ra,(sp+4) 8009ad8: 2b 8b 00 1c lw r11,(sp+28) 8009adc: 2b 8c 00 18 lw r12,(sp+24) 8009ae0: 2b 8d 00 14 lw r13,(sp+20) 8009ae4: 2b 8e 00 10 lw r14,(sp+16) 8009ae8: 2b 8f 00 0c lw r15,(sp+12) 8009aec: 2b 90 00 08 lw r16,(sp+8) 8009af0: 37 9c 00 24 addi sp,sp,36 8009af4: c3 a0 00 00 ret the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 8009af8: 28 24 00 14 lw r4,(r1+20) 8009afc: 34 07 00 01 mvi r7,1 8009b00: 20 88 00 03 andi r8,r4,0x3 8009b04: 45 07 00 3a be r8,r7,8009bec <_POSIX_Message_queue_Receive_support+0x17c> _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 8009b08: 28 27 00 10 lw r7,(r1+16) if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 8009b0c: 28 e1 00 68 lw r1,(r7+104) 8009b10: 51 81 00 07 bgeu r12,r1,8009b2c <_POSIX_Message_queue_Receive_support+0xbc> _Thread_Enable_dispatch(); 8009b14: f8 00 11 e5 calli 800e2a8 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 8009b18: f8 00 2d 41 calli 801501c <__errno> 8009b1c: 34 02 00 7a mvi r2,122 8009b20: 58 22 00 00 sw (r1+0),r2 8009b24: 34 01 ff ff mvi r1,-1 8009b28: e3 ff ff eb bi 8009ad4 <_POSIX_Message_queue_Receive_support+0x64> /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 8009b2c: 34 01 ff ff mvi r1,-1 8009b30: 5b 81 00 20 sw (sp+32),r1 /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 8009b34: 34 05 00 00 mvi r5,0 8009b38: 5e 00 00 17 bne r16,r0,8009b94 <_POSIX_Message_queue_Receive_support+0x124> do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 8009b3c: 34 e1 00 1c addi r1,r7,28 8009b40: b9 60 10 00 mv r2,r11 8009b44: b9 e0 18 00 mv r3,r15 8009b48: 37 84 00 20 addi r4,sp,32 8009b4c: b9 c0 30 00 mv r6,r14 8009b50: f8 00 08 45 calli 800bc64 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 8009b54: f8 00 11 d5 calli 800e2a8 <_Thread_Enable_dispatch> if (msg_prio) { 8009b58: 45 a0 00 19 be r13,r0,8009bbc <_POSIX_Message_queue_Receive_support+0x14c><== NEVER TAKEN *msg_prio = _POSIX_Message_queue_Priority_from_core( _Thread_Executing->Wait.count 8009b5c: 78 0b 08 02 mvhi r11,0x802 8009b60: 39 6b b2 c0 ori r11,r11,0xb2c0 8009b64: 29 6c 00 10 lw r12,(r11+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); 8009b68: 34 02 00 1f mvi r2,31 8009b6c: 29 81 00 24 lw r1,(r12+36) 8009b70: f8 00 6f 36 calli 8025848 <__ashrsi3> 8009b74: 29 82 00 24 lw r2,(r12+36) 8009b78: 98 22 10 00 xor r2,r1,r2 8009b7c: c8 41 08 00 sub r1,r2,r1 timeout ); _Thread_Enable_dispatch(); if (msg_prio) { *msg_prio = _POSIX_Message_queue_Priority_from_core( 8009b80: 59 a1 00 00 sw (r13+0),r1 _Thread_Executing->Wait.count ); } if ( !_Thread_Executing->Wait.return_code ) 8009b84: 29 81 00 34 lw r1,(r12+52) 8009b88: 5c 20 00 11 bne r1,r0,8009bcc <_POSIX_Message_queue_Receive_support+0x15c> return length_out; 8009b8c: 2b 81 00 20 lw r1,(sp+32) 8009b90: e3 ff ff d1 bi 8009ad4 <_POSIX_Message_queue_Receive_support+0x64> /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 8009b94: 20 85 40 00 andi r5,r4,0x4000 length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 8009b98: 64 a5 00 00 cmpei r5,r5,0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 8009b9c: 34 e1 00 1c addi r1,r7,28 8009ba0: b9 60 10 00 mv r2,r11 8009ba4: b9 e0 18 00 mv r3,r15 8009ba8: 37 84 00 20 addi r4,sp,32 8009bac: b9 c0 30 00 mv r6,r14 8009bb0: f8 00 08 2d calli 800bc64 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 8009bb4: f8 00 11 bd calli 800e2a8 <_Thread_Enable_dispatch> if (msg_prio) { 8009bb8: 5d a0 ff e9 bne r13,r0,8009b5c <_POSIX_Message_queue_Receive_support+0xec><== ALWAYS TAKEN 8009bbc: 78 0b 08 02 mvhi r11,0x802 <== NOT EXECUTED 8009bc0: 39 6b b2 c0 ori r11,r11,0xb2c0 <== NOT EXECUTED 8009bc4: 29 6c 00 10 lw r12,(r11+16) <== NOT EXECUTED 8009bc8: e3 ff ff ef bi 8009b84 <_POSIX_Message_queue_Receive_support+0x114><== NOT EXECUTED } if ( !_Thread_Executing->Wait.return_code ) return length_out; rtems_set_errno_and_return_minus_one( 8009bcc: f8 00 2d 14 calli 801501c <__errno> 8009bd0: b8 20 60 00 mv r12,r1 8009bd4: 29 61 00 10 lw r1,(r11+16) 8009bd8: 28 21 00 34 lw r1,(r1+52) 8009bdc: f8 00 00 c2 calli 8009ee4 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 8009be0: 59 81 00 00 sw (r12+0),r1 8009be4: 34 01 ff ff mvi r1,-1 8009be8: e3 ff ff bb bi 8009ad4 <_POSIX_Message_queue_Receive_support+0x64> the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { _Thread_Enable_dispatch(); 8009bec: f8 00 11 af calli 800e2a8 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EBADF ); 8009bf0: f8 00 2d 0b calli 801501c <__errno> 8009bf4: 34 02 00 09 mvi r2,9 8009bf8: 58 22 00 00 sw (r1+0),r2 8009bfc: 34 01 ff ff mvi r1,-1 8009c00: e3 ff ff b5 bi 8009ad4 <_POSIX_Message_queue_Receive_support+0x64> =============================================================================== 0800c6d8 <_POSIX_Semaphore_Create_support>: size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { 800c6d8: 37 9c ff e0 addi sp,sp,-32 800c6dc: 5b 8b 00 20 sw (sp+32),r11 800c6e0: 5b 8c 00 1c sw (sp+28),r12 800c6e4: 5b 8d 00 18 sw (sp+24),r13 800c6e8: 5b 8e 00 14 sw (sp+20),r14 800c6ec: 5b 8f 00 10 sw (sp+16),r15 800c6f0: 5b 90 00 0c sw (sp+12),r16 800c6f4: 5b 91 00 08 sw (sp+8),r17 800c6f8: 5b 9d 00 04 sw (sp+4),ra 800c6fc: b8 60 68 00 mv r13,r3 800c700: b8 20 70 00 mv r14,r1 800c704: b8 40 88 00 mv r17,r2 800c708: b8 80 78 00 mv r15,r4 800c70c: b8 a0 80 00 mv r16,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) 800c710: 5c 60 00 39 bne r3,r0,800c7f4 <_POSIX_Semaphore_Create_support+0x11c> * * 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; 800c714: 78 06 08 02 mvhi r6,0x802 800c718: 38 c6 53 28 ori r6,r6,0x5328 800c71c: 28 c1 00 00 lw r1,(r6+0) ++level; 800c720: 34 21 00 01 addi r1,r1,1 _Thread_Dispatch_disable_level = level; 800c724: 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 ); 800c728: 78 0c 08 02 mvhi r12,0x802 800c72c: 39 8c 55 64 ori r12,r12,0x5564 800c730: b9 80 08 00 mv r1,r12 800c734: fb ff ec 0d calli 8007768 <_Objects_Allocate> 800c738: b8 20 58 00 mv r11,r1 rtems_set_errno_and_return_minus_one( ENOSYS ); _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { 800c73c: 44 2d 00 33 be r1,r13,800c808 <_POSIX_Semaphore_Create_support+0x130> /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ if ( name_arg != NULL ) { 800c740: 45 c0 00 27 be r14,r0,800c7dc <_POSIX_Semaphore_Create_support+0x104> name = _Workspace_String_duplicate( name_arg, name_len ); 800c744: b9 c0 08 00 mv r1,r14 800c748: ba 20 10 00 mv r2,r17 800c74c: f8 00 05 22 calli 800dbd4 <_Workspace_String_duplicate> 800c750: b8 20 68 00 mv r13,r1 if ( !name ) { 800c754: 44 20 00 33 be r1,r0,800c820 <_POSIX_Semaphore_Create_support+0x148><== NEVER TAKEN the_semaphore->process_shared = pshared; if ( name ) { the_semaphore->named = true; the_semaphore->open_count = 1; 800c758: 34 01 00 01 mvi r1,1 } the_semaphore->process_shared = pshared; if ( name ) { the_semaphore->named = true; 800c75c: 34 02 00 01 mvi r2,1 } } else { name = NULL; } the_semaphore->process_shared = pshared; 800c760: 59 60 00 10 sw (r11+16),r0 if ( name ) { the_semaphore->named = true; 800c764: 31 62 00 14 sb (r11+20),r2 the_semaphore->open_count = 1; 800c768: 59 61 00 18 sw (r11+24),r1 the_semaphore->linked = true; 800c76c: 31 61 00 15 sb (r11+21),r1 the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 800c770: 34 04 ff ff mvi r4,-1 _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 800c774: 35 61 00 1c addi r1,r11,28 800c778: 35 62 00 5c addi r2,r11,92 800c77c: b9 e0 18 00 mv r3,r15 the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 800c780: 59 64 00 5c sw (r11+92),r4 * 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; 800c784: 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 ); 800c788: fb ff e9 f4 calli 8006f58 <_CORE_semaphore_Initialize> Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 800c78c: 2d 62 00 0a lhu r2,(r11+10) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 800c790: 29 81 00 1c lw r1,(r12+28) 800c794: b4 42 10 00 add r2,r2,r2 800c798: b4 42 10 00 add r2,r2,r2 800c79c: b4 22 10 00 add r2,r1,r2 800c7a0: 58 4b 00 00 sw (r2+0),r11 the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 800c7a4: 59 6d 00 0c sw (r11+12),r13 &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; 800c7a8: 5a 0b 00 00 sw (r16+0),r11 _Thread_Enable_dispatch(); 800c7ac: fb ff f1 88 calli 8008dcc <_Thread_Enable_dispatch> return 0; 800c7b0: 34 01 00 00 mvi r1,0 } 800c7b4: 2b 9d 00 04 lw ra,(sp+4) 800c7b8: 2b 8b 00 20 lw r11,(sp+32) 800c7bc: 2b 8c 00 1c lw r12,(sp+28) 800c7c0: 2b 8d 00 18 lw r13,(sp+24) 800c7c4: 2b 8e 00 14 lw r14,(sp+20) 800c7c8: 2b 8f 00 10 lw r15,(sp+16) 800c7cc: 2b 90 00 0c lw r16,(sp+12) 800c7d0: 2b 91 00 08 lw r17,(sp+8) 800c7d4: 37 9c 00 20 addi sp,sp,32 800c7d8: c3 a0 00 00 ret } } else { name = NULL; } the_semaphore->process_shared = pshared; 800c7dc: 58 20 00 10 sw (r1+16),r0 if ( name ) { the_semaphore->named = true; the_semaphore->open_count = 1; the_semaphore->linked = true; } else { the_semaphore->named = false; 800c7e0: 30 20 00 14 sb (r1+20),r0 the_semaphore->open_count = 0; 800c7e4: 58 20 00 18 sw (r1+24),r0 the_semaphore->linked = false; 800c7e8: 30 20 00 15 sb (r1+21),r0 _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENOMEM ); } } else { name = NULL; 800c7ec: 34 0d 00 00 mvi r13,0 800c7f0: e3 ff ff e0 bi 800c770 <_POSIX_Semaphore_Create_support+0x98> CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) rtems_set_errno_and_return_minus_one( ENOSYS ); 800c7f4: f8 00 0b f1 calli 800f7b8 <__errno> 800c7f8: 34 02 00 58 mvi r2,88 800c7fc: 58 22 00 00 sw (r1+0),r2 800c800: 34 01 ff ff mvi r1,-1 800c804: e3 ff ff ec bi 800c7b4 <_POSIX_Semaphore_Create_support+0xdc> _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { _Thread_Enable_dispatch(); 800c808: fb ff f1 71 calli 8008dcc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSPC ); 800c80c: f8 00 0b eb calli 800f7b8 <__errno> 800c810: 34 02 00 1c mvi r2,28 800c814: 58 22 00 00 sw (r1+0),r2 800c818: 34 01 ff ff mvi r1,-1 800c81c: e3 ff ff e6 bi 800c7b4 <_POSIX_Semaphore_Create_support+0xdc> RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( POSIX_Semaphore_Control *the_semaphore ) { _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); 800c820: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 800c824: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 800c828: fb ff ec db calli 8007b94 <_Objects_Free> <== NOT EXECUTED */ if ( name_arg != NULL ) { name = _Workspace_String_duplicate( name_arg, name_len ); if ( !name ) { _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 800c82c: fb ff f1 68 calli 8008dcc <_Thread_Enable_dispatch> <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 800c830: f8 00 0b e2 calli 800f7b8 <__errno> <== NOT EXECUTED 800c834: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 800c838: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 800c83c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 800c840: e3 ff ff dd bi 800c7b4 <_POSIX_Semaphore_Create_support+0xdc><== NOT EXECUTED =============================================================================== 080091a4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 80091a4: 37 9c ff fc addi sp,sp,-4 80091a8: 5b 9d 00 04 sw (sp+4),ra POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 80091ac: 28 22 01 1c lw r2,(r1+284) if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 80091b0: 28 43 00 d8 lw r3,(r2+216) 80091b4: 5c 60 00 04 bne r3,r0,80091c4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x20><== NEVER TAKEN 80091b8: 28 44 00 dc lw r4,(r2+220) 80091bc: 34 03 00 01 mvi r3,1 80091c0: 44 83 00 05 be r4,r3,80091d4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x30> thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } else _Thread_Enable_dispatch(); 80091c4: fb ff f4 fa calli 80065ac <_Thread_Enable_dispatch> } 80091c8: 2b 9d 00 04 lw ra,(sp+4) 80091cc: 37 9c 00 04 addi sp,sp,4 80091d0: c3 a0 00 00 ret POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 80091d4: 28 42 00 e0 lw r2,(r2+224) 80091d8: 44 40 ff fb be r2,r0,80091c4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x20> * * 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; 80091dc: 78 03 08 01 mvhi r3,0x801 80091e0: 38 63 68 e8 ori r3,r3,0x68e8 80091e4: 28 64 00 00 lw r4,(r3+0) thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 80091e8: 34 02 ff ff mvi r2,-1 --level; 80091ec: 34 84 ff ff addi r4,r4,-1 _Thread_Dispatch_disable_level = level; 80091f0: 58 64 00 00 sw (r3+0),r4 80091f4: f8 00 02 93 calli 8009c40 <_POSIX_Thread_Exit> 80091f8: e3 ff ff f4 bi 80091c8 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x24> =============================================================================== 0800ad10 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 800ad10: 37 9c ff e8 addi sp,sp,-24 800ad14: 5b 8b 00 18 sw (sp+24),r11 800ad18: 5b 8c 00 14 sw (sp+20),r12 800ad1c: 5b 8d 00 10 sw (sp+16),r13 800ad20: 5b 8e 00 0c sw (sp+12),r14 800ad24: 5b 8f 00 08 sw (sp+8),r15 800ad28: 5b 9d 00 04 sw (sp+4),ra 800ad2c: b8 20 68 00 mv r13,r1 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 800ad30: 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 ) { 800ad34: b8 40 60 00 mv r12,r2 800ad38: b8 60 70 00 mv r14,r3 800ad3c: b8 80 78 00 mv r15,r4 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 800ad40: fb ff ff ec calli 800acf0 <_POSIX_Priority_Is_valid> return EINVAL; 800ad44: 34 0b 00 16 mvi r11,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 ) ) 800ad48: 44 20 00 0c be r1,r0,800ad78 <_POSIX_Thread_Translate_sched_param+0x68><== NEVER TAKEN return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 800ad4c: 59 c0 00 00 sw (r14+0),r0 *budget_callout = NULL; 800ad50: 59 e0 00 00 sw (r15+0),r0 if ( policy == SCHED_OTHER ) { 800ad54: 45 a0 00 12 be r13,r0,800ad9c <_POSIX_Thread_Translate_sched_param+0x8c> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; return 0; } if ( policy == SCHED_FIFO ) { 800ad58: 34 01 00 01 mvi r1,1 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; 800ad5c: 34 0b 00 00 mvi r11,0 if ( policy == SCHED_OTHER ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; return 0; } if ( policy == SCHED_FIFO ) { 800ad60: 45 a1 00 06 be r13,r1,800ad78 <_POSIX_Thread_Translate_sched_param+0x68> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 800ad64: 34 01 00 02 mvi r1,2 800ad68: 45 a1 00 2b be r13,r1,800ae14 <_POSIX_Thread_Translate_sched_param+0x104> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; return 0; } if ( policy == SCHED_SPORADIC ) { 800ad6c: 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; 800ad70: 34 0b 00 16 mvi r11,22 if ( policy == SCHED_RR ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; return 0; } if ( policy == SCHED_SPORADIC ) { 800ad74: 45 a1 00 0e be r13,r1,800adac <_POSIX_Thread_Translate_sched_param+0x9c> *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } 800ad78: b9 60 08 00 mv r1,r11 800ad7c: 2b 9d 00 04 lw ra,(sp+4) 800ad80: 2b 8b 00 18 lw r11,(sp+24) 800ad84: 2b 8c 00 14 lw r12,(sp+20) 800ad88: 2b 8d 00 10 lw r13,(sp+16) 800ad8c: 2b 8e 00 0c lw r14,(sp+12) 800ad90: 2b 8f 00 08 lw r15,(sp+8) 800ad94: 37 9c 00 18 addi sp,sp,24 800ad98: c3 a0 00 00 ret *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 800ad9c: 34 01 00 01 mvi r1,1 800ada0: 59 c1 00 00 sw (r14+0),r1 return 0; 800ada4: 34 0b 00 00 mvi r11,0 800ada8: e3 ff ff f4 bi 800ad78 <_POSIX_Thread_Translate_sched_param+0x68> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; return 0; } if ( policy == SCHED_SPORADIC ) { if ( (param->sched_ss_repl_period.tv_sec == 0) && 800adac: 29 81 00 08 lw r1,(r12+8) 800adb0: 5c 20 00 03 bne r1,r0,800adbc <_POSIX_Thread_Translate_sched_param+0xac> 800adb4: 29 82 00 0c lw r2,(r12+12) 800adb8: 44 41 ff f0 be r2,r1,800ad78 <_POSIX_Thread_Translate_sched_param+0x68> (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 800adbc: 29 81 00 10 lw r1,(r12+16) 800adc0: 5c 20 00 04 bne r1,r0,800add0 <_POSIX_Thread_Translate_sched_param+0xc0> 800adc4: 29 82 00 14 lw r2,(r12+20) (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; 800adc8: 34 0b 00 16 mvi r11,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) && 800adcc: 44 41 ff eb be r2,r1,800ad78 <_POSIX_Thread_Translate_sched_param+0x68> (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 800add0: 35 81 00 08 addi r1,r12,8 800add4: fb ff f5 ea calli 800857c <_Timespec_To_ticks> 800add8: b8 20 68 00 mv r13,r1 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 800addc: 35 81 00 10 addi r1,r12,16 800ade0: fb ff f5 e7 calli 800857c <_Timespec_To_ticks> return EINVAL; 800ade4: 34 0b 00 16 mvi r11,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 ) < 800ade8: 54 2d ff e4 bgu r1,r13,800ad78 <_POSIX_Thread_Translate_sched_param+0x68> _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 800adec: 29 81 00 04 lw r1,(r12+4) 800adf0: fb ff ff c0 calli 800acf0 <_POSIX_Priority_Is_valid> 800adf4: 44 20 ff e1 be r1,r0,800ad78 <_POSIX_Thread_Translate_sched_param+0x68> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 800adf8: 78 01 08 00 mvhi r1,0x800 return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 800adfc: 34 02 00 03 mvi r2,3 800ae00: 59 c2 00 00 sw (r14+0),r2 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 800ae04: 38 21 45 f0 ori r1,r1,0x45f0 800ae08: 59 e1 00 00 sw (r15+0),r1 return 0; 800ae0c: 34 0b 00 00 mvi r11,0 800ae10: e3 ff ff da bi 800ad78 <_POSIX_Thread_Translate_sched_param+0x68> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 800ae14: 59 cd 00 00 sw (r14+0),r13 return 0; 800ae18: e3 ff ff d8 bi 800ad78 <_POSIX_Thread_Translate_sched_param+0x68> =============================================================================== 08009f74 <_POSIX_Threads_Delete_extension>: */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { 8009f74: 37 9c ff ec addi sp,sp,-20 8009f78: 5b 8b 00 14 sw (sp+20),r11 8009f7c: 5b 8c 00 10 sw (sp+16),r12 8009f80: 5b 8d 00 0c sw (sp+12),r13 8009f84: 5b 8e 00 08 sw (sp+8),r14 8009f88: 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 ]; 8009f8c: 28 4e 01 1c lw r14,(r2+284) /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 8009f90: b8 40 08 00 mv r1,r2 */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { 8009f94: b8 40 68 00 mv r13,r2 api = deleted->API_Extensions[ THREAD_API_POSIX ]; /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 8009f98: f8 00 0a 0b calli 800c7c4 <_POSIX_Threads_cancel_run> /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); 8009f9c: b9 a0 08 00 mv r1,r13 8009fa0: f8 00 0a 2d calli 800c854 <_POSIX_Keys_Run_destructors> 8009fa4: 35 cb 00 44 addi r11,r14,68 /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; 8009fa8: 29 ac 00 28 lw r12,(r13+40) while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 8009fac: e0 00 00 03 bi 8009fb8 <_POSIX_Threads_Delete_extension+0x44> *(void **)the_thread->Wait.return_argument = value_ptr; 8009fb0: 28 23 00 28 lw r3,(r1+40) <== NOT EXECUTED 8009fb4: 58 6c 00 00 sw (r3+0),r12 <== 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 )) ) 8009fb8: b9 60 08 00 mv r1,r11 8009fbc: fb ff f4 2d calli 8007070 <_Thread_queue_Dequeue> 8009fc0: 5c 20 ff fc bne r1,r0,8009fb0 <_POSIX_Threads_Delete_extension+0x3c><== NEVER TAKEN *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) 8009fc4: 29 c2 00 84 lw r2,(r14+132) 8009fc8: 34 01 00 04 mvi r1,4 8009fcc: 44 41 00 0b be r2,r1,8009ff8 <_POSIX_Threads_Delete_extension+0x84> (void) _Watchdog_Remove( &api->Sporadic_timer ); deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; 8009fd0: 59 a0 01 1c sw (r13+284),r0 _Workspace_Free( api ); 8009fd4: b9 c0 08 00 mv r1,r14 8009fd8: fb ff f8 16 calli 8008030 <_Workspace_Free> } 8009fdc: 2b 9d 00 04 lw ra,(sp+4) 8009fe0: 2b 8b 00 14 lw r11,(sp+20) 8009fe4: 2b 8c 00 10 lw r12,(sp+16) 8009fe8: 2b 8d 00 0c lw r13,(sp+12) 8009fec: 2b 8e 00 08 lw r14,(sp+8) 8009ff0: 37 9c 00 14 addi sp,sp,20 8009ff4: c3 a0 00 00 ret while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); 8009ff8: 35 c1 00 a8 addi r1,r14,168 8009ffc: fb ff f7 35 calli 8007cd0 <_Watchdog_Remove> 800a000: e3 ff ff f4 bi 8009fd0 <_POSIX_Threads_Delete_extension+0x5c> =============================================================================== 08009f24 <_POSIX_Threads_Exitted_extension>: * This method is invoked each time a thread exits. */ static void _POSIX_Threads_Exitted_extension( Thread_Control *executing ) { 8009f24: 37 9c ff f8 addi sp,sp,-8 8009f28: 5b 8b 00 08 sw (sp+8),r11 8009f2c: 5b 9d 00 04 sw (sp+4),ra 8009f30: b8 20 58 00 mv r11,r1 */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 8009f34: 28 21 00 08 lw r1,(r1+8) 8009f38: 34 02 00 18 mvi r2,24 8009f3c: f8 00 47 a7 calli 801bdd8 <__lshrsi3> 8009f40: 20 21 00 07 andi r1,r1,0x7 /* * If the executing thread was not created with the POSIX API, then this * API do not get to define its exit behavior. */ if ( _Objects_Get_API( executing->Object.id ) == OBJECTS_POSIX_API ) 8009f44: 34 02 00 03 mvi r2,3 8009f48: 44 22 00 05 be r1,r2,8009f5c <_POSIX_Threads_Exitted_extension+0x38> pthread_exit( executing->Wait.return_argument ); } 8009f4c: 2b 9d 00 04 lw ra,(sp+4) 8009f50: 2b 8b 00 08 lw r11,(sp+8) 8009f54: 37 9c 00 08 addi sp,sp,8 8009f58: c3 a0 00 00 ret /* * If the executing thread was not created with the POSIX API, then this * API do not get to define its exit behavior. */ if ( _Objects_Get_API( executing->Object.id ) == OBJECTS_POSIX_API ) pthread_exit( executing->Wait.return_argument ); 8009f5c: 29 61 00 28 lw r1,(r11+40) 8009f60: f8 00 0b 82 calli 800cd68 } 8009f64: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8009f68: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8009f6c: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 8009f70: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08004234 <_POSIX_Threads_Initialize_user_threads_body>: #include #include #include void _POSIX_Threads_Initialize_user_threads_body(void) { 8004234: 37 9c ff a8 addi sp,sp,-88 8004238: 5b 8b 00 14 sw (sp+20),r11 800423c: 5b 8c 00 10 sw (sp+16),r12 8004240: 5b 8d 00 0c sw (sp+12),r13 8004244: 5b 8e 00 08 sw (sp+8),r14 8004248: 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; 800424c: 78 01 08 02 mvhi r1,0x802 8004250: 38 21 00 c0 ori r1,r1,0xc0 maximum = Configuration_POSIX_API.number_of_initialization_threads; 8004254: 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; 8004258: 28 2c 00 34 lw r12,(r1+52) maximum = Configuration_POSIX_API.number_of_initialization_threads; if ( !user_threads || maximum == 0 ) 800425c: 65 c2 00 00 cmpei r2,r14,0 8004260: 65 81 00 00 cmpei r1,r12,0 8004264: b8 41 08 00 or r1,r2,r1 8004268: 5c 20 00 15 bne r1,r0,80042bc <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN 800426c: 34 0d 00 00 mvi r13,0 8004270: 37 8b 00 18 addi r11,sp,24 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 8004274: b9 60 08 00 mv r1,r11 8004278: f8 00 1a e9 calli 800ae1c (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 800427c: 34 02 00 02 mvi r2,2 8004280: b9 60 08 00 mv r1,r11 8004284: f8 00 1b 1d calli 800aef8 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 8004288: 29 82 00 04 lw r2,(r12+4) 800428c: b9 60 08 00 mv r1,r11 8004290: f8 00 1b 26 calli 800af28 status = pthread_create( 8004294: 29 83 00 00 lw r3,(r12+0) 8004298: 37 81 00 58 addi r1,sp,88 800429c: b9 60 10 00 mv r2,r11 80042a0: 34 04 00 00 mvi r4,0 80042a4: fb ff fe bb calli 8003d90 80042a8: b8 20 18 00 mv r3,r1 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 80042ac: 5c 20 00 0b bne r1,r0,80042d8 <_POSIX_Threads_Initialize_user_threads_body+0xa4> * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 80042b0: 35 ad 00 01 addi r13,r13,1 80042b4: 35 8c 00 08 addi r12,r12,8 80042b8: 55 cd ff ef bgu r14,r13,8004274 <_POSIX_Threads_Initialize_user_threads_body+0x40><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 80042bc: 2b 9d 00 04 lw ra,(sp+4) 80042c0: 2b 8b 00 14 lw r11,(sp+20) 80042c4: 2b 8c 00 10 lw r12,(sp+16) 80042c8: 2b 8d 00 0c lw r13,(sp+12) 80042cc: 2b 8e 00 08 lw r14,(sp+8) 80042d0: 37 9c 00 58 addi sp,sp,88 80042d4: c3 a0 00 00 ret &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 80042d8: 34 01 00 02 mvi r1,2 80042dc: 34 02 00 01 mvi r2,1 80042e0: f8 00 07 93 calli 800612c <_Internal_error_Occurred> =============================================================================== 0800a180 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 800a180: 37 9c ff f4 addi sp,sp,-12 800a184: 5b 8b 00 0c sw (sp+12),r11 800a188: 5b 8c 00 08 sw (sp+8),r12 800a18c: 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 ]; 800a190: 28 4c 01 1c lw r12,(r2+284) */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 800a194: 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 ); 800a198: 35 81 00 98 addi r1,r12,152 800a19c: f8 00 04 8e calli 800b3d4 <_Timespec_To_ticks> RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 800a1a0: 78 03 08 02 mvhi r3,0x802 800a1a4: 38 63 00 d8 ori r3,r3,0xd8 800a1a8: 29 84 00 88 lw r4,(r12+136) 800a1ac: 40 62 00 00 lbu r2,(r3+0) */ #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 ) { 800a1b0: 29 63 00 1c lw r3,(r11+28) 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 ); the_thread->cpu_time_budget = ticks; 800a1b4: 59 61 00 74 sw (r11+116),r1 800a1b8: c8 44 10 00 sub r2,r2,r4 new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; 800a1bc: 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 ) { 800a1c0: 5c 60 00 06 bne r3,r0,800a1d8 <_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 ) { 800a1c4: 29 61 00 14 lw r1,(r11+20) 800a1c8: 50 41 00 04 bgeu r2,r1,800a1d8 <_POSIX_Threads_Sporadic_budget_TSR+0x58> _Thread_Change_priority( the_thread, new_priority, true ); 800a1cc: b9 60 08 00 mv r1,r11 800a1d0: 34 03 00 01 mvi r3,1 800a1d4: fb ff f1 43 calli 80066e0 <_Thread_Change_priority> #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 800a1d8: 35 81 00 90 addi r1,r12,144 800a1dc: f8 00 04 7e calli 800b3d4 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 800a1e0: 59 81 00 b4 sw (r12+180),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800a1e4: 78 01 08 02 mvhi r1,0x802 800a1e8: 35 82 00 a8 addi r2,r12,168 800a1ec: 38 21 09 f0 ori r1,r1,0x9f0 800a1f0: fb ff f6 52 calli 8007b38 <_Watchdog_Insert> _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } 800a1f4: 2b 9d 00 04 lw ra,(sp+4) 800a1f8: 2b 8b 00 0c lw r11,(sp+12) 800a1fc: 2b 8c 00 08 lw r12,(sp+8) 800a200: 37 9c 00 0c addi sp,sp,12 800a204: c3 a0 00 00 ret =============================================================================== 0800a208 <_POSIX_Threads_Sporadic_budget_callout>: * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 800a208: 37 9c ff fc addi sp,sp,-4 800a20c: 5b 9d 00 04 sw (sp+4),ra POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800a210: 28 22 01 1c lw r2,(r1+284) 800a214: 78 04 08 02 mvhi r4,0x802 800a218: 38 84 00 d8 ori r4,r4,0xd8 800a21c: 28 42 00 8c lw r2,(r2+140) 800a220: 40 84 00 00 lbu r4,(r4+0) */ #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 ) { 800a224: 28 25 00 1c lw r5,(r1+28) 800a228: c8 82 10 00 sub r2,r4,r2 /* * 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 */ 800a22c: 34 04 ff ff mvi r4,-1 800a230: 58 24 00 74 sw (r1+116),r4 new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 800a234: 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 ) { 800a238: 5c a0 00 05 bne r5,r0,800a24c <_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 ) { 800a23c: 28 23 00 14 lw r3,(r1+20) 800a240: 50 62 00 03 bgeu r3,r2,800a24c <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, true ); 800a244: 34 03 00 01 mvi r3,1 800a248: fb ff f1 26 calli 80066e0 <_Thread_Change_priority> #if 0 printk( "lower priority\n" ); #endif } } } 800a24c: 2b 9d 00 04 lw ra,(sp+4) 800a250: 37 9c 00 04 addi sp,sp,4 800a254: c3 a0 00 00 ret =============================================================================== 0800c7c4 <_POSIX_Threads_cancel_run>: #include void _POSIX_Threads_cancel_run( Thread_Control *the_thread ) { 800c7c4: 37 9c ff ec addi sp,sp,-20 800c7c8: 5b 8b 00 14 sw (sp+20),r11 800c7cc: 5b 8c 00 10 sw (sp+16),r12 800c7d0: 5b 8d 00 0c sw (sp+12),r13 800c7d4: 5b 8e 00 08 sw (sp+8),r14 800c7d8: 5b 9d 00 04 sw (sp+4),ra POSIX_Cancel_Handler_control *handler; Chain_Control *handler_stack; POSIX_API_Control *thread_support; ISR_Level level; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800c7dc: 28 2c 01 1c lw r12,(r1+284) handler_stack = &thread_support->Cancellation_Handlers; thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; 800c7e0: 34 01 00 01 mvi r1,1 while ( !_Chain_Is_empty( handler_stack ) ) { 800c7e4: 29 82 00 e4 lw r2,(r12+228) thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; 800c7e8: 59 81 00 d8 sw (r12+216),r1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 800c7ec: 35 8d 00 e8 addi r13,r12,232 while ( !_Chain_Is_empty( handler_stack ) ) { 800c7f0: 44 4d 00 12 be r2,r13,800c838 <_POSIX_Threads_cancel_run+0x74> _ISR_Disable( level ); 800c7f4: 34 0e ff fe mvi r14,-2 800c7f8: 90 00 08 00 rcsr r1,IE 800c7fc: a0 2e 10 00 and r2,r1,r14 800c800: d0 02 00 00 wcsr IE,r2 handler = (POSIX_Cancel_Handler_control *) 800c804: 29 8b 00 ec lw r11,(r12+236) ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 800c808: 29 63 00 00 lw r3,(r11+0) previous = the_node->previous; 800c80c: 29 62 00 04 lw r2,(r11+4) next->previous = previous; 800c810: 58 62 00 04 sw (r3+4),r2 previous->next = next; 800c814: 58 43 00 00 sw (r2+0),r3 _Chain_Tail( handler_stack )->previous; _Chain_Extract_unprotected( &handler->Node ); _ISR_Enable( level ); 800c818: d0 01 00 00 wcsr IE,r1 (*handler->routine)( handler->arg ); 800c81c: 29 62 00 08 lw r2,(r11+8) 800c820: 29 61 00 0c lw r1,(r11+12) 800c824: d8 40 00 00 call r2 _Workspace_Free( handler ); 800c828: b9 60 08 00 mv r1,r11 800c82c: fb ff ee 01 calli 8008030 <_Workspace_Free> handler_stack = &thread_support->Cancellation_Handlers; thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; while ( !_Chain_Is_empty( handler_stack ) ) { 800c830: 29 81 00 e4 lw r1,(r12+228) 800c834: 5c 2d ff f1 bne r1,r13,800c7f8 <_POSIX_Threads_cancel_run+0x34><== NEVER TAKEN (*handler->routine)( handler->arg ); _Workspace_Free( handler ); } } 800c838: 2b 9d 00 04 lw ra,(sp+4) 800c83c: 2b 8b 00 14 lw r11,(sp+20) 800c840: 2b 8c 00 10 lw r12,(sp+16) 800c844: 2b 8d 00 0c lw r13,(sp+12) 800c848: 2b 8e 00 08 lw r14,(sp+8) 800c84c: 37 9c 00 14 addi sp,sp,20 800c850: c3 a0 00 00 ret =============================================================================== 08003f10 <_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) { 8003f10: 37 9c ff e8 addi sp,sp,-24 8003f14: 5b 8b 00 10 sw (sp+16),r11 8003f18: 5b 8c 00 0c sw (sp+12),r12 8003f1c: 5b 8d 00 08 sw (sp+8),r13 8003f20: 5b 9d 00 04 sw (sp+4),ra 8003f24: b8 40 58 00 mv r11,r2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 8003f28: 28 42 00 68 lw r2,(r2+104) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 8003f2c: 29 61 00 54 lw r1,(r11+84) bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 8003f30: 34 42 00 01 addi r2,r2,1 8003f34: 59 62 00 68 sw (r11+104),r2 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 8003f38: 5c 20 00 0f bne r1,r0,8003f74 <_POSIX_Timer_TSR+0x64> 8003f3c: 29 62 00 58 lw r2,(r11+88) 8003f40: 5c 41 00 0d bne r2,r1,8003f74 <_POSIX_Timer_TSR+0x64> <== ALWAYS TAKEN /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 8003f44: 34 01 00 04 mvi r1,4 <== NOT EXECUTED 8003f48: 31 61 00 3c sb (r11+60),r1 <== NOT EXECUTED /* * 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 ) ) { 8003f4c: 29 61 00 38 lw r1,(r11+56) 8003f50: 29 62 00 44 lw r2,(r11+68) 8003f54: f8 00 18 f2 calli 800a31c } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 8003f58: 59 60 00 68 sw (r11+104),r0 } 8003f5c: 2b 9d 00 04 lw ra,(sp+4) 8003f60: 2b 8b 00 10 lw r11,(sp+16) 8003f64: 2b 8c 00 0c lw r12,(sp+12) 8003f68: 2b 8d 00 08 lw r13,(sp+8) 8003f6c: 37 9c 00 18 addi sp,sp,24 8003f70: c3 a0 00 00 ret ptimer->overrun = ptimer->overrun + 1; /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 8003f74: 29 62 00 64 lw r2,(r11+100) 8003f78: 29 63 00 08 lw r3,(r11+8) 8003f7c: 78 04 08 00 mvhi r4,0x800 8003f80: 35 61 00 10 addi r1,r11,16 8003f84: 38 84 3f 10 ori r4,r4,0x3f10 8003f88: b9 60 28 00 mv r5,r11 8003f8c: f8 00 1a 4a calli 800a8b4 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 8003f90: 44 20 ff f3 be r1,r0,8003f5c <_POSIX_Timer_TSR+0x4c> <== NEVER TAKEN 8003f94: 78 02 08 02 mvhi r2,0x802 8003f98: 38 42 08 c8 ori r2,r2,0x8c8 8003f9c: 37 81 00 14 addi r1,sp,20 8003fa0: f8 00 05 00 calli 80053a0 <_TOD_Get_with_nanoseconds> /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; } 8003fa4: 28 2d 00 00 lw r13,(r1+0) 8003fa8: 28 2c 00 04 lw r12,(r1+4) static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 8003fac: 78 01 08 01 mvhi r1,0x801 8003fb0: 38 21 e6 08 ori r1,r1,0xe608 8003fb4: 28 24 00 00 lw r4,(r1+0) 8003fb8: 34 03 00 00 mvi r3,0 8003fbc: b9 a0 08 00 mv r1,r13 8003fc0: b9 80 10 00 mv r2,r12 8003fc4: f8 00 4e 2a calli 801786c <__divdi3> _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 8003fc8: 78 01 08 01 mvhi r1,0x801 8003fcc: 38 21 e6 08 ori r1,r1,0xe608 8003fd0: 28 24 00 00 lw r4,(r1+0) static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 8003fd4: 59 62 00 6c sw (r11+108),r2 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 8003fd8: b9 a0 08 00 mv r1,r13 8003fdc: b9 80 10 00 mv r2,r12 8003fe0: 34 03 00 00 mvi r3,0 8003fe4: f8 00 50 24 calli 8018074 <__moddi3> /* 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; 8003fe8: 34 01 00 03 mvi r1,3 8003fec: 59 62 00 70 sw (r11+112),r2 8003ff0: 31 61 00 3c sb (r11+60),r1 8003ff4: e3 ff ff d6 bi 8003f4c <_POSIX_Timer_TSR+0x3c> =============================================================================== 0800c92c <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 800c92c: 37 9c ff a0 addi sp,sp,-96 800c930: 5b 8b 00 2c sw (sp+44),r11 800c934: 5b 8c 00 28 sw (sp+40),r12 800c938: 5b 8d 00 24 sw (sp+36),r13 800c93c: 5b 8e 00 20 sw (sp+32),r14 800c940: 5b 8f 00 1c sw (sp+28),r15 800c944: 5b 90 00 18 sw (sp+24),r16 800c948: 5b 91 00 14 sw (sp+20),r17 800c94c: 5b 92 00 10 sw (sp+16),r18 800c950: 5b 93 00 0c sw (sp+12),r19 800c954: 5b 94 00 08 sw (sp+8),r20 800c958: 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, 800c95c: 37 8e 00 58 addi r14,sp,88 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 800c960: 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, 800c964: 34 05 00 01 mvi r5,1 800c968: b9 c0 18 00 mv r3,r14 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 800c96c: b8 20 68 00 mv r13,r1 800c970: 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, 800c974: f8 00 00 57 calli 800cad0 <_POSIX_signals_Clear_signals> is_global, true ) ) return false; 800c978: 34 06 00 00 mvi r6,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, 800c97c: 44 20 00 42 be r1,r0,800ca84 <_POSIX_signals_Check_signal+0x158> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 800c980: b5 6b 20 00 add r4,r11,r11 800c984: b4 8b 20 00 add r4,r4,r11 800c988: 78 05 08 02 mvhi r5,0x802 800c98c: b4 84 20 00 add r4,r4,r4 800c990: 38 a5 0e 68 ori r5,r5,0xe68 800c994: b4 84 20 00 add r4,r4,r4 800c998: b4 a4 28 00 add r5,r5,r4 800c99c: 28 a7 00 08 lw r7,(r5+8) 800c9a0: 34 01 00 01 mvi r1,1 800c9a4: 44 e1 00 38 be r7,r1,800ca84 <_POSIX_signals_Check_signal+0x158><== NEVER TAKEN /* * 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, 800c9a8: 78 0c 08 02 mvhi r12,0x802 800c9ac: 39 8c 0d e0 ori r12,r12,0xde0 800c9b0: 29 84 00 10 lw r4,(r12+16) return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 800c9b4: 29 af 00 d0 lw r15,(r13+208) api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 800c9b8: 28 a1 00 04 lw r1,(r5+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, 800c9bc: 28 94 00 20 lw r20,(r4+32) 800c9c0: 28 93 00 24 lw r19,(r4+36) 800c9c4: 28 92 00 28 lw r18,(r4+40) 800c9c8: 28 91 00 2c lw r17,(r4+44) 800c9cc: 28 90 00 30 lw r16,(r4+48) 800c9d0: 28 8a 00 34 lw r10,(r4+52) 800c9d4: 28 89 00 38 lw r9,(r4+56) 800c9d8: 28 88 00 3c lw r8,(r4+60) 800c9dc: 28 86 00 40 lw r6,(r4+64) 800c9e0: 28 83 00 44 lw r3,(r4+68) sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 800c9e4: 28 a2 00 00 lw r2,(r5+0) /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 800c9e8: b8 2f 08 00 or r1,r1,r15 800c9ec: 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, 800c9f0: 5b 94 00 30 sw (sp+48),r20 800c9f4: 5b 93 00 34 sw (sp+52),r19 800c9f8: 5b 92 00 38 sw (sp+56),r18 800c9fc: 5b 91 00 3c sw (sp+60),r17 800ca00: 5b 90 00 40 sw (sp+64),r16 800ca04: 5b 8a 00 44 sw (sp+68),r10 800ca08: 5b 89 00 48 sw (sp+72),r9 800ca0c: 5b 88 00 4c sw (sp+76),r8 800ca10: 5b 86 00 50 sw (sp+80),r6 800ca14: 5b 83 00 54 sw (sp+84),r3 sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 800ca18: 34 01 00 02 mvi r1,2 800ca1c: 44 41 00 28 be r2,r1,800cabc <_POSIX_signals_Check_signal+0x190> &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 800ca20: b9 60 08 00 mv r1,r11 800ca24: d8 e0 00 00 call r7 } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, 800ca28: 29 82 00 10 lw r2,(r12+16) 800ca2c: 2b 81 00 30 lw r1,(sp+48) /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; 800ca30: 34 06 00 01 mvi r6,1 } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, 800ca34: 58 41 00 20 sw (r2+32),r1 800ca38: 2b 81 00 34 lw r1,(sp+52) 800ca3c: 58 41 00 24 sw (r2+36),r1 800ca40: 2b 81 00 38 lw r1,(sp+56) 800ca44: 58 41 00 28 sw (r2+40),r1 800ca48: 2b 81 00 3c lw r1,(sp+60) 800ca4c: 58 41 00 2c sw (r2+44),r1 800ca50: 2b 81 00 40 lw r1,(sp+64) 800ca54: 58 41 00 30 sw (r2+48),r1 800ca58: 2b 81 00 44 lw r1,(sp+68) 800ca5c: 58 41 00 34 sw (r2+52),r1 800ca60: 2b 81 00 48 lw r1,(sp+72) 800ca64: 58 41 00 38 sw (r2+56),r1 800ca68: 2b 81 00 4c lw r1,(sp+76) 800ca6c: 58 41 00 3c sw (r2+60),r1 800ca70: 2b 81 00 50 lw r1,(sp+80) 800ca74: 58 41 00 40 sw (r2+64),r1 800ca78: 2b 81 00 54 lw r1,(sp+84) 800ca7c: 58 41 00 44 sw (r2+68),r1 sizeof( Thread_Wait_information )); /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 800ca80: 59 af 00 d0 sw (r13+208),r15 return true; } 800ca84: b8 c0 08 00 mv r1,r6 800ca88: 2b 9d 00 04 lw ra,(sp+4) 800ca8c: 2b 8b 00 2c lw r11,(sp+44) 800ca90: 2b 8c 00 28 lw r12,(sp+40) 800ca94: 2b 8d 00 24 lw r13,(sp+36) 800ca98: 2b 8e 00 20 lw r14,(sp+32) 800ca9c: 2b 8f 00 1c lw r15,(sp+28) 800caa0: 2b 90 00 18 lw r16,(sp+24) 800caa4: 2b 91 00 14 lw r17,(sp+20) 800caa8: 2b 92 00 10 lw r18,(sp+16) 800caac: 2b 93 00 0c lw r19,(sp+12) 800cab0: 2b 94 00 08 lw r20,(sp+8) 800cab4: 37 9c 00 60 addi sp,sp,96 800cab8: c3 a0 00 00 ret /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 800cabc: b9 60 08 00 mv r1,r11 800cac0: b9 c0 10 00 mv r2,r14 800cac4: 34 03 00 00 mvi r3,0 800cac8: d8 e0 00 00 call r7 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 800cacc: e3 ff ff d7 bi 800ca28 <_POSIX_signals_Check_signal+0xfc> =============================================================================== 0800d174 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 800d174: 37 9c ff f4 addi sp,sp,-12 800d178: 5b 8b 00 0c sw (sp+12),r11 800d17c: 5b 8c 00 08 sw (sp+8),r12 800d180: 5b 9d 00 04 sw (sp+4),ra 800d184: b8 20 10 00 mv r2,r1 clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 800d188: 90 00 60 00 rcsr r12,IE 800d18c: 34 01 ff fe mvi r1,-2 800d190: a1 81 08 00 and r1,r12,r1 800d194: d0 01 00 00 wcsr IE,r1 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 800d198: b4 42 20 00 add r4,r2,r2 800d19c: b4 82 20 00 add r4,r4,r2 800d1a0: 78 01 08 02 mvhi r1,0x802 800d1a4: b4 84 18 00 add r3,r4,r4 800d1a8: 38 21 0e 68 ori r1,r1,0xe68 800d1ac: b4 63 18 00 add r3,r3,r3 800d1b0: b4 23 18 00 add r3,r1,r3 800d1b4: 28 63 00 00 lw r3,(r3+0) 800d1b8: 34 01 00 02 mvi r1,2 800d1bc: 44 61 00 10 be r3,r1,800d1fc <_POSIX_signals_Clear_process_signals+0x88> 800d1c0: 34 42 ff ff addi r2,r2,-1 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 800d1c4: 78 0b 08 02 mvhi r11,0x802 800d1c8: 34 01 00 01 mvi r1,1 800d1cc: f8 00 3a b5 calli 801bca0 <__ashlsi3> 800d1d0: 39 6b 10 5c ori r11,r11,0x105c 800d1d4: 29 62 00 00 lw r2,(r11+0) 800d1d8: a4 20 08 00 not r1,r1 800d1dc: a0 22 08 00 and r1,r1,r2 800d1e0: 59 61 00 00 sw (r11+0),r1 } _ISR_Enable( level ); 800d1e4: d0 0c 00 00 wcsr IE,r12 } 800d1e8: 2b 9d 00 04 lw ra,(sp+4) 800d1ec: 2b 8b 00 0c lw r11,(sp+12) 800d1f0: 2b 8c 00 08 lw r12,(sp+8) 800d1f4: 37 9c 00 0c addi sp,sp,12 800d1f8: c3 a0 00 00 ret 800d1fc: 78 01 08 02 mvhi r1,0x802 800d200: b4 84 20 00 add r4,r4,r4 800d204: 38 21 10 60 ori r1,r1,0x1060 800d208: b4 84 20 00 add r4,r4,r4 800d20c: b4 24 20 00 add r4,r1,r4 ISR_Level level; _ISR_Disable( level ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 800d210: 28 81 00 00 lw r1,(r4+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 800d214: 34 84 00 04 addi r4,r4,4 800d218: 44 24 ff ea be r1,r4,800d1c0 <_POSIX_signals_Clear_process_signals+0x4c><== ALWAYS TAKEN clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; } _ISR_Enable( level ); 800d21c: d0 0c 00 00 wcsr IE,r12 <== NOT EXECUTED } 800d220: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800d224: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED 800d228: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED 800d22c: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 800d230: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08004f28 <_POSIX_signals_Get_lowest>: #include static int _POSIX_signals_Get_lowest( sigset_t set ) { 8004f28: 37 9c ff f0 addi sp,sp,-16 8004f2c: 5b 8b 00 10 sw (sp+16),r11 8004f30: 5b 8c 00 0c sw (sp+12),r12 8004f34: 5b 8d 00 08 sw (sp+8),r13 8004f38: 5b 9d 00 04 sw (sp+4),ra int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8004f3c: 34 0b 00 1b mvi r11,27 #include static int _POSIX_signals_Get_lowest( sigset_t set ) { 8004f40: b8 20 60 00 mv r12,r1 int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8004f44: 34 0d 00 20 mvi r13,32 8004f48: 35 62 ff ff addi r2,r11,-1 8004f4c: 34 01 00 01 mvi r1,1 8004f50: f8 00 46 e7 calli 8016aec <__ashlsi3> if ( set & signo_to_mask( signo ) ) { 8004f54: a0 2c 08 00 and r1,r1,r12 8004f58: 5c 20 00 0d bne r1,r0,8004f8c <_POSIX_signals_Get_lowest+0x64><== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8004f5c: 35 6b 00 01 addi r11,r11,1 8004f60: 5d 6d ff fa bne r11,r13,8004f48 <_POSIX_signals_Get_lowest+0x20> 8004f64: 34 0b 00 01 mvi r11,1 */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 8004f68: 34 0d 00 1b mvi r13,27 8004f6c: e0 00 00 03 bi 8004f78 <_POSIX_signals_Get_lowest+0x50> 8004f70: 35 6b 00 01 addi r11,r11,1 8004f74: 45 6d 00 06 be r11,r13,8004f8c <_POSIX_signals_Get_lowest+0x64><== NEVER TAKEN 8004f78: 35 62 ff ff addi r2,r11,-1 8004f7c: 34 01 00 01 mvi r1,1 8004f80: f8 00 46 db calli 8016aec <__ashlsi3> if ( set & signo_to_mask( signo ) ) { 8004f84: a0 2c 10 00 and r2,r1,r12 8004f88: 44 40 ff fa be r2,r0,8004f70 <_POSIX_signals_Get_lowest+0x48> * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 8004f8c: b9 60 08 00 mv r1,r11 8004f90: 2b 9d 00 04 lw ra,(sp+4) 8004f94: 2b 8b 00 10 lw r11,(sp+16) 8004f98: 2b 8c 00 0c lw r12,(sp+12) 8004f9c: 2b 8d 00 08 lw r13,(sp+8) 8004fa0: 37 9c 00 10 addi sp,sp,16 8004fa4: c3 a0 00 00 ret =============================================================================== 08009b48 <_POSIX_signals_Post_switch_hook>: */ static void _POSIX_signals_Post_switch_hook( Thread_Control *the_thread ) { 8009b48: 37 9c ff dc addi sp,sp,-36 8009b4c: 5b 8b 00 24 sw (sp+36),r11 8009b50: 5b 8c 00 20 sw (sp+32),r12 8009b54: 5b 8d 00 1c sw (sp+28),r13 8009b58: 5b 8e 00 18 sw (sp+24),r14 8009b5c: 5b 8f 00 14 sw (sp+20),r15 8009b60: 5b 90 00 10 sw (sp+16),r16 8009b64: 5b 91 00 0c sw (sp+12),r17 8009b68: 5b 92 00 08 sw (sp+8),r18 8009b6c: 5b 9d 00 04 sw (sp+4),ra /* * 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; 8009b70: 78 11 08 02 mvhi r17,0x802 8009b74: 3a 31 0d e0 ori r17,r17,0xde0 8009b78: 2a 22 00 10 lw r2,(r17+16) POSIX_API_Control *api; int signo; ISR_Level level; int hold_errno; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 8009b7c: 28 2c 01 1c lw r12,(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; 8009b80: 28 52 00 34 lw r18,(r2+52) /* * api may be NULL in case of a thread close in progress */ if ( !api ) 8009b84: 45 80 00 2b be r12,r0,8009c30 <_POSIX_signals_Post_switch_hook+0xe8><== NEVER TAKEN 8009b88: 78 0f 08 02 mvhi r15,0x802 8009b8c: 39 ef 10 5c ori r15,r15,0x105c * * 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 ); 8009b90: 34 10 ff fe mvi r16,-2 _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8009b94: 34 0d 00 1b mvi r13,27 8009b98: 34 0e 00 20 mvi r14,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 ); 8009b9c: 90 00 08 00 rcsr r1,IE 8009ba0: a0 30 10 00 and r2,r1,r16 8009ba4: d0 02 00 00 wcsr IE,r2 if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 8009ba8: 29 e4 00 00 lw r4,(r15+0) 8009bac: 29 83 00 d4 lw r3,(r12+212) * 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 & 8009bb0: 29 82 00 d0 lw r2,(r12+208) (api->signals_pending | _POSIX_signals_Pending)) ) { 8009bb4: b8 83 18 00 or r3,r4,r3 * 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 & 8009bb8: a4 40 10 00 not r2,r2 8009bbc: a0 62 10 00 and r2,r3,r2 8009bc0: 44 40 00 19 be r2,r0,8009c24 <_POSIX_signals_Post_switch_hook+0xdc> (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); break; } _ISR_Enable( level ); 8009bc4: d0 01 00 00 wcsr IE,r1 for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8009bc8: 34 0b 00 1b mvi r11,27 _POSIX_signals_Check_signal( api, signo, false ); 8009bcc: b9 60 10 00 mv r2,r11 8009bd0: 34 03 00 00 mvi r3,0 8009bd4: b9 80 08 00 mv r1,r12 8009bd8: f8 00 0b 55 calli 800c92c <_POSIX_signals_Check_signal> _POSIX_signals_Check_signal( api, signo, true ); 8009bdc: b9 60 10 00 mv r2,r11 8009be0: b9 80 08 00 mv r1,r12 _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8009be4: 35 6b 00 01 addi r11,r11,1 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 8009be8: 34 03 00 01 mvi r3,1 8009bec: f8 00 0b 50 calli 800c92c <_POSIX_signals_Check_signal> _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8009bf0: 5d 6e ff f7 bne r11,r14,8009bcc <_POSIX_signals_Post_switch_hook+0x84> 8009bf4: 34 0b 00 01 mvi r11,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 ); 8009bf8: b9 60 10 00 mv r2,r11 8009bfc: 34 03 00 00 mvi r3,0 8009c00: b9 80 08 00 mv r1,r12 8009c04: f8 00 0b 4a calli 800c92c <_POSIX_signals_Check_signal> _POSIX_signals_Check_signal( api, signo, true ); 8009c08: b9 60 10 00 mv r2,r11 8009c0c: b9 80 08 00 mv r1,r12 _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++ ) { 8009c10: 35 6b 00 01 addi r11,r11,1 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 8009c14: 34 03 00 01 mvi r3,1 8009c18: f8 00 0b 45 calli 800c92c <_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++ ) { 8009c1c: 5d 6d ff f7 bne r11,r13,8009bf8 <_POSIX_signals_Post_switch_hook+0xb0> 8009c20: e3 ff ff df bi 8009b9c <_POSIX_signals_Post_switch_hook+0x54> */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 8009c24: 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; 8009c28: 2a 21 00 10 lw r1,(r17+16) 8009c2c: 58 32 00 34 sw (r1+52),r18 } 8009c30: 2b 9d 00 04 lw ra,(sp+4) 8009c34: 2b 8b 00 24 lw r11,(sp+36) 8009c38: 2b 8c 00 20 lw r12,(sp+32) 8009c3c: 2b 8d 00 1c lw r13,(sp+28) 8009c40: 2b 8e 00 18 lw r14,(sp+24) 8009c44: 2b 8f 00 14 lw r15,(sp+20) 8009c48: 2b 90 00 10 lw r16,(sp+16) 8009c4c: 2b 91 00 0c lw r17,(sp+12) 8009c50: 2b 92 00 08 lw r18,(sp+8) 8009c54: 37 9c 00 24 addi sp,sp,36 8009c58: c3 a0 00 00 ret =============================================================================== 0801ca8c <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 801ca8c: 37 9c ff ec addi sp,sp,-20 801ca90: 5b 8b 00 14 sw (sp+20),r11 801ca94: 5b 8c 00 10 sw (sp+16),r12 801ca98: 5b 8d 00 0c sw (sp+12),r13 801ca9c: 5b 8e 00 08 sw (sp+8),r14 801caa0: 5b 9d 00 04 sw (sp+4),ra 801caa4: b8 20 58 00 mv r11,r1 801caa8: b8 40 70 00 mv r14,r2 801caac: 34 01 00 01 mvi r1,1 801cab0: 34 42 ff ff addi r2,r2,-1 801cab4: b8 60 68 00 mv r13,r3 801cab8: fb ff fc 7a calli 801bca0 <__ashlsi3> /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 801cabc: 78 02 08 01 mvhi r2,0x801 801cac0: 38 42 de 44 ori r2,r2,0xde44 801cac4: 29 64 00 10 lw r4,(r11+16) 801cac8: 28 43 00 00 lw r3,(r2+0) { POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 801cacc: 29 65 01 1c lw r5,(r11+284) /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 801cad0: a0 83 10 00 and r2,r4,r3 801cad4: 44 43 00 21 be r2,r3,801cb58 <_POSIX_signals_Unblock_thread+0xcc> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 801cad8: 28 a2 00 d0 lw r2,(r5+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; 801cadc: 34 0c 00 00 mvi r12,0 } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 801cae0: a4 40 10 00 not r2,r2 801cae4: a0 22 08 00 and r1,r1,r2 801cae8: 44 20 00 14 be r1,r0,801cb38 <_POSIX_signals_Unblock_thread+0xac> 801caec: 78 01 10 00 mvhi r1,0x1000 801caf0: 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 ) ) { 801caf4: 44 20 00 31 be r1,r0,801cbb8 <_POSIX_signals_Unblock_thread+0x12c> */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 801caf8: 78 03 08 01 mvhi r3,0x801 the_thread->Wait.return_code = EINTR; 801cafc: 34 01 00 04 mvi r1,4 801cb00: 38 63 dc 04 ori r3,r3,0xdc04 801cb04: 59 61 00 34 sw (r11+52),r1 801cb08: 28 61 00 00 lw r1,(r3+0) 801cb0c: 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) ) 801cb10: 5c 20 00 3a bne r1,r0,801cbf8 <_POSIX_signals_Unblock_thread+0x16c> */ RTEMS_INLINE_ROUTINE bool _States_Is_delaying ( States_Control the_states ) { return (the_states & STATES_DELAYING); 801cb14: 20 84 00 08 andi r4,r4,0x8 _Thread_queue_Extract_with_proxy( the_thread ); else if ( _States_Is_delaying(the_thread->current_state) ) { 801cb18: 44 8c 00 08 be r4,r12,801cb38 <_POSIX_signals_Unblock_thread+0xac><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); 801cb1c: 35 61 00 48 addi r1,r11,72 801cb20: fb ff ac 6c calli 8007cd0 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 801cb24: 78 03 08 01 mvhi r3,0x801 801cb28: 38 63 dc 0c ori r3,r3,0xdc0c 801cb2c: 28 62 00 00 lw r2,(r3+0) 801cb30: b9 60 08 00 mv r1,r11 801cb34: fb ff b9 39 calli 800b018 <_Thread_Clear_state> if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; } 801cb38: b9 80 08 00 mv r1,r12 801cb3c: 2b 9d 00 04 lw ra,(sp+4) 801cb40: 2b 8b 00 14 lw r11,(sp+20) 801cb44: 2b 8c 00 10 lw r12,(sp+16) 801cb48: 2b 8d 00 0c lw r13,(sp+12) 801cb4c: 2b 8e 00 08 lw r14,(sp+8) 801cb50: 37 9c 00 14 addi sp,sp,20 801cb54: c3 a0 00 00 ret * 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) ) { 801cb58: 29 62 00 30 lw r2,(r11+48) 801cb5c: a0 22 10 00 and r2,r1,r2 801cb60: 44 40 00 20 be r2,r0,801cbe0 <_POSIX_signals_Unblock_thread+0x154> the_thread->Wait.return_code = EINTR; 801cb64: 34 01 00 04 mvi r1,4 801cb68: 59 61 00 34 sw (r11+52),r1 the_info = (siginfo_t *) the_thread->Wait.return_argument; 801cb6c: 29 61 00 28 lw r1,(r11+40) if ( !info ) { 801cb70: 45 a0 00 25 be r13,r0,801cc04 <_POSIX_signals_Unblock_thread+0x178> the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; } else { *the_info = *info; 801cb74: 29 a2 00 00 lw r2,(r13+0) 801cb78: 58 22 00 00 sw (r1+0),r2 801cb7c: 29 a2 00 04 lw r2,(r13+4) 801cb80: 58 22 00 04 sw (r1+4),r2 801cb84: 29 a2 00 08 lw r2,(r13+8) 801cb88: 58 22 00 08 sw (r1+8),r2 } _Thread_queue_Extract_with_proxy( the_thread ); 801cb8c: b9 60 08 00 mv r1,r11 801cb90: fb ff aa 60 calli 8007510 <_Thread_queue_Extract_with_proxy> return true; 801cb94: 34 0c 00 01 mvi r12,1 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; } 801cb98: b9 80 08 00 mv r1,r12 801cb9c: 2b 9d 00 04 lw ra,(sp+4) 801cba0: 2b 8b 00 14 lw r11,(sp+20) 801cba4: 2b 8c 00 10 lw r12,(sp+16) 801cba8: 2b 8d 00 0c lw r13,(sp+12) 801cbac: 2b 8e 00 08 lw r14,(sp+8) 801cbb0: 37 9c 00 14 addi sp,sp,20 801cbb4: c3 a0 00 00 ret else if ( _States_Is_delaying(the_thread->current_state) ) { (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 801cbb8: 5c 8c ff e0 bne r4,r12,801cb38 <_POSIX_signals_Unblock_thread+0xac><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 801cbbc: 78 01 08 02 mvhi r1,0x802 801cbc0: 38 21 0d e0 ori r1,r1,0xde0 801cbc4: 28 22 00 08 lw r2,(r1+8) 801cbc8: 44 4c ff dc be r2,r12,801cb38 <_POSIX_signals_Unblock_thread+0xac> 801cbcc: 28 22 00 10 lw r2,(r1+16) 801cbd0: 5d 62 ff da bne r11,r2,801cb38 <_POSIX_signals_Unblock_thread+0xac><== NEVER TAKEN _Thread_Dispatch_necessary = true; 801cbd4: 34 02 00 01 mvi r2,1 801cbd8: 30 22 00 0c sb (r1+12),r2 801cbdc: e3 ff ff d7 bi 801cb38 <_POSIX_signals_Unblock_thread+0xac> * 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) ) { 801cbe0: 28 a2 00 d0 lw r2,(r5+208) /* * This should only be reached via pthread_kill(). */ return false; 801cbe4: 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) ) { 801cbe8: a4 40 10 00 not r2,r2 801cbec: a0 22 08 00 and r1,r1,r2 801cbf0: 5c 2c ff dd bne r1,r12,801cb64 <_POSIX_signals_Unblock_thread+0xd8> 801cbf4: e3 ff ff d1 bi 801cb38 <_POSIX_signals_Unblock_thread+0xac> /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); 801cbf8: b9 60 08 00 mv r1,r11 801cbfc: fb ff aa 45 calli 8007510 <_Thread_queue_Extract_with_proxy> 801cc00: e3 ff ff ce bi 801cb38 <_POSIX_signals_Unblock_thread+0xac> the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; the_info->si_code = SI_USER; 801cc04: 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; 801cc08: 58 2e 00 00 sw (r1+0),r14 the_info->si_code = SI_USER; 801cc0c: 58 22 00 04 sw (r1+4),r2 the_info->si_value.sival_int = 0; 801cc10: 58 20 00 08 sw (r1+8),r0 801cc14: e3 ff ff de bi 801cb8c <_POSIX_signals_Unblock_thread+0x100> =============================================================================== 0800691c <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 800691c: 37 9c ff ec addi sp,sp,-20 8006920: 5b 8b 00 14 sw (sp+20),r11 8006924: 5b 8c 00 10 sw (sp+16),r12 8006928: 5b 8d 00 0c sw (sp+12),r13 800692c: 5b 8e 00 08 sw (sp+8),r14 8006930: 5b 9d 00 04 sw (sp+4),ra 8006934: b8 40 60 00 mv r12,r2 8006938: b8 20 68 00 mv r13,r1 RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 800693c: 44 40 00 35 be r2,r0,8006a10 <_RBTree_Extract_unprotected+0xf4> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 8006940: 28 21 00 08 lw r1,(r1+8) 8006944: 44 22 00 4a be r1,r2,8006a6c <_RBTree_Extract_unprotected+0x150> the_rbtree->first[RBT_LEFT] = next; } /* Check if max needs to be updated. min=max for 1 element trees so * do not use else if here. */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 8006948: 29 a1 00 0c lw r1,(r13+12) 800694c: 44 2c 00 4d be r1,r12,8006a80 <_RBTree_Extract_unprotected+0x164> * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 8006950: 29 8b 00 04 lw r11,(r12+4) 8006954: 45 60 00 53 be r11,r0,8006aa0 <_RBTree_Extract_unprotected+0x184> 8006958: 29 81 00 08 lw r1,(r12+8) 800695c: 5c 20 00 03 bne r1,r0,8006968 <_RBTree_Extract_unprotected+0x4c> 8006960: e0 00 00 36 bi 8006a38 <_RBTree_Extract_unprotected+0x11c> target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 8006964: b8 40 58 00 mv r11,r2 8006968: 29 62 00 08 lw r2,(r11+8) 800696c: 5c 40 ff fe bne r2,r0,8006964 <_RBTree_Extract_unprotected+0x48> * target's position (target is the right child of target->parent) * when target vacates it. if there is no child, then target->parent * should become NULL. This may cause the coloring to be violated. * For now we store the color of the node being deleted in victim_color. */ leaf = target->child[RBT_LEFT]; 8006970: 29 6e 00 04 lw r14,(r11+4) if(leaf) { 8006974: 45 c2 00 48 be r14,r2,8006a94 <_RBTree_Extract_unprotected+0x178> leaf->parent = target->parent; 8006978: 29 61 00 00 lw r1,(r11+0) 800697c: 59 c1 00 00 sw (r14+0),r1 } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; dir = target != target->parent->child[0]; 8006980: 29 61 00 00 lw r1,(r11+0) target->parent->child[dir] = leaf; /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 8006984: 29 84 00 00 lw r4,(r12+0) leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; 8006988: 29 63 00 0c lw r3,(r11+12) dir = target != target->parent->child[0]; 800698c: 28 22 00 04 lw r2,(r1+4) 8006990: fc 4b 10 00 cmpne r2,r2,r11 target->parent->child[dir] = leaf; 8006994: b4 42 10 00 add r2,r2,r2 8006998: b4 42 10 00 add r2,r2,r2 800699c: b4 22 10 00 add r2,r1,r2 80069a0: 58 4e 00 04 sw (r2+4),r14 /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 80069a4: 28 81 00 04 lw r1,(r4+4) 80069a8: fc 2c 08 00 cmpne r1,r1,r12 the_node->parent->child[dir] = target; 80069ac: b4 21 08 00 add r1,r1,r1 80069b0: b4 21 08 00 add r1,r1,r1 80069b4: b4 81 08 00 add r1,r4,r1 80069b8: 58 2b 00 04 sw (r1+4),r11 /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 80069bc: 29 81 00 08 lw r1,(r12+8) 80069c0: 59 61 00 08 sw (r11+8),r1 if (the_node->child[RBT_RIGHT]) 80069c4: 29 81 00 08 lw r1,(r12+8) 80069c8: 44 20 00 02 be r1,r0,80069d0 <_RBTree_Extract_unprotected+0xb4><== NEVER TAKEN the_node->child[RBT_RIGHT]->parent = target; 80069cc: 58 2b 00 00 sw (r1+0),r11 target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 80069d0: 29 81 00 04 lw r1,(r12+4) 80069d4: 59 61 00 04 sw (r11+4),r1 if (the_node->child[RBT_LEFT]) 80069d8: 29 81 00 04 lw r1,(r12+4) 80069dc: 44 20 00 02 be r1,r0,80069e4 <_RBTree_Extract_unprotected+0xc8> the_node->child[RBT_LEFT]->parent = target; 80069e0: 58 2b 00 00 sw (r1+0),r11 /* finally, update the parent node and recolor. target has completely * replaced the_node, and target's child has moved up the tree if needed. * the_node is no longer part of the tree, although it has valid pointers * still. */ target->parent = the_node->parent; 80069e4: 29 82 00 00 lw r2,(r12+0) target->color = the_node->color; 80069e8: 29 81 00 0c lw r1,(r12+12) /* finally, update the parent node and recolor. target has completely * replaced the_node, and target's child has moved up the tree if needed. * the_node is no longer part of the tree, although it has valid pointers * still. */ target->parent = the_node->parent; 80069ec: 59 62 00 00 sw (r11+0),r2 target->color = the_node->color; 80069f0: 59 61 00 0c sw (r11+12),r1 /* fix coloring. leaf has moved up the tree. The color of the deleted * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 80069f4: 44 60 00 0e be r3,r0,8006a2c <_RBTree_Extract_unprotected+0x110> /* Wipe the_node */ _RBTree_Set_off_rbtree(the_node); /* set root to black, if it exists */ if (the_rbtree->root) the_rbtree->root->color = RBT_BLACK; 80069f8: 29 a1 00 04 lw r1,(r13+4) */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; 80069fc: 59 80 00 08 sw (r12+8),r0 8006a00: 59 80 00 04 sw (r12+4),r0 8006a04: 59 80 00 00 sw (r12+0),r0 8006a08: 44 20 00 02 be r1,r0,8006a10 <_RBTree_Extract_unprotected+0xf4> 8006a0c: 58 20 00 0c sw (r1+12),r0 } 8006a10: 2b 9d 00 04 lw ra,(sp+4) 8006a14: 2b 8b 00 14 lw r11,(sp+20) 8006a18: 2b 8c 00 10 lw r12,(sp+16) 8006a1c: 2b 8d 00 0c lw r13,(sp+12) 8006a20: 2b 8e 00 08 lw r14,(sp+8) 8006a24: 37 9c 00 14 addi sp,sp,20 8006a28: c3 a0 00 00 ret * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ if (leaf) { 8006a2c: 45 c3 ff f3 be r14,r3,80069f8 <_RBTree_Extract_unprotected+0xdc> leaf->color = RBT_BLACK; /* case 2 */ 8006a30: 59 c0 00 0c sw (r14+12),r0 8006a34: e3 ff ff f1 bi 80069f8 <_RBTree_Extract_unprotected+0xdc> * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 8006a38: b9 60 70 00 mv r14,r11 * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { leaf->parent = the_node->parent; 8006a3c: 29 81 00 00 lw r1,(r12+0) 8006a40: 59 c1 00 00 sw (r14+0),r1 _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 8006a44: 29 82 00 00 lw r2,(r12+0) leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; 8006a48: 29 83 00 0c lw r3,(r12+12) /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 8006a4c: 28 41 00 04 lw r1,(r2+4) 8006a50: fc 2c 08 00 cmpne r1,r1,r12 the_node->parent->child[dir] = leaf; 8006a54: b4 21 08 00 add r1,r1,r1 8006a58: b4 21 08 00 add r1,r1,r1 8006a5c: b4 41 08 00 add r1,r2,r1 8006a60: 58 2e 00 04 sw (r1+4),r14 /* fix coloring. leaf has moved up the tree. The color of the deleted * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 8006a64: 5c 60 ff e5 bne r3,r0,80069f8 <_RBTree_Extract_unprotected+0xdc> 8006a68: e3 ff ff f1 bi 8006a2c <_RBTree_Extract_unprotected+0x110> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); 8006a6c: b8 40 08 00 mv r1,r2 8006a70: 34 02 00 01 mvi r2,1 8006a74: f8 00 01 09 calli 8006e98 <_RBTree_Next_unprotected> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 8006a78: 59 a1 00 08 sw (r13+8),r1 8006a7c: e3 ff ff b3 bi 8006948 <_RBTree_Extract_unprotected+0x2c> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); 8006a80: b9 80 08 00 mv r1,r12 8006a84: 34 02 00 00 mvi r2,0 8006a88: f8 00 01 04 calli 8006e98 <_RBTree_Next_unprotected> /* Check if max needs to be updated. min=max for 1 element trees so * do not use else if here. */ if (the_node == the_rbtree->first[RBT_RIGHT]) { RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 8006a8c: 59 a1 00 0c sw (r13+12),r1 8006a90: e3 ff ff b0 bi 8006950 <_RBTree_Extract_unprotected+0x34> leaf = target->child[RBT_LEFT]; if(leaf) { leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 8006a94: b9 60 08 00 mv r1,r11 8006a98: fb ff fe e2 calli 8006620 <_RBTree_Extract_validate_unprotected> 8006a9c: e3 ff ff b9 bi 8006980 <_RBTree_Extract_unprotected+0x64> * the_node's location in the tree. This may cause the coloring to be * violated. We will fix it later. * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; 8006aa0: 29 8e 00 08 lw r14,(r12+8) if( leaf ) { 8006aa4: 5d cb ff e6 bne r14,r11,8006a3c <_RBTree_Extract_unprotected+0x120> leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 8006aa8: b9 80 08 00 mv r1,r12 8006aac: fb ff fe dd calli 8006620 <_RBTree_Extract_validate_unprotected> 8006ab0: e3 ff ff e5 bi 8006a44 <_RBTree_Extract_unprotected+0x128> =============================================================================== 08006620 <_RBTree_Extract_validate_unprotected>: * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( RBTree_Node *the_node ) { 8006620: 37 9c ff fc addi sp,sp,-4 8006624: 5b 8b 00 04 sw (sp+4),r11 RBTree_Node *parent, *sibling; RBTree_Direction dir; parent = the_node->parent; 8006628: 28 22 00 00 lw r2,(r1+0) if(!parent->parent) return; 800662c: 28 43 00 00 lw r3,(r2+0) 8006630: 44 60 00 23 be r3,r0,80066bc <_RBTree_Extract_validate_unprotected+0x9c> { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) 8006634: 28 43 00 04 lw r3,(r2+4) 8006638: 44 23 00 af be r1,r3,80068f4 <_RBTree_Extract_validate_unprotected+0x2d4> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 800663c: 34 04 00 01 mvi r4,1 8006640: e0 00 00 1a bi 80066a8 <_RBTree_Extract_validate_unprotected+0x88> sibling = _RBTree_Sibling(the_node); /* continue to correct tree as long as the_node is black and not the root */ while (!_RBTree_Is_red(the_node) && parent->parent) { 8006644: 28 45 00 00 lw r5,(r2+0) 8006648: 44 a0 00 1a be r5,r0,80066b0 <_RBTree_Extract_validate_unprotected+0x90> 800664c: 44 60 00 03 be r3,r0,8006658 <_RBTree_Extract_validate_unprotected+0x38><== NEVER TAKEN 8006650: 28 66 00 0c lw r6,(r3+12) 8006654: 44 c4 00 1d be r6,r4,80066c8 <_RBTree_Extract_validate_unprotected+0xa8> _RBTree_Rotate(parent, dir); sibling = parent->child[_RBTree_Opposite_direction(dir)]; } /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && 8006658: 28 65 00 08 lw r5,(r3+8) 800665c: 44 a0 00 03 be r5,r0,8006668 <_RBTree_Extract_validate_unprotected+0x48> 8006660: 28 a6 00 0c lw r6,(r5+12) 8006664: 44 c4 00 4d be r6,r4,8006798 <_RBTree_Extract_validate_unprotected+0x178> !_RBTree_Is_red(sibling->child[RBT_LEFT])) { 8006668: 28 66 00 04 lw r6,(r3+4) 800666c: 44 c0 00 03 be r6,r0,8006678 <_RBTree_Extract_validate_unprotected+0x58> 8006670: 28 c6 00 0c lw r6,(r6+12) 8006674: 44 c4 00 49 be r6,r4,8006798 <_RBTree_Extract_validate_unprotected+0x178> sibling->color = RBT_RED; 8006678: 58 64 00 0c sw (r3+12),r4 800667c: 28 43 00 0c lw r3,(r2+12) 8006680: 44 64 00 3c be r3,r4,8006770 <_RBTree_Extract_validate_unprotected+0x150> if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; break; } the_node = parent; /* done if parent is red */ parent = the_node->parent; 8006684: 28 45 00 00 lw r5,(r2+0) RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 8006688: 34 03 00 00 mvi r3,0 800668c: 44 a0 00 05 be r5,r0,80066a0 <_RBTree_Extract_validate_unprotected+0x80><== NEVER TAKEN if(!(the_node->parent->parent)) return NULL; 8006690: 28 a1 00 00 lw r1,(r5+0) 8006694: 44 20 00 03 be r1,r0,80066a0 <_RBTree_Extract_validate_unprotected+0x80> if(the_node == the_node->parent->child[RBT_LEFT]) 8006698: 28 a3 00 04 lw r3,(r5+4) 800669c: 44 43 00 3d be r2,r3,8006790 <_RBTree_Extract_validate_unprotected+0x170> c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; c->parent = the_node->parent; the_node->parent = c; 80066a0: b8 40 08 00 mv r1,r2 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 80066a4: b8 a0 10 00 mv r2,r5 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 80066a8: 28 25 00 0c lw r5,(r1+12) 80066ac: 5c a4 ff e6 bne r5,r4,8006644 <_RBTree_Extract_validate_unprotected+0x24> sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 80066b0: 28 22 00 00 lw r2,(r1+0) 80066b4: 28 42 00 00 lw r2,(r2+0) 80066b8: 44 40 00 32 be r2,r0,8006780 <_RBTree_Extract_validate_unprotected+0x160> } 80066bc: 2b 8b 00 04 lw r11,(sp+4) 80066c0: 37 9c 00 04 addi sp,sp,4 80066c4: c3 a0 00 00 ret * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; 80066c8: 28 46 00 04 lw r6,(r2+4) * then rotate parent left, making the sibling be the_node's grandparent. * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; 80066cc: 58 44 00 0c sw (r2+12),r4 sibling->color = RBT_BLACK; 80066d0: 58 60 00 0c sw (r3+12),r0 dir = the_node != parent->child[0]; 80066d4: fc c1 50 00 cmpne r10,r6,r1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 80066d8: 34 03 00 00 mvi r3,0 * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 80066dc: 19 49 00 01 xori r9,r10,0x1 80066e0: b5 29 38 00 add r7,r9,r9 80066e4: b4 e7 40 00 add r8,r7,r7 80066e8: b4 48 40 00 add r8,r2,r8 80066ec: 29 08 00 04 lw r8,(r8+4) 80066f0: 45 00 ff da be r8,r0,8006658 <_RBTree_Extract_validate_unprotected+0x38><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 80066f4: 34 08 00 00 mvi r8,0 80066f8: 45 20 00 03 be r9,r0,8006704 <_RBTree_Extract_validate_unprotected+0xe4> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 80066fc: 28 46 00 08 lw r6,(r2+8) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006700: 34 08 00 01 mvi r8,1 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 8006704: b5 4a 18 00 add r3,r10,r10 8006708: b4 63 48 00 add r9,r3,r3 800670c: b4 c9 48 00 add r9,r6,r9 8006710: b5 08 40 00 add r8,r8,r8 8006714: 29 2a 00 04 lw r10,(r9+4) 8006718: b5 08 40 00 add r8,r8,r8 800671c: b4 48 40 00 add r8,r2,r8 8006720: 59 0a 00 04 sw (r8+4),r10 if (c->child[dir]) 8006724: 29 28 00 04 lw r8,(r9+4) 8006728: 45 00 00 03 be r8,r0,8006734 <_RBTree_Extract_validate_unprotected+0x114><== NEVER TAKEN c->child[dir]->parent = the_node; 800672c: 59 02 00 00 sw (r8+0),r2 8006730: 28 45 00 00 lw r5,(r2+0) c->child[dir] = the_node; 8006734: b4 63 18 00 add r3,r3,r3 8006738: b4 c3 18 00 add r3,r6,r3 800673c: 58 62 00 04 sw (r3+4),r2 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006740: 28 a3 00 04 lw r3,(r5+4) c->parent = the_node->parent; 8006744: 58 c5 00 00 sw (r6+0),r5 the_node->parent = c; 8006748: b4 e7 38 00 add r7,r7,r7 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 800674c: fc 43 18 00 cmpne r3,r2,r3 c->parent = the_node->parent; the_node->parent = c; 8006750: b4 47 38 00 add r7,r2,r7 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006754: b4 63 18 00 add r3,r3,r3 8006758: b4 63 18 00 add r3,r3,r3 800675c: b4 a3 28 00 add r5,r5,r3 8006760: 58 a6 00 04 sw (r5+4),r6 c->parent = the_node->parent; the_node->parent = c; 8006764: 28 e3 00 04 lw r3,(r7+4) 8006768: 58 46 00 00 sw (r2+0),r6 800676c: e3 ff ff bb bi 8006658 <_RBTree_Extract_validate_unprotected+0x38> /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && !_RBTree_Is_red(sibling->child[RBT_LEFT])) { sibling->color = RBT_RED; if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; 8006770: 58 40 00 0c sw (r2+12),r0 sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 8006774: 28 22 00 00 lw r2,(r1+0) 8006778: 28 42 00 00 lw r2,(r2+0) 800677c: 5c 40 ff d0 bne r2,r0,80066bc <_RBTree_Extract_validate_unprotected+0x9c><== ALWAYS TAKEN 8006780: 58 20 00 0c sw (r1+12),r0 } 8006784: 2b 8b 00 04 lw r11,(sp+4) 8006788: 37 9c 00 04 addi sp,sp,4 800678c: c3 a0 00 00 ret if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; 8006790: 28 a3 00 08 lw r3,(r5+8) 8006794: e3 ff ff c3 bi 80066a0 <_RBTree_Extract_validate_unprotected+0x80> * cases, either the_node is to the left or the right of the parent. * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; 8006798: 28 47 00 04 lw r7,(r2+4) 800679c: fc e1 38 00 cmpne r7,r7,r1 * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 80067a0: 18 e8 00 01 xori r8,r7,0x1 * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { 80067a4: b5 08 20 00 add r4,r8,r8 80067a8: b4 84 48 00 add r9,r4,r4 80067ac: b4 69 30 00 add r6,r3,r9 80067b0: 28 c6 00 04 lw r6,(r6+4) */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 80067b4: 44 c0 00 04 be r6,r0,80067c4 <_RBTree_Extract_validate_unprotected+0x1a4> 80067b8: 28 cb 00 0c lw r11,(r6+12) 80067bc: 34 0a 00 01 mvi r10,1 80067c0: 45 6a 00 54 be r11,r10,8006910 <_RBTree_Extract_validate_unprotected+0x2f0> sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; 80067c4: b4 e7 48 00 add r9,r7,r7 * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 80067c8: 19 0a 00 01 xori r10,r8,0x1 * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; 80067cc: b5 29 48 00 add r9,r9,r9 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 80067d0: b5 4a 30 00 add r6,r10,r10 80067d4: b4 69 48 00 add r9,r3,r9 80067d8: b4 c6 30 00 add r6,r6,r6 80067dc: 29 29 00 04 lw r9,(r9+4) 80067e0: b4 66 30 00 add r6,r3,r6 * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; 80067e4: 34 0b 00 01 mvi r11,1 80067e8: 28 c6 00 04 lw r6,(r6+4) 80067ec: 58 6b 00 0c sw (r3+12),r11 sibling->child[dir]->color = RBT_BLACK; 80067f0: 59 20 00 0c sw (r9+12),r0 80067f4: 44 c0 00 1a be r6,r0,800685c <_RBTree_Extract_validate_unprotected+0x23c><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 80067f8: 5d 40 00 41 bne r10,r0,80068fc <_RBTree_Extract_validate_unprotected+0x2dc> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 80067fc: 28 65 00 04 lw r5,(r3+4) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006800: 34 06 00 00 mvi r6,0 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 8006804: b4 84 48 00 add r9,r4,r4 8006808: b4 a9 48 00 add r9,r5,r9 800680c: b4 c6 30 00 add r6,r6,r6 8006810: 29 2a 00 04 lw r10,(r9+4) 8006814: b4 c6 30 00 add r6,r6,r6 8006818: b4 66 30 00 add r6,r3,r6 800681c: 58 ca 00 04 sw (r6+4),r10 if (c->child[dir]) 8006820: 29 26 00 04 lw r6,(r9+4) 8006824: 44 c0 00 02 be r6,r0,800682c <_RBTree_Extract_validate_unprotected+0x20c> c->child[dir]->parent = the_node; 8006828: 58 c3 00 00 sw (r6+0),r3 c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 800682c: 28 66 00 00 lw r6,(r3+0) the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 8006830: b4 84 48 00 add r9,r4,r4 8006834: b4 a9 48 00 add r9,r5,r9 8006838: 59 23 00 04 sw (r9+4),r3 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 800683c: 28 c9 00 04 lw r9,(r6+4) c->parent = the_node->parent; 8006840: 58 a6 00 00 sw (r5+0),r6 the_node->parent = c; 8006844: 58 65 00 00 sw (r3+0),r5 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006848: fc 69 18 00 cmpne r3,r3,r9 800684c: b4 63 18 00 add r3,r3,r3 8006850: b4 63 18 00 add r3,r3,r3 8006854: b4 c3 18 00 add r3,r6,r3 8006858: 58 65 00 04 sw (r3+4),r5 _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; 800685c: b4 84 20 00 add r4,r4,r4 8006860: b4 44 18 00 add r3,r2,r4 8006864: 28 63 00 04 lw r3,(r3+4) 8006868: b4 64 20 00 add r4,r3,r4 800686c: 28 86 00 04 lw r6,(r4+4) 8006870: b8 60 20 00 mv r4,r3 } sibling->color = parent->color; 8006874: 28 45 00 0c lw r5,(r2+12) 8006878: 58 65 00 0c sw (r3+12),r5 parent->color = RBT_BLACK; 800687c: 58 40 00 0c sw (r2+12),r0 sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; 8006880: 58 c0 00 0c sw (r6+12),r0 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 8006884: 44 80 ff 8b be r4,r0,80066b0 <_RBTree_Extract_validate_unprotected+0x90><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006888: 45 00 00 1f be r8,r0,8006904 <_RBTree_Extract_validate_unprotected+0x2e4> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 800688c: 28 43 00 08 lw r3,(r2+8) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006890: 34 04 00 01 mvi r4,1 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 8006894: b4 e7 38 00 add r7,r7,r7 8006898: b4 e7 28 00 add r5,r7,r7 800689c: b4 65 28 00 add r5,r3,r5 80068a0: b4 84 20 00 add r4,r4,r4 80068a4: 28 a6 00 04 lw r6,(r5+4) 80068a8: b4 84 20 00 add r4,r4,r4 80068ac: b4 44 20 00 add r4,r2,r4 80068b0: 58 86 00 04 sw (r4+4),r6 if (c->child[dir]) 80068b4: 28 a4 00 04 lw r4,(r5+4) 80068b8: 44 80 00 02 be r4,r0,80068c0 <_RBTree_Extract_validate_unprotected+0x2a0> c->child[dir]->parent = the_node; 80068bc: 58 82 00 00 sw (r4+0),r2 c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80068c0: 28 44 00 00 lw r4,(r2+0) the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 80068c4: b4 e7 38 00 add r7,r7,r7 80068c8: b4 67 38 00 add r7,r3,r7 80068cc: 58 e2 00 04 sw (r7+4),r2 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80068d0: 28 85 00 04 lw r5,(r4+4) c->parent = the_node->parent; 80068d4: 58 64 00 00 sw (r3+0),r4 the_node->parent = c; 80068d8: 58 43 00 00 sw (r2+0),r3 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 80068dc: fc 45 10 00 cmpne r2,r2,r5 80068e0: b4 42 10 00 add r2,r2,r2 80068e4: b4 42 10 00 add r2,r2,r2 80068e8: b4 82 10 00 add r2,r4,r2 80068ec: 58 43 00 04 sw (r2+4),r3 80068f0: e3 ff ff 70 bi 80066b0 <_RBTree_Extract_validate_unprotected+0x90> if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; 80068f4: 28 43 00 08 lw r3,(r2+8) 80068f8: e3 ff ff 51 bi 800663c <_RBTree_Extract_validate_unprotected+0x1c> */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 80068fc: 34 06 00 01 mvi r6,1 8006900: e3 ff ff c1 bi 8006804 <_RBTree_Extract_validate_unprotected+0x1e4> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 8006904: 28 43 00 04 lw r3,(r2+4) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006908: 34 04 00 00 mvi r4,0 800690c: e3 ff ff e2 bi 8006894 <_RBTree_Extract_validate_unprotected+0x274> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8006910: b4 49 48 00 add r9,r2,r9 8006914: 29 24 00 04 lw r4,(r9+4) 8006918: e3 ff ff d7 bi 8006874 <_RBTree_Extract_validate_unprotected+0x254> =============================================================================== 08006d00 <_RBTree_Find>: RBTree_Node *_RBTree_Find( RBTree_Control *the_rbtree, RBTree_Node *search_node ) { 8006d00: 37 9c ff e8 addi sp,sp,-24 8006d04: 5b 8b 00 18 sw (sp+24),r11 8006d08: 5b 8c 00 14 sw (sp+20),r12 8006d0c: 5b 8d 00 10 sw (sp+16),r13 8006d10: 5b 8e 00 0c sw (sp+12),r14 8006d14: 5b 8f 00 08 sw (sp+8),r15 8006d18: 5b 9d 00 04 sw (sp+4),ra 8006d1c: b8 20 60 00 mv r12,r1 8006d20: b8 40 68 00 mv r13,r2 ISR_Level level; RBTree_Node *return_node; return_node = NULL; _ISR_Disable( level ); 8006d24: 90 00 78 00 rcsr r15,IE 8006d28: 34 01 ff fe mvi r1,-2 8006d2c: a1 e1 08 00 and r1,r15,r1 8006d30: d0 01 00 00 wcsr IE,r1 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; 8006d34: 29 8b 00 04 lw r11,(r12+4) RBTree_Node* found = NULL; 8006d38: 34 0e 00 00 mvi r14,0 int compare_result; while (iter_node) { 8006d3c: 45 60 00 0f be r11,r0,8006d78 <_RBTree_Find+0x78> <== NEVER TAKEN compare_result = the_rbtree->compare_function(the_node, iter_node); 8006d40: 29 83 00 10 lw r3,(r12+16) 8006d44: b9 60 10 00 mv r2,r11 8006d48: b9 a0 08 00 mv r1,r13 8006d4c: d8 60 00 00 call r3 found = iter_node; if ( the_rbtree->is_unique ) break; } RBTree_Direction dir = 8006d50: 68 23 00 00 cmpgi r3,r1,0 RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( _RBTree_Is_equal( compare_result ) ) { 8006d54: 5c 20 00 04 bne r1,r0,8006d64 <_RBTree_Find+0x64> found = iter_node; if ( the_rbtree->is_unique ) 8006d58: 41 82 00 14 lbu r2,(r12+20) 8006d5c: b9 60 70 00 mv r14,r11 8006d60: 5c 41 00 10 bne r2,r1,8006da0 <_RBTree_Find+0xa0> break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 8006d64: b4 63 18 00 add r3,r3,r3 8006d68: b4 63 18 00 add r3,r3,r3 8006d6c: b5 63 58 00 add r11,r11,r3 8006d70: 29 6b 00 04 lw r11,(r11+4) ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { 8006d74: 5d 60 ff f3 bne r11,r0,8006d40 <_RBTree_Find+0x40> return_node = _RBTree_Find_unprotected( the_rbtree, search_node ); _ISR_Enable( level ); 8006d78: d0 0f 00 00 wcsr IE,r15 return return_node; } 8006d7c: b9 c0 08 00 mv r1,r14 8006d80: 2b 9d 00 04 lw ra,(sp+4) 8006d84: 2b 8b 00 18 lw r11,(sp+24) 8006d88: 2b 8c 00 14 lw r12,(sp+20) 8006d8c: 2b 8d 00 10 lw r13,(sp+16) 8006d90: 2b 8e 00 0c lw r14,(sp+12) 8006d94: 2b 8f 00 08 lw r15,(sp+8) 8006d98: 37 9c 00 18 addi sp,sp,24 8006d9c: c3 a0 00 00 ret compare_result = the_rbtree->compare_function(the_node, iter_node); if ( _RBTree_Is_equal( compare_result ) ) { found = iter_node; if ( the_rbtree->is_unique ) 8006da0: b9 60 70 00 mv r14,r11 8006da4: e3 ff ff f5 bi 8006d78 <_RBTree_Find+0x78> =============================================================================== 080071e4 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 80071e4: 37 9c ff ec addi sp,sp,-20 80071e8: 5b 8b 00 14 sw (sp+20),r11 80071ec: 5b 8c 00 10 sw (sp+16),r12 80071f0: 5b 8d 00 0c sw (sp+12),r13 80071f4: 5b 8e 00 08 sw (sp+8),r14 80071f8: 5b 9d 00 04 sw (sp+4),ra 80071fc: b8 20 68 00 mv r13,r1 8007200: b8 80 58 00 mv r11,r4 8007204: b8 a0 70 00 mv r14,r5 8007208: 20 c6 00 ff andi r6,r6,0xff size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 800720c: 44 20 00 0f be r1,r0,8007248 <_RBTree_Initialize+0x64> <== NEVER TAKEN RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 8007210: 58 20 00 00 sw (r1+0),r0 the_rbtree->root = NULL; 8007214: 58 20 00 04 sw (r1+4),r0 the_rbtree->first[0] = NULL; 8007218: 58 20 00 08 sw (r1+8),r0 the_rbtree->first[1] = NULL; 800721c: 58 20 00 0c sw (r1+12),r0 the_rbtree->compare_function = compare_function; 8007220: 58 22 00 10 sw (r1+16),r2 the_rbtree->is_unique = is_unique; 8007224: 30 26 00 14 sb (r1+20),r6 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 8007228: 44 80 00 08 be r4,r0,8007248 <_RBTree_Initialize+0x64> <== NEVER TAKEN /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; 800722c: b8 60 60 00 mv r12,r3 while ( count-- ) { _RBTree_Insert_unprotected(the_rbtree, next); 8007230: b9 80 10 00 mv r2,r12 8007234: b9 a0 08 00 mv r1,r13 #include #include #include #include void _RBTree_Initialize( 8007238: 35 6b ff ff addi r11,r11,-1 _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { _RBTree_Insert_unprotected(the_rbtree, next); 800723c: fb ff fe f1 calli 8006e00 <_RBTree_Insert_unprotected> #include #include #include #include void _RBTree_Initialize( 8007240: b5 8e 60 00 add r12,r12,r14 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 8007244: 5d 60 ff fb bne r11,r0,8007230 <_RBTree_Initialize+0x4c> _RBTree_Insert_unprotected(the_rbtree, next); next = (RBTree_Node *) _Addresses_Add_offset( (void *) next, node_size ); } } 8007248: 2b 9d 00 04 lw ra,(sp+4) 800724c: 2b 8b 00 14 lw r11,(sp+20) 8007250: 2b 8c 00 10 lw r12,(sp+16) 8007254: 2b 8d 00 0c lw r13,(sp+12) 8007258: 2b 8e 00 08 lw r14,(sp+8) 800725c: 37 9c 00 14 addi sp,sp,20 8007260: c3 a0 00 00 ret =============================================================================== 08006ae8 <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 8006ae8: 37 9c ff e4 addi sp,sp,-28 8006aec: 5b 8b 00 1c sw (sp+28),r11 8006af0: 5b 8c 00 18 sw (sp+24),r12 8006af4: 5b 8d 00 14 sw (sp+20),r13 8006af8: 5b 8e 00 10 sw (sp+16),r14 8006afc: 5b 8f 00 0c sw (sp+12),r15 8006b00: 5b 90 00 08 sw (sp+8),r16 8006b04: 5b 9d 00 04 sw (sp+4),ra if(!the_node) return (RBTree_Node*)-1; 8006b08: 34 0d ff ff mvi r13,-1 */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 8006b0c: b8 40 58 00 mv r11,r2 8006b10: b8 20 60 00 mv r12,r1 if(!the_node) return (RBTree_Node*)-1; 8006b14: 44 40 00 87 be r2,r0,8006d30 <_RBTree_Insert_unprotected+0x248><== NEVER TAKEN RBTree_Node *iter_node = the_rbtree->root; 8006b18: 28 2f 00 04 lw r15,(r1+4) int compare_result; if (!iter_node) { /* special case: first node inserted */ 8006b1c: 5d e0 00 03 bne r15,r0,8006b28 <_RBTree_Insert_unprotected+0x40> 8006b20: e0 00 00 a3 bi 8006dac <_RBTree_Insert_unprotected+0x2c4> while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { 8006b24: 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); 8006b28: 29 83 00 10 lw r3,(r12+16) 8006b2c: b9 e0 10 00 mv r2,r15 8006b30: b9 60 08 00 mv r1,r11 8006b34: d8 60 00 00 call r3 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 8006b38: 41 82 00 14 lbu r2,(r12+20) 8006b3c: 44 40 00 02 be r2,r0,8006b44 <_RBTree_Insert_unprotected+0x5c> 8006b40: 44 20 00 99 be r1,r0,8006da4 <_RBTree_Insert_unprotected+0x2bc><== NEVER TAKEN return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 8006b44: a4 20 08 00 not r1,r1 8006b48: 34 02 00 1f mvi r2,31 8006b4c: fb ff e8 7f calli 8000d48 <__lshrsi3> if (!iter_node->child[dir]) { 8006b50: b4 21 18 00 add r3,r1,r1 8006b54: b4 63 18 00 add r3,r3,r3 8006b58: b5 e3 18 00 add r3,r15,r3 8006b5c: 28 6d 00 04 lw r13,(r3+4) /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 8006b60: b8 20 70 00 mv r14,r1 if (!iter_node->child[dir]) { 8006b64: 34 63 00 04 addi r3,r3,4 8006b68: 5d a0 ff ef bne r13,r0,8006b24 <_RBTree_Insert_unprotected+0x3c> RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 8006b6c: 34 30 00 02 addi r16,r1,2 8006b70: b6 10 08 00 add r1,r16,r16 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 8006b74: 59 60 00 08 sw (r11+8),r0 8006b78: 59 60 00 04 sw (r11+4),r0 8006b7c: b4 21 08 00 add r1,r1,r1 the_node->color = RBT_RED; iter_node->child[dir] = the_node; 8006b80: 58 6b 00 00 sw (r3+0),r11 8006b84: b5 81 08 00 add r1,r12,r1 the_node->parent = iter_node; 8006b88: 59 6f 00 00 sw (r11+0),r15 /* update min/max */ compare_result = the_rbtree->compare_function( 8006b8c: 28 22 00 00 lw r2,(r1+0) 8006b90: 29 84 00 10 lw r4,(r12+16) if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; 8006b94: 34 03 00 01 mvi r3,1 8006b98: 59 63 00 0c sw (r11+12),r3 iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ compare_result = the_rbtree->compare_function( 8006b9c: b9 60 08 00 mv r1,r11 8006ba0: d8 80 00 00 call r4 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 8006ba4: 5d cd 00 6f bne r14,r13,8006d60 <_RBTree_Insert_unprotected+0x278> 8006ba8: 49 a1 00 6f bg r13,r1,8006d64 <_RBTree_Insert_unprotected+0x27c> (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; 8006bac: 29 63 00 00 lw r3,(r11+0) */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8006bb0: 34 06 00 01 mvi r6,1 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 8006bb4: 28 62 00 00 lw r2,(r3+0) 8006bb8: b8 40 08 00 mv r1,r2 8006bbc: 44 40 00 5c be r2,r0,8006d2c <_RBTree_Insert_unprotected+0x244> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8006bc0: 28 64 00 0c lw r4,(r3+12) 8006bc4: 5c 86 00 5b bne r4,r6,8006d30 <_RBTree_Insert_unprotected+0x248> ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(!(the_node->parent->parent->parent)) return NULL; 8006bc8: 28 47 00 00 lw r7,(r2+0) 8006bcc: 44 e0 00 74 be r7,r0,8006d9c <_RBTree_Insert_unprotected+0x2b4><== NEVER TAKEN { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) 8006bd0: 28 44 00 04 lw r4,(r2+4) 8006bd4: b8 80 28 00 mv r5,r4 8006bd8: 44 64 00 60 be r3,r4,8006d58 <_RBTree_Insert_unprotected+0x270> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8006bdc: 44 a0 00 03 be r5,r0,8006be8 <_RBTree_Insert_unprotected+0x100> 8006be0: 28 a8 00 0c lw r8,(r5+12) 8006be4: 45 06 00 65 be r8,r6,8006d78 <_RBTree_Insert_unprotected+0x290> the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 8006be8: 28 65 00 04 lw r5,(r3+4) RBTree_Direction pdir = the_node->parent != g->child[0]; 8006bec: fc 64 20 00 cmpne r4,r3,r4 the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 8006bf0: fd 65 38 00 cmpne r7,r11,r5 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 8006bf4: 44 e4 00 27 be r7,r4,8006c90 <_RBTree_Insert_unprotected+0x1a8> * in an unique @a the_rbtree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ RBTree_Node *_RBTree_Insert_unprotected( 8006bf8: 18 89 00 01 xori r9,r4,0x1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 8006bfc: b5 29 38 00 add r7,r9,r9 8006c00: b4 e7 38 00 add r7,r7,r7 8006c04: b4 67 38 00 add r7,r3,r7 8006c08: 28 e8 00 04 lw r8,(r7+4) 8006c0c: b4 84 38 00 add r7,r4,r4 8006c10: 45 00 00 1c be r8,r0,8006c80 <_RBTree_Insert_unprotected+0x198><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006c14: 34 08 00 00 mvi r8,0 8006c18: 45 20 00 03 be r9,r0,8006c24 <_RBTree_Insert_unprotected+0x13c> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 8006c1c: 28 65 00 08 lw r5,(r3+8) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006c20: 34 08 00 01 mvi r8,1 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 8006c24: b4 84 38 00 add r7,r4,r4 8006c28: b4 e7 48 00 add r9,r7,r7 8006c2c: b4 a9 48 00 add r9,r5,r9 8006c30: b5 08 40 00 add r8,r8,r8 8006c34: 29 2a 00 04 lw r10,(r9+4) 8006c38: b5 08 40 00 add r8,r8,r8 8006c3c: b4 68 40 00 add r8,r3,r8 8006c40: 59 0a 00 04 sw (r8+4),r10 if (c->child[dir]) 8006c44: 29 28 00 04 lw r8,(r9+4) 8006c48: 45 00 00 03 be r8,r0,8006c54 <_RBTree_Insert_unprotected+0x16c> c->child[dir]->parent = the_node; 8006c4c: 59 03 00 00 sw (r8+0),r3 8006c50: 28 62 00 00 lw r2,(r3+0) c->child[dir] = the_node; 8006c54: b4 e7 40 00 add r8,r7,r7 8006c58: b4 a8 40 00 add r8,r5,r8 8006c5c: 59 03 00 04 sw (r8+4),r3 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006c60: 28 48 00 04 lw r8,(r2+4) c->parent = the_node->parent; 8006c64: 58 a2 00 00 sw (r5+0),r2 the_node->parent = c; 8006c68: 58 65 00 00 sw (r3+0),r5 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006c6c: fc 68 18 00 cmpne r3,r3,r8 8006c70: b4 63 18 00 add r3,r3,r3 8006c74: b4 63 18 00 add r3,r3,r3 8006c78: b4 43 10 00 add r2,r2,r3 8006c7c: 58 45 00 04 sw (r2+4),r5 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; 8006c80: b4 e7 38 00 add r7,r7,r7 8006c84: b5 67 58 00 add r11,r11,r7 8006c88: 29 6b 00 04 lw r11,(r11+4) 8006c8c: 29 63 00 00 lw r3,(r11+0) } the_node->parent->color = RBT_BLACK; g->color = RBT_RED; /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 8006c90: c8 c4 20 00 sub r4,r6,r4 * in an unique @a the_rbtree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ RBTree_Node *_RBTree_Insert_unprotected( 8006c94: 64 85 00 00 cmpei r5,r4,0 /* ensure node is on the same branch direction as parent */ if (dir != pdir) { _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; } the_node->parent->color = RBT_BLACK; 8006c98: 58 60 00 0c sw (r3+12),r0 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 8006c9c: b4 a5 10 00 add r2,r5,r5 8006ca0: b4 42 10 00 add r2,r2,r2 8006ca4: b4 22 10 00 add r2,r1,r2 8006ca8: 28 42 00 04 lw r2,(r2+4) g->color = RBT_RED; 8006cac: 58 26 00 0c sw (r1+12),r6 8006cb0: 44 40 ff c1 be r2,r0,8006bb4 <_RBTree_Insert_unprotected+0xcc><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006cb4: 44 a0 00 37 be r5,r0,8006d90 <_RBTree_Insert_unprotected+0x2a8> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 8006cb8: 28 22 00 08 lw r2,(r1+8) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006cbc: 34 03 00 01 mvi r3,1 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 8006cc0: b4 84 20 00 add r4,r4,r4 8006cc4: b4 84 28 00 add r5,r4,r4 8006cc8: b4 45 28 00 add r5,r2,r5 8006ccc: b4 63 18 00 add r3,r3,r3 8006cd0: 28 a7 00 04 lw r7,(r5+4) 8006cd4: b4 63 18 00 add r3,r3,r3 8006cd8: b4 23 18 00 add r3,r1,r3 8006cdc: 58 67 00 04 sw (r3+4),r7 if (c->child[dir]) 8006ce0: 28 a3 00 04 lw r3,(r5+4) 8006ce4: 44 60 00 02 be r3,r0,8006cec <_RBTree_Insert_unprotected+0x204> c->child[dir]->parent = the_node; 8006ce8: 58 61 00 00 sw (r3+0),r1 c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006cec: 28 25 00 00 lw r5,(r1+0) the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 8006cf0: b4 84 20 00 add r4,r4,r4 8006cf4: b4 44 20 00 add r4,r2,r4 8006cf8: 58 81 00 04 sw (r4+4),r1 the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006cfc: 28 a3 00 04 lw r3,(r5+4) c->parent = the_node->parent; 8006d00: 58 45 00 00 sw (r2+0),r5 the_node->parent = c; 8006d04: 58 22 00 00 sw (r1+0),r2 if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006d08: fc 23 08 00 cmpne r1,r1,r3 c->parent = the_node->parent; the_node->parent = c; 8006d0c: 29 63 00 00 lw r3,(r11+0) if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 8006d10: b4 21 08 00 add r1,r1,r1 8006d14: b4 21 08 00 add r1,r1,r1 8006d18: b4 a1 08 00 add r1,r5,r1 8006d1c: 58 22 00 04 sw (r1+4),r2 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 8006d20: 28 62 00 00 lw r2,(r3+0) 8006d24: b8 40 08 00 mv r1,r2 8006d28: 5c 40 ff a6 bne r2,r0,8006bc0 <_RBTree_Insert_unprotected+0xd8><== ALWAYS TAKEN /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 8006d2c: 59 60 00 0c sw (r11+12),r0 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 8006d30: b9 a0 08 00 mv r1,r13 8006d34: 2b 9d 00 04 lw ra,(sp+4) 8006d38: 2b 8b 00 1c lw r11,(sp+28) 8006d3c: 2b 8c 00 18 lw r12,(sp+24) 8006d40: 2b 8d 00 14 lw r13,(sp+20) 8006d44: 2b 8e 00 10 lw r14,(sp+16) 8006d48: 2b 8f 00 0c lw r15,(sp+12) 8006d4c: 2b 90 00 08 lw r16,(sp+8) 8006d50: 37 9c 00 1c addi sp,sp,28 8006d54: c3 a0 00 00 ret if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; 8006d58: 28 45 00 08 lw r5,(r2+8) 8006d5c: e3 ff ff a0 bi 8006bdc <_RBTree_Insert_unprotected+0xf4> compare_result = the_rbtree->compare_function( the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || (dir && _RBTree_Is_greater(compare_result)) ) { 8006d60: 4c 01 ff 93 bge r0,r1,8006bac <_RBTree_Insert_unprotected+0xc4> the_rbtree->first[dir] = the_node; 8006d64: b6 10 80 00 add r16,r16,r16 8006d68: b6 10 80 00 add r16,r16,r16 8006d6c: b5 90 60 00 add r12,r12,r16 8006d70: 59 8b 00 00 sw (r12+0),r11 8006d74: e3 ff ff 8e bi 8006bac <_RBTree_Insert_unprotected+0xc4> u = _RBTree_Parent_sibling(the_node); g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { the_node->parent->color = RBT_BLACK; 8006d78: 58 60 00 0c sw (r3+12),r0 u->color = RBT_BLACK; 8006d7c: 58 a0 00 0c sw (r5+12),r0 g->color = RBT_RED; 8006d80: 58 46 00 0c sw (r2+12),r6 8006d84: b8 e0 18 00 mv r3,r7 8006d88: b8 40 58 00 mv r11,r2 8006d8c: e3 ff ff 8a bi 8006bb4 <_RBTree_Insert_unprotected+0xcc> { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 8006d90: 28 22 00 04 lw r2,(r1+4) */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8006d94: 34 03 00 00 mvi r3,0 8006d98: e3 ff ff ca bi 8006cc0 <_RBTree_Insert_unprotected+0x1d8> /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 8006d9c: 28 44 00 04 lw r4,(r2+4) <== NOT EXECUTED 8006da0: e3 ff ff 92 bi 8006be8 <_RBTree_Insert_unprotected+0x100> <== NOT EXECUTED the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 8006da4: b9 e0 68 00 mv r13,r15 8006da8: e3 ff ff e2 bi 8006d30 <_RBTree_Insert_unprotected+0x248> RBTree_Node *iter_node = the_rbtree->root; int compare_result; if (!iter_node) { /* special case: first node inserted */ the_node->color = RBT_BLACK; 8006dac: 58 40 00 0c sw (r2+12),r0 the_rbtree->root = the_node; 8006db0: 59 82 00 04 sw (r12+4),r2 the_rbtree->first[0] = the_rbtree->first[1] = the_node; 8006db4: 59 82 00 0c sw (r12+12),r2 8006db8: 59 82 00 08 sw (r12+8),r2 the_node->parent = (RBTree_Node *) the_rbtree; 8006dbc: 59 61 00 00 sw (r11+0),r1 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 8006dc0: 58 40 00 08 sw (r2+8),r0 8006dc4: 58 40 00 04 sw (r2+4),r0 } /* while(iter_node) */ /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; 8006dc8: 34 0d 00 00 mvi r13,0 8006dcc: e3 ff ff d9 bi 8006d30 <_RBTree_Insert_unprotected+0x248> =============================================================================== 08006e04 <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 8006e04: 37 9c ff e8 addi sp,sp,-24 8006e08: 5b 8b 00 18 sw (sp+24),r11 8006e0c: 5b 8c 00 14 sw (sp+20),r12 8006e10: 5b 8d 00 10 sw (sp+16),r13 8006e14: 5b 8e 00 0c sw (sp+12),r14 8006e18: 5b 8f 00 08 sw (sp+8),r15 8006e1c: 5b 9d 00 04 sw (sp+4),ra 8006e20: b8 40 60 00 mv r12,r2 8006e24: 64 42 00 00 cmpei r2,r2,0 8006e28: b8 60 78 00 mv r15,r3 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 8006e2c: 34 42 00 02 addi r2,r2,2 8006e30: b4 42 10 00 add r2,r2,r2 8006e34: b4 42 10 00 add r2,r2,r2 8006e38: b4 22 08 00 add r1,r1,r2 8006e3c: 28 2b 00 00 lw r11,(r1+0) 8006e40: b8 80 70 00 mv r14,r4 RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 8006e44: 5d 60 00 03 bne r11,r0,8006e50 <_RBTree_Iterate_unprotected+0x4c><== ALWAYS TAKEN 8006e48: e0 00 00 0c bi 8006e78 <_RBTree_Iterate_unprotected+0x74> <== NOT EXECUTED 8006e4c: 44 2d 00 0b be r1,r13,8006e78 <_RBTree_Iterate_unprotected+0x74> stop = (*visitor)( current, dir, visitor_arg ); 8006e50: b9 60 08 00 mv r1,r11 8006e54: b9 c0 18 00 mv r3,r14 8006e58: b9 80 10 00 mv r2,r12 8006e5c: d9 e0 00 00 call r15 8006e60: b8 20 68 00 mv r13,r1 current = _RBTree_Next_unprotected( current, dir ); 8006e64: b9 80 10 00 mv r2,r12 8006e68: b9 60 08 00 mv r1,r11 8006e6c: f8 00 00 0b calli 8006e98 <_RBTree_Next_unprotected> 8006e70: 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 ) { 8006e74: 45 a0 ff f6 be r13,r0,8006e4c <_RBTree_Iterate_unprotected+0x48><== ALWAYS TAKEN stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); } } 8006e78: 2b 9d 00 04 lw ra,(sp+4) 8006e7c: 2b 8b 00 18 lw r11,(sp+24) 8006e80: 2b 8c 00 14 lw r12,(sp+20) 8006e84: 2b 8d 00 10 lw r13,(sp+16) 8006e88: 2b 8e 00 0c lw r14,(sp+12) 8006e8c: 2b 8f 00 08 lw r15,(sp+8) 8006e90: 37 9c 00 18 addi sp,sp,24 8006e94: c3 a0 00 00 ret =============================================================================== 08004e40 <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 8004e40: 37 9c ff f0 addi sp,sp,-16 8004e44: 5b 8b 00 0c sw (sp+12),r11 8004e48: 5b 8c 00 08 sw (sp+8),r12 8004e4c: 5b 9d 00 04 sw (sp+4),ra RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 8004e50: 28 2b 01 18 lw r11,(r1+280) if ( !api ) 8004e54: 45 60 00 1a be r11,r0,8004ebc <_RTEMS_signal_Post_switch_hook+0x7c><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 8004e58: 90 00 10 00 rcsr r2,IE 8004e5c: 34 01 ff fe mvi r1,-2 8004e60: a0 41 08 00 and r1,r2,r1 8004e64: d0 01 00 00 wcsr IE,r1 signal_set = asr->signals_posted; 8004e68: 29 6c 00 14 lw r12,(r11+20) asr->signals_posted = 0; 8004e6c: 59 60 00 14 sw (r11+20),r0 _ISR_Enable( level ); 8004e70: d0 02 00 00 wcsr IE,r2 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 8004e74: 45 80 00 12 be r12,r0,8004ebc <_RTEMS_signal_Post_switch_hook+0x7c> return; asr->nest_level += 1; 8004e78: 29 64 00 1c lw r4,(r11+28) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004e7c: 29 61 00 10 lw r1,(r11+16) 8004e80: 37 83 00 10 addi r3,sp,16 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 8004e84: 34 84 00 01 addi r4,r4,1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004e88: 38 02 ff ff mvu r2,0xffff if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 8004e8c: 59 64 00 1c sw (r11+28),r4 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004e90: f8 00 01 3d calli 8005384 (*asr->handler)( signal_set ); 8004e94: 29 62 00 0c lw r2,(r11+12) 8004e98: b9 80 08 00 mv r1,r12 8004e9c: d8 40 00 00 call r2 asr->nest_level -= 1; 8004ea0: 29 63 00 1c lw r3,(r11+28) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004ea4: 2b 81 00 10 lw r1,(sp+16) 8004ea8: 38 02 ff ff mvu r2,0xffff asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; 8004eac: 34 63 ff ff addi r3,r3,-1 8004eb0: 59 63 00 1c sw (r11+28),r3 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 8004eb4: 37 83 00 10 addi r3,sp,16 8004eb8: f8 00 01 33 calli 8005384 } 8004ebc: 2b 9d 00 04 lw ra,(sp+4) 8004ec0: 2b 8b 00 0c lw r11,(sp+12) 8004ec4: 2b 8c 00 08 lw r12,(sp+8) 8004ec8: 37 9c 00 10 addi sp,sp,16 8004ecc: c3 a0 00 00 ret =============================================================================== 08004184 <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 8004184: 37 9c ff e8 addi sp,sp,-24 8004188: 5b 8b 00 14 sw (sp+20),r11 800418c: 5b 8c 00 10 sw (sp+16),r12 8004190: 5b 8d 00 0c sw (sp+12),r13 8004194: 5b 8e 00 08 sw (sp+8),r14 8004198: 5b 9d 00 04 sw (sp+4),ra rtems_initialization_tasks_table *user_tasks; /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; 800419c: 78 01 08 02 mvhi r1,0x802 80041a0: 38 21 00 a4 ori r1,r1,0xa4 80041a4: 28 2b 00 2c lw r11,(r1+44) maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 80041a8: 28 2e 00 28 lw r14,(r1+40) /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 80041ac: 45 60 00 15 be r11,r0,8004200 <_RTEMS_tasks_Initialize_user_tasks_body+0x7c> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 80041b0: 45 c0 00 14 be r14,r0,8004200 <_RTEMS_tasks_Initialize_user_tasks_body+0x7c><== NEVER TAKEN 80041b4: 34 0c 00 00 mvi r12,0 return_value = rtems_task_create( 80041b8: 29 61 00 00 lw r1,(r11+0) 80041bc: 29 62 00 08 lw r2,(r11+8) 80041c0: 29 63 00 04 lw r3,(r11+4) 80041c4: 29 64 00 14 lw r4,(r11+20) 80041c8: 29 65 00 0c lw r5,(r11+12) 80041cc: 37 86 00 18 addi r6,sp,24 80041d0: fb ff ff 52 calli 8003f18 80041d4: b8 20 68 00 mv r13,r1 user_tasks[ index ].stack_size, user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) 80041d8: 5c 20 00 11 bne r1,r0,800421c <_RTEMS_tasks_Initialize_user_tasks_body+0x98> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 80041dc: 29 63 00 18 lw r3,(r11+24) 80041e0: 2b 81 00 18 lw r1,(sp+24) 80041e4: 29 62 00 10 lw r2,(r11+16) 80041e8: f8 00 00 14 calli 8004238 80041ec: b8 20 18 00 mv r3,r1 id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 80041f0: 5c 2d 00 0f bne r1,r13,800422c <_RTEMS_tasks_Initialize_user_tasks_body+0xa8> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 80041f4: 35 8c 00 01 addi r12,r12,1 80041f8: 35 6b 00 1c addi r11,r11,28 80041fc: 55 cc ff ef bgu r14,r12,80041b8 <_RTEMS_tasks_Initialize_user_tasks_body+0x34><== NEVER TAKEN user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); } } 8004200: 2b 9d 00 04 lw ra,(sp+4) 8004204: 2b 8b 00 14 lw r11,(sp+20) 8004208: 2b 8c 00 10 lw r12,(sp+16) 800420c: 2b 8d 00 0c lw r13,(sp+12) 8004210: 2b 8e 00 08 lw r14,(sp+8) 8004214: 37 9c 00 18 addi sp,sp,24 8004218: c3 a0 00 00 ret user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 800421c: 34 01 00 01 mvi r1,1 8004220: 34 02 00 01 mvi r2,1 8004224: b9 a0 18 00 mv r3,r13 8004228: f8 00 04 9d calli 800549c <_Internal_error_Occurred> id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 800422c: 34 01 00 01 mvi r1,1 8004230: 34 02 00 01 mvi r2,1 8004234: f8 00 04 9a calli 800549c <_Internal_error_Occurred> =============================================================================== 0800a6e8 <_RTEMS_tasks_Switch_extension>: /* * Per Task Variables */ tvp = executing->task_variables; 800a6e8: 28 21 01 24 lw r1,(r1+292) while (tvp) { 800a6ec: 44 20 00 08 be r1,r0,800a70c <_RTEMS_tasks_Switch_extension+0x24> tvp->tval = *tvp->ptr; 800a6f0: 28 23 00 04 lw r3,(r1+4) *tvp->ptr = tvp->gval; 800a6f4: 28 24 00 08 lw r4,(r1+8) * Per Task Variables */ tvp = executing->task_variables; while (tvp) { tvp->tval = *tvp->ptr; 800a6f8: 28 65 00 00 lw r5,(r3+0) 800a6fc: 58 25 00 0c sw (r1+12),r5 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; 800a700: 28 21 00 00 lw r1,(r1+0) */ tvp = executing->task_variables; while (tvp) { tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; 800a704: 58 64 00 00 sw (r3+0),r4 /* * Per Task Variables */ tvp = executing->task_variables; while (tvp) { 800a708: 5c 20 ff fa bne r1,r0,800a6f0 <_RTEMS_tasks_Switch_extension+0x8><== NEVER TAKEN tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; 800a70c: 28 41 01 24 lw r1,(r2+292) while (tvp) { 800a710: 44 20 00 08 be r1,r0,800a730 <_RTEMS_tasks_Switch_extension+0x48> tvp->gval = *tvp->ptr; 800a714: 28 22 00 04 lw r2,(r1+4) *tvp->ptr = tvp->tval; 800a718: 28 23 00 0c lw r3,(r1+12) tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { tvp->gval = *tvp->ptr; 800a71c: 28 44 00 00 lw r4,(r2+0) 800a720: 58 24 00 08 sw (r1+8),r4 *tvp->ptr = tvp->tval; tvp = (rtems_task_variable_t *)tvp->next; 800a724: 28 21 00 00 lw r1,(r1+0) } tvp = heir->task_variables; while (tvp) { tvp->gval = *tvp->ptr; *tvp->ptr = tvp->tval; 800a728: 58 43 00 00 sw (r2+0),r3 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { 800a72c: 5c 20 ff fa bne r1,r0,800a714 <_RTEMS_tasks_Switch_extension+0x2c><== NEVER TAKEN 800a730: c3 a0 00 00 ret =============================================================================== 080386d8 <_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 ) { 80386d8: 37 9c ff e4 addi sp,sp,-28 80386dc: 5b 8b 00 14 sw (sp+20),r11 80386e0: 5b 8c 00 10 sw (sp+16),r12 80386e4: 5b 8d 00 0c sw (sp+12),r13 80386e8: 5b 8e 00 08 sw (sp+8),r14 80386ec: 5b 9d 00 04 sw (sp+4),ra 80386f0: b8 40 68 00 mv r13,r2 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 80386f4: 78 02 08 06 mvhi r2,0x806 80386f8: b8 20 58 00 mv r11,r1 80386fc: 38 42 ef e8 ori r2,r2,0xefe8 8038700: 37 81 00 18 addi r1,sp,24 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 8038704: 29 6c 00 40 lw r12,(r11+64) bool _Rate_monotonic_Get_status( Rate_monotonic_Control *the_period, Rate_monotonic_Period_time_t *wall_since_last_period, Thread_CPU_usage_t *cpu_since_last_period ) { 8038708: b8 60 70 00 mv r14,r3 803870c: fb ff 2f 8e calli 8004544 <_TOD_Get_with_nanoseconds> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8038710: 2b 85 00 1c lw r5,(sp+28) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8038714: 29 61 00 54 lw r1,(r11+84) 8038718: 29 66 00 50 lw r6,(r11+80) 803871c: 2b 82 00 18 lw r2,(sp+24) 8038720: c8 a1 08 00 sub r1,r5,r1 * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 8038724: 78 04 08 06 mvhi r4,0x806 8038728: f4 25 38 00 cmpgu r7,r1,r5 803872c: 38 84 f5 00 ori r4,r4,0xf500 8038730: 28 88 00 10 lw r8,(r4+16) 8038734: c8 46 30 00 sub r6,r2,r6 8038738: c8 c7 30 00 sub r6,r6,r7 803873c: 59 a1 00 04 sw (r13+4),r1 8038740: 59 a6 00 00 sw (r13+0),r6 #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 8038744: 29 83 00 80 lw r3,(r12+128) 8038748: 29 86 00 84 lw r6,(r12+132) if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 803874c: 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) { 8038750: 45 0c 00 08 be r8,r12,8038770 <_Rate_monotonic_Get_status+0x98> return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 8038754: 2b 9d 00 04 lw ra,(sp+4) 8038758: 2b 8b 00 14 lw r11,(sp+20) 803875c: 2b 8c 00 10 lw r12,(sp+16) 8038760: 2b 8d 00 0c lw r13,(sp+12) 8038764: 2b 8e 00 08 lw r14,(sp+8) 8038768: 37 9c 00 1c addi sp,sp,28 803876c: c3 a0 00 00 ret static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8038770: 28 81 00 24 lw r1,(r4+36) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8038774: b4 c5 28 00 add r5,r6,r5 8038778: f4 c5 30 00 cmpgu r6,r6,r5 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 803877c: 28 87 00 20 lw r7,(r4+32) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8038780: b4 62 10 00 add r2,r3,r2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8038784: c8 a1 08 00 sub r1,r5,r1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8038788: b4 c2 10 00 add r2,r6,r2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 803878c: f4 25 28 00 cmpgu r5,r1,r5 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8038790: 29 64 00 48 lw r4,(r11+72) 8038794: c8 47 10 00 sub r2,r2,r7 8038798: c8 45 28 00 sub r5,r2,r5 803879c: 29 62 00 4c lw r2,(r11+76) /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 80387a0: 48 85 00 10 bg r4,r5,80387e0 <_Rate_monotonic_Get_status+0x108><== NEVER TAKEN 80387a4: 44 85 00 11 be r4,r5,80387e8 <_Rate_monotonic_Get_status+0x110> const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 80387a8: c8 22 10 00 sub r2,r1,r2 80387ac: f4 41 08 00 cmpgu r1,r2,r1 80387b0: c8 a4 20 00 sub r4,r5,r4 80387b4: c8 81 08 00 sub r1,r4,r1 80387b8: 59 c1 00 00 sw (r14+0),r1 if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 80387bc: 34 01 00 01 mvi r1,1 80387c0: 59 c2 00 04 sw (r14+4),r2 } 80387c4: 2b 9d 00 04 lw ra,(sp+4) 80387c8: 2b 8b 00 14 lw r11,(sp+20) 80387cc: 2b 8c 00 10 lw r12,(sp+16) 80387d0: 2b 8d 00 0c lw r13,(sp+12) 80387d4: 2b 8e 00 08 lw r14,(sp+8) 80387d8: 37 9c 00 1c addi sp,sp,28 80387dc: c3 a0 00 00 ret /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) return false; 80387e0: 34 01 00 00 mvi r1,0 80387e4: e3 ff ff dc bi 8038754 <_Rate_monotonic_Get_status+0x7c> /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 80387e8: 54 41 ff fe bgu r2,r1,80387e0 <_Rate_monotonic_Get_status+0x108> 80387ec: e3 ff ff ef bi 80387a8 <_Rate_monotonic_Get_status+0xd0> =============================================================================== 08038bdc <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 8038bdc: 37 9c ff f4 addi sp,sp,-12 8038be0: 5b 8b 00 08 sw (sp+8),r11 8038be4: 5b 9d 00 04 sw (sp+4),ra 8038be8: b8 20 10 00 mv r2,r1 8038bec: 78 01 08 06 mvhi r1,0x806 8038bf0: 38 21 fb 30 ori r1,r1,0xfb30 8038bf4: 37 83 00 0c addi r3,sp,12 8038bf8: fb ff 31 72 calli 80051c0 <_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 ) { 8038bfc: 2b 82 00 0c lw r2,(sp+12) 8038c00: b8 20 58 00 mv r11,r1 8038c04: 44 40 00 05 be r2,r0,8038c18 <_Rate_monotonic_Timeout+0x3c><== ALWAYS TAKEN case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 8038c08: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8038c0c: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8038c10: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 8038c14: c3 a0 00 00 ret <== NOT EXECUTED */ the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: the_thread = the_period->owner; 8038c18: 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); 8038c1c: 28 23 00 10 lw r3,(r1+16) 8038c20: 20 63 40 00 andi r3,r3,0x4000 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 8038c24: 44 62 00 04 be r3,r2,8038c34 <_Rate_monotonic_Timeout+0x58> 8038c28: 28 23 00 20 lw r3,(r1+32) 8038c2c: 29 62 00 08 lw r2,(r11+8) 8038c30: 44 62 00 1a be r3,r2,8038c98 <_Rate_monotonic_Timeout+0xbc> _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { 8038c34: 29 62 00 38 lw r2,(r11+56) 8038c38: 34 01 00 01 mvi r1,1 8038c3c: 44 41 00 0c be r2,r1,8038c6c <_Rate_monotonic_Timeout+0x90><== NEVER TAKEN _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 8038c40: 34 01 00 04 mvi r1,4 8038c44: 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; 8038c48: 78 01 08 06 mvhi r1,0x806 8038c4c: 38 21 f0 60 ori r1,r1,0xf060 8038c50: 28 22 00 00 lw r2,(r1+0) --level; 8038c54: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 8038c58: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 8038c5c: 2b 9d 00 04 lw ra,(sp+4) 8038c60: 2b 8b 00 08 lw r11,(sp+8) 8038c64: 37 9c 00 0c addi sp,sp,12 8038c68: c3 a0 00 00 ret _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 8038c6c: 34 02 00 03 mvi r2,3 <== NOT EXECUTED _Rate_monotonic_Initiate_statistics( the_period ); 8038c70: b9 60 08 00 mv r1,r11 <== NOT EXECUTED _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 8038c74: 59 62 00 38 sw (r11+56),r2 <== NOT EXECUTED _Rate_monotonic_Initiate_statistics( the_period ); 8038c78: fb ff ff 2b calli 8038924 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8038c7c: 29 62 00 3c lw r2,(r11+60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8038c80: 78 01 08 06 mvhi r1,0x806 8038c84: 38 21 f0 f8 ori r1,r1,0xf0f8 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8038c88: 59 62 00 1c sw (r11+28),r2 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8038c8c: 35 62 00 10 addi r2,r11,16 8038c90: fb ff 38 cb calli 8006fbc <_Watchdog_Insert> 8038c94: e3 ff ff ed bi 8038c48 <_Rate_monotonic_Timeout+0x6c> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 8038c98: 78 03 08 05 mvhi r3,0x805 8038c9c: 38 63 e2 9c ori r3,r3,0xe29c 8038ca0: 28 62 00 00 lw r2,(r3+0) 8038ca4: fb ff 54 21 calli 800dd28 <_Thread_Clear_state> the_thread = the_period->owner; if ( _States_Is_waiting_for_period( the_thread->current_state ) && the_thread->Wait.id == the_period->Object.id ) { _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); 8038ca8: b9 60 08 00 mv r1,r11 8038cac: e3 ff ff f3 bi 8038c78 <_Rate_monotonic_Timeout+0x9c> =============================================================================== 080387f0 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 80387f0: 37 9c ff e8 addi sp,sp,-24 80387f4: 5b 8b 00 08 sw (sp+8),r11 80387f8: 5b 9d 00 04 sw (sp+4),ra 80387fc: b8 20 58 00 mv r11,r1 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8038800: 28 21 00 58 lw r1,(r1+88) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 8038804: 29 62 00 38 lw r2,(r11+56) /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8038808: 34 21 00 01 addi r1,r1,1 803880c: 59 61 00 58 sw (r11+88),r1 if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 8038810: 34 01 00 04 mvi r1,4 8038814: 44 41 00 3a be r2,r1,80388fc <_Rate_monotonic_Update_statistics+0x10c> stats->missed_count++; /* * Grab status for time statistics. */ valid_status = 8038818: b9 60 08 00 mv r1,r11 803881c: 37 82 00 0c addi r2,sp,12 8038820: 37 83 00 14 addi r3,sp,20 8038824: fb ff ff ad calli 80386d8 <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 8038828: 44 20 00 13 be r1,r0,8038874 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 803882c: 2b 82 00 18 lw r2,(sp+24) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8038830: 29 63 00 74 lw r3,(r11+116) 8038834: 29 65 00 70 lw r5,(r11+112) 8038838: 2b 81 00 14 lw r1,(sp+20) 803883c: b4 43 18 00 add r3,r2,r3 8038840: f4 43 30 00 cmpgu r6,r2,r3 8038844: b4 25 28 00 add r5,r1,r5 * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 8038848: 29 64 00 60 lw r4,(r11+96) 803884c: b4 c5 28 00 add r5,r6,r5 8038850: 59 65 00 70 sw (r11+112),r5 8038854: 59 63 00 74 sw (r11+116),r3 8038858: 48 81 00 0b bg r4,r1,8038884 <_Rate_monotonic_Update_statistics+0x94> 803885c: 5c 81 00 0c bne r4,r1,803888c <_Rate_monotonic_Update_statistics+0x9c><== NEVER TAKEN 8038860: 29 63 00 64 lw r3,(r11+100) 8038864: 54 62 00 08 bgu r3,r2,8038884 <_Rate_monotonic_Update_statistics+0x94> 8038868: e0 00 00 09 bi 803888c <_Rate_monotonic_Update_statistics+0x9c> if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) stats->min_wall_time = since_last_period; if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) stats->max_wall_time = since_last_period; 803886c: 59 61 00 80 sw (r11+128),r1 8038870: 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 } 8038874: 2b 9d 00 04 lw ra,(sp+4) 8038878: 2b 8b 00 08 lw r11,(sp+8) 803887c: 37 9c 00 18 addi sp,sp,24 8038880: c3 a0 00 00 ret */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) stats->min_cpu_time = executed; 8038884: 59 61 00 60 sw (r11+96),r1 8038888: 59 62 00 64 sw (r11+100),r2 if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 803888c: 29 63 00 68 lw r3,(r11+104) 8038890: 48 23 00 18 bg r1,r3,80388f0 <_Rate_monotonic_Update_statistics+0x100><== NEVER TAKEN 8038894: 44 61 00 21 be r3,r1,8038918 <_Rate_monotonic_Update_statistics+0x128><== ALWAYS TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8038898: 2b 82 00 10 lw r2,(sp+16) 803889c: 29 63 00 8c lw r3,(r11+140) 80388a0: 29 65 00 88 lw r5,(r11+136) 80388a4: 2b 81 00 0c lw r1,(sp+12) 80388a8: b4 43 18 00 add r3,r2,r3 80388ac: f4 43 30 00 cmpgu r6,r2,r3 80388b0: b4 25 28 00 add r5,r1,r5 * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 80388b4: 29 64 00 78 lw r4,(r11+120) 80388b8: b4 c5 28 00 add r5,r6,r5 80388bc: 59 65 00 88 sw (r11+136),r5 80388c0: 59 63 00 8c sw (r11+140),r3 80388c4: 48 81 00 08 bg r4,r1,80388e4 <_Rate_monotonic_Update_statistics+0xf4> 80388c8: 44 81 00 11 be r4,r1,803890c <_Rate_monotonic_Update_statistics+0x11c><== ALWAYS TAKEN stats->min_wall_time = since_last_period; if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 80388cc: 29 63 00 80 lw r3,(r11+128) 80388d0: 48 23 ff e7 bg r1,r3,803886c <_Rate_monotonic_Update_statistics+0x7c><== NEVER TAKEN 80388d4: 5c 61 ff e8 bne r3,r1,8038874 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN 80388d8: 29 63 00 84 lw r3,(r11+132) 80388dc: 54 43 ff e4 bgu r2,r3,803886c <_Rate_monotonic_Update_statistics+0x7c> 80388e0: e3 ff ff e5 bi 8038874 <_Rate_monotonic_Update_statistics+0x84> */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) stats->min_wall_time = since_last_period; 80388e4: 59 61 00 78 sw (r11+120),r1 80388e8: 59 62 00 7c sw (r11+124),r2 80388ec: e3 ff ff f8 bi 80388cc <_Rate_monotonic_Update_statistics+0xdc> if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) stats->min_cpu_time = executed; if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) stats->max_cpu_time = executed; 80388f0: 59 61 00 68 sw (r11+104),r1 80388f4: 59 62 00 6c sw (r11+108),r2 80388f8: e3 ff ff e8 bi 8038898 <_Rate_monotonic_Update_statistics+0xa8> */ stats = &the_period->Statistics; stats->count++; if ( the_period->state == RATE_MONOTONIC_EXPIRED ) stats->missed_count++; 80388fc: 29 61 00 5c lw r1,(r11+92) 8038900: 34 21 00 01 addi r1,r1,1 8038904: 59 61 00 5c sw (r11+92),r1 8038908: e3 ff ff c4 bi 8038818 <_Rate_monotonic_Update_statistics+0x28> * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 803890c: 29 63 00 7c lw r3,(r11+124) 8038910: 54 62 ff f5 bgu r3,r2,80388e4 <_Rate_monotonic_Update_statistics+0xf4> 8038914: e3 ff ff ee bi 80388cc <_Rate_monotonic_Update_statistics+0xdc> _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) stats->min_cpu_time = executed; if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 8038918: 29 63 00 6c lw r3,(r11+108) 803891c: 54 43 ff f5 bgu r2,r3,80388f0 <_Rate_monotonic_Update_statistics+0x100> 8038920: e3 ff ff de bi 8038898 <_Rate_monotonic_Update_statistics+0xa8> =============================================================================== 08006f1c <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 8006f1c: 37 9c ff f8 addi sp,sp,-8 8006f20: 5b 8b 00 08 sw (sp+8),r11 8006f24: 5b 9d 00 04 sw (sp+4),ra 8006f28: b8 20 58 00 mv r11,r1 void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 8006f2c: 34 01 00 1c mvi r1,28 8006f30: f8 00 08 07 calli 8008f4c <_Workspace_Allocate> if ( sched ) { 8006f34: 44 20 00 06 be r1,r0,8006f4c <_Scheduler_CBS_Allocate+0x30><== NEVER TAKEN the_thread->scheduler_info = sched; 8006f38: 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; 8006f3c: 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; 8006f40: 58 2b 00 00 sw (r1+0),r11 schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 8006f44: 58 22 00 14 sw (r1+20),r2 schinfo->cbs_server = NULL; 8006f48: 58 20 00 18 sw (r1+24),r0 } return sched; } 8006f4c: 2b 9d 00 04 lw ra,(sp+4) 8006f50: 2b 8b 00 08 lw r11,(sp+8) 8006f54: 37 9c 00 08 addi sp,sp,8 8006f58: c3 a0 00 00 ret =============================================================================== 08008280 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 8008280: 37 9c ff f4 addi sp,sp,-12 8008284: 5b 8b 00 08 sw (sp+8),r11 8008288: 5b 9d 00 04 sw (sp+4),ra 800828c: 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; 8008290: 28 22 00 ac lw r2,(r1+172) if ( the_thread->real_priority != new_priority ) 8008294: 28 21 00 18 lw r1,(r1+24) 8008298: 44 22 00 02 be r1,r2,80082a0 <_Scheduler_CBS_Budget_callout+0x20><== NEVER TAKEN the_thread->real_priority = new_priority; 800829c: 59 62 00 18 sw (r11+24),r2 if ( the_thread->current_priority != new_priority ) 80082a0: 29 61 00 14 lw r1,(r11+20) 80082a4: 44 22 00 04 be r1,r2,80082b4 <_Scheduler_CBS_Budget_callout+0x34><== NEVER TAKEN _Thread_Change_priority(the_thread, new_priority, true); 80082a8: b9 60 08 00 mv r1,r11 80082ac: 34 03 00 01 mvi r3,1 80082b0: f8 00 01 a6 calli 8008948 <_Thread_Change_priority> /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 80082b4: 29 6b 00 88 lw r11,(r11+136) if ( sched_info->cbs_server->cbs_budget_overrun ) { 80082b8: 29 61 00 18 lw r1,(r11+24) 80082bc: 28 22 00 0c lw r2,(r1+12) 80082c0: 44 40 00 08 be r2,r0,80082e0 <_Scheduler_CBS_Budget_callout+0x60><== NEVER TAKEN _Scheduler_CBS_Get_server_id( 80082c4: 28 21 00 00 lw r1,(r1+0) 80082c8: 37 82 00 0c addi r2,sp,12 80082cc: fb ff ff d6 calli 8008224 <_Scheduler_CBS_Get_server_id> sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); 80082d0: 29 62 00 18 lw r2,(r11+24) 80082d4: 2b 81 00 0c lw r1,(sp+12) 80082d8: 28 42 00 0c lw r2,(r2+12) 80082dc: d8 40 00 00 call r2 } } 80082e0: 2b 9d 00 04 lw ra,(sp+4) 80082e4: 2b 8b 00 08 lw r11,(sp+8) 80082e8: 37 9c 00 0c addi sp,sp,12 80082ec: c3 a0 00 00 ret =============================================================================== 08007cec <_Scheduler_CBS_Cleanup>: #include #include #include int _Scheduler_CBS_Cleanup (void) { 8007cec: 37 9c ff ec addi sp,sp,-20 8007cf0: 5b 8b 00 14 sw (sp+20),r11 8007cf4: 5b 8c 00 10 sw (sp+16),r12 8007cf8: 5b 8d 00 0c sw (sp+12),r13 8007cfc: 5b 8e 00 08 sw (sp+8),r14 8007d00: 5b 9d 00 04 sw (sp+4),ra unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007d04: 78 0d 08 02 mvhi r13,0x802 8007d08: 39 ad 30 18 ori r13,r13,0x3018 8007d0c: 29 a1 00 00 lw r1,(r13+0) 8007d10: 44 20 00 1a be r1,r0,8007d78 <_Scheduler_CBS_Cleanup+0x8c> <== NEVER TAKEN 8007d14: 78 0e 08 02 mvhi r14,0x802 8007d18: 39 ce 3e e8 ori r14,r14,0x3ee8 8007d1c: 29 c2 00 00 lw r2,(r14+0) 8007d20: 34 0c 00 00 mvi r12,0 8007d24: 34 0b 00 00 mvi r11,0 if ( _Scheduler_CBS_Server_list[ i ] ) 8007d28: b4 4c 08 00 add r1,r2,r12 8007d2c: 28 23 00 00 lw r3,(r1+0) _Scheduler_CBS_Destroy_server( i ); 8007d30: b9 60 08 00 mv r1,r11 int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007d34: 35 6b 00 01 addi r11,r11,1 if ( _Scheduler_CBS_Server_list[ i ] ) 8007d38: 44 60 00 03 be r3,r0,8007d44 <_Scheduler_CBS_Cleanup+0x58> _Scheduler_CBS_Destroy_server( i ); 8007d3c: f8 00 00 57 calli 8007e98 <_Scheduler_CBS_Destroy_server> 8007d40: 29 c2 00 00 lw r2,(r14+0) int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007d44: 29 a1 00 00 lw r1,(r13+0) 8007d48: 35 8c 00 04 addi r12,r12,4 8007d4c: 54 2b ff f7 bgu r1,r11,8007d28 <_Scheduler_CBS_Cleanup+0x3c> if ( _Scheduler_CBS_Server_list[ i ] ) _Scheduler_CBS_Destroy_server( i ); } _Workspace_Free( _Scheduler_CBS_Server_list ); 8007d50: b8 40 08 00 mv r1,r2 8007d54: f8 00 09 7f calli 800a350 <_Workspace_Free> return SCHEDULER_CBS_OK; } 8007d58: 34 01 00 00 mvi r1,0 8007d5c: 2b 9d 00 04 lw ra,(sp+4) 8007d60: 2b 8b 00 14 lw r11,(sp+20) 8007d64: 2b 8c 00 10 lw r12,(sp+16) 8007d68: 2b 8d 00 0c lw r13,(sp+12) 8007d6c: 2b 8e 00 08 lw r14,(sp+8) 8007d70: 37 9c 00 14 addi sp,sp,20 8007d74: c3 a0 00 00 ret int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007d78: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 8007d7c: 38 21 3e e8 ori r1,r1,0x3ee8 <== NOT EXECUTED 8007d80: 28 22 00 00 lw r2,(r1+0) <== NOT EXECUTED 8007d84: e3 ff ff f3 bi 8007d50 <_Scheduler_CBS_Cleanup+0x64> <== NOT EXECUTED =============================================================================== 08007d88 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 8007d88: 37 9c ff e4 addi sp,sp,-28 8007d8c: 5b 8b 00 14 sw (sp+20),r11 8007d90: 5b 8c 00 10 sw (sp+16),r12 8007d94: 5b 8d 00 0c sw (sp+12),r13 8007d98: 5b 8e 00 08 sw (sp+8),r14 8007d9c: 5b 9d 00 04 sw (sp+4),ra unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 8007da0: 28 24 00 04 lw r4,(r1+4) int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 8007da4: b8 20 58 00 mv r11,r1 if ( params->budget <= 0 || params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 8007da8: 34 01 ff ee mvi r1,-18 ) { unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 8007dac: 4c 04 00 2e bge r0,r4,8007e64 <_Scheduler_CBS_Create_server+0xdc> 8007db0: 29 64 00 00 lw r4,(r11+0) 8007db4: 4c 04 00 2c bge r0,r4,8007e64 <_Scheduler_CBS_Create_server+0xdc> params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007db8: 78 01 08 02 mvhi r1,0x802 8007dbc: 38 21 30 18 ori r1,r1,0x3018 8007dc0: 28 24 00 00 lw r4,(r1+0) if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 8007dc4: 34 01 ff e6 mvi r1,-26 params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007dc8: 44 80 00 27 be r4,r0,8007e64 <_Scheduler_CBS_Create_server+0xdc><== NEVER TAKEN if ( !_Scheduler_CBS_Server_list[i] ) 8007dcc: 78 0e 08 02 mvhi r14,0x802 8007dd0: 39 ce 3e e8 ori r14,r14,0x3ee8 8007dd4: 29 cd 00 00 lw r13,(r14+0) 8007dd8: 29 a1 00 00 lw r1,(r13+0) 8007ddc: 44 20 00 2d be r1,r0,8007e90 <_Scheduler_CBS_Create_server+0x108> 8007de0: b9 a0 08 00 mv r1,r13 8007de4: 34 0c 00 00 mvi r12,0 params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8007de8: 35 8c 00 01 addi r12,r12,1 8007dec: 54 8c 00 25 bgu r4,r12,8007e80 <_Scheduler_CBS_Create_server+0xf8> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 8007df0: 34 01 ff e6 mvi r1,-26 for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) 8007df4: 45 84 00 1c be r12,r4,8007e64 <_Scheduler_CBS_Create_server+0xdc> return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 8007df8: 58 6c 00 00 sw (r3+0),r12 _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 8007dfc: 34 01 00 10 mvi r1,16 8007e00: 5b 82 00 1c sw (sp+28),r2 8007e04: 5b 83 00 18 sw (sp+24),r3 8007e08: f8 00 09 47 calli 800a324 <_Workspace_Allocate> the_server = _Scheduler_CBS_Server_list[*server_id]; 8007e0c: 2b 83 00 18 lw r3,(sp+24) 8007e10: 29 c4 00 00 lw r4,(r14+0) if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 8007e14: b5 8c 60 00 add r12,r12,r12 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 8007e18: 28 63 00 00 lw r3,(r3+0) if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 8007e1c: b5 8c 60 00 add r12,r12,r12 8007e20: b5 ac 60 00 add r12,r13,r12 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 8007e24: b4 63 18 00 add r3,r3,r3 8007e28: b4 63 18 00 add r3,r3,r3 if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 8007e2c: 59 81 00 00 sw (r12+0),r1 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 8007e30: b4 83 18 00 add r3,r4,r3 8007e34: 28 63 00 00 lw r3,(r3+0) if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 8007e38: 34 01 ff ef mvi r1,-17 *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) 8007e3c: 2b 82 00 1c lw r2,(sp+28) 8007e40: 44 60 00 09 be r3,r0,8007e64 <_Scheduler_CBS_Create_server+0xdc><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 8007e44: 29 64 00 00 lw r4,(r11+0) the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 8007e48: 34 01 00 00 mvi r1,0 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 8007e4c: 58 64 00 04 sw (r3+4),r4 8007e50: 29 65 00 04 lw r5,(r11+4) the_server->task_id = -1; 8007e54: 34 04 ff ff mvi r4,-1 8007e58: 58 64 00 00 sw (r3+0),r4 the_server->cbs_budget_overrun = budget_overrun_callback; 8007e5c: 58 62 00 0c sw (r3+12),r2 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 8007e60: 58 65 00 08 sw (r3+8),r5 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 8007e64: 2b 9d 00 04 lw ra,(sp+4) 8007e68: 2b 8b 00 14 lw r11,(sp+20) 8007e6c: 2b 8c 00 10 lw r12,(sp+16) 8007e70: 2b 8d 00 0c lw r13,(sp+12) 8007e74: 2b 8e 00 08 lw r14,(sp+8) 8007e78: 37 9c 00 1c addi sp,sp,28 8007e7c: c3 a0 00 00 ret params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( !_Scheduler_CBS_Server_list[i] ) 8007e80: 28 25 00 04 lw r5,(r1+4) 8007e84: 34 21 00 04 addi r1,r1,4 8007e88: 5c a0 ff d8 bne r5,r0,8007de8 <_Scheduler_CBS_Create_server+0x60> 8007e8c: e3 ff ff d9 bi 8007df0 <_Scheduler_CBS_Create_server+0x68> 8007e90: 34 0c 00 00 mvi r12,0 8007e94: e3 ff ff d9 bi 8007df8 <_Scheduler_CBS_Create_server+0x70> =============================================================================== 08007f38 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 8007f38: 37 9c ff ec addi sp,sp,-20 8007f3c: 5b 8b 00 10 sw (sp+16),r11 8007f40: 5b 8c 00 0c sw (sp+12),r12 8007f44: 5b 8d 00 08 sw (sp+8),r13 8007f48: 5b 9d 00 04 sw (sp+4),ra 8007f4c: b8 40 68 00 mv r13,r2 8007f50: b8 20 60 00 mv r12,r1 Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 8007f54: 37 82 00 14 addi r2,sp,20 8007f58: b9 a0 08 00 mv r1,r13 8007f5c: f8 00 04 0a calli 8008f84 <_Thread_Get> 8007f60: b8 20 58 00 mv r11,r1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 8007f64: 44 20 00 02 be r1,r0,8007f6c <_Scheduler_CBS_Detach_thread+0x34> _Thread_Enable_dispatch(); 8007f68: f8 00 03 fb calli 8008f54 <_Thread_Enable_dispatch> } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 8007f6c: 78 03 08 02 mvhi r3,0x802 8007f70: 38 63 30 18 ori r3,r3,0x3018 8007f74: 28 61 00 00 lw r1,(r3+0) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 8007f78: 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 ) 8007f7c: 51 81 00 19 bgeu r12,r1,8007fe0 <_Scheduler_CBS_Detach_thread+0xa8> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 8007f80: 45 60 00 18 be r11,r0,8007fe0 <_Scheduler_CBS_Detach_thread+0xa8> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 8007f84: 78 01 08 02 mvhi r1,0x802 8007f88: 38 21 3e e8 ori r1,r1,0x3ee8 8007f8c: 28 21 00 00 lw r1,(r1+0) 8007f90: b5 8c 60 00 add r12,r12,r12 8007f94: b5 8c 60 00 add r12,r12,r12 8007f98: b4 2c 60 00 add r12,r1,r12 8007f9c: 29 81 00 00 lw r1,(r12+0) return SCHEDULER_CBS_ERROR_NOSERVER; 8007fa0: 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] ) 8007fa4: 44 20 00 0f be r1,r0,8007fe0 <_Scheduler_CBS_Detach_thread+0xa8> return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 8007fa8: 28 22 00 00 lw r2,(r1+0) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 8007fac: 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 ) 8007fb0: 5c 4d 00 0c bne r2,r13,8007fe0 <_Scheduler_CBS_Detach_thread+0xa8><== NEVER TAKEN return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 8007fb4: 29 66 00 88 lw r6,(r11+136) the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->is_preemptible = the_thread->Start.is_preemptible; 8007fb8: 41 63 00 9c lbu r3,(r11+156) _Scheduler_CBS_Server_list[server_id]->task_id = -1; sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 8007fbc: 29 65 00 a0 lw r5,(r11+160) the_thread->budget_callout = the_thread->Start.budget_callout; 8007fc0: 29 64 00 a4 lw r4,(r11+164) return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 8007fc4: 34 02 ff ff mvi r2,-1 8007fc8: 58 22 00 00 sw (r1+0),r2 sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 8007fcc: 58 c0 00 18 sw (r6+24),r0 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->is_preemptible = the_thread->Start.is_preemptible; 8007fd0: 31 63 00 70 sb (r11+112),r3 _Scheduler_CBS_Server_list[server_id]->task_id = -1; sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 8007fd4: 59 65 00 78 sw (r11+120),r5 the_thread->budget_callout = the_thread->Start.budget_callout; 8007fd8: 59 64 00 7c sw (r11+124),r4 the_thread->is_preemptible = the_thread->Start.is_preemptible; return SCHEDULER_CBS_OK; 8007fdc: 34 03 00 00 mvi r3,0 } 8007fe0: b8 60 08 00 mv r1,r3 8007fe4: 2b 9d 00 04 lw ra,(sp+4) 8007fe8: 2b 8b 00 10 lw r11,(sp+16) 8007fec: 2b 8c 00 0c lw r12,(sp+12) 8007ff0: 2b 8d 00 08 lw r13,(sp+8) 8007ff4: 37 9c 00 14 addi sp,sp,20 8007ff8: c3 a0 00 00 ret =============================================================================== 08008224 <_Scheduler_CBS_Get_server_id>: rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8008224: 78 03 08 02 mvhi r3,0x802 8008228: 38 63 30 18 ori r3,r3,0x3018 800822c: 28 66 00 00 lw r6,(r3+0) _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; return SCHEDULER_CBS_OK; } } return SCHEDULER_CBS_ERROR_NOSERVER; 8008230: 34 03 ff e7 mvi r3,-25 rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 8008234: 44 c0 00 0d be r6,r0,8008268 <_Scheduler_CBS_Get_server_id+0x44><== NEVER TAKEN 8008238: 78 03 08 02 mvhi r3,0x802 800823c: 38 63 3e e8 ori r3,r3,0x3ee8 8008240: 28 63 00 00 lw r3,(r3+0) 8008244: 34 04 00 00 mvi r4,0 if ( _Scheduler_CBS_Server_list[i] && 8008248: 28 65 00 00 lw r5,(r3+0) rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 800824c: 34 63 00 04 addi r3,r3,4 if ( _Scheduler_CBS_Server_list[i] && 8008250: 44 a0 00 03 be r5,r0,800825c <_Scheduler_CBS_Get_server_id+0x38> 8008254: 28 a5 00 00 lw r5,(r5+0) 8008258: 44 a1 00 06 be r5,r1,8008270 <_Scheduler_CBS_Get_server_id+0x4c> rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 800825c: 34 84 00 01 addi r4,r4,1 8008260: 54 c4 ff fa bgu r6,r4,8008248 <_Scheduler_CBS_Get_server_id+0x24> _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; return SCHEDULER_CBS_OK; } } return SCHEDULER_CBS_ERROR_NOSERVER; 8008264: 34 03 ff e7 mvi r3,-25 } 8008268: b8 60 08 00 mv r1,r3 800826c: c3 a0 00 00 ret unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( _Scheduler_CBS_Server_list[i] && _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; return SCHEDULER_CBS_OK; 8008270: 34 03 00 00 mvi r3,0 { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( _Scheduler_CBS_Server_list[i] && _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; 8008274: 58 44 00 00 sw (r2+0),r4 return SCHEDULER_CBS_OK; } } return SCHEDULER_CBS_ERROR_NOSERVER; } 8008278: b8 60 08 00 mv r1,r3 800827c: c3 a0 00 00 ret =============================================================================== 080082f0 <_Scheduler_CBS_Initialize>: int _Scheduler_CBS_Initialize(void) { 80082f0: 37 9c ff f8 addi sp,sp,-8 80082f4: 5b 8b 00 08 sw (sp+8),r11 80082f8: 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*) ); 80082fc: 78 0b 08 02 mvhi r11,0x802 8008300: 39 6b 30 18 ori r11,r11,0x3018 8008304: 29 61 00 00 lw r1,(r11+0) 8008308: b4 21 08 00 add r1,r1,r1 800830c: b4 21 08 00 add r1,r1,r1 } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 8008310: f8 00 08 05 calli 800a324 <_Workspace_Allocate> 8008314: 78 02 08 02 mvhi r2,0x802 8008318: 38 42 3e e8 ori r2,r2,0x3ee8 800831c: 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; 8008320: 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 ) 8008324: 44 20 00 09 be r1,r0,8008348 <_Scheduler_CBS_Initialize+0x58><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 8008328: 29 63 00 00 lw r3,(r11+0) _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 800832c: 34 02 00 00 mvi r2,0 unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 8008330: 44 60 00 06 be r3,r0,8008348 <_Scheduler_CBS_Initialize+0x58><== NEVER TAKEN _Scheduler_CBS_Server_list[i] = NULL; 8008334: 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++) { 8008338: 34 42 00 01 addi r2,r2,1 800833c: 34 21 00 04 addi r1,r1,4 8008340: 54 62 ff fd bgu r3,r2,8008334 <_Scheduler_CBS_Initialize+0x44> _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 8008344: 34 02 00 00 mvi r2,0 } 8008348: b8 40 08 00 mv r1,r2 800834c: 2b 9d 00 04 lw ra,(sp+4) 8008350: 2b 8b 00 08 lw r11,(sp+8) 8008354: 37 9c 00 08 addi sp,sp,8 8008358: c3 a0 00 00 ret =============================================================================== 08006f5c <_Scheduler_CBS_Release_job>: void _Scheduler_CBS_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 8006f5c: 37 9c ff fc addi sp,sp,-4 8006f60: 5b 9d 00 04 sw (sp+4),ra Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 8006f64: 28 23 00 88 lw r3,(r1+136) void _Scheduler_CBS_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 8006f68: 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 = 8006f6c: 28 63 00 18 lw r3,(r3+24) (Scheduler_CBS_Server *) sched_info->cbs_server; if (deadline) { 8006f70: 44 40 00 13 be r2,r0,8006fbc <_Scheduler_CBS_Release_job+0x60> /* Initializing or shifting deadline. */ if (serv_info) 8006f74: 44 60 00 15 be r3,r0,8006fc8 <_Scheduler_CBS_Release_job+0x6c> new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 8006f78: 78 02 08 02 mvhi r2,0x802 8006f7c: 38 42 2a c8 ori r2,r2,0x2ac8 8006f80: 28 64 00 04 lw r4,(r3+4) 8006f84: 28 42 00 00 lw r2,(r2+0) 8006f88: 78 05 08 01 mvhi r5,0x801 8006f8c: 38 a5 fc 8c ori r5,r5,0xfc8c 8006f90: b4 44 10 00 add r2,r2,r4 8006f94: 28 a4 00 00 lw r4,(r5+0) 8006f98: a0 44 10 00 and r2,r2,r4 new_priority = the_thread->Start.initial_priority; } /* Budget replenishment for the next job. */ if (serv_info) the_thread->cpu_time_budget = serv_info->parameters.budget; 8006f9c: 28 63 00 08 lw r3,(r3+8) 8006fa0: 58 23 00 74 sw (r1+116),r3 the_thread->real_priority = new_priority; 8006fa4: 58 22 00 18 sw (r1+24),r2 _Thread_Change_priority(the_thread, new_priority, true); 8006fa8: 34 03 00 01 mvi r3,1 8006fac: f8 00 01 4f calli 80074e8 <_Thread_Change_priority> } 8006fb0: 2b 9d 00 04 lw ra,(sp+4) 8006fb4: 37 9c 00 04 addi sp,sp,4 8006fb8: c3 a0 00 00 ret new_priority = (_Watchdog_Ticks_since_boot + deadline) & ~SCHEDULER_EDF_PRIO_MSB; } else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; 8006fbc: 28 22 00 ac lw r2,(r1+172) } /* Budget replenishment for the next job. */ if (serv_info) 8006fc0: 5c 64 ff f7 bne r3,r4,8006f9c <_Scheduler_CBS_Release_job+0x40><== ALWAYS TAKEN 8006fc4: e3 ff ff f8 bi 8006fa4 <_Scheduler_CBS_Release_job+0x48> <== NOT EXECUTED /* Initializing or shifting deadline. */ if (serv_info) new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 8006fc8: 78 02 08 02 mvhi r2,0x802 8006fcc: 38 42 2a c8 ori r2,r2,0x2ac8 8006fd0: 28 42 00 00 lw r2,(r2+0) 8006fd4: b4 82 10 00 add r2,r4,r2 8006fd8: 78 04 08 01 mvhi r4,0x801 8006fdc: 38 84 fc 8c ori r4,r4,0xfc8c 8006fe0: 28 83 00 00 lw r3,(r4+0) 8006fe4: a0 43 10 00 and r2,r2,r3 8006fe8: e3 ff ff ef bi 8006fa4 <_Scheduler_CBS_Release_job+0x48> =============================================================================== 08006fec <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 8006fec: 37 9c ff ec addi sp,sp,-20 8006ff0: 5b 8b 00 14 sw (sp+20),r11 8006ff4: 5b 8c 00 10 sw (sp+16),r12 8006ff8: 5b 8d 00 0c sw (sp+12),r13 8006ffc: 5b 8e 00 08 sw (sp+8),r14 8007000: 5b 9d 00 04 sw (sp+4),ra 8007004: 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); 8007008: f8 00 00 59 calli 800716c <_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; 800700c: 29 61 00 88 lw r1,(r11+136) 8007010: 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) { 8007014: 45 80 00 0d be r12,r0,8007048 <_Scheduler_CBS_Unblock+0x5c> time_t deadline = serv_info->parameters.deadline; time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - 8007018: 78 01 08 02 mvhi r1,0x802 800701c: 38 21 2a c8 ori r1,r1,0x2ac8 8007020: 28 21 00 00 lw r1,(r1+0) 8007024: 29 6d 00 18 lw r13,(r11+24) _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 8007028: 29 82 00 04 lw r2,(r12+4) 800702c: c9 a1 08 00 sub r1,r13,r1 8007030: f8 00 5b 5a calli 801dd98 <__mulsi3> 8007034: b8 20 70 00 mv r14,r1 8007038: 29 82 00 08 lw r2,(r12+8) 800703c: 29 61 00 74 lw r1,(r11+116) 8007040: f8 00 5b 56 calli 801dd98 <__mulsi3> 8007044: 49 c1 00 18 bg r14,r1,80070a4 <_Scheduler_CBS_Unblock+0xb8> /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; if ( the_thread->real_priority != new_priority ) the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) _Thread_Change_priority(the_thread, new_priority, true); 8007048: 29 61 00 14 lw r1,(r11+20) * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, 800704c: 78 0c 08 02 mvhi r12,0x802 8007050: 39 8c 2e 80 ori r12,r12,0x2e80 8007054: 29 84 00 14 lw r4,(r12+20) 8007058: 78 02 08 02 mvhi r2,0x802 800705c: 38 42 20 1c ori r2,r2,0x201c 8007060: 28 43 00 30 lw r3,(r2+48) 8007064: 28 82 00 14 lw r2,(r4+20) 8007068: d8 60 00 00 call r3 800706c: 4c 01 00 07 bge r0,r1,8007088 <_Scheduler_CBS_Unblock+0x9c> _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 8007070: 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; 8007074: 59 8b 00 14 sw (r12+20),r11 if ( _Thread_Executing->is_preemptible || 8007078: 40 21 00 70 lbu r1,(r1+112) 800707c: 44 20 00 13 be r1,r0,80070c8 <_Scheduler_CBS_Unblock+0xdc> the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 8007080: 34 01 00 01 mvi r1,1 8007084: 31 81 00 0c sb (r12+12),r1 } } 8007088: 2b 9d 00 04 lw ra,(sp+4) 800708c: 2b 8b 00 14 lw r11,(sp+20) 8007090: 2b 8c 00 10 lw r12,(sp+16) 8007094: 2b 8d 00 0c lw r13,(sp+12) 8007098: 2b 8e 00 08 lw r14,(sp+8) 800709c: 37 9c 00 14 addi sp,sp,20 80070a0: c3 a0 00 00 ret time_t budget_left = the_thread->real_priority - _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 80070a4: 29 62 00 ac lw r2,(r11+172) if ( the_thread->real_priority != new_priority ) 80070a8: 45 a2 00 02 be r13,r2,80070b0 <_Scheduler_CBS_Unblock+0xc4> the_thread->real_priority = new_priority; 80070ac: 59 62 00 18 sw (r11+24),r2 if ( the_thread->current_priority != new_priority ) 80070b0: 29 61 00 14 lw r1,(r11+20) 80070b4: 44 22 ff e6 be r1,r2,800704c <_Scheduler_CBS_Unblock+0x60> _Thread_Change_priority(the_thread, new_priority, true); 80070b8: b9 60 08 00 mv r1,r11 80070bc: 34 03 00 01 mvi r3,1 80070c0: f8 00 01 0a calli 80074e8 <_Thread_Change_priority> 80070c4: e3 ff ff e1 bi 8007048 <_Scheduler_CBS_Unblock+0x5c> * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 80070c8: 29 62 00 14 lw r2,(r11+20) 80070cc: 44 41 ff ed be r2,r1,8007080 <_Scheduler_CBS_Unblock+0x94> <== NEVER TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; } } 80070d0: 2b 9d 00 04 lw ra,(sp+4) 80070d4: 2b 8b 00 14 lw r11,(sp+20) 80070d8: 2b 8c 00 10 lw r12,(sp+16) 80070dc: 2b 8d 00 0c lw r13,(sp+12) 80070e0: 2b 8e 00 08 lw r14,(sp+8) 80070e4: 37 9c 00 14 addi sp,sp,20 80070e8: c3 a0 00 00 ret =============================================================================== 08006f1c <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 8006f1c: 37 9c ff f8 addi sp,sp,-8 8006f20: 5b 8b 00 08 sw (sp+8),r11 8006f24: 5b 9d 00 04 sw (sp+4),ra 8006f28: b8 20 58 00 mv r11,r1 void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 8006f2c: 34 01 00 18 mvi r1,24 8006f30: f8 00 07 da calli 8008e98 <_Workspace_Allocate> if ( sched ) { 8006f34: 44 20 00 05 be r1,r0,8006f48 <_Scheduler_EDF_Allocate+0x2c><== NEVER TAKEN the_thread->scheduler_info = sched; 8006f38: 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; 8006f3c: 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; 8006f40: 58 2b 00 00 sw (r1+0),r11 schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 8006f44: 58 22 00 14 sw (r1+20),r2 } return sched; } 8006f48: 2b 9d 00 04 lw ra,(sp+4) 8006f4c: 2b 8b 00 08 lw r11,(sp+8) 8006f50: 37 9c 00 08 addi sp,sp,8 8006f54: c3 a0 00 00 ret =============================================================================== 08007190 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 8007190: 37 9c ff f4 addi sp,sp,-12 8007194: 5b 8b 00 0c sw (sp+12),r11 8007198: 5b 8c 00 08 sw (sp+8),r12 800719c: 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( 80071a0: 78 0b 08 02 mvhi r11,0x802 #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 80071a4: 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( 80071a8: 39 6b 2e 80 ori r11,r11,0x2e80 void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { _Scheduler_EDF_Enqueue(the_thread); 80071ac: fb ff ff 8b calli 8006fd8 <_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( 80071b0: 29 61 00 14 lw r1,(r11+20) 80071b4: 78 02 08 02 mvhi r2,0x802 80071b8: 38 42 20 18 ori r2,r2,0x2018 80071bc: 28 43 00 30 lw r3,(r2+48) 80071c0: 28 21 00 14 lw r1,(r1+20) 80071c4: 29 82 00 14 lw r2,(r12+20) 80071c8: d8 60 00 00 call r3 80071cc: 4c 20 00 07 bge r1,r0,80071e8 <_Scheduler_EDF_Unblock+0x58> _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 80071d0: 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; 80071d4: 59 6c 00 14 sw (r11+20),r12 if ( _Thread_Executing->is_preemptible || 80071d8: 40 21 00 70 lbu r1,(r1+112) 80071dc: 44 20 00 08 be r1,r0,80071fc <_Scheduler_EDF_Unblock+0x6c> the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 80071e0: 34 01 00 01 mvi r1,1 80071e4: 31 61 00 0c sb (r11+12),r1 } } 80071e8: 2b 9d 00 04 lw ra,(sp+4) 80071ec: 2b 8b 00 0c lw r11,(sp+12) 80071f0: 2b 8c 00 08 lw r12,(sp+8) 80071f4: 37 9c 00 0c addi sp,sp,12 80071f8: c3 a0 00 00 ret */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 80071fc: 29 82 00 14 lw r2,(r12+20) 8007200: 5c 41 ff fa bne r2,r1,80071e8 <_Scheduler_EDF_Unblock+0x58><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 8007204: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8007208: 31 61 00 0c sb (r11+12),r1 <== NOT EXECUTED 800720c: e3 ff ff f7 bi 80071e8 <_Scheduler_EDF_Unblock+0x58> <== NOT EXECUTED =============================================================================== 0800600c <_Scheduler_priority_Block>: ) { Scheduler_priority_Per_thread *sched_info; Chain_Control *ready; sched_info = (Scheduler_priority_Per_thread *) the_thread->scheduler_info; 800600c: 28 23 00 88 lw r3,(r1+136) ready = sched_info->ready_chain; 8006010: 28 62 00 00 lw r2,(r3+0) if ( _Chain_Has_only_one_node( ready ) ) { 8006014: 28 45 00 00 lw r5,(r2+0) 8006018: 28 44 00 08 lw r4,(r2+8) 800601c: 44 a4 00 37 be r5,r4,80060f8 <_Scheduler_priority_Block+0xec> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 8006020: 28 23 00 00 lw r3,(r1+0) previous = the_node->previous; 8006024: 28 22 00 04 lw r2,(r1+4) next->previous = previous; 8006028: 58 62 00 04 sw (r3+4),r2 previous->next = next; 800602c: 58 43 00 00 sw (r2+0),r3 RTEMS_INLINE_ROUTINE bool _Thread_Is_heir ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Heir ); 8006030: 78 02 08 02 mvhi r2,0x802 8006034: 38 42 0d e0 ori r2,r2,0xde0 { _Scheduler_priority_Ready_queue_extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) 8006038: 28 43 00 14 lw r3,(r2+20) 800603c: 44 23 00 07 be r1,r3,8006058 <_Scheduler_priority_Block+0x4c> _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) 8006040: 28 43 00 10 lw r3,(r2+16) 8006044: 44 23 00 02 be r1,r3,800604c <_Scheduler_priority_Block+0x40> 8006048: c3 a0 00 00 ret _Thread_Dispatch_necessary = true; 800604c: 34 01 00 01 mvi r1,1 8006050: 30 41 00 0c sb (r2+12),r1 8006054: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 8006058: 78 03 08 02 mvhi r3,0x802 800605c: 38 63 0e 20 ori r3,r3,0xe20 8006060: 2c 64 00 00 lhu r4,(r3+0) * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( (Chain_Control *) _Scheduler.information 8006064: 78 03 08 02 mvhi r3,0x802 8006068: 38 63 00 18 ori r3,r3,0x18 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 800606c: 28 67 00 00 lw r7,(r3+0) 8006070: 20 84 ff ff andi r4,r4,0xffff 8006074: 34 03 00 ff mvi r3,255 8006078: 54 83 00 3c bgu r4,r3,8006168 <_Scheduler_priority_Block+0x15c> 800607c: 78 05 08 01 mvhi r5,0x801 8006080: 38 a5 da a8 ori r5,r5,0xdaa8 8006084: b4 a4 20 00 add r4,r5,r4 8006088: 40 84 00 00 lbu r4,(r4+0) 800608c: 34 84 00 08 addi r4,r4,8 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8006090: 78 06 08 02 mvhi r6,0x802 8006094: 38 c6 0e 40 ori r6,r6,0xe40 8006098: b4 84 20 00 add r4,r4,r4 800609c: b4 c4 30 00 add r6,r6,r4 80060a0: 2c c3 00 00 lhu r3,(r6+0) 80060a4: 34 06 00 ff mvi r6,255 80060a8: 54 66 00 25 bgu r3,r6,800613c <_Scheduler_priority_Block+0x130> 80060ac: b4 a3 18 00 add r3,r5,r3 80060b0: 40 65 00 00 lbu r5,(r3+0) 80060b4: 34 a5 00 08 addi r5,r5,8 return (_Priority_Bits_index( major ) << 4) + 80060b8: b4 84 18 00 add r3,r4,r4 80060bc: b4 63 18 00 add r3,r3,r3 80060c0: b4 63 18 00 add r3,r3,r3 80060c4: b4 a3 18 00 add r3,r5,r3 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 80060c8: b4 63 20 00 add r4,r3,r3 80060cc: b4 83 18 00 add r3,r4,r3 80060d0: b4 63 18 00 add r3,r3,r3 80060d4: b4 63 18 00 add r3,r3,r3 80060d8: b4 e3 18 00 add r3,r7,r3 } 80060dc: 28 65 00 00 lw r5,(r3+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 80060e0: 34 63 00 04 addi r3,r3,4 return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 80060e4: 34 04 00 00 mvi r4,0 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 80060e8: 44 a3 00 02 be r5,r3,80060f0 <_Scheduler_priority_Block+0xe4><== NEVER TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); 80060ec: b8 a0 20 00 mv r4,r5 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 80060f0: 58 44 00 14 sw (r2+20),r4 80060f4: e3 ff ff d3 bi 8006040 <_Scheduler_priority_Block+0x34> RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 80060f8: 28 64 00 04 lw r4,(r3+4) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 80060fc: 34 45 00 04 addi r5,r2,4 head->next = tail; 8006100: 58 45 00 00 sw (r2+0),r5 head->previous = NULL; 8006104: 58 40 00 04 sw (r2+4),r0 tail->previous = head; 8006108: 58 42 00 08 sw (r2+8),r2 800610c: 2c 65 00 0e lhu r5,(r3+14) 8006110: 2c 82 00 00 lhu r2,(r4+0) 8006114: a0 45 10 00 and r2,r2,r5 8006118: 0c 82 00 00 sh (r4+0),r2 if ( *the_priority_map->minor == 0 ) 800611c: 5c 40 ff c5 bne r2,r0,8006030 <_Scheduler_priority_Block+0x24> _Priority_Major_bit_map &= the_priority_map->block_major; 8006120: 78 02 08 02 mvhi r2,0x802 8006124: 38 42 0e 20 ori r2,r2,0xe20 8006128: 2c 44 00 00 lhu r4,(r2+0) 800612c: 2c 63 00 0c lhu r3,(r3+12) 8006130: a0 64 18 00 and r3,r3,r4 8006134: 0c 43 00 00 sh (r2+0),r3 8006138: e3 ff ff be bi 8006030 <_Scheduler_priority_Block+0x24> { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 800613c: 00 63 00 01 srui r3,r3,1 8006140: 00 63 00 01 srui r3,r3,1 8006144: 00 63 00 01 srui r3,r3,1 8006148: 00 63 00 01 srui r3,r3,1 800614c: 00 63 00 01 srui r3,r3,1 8006150: 00 63 00 01 srui r3,r3,1 8006154: 00 63 00 01 srui r3,r3,1 8006158: 00 63 00 01 srui r3,r3,1 800615c: b4 a3 18 00 add r3,r5,r3 8006160: 40 65 00 00 lbu r5,(r3+0) 8006164: e3 ff ff d5 bi 80060b8 <_Scheduler_priority_Block+0xac> RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 8006168: 00 84 00 01 srui r4,r4,1 800616c: 78 05 08 01 mvhi r5,0x801 8006170: 00 84 00 01 srui r4,r4,1 8006174: 38 a5 da a8 ori r5,r5,0xdaa8 8006178: 00 84 00 01 srui r4,r4,1 800617c: 00 84 00 01 srui r4,r4,1 8006180: 00 84 00 01 srui r4,r4,1 8006184: 00 84 00 01 srui r4,r4,1 8006188: 00 84 00 01 srui r4,r4,1 800618c: 00 84 00 01 srui r4,r4,1 8006190: b4 a4 20 00 add r4,r5,r4 8006194: 40 84 00 00 lbu r4,(r4+0) 8006198: e3 ff ff be bi 8006090 <_Scheduler_priority_Block+0x84> =============================================================================== 08006368 <_Scheduler_priority_Schedule>: RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 8006368: 78 01 08 02 mvhi r1,0x802 800636c: 38 21 0e 20 ori r1,r1,0xe20 8006370: 2c 22 00 00 lhu r2,(r1+0) * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( (Chain_Control *) _Scheduler.information 8006374: 78 01 08 02 mvhi r1,0x802 8006378: 38 21 00 18 ori r1,r1,0x18 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 800637c: 28 25 00 00 lw r5,(r1+0) 8006380: 20 42 ff ff andi r2,r2,0xffff 8006384: 34 01 00 ff mvi r1,255 8006388: 54 41 00 2d bgu r2,r1,800643c <_Scheduler_priority_Schedule+0xd4> 800638c: 78 03 08 01 mvhi r3,0x801 8006390: 38 63 da a8 ori r3,r3,0xdaa8 8006394: b4 62 10 00 add r2,r3,r2 8006398: 40 42 00 00 lbu r2,(r2+0) 800639c: 34 42 00 08 addi r2,r2,8 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 80063a0: 78 04 08 02 mvhi r4,0x802 80063a4: 38 84 0e 40 ori r4,r4,0xe40 80063a8: b4 42 10 00 add r2,r2,r2 80063ac: b4 82 20 00 add r4,r4,r2 80063b0: 2c 81 00 00 lhu r1,(r4+0) 80063b4: 34 04 00 ff mvi r4,255 80063b8: 54 24 00 16 bgu r1,r4,8006410 <_Scheduler_priority_Schedule+0xa8> 80063bc: b4 61 08 00 add r1,r3,r1 80063c0: 40 23 00 00 lbu r3,(r1+0) 80063c4: 34 63 00 08 addi r3,r3,8 return (_Priority_Bits_index( major ) << 4) + 80063c8: b4 42 08 00 add r1,r2,r2 80063cc: b4 21 08 00 add r1,r1,r1 80063d0: b4 21 08 00 add r1,r1,r1 80063d4: b4 61 08 00 add r1,r3,r1 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 80063d8: b4 21 10 00 add r2,r1,r1 80063dc: b4 41 08 00 add r1,r2,r1 80063e0: b4 21 08 00 add r1,r1,r1 80063e4: b4 21 08 00 add r1,r1,r1 80063e8: b4 a1 08 00 add r1,r5,r1 #include void _Scheduler_priority_Schedule(void) { _Scheduler_priority_Schedule_body(); } 80063ec: 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 ); 80063f0: 34 21 00 04 addi r1,r1,4 return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 80063f4: 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 ] ) ) 80063f8: 44 61 00 02 be r3,r1,8006400 <_Scheduler_priority_Schedule+0x98><== NEVER TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); 80063fc: 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( 8006400: 78 01 08 02 mvhi r1,0x802 8006404: 38 21 0d e0 ori r1,r1,0xde0 8006408: 58 22 00 14 sw (r1+20),r2 800640c: c3 a0 00 00 ret { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 8006410: 00 21 00 01 srui r1,r1,1 8006414: 00 21 00 01 srui r1,r1,1 8006418: 00 21 00 01 srui r1,r1,1 800641c: 00 21 00 01 srui r1,r1,1 8006420: 00 21 00 01 srui r1,r1,1 8006424: 00 21 00 01 srui r1,r1,1 8006428: 00 21 00 01 srui r1,r1,1 800642c: 00 21 00 01 srui r1,r1,1 8006430: b4 61 08 00 add r1,r3,r1 8006434: 40 23 00 00 lbu r3,(r1+0) 8006438: e3 ff ff e4 bi 80063c8 <_Scheduler_priority_Schedule+0x60> RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 800643c: 00 42 00 01 srui r2,r2,1 8006440: 78 03 08 01 mvhi r3,0x801 8006444: 00 42 00 01 srui r2,r2,1 8006448: 38 63 da a8 ori r3,r3,0xdaa8 800644c: 00 42 00 01 srui r2,r2,1 8006450: 00 42 00 01 srui r2,r2,1 8006454: 00 42 00 01 srui r2,r2,1 8006458: 00 42 00 01 srui r2,r2,1 800645c: 00 42 00 01 srui r2,r2,1 8006460: 00 42 00 01 srui r2,r2,1 8006464: b4 62 10 00 add r2,r3,r2 8006468: 40 42 00 00 lbu r2,(r2+0) 800646c: e3 ff ff cd bi 80063a0 <_Scheduler_priority_Schedule+0x38> =============================================================================== 08006470 <_Scheduler_priority_Tick>: #include #include void _Scheduler_priority_Tick( void ) { 8006470: 37 9c ff f8 addi sp,sp,-8 8006474: 5b 9d 00 04 sw (sp+4),ra Thread_Control *executing; executing = _Thread_Executing; 8006478: 78 01 08 02 mvhi r1,0x802 800647c: 38 21 0d e0 ori r1,r1,0xde0 8006480: 28 21 00 10 lw r1,(r1+16) /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 8006484: 40 22 00 70 lbu r2,(r1+112) 8006488: 44 40 00 09 be r2,r0,80064ac <_Scheduler_priority_Tick+0x3c> return; if ( !_States_Is_ready( executing->current_state ) ) 800648c: 28 22 00 10 lw r2,(r1+16) 8006490: 5c 40 00 07 bne r2,r0,80064ac <_Scheduler_priority_Tick+0x3c> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 8006494: 28 22 00 78 lw r2,(r1+120) 8006498: 44 40 00 05 be r2,r0,80064ac <_Scheduler_priority_Tick+0x3c> 800649c: 34 03 00 02 mvi r3,2 80064a0: 50 62 00 0d bgeu r3,r2,80064d4 <_Scheduler_priority_Tick+0x64> 80064a4: 34 03 00 03 mvi r3,3 80064a8: 44 43 00 04 be r2,r3,80064b8 <_Scheduler_priority_Tick+0x48><== ALWAYS TAKEN if ( --executing->cpu_time_budget == 0 ) (*executing->budget_callout)( executing ); break; #endif } } 80064ac: 2b 9d 00 04 lw ra,(sp+4) 80064b0: 37 9c 00 08 addi sp,sp,8 80064b4: c3 a0 00 00 ret } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 80064b8: 28 22 00 74 lw r2,(r1+116) 80064bc: 34 42 ff ff addi r2,r2,-1 80064c0: 58 22 00 74 sw (r1+116),r2 80064c4: 5c 40 ff fa bne r2,r0,80064ac <_Scheduler_priority_Tick+0x3c> (*executing->budget_callout)( executing ); 80064c8: 28 22 00 7c lw r2,(r1+124) 80064cc: d8 40 00 00 call r2 80064d0: e3 ff ff f7 bi 80064ac <_Scheduler_priority_Tick+0x3c> 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 ) { 80064d4: 28 22 00 74 lw r2,(r1+116) 80064d8: 34 42 ff ff addi r2,r2,-1 80064dc: 58 22 00 74 sw (r1+116),r2 80064e0: 48 40 ff f3 bg r2,r0,80064ac <_Scheduler_priority_Tick+0x3c> * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield(); 80064e4: 78 02 08 02 mvhi r2,0x802 80064e8: 38 42 00 18 ori r2,r2,0x18 80064ec: 28 42 00 0c lw r2,(r2+12) 80064f0: 5b 81 00 08 sw (sp+8),r1 80064f4: d8 40 00 00 call r2 * 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; 80064f8: 78 02 08 02 mvhi r2,0x802 80064fc: 38 42 08 f0 ori r2,r2,0x8f0 8006500: 28 42 00 00 lw r2,(r2+0) 8006504: 2b 81 00 08 lw r1,(sp+8) 8006508: 58 22 00 74 sw (r1+116),r2 800650c: e3 ff ff e8 bi 80064ac <_Scheduler_priority_Tick+0x3c> =============================================================================== 0800519c <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 800519c: 37 9c ff f4 addi sp,sp,-12 80051a0: 5b 8b 00 0c sw (sp+12),r11 80051a4: 5b 8c 00 08 sw (sp+8),r12 80051a8: 5b 9d 00 04 sw (sp+4),ra uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 80051ac: 78 02 08 01 mvhi r2,0x801 80051b0: 38 42 fa d0 ori r2,r2,0xfad0 }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 80051b4: 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(); 80051b8: 28 42 00 0c lw r2,(r2+12) (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 80051bc: 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) || 80051c0: 44 20 00 22 be r1,r0,8005248 <_TOD_Validate+0xac> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 80051c4: 78 03 08 01 mvhi r3,0x801 80051c8: 38 63 fe 54 ori r3,r3,0xfe54 80051cc: 28 61 00 00 lw r1,(r3+0) 80051d0: f8 00 65 7d calli 801e7c4 <__udivsi3> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 80051d4: 29 62 00 18 lw r2,(r11+24) 80051d8: 50 41 00 1c bgeu r2,r1,8005248 <_TOD_Validate+0xac> (the_tod->ticks >= ticks_per_second) || 80051dc: 29 62 00 14 lw r2,(r11+20) 80051e0: 34 01 00 3b mvi r1,59 80051e4: 54 41 00 19 bgu r2,r1,8005248 <_TOD_Validate+0xac> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 80051e8: 29 62 00 10 lw r2,(r11+16) 80051ec: 54 41 00 17 bgu r2,r1,8005248 <_TOD_Validate+0xac> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 80051f0: 29 62 00 0c lw r2,(r11+12) 80051f4: 34 01 00 17 mvi r1,23 80051f8: 54 41 00 14 bgu r2,r1,8005248 <_TOD_Validate+0xac> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 80051fc: 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) || 8005200: 44 20 00 12 be r1,r0,8005248 <_TOD_Validate+0xac> <== NEVER TAKEN (the_tod->month == 0) || 8005204: 34 02 00 0c mvi r2,12 8005208: 54 22 00 10 bgu r1,r2,8005248 <_TOD_Validate+0xac> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 800520c: 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) || 8005210: 34 03 07 c3 mvi r3,1987 8005214: 50 62 00 0d bgeu r3,r2,8005248 <_TOD_Validate+0xac> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 8005218: 29 63 00 08 lw r3,(r11+8) (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 800521c: 44 60 00 0b be r3,r0,8005248 <_TOD_Validate+0xac> <== NEVER TAKEN (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 8005220: 20 42 00 03 andi r2,r2,0x3 8005224: 5c 40 00 02 bne r2,r0,800522c <_TOD_Validate+0x90> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 8005228: 34 21 00 0d addi r1,r1,13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 800522c: 78 02 08 02 mvhi r2,0x802 8005230: b4 21 08 00 add r1,r1,r1 8005234: 38 42 07 d0 ori r2,r2,0x7d0 8005238: b4 21 08 00 add r1,r1,r1 800523c: b4 41 08 00 add r1,r2,r1 8005240: 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( 8005244: f1 83 60 00 cmpgeu r12,r12,r3 if ( the_tod->day > days_in_month ) return false; return true; } 8005248: b9 80 08 00 mv r1,r12 800524c: 2b 9d 00 04 lw ra,(sp+4) 8005250: 2b 8b 00 0c lw r11,(sp+12) 8005254: 2b 8c 00 08 lw r12,(sp+8) 8005258: 37 9c 00 0c addi sp,sp,12 800525c: c3 a0 00 00 ret =============================================================================== 080066e0 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 80066e0: 37 9c ff e4 addi sp,sp,-28 80066e4: 5b 8b 00 1c sw (sp+28),r11 80066e8: 5b 8c 00 18 sw (sp+24),r12 80066ec: 5b 8d 00 14 sw (sp+20),r13 80066f0: 5b 8e 00 10 sw (sp+16),r14 80066f4: 5b 8f 00 0c sw (sp+12),r15 80066f8: 5b 90 00 08 sw (sp+8),r16 80066fc: 5b 9d 00 04 sw (sp+4),ra 8006700: b8 20 58 00 mv r11,r1 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 8006704: 28 2f 00 10 lw r15,(r1+16) void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 8006708: b8 40 60 00 mv r12,r2 800670c: 20 70 00 ff andi r16,r3,0xff /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 8006710: f8 00 04 0c calli 8007740 <_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 ) 8006714: 29 61 00 14 lw r1,(r11+20) 8006718: 44 2c 00 04 be r1,r12,8006728 <_Thread_Change_priority+0x48> _Thread_Set_priority( the_thread, new_priority ); 800671c: b9 60 08 00 mv r1,r11 8006720: b9 80 10 00 mv r2,r12 8006724: f8 00 03 e3 calli 80076b0 <_Thread_Set_priority> _ISR_Disable( level ); 8006728: 90 00 60 00 rcsr r12,IE 800672c: 34 0d ff fe mvi r13,-2 8006730: a1 8d 68 00 and r13,r12,r13 8006734: 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; 8006738: 29 61 00 10 lw r1,(r11+16) if ( state != STATES_TRANSIENT ) { 800673c: 34 02 00 04 mvi r2,4 8006740: 44 22 00 1f be r1,r2,80067bc <_Thread_Change_priority+0xdc> */ RTEMS_INLINE_ROUTINE bool _States_Is_transient ( States_Control the_states ) { return (the_states & STATES_TRANSIENT); 8006744: 21 ef 00 04 andi r15,r15,0x4 /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 8006748: 45 e0 00 10 be r15,r0,8006788 <_Thread_Change_priority+0xa8><== ALWAYS TAKEN the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 800674c: d0 0c 00 00 wcsr IE,r12 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 8006750: 78 03 08 01 mvhi r3,0x801 <== NOT EXECUTED 8006754: 38 63 dc 04 ori r3,r3,0xdc04 <== NOT EXECUTED 8006758: 28 62 00 00 lw r2,(r3+0) <== NOT EXECUTED 800675c: a0 22 08 00 and r1,r1,r2 <== NOT EXECUTED if ( _States_Is_waiting_on_thread_queue( state ) ) { 8006760: 5c 20 00 13 bne r1,r0,80067ac <_Thread_Change_priority+0xcc><== NOT EXECUTED if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } 8006764: 2b 9d 00 04 lw ra,(sp+4) 8006768: 2b 8b 00 1c lw r11,(sp+28) 800676c: 2b 8c 00 18 lw r12,(sp+24) 8006770: 2b 8d 00 14 lw r13,(sp+20) 8006774: 2b 8e 00 10 lw r14,(sp+16) 8006778: 2b 8f 00 0c lw r15,(sp+12) 800677c: 2b 90 00 08 lw r16,(sp+8) 8006780: 37 9c 00 1c addi sp,sp,28 8006784: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 8006788: 34 02 ff fb mvi r2,-5 800678c: a0 22 10 00 and r2,r1,r2 */ state = the_thread->current_state; if ( state != STATES_TRANSIENT ) { /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 8006790: 59 62 00 10 sw (r11+16),r2 _ISR_Enable( level ); 8006794: 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); 8006798: 78 03 08 01 mvhi r3,0x801 800679c: 38 63 dc 04 ori r3,r3,0xdc04 80067a0: 28 62 00 00 lw r2,(r3+0) 80067a4: a0 22 08 00 and r1,r1,r2 if ( _States_Is_waiting_on_thread_queue( state ) ) { 80067a8: 44 20 ff ef be r1,r0,8006764 <_Thread_Change_priority+0x84> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 80067ac: 29 61 00 44 lw r1,(r11+68) 80067b0: b9 60 10 00 mv r2,r11 80067b4: f8 00 03 82 calli 80075bc <_Thread_queue_Requeue> 80067b8: e3 ff ff eb bi 8006764 <_Thread_Change_priority+0x84> 80067bc: 78 0e 08 02 mvhi r14,0x802 */ RTEMS_INLINE_ROUTINE bool _States_Is_transient ( States_Control the_states ) { return (the_states & STATES_TRANSIENT); 80067c0: 21 ef 00 04 andi r15,r15,0x4 80067c4: 39 ce 00 18 ori r14,r14,0x18 } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 80067c8: 5d e0 00 06 bne r15,r0,80067e0 <_Thread_Change_priority+0x100><== NEVER TAKEN * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 80067cc: 59 60 00 10 sw (r11+16),r0 if ( prepend_it ) 80067d0: 46 0f 00 13 be r16,r15,800681c <_Thread_Change_priority+0x13c> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 80067d4: 29 c2 00 28 lw r2,(r14+40) 80067d8: b9 60 08 00 mv r1,r11 80067dc: d8 40 00 00 call r2 _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 80067e0: d0 0c 00 00 wcsr IE,r12 80067e4: 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(); 80067e8: 29 c1 00 08 lw r1,(r14+8) 80067ec: 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 ); 80067f0: 78 01 08 02 mvhi r1,0x802 80067f4: 38 21 0d e0 ori r1,r1,0xde0 80067f8: 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() && 80067fc: 28 23 00 14 lw r3,(r1+20) 8006800: 44 43 00 05 be r2,r3,8006814 <_Thread_Change_priority+0x134> 8006804: 40 42 00 70 lbu r2,(r2+112) 8006808: 44 40 00 03 be r2,r0,8006814 <_Thread_Change_priority+0x134> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 800680c: 34 02 00 01 mvi r2,1 8006810: 30 22 00 0c sb (r1+12),r2 _ISR_Enable( level ); 8006814: d0 0c 00 00 wcsr IE,r12 8006818: e3 ff ff d3 bi 8006764 <_Thread_Change_priority+0x84> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 800681c: 29 c2 00 24 lw r2,(r14+36) 8006820: b9 60 08 00 mv r1,r11 8006824: d8 40 00 00 call r2 8006828: e3 ff ff ee bi 80067e0 <_Thread_Change_priority+0x100> =============================================================================== 0800d48c <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 800d48c: 37 9c ff f8 addi sp,sp,-8 800d490: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 800d494: 37 82 00 08 addi r2,sp,8 800d498: f8 00 00 a7 calli 800d734 <_Thread_Get> switch ( location ) { 800d49c: 2b 82 00 08 lw r2,(sp+8) 800d4a0: 5c 40 00 0a bne r2,r0,800d4c8 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 800d4a4: 78 03 08 02 mvhi r3,0x802 800d4a8: 38 63 86 44 ori r3,r3,0x8644 800d4ac: 28 62 00 00 lw r2,(r3+0) 800d4b0: fb ff ff 65 calli 800d244 <_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; 800d4b4: 78 01 08 02 mvhi r1,0x802 800d4b8: 38 21 aa 78 ori r1,r1,0xaa78 800d4bc: 28 22 00 00 lw r2,(r1+0) --level; 800d4c0: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 800d4c4: 58 22 00 00 sw (r1+0),r2 | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 800d4c8: 2b 9d 00 04 lw ra,(sp+4) 800d4cc: 37 9c 00 08 addi sp,sp,8 800d4d0: c3 a0 00 00 ret =============================================================================== 08006a04 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 8006a04: 37 9c ff bc addi sp,sp,-68 8006a08: 5b 8b 00 3c sw (sp+60),r11 8006a0c: 5b 8c 00 38 sw (sp+56),r12 8006a10: 5b 8d 00 34 sw (sp+52),r13 8006a14: 5b 8e 00 30 sw (sp+48),r14 8006a18: 5b 8f 00 2c sw (sp+44),r15 8006a1c: 5b 90 00 28 sw (sp+40),r16 8006a20: 5b 91 00 24 sw (sp+36),r17 8006a24: 5b 92 00 20 sw (sp+32),r18 8006a28: 5b 93 00 1c sw (sp+28),r19 8006a2c: 5b 94 00 18 sw (sp+24),r20 8006a30: 5b 95 00 14 sw (sp+20),r21 8006a34: 5b 96 00 10 sw (sp+16),r22 8006a38: 5b 97 00 0c sw (sp+12),r23 8006a3c: 5b 98 00 08 sw (sp+8),r24 8006a40: 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; 8006a44: 78 01 08 02 mvhi r1,0x802 8006a48: 38 21 0d e0 ori r1,r1,0xde0 8006a4c: 28 2c 00 10 lw r12,(r1+16) _ISR_Disable( level ); 8006a50: 90 00 18 00 rcsr r3,IE 8006a54: 34 01 ff fe mvi r1,-2 8006a58: a0 61 08 00 and r1,r3,r1 8006a5c: d0 01 00 00 wcsr IE,r1 while ( _Thread_Dispatch_necessary == true ) { 8006a60: 78 0e 08 02 mvhi r14,0x802 8006a64: 39 ce 0d e0 ori r14,r14,0xde0 8006a68: 41 c2 00 0c lbu r2,(r14+12) 8006a6c: 78 11 08 02 mvhi r17,0x802 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); 8006a70: b8 60 08 00 mv r1,r3 while ( _Thread_Dispatch_necessary == true ) { 8006a74: 20 42 00 ff andi r2,r2,0xff 8006a78: 3a 31 09 58 ori r17,r17,0x958 8006a7c: 44 40 00 4d be r2,r0,8006bb0 <_Thread_Dispatch+0x1ac> heir = _Thread_Heir; 8006a80: 29 cd 00 14 lw r13,(r14+20) * This routine sets thread dispatch level to the * value passed in. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value) { _Thread_Dispatch_disable_level = value; 8006a84: 34 01 00 01 mvi r1,1 8006a88: 5a 21 00 00 sw (r17+0),r1 #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 8006a8c: 31 c0 00 0c sb (r14+12),r0 _Thread_Executing = heir; 8006a90: 59 cd 00 10 sw (r14+16),r13 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); 8006a94: b8 60 08 00 mv r1,r3 /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 8006a98: 45 8d 00 46 be r12,r13,8006bb0 <_Thread_Dispatch+0x1ac> 8006a9c: 78 15 08 02 mvhi r21,0x802 8006aa0: 78 14 08 02 mvhi r20,0x802 8006aa4: 78 13 08 02 mvhi r19,0x802 8006aa8: 78 0f 08 02 mvhi r15,0x802 #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; 8006aac: 78 16 08 02 mvhi r22,0x802 8006ab0: 37 98 00 40 addi r24,sp,64 8006ab4: 3a b5 08 e0 ori r21,r21,0x8e0 8006ab8: 3a 94 09 c4 ori r20,r20,0x9c4 8006abc: 3a 73 01 a0 ori r19,r19,0x1a0 8006ac0: 39 ef 01 a4 ori r15,r15,0x1a4 */ #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 ) 8006ac4: 34 12 00 01 mvi r18,1 heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 8006ac8: 3a d6 08 f0 ori r22,r22,0x8f0 #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 8006acc: 34 17 ff fe mvi r23,-2 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 8006ad0: b9 c0 80 00 mv r16,r14 */ #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) 8006ad4: 29 a1 00 78 lw r1,(r13+120) 8006ad8: 44 32 00 54 be r1,r18,8006c28 <_Thread_Dispatch+0x224> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; _ISR_Enable( level ); 8006adc: d0 03 00 00 wcsr IE,r3 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 8006ae0: bb 00 08 00 mv r1,r24 8006ae4: ba a0 10 00 mv r2,r21 8006ae8: fb ff f8 d7 calli 8004e44 <_TOD_Get_with_nanoseconds> #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 8006aec: 2b 84 00 44 lw r4,(sp+68) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006af0: 29 83 00 84 lw r3,(r12+132) 8006af4: 29 88 00 80 lw r8,(r12+128) static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006af8: 29 c5 00 24 lw r5,(r14+36) 8006afc: 2b 86 00 40 lw r6,(sp+64) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006b00: b4 83 18 00 add r3,r4,r3 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006b04: 29 c1 00 20 lw r1,(r14+32) const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006b08: f4 83 48 00 cmpgu r9,r4,r3 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006b0c: c8 65 28 00 sub r5,r3,r5 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006b10: b4 c8 40 00 add r8,r6,r8 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006b14: f4 a3 18 00 cmpgu r3,r5,r3 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 8006b18: b5 28 38 00 add r7,r9,r8 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 8006b1c: c8 e1 38 00 sub r7,r7,r1 8006b20: c8 e3 38 00 sub r7,r7,r3 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8006b24: 2a 83 00 00 lw r3,(r20+0) 8006b28: 59 87 00 80 sw (r12+128),r7 8006b2c: 59 85 00 84 sw (r12+132),r5 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 8006b30: 59 c6 00 20 sw (r14+32),r6 8006b34: 59 c4 00 24 sw (r14+36),r4 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8006b38: 44 60 00 05 be r3,r0,8006b4c <_Thread_Dispatch+0x148> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 8006b3c: 28 61 00 00 lw r1,(r3+0) 8006b40: 59 81 01 14 sw (r12+276),r1 *_Thread_libc_reent = heir->libc_reent; 8006b44: 29 a1 01 14 lw r1,(r13+276) 8006b48: 58 61 00 00 sw (r3+0),r1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 8006b4c: 2a 6b 00 00 lw r11,(r19+0) { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 8006b50: 45 6f 00 07 be r11,r15,8006b6c <_Thread_Dispatch+0x168> <== NEVER TAKEN const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 8006b54: 29 63 00 08 lw r3,(r11+8) 8006b58: b9 80 08 00 mv r1,r12 8006b5c: b9 a0 10 00 mv r2,r13 8006b60: d8 60 00 00 call r3 8006b64: 29 6b 00 00 lw r11,(r11+0) { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 8006b68: 5d 6f ff fb bne r11,r15,8006b54 <_Thread_Dispatch+0x150> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 8006b6c: 35 81 00 c0 addi r1,r12,192 8006b70: 35 a2 00 c0 addi r2,r13,192 8006b74: f8 00 05 47 calli 8008090 <_CPU_Context_switch> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 8006b78: 29 cc 00 10 lw r12,(r14+16) _ISR_Disable( level ); 8006b7c: 90 00 18 00 rcsr r3,IE 8006b80: a0 77 20 00 and r4,r3,r23 8006b84: d0 04 00 00 wcsr IE,r4 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 8006b88: 42 04 00 0c lbu r4,(r16+12) 8006b8c: ba 00 70 00 mv r14,r16 8006b90: 20 84 00 ff andi r4,r4,0xff 8006b94: 44 80 00 06 be r4,r0,8006bac <_Thread_Dispatch+0x1a8> heir = _Thread_Heir; 8006b98: 2a 0d 00 14 lw r13,(r16+20) 8006b9c: 5a 32 00 00 sw (r17+0),r18 #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 8006ba0: 32 00 00 0c sb (r16+12),r0 _Thread_Executing = heir; 8006ba4: 5a 0d 00 10 sw (r16+16),r13 /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 8006ba8: 5d ac ff cb bne r13,r12,8006ad4 <_Thread_Dispatch+0xd0> <== ALWAYS TAKEN #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 8006bac: b8 60 08 00 mv r1,r3 8006bb0: 5a 20 00 00 sw (r17+0),r0 post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 8006bb4: d0 01 00 00 wcsr IE,r1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 8006bb8: 78 01 08 02 mvhi r1,0x802 8006bbc: 38 21 09 c8 ori r1,r1,0x9c8 8006bc0: 28 2b 00 00 lw r11,(r1+0) { const Chain_Control *chain = &_API_extensions_Post_switch_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 8006bc4: 78 0d 08 02 mvhi r13,0x802 8006bc8: 39 ad 09 cc ori r13,r13,0x9cc 8006bcc: 45 6d 00 06 be r11,r13,8006be4 <_Thread_Dispatch+0x1e0> const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 8006bd0: 29 62 00 08 lw r2,(r11+8) 8006bd4: b9 80 08 00 mv r1,r12 8006bd8: d8 40 00 00 call r2 8006bdc: 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 ) { 8006be0: 5d 6d ff fc bne r11,r13,8006bd0 <_Thread_Dispatch+0x1cc> <== NEVER TAKEN 8006be4: 2b 9d 00 04 lw ra,(sp+4) 8006be8: 2b 8b 00 3c lw r11,(sp+60) 8006bec: 2b 8c 00 38 lw r12,(sp+56) 8006bf0: 2b 8d 00 34 lw r13,(sp+52) 8006bf4: 2b 8e 00 30 lw r14,(sp+48) 8006bf8: 2b 8f 00 2c lw r15,(sp+44) 8006bfc: 2b 90 00 28 lw r16,(sp+40) 8006c00: 2b 91 00 24 lw r17,(sp+36) 8006c04: 2b 92 00 20 lw r18,(sp+32) 8006c08: 2b 93 00 1c lw r19,(sp+28) 8006c0c: 2b 94 00 18 lw r20,(sp+24) 8006c10: 2b 95 00 14 lw r21,(sp+20) 8006c14: 2b 96 00 10 lw r22,(sp+16) 8006c18: 2b 97 00 0c lw r23,(sp+12) 8006c1c: 2b 98 00 08 lw r24,(sp+8) 8006c20: 37 9c 00 44 addi sp,sp,68 8006c24: c3 a0 00 00 ret #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 8006c28: 2a c1 00 00 lw r1,(r22+0) 8006c2c: 59 a1 00 74 sw (r13+116),r1 8006c30: e3 ff ff ab bi 8006adc <_Thread_Dispatch+0xd8> =============================================================================== 0800cfb4 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 800cfb4: 37 9c ff f4 addi sp,sp,-12 800cfb8: 5b 8b 00 0c sw (sp+12),r11 800cfbc: 5b 8c 00 08 sw (sp+8),r12 800cfc0: 5b 9d 00 04 sw (sp+4),ra #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 800cfc4: 78 01 08 02 mvhi r1,0x802 800cfc8: 38 21 0d e0 ori r1,r1,0xde0 800cfcc: 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; 800cfd0: 29 61 00 a8 lw r1,(r11+168) _ISR_Set_level(level); 800cfd4: 64 21 00 00 cmpei r1,r1,0 800cfd8: 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; 800cfdc: 78 03 08 02 mvhi r3,0x802 800cfe0: 38 63 07 a8 ori r3,r3,0x7a8 800cfe4: 40 6c 00 00 lbu r12,(r3+0) doneConstructors = true; 800cfe8: 34 04 00 01 mvi r4,1 ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 800cfec: 78 02 08 00 mvhi r2,0x800 800cff0: b9 60 08 00 mv r1,r11 800cff4: 38 42 79 78 ori r2,r2,0x7978 800cff8: 30 64 00 00 sb (r3+0),r4 800cffc: fb ff ea 7b calli 80079e8 <_User_extensions_Iterate> _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 800d000: fb ff e7 0d calli 8006c34 <_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) */ { 800d004: 45 80 00 0d be r12,r0,800d038 <_Thread_Handler+0x84> _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 800d008: 29 61 00 90 lw r1,(r11+144) 800d00c: 44 20 00 0e be r1,r0,800d044 <_Thread_Handler+0x90> (*(Thread_Entry_numeric) executing->Start.entry_point)( executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 800d010: 34 02 00 01 mvi r2,1 800d014: 44 22 00 11 be r1,r2,800d058 <_Thread_Handler+0xa4> <== ALWAYS TAKEN } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 800d018: 78 02 08 00 mvhi r2,0x800 800d01c: b9 60 08 00 mv r1,r11 800d020: 38 42 79 98 ori r2,r2,0x7998 800d024: fb ff ea 71 calli 80079e8 <_User_extensions_Iterate> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 800d028: 34 01 00 00 mvi r1,0 800d02c: 34 02 00 01 mvi r2,1 800d030: 34 03 00 05 mvi r3,5 800d034: fb ff e1 1a calli 800549c <_Internal_error_Occurred> * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (doCons) /* && (volatile void *)_init) */ { INIT_NAME (); 800d038: fb ff cb f2 calli 8000000 _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 800d03c: 29 61 00 90 lw r1,(r11+144) 800d040: 5c 20 ff f4 bne r1,r0,800d010 <_Thread_Handler+0x5c> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 800d044: 29 62 00 8c lw r2,(r11+140) 800d048: 29 61 00 98 lw r1,(r11+152) 800d04c: d8 40 00 00 call r2 #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 800d050: 59 61 00 28 sw (r11+40),r1 800d054: e3 ff ff f1 bi 800d018 <_Thread_Handler+0x64> ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 800d058: 29 62 00 8c lw r2,(r11+140) 800d05c: 29 61 00 94 lw r1,(r11+148) 800d060: 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 = 800d064: 59 61 00 28 sw (r11+40),r1 800d068: e3 ff ff ec bi 800d018 <_Thread_Handler+0x64> =============================================================================== 08006fbc <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 8006fbc: 37 9c ff f4 addi sp,sp,-12 8006fc0: 5b 8b 00 0c sw (sp+12),r11 8006fc4: 5b 8c 00 08 sw (sp+8),r12 8006fc8: 5b 9d 00 04 sw (sp+4),ra uint32_t ticks_per_timeslice = 8006fcc: 78 01 08 01 mvhi r1,0x801 8006fd0: 38 21 d2 6c ori r1,r1,0xd26c #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 8006fd4: 28 23 00 28 lw r3,(r1+40) #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = 8006fd8: 28 2b 00 14 lw r11,(r1+20) rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 8006fdc: 28 2c 00 08 lw r12,(r1+8) rtems_configuration_get_maximum_extensions(); rtems_stack_allocate_init_hook stack_allocate_init_hook = 8006fe0: 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 || 8006fe4: 44 60 00 1f be r3,r0,8007060 <_Thread_Handler_initialization+0xa4><== NEVER TAKEN 8006fe8: 28 23 00 2c lw r3,(r1+44) 8006fec: 44 60 00 1d be r3,r0,8007060 <_Thread_Handler_initialization+0xa4> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 8006ff0: 44 40 00 03 be r2,r0,8006ffc <_Thread_Handler_initialization+0x40> (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 8006ff4: 28 21 00 04 lw r1,(r1+4) 8006ff8: d8 40 00 00 call r2 _Thread_Dispatch_necessary = false; 8006ffc: 78 08 08 02 mvhi r8,0x802 8007000: 39 08 0d e0 ori r8,r8,0xde0 _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 8007004: 78 0a 08 02 mvhi r10,0x802 _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8007008: 78 09 08 02 mvhi r9,0x802 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 800700c: 78 01 08 02 mvhi r1,0x802 ); if ( stack_allocate_init_hook != NULL ) (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); _Thread_Dispatch_necessary = false; 8007010: 31 00 00 0c sb (r8+12),r0 _Thread_Executing = NULL; 8007014: 59 00 00 10 sw (r8+16),r0 _Thread_Heir = NULL; 8007018: 59 00 00 14 sw (r8+20),r0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 800701c: 39 4a 09 d4 ori r10,r10,0x9d4 _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8007020: 39 29 08 f0 ori r9,r9,0x8f0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 8007024: 38 21 0a 48 ori r1,r1,0xa48 8007028: 34 02 00 01 mvi r2,1 800702c: 34 03 00 01 mvi r3,1 8007030: 34 04 00 01 mvi r4,1 8007034: 34 05 01 28 mvi r5,296 8007038: 34 06 00 00 mvi r6,0 800703c: 34 07 00 08 mvi r7,8 _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 8007040: 59 4c 00 00 sw (r10+0),r12 _Thread_Ticks_per_timeslice = ticks_per_timeslice; 8007044: 59 2b 00 00 sw (r9+0),r11 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 8007048: fb ff fa fb calli 8005c34 <_Objects_Initialize_information> false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 800704c: 2b 9d 00 04 lw ra,(sp+4) 8007050: 2b 8b 00 0c lw r11,(sp+12) 8007054: 2b 8c 00 08 lw r12,(sp+8) 8007058: 37 9c 00 0c addi sp,sp,12 800705c: c3 a0 00 00 ret _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 8007060: 34 01 00 00 mvi r1,0 8007064: 34 02 00 01 mvi r2,1 8007068: 34 03 00 0e mvi r3,14 800706c: fb ff f9 0c calli 800549c <_Internal_error_Occurred> =============================================================================== 080077f4 <_Thread_Stack_Free>: #include void _Thread_Stack_Free( Thread_Control *the_thread ) { 80077f4: 37 9c ff fc addi sp,sp,-4 80077f8: 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 ) 80077fc: 40 23 00 b0 lbu r3,(r1+176) void _Thread_Stack_Free( Thread_Control *the_thread ) { rtems_stack_free_hook stack_free_hook = 8007800: 78 02 08 01 mvhi r2,0x801 8007804: 38 42 d2 6c ori r2,r2,0xd26c 8007808: 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 ) 800780c: 44 60 00 03 be r3,r0,8007818 <_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 ); 8007810: 28 21 00 b8 lw r1,(r1+184) 8007814: d8 40 00 00 call r2 } 8007818: 2b 9d 00 04 lw ra,(sp+4) 800781c: 37 9c 00 04 addi sp,sp,4 8007820: c3 a0 00 00 ret =============================================================================== 0800afb8 <_Thread_blocking_operation_Cancel>: Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 800afb8: 37 9c ff f8 addi sp,sp,-8 800afbc: 5b 8b 00 08 sw (sp+8),r11 800afc0: 5b 9d 00 04 sw (sp+4),ra 800afc4: b8 40 58 00 mv r11,r2 /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 800afc8: 28 42 00 50 lw r2,(r2+80) #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 800afcc: 59 60 00 44 sw (r11+68),r0 /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 800afd0: 34 01 00 02 mvi r1,2 800afd4: 44 41 00 0b be r2,r1,800b000 <_Thread_blocking_operation_Cancel+0x48><== NEVER TAKEN _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); (void) _Watchdog_Remove( &the_thread->Timer ); } else _ISR_Enable( level ); 800afd8: d0 03 00 00 wcsr IE,r3 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800afdc: 78 01 08 01 mvhi r1,0x801 800afe0: 38 21 dc 0c ori r1,r1,0xdc0c 800afe4: 28 22 00 00 lw r2,(r1+0) 800afe8: b9 60 08 00 mv r1,r11 800afec: f8 00 00 0b calli 800b018 <_Thread_Clear_state> #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 800aff0: 2b 9d 00 04 lw ra,(sp+4) 800aff4: 2b 8b 00 08 lw r11,(sp+8) 800aff8: 37 9c 00 08 addi sp,sp,8 800affc: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 800b000: 34 01 00 03 mvi r1,3 <== NOT EXECUTED 800b004: 59 61 00 50 sw (r11+80),r1 <== NOT EXECUTED * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 800b008: d0 03 00 00 wcsr IE,r3 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 800b00c: 35 61 00 48 addi r1,r11,72 <== NOT EXECUTED 800b010: fb ff f3 30 calli 8007cd0 <_Watchdog_Remove> <== NOT EXECUTED 800b014: e3 ff ff f2 bi 800afdc <_Thread_blocking_operation_Cancel+0x24><== NOT EXECUTED =============================================================================== 08007070 <_Thread_queue_Dequeue>: #include Thread_Control *_Thread_queue_Dequeue( Thread_queue_Control *the_thread_queue ) { 8007070: 37 9c ff f8 addi sp,sp,-8 8007074: 5b 8b 00 08 sw (sp+8),r11 8007078: 5b 9d 00 04 sw (sp+4),ra Thread_Control *(*dequeue_p)( Thread_queue_Control * ); Thread_Control *the_thread; ISR_Level level; Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 800707c: 28 23 00 34 lw r3,(r1+52) #include Thread_Control *_Thread_queue_Dequeue( Thread_queue_Control *the_thread_queue ) { 8007080: b8 20 58 00 mv r11,r1 Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) dequeue_p = _Thread_queue_Dequeue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ dequeue_p = _Thread_queue_Dequeue_fifo; 8007084: 78 02 08 00 mvhi r2,0x800 Thread_Control *(*dequeue_p)( Thread_queue_Control * ); Thread_Control *the_thread; ISR_Level level; Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 8007088: 34 01 00 01 mvi r1,1 dequeue_p = _Thread_queue_Dequeue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ dequeue_p = _Thread_queue_Dequeue_fifo; 800708c: 38 42 b0 d4 ori r2,r2,0xb0d4 Thread_Control *(*dequeue_p)( Thread_queue_Control * ); Thread_Control *the_thread; ISR_Level level; Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 8007090: 44 61 00 0d be r3,r1,80070c4 <_Thread_queue_Dequeue+0x54> dequeue_p = _Thread_queue_Dequeue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ dequeue_p = _Thread_queue_Dequeue_fifo; the_thread = (*dequeue_p)( the_thread_queue ); 8007094: b9 60 08 00 mv r1,r11 8007098: d8 40 00 00 call r2 _ISR_Disable( level ); 800709c: 90 00 10 00 rcsr r2,IE 80070a0: 34 03 ff fe mvi r3,-2 80070a4: a0 43 18 00 and r3,r2,r3 80070a8: d0 03 00 00 wcsr IE,r3 if ( !the_thread ) { 80070ac: 44 20 00 0f be r1,r0,80070e8 <_Thread_queue_Dequeue+0x78> (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; the_thread = _Thread_Executing; } } _ISR_Enable( level ); 80070b0: d0 02 00 00 wcsr IE,r2 return the_thread; } 80070b4: 2b 9d 00 04 lw ra,(sp+4) 80070b8: 2b 8b 00 08 lw r11,(sp+8) 80070bc: 37 9c 00 08 addi sp,sp,8 80070c0: c3 a0 00 00 ret Thread_Control *the_thread; ISR_Level level; Thread_blocking_operation_States sync_state; if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) dequeue_p = _Thread_queue_Dequeue_priority; 80070c4: 78 02 08 00 mvhi r2,0x800 80070c8: 38 42 71 10 ori r2,r2,0x7110 else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ dequeue_p = _Thread_queue_Dequeue_fifo; the_thread = (*dequeue_p)( the_thread_queue ); 80070cc: b9 60 08 00 mv r1,r11 80070d0: d8 40 00 00 call r2 _ISR_Disable( level ); 80070d4: 90 00 10 00 rcsr r2,IE 80070d8: 34 03 ff fe mvi r3,-2 80070dc: a0 43 18 00 and r3,r2,r3 80070e0: d0 03 00 00 wcsr IE,r3 if ( !the_thread ) { 80070e4: 5c 20 ff f3 bne r1,r0,80070b0 <_Thread_queue_Dequeue+0x40> sync_state = the_thread_queue->sync_state; if ( (sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 80070e8: 29 64 00 30 lw r4,(r11+48) 80070ec: 34 03 00 01 mvi r3,1 80070f0: 34 84 ff ff addi r4,r4,-1 80070f4: 54 83 ff ef bgu r4,r3,80070b0 <_Thread_queue_Dequeue+0x40> <== ALWAYS TAKEN (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; the_thread = _Thread_Executing; 80070f8: 78 01 08 02 mvhi r1,0x802 <== NOT EXECUTED 80070fc: 38 21 0d e0 ori r1,r1,0xde0 <== NOT EXECUTED _ISR_Disable( level ); if ( !the_thread ) { sync_state = the_thread_queue->sync_state; if ( (sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 8007100: 34 03 00 03 mvi r3,3 <== NOT EXECUTED the_thread = _Thread_Executing; 8007104: 28 21 00 10 lw r1,(r1+16) <== NOT EXECUTED _ISR_Disable( level ); if ( !the_thread ) { sync_state = the_thread_queue->sync_state; if ( (sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 8007108: 59 63 00 30 sw (r11+48),r3 <== NOT EXECUTED 800710c: e3 ff ff e9 bi 80070b0 <_Thread_queue_Dequeue+0x40> <== NOT EXECUTED =============================================================================== 0800731c <_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 ) { 800731c: 37 9c ff f4 addi sp,sp,-12 8007320: 5b 8b 00 0c sw (sp+12),r11 8007324: 5b 8c 00 08 sw (sp+8),r12 8007328: 5b 8d 00 04 sw (sp+4),r13 Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 800732c: 28 45 00 14 lw r5,(r2+20) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8007330: 34 47 00 3c addi r7,r2,60 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 8007334: 34 46 00 38 addi r6,r2,56 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 8007338: 00 a4 00 01 srui r4,r5,1 800733c: 78 0c 08 02 mvhi r12,0x802 8007340: 00 84 00 01 srui r4,r4,1 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8007344: 58 47 00 38 sw (r2+56),r7 8007348: 00 84 00 01 srui r4,r4,1 head->previous = NULL; tail->previous = head; 800734c: 58 46 00 40 sw (r2+64),r6 8007350: 00 84 00 01 srui r4,r4,1 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 8007354: 58 40 00 3c sw (r2+60),r0 8007358: 00 84 00 01 srui r4,r4,1 RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_reverse_search ( Priority_Control the_priority ) { return ( the_priority & TASK_QUEUE_DATA_REVERSE_SEARCH_MASK ); 800735c: 20 a8 00 20 andi r8,r5,0x20 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 8007360: 00 84 00 01 srui r4,r4,1 header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; 8007364: 28 27 00 38 lw r7,(r1+56) 8007368: b4 84 30 00 add r6,r4,r4 800736c: 39 8c 00 d8 ori r12,r12,0xd8 if ( _Thread_queue_Is_reverse_search( priority ) ) 8007370: 5d 00 00 18 bne r8,r0,80073d0 <_Thread_queue_Enqueue_priority+0xb4> * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007374: b4 c4 20 00 add r4,r6,r4 8007378: b4 84 20 00 add r4,r4,r4 800737c: b4 84 20 00 add r4,r4,r4 8007380: b4 24 60 00 add r12,r1,r4 if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 8007384: 34 0d ff fe mvi r13,-2 RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 8007388: 35 8b 00 04 addi r11,r12,4 800738c: 90 00 40 00 rcsr r8,IE 8007390: a1 0d 50 00 and r10,r8,r13 8007394: d0 0a 00 00 wcsr IE,r10 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007398: 29 84 00 00 lw r4,(r12+0) restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 800739c: 5c 8b 00 04 bne r4,r11,80073ac <_Thread_queue_Enqueue_priority+0x90> 80073a0: e0 00 00 24 bi 8007430 <_Thread_queue_Enqueue_priority+0x114> if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; 80073a4: 28 84 00 00 lw r4,(r4+0) restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 80073a8: 44 8b 00 23 be r4,r11,8007434 <_Thread_queue_Enqueue_priority+0x118> search_priority = search_thread->current_priority; 80073ac: 28 86 00 14 lw r6,(r4+20) if ( priority <= search_priority ) 80073b0: 50 c5 00 21 bgeu r6,r5,8007434 <_Thread_queue_Enqueue_priority+0x118> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 80073b4: d0 08 00 00 wcsr IE,r8 80073b8: d0 0a 00 00 wcsr IE,r10 RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 80073bc: 28 89 00 10 lw r9,(r4+16) 80073c0: a0 e9 48 00 and r9,r7,r9 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 80073c4: 5d 20 ff f8 bne r9,r0,80073a4 <_Thread_queue_Enqueue_priority+0x88> _ISR_Enable( level ); 80073c8: d0 08 00 00 wcsr IE,r8 goto restart_forward_search; 80073cc: e3 ff ff f0 bi 800738c <_Thread_queue_Enqueue_priority+0x70> * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 80073d0: b4 c4 20 00 add r4,r6,r4 80073d4: b4 84 20 00 add r4,r4,r4 80073d8: b4 84 20 00 add r4,r4,r4 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 80073dc: 34 0d ff fe mvi r13,-2 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 80073e0: b4 24 50 00 add r10,r1,r4 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 80073e4: 41 86 00 00 lbu r6,(r12+0) 80073e8: 34 c6 00 01 addi r6,r6,1 _ISR_Disable( level ); 80073ec: 90 00 40 00 rcsr r8,IE 80073f0: a1 0d 58 00 and r11,r8,r13 80073f4: d0 0b 00 00 wcsr IE,r11 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 80073f8: 29 44 00 08 lw r4,(r10+8) restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 80073fc: 5c 8a 00 04 bne r4,r10,800740c <_Thread_queue_Enqueue_priority+0xf0> 8007400: e0 00 00 18 bi 8007460 <_Thread_queue_Enqueue_priority+0x144> if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) search_thread->Object.Node.previous; 8007404: 28 84 00 04 lw r4,(r4+4) restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8007408: 44 8a 00 16 be r4,r10,8007460 <_Thread_queue_Enqueue_priority+0x144> search_priority = search_thread->current_priority; 800740c: 28 86 00 14 lw r6,(r4+20) if ( priority >= search_priority ) 8007410: 50 a6 00 14 bgeu r5,r6,8007460 <_Thread_queue_Enqueue_priority+0x144> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 8007414: d0 08 00 00 wcsr IE,r8 8007418: d0 0b 00 00 wcsr IE,r11 800741c: 28 89 00 10 lw r9,(r4+16) 8007420: a0 e9 48 00 and r9,r7,r9 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8007424: 5d 20 ff f8 bne r9,r0,8007404 <_Thread_queue_Enqueue_priority+0xe8> _ISR_Enable( level ); 8007428: d0 08 00 00 wcsr IE,r8 goto restart_reverse_search; 800742c: e3 ff ff ee bi 80073e4 <_Thread_queue_Enqueue_priority+0xc8> if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 8007430: 34 06 ff ff mvi r6,-1 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 8007434: 28 27 00 30 lw r7,(r1+48) 8007438: 34 0a 00 01 mvi r10,1 800743c: b9 00 48 00 mv r9,r8 8007440: 44 ea 00 1b be r7,r10,80074ac <_Thread_queue_Enqueue_priority+0x190><== ALWAYS TAKEN * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 8007444: 58 69 00 00 sw (r3+0),r9 <== NOT EXECUTED return the_thread_queue->sync_state; } 8007448: b8 e0 08 00 mv r1,r7 800744c: 2b 8b 00 0c lw r11,(sp+12) 8007450: 2b 8c 00 08 lw r12,(sp+8) 8007454: 2b 8d 00 04 lw r13,(sp+4) 8007458: 37 9c 00 0c addi sp,sp,12 800745c: c3 a0 00 00 ret } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 8007460: 28 27 00 30 lw r7,(r1+48) 8007464: 34 0a 00 01 mvi r10,1 8007468: b9 00 48 00 mv r9,r8 800746c: 5c ea ff f6 bne r7,r10,8007444 <_Thread_queue_Enqueue_priority+0x128><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8007470: 58 20 00 30 sw (r1+48),r0 if ( priority == search_priority ) 8007474: 44 a6 00 1d be r5,r6,80074e8 <_Thread_queue_Enqueue_priority+0x1cc> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 8007478: 28 83 00 00 lw r3,(r4+0) the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 800747c: 58 44 00 04 sw (r2+4),r4 search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 8007480: 58 43 00 00 sw (r2+0),r3 the_node->previous = search_node; search_node->next = the_node; 8007484: 58 82 00 00 sw (r4+0),r2 next_node->previous = the_node; 8007488: 58 62 00 04 sw (r3+4),r2 the_thread->Wait.queue = the_thread_queue; 800748c: 58 41 00 44 sw (r2+68),r1 _ISR_Enable( level ); 8007490: d0 08 00 00 wcsr IE,r8 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007494: b8 e0 08 00 mv r1,r7 8007498: 2b 8b 00 0c lw r11,(sp+12) 800749c: 2b 8c 00 08 lw r12,(sp+8) 80074a0: 2b 8d 00 04 lw r13,(sp+4) 80074a4: 37 9c 00 0c addi sp,sp,12 80074a8: c3 a0 00 00 ret if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 80074ac: 58 20 00 30 sw (r1+48),r0 if ( priority == search_priority ) 80074b0: 44 a6 00 0e be r5,r6,80074e8 <_Thread_queue_Enqueue_priority+0x1cc> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 80074b4: 28 83 00 04 lw r3,(r4+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 80074b8: 58 44 00 00 sw (r2+0),r4 the_node->previous = previous_node; 80074bc: 58 43 00 04 sw (r2+4),r3 previous_node->next = the_node; 80074c0: 58 62 00 00 sw (r3+0),r2 search_node->previous = the_node; 80074c4: 58 82 00 04 sw (r4+4),r2 the_thread->Wait.queue = the_thread_queue; 80074c8: 58 41 00 44 sw (r2+68),r1 _ISR_Enable( level ); 80074cc: d0 08 00 00 wcsr IE,r8 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 80074d0: b8 e0 08 00 mv r1,r7 80074d4: 2b 8b 00 0c lw r11,(sp+12) 80074d8: 2b 8c 00 08 lw r12,(sp+8) 80074dc: 2b 8d 00 04 lw r13,(sp+4) 80074e0: 37 9c 00 0c addi sp,sp,12 80074e4: c3 a0 00 00 ret _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 80074e8: 28 83 00 40 lw r3,(r4+64) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); 80074ec: 34 85 00 3c addi r5,r4,60 previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; 80074f0: 58 45 00 00 sw (r2+0),r5 the_node->previous = previous_node; 80074f4: 58 43 00 04 sw (r2+4),r3 previous_node->next = the_node; 80074f8: 58 62 00 00 sw (r3+0),r2 search_node->previous = the_node; 80074fc: 58 82 00 40 sw (r4+64),r2 the_thread->Wait.queue = the_thread_queue; 8007500: 58 41 00 44 sw (r2+68),r1 _ISR_Enable( level ); 8007504: d0 08 00 00 wcsr IE,r8 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8007508: 34 07 00 01 mvi r7,1 800750c: e3 ff ff cf bi 8007448 <_Thread_queue_Enqueue_priority+0x12c> =============================================================================== 0800b32c <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 800b32c: 37 9c ff fc addi sp,sp,-4 800b330: 5b 9d 00 04 sw (sp+4),ra Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 800b334: 28 23 00 44 lw r3,(r1+68) #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 800b338: b8 20 20 00 mv r4,r1 * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && 800b33c: 28 62 00 30 lw r2,(r3+48) 800b340: 44 40 00 05 be r2,r0,800b354 <_Thread_queue_Process_timeout+0x28> RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800b344: 78 01 08 02 mvhi r1,0x802 800b348: 38 21 0d e0 ori r1,r1,0xde0 800b34c: 28 21 00 10 lw r1,(r1+16) 800b350: 44 81 00 09 be r4,r1,800b374 <_Thread_queue_Process_timeout+0x48> if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800b354: 28 65 00 3c lw r5,(r3+60) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 800b358: b8 60 08 00 mv r1,r3 800b35c: b8 80 10 00 mv r2,r4 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800b360: 58 85 00 34 sw (r4+52),r5 _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 800b364: fb ff ff a4 calli 800b1f4 <_Thread_queue_Extract> } } 800b368: 2b 9d 00 04 lw ra,(sp+4) 800b36c: 37 9c 00 04 addi sp,sp,4 800b370: c3 a0 00 00 ret * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 800b374: 34 01 00 03 mvi r1,3 800b378: 44 41 ff fc be r2,r1,800b368 <_Thread_queue_Process_timeout+0x3c><== NEVER TAKEN the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800b37c: 28 61 00 3c lw r1,(r3+60) 800b380: 58 81 00 34 sw (r4+52),r1 the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800b384: 34 01 00 02 mvi r1,2 800b388: 58 61 00 30 sw (r3+48),r1 800b38c: e3 ff ff f7 bi 800b368 <_Thread_queue_Process_timeout+0x3c> =============================================================================== 080075bc <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 80075bc: 37 9c ff ec addi sp,sp,-20 80075c0: 5b 8b 00 10 sw (sp+16),r11 80075c4: 5b 8c 00 0c sw (sp+12),r12 80075c8: 5b 8d 00 08 sw (sp+8),r13 80075cc: 5b 9d 00 04 sw (sp+4),ra 80075d0: b8 20 58 00 mv r11,r1 80075d4: 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 ) 80075d8: 44 20 00 04 be r1,r0,80075e8 <_Thread_queue_Requeue+0x2c> <== NEVER TAKEN /* * If queueing by FIFO, there is nothing to do. This only applies to * priority blocking discipline. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 80075dc: 28 22 00 34 lw r2,(r1+52) 80075e0: 34 01 00 01 mvi r1,1 80075e4: 44 41 00 07 be r2,r1,8007600 <_Thread_queue_Requeue+0x44> <== ALWAYS TAKEN _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); } } 80075e8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80075ec: 2b 8b 00 10 lw r11,(sp+16) <== NOT EXECUTED 80075f0: 2b 8c 00 0c lw r12,(sp+12) <== NOT EXECUTED 80075f4: 2b 8d 00 08 lw r13,(sp+8) <== NOT EXECUTED 80075f8: 37 9c 00 14 addi sp,sp,20 <== NOT EXECUTED 80075fc: c3 a0 00 00 ret <== NOT EXECUTED if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 8007600: 90 00 68 00 rcsr r13,IE 8007604: 34 01 ff fe mvi r1,-2 8007608: a1 a1 08 00 and r1,r13,r1 800760c: d0 01 00 00 wcsr IE,r1 8007610: 78 03 08 01 mvhi r3,0x801 8007614: 38 63 dc 04 ori r3,r3,0xdc04 8007618: 29 82 00 10 lw r2,(r12+16) 800761c: 28 61 00 00 lw r1,(r3+0) 8007620: a0 41 08 00 and r1,r2,r1 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 8007624: 5c 20 00 08 bne r1,r0,8007644 <_Thread_queue_Requeue+0x88> <== ALWAYS TAKEN _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); 8007628: d0 0d 00 00 wcsr IE,r13 <== NOT EXECUTED } } 800762c: 2b 9d 00 04 lw ra,(sp+4) 8007630: 2b 8b 00 10 lw r11,(sp+16) 8007634: 2b 8c 00 0c lw r12,(sp+12) 8007638: 2b 8d 00 08 lw r13,(sp+8) 800763c: 37 9c 00 14 addi sp,sp,20 8007640: c3 a0 00 00 ret RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8007644: 34 01 00 01 mvi r1,1 8007648: 59 61 00 30 sw (r11+48),r1 ISR_Level level_ignored; _ISR_Disable( level ); if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 800764c: b9 80 10 00 mv r2,r12 8007650: b9 60 08 00 mv r1,r11 8007654: 34 03 00 01 mvi r3,1 8007658: f8 00 0e f5 calli 800b22c <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 800765c: b9 60 08 00 mv r1,r11 8007660: b9 80 10 00 mv r2,r12 8007664: 37 83 00 14 addi r3,sp,20 8007668: fb ff ff 2d calli 800731c <_Thread_queue_Enqueue_priority> } _ISR_Enable( level ); 800766c: d0 0d 00 00 wcsr IE,r13 8007670: e3 ff ff ef bi 800762c <_Thread_queue_Requeue+0x70> =============================================================================== 08007674 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 8007674: 37 9c ff f8 addi sp,sp,-8 8007678: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 800767c: 37 82 00 08 addi r2,sp,8 8007680: fb ff fd 79 calli 8006c64 <_Thread_Get> switch ( location ) { 8007684: 2b 82 00 08 lw r2,(sp+8) 8007688: 5c 40 00 07 bne r2,r0,80076a4 <_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 ); 800768c: f8 00 0f 28 calli 800b32c <_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; 8007690: 78 01 08 02 mvhi r1,0x802 8007694: 38 21 09 58 ori r1,r1,0x958 8007698: 28 22 00 00 lw r2,(r1+0) --level; 800769c: 34 42 ff ff addi r2,r2,-1 _Thread_Dispatch_disable_level = level; 80076a0: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 80076a4: 2b 9d 00 04 lw ra,(sp+4) 80076a8: 37 9c 00 08 addi sp,sp,8 80076ac: c3 a0 00 00 ret =============================================================================== 080159cc <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 80159cc: 37 9c ff a4 addi sp,sp,-92 80159d0: 5b 8b 00 44 sw (sp+68),r11 80159d4: 5b 8c 00 40 sw (sp+64),r12 80159d8: 5b 8d 00 3c sw (sp+60),r13 80159dc: 5b 8e 00 38 sw (sp+56),r14 80159e0: 5b 8f 00 34 sw (sp+52),r15 80159e4: 5b 90 00 30 sw (sp+48),r16 80159e8: 5b 91 00 2c sw (sp+44),r17 80159ec: 5b 92 00 28 sw (sp+40),r18 80159f0: 5b 93 00 24 sw (sp+36),r19 80159f4: 5b 94 00 20 sw (sp+32),r20 80159f8: 5b 95 00 1c sw (sp+28),r21 80159fc: 5b 96 00 18 sw (sp+24),r22 8015a00: 5b 97 00 14 sw (sp+20),r23 8015a04: 5b 98 00 10 sw (sp+16),r24 8015a08: 5b 99 00 0c sw (sp+12),r25 8015a0c: 5b 9b 00 08 sw (sp+8),fp 8015a10: 5b 9d 00 04 sw (sp+4),ra 8015a14: 78 13 08 03 mvhi r19,0x803 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8015a18: 37 96 00 54 addi r22,sp,84 8015a1c: 37 95 00 58 addi r21,sp,88 8015a20: 37 8f 00 48 addi r15,sp,72 8015a24: 37 94 00 4c addi r20,sp,76 8015a28: 78 0e 08 03 mvhi r14,0x803 8015a2c: 78 17 08 03 mvhi r23,0x803 8015a30: b8 20 58 00 mv r11,r1 8015a34: 5b 95 00 54 sw (sp+84),r21 head->previous = NULL; 8015a38: 5b 80 00 58 sw (sp+88),r0 tail->previous = head; 8015a3c: 5b 96 00 5c sw (sp+92),r22 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8015a40: 5b 94 00 48 sw (sp+72),r20 head->previous = NULL; 8015a44: 5b 80 00 4c sw (sp+76),r0 tail->previous = head; 8015a48: 5b 8f 00 50 sw (sp+80),r15 8015a4c: 3a 73 fe 38 ori r19,r19,0xfe38 8015a50: 34 31 00 30 addi r17,r1,48 8015a54: 39 ce fc d0 ori r14,r14,0xfcd0 8015a58: 34 30 00 68 addi r16,r1,104 8015a5c: 3a f7 fd 50 ori r23,r23,0xfd50 8015a60: 34 3b 00 08 addi fp,r1,8 8015a64: 34 39 00 40 addi r25,r1,64 Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8015a68: 34 0d 00 03 mvi r13,3 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 8015a6c: 34 12 ff fe mvi r18,-2 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 8015a70: 34 18 00 01 mvi r24,1 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 8015a74: 59 76 00 78 sw (r11+120),r22 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 8015a78: 2a 64 00 00 lw r4,(r19+0) /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 8015a7c: 29 62 00 3c lw r2,(r11+60) watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8015a80: ba 20 08 00 mv r1,r17 8015a84: b9 e0 18 00 mv r3,r15 8015a88: c8 82 10 00 sub r2,r4,r2 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 8015a8c: 59 64 00 3c sw (r11+60),r4 _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8015a90: f8 00 15 40 calli 801af90 <_Watchdog_Adjust_to_chain> 8015a94: 78 03 08 03 mvhi r3,0x803 8015a98: 38 63 90 8c ori r3,r3,0x908c 8015a9c: 28 64 00 00 lw r4,(r3+0) 8015aa0: 29 c1 00 00 lw r1,(r14+0) 8015aa4: 29 c2 00 04 lw r2,(r14+4) 8015aa8: 34 03 00 00 mvi r3,0 8015aac: f8 00 56 d6 calli 802b604 <__divdi3> Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 8015ab0: 29 64 00 74 lw r4,(r11+116) 8015ab4: b8 40 60 00 mv r12,r2 /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 8015ab8: 50 82 00 1c bgeu r4,r2,8015b28 <_Timer_server_Body+0x15c> /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8015abc: ba 00 08 00 mv r1,r16 8015ac0: c8 44 10 00 sub r2,r2,r4 8015ac4: b9 e0 18 00 mv r3,r15 8015ac8: f8 00 15 32 calli 801af90 <_Watchdog_Adjust_to_chain> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 8015acc: 59 6c 00 74 sw (r11+116),r12 static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8015ad0: 34 0c 00 01 mvi r12,1 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 8015ad4: 29 61 00 78 lw r1,(r11+120) 8015ad8: f8 00 03 5c calli 8016848 <_Chain_Get> 8015adc: b8 20 10 00 mv r2,r1 if ( timer == NULL ) { 8015ae0: 44 20 00 0b be r1,r0,8015b0c <_Timer_server_Body+0x140> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8015ae4: 28 24 00 38 lw r4,(r1+56) 8015ae8: 44 8c 00 16 be r4,r12,8015b40 <_Timer_server_Body+0x174> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8015aec: 5c 8d ff fa bne r4,r13,8015ad4 <_Timer_server_Body+0x108> <== NEVER TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8015af0: 34 42 00 10 addi r2,r2,16 8015af4: ba 00 08 00 mv r1,r16 8015af8: f8 00 15 4a calli 801b020 <_Watchdog_Insert> } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 8015afc: 29 61 00 78 lw r1,(r11+120) 8015b00: f8 00 03 52 calli 8016848 <_Chain_Get> 8015b04: b8 20 10 00 mv r2,r1 if ( timer == NULL ) { 8015b08: 5c 20 ff f7 bne r1,r0,8015ae4 <_Timer_server_Body+0x118> <== NEVER TAKEN * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 8015b0c: 90 00 10 00 rcsr r2,IE 8015b10: a0 52 18 00 and r3,r2,r18 8015b14: d0 03 00 00 wcsr IE,r3 if ( _Chain_Is_empty( insert_chain ) ) { 8015b18: 2b 83 00 54 lw r3,(sp+84) 8015b1c: 44 75 00 0d be r3,r21,8015b50 <_Timer_server_Body+0x184> <== ALWAYS TAKEN ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 8015b20: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED 8015b24: e3 ff ff d5 bi 8015a78 <_Timer_server_Body+0xac> <== NOT EXECUTED * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 8015b28: 50 44 ff e9 bgeu r2,r4,8015acc <_Timer_server_Body+0x100> /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 8015b2c: ba 00 08 00 mv r1,r16 8015b30: 34 02 00 01 mvi r2,1 8015b34: c8 8c 18 00 sub r3,r4,r12 8015b38: f8 00 14 d8 calli 801ae98 <_Watchdog_Adjust> 8015b3c: e3 ff ff e4 bi 8015acc <_Timer_server_Body+0x100> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8015b40: ba 20 08 00 mv r1,r17 8015b44: 34 42 00 10 addi r2,r2,16 8015b48: f8 00 15 36 calli 801b020 <_Watchdog_Insert> 8015b4c: e3 ff ff e2 bi 8015ad4 <_Timer_server_Body+0x108> */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 8015b50: 59 60 00 78 sw (r11+120),r0 _ISR_Enable( level ); 8015b54: d0 02 00 00 wcsr IE,r2 _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 8015b58: 2b 82 00 48 lw r2,(sp+72) 8015b5c: 5c 54 00 0b bne r2,r20,8015b88 <_Timer_server_Body+0x1bc> 8015b60: e0 00 00 11 bi 8015ba4 <_Timer_server_Body+0x1d8> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 8015b64: 28 43 00 00 lw r3,(r2+0) head->next = new_first; new_first->previous = head; 8015b68: 58 6f 00 04 sw (r3+4),r15 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 8015b6c: 5b 83 00 48 sw (sp+72),r3 * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 8015b70: 58 40 00 08 sw (r2+8),r0 _ISR_Enable( level ); 8015b74: d0 04 00 00 wcsr IE,r4 /* * The timer server may block here and wait for resources or time. * The system watchdogs are inactive and will remain inactive since * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); 8015b78: 28 43 00 1c lw r3,(r2+28) 8015b7c: 28 41 00 20 lw r1,(r2+32) 8015b80: 28 42 00 24 lw r2,(r2+36) 8015b84: d8 60 00 00 call r3 /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 8015b88: 90 00 20 00 rcsr r4,IE 8015b8c: a0 92 10 00 and r2,r4,r18 8015b90: d0 02 00 00 wcsr IE,r2 initialized = false; } #endif return status; } 8015b94: 2b 82 00 48 lw r2,(sp+72) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 8015b98: 5c 54 ff f3 bne r2,r20,8015b64 <_Timer_server_Body+0x198> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 8015b9c: d0 04 00 00 wcsr IE,r4 8015ba0: e3 ff ff b5 bi 8015a74 <_Timer_server_Body+0xa8> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 8015ba4: 31 60 00 7c sb (r11+124),r0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 8015ba8: 2a e1 00 00 lw r1,(r23+0) ++level; 8015bac: 34 21 00 01 addi r1,r1,1 _Thread_Dispatch_disable_level = level; 8015bb0: 5a e1 00 00 sw (r23+0),r1 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 8015bb4: 29 61 00 00 lw r1,(r11+0) 8015bb8: 34 02 00 08 mvi r2,8 8015bbc: f8 00 13 9f calli 801aa38 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 8015bc0: b9 60 08 00 mv r1,r11 8015bc4: fb ff ff 40 calli 80158c4 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 8015bc8: b9 60 08 00 mv r1,r11 8015bcc: fb ff ff 5f calli 8015948 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 8015bd0: f8 00 10 be calli 8019ec8 <_Thread_Enable_dispatch> static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8015bd4: bb 60 08 00 mv r1,fp _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 8015bd8: 31 78 00 7c sb (r11+124),r24 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8015bdc: f8 00 15 77 calli 801b1b8 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 8015be0: bb 20 08 00 mv r1,r25 8015be4: f8 00 15 75 calli 801b1b8 <_Watchdog_Remove> 8015be8: e3 ff ff a3 bi 8015a74 <_Timer_server_Body+0xa8> =============================================================================== 08015bec <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8015bec: 37 9c ff f0 addi sp,sp,-16 8015bf0: 5b 8b 00 10 sw (sp+16),r11 8015bf4: 5b 8c 00 0c sw (sp+12),r12 8015bf8: 5b 8d 00 08 sw (sp+8),r13 8015bfc: 5b 9d 00 04 sw (sp+4),ra 8015c00: b8 20 58 00 mv r11,r1 if ( ts->insert_chain == NULL ) { 8015c04: 28 21 00 78 lw r1,(r1+120) static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 8015c08: b8 40 60 00 mv r12,r2 if ( ts->insert_chain == NULL ) { 8015c0c: 44 20 00 09 be r1,r0,8015c30 <_Timer_server_Schedule_operation_method+0x44> * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 8015c10: 29 61 00 78 lw r1,(r11+120) 8015c14: f8 00 03 01 calli 8016818 <_Chain_Append> } } 8015c18: 2b 9d 00 04 lw ra,(sp+4) 8015c1c: 2b 8b 00 10 lw r11,(sp+16) 8015c20: 2b 8c 00 0c lw r12,(sp+12) 8015c24: 2b 8d 00 08 lw r13,(sp+8) 8015c28: 37 9c 00 10 addi sp,sp,16 8015c2c: c3 a0 00 00 ret * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 8015c30: 78 01 08 03 mvhi r1,0x803 8015c34: 38 21 fd 50 ori r1,r1,0xfd50 8015c38: 28 22 00 00 lw r2,(r1+0) ++level; 8015c3c: 34 42 00 01 addi r2,r2,1 _Thread_Dispatch_disable_level = level; 8015c40: 58 22 00 00 sw (r1+0),r2 * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 8015c44: 29 81 00 38 lw r1,(r12+56) 8015c48: 34 02 00 01 mvi r2,1 8015c4c: 44 22 00 30 be r1,r2,8015d0c <_Timer_server_Schedule_operation_method+0x120> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); if ( !ts->active ) { _Timer_server_Reset_interval_system_watchdog( ts ); } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8015c50: 34 02 00 03 mvi r2,3 8015c54: 44 22 00 08 be r1,r2,8015c74 <_Timer_server_Schedule_operation_method+0x88> if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 8015c58: f8 00 10 9c calli 8019ec8 <_Thread_Enable_dispatch> * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); } } 8015c5c: 2b 9d 00 04 lw ra,(sp+4) 8015c60: 2b 8b 00 10 lw r11,(sp+16) 8015c64: 2b 8c 00 0c lw r12,(sp+12) 8015c68: 2b 8d 00 08 lw r13,(sp+8) 8015c6c: 37 9c 00 10 addi sp,sp,16 8015c70: c3 a0 00 00 ret } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8015c74: 90 00 68 00 rcsr r13,IE 8015c78: 34 01 ff fe mvi r1,-2 8015c7c: a1 a1 08 00 and r1,r13,r1 8015c80: d0 01 00 00 wcsr IE,r1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8015c84: 78 02 08 03 mvhi r2,0x803 8015c88: 78 03 08 03 mvhi r3,0x803 8015c8c: 38 42 fc d0 ori r2,r2,0xfcd0 8015c90: 38 63 90 8c ori r3,r3,0x908c 8015c94: 28 64 00 00 lw r4,(r3+0) 8015c98: 28 41 00 00 lw r1,(r2+0) 8015c9c: 28 42 00 04 lw r2,(r2+4) 8015ca0: 34 03 00 00 mvi r3,0 8015ca4: f8 00 56 58 calli 802b604 <__divdi3> initialized = false; } #endif return status; } 8015ca8: 29 61 00 68 lw r1,(r11+104) * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; 8015cac: 29 63 00 74 lw r3,(r11+116) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8015cb0: 35 64 00 6c addi r4,r11,108 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 8015cb4: 44 24 00 0a be r1,r4,8015cdc <_Timer_server_Schedule_operation_method+0xf0> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 8015cb8: 28 25 00 10 lw r5,(r1+16) } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 8015cbc: b4 a3 20 00 add r4,r5,r3 delta_interval += delta; 8015cc0: c8 82 20 00 sub r4,r4,r2 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 8015cc4: 50 62 00 05 bgeu r3,r2,8015cd8 <_Timer_server_Schedule_operation_method+0xec> /* * We advanced in time. */ delta = snapshot - last_snapshot; 8015cc8: c8 43 18 00 sub r3,r2,r3 if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 8015ccc: 34 04 00 00 mvi r4,0 if ( snapshot > last_snapshot ) { /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { 8015cd0: 50 65 00 02 bgeu r3,r5,8015cd8 <_Timer_server_Schedule_operation_method+0xec><== NEVER TAKEN delta_interval -= delta; 8015cd4: c8 a3 20 00 sub r4,r5,r3 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 8015cd8: 58 24 00 10 sw (r1+16),r4 } ts->TOD_watchdogs.last_snapshot = snapshot; 8015cdc: 59 62 00 74 sw (r11+116),r2 _ISR_Enable( level ); 8015ce0: d0 0d 00 00 wcsr IE,r13 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 8015ce4: 35 61 00 68 addi r1,r11,104 8015ce8: 35 82 00 10 addi r2,r12,16 8015cec: f8 00 14 cd calli 801b020 <_Watchdog_Insert> if ( !ts->active ) { 8015cf0: 41 61 00 7c lbu r1,(r11+124) 8015cf4: 20 21 00 ff andi r1,r1,0xff 8015cf8: 5c 20 ff d8 bne r1,r0,8015c58 <_Timer_server_Schedule_operation_method+0x6c><== NEVER TAKEN _Timer_server_Reset_tod_system_watchdog( ts ); 8015cfc: b9 60 08 00 mv r1,r11 8015d00: fb ff ff 12 calli 8015948 <_Timer_server_Reset_tod_system_watchdog> } } _Thread_Enable_dispatch(); 8015d04: f8 00 10 71 calli 8019ec8 <_Thread_Enable_dispatch> 8015d08: e3 ff ff d5 bi 8015c5c <_Timer_server_Schedule_operation_method+0x70> if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8015d0c: 90 00 18 00 rcsr r3,IE 8015d10: 34 01 ff fe mvi r1,-2 8015d14: a0 61 08 00 and r1,r3,r1 8015d18: d0 01 00 00 wcsr IE,r1 snapshot = _Watchdog_Ticks_since_boot; 8015d1c: 78 01 08 03 mvhi r1,0x803 8015d20: 38 21 fe 38 ori r1,r1,0xfe38 initialized = false; } #endif return status; } 8015d24: 29 62 00 30 lw r2,(r11+48) /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = _Watchdog_Ticks_since_boot; 8015d28: 28 21 00 00 lw r1,(r1+0) last_snapshot = ts->Interval_watchdogs.last_snapshot; 8015d2c: 29 65 00 3c lw r5,(r11+60) 8015d30: 35 64 00 34 addi r4,r11,52 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 8015d34: 44 44 00 07 be r2,r4,8015d50 <_Timer_server_Schedule_operation_method+0x164> /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 8015d38: 28 46 00 10 lw r6,(r2+16) first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 8015d3c: c8 25 28 00 sub r5,r1,r5 delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 8015d40: 34 04 00 00 mvi r4,0 * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { 8015d44: 50 a6 00 02 bgeu r5,r6,8015d4c <_Timer_server_Schedule_operation_method+0x160> delta_interval -= delta; 8015d48: c8 c5 20 00 sub r4,r6,r5 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 8015d4c: 58 44 00 10 sw (r2+16),r4 } ts->Interval_watchdogs.last_snapshot = snapshot; 8015d50: 59 61 00 3c sw (r11+60),r1 _ISR_Enable( level ); 8015d54: d0 03 00 00 wcsr IE,r3 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8015d58: 35 61 00 30 addi r1,r11,48 8015d5c: 35 82 00 10 addi r2,r12,16 8015d60: f8 00 14 b0 calli 801b020 <_Watchdog_Insert> if ( !ts->active ) { 8015d64: 41 61 00 7c lbu r1,(r11+124) 8015d68: 20 21 00 ff andi r1,r1,0xff 8015d6c: 5c 20 ff bb bne r1,r0,8015c58 <_Timer_server_Schedule_operation_method+0x6c> _Timer_server_Reset_interval_system_watchdog( ts ); 8015d70: b9 60 08 00 mv r1,r11 8015d74: fb ff fe d4 calli 80158c4 <_Timer_server_Reset_interval_system_watchdog> if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 8015d78: f8 00 10 54 calli 8019ec8 <_Thread_Enable_dispatch> 8015d7c: e3 ff ff b8 bi 8015c5c <_Timer_server_Schedule_operation_method+0x70> =============================================================================== 08009290 <_Timespec_Add_to>: uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { 8009290: b8 20 20 00 mv r4,r1 uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; 8009294: 28 83 00 00 lw r3,(r4+0) uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { uint32_t seconds = add->tv_sec; 8009298: 28 41 00 00 lw r1,(r2+0) /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; 800929c: 28 86 00 04 lw r6,(r4+4) 80092a0: 28 42 00 04 lw r2,(r2+4) /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 80092a4: 78 07 08 01 mvhi r7,0x801 80092a8: 38 e7 8c 98 ori r7,r7,0x8c98 80092ac: 28 e5 00 00 lw r5,(r7+0) ) { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; 80092b0: b4 61 18 00 add r3,r3,r1 time->tv_nsec += add->tv_nsec; 80092b4: b4 46 10 00 add r2,r2,r6 ) { uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; 80092b8: 58 83 00 00 sw (r4+0),r3 time->tv_nsec += add->tv_nsec; 80092bc: 58 82 00 04 sw (r4+4),r2 /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 80092c0: 50 a2 00 0a bgeu r5,r2,80092e8 <_Timespec_Add_to+0x58> time->tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 80092c4: 78 07 08 01 mvhi r7,0x801 80092c8: 38 e7 8c 9c ori r7,r7,0x8c9c 80092cc: 28 e6 00 00 lw r6,(r7+0) 80092d0: b4 46 10 00 add r2,r2,r6 #include #include #include #include uint32_t _Timespec_Add_to( 80092d4: 34 63 00 01 addi r3,r3,1 /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { time->tv_nsec -= TOD_NANOSECONDS_PER_SECOND; time->tv_sec++; seconds++; 80092d8: 34 21 00 01 addi r1,r1,1 /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 80092dc: 54 45 ff fd bgu r2,r5,80092d0 <_Timespec_Add_to+0x40> <== NEVER TAKEN 80092e0: 58 82 00 04 sw (r4+4),r2 80092e4: 58 83 00 00 sw (r4+0),r3 time->tv_sec++; seconds++; } return seconds; } 80092e8: c3 a0 00 00 ret =============================================================================== 08007aec <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 8007aec: 37 9c ff f8 addi sp,sp,-8 8007af0: 5b 9d 00 04 sw (sp+4),ra uint32_t number_of_initial_extensions = 8007af4: 78 01 08 01 mvhi r1,0x801 8007af8: 38 21 d2 6c ori r1,r1,0xd26c 8007afc: 28 21 00 40 lw r1,(r1+64) rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 8007b00: 44 20 00 0b be r1,r0,8007b2c <_User_extensions_Handler_initialization+0x40><== NEVER TAKEN User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) 8007b04: b4 21 10 00 add r2,r1,r1 8007b08: b4 41 08 00 add r1,r2,r1 8007b0c: b4 21 08 00 add r1,r1,r1 8007b10: b4 21 08 00 add r1,r1,r1 uint32_t number_of_initial_extensions = rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( 8007b14: f8 00 01 50 calli 8008054 <_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 ); 8007b18: 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 }; 8007b1c: 5b 81 00 08 sw (sp+8),r1 _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 8007b20: 38 42 7a ac ori r2,r2,0x7aac 8007b24: 37 81 00 08 addi r1,sp,8 8007b28: fb ff ff b0 calli 80079e8 <_User_extensions_Iterate> } } 8007b2c: 2b 9d 00 04 lw ra,(sp+4) 8007b30: 37 9c 00 08 addi sp,sp,8 8007b34: c3 a0 00 00 ret =============================================================================== 080079e8 <_User_extensions_Iterate>: void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { 80079e8: 37 9c ff e8 addi sp,sp,-24 80079ec: 5b 8b 00 18 sw (sp+24),r11 80079f0: 5b 8c 00 14 sw (sp+20),r12 80079f4: 5b 8d 00 10 sw (sp+16),r13 80079f8: 5b 8e 00 0c sw (sp+12),r14 80079fc: 5b 8f 00 08 sw (sp+8),r15 8007a00: 5b 9d 00 04 sw (sp+4),ra Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = 8007a04: 78 04 08 01 mvhi r4,0x801 8007a08: 38 84 d2 6c ori r4,r4,0xd26c rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); 8007a0c: 28 83 00 40 lw r3,(r4+64) void *arg, User_extensions_Visitor visitor ) { Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = 8007a10: 28 8b 00 44 lw r11,(r4+68) void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { Thread_Control *executing = _Thread_Executing; 8007a14: 78 04 08 02 mvhi r4,0x802 const User_extensions_Table *callouts_current = rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); 8007a18: b4 63 18 00 add r3,r3,r3 8007a1c: b4 63 18 00 add r3,r3,r3 8007a20: b4 63 18 00 add r3,r3,r3 8007a24: b4 63 18 00 add r3,r3,r3 8007a28: b4 63 18 00 add r3,r3,r3 void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { Thread_Control *executing = _Thread_Executing; 8007a2c: 38 84 0d e0 ori r4,r4,0xde0 const User_extensions_Table *callouts_current = rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = 8007a30: b5 63 78 00 add r15,r11,r3 void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { 8007a34: b8 20 68 00 mv r13,r1 8007a38: b8 40 70 00 mv r14,r2 Thread_Control *executing = _Thread_Executing; 8007a3c: 28 8c 00 10 lw r12,(r4+16) const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { 8007a40: 45 6f 00 07 be r11,r15,8007a5c <_User_extensions_Iterate+0x74><== NEVER TAKEN (*visitor)( executing, arg, callouts_current ); 8007a44: b9 60 18 00 mv r3,r11 8007a48: b9 80 08 00 mv r1,r12 ++callouts_current; 8007a4c: 35 6b 00 20 addi r11,r11,32 callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { (*visitor)( executing, arg, callouts_current ); 8007a50: b9 a0 10 00 mv r2,r13 8007a54: d9 c0 00 00 call r14 const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { 8007a58: 5d eb ff fb bne r15,r11,8007a44 <_User_extensions_Iterate+0x5c> (*visitor)( executing, arg, &extension->Callouts ); node = _Chain_Immutable_next( node ); } } 8007a5c: 78 01 08 02 mvhi r1,0x802 8007a60: 38 21 01 94 ori r1,r1,0x194 8007a64: 28 2b 00 00 lw r11,(r1+0) ++callouts_current; } node = _Chain_Immutable_first( &_User_extensions_List ); tail = _Chain_Immutable_tail( &_User_extensions_List ); while ( node != tail ) { 8007a68: 78 0f 08 02 mvhi r15,0x802 8007a6c: 39 ef 01 98 ori r15,r15,0x198 8007a70: 45 6f 00 07 be r11,r15,8007a8c <_User_extensions_Iterate+0xa4> const User_extensions_Control *extension = (const User_extensions_Control *) node; (*visitor)( executing, arg, &extension->Callouts ); 8007a74: 35 63 00 14 addi r3,r11,20 8007a78: b9 80 08 00 mv r1,r12 8007a7c: b9 a0 10 00 mv r2,r13 8007a80: d9 c0 00 00 call r14 node = _Chain_Immutable_next( node ); } } 8007a84: 29 6b 00 00 lw r11,(r11+0) ++callouts_current; } node = _Chain_Immutable_first( &_User_extensions_List ); tail = _Chain_Immutable_tail( &_User_extensions_List ); while ( node != tail ) { 8007a88: 5d 6f ff fb bne r11,r15,8007a74 <_User_extensions_Iterate+0x8c> (*visitor)( executing, arg, &extension->Callouts ); node = _Chain_Immutable_next( node ); } } 8007a8c: 2b 9d 00 04 lw ra,(sp+4) 8007a90: 2b 8b 00 18 lw r11,(sp+24) 8007a94: 2b 8c 00 14 lw r12,(sp+20) 8007a98: 2b 8d 00 10 lw r13,(sp+16) 8007a9c: 2b 8e 00 0c lw r14,(sp+12) 8007aa0: 2b 8f 00 08 lw r15,(sp+8) 8007aa4: 37 9c 00 18 addi sp,sp,24 8007aa8: c3 a0 00 00 ret =============================================================================== 08009a64 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 8009a64: 37 9c ff e4 addi sp,sp,-28 8009a68: 5b 8b 00 1c sw (sp+28),r11 8009a6c: 5b 8c 00 18 sw (sp+24),r12 8009a70: 5b 8d 00 14 sw (sp+20),r13 8009a74: 5b 8e 00 10 sw (sp+16),r14 8009a78: 5b 8f 00 0c sw (sp+12),r15 8009a7c: 5b 90 00 08 sw (sp+8),r16 8009a80: 5b 9d 00 04 sw (sp+4),ra 8009a84: b8 20 60 00 mv r12,r1 8009a88: b8 60 58 00 mv r11,r3 ISR_Level level; _ISR_Disable( level ); 8009a8c: 90 00 18 00 rcsr r3,IE 8009a90: 34 01 ff fe mvi r1,-2 8009a94: a0 61 08 00 and r1,r3,r1 8009a98: d0 01 00 00 wcsr IE,r1 } } _ISR_Enable( level ); } 8009a9c: 29 81 00 00 lw r1,(r12+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8009aa0: 35 8e 00 04 addi r14,r12,4 Watchdog_Interval units ) { ISR_Level level; _ISR_Disable( level ); 8009aa4: b8 60 20 00 mv r4,r3 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 8009aa8: 44 2e 00 04 be r1,r14,8009ab8 <_Watchdog_Adjust+0x54> switch ( direction ) { 8009aac: 44 40 00 11 be r2,r0,8009af0 <_Watchdog_Adjust+0x8c> 8009ab0: 34 03 00 01 mvi r3,1 8009ab4: 44 43 00 0b be r2,r3,8009ae0 <_Watchdog_Adjust+0x7c> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 8009ab8: d0 04 00 00 wcsr IE,r4 } 8009abc: 2b 9d 00 04 lw ra,(sp+4) 8009ac0: 2b 8b 00 1c lw r11,(sp+28) 8009ac4: 2b 8c 00 18 lw r12,(sp+24) 8009ac8: 2b 8d 00 14 lw r13,(sp+20) 8009acc: 2b 8e 00 10 lw r14,(sp+16) 8009ad0: 2b 8f 00 0c lw r15,(sp+12) 8009ad4: 2b 90 00 08 lw r16,(sp+8) 8009ad8: 37 9c 00 1c addi sp,sp,28 8009adc: c3 a0 00 00 ret * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 8009ae0: 28 22 00 10 lw r2,(r1+16) 8009ae4: b4 4b 58 00 add r11,r2,r11 8009ae8: 58 2b 00 10 sw (r1+16),r11 break; 8009aec: e3 ff ff f3 bi 8009ab8 <_Watchdog_Adjust+0x54> case WATCHDOG_FORWARD: while ( units ) { 8009af0: b8 60 20 00 mv r4,r3 8009af4: 45 62 ff f1 be r11,r2,8009ab8 <_Watchdog_Adjust+0x54> <== NEVER TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 8009af8: 28 2d 00 10 lw r13,(r1+16) 8009afc: 55 ab 00 13 bgu r13,r11,8009b48 <_Watchdog_Adjust+0xe4> <== NEVER TAKEN _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 8009b00: 34 10 00 01 mvi r16,1 _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8009b04: 34 0f ff fe mvi r15,-2 if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 8009b08: 58 30 00 10 sw (r1+16),r16 _ISR_Enable( level ); 8009b0c: d0 03 00 00 wcsr IE,r3 _Watchdog_Tickle( header ); 8009b10: b9 80 08 00 mv r1,r12 8009b14: f8 00 00 ad calli 8009dc8 <_Watchdog_Tickle> _ISR_Disable( level ); 8009b18: 90 00 10 00 rcsr r2,IE 8009b1c: a0 4f 08 00 and r1,r2,r15 8009b20: d0 01 00 00 wcsr IE,r1 } } _ISR_Enable( level ); } 8009b24: 29 84 00 00 lw r4,(r12+0) while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 8009b28: c9 6d 58 00 sub r11,r11,r13 _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8009b2c: b8 40 18 00 mv r3,r2 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) _Chain_First( header ) ); 8009b30: b8 80 08 00 mv r1,r4 if ( _Chain_Is_empty( header ) ) 8009b34: 45 c4 00 08 be r14,r4,8009b54 <_Watchdog_Adjust+0xf0> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 8009b38: 45 60 00 07 be r11,r0,8009b54 <_Watchdog_Adjust+0xf0> <== NEVER TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 8009b3c: 28 2d 00 10 lw r13,(r1+16) 8009b40: 51 6d ff f2 bgeu r11,r13,8009b08 <_Watchdog_Adjust+0xa4> _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8009b44: b8 40 20 00 mv r4,r2 _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; 8009b48: c9 ab 58 00 sub r11,r13,r11 8009b4c: 58 2b 00 10 sw (r1+16),r11 break; 8009b50: e3 ff ff da bi 8009ab8 <_Watchdog_Adjust+0x54> _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 8009b54: b8 40 20 00 mv r4,r2 8009b58: e3 ff ff d8 bi 8009ab8 <_Watchdog_Adjust+0x54> =============================================================================== 08007b38 <_Watchdog_Insert>: void _Watchdog_Insert( Chain_Control *header, Watchdog_Control *the_watchdog ) { 8007b38: 37 9c ff f8 addi sp,sp,-8 8007b3c: 5b 8b 00 08 sw (sp+8),r11 8007b40: 5b 8c 00 04 sw (sp+4),r12 Watchdog_Control *after; uint32_t insert_isr_nest_level; Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; 8007b44: 78 03 08 02 mvhi r3,0x802 8007b48: 38 63 0d e0 ori r3,r3,0xde0 8007b4c: 28 69 00 08 lw r9,(r3+8) _ISR_Disable( level ); 8007b50: 90 00 30 00 rcsr r6,IE 8007b54: 34 08 ff fe mvi r8,-2 8007b58: a0 c8 40 00 and r8,r6,r8 8007b5c: d0 08 00 00 wcsr IE,r8 /* * Check to see if the watchdog has just been inserted by a * higher priority interrupt. If so, abandon this insert. */ if ( the_watchdog->state != WATCHDOG_INACTIVE ) { 8007b60: 28 43 00 08 lw r3,(r2+8) 8007b64: 5c 60 00 32 bne r3,r0,8007c2c <_Watchdog_Insert+0xf4> _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; 8007b68: 78 0c 08 02 mvhi r12,0x802 8007b6c: 39 8c 0a 3c ori r12,r12,0xa3c 8007b70: 29 83 00 00 lw r3,(r12+0) 8007b74: 78 07 08 02 mvhi r7,0x802 if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 8007b78: 34 04 00 01 mvi r4,1 _Watchdog_Sync_count++; 8007b7c: 34 63 00 01 addi r3,r3,1 if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 8007b80: 58 44 00 08 sw (r2+8),r4 _Watchdog_Sync_count++; 8007b84: 59 83 00 00 sw (r12+0),r3 8007b88: 38 e7 09 dc ori r7,r7,0x9dc delta_interval -= after->delta_interval; _ISR_Flash( level ); if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8007b8c: 34 0a 00 01 mvi r10,1 the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; restart: delta_interval = the_watchdog->initial; 8007b90: 28 44 00 0c lw r4,(r2+12) RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) _Chain_First( header ) ); 8007b94: 28 23 00 00 lw r3,(r1+0) for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 8007b98: 44 80 00 14 be r4,r0,8007be8 <_Watchdog_Insert+0xb0> 8007b9c: 28 65 00 00 lw r5,(r3+0) 8007ba0: 44 a0 00 12 be r5,r0,8007be8 <_Watchdog_Insert+0xb0> break; if ( delta_interval < after->delta_interval ) { 8007ba4: 28 65 00 10 lw r5,(r3+16) 8007ba8: 54 a4 00 0e bgu r5,r4,8007be0 <_Watchdog_Insert+0xa8> break; } delta_interval -= after->delta_interval; _ISR_Flash( level ); 8007bac: d0 06 00 00 wcsr IE,r6 8007bb0: d0 08 00 00 wcsr IE,r8 if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8007bb4: 28 4b 00 08 lw r11,(r2+8) 8007bb8: 5d 6a 00 19 bne r11,r10,8007c1c <_Watchdog_Insert+0xe4> goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 8007bbc: 28 eb 00 00 lw r11,(r7+0) 8007bc0: 55 69 00 28 bgu r11,r9,8007c60 <_Watchdog_Insert+0x128> if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 8007bc4: c8 85 20 00 sub r4,r4,r5 exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; _Watchdog_Sync_count--; _ISR_Enable( level ); } 8007bc8: 28 63 00 00 lw r3,(r3+0) for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 8007bcc: 44 80 00 07 be r4,r0,8007be8 <_Watchdog_Insert+0xb0> 8007bd0: 28 65 00 00 lw r5,(r3+0) 8007bd4: 44 a0 00 05 be r5,r0,8007be8 <_Watchdog_Insert+0xb0> break; if ( delta_interval < after->delta_interval ) { 8007bd8: 28 65 00 10 lw r5,(r3+16) 8007bdc: 50 85 00 19 bgeu r4,r5,8007c40 <_Watchdog_Insert+0x108> after->delta_interval -= delta_interval; 8007be0: c8 a4 28 00 sub r5,r5,r4 8007be4: 58 65 00 10 sw (r3+16),r5 _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); 8007be8: 28 63 00 04 lw r3,(r3+4) the_watchdog->start_time = _Watchdog_Ticks_since_boot; 8007bec: 78 01 08 02 mvhi r1,0x802 8007bf0: 38 21 0a 40 ori r1,r1,0xa40 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 8007bf4: 28 65 00 00 lw r5,(r3+0) 8007bf8: 28 28 00 00 lw r8,(r1+0) RTEMS_INLINE_ROUTINE void _Watchdog_Activate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_ACTIVE; 8007bfc: 34 01 00 02 mvi r1,2 8007c00: 58 41 00 08 sw (r2+8),r1 } } _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; 8007c04: 58 44 00 10 sw (r2+16),r4 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 8007c08: 58 43 00 04 sw (r2+4),r3 before_node = after_node->next; after_node->next = the_node; 8007c0c: 58 62 00 00 sw (r3+0),r2 the_node->next = before_node; before_node->previous = the_node; 8007c10: 58 a2 00 04 sw (r5+4),r2 Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 8007c14: 58 45 00 00 sw (r2+0),r5 _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); the_watchdog->start_time = _Watchdog_Ticks_since_boot; 8007c18: 58 48 00 14 sw (r2+20),r8 exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; 8007c1c: 58 e9 00 00 sw (r7+0),r9 _Watchdog_Sync_count--; 8007c20: 29 81 00 00 lw r1,(r12+0) 8007c24: 34 21 ff ff addi r1,r1,-1 8007c28: 59 81 00 00 sw (r12+0),r1 _ISR_Enable( level ); 8007c2c: d0 06 00 00 wcsr IE,r6 } 8007c30: 2b 8b 00 08 lw r11,(sp+8) 8007c34: 2b 8c 00 04 lw r12,(sp+4) 8007c38: 37 9c 00 08 addi sp,sp,8 8007c3c: c3 a0 00 00 ret break; } delta_interval -= after->delta_interval; _ISR_Flash( level ); 8007c40: d0 06 00 00 wcsr IE,r6 8007c44: d0 08 00 00 wcsr IE,r8 if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8007c48: 28 4b 00 08 lw r11,(r2+8) if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 8007c4c: c8 85 20 00 sub r4,r4,r5 _ISR_Flash( level ); if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 8007c50: 5d 6a ff f3 bne r11,r10,8007c1c <_Watchdog_Insert+0xe4> <== NEVER TAKEN goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 8007c54: 28 e5 00 00 lw r5,(r7+0) 8007c58: 54 a9 00 02 bgu r5,r9,8007c60 <_Watchdog_Insert+0x128> <== NEVER TAKEN 8007c5c: e3 ff ff db bi 8007bc8 <_Watchdog_Insert+0x90> _Watchdog_Sync_level = insert_isr_nest_level; 8007c60: 58 e9 00 00 sw (r7+0),r9 goto restart; 8007c64: e3 ff ff cb bi 8007b90 <_Watchdog_Insert+0x58> =============================================================================== 08007cd0 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 8007cd0: 90 00 20 00 rcsr r4,IE 8007cd4: 34 02 ff fe mvi r2,-2 8007cd8: a0 82 10 00 and r2,r4,r2 8007cdc: d0 02 00 00 wcsr IE,r2 previous_state = the_watchdog->state; 8007ce0: 28 22 00 08 lw r2,(r1+8) switch ( previous_state ) { 8007ce4: 34 03 00 01 mvi r3,1 8007ce8: 44 43 00 27 be r2,r3,8007d84 <_Watchdog_Remove+0xb4> 8007cec: 5c 40 00 08 bne r2,r0,8007d0c <_Watchdog_Remove+0x3c> _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8007cf0: 78 03 08 02 mvhi r3,0x802 8007cf4: 38 63 0a 40 ori r3,r3,0xa40 8007cf8: 28 63 00 00 lw r3,(r3+0) 8007cfc: 58 23 00 18 sw (r1+24),r3 _ISR_Enable( level ); 8007d00: d0 04 00 00 wcsr IE,r4 return( previous_state ); } 8007d04: b8 40 08 00 mv r1,r2 8007d08: c3 a0 00 00 ret Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); previous_state = the_watchdog->state; switch ( previous_state ) { 8007d0c: 34 03 00 03 mvi r3,3 8007d10: 54 43 ff f8 bgu r2,r3,8007cf0 <_Watchdog_Remove+0x20> <== NEVER TAKEN } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 8007d14: 28 23 00 00 lw r3,(r1+0) break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 8007d18: 58 20 00 08 sw (r1+8),r0 next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 8007d1c: 28 65 00 00 lw r5,(r3+0) 8007d20: 44 a0 00 05 be r5,r0,8007d34 <_Watchdog_Remove+0x64> next_watchdog->delta_interval += the_watchdog->delta_interval; 8007d24: 28 66 00 10 lw r6,(r3+16) 8007d28: 28 25 00 10 lw r5,(r1+16) 8007d2c: b4 c5 28 00 add r5,r6,r5 8007d30: 58 65 00 10 sw (r3+16),r5 if ( _Watchdog_Sync_count ) 8007d34: 78 05 08 02 mvhi r5,0x802 8007d38: 38 a5 0a 3c ori r5,r5,0xa3c 8007d3c: 28 a5 00 00 lw r5,(r5+0) 8007d40: 44 a0 00 07 be r5,r0,8007d5c <_Watchdog_Remove+0x8c> _Watchdog_Sync_level = _ISR_Nest_level; 8007d44: 78 05 08 02 mvhi r5,0x802 8007d48: 38 a5 0d e0 ori r5,r5,0xde0 8007d4c: 28 a6 00 08 lw r6,(r5+8) 8007d50: 78 05 08 02 mvhi r5,0x802 8007d54: 38 a5 09 dc ori r5,r5,0x9dc 8007d58: 58 a6 00 00 sw (r5+0),r6 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 8007d5c: 28 25 00 04 lw r5,(r1+4) next->previous = previous; 8007d60: 58 65 00 04 sw (r3+4),r5 previous->next = next; 8007d64: 58 a3 00 00 sw (r5+0),r3 _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8007d68: 78 03 08 02 mvhi r3,0x802 8007d6c: 38 63 0a 40 ori r3,r3,0xa40 8007d70: 28 63 00 00 lw r3,(r3+0) 8007d74: 58 23 00 18 sw (r1+24),r3 _ISR_Enable( level ); 8007d78: d0 04 00 00 wcsr IE,r4 return( previous_state ); } 8007d7c: b8 40 08 00 mv r1,r2 8007d80: c3 a0 00 00 ret _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8007d84: 78 03 08 02 mvhi r3,0x802 8007d88: 38 63 0a 40 ori r3,r3,0xa40 8007d8c: 28 63 00 00 lw r3,(r3+0) /* * It is not actually on the chain so just change the state and * the Insert operation we interrupted will be aborted. */ the_watchdog->state = WATCHDOG_INACTIVE; 8007d90: 58 20 00 08 sw (r1+8),r0 _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8007d94: 58 23 00 18 sw (r1+24),r3 _ISR_Enable( level ); 8007d98: d0 04 00 00 wcsr IE,r4 return( previous_state ); } 8007d9c: b8 40 08 00 mv r1,r2 8007da0: c3 a0 00 00 ret =============================================================================== 080095ec <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 80095ec: 37 9c ff ec addi sp,sp,-20 80095f0: 5b 8b 00 14 sw (sp+20),r11 80095f4: 5b 8c 00 10 sw (sp+16),r12 80095f8: 5b 8d 00 0c sw (sp+12),r13 80095fc: 5b 8e 00 08 sw (sp+8),r14 8009600: 5b 9d 00 04 sw (sp+4),ra 8009604: b8 20 70 00 mv r14,r1 8009608: b8 40 60 00 mv r12,r2 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 800960c: 90 00 68 00 rcsr r13,IE 8009610: 34 01 ff fe mvi r1,-2 8009614: a1 a1 08 00 and r1,r13,r1 8009618: d0 01 00 00 wcsr IE,r1 printk( "Watchdog Chain: %s %p\n", name, header ); 800961c: 78 01 08 02 mvhi r1,0x802 8009620: b9 80 18 00 mv r3,r12 8009624: 38 21 00 2c ori r1,r1,0x2c 8009628: b9 c0 10 00 mv r2,r14 800962c: fb ff e6 cd calli 8003160 printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); } 8009630: 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 ); 8009634: 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 ) ) { 8009638: 45 6c 00 12 be r11,r12,8009680 <_Watchdog_Report_chain+0x94> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 800963c: b9 60 10 00 mv r2,r11 8009640: 34 01 00 00 mvi r1,0 8009644: f8 00 00 13 calli 8009690 <_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 ) 8009648: 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 ) ; 800964c: 5d 6c ff fc bne r11,r12,800963c <_Watchdog_Report_chain+0x50><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 8009650: 78 01 08 02 mvhi r1,0x802 8009654: 38 21 00 44 ori r1,r1,0x44 8009658: b9 c0 10 00 mv r2,r14 800965c: fb ff e6 c1 calli 8003160 } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); 8009660: d0 0d 00 00 wcsr IE,r13 } 8009664: 2b 9d 00 04 lw ra,(sp+4) 8009668: 2b 8b 00 14 lw r11,(sp+20) 800966c: 2b 8c 00 10 lw r12,(sp+16) 8009670: 2b 8d 00 0c lw r13,(sp+12) 8009674: 2b 8e 00 08 lw r14,(sp+8) 8009678: 37 9c 00 14 addi sp,sp,20 800967c: c3 a0 00 00 ret _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 8009680: 78 01 08 02 mvhi r1,0x802 8009684: 38 21 00 54 ori r1,r1,0x54 8009688: fb ff e6 b6 calli 8003160 800968c: e3 ff ff f5 bi 8009660 <_Watchdog_Report_chain+0x74> =============================================================================== 08007da4 <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 8007da4: 37 9c ff e4 addi sp,sp,-28 8007da8: 5b 8b 00 1c sw (sp+28),r11 8007dac: 5b 8c 00 18 sw (sp+24),r12 8007db0: 5b 8d 00 14 sw (sp+20),r13 8007db4: 5b 8e 00 10 sw (sp+16),r14 8007db8: 5b 8f 00 0c sw (sp+12),r15 8007dbc: 5b 90 00 08 sw (sp+8),r16 8007dc0: 5b 9d 00 04 sw (sp+4),ra 8007dc4: 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 ); 8007dc8: 90 00 68 00 rcsr r13,IE 8007dcc: 34 01 ff fe mvi r1,-2 8007dd0: a1 a1 08 00 and r1,r13,r1 8007dd4: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 8007dd8: 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 ); 8007ddc: 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 ); 8007de0: b9 a0 10 00 mv r2,r13 if ( _Chain_Is_empty( header ) ) 8007de4: 45 6e 00 1e be r11,r14,8007e5c <_Watchdog_Tickle+0xb8> * to be inserted has already had its delta_interval adjusted to 0, and * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { 8007de8: 29 61 00 10 lw r1,(r11+16) 8007dec: 5c 20 00 26 bne r1,r0,8007e84 <_Watchdog_Tickle+0xe0> <== ALWAYS TAKEN do { watchdog_state = _Watchdog_Remove( the_watchdog ); _ISR_Enable( level ); switch( watchdog_state ) { 8007df0: 34 10 00 02 mvi r16,2 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8007df4: 34 0f ff fe mvi r15,-2 8007df8: e0 00 00 0a bi 8007e20 <_Watchdog_Tickle+0x7c> 8007dfc: 90 00 10 00 rcsr r2,IE <== NOT EXECUTED 8007e00: a0 4f 08 00 and r1,r2,r15 <== NOT EXECUTED 8007e04: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 8007e08: 29 81 00 00 lw r1,(r12+0) <== NOT EXECUTED case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8007e0c: b8 40 68 00 mv r13,r2 <== NOT EXECUTED RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) _Chain_First( header ) ); 8007e10: b8 20 58 00 mv r11,r1 <== NOT EXECUTED the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 8007e14: 44 2e 00 12 be r1,r14,8007e5c <_Watchdog_Tickle+0xb8> <== NOT EXECUTED } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 8007e18: 28 21 00 10 lw r1,(r1+16) 8007e1c: 5c 20 00 10 bne r1,r0,8007e5c <_Watchdog_Tickle+0xb8> if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 8007e20: b9 60 08 00 mv r1,r11 8007e24: fb ff ff ab calli 8007cd0 <_Watchdog_Remove> _ISR_Enable( level ); 8007e28: d0 0d 00 00 wcsr IE,r13 switch( watchdog_state ) { 8007e2c: 5c 30 ff f4 bne r1,r16,8007dfc <_Watchdog_Tickle+0x58> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 8007e30: 29 63 00 1c lw r3,(r11+28) 8007e34: 29 61 00 20 lw r1,(r11+32) 8007e38: 29 62 00 24 lw r2,(r11+36) 8007e3c: d8 60 00 00 call r3 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8007e40: 90 00 10 00 rcsr r2,IE 8007e44: a0 4f 08 00 and r1,r2,r15 8007e48: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 8007e4c: 29 81 00 00 lw r1,(r12+0) case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 8007e50: b8 40 68 00 mv r13,r2 8007e54: b8 20 58 00 mv r11,r1 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 8007e58: 5c 2e ff f0 bne r1,r14,8007e18 <_Watchdog_Tickle+0x74> leave: _ISR_Enable(level); 8007e5c: d0 02 00 00 wcsr IE,r2 } 8007e60: 2b 9d 00 04 lw ra,(sp+4) 8007e64: 2b 8b 00 1c lw r11,(sp+28) 8007e68: 2b 8c 00 18 lw r12,(sp+24) 8007e6c: 2b 8d 00 14 lw r13,(sp+20) 8007e70: 2b 8e 00 10 lw r14,(sp+16) 8007e74: 2b 8f 00 0c lw r15,(sp+12) 8007e78: 2b 90 00 08 lw r16,(sp+8) 8007e7c: 37 9c 00 1c addi sp,sp,28 8007e80: c3 a0 00 00 ret * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { the_watchdog->delta_interval--; 8007e84: 34 21 ff ff addi r1,r1,-1 8007e88: 59 61 00 10 sw (r11+16),r1 if ( the_watchdog->delta_interval != 0 ) 8007e8c: 44 20 ff d9 be r1,r0,8007df0 <_Watchdog_Tickle+0x4c> 8007e90: e3 ff ff f3 bi 8007e5c <_Watchdog_Tickle+0xb8> =============================================================================== 08007e94 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8007e94: 37 9c ff d0 addi sp,sp,-48 8007e98: 5b 8b 00 30 sw (sp+48),r11 8007e9c: 5b 8c 00 2c sw (sp+44),r12 8007ea0: 5b 8d 00 28 sw (sp+40),r13 8007ea4: 5b 8e 00 24 sw (sp+36),r14 8007ea8: 5b 8f 00 20 sw (sp+32),r15 8007eac: 5b 90 00 1c sw (sp+28),r16 8007eb0: 5b 91 00 18 sw (sp+24),r17 8007eb4: 5b 92 00 14 sw (sp+20),r18 8007eb8: 5b 93 00 10 sw (sp+16),r19 8007ebc: 5b 94 00 0c sw (sp+12),r20 8007ec0: 5b 95 00 08 sw (sp+8),r21 8007ec4: 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(); 8007ec8: 78 04 08 01 mvhi r4,0x801 8007ecc: 38 84 d2 6c ori r4,r4,0xd26c 8007ed0: 40 85 00 32 lbu r5,(r4+50) void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 8007ed4: b8 40 80 00 mv r16,r2 8007ed8: b8 60 a0 00 mv r20,r3 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 8007edc: 28 8e 00 00 lw r14,(r4+0) 8007ee0: 34 02 00 00 mvi r2,0 8007ee4: 5c a0 00 02 bne r5,r0,8007eec <_Workspace_Handler_initialization+0x58> 8007ee8: 28 82 00 04 lw r2,(r4+4) 8007eec: b4 4e 70 00 add r14,r2,r14 bool do_zero = rtems_configuration_get_do_zero_of_workspace(); 8007ef0: 40 92 00 30 lbu r18,(r4+48) bool unified = rtems_configuration_get_unified_work_area(); 8007ef4: 40 95 00 31 lbu r21,(r4+49) uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 8007ef8: 46 00 00 21 be r16,r0,8007f7c <_Workspace_Handler_initialization+0xe8><== NEVER TAKEN Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 8007efc: 78 0f 08 00 mvhi r15,0x800 } else { size = 0; } } space_available = (*init_or_extend)( 8007f00: 78 11 08 02 mvhi r17,0x802 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) { 8007f04: b8 20 58 00 mv r11,r1 8007f08: 34 0d 00 00 mvi r13,0 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 8007f0c: 39 ef 51 d8 ori r15,r15,0x51d8 if ( do_zero ) { memset( area->begin, 0, area->size ); } if ( area->size > overhead ) { 8007f10: 34 13 00 0e mvi r19,14 } else { size = 0; } } space_available = (*init_or_extend)( 8007f14: 3a 31 09 68 ori r17,r17,0x968 size_t i; for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { 8007f18: 5e 40 00 28 bne r18,r0,8007fb8 <_Workspace_Handler_initialization+0x124> memset( area->begin, 0, area->size ); } if ( area->size > overhead ) { 8007f1c: 29 6c 00 04 lw r12,(r11+4) 8007f20: 52 6c 00 14 bgeu r19,r12,8007f70 <_Workspace_Handler_initialization+0xdc> uintptr_t space_available; uintptr_t size; if ( unified ) { 8007f24: 5e a0 00 05 bne r21,r0,8007f38 <_Workspace_Handler_initialization+0xa4> size = area->size; } else { if ( remaining > 0 ) { 8007f28: 45 d5 00 29 be r14,r21,8007fcc <_Workspace_Handler_initialization+0x138><== NEVER TAKEN size = remaining < area->size - overhead ? 8007f2c: 35 81 ff f2 addi r1,r12,-14 remaining + overhead : area->size; 8007f30: 51 c1 00 02 bgeu r14,r1,8007f38 <_Workspace_Handler_initialization+0xa4><== NEVER TAKEN 8007f34: 35 cc 00 0e addi r12,r14,14 } else { size = 0; } } space_available = (*init_or_extend)( 8007f38: 29 62 00 00 lw r2,(r11+0) 8007f3c: b9 80 18 00 mv r3,r12 8007f40: ba 20 08 00 mv r1,r17 8007f44: 34 04 00 04 mvi r4,4 8007f48: d9 e0 00 00 call r15 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 8007f4c: 29 62 00 00 lw r2,(r11+0) area->size -= size; 8007f50: 29 63 00 04 lw r3,(r11+4) area->begin, size, page_size ); area->begin = (char *) area->begin + size; 8007f54: b4 4c 10 00 add r2,r2,r12 area->size -= size; 8007f58: c8 6c 60 00 sub r12,r3,r12 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 8007f5c: 59 62 00 00 sw (r11+0),r2 area->size -= size; 8007f60: 59 6c 00 04 sw (r11+4),r12 if ( space_available < remaining ) { 8007f64: 50 2e 00 21 bgeu r1,r14,8007fe8 <_Workspace_Handler_initialization+0x154><== ALWAYS TAKEN remaining -= space_available; 8007f68: c9 c1 70 00 sub r14,r14,r1 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 8007f6c: ba 80 78 00 mv r15,r20 <== NOT EXECUTED bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 8007f70: 35 ad 00 01 addi r13,r13,1 8007f74: 35 6b 00 08 addi r11,r11,8 8007f78: 56 0d ff e8 bgu r16,r13,8007f18 <_Workspace_Handler_initialization+0x84><== NEVER TAKEN init_or_extend = extend; } } if ( remaining > 0 ) { 8007f7c: 5d c0 00 1e bne r14,r0,8007ff4 <_Workspace_Handler_initialization+0x160> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } } 8007f80: 2b 9d 00 04 lw ra,(sp+4) 8007f84: 2b 8b 00 30 lw r11,(sp+48) 8007f88: 2b 8c 00 2c lw r12,(sp+44) 8007f8c: 2b 8d 00 28 lw r13,(sp+40) 8007f90: 2b 8e 00 24 lw r14,(sp+36) 8007f94: 2b 8f 00 20 lw r15,(sp+32) 8007f98: 2b 90 00 1c lw r16,(sp+28) 8007f9c: 2b 91 00 18 lw r17,(sp+24) 8007fa0: 2b 92 00 14 lw r18,(sp+20) 8007fa4: 2b 93 00 10 lw r19,(sp+16) 8007fa8: 2b 94 00 0c lw r20,(sp+12) 8007fac: 2b 95 00 08 lw r21,(sp+8) 8007fb0: 37 9c 00 30 addi sp,sp,48 8007fb4: c3 a0 00 00 ret for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { memset( area->begin, 0, area->size ); 8007fb8: 29 61 00 00 lw r1,(r11+0) 8007fbc: 29 63 00 04 lw r3,(r11+4) 8007fc0: 34 02 00 00 mvi r2,0 8007fc4: f8 00 17 e7 calli 800df60 8007fc8: e3 ff ff d5 bi 8007f1c <_Workspace_Handler_initialization+0x88> } else { size = 0; } } space_available = (*init_or_extend)( 8007fcc: 29 62 00 00 lw r2,(r11+0) <== NOT EXECUTED 8007fd0: ba 20 08 00 mv r1,r17 <== NOT EXECUTED 8007fd4: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 8007fd8: 34 04 00 04 mvi r4,4 <== NOT EXECUTED 8007fdc: d9 e0 00 00 call r15 <== NOT EXECUTED remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 8007fe0: ba 80 78 00 mv r15,r20 <== NOT EXECUTED 8007fe4: e3 ff ff e3 bi 8007f70 <_Workspace_Handler_initialization+0xdc><== NOT EXECUTED 8007fe8: ba 80 78 00 mv r15,r20 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 8007fec: 34 0e 00 00 mvi r14,0 8007ff0: e3 ff ff e0 bi 8007f70 <_Workspace_Handler_initialization+0xdc> init_or_extend = extend; } } if ( remaining > 0 ) { _Internal_error_Occurred( 8007ff4: 34 01 00 00 mvi r1,0 8007ff8: 34 02 00 01 mvi r2,1 8007ffc: 34 03 00 02 mvi r3,2 8008000: fb ff f5 27 calli 800549c <_Internal_error_Occurred> =============================================================================== 08010f04 <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 8010f04: 37 9c ff dc addi sp,sp,-36 8010f08: 5b 8b 00 20 sw (sp+32),r11 8010f0c: 5b 8c 00 1c sw (sp+28),r12 8010f10: 5b 8d 00 18 sw (sp+24),r13 8010f14: 5b 8e 00 14 sw (sp+20),r14 8010f18: 5b 8f 00 10 sw (sp+16),r15 8010f1c: 5b 90 00 0c sw (sp+12),r16 8010f20: 5b 91 00 08 sw (sp+8),r17 8010f24: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; ssize_t cmpltd = 0; 8010f28: 34 0d 00 00 mvi r13,0 uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 8010f2c: b8 80 60 00 mv r12,r4 8010f30: b8 20 80 00 mv r16,r1 8010f34: b8 a0 88 00 mv r17,r5 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 8010f38: 44 80 00 19 be r4,r0,8010f9c <_fat_block_read+0x98> <== NEVER TAKEN 8010f3c: b8 60 78 00 mv r15,r3 8010f40: b8 40 70 00 mv r14,r2 8010f44: e0 00 00 0f bi 8010f80 <_fat_block_read+0x7c> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 8010f48: 2e 0b 00 00 lhu r11,(r16+0) memcpy((buff + cmpltd), (sec_buf + ofs), c); 8010f4c: 2b 82 00 24 lw r2,(sp+36) 8010f50: b6 2d 08 00 add r1,r17,r13 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 8010f54: c9 6f 58 00 sub r11,r11,r15 memcpy((buff + cmpltd), (sec_buf + ofs), c); 8010f58: b4 4f 10 00 add r2,r2,r15 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 8010f5c: 51 8b 00 02 bgeu r12,r11,8010f64 <_fat_block_read+0x60> 8010f60: b9 80 58 00 mv r11,r12 memcpy((buff + cmpltd), (sec_buf + ofs), c); 8010f64: b9 60 18 00 mv r3,r11 count -= c; 8010f68: c9 8b 60 00 sub r12,r12,r11 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); 8010f6c: f8 00 31 70 calli 801d52c count -= c; cmpltd += c; 8010f70: b5 6d 68 00 add r13,r11,r13 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 8010f74: 45 80 00 0a be r12,r0,8010f9c <_fat_block_read+0x98> c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); count -= c; cmpltd += c; sec_num++; 8010f78: 35 ce 00 01 addi r14,r14,1 ofs = 0; 8010f7c: 34 0f 00 00 mvi r15,0 uint8_t *sec_buf; uint32_t c = 0; while (count > 0) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 8010f80: b9 c0 10 00 mv r2,r14 8010f84: 37 84 00 24 addi r4,sp,36 8010f88: ba 00 08 00 mv r1,r16 8010f8c: 34 03 00 01 mvi r3,1 8010f90: fb ff ff 98 calli 8010df0 if (rc != RC_OK) 8010f94: 44 20 ff ed be r1,r0,8010f48 <_fat_block_read+0x44> <== ALWAYS TAKEN return -1; 8010f98: 34 0d ff ff mvi r13,-1 <== NOT EXECUTED cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } 8010f9c: b9 a0 08 00 mv r1,r13 8010fa0: 2b 9d 00 04 lw ra,(sp+4) 8010fa4: 2b 8b 00 20 lw r11,(sp+32) 8010fa8: 2b 8c 00 1c lw r12,(sp+28) 8010fac: 2b 8d 00 18 lw r13,(sp+24) 8010fb0: 2b 8e 00 14 lw r14,(sp+20) 8010fb4: 2b 8f 00 10 lw r15,(sp+16) 8010fb8: 2b 90 00 0c lw r16,(sp+12) 8010fbc: 2b 91 00 08 lw r17,(sp+8) 8010fc0: 37 9c 00 24 addi sp,sp,36 8010fc4: c3 a0 00 00 ret =============================================================================== 08002518 <_lstat_r>: int _STAT_R_NAME( struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { 8002518: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 800251c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return _STAT_NAME( path, buf ); 8002520: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 8002524: b8 60 10 00 mv r2,r3 <== NOT EXECUTED 8002528: fb ff ff dd calli 800249c <== NOT EXECUTED } 800252c: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8002530: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 8002534: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080027c4 <_stat_r>: int _STAT_R_NAME( struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { 80027c4: 37 9c ff fc addi sp,sp,-4 <== NOT EXECUTED 80027c8: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED return _STAT_NAME( path, buf ); 80027cc: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 80027d0: b8 60 10 00 mv r2,r3 <== NOT EXECUTED 80027d4: fb ff ff dd calli 8002748 <== NOT EXECUTED } 80027d8: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80027dc: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 80027e0: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08003c84 : */ int adjtime( const struct timeval *delta, struct timeval *olddelta ) { 8003c84: 37 9c ff dc addi sp,sp,-36 8003c88: 5b 8b 00 1c sw (sp+28),r11 8003c8c: 5b 8c 00 18 sw (sp+24),r12 8003c90: 5b 8d 00 14 sw (sp+20),r13 8003c94: 5b 8e 00 10 sw (sp+16),r14 8003c98: 5b 8f 00 0c sw (sp+12),r15 8003c9c: 5b 90 00 08 sw (sp+8),r16 8003ca0: 5b 9d 00 04 sw (sp+4),ra 8003ca4: b8 20 60 00 mv r12,r1 8003ca8: b8 40 70 00 mv r14,r2 long adjustment; /* * Simple validations */ if ( !delta ) 8003cac: 44 20 00 06 be r1,r0,8003cc4 rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) 8003cb0: 78 03 08 01 mvhi r3,0x801 8003cb4: 38 63 6e 00 ori r3,r3,0x6e00 8003cb8: 28 22 00 04 lw r2,(r1+4) 8003cbc: 28 61 00 00 lw r1,(r3+0) 8003cc0: 50 22 00 0e bgeu r1,r2,8003cf8 rtems_set_errno_and_return_minus_one( EINVAL ); 8003cc4: f8 00 29 1e calli 800e13c <__errno> 8003cc8: 34 02 00 16 mvi r2,22 8003ccc: 58 22 00 00 sw (r1+0),r2 8003cd0: 34 01 ff ff mvi r1,-1 /* set the user's output */ if ( olddelta ) *olddelta = *delta; return 0; } 8003cd4: 2b 9d 00 04 lw ra,(sp+4) 8003cd8: 2b 8b 00 1c lw r11,(sp+28) 8003cdc: 2b 8c 00 18 lw r12,(sp+24) 8003ce0: 2b 8d 00 14 lw r13,(sp+20) 8003ce4: 2b 8e 00 10 lw r14,(sp+16) 8003ce8: 2b 8f 00 0c lw r15,(sp+12) 8003cec: 2b 90 00 08 lw r16,(sp+8) 8003cf0: 37 9c 00 24 addi sp,sp,36 8003cf4: c3 a0 00 00 ret rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( olddelta ) { 8003cf8: 45 c0 00 04 be r14,r0,8003d08 olddelta->tv_sec = 0; olddelta->tv_usec = 0; 8003cfc: 59 c0 00 04 sw (r14+4),r0 8003d00: 29 82 00 04 lw r2,(r12+4) if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( olddelta ) { olddelta->tv_sec = 0; 8003d04: 59 c0 00 00 sw (r14+0),r0 olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 8003d08: 29 83 00 00 lw r3,(r12+0) adjustment += delta->tv_usec; /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 8003d0c: 78 01 08 01 mvhi r1,0x801 8003d10: 38 21 6a 00 ori r1,r1,0x6a00 olddelta->tv_sec = 0; olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 8003d14: b4 63 20 00 add r4,r3,r3 8003d18: b4 84 20 00 add r4,r4,r4 8003d1c: b4 84 20 00 add r4,r4,r4 8003d20: b4 84 28 00 add r5,r4,r4 8003d24: b4 a5 28 00 add r5,r5,r5 8003d28: b4 a5 28 00 add r5,r5,r5 8003d2c: b4 a5 28 00 add r5,r5,r5 8003d30: b4 a5 28 00 add r5,r5,r5 8003d34: c8 a4 28 00 sub r5,r5,r4 8003d38: b4 a5 20 00 add r4,r5,r5 8003d3c: b4 84 20 00 add r4,r4,r4 8003d40: b4 84 20 00 add r4,r4,r4 8003d44: b4 84 20 00 add r4,r4,r4 8003d48: b4 84 20 00 add r4,r4,r4 8003d4c: b4 84 20 00 add r4,r4,r4 8003d50: c8 85 20 00 sub r4,r4,r5 8003d54: b4 83 18 00 add r3,r4,r3 8003d58: b4 63 18 00 add r3,r3,r3 8003d5c: b4 63 18 00 add r3,r3,r3 8003d60: b4 63 18 00 add r3,r3,r3 8003d64: b4 63 18 00 add r3,r3,r3 8003d68: b4 63 18 00 add r3,r3,r3 adjustment += delta->tv_usec; /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 8003d6c: 28 24 00 0c lw r4,(r1+12) olddelta->tv_sec = 0; olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 8003d70: b4 63 18 00 add r3,r3,r3 adjustment += delta->tv_usec; 8003d74: b4 43 18 00 add r3,r2,r3 /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) return 0; 8003d78: 34 01 00 00 mvi r1,0 /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); adjustment += delta->tv_usec; /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 8003d7c: 54 83 ff d6 bgu r4,r3,8003cd4 * * 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; 8003d80: 78 01 08 01 mvhi r1,0x801 8003d84: 38 21 8a 20 ori r1,r1,0x8a20 8003d88: 28 22 00 00 lw r2,(r1+0) ++level; 8003d8c: 34 42 00 01 addi r2,r2,1 _Thread_Dispatch_disable_level = level; 8003d90: 58 22 00 00 sw (r1+0),r2 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 8003d94: 78 02 08 01 mvhi r2,0x801 _TOD_Get_with_nanoseconds( &tod_as_timestamp, &_TOD.now ); 8003d98: 37 8f 00 20 addi r15,sp,32 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 8003d9c: 38 42 89 a0 ori r2,r2,0x89a0 8003da0: b9 e0 08 00 mv r1,r15 8003da4: f8 00 07 06 calli 80059bc <_TOD_Get_with_nanoseconds> /* set the user's output */ if ( olddelta ) *olddelta = *delta; return 0; } 8003da8: 28 30 00 00 lw r16,(r1+0) 8003dac: 28 2d 00 04 lw r13,(r1+4) static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 8003db0: 78 01 08 01 mvhi r1,0x801 8003db4: 38 21 6d fc ori r1,r1,0x6dfc 8003db8: 28 24 00 00 lw r4,(r1+0) 8003dbc: 34 03 00 00 mvi r3,0 8003dc0: ba 00 08 00 mv r1,r16 8003dc4: b9 a0 10 00 mv r2,r13 8003dc8: f8 00 3f 0e calli 8013a00 <__divdi3> _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 8003dcc: 78 03 08 01 mvhi r3,0x801 8003dd0: 38 63 6d fc ori r3,r3,0x6dfc _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 8003dd4: 29 8b 00 00 lw r11,(r12+0) 8003dd8: 28 64 00 00 lw r4,(r3+0) 8003ddc: ba 00 08 00 mv r1,r16 8003de0: 34 03 00 00 mvi r3,0 8003de4: b5 62 58 00 add r11,r11,r2 8003de8: b9 a0 10 00 mv r2,r13 8003dec: f8 00 41 07 calli 8014208 <__moddi3> ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 8003df0: 29 83 00 04 lw r3,(r12+4) /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 8003df4: 78 01 08 01 mvhi r1,0x801 8003df8: 38 21 70 04 ori r1,r1,0x7004 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 8003dfc: b4 63 18 00 add r3,r3,r3 8003e00: b4 63 18 00 add r3,r3,r3 8003e04: b4 63 18 00 add r3,r3,r3 8003e08: b4 63 28 00 add r5,r3,r3 8003e0c: b4 a5 28 00 add r5,r5,r5 8003e10: b4 65 18 00 add r3,r3,r5 8003e14: b4 63 28 00 add r5,r3,r3 8003e18: b4 a5 28 00 add r5,r5,r5 8003e1c: b4 65 18 00 add r3,r3,r5 8003e20: b4 63 28 00 add r5,r3,r3 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 8003e24: 28 24 00 00 lw r4,(r1+0) _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 8003e28: b4 a5 28 00 add r5,r5,r5 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 8003e2c: 78 01 08 01 mvhi r1,0x801 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 8003e30: b4 65 18 00 add r3,r3,r5 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 8003e34: 38 21 70 08 ori r1,r1,0x7008 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 8003e38: b4 43 18 00 add r3,r2,r3 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 8003e3c: 28 22 00 00 lw r2,(r1+0) 8003e40: 54 62 00 bc bgu r3,r2,8004130 <== NEVER TAKEN _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 8003e44: b8 60 68 00 mv r13,r3 ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 8003e48: 78 01 08 01 mvhi r1,0x801 8003e4c: 38 21 70 04 ori r1,r1,0x7004 8003e50: 28 22 00 00 lw r2,(r1+0) 8003e54: 54 62 00 08 bgu r3,r2,8003e74 <== NEVER TAKEN ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; 8003e58: 78 01 08 01 mvhi r1,0x801 8003e5c: 38 21 6d fc ori r1,r1,0x6dfc 8003e60: 28 24 00 00 lw r4,(r1+0) 8003e64: b4 64 18 00 add r3,r3,r4 8003e68: b8 60 68 00 mv r13,r3 ts.tv_sec--; 8003e6c: 35 6b ff ff addi r11,r11,-1 ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 8003e70: 50 43 ff fd bgeu r2,r3,8003e64 const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 8003e74: 34 02 00 1f mvi r2,31 8003e78: b9 60 08 00 mv r1,r11 8003e7c: f8 00 46 ce calli 80159b4 <__ashrsi3> Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; 8003e80: b5 6b 10 00 add r2,r11,r11 8003e84: f5 62 28 00 cmpgu r5,r11,r2 8003e88: b8 20 18 00 mv r3,r1 8003e8c: b4 42 20 00 add r4,r2,r2 8003e90: b4 21 08 00 add r1,r1,r1 8003e94: b4 a1 28 00 add r5,r5,r1 8003e98: f4 44 08 00 cmpgu r1,r2,r4 8003e9c: b4 a5 28 00 add r5,r5,r5 8003ea0: b4 84 10 00 add r2,r4,r4 8003ea4: b4 25 08 00 add r1,r1,r5 8003ea8: f4 82 20 00 cmpgu r4,r4,r2 8003eac: b4 42 28 00 add r5,r2,r2 8003eb0: b4 21 08 00 add r1,r1,r1 8003eb4: b4 81 20 00 add r4,r4,r1 8003eb8: f4 45 08 00 cmpgu r1,r2,r5 8003ebc: b4 84 20 00 add r4,r4,r4 8003ec0: c8 ab 10 00 sub r2,r5,r11 8003ec4: b4 24 08 00 add r1,r1,r4 8003ec8: f4 45 28 00 cmpgu r5,r2,r5 8003ecc: b4 42 20 00 add r4,r2,r2 8003ed0: c8 23 08 00 sub r1,r1,r3 8003ed4: c8 25 28 00 sub r5,r1,r5 8003ed8: f4 44 08 00 cmpgu r1,r2,r4 8003edc: b4 a5 28 00 add r5,r5,r5 8003ee0: b4 84 10 00 add r2,r4,r4 8003ee4: f4 82 20 00 cmpgu r4,r4,r2 8003ee8: b4 25 08 00 add r1,r1,r5 8003eec: b4 21 08 00 add r1,r1,r1 8003ef0: b4 42 28 00 add r5,r2,r2 8003ef4: b4 81 30 00 add r6,r4,r1 8003ef8: f4 45 08 00 cmpgu r1,r2,r5 8003efc: c8 ab 20 00 sub r4,r5,r11 8003f00: b4 c6 30 00 add r6,r6,r6 8003f04: f4 85 28 00 cmpgu r5,r4,r5 8003f08: b4 26 08 00 add r1,r1,r6 8003f0c: b4 84 10 00 add r2,r4,r4 8003f10: c8 23 08 00 sub r1,r1,r3 8003f14: c8 25 08 00 sub r1,r1,r5 8003f18: f4 82 20 00 cmpgu r4,r4,r2 8003f1c: b4 42 28 00 add r5,r2,r2 8003f20: b4 21 08 00 add r1,r1,r1 8003f24: b4 81 20 00 add r4,r4,r1 8003f28: f4 45 08 00 cmpgu r1,r2,r5 8003f2c: b4 84 20 00 add r4,r4,r4 8003f30: b4 ab 10 00 add r2,r5,r11 8003f34: b4 24 08 00 add r1,r1,r4 8003f38: f4 a2 28 00 cmpgu r5,r5,r2 8003f3c: b4 42 20 00 add r4,r2,r2 8003f40: b4 23 08 00 add r1,r1,r3 8003f44: b4 a1 28 00 add r5,r5,r1 8003f48: f4 44 08 00 cmpgu r1,r2,r4 8003f4c: b4 a5 28 00 add r5,r5,r5 8003f50: b4 84 10 00 add r2,r4,r4 8003f54: f4 82 20 00 cmpgu r4,r4,r2 8003f58: b4 25 08 00 add r1,r1,r5 8003f5c: b4 21 08 00 add r1,r1,r1 8003f60: b4 42 28 00 add r5,r2,r2 8003f64: b4 81 30 00 add r6,r4,r1 8003f68: f4 45 08 00 cmpgu r1,r2,r5 8003f6c: c8 ab 20 00 sub r4,r5,r11 8003f70: b4 c6 30 00 add r6,r6,r6 8003f74: f4 85 28 00 cmpgu r5,r4,r5 8003f78: b4 26 08 00 add r1,r1,r6 8003f7c: b4 84 10 00 add r2,r4,r4 8003f80: c8 23 08 00 sub r1,r1,r3 8003f84: f4 82 20 00 cmpgu r4,r4,r2 8003f88: c8 25 08 00 sub r1,r1,r5 8003f8c: b4 21 08 00 add r1,r1,r1 8003f90: b4 42 28 00 add r5,r2,r2 8003f94: b4 81 30 00 add r6,r4,r1 8003f98: f4 45 08 00 cmpgu r1,r2,r5 8003f9c: c8 ab 20 00 sub r4,r5,r11 8003fa0: b4 c6 30 00 add r6,r6,r6 8003fa4: f4 85 28 00 cmpgu r5,r4,r5 8003fa8: b4 26 08 00 add r1,r1,r6 8003fac: b4 84 10 00 add r2,r4,r4 8003fb0: c8 23 08 00 sub r1,r1,r3 8003fb4: c8 25 08 00 sub r1,r1,r5 8003fb8: f4 82 20 00 cmpgu r4,r4,r2 8003fbc: b4 42 28 00 add r5,r2,r2 8003fc0: b4 21 08 00 add r1,r1,r1 8003fc4: b4 81 20 00 add r4,r4,r1 8003fc8: f4 45 08 00 cmpgu r1,r2,r5 8003fcc: b4 84 20 00 add r4,r4,r4 8003fd0: c8 ab 10 00 sub r2,r5,r11 8003fd4: b4 24 08 00 add r1,r1,r4 8003fd8: f4 45 28 00 cmpgu r5,r2,r5 8003fdc: b4 42 20 00 add r4,r2,r2 8003fe0: c8 23 08 00 sub r1,r1,r3 8003fe4: c8 25 28 00 sub r5,r1,r5 8003fe8: f4 44 08 00 cmpgu r1,r2,r4 8003fec: b4 a5 28 00 add r5,r5,r5 8003ff0: b4 84 10 00 add r2,r4,r4 8003ff4: f4 82 20 00 cmpgu r4,r4,r2 8003ff8: b4 25 08 00 add r1,r1,r5 8003ffc: b4 21 08 00 add r1,r1,r1 8004000: b4 42 28 00 add r5,r2,r2 8004004: b4 81 30 00 add r6,r4,r1 8004008: f4 45 08 00 cmpgu r1,r2,r5 800400c: b4 ab 20 00 add r4,r5,r11 8004010: b4 c6 30 00 add r6,r6,r6 8004014: b4 26 08 00 add r1,r1,r6 8004018: f4 a4 28 00 cmpgu r5,r5,r4 800401c: b4 84 10 00 add r2,r4,r4 8004020: b4 23 08 00 add r1,r1,r3 8004024: b4 a1 08 00 add r1,r5,r1 8004028: f4 82 20 00 cmpgu r4,r4,r2 800402c: b4 42 28 00 add r5,r2,r2 8004030: b4 21 08 00 add r1,r1,r1 8004034: b4 81 20 00 add r4,r4,r1 8004038: f4 45 10 00 cmpgu r2,r2,r5 800403c: b4 ab 58 00 add r11,r5,r11 8004040: b4 84 20 00 add r4,r4,r4 8004044: b4 44 10 00 add r2,r2,r4 8004048: f4 ab 28 00 cmpgu r5,r5,r11 800404c: b5 6b 20 00 add r4,r11,r11 8004050: b4 43 18 00 add r3,r2,r3 8004054: b4 a3 18 00 add r3,r5,r3 8004058: f5 64 58 00 cmpgu r11,r11,r4 800405c: b4 84 10 00 add r2,r4,r4 8004060: b4 63 18 00 add r3,r3,r3 8004064: f4 82 20 00 cmpgu r4,r4,r2 8004068: b5 63 58 00 add r11,r11,r3 800406c: b5 6b 58 00 add r11,r11,r11 8004070: b4 42 18 00 add r3,r2,r2 8004074: b4 8b 28 00 add r5,r4,r11 8004078: f4 43 20 00 cmpgu r4,r2,r3 800407c: b4 a5 28 00 add r5,r5,r5 8004080: b4 63 10 00 add r2,r3,r3 8004084: f4 62 08 00 cmpgu r1,r3,r2 8004088: b4 85 20 00 add r4,r4,r5 800408c: b4 42 18 00 add r3,r2,r2 8004090: b4 84 20 00 add r4,r4,r4 8004094: f4 43 28 00 cmpgu r5,r2,r3 8004098: b4 24 08 00 add r1,r1,r4 800409c: b4 63 10 00 add r2,r3,r3 80040a0: b4 21 08 00 add r1,r1,r1 80040a4: f4 62 20 00 cmpgu r4,r3,r2 80040a8: b4 a1 28 00 add r5,r5,r1 80040ac: b4 a5 28 00 add r5,r5,r5 80040b0: b4 42 18 00 add r3,r2,r2 80040b4: b4 85 20 00 add r4,r4,r5 80040b8: f4 43 08 00 cmpgu r1,r2,r3 80040bc: b4 84 20 00 add r4,r4,r4 80040c0: b4 63 10 00 add r2,r3,r3 80040c4: b4 24 08 00 add r1,r1,r4 80040c8: f4 62 18 00 cmpgu r3,r3,r2 80040cc: b4 42 58 00 add r11,r2,r2 80040d0: b4 21 08 00 add r1,r1,r1 80040d4: f4 4b 80 00 cmpgu r16,r2,r11 80040d8: b4 61 18 00 add r3,r3,r1 80040dc: b4 63 18 00 add r3,r3,r3 80040e0: 34 02 00 1f mvi r2,31 80040e4: b9 a0 08 00 mv r1,r13 80040e8: b5 6d 68 00 add r13,r11,r13 80040ec: b6 03 80 00 add r16,r16,r3 80040f0: f5 6d 58 00 cmpgu r11,r11,r13 80040f4: f8 00 46 30 calli 80159b4 <__ashrsi3> 80040f8: b6 01 08 00 add r1,r16,r1 80040fc: b5 61 58 00 add r11,r11,r1 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 8004100: b9 e0 08 00 mv r1,r15 8004104: 5b 8b 00 20 sw (sp+32),r11 8004108: 5b 8d 00 24 sw (sp+36),r13 800410c: f8 00 06 56 calli 8005a64 <_TOD_Set_with_timestamp> ts.tv_sec--; } _TOD_Set( &ts ); _Thread_Enable_dispatch(); 8004110: f8 00 0d 6d calli 80076c4 <_Thread_Enable_dispatch> /* set the user's output */ if ( olddelta ) *olddelta = *delta; return 0; 8004114: 34 01 00 00 mvi r1,0 _TOD_Set( &ts ); _Thread_Enable_dispatch(); /* set the user's output */ if ( olddelta ) 8004118: 45 c0 fe ef be r14,r0,8003cd4 <== NEVER TAKEN *olddelta = *delta; 800411c: 29 82 00 00 lw r2,(r12+0) 8004120: 59 c2 00 00 sw (r14+0),r2 8004124: 29 82 00 04 lw r2,(r12+4) 8004128: 59 c2 00 04 sw (r14+4),r2 800412c: e3 ff fe ea bi 8003cd4 ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 8004130: b4 64 18 00 add r3,r3,r4 8004134: b8 60 68 00 mv r13,r3 ts.tv_sec++; 8004138: 35 6b 00 01 addi r11,r11,1 ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 800413c: 54 62 ff fd bgu r3,r2,8004130 <== NEVER TAKEN 8004140: e3 ff ff 42 bi 8003e48 =============================================================================== 08003f6c : #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 8003f6c: 37 9c ff ec addi sp,sp,-20 8003f70: 5b 8b 00 14 sw (sp+20),r11 8003f74: 5b 8c 00 10 sw (sp+16),r12 8003f78: 5b 8d 00 0c sw (sp+12),r13 8003f7c: 5b 8e 00 08 sw (sp+8),r14 8003f80: 5b 9d 00 04 sw (sp+4),ra rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 8003f84: 78 0b 08 01 mvhi r11,0x801 8003f88: 39 6b 88 40 ori r11,r11,0x8840 #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 8003f8c: b8 20 68 00 mv r13,r1 rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 8003f90: b9 60 08 00 mv r1,r11 #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 8003f94: b8 40 60 00 mv r12,r2 rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 8003f98: f8 00 05 2c calli 8005448 if (fcntl (fildes, F_GETFD) < 0) { 8003f9c: b9 a0 08 00 mv r1,r13 8003fa0: 34 02 00 01 mvi r2,1 8003fa4: f8 00 1d 4c calli 800b4d4 8003fa8: 4c 20 00 08 bge r1,r0,8003fc8 pthread_mutex_unlock(&aio_request_queue.mutex); 8003fac: b9 60 08 00 mv r1,r11 8003fb0: f8 00 05 56 calli 8005508 rtems_set_errno_and_return_minus_one (EBADF); 8003fb4: f8 00 2d f2 calli 800f77c <__errno> 8003fb8: 34 02 00 09 mvi r2,9 8003fbc: 58 22 00 00 sw (r1+0),r2 8003fc0: 34 0c ff ff mvi r12,-1 8003fc4: e0 00 00 16 bi 800401c } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { 8003fc8: 45 80 00 40 be r12,r0,80040c8 <== NEVER TAKEN pthread_mutex_unlock (&aio_request_queue.mutex); return AIO_CANCELED; } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { 8003fcc: 29 8e 00 00 lw r14,(r12+0) 8003fd0: 5d cd 00 37 bne r14,r13,80040ac <== NEVER TAKEN pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 8003fd4: 78 01 08 01 mvhi r1,0x801 8003fd8: 38 21 88 88 ori r1,r1,0x8888 8003fdc: b9 c0 10 00 mv r2,r14 8003fe0: 34 03 00 00 mvi r3,0 8003fe4: f8 00 01 b5 calli 80046b8 8003fe8: b8 20 68 00 mv r13,r1 if (r_chain == NULL) { 8003fec: 44 20 00 14 be r1,r0,800403c return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 8003ff0: 34 2e 00 1c addi r14,r1,28 8003ff4: b9 c0 08 00 mv r1,r14 8003ff8: f8 00 05 14 calli 8005448 result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 8003ffc: b9 80 10 00 mv r2,r12 8004000: 35 a1 00 08 addi r1,r13,8 8004004: f8 00 02 00 calli 8004804 8004008: b8 20 60 00 mv r12,r1 pthread_mutex_unlock (&r_chain->mutex); 800400c: b9 c0 08 00 mv r1,r14 8004010: f8 00 05 3e calli 8005508 pthread_mutex_unlock (&aio_request_queue.mutex); 8004014: b9 60 08 00 mv r1,r11 8004018: f8 00 05 3c calli 8005508 return result; } return AIO_ALLDONE; } 800401c: b9 80 08 00 mv r1,r12 8004020: 2b 9d 00 04 lw ra,(sp+4) 8004024: 2b 8b 00 14 lw r11,(sp+20) 8004028: 2b 8c 00 10 lw r12,(sp+16) 800402c: 2b 8d 00 0c lw r13,(sp+12) 8004030: 2b 8e 00 08 lw r14,(sp+8) 8004034: 37 9c 00 14 addi sp,sp,20 8004038: c3 a0 00 00 ret rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); if (r_chain == NULL) { if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 800403c: 29 62 00 54 lw r2,(r11+84) 8004040: 78 01 08 01 mvhi r1,0x801 8004044: 38 21 88 98 ori r1,r1,0x8898 8004048: 44 41 00 15 be r2,r1,800409c <== NEVER TAKEN r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 800404c: 78 01 08 01 mvhi r1,0x801 8004050: 38 21 88 94 ori r1,r1,0x8894 8004054: b9 c0 10 00 mv r2,r14 8004058: 34 03 00 00 mvi r3,0 800405c: f8 00 01 97 calli 80046b8 if (r_chain == NULL) { 8004060: 44 20 00 13 be r1,r0,80040ac rtems_set_errno_and_return_minus_one (EINVAL); } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 8004064: b9 80 10 00 mv r2,r12 8004068: 34 21 00 08 addi r1,r1,8 800406c: f8 00 01 e6 calli 8004804 8004070: b8 20 60 00 mv r12,r1 pthread_mutex_unlock (&aio_request_queue.mutex); 8004074: b9 60 08 00 mv r1,r11 8004078: f8 00 05 24 calli 8005508 pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_unlock (&aio_request_queue.mutex); return result; } return AIO_ALLDONE; } 800407c: b9 80 08 00 mv r1,r12 8004080: 2b 9d 00 04 lw ra,(sp+4) 8004084: 2b 8b 00 14 lw r11,(sp+20) 8004088: 2b 8c 00 10 lw r12,(sp+16) 800408c: 2b 8d 00 0c lw r13,(sp+12) 8004090: 2b 8e 00 08 lw r14,(sp+8) 8004094: 37 9c 00 14 addi sp,sp,20 8004098: c3 a0 00 00 ret result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); pthread_mutex_unlock (&aio_request_queue.mutex); return result; } else { pthread_mutex_unlock (&aio_request_queue.mutex); 800409c: b9 60 08 00 mv r1,r11 80040a0: f8 00 05 1a calli 8005508 return AIO_ALLDONE; 80040a4: 34 0c 00 02 mvi r12,2 80040a8: e3 ff ff dd bi 800401c r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); if (r_chain == NULL) { if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); if (r_chain == NULL) { pthread_mutex_unlock (&aio_request_queue.mutex); 80040ac: b9 60 08 00 mv r1,r11 80040b0: f8 00 05 16 calli 8005508 rtems_set_errno_and_return_minus_one (EINVAL); 80040b4: f8 00 2d b2 calli 800f77c <__errno> 80040b8: 34 02 00 16 mvi r2,22 80040bc: 58 22 00 00 sw (r1+0),r2 80040c0: 34 0c ff ff mvi r12,-1 80040c4: e3 ff ff d6 bi 800401c /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 80040c8: 78 01 08 01 mvhi r1,0x801 80040cc: 38 21 88 88 ori r1,r1,0x8888 80040d0: b9 a0 10 00 mv r2,r13 80040d4: 34 03 00 00 mvi r3,0 80040d8: f8 00 01 78 calli 80046b8 80040dc: b8 20 70 00 mv r14,r1 if (r_chain == NULL) { 80040e0: 44 2c 00 0e be r1,r12,8004118 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 80040e4: 34 2c 00 1c addi r12,r1,28 80040e8: b9 80 08 00 mv r1,r12 80040ec: f8 00 04 d7 calli 8005448 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 80040f0: b9 c0 08 00 mv r1,r14 80040f4: f8 00 0b 07 calli 8006d10 <_Chain_Extract> rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 80040f8: b9 c0 08 00 mv r1,r14 80040fc: f8 00 01 a7 calli 8004798 pthread_mutex_unlock (&r_chain->mutex); 8004100: b9 80 08 00 mv r1,r12 8004104: f8 00 05 01 calli 8005508 pthread_mutex_unlock (&aio_request_queue.mutex); 8004108: b9 60 08 00 mv r1,r11 800410c: f8 00 04 ff calli 8005508 return AIO_CANCELED; 8004110: 34 0c 00 00 mvi r12,0 8004114: e3 ff ff c2 bi 800401c r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); if (r_chain == NULL) { AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 8004118: 29 62 00 54 lw r2,(r11+84) 800411c: 78 01 08 01 mvhi r1,0x801 8004120: 38 21 88 98 ori r1,r1,0x8898 8004124: 44 41 ff de be r2,r1,800409c <== NEVER TAKEN r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 8004128: 78 01 08 01 mvhi r1,0x801 800412c: 38 21 88 94 ori r1,r1,0x8894 8004130: b9 a0 10 00 mv r2,r13 8004134: 34 03 00 00 mvi r3,0 8004138: f8 00 01 60 calli 80046b8 800413c: b8 20 60 00 mv r12,r1 if (r_chain == NULL) { 8004140: 44 2e ff d7 be r1,r14,800409c 8004144: f8 00 0a f3 calli 8006d10 <_Chain_Extract> } AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 8004148: b9 80 08 00 mv r1,r12 pthread_mutex_destroy (&r_chain->mutex); 800414c: 35 8d 00 1c addi r13,r12,28 } AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 8004150: f8 00 01 92 calli 8004798 pthread_mutex_destroy (&r_chain->mutex); 8004154: b9 a0 08 00 mv r1,r13 8004158: f8 00 03 f4 calli 8005128 pthread_cond_destroy (&r_chain->mutex); 800415c: b9 a0 08 00 mv r1,r13 8004160: f8 00 02 e1 calli 8004ce4 free (r_chain); 8004164: b9 80 08 00 mv r1,r12 8004168: fb ff f6 20 calli 80019e8 pthread_mutex_unlock (&aio_request_queue.mutex); 800416c: b9 60 08 00 mv r1,r11 8004170: f8 00 04 e6 calli 8005508 return AIO_CANCELED; 8004174: 34 0c 00 00 mvi r12,0 8004178: e3 ff ff a9 bi 800401c =============================================================================== 08004184 : int aio_fsync( int op, struct aiocb *aiocbp ) { 8004184: 37 9c ff f4 addi sp,sp,-12 8004188: 5b 8b 00 0c sw (sp+12),r11 800418c: 5b 8c 00 08 sw (sp+8),r12 8004190: 5b 9d 00 04 sw (sp+4),ra 8004194: b8 40 58 00 mv r11,r2 rtems_aio_request *req; int mode; if (op != O_SYNC) 8004198: 34 02 20 00 mvi r2,8192 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 800419c: 34 0c 00 16 mvi r12,22 ) { rtems_aio_request *req; int mode; if (op != O_SYNC) 80041a0: 5c 22 00 09 bne r1,r2,80041c4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 80041a4: 29 61 00 00 lw r1,(r11+0) 80041a8: 34 02 00 03 mvi r2,3 80041ac: f8 00 1c ca calli 800b4d4 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 80041b0: 20 21 00 03 andi r1,r1,0x3 80041b4: 34 21 ff ff addi r1,r1,-1 80041b8: 34 02 00 01 mvi r2,1 80041bc: 50 41 00 0d bgeu r2,r1,80041f0 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 80041c0: 34 0c 00 09 mvi r12,9 80041c4: 34 01 ff ff mvi r1,-1 80041c8: 59 6c 00 2c sw (r11+44),r12 80041cc: 59 61 00 30 sw (r11+48),r1 80041d0: f8 00 2d 6b calli 800f77c <__errno> 80041d4: 58 2c 00 00 sw (r1+0),r12 80041d8: 34 01 ff ff mvi r1,-1 req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 80041dc: 2b 9d 00 04 lw ra,(sp+4) 80041e0: 2b 8b 00 0c lw r11,(sp+12) 80041e4: 2b 8c 00 08 lw r12,(sp+8) 80041e8: 37 9c 00 0c addi sp,sp,12 80041ec: c3 a0 00 00 ret 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)); 80041f0: 34 01 00 18 mvi r1,24 80041f4: fb ff f7 6b calli 8001fa0 if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 80041f8: 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) 80041fc: 44 20 ff f2 be r1,r0,80041c4 <== NEVER TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; 8004200: 34 03 00 03 mvi r3,3 8004204: 59 63 00 28 sw (r11+40),r3 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 8004208: 58 2b 00 14 sw (r1+20),r11 req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); 800420c: f8 00 01 9d calli 8004880 } 8004210: 2b 9d 00 04 lw ra,(sp+4) 8004214: 2b 8b 00 0c lw r11,(sp+12) 8004218: 2b 8c 00 08 lw r12,(sp+8) 800421c: 37 9c 00 0c addi sp,sp,12 8004220: c3 a0 00 00 ret =============================================================================== 08004a90 : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 8004a90: 37 9c ff f4 addi sp,sp,-12 8004a94: 5b 8b 00 0c sw (sp+12),r11 8004a98: 5b 8c 00 08 sw (sp+8),r12 8004a9c: 5b 9d 00 04 sw (sp+4),ra 8004aa0: b8 20 58 00 mv r11,r1 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 8004aa4: 28 21 00 00 lw r1,(r1+0) 8004aa8: 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); 8004aac: 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); 8004ab0: f8 00 1a 89 calli 800b4d4 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 8004ab4: 20 21 00 03 andi r1,r1,0x3 8004ab8: 7c 22 00 02 cmpnei r2,r1,2 8004abc: 7c 21 00 00 cmpnei r1,r1,0 8004ac0: a0 41 08 00 and r1,r2,r1 8004ac4: 5c 20 00 06 bne r1,r0,8004adc rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 8004ac8: 29 6c 00 10 lw r12,(r11+16) 8004acc: 5d 81 00 03 bne r12,r1,8004ad8 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 8004ad0: 29 61 00 04 lw r1,(r11+4) 8004ad4: 4c 2c 00 09 bge r1,r12,8004af8 mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 8004ad8: 34 0c 00 16 mvi r12,22 8004adc: 34 01 ff ff mvi r1,-1 8004ae0: 59 6c 00 2c sw (r11+44),r12 8004ae4: 59 61 00 30 sw (r11+48),r1 8004ae8: f8 00 2b 25 calli 800f77c <__errno> 8004aec: 58 2c 00 00 sw (r1+0),r12 8004af0: 34 01 ff ff mvi r1,-1 8004af4: e0 00 00 08 bi 8004b14 if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 8004af8: 34 01 00 18 mvi r1,24 8004afc: fb ff f5 29 calli 8001fa0 if (req == NULL) 8004b00: 44 2c 00 0a be r1,r12,8004b28 <== NEVER TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; 8004b04: 34 03 00 01 mvi r3,1 8004b08: 59 63 00 28 sw (r11+40),r3 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 8004b0c: 58 2b 00 14 sw (r1+20),r11 req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); 8004b10: fb ff ff 5c calli 8004880 } 8004b14: 2b 9d 00 04 lw ra,(sp+4) 8004b18: 2b 8b 00 0c lw r11,(sp+12) 8004b1c: 2b 8c 00 08 lw r12,(sp+8) 8004b20: 37 9c 00 0c addi sp,sp,12 8004b24: c3 a0 00 00 ret if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 8004b28: 34 0c 00 0b mvi r12,11 <== NOT EXECUTED 8004b2c: e3 ff ff ec bi 8004adc <== NOT EXECUTED =============================================================================== 08004b38 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 8004b38: 37 9c ff f4 addi sp,sp,-12 8004b3c: 5b 8b 00 0c sw (sp+12),r11 8004b40: 5b 8c 00 08 sw (sp+8),r12 8004b44: 5b 9d 00 04 sw (sp+4),ra 8004b48: b8 20 58 00 mv r11,r1 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 8004b4c: 28 21 00 00 lw r1,(r1+0) 8004b50: 34 02 00 03 mvi r2,3 8004b54: f8 00 1a 60 calli 800b4d4 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 8004b58: 20 21 00 03 andi r1,r1,0x3 8004b5c: 34 21 ff ff addi r1,r1,-1 8004b60: 34 02 00 01 mvi r2,1 8004b64: 50 41 00 09 bgeu r2,r1,8004b88 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 8004b68: 34 0c 00 09 mvi r12,9 if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 8004b6c: 34 01 ff ff mvi r1,-1 8004b70: 59 6c 00 2c sw (r11+44),r12 8004b74: 59 61 00 30 sw (r11+48),r1 8004b78: f8 00 2b 01 calli 800f77c <__errno> 8004b7c: 58 2c 00 00 sw (r1+0),r12 8004b80: 34 01 ff ff mvi r1,-1 8004b84: e0 00 00 0f bi 8004bc0 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); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 8004b88: 29 61 00 10 lw r1,(r11+16) 8004b8c: 5c 20 00 03 bne r1,r0,8004b98 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 8004b90: 29 62 00 04 lw r2,(r11+4) 8004b94: 4c 41 00 03 bge r2,r1,8004ba0 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); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 8004b98: 34 0c 00 16 mvi r12,22 8004b9c: e3 ff ff f4 bi 8004b6c if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 8004ba0: 34 01 00 18 mvi r1,24 8004ba4: fb ff f4 ff calli 8001fa0 if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 8004ba8: 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) 8004bac: 44 20 ff f0 be r1,r0,8004b6c <== NEVER TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; 8004bb0: 34 03 00 02 mvi r3,2 8004bb4: 59 63 00 28 sw (r11+40),r3 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 8004bb8: 58 2b 00 14 sw (r1+20),r11 req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); 8004bbc: fb ff ff 31 calli 8004880 } 8004bc0: 2b 9d 00 04 lw ra,(sp+4) 8004bc4: 2b 8b 00 0c lw r11,(sp+12) 8004bc8: 2b 8c 00 08 lw r12,(sp+8) 8004bcc: 37 9c 00 0c addi sp,sp,12 8004bd0: c3 a0 00 00 ret =============================================================================== 080049f4 : rtems_chain_control *free_chain, rtems_rbtree_control *chunk_tree, rtems_rbheap_chunk *a, rtems_rbheap_chunk *b ) { 80049f4: 37 9c ff fc addi sp,sp,-4 80049f8: 5b 9d 00 04 sw (sp+4),ra 80049fc: b8 20 28 00 mv r5,r1 if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) { 8004a00: 34 01 ff f8 mvi r1,-8 8004a04: 44 81 00 15 be r4,r1,8004a58 rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); if (chunk != NULL) { rtems_rbheap_add_to_spare_descriptor_chain(control, chunk); } } 8004a08: 28 86 00 00 lw r6,(r4+0) */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 8004a0c: 44 c0 00 1b be r6,r0,8004a78 rtems_rbheap_chunk *a, rtems_rbheap_chunk *b ) { if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) { if (b->begin < a->begin) { 8004a10: 28 81 00 18 lw r1,(r4+24) 8004a14: 28 67 00 18 lw r7,(r3+24) 8004a18: 54 e1 00 13 bgu r7,r1,8004a64 a = b; b = t; } a->size += b->size; 8004a1c: 28 69 00 1c lw r9,(r3+28) 8004a20: 28 88 00 1c lw r8,(r4+28) { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 8004a24: 28 87 00 04 lw r7,(r4+4) rtems_chain_extract_unprotected(&b->chain_node); add_to_chain(free_chain, b); _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); 8004a28: b8 40 08 00 mv r1,r2 a = b; b = t; } a->size += b->size; 8004a2c: b5 28 10 00 add r2,r9,r8 8004a30: 58 62 00 1c sw (r3+28),r2 next->previous = previous; previous->next = next; 8004a34: 58 e6 00 00 sw (r7+0),r6 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 8004a38: 28 a2 00 00 lw r2,(r5+0) Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 8004a3c: 58 c7 00 04 sw (r6+4),r7 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 8004a40: 58 85 00 04 sw (r4+4),r5 before_node = after_node->next; after_node->next = the_node; 8004a44: 58 a4 00 00 sw (r5+0),r4 the_node->next = before_node; 8004a48: 58 82 00 00 sw (r4+0),r2 before_node->previous = the_node; 8004a4c: 58 44 00 04 sw (r2+4),r4 rtems_chain_extract_unprotected(&b->chain_node); add_to_chain(free_chain, b); _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); 8004a50: 34 82 00 08 addi r2,r4,8 8004a54: f8 00 07 b2 calli 800691c <_RBTree_Extract_unprotected> } } 8004a58: 2b 9d 00 04 lw ra,(sp+4) 8004a5c: 37 9c 00 04 addi sp,sp,4 8004a60: c3 a0 00 00 ret rtems_rbheap_chunk *a, rtems_rbheap_chunk *b ) { if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) { if (b->begin < a->begin) { 8004a64: b8 60 08 00 mv r1,r3 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 8004a68: 28 66 00 00 lw r6,(r3+0) 8004a6c: b8 80 18 00 mv r3,r4 8004a70: b8 20 20 00 mv r4,r1 8004a74: e3 ff ff ea bi 8004a1c 8004a78: 28 81 00 04 lw r1,(r4+4) 8004a7c: 5c 26 ff e5 bne r1,r6,8004a10 <== NEVER TAKEN 8004a80: e3 ff ff f6 bi 8004a58 =============================================================================== 08002128 : #include #include int chroot( const char *path ) { 8002128: 37 9c ff 98 addi sp,sp,-104 800212c: 5b 8b 00 14 sw (sp+20),r11 8002130: 5b 8c 00 10 sw (sp+16),r12 8002134: 5b 8d 00 0c sw (sp+12),r13 8002138: 5b 8e 00 08 sw (sp+8),r14 800213c: 5b 9d 00 04 sw (sp+4),ra /* * We use the global environment for path evaluation. This makes it possible * to escape from a chroot environment referencing an unmounted file system. */ rtems_filesystem_eval_path_start_with_root_and_current( 8002140: 78 04 08 01 mvhi r4,0x801 8002144: 37 8d 00 18 addi r13,sp,24 8002148: 78 05 08 01 mvhi r5,0x801 800214c: 34 03 00 19 mvi r3,25 8002150: 38 84 41 20 ori r4,r4,0x4120 8002154: 38 a5 41 1c ori r5,r5,0x411c 8002158: b8 20 10 00 mv r2,r1 800215c: b9 a0 08 00 mv r1,r13 8002160: f8 00 05 7e calli 8003758 eval_flags, &rtems_global_user_env.root_directory, &rtems_global_user_env.current_directory ); rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc ); 8002164: 37 8b 00 50 addi r11,sp,80 8002168: 37 82 00 30 addi r2,sp,48 800216c: b9 60 08 00 mv r1,r11 8002170: f8 00 07 2c calli 8003e20 new_current_loc = rtems_filesystem_location_transform_to_global( &loc ); 8002174: b9 60 08 00 mv r1,r11 8002178: f8 00 07 f1 calli 800413c if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { 800217c: 28 22 00 10 lw r2,(r1+16) 8002180: 78 0b 08 01 mvhi r11,0x801 &rtems_global_user_env.root_directory, &rtems_global_user_env.current_directory ); rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc ); new_current_loc = rtems_filesystem_location_transform_to_global( &loc ); 8002184: 5b 81 00 68 sw (sp+104),r1 if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { 8002188: 39 6b 34 40 ori r11,r11,0x3440 800218c: 44 4b 00 11 be r2,r11,80021d0 rtems_filesystem_global_location_t *new_root_loc = 8002190: 37 81 00 68 addi r1,sp,104 8002194: f8 00 07 b1 calli 8004058 rtems_filesystem_global_location_obtain( &new_current_loc ); rtems_filesystem_node_types_t type = (*new_root_loc->location.mt_entry->ops->node_type_h)( 8002198: 28 22 00 14 lw r2,(r1+20) ); rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc ); new_current_loc = rtems_filesystem_location_transform_to_global( &loc ); if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { rtems_filesystem_global_location_t *new_root_loc = 800219c: b8 20 60 00 mv r12,r1 rtems_filesystem_global_location_obtain( &new_current_loc ); rtems_filesystem_node_types_t type = (*new_root_loc->location.mt_entry->ops->node_type_h)( 80021a0: 28 42 00 0c lw r2,(r2+12) rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc ); new_current_loc = rtems_filesystem_location_transform_to_global( &loc ); if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) { rtems_filesystem_global_location_t *new_root_loc = rtems_filesystem_global_location_obtain( &new_current_loc ); rtems_filesystem_node_types_t type = 80021a4: 28 42 00 14 lw r2,(r2+20) 80021a8: d8 40 00 00 call r2 80021ac: b8 20 70 00 mv r14,r1 (*new_root_loc->location.mt_entry->ops->node_type_h)( &new_root_loc->location ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { 80021b0: 44 20 00 14 be r1,r0,8002200 static inline void rtems_filesystem_location_error( const rtems_filesystem_location_info_t *loc, int eno ) { if ( !rtems_filesystem_location_is_null( loc ) ) { 80021b4: 29 81 00 10 lw r1,(r12+16) 80021b8: 44 2b 00 04 be r1,r11,80021c8 <== NEVER TAKEN errno = eno; 80021bc: f8 00 27 f7 calli 800c198 <__errno> 80021c0: 34 02 00 14 mvi r2,20 80021c4: 58 22 00 00 sw (r1+0),r2 rtems_filesystem_location_error( &new_root_loc->location, ENOTDIR ); rv = -1; } if ( rv != 0 ) { rtems_filesystem_global_location_release( new_root_loc ); 80021c8: b9 80 08 00 mv r1,r12 80021cc: f8 00 07 78 calli 8003fac } } else { rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 80021d0: b9 a0 08 00 mv r1,r13 80021d4: f8 00 05 d3 calli 8003920 if ( rv != 0 ) { rtems_filesystem_global_location_release( new_current_loc ); 80021d8: 2b 81 00 68 lw r1,(sp+104) 80021dc: f8 00 07 74 calli 8003fac 80021e0: 34 01 ff ff mvi r1,-1 } return rv; } 80021e4: 2b 9d 00 04 lw ra,(sp+4) 80021e8: 2b 8b 00 14 lw r11,(sp+20) 80021ec: 2b 8c 00 10 lw r12,(sp+16) 80021f0: 2b 8d 00 0c lw r13,(sp+12) 80021f4: 2b 8e 00 08 lw r14,(sp+8) 80021f8: 37 9c 00 68 addi sp,sp,104 80021fc: c3 a0 00 00 ret (*new_root_loc->location.mt_entry->ops->node_type_h)( &new_root_loc->location ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { sc = rtems_libio_set_private_env(); 8002200: f8 00 03 27 calli 8002e9c if (sc == RTEMS_SUCCESSFUL) { 8002204: 44 2e 00 07 be r1,r14,8002220 rtems_filesystem_global_location_assign( &rtems_filesystem_current, new_current_loc ); } else { if (sc != RTEMS_UNSATISFIED) { 8002208: 34 02 00 0d mvi r2,13 800220c: 44 22 ff ef be r1,r2,80021c8 <== NEVER TAKEN errno = ENOMEM; 8002210: f8 00 27 e2 calli 800c198 <__errno> 8002214: 34 02 00 0c mvi r2,12 8002218: 58 22 00 00 sw (r1+0),r2 800221c: e3 ff ff eb bi 80021c8 ); if ( type == RTEMS_FILESYSTEM_DIRECTORY ) { sc = rtems_libio_set_private_env(); if (sc == RTEMS_SUCCESSFUL) { rtems_filesystem_global_location_assign( 8002220: 78 0b 08 01 mvhi r11,0x801 8002224: 39 6b 41 48 ori r11,r11,0x4148 8002228: 29 61 00 00 lw r1,(r11+0) 800222c: b9 80 10 00 mv r2,r12 8002230: 34 21 00 04 addi r1,r1,4 8002234: f8 00 07 7b calli 8004020 &rtems_filesystem_root, new_root_loc ); rtems_filesystem_global_location_assign( 8002238: 2b 82 00 68 lw r2,(sp+104) 800223c: 29 61 00 00 lw r1,(r11+0) 8002240: f8 00 07 78 calli 8004020 } } else { rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 8002244: b9 a0 08 00 mv r1,r13 8002248: f8 00 05 b6 calli 8003920 800224c: 34 01 00 00 mvi r1,0 8002250: e3 ff ff e5 bi 80021e4 =============================================================================== 08003a90 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 8003a90: 37 9c ff e8 addi sp,sp,-24 8003a94: 5b 8b 00 10 sw (sp+16),r11 8003a98: 5b 8c 00 0c sw (sp+12),r12 8003a9c: 5b 8d 00 08 sw (sp+8),r13 8003aa0: 5b 9d 00 04 sw (sp+4),ra 8003aa4: b8 40 58 00 mv r11,r2 if ( !tp ) 8003aa8: 44 40 00 09 be r2,r0,8003acc rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 8003aac: 34 02 00 01 mvi r2,1 8003ab0: 44 22 00 24 be r1,r2,8003b40 _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 8003ab4: 34 02 00 04 mvi r2,4 8003ab8: 44 22 00 19 be r1,r2,8003b1c <== NEVER TAKEN return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { 8003abc: 34 02 00 02 mvi r2,2 8003ac0: 44 22 00 17 be r1,r2,8003b1c return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 8003ac4: 34 02 00 03 mvi r2,3 8003ac8: 44 22 00 0b be r1,r2,8003af4 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif rtems_set_errno_and_return_minus_one( EINVAL ); 8003acc: f8 00 2a 39 calli 800e3b0 <__errno> 8003ad0: 34 02 00 16 mvi r2,22 8003ad4: 58 22 00 00 sw (r1+0),r2 8003ad8: 34 01 ff ff mvi r1,-1 return 0; } 8003adc: 2b 9d 00 04 lw ra,(sp+4) 8003ae0: 2b 8b 00 10 lw r11,(sp+16) 8003ae4: 2b 8c 00 0c lw r12,(sp+12) 8003ae8: 2b 8d 00 08 lw r13,(sp+8) 8003aec: 37 9c 00 18 addi sp,sp,24 8003af0: c3 a0 00 00 ret } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) rtems_set_errno_and_return_minus_one( ENOSYS ); 8003af4: f8 00 2a 2f calli 800e3b0 <__errno> 8003af8: 34 02 00 58 mvi r2,88 8003afc: 58 22 00 00 sw (r1+0),r2 8003b00: 34 01 ff ff mvi r1,-1 #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 8003b04: 2b 9d 00 04 lw ra,(sp+4) 8003b08: 2b 8b 00 10 lw r11,(sp+16) 8003b0c: 2b 8c 00 0c lw r12,(sp+12) 8003b10: 2b 8d 00 08 lw r13,(sp+8) 8003b14: 37 9c 00 18 addi sp,sp,24 8003b18: c3 a0 00 00 ret } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { _TOD_Get_uptime_as_timespec( tp ); 8003b1c: b9 60 08 00 mv r1,r11 8003b20: f8 00 08 67 calli 8005cbc <_TOD_Get_uptime_as_timespec> return 0; 8003b24: 34 01 00 00 mvi r1,0 #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 8003b28: 2b 9d 00 04 lw ra,(sp+4) 8003b2c: 2b 8b 00 10 lw r11,(sp+16) 8003b30: 2b 8c 00 0c lw r12,(sp+12) 8003b34: 2b 8d 00 08 lw r13,(sp+8) 8003b38: 37 9c 00 18 addi sp,sp,24 8003b3c: c3 a0 00 00 ret ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 8003b40: 78 02 08 01 mvhi r2,0x801 8003b44: 38 42 98 b8 ori r2,r2,0x98b8 8003b48: 37 81 00 14 addi r1,sp,20 8003b4c: f8 00 08 3e calli 8005c44 <_TOD_Get_with_nanoseconds> 8003b50: 28 2d 00 00 lw r13,(r1+0) 8003b54: 28 2c 00 04 lw r12,(r1+4) static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 8003b58: 78 01 08 01 mvhi r1,0x801 8003b5c: 38 21 79 10 ori r1,r1,0x7910 8003b60: 28 24 00 00 lw r4,(r1+0) 8003b64: 34 03 00 00 mvi r3,0 8003b68: b9 a0 08 00 mv r1,r13 8003b6c: b9 80 10 00 mv r2,r12 8003b70: f8 00 42 71 calli 8014534 <__divdi3> _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 8003b74: 78 01 08 01 mvhi r1,0x801 8003b78: 38 21 79 10 ori r1,r1,0x7910 8003b7c: 28 24 00 00 lw r4,(r1+0) static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 8003b80: 59 62 00 00 sw (r11+0),r2 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 8003b84: b9 a0 08 00 mv r1,r13 8003b88: b9 80 10 00 mv r2,r12 8003b8c: 34 03 00 00 mvi r3,0 8003b90: f8 00 44 6b calli 8014d3c <__moddi3> 8003b94: 59 62 00 04 sw (r11+4),r2 if ( !tp ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); return 0; 8003b98: 34 01 00 00 mvi r1,0 8003b9c: e3 ff ff d0 bi 8003adc =============================================================================== 08027d78 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 8027d78: 37 9c ff e8 addi sp,sp,-24 8027d7c: 5b 8b 00 10 sw (sp+16),r11 8027d80: 5b 8c 00 0c sw (sp+12),r12 8027d84: 5b 8d 00 08 sw (sp+8),r13 8027d88: 5b 9d 00 04 sw (sp+4),ra 8027d8c: b8 40 60 00 mv r12,r2 if ( !tp ) 8027d90: 44 40 00 07 be r2,r0,8027dac <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 8027d94: 34 02 00 01 mvi r2,1 8027d98: 44 22 00 0f be r1,r2,8027dd4 _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) 8027d9c: 34 02 00 02 mvi r2,2 8027da0: 44 22 00 c8 be r1,r2,80280c0 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 8027da4: 34 02 00 03 mvi r2,3 8027da8: 44 22 00 c6 be r1,r2,80280c0 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 8027dac: f8 00 56 9c calli 803d81c <__errno> 8027db0: 34 02 00 16 mvi r2,22 8027db4: 58 22 00 00 sw (r1+0),r2 8027db8: 34 01 ff ff mvi r1,-1 return 0; } 8027dbc: 2b 9d 00 04 lw ra,(sp+4) 8027dc0: 2b 8b 00 10 lw r11,(sp+16) 8027dc4: 2b 8c 00 0c lw r12,(sp+12) 8027dc8: 2b 8d 00 08 lw r13,(sp+8) 8027dcc: 37 9c 00 18 addi sp,sp,24 8027dd0: c3 a0 00 00 ret { if ( !tp ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 8027dd4: 78 03 08 06 mvhi r3,0x806 8027dd8: 38 63 4e 10 ori r3,r3,0x4e10 8027ddc: 29 82 00 00 lw r2,(r12+0) 8027de0: 28 61 00 00 lw r1,(r3+0) 8027de4: 54 41 00 02 bgu r2,r1,8027dec 8027de8: e3 ff ff f1 bi 8027dac * * 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; 8027dec: 78 01 08 06 mvhi r1,0x806 8027df0: 38 21 f0 60 ori r1,r1,0xf060 8027df4: 28 22 00 00 lw r2,(r1+0) ++level; 8027df8: 34 42 00 01 addi r2,r2,1 _Thread_Dispatch_disable_level = level; 8027dfc: 58 22 00 00 sw (r1+0),r2 const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 8027e00: 29 8b 00 00 lw r11,(r12+0) 8027e04: 34 02 00 1f mvi r2,31 8027e08: b9 60 08 00 mv r1,r11 8027e0c: f8 00 d4 a4 calli 805d09c <__ashrsi3> Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; 8027e10: b5 6b 10 00 add r2,r11,r11 8027e14: f5 62 28 00 cmpgu r5,r11,r2 8027e18: b4 42 18 00 add r3,r2,r2 8027e1c: b4 21 20 00 add r4,r1,r1 8027e20: b4 a4 20 00 add r4,r5,r4 8027e24: f4 43 28 00 cmpgu r5,r2,r3 8027e28: b4 84 20 00 add r4,r4,r4 8027e2c: b4 63 10 00 add r2,r3,r3 8027e30: b4 a4 28 00 add r5,r5,r4 8027e34: f4 62 18 00 cmpgu r3,r3,r2 8027e38: b4 42 20 00 add r4,r2,r2 8027e3c: b4 a5 28 00 add r5,r5,r5 8027e40: b4 65 18 00 add r3,r3,r5 8027e44: f4 44 28 00 cmpgu r5,r2,r4 8027e48: b4 63 18 00 add r3,r3,r3 8027e4c: c8 8b 10 00 sub r2,r4,r11 8027e50: b4 a3 28 00 add r5,r5,r3 8027e54: f4 44 20 00 cmpgu r4,r2,r4 8027e58: b4 42 18 00 add r3,r2,r2 8027e5c: c8 a1 28 00 sub r5,r5,r1 8027e60: c8 a4 20 00 sub r4,r5,r4 8027e64: f4 43 28 00 cmpgu r5,r2,r3 8027e68: b4 84 20 00 add r4,r4,r4 8027e6c: b4 63 10 00 add r2,r3,r3 8027e70: f4 62 18 00 cmpgu r3,r3,r2 8027e74: b4 a4 28 00 add r5,r5,r4 8027e78: b4 a5 28 00 add r5,r5,r5 8027e7c: b4 42 20 00 add r4,r2,r2 8027e80: b4 65 30 00 add r6,r3,r5 8027e84: f4 44 28 00 cmpgu r5,r2,r4 8027e88: c8 8b 18 00 sub r3,r4,r11 8027e8c: b4 c6 30 00 add r6,r6,r6 8027e90: f4 64 20 00 cmpgu r4,r3,r4 8027e94: b4 a6 28 00 add r5,r5,r6 8027e98: b4 63 10 00 add r2,r3,r3 8027e9c: c8 a1 28 00 sub r5,r5,r1 8027ea0: c8 a4 28 00 sub r5,r5,r4 8027ea4: f4 62 18 00 cmpgu r3,r3,r2 8027ea8: b4 42 20 00 add r4,r2,r2 8027eac: b4 a5 28 00 add r5,r5,r5 8027eb0: b4 65 18 00 add r3,r3,r5 8027eb4: f4 44 28 00 cmpgu r5,r2,r4 8027eb8: b4 63 18 00 add r3,r3,r3 8027ebc: b4 8b 10 00 add r2,r4,r11 8027ec0: b4 a3 28 00 add r5,r5,r3 8027ec4: f4 82 20 00 cmpgu r4,r4,r2 8027ec8: b4 42 18 00 add r3,r2,r2 8027ecc: b4 a1 28 00 add r5,r5,r1 8027ed0: b4 85 20 00 add r4,r4,r5 8027ed4: f4 43 28 00 cmpgu r5,r2,r3 8027ed8: b4 84 20 00 add r4,r4,r4 8027edc: b4 63 10 00 add r2,r3,r3 8027ee0: f4 62 18 00 cmpgu r3,r3,r2 8027ee4: b4 a4 28 00 add r5,r5,r4 8027ee8: b4 a5 28 00 add r5,r5,r5 8027eec: b4 42 20 00 add r4,r2,r2 8027ef0: b4 65 30 00 add r6,r3,r5 8027ef4: f4 44 28 00 cmpgu r5,r2,r4 8027ef8: c8 8b 18 00 sub r3,r4,r11 8027efc: b4 c6 30 00 add r6,r6,r6 8027f00: f4 64 20 00 cmpgu r4,r3,r4 8027f04: b4 a6 28 00 add r5,r5,r6 8027f08: b4 63 10 00 add r2,r3,r3 8027f0c: c8 a1 28 00 sub r5,r5,r1 8027f10: f4 62 18 00 cmpgu r3,r3,r2 8027f14: c8 a4 28 00 sub r5,r5,r4 8027f18: b4 a5 28 00 add r5,r5,r5 8027f1c: b4 42 20 00 add r4,r2,r2 8027f20: b4 65 30 00 add r6,r3,r5 8027f24: f4 44 28 00 cmpgu r5,r2,r4 8027f28: c8 8b 18 00 sub r3,r4,r11 8027f2c: b4 c6 30 00 add r6,r6,r6 8027f30: f4 64 20 00 cmpgu r4,r3,r4 8027f34: b4 a6 28 00 add r5,r5,r6 8027f38: b4 63 10 00 add r2,r3,r3 8027f3c: c8 a1 28 00 sub r5,r5,r1 8027f40: c8 a4 28 00 sub r5,r5,r4 8027f44: f4 62 18 00 cmpgu r3,r3,r2 8027f48: b4 42 20 00 add r4,r2,r2 8027f4c: b4 a5 28 00 add r5,r5,r5 8027f50: b4 65 18 00 add r3,r3,r5 8027f54: f4 44 28 00 cmpgu r5,r2,r4 8027f58: b4 63 18 00 add r3,r3,r3 8027f5c: c8 8b 10 00 sub r2,r4,r11 8027f60: b4 a3 28 00 add r5,r5,r3 8027f64: f4 44 20 00 cmpgu r4,r2,r4 8027f68: b4 42 18 00 add r3,r2,r2 8027f6c: c8 a1 28 00 sub r5,r5,r1 8027f70: c8 a4 20 00 sub r4,r5,r4 8027f74: f4 43 28 00 cmpgu r5,r2,r3 8027f78: b4 84 20 00 add r4,r4,r4 8027f7c: b4 63 10 00 add r2,r3,r3 8027f80: f4 62 18 00 cmpgu r3,r3,r2 8027f84: b4 a4 28 00 add r5,r5,r4 8027f88: b4 a5 28 00 add r5,r5,r5 8027f8c: b4 42 20 00 add r4,r2,r2 8027f90: b4 65 30 00 add r6,r3,r5 8027f94: f4 44 28 00 cmpgu r5,r2,r4 8027f98: b4 c6 30 00 add r6,r6,r6 8027f9c: b4 8b 18 00 add r3,r4,r11 8027fa0: b4 a6 28 00 add r5,r5,r6 8027fa4: f4 83 20 00 cmpgu r4,r4,r3 8027fa8: b4 63 10 00 add r2,r3,r3 8027fac: b4 a1 28 00 add r5,r5,r1 8027fb0: b4 85 28 00 add r5,r4,r5 8027fb4: f4 62 18 00 cmpgu r3,r3,r2 8027fb8: b4 42 20 00 add r4,r2,r2 8027fbc: b4 a5 28 00 add r5,r5,r5 8027fc0: f4 44 10 00 cmpgu r2,r2,r4 8027fc4: b4 65 18 00 add r3,r3,r5 8027fc8: b4 8b 58 00 add r11,r4,r11 8027fcc: b4 63 18 00 add r3,r3,r3 8027fd0: b4 43 18 00 add r3,r2,r3 8027fd4: f4 8b 20 00 cmpgu r4,r4,r11 8027fd8: b5 6b 10 00 add r2,r11,r11 8027fdc: b4 61 08 00 add r1,r3,r1 8027fe0: f5 62 58 00 cmpgu r11,r11,r2 8027fe4: b4 81 20 00 add r4,r4,r1 8027fe8: b4 42 18 00 add r3,r2,r2 8027fec: b4 84 20 00 add r4,r4,r4 8027ff0: b5 64 08 00 add r1,r11,r4 8027ff4: f4 43 58 00 cmpgu r11,r2,r3 8027ff8: b4 21 08 00 add r1,r1,r1 8027ffc: b4 63 10 00 add r2,r3,r3 8028000: f4 62 18 00 cmpgu r3,r3,r2 8028004: b5 61 58 00 add r11,r11,r1 8028008: b5 6b 58 00 add r11,r11,r11 802800c: b4 42 08 00 add r1,r2,r2 8028010: b4 6b 20 00 add r4,r3,r11 8028014: f4 41 18 00 cmpgu r3,r2,r1 8028018: b4 84 20 00 add r4,r4,r4 802801c: b4 21 10 00 add r2,r1,r1 8028020: f4 22 28 00 cmpgu r5,r1,r2 8028024: b4 64 18 00 add r3,r3,r4 8028028: b4 42 08 00 add r1,r2,r2 802802c: b4 63 18 00 add r3,r3,r3 8028030: f4 41 10 00 cmpgu r2,r2,r1 8028034: b4 a3 28 00 add r5,r5,r3 8028038: b4 a5 28 00 add r5,r5,r5 802803c: b4 21 18 00 add r3,r1,r1 8028040: b4 45 20 00 add r4,r2,r5 8028044: f4 23 08 00 cmpgu r1,r1,r3 8028048: b4 63 10 00 add r2,r3,r3 802804c: b4 84 20 00 add r4,r4,r4 8028050: 29 8c 00 04 lw r12,(r12+4) 8028054: b4 24 08 00 add r1,r1,r4 8028058: f4 62 18 00 cmpgu r3,r3,r2 802805c: b4 42 58 00 add r11,r2,r2 8028060: b4 21 08 00 add r1,r1,r1 8028064: f4 4b 68 00 cmpgu r13,r2,r11 8028068: b4 61 18 00 add r3,r3,r1 802806c: b4 63 18 00 add r3,r3,r3 8028070: 34 02 00 1f mvi r2,31 8028074: b9 80 08 00 mv r1,r12 8028078: b5 a3 68 00 add r13,r13,r3 802807c: f8 00 d4 08 calli 805d09c <__ashrsi3> 8028080: b5 6c 20 00 add r4,r11,r12 8028084: f5 64 58 00 cmpgu r11,r11,r4 8028088: b5 a1 08 00 add r1,r13,r1 802808c: b5 61 58 00 add r11,r11,r1 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 8028090: 37 81 00 14 addi r1,sp,20 8028094: 5b 84 00 18 sw (sp+24),r4 8028098: 5b 8b 00 14 sw (sp+20),r11 802809c: f8 00 06 5f calli 8029a18 <_TOD_Set_with_timestamp> rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); 80280a0: fb ff 78 16 calli 80060f8 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 80280a4: 34 01 00 00 mvi r1,0 } 80280a8: 2b 9d 00 04 lw ra,(sp+4) 80280ac: 2b 8b 00 10 lw r11,(sp+16) 80280b0: 2b 8c 00 0c lw r12,(sp+12) 80280b4: 2b 8d 00 08 lw r13,(sp+8) 80280b8: 37 9c 00 18 addi sp,sp,24 80280bc: c3 a0 00 00 ret else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) rtems_set_errno_and_return_minus_one( ENOSYS ); 80280c0: f8 00 55 d7 calli 803d81c <__errno> 80280c4: 34 02 00 58 mvi r2,88 80280c8: 58 22 00 00 sw (r1+0),r2 80280cc: 34 01 ff ff mvi r1,-1 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 80280d0: 2b 9d 00 04 lw ra,(sp+4) 80280d4: 2b 8b 00 10 lw r11,(sp+16) 80280d8: 2b 8c 00 0c lw r12,(sp+12) 80280dc: 2b 8d 00 08 lw r13,(sp+8) 80280e0: 37 9c 00 18 addi sp,sp,24 80280e4: c3 a0 00 00 ret =============================================================================== 08001478 : dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 8001478: 37 9c ff cc addi sp,sp,-52 800147c: 5b 8b 00 34 sw (sp+52),r11 8001480: 5b 8c 00 30 sw (sp+48),r12 8001484: 5b 8d 00 2c sw (sp+44),r13 8001488: 5b 8e 00 28 sw (sp+40),r14 800148c: 5b 8f 00 24 sw (sp+36),r15 8001490: 5b 90 00 20 sw (sp+32),r16 8001494: 5b 91 00 1c sw (sp+28),r17 8001498: 5b 92 00 18 sw (sp+24),r18 800149c: 5b 93 00 14 sw (sp+20),r19 80014a0: 5b 94 00 10 sw (sp+16),r20 80014a4: 5b 95 00 0c sw (sp+12),r21 80014a8: 5b 96 00 08 sw (sp+8),r22 80014ac: 5b 9d 00 04 sw (sp+4),ra rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { 80014b0: 78 0b 08 01 mvhi r11,0x801 80014b4: 39 6b a7 54 ori r11,r11,0xa754 80014b8: 29 6e 00 00 lw r14,(r11+0) dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 80014bc: b8 20 78 00 mv r15,r1 80014c0: b8 40 80 00 mv r16,r2 80014c4: b8 60 98 00 mv r19,r3 80014c8: b8 80 a0 00 mv r20,r4 80014cc: b8 a0 a8 00 mv r21,r5 rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { 80014d0: 50 2e 00 51 bgeu r1,r14,8001614 80014d4: 78 0c 08 01 mvhi r12,0x801 80014d8: 39 8c a7 50 ori r12,r12,0xa750 80014dc: 29 91 00 00 lw r17,(r12+0) memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); disktab = table; disktab_size = new_size; } if (disktab [major].minor == NULL || minor >= disktab[major].size) { 80014e0: b5 ef 58 00 add r11,r15,r15 80014e4: b5 6b 58 00 add r11,r11,r11 80014e8: b5 6b 58 00 add r11,r11,r11 80014ec: b6 2b 10 00 add r2,r17,r11 80014f0: 28 4e 00 00 lw r14,(r2+0) 80014f4: 45 c0 00 6b be r14,r0,80016a0 80014f8: 28 51 00 04 lw r17,(r2+4) 80014fc: 56 30 00 19 bgu r17,r16,8001560 rtems_disk_device **table = disktab [major].minor; rtems_device_minor_number old_size = disktab [major].size; rtems_device_minor_number new_size = 0; if (old_size == 0) { new_size = DISKTAB_INITIAL_SIZE; 8001500: 34 12 00 08 mvi r18,8 if (disktab [major].minor == NULL || minor >= disktab[major].size) { rtems_disk_device **table = disktab [major].minor; rtems_device_minor_number old_size = disktab [major].size; rtems_device_minor_number new_size = 0; if (old_size == 0) { 8001504: 46 20 00 02 be r17,r0,800150c new_size = DISKTAB_INITIAL_SIZE; } else { new_size = 2 * old_size; 8001508: b6 31 90 00 add r18,r17,r17 } if (minor >= new_size) { 800150c: 56 50 00 02 bgu r18,r16,8001514 new_size = minor + 1; 8001510: 36 12 00 01 addi r18,r16,1 } table = realloc(table, new_size * sizeof(*table)); 8001514: b6 52 10 00 add r2,r18,r18 8001518: b9 c0 08 00 mv r1,r14 800151c: b4 42 10 00 add r2,r2,r2 8001520: f8 00 09 93 calli 8003b6c 8001524: b8 20 70 00 mv r14,r1 rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { return RTEMS_NO_MEMORY; 8001528: 34 0d 00 1a mvi r13,26 if (minor >= new_size) { new_size = minor + 1; } table = realloc(table, new_size * sizeof(*table)); if (table == NULL) { 800152c: 44 20 00 15 be r1,r0,8001580 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 8001530: ca 51 18 00 sub r3,r18,r17 8001534: b6 31 88 00 add r17,r17,r17 8001538: b4 63 18 00 add r3,r3,r3 800153c: b6 31 88 00 add r17,r17,r17 8001540: b4 63 18 00 add r3,r3,r3 8001544: b4 31 08 00 add r1,r1,r17 8001548: 34 02 00 00 mvi r2,0 800154c: f8 00 47 77 calli 8013328 disktab [major].minor = table; 8001550: 29 81 00 00 lw r1,(r12+0) 8001554: b4 2b 58 00 add r11,r1,r11 8001558: 59 6e 00 00 sw (r11+0),r14 disktab [major].size = new_size; 800155c: 59 72 00 04 sw (r11+4),r18 } return disktab [major].minor + minor; 8001560: b6 10 30 00 add r6,r16,r16 8001564: b4 c6 30 00 add r6,r6,r6 8001568: b5 c6 70 00 add r14,r14,r6 rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { return RTEMS_NO_MEMORY; 800156c: 34 0d 00 1a mvi r13,26 { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { 8001570: 45 c0 00 04 be r14,r0,8001580 <== NEVER TAKEN return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { 8001574: 29 cb 00 00 lw r11,(r14+0) return RTEMS_RESOURCE_IN_USE; 8001578: 34 0d 00 0c mvi r13,12 if (dd_entry == NULL) { return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { 800157c: 45 60 00 11 be r11,r0,80015c0 *dd_entry = dd; *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; } 8001580: b9 a0 08 00 mv r1,r13 8001584: 2b 9d 00 04 lw ra,(sp+4) 8001588: 2b 8b 00 34 lw r11,(sp+52) 800158c: 2b 8c 00 30 lw r12,(sp+48) 8001590: 2b 8d 00 2c lw r13,(sp+44) 8001594: 2b 8e 00 28 lw r14,(sp+40) 8001598: 2b 8f 00 24 lw r15,(sp+36) 800159c: 2b 90 00 20 lw r16,(sp+32) 80015a0: 2b 91 00 1c lw r17,(sp+28) 80015a4: 2b 92 00 18 lw r18,(sp+24) 80015a8: 2b 93 00 14 lw r19,(sp+20) 80015ac: 2b 94 00 10 lw r20,(sp+16) 80015b0: 2b 95 00 0c lw r21,(sp+12) 80015b4: 2b 96 00 08 lw r22,(sp+8) 80015b8: 37 9c 00 34 addi sp,sp,52 80015bc: c3 a0 00 00 ret if (*dd_entry != NULL) { return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); 80015c0: 34 01 00 78 mvi r1,120 80015c4: f8 00 06 52 calli 8002f0c 80015c8: b8 20 60 00 mv r12,r1 if (dd == NULL) { return RTEMS_NO_MEMORY; 80015cc: 34 0d 00 1a mvi r13,26 if (*dd_entry != NULL) { return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); if (dd == NULL) { 80015d0: 44 2b ff ec be r1,r11,8001580 <== NEVER TAKEN return RTEMS_NO_MEMORY; } if (name != NULL) { 80015d4: 46 60 00 31 be r19,r0,8001698 alloc_name = strdup(name); 80015d8: ba 60 08 00 mv r1,r19 80015dc: f8 00 48 9a calli 8013844 80015e0: b8 20 58 00 mv r11,r1 80015e4: b8 20 88 00 mv r17,r1 if (alloc_name == NULL) { 80015e8: 44 20 00 30 be r1,r0,80016a8 <== NEVER TAKEN return RTEMS_NO_MEMORY; } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { 80015ec: 34 02 61 ff mvi r2,25087 80015f0: b9 e0 18 00 mv r3,r15 80015f4: ba 00 20 00 mv r4,r16 80015f8: f8 00 06 b0 calli 80030b8 80015fc: 48 01 00 21 bg r0,r1,8001680 <== NEVER TAKEN free(dd); return RTEMS_UNSATISFIED; } } *dd_entry = dd; 8001600: 59 cc 00 00 sw (r14+0),r12 *dd_ptr = dd; 8001604: 5a 8c 00 00 sw (r20+0),r12 *alloc_name_ptr = alloc_name; 8001608: 5a b1 00 00 sw (r21+0),r17 return RTEMS_SUCCESSFUL; 800160c: 34 0d 00 00 mvi r13,0 8001610: e3 ff ff dc bi 8001580 rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { rtems_disk_device_table *table = disktab; 8001614: 78 0c 08 01 mvhi r12,0x801 8001618: 39 8c a7 50 ori r12,r12,0xa750 rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; 800161c: b5 ce b0 00 add r22,r14,r14 rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { rtems_disk_device_table *table = disktab; 8001620: 29 81 00 00 lw r1,(r12+0) rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; 8001624: ba c0 90 00 mv r18,r22 if (major >= new_size) { 8001628: 56 cf 00 02 bgu r22,r15,8001630 <== NEVER TAKEN new_size = major + 1; 800162c: 35 f2 00 01 addi r18,r15,1 } table = realloc(table, new_size * sizeof(*table)); 8001630: b6 52 10 00 add r2,r18,r18 8001634: b4 42 10 00 add r2,r2,r2 8001638: b4 42 10 00 add r2,r2,r2 800163c: f8 00 09 4c calli 8003b6c 8001640: b8 20 88 00 mv r17,r1 rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { return RTEMS_NO_MEMORY; 8001644: 34 0d 00 1a mvi r13,26 if (major >= new_size) { new_size = major + 1; } table = realloc(table, new_size * sizeof(*table)); if (table == NULL) { 8001648: 44 20 ff ce be r1,r0,8001580 <== ALWAYS TAKEN return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 800164c: ca 4e 70 00 sub r14,r18,r14 <== NOT EXECUTED 8001650: b5 ce 70 00 add r14,r14,r14 <== NOT EXECUTED 8001654: b5 ce 70 00 add r14,r14,r14 <== NOT EXECUTED 8001658: b6 d6 b0 00 add r22,r22,r22 <== NOT EXECUTED 800165c: b5 ce 70 00 add r14,r14,r14 <== NOT EXECUTED 8001660: b6 d6 b0 00 add r22,r22,r22 <== NOT EXECUTED 8001664: b4 36 08 00 add r1,r1,r22 <== NOT EXECUTED 8001668: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 800166c: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED 8001670: f8 00 47 2e calli 8013328 <== NOT EXECUTED disktab = table; 8001674: 59 91 00 00 sw (r12+0),r17 <== NOT EXECUTED disktab_size = new_size; 8001678: 59 72 00 00 sw (r11+0),r18 <== NOT EXECUTED 800167c: e3 ff ff 99 bi 80014e0 <== NOT EXECUTED } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { free(alloc_name); 8001680: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8001684: f8 00 04 8e calli 80028bc <== NOT EXECUTED free(dd); 8001688: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 800168c: f8 00 04 8c calli 80028bc <== NOT EXECUTED return RTEMS_UNSATISFIED; 8001690: 34 0d 00 0d mvi r13,13 <== NOT EXECUTED 8001694: e3 ff ff bb bi 8001580 <== NOT EXECUTED char **alloc_name_ptr ) { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; 8001698: 34 11 00 00 mvi r17,0 800169c: e3 ff ff d9 bi 8001600 memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); disktab = table; disktab_size = new_size; } if (disktab [major].minor == NULL || minor >= disktab[major].size) { 80016a0: 28 51 00 04 lw r17,(r2+4) 80016a4: e3 ff ff 97 bi 8001500 if (name != NULL) { alloc_name = strdup(name); if (alloc_name == NULL) { free(dd); 80016a8: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 80016ac: f8 00 04 84 calli 80028bc <== NOT EXECUTED return RTEMS_NO_MEMORY; 80016b0: e3 ff ff b4 bi 8001580 <== NOT EXECUTED =============================================================================== 0800118c : */ char *ctermid( char *s ) { if ( !s ) 800118c: 44 20 00 18 be r1,r0,80011ec <== NOT EXECUTED /* * We have no way of knowing the length of the user provided buffer. * It may not be large enough but there is no way to know that. :( * So this is a potential buffer owerrun that we can do nothing about. */ strcpy( s, ctermid_name ); 8001190: 34 04 00 2f mvi r4,47 <== NOT EXECUTED 8001194: 30 24 00 00 sb (r1+0),r4 <== NOT EXECUTED 8001198: 30 24 00 04 sb (r1+4),r4 <== NOT EXECUTED 800119c: 34 04 00 63 mvi r4,99 <== NOT EXECUTED 80011a0: 34 03 00 6f mvi r3,111 <== NOT EXECUTED 80011a4: 34 05 00 64 mvi r5,100 <== NOT EXECUTED 80011a8: 30 24 00 05 sb (r1+5),r4 <== NOT EXECUTED 80011ac: 34 04 00 6e mvi r4,110 <== NOT EXECUTED 80011b0: 34 02 00 65 mvi r2,101 <== NOT EXECUTED 80011b4: 30 25 00 01 sb (r1+1),r5 <== NOT EXECUTED 80011b8: 30 23 00 06 sb (r1+6),r3 <== NOT EXECUTED 80011bc: 34 05 00 76 mvi r5,118 <== NOT EXECUTED 80011c0: 30 24 00 07 sb (r1+7),r4 <== NOT EXECUTED 80011c4: 30 23 00 09 sb (r1+9),r3 <== NOT EXECUTED 80011c8: 34 04 00 73 mvi r4,115 <== NOT EXECUTED 80011cc: 34 03 00 6c mvi r3,108 <== NOT EXECUTED 80011d0: 30 22 00 02 sb (r1+2),r2 <== NOT EXECUTED 80011d4: 30 25 00 03 sb (r1+3),r5 <== NOT EXECUTED 80011d8: 30 24 00 08 sb (r1+8),r4 <== NOT EXECUTED 80011dc: 30 23 00 0a sb (r1+10),r3 <== NOT EXECUTED 80011e0: 30 22 00 0b sb (r1+11),r2 <== NOT EXECUTED 80011e4: 30 20 00 0c sb (r1+12),r0 <== NOT EXECUTED return s; 80011e8: c3 a0 00 00 ret <== NOT EXECUTED char *ctermid( char *s ) { if ( !s ) return ctermid_name; 80011ec: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 80011f0: 38 21 0e 18 ori r1,r1,0xe18 <== NOT EXECUTED * It may not be large enough but there is no way to know that. :( * So this is a potential buffer owerrun that we can do nothing about. */ strcpy( s, ctermid_name ); return s; } 80011f4: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 0800321c : * RTEMS_NO_MEMOTY, if cannot allocate memory for part_desc_t strucure; * RTEMS_INTERNAL_ERROR, if other error occurs. */ static rtems_status_code data_to_part_desc(uint8_t *data, rtems_part_desc_t **new_part_desc) { 800321c: 37 9c ff e0 addi sp,sp,-32 8003220: 5b 8b 00 1c sw (sp+28),r11 8003224: 5b 8c 00 18 sw (sp+24),r12 8003228: 5b 8d 00 14 sw (sp+20),r13 800322c: 5b 8e 00 10 sw (sp+16),r14 8003230: 5b 8f 00 0c sw (sp+12),r15 8003234: 5b 90 00 08 sw (sp+8),r16 8003238: 5b 9d 00 04 sw (sp+4),ra 800323c: b8 20 58 00 mv r11,r1 8003240: b8 40 68 00 mv r13,r2 rtems_part_desc_t *part_desc; uint32_t temp; if (new_part_desc == NULL) { return RTEMS_INTERNAL_ERROR; 8003244: 34 01 00 19 mvi r1,25 data_to_part_desc(uint8_t *data, rtems_part_desc_t **new_part_desc) { rtems_part_desc_t *part_desc; uint32_t temp; if (new_part_desc == NULL) 8003248: 44 40 00 72 be r2,r0,8003410 <== NEVER TAKEN { return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; 800324c: 58 40 00 00 sw (r2+0),r0 if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) 8003250: 34 01 00 01 mvi r1,1 8003254: 34 02 00 28 mvi r2,40 8003258: f8 00 03 c6 calli 8004170 800325c: b8 20 60 00 mv r12,r1 { return RTEMS_NO_MEMORY; 8003260: 34 01 00 1a mvi r1,26 return RTEMS_INTERNAL_ERROR; } *new_part_desc = NULL; if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) 8003264: 45 80 00 6b be r12,r0,8003410 <== NEVER TAKEN part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); /* read the offset start position and partition size in sectors */ /* due to incorrect data alignment one have to align data first */ memcpy(&temp, data + RTEMS_IDE_PARTITION_START_OFFSET, sizeof(uint32_t)); 8003268: 35 61 00 08 addi r1,r11,8 800326c: 41 64 00 08 lbu r4,(r11+8) 8003270: 40 23 00 01 lbu r3,(r1+1) 8003274: 40 22 00 02 lbu r2,(r1+2) 8003278: 40 21 00 03 lbu r1,(r1+3) 800327c: 33 84 00 20 sb (sp+32),r4 8003280: 33 82 00 22 sb (sp+34),r2 8003284: 33 81 00 23 sb (sp+35),r1 8003288: 33 83 00 21 sb (sp+33),r3 part_desc->start = LE_TO_CPU_U32(temp); 800328c: 2b 8f 00 20 lw r15,(sp+32) if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); 8003290: 41 63 00 00 lbu r3,(r11+0) part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); 8003294: 41 6e 00 04 lbu r14,(r11+4) byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8003298: 34 02 00 18 mvi r2,24 800329c: 21 e1 00 ff andi r1,r15,0xff if ((part_desc = calloc(1, sizeof(rtems_part_desc_t))) == NULL) { return RTEMS_NO_MEMORY; } part_desc->bootable = *(data + RTEMS_IDE_PARTITION_BOOTABLE_OFFSET); 80032a0: 31 83 00 00 sb (r12+0),r3 part_desc->sys_type = *(data + RTEMS_IDE_PARTITION_SYS_TYPE_OFFSET); 80032a4: 31 8e 00 01 sb (r12+1),r14 80032a8: f8 00 8c 48 calli 80263c8 <__ashlsi3> 80032ac: b8 20 80 00 mv r16,r1 uint32_t value ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; 80032b0: 34 02 00 18 mvi r2,24 80032b4: b9 e0 08 00 mv r1,r15 80032b8: f8 00 8c 92 calli 8026500 <__lshrsi3> byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 80032bc: 01 e4 00 01 srui r4,r15,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 80032c0: ba 01 80 00 or r16,r16,r1 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 80032c4: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 80032c8: 34 02 00 10 mvi r2,16 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 80032cc: 00 84 00 01 srui r4,r4,1 80032d0: 00 84 00 01 srui r4,r4,1 80032d4: 00 84 00 01 srui r4,r4,1 80032d8: 00 84 00 01 srui r4,r4,1 80032dc: 00 84 00 01 srui r4,r4,1 80032e0: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 80032e4: 20 81 00 ff andi r1,r4,0xff 80032e8: f8 00 8c 38 calli 80263c8 <__ashlsi3> 80032ec: ba 01 80 00 or r16,r16,r1 ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; 80032f0: 34 02 00 10 mvi r2,16 80032f4: b9 e0 08 00 mv r1,r15 80032f8: f8 00 8c 82 calli 8026500 <__lshrsi3> 80032fc: 20 23 00 ff andi r3,r1,0xff /* due to incorrect data alignment one have to align data first */ memcpy(&temp, data + RTEMS_IDE_PARTITION_START_OFFSET, sizeof(uint32_t)); part_desc->start = LE_TO_CPU_U32(temp); memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); 8003300: 35 62 00 0c addi r2,r11,12 byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8003304: b4 63 18 00 add r3,r3,r3 8003308: 40 45 00 01 lbu r5,(r2+1) 800330c: 40 44 00 02 lbu r4,(r2+2) 8003310: 40 41 00 03 lbu r1,(r2+3) 8003314: b4 63 18 00 add r3,r3,r3 8003318: 41 62 00 0c lbu r2,(r11+12) 800331c: b4 63 18 00 add r3,r3,r3 8003320: b4 63 18 00 add r3,r3,r3 8003324: 33 85 00 21 sb (sp+33),r5 8003328: 33 84 00 22 sb (sp+34),r4 800332c: 33 82 00 20 sb (sp+32),r2 8003330: 33 81 00 23 sb (sp+35),r1 8003334: b4 63 18 00 add r3,r3,r3 part_desc->size = LE_TO_CPU_U32(temp); 8003338: 2b 8b 00 20 lw r11,(sp+32) 800333c: b4 63 18 00 add r3,r3,r3 8003340: b4 63 18 00 add r3,r3,r3 8003344: b4 63 18 00 add r3,r3,r3 8003348: ba 03 18 00 or r3,r16,r3 800334c: 34 02 00 18 mvi r2,24 8003350: 21 61 00 ff andi r1,r11,0xff /* read the offset start position and partition size in sectors */ /* due to incorrect data alignment one have to align data first */ memcpy(&temp, data + RTEMS_IDE_PARTITION_START_OFFSET, sizeof(uint32_t)); part_desc->start = LE_TO_CPU_U32(temp); 8003354: 59 83 00 04 sw (r12+4),r3 8003358: f8 00 8c 1c calli 80263c8 <__ashlsi3> 800335c: b8 20 78 00 mv r15,r1 uint32_t value ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; 8003360: 34 02 00 18 mvi r2,24 8003364: b9 60 08 00 mv r1,r11 8003368: f8 00 8c 66 calli 8026500 <__lshrsi3> byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 800336c: 01 64 00 01 srui r4,r11,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8003370: b9 e1 78 00 or r15,r15,r1 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8003374: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8003378: 34 02 00 10 mvi r2,16 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 800337c: 00 84 00 01 srui r4,r4,1 8003380: 00 84 00 01 srui r4,r4,1 8003384: 00 84 00 01 srui r4,r4,1 8003388: 00 84 00 01 srui r4,r4,1 800338c: 00 84 00 01 srui r4,r4,1 8003390: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8003394: 20 81 00 ff andi r1,r4,0xff 8003398: f8 00 8c 0c calli 80263c8 <__ashlsi3> 800339c: b9 e1 78 00 or r15,r15,r1 ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; 80033a0: 34 02 00 10 mvi r2,16 80033a4: b9 60 08 00 mv r1,r11 80033a8: f8 00 8c 56 calli 8026500 <__lshrsi3> 80033ac: 20 23 00 ff andi r3,r1,0xff byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 80033b0: b4 63 18 00 add r3,r3,r3 80033b4: b4 63 18 00 add r3,r3,r3 80033b8: b4 63 18 00 add r3,r3,r3 80033bc: b4 63 18 00 add r3,r3,r3 80033c0: b4 63 18 00 add r3,r3,r3 80033c4: b4 63 18 00 add r3,r3,r3 80033c8: b4 63 18 00 add r3,r3,r3 80033cc: b4 63 18 00 add r3,r3,r3 * true if partition type is extended, false otherwise */ static bool is_extended(uint8_t type) { return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED)); 80033d0: 65 cb 00 85 cmpei r11,r14,133 80033d4: 65 c2 00 05 cmpei r2,r14,5 80033d8: b9 e3 78 00 or r15,r15,r3 /* due to incorrect data alignment one have to align data first */ memcpy(&temp, data + RTEMS_IDE_PARTITION_START_OFFSET, sizeof(uint32_t)); part_desc->start = LE_TO_CPU_U32(temp); memcpy(&temp, data + RTEMS_IDE_PARTITION_SIZE_OFFSET, sizeof(uint32_t)); part_desc->size = LE_TO_CPU_U32(temp); 80033dc: 59 8f 00 08 sw (r12+8),r15 * true if partition type is extended, false otherwise */ static bool is_extended(uint8_t type) { return ((type == EXTENDED_PARTITION) || (type == LINUX_EXTENDED)); 80033e0: b9 62 58 00 or r11,r11,r2 * use partitions that are * - extended * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || 80033e4: 5d 60 00 14 bne r11,r0,8003434 DOS_P32MB_PARTITION, FAT32_PARTITION ,FAT32_LBA_PARTITION, FAT16_LBA_PARTITION }; return (NULL != memchr(fat_part_types,type,sizeof(fat_part_types))); 80033e8: 78 01 08 02 mvhi r1,0x802 80033ec: 38 21 73 d8 ori r1,r1,0x73d8 80033f0: b9 c0 10 00 mv r2,r14 80033f4: 34 03 00 06 mvi r3,6 80033f8: f8 00 46 d7 calli 8014f54 * use partitions that are * - extended * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || 80033fc: 44 2b 00 02 be r1,r11,8003404 ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { 8003400: 5d e0 00 0d bne r15,r0,8003434 <== ALWAYS TAKEN *new_part_desc = part_desc; } else { /* empty partition */ free(part_desc); 8003404: b9 80 08 00 mv r1,r12 8003408: f8 00 03 a8 calli 80042a8 } return RTEMS_SUCCESSFUL; 800340c: 34 01 00 00 mvi r1,0 } 8003410: 2b 9d 00 04 lw ra,(sp+4) 8003414: 2b 8b 00 1c lw r11,(sp+28) 8003418: 2b 8c 00 18 lw r12,(sp+24) 800341c: 2b 8d 00 14 lw r13,(sp+20) 8003420: 2b 8e 00 10 lw r14,(sp+16) 8003424: 2b 8f 00 0c lw r15,(sp+12) 8003428: 2b 90 00 08 lw r16,(sp+8) 800342c: 37 9c 00 20 addi sp,sp,32 8003430: c3 a0 00 00 ret * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { *new_part_desc = part_desc; 8003434: 59 ac 00 00 sw (r13+0),r12 } else { /* empty partition */ free(part_desc); } return RTEMS_SUCCESSFUL; 8003438: 34 01 00 00 mvi r1,0 * or * - FAT type and non-zero */ if (is_extended(part_desc->sys_type) || ((is_fat_partition(part_desc->sys_type)) && (part_desc->size != 0))) { *new_part_desc = part_desc; 800343c: e3 ff ff f5 bi 8003410 =============================================================================== 08000970 : #endif #include "devfs.h" void devFS_Show(void) { 8000970: 37 9c ff dc addi sp,sp,-36 8000974: 5b 8b 00 24 sw (sp+36),r11 8000978: 5b 8c 00 20 sw (sp+32),r12 800097c: 5b 8d 00 1c sw (sp+28),r13 8000980: 5b 8e 00 18 sw (sp+24),r14 8000984: 5b 8f 00 14 sw (sp+20),r15 8000988: 5b 90 00 10 sw (sp+16),r16 800098c: 5b 91 00 0c sw (sp+12),r17 8000990: 5b 92 00 08 sw (sp+8),r18 8000994: 5b 9d 00 04 sw (sp+4),ra rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; 8000998: 78 01 08 01 mvhi r1,0x801 800099c: 38 21 21 80 ori r1,r1,0x2180 80009a0: 28 22 00 00 lw r2,(r1+0) if (rootloc->mt_entry->ops == &devFS_ops) { 80009a4: 78 01 08 01 mvhi r1,0x801 80009a8: 38 21 08 58 ori r1,r1,0x858 #include "devfs.h" void devFS_Show(void) { rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; 80009ac: 28 42 00 04 lw r2,(r2+4) if (rootloc->mt_entry->ops == &devFS_ops) { 80009b0: 28 42 00 14 lw r2,(r2+20) 80009b4: 28 43 00 0c lw r3,(r2+12) 80009b8: 44 61 00 0c be r3,r1,80009e8 <== ALWAYS TAKEN (unsigned long) current->minor ); } } } } 80009bc: 2b 9d 00 04 lw ra,(sp+4) 80009c0: 2b 8b 00 24 lw r11,(sp+36) 80009c4: 2b 8c 00 20 lw r12,(sp+32) 80009c8: 2b 8d 00 1c lw r13,(sp+28) 80009cc: 2b 8e 00 18 lw r14,(sp+24) 80009d0: 2b 8f 00 14 lw r15,(sp+20) 80009d4: 2b 90 00 10 lw r16,(sp+16) 80009d8: 2b 91 00 0c lw r17,(sp+12) 80009dc: 2b 92 00 08 lw r18,(sp+8) 80009e0: 37 9c 00 24 addi sp,sp,36 80009e4: c3 a0 00 00 ret static inline const devFS_data *devFS_get_data( const rtems_filesystem_location_info_t *loc ) { return (const devFS_data *) loc->mt_entry->immutable_fs_info; 80009e8: 28 41 00 10 lw r1,(r2+16) rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location; if (rootloc->mt_entry->ops == &devFS_ops) { const devFS_data *data = devFS_get_data(rootloc); size_t i = 0; size_t n = data->count; 80009ec: 28 32 00 04 lw r18,(r1+4) devFS_node *nodes = data->nodes; 80009f0: 28 2c 00 00 lw r12,(r1+0) for (i = 0; i < n; ++i) { 80009f4: 46 40 ff f2 be r18,r0,80009bc <== NEVER TAKEN if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); 80009f8: 78 11 08 01 mvhi r17,0x801 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); } printk( 80009fc: 78 10 08 01 mvhi r16,0x801 8000a00: 78 0d 08 01 mvhi r13,0x801 const devFS_data *data = devFS_get_data(rootloc); size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { 8000a04: 34 0f 00 00 mvi r15,0 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); 8000a08: 3a 31 08 d8 ori r17,r17,0x8d8 for (j = 0; j < m; ++j) { printk("%c", current->name [j]); } printk( 8000a0c: 3a 10 08 e0 ori r16,r16,0x8e0 8000a10: 39 ad 08 dc ori r13,r13,0x8dc devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { devFS_node *current = nodes + i; if (current->name != NULL) { 8000a14: 29 81 00 00 lw r1,(r12+0) 8000a18: 44 20 00 11 be r1,r0,8000a5c size_t j = 0; size_t m = current->namelen; 8000a1c: 29 8e 00 04 lw r14,(r12+4) printk("/"); 8000a20: ba 20 08 00 mv r1,r17 8000a24: f8 00 04 19 calli 8001a88 for (j = 0; j < m; ++j) { 8000a28: 45 c0 00 09 be r14,r0,8000a4c <== NEVER TAKEN 8000a2c: 34 0b 00 00 mvi r11,0 printk("%c", current->name [j]); 8000a30: 29 82 00 00 lw r2,(r12+0) 8000a34: b9 a0 08 00 mv r1,r13 8000a38: b4 4b 10 00 add r2,r2,r11 8000a3c: 40 42 00 00 lbu r2,(r2+0) if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); for (j = 0; j < m; ++j) { 8000a40: 35 6b 00 01 addi r11,r11,1 printk("%c", current->name [j]); 8000a44: f8 00 04 11 calli 8001a88 if (current->name != NULL) { size_t j = 0; size_t m = current->namelen; printk("/"); for (j = 0; j < m; ++j) { 8000a48: 55 cb ff fa bgu r14,r11,8000a30 printk("%c", current->name [j]); } printk( 8000a4c: 29 82 00 08 lw r2,(r12+8) 8000a50: 29 83 00 0c lw r3,(r12+12) 8000a54: ba 00 08 00 mv r1,r16 8000a58: f8 00 04 0c calli 8001a88 const devFS_data *data = devFS_get_data(rootloc); size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; for (i = 0; i < n; ++i) { 8000a5c: 35 ef 00 01 addi r15,r15,1 8000a60: 35 8c 00 14 addi r12,r12,20 8000a64: 56 4f ff ec bgu r18,r15,8000a14 8000a68: e3 ff ff d5 bi 80009bc =============================================================================== 0800a0c8 : } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { 800a0c8: 37 9c ff dc addi sp,sp,-36 800a0cc: 5b 8b 00 24 sw (sp+36),r11 800a0d0: 5b 8c 00 20 sw (sp+32),r12 800a0d4: 5b 8d 00 1c sw (sp+28),r13 800a0d8: 5b 8e 00 18 sw (sp+24),r14 800a0dc: 5b 8f 00 14 sw (sp+20),r15 800a0e0: 5b 90 00 10 sw (sp+16),r16 800a0e4: 5b 91 00 0c sw (sp+12),r17 800a0e8: 5b 92 00 08 sw (sp+8),r18 800a0ec: 5b 9d 00 04 sw (sp+4),ra 800a0f0: b8 20 80 00 mv r16,r1 static inline const devFS_data *devFS_get_data( const rtems_filesystem_location_info_t *loc ) { return (const devFS_data *) loc->mt_entry->immutable_fs_info; 800a0f4: 28 21 00 2c lw r1,(r1+44) } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } 800a0f8: 2a 12 00 00 lw r18,(r16+0) 800a0fc: 2a 0f 00 04 lw r15,(r16+4) 800a100: 28 21 00 10 lw r1,(r1+16) size_t pathlen, devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; 800a104: 28 31 00 04 lw r17,(r1+4) devFS_node *nodes = data->nodes; 800a108: 28 2b 00 00 lw r11,(r1+0) devFS_node *node = NULL; devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 800a10c: 46 20 00 2c be r17,r0,800a1bc ) { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; 800a110: 34 0d 00 00 mvi r13,0 devFS_node *free_node = NULL; 800a114: 34 0e 00 00 mvi r14,0 for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { 800a118: 34 0c 00 00 mvi r12,0 devFS_node *current = nodes + i; if (current->name != NULL) { 800a11c: 29 61 00 00 lw r1,(r11+0) 800a120: 44 20 00 21 be r1,r0,800a1a4 if ( 800a124: 29 63 00 04 lw r3,(r11+4) 800a128: 45 e3 00 19 be r15,r3,800a18c 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) { 800a12c: 65 a5 00 00 cmpei r5,r13,0 800a130: 65 c4 00 00 cmpei r4,r14,0 800a134: 35 8c 00 01 addi r12,r12,1 800a138: b8 a4 20 00 or r4,r5,r4 800a13c: 44 80 00 03 be r4,r0,800a148 800a140: 35 6b 00 14 addi r11,r11,20 800a144: 56 2c ff f6 bgu r17,r12,800a11c } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } 800a148: 2a 01 00 10 lw r1,(r16+16) rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { 800a14c: 45 a0 00 1e be r13,r0,800a1c4 if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { 800a150: 20 21 00 40 andi r1,r1,0x40 800a154: 5c 20 00 16 bne r1,r0,800a1ac currentloc->node_access = node; 800a158: 5a 0d 00 20 sw (r16+32),r13 static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; 800a15c: 5a 00 00 04 sw (r16+4),r0 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } 800a160: 2b 9d 00 04 lw ra,(sp+4) 800a164: 2b 8b 00 24 lw r11,(sp+36) 800a168: 2b 8c 00 20 lw r12,(sp+32) 800a16c: 2b 8d 00 1c lw r13,(sp+28) 800a170: 2b 8e 00 18 lw r14,(sp+24) 800a174: 2b 8f 00 14 lw r15,(sp+20) 800a178: 2b 90 00 10 lw r16,(sp+16) 800a17c: 2b 91 00 0c lw r17,(sp+12) 800a180: 2b 92 00 08 lw r18,(sp+8) 800a184: 37 9c 00 24 addi sp,sp,36 800a188: c3 a0 00 00 ret devFS_node *current = nodes + i; if (current->name != NULL) { if ( current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 800a18c: ba 40 10 00 mv r2,r18 800a190: b9 e0 18 00 mv r3,r15 800a194: f8 00 10 a9 calli 800e438 800a198: 5c 20 ff e5 bne r1,r0,800a12c 800a19c: b9 60 68 00 mv r13,r11 800a1a0: e3 ff ff e3 bi 800a12c 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) { 800a1a4: b9 60 70 00 mv r14,r11 800a1a8: e3 ff ff e1 bi 800a12c if (node != NULL) { if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { currentloc->node_access = node; rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); 800a1ac: ba 00 08 00 mv r1,r16 800a1b0: 34 02 00 11 mvi r2,17 800a1b4: fb ff ea 36 calli 8004a8c 800a1b8: e3 ff ff ea bi 800a160 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } 800a1bc: 2a 01 00 10 lw r1,(r16+16) { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; 800a1c0: 34 0e 00 00 mvi r14,0 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { 800a1c4: 20 21 00 20 andi r1,r1,0x20 800a1c8: 44 20 00 09 be r1,r0,800a1ec <== NEVER TAKEN if (free_node != NULL) { 800a1cc: 45 c0 00 0c be r14,r0,800a1fc free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; 800a1d0: 34 01 01 ff mvi r1,511 800a1d4: 59 c1 00 10 sw (r14+16),r1 currentloc->node_access = free_node; 800a1d8: 5a 0e 00 20 sw (r16+32),r14 rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; 800a1dc: 5a 12 00 08 sw (r16+8),r18 ctx->tokenlen = tokenlen; 800a1e0: 5a 0f 00 0c sw (r16+12),r15 static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; 800a1e4: 5a 00 00 04 sw (r16+4),r0 800a1e8: e3 ff ff de bi 800a160 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, ENOSPC); } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); 800a1ec: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 800a1f0: 34 02 00 02 mvi r2,2 <== NOT EXECUTED 800a1f4: fb ff ea 26 calli 8004a8c <== NOT EXECUTED 800a1f8: e3 ff ff da bi 800a160 <== NOT EXECUTED rtems_filesystem_eval_path_get_path(ctx), rtems_filesystem_eval_path_get_pathlen(ctx) ); rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, ENOSPC); 800a1fc: ba 00 08 00 mv r1,r16 800a200: 34 02 00 1c mvi r2,28 800a204: fb ff ea 22 calli 8004a8c 800a208: e3 ff ff d6 bi 800a160 =============================================================================== 080036d8 : const char *name, size_t namelen, mode_t mode, dev_t dev ) { 80036d8: 37 9c ff e4 addi sp,sp,-28 80036dc: 5b 8b 00 18 sw (sp+24),r11 80036e0: 5b 8c 00 14 sw (sp+20),r12 80036e4: 5b 8d 00 10 sw (sp+16),r13 80036e8: 5b 8e 00 0c sw (sp+12),r14 80036ec: 5b 8f 00 08 sw (sp+8),r15 80036f0: 5b 9d 00 04 sw (sp+4),ra 80036f4: b8 60 58 00 mv r11,r3 int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { 80036f8: 34 03 00 03 mvi r3,3 const char *name, size_t namelen, mode_t mode, dev_t dev ) { 80036fc: b8 20 78 00 mv r15,r1 8003700: b8 80 60 00 mv r12,r4 8003704: b8 a0 70 00 mv r14,r5 8003708: b8 c0 68 00 mv r13,r6 int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { 800370c: 45 63 00 1c be r11,r3,800377c if (S_ISBLK(mode) || S_ISCHR(mode)) { 8003710: 21 83 f0 00 andi r3,r12,0xf000 8003714: 64 64 20 00 cmpei r4,r3,8192 8003718: 64 63 60 00 cmpei r3,r3,24576 800371c: b8 83 18 00 or r3,r4,r3 8003720: 44 60 00 24 be r3,r0,80037b0 char *dupname = malloc(namelen); 8003724: b9 60 08 00 mv r1,r11 8003728: 5b 82 00 1c sw (sp+28),r2 800372c: f8 00 01 2b calli 8003bd8 if (dupname != NULL) { 8003730: 2b 82 00 1c lw r2,(sp+28) 8003734: 44 20 00 24 be r1,r0,80037c4 devFS_node *node = parentloc->node_access; 8003738: 29 e7 00 08 lw r7,(r15+8) node->name = dupname; node->namelen = namelen; node->major = rtems_filesystem_dev_major_t(dev); node->minor = rtems_filesystem_dev_minor_t(dev); node->mode = mode; memcpy(dupname, name, namelen); 800373c: b9 60 18 00 mv r3,r11 char *dupname = malloc(namelen); if (dupname != NULL) { devFS_node *node = parentloc->node_access; node->name = dupname; 8003740: 58 e1 00 00 sw (r7+0),r1 node->namelen = namelen; 8003744: 58 eb 00 04 sw (r7+4),r11 node->major = rtems_filesystem_dev_major_t(dev); 8003748: 58 ee 00 08 sw (r7+8),r14 node->minor = rtems_filesystem_dev_minor_t(dev); 800374c: 58 ed 00 0c sw (r7+12),r13 node->mode = mode; 8003750: 58 ec 00 10 sw (r7+16),r12 memcpy(dupname, name, namelen); 8003754: f8 00 2b 5a calli 800e4bc size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 8003758: 34 01 00 00 mvi r1,0 rv = -1; } } return rv; } 800375c: 2b 9d 00 04 lw ra,(sp+4) 8003760: 2b 8b 00 18 lw r11,(sp+24) 8003764: 2b 8c 00 14 lw r12,(sp+20) 8003768: 2b 8d 00 10 lw r13,(sp+16) 800376c: 2b 8e 00 0c lw r14,(sp+12) 8003770: 2b 8f 00 08 lw r15,(sp+8) 8003774: 37 9c 00 1c addi sp,sp,28 8003778: c3 a0 00 00 ret dev_t dev ) { int rv = 0; if (namelen != 3 || name [0] != 'd' || name [1] != 'e' || name [2] != 'v') { 800377c: 40 43 00 00 lbu r3,(r2+0) 8003780: 34 01 00 64 mvi r1,100 8003784: 5c 61 ff e3 bne r3,r1,8003710 <== NEVER TAKEN 8003788: 40 43 00 01 lbu r3,(r2+1) 800378c: 34 01 00 65 mvi r1,101 8003790: 5c 61 ff e0 bne r3,r1,8003710 <== NEVER TAKEN 8003794: 40 43 00 02 lbu r3,(r2+2) 8003798: 34 01 00 76 mvi r1,118 800379c: 5c 61 ff dd bne r3,r1,8003710 <== NEVER TAKEN } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { 80037a0: 20 8c f0 00 andi r12,r4,0xf000 80037a4: 34 02 40 00 mvi r2,16384 size_t namelen, mode_t mode, dev_t dev ) { int rv = 0; 80037a8: 34 01 00 00 mvi r1,0 } else { errno = ENOTSUP; rv = -1; } } else { if (!S_ISDIR(mode)) { 80037ac: 45 82 ff ec be r12,r2,800375c <== ALWAYS TAKEN errno = ENOTSUP; 80037b0: f8 00 27 fe calli 800d7a8 <__errno> 80037b4: 34 02 00 86 mvi r2,134 80037b8: 58 22 00 00 sw (r1+0),r2 rv = -1; 80037bc: 34 01 ff ff mvi r1,-1 80037c0: e3 ff ff e7 bi 800375c node->major = rtems_filesystem_dev_major_t(dev); node->minor = rtems_filesystem_dev_minor_t(dev); node->mode = mode; memcpy(dupname, name, namelen); } else { errno = ENOMEM; 80037c4: f8 00 27 f9 calli 800d7a8 <__errno> 80037c8: 34 02 00 0c mvi r2,12 80037cc: 58 22 00 00 sw (r1+0),r2 rv = -1; 80037d0: 34 01 ff ff mvi r1,-1 80037d4: e3 ff ff e2 bi 800375c =============================================================================== 080013e8 : */ static volatile bool diskdevs_protected; static rtems_status_code disk_lock(void) { 80013e8: 37 9c ff fc addi sp,sp,-4 80013ec: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 80013f0: 78 01 08 01 mvhi r1,0x801 80013f4: 38 21 a7 58 ori r1,r1,0xa758 80013f8: 28 21 00 00 lw r1,(r1+0) 80013fc: 34 02 00 00 mvi r2,0 8001400: 34 03 00 00 mvi r3,0 8001404: f8 00 0f b4 calli 80052d4 if (sc == RTEMS_SUCCESSFUL) { diskdevs_protected = true; return RTEMS_SUCCESSFUL; } else { return RTEMS_NOT_CONFIGURED; 8001408: 34 02 00 16 mvi r2,22 disk_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; sc = rtems_semaphore_obtain(diskdevs_mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc == RTEMS_SUCCESSFUL) { 800140c: 5c 20 00 06 bne r1,r0,8001424 <== NEVER TAKEN diskdevs_protected = true; 8001410: 78 01 08 01 mvhi r1,0x801 8001414: 34 02 00 01 mvi r2,1 8001418: 38 21 a7 5c ori r1,r1,0xa75c 800141c: 30 22 00 00 sb (r1+0),r2 return RTEMS_SUCCESSFUL; 8001420: 34 02 00 00 mvi r2,0 } else { return RTEMS_NOT_CONFIGURED; } } 8001424: b8 40 08 00 mv r1,r2 8001428: 2b 9d 00 04 lw ra,(sp+4) 800142c: 37 9c 00 04 addi sp,sp,4 8001430: c3 a0 00 00 ret =============================================================================== 08001434 : static void disk_unlock(void) { 8001434: 37 9c ff fc addi sp,sp,-4 8001438: 5b 9d 00 04 sw (sp+4),ra rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; sc = rtems_semaphore_release(diskdevs_mutex); 800143c: 78 01 08 01 mvhi r1,0x801 8001440: 38 21 a7 58 ori r1,r1,0xa758 static void disk_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 8001444: 78 02 08 01 mvhi r2,0x801 sc = rtems_semaphore_release(diskdevs_mutex); 8001448: 28 21 00 00 lw r1,(r1+0) static void disk_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 800144c: 38 42 a7 5c ori r2,r2,0xa75c 8001450: 30 40 00 00 sb (r2+0),r0 sc = rtems_semaphore_release(diskdevs_mutex); 8001454: f8 00 0f fc calli 8005444 if (sc != RTEMS_SUCCESSFUL) { 8001458: 5c 20 00 04 bne r1,r0,8001468 <== NEVER TAKEN /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); } } 800145c: 2b 9d 00 04 lw ra,(sp+4) 8001460: 37 9c 00 04 addi sp,sp,4 8001464: c3 a0 00 00 ret diskdevs_protected = false; sc = rtems_semaphore_release(diskdevs_mutex); if (sc != RTEMS_SUCCESSFUL) { /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); 8001468: 78 02 08 01 mvhi r2,0x801 <== NOT EXECUTED 800146c: 38 42 92 bc ori r2,r2,0x92bc <== NOT EXECUTED 8001470: 28 41 00 00 lw r1,(r2+0) <== NOT EXECUTED 8001474: f8 00 10 fc calli 8005864 <== NOT EXECUTED =============================================================================== 08004318 : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) { 8004318: 37 9c ff f0 addi sp,sp,-16 800431c: 5b 8b 00 10 sw (sp+16),r11 8004320: 5b 8c 00 0c sw (sp+12),r12 8004324: 5b 8d 00 08 sw (sp+8),r13 8004328: 5b 9d 00 04 sw (sp+4),ra 800432c: b8 20 58 00 mv r11,r1 rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { 8004330: 28 21 00 b4 lw r1,(r1+180) 8004334: 44 20 00 18 be r1,r0,8004394 rtems_interrupt_disable (level); 8004338: 90 00 08 00 rcsr r1,IE 800433c: 34 02 ff fe mvi r2,-2 8004340: a0 22 10 00 and r2,r1,r2 8004344: d0 02 00 00 wcsr IE,r2 while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { 8004348: 29 63 00 84 lw r3,(r11+132) 800434c: 29 62 00 80 lw r2,(r11+128) 8004350: 44 62 00 10 be r3,r2,8004390 <== ALWAYS TAKEN tty->rawOutBufState = rob_wait; 8004354: 34 0c 00 02 mvi r12,2 <== NOT EXECUTED rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); 8004358: 34 0d ff fe mvi r13,-2 <== NOT EXECUTED rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; 800435c: 59 6c 00 94 sw (r11+148),r12 <== NOT EXECUTED rtems_interrupt_enable (level); 8004360: d0 01 00 00 wcsr IE,r1 <== NOT EXECUTED sc = rtems_semaphore_obtain( 8004364: 29 61 00 8c lw r1,(r11+140) <== NOT EXECUTED 8004368: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 800436c: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 8004370: f8 00 0a 79 calli 8006d54 <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 8004374: 5c 20 00 0e bne r1,r0,80043ac <== NOT EXECUTED rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); 8004378: 90 00 08 00 rcsr r1,IE <== NOT EXECUTED 800437c: a0 2d 10 00 and r2,r1,r13 <== NOT EXECUTED 8004380: d0 02 00 00 wcsr IE,r2 <== NOT EXECUTED rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { 8004384: 29 63 00 84 lw r3,(r11+132) <== NOT EXECUTED 8004388: 29 62 00 80 lw r2,(r11+128) <== NOT EXECUTED 800438c: 5c 62 ff f4 bne r3,r2,800435c <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } rtems_interrupt_enable (level); 8004390: d0 01 00 00 wcsr IE,r1 } } 8004394: 2b 9d 00 04 lw ra,(sp+4) 8004398: 2b 8b 00 10 lw r11,(sp+16) 800439c: 2b 8c 00 0c lw r12,(sp+12) 80043a0: 2b 8d 00 08 lw r13,(sp+8) 80043a4: 37 9c 00 10 addi sp,sp,16 80043a8: c3 a0 00 00 ret tty->rawOutBufState = rob_wait; rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); 80043ac: f8 00 0d 00 calli 80077ac <== NOT EXECUTED =============================================================================== 08001be4 : */ int dup2( int fildes, int fildes2 ) { 8001be4: 37 9c ff a4 addi sp,sp,-92 8001be8: 5b 8b 00 14 sw (sp+20),r11 8001bec: 5b 8c 00 10 sw (sp+16),r12 8001bf0: 5b 8d 00 0c sw (sp+12),r13 8001bf4: 5b 8e 00 08 sw (sp+8),r14 8001bf8: 5b 9d 00 04 sw (sp+4),ra /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001bfc: 37 8c 00 18 addi r12,sp,24 */ int dup2( int fildes, int fildes2 ) { 8001c00: b8 40 68 00 mv r13,r2 /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001c04: b9 80 10 00 mv r2,r12 if ( status == -1 ) return -1; 8001c08: 34 0b ff ff mvi r11,-1 */ int dup2( int fildes, int fildes2 ) { 8001c0c: b8 20 70 00 mv r14,r1 /* * If fildes is not valid, then fildes2 should not be closed. */ status = fstat( fildes, &buf ); 8001c10: f8 00 01 61 calli 8002194 if ( status == -1 ) 8001c14: 5c 2b 00 09 bne r1,r11,8001c38 /* * This fcntl handles everything else. */ return fcntl( fildes, F_DUPFD, fildes2 ); } 8001c18: b9 60 08 00 mv r1,r11 8001c1c: 2b 9d 00 04 lw ra,(sp+4) 8001c20: 2b 8b 00 14 lw r11,(sp+20) 8001c24: 2b 8c 00 10 lw r12,(sp+16) 8001c28: 2b 8d 00 0c lw r13,(sp+12) 8001c2c: 2b 8e 00 08 lw r14,(sp+8) 8001c30: 37 9c 00 5c addi sp,sp,92 8001c34: c3 a0 00 00 ret /* * If fildes2 is not valid, then we should not do anything either. */ status = fstat( fildes2, &buf ); 8001c38: b9 a0 08 00 mv r1,r13 8001c3c: b9 80 10 00 mv r2,r12 8001c40: f8 00 01 55 calli 8002194 if ( status == -1 ) 8001c44: 44 2b ff f5 be r1,r11,8001c18 <== NEVER TAKEN /* * This fcntl handles everything else. */ return fcntl( fildes, F_DUPFD, fildes2 ); 8001c48: b9 c0 08 00 mv r1,r14 8001c4c: 34 02 00 00 mvi r2,0 8001c50: b9 a0 18 00 mv r3,r13 8001c54: f8 00 00 0b calli 8001c80 8001c58: b8 20 58 00 mv r11,r1 8001c5c: e3 ff ff ef bi 8001c18 =============================================================================== 080052b8 : /* * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { 80052b8: 37 9c ff f4 addi sp,sp,-12 80052bc: 5b 8b 00 08 sw (sp+8),r11 80052c0: 5b 9d 00 04 sw (sp+4),ra 80052c4: b8 40 58 00 mv r11,r2 if ((tty->termios.c_lflag & ECHOCTL) && 80052c8: 28 42 00 3c lw r2,(r2+60) 80052cc: 20 42 02 00 andi r2,r2,0x200 80052d0: 44 40 00 0b be r2,r0,80052fc <== NEVER TAKEN iscntrl(c) && (c != '\t') && (c != '\n')) { 80052d4: 78 02 08 02 mvhi r2,0x802 80052d8: 38 42 82 e0 ori r2,r2,0x82e0 80052dc: 28 42 00 00 lw r2,(r2+0) 80052e0: 7c 23 00 09 cmpnei r3,r1,9 80052e4: b4 41 10 00 add r2,r2,r1 80052e8: 40 42 00 01 lbu r2,(r2+1) 80052ec: 20 42 00 20 andi r2,r2,0x20 * Echo a typed character */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { if ((tty->termios.c_lflag & ECHOCTL) && 80052f0: 7c 42 00 00 cmpnei r2,r2,0 iscntrl(c) && (c != '\t') && (c != '\n')) { 80052f4: a0 43 10 00 and r2,r2,r3 80052f8: 5c 40 00 07 bne r2,r0,8005314 echobuf[0] = '^'; echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); tty->column += 2; } else { oproc (c, tty); 80052fc: b9 60 10 00 mv r2,r11 8005300: fb ff ff 8c calli 8005130 } } 8005304: 2b 9d 00 04 lw ra,(sp+4) 8005308: 2b 8b 00 08 lw r11,(sp+8) 800530c: 37 9c 00 0c addi sp,sp,12 8005310: c3 a0 00 00 ret */ static void echo (unsigned char c, struct rtems_termios_tty *tty) { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { 8005314: 34 02 00 0a mvi r2,10 8005318: 44 22 ff f9 be r1,r2,80052fc char echobuf[2]; echobuf[0] = '^'; echobuf[1] = c ^ 0x40; 800531c: 18 24 00 40 xori r4,r1,0x40 { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; 8005320: 34 05 00 5e mvi r5,94 echobuf[1] = c ^ 0x40; rtems_termios_puts (echobuf, 2, tty); 8005324: 37 81 00 0c addi r1,sp,12 8005328: 34 02 00 02 mvi r2,2 800532c: b9 60 18 00 mv r3,r11 { if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) { char echobuf[2]; echobuf[0] = '^'; 8005330: 33 85 00 0c sb (sp+12),r5 echobuf[1] = c ^ 0x40; 8005334: 33 84 00 0d sb (sp+13),r4 rtems_termios_puts (echobuf, 2, tty); 8005338: fb ff ff 25 calli 8004fcc tty->column += 2; 800533c: 29 61 00 28 lw r1,(r11+40) 8005340: 34 21 00 02 addi r1,r1,2 8005344: 59 61 00 28 sw (r11+40),r1 } else { oproc (c, tty); } } 8005348: 2b 9d 00 04 lw ra,(sp+4) 800534c: 2b 8b 00 08 lw r11,(sp+8) 8005350: 37 9c 00 0c addi sp,sp,12 8005354: c3 a0 00 00 ret =============================================================================== 080267b8 : void endgrent(void) { 80267b8: 37 9c ff fc addi sp,sp,-4 80267bc: 5b 9d 00 04 sw (sp+4),ra if (group_fp != NULL) 80267c0: 78 01 08 06 mvhi r1,0x806 80267c4: 38 21 ea 8c ori r1,r1,0xea8c 80267c8: 28 21 00 00 lw r1,(r1+0) 80267cc: 44 20 00 02 be r1,r0,80267d4 <== NEVER TAKEN fclose(group_fp); 80267d0: f8 00 5c 6b calli 803d97c } 80267d4: 2b 9d 00 04 lw ra,(sp+4) 80267d8: 37 9c 00 04 addi sp,sp,4 80267dc: c3 a0 00 00 ret =============================================================================== 080265e0 : void endpwent(void) { 80265e0: 37 9c ff fc addi sp,sp,-4 80265e4: 5b 9d 00 04 sw (sp+4),ra if (passwd_fp != NULL) 80265e8: 78 01 08 06 mvhi r1,0x806 80265ec: 38 21 eb 68 ori r1,r1,0xeb68 80265f0: 28 21 00 00 lw r1,(r1+0) 80265f4: 44 20 00 02 be r1,r0,80265fc <== NEVER TAKEN fclose(passwd_fp); 80265f8: f8 00 5c e1 calli 803d97c } 80265fc: 2b 9d 00 04 lw ra,(sp+4) 8026600: 37 9c 00 04 addi sp,sp,4 8026604: c3 a0 00 00 ret =============================================================================== 08005358 : * FIXME: Needs support for WERASE and ECHOPRT. * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { 8005358: 37 9c ff e0 addi sp,sp,-32 800535c: 5b 8b 00 20 sw (sp+32),r11 8005360: 5b 8c 00 1c sw (sp+28),r12 8005364: 5b 8d 00 18 sw (sp+24),r13 8005368: 5b 8e 00 14 sw (sp+20),r14 800536c: 5b 8f 00 10 sw (sp+16),r15 8005370: 5b 90 00 0c sw (sp+12),r16 8005374: 5b 91 00 08 sw (sp+8),r17 8005378: 5b 9d 00 04 sw (sp+4),ra if (tty->ccount == 0) 800537c: 28 24 00 20 lw r4,(r1+32) * FIXME: Needs support for WERASE and ECHOPRT. * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { 8005380: b8 20 58 00 mv r11,r1 8005384: b8 40 68 00 mv r13,r2 if (tty->ccount == 0) 8005388: 44 80 00 27 be r4,r0,8005424 return; if (lineFlag) { 800538c: 5c 40 00 30 bne r2,r0,800544c echo ('\n', tty); return; } } while (tty->ccount) { 8005390: 28 25 00 3c lw r5,(r1+60) 8005394: 20 a2 00 08 andi r2,r5,0x8 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 8005398: 78 0f 08 02 mvhi r15,0x802 800539c: 78 11 08 02 mvhi r17,0x802 80053a0: 78 0e 08 02 mvhi r14,0x802 unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { 80053a4: 34 10 00 09 mvi r16,9 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 80053a8: 39 ef 82 e0 ori r15,r15,0x82e0 80053ac: 3a 31 61 84 ori r17,r17,0x6184 80053b0: 39 ce 61 80 ori r14,r14,0x6180 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 80053b4: 29 67 00 1c lw r7,(r11+28) 80053b8: 34 84 ff ff addi r4,r4,-1 80053bc: 59 64 00 20 sw (r11+32),r4 80053c0: b4 e4 18 00 add r3,r7,r4 80053c4: 40 63 00 00 lbu r3,(r3+0) if (tty->termios.c_lflag & ECHO) { 80053c8: 44 40 00 0e be r2,r0,8005400 <== NEVER TAKEN if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 80053cc: 5d a0 00 03 bne r13,r0,80053d8 80053d0: 20 a1 00 10 andi r1,r5,0x10 80053d4: 44 2d 00 11 be r1,r13,8005418 <== NEVER TAKEN echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { 80053d8: 44 70 00 45 be r3,r16,80054ec rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 80053dc: 29 e2 00 00 lw r2,(r15+0) 80053e0: 34 6c 00 01 addi r12,r3,1 80053e4: ba 20 08 00 mv r1,r17 80053e8: b4 4c 10 00 add r2,r2,r12 80053ec: 40 42 00 00 lbu r2,(r2+0) 80053f0: 20 42 00 20 andi r2,r2,0x20 80053f4: 44 40 00 36 be r2,r0,80054cc <== ALWAYS TAKEN 80053f8: 20 a5 02 00 andi r5,r5,0x200 <== NOT EXECUTED 80053fc: 5c a0 00 24 bne r5,r0,800548c <== NOT EXECUTED if (tty->column) tty->column--; } } } if (!lineFlag) 8005400: 45 a0 00 09 be r13,r0,8005424 echo ('\n', tty); return; } } while (tty->ccount) { 8005404: 29 64 00 20 lw r4,(r11+32) 8005408: 44 80 00 07 be r4,r0,8005424 } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); if (tty->termios.c_lflag & ECHOK) echo ('\n', tty); 800540c: 29 65 00 3c lw r5,(r11+60) 8005410: 20 a2 00 08 andi r2,r5,0x8 8005414: e3 ff ff e8 bi 80053b4 while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); 8005418: 41 61 00 43 lbu r1,(r11+67) <== NOT EXECUTED 800541c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005420: fb ff ff a6 calli 80052b8 <== NOT EXECUTED } } if (!lineFlag) break; } } 8005424: 2b 9d 00 04 lw ra,(sp+4) 8005428: 2b 8b 00 20 lw r11,(sp+32) 800542c: 2b 8c 00 1c lw r12,(sp+28) 8005430: 2b 8d 00 18 lw r13,(sp+24) 8005434: 2b 8e 00 14 lw r14,(sp+20) 8005438: 2b 8f 00 10 lw r15,(sp+16) 800543c: 2b 90 00 0c lw r16,(sp+12) 8005440: 2b 91 00 08 lw r17,(sp+8) 8005444: 37 9c 00 20 addi sp,sp,32 8005448: c3 a0 00 00 ret erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { 800544c: 28 25 00 3c lw r5,(r1+60) 8005450: 20 a2 00 08 andi r2,r5,0x8 8005454: 44 40 00 48 be r2,r0,8005574 <== NEVER TAKEN tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { 8005458: 20 ac 00 10 andi r12,r5,0x10 800545c: 5d 80 ff cf bne r12,r0,8005398 <== ALWAYS TAKEN tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); 8005460: 40 21 00 44 lbu r1,(r1+68) <== NOT EXECUTED if (!(tty->termios.c_lflag & ECHO)) { tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; 8005464: 59 60 00 20 sw (r11+32),r0 <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 8005468: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 800546c: fb ff ff 93 calli 80052b8 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 8005470: 29 61 00 3c lw r1,(r11+60) <== NOT EXECUTED 8005474: 20 21 00 20 andi r1,r1,0x20 <== NOT EXECUTED 8005478: 44 2c ff eb be r1,r12,8005424 <== NOT EXECUTED echo ('\n', tty); 800547c: 34 01 00 0a mvi r1,10 <== NOT EXECUTED 8005480: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8005484: fb ff ff 8d calli 80052b8 <== NOT EXECUTED 8005488: e3 ff ff e7 bi 8005424 <== NOT EXECUTED tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 800548c: 34 02 00 03 mvi r2,3 <== NOT EXECUTED 8005490: b9 60 18 00 mv r3,r11 <== NOT EXECUTED 8005494: fb ff fe ce calli 8004fcc <== NOT EXECUTED if (tty->column) 8005498: 29 62 00 28 lw r2,(r11+40) <== NOT EXECUTED tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 800549c: ba 20 08 00 mv r1,r17 <== NOT EXECUTED if (tty->column) 80054a0: 44 40 00 03 be r2,r0,80054ac <== NOT EXECUTED tty->column--; 80054a4: 34 42 ff ff addi r2,r2,-1 <== NOT EXECUTED 80054a8: 59 62 00 28 sw (r11+40),r2 <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 80054ac: 29 e2 00 00 lw r2,(r15+0) <== NOT EXECUTED 80054b0: b4 4c 60 00 add r12,r2,r12 <== NOT EXECUTED 80054b4: 41 82 00 00 lbu r2,(r12+0) <== NOT EXECUTED 80054b8: 20 42 00 20 andi r2,r2,0x20 <== NOT EXECUTED 80054bc: 44 40 00 04 be r2,r0,80054cc <== NOT EXECUTED 80054c0: 29 62 00 3c lw r2,(r11+60) <== NOT EXECUTED 80054c4: 20 42 02 00 andi r2,r2,0x200 <== NOT EXECUTED 80054c8: 44 40 ff ce be r2,r0,8005400 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 80054cc: 34 02 00 03 mvi r2,3 80054d0: b9 60 18 00 mv r3,r11 80054d4: fb ff fe be calli 8004fcc if (tty->column) 80054d8: 29 61 00 28 lw r1,(r11+40) 80054dc: 44 20 ff c9 be r1,r0,8005400 <== NEVER TAKEN tty->column--; 80054e0: 34 21 ff ff addi r1,r1,-1 80054e4: 59 61 00 28 sw (r11+40),r1 80054e8: e3 ff ff c6 bi 8005400 if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { int col = tty->read_start_column; 80054ec: 29 6c 00 2c lw r12,(r11+44) int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 80054f0: 44 80 00 0f be r4,r0,800552c c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { 80054f4: 29 e1 00 00 lw r1,(r15+0) if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { int col = tty->read_start_column; int i = 0; 80054f8: 34 03 00 00 mvi r3,0 while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { if (tty->termios.c_lflag & ECHOCTL) 80054fc: 20 a5 02 00 andi r5,r5,0x200 * Erase a character or line * FIXME: Needs support for WERASE and ECHOPRT. * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) 8005500: b4 e3 10 00 add r2,r7,r3 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; 8005504: 40 46 00 00 lbu r6,(r2+0) 8005508: 34 63 00 01 addi r3,r3,1 if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { 800550c: b4 26 10 00 add r2,r1,r6 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { 8005510: 44 d0 00 15 be r6,r16,8005564 col = (col | 7) + 1; } else if (iscntrl (c)) { 8005514: 40 42 00 01 lbu r2,(r2+1) 8005518: 20 42 00 20 andi r2,r2,0x20 800551c: 44 40 00 0f be r2,r0,8005558 <== ALWAYS TAKEN if (tty->termios.c_lflag & ECHOCTL) 8005520: 44 a0 00 02 be r5,r0,8005528 <== NOT EXECUTED col += 2; 8005524: 35 8c 00 02 addi r12,r12,2 <== NOT EXECUTED int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 8005528: 5c 83 ff f6 bne r4,r3,8005500 <== NOT EXECUTED } /* * Back up over the tab */ while (tty->column > col) { 800552c: 29 61 00 28 lw r1,(r11+40) 8005530: 4d 81 ff b4 bge r12,r1,8005400 <== NEVER TAKEN rtems_termios_puts ("\b", 1, tty); 8005534: b9 60 18 00 mv r3,r11 8005538: b9 c0 08 00 mv r1,r14 800553c: 34 02 00 01 mvi r2,1 8005540: fb ff fe a3 calli 8004fcc tty->column--; 8005544: 29 63 00 28 lw r3,(r11+40) 8005548: 34 63 ff ff addi r3,r3,-1 800554c: 59 63 00 28 sw (r11+40),r3 } /* * Back up over the tab */ while (tty->column > col) { 8005550: 48 6c ff f9 bg r3,r12,8005534 8005554: e3 ff ff ab bi 8005400 col = (col | 7) + 1; } else if (iscntrl (c)) { if (tty->termios.c_lflag & ECHOCTL) col += 2; } else { col++; 8005558: 35 8c 00 01 addi r12,r12,1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 800555c: 5c 83 ff e9 bne r4,r3,8005500 8005560: e3 ff ff f3 bi 800552c c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; 8005564: 39 8c 00 07 ori r12,r12,0x7 8005568: 35 8c 00 01 addi r12,r12,1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 800556c: 5c 83 ff e5 bne r4,r3,8005500 <== ALWAYS TAKEN 8005570: e3 ff ff ef bi 800552c <== NOT EXECUTED { if (tty->ccount == 0) return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { tty->ccount = 0; 8005574: 58 20 00 20 sw (r1+32),r0 <== NOT EXECUTED return; 8005578: e3 ff ff ab bi 8005424 <== NOT EXECUTED =============================================================================== 08010df0 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 8010df0: 37 9c ff e0 addi sp,sp,-32 8010df4: 5b 8b 00 20 sw (sp+32),r11 8010df8: 5b 8c 00 1c sw (sp+28),r12 8010dfc: 5b 8d 00 18 sw (sp+24),r13 8010e00: 5b 8e 00 14 sw (sp+20),r14 8010e04: 5b 8f 00 10 sw (sp+16),r15 8010e08: 5b 90 00 0c sw (sp+12),r16 8010e0c: 5b 91 00 08 sw (sp+8),r17 8010e10: 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); 8010e14: 40 2e 00 02 lbu r14,(r1+2) 8010e18: 40 2f 00 0c lbu r15,(r1+12) 8010e1c: b8 20 58 00 mv r11,r1 8010e20: b8 40 60 00 mv r12,r2 8010e24: c9 ee 78 00 sub r15,r15,r14 8010e28: b8 40 08 00 mv r1,r2 8010e2c: b9 e0 10 00 mv r2,r15 8010e30: b8 60 88 00 mv r17,r3 8010e34: b8 80 80 00 mv r16,r4 8010e38: f8 00 78 70 calli 802eff8 <__lshrsi3> 8010e3c: 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) 8010e40: 41 61 00 89 lbu r1,(r11+137) 8010e44: 44 20 00 03 be r1,r0,8010e50 8010e48: 29 61 00 84 lw r1,(r11+132) 8010e4c: 44 2c 00 0e be r1,r12,8010e84 { fat_buf_release(fs_info); 8010e50: b9 60 08 00 mv r1,r11 8010e54: fb ff ff 6c calli 8010c04 if (op_type == FAT_OP_TYPE_READ) 8010e58: 34 01 00 01 mvi r1,1 8010e5c: 46 21 00 20 be r17,r1,8010edc 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); 8010e60: 29 61 00 64 lw r1,(r11+100) 8010e64: b9 a0 10 00 mv r2,r13 8010e68: 35 63 00 8c addi r3,r11,140 8010e6c: fb ff f5 9b calli 800e4d8 if (sc != RTEMS_SUCCESSFUL) 8010e70: 5c 20 00 20 bne r1,r0,8010ef0 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(EIO); fs_info->c.blk_num = sec_num; fs_info->c.modified = 0; fs_info->c.state = FAT_CACHE_ACTUAL; 8010e74: 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; 8010e78: 59 6c 00 84 sw (r11+132),r12 fs_info->c.modified = 0; 8010e7c: 31 60 00 88 sb (r11+136),r0 fs_info->c.state = FAT_CACHE_ACTUAL; 8010e80: 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); 8010e84: b9 e0 10 00 mv r2,r15 8010e88: b9 a0 08 00 mv r1,r13 8010e8c: fb ff c0 b6 calli 8001164 <__ashlsi3> } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 8010e90: 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); 8010e94: b9 c0 10 00 mv r2,r14 8010e98: c9 81 08 00 sub r1,r12,r1 8010e9c: fb ff c0 b2 calli 8001164 <__ashlsi3> 8010ea0: 29 63 00 1c lw r3,(r11+28) return RC_OK; 8010ea4: 34 02 00 00 mvi r2,0 rtems_set_errno_and_return_minus_one(EIO); fs_info->c.blk_num = sec_num; fs_info->c.modified = 0; fs_info->c.state = FAT_CACHE_ACTUAL; } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 8010ea8: b4 61 08 00 add r1,r3,r1 8010eac: 5a 01 00 00 sw (r16+0),r1 return RC_OK; } 8010eb0: b8 40 08 00 mv r1,r2 8010eb4: 2b 9d 00 04 lw ra,(sp+4) 8010eb8: 2b 8b 00 20 lw r11,(sp+32) 8010ebc: 2b 8c 00 1c lw r12,(sp+28) 8010ec0: 2b 8d 00 18 lw r13,(sp+24) 8010ec4: 2b 8e 00 14 lw r14,(sp+20) 8010ec8: 2b 8f 00 10 lw r15,(sp+16) 8010ecc: 2b 90 00 0c lw r16,(sp+12) 8010ed0: 2b 91 00 08 lw r17,(sp+8) 8010ed4: 37 9c 00 20 addi sp,sp,32 8010ed8: c3 a0 00 00 ret if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num) { fat_buf_release(fs_info); if (op_type == FAT_OP_TYPE_READ) sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 8010edc: 29 61 00 64 lw r1,(r11+100) 8010ee0: b9 a0 10 00 mv r2,r13 8010ee4: 35 63 00 8c addi r3,r11,140 8010ee8: fb ff f5 c6 calli 800e600 8010eec: e3 ff ff e1 bi 8010e70 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); 8010ef0: f8 00 2e 41 calli 801c7f4 <__errno> <== NOT EXECUTED 8010ef4: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8010ef8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8010efc: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8010f00: e3 ff ff ec bi 8010eb0 <== NOT EXECUTED =============================================================================== 08010c04 : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 8010c04: 37 9c ff e0 addi sp,sp,-32 8010c08: 5b 8b 00 1c sw (sp+28),r11 8010c0c: 5b 8c 00 18 sw (sp+24),r12 8010c10: 5b 8d 00 14 sw (sp+20),r13 8010c14: 5b 8e 00 10 sw (sp+16),r14 8010c18: 5b 8f 00 0c sw (sp+12),r15 8010c1c: 5b 90 00 08 sw (sp+8),r16 8010c20: 5b 9d 00 04 sw (sp+4),ra 8010c24: b8 20 58 00 mv r11,r1 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 8010c28: 40 21 00 89 lbu r1,(r1+137) return RC_OK; 8010c2c: 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) 8010c30: 44 20 00 44 be r1,r0,8010d40 return RC_OK; if (fs_info->c.modified) 8010c34: 41 61 00 88 lbu r1,(r11+136) 8010c38: 44 20 00 4c be r1,r0,8010d68 { uint32_t sec_num = fs_info->c.blk_num; 8010c3c: 29 6c 00 84 lw r12,(r11+132) bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 8010c40: 2d 61 00 18 lhu r1,(r11+24) 8010c44: 34 0d 00 00 mvi r13,0 8010c48: 54 2c 00 08 bgu r1,r12,8010c68 8010c4c: 29 61 00 20 lw r1,(r11+32) 8010c50: 51 81 00 06 bgeu r12,r1,8010c68 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) 8010c54: 41 61 00 54 lbu r1,(r11+84) uint32_t ino ) { return (ino >= fs_info->uino_base); } 8010c58: 41 6e 00 02 lbu r14,(r11+2) 8010c5c: 41 6f 00 0c lbu r15,(r11+12) return RC_OK; if (fs_info->c.modified) { uint32_t sec_num = fs_info->c.blk_num; bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 8010c60: 34 0d 00 01 mvi r13,1 uint32_t blk = fat_sector_num_to_block_num(fs_info, sec_num); uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info, sec_num, 0); if (sec_of_fat && !fs_info->vol.mirror) 8010c64: 44 20 00 49 be r1,r0,8010d88 <== ALWAYS TAKEN memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(fs_info->c.buf); 8010c68: 29 61 00 8c lw r1,(r11+140) 8010c6c: fb ff f7 31 calli 800e930 if (sc != RTEMS_SUCCESSFUL) 8010c70: 5c 20 00 41 bne r1,r0,8010d74 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; 8010c74: 31 60 00 88 sb (r11+136),r0 if (sec_of_fat && !fs_info->vol.mirror) 8010c78: 45 a1 00 30 be r13,r1,8010d38 8010c7c: 41 61 00 54 lbu r1,(r11+84) 8010c80: 5c 20 00 2e bne r1,r0,8010d38 <== NEVER TAKEN { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 8010c84: 41 61 00 0d lbu r1,(r11+13) 8010c88: 34 02 00 01 mvi r2,1 8010c8c: 50 41 00 2b bgeu r2,r1,8010d38 <== NEVER TAKEN 8010c90: 34 0c 00 01 mvi r12,1 { rtems_bdbuf_buffer *bd; sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i, 8010c94: 29 62 00 1c lw r2,(r11+28) 8010c98: b9 80 08 00 mv r1,r12 8010c9c: fb ff c1 80 calli 800129c <__mulsi3> static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 8010ca0: 41 6e 00 02 lbu r14,(r11+2) 8010ca4: 29 6d 00 84 lw r13,(r11+132) 8010ca8: 41 6f 00 0c lbu r15,(r11+12) 8010cac: b4 2d 68 00 add r13,r1,r13 8010cb0: c9 ee 78 00 sub r15,r15,r14 8010cb4: b9 e0 10 00 mv r2,r15 8010cb8: b9 a0 08 00 mv r1,r13 8010cbc: f8 00 78 cf calli 802eff8 <__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); 8010cc0: b9 e0 10 00 mv r2,r15 static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 8010cc4: b8 20 80 00 mv r16,r1 static inline uint32_t fat_block_num_to_sector_num (const fat_fs_info_t *fs_info, const uint32_t block_number) { return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 8010cc8: fb ff c1 27 calli 8001164 <__ashlsi3> { return sector_offset + ((sector - fat_block_num_to_sector_num (fs_info, fat_sector_num_to_block_num (fs_info, sector))) << fs_info->vol.sec_log2); 8010ccc: b9 c0 10 00 mv r2,r14 8010cd0: c9 a1 08 00 sub r1,r13,r1 8010cd4: fb ff c1 24 calli 8001164 <__ashlsi3> 8010cd8: b8 20 70 00 mv r14,r1 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); 8010cdc: ba 00 10 00 mv r2,r16 8010ce0: 37 83 00 20 addi r3,sp,32 blk = fat_sector_num_to_block_num(fs_info, sec_num); blk_ofs = fat_sector_offset_to_block_offset(fs_info, sec_num, 0); if (blk_ofs == 0 8010ce4: 5c 20 00 04 bne r1,r0,8010cf4 && fs_info->vol.bps == fs_info->vol.bytes_per_block) 8010ce8: 2d 64 00 00 lhu r4,(r11+0) 8010cec: 2d 61 00 0a lhu r1,(r11+10) 8010cf0: 44 81 00 37 be r4,r1,8010dcc { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); 8010cf4: 29 61 00 64 lw r1,(r11+100) 8010cf8: fb ff f6 42 calli 800e600 8010cfc: b8 20 68 00 mv r13,r1 } if ( sc != RTEMS_SUCCESSFUL) 8010d00: 5d a0 00 37 bne r13,r0,8010ddc <== NEVER TAKEN rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 8010d04: 2b 81 00 20 lw r1,(sp+32) 8010d08: 29 62 00 90 lw r2,(r11+144) 8010d0c: 2d 63 00 00 lhu r3,(r11+0) 8010d10: 28 21 00 1c lw r1,(r1+28) if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 8010d14: 35 8c 00 01 addi r12,r12,1 8010d18: 21 8c 00 ff andi r12,r12,0xff { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); } if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 8010d1c: b4 2e 08 00 add r1,r1,r14 8010d20: f8 00 32 03 calli 801d52c sc = rtems_bdbuf_release_modified(bd); 8010d24: 2b 81 00 20 lw r1,(sp+32) 8010d28: fb ff f7 02 calli 800e930 if ( sc != RTEMS_SUCCESSFUL) 8010d2c: 5c 2d 00 2c bne r1,r13,8010ddc <== NEVER TAKEN if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 8010d30: 41 61 00 0d lbu r1,(r11+13) 8010d34: 54 2c ff d8 bgu r1,r12,8010c94 <== NEVER TAKEN { sc = rtems_bdbuf_release(fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); } fs_info->c.state = FAT_CACHE_EMPTY; 8010d38: 31 60 00 89 sb (r11+137),r0 return RC_OK; 8010d3c: 34 0c 00 00 mvi r12,0 } 8010d40: b9 80 08 00 mv r1,r12 8010d44: 2b 9d 00 04 lw ra,(sp+4) 8010d48: 2b 8b 00 1c lw r11,(sp+28) 8010d4c: 2b 8c 00 18 lw r12,(sp+24) 8010d50: 2b 8d 00 14 lw r13,(sp+20) 8010d54: 2b 8e 00 10 lw r14,(sp+16) 8010d58: 2b 8f 00 0c lw r15,(sp+12) 8010d5c: 2b 90 00 08 lw r16,(sp+8) 8010d60: 37 9c 00 20 addi sp,sp,32 8010d64: c3 a0 00 00 ret } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 8010d68: 29 61 00 8c lw r1,(r11+140) 8010d6c: fb ff f6 b6 calli 800e844 if (sc != RTEMS_SUCCESSFUL) 8010d70: 44 2c ff f2 be r1,r12,8010d38 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EIO); 8010d74: f8 00 2e a0 calli 801c7f4 <__errno> <== NOT EXECUTED 8010d78: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8010d7c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8010d80: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8010d84: e3 ff ff ef bi 8010d40 <== 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); 8010d88: c9 ee 78 00 sub r15,r15,r14 8010d8c: b9 e0 10 00 mv r2,r15 8010d90: b9 80 08 00 mv r1,r12 8010d94: f8 00 78 99 calli 802eff8 <__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); 8010d98: b9 e0 10 00 mv r2,r15 8010d9c: fb ff c0 f2 calli 8001164 <__ashlsi3> sec_num, 0); if (sec_of_fat && !fs_info->vol.mirror) memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, 8010da0: 29 6f 00 8c lw r15,(r11+140) { return sector_offset + ((sector - fat_block_num_to_sector_num (fs_info, fat_sector_num_to_block_num (fs_info, sector))) << fs_info->vol.sec_log2); 8010da4: b9 c0 10 00 mv r2,r14 8010da8: c9 81 08 00 sub r1,r12,r1 8010dac: fb ff c0 ee calli 8001164 <__ashlsi3> uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info, sec_num, 0); if (sec_of_fat && !fs_info->vol.mirror) memcpy(fs_info->sec_buf, 8010db0: 29 e2 00 1c lw r2,(r15+28) 8010db4: 29 64 00 90 lw r4,(r11+144) 8010db8: 2d 63 00 00 lhu r3,(r11+0) 8010dbc: b4 41 10 00 add r2,r2,r1 8010dc0: b8 80 08 00 mv r1,r4 8010dc4: f8 00 31 da calli 801d52c 8010dc8: e3 ff ff a8 bi 8010c68 0); if (blk_ofs == 0 && fs_info->vol.bps == fs_info->vol.bytes_per_block) { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 8010dcc: 29 61 00 64 lw r1,(r11+100) 8010dd0: fb ff f5 c2 calli 800e4d8 8010dd4: b8 20 68 00 mv r13,r1 8010dd8: e3 ff ff ca bi 8010d00 if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(bd); if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); 8010ddc: f8 00 2e 86 calli 801c7f4 <__errno> <== NOT EXECUTED 8010de0: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8010de4: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8010de8: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8010dec: e3 ff ff d5 bi 8010d40 <== NOT EXECUTED =============================================================================== 080110d8 : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 80110d8: 37 9c ff cc addi sp,sp,-52 80110dc: 5b 8b 00 30 sw (sp+48),r11 80110e0: 5b 8c 00 2c sw (sp+44),r12 80110e4: 5b 8d 00 28 sw (sp+40),r13 80110e8: 5b 8e 00 24 sw (sp+36),r14 80110ec: 5b 8f 00 20 sw (sp+32),r15 80110f0: 5b 90 00 1c sw (sp+28),r16 80110f4: 5b 91 00 18 sw (sp+24),r17 80110f8: 5b 92 00 14 sw (sp+20),r18 80110fc: 5b 93 00 10 sw (sp+16),r19 8011100: 5b 94 00 0c sw (sp+12),r20 8011104: 5b 95 00 08 sw (sp+8),r21 8011108: 5b 9d 00 04 sw (sp+4),ra 801110c: b8 20 58 00 mv r11,r1 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8011110: 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) { 8011114: b8 60 78 00 mv r15,r3 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8011118: b8 80 70 00 mv r14,r4 801111c: c8 23 08 00 sub r1,r1,r3 fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 8011120: 20 b5 00 ff andi r21,r5,0xff ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8011124: 50 24 00 02 bgeu r1,r4,801112c <== ALWAYS TAKEN 8011128: b8 20 70 00 mv r14,r1 <== NOT EXECUTED fat_cluster_num_to_block_num (const fat_fs_info_t *fs_info, uint32_t cln) { uint32_t blk; if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 801112c: 5c 40 00 04 bne r2,r0,801113c <== ALWAYS TAKEN 8011130: 41 61 00 0e lbu r1,(r11+14) <== NOT EXECUTED 8011134: 20 21 00 03 andi r1,r1,0x3 <== NOT EXECUTED 8011138: 5c 22 00 5b bne r1,r2,80112a4 <== 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); 801113c: 41 63 00 08 lbu r3,(r11+8) 8011140: 41 6c 00 0c lbu r12,(r11+12) 8011144: 34 41 ff fe addi r1,r2,-2 8011148: c8 6c 10 00 sub r2,r3,r12 801114c: fb ff c0 06 calli 8001164 <__ashlsi3> static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 8011150: 41 62 00 02 lbu r2,(r11+2) 8011154: b8 20 88 00 mv r17,r1 8011158: 29 61 00 34 lw r1,(r11+52) 801115c: c9 82 10 00 sub r2,r12,r2 8011160: f8 00 77 a6 calli 802eff8 <__lshrsi3> blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); 8011164: b6 21 88 00 add r17,r17,r1 const uint8_t pattern) { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; 8011168: b9 e0 08 00 mv r1,r15 801116c: b9 80 10 00 mv r2,r12 8011170: f8 00 77 a2 calli 802eff8 <__lshrsi3> uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 8011174: b9 80 10 00 mv r2,r12 const uint8_t pattern) { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; 8011178: b8 20 68 00 mv r13,r1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 801117c: fb ff bf fa calli 8001164 <__ashlsi3> const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { ssize_t rc = RC_OK; 8011180: 34 04 00 00 mvi r4,0 8011184: 7d d2 00 00 cmpnei r18,r14,0 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 8011188: 64 83 00 00 cmpei r3,r4,0 { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 801118c: c9 e1 78 00 sub r15,r15,r1 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 8011190: a2 43 18 00 and r3,r18,r3 uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; 8011194: b5 b1 88 00 add r17,r13,r17 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; 8011198: 34 13 00 00 mvi r19,0 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 801119c: 34 14 00 01 mvi r20,1 ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 80111a0: 44 60 00 1c be r3,r0,8011210 <== NEVER TAKEN && (0 < bytes_to_write)) { uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 80111a4: 2d 70 00 0a lhu r16,(r11+10) 80111a8: ca 0f 30 00 sub r6,r16,r15 80111ac: b8 c0 60 00 mv r12,r6 80111b0: 51 c6 00 02 bgeu r14,r6,80111b8 <== ALWAYS TAKEN 80111b4: b9 c0 60 00 mv r12,r14 <== NOT EXECUTED const uint32_t offset, const uint32_t count, const uint8_t pattern) { int rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset)); 80111b8: b9 80 68 00 mv r13,r12 80111bc: 50 cc 00 02 bgeu r6,r12,80111c4 <== ALWAYS TAKEN 80111c0: b8 c0 68 00 mv r13,r6 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 80111c4: 41 63 00 02 lbu r3,(r11+2) 80111c8: 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) 80111cc: 45 a0 00 2f be r13,r0,8011288 <== 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); 80111d0: c8 83 10 00 sub r2,r4,r3 80111d4: ba 20 08 00 mv r1,r17 80111d8: fb ff bf e3 calli 8001164 <__ashlsi3> 80111dc: b8 20 10 00 mv r2,r1 { if (bytes_to_write == fs_info->vol.bytes_per_block) 80111e0: 46 0d 00 2c be r16,r13,8011290 { 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); 80111e4: b9 60 08 00 mv r1,r11 80111e8: 34 03 00 01 mvi r3,1 80111ec: 37 84 00 34 addi r4,sp,52 80111f0: fb ff ff 00 calli 8010df0 if (RC_OK == rc) 80111f4: 44 20 00 1f be r1,r0,8011270 <== ALWAYS TAKEN cur_blk, ofs_blk, c, pattern); if (c != ret) rc = -1; 80111f8: 34 04 ff ff mvi r4,-1 fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) 80111fc: 44 2c 00 16 be r1,r12,8011254 <== ALWAYS TAKEN rc = -1; else { bytes_to_write -= ret; bytes_written += ret; ++cur_blk; 8011200: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 8011204: 64 83 00 00 cmpei r3,r4,0 8011208: a2 43 18 00 and r3,r18,r3 801120c: 5c 60 ff e6 bne r3,r0,80111a4 <== NEVER TAKEN bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 8011210: 5c 83 00 02 bne r4,r3,8011218 <== NEVER TAKEN 8011214: ba 60 20 00 mv r4,r19 return rc; else return bytes_written; } 8011218: b8 80 08 00 mv r1,r4 801121c: 2b 9d 00 04 lw ra,(sp+4) 8011220: 2b 8b 00 30 lw r11,(sp+48) 8011224: 2b 8c 00 2c lw r12,(sp+44) 8011228: 2b 8d 00 28 lw r13,(sp+40) 801122c: 2b 8e 00 24 lw r14,(sp+36) 8011230: 2b 8f 00 20 lw r15,(sp+32) 8011234: 2b 90 00 1c lw r16,(sp+28) 8011238: 2b 91 00 18 lw r17,(sp+24) 801123c: 2b 92 00 14 lw r18,(sp+20) 8011240: 2b 93 00 10 lw r19,(sp+16) 8011244: 2b 94 00 0c lw r20,(sp+12) 8011248: 2b 95 00 08 lw r21,(sp+8) 801124c: 37 9c 00 34 addi sp,sp,52 8011250: c3 a0 00 00 ret pattern); if (c != ret) rc = -1; else { bytes_to_write -= ret; 8011254: c9 c1 70 00 sub r14,r14,r1 8011258: 7d d2 00 00 cmpnei r18,r14,0 bytes_written += ret; 801125c: b6 61 98 00 add r19,r19,r1 ++cur_blk; 8011260: 36 31 00 01 addi r17,r17,1 8011264: 34 04 00 00 mvi r4,0 8011268: 34 0f 00 00 mvi r15,0 801126c: e3 ff ff e6 bi 8011204 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); if (RC_OK == rc) { memset(blk_buf + offset, pattern, bytes_to_write); 8011270: 2b 81 00 34 lw r1,(sp+52) 8011274: ba a0 10 00 mv r2,r21 8011278: b9 a0 18 00 mv r3,r13 801127c: b4 2f 08 00 add r1,r1,r15 8011280: f8 00 30 ec calli 801d630 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 8011284: 31 74 00 88 sb (r11+136),r20 } } if (RC_OK != rc) return rc; else return bytes_to_write; 8011288: b9 a0 08 00 mv r1,r13 801128c: e3 ff ff db bi 80111f8 if (0 < bytes_to_write) { if (bytes_to_write == fs_info->vol.bytes_per_block) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 8011290: b9 60 08 00 mv r1,r11 8011294: 34 03 00 02 mvi r3,2 8011298: 37 84 00 34 addi r4,sp,52 801129c: fb ff fe d5 calli 8010df0 80112a0: e3 ff ff d5 bi 80111f4 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); 80112a4: 41 6c 00 0c lbu r12,(r11+12) <== NOT EXECUTED 80112a8: 41 62 00 02 lbu r2,(r11+2) <== NOT EXECUTED 80112ac: 29 61 00 20 lw r1,(r11+32) <== NOT EXECUTED 80112b0: c9 82 10 00 sub r2,r12,r2 <== NOT EXECUTED 80112b4: f8 00 77 51 calli 802eff8 <__lshrsi3> <== NOT EXECUTED 80112b8: b8 20 88 00 mv r17,r1 <== NOT EXECUTED 80112bc: e3 ff ff ab bi 8011168 <== NOT EXECUTED =============================================================================== 080112c0 : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 80112c0: 37 9c ff c8 addi sp,sp,-56 80112c4: 5b 8b 00 34 sw (sp+52),r11 80112c8: 5b 8c 00 30 sw (sp+48),r12 80112cc: 5b 8d 00 2c sw (sp+44),r13 80112d0: 5b 8e 00 28 sw (sp+40),r14 80112d4: 5b 8f 00 24 sw (sp+36),r15 80112d8: 5b 90 00 20 sw (sp+32),r16 80112dc: 5b 91 00 1c sw (sp+28),r17 80112e0: 5b 92 00 18 sw (sp+24),r18 80112e4: 5b 93 00 14 sw (sp+20),r19 80112e8: 5b 94 00 10 sw (sp+16),r20 80112ec: 5b 95 00 0c sw (sp+12),r21 80112f0: 5b 96 00 08 sw (sp+8),r22 80112f4: 5b 9d 00 04 sw (sp+4),ra 80112f8: b8 20 58 00 mv r11,r1 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 80112fc: 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) { 8011300: b8 60 78 00 mv r15,r3 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8011304: b8 80 68 00 mv r13,r4 8011308: 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) { 801130c: b8 a0 b0 00 mv r22,r5 8011310: 20 d4 00 ff andi r20,r6,0xff ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 8011314: 50 24 00 02 bgeu r1,r4,801131c <== ALWAYS TAKEN 8011318: b8 20 68 00 mv r13,r1 <== NOT EXECUTED fat_cluster_num_to_block_num (const fat_fs_info_t *fs_info, uint32_t cln) { uint32_t blk; if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 801131c: 5c 40 00 04 bne r2,r0,801132c 8011320: 41 61 00 0e lbu r1,(r11+14) 8011324: 20 21 00 03 andi r1,r1,0x3 8011328: 5c 22 00 5d bne r1,r2,801149c <== ALWAYS TAKEN blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc); else { cln -= FAT_RSRVD_CLN; blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 801132c: 41 63 00 08 lbu r3,(r11+8) 8011330: 41 6c 00 0c lbu r12,(r11+12) 8011334: 34 41 ff fe addi r1,r2,-2 8011338: c8 6c 10 00 sub r2,r3,r12 801133c: fb ff bf 8a calli 8001164 <__ashlsi3> 8011340: 41 62 00 02 lbu r2,(r11+2) 8011344: b8 20 88 00 mv r17,r1 8011348: 29 61 00 34 lw r1,(r11+52) 801134c: c9 82 10 00 sub r2,r12,r2 8011350: f8 00 77 2a calli 802eff8 <__lshrsi3> blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); 8011354: b6 21 88 00 add r17,r17,r1 const bool overwrite_cluster) { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); 8011358: b9 e0 08 00 mv r1,r15 801135c: b9 80 10 00 mv r2,r12 8011360: f8 00 77 26 calli 802eff8 <__lshrsi3> uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 8011364: b9 80 10 00 mv r2,r12 const bool overwrite_cluster) { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); 8011368: b8 20 70 00 mv r14,r1 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 801136c: fb ff bf 7e calli 8001164 <__ashlsi3> const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { ssize_t rc = RC_OK; 8011370: 34 02 00 00 mvi r2,0 8011374: 7d b2 00 00 cmpnei r18,r13,0 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 8011378: 64 43 00 00 cmpei r3,r2,0 { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 801137c: c9 e1 78 00 sub r15,r15,r1 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 8011380: a2 43 18 00 and r3,r18,r3 ssize_t bytes_written = 0; uint8_t *buffer = (uint8_t*)buff; ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; 8011384: b5 d1 88 00 add r17,r14,r17 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; 8011388: 34 13 00 00 mvi r19,0 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 801138c: 34 15 00 01 mvi r21,1 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 8011390: 44 60 00 1d be r3,r0,8011404 <== NEVER TAKEN && (0 < bytes_to_write)) { c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 8011394: 2d 70 00 0a lhu r16,(r11+10) 8011398: ca 0f 10 00 sub r2,r16,r15 801139c: b8 40 60 00 mv r12,r2 80113a0: 51 a2 00 02 bgeu r13,r2,80113a8 80113a4: b9 a0 60 00 mv r12,r13 const uint32_t count, const void *buf, const bool overwrite_block) { int rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset)); 80113a8: b9 80 70 00 mv r14,r12 80113ac: 50 4c 00 02 bgeu r2,r12,80113b4 <== ALWAYS TAKEN 80113b0: b8 40 70 00 mv r14,r2 <== NOT EXECUTED uint32_t ino ) { return (ino >= fs_info->uino_base); } 80113b4: 41 62 00 02 lbu r2,(r11+2) 80113b8: 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) 80113bc: 45 c0 00 31 be r14,r0,8011480 <== 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); 80113c0: c8 62 10 00 sub r2,r3,r2 80113c4: ba 20 08 00 mv r1,r17 80113c8: fb ff bf 67 calli 8001164 <__ashlsi3> 80113cc: b8 20 10 00 mv r2,r1 { if ( overwrite_block 80113d0: 5e 80 00 2e bne r20,r0,8011488 || (bytes_to_write == fs_info->vol.bytes_per_block)) 80113d4: 46 0e 00 2d be r16,r14,8011488 { 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); 80113d8: b9 60 08 00 mv r1,r11 80113dc: 34 03 00 01 mvi r3,1 80113e0: 37 84 00 38 addi r4,sp,56 80113e4: fb ff fe 83 calli 8010df0 if (RC_OK == rc) 80113e8: 44 20 00 20 be r1,r0,8011468 <== ALWAYS TAKEN ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) rc = -1; 80113ec: 34 02 ff ff mvi r2,-1 cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) 80113f0: 44 2c 00 17 be r1,r12,801144c <== ALWAYS TAKEN rc = -1; else { bytes_to_write -= ret; bytes_written += ret; ++cur_blk; 80113f4: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 80113f8: 64 43 00 00 cmpei r3,r2,0 80113fc: a2 43 18 00 and r3,r18,r3 8011400: 5c 60 ff e5 bne r3,r0,8011394 <== NEVER TAKEN bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 8011404: 5c 43 00 02 bne r2,r3,801140c <== NEVER TAKEN 8011408: ba 60 10 00 mv r2,r19 return rc; else return bytes_written; } 801140c: b8 40 08 00 mv r1,r2 8011410: 2b 9d 00 04 lw ra,(sp+4) 8011414: 2b 8b 00 34 lw r11,(sp+52) 8011418: 2b 8c 00 30 lw r12,(sp+48) 801141c: 2b 8d 00 2c lw r13,(sp+44) 8011420: 2b 8e 00 28 lw r14,(sp+40) 8011424: 2b 8f 00 24 lw r15,(sp+36) 8011428: 2b 90 00 20 lw r16,(sp+32) 801142c: 2b 91 00 1c lw r17,(sp+28) 8011430: 2b 92 00 18 lw r18,(sp+24) 8011434: 2b 93 00 14 lw r19,(sp+20) 8011438: 2b 94 00 10 lw r20,(sp+16) 801143c: 2b 95 00 0c lw r21,(sp+12) 8011440: 2b 96 00 08 lw r22,(sp+8) 8011444: 37 9c 00 38 addi sp,sp,56 8011448: c3 a0 00 00 ret overwrite_cluster); if (c != ret) rc = -1; else { bytes_to_write -= ret; 801144c: c9 a1 68 00 sub r13,r13,r1 8011450: 7d b2 00 00 cmpnei r18,r13,0 bytes_written += ret; 8011454: b6 61 98 00 add r19,r19,r1 ++cur_blk; 8011458: 36 31 00 01 addi r17,r17,1 801145c: 34 02 00 00 mvi r2,0 8011460: 34 0f 00 00 mvi r15,0 8011464: e3 ff ff e5 bi 80113f8 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); if (RC_OK == rc) { memcpy(blk_buf + offset, buf, bytes_to_write); 8011468: 2b 81 00 38 lw r1,(sp+56) 801146c: b6 d3 10 00 add r2,r22,r19 8011470: b9 c0 18 00 mv r3,r14 8011474: b4 2f 08 00 add r1,r1,r15 8011478: f8 00 30 2d calli 801d52c } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 801147c: 31 75 00 88 sb (r11+136),r21 } } if (RC_OK != rc) return rc; else return bytes_to_write; 8011480: b9 c0 08 00 mv r1,r14 8011484: e3 ff ff da bi 80113ec if (0 < bytes_to_write) { if ( overwrite_block || (bytes_to_write == fs_info->vol.bytes_per_block)) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 8011488: b9 60 08 00 mv r1,r11 801148c: 34 03 00 02 mvi r3,2 8011490: 37 84 00 38 addi r4,sp,56 8011494: fb ff fe 57 calli 8010df0 8011498: e3 ff ff d4 bi 80113e8 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); 801149c: 41 6c 00 0c lbu r12,(r11+12) 80114a0: 41 62 00 02 lbu r2,(r11+2) 80114a4: 29 61 00 20 lw r1,(r11+32) 80114a8: c9 82 10 00 sub r2,r12,r2 80114ac: f8 00 76 d3 calli 802eff8 <__lshrsi3> 80114b0: b8 20 88 00 mv r17,r1 80114b4: e3 ff ff a9 bi 8011358 =============================================================================== 080103d8 : int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 80103d8: 37 9c ff f0 addi sp,sp,-16 80103dc: 5b 8b 00 10 sw (sp+16),r11 80103e0: 5b 8c 00 0c sw (sp+12),r12 80103e4: 5b 8d 00 08 sw (sp+8),r13 80103e8: 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) 80103ec: 28 43 00 08 lw r3,(r2+8) 80103f0: 34 04 00 01 mvi r4,1 int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 80103f4: b8 40 58 00 mv r11,r2 80103f8: b8 20 68 00 mv r13,r1 /* * if links_num field of fat-file descriptor is greater than 1 * decrement the count of links and return */ if (fat_fd->links_num > 1) 80103fc: 50 83 00 0b bgeu r4,r3,8010428 { fat_fd->links_num--; 8010400: 34 63 ff ff addi r3,r3,-1 8010404: 58 43 00 08 sw (r2+8),r3 return rc; 8010408: 34 0c 00 00 mvi r12,0 * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); return rc; } 801040c: b9 80 08 00 mv r1,r12 8010410: 2b 9d 00 04 lw ra,(sp+4) 8010414: 2b 8b 00 10 lw r11,(sp+16) 8010418: 2b 8c 00 0c lw r12,(sp+12) 801041c: 2b 8d 00 08 lw r13,(sp+8) 8010420: 37 9c 00 10 addi sp,sp,16 8010424: c3 a0 00 00 ret return rc; } key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); if (fat_fd->flags & FAT_FILE_REMOVED) 8010428: 40 4c 00 30 lbu r12,(r2+48) 801042c: 21 8c 00 01 andi r12,r12,0x1 8010430: 45 80 00 0e be r12,r0,8010468 { rc = fat_file_truncate(fs_info, fat_fd, 0); 8010434: 34 03 00 00 mvi r3,0 8010438: fb ff ff 9a calli 80102a0 801043c: b8 20 60 00 mv r12,r1 if ( rc != RC_OK ) 8010440: 5c 20 ff f3 bne r1,r0,801040c <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 8010444: b9 60 08 00 mv r1,r11 8010448: f8 00 13 fd calli 801543c <_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) ) 801044c: 29 62 00 0c lw r2,(r11+12) 8010450: b9 a0 08 00 mv r1,r13 8010454: f8 00 07 dc calli 80123c4 8010458: 5c 2c 00 15 bne r1,r12,80104ac <== NEVER TAKEN fat_fd->links_num = 0; } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 801045c: b9 60 08 00 mv r1,r11 8010460: fb ff ca fa calli 8003048 8010464: e0 00 00 05 bi 8010478 free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 8010468: 28 42 00 0c lw r2,(r2+12) 801046c: f8 00 07 d6 calli 80123c4 8010470: 44 2c 00 0c be r1,r12,80104a0 { fat_fd->links_num = 0; 8010474: 59 60 00 08 sw (r11+8),r0 } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 8010478: b9 a0 08 00 mv r1,r13 801047c: f8 00 01 e2 calli 8010c04 8010480: b8 20 60 00 mv r12,r1 return rc; } 8010484: b9 80 08 00 mv r1,r12 8010488: 2b 9d 00 04 lw ra,(sp+4) 801048c: 2b 8b 00 10 lw r11,(sp+16) 8010490: 2b 8c 00 0c lw r12,(sp+12) 8010494: 2b 8d 00 08 lw r13,(sp+8) 8010498: 37 9c 00 10 addi sp,sp,16 801049c: c3 a0 00 00 ret 80104a0: b9 60 08 00 mv r1,r11 80104a4: f8 00 13 e6 calli 801543c <_Chain_Extract> 80104a8: e3 ff ff ed bi 801045c return rc; _hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd); if ( fat_ino_is_unique(fs_info, fat_fd->ino) ) fat_free_unique_ino(fs_info, fat_fd->ino); 80104ac: 29 62 00 0c lw r2,(r11+12) <== NOT EXECUTED 80104b0: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 80104b4: f8 00 07 af calli 8012370 <== NOT EXECUTED 80104b8: e3 ff ff e9 bi 801045c <== NOT EXECUTED =============================================================================== 080105ac : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 80105ac: 37 9c ff c4 addi sp,sp,-60 80105b0: 5b 8b 00 28 sw (sp+40),r11 80105b4: 5b 8c 00 24 sw (sp+36),r12 80105b8: 5b 8d 00 20 sw (sp+32),r13 80105bc: 5b 8e 00 1c sw (sp+28),r14 80105c0: 5b 8f 00 18 sw (sp+24),r15 80105c4: 5b 90 00 14 sw (sp+20),r16 80105c8: 5b 91 00 10 sw (sp+16),r17 80105cc: 5b 92 00 0c sw (sp+12),r18 80105d0: 5b 93 00 08 sw (sp+8),r19 80105d4: 5b 9d 00 04 sw (sp+4),ra 80105d8: b8 a0 88 00 mv r17,r5 uint32_t last_cl = 0; uint32_t bytes_remain = 0; uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; 80105dc: 5a 24 00 00 sw (r17+0),r4 if (new_length <= fat_fd->fat_file_size) 80105e0: 28 47 00 18 lw r7,(r2+24) uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; 80105e4: 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; 80105e8: 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 ) { 80105ec: b8 80 68 00 mv r13,r4 80105f0: b8 40 58 00 mv r11,r2 80105f4: b8 20 70 00 mv r14,r1 80105f8: 20 72 00 ff andi r18,r3,0xff ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; 80105fc: 34 0c 00 00 mvi r12,0 uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 8010600: 50 e4 00 11 bgeu r7,r4,8010644 return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 8010604: 28 42 00 20 lw r2,(r2+32) 8010608: 34 01 00 01 mvi r1,1 801060c: 44 41 00 49 be r2,r1,8010730 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - 8010610: 2d cf 00 06 lhu r15,(r14+6) (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & (fs_info->vol.bpc - 1); bytes2add = new_length - fat_fd->fat_file_size; 8010614: c9 a7 10 00 sub r2,r13,r7 if (bytes2add > bytes_remain) bytes2add -= bytes_remain; else bytes2add = 0; 8010618: 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))) & 801061c: 35 e1 ff ff addi r1,r15,-1 8010620: a0 27 98 00 and r19,r1,r7 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - 8010624: c9 f3 78 00 sub r15,r15,r19 8010628: a1 e1 78 00 and r15,r15,r1 (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & (fs_info->vol.bpc - 1); bytes2add = new_length - fat_fd->fat_file_size; if (bytes2add > bytes_remain) 801062c: 51 e2 00 02 bgeu r15,r2,8010634 bytes2add -= bytes_remain; 8010630: c8 4f 80 00 sub r16,r2,r15 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { 8010634: 46 40 00 02 be r18,r0,801063c 8010638: 5d e0 00 48 bne r15,r0,8010758 * 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; 801063c: 34 0c 00 00 mvi r12,0 /* * if in last cluster allocated for the file there is enough room to * handle extention (hence we don't need to add even one cluster to the * file ) - return */ if (bytes2add == 0) 8010640: 5e 00 00 0e bne r16,r0,8010678 *a_length = new_length; fat_fd->fat_file_size = new_length; return RC_OK; } 8010644: b9 80 08 00 mv r1,r12 8010648: 2b 9d 00 04 lw ra,(sp+4) 801064c: 2b 8b 00 28 lw r11,(sp+40) 8010650: 2b 8c 00 24 lw r12,(sp+36) 8010654: 2b 8d 00 20 lw r13,(sp+32) 8010658: 2b 8e 00 1c lw r14,(sp+28) 801065c: 2b 8f 00 18 lw r15,(sp+24) 8010660: 2b 90 00 14 lw r16,(sp+20) 8010664: 2b 91 00 10 lw r17,(sp+16) 8010668: 2b 92 00 0c lw r18,(sp+12) 801066c: 2b 93 00 08 lw r19,(sp+8) 8010670: 37 9c 00 3c addi sp,sp,60 8010674: c3 a0 00 00 ret * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 8010678: 41 c2 00 08 lbu r2,(r14+8) 801067c: 36 01 ff ff addi r1,r16,-1 8010680: f8 00 7a 5e calli 802eff8 <__lshrsi3> 8010684: 34 33 00 01 addi r19,r1,1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 8010688: 37 82 00 3c addi r2,sp,60 801068c: b9 c0 08 00 mv r1,r14 8010690: ba 60 18 00 mv r3,r19 8010694: 37 84 00 30 addi r4,sp,48 8010698: 37 85 00 34 addi r5,sp,52 801069c: ba 40 30 00 mv r6,r18 80106a0: f8 00 27 d7 calli 801a5fc 80106a4: b8 20 60 00 mv r12,r1 &cls_added, &last_cl, zero_fill); /* this means that low level I/O error occured */ if (rc != RC_OK) 80106a8: 5c 20 ff e7 bne r1,r0,8010644 <== NEVER TAKEN return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) 80106ac: 2b 92 00 30 lw r18,(sp+48) 80106b0: b9 f2 78 00 or r15,r15,r18 80106b4: 45 e1 00 24 be r15,r1,8010744 <== NEVER TAKEN rtems_set_errno_and_return_minus_one(ENOSPC); /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 80106b8: 46 72 00 09 be r19,r18,80106dc <== ALWAYS TAKEN { new_length -= bytes2add & (fs_info->vol.bpc - 1); 80106bc: 2d c3 00 06 lhu r3,(r14+6) <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 80106c0: 41 c2 00 08 lbu r2,(r14+8) <== NOT EXECUTED 80106c4: ca 72 08 00 sub r1,r19,r18 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOSPC); /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) { new_length -= bytes2add & (fs_info->vol.bpc - 1); 80106c8: 34 63 ff ff addi r3,r3,-1 <== NOT EXECUTED 80106cc: a2 03 80 00 and r16,r16,r3 <== NOT EXECUTED 80106d0: c9 b0 68 00 sub r13,r13,r16 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 80106d4: fb ff c2 a4 calli 8001164 <__ashlsi3> <== NOT EXECUTED 80106d8: c9 a1 68 00 sub r13,r13,r1 <== NOT EXECUTED } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) 80106dc: 29 64 00 18 lw r4,(r11+24) 80106e0: 5c 80 00 34 bne r4,r0,80107b0 { fat_fd->map.disk_cln = fat_fd->cln = chain; 80106e4: 2b 81 00 3c lw r1,(sp+60) fat_fd->map.file_cln = 0; 80106e8: 59 60 00 34 sw (r11+52),r0 } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) { fat_fd->map.disk_cln = fat_fd->cln = chain; 80106ec: 59 61 00 1c sw (r11+28),r1 80106f0: 59 61 00 38 sw (r11+56),r1 } fat_buf_release(fs_info); } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 80106f4: 46 40 00 2c be r18,r0,80107a4 <== NEVER TAKEN { fat_fd->map.last_cln = last_cl; 80106f8: 2b 81 00 34 lw r1,(sp+52) if (fat_fd->fat_file_type == FAT_DIRECTORY) 80106fc: 29 6f 00 10 lw r15,(r11+16) } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) { fat_fd->map.last_cln = last_cl; 8010700: 59 61 00 3c sw (r11+60),r1 if (fat_fd->fat_file_type == FAT_DIRECTORY) 8010704: 5d e0 00 28 bne r15,r0,80107a4 { rc = fat_init_clusters_chain(fs_info, chain); 8010708: 2b 82 00 3c lw r2,(sp+60) 801070c: b9 c0 08 00 mv r1,r14 8010710: f8 00 06 a2 calli 8012198 8010714: b8 20 18 00 mv r3,r1 if ( rc != RC_OK ) 8010718: 44 2f 00 23 be r1,r15,80107a4 <== ALWAYS TAKEN { fat_free_fat_clusters_chain(fs_info, chain); 801071c: 2b 82 00 3c lw r2,(sp+60) <== NOT EXECUTED 8010720: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED return rc; 8010724: b8 60 60 00 mv r12,r3 <== NOT EXECUTED if (fat_fd->fat_file_type == FAT_DIRECTORY) { rc = fat_init_clusters_chain(fs_info, chain); if ( rc != RC_OK ) { fat_free_fat_clusters_chain(fs_info, chain); 8010728: f8 00 27 73 calli 801a4f4 <== NOT EXECUTED return rc; 801072c: e3 ff ff c6 bi 8010644 <== NOT EXECUTED *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 8010730: 29 61 00 24 lw r1,(r11+36) 8010734: 5c 20 ff b7 bne r1,r0,8010610 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 8010738: 41 c1 00 0e lbu r1,(r14+14) 801073c: 20 21 00 03 andi r1,r1,0x3 *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 8010740: 44 2c ff b4 be r1,r12,8010610 <== NEVER TAKEN if (rc != RC_OK) return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) rtems_set_errno_and_return_minus_one(ENOSPC); 8010744: f8 00 30 2c calli 801c7f4 <__errno> 8010748: 34 02 00 1c mvi r2,28 801074c: 58 22 00 00 sw (r1+0),r2 8010750: 34 0c ff ff mvi r12,-1 8010754: e3 ff ff bc bi 8010644 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { uint32_t start = fat_fd->fat_file_size; uint32_t cl_start = start >> fs_info->vol.bpc_log2; 8010758: 41 c2 00 08 lbu r2,(r14+8) 801075c: b8 e0 08 00 mv r1,r7 8010760: f8 00 7a 26 calli 802eff8 <__lshrsi3> 8010764: 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); 8010768: b9 60 10 00 mv r2,r11 801076c: b9 c0 08 00 mv r1,r14 8010770: 37 84 00 2c addi r4,sp,44 8010774: fb ff fd 31 calli 800fc38 8010778: b8 20 60 00 mv r12,r1 if (rc != RC_OK) 801077c: 5c 20 ff b2 bne r1,r0,8010644 <== NEVER TAKEN return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 8010780: 2b 82 00 2c lw r2,(sp+44) 8010784: b9 c0 08 00 mv r1,r14 8010788: ba 60 18 00 mv r3,r19 801078c: b9 e0 20 00 mv r4,r15 8010790: 34 05 00 00 mvi r5,0 8010794: f8 00 02 51 calli 80110d8 if (bytes_remain != bytes_written) return -1; 8010798: 34 0c ff ff mvi r12,-1 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); if (bytes_remain != bytes_written) 801079c: 5c 2f ff aa bne r1,r15,8010644 <== NEVER TAKEN 80107a0: e3 ff ff a7 bi 801063c return rc; } } } *a_length = new_length; 80107a4: 5a 2d 00 00 sw (r17+0),r13 fat_fd->fat_file_size = new_length; 80107a8: 59 6d 00 18 sw (r11+24),r13 return RC_OK; 80107ac: e3 ff ff a6 bi 8010644 fat_fd->map.disk_cln = fat_fd->cln = chain; fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 80107b0: 29 62 00 3c lw r2,(r11+60) 80107b4: 34 01 ff ff mvi r1,-1 80107b8: 44 41 00 0c be r2,r1,80107e8 <== NEVER TAKEN { old_last_cl = fat_fd->map.last_cln; 80107bc: 5b 82 00 38 sw (sp+56),r2 fat_free_fat_clusters_chain(fs_info, chain); return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); 80107c0: 2b 83 00 3c lw r3,(sp+60) 80107c4: b9 c0 08 00 mv r1,r14 80107c8: f8 00 26 3c calli 801a0b8 80107cc: b8 20 18 00 mv r3,r1 if ( rc != RC_OK ) 80107d0: 5c 20 ff d3 bne r1,r0,801071c <== NEVER TAKEN { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); 80107d4: b9 c0 08 00 mv r1,r14 80107d8: f8 00 01 0b calli 8010c04 80107dc: 2b 92 00 30 lw r18,(sp+48) } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 80107e0: 46 40 ff f1 be r18,r0,80107a4 <== NEVER TAKEN 80107e4: e3 ff ff c5 bi 80106f8 { old_last_cl = fat_fd->map.last_cln; } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 80107e8: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 80107ec: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 80107f0: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 80107f4: 34 84 ff ff addi r4,r4,-1 <== NOT EXECUTED 80107f8: 37 85 00 38 addi r5,sp,56 <== NOT EXECUTED 80107fc: fb ff ff 30 calli 80104bc <== NOT EXECUTED 8010800: b8 20 18 00 mv r3,r1 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 8010804: 5c 20 ff c6 bne r1,r0,801071c <== NOT EXECUTED { fat_free_fat_clusters_chain(fs_info, chain); return rc; 8010808: 2b 82 00 38 lw r2,(sp+56) <== NOT EXECUTED 801080c: e3 ff ff ed bi 80107c0 <== NOT EXECUTED =============================================================================== 080104bc : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 80104bc: 37 9c ff d4 addi sp,sp,-44 80104c0: 5b 8b 00 10 sw (sp+16),r11 80104c4: 5b 8c 00 0c sw (sp+12),r12 80104c8: 5b 8d 00 08 sw (sp+8),r13 80104cc: 5b 9d 00 04 sw (sp+4),ra 80104d0: b8 20 60 00 mv r12,r1 80104d4: 5b 83 00 18 sw (sp+24),r3 80104d8: 5b 84 00 1c sw (sp+28),r4 80104dc: 5b 85 00 20 sw (sp+32),r5 80104e0: 5b 86 00 24 sw (sp+36),r6 80104e4: 5b 87 00 28 sw (sp+40),r7 80104e8: 5b 88 00 2c sw (sp+44),r8 int rc = RC_OK; uint32_t cur_cln = 0; 80104ec: 5b 80 00 14 sw (sp+20),r0 uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 80104f0: 34 01 00 01 mvi r1,1 fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 80104f4: b8 40 58 00 mv r11,r2 uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 80104f8: 44 61 00 0b be r3,r1,8010524 <== ALWAYS TAKEN *ret = cur_cln; break; default: errno = EINVAL; 80104fc: f8 00 30 be calli 801c7f4 <__errno> <== NOT EXECUTED 8010500: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8010504: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rc = -1; 8010508: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED break; } va_end(ap); return rc; } 801050c: 2b 9d 00 04 lw ra,(sp+4) 8010510: 2b 8b 00 10 lw r11,(sp+16) 8010514: 2b 8c 00 0c lw r12,(sp+12) 8010518: 2b 8d 00 08 lw r13,(sp+8) 801051c: 37 9c 00 2c addi sp,sp,44 8010520: c3 a0 00 00 ret case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 8010524: 28 41 00 18 lw r1,(r2+24) switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); 8010528: b8 a0 68 00 mv r13,r5 /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 801052c: 54 24 00 06 bgu r1,r4,8010544 <== ALWAYS TAKEN va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); 8010530: f8 00 30 b1 calli 801c7f4 <__errno> <== NOT EXECUTED 8010534: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8010538: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 801053c: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8010540: e3 ff ff f3 bi 801050c <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 8010544: 28 41 00 20 lw r1,(r2+32) 8010548: 44 23 00 12 be r1,r3,8010590 *ret = 0; rc = RC_OK; break; } cl_start = pos >> fs_info->vol.bpc_log2; 801054c: 41 82 00 08 lbu r2,(r12+8) 8010550: b8 80 08 00 mv r1,r4 8010554: f8 00 7a a9 calli 802eff8 <__lshrsi3> 8010558: b8 20 18 00 mv r3,r1 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 801055c: b9 60 10 00 mv r2,r11 8010560: b9 80 08 00 mv r1,r12 8010564: 37 84 00 14 addi r4,sp,20 8010568: fb ff fd b4 calli 800fc38 if ( rc != RC_OK ) 801056c: 5c 20 ff e8 bne r1,r0,801050c <== NEVER TAKEN break; *ret = cur_cln; 8010570: 2b 82 00 14 lw r2,(sp+20) 8010574: 59 a2 00 00 sw (r13+0),r2 rc = -1; break; } va_end(ap); return rc; } 8010578: 2b 9d 00 04 lw ra,(sp+4) 801057c: 2b 8b 00 10 lw r11,(sp+16) 8010580: 2b 8c 00 0c lw r12,(sp+12) 8010584: 2b 8d 00 08 lw r13,(sp+8) 8010588: 37 9c 00 2c addi sp,sp,44 801058c: c3 a0 00 00 ret if ( pos >= fat_fd->fat_file_size ) { va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 8010590: 28 41 00 24 lw r1,(r2+36) 8010594: 5c 20 ff ee bne r1,r0,801054c <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 8010598: 41 82 00 0e lbu r2,(r12+14) 801059c: 20 42 00 03 andi r2,r2,0x3 if ( pos >= fat_fd->fat_file_size ) { va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 80105a0: 44 41 ff eb be r2,r1,801054c (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { /* cluster 0 (zero) reserved for root dir */ *ret = 0; 80105a4: 58 a0 00 00 sw (r5+0),r0 rc = RC_OK; break; 80105a8: e3 ff ff d9 bi 801050c =============================================================================== 0800fc38 : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 800fc38: 37 9c ff e0 addi sp,sp,-32 800fc3c: 5b 8b 00 1c sw (sp+28),r11 800fc40: 5b 8c 00 18 sw (sp+24),r12 800fc44: 5b 8d 00 14 sw (sp+20),r13 800fc48: 5b 8e 00 10 sw (sp+16),r14 800fc4c: 5b 8f 00 0c sw (sp+12),r15 800fc50: 5b 90 00 08 sw (sp+8),r16 800fc54: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 800fc58: 28 4c 00 34 lw r12,(r2+52) fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 800fc5c: b8 40 78 00 mv r15,r2 800fc60: b8 60 70 00 mv r14,r3 800fc64: b8 20 68 00 mv r13,r1 800fc68: b8 80 80 00 mv r16,r4 int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 800fc6c: 45 83 00 22 be r12,r3,800fcf4 { uint32_t cur_cln; uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) 800fc70: 51 83 00 17 bgeu r12,r3,800fccc <== NEVER TAKEN { cur_cln = fat_fd->map.disk_cln; 800fc74: 28 42 00 38 lw r2,(r2+56) count = file_cln - fat_fd->map.file_cln; 800fc78: c8 6c 60 00 sub r12,r3,r12 uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) { cur_cln = fat_fd->map.disk_cln; 800fc7c: 5b 82 00 20 sw (sp+32),r2 cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 800fc80: 45 80 00 18 be r12,r0,800fce0 <== NEVER TAKEN 800fc84: 34 0b 00 00 mvi r11,0 800fc88: e0 00 00 03 bi 800fc94 800fc8c: 51 6c 00 14 bgeu r11,r12,800fcdc 800fc90: 2b 82 00 20 lw r2,(sp+32) { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 800fc94: b9 a0 08 00 mv r1,r13 800fc98: 37 83 00 20 addi r3,sp,32 800fc9c: f8 00 28 4a calli 8019dc4 cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 800fca0: 35 6b 00 01 addi r11,r11,1 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) 800fca4: 44 20 ff fa be r1,r0,800fc8c <== ALWAYS TAKEN fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } 800fca8: 2b 9d 00 04 lw ra,(sp+4) 800fcac: 2b 8b 00 1c lw r11,(sp+28) 800fcb0: 2b 8c 00 18 lw r12,(sp+24) 800fcb4: 2b 8d 00 14 lw r13,(sp+20) 800fcb8: 2b 8e 00 10 lw r14,(sp+16) 800fcbc: 2b 8f 00 0c lw r15,(sp+12) 800fcc0: 2b 90 00 08 lw r16,(sp+8) 800fcc4: 37 9c 00 20 addi sp,sp,32 800fcc8: c3 a0 00 00 ret cur_cln = fat_fd->map.disk_cln; count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; 800fccc: 28 42 00 1c lw r2,(r2+28) 800fcd0: b8 60 60 00 mv r12,r3 800fcd4: 5b 82 00 20 sw (sp+32),r2 800fcd8: e3 ff ff ea bi 800fc80 count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 800fcdc: 2b 82 00 20 lw r2,(sp+32) if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; 800fce0: 59 ee 00 34 sw (r15+52),r14 fat_fd->map.disk_cln = cur_cln; 800fce4: 59 e2 00 38 sw (r15+56),r2 *disk_cln = cur_cln; 800fce8: 5a 02 00 00 sw (r16+0),r2 } return RC_OK; 800fcec: 34 01 00 00 mvi r1,0 800fcf0: e3 ff ff ee bi 800fca8 ) { int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) *disk_cln = fat_fd->map.disk_cln; 800fcf4: 28 42 00 38 lw r2,(r2+56) fat_fd->map.file_cln = file_cln; fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; 800fcf8: 34 01 00 00 mvi r1,0 ) { int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) *disk_cln = fat_fd->map.disk_cln; 800fcfc: 58 82 00 00 sw (r4+0),r2 800fd00: e3 ff ff ea bi 800fca8 =============================================================================== 0800fd04 : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 800fd04: 37 9c ff d4 addi sp,sp,-44 800fd08: 5b 8b 00 2c sw (sp+44),r11 800fd0c: 5b 8c 00 28 sw (sp+40),r12 800fd10: 5b 8d 00 24 sw (sp+36),r13 800fd14: 5b 8e 00 20 sw (sp+32),r14 800fd18: 5b 8f 00 1c sw (sp+28),r15 800fd1c: 5b 90 00 18 sw (sp+24),r16 800fd20: 5b 91 00 14 sw (sp+20),r17 800fd24: 5b 92 00 10 sw (sp+16),r18 800fd28: 5b 93 00 0c sw (sp+12),r19 800fd2c: 5b 94 00 08 sw (sp+8),r20 800fd30: 5b 9d 00 04 sw (sp+4),ra static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800fd34: 28 45 00 00 lw r5,(r2+0) 800fd38: b8 20 60 00 mv r12,r1 fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 800fd3c: 34 01 00 01 mvi r1,1 800fd40: b8 40 80 00 mv r16,r2 800fd44: b8 60 a0 00 mv r20,r3 return 1; 800fd48: 34 0b 00 01 mvi r11,1 fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 800fd4c: 44 a1 00 0a be r5,r1,800fd74 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)) ) 800fd50: 44 a0 00 58 be r5,r0,800feb0 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800fd54: 41 82 00 05 lbu r2,(r12+5) 800fd58: 34 a1 ff fe addi r1,r5,-2 800fd5c: fb ff c5 02 calli 8001164 <__ashlsi3> 800fd60: 29 82 00 34 lw r2,(r12+52) 800fd64: b4 22 08 00 add r1,r1,r2 ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 800fd68: 41 82 00 03 lbu r2,(r12+3) 800fd6c: fb ff c4 fe calli 8001164 <__ashlsi3> 800fd70: b8 20 58 00 mv r11,r1 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fd74: 2a 0d 00 04 lw r13,(r16+4) 800fd78: 34 02 00 09 mvi r2,9 800fd7c: b9 a0 08 00 mv r1,r13 800fd80: f8 00 7c 9e calli 802eff8 <__lshrsi3> ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fd84: 01 a5 00 01 srui r5,r13,1 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800fd88: b5 61 20 00 add r4,r11,r1 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fd8c: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fd90: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fd94: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fd98: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fd9c: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fda0: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fda4: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fda8: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fdac: 20 ad 00 0f andi r13,r5,0xf static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800fdb0: b4 8d 68 00 add r13,r4,r13 uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { uint32_t mod = (key1) % FAT_HASH_MODULE; 800fdb4: 21 a1 00 01 andi r1,r13,0x1 rtems_chain_node *the_node = rtems_chain_first(hash + mod); 800fdb8: b4 21 88 00 add r17,r1,r1 800fdbc: b6 21 88 00 add r17,r17,r1 800fdc0: 29 81 00 6c lw r1,(r12+108) 800fdc4: b6 31 88 00 add r17,r17,r17 800fdc8: b6 31 88 00 add r17,r17,r17 800fdcc: b4 31 08 00 add r1,r1,r17 fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } 800fdd0: 28 2b 00 00 lw r11,(r1+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 800fdd4: 34 32 00 04 addi r18,r1,4 ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 800fdd8: 45 72 00 3d be r11,r18,800fecc fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 800fddc: 34 13 00 01 mvi r19,1 800fde0: 29 62 00 20 lw r2,(r11+32) return 1; 800fde4: 34 0e 00 01 mvi r14,1 ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800fde8: 34 41 ff fe addi r1,r2,-2 fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 800fdec: 44 53 00 09 be r2,r19,800fe10 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)) ) 800fdf0: 44 40 00 2b be r2,r0,800fe9c return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800fdf4: 41 82 00 05 lbu r2,(r12+5) 800fdf8: fb ff c4 db calli 8001164 <__ashlsi3> 800fdfc: 29 82 00 34 lw r2,(r12+52) 800fe00: b4 22 08 00 add r1,r1,r2 ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 800fe04: 41 82 00 03 lbu r2,(r12+3) 800fe08: fb ff c4 d7 calli 8001164 <__ashlsi3> 800fe0c: b8 20 70 00 mv r14,r1 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fe10: 29 6f 00 24 lw r15,(r11+36) 800fe14: 34 02 00 09 mvi r2,9 800fe18: b9 e0 08 00 mv r1,r15 800fe1c: f8 00 7c 77 calli 802eff8 <__lshrsi3> ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fe20: 01 e5 00 01 srui r5,r15,1 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800fe24: b5 c1 20 00 add r4,r14,r1 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fe28: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fe2c: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fe30: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fe34: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fe38: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fe3c: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fe40: 00 a5 00 01 srui r5,r5,1 fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800fe44: b4 84 20 00 add r4,r4,r4 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800fe48: 20 a5 00 0f andi r5,r5,0xf static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800fe4c: b4 85 20 00 add r4,r4,r5 { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); if ( (key1) == ck) 800fe50: 5d a4 00 1d bne r13,r4,800fec4 rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); if ( rc == RC_OK ) { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; lfat_fd->links_num++; 800fe54: 29 62 00 08 lw r2,(r11+8) /* access "valid" hash table */ rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); if ( rc == RC_OK ) { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; 800fe58: 5a 8b 00 00 sw (r20+0),r11 lfat_fd->links_num++; return rc; 800fe5c: 34 01 00 00 mvi r1,0 rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); if ( rc == RC_OK ) { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; lfat_fd->links_num++; 800fe60: 34 42 00 01 addi r2,r2,1 800fe64: 59 62 00 08 sw (r11+8),r2 * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; } 800fe68: 2b 9d 00 04 lw ra,(sp+4) 800fe6c: 2b 8b 00 2c lw r11,(sp+44) 800fe70: 2b 8c 00 28 lw r12,(sp+40) 800fe74: 2b 8d 00 24 lw r13,(sp+36) 800fe78: 2b 8e 00 20 lw r14,(sp+32) 800fe7c: 2b 8f 00 1c lw r15,(sp+28) 800fe80: 2b 90 00 18 lw r16,(sp+24) 800fe84: 2b 91 00 14 lw r17,(sp+20) 800fe88: 2b 92 00 10 lw r18,(sp+16) 800fe8c: 2b 93 00 0c lw r19,(sp+12) 800fe90: 2b 94 00 08 lw r20,(sp+8) 800fe94: 37 9c 00 2c addi sp,sp,44 800fe98: c3 a0 00 00 ret fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 800fe9c: 41 83 00 0e lbu r3,(r12+14) 800fea0: 20 63 00 03 andi r3,r3,0x3 800fea4: 44 62 ff d4 be r3,r2,800fdf4 <== NEVER TAKEN return fs_info->vol.rdir_loc; 800fea8: 29 81 00 20 lw r1,(r12+32) 800feac: e3 ff ff d6 bi 800fe04 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)) ) 800feb0: 41 81 00 0e lbu r1,(r12+14) 800feb4: 20 21 00 03 andi r1,r1,0x3 800feb8: 44 25 ff a7 be r1,r5,800fd54 <== NEVER TAKEN return fs_info->vol.rdir_loc; 800febc: 29 81 00 20 lw r1,(r12+32) 800fec0: e3 ff ff aa bi 800fd68 { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 800fec4: 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) ; ) 800fec8: 5d 72 ff c6 bne r11,r18,800fde0 uint32_t key2, fat_file_fd_t **ret ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); 800fecc: 29 93 00 70 lw r19,(r12+112) fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 800fed0: 34 12 00 01 mvi r18,1 800fed4: b6 71 98 00 add r19,r19,r17 fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } 800fed8: 2a 6b 00 00 lw r11,(r19+0) 800fedc: 36 73 00 04 addi r19,r19,4 ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 800fee0: 5e 6b 00 1f bne r19,r11,800ff5c <== NEVER TAKEN 800fee4: e0 00 00 48 bi 8010004 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)) ) 800fee8: 41 82 00 0e lbu r2,(r12+14) <== NOT EXECUTED 800feec: 20 42 00 03 andi r2,r2,0x3 <== NOT EXECUTED 800fef0: 44 45 00 20 be r2,r5,800ff70 <== NOT EXECUTED return fs_info->vol.rdir_loc; 800fef4: 29 81 00 20 lw r1,(r12+32) <== NOT EXECUTED ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 800fef8: 41 82 00 03 lbu r2,(r12+3) <== NOT EXECUTED 800fefc: fb ff c4 9a calli 8001164 <__ashlsi3> <== NOT EXECUTED 800ff00: b8 20 70 00 mv r14,r1 <== NOT EXECUTED (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800ff04: 29 6f 00 24 lw r15,(r11+36) <== NOT EXECUTED 800ff08: 34 02 00 09 mvi r2,9 <== NOT EXECUTED 800ff0c: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 800ff10: f8 00 7c 3a calli 802eff8 <__lshrsi3> <== NOT EXECUTED ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800ff14: 01 e5 00 01 srui r5,r15,1 <== NOT EXECUTED static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800ff18: b5 c1 20 00 add r4,r14,r1 <== NOT EXECUTED (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800ff1c: 00 a5 00 01 srui r5,r5,1 <== NOT EXECUTED fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800ff20: b4 84 20 00 add r4,r4,r4 <== NOT EXECUTED ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800ff24: 00 a5 00 01 srui r5,r5,1 <== NOT EXECUTED fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800ff28: b4 84 20 00 add r4,r4,r4 <== NOT EXECUTED ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800ff2c: 00 a5 00 01 srui r5,r5,1 <== NOT EXECUTED fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800ff30: b4 84 20 00 add r4,r4,r4 <== NOT EXECUTED ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800ff34: 00 a5 00 01 srui r5,r5,1 <== NOT EXECUTED fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 800ff38: b4 84 20 00 add r4,r4,r4 <== NOT EXECUTED ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 800ff3c: 20 a5 00 0f andi r5,r5,0xf <== NOT EXECUTED static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 800ff40: b4 85 20 00 add r4,r4,r5 <== NOT EXECUTED { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); if ( (key1) == ck) 800ff44: 5d a4 00 04 bne r13,r4,800ff54 <== NOT EXECUTED { if ( ((key2) == 0) || ((key2) == ffd->ino) ) 800ff48: 45 a0 00 0f be r13,r0,800ff84 <== NOT EXECUTED 800ff4c: 29 61 00 0c lw r1,(r11+12) <== NOT EXECUTED 800ff50: 45 a1 00 0d be r13,r1,800ff84 <== NOT EXECUTED { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 800ff54: 29 6b 00 00 lw r11,(r11+0) <== NOT EXECUTED ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 800ff58: 46 6b 00 2b be r19,r11,8010004 <== NOT EXECUTED 800ff5c: 29 65 00 20 lw r5,(r11+32) <== NOT EXECUTED const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) return 1; 800ff60: 34 0e 00 01 mvi r14,1 <== NOT EXECUTED ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800ff64: 34 a1 ff fe addi r1,r5,-2 <== NOT EXECUTED fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 800ff68: 44 b2 ff e7 be r5,r18,800ff04 <== NOT EXECUTED fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 800ff6c: 44 a0 ff df be r5,r0,800fee8 <== NOT EXECUTED return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 800ff70: 41 82 00 05 lbu r2,(r12+5) <== NOT EXECUTED 800ff74: fb ff c4 7c calli 8001164 <__ashlsi3> <== NOT EXECUTED 800ff78: 29 82 00 34 lw r2,(r12+52) <== NOT EXECUTED 800ff7c: b4 22 08 00 add r1,r1,r2 <== NOT EXECUTED 800ff80: e3 ff ff de bi 800fef8 <== NOT EXECUTED if ( (key1) == ck) { if ( ((key2) == 0) || ((key2) == ffd->ino) ) { *ret = (void *)the_node; return 0; 800ff84: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED } /* access "removed-but-still-open" hash table */ rc = _hash_search(fs_info, fs_info->rhash, key, key, &lfat_fd); lfat_fd = (*fat_fd) = (fat_file_fd_t*)malloc(sizeof(fat_file_fd_t)); 800ff88: 34 01 00 44 mvi r1,68 800ff8c: fb ff cd d5 calli 80036e0 800ff90: 5a 81 00 00 sw (r20+0),r1 800ff94: b8 20 58 00 mv r11,r1 if ( lfat_fd == NULL ) 800ff98: 44 20 00 23 be r1,r0,8010024 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 800ff9c: 34 02 00 00 mvi r2,0 800ffa0: 34 03 00 44 mvi r3,68 800ffa4: f8 00 35 a3 calli 801d630 lfat_fd->links_num = 1; lfat_fd->flags &= ~FAT_FILE_REMOVED; 800ffa8: 41 64 00 30 lbu r4,(r11+48) lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; 800ffac: 2a 03 00 00 lw r3,(r16+0) 800ffb0: 2a 02 00 04 lw r2,(r16+4) 800ffb4: 2a 01 00 08 lw r1,(r16+8) 800ffb8: 2a 06 00 0c lw r6,(r16+12) rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); lfat_fd->links_num = 1; lfat_fd->flags &= ~FAT_FILE_REMOVED; 800ffbc: 20 84 00 fe andi r4,r4,0xfe if ( lfat_fd == NULL ) rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); lfat_fd->links_num = 1; 800ffc0: 34 05 00 01 mvi r5,1 lfat_fd->flags &= ~FAT_FILE_REMOVED; 800ffc4: 31 64 00 30 sb (r11+48),r4 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 800ffc8: 34 04 ff ff mvi r4,-1 if ( lfat_fd == NULL ) rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); lfat_fd->links_num = 1; 800ffcc: 59 65 00 08 sw (r11+8),r5 lfat_fd->flags &= ~FAT_FILE_REMOVED; lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 800ffd0: 59 64 00 3c sw (r11+60),r4 lfat_fd->dir_pos = *dir_pos; 800ffd4: 59 63 00 20 sw (r11+32),r3 800ffd8: 59 62 00 24 sw (r11+36),r2 800ffdc: 59 61 00 28 sw (r11+40),r1 800ffe0: 59 66 00 2c sw (r11+44),r6 if ( rc != RC_OK ) 800ffe4: 45 c0 00 0a be r14,r0,801000c <== NEVER TAKEN lfat_fd->ino = key; 800ffe8: 59 6d 00 0c sw (r11+12),r13 */ static inline void _hash_insert(rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t *el) { rtems_chain_append((hash) + ((key1) % FAT_HASH_MODULE), &(el)->link); 800ffec: 29 81 00 6c lw r1,(r12+108) RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); 800fff0: b9 60 10 00 mv r2,r11 800fff4: b4 31 08 00 add r1,r1,r17 800fff8: fb ff d9 cc calli 8006728 <_Chain_Append> /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; 800fffc: 34 01 00 00 mvi r1,0 8010000: e3 ff ff 9a bi 800fe68 return 0; } } the_node = the_node->next; } return -1; 8010004: 34 0e ff ff mvi r14,-1 8010008: e3 ff ff e0 bi 800ff88 if ( rc != RC_OK ) lfat_fd->ino = key; else { lfat_fd->ino = fat_get_unique_ino(fs_info); 801000c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8010010: f8 00 08 85 calli 8012224 <== NOT EXECUTED 8010014: 59 61 00 0c sw (r11+12),r1 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 8010018: 5c 2e ff f5 bne r1,r14,800ffec <== NOT EXECUTED { free((*fat_fd)); 801001c: 2a 81 00 00 lw r1,(r20+0) <== NOT EXECUTED 8010020: fb ff cc 0a calli 8003048 <== NOT EXECUTED /* * XXX: kernel resource is unsufficient, but not the memory, * but there is no suitable errno :( */ rtems_set_errno_and_return_minus_one( ENOMEM ); 8010024: f8 00 31 f4 calli 801c7f4 <__errno> <== NOT EXECUTED 8010028: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 801002c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8010030: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 8010034: e3 ff ff 8d bi 800fe68 <== NOT EXECUTED =============================================================================== 08010050 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 8010050: 37 9c ff c8 addi sp,sp,-56 8010054: 5b 8b 00 34 sw (sp+52),r11 8010058: 5b 8c 00 30 sw (sp+48),r12 801005c: 5b 8d 00 2c sw (sp+44),r13 8010060: 5b 8e 00 28 sw (sp+40),r14 8010064: 5b 8f 00 24 sw (sp+36),r15 8010068: 5b 90 00 20 sw (sp+32),r16 801006c: 5b 91 00 1c sw (sp+28),r17 8010070: 5b 92 00 18 sw (sp+24),r18 8010074: 5b 93 00 14 sw (sp+20),r19 8010078: 5b 94 00 10 sw (sp+16),r20 801007c: 5b 95 00 0c sw (sp+12),r21 8010080: 5b 96 00 08 sw (sp+8),r22 8010084: 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; 8010088: 5b 80 00 38 sw (sp+56),r0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 801008c: b8 80 60 00 mv r12,r4 8010090: b8 20 58 00 mv r11,r1 8010094: b8 40 78 00 mv r15,r2 8010098: b8 60 70 00 mv r14,r3 801009c: 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; 80100a0: 34 0d 00 00 mvi r13,0 uint32_t sec = 0; uint32_t byte = 0; uint32_t c = 0; /* it couldn't be removed - otherwise cache update will be broken */ if (count == 0) 80100a4: 44 80 00 4b be r4,r0,80101d0 <== NEVER TAKEN /* * >= because start is offset and computed from 0 and file_size * computed from 1 */ if ( start >= fat_fd->fat_file_size ) 80100a8: 28 41 00 18 lw r1,(r2+24) 80100ac: 50 61 00 49 bgeu r3,r1,80101d0 return FAT_EOF; if ((count > fat_fd->fat_file_size) || 80100b0: 54 81 00 03 bgu r4,r1,80100bc <== NEVER TAKEN (start > fat_fd->fat_file_size - count)) 80100b4: c8 24 10 00 sub r2,r1,r4 * computed from 1 */ if ( start >= fat_fd->fat_file_size ) return FAT_EOF; if ((count > fat_fd->fat_file_size) || 80100b8: 50 43 00 02 bgeu r2,r3,80100c0 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 80100bc: c8 2e 60 00 sub r12,r1,r14 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 80100c0: 29 e2 00 20 lw r2,(r15+32) 80100c4: 34 01 00 01 mvi r1,1 80100c8: 44 41 00 57 be r2,r1,8010224 return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 80100cc: 41 62 00 08 lbu r2,(r11+8) 80100d0: b9 c0 08 00 mv r1,r14 80100d4: f8 00 7b c9 calli 802eff8 <__lshrsi3> 80100d8: b8 20 a8 00 mv r21,r1 save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 80100dc: b9 e0 10 00 mv r2,r15 80100e0: b9 60 08 00 mv r1,r11 80100e4: ba a0 18 00 mv r3,r21 80100e8: 37 84 00 38 addi r4,sp,56 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 80100ec: 2d 70 00 06 lhu r16,(r11+6) rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 80100f0: fb ff fe d2 calli 800fc38 80100f4: b8 20 68 00 mv r13,r1 if (rc != RC_OK) 80100f8: 5c 20 00 36 bne r1,r0,80101d0 <== NEVER TAKEN return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 80100fc: 36 10 ff ff addi r16,r16,-1 8010100: a1 d0 b0 00 and r22,r14,r16 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) 8010104: 34 11 00 00 mvi r17,0 8010108: 34 10 00 00 mvi r16,0 801010c: 45 81 00 2a be r12,r1,80101b4 <== NEVER TAKEN cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) 8010110: 41 72 00 02 lbu r18,(r11+2) 8010114: 2d 71 00 00 lhu r17,(r11+0) return rc; while (count > 0) 8010118: ba c0 70 00 mv r14,r22 801011c: 34 10 00 00 mvi r16,0 { c = MIN(count, (fs_info->vol.bpc - ofs)); 8010120: 2d 6d 00 06 lhu r13,(r11+6) sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 8010124: 2b 84 00 38 lw r4,(sp+56) if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 8010128: c9 ae 68 00 sub r13,r13,r14 801012c: 34 81 ff fe addi r1,r4,-2 8010130: 51 8d 00 02 bgeu r12,r13,8010138 8010134: b9 80 68 00 mv r13,r12 fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 8010138: 5c 80 00 36 bne r4,r0,8010210 <== ALWAYS TAKEN 801013c: 41 62 00 0e lbu r2,(r11+14) <== NOT EXECUTED 8010140: 20 42 00 03 andi r2,r2,0x3 <== NOT EXECUTED 8010144: 44 44 00 33 be r2,r4,8010210 <== NOT EXECUTED return fs_info->vol.rdir_loc; 8010148: 29 73 00 20 lw r19,(r11+32) <== NOT EXECUTED sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); sec += (ofs >> fs_info->vol.sec_log2); 801014c: ba 40 10 00 mv r2,r18 8010150: b9 c0 08 00 mv r1,r14 8010154: f8 00 7b a9 calli 802eff8 <__lshrsi3> byte = ofs & (fs_info->vol.bps - 1); 8010158: 36 24 ff ff addi r4,r17,-1 while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); sec += (ofs >> fs_info->vol.sec_log2); 801015c: b6 61 10 00 add r2,r19,r1 byte = ofs & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 8010160: a0 8e 18 00 and r3,r4,r14 8010164: b6 90 28 00 add r5,r20,r16 8010168: b9 a0 20 00 mv r4,r13 801016c: b9 60 08 00 mv r1,r11 8010170: f8 00 03 65 calli 8010f04 <_fat_block_read> 8010174: b8 20 10 00 mv r2,r1 return -1; count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 8010178: 37 83 00 38 addi r3,sp,56 801017c: b9 60 08 00 mv r1,r11 ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) return -1; count -= c; 8010180: c9 8d 60 00 sub r12,r12,r13 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); sec += (ofs >> fs_info->vol.sec_log2); byte = ofs & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) 8010184: 48 02 00 3d bg r0,r2,8010278 <== NEVER TAKEN return -1; count -= c; cmpltd += c; save_cln = cur_cln; 8010188: 2b 91 00 38 lw r17,(sp+56) ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) return -1; count -= c; cmpltd += c; 801018c: b6 0d 80 00 add r16,r16,r13 save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; ofs = 0; 8010190: 34 0e 00 00 mvi r14,0 return -1; count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 8010194: ba 20 10 00 mv r2,r17 8010198: f8 00 27 0b calli 8019dc4 if ( rc != RC_OK ) 801019c: 5c 20 00 39 bne r1,r0,8010280 <== NEVER TAKEN rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) 80101a0: 45 81 00 04 be r12,r1,80101b0 80101a4: 41 72 00 02 lbu r18,(r11+2) 80101a8: 2d 71 00 00 lhu r17,(r11+0) 80101ac: e3 ff ff dd bi 8010120 save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; ofs = 0; 80101b0: ba 00 68 00 mv r13,r16 } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); 80101b4: 41 62 00 08 lbu r2,(r11+8) 80101b8: 36 c1 ff ff addi r1,r22,-1 80101bc: b4 30 08 00 add r1,r1,r16 80101c0: f8 00 7b 8e calli 802eff8 <__lshrsi3> ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 80101c4: b4 35 08 00 add r1,r1,r21 80101c8: 59 e1 00 34 sw (r15+52),r1 ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; 80101cc: 59 f1 00 38 sw (r15+56),r17 return cmpltd; } 80101d0: b9 a0 08 00 mv r1,r13 80101d4: 2b 9d 00 04 lw ra,(sp+4) 80101d8: 2b 8b 00 34 lw r11,(sp+52) 80101dc: 2b 8c 00 30 lw r12,(sp+48) 80101e0: 2b 8d 00 2c lw r13,(sp+44) 80101e4: 2b 8e 00 28 lw r14,(sp+40) 80101e8: 2b 8f 00 24 lw r15,(sp+36) 80101ec: 2b 90 00 20 lw r16,(sp+32) 80101f0: 2b 91 00 1c lw r17,(sp+28) 80101f4: 2b 92 00 18 lw r18,(sp+24) 80101f8: 2b 93 00 14 lw r19,(sp+20) 80101fc: 2b 94 00 10 lw r20,(sp+16) 8010200: 2b 95 00 0c lw r21,(sp+12) 8010204: 2b 96 00 08 lw r22,(sp+8) 8010208: 37 9c 00 38 addi sp,sp,56 801020c: c3 a0 00 00 ret return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 8010210: 41 62 00 05 lbu r2,(r11+5) 8010214: fb ff c3 d4 calli 8001164 <__ashlsi3> 8010218: 29 73 00 34 lw r19,(r11+52) 801021c: b4 33 98 00 add r19,r1,r19 8010220: e3 ff ff cb bi 801014c 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)) && 8010224: 29 e1 00 24 lw r1,(r15+36) 8010228: 5c 20 ff a9 bne r1,r0,80100cc <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 801022c: 41 62 00 0e lbu r2,(r11+14) 8010230: 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)) && 8010234: 44 41 ff a6 be r2,r1,80100cc (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); 8010238: 29 e1 00 1c lw r1,(r15+28) fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 801023c: 5c 20 00 13 bne r1,r0,8010288 <== NEVER TAKEN return fs_info->vol.rdir_loc; 8010240: 29 6d 00 20 lw r13,(r11+32) sec += (start >> fs_info->vol.sec_log2); 8010244: 41 62 00 02 lbu r2,(r11+2) 8010248: b9 c0 08 00 mv r1,r14 801024c: f8 00 7b 6b calli 802eff8 <__lshrsi3> byte = start & (fs_info->vol.bps - 1); 8010250: 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); 8010254: 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); 8010258: 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); 801025c: 34 63 ff ff addi r3,r3,-1 ret = _fat_block_read(fs_info, sec, byte, count, buf); 8010260: b9 60 08 00 mv r1,r11 8010264: a1 c3 18 00 and r3,r14,r3 8010268: ba 80 28 00 mv r5,r20 801026c: f8 00 03 26 calli 8010f04 <_fat_block_read> 8010270: b8 20 68 00 mv r13,r1 if ( ret < 0 ) 8010274: 4c 20 ff d7 bge r1,r0,80101d0 <== ALWAYS TAKEN sec += (ofs >> fs_info->vol.sec_log2); byte = ofs & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) return -1; 8010278: 34 0d ff ff mvi r13,-1 <== NOT EXECUTED 801027c: e3 ff ff d5 bi 80101d0 <== NOT EXECUTED count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 8010280: b8 20 68 00 mv r13,r1 <== NOT EXECUTED 8010284: e3 ff ff d3 bi 80101d0 <== NOT EXECUTED return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 8010288: 41 62 00 05 lbu r2,(r11+5) <== NOT EXECUTED 801028c: 34 21 ff fe addi r1,r1,-2 <== NOT EXECUTED 8010290: fb ff c3 b5 calli 8001164 <__ashlsi3> <== NOT EXECUTED 8010294: 29 6d 00 34 lw r13,(r11+52) <== NOT EXECUTED 8010298: b4 2d 68 00 add r13,r1,r13 <== NOT EXECUTED 801029c: e3 ff ff ea bi 8010244 <== NOT EXECUTED =============================================================================== 08010b38 : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 8010b38: 37 9c ff ec addi sp,sp,-20 8010b3c: 5b 8b 00 10 sw (sp+16),r11 8010b40: 5b 8c 00 0c sw (sp+12),r12 8010b44: 5b 8d 00 08 sw (sp+8),r13 8010b48: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 8010b4c: 28 4d 00 1c lw r13,(r2+28) int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 8010b50: b8 40 60 00 mv r12,r2 int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 8010b54: 28 42 00 20 lw r2,(r2+32) int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 8010b58: b8 20 58 00 mv r11,r1 int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 8010b5c: 5b 8d 00 14 sw (sp+20),r13 uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 8010b60: 34 01 00 01 mvi r1,1 8010b64: 44 41 00 1e be r2,r1,8010bdc return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8010b68: 29 61 00 10 lw r1,(r11+16) 8010b6c: 29 62 00 14 lw r2,(r11+20) { fat_fd->fat_file_size = fs_info->vol.rdir_size; return rc; } fat_fd->fat_file_size = 0; 8010b70: 59 80 00 18 sw (r12+24),r0 while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8010b74: a1 a1 08 00 and r1,r13,r1 8010b78: 50 22 00 21 bgeu r1,r2,8010bfc <== NEVER TAKEN { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 8010b7c: b9 a0 10 00 mv r2,r13 8010b80: b9 60 08 00 mv r1,r11 8010b84: 37 83 00 14 addi r3,sp,20 8010b88: f8 00 24 8f calli 8019dc4 if ( rc != RC_OK ) 8010b8c: 5c 20 00 0c bne r1,r0,8010bbc <== NEVER TAKEN return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 8010b90: 2d 63 00 06 lhu r3,(r11+6) 8010b94: 29 85 00 18 lw r5,(r12+24) return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8010b98: 29 62 00 10 lw r2,(r11+16) 8010b9c: 2b 81 00 14 lw r1,(sp+20) 8010ba0: 29 64 00 14 lw r4,(r11+20) save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 8010ba4: b4 a3 18 00 add r3,r5,r3 8010ba8: 59 83 00 18 sw (r12+24),r3 return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8010bac: a0 22 10 00 and r2,r1,r2 8010bb0: 54 82 00 09 bgu r4,r2,8010bd4 <== NEVER TAKEN if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; 8010bb4: 59 8d 00 3c sw (r12+60),r13 return rc; 8010bb8: 34 01 00 00 mvi r1,0 } 8010bbc: 2b 9d 00 04 lw ra,(sp+4) 8010bc0: 2b 8b 00 10 lw r11,(sp+16) 8010bc4: 2b 8c 00 0c lw r12,(sp+12) 8010bc8: 2b 8d 00 08 lw r13,(sp+8) 8010bcc: 37 9c 00 14 addi sp,sp,20 8010bd0: c3 a0 00 00 ret return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 8010bd4: b8 20 68 00 mv r13,r1 <== NOT EXECUTED 8010bd8: e3 ff ff e9 bi 8010b7c <== NOT EXECUTED int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 8010bdc: 29 81 00 24 lw r1,(r12+36) 8010be0: 5c 20 ff e2 bne r1,r0,8010b68 <== NEVER TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 8010be4: 41 62 00 0e lbu r2,(r11+14) 8010be8: 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)) && 8010bec: 44 41 ff df be r2,r1,8010b68 <== ALWAYS TAKEN (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { fat_fd->fat_file_size = fs_info->vol.rdir_size; 8010bf0: 29 62 00 2c lw r2,(r11+44) <== NOT EXECUTED 8010bf4: 59 82 00 18 sw (r12+24),r2 <== NOT EXECUTED return rc; 8010bf8: e3 ff ff f1 bi 8010bbc <== NOT EXECUTED fat_file_fd_t *fat_fd ) { int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; 8010bfc: 34 0d 00 00 mvi r13,0 <== NOT EXECUTED 8010c00: e3 ff ff ed bi 8010bb4 <== NOT EXECUTED =============================================================================== 080102a0 : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 80102a0: 37 9c ff e0 addi sp,sp,-32 80102a4: 5b 8b 00 18 sw (sp+24),r11 80102a8: 5b 8c 00 14 sw (sp+20),r12 80102ac: 5b 8d 00 10 sw (sp+16),r13 80102b0: 5b 8e 00 0c sw (sp+12),r14 80102b4: 5b 8f 00 08 sw (sp+8),r15 80102b8: 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 ) 80102bc: 28 4b 00 18 lw r11,(r2+24) fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 80102c0: b8 40 68 00 mv r13,r2 int rc = RC_OK; uint32_t cur_cln = 0; uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 80102c4: 34 02 ff ff mvi r2,-1 fat_file_fd_t *fat_fd, uint32_t new_length ) { int rc = RC_OK; uint32_t cur_cln = 0; 80102c8: 5b 80 00 20 sw (sp+32),r0 uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 80102cc: 5b 82 00 1c sw (sp+28),r2 fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 80102d0: b8 20 60 00 mv r12,r1 uint32_t cur_cln = 0; uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; if ( new_length >= fat_fd->fat_file_size ) 80102d4: 50 6b 00 25 bgeu r3,r11,8010368 return rc; assert(fat_fd->fat_file_size); 80102d8: 45 60 00 38 be r11,r0,80103b8 <== NEVER TAKEN cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; 80102dc: 2c 21 00 06 lhu r1,(r1+6) 80102e0: 41 8f 00 08 lbu r15,(r12+8) 80102e4: 34 21 ff ff addi r1,r1,-1 80102e8: b4 23 08 00 add r1,r1,r3 80102ec: b9 e0 10 00 mv r2,r15 80102f0: f8 00 7b 42 calli 802eff8 <__lshrsi3> if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 80102f4: 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; 80102f8: b8 20 70 00 mv r14,r1 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 80102fc: fb ff c3 9a calli 8001164 <__ashlsi3> return RC_OK; 8010300: 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) 8010304: 50 2b 00 10 bgeu r1,r11,8010344 return RC_OK; if (cl_start != 0) 8010308: 45 c0 00 08 be r14,r0,8010328 { rc = fat_file_lseek(fs_info, fat_fd, cl_start - 1, &new_last_cln); 801030c: 37 84 00 1c addi r4,sp,28 8010310: b9 80 08 00 mv r1,r12 8010314: b9 a0 10 00 mv r2,r13 8010318: 35 c3 ff ff addi r3,r14,-1 801031c: fb ff fe 47 calli 800fc38 8010320: b8 20 20 00 mv r4,r1 if (rc != RC_OK) 8010324: 5c 20 00 08 bne r1,r0,8010344 <== NEVER TAKEN return rc; } rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 8010328: 37 84 00 20 addi r4,sp,32 801032c: b9 80 08 00 mv r1,r12 8010330: b9 a0 10 00 mv r2,r13 8010334: b9 c0 18 00 mv r3,r14 8010338: fb ff fe 40 calli 800fc38 801033c: b8 20 20 00 mv r4,r1 if (rc != RC_OK) 8010340: 44 20 00 0c be r1,r0,8010370 <== ALWAYS TAKEN fat_fd->map.file_cln = cl_start - 1; fat_fd->map.disk_cln = new_last_cln; fat_fd->map.last_cln = new_last_cln; } return RC_OK; } 8010344: b8 80 08 00 mv r1,r4 8010348: 2b 9d 00 04 lw ra,(sp+4) 801034c: 2b 8b 00 18 lw r11,(sp+24) 8010350: 2b 8c 00 14 lw r12,(sp+20) 8010354: 2b 8d 00 10 lw r13,(sp+16) 8010358: 2b 8e 00 0c lw r14,(sp+12) 801035c: 2b 8f 00 08 lw r15,(sp+8) 8010360: 37 9c 00 20 addi sp,sp,32 8010364: c3 a0 00 00 ret uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; if ( new_length >= fat_fd->fat_file_size ) return rc; 8010368: 34 04 00 00 mvi r4,0 801036c: e3 ff ff f6 bi 8010344 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; rc = fat_free_fat_clusters_chain(fs_info, cur_cln); 8010370: 2b 82 00 20 lw r2,(sp+32) 8010374: b9 80 08 00 mv r1,r12 8010378: f8 00 28 5f calli 801a4f4 801037c: b8 20 20 00 mv r4,r1 if (rc != RC_OK) 8010380: 5c 20 ff f1 bne r1,r0,8010344 <== NEVER TAKEN return rc; if (cl_start != 0) 8010384: 45 c1 ff f0 be r14,r1,8010344 { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); 8010388: 2b 82 00 1c lw r2,(sp+28) 801038c: b9 80 08 00 mv r1,r12 8010390: 34 03 ff ff mvi r3,-1 8010394: f8 00 27 49 calli 801a0b8 8010398: b8 20 20 00 mv r4,r1 if ( rc != RC_OK ) 801039c: 5c 20 ff ea bne r1,r0,8010344 <== NEVER TAKEN return rc; fat_fd->map.file_cln = cl_start - 1; fat_fd->map.disk_cln = new_last_cln; 80103a0: 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; 80103a4: 35 ce ff ff addi r14,r14,-1 80103a8: 59 ae 00 34 sw (r13+52),r14 fat_fd->map.disk_cln = new_last_cln; 80103ac: 59 a1 00 38 sw (r13+56),r1 fat_fd->map.last_cln = new_last_cln; 80103b0: 59 a1 00 3c sw (r13+60),r1 80103b4: e3 ff ff e4 bi 8010344 if ( new_length >= fat_fd->fat_file_size ) return rc; assert(fat_fd->fat_file_size); 80103b8: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED 80103bc: 78 03 08 03 mvhi r3,0x803 <== NOT EXECUTED 80103c0: 78 04 08 03 mvhi r4,0x803 <== NOT EXECUTED 80103c4: 38 21 02 90 ori r1,r1,0x290 <== NOT EXECUTED 80103c8: 34 02 02 d1 mvi r2,721 <== NOT EXECUTED 80103cc: 38 63 02 f0 ori r3,r3,0x2f0 <== NOT EXECUTED 80103d0: 38 84 02 d8 ori r4,r4,0x2d8 <== NOT EXECUTED 80103d4: f8 00 0a 90 calli 8012e14 <__assert_func> <== NOT EXECUTED =============================================================================== 08010810 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 8010810: 37 9c ff b4 addi sp,sp,-76 8010814: 5b 8b 00 44 sw (sp+68),r11 8010818: 5b 8c 00 40 sw (sp+64),r12 801081c: 5b 8d 00 3c sw (sp+60),r13 8010820: 5b 8e 00 38 sw (sp+56),r14 8010824: 5b 8f 00 34 sw (sp+52),r15 8010828: 5b 90 00 30 sw (sp+48),r16 801082c: 5b 91 00 2c sw (sp+44),r17 8010830: 5b 92 00 28 sw (sp+40),r18 8010834: 5b 93 00 24 sw (sp+36),r19 8010838: 5b 94 00 20 sw (sp+32),r20 801083c: 5b 95 00 1c sw (sp+28),r21 8010840: 5b 96 00 18 sw (sp+24),r22 8010844: 5b 97 00 14 sw (sp+20),r23 8010848: 5b 98 00 10 sw (sp+16),r24 801084c: 5b 99 00 0c sw (sp+12),r25 8010850: 5b 9b 00 08 sw (sp+8),fp 8010854: 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; 8010858: 5b 80 00 4c sw (sp+76),r0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 801085c: b8 40 58 00 mv r11,r2 8010860: 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; 8010864: 28 55 00 34 lw r21,(r2+52) int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; bool zero_fill = start > fat_fd->fat_file_size; 8010868: 28 43 00 18 lw r3,(r2+24) fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 801086c: b8 20 68 00 mv r13,r1 8010870: b8 a0 a0 00 mv r20,r5 uint32_t file_cln_initial = fat_fd->map.file_cln; uint32_t cln; if ( count == 0 ) return cmpltd; 8010874: 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 ) 8010878: 44 80 00 07 be r4,r0,8010894 <== NEVER TAKEN return cmpltd; if (start >= fat_fd->size_limit) 801087c: 29 6c 00 14 lw r12,(r11+20) 8010880: 55 8e 00 19 bgu r12,r14,80108e4 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EFBIG); 8010884: f8 00 2f dc calli 801c7f4 <__errno> <== NOT EXECUTED 8010888: 34 02 00 1b mvi r2,27 <== NOT EXECUTED 801088c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8010890: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED } if (RC_OK != rc) return rc; else return cmpltd; } 8010894: b8 40 08 00 mv r1,r2 8010898: 2b 9d 00 04 lw ra,(sp+4) 801089c: 2b 8b 00 44 lw r11,(sp+68) 80108a0: 2b 8c 00 40 lw r12,(sp+64) 80108a4: 2b 8d 00 3c lw r13,(sp+60) 80108a8: 2b 8e 00 38 lw r14,(sp+56) 80108ac: 2b 8f 00 34 lw r15,(sp+52) 80108b0: 2b 90 00 30 lw r16,(sp+48) 80108b4: 2b 91 00 2c lw r17,(sp+44) 80108b8: 2b 92 00 28 lw r18,(sp+40) 80108bc: 2b 93 00 24 lw r19,(sp+36) 80108c0: 2b 94 00 20 lw r20,(sp+32) 80108c4: 2b 95 00 1c lw r21,(sp+28) 80108c8: 2b 96 00 18 lw r22,(sp+24) 80108cc: 2b 97 00 14 lw r23,(sp+20) 80108d0: 2b 98 00 10 lw r24,(sp+16) 80108d4: 2b 99 00 0c lw r25,(sp+12) 80108d8: 2b 9b 00 08 lw fp,(sp+8) 80108dc: 37 9c 00 4c addi sp,sp,76 80108e0: c3 a0 00 00 ret return cmpltd; if (start >= fat_fd->size_limit) rtems_set_errno_and_return_minus_one(EFBIG); if (count > fat_fd->size_limit - start) 80108e4: c9 8e 60 00 sub r12,r12,r14 if ( count == 0 ) return cmpltd; if (start >= fat_fd->size_limit) rtems_set_errno_and_return_minus_one(EFBIG); 80108e8: 50 8c 00 02 bgeu r4,r12,80108f0 <== NEVER TAKEN 80108ec: b8 80 60 00 mv r12,r4 if (count > fat_fd->size_limit - start) count = fat_fd->size_limit - start; rc = fat_file_extend(fs_info, fat_fd, zero_fill, start + count, &c); 80108f0: b5 8e 78 00 add r15,r12,r14 80108f4: f5 c3 18 00 cmpgu r3,r14,r3 80108f8: b9 60 10 00 mv r2,r11 80108fc: b9 a0 08 00 mv r1,r13 8010900: b9 e0 20 00 mv r4,r15 8010904: 37 85 00 4c addi r5,sp,76 8010908: fb ff ff 29 calli 80105ac 801090c: b8 20 10 00 mv r2,r1 if (RC_OK == rc) 8010910: 5c 20 ff e1 bne r1,r0,8010894 { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) 8010914: 2b 81 00 4c lw r1,(sp+76) 8010918: 45 e1 00 02 be r15,r1,8010920 <== ALWAYS TAKEN count = c - start; 801091c: c8 2e 60 00 sub r12,r1,r14 <== NOT EXECUTED */ static bool fat_is_fat12_or_fat16_root_dir (const fat_file_fd_t *fat_fd, const uint8_t volume_type) { return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16)); 8010920: 29 63 00 20 lw r3,(r11+32) 8010924: 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)) 8010928: 41 a2 00 0e lbu r2,(r13+14) */ static bool fat_is_fat12_or_fat16_root_dir (const fat_file_fd_t *fat_fd, const uint8_t volume_type) { return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16)); 801092c: 44 61 00 4b be r3,r1,8010a58 { 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; 8010930: 41 b0 00 08 lbu r16,(r13+8) 8010934: 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; 8010938: 5b 80 00 48 sw (sp+72),r0 uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; 801093c: ba 00 10 00 mv r2,r16 8010940: f8 00 79 ae calli 802eff8 <__lshrsi3> 8010944: b8 20 c8 00 mv r25,r1 uint32_t file_cln_cnt; ssize_t ret; uint32_t c; bool overwrite_cluster = false; rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); 8010948: 37 9b 00 48 addi fp,sp,72 801094c: b9 a0 08 00 mv r1,r13 8010950: b9 60 10 00 mv r2,r11 8010954: bb 20 18 00 mv r3,r25 8010958: bb 60 20 00 mv r4,fp 801095c: fb ff fc b7 calli 800fc38 8010960: b8 20 78 00 mv r15,r1 if (RC_OK == rc) 8010964: 5c 20 00 36 bne r1,r0,8010a3c <== NEVER TAKEN int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; uint32_t ofs_cln = start - (start_cln << fs_info->vol.bpc_log2); 8010968: ba 00 10 00 mv r2,r16 801096c: bb 20 08 00 mv r1,r25 8010970: fb ff c1 fd calli 8001164 <__ashlsi3> bool overwrite_cluster = false; rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); if (RC_OK == rc) { file_cln_cnt = cur_cln - fat_fd->cln; 8010974: 29 62 00 1c lw r2,(r11+28) 8010978: 2b 92 00 48 lw r18,(sp+72) int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; uint32_t ofs_cln = start - (start_cln << fs_info->vol.bpc_log2); 801097c: c9 c1 70 00 sub r14,r14,r1 8010980: 7d 93 00 00 cmpnei r19,r12,0 8010984: b9 c0 80 00 mv r16,r14 bool overwrite_cluster = false; rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); if (RC_OK == rc) { file_cln_cnt = cur_cln - fat_fd->cln; 8010988: ca 42 90 00 sub r18,r18,r2 801098c: 34 0f 00 00 mvi r15,0 uint32_t ofs_cln_save = ofs_cln; uint32_t bytes_to_write = count; uint32_t file_cln_cnt; ssize_t ret; uint32_t c; bool overwrite_cluster = false; 8010990: 34 17 00 00 mvi r23,0 const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ 8010994: 34 18 00 00 mvi r24,0 const uint32_t count, const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; 8010998: 34 11 00 00 mvi r17,0 rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); if (RC_OK == rc) { file_cln_cnt = cur_cln - fat_fd->cln; while ( (RC_OK == rc) 801099c: 65 f6 00 00 cmpei r22,r15,0 && (bytes_to_write > 0)) { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); if (file_cln_initial < file_cln_cnt) 80109a0: ba e0 30 00 mv r6,r23 rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); if (RC_OK == rc) { file_cln_cnt = cur_cln - fat_fd->cln; while ( (RC_OK == rc) 80109a4: a2 76 b0 00 and r22,r19,r22 80109a8: 46 c0 00 1c be r22,r0,8010a18 && (bytes_to_write > 0)) { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); 80109ac: 2d a5 00 06 lhu r5,(r13+6) 80109b0: c8 b0 20 00 sub r4,r5,r16 80109b4: 51 84 00 02 bgeu r12,r4,80109bc 80109b8: b9 80 20 00 mv r4,r12 if (file_cln_initial < file_cln_cnt) 80109bc: 56 55 00 24 bgu r18,r21,8010a4c overwrite_cluster = true; ret = fat_cluster_write(fs_info, 80109c0: 2b 82 00 48 lw r2,(sp+72) 80109c4: ba 00 18 00 mv r3,r16 80109c8: b6 91 28 00 add r5,r20,r17 80109cc: b9 a0 08 00 mv r1,r13 80109d0: f8 00 02 3c calli 80112c0 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 80109d4: 34 0f ff ff mvi r15,-1 80109d8: 48 01 ff f1 bg r0,r1,801099c <== NEVER TAKEN rc = -1; if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; 80109dc: c9 81 60 00 sub r12,r12,r1 cmpltd += ret; save_cln = cur_cln; 80109e0: 2b 98 00 48 lw r24,(sp+72) if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; 80109e4: b6 21 88 00 add r17,r17,r1 save_cln = cur_cln; if (0 < bytes_to_write) 80109e8: 34 0f 00 00 mvi r15,0 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ofs_cln = 0; 80109ec: 34 10 00 00 mvi r16,0 80109f0: 34 13 00 00 mvi r19,0 if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 80109f4: 36 52 00 01 addi r18,r18,1 bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) 80109f8: 45 80 ff e9 be r12,r0,801099c rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 80109fc: b9 a0 08 00 mv r1,r13 8010a00: bb 00 10 00 mv r2,r24 8010a04: bb 60 18 00 mv r3,fp 8010a08: f8 00 24 ef calli 8019dc4 8010a0c: b8 20 78 00 mv r15,r1 8010a10: 34 13 00 01 mvi r19,1 8010a14: e3 ff ff e2 bi 801099c } /* 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); 8010a18: 41 a2 00 08 lbu r2,(r13+8) 8010a1c: 35 ce ff ff addi r14,r14,-1 8010a20: b5 d1 08 00 add r1,r14,r17 8010a24: f8 00 79 75 calli 802eff8 <__lshrsi3> } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 8010a28: b4 39 08 00 add r1,r1,r25 8010a2c: 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; 8010a30: 59 78 00 38 sw (r11+56),r24 } if (RC_OK != rc) 8010a34: 5d f6 00 02 bne r15,r22,8010a3c <== NEVER TAKEN return rc; else return cmpltd; 8010a38: ba 20 78 00 mv r15,r17 start, count, buf, file_cln_initial); if (0 > ret) rc = -1; 8010a3c: 34 02 ff ff mvi r2,-1 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 8010a40: 48 0f ff 95 bg r0,r15,8010894 <== NEVER TAKEN rc = -1; else cmpltd = ret; 8010a44: b9 e0 10 00 mv r2,r15 8010a48: e3 ff ff 93 bi 8010894 while ( (RC_OK == rc) && (bytes_to_write > 0)) { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); if (file_cln_initial < file_cln_cnt) 8010a4c: 34 06 00 01 mvi r6,1 overwrite_cluster = true; 8010a50: 34 17 00 01 mvi r23,1 8010a54: e3 ff ff db bi 80109c0 */ 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)); 8010a58: 29 61 00 24 lw r1,(r11+36) 8010a5c: 5c 20 ff b5 bne r1,r0,8010930 <== NEVER TAKEN 8010a60: 20 42 00 03 andi r2,r2,0x3 8010a64: 44 41 ff b3 be r2,r1,8010930 /* 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); 8010a68: 41 a2 00 08 lbu r2,(r13+8) 8010a6c: 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; 8010a70: 29 6b 00 1c lw r11,(r11+28) cln += (start >> fs_info->vol.bpc_log2); 8010a74: f8 00 79 61 calli 802eff8 <__lshrsi3> byte = start & (fs_info->vol.bpc -1); 8010a78: 2d a3 00 06 lhu r3,(r13+6) /* for the root directory of FAT12 and FAT16 we need this special handling */ if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type)) { cln = fat_fd->cln; cln += (start >> fs_info->vol.bpc_log2); 8010a7c: b4 2b 10 00 add r2,r1,r11 byte = start & (fs_info->vol.bpc -1); ret = fat_cluster_write(fs_info, 8010a80: b9 80 20 00 mv r4,r12 /* for the root directory of FAT12 and FAT16 we need this special handling */ if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type)) { cln = fat_fd->cln; cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); 8010a84: 34 63 ff ff addi r3,r3,-1 ret = fat_cluster_write(fs_info, 8010a88: b9 a0 08 00 mv r1,r13 8010a8c: a1 c3 18 00 and r3,r14,r3 8010a90: ba 80 28 00 mv r5,r20 8010a94: 34 06 00 00 mvi r6,0 8010a98: f8 00 02 0a calli 80112c0 byte, count, buf, false); if (0 > ret) rc = -1; 8010a9c: 34 02 ff ff mvi r2,-1 cln, byte, count, buf, false); if (0 > ret) 8010aa0: 48 01 ff 7d bg r0,r1,8010894 <== NEVER TAKEN rc = -1; else cmpltd = ret; 8010aa4: b8 20 10 00 mv r2,r1 8010aa8: e3 ff ff 7b bi 8010894 =============================================================================== 0801a4f4 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 801a4f4: 37 9c ff e0 addi sp,sp,-32 801a4f8: 5b 8b 00 1c sw (sp+28),r11 801a4fc: 5b 8c 00 18 sw (sp+24),r12 801a500: 5b 8d 00 14 sw (sp+20),r13 801a504: 5b 8e 00 10 sw (sp+16),r14 801a508: 5b 8f 00 0c sw (sp+12),r15 801a50c: 5b 90 00 08 sw (sp+8),r16 801a510: 5b 9d 00 04 sw (sp+4),ra 801a514: b8 20 58 00 mv r11,r1 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 801a518: 28 21 00 10 lw r1,(r1+16) 801a51c: 29 63 00 14 lw r3,(r11+20) uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 801a520: 5b 80 00 20 sw (sp+32),r0 uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 801a524: a0 41 08 00 and r1,r2,r1 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 801a528: b8 40 80 00 mv r16,r2 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 801a52c: 50 23 00 31 bgeu r1,r3,801a5f0 <== NEVER TAKEN 801a530: b8 40 60 00 mv r12,r2 801a534: 34 0e 00 00 mvi r14,0 801a538: 34 0f 00 00 mvi r15,0 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 801a53c: b9 80 10 00 mv r2,r12 801a540: 37 83 00 20 addi r3,sp,32 801a544: b9 60 08 00 mv r1,r11 801a548: fb ff fe 1f calli 8019dc4 801a54c: b8 20 68 00 mv r13,r1 fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 801a550: b9 80 10 00 mv r2,r12 801a554: b9 60 08 00 mv r1,r11 801a558: 34 03 00 00 mvi r3,0 uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); if ( rc != RC_OK ) 801a55c: 5d a0 00 1d bne r13,r0,801a5d0 <== NEVER TAKEN fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 801a560: fb ff fe d6 calli 801a0b8 if ( rc != RC_OK ) rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; 801a564: 2b 8c 00 20 lw r12,(sp+32) fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) 801a568: 44 2d 00 02 be r1,r13,801a570 <== ALWAYS TAKEN 801a56c: b8 20 78 00 mv r15,r1 <== NOT EXECUTED int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 801a570: 29 61 00 10 lw r1,(r11+16) 801a574: 29 63 00 14 lw r3,(r11+20) rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) rc1 = rc; freed_cls_cnt++; 801a578: 35 ce 00 01 addi r14,r14,1 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 801a57c: a1 81 08 00 and r1,r12,r1 801a580: 54 61 ff ef bgu r3,r1,801a53c freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 801a584: 29 61 00 44 lw r1,(r11+68) freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; 801a588: 59 70 00 4c sw (r11+76),r16 if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 801a58c: 34 02 ff ff mvi r2,-1 801a590: 44 22 00 03 be r1,r2,801a59c <== ALWAYS TAKEN fs_info->vol.free_cls += freed_cls_cnt; 801a594: b5 c1 08 00 add r1,r14,r1 <== NOT EXECUTED 801a598: 59 61 00 44 sw (r11+68),r1 <== NOT EXECUTED fat_buf_release(fs_info); 801a59c: b9 60 08 00 mv r1,r11 801a5a0: fb ff d9 99 calli 8010c04 801a5a4: b9 e0 68 00 mv r13,r15 if (rc1 != RC_OK) return rc1; return RC_OK; } 801a5a8: b9 a0 08 00 mv r1,r13 801a5ac: 2b 9d 00 04 lw ra,(sp+4) 801a5b0: 2b 8b 00 1c lw r11,(sp+28) 801a5b4: 2b 8c 00 18 lw r12,(sp+24) 801a5b8: 2b 8d 00 14 lw r13,(sp+20) 801a5bc: 2b 8e 00 10 lw r14,(sp+16) 801a5c0: 2b 8f 00 0c lw r15,(sp+12) 801a5c4: 2b 90 00 08 lw r16,(sp+8) 801a5c8: 37 9c 00 20 addi sp,sp,32 801a5cc: c3 a0 00 00 ret while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); if ( rc != RC_OK ) { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 801a5d0: 29 61 00 44 lw r1,(r11+68) <== NOT EXECUTED 801a5d4: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 801a5d8: 44 22 00 03 be r1,r2,801a5e4 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 801a5dc: b5 c1 08 00 add r1,r14,r1 <== NOT EXECUTED 801a5e0: 59 61 00 44 sw (r11+68),r1 <== NOT EXECUTED fat_buf_release(fs_info); 801a5e4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 801a5e8: fb ff d9 87 calli 8010c04 <== NOT EXECUTED return rc; 801a5ec: e3 ff ff ef bi 801a5a8 <== NOT EXECUTED ) { int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; 801a5f0: 34 0e 00 00 mvi r14,0 <== NOT EXECUTED fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; 801a5f4: 34 0f 00 00 mvi r15,0 <== NOT EXECUTED 801a5f8: e3 ff ff e3 bi 801a584 <== NOT EXECUTED =============================================================================== 08012370 : void fat_free_unique_ino( fat_fs_info_t *fs_info, uint32_t ino ) { 8012370: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED 8012374: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED 8012378: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED FAT_SET_UNIQ_INO_FREE((ino - fs_info->uino_base), fs_info->uino); 801237c: 28 23 00 80 lw r3,(r1+128) <== NOT EXECUTED 8012380: 28 2b 00 74 lw r11,(r1+116) <== NOT EXECUTED 8012384: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8012388: c8 43 10 00 sub r2,r2,r3 <== NOT EXECUTED 801238c: 00 43 00 01 srui r3,r2,1 <== NOT EXECUTED 8012390: 20 42 00 07 andi r2,r2,0x7 <== NOT EXECUTED 8012394: 00 63 00 01 srui r3,r3,1 <== NOT EXECUTED 8012398: 00 63 00 01 srui r3,r3,1 <== NOT EXECUTED 801239c: b5 63 58 00 add r11,r11,r3 <== NOT EXECUTED 80123a0: fb ff bb 71 calli 8001164 <__ashlsi3> <== NOT EXECUTED 80123a4: 41 62 00 00 lbu r2,(r11+0) <== NOT EXECUTED 80123a8: a4 20 08 00 not r1,r1 <== NOT EXECUTED 80123ac: a0 22 08 00 and r1,r1,r2 <== NOT EXECUTED 80123b0: 31 61 00 00 sb (r11+0),r1 <== NOT EXECUTED } 80123b4: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80123b8: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 80123bc: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 80123c0: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08019dc4 : fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 8019dc4: 37 9c ff dc addi sp,sp,-36 8019dc8: 5b 8b 00 20 sw (sp+32),r11 8019dcc: 5b 8c 00 1c sw (sp+28),r12 8019dd0: 5b 8d 00 18 sw (sp+24),r13 8019dd4: 5b 8e 00 14 sw (sp+20),r14 8019dd8: 5b 8f 00 10 sw (sp+16),r15 8019ddc: 5b 90 00 0c sw (sp+12),r16 8019de0: 5b 91 00 08 sw (sp+8),r17 8019de4: 5b 9d 00 04 sw (sp+4),ra 8019de8: b8 20 58 00 mv r11,r1 uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 8019dec: 34 01 00 01 mvi r1,1 fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 8019df0: b8 40 60 00 mv r12,r2 8019df4: b8 60 78 00 mv r15,r3 uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 8019df8: 50 22 00 21 bgeu r1,r2,8019e7c <== NEVER TAKEN 8019dfc: 29 61 00 38 lw r1,(r11+56) 8019e00: 34 21 00 01 addi r1,r1,1 8019e04: 50 22 00 02 bgeu r1,r2,8019e0c <== ALWAYS TAKEN 8019e08: e0 00 00 1d bi 8019e7c <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 8019e0c: 41 62 00 0e lbu r2,(r11+14) 8019e10: 20 41 00 01 andi r1,r2,0x1 8019e14: 5c 20 00 29 bne r1,r0,8019eb8 8019e18: 20 42 00 02 andi r2,r2,0x2 8019e1c: 44 41 00 2f be r2,r1,8019ed8 8019e20: 41 62 00 02 lbu r2,(r11+2) 8019e24: b5 8c 70 00 add r14,r12,r12 8019e28: b9 c0 08 00 mv r1,r14 8019e2c: f8 00 54 73 calli 802eff8 <__lshrsi3> 8019e30: 29 70 00 58 lw r16,(r11+88) 8019e34: b4 30 80 00 add r16,r1,r16 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 8019e38: b9 60 08 00 mv r1,r11 8019e3c: ba 00 10 00 mv r2,r16 8019e40: 34 03 00 01 mvi r3,1 8019e44: 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); 8019e48: 2d 71 00 00 lhu r17,(r11+0) rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 8019e4c: fb ff db e9 calli 8010df0 8019e50: b8 20 68 00 mv r13,r1 if (rc != RC_OK) 8019e54: 5c 20 00 0e bne r1,r0,8019e8c <== NEVER TAKEN return rc; switch ( fs_info->vol.type ) 8019e58: 41 61 00 0e lbu r1,(r11+14) if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 8019e5c: 36 31 ff ff addi r17,r17,-1 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 8019e60: 34 02 00 02 mvi r2,2 if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 8019e64: a1 d1 70 00 and r14,r14,r17 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 8019e68: 44 22 00 24 be r1,r2,8019ef8 8019e6c: 34 02 00 04 mvi r2,4 8019e70: 44 22 00 53 be r1,r2,8019fbc 8019e74: 34 02 00 01 mvi r2,1 8019e78: 44 22 00 37 be r1,r2,8019f54 <== ALWAYS TAKEN *ret_val = *((uint32_t *)(sec_buf + ofs)); *ret_val = CF_LE_L(*ret_val); break; default: rtems_set_errno_and_return_minus_one(EIO); 8019e7c: f8 00 0a 5e calli 801c7f4 <__errno> <== NOT EXECUTED 8019e80: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8019e84: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8019e88: 34 0d ff ff mvi r13,-1 <== NOT EXECUTED break; } return RC_OK; } 8019e8c: b9 a0 08 00 mv r1,r13 8019e90: 2b 9d 00 04 lw ra,(sp+4) 8019e94: 2b 8b 00 20 lw r11,(sp+32) 8019e98: 2b 8c 00 1c lw r12,(sp+28) 8019e9c: 2b 8d 00 18 lw r13,(sp+24) 8019ea0: 2b 8e 00 14 lw r14,(sp+20) 8019ea4: 2b 8f 00 10 lw r15,(sp+16) 8019ea8: 2b 90 00 0c lw r16,(sp+12) 8019eac: 2b 91 00 08 lw r17,(sp+8) 8019eb0: 37 9c 00 24 addi sp,sp,36 8019eb4: c3 a0 00 00 ret /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 8019eb8: 01 8e 00 01 srui r14,r12,1 8019ebc: 41 62 00 02 lbu r2,(r11+2) 8019ec0: b5 cc 70 00 add r14,r14,r12 8019ec4: b9 c0 08 00 mv r1,r14 8019ec8: f8 00 54 4c calli 802eff8 <__lshrsi3> 8019ecc: 29 70 00 58 lw r16,(r11+88) 8019ed0: b4 30 80 00 add r16,r1,r16 8019ed4: e3 ff ff d9 bi 8019e38 8019ed8: b5 8c 70 00 add r14,r12,r12 8019edc: 41 62 00 02 lbu r2,(r11+2) 8019ee0: b5 ce 70 00 add r14,r14,r14 8019ee4: b9 c0 08 00 mv r1,r14 8019ee8: f8 00 54 44 calli 802eff8 <__lshrsi3> 8019eec: 29 70 00 58 lw r16,(r11+88) 8019ef0: b4 30 80 00 add r16,r1,r16 8019ef4: e3 ff ff d1 bi 8019e38 else *ret_val = (*ret_val) & FAT_FAT12_MASK; break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 8019ef8: 2b 81 00 24 lw r1,(sp+36) 8019efc: b4 2e 70 00 add r14,r1,r14 8019f00: 2d c2 00 00 lhu r2,(r14+0) * @param[in] value is the value to be swapped * @return the value after being endian swapped */ static inline uint16_t CPU_swap_u16(uint16_t v) { return v << 8 | v >> 8; 8019f04: 00 41 00 01 srui r1,r2,1 8019f08: b4 42 10 00 add r2,r2,r2 8019f0c: 00 21 00 01 srui r1,r1,1 8019f10: b4 42 10 00 add r2,r2,r2 8019f14: 00 21 00 01 srui r1,r1,1 8019f18: b4 42 10 00 add r2,r2,r2 8019f1c: 00 21 00 01 srui r1,r1,1 8019f20: b4 42 10 00 add r2,r2,r2 8019f24: 00 21 00 01 srui r1,r1,1 8019f28: b4 42 10 00 add r2,r2,r2 8019f2c: 00 21 00 01 srui r1,r1,1 8019f30: b4 42 10 00 add r2,r2,r2 8019f34: 00 21 00 01 srui r1,r1,1 8019f38: b4 42 10 00 add r2,r2,r2 8019f3c: 00 21 00 01 srui r1,r1,1 8019f40: b4 42 10 00 add r2,r2,r2 8019f44: b8 41 08 00 or r1,r2,r1 *ret_val = CF_LE_W(*ret_val); 8019f48: 20 21 ff ff andi r1,r1,0xffff 8019f4c: 59 e1 00 00 sw (r15+0),r1 break; 8019f50: e3 ff ff cf bi 8019e8c case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 8019f54: 2b 82 00 24 lw r2,(sp+36) if ( ofs == (fs_info->vol.bps - 1) ) 8019f58: 2d 63 00 00 lhu r3,(r11+0) case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 8019f5c: b4 4e 10 00 add r2,r2,r14 8019f60: 40 41 00 00 lbu r1,(r2+0) if ( ofs == (fs_info->vol.bps - 1) ) 8019f64: 34 63 ff ff addi r3,r3,-1 case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 8019f68: 59 e1 00 00 sw (r15+0),r1 if ( ofs == (fs_info->vol.bps - 1) ) 8019f6c: 44 6e 00 3d be r3,r14,801a060 <== NEVER TAKEN *ret_val |= *sec_buf << 8; } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 8019f70: 40 42 00 01 lbu r2,(r2+1) 8019f74: b4 42 10 00 add r2,r2,r2 8019f78: b4 42 10 00 add r2,r2,r2 8019f7c: b4 42 10 00 add r2,r2,r2 8019f80: b4 42 10 00 add r2,r2,r2 8019f84: b4 42 10 00 add r2,r2,r2 8019f88: b4 42 10 00 add r2,r2,r2 8019f8c: b4 42 10 00 add r2,r2,r2 8019f90: b4 42 10 00 add r2,r2,r2 8019f94: b8 41 10 00 or r2,r2,r1 8019f98: 59 e2 00 00 sw (r15+0),r2 } if ( FAT_CLUSTER_IS_ODD(cln) ) 8019f9c: 21 8c 00 01 andi r12,r12,0x1 8019fa0: 45 80 00 2d be r12,r0,801a054 *ret_val = (*ret_val) >> FAT12_SHIFT; 8019fa4: 00 42 00 01 srui r2,r2,1 8019fa8: 00 42 00 01 srui r2,r2,1 8019fac: 00 42 00 01 srui r2,r2,1 8019fb0: 00 42 00 01 srui r2,r2,1 8019fb4: 59 e2 00 00 sw (r15+0),r2 8019fb8: e3 ff ff b5 bi 8019e8c *ret_val = *((uint16_t *)(sec_buf + ofs)); *ret_val = CF_LE_W(*ret_val); break; case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); 8019fbc: 2b 81 00 24 lw r1,(sp+36) byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8019fc0: 34 02 00 18 mvi r2,24 8019fc4: b4 2e 70 00 add r14,r1,r14 8019fc8: 29 cb 00 00 lw r11,(r14+0) 8019fcc: 21 61 00 ff andi r1,r11,0xff 8019fd0: fb ff 9c 65 calli 8001164 <__ashlsi3> 8019fd4: b8 20 60 00 mv r12,r1 uint32_t value ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; 8019fd8: 34 02 00 18 mvi r2,24 8019fdc: b9 60 08 00 mv r1,r11 8019fe0: f8 00 54 06 calli 802eff8 <__lshrsi3> byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8019fe4: 01 64 00 01 srui r4,r11,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8019fe8: b9 81 60 00 or r12,r12,r1 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8019fec: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8019ff0: 34 02 00 10 mvi r2,16 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8019ff4: 00 84 00 01 srui r4,r4,1 8019ff8: 00 84 00 01 srui r4,r4,1 8019ffc: 00 84 00 01 srui r4,r4,1 801a000: 00 84 00 01 srui r4,r4,1 801a004: 00 84 00 01 srui r4,r4,1 801a008: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 801a00c: 20 81 00 ff andi r1,r4,0xff 801a010: fb ff 9c 55 calli 8001164 <__ashlsi3> 801a014: b9 81 60 00 or r12,r12,r1 ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; 801a018: 34 02 00 10 mvi r2,16 801a01c: b9 60 08 00 mv r1,r11 801a020: f8 00 53 f6 calli 802eff8 <__lshrsi3> 801a024: 20 22 00 ff andi r2,r1,0xff byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 801a028: b4 42 10 00 add r2,r2,r2 801a02c: b4 42 10 00 add r2,r2,r2 801a030: b4 42 10 00 add r2,r2,r2 801a034: b4 42 10 00 add r2,r2,r2 801a038: b4 42 10 00 add r2,r2,r2 801a03c: b4 42 10 00 add r2,r2,r2 801a040: b4 42 10 00 add r2,r2,r2 801a044: b4 42 10 00 add r2,r2,r2 801a048: b9 82 10 00 or r2,r12,r2 *ret_val = CF_LE_L(*ret_val); 801a04c: 59 e2 00 00 sw (r15+0),r2 break; 801a050: e3 ff ff 8f bi 8019e8c } if ( FAT_CLUSTER_IS_ODD(cln) ) *ret_val = (*ret_val) >> FAT12_SHIFT; else *ret_val = (*ret_val) & FAT_FAT12_MASK; 801a054: 20 42 0f ff andi r2,r2,0xfff 801a058: 59 e2 00 00 sw (r15+0),r2 801a05c: e3 ff ff 8c bi 8019e8c * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 801a060: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 801a064: 36 02 00 01 addi r2,r16,1 <== NOT EXECUTED 801a068: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 801a06c: 37 84 00 24 addi r4,sp,36 <== NOT EXECUTED 801a070: fb ff db 60 calli 8010df0 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 801a074: 5c 20 00 0f bne r1,r0,801a0b0 <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; 801a078: 2b 81 00 24 lw r1,(sp+36) <== NOT EXECUTED 801a07c: 29 e2 00 00 lw r2,(r15+0) <== NOT EXECUTED 801a080: 40 21 00 00 lbu r1,(r1+0) <== NOT EXECUTED 801a084: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 801a088: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 801a08c: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 801a090: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 801a094: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 801a098: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 801a09c: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 801a0a0: b4 21 08 00 add r1,r1,r1 <== NOT EXECUTED 801a0a4: b8 22 10 00 or r2,r1,r2 <== NOT EXECUTED 801a0a8: 59 e2 00 00 sw (r15+0),r2 <== NOT EXECUTED 801a0ac: e3 ff ff bc bi 8019f9c <== 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) 801a0b0: b8 20 68 00 mv r13,r1 <== NOT EXECUTED 801a0b4: e3 ff ff 76 bi 8019e8c <== NOT EXECUTED =============================================================================== 08012224 : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 8012224: 37 9c ff d8 addi sp,sp,-40 <== NOT EXECUTED 8012228: 5b 8b 00 28 sw (sp+40),r11 <== NOT EXECUTED 801222c: 5b 8c 00 24 sw (sp+36),r12 <== NOT EXECUTED 8012230: 5b 8d 00 20 sw (sp+32),r13 <== NOT EXECUTED 8012234: 5b 8e 00 1c sw (sp+28),r14 <== NOT EXECUTED 8012238: 5b 8f 00 18 sw (sp+24),r15 <== NOT EXECUTED 801223c: 5b 90 00 14 sw (sp+20),r16 <== NOT EXECUTED 8012240: 5b 91 00 10 sw (sp+16),r17 <== NOT EXECUTED 8012244: 5b 92 00 0c sw (sp+12),r18 <== NOT EXECUTED 8012248: 5b 93 00 08 sw (sp+8),r19 <== NOT EXECUTED 801224c: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED 8012250: b8 20 60 00 mv r12,r1 <== NOT EXECUTED 8012254: 28 2e 00 7c lw r14,(r1+124) <== NOT EXECUTED fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) fs_info->index = 0; } if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) 8012258: 78 01 08 03 mvhi r1,0x803 <== NOT EXECUTED 801225c: 38 21 03 04 ori r1,r1,0x304 <== NOT EXECUTED 8012260: 28 33 00 00 lw r19,(r1+0) <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 8012264: 45 c0 00 15 be r14,r0,80122b8 <== NOT EXECUTED { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 8012268: 29 8b 00 78 lw r11,(r12+120) <== NOT EXECUTED 801226c: 29 92 00 74 lw r18,(r12+116) <== NOT EXECUTED 8012270: 01 6f 00 01 srui r15,r11,1 <== NOT EXECUTED 8012274: 21 71 00 07 andi r17,r11,0x7 <== NOT EXECUTED 8012278: 01 ef 00 01 srui r15,r15,1 <== NOT EXECUTED 801227c: ba 20 10 00 mv r2,r17 <== NOT EXECUTED 8012280: 01 ef 00 01 srui r15,r15,1 <== NOT EXECUTED 8012284: b6 4f 78 00 add r15,r18,r15 <== NOT EXECUTED 8012288: 41 f0 00 00 lbu r16,(r15+0) <== NOT EXECUTED 801228c: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 8012290: fb ff bb dc calli 8001200 <__ashrsi3> <== NOT EXECUTED 8012294: 20 21 00 01 andi r1,r1,0x1 <== NOT EXECUTED 8012298: 44 20 00 1f be r1,r0,8012314 <== NOT EXECUTED 801229c: 34 0d 00 00 mvi r13,0 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); return (fs_info->uino_base + fs_info->index); } fs_info->index++; 80122a0: 35 6b 00 01 addi r11,r11,1 <== NOT EXECUTED 80122a4: 59 8b 00 78 sw (r12+120),r11 <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 80122a8: 35 ad 00 01 addi r13,r13,1 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); return (fs_info->uino_base + fs_info->index); } fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) 80122ac: 55 cb 00 02 bgu r14,r11,80122b4 <== NOT EXECUTED fs_info->index = 0; 80122b0: 59 80 00 78 sw (r12+120),r0 <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 80122b4: 55 cd 00 0c bgu r14,r13,80122e4 <== 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)) 80122b8: 29 81 00 80 lw r1,(r12+128) <== NOT EXECUTED 80122bc: b5 ce 10 00 add r2,r14,r14 <== NOT EXECUTED 80122c0: ca 61 08 00 sub r1,r19,r1 <== NOT EXECUTED 80122c4: 50 41 00 06 bgeu r2,r1,80122dc <== NOT EXECUTED { fs_info->uino_pool_size <<= 1; fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); 80122c8: 29 81 00 74 lw r1,(r12+116) <== NOT EXECUTED fs_info->index = 0; } if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) { fs_info->uino_pool_size <<= 1; 80122cc: 59 82 00 7c sw (r12+124),r2 <== NOT EXECUTED fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); 80122d0: fb ff c8 1c calli 8004340 <== NOT EXECUTED 80122d4: 59 81 00 74 sw (r12+116),r1 <== NOT EXECUTED if (fs_info->uino != NULL) 80122d8: 5c 20 00 23 bne r1,r0,8012364 <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 80122dc: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 80122e0: e0 00 00 15 bi 8012334 <== NOT EXECUTED while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 80122e4: 29 8b 00 78 lw r11,(r12+120) <== NOT EXECUTED 80122e8: 01 63 00 01 srui r3,r11,1 <== NOT EXECUTED 80122ec: 21 71 00 07 andi r17,r11,0x7 <== NOT EXECUTED 80122f0: 00 63 00 01 srui r3,r3,1 <== NOT EXECUTED 80122f4: ba 20 10 00 mv r2,r17 <== NOT EXECUTED 80122f8: 00 63 00 01 srui r3,r3,1 <== NOT EXECUTED 80122fc: b6 43 78 00 add r15,r18,r3 <== NOT EXECUTED 8012300: 41 f0 00 00 lbu r16,(r15+0) <== NOT EXECUTED 8012304: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 8012308: fb ff bb be calli 8001200 <__ashrsi3> <== NOT EXECUTED 801230c: 20 21 00 01 andi r1,r1,0x1 <== NOT EXECUTED 8012310: 5c 20 ff e4 bne r1,r0,80122a0 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); 8012314: ba 20 10 00 mv r2,r17 <== NOT EXECUTED 8012318: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 801231c: fb ff bb 92 calli 8001164 <__ashlsi3> <== NOT EXECUTED 8012320: b8 30 08 00 or r1,r1,r16 <== NOT EXECUTED 8012324: 31 e1 00 00 sb (r15+0),r1 <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 8012328: 29 82 00 78 lw r2,(r12+120) <== NOT EXECUTED 801232c: 29 81 00 80 lw r1,(r12+128) <== NOT EXECUTED 8012330: b4 41 08 00 add r1,r2,r1 <== NOT EXECUTED } else resrc_unsuff = true; } return 0; } 8012334: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8012338: 2b 8b 00 28 lw r11,(sp+40) <== NOT EXECUTED 801233c: 2b 8c 00 24 lw r12,(sp+36) <== NOT EXECUTED 8012340: 2b 8d 00 20 lw r13,(sp+32) <== NOT EXECUTED 8012344: 2b 8e 00 1c lw r14,(sp+28) <== NOT EXECUTED 8012348: 2b 8f 00 18 lw r15,(sp+24) <== NOT EXECUTED 801234c: 2b 90 00 14 lw r16,(sp+20) <== NOT EXECUTED 8012350: 2b 91 00 10 lw r17,(sp+16) <== NOT EXECUTED 8012354: 2b 92 00 0c lw r18,(sp+12) <== NOT EXECUTED 8012358: 2b 93 00 08 lw r19,(sp+8) <== NOT EXECUTED 801235c: 37 9c 00 28 addi sp,sp,40 <== NOT EXECUTED 8012360: c3 a0 00 00 ret <== NOT EXECUTED if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) { fs_info->uino_pool_size <<= 1; fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); if (fs_info->uino != NULL) fs_info->index = fs_info->uino_pool_size; 8012364: 29 8e 00 7c lw r14,(r12+124) <== NOT EXECUTED 8012368: 59 8e 00 78 sw (r12+120),r14 <== NOT EXECUTED 801236c: e3 ff ff be bi 8012264 <== NOT EXECUTED =============================================================================== 08012198 : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 8012198: 37 9c ff f4 addi sp,sp,-12 801219c: 5b 8b 00 08 sw (sp+8),r11 80121a0: 5b 9d 00 04 sw (sp+4),ra 80121a4: b8 40 20 00 mv r4,r2 80121a8: b8 20 58 00 mv r11,r1 int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 80121ac: 5b 82 00 0c sw (sp+12),r2 while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 80121b0: 29 67 00 10 lw r7,(r11+16) 80121b4: 29 66 00 14 lw r6,(r11+20) { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 80121b8: b8 80 10 00 mv r2,r4 { int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 80121bc: a0 87 20 00 and r4,r4,r7 { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 80121c0: 34 03 00 00 mvi r3,0 80121c4: 34 05 00 00 mvi r5,0 80121c8: b9 60 08 00 mv r1,r11 { int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 80121cc: 54 c4 00 06 bgu r6,r4,80121e4 return rc; } } return rc; 80121d0: 34 01 00 00 mvi r1,0 } 80121d4: 2b 9d 00 04 lw ra,(sp+4) 80121d8: 2b 8b 00 08 lw r11,(sp+8) 80121dc: 37 9c 00 0c addi sp,sp,12 80121e0: c3 a0 00 00 ret ssize_t ret = 0; uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 80121e4: 2d 64 00 06 lhu r4,(r11+6) 80121e8: fb ff fb bc calli 80110d8 if ( ret != fs_info->vol.bpc ) 80121ec: 2d 62 00 06 lhu r2,(r11+6) { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 80121f0: 37 83 00 0c addi r3,sp,12 uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); if ( ret != fs_info->vol.bpc ) 80121f4: 5c 41 00 07 bne r2,r1,8012210 <== NEVER TAKEN { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 80121f8: 2b 82 00 0c lw r2,(sp+12) 80121fc: b9 60 08 00 mv r1,r11 8012200: f8 00 1e f1 calli 8019dc4 if ( rc != RC_OK ) 8012204: 5c 20 ff f4 bne r1,r0,80121d4 <== NEVER TAKEN 8012208: 2b 84 00 0c lw r4,(sp+12) 801220c: e3 ff ff e9 bi 80121b0 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; 8012210: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED } } return rc; } 8012214: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8012218: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 801221c: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 8012220: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080114b8 : * 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) { 80114b8: 37 9c ff 2c addi sp,sp,-212 80114bc: 5b 8b 00 44 sw (sp+68),r11 80114c0: 5b 8c 00 40 sw (sp+64),r12 80114c4: 5b 8d 00 3c sw (sp+60),r13 80114c8: 5b 8e 00 38 sw (sp+56),r14 80114cc: 5b 8f 00 34 sw (sp+52),r15 80114d0: 5b 90 00 30 sw (sp+48),r16 80114d4: 5b 91 00 2c sw (sp+44),r17 80114d8: 5b 92 00 28 sw (sp+40),r18 80114dc: 5b 93 00 24 sw (sp+36),r19 80114e0: 5b 94 00 20 sw (sp+32),r20 80114e4: 5b 95 00 1c sw (sp+28),r21 80114e8: 5b 96 00 18 sw (sp+24),r22 80114ec: 5b 97 00 14 sw (sp+20),r23 80114f0: 5b 98 00 10 sw (sp+16),r24 80114f4: 5b 99 00 0c sw (sp+12),r25 80114f8: 5b 9b 00 08 sw (sp+8),fp 80114fc: 5b 9d 00 04 sw (sp+4),ra 8011500: b8 20 70 00 mv r14,r1 ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; vol->fd = open(device, O_RDWR); 8011504: b8 40 08 00 mv r1,r2 8011508: 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; 801150c: 5b 80 00 d4 sw (sp+212),r0 vol->fd = open(device, O_RDWR); 8011510: fb ff ca c7 calli 800402c 8011514: 59 c1 00 60 sw (r14+96),r1 if (vol->fd < 0) 8011518: 4c 20 00 19 bge r1,r0,801157c <== ALWAYS TAKEN rc = fstat(vol->fd, &stat_buf); if (rc != 0) { close(vol->fd); rtems_set_errno_and_return_minus_one(ENXIO); 801151c: f8 00 2c b6 calli 801c7f4 <__errno> <== NOT EXECUTED 8011520: 34 02 00 06 mvi r2,6 <== NOT EXECUTED 8011524: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8011528: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED vol->sectors_per_block = vol->spc; } } return RC_OK; } 801152c: b8 40 08 00 mv r1,r2 8011530: 2b 9d 00 04 lw ra,(sp+4) 8011534: 2b 8b 00 44 lw r11,(sp+68) 8011538: 2b 8c 00 40 lw r12,(sp+64) 801153c: 2b 8d 00 3c lw r13,(sp+60) 8011540: 2b 8e 00 38 lw r14,(sp+56) 8011544: 2b 8f 00 34 lw r15,(sp+52) 8011548: 2b 90 00 30 lw r16,(sp+48) 801154c: 2b 91 00 2c lw r17,(sp+44) 8011550: 2b 92 00 28 lw r18,(sp+40) 8011554: 2b 93 00 24 lw r19,(sp+36) 8011558: 2b 94 00 20 lw r20,(sp+32) 801155c: 2b 95 00 1c lw r21,(sp+28) 8011560: 2b 96 00 18 lw r22,(sp+24) 8011564: 2b 97 00 14 lw r23,(sp+20) 8011568: 2b 98 00 10 lw r24,(sp+16) 801156c: 2b 99 00 0c lw r25,(sp+12) 8011570: 2b 9b 00 08 lw fp,(sp+8) 8011574: 37 9c 00 d4 addi sp,sp,212 8011578: c3 a0 00 00 ret if (vol->fd < 0) { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); 801157c: 37 82 00 80 addi r2,sp,128 8011580: fb ff c6 e0 calli 8003100 if (rc != 0) 8011584: 5c 20 02 2c bne r1,r0,8011e34 <== NEVER TAKEN close(vol->fd); rtems_set_errno_and_return_minus_one(ENXIO); } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) 8011588: 2b 83 00 8c lw r3,(sp+140) 801158c: 34 02 60 00 mvi r2,24576 8011590: 20 63 f0 00 andi r3,r3,0xf000 8011594: 5c 62 02 15 bne r3,r2,8011de8 <== 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); 8011598: 78 03 08 03 mvhi r3,0x803 801159c: 38 63 02 08 ori r3,r3,0x208 80115a0: 28 62 00 00 lw r2,(r3+0) 80115a4: 29 c1 00 60 lw r1,(r14+96) 80115a8: 35 c3 00 64 addi r3,r14,100 80115ac: f8 00 06 e6 calli 8013144 80115b0: 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) { 80115b4: 5c 20 02 0d bne r1,r0,8011de8 <== 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); 80115b8: 29 c1 00 64 lw r1,(r14+100) 80115bc: 34 02 00 00 mvi r2,0 80115c0: 37 83 00 d4 addi r3,sp,212 80115c4: fb ff f4 0f calli 800e600 80115c8: b8 20 68 00 mv r13,r1 if (sc != RTEMS_SUCCESSFUL) 80115cc: 5c 2b 02 10 bne r1,r11,8011e0c <== NEVER TAKEN { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 80115d0: 2b 82 00 d4 lw r2,(sp+212) 80115d4: 28 45 00 1c lw r5,(r2+28) sc = rtems_bdbuf_release( block); 80115d8: b8 40 08 00 mv r1,r2 { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 80115dc: 40 a4 00 20 lbu r4,(r5+32) 80115e0: 40 b1 00 0b lbu r17,(r5+11) 80115e4: 40 af 00 0c lbu r15,(r5+12) 80115e8: 40 b2 00 0d lbu r18,(r5+13) 80115ec: 40 b0 00 0e lbu r16,(r5+14) 80115f0: 40 b4 00 0f lbu r20,(r5+15) 80115f4: 40 b7 00 10 lbu r23,(r5+16) 80115f8: 40 b8 00 11 lbu r24,(r5+17) 80115fc: 40 b3 00 12 lbu r19,(r5+18) 8011600: 40 b9 00 13 lbu r25,(r5+19) 8011604: 40 b5 00 14 lbu r21,(r5+20) 8011608: 40 bb 00 16 lbu fp,(r5+22) 801160c: 40 b6 00 17 lbu r22,(r5+23) 8011610: 5b 84 00 54 sw (sp+84),r4 8011614: 40 a2 00 22 lbu r2,(r5+34) 8011618: 40 ab 00 21 lbu r11,(r5+33) 801161c: 5b 82 00 58 sw (sp+88),r2 8011620: 40 a3 00 23 lbu r3,(r5+35) 8011624: 5b 83 00 5c sw (sp+92),r3 8011628: 40 a4 00 24 lbu r4,(r5+36) 801162c: 5b 84 00 60 sw (sp+96),r4 8011630: 40 a2 00 26 lbu r2,(r5+38) 8011634: 40 ac 00 25 lbu r12,(r5+37) 8011638: 5b 82 00 4c sw (sp+76),r2 801163c: 40 a3 00 27 lbu r3,(r5+39) 8011640: 5b 83 00 50 sw (sp+80),r3 8011644: 40 a4 00 28 lbu r4,(r5+40) 8011648: 5b 84 00 7c sw (sp+124),r4 801164c: 40 a2 00 29 lbu r2,(r5+41) 8011650: 5b 82 00 68 sw (sp+104),r2 8011654: 40 a3 00 2c lbu r3,(r5+44) 8011658: 5b 83 00 78 sw (sp+120),r3 801165c: 40 a4 00 2d lbu r4,(r5+45) 8011660: 5b 84 00 64 sw (sp+100),r4 8011664: 40 a2 00 2e lbu r2,(r5+46) 8011668: 5b 82 00 74 sw (sp+116),r2 801166c: 40 a3 00 2f lbu r3,(r5+47) 8011670: 5b 83 00 70 sw (sp+112),r3 8011674: 40 a4 00 30 lbu r4,(r5+48) 8011678: 5b 84 00 6c sw (sp+108),r4 801167c: 40 a5 00 31 lbu r5,(r5+49) 8011680: 5b 85 00 48 sw (sp+72),r5 sc = rtems_bdbuf_release( block); 8011684: fb ff f4 70 calli 800e844 if (sc != RTEMS_SUCCESSFUL) 8011688: 5c 2d 01 e1 bne r1,r13,8011e0c <== NEVER TAKEN close(vol->fd); rtems_set_errno_and_return_minus_one( EIO ); } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 801168c: b5 ef 30 00 add r6,r15,r15 8011690: b4 c6 30 00 add r6,r6,r6 8011694: b4 c6 30 00 add r6,r6,r6 8011698: b4 c6 30 00 add r6,r6,r6 801169c: b4 c6 30 00 add r6,r6,r6 80116a0: b4 c6 30 00 add r6,r6,r6 80116a4: b4 c6 30 00 add r6,r6,r6 80116a8: b4 c6 30 00 add r6,r6,r6 80116ac: b8 d1 88 00 or r17,r6,r17 if ( (vol->bps != 512) && 80116b0: 7e 28 04 00 cmpnei r8,r17,1024 80116b4: 7e 27 02 00 cmpnei r7,r17,512 close(vol->fd); rtems_set_errno_and_return_minus_one( EIO ); } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 80116b8: 0d d1 00 00 sh (r14+0),r17 if ( (vol->bps != 512) && 80116bc: a1 07 68 00 and r13,r8,r7 80116c0: 45 a1 00 41 be r13,r1,80117c4 <== ALWAYS TAKEN (vol->bps != 1024) && 80116c4: 34 08 08 00 mvi r8,2048 <== NOT EXECUTED 80116c8: 46 28 00 03 be r17,r8,80116d4 <== NOT EXECUTED (vol->bps != 2048) && 80116cc: 34 08 10 00 mvi r8,4096 <== NOT EXECUTED 80116d0: 5e 28 00 36 bne r17,r8,80117a8 <== 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; 80116d4: 31 c0 00 03 sb (r14+3),r0 <== NOT EXECUTED 80116d8: ba 20 08 00 mv r1,r17 <== NOT EXECUTED 80116dc: 34 02 00 09 mvi r2,9 <== NOT EXECUTED 80116e0: f8 00 76 46 calli 802eff8 <__lshrsi3> <== NOT EXECUTED 80116e4: 20 27 ff ff andi r7,r1,0xffff <== NOT EXECUTED 80116e8: 41 c6 00 03 lbu r6,(r14+3) <== NOT EXECUTED i >>= 1, vol->sec_mul++); 80116ec: 14 e7 00 01 sri r7,r7,1 <== NOT EXECUTED 80116f0: 34 c6 00 01 addi r6,r6,1 <== NOT EXECUTED (vol->bps != 4096)) { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; 80116f4: 20 e1 00 01 andi r1,r7,0x1 <== NOT EXECUTED i >>= 1, vol->sec_mul++); 80116f8: 20 c6 00 ff andi r6,r6,0xff <== NOT EXECUTED (vol->bps != 4096)) { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; 80116fc: 44 20 ff fc be r1,r0,80116ec <== NOT EXECUTED 8011700: 31 c6 00 03 sb (r14+3),r6 <== NOT EXECUTED i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 8011704: 31 c0 00 02 sb (r14+2),r0 8011708: 22 28 00 01 andi r8,r17,0x1 801170c: 34 0f 00 00 mvi r15,0 8011710: 5d 00 00 0b bne r8,r0,801173c <== NEVER TAKEN 8011714: ba 20 38 00 mv r7,r17 8011718: 34 0f 00 01 mvi r15,1 801171c: e0 00 00 02 bi 8011724 8011720: b8 40 78 00 mv r15,r2 i >>= 1, vol->sec_log2++); 8011724: 14 e7 00 01 sri r7,r7,1 8011728: 35 e2 00 01 addi r2,r15,1 close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 801172c: 20 e1 00 01 andi r1,r7,0x1 i >>= 1, vol->sec_log2++); 8011730: 20 42 00 ff andi r2,r2,0xff close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 8011734: 44 20 ff fb be r1,r0,8011720 8011738: 31 cf 00 02 sb (r14+2),r15 i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; vol->bytes_per_block_log2 = vol->sec_log2; vol->sectors_per_block = 1; 801173c: 34 06 00 01 mvi r6,1 for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; 8011740: 0d d1 00 0a sh (r14+10),r17 vol->bytes_per_block_log2 = vol->sec_log2; 8011744: 31 cf 00 0c sb (r14+12),r15 vol->sectors_per_block = 1; 8011748: 31 c6 00 09 sb (r14+9),r6 vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); 801174c: 31 d2 00 04 sb (r14+4),r18 /* * "sectors per cluster" of zero is invalid * (and would hang the following loop) */ if (vol->spc == 0) 8011750: 46 40 00 16 be r18,r0,80117a8 <== NEVER TAKEN { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 8011754: 31 c0 00 05 sb (r14+5),r0 8011758: 22 49 00 01 andi r9,r18,0x1 801175c: ba 40 40 00 mv r8,r18 8011760: 34 07 00 00 mvi r7,0 8011764: 5d 20 00 0a bne r9,r0,801178c 8011768: 34 07 00 01 mvi r7,1 801176c: e0 00 00 02 bi 8011774 8011770: b8 40 38 00 mv r7,r2 i >>= 1, vol->spc_log2++); 8011774: 15 08 00 01 sri r8,r8,1 8011778: 34 e2 00 01 addi r2,r7,1 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 801177c: 21 01 00 01 andi r1,r8,0x1 i >>= 1, vol->spc_log2++); 8011780: 20 42 00 ff andi r2,r2,0xff { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 8011784: 44 20 ff fb be r1,r0,8011770 8011788: 31 c7 00 05 sb (r14+5),r7 i >>= 1, vol->spc_log2++); /* * "bytes per cluster" value greater than 32K is invalid */ if ((vol->bpc = vol->bps << vol->spc_log2) > MS_BYTES_PER_CLUSTER_LIMIT) 801178c: ba 20 08 00 mv r1,r17 8011790: b8 e0 10 00 mv r2,r7 8011794: fb ff be 74 calli 8001164 <__ashlsi3> 8011798: 20 28 ff ff andi r8,r1,0xffff 801179c: 0d c8 00 06 sh (r14+6),r8 80117a0: 38 06 80 00 mvu r6,0x8000 80117a4: 50 c8 00 10 bgeu r6,r8,80117e4 <== ALWAYS TAKEN if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(fs_info); close(vol->fd); 80117a8: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 80117ac: fb ff c5 f8 calli 8002f8c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 80117b0: f8 00 2c 11 calli 801c7f4 <__errno> <== NOT EXECUTED 80117b4: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 80117b8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 80117bc: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 80117c0: e3 ff ff 5b bi 801152c <== 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; 80117c4: 31 c0 00 03 sb (r14+3),r0 80117c8: ba 20 08 00 mv r1,r17 80117cc: 34 02 00 09 mvi r2,9 80117d0: f8 00 76 0a calli 802eff8 <__lshrsi3> 80117d4: 20 27 ff ff andi r7,r1,0xffff 80117d8: 20 e8 00 01 andi r8,r7,0x1 80117dc: 45 0d ff c3 be r8,r13,80116e8 <== NEVER TAKEN 80117e0: e3 ff ff c9 bi 8011704 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 80117e4: 31 c0 00 08 sb (r14+8),r0 80117e8: 21 06 00 01 andi r6,r8,0x1 80117ec: 34 07 00 01 mvi r7,1 80117f0: 44 c0 00 03 be r6,r0,80117fc <== ALWAYS TAKEN 80117f4: e0 00 00 08 bi 8011814 <== NOT EXECUTED 80117f8: b8 40 38 00 mv r7,r2 i >>= 1, vol->bpc_log2++); 80117fc: 15 08 00 01 sri r8,r8,1 8011800: 34 e2 00 01 addi r2,r7,1 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 8011804: 21 01 00 01 andi r1,r8,0x1 i >>= 1, vol->bpc_log2++); 8011808: 20 42 00 ff andi r2,r2,0xff { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 801180c: 44 20 ff fb be r1,r0,80117f8 8011810: 31 c7 00 08 sb (r14+8),r7 i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 8011814: b6 73 38 00 add r7,r19,r19 8011818: b4 e7 38 00 add r7,r7,r7 801181c: b4 e7 38 00 add r7,r7,r7 8011820: b4 e7 38 00 add r7,r7,r7 8011824: b4 e7 38 00 add r7,r7,r7 8011828: b4 e7 38 00 add r7,r7,r7 for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 801182c: b6 94 28 00 add r5,r20,r20 8011830: b4 a5 28 00 add r5,r5,r5 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 8011834: b4 e7 38 00 add r7,r7,r7 8011838: b4 e7 38 00 add r7,r7,r7 for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 801183c: b4 a5 28 00 add r5,r5,r5 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 8011840: b8 f8 48 00 or r9,r7,r24 for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 8011844: b4 a5 28 00 add r5,r5,r5 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 8011848: b5 29 38 00 add r7,r9,r9 for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 801184c: b4 a5 28 00 add r5,r5,r5 8011850: b4 a5 28 00 add r5,r5,r5 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 8011854: b4 e7 38 00 add r7,r7,r7 for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 8011858: b4 a5 28 00 add r5,r5,r5 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 801185c: b4 e7 38 00 add r7,r7,r7 for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 8011860: b4 a5 28 00 add r5,r5,r5 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 8011864: b4 e7 38 00 add r7,r7,r7 for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 8011868: b8 b0 80 00 or r16,r5,r16 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 801186c: b4 e7 38 00 add r7,r7,r7 8011870: 36 28 ff ff addi r8,r17,-1 i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 8011874: 0d c9 00 24 sh (r14+36),r9 /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 8011878: b5 07 08 00 add r1,r8,r7 801187c: ba 20 10 00 mv r2,r17 } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); 8011880: 31 d7 00 0d sb (r14+13),r23 vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 8011884: 0d d0 00 18 sh (r14+24),r16 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 8011888: fb ff be 91 calli 80012cc <__divsi3> vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 801188c: b9 e0 10 00 mv r2,r15 vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 8011890: 59 c1 00 28 sw (r14+40),r1 8011894: b8 20 68 00 mv r13,r1 vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 8011898: fb ff be 33 calli 8001164 <__ashlsi3> if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 801189c: b6 d6 20 00 add r4,r22,r22 80118a0: b4 84 20 00 add r4,r4,r4 80118a4: b4 84 20 00 add r4,r4,r4 80118a8: b4 84 20 00 add r4,r4,r4 80118ac: b4 84 20 00 add r4,r4,r4 80118b0: b4 84 20 00 add r4,r4,r4 80118b4: b4 84 20 00 add r4,r4,r4 80118b8: b4 84 20 00 add r4,r4,r4 /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 80118bc: 59 c1 00 2c sw (r14+44),r1 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 80118c0: 34 02 00 10 mvi r2,16 80118c4: b8 9b 08 00 or r1,r4,fp 80118c8: fb ff be 27 calli 8001164 <__ashlsi3> 80118cc: 34 02 00 10 mvi r2,16 80118d0: fb ff be 4c calli 8001200 <__ashrsi3> 80118d4: 44 20 00 94 be r1,r0,8011b24 vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); 80118d8: 20 24 ff ff andi r4,r1,0xffff 80118dc: 59 c4 00 1c sw (r14+28),r4 else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 80118e0: ba e0 10 00 mv r2,r23 80118e4: b8 80 08 00 mv r1,r4 80118e8: fb ff be 6d calli 800129c <__mulsi3> vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 80118ec: b6 b5 18 00 add r3,r21,r21 80118f0: b4 63 18 00 add r3,r3,r3 80118f4: b4 63 18 00 add r3,r3,r3 80118f8: b4 63 18 00 add r3,r3,r3 80118fc: b4 63 18 00 add r3,r3,r3 8011900: b4 63 18 00 add r3,r3,r3 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 8011904: b4 30 28 00 add r5,r1,r16 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 8011908: b4 63 18 00 add r3,r3,r3 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 801190c: b4 ad 60 00 add r12,r5,r13 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 8011910: b4 63 18 00 add r3,r3,r3 8011914: 34 02 00 10 mvi r2,16 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 8011918: 59 cc 00 34 sw (r14+52),r12 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; 801191c: 59 c5 00 20 sw (r14+32),r5 if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 8011920: b8 79 08 00 or r1,r3,r25 8011924: fb ff be 10 calli 8001164 <__ashlsi3> 8011928: 34 02 00 10 mvi r2,16 801192c: fb ff be 35 calli 8001200 <__ashrsi3> 8011930: 44 20 00 69 be r1,r0,8011ad4 vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); 8011934: 20 24 ff ff andi r4,r1,0xffff 8011938: 59 c4 00 30 sw (r14+48),r4 else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); data_secs = vol->tot_secs - vol->data_fsec; vol->data_cls = data_secs / vol->spc; 801193c: c8 8c 08 00 sub r1,r4,r12 8011940: ba 40 10 00 mv r2,r18 8011944: f8 00 75 fd calli 802f138 <__udivsi3> 8011948: 59 c1 00 38 sw (r14+56),r1 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 801194c: 34 05 0f f4 mvi r5,4084 8011950: 54 25 00 89 bgu r1,r5,8011b74 { vol->type = FAT_FAT12; 8011954: 34 02 00 01 mvi r2,1 8011958: 31 c2 00 0e sb (r14+14),r2 vol->mask = FAT_FAT12_MASK; 801195c: 34 02 0f ff mvi r2,4095 8011960: 59 c2 00 10 sw (r14+16),r2 vol->eoc_val = FAT_FAT12_EOC; 8011964: 34 02 0f f8 mvi r2,4088 8011968: 59 c2 00 14 sw (r14+20),r2 else { vol->rdir_cl = 0; vol->mirror = 0; vol->afat = 0; vol->free_cls = FAT_UNDEFINED_VALUE; 801196c: 34 02 ff ff mvi r2,-1 } } } else { vol->rdir_cl = 0; 8011970: 59 c0 00 3c sw (r14+60),r0 vol->mirror = 0; 8011974: 31 c0 00 54 sb (r14+84),r0 vol->afat = 0; 8011978: 31 c0 00 5c sb (r14+92),r0 vol->free_cls = FAT_UNDEFINED_VALUE; 801197c: 59 c2 00 44 sw (r14+68),r2 vol->next_cl = FAT_UNDEFINED_VALUE; 8011980: 59 c2 00 4c sw (r14+76),r2 * 0 on success, or -1 if error occured and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) { return fat_buf_release(fs_info); 8011984: b9 c0 08 00 mv r1,r14 8011988: fb ff fc 9f calli 8010c04 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 801198c: 29 c2 00 1c lw r2,(r14+28) 8011990: 41 c1 00 5c lbu r1,(r14+92) 8011994: fb ff be 42 calli 800129c <__mulsi3> 8011998: 2d c3 00 18 lhu r3,(r14+24) /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 801199c: 34 02 00 0c mvi r2,12 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 80119a0: b4 23 18 00 add r3,r1,r3 80119a4: 59 c3 00 58 sw (r14+88),r3 /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 80119a8: 34 01 00 02 mvi r1,2 80119ac: fb ff c5 59 calli 8002f10 80119b0: 59 c1 00 6c sw (r14+108),r1 80119b4: b8 20 18 00 mv r3,r1 if ( fs_info->vhash == NULL ) 80119b8: 44 20 01 2d be r1,r0,8011e6c <== NEVER TAKEN Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; tail->previous = head; 80119bc: 58 61 00 08 sw (r3+8),r1 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 80119c0: 58 20 00 04 sw (r1+4),r0 close(vol->fd); rtems_set_errno_and_return_minus_one( ENOMEM ); } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->vhash + i); 80119c4: 34 24 00 0c addi r4,r1,12 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 80119c8: 34 26 00 04 addi r6,r1,4 80119cc: 34 25 00 10 addi r5,r1,16 head->next = tail; 80119d0: 58 66 00 00 sw (r3+0),r6 80119d4: 58 65 00 0c sw (r3+12),r5 fs_info->rhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 80119d8: 34 01 00 02 mvi r1,2 80119dc: 34 02 00 0c mvi r2,12 head->previous = NULL; 80119e0: 58 80 00 04 sw (r4+4),r0 tail->previous = head; 80119e4: 58 84 00 08 sw (r4+8),r4 80119e8: fb ff c5 4a calli 8002f10 80119ec: 59 c1 00 70 sw (r14+112),r1 80119f0: b8 20 18 00 mv r3,r1 if ( fs_info->rhash == NULL ) 80119f4: 44 20 01 25 be r1,r0,8011e88 <== NEVER TAKEN } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->rhash + i); fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE; fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 80119f8: 41 c2 00 03 lbu r2,(r14+3) 80119fc: 29 c1 00 30 lw r1,(r14+48) rtems_set_errno_and_return_minus_one( ENOMEM ); } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->rhash + i); fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE; 8011a00: 34 07 01 00 mvi r7,256 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 8011a04: 58 60 00 04 sw (r3+4),r0 tail->previous = head; 8011a08: 58 63 00 08 sw (r3+8),r3 8011a0c: 59 c7 00 7c sw (r14+124),r7 close(vol->fd); free(fs_info->vhash); rtems_set_errno_and_return_minus_one( ENOMEM ); } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->rhash + i); 8011a10: 34 64 00 0c addi r4,r3,12 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8011a14: 34 66 00 04 addi r6,r3,4 8011a18: 34 65 00 10 addi r5,r3,16 head->next = tail; 8011a1c: 58 66 00 00 sw (r3+0),r6 8011a20: 58 65 00 0c sw (r3+12),r5 head->previous = NULL; 8011a24: 58 80 00 04 sw (r4+4),r0 tail->previous = head; 8011a28: 58 84 00 08 sw (r4+8),r4 fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE; fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 8011a2c: fb ff bd ce calli 8001164 <__ashlsi3> 8011a30: b4 21 10 00 add r2,r1,r1 8011a34: b4 42 10 00 add r2,r2,r2 8011a38: b4 42 10 00 add r2,r2,r2 8011a3c: b4 42 10 00 add r2,r2,r2 8011a40: 59 c2 00 80 sw (r14+128),r2 fs_info->index = 0; 8011a44: 59 c0 00 78 sw (r14+120),r0 fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 8011a48: 34 01 01 00 mvi r1,256 8011a4c: 34 02 00 01 mvi r2,1 8011a50: fb ff c5 30 calli 8002f10 8011a54: 59 c1 00 74 sw (r14+116),r1 if ( fs_info->uino == NULL ) 8011a58: 44 20 00 fa be r1,r0,8011e40 <== NEVER TAKEN close(vol->fd); free(fs_info->vhash); free(fs_info->rhash); rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); 8011a5c: 2d c1 00 00 lhu r1,(r14+0) 8011a60: 34 02 00 01 mvi r2,1 8011a64: fb ff c5 2b calli 8002f10 8011a68: 59 c1 00 90 sw (r14+144),r1 if (fs_info->sec_buf == NULL) 8011a6c: 44 20 01 0b be r1,r0,8011e98 <== NEVER TAKEN return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 8011a70: 41 c3 00 04 lbu r3,(r14+4) 8011a74: 29 c4 00 34 lw r4,(r14+52) vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; 8011a78: 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; 8011a7c: 34 63 ff ff addi r3,r3,-1 8011a80: 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) 8011a84: 5c 80 fe aa bne r4,r0,801152c <== NEVER TAKEN && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) 8011a88: 41 c5 00 0e lbu r5,(r14+14) 8011a8c: 34 04 00 04 mvi r4,4 8011a90: 44 a4 00 04 be r5,r4,8011aa0 return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 8011a94: 29 c1 00 20 lw r1,(r14+32) 8011a98: 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))) 8011a9c: 5c 60 fe a4 bne r3,r0,801152c <== NEVER TAKEN { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 8011aa0: 2d c2 00 06 lhu r2,(r14+6) 8011aa4: 29 c1 00 64 lw r1,(r14+100) 8011aa8: 34 03 00 01 mvi r3,1 8011aac: fb ff f4 c2 calli 800edb4 vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; 8011ab0: 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) 8011ab4: 5c 20 fe 9e bne r1,r0,801152c <== NEVER TAKEN { vol->bytes_per_block = vol->bpc; 8011ab8: 2d c4 00 06 lhu r4,(r14+6) vol->bytes_per_block_log2 = vol->bpc_log2; 8011abc: 41 c3 00 08 lbu r3,(r14+8) vol->sectors_per_block = vol->spc; 8011ac0: 41 c1 00 04 lbu r1,(r14+4) && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); if (sc == RTEMS_SUCCESSFUL) { vol->bytes_per_block = vol->bpc; 8011ac4: 0d c4 00 0a sh (r14+10),r4 vol->bytes_per_block_log2 = vol->bpc_log2; 8011ac8: 31 c3 00 0c sb (r14+12),r3 vol->sectors_per_block = vol->spc; 8011acc: 31 c1 00 09 sb (r14+9),r1 8011ad0: e3 ff fe 97 bi 801152c vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); 8011ad4: b5 6b 58 00 add r11,r11,r11 8011ad8: b5 6b 58 00 add r11,r11,r11 8011adc: b5 6b 58 00 add r11,r11,r11 8011ae0: b5 6b 58 00 add r11,r11,r11 8011ae4: b5 6b 58 00 add r11,r11,r11 8011ae8: 2b 81 00 58 lw r1,(sp+88) 8011aec: b5 6b 58 00 add r11,r11,r11 8011af0: 34 02 00 10 mvi r2,16 8011af4: b5 6b 58 00 add r11,r11,r11 8011af8: fb ff bd 9b calli 8001164 <__ashlsi3> 8011afc: b5 6b 58 00 add r11,r11,r11 8011b00: 2b 84 00 54 lw r4,(sp+84) 8011b04: b9 61 58 00 or r11,r11,r1 8011b08: 2b 81 00 5c lw r1,(sp+92) 8011b0c: 34 02 00 18 mvi r2,24 8011b10: b9 64 58 00 or r11,r11,r4 8011b14: fb ff bd 94 calli 8001164 <__ashlsi3> 8011b18: b9 61 20 00 or r4,r11,r1 8011b1c: 59 c4 00 30 sw (r14+48),r4 8011b20: e3 ff ff 87 bi 801193c vol->rdir_size = vol->rdir_secs << vol->sec_log2; if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); 8011b24: b5 8c 60 00 add r12,r12,r12 8011b28: b5 8c 60 00 add r12,r12,r12 8011b2c: b5 8c 60 00 add r12,r12,r12 8011b30: b5 8c 60 00 add r12,r12,r12 8011b34: b5 8c 60 00 add r12,r12,r12 8011b38: 2b 81 00 4c lw r1,(sp+76) 8011b3c: b5 8c 60 00 add r12,r12,r12 8011b40: 34 02 00 10 mvi r2,16 8011b44: b5 8c 60 00 add r12,r12,r12 8011b48: fb ff bd 87 calli 8001164 <__ashlsi3> 8011b4c: b5 8c 60 00 add r12,r12,r12 8011b50: b9 81 60 00 or r12,r12,r1 8011b54: 2b 83 00 60 lw r3,(sp+96) 8011b58: 2b 81 00 50 lw r1,(sp+80) 8011b5c: 34 02 00 18 mvi r2,24 8011b60: b9 83 60 00 or r12,r12,r3 8011b64: fb ff bd 80 calli 8001164 <__ashlsi3> 8011b68: b9 81 20 00 or r4,r12,r1 8011b6c: 59 c4 00 1c sw (r14+28),r4 8011b70: e3 ff ff 5c bi 80118e0 vol->mask = FAT_FAT12_MASK; vol->eoc_val = FAT_FAT12_EOC; } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 8011b74: 38 05 ff f4 mvu r5,0xfff4 8011b78: 54 25 00 08 bgu r1,r5,8011b98 { vol->type = FAT_FAT16; 8011b7c: 34 01 00 02 mvi r1,2 8011b80: 31 c1 00 0e sb (r14+14),r1 vol->mask = FAT_FAT16_MASK; 8011b84: 38 01 ff ff mvu r1,0xffff 8011b88: 59 c1 00 10 sw (r14+16),r1 vol->eoc_val = FAT_FAT16_EOC; 8011b8c: 34 21 ff f9 addi r1,r1,-7 8011b90: 59 c1 00 14 sw (r14+20),r1 8011b94: e3 ff ff 76 bi 801196c } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011b98: 2b 81 00 64 lw r1,(sp+100) vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 8011b9c: 78 03 08 03 mvhi r3,0x803 8011ba0: 38 63 03 04 ori r3,r3,0x304 vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; 8011ba4: 34 04 00 04 mvi r4,4 8011ba8: 31 c4 00 0e sb (r14+14),r4 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011bac: b4 21 58 00 add r11,r1,r1 vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 8011bb0: 28 64 00 00 lw r4,(r3+0) } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011bb4: b5 6b 58 00 add r11,r11,r11 } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; vol->eoc_val = FAT_FAT32_EOC; 8011bb8: 78 01 08 03 mvhi r1,0x803 8011bbc: 38 21 03 08 ori r1,r1,0x308 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011bc0: b5 6b 58 00 add r11,r11,r11 vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; 8011bc4: 59 c4 00 10 sw (r14+16),r4 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011bc8: b5 6b 58 00 add r11,r11,r11 } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; vol->eoc_val = FAT_FAT32_EOC; 8011bcc: 28 24 00 00 lw r4,(r1+0) } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011bd0: b5 6b 58 00 add r11,r11,r11 8011bd4: 2b 81 00 74 lw r1,(sp+116) 8011bd8: b5 6b 58 00 add r11,r11,r11 } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; vol->eoc_val = FAT_FAT32_EOC; 8011bdc: 59 c4 00 14 sw (r14+20),r4 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011be0: 34 02 00 10 mvi r2,16 8011be4: b5 6b 58 00 add r11,r11,r11 8011be8: fb ff bd 5f calli 8001164 <__ashlsi3> 8011bec: b5 6b 58 00 add r11,r11,r11 8011bf0: 2b 83 00 78 lw r3,(sp+120) 8011bf4: b9 61 58 00 or r11,r11,r1 8011bf8: 2b 81 00 70 lw r1,(sp+112) 8011bfc: 34 02 00 18 mvi r2,24 8011c00: b9 63 58 00 or r11,r11,r3 8011c04: fb ff bd 58 calli 8001164 <__ashlsi3> vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 8011c08: 2b 84 00 68 lw r4,(sp+104) 8011c0c: 2b 82 00 7c lw r2,(sp+124) } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011c10: b9 61 08 00 or r1,r11,r1 vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 8011c14: b4 84 18 00 add r3,r4,r4 8011c18: b4 63 18 00 add r3,r3,r3 8011c1c: b4 63 18 00 add r3,r3,r3 8011c20: b4 63 18 00 add r3,r3,r3 8011c24: b4 63 18 00 add r3,r3,r3 8011c28: b4 63 18 00 add r3,r3,r3 8011c2c: b4 63 18 00 add r3,r3,r3 8011c30: b4 63 18 00 add r3,r3,r3 8011c34: b8 62 18 00 or r3,r3,r2 8011c38: 20 63 00 ff andi r3,r3,0xff 8011c3c: 20 64 00 80 andi r4,r3,0x80 8011c40: 20 84 00 ff andi r4,r4,0xff } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 8011c44: 59 c1 00 3c sw (r14+60),r1 vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 8011c48: 31 c4 00 54 sb (r14+84),r4 if (vol->mirror) 8011c4c: 44 80 00 6e be r4,r0,8011e04 <== ALWAYS TAKEN vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 8011c50: 20 63 00 0f andi r3,r3,0xf <== NOT EXECUTED 8011c54: 31 c3 00 5c sb (r14+92),r3 <== NOT EXECUTED else vol->afat = 0; vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 8011c58: 2b 83 00 48 lw r3,(sp+72) 8011c5c: 2b 84 00 6c lw r4,(sp+108) 8011c60: b4 63 10 00 add r2,r3,r3 8011c64: b4 42 10 00 add r2,r2,r2 8011c68: b4 42 10 00 add r2,r2,r2 8011c6c: b4 42 10 00 add r2,r2,r2 8011c70: b4 42 10 00 add r2,r2,r2 8011c74: b4 42 10 00 add r2,r2,r2 8011c78: b4 42 10 00 add r2,r2,r2 8011c7c: b4 42 10 00 add r2,r2,r2 8011c80: b8 44 10 00 or r2,r2,r4 8011c84: 0d c2 00 40 sh (r14+64),r2 if( vol->info_sec == 0 ) 8011c88: 44 40 fe c8 be r2,r0,80117a8 <== 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); 8011c8c: 37 8c 00 c8 addi r12,sp,200 close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, 8011c90: b9 c0 08 00 mv r1,r14 8011c94: 34 03 00 00 mvi r3,0 8011c98: 34 04 00 04 mvi r4,4 8011c9c: b9 80 28 00 mv r5,r12 8011ca0: fb ff fc 99 calli 8010f04 <_fat_block_read> FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 8011ca4: 4c 20 00 05 bge r1,r0,8011cb8 <== ALWAYS TAKEN ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) { _fat_block_release(fs_info); close(vol->fd); 8011ca8: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011cac: fb ff c4 b8 calli 8002f8c <== NOT EXECUTED return -1; 8011cb0: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8011cb4: e3 ff fe 1e bi 801152c <== NOT EXECUTED { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 8011cb8: 43 8b 00 c9 lbu r11,(sp+201) 8011cbc: 43 81 00 ca lbu r1,(sp+202) 8011cc0: 34 02 00 10 mvi r2,16 8011cc4: b5 6b 58 00 add r11,r11,r11 8011cc8: b5 6b 58 00 add r11,r11,r11 8011ccc: b5 6b 58 00 add r11,r11,r11 8011cd0: b5 6b 58 00 add r11,r11,r11 8011cd4: b5 6b 58 00 add r11,r11,r11 8011cd8: b5 6b 58 00 add r11,r11,r11 8011cdc: b5 6b 58 00 add r11,r11,r11 8011ce0: fb ff bd 21 calli 8001164 <__ashlsi3> 8011ce4: b5 6b 58 00 add r11,r11,r11 8011ce8: 43 83 00 c8 lbu r3,(sp+200) 8011cec: b9 61 58 00 or r11,r11,r1 8011cf0: 43 81 00 cb lbu r1,(sp+203) 8011cf4: 34 02 00 18 mvi r2,24 8011cf8: b9 63 58 00 or r11,r11,r3 8011cfc: fb ff bd 1a calli 8001164 <__ashlsi3> 8011d00: 78 03 08 03 mvhi r3,0x803 8011d04: 38 63 03 0c ori r3,r3,0x30c 8011d08: 28 62 00 00 lw r2,(r3+0) 8011d0c: b9 61 08 00 or r1,r11,r1 8011d10: 5c 22 00 46 bne r1,r2,8011e28 <== NEVER TAKEN close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 8011d14: 2d c2 00 40 lhu r2,(r14+64) 8011d18: b9 c0 08 00 mv r1,r14 8011d1c: 34 03 01 e4 mvi r3,484 8011d20: 34 04 00 0c mvi r4,12 8011d24: b9 80 28 00 mv r5,r12 8011d28: fb ff fc 77 calli 8010f04 <_fat_block_read> FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 8011d2c: 4c 20 00 04 bge r1,r0,8011d3c <== 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); 8011d30: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8011d34: fb ff fb b4 calli 8010c04 <== NOT EXECUTED 8011d38: e3 ff ff dc bi 8011ca8 <== NOT EXECUTED close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 8011d3c: 43 8b 00 cd lbu r11,(sp+205) 8011d40: 43 81 00 ce lbu r1,(sp+206) 8011d44: 34 02 00 10 mvi r2,16 8011d48: b5 6b 58 00 add r11,r11,r11 8011d4c: b5 6b 58 00 add r11,r11,r11 8011d50: b5 6b 58 00 add r11,r11,r11 8011d54: b5 6b 58 00 add r11,r11,r11 8011d58: b5 6b 58 00 add r11,r11,r11 8011d5c: b5 6b 58 00 add r11,r11,r11 8011d60: b5 6b 58 00 add r11,r11,r11 8011d64: fb ff bd 00 calli 8001164 <__ashlsi3> 8011d68: b5 6b 58 00 add r11,r11,r11 8011d6c: b9 61 58 00 or r11,r11,r1 8011d70: 43 8c 00 cc lbu r12,(sp+204) 8011d74: 43 81 00 cf lbu r1,(sp+207) 8011d78: 34 02 00 18 mvi r2,24 8011d7c: b9 6c 60 00 or r12,r11,r12 8011d80: fb ff bc f9 calli 8001164 <__ashlsi3> vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 8011d84: 43 8b 00 d1 lbu r11,(sp+209) close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 8011d88: b9 81 18 00 or r3,r12,r1 vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 8011d8c: 43 81 00 d2 lbu r1,(sp+210) 8011d90: b5 6b 58 00 add r11,r11,r11 8011d94: b5 6b 58 00 add r11,r11,r11 8011d98: b5 6b 58 00 add r11,r11,r11 8011d9c: b5 6b 58 00 add r11,r11,r11 8011da0: b5 6b 58 00 add r11,r11,r11 8011da4: b5 6b 58 00 add r11,r11,r11 8011da8: 34 02 00 10 mvi r2,16 _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 8011dac: 59 c3 00 48 sw (r14+72),r3 FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; 8011db0: 59 c3 00 44 sw (r14+68),r3 vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 8011db4: b5 6b 58 00 add r11,r11,r11 8011db8: fb ff bc eb calli 8001164 <__ashlsi3> 8011dbc: b5 6b 58 00 add r11,r11,r11 8011dc0: b9 61 58 00 or r11,r11,r1 8011dc4: 43 83 00 d0 lbu r3,(sp+208) 8011dc8: 43 81 00 d3 lbu r1,(sp+211) 8011dcc: 34 02 00 18 mvi r2,24 8011dd0: b9 63 58 00 or r11,r11,r3 8011dd4: fb ff bc e4 calli 8001164 <__ashlsi3> 8011dd8: b9 61 08 00 or r1,r11,r1 } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = 8011ddc: 59 c1 00 50 sw (r14+80),r1 FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); vol->next_cl = vol->next_cl_in_fs_info; 8011de0: 59 c1 00 4c sw (r14+76),r1 8011de4: e3 ff fe e8 bi 8011984 } /* check that device is registred as block device and lock it */ rc = rtems_disk_fd_get_disk_device(vol->fd, &vol->dd); if (rc != 0) { close(vol->fd); 8011de8: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011dec: fb ff c4 68 calli 8002f8c <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 8011df0: f8 00 2a 81 calli 801c7f4 <__errno> <== NOT EXECUTED 8011df4: 34 02 00 06 mvi r2,6 <== NOT EXECUTED 8011df8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8011dfc: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8011e00: e3 ff fd cb bi 801152c <== NOT EXECUTED vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; if (vol->mirror) vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; else vol->afat = 0; 8011e04: 31 c0 00 5c sb (r14+92),r0 8011e08: e3 ff ff 94 bi 8011c58 memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); sc = rtems_bdbuf_release( block); if (sc != RTEMS_SUCCESSFUL) { close(vol->fd); 8011e0c: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011e10: fb ff c4 5f calli 8002f8c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 8011e14: f8 00 2a 78 calli 801c7f4 <__errno> <== NOT EXECUTED 8011e18: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8011e1c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8011e20: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8011e24: e3 ff fd c2 bi 801152c <== NOT EXECUTED * 0 on success, or -1 if error occured and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) { return fat_buf_release(fs_info); 8011e28: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8011e2c: fb ff fb 76 calli 8010c04 <== NOT EXECUTED 8011e30: e3 ff fe 5e bi 80117a8 <== NOT EXECUTED } rc = fstat(vol->fd, &stat_buf); if (rc != 0) { close(vol->fd); 8011e34: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011e38: fb ff c4 55 calli 8002f8c <== NOT EXECUTED 8011e3c: e3 ff fd b8 bi 801151c <== 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); 8011e40: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011e44: fb ff c4 52 calli 8002f8c <== NOT EXECUTED free(fs_info->vhash); 8011e48: 29 c1 00 6c lw r1,(r14+108) <== NOT EXECUTED 8011e4c: fb ff c4 7f calli 8003048 <== NOT EXECUTED free(fs_info->rhash); 8011e50: 29 c1 00 70 lw r1,(r14+112) <== NOT EXECUTED if (fs_info->sec_buf == NULL) { close(vol->fd); free(fs_info->vhash); free(fs_info->rhash); free(fs_info->uino); 8011e54: fb ff c4 7d calli 8003048 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 8011e58: f8 00 2a 67 calli 801c7f4 <__errno> <== NOT EXECUTED 8011e5c: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8011e60: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8011e64: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8011e68: e3 ff fd b1 bi 801152c <== 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); 8011e6c: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011e70: fb ff c4 47 calli 8002f8c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 8011e74: f8 00 2a 60 calli 801c7f4 <__errno> <== NOT EXECUTED 8011e78: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8011e7c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8011e80: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8011e84: e3 ff fd aa bi 801152c <== 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); 8011e88: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011e8c: fb ff c4 40 calli 8002f8c <== NOT EXECUTED free(fs_info->vhash); 8011e90: 29 c1 00 6c lw r1,(r14+108) <== NOT EXECUTED 8011e94: e3 ff ff f0 bi 8011e54 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); if (fs_info->sec_buf == NULL) { close(vol->fd); 8011e98: 29 c1 00 60 lw r1,(r14+96) <== NOT EXECUTED 8011e9c: fb ff c4 3c calli 8002f8c <== NOT EXECUTED free(fs_info->vhash); 8011ea0: 29 c1 00 6c lw r1,(r14+108) <== NOT EXECUTED 8011ea4: fb ff c4 69 calli 8003048 <== NOT EXECUTED free(fs_info->rhash); 8011ea8: 29 c1 00 70 lw r1,(r14+112) <== NOT EXECUTED 8011eac: fb ff c4 67 calli 8003048 <== NOT EXECUTED free(fs_info->uino); 8011eb0: 29 c1 00 74 lw r1,(r14+116) <== NOT EXECUTED 8011eb4: e3 ff ff e8 bi 8011e54 <== NOT EXECUTED =============================================================================== 0801a5fc : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 801a5fc: 37 9c ff cc addi sp,sp,-52 801a600: 5b 8b 00 30 sw (sp+48),r11 801a604: 5b 8c 00 2c sw (sp+44),r12 801a608: 5b 8d 00 28 sw (sp+40),r13 801a60c: 5b 8e 00 24 sw (sp+36),r14 801a610: 5b 8f 00 20 sw (sp+32),r15 801a614: 5b 90 00 1c sw (sp+28),r16 801a618: 5b 91 00 18 sw (sp+24),r17 801a61c: 5b 92 00 14 sw (sp+20),r18 801a620: 5b 93 00 10 sw (sp+16),r19 801a624: 5b 94 00 0c sw (sp+12),r20 801a628: 5b 95 00 08 sw (sp+8),r21 801a62c: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 801a630: 5b 80 00 34 sw (sp+52),r0 uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; 801a634: 28 30 00 38 lw r16,(r1+56) uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; 801a638: 58 80 00 00 sw (r4+0),r0 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 801a63c: b8 20 68 00 mv r13,r1 801a640: b8 80 70 00 mv r14,r4 801a644: b8 60 90 00 mv r18,r3 801a648: b8 40 a0 00 mv r20,r2 801a64c: b8 a0 a8 00 mv r21,r5 801a650: 20 d3 00 ff andi r19,r6,0xff ssize_t bytes_written; *cls_added = 0; if (count == 0) return rc; 801a654: 34 0c 00 00 mvi r12,0 uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) 801a658: 44 60 00 2e be r3,r0,801a710 <== NEVER TAKEN return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) 801a65c: 28 2b 00 4c lw r11,(r1+76) 801a660: 34 01 ff ff mvi r1,-1 801a664: 45 61 00 5e be r11,r1,801a7dc { 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; 801a668: 36 10 00 02 addi r16,r16,2 /* * fs_info->vol.data_cls is exactly the count of data clusters * starting at cluster 2, so the maximum valid cluster number is * (fs_info->vol.data_cls + 1) */ while (i < data_cls_val) 801a66c: 34 01 00 02 mvi r1,2 801a670: 50 30 00 75 bgeu r1,r16,801a844 <== NEVER TAKEN 801a674: 34 0f 00 02 mvi r15,2 801a678: 34 11 00 00 mvi r17,0 { rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); 801a67c: b9 a0 08 00 mv r1,r13 801a680: b9 60 10 00 mv r2,r11 801a684: 37 83 00 34 addi r3,sp,52 801a688: fb ff fd cf calli 8019dc4 801a68c: b8 20 60 00 mv r12,r1 if ( rc != RC_OK ) 801a690: 5c 20 00 55 bne r1,r0,801a7e4 <== NEVER TAKEN if (*cls_added != 0) fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } if (next_cln == FAT_GENFAT_FREE) 801a694: 2b 81 00 34 lw r1,(sp+52) 801a698: 5c 2c 00 0f bne r1,r12,801a6d4 /* * 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) 801a69c: 29 c1 00 00 lw r1,(r14+0) 801a6a0: 5c 20 00 2e bne r1,r0,801a758 { *chain = cl4find; 801a6a4: 5a 8b 00 00 sw (r20+0),r11 rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 801a6a8: b9 a0 08 00 mv r1,r13 801a6ac: b9 60 10 00 mv r2,r11 801a6b0: 34 03 ff ff mvi r3,-1 801a6b4: fb ff fe 81 calli 801a0b8 if ( rc != RC_OK ) 801a6b8: 5c 20 00 5c bne r1,r0,801a828 <== NEVER TAKEN rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); if ( rc != RC_OK ) goto cleanup; } if (zero_fill) 801a6bc: 5e 60 00 3e bne r19,r0,801a7b4 goto cleanup; } } save_cln = cl4find; (*cls_added)++; 801a6c0: 29 c1 00 00 lw r1,(r14+0) 801a6c4: 34 21 00 01 addi r1,r1,1 801a6c8: 59 c1 00 00 sw (r14+0),r1 /* have we satisfied request ? */ if (*cls_added == count) 801a6cc: 46 41 00 4c be r18,r1,801a7fc 801a6d0: b9 60 88 00 mv r17,r11 fat_buf_release(fs_info); return rc; } } i++; cl4find++; 801a6d4: 35 6b 00 01 addi r11,r11,1 *last_cl = save_cln; fat_buf_release(fs_info); return rc; } } i++; 801a6d8: 35 ef 00 01 addi r15,r15,1 cl4find++; if (cl4find >= data_cls_val) 801a6dc: 51 70 00 1c bgeu r11,r16,801a74c <== NEVER TAKEN /* * fs_info->vol.data_cls is exactly the count of data clusters * starting at cluster 2, so the maximum valid cluster number is * (fs_info->vol.data_cls + 1) */ while (i < data_cls_val) 801a6e0: 56 0f ff e7 bgu r16,r15,801a67c <== 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) 801a6e4: 29 a1 00 44 lw r1,(r13+68) <== NOT EXECUTED cl4find++; if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; 801a6e8: 59 b1 00 4c sw (r13+76),r17 <== NOT EXECUTED if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 801a6ec: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 801a6f0: 44 22 00 04 be r1,r2,801a700 <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); 801a6f4: 29 c2 00 00 lw r2,(r14+0) <== NOT EXECUTED 801a6f8: c8 22 08 00 sub r1,r1,r2 <== NOT EXECUTED 801a6fc: 59 a1 00 44 sw (r13+68),r1 <== NOT EXECUTED *last_cl = save_cln; 801a700: 5a b1 00 00 sw (r21+0),r17 <== NOT EXECUTED fat_buf_release(fs_info); 801a704: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 801a708: fb ff d9 3f calli 8010c04 <== NOT EXECUTED return RC_OK; 801a70c: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); fat_buf_release(fs_info); return rc; } 801a710: b9 80 08 00 mv r1,r12 801a714: 2b 9d 00 04 lw ra,(sp+4) 801a718: 2b 8b 00 30 lw r11,(sp+48) 801a71c: 2b 8c 00 2c lw r12,(sp+44) 801a720: 2b 8d 00 28 lw r13,(sp+40) 801a724: 2b 8e 00 24 lw r14,(sp+36) 801a728: 2b 8f 00 20 lw r15,(sp+32) 801a72c: 2b 90 00 1c lw r16,(sp+28) 801a730: 2b 91 00 18 lw r17,(sp+24) 801a734: 2b 92 00 14 lw r18,(sp+20) 801a738: 2b 93 00 10 lw r19,(sp+16) 801a73c: 2b 94 00 0c lw r20,(sp+12) 801a740: 2b 95 00 08 lw r21,(sp+8) 801a744: 37 9c 00 34 addi sp,sp,52 801a748: c3 a0 00 00 ret } } i++; cl4find++; if (cl4find >= data_cls_val) cl4find = 2; 801a74c: 34 0b 00 02 mvi r11,2 <== NOT EXECUTED /* * fs_info->vol.data_cls is exactly the count of data clusters * starting at cluster 2, so the maximum valid cluster number is * (fs_info->vol.data_cls + 1) */ while (i < data_cls_val) 801a750: 56 0f ff cb bgu r16,r15,801a67c <== NOT EXECUTED 801a754: e3 ff ff e4 bi 801a6e4 <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 801a758: b9 a0 08 00 mv r1,r13 801a75c: b9 60 10 00 mv r2,r11 801a760: 34 03 ff ff mvi r3,-1 801a764: fb ff fe 55 calli 801a0b8 801a768: b8 20 20 00 mv r4,r1 if ( rc != RC_OK ) 801a76c: 5c 20 00 31 bne r1,r0,801a830 <== NEVER TAKEN /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); 801a770: b9 a0 08 00 mv r1,r13 801a774: ba 20 10 00 mv r2,r17 801a778: b9 60 18 00 mv r3,r11 801a77c: fb ff fe 4f calli 801a0b8 801a780: b8 20 20 00 mv r4,r1 if ( rc != RC_OK ) 801a784: 44 20 ff ce be r1,r0,801a6bc <== ALWAYS TAKEN return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 801a788: 2a 82 00 00 lw r2,(r20+0) <== NOT EXECUTED 801a78c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); fat_buf_release(fs_info); return rc; 801a790: b8 80 60 00 mv r12,r4 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 801a794: fb ff ff 58 calli 801a4f4 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); 801a798: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 801a79c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 801a7a0: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 801a7a4: fb ff fe 45 calli 801a0b8 <== NOT EXECUTED fat_buf_release(fs_info); 801a7a8: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 801a7ac: fb ff d9 16 calli 8010c04 <== NOT EXECUTED return rc; 801a7b0: e3 ff ff d8 bi 801a710 <== NOT EXECUTED goto cleanup; } if (zero_fill) { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 801a7b4: 2d a4 00 06 lhu r4,(r13+6) 801a7b8: b9 60 10 00 mv r2,r11 801a7bc: b9 a0 08 00 mv r1,r13 801a7c0: 34 03 00 00 mvi r3,0 801a7c4: 34 05 00 00 mvi r5,0 801a7c8: fb ff da 44 calli 80110d8 if (fs_info->vol.bpc != bytes_written) 801a7cc: 2d a2 00 06 lhu r2,(r13+6) 801a7d0: 44 41 ff bc be r2,r1,801a6c0 <== ALWAYS TAKEN { rc = -1; 801a7d4: 34 04 ff ff mvi r4,-1 <== NOT EXECUTED 801a7d8: e3 ff ff ec bi 801a788 <== NOT EXECUTED uint32_t *last_cl, bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; 801a7dc: 34 0b 00 02 mvi r11,2 801a7e0: e3 ff ff a2 bi 801a668 while (i < data_cls_val) { rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); if ( rc != RC_OK ) { if (*cls_added != 0) 801a7e4: 29 c1 00 00 lw r1,(r14+0) <== NOT EXECUTED 801a7e8: 44 20 ff ca be r1,r0,801a710 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); 801a7ec: 2a 82 00 00 lw r2,(r20+0) <== NOT EXECUTED 801a7f0: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 801a7f4: fb ff ff 40 calli 801a4f4 <== NOT EXECUTED 801a7f8: e3 ff ff c6 bi 801a710 <== NOT EXECUTED /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 801a7fc: 29 a1 00 44 lw r1,(r13+68) (*cls_added)++; /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; 801a800: 59 ab 00 4c sw (r13+76),r11 if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 801a804: 34 02 ff ff mvi r2,-1 801a808: 44 22 00 04 be r1,r2,801a818 <== ALWAYS TAKEN fs_info->vol.free_cls -= (*cls_added); 801a80c: 29 c2 00 00 lw r2,(r14+0) <== NOT EXECUTED 801a810: c8 22 08 00 sub r1,r1,r2 <== NOT EXECUTED 801a814: 59 a1 00 44 sw (r13+68),r1 <== NOT EXECUTED *last_cl = save_cln; 801a818: 5a ab 00 00 sw (r21+0),r11 fat_buf_release(fs_info); 801a81c: b9 a0 08 00 mv r1,r13 801a820: fb ff d8 f9 calli 8010c04 return rc; 801a824: e3 ff ff bb bi 801a710 * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 801a828: b8 20 60 00 mv r12,r1 <== NOT EXECUTED 801a82c: e3 ff ff b9 bi 801a710 <== NOT EXECUTED /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 801a830: 2a 82 00 00 lw r2,(r20+0) <== NOT EXECUTED 801a834: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 801a838: b8 80 60 00 mv r12,r4 <== NOT EXECUTED if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 801a83c: fb ff ff 2e calli 801a4f4 <== NOT EXECUTED return rc; 801a840: e3 ff ff b4 bi 801a710 <== 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) 801a844: 34 11 00 00 mvi r17,0 <== NOT EXECUTED 801a848: e3 ff ff a7 bi 801a6e4 <== NOT EXECUTED =============================================================================== 08010fc8 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 8010fc8: 37 9c ff d4 addi sp,sp,-44 8010fcc: 5b 8b 00 28 sw (sp+40),r11 8010fd0: 5b 8c 00 24 sw (sp+36),r12 8010fd4: 5b 8d 00 20 sw (sp+32),r13 8010fd8: 5b 8e 00 1c sw (sp+28),r14 8010fdc: 5b 8f 00 18 sw (sp+24),r15 8010fe0: 5b 90 00 14 sw (sp+20),r16 8010fe4: 5b 91 00 10 sw (sp+16),r17 8010fe8: 5b 92 00 0c sw (sp+12),r18 8010fec: 5b 93 00 08 sw (sp+8),r19 8010ff0: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; ssize_t cmpltd = 0; 8010ff4: 34 0f 00 00 mvi r15,0 fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 8010ff8: b8 80 60 00 mv r12,r4 8010ffc: b8 20 68 00 mv r13,r1 8011000: b8 a0 90 00 mv r18,r5 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 8011004: 44 80 00 28 be r4,r0,80110a4 <== NEVER TAKEN 8011008: b8 60 80 00 mv r16,r3 801100c: b8 40 70 00 mv r14,r2 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 8011010: 34 13 00 01 mvi r19,1 8011014: e0 00 00 0f bi 8011050 c = MIN(count, (fs_info->vol.bps - ofs)); if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 8011018: fb ff ff 76 calli 8010df0 801101c: b8 20 88 00 mv r17,r1 if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 8011020: b6 4f 10 00 add r2,r18,r15 8011024: b9 60 18 00 mv r3,r11 fat_buf_mark_modified(fs_info); count -= c; 8011028: c9 8b 60 00 sub r12,r12,r11 if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) 801102c: 5e 20 00 1d bne r17,r0,80110a0 <== NEVER TAKEN return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 8011030: 2b 81 00 2c lw r1,(sp+44) fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; 8011034: b5 6f 78 00 add r15,r11,r15 sec_num++; 8011038: 35 ce 00 01 addi r14,r14,1 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 801103c: b4 30 08 00 add r1,r1,r16 8011040: f8 00 31 3b calli 801d52c 8011044: 31 b3 00 88 sb (r13+136),r19 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 8011048: 45 91 00 17 be r12,r17,80110a4 <== ALWAYS TAKEN fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; sec_num++; ofs = 0; 801104c: 34 10 00 00 mvi r16,0 <== NOT EXECUTED uint8_t *sec_buf; uint32_t c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); 8011050: 2d ab 00 00 lhu r11,(r13+0) if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 8011054: b9 c0 10 00 mv r2,r14 8011058: 37 84 00 2c addi r4,sp,44 uint8_t *sec_buf; uint32_t c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); 801105c: c9 70 58 00 sub r11,r11,r16 if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 8011060: b9 a0 08 00 mv r1,r13 8011064: 34 03 00 01 mvi r3,1 uint8_t *sec_buf; uint32_t c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); 8011068: 51 8b 00 02 bgeu r12,r11,8011070 801106c: b9 80 58 00 mv r11,r12 if (c == fs_info->vol.bytes_per_block) 8011070: 2d a6 00 0a lhu r6,(r13+10) 8011074: 5c cb ff e9 bne r6,r11,8011018 <== ALWAYS TAKEN rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 8011078: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED 801107c: 34 03 00 02 mvi r3,2 <== NOT EXECUTED 8011080: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8011084: 37 84 00 2c addi r4,sp,44 <== NOT EXECUTED 8011088: fb ff ff 5a calli 8010df0 <== NOT EXECUTED 801108c: b8 20 88 00 mv r17,r1 <== NOT EXECUTED else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 8011090: b6 4f 10 00 add r2,r18,r15 <== NOT EXECUTED 8011094: b9 60 18 00 mv r3,r11 <== NOT EXECUTED fat_buf_mark_modified(fs_info); count -= c; 8011098: c9 8b 60 00 sub r12,r12,r11 <== NOT EXECUTED if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) 801109c: 46 20 ff e5 be r17,r0,8011030 <== NOT EXECUTED return -1; 80110a0: 34 0f ff ff mvi r15,-1 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 80110a4: b9 e0 08 00 mv r1,r15 80110a8: 2b 9d 00 04 lw ra,(sp+4) 80110ac: 2b 8b 00 28 lw r11,(sp+40) 80110b0: 2b 8c 00 24 lw r12,(sp+36) 80110b4: 2b 8d 00 20 lw r13,(sp+32) 80110b8: 2b 8e 00 1c lw r14,(sp+28) 80110bc: 2b 8f 00 18 lw r15,(sp+24) 80110c0: 2b 90 00 14 lw r16,(sp+20) 80110c4: 2b 91 00 10 lw r17,(sp+16) 80110c8: 2b 92 00 0c lw r18,(sp+12) 80110cc: 2b 93 00 08 lw r19,(sp+8) 80110d0: 37 9c 00 2c addi sp,sp,44 80110d4: c3 a0 00 00 ret =============================================================================== 0801a0b8 : fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 801a0b8: 37 9c ff d8 addi sp,sp,-40 801a0bc: 5b 8b 00 24 sw (sp+36),r11 801a0c0: 5b 8c 00 20 sw (sp+32),r12 801a0c4: 5b 8d 00 1c sw (sp+28),r13 801a0c8: 5b 8e 00 18 sw (sp+24),r14 801a0cc: 5b 8f 00 14 sw (sp+20),r15 801a0d0: 5b 90 00 10 sw (sp+16),r16 801a0d4: 5b 91 00 0c sw (sp+12),r17 801a0d8: 5b 92 00 08 sw (sp+8),r18 801a0dc: 5b 9d 00 04 sw (sp+4),ra 801a0e0: 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; 801a0e4: 5b 80 00 28 sw (sp+40),r0 /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 801a0e8: 34 01 00 01 mvi r1,1 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 801a0ec: b8 40 60 00 mv r12,r2 801a0f0: b8 60 88 00 mv r17,r3 uint16_t fat16_clv = 0; uint32_t fat32_clv = 0; uint8_t *sec_buf = NULL; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 801a0f4: 50 22 00 21 bgeu r1,r2,801a178 <== NEVER TAKEN 801a0f8: 29 61 00 38 lw r1,(r11+56) 801a0fc: 34 21 00 01 addi r1,r1,1 801a100: 50 22 00 02 bgeu r1,r2,801a108 <== ALWAYS TAKEN 801a104: e0 00 00 1d bi 801a178 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 801a108: 41 62 00 0e lbu r2,(r11+14) 801a10c: 20 41 00 01 andi r1,r2,0x1 801a110: 5c 20 00 2a bne r1,r0,801a1b8 801a114: 20 42 00 02 andi r2,r2,0x2 801a118: 44 41 00 30 be r2,r1,801a1d8 801a11c: 41 62 00 02 lbu r2,(r11+2) 801a120: b5 8c 70 00 add r14,r12,r12 801a124: b9 c0 08 00 mv r1,r14 801a128: f8 00 53 b4 calli 802eff8 <__lshrsi3> 801a12c: 29 70 00 58 lw r16,(r11+88) 801a130: b4 30 80 00 add r16,r1,r16 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 801a134: b9 60 08 00 mv r1,r11 801a138: ba 00 10 00 mv r2,r16 801a13c: 34 03 00 01 mvi r3,1 801a140: 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); 801a144: 2d 72 00 00 lhu r18,(r11+0) rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 801a148: fb ff db 2a calli 8010df0 801a14c: b8 20 68 00 mv r13,r1 if (rc != RC_OK) 801a150: 5c 20 00 0e bne r1,r0,801a188 <== NEVER TAKEN return rc; switch ( fs_info->vol.type ) 801a154: 41 6f 00 0e lbu r15,(r11+14) if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 801a158: 36 52 ff ff addi r18,r18,-1 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 801a15c: 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); 801a160: a1 d2 70 00 and r14,r14,r18 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 801a164: 45 e1 00 25 be r15,r1,801a1f8 801a168: 34 01 00 04 mvi r1,4 801a16c: 45 e1 00 63 be r15,r1,801a2f8 801a170: 34 01 00 01 mvi r1,1 801a174: 45 e1 00 39 be r15,r1,801a258 <== ALWAYS TAKEN fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); 801a178: f8 00 09 9f calli 801c7f4 <__errno> <== NOT EXECUTED 801a17c: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 801a180: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 801a184: 34 0d ff ff mvi r13,-1 <== NOT EXECUTED break; } return RC_OK; } 801a188: b9 a0 08 00 mv r1,r13 801a18c: 2b 9d 00 04 lw ra,(sp+4) 801a190: 2b 8b 00 24 lw r11,(sp+36) 801a194: 2b 8c 00 20 lw r12,(sp+32) 801a198: 2b 8d 00 1c lw r13,(sp+28) 801a19c: 2b 8e 00 18 lw r14,(sp+24) 801a1a0: 2b 8f 00 14 lw r15,(sp+20) 801a1a4: 2b 90 00 10 lw r16,(sp+16) 801a1a8: 2b 91 00 0c lw r17,(sp+12) 801a1ac: 2b 92 00 08 lw r18,(sp+8) 801a1b0: 37 9c 00 28 addi sp,sp,40 801a1b4: c3 a0 00 00 ret /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 801a1b8: 01 8e 00 01 srui r14,r12,1 801a1bc: 41 62 00 02 lbu r2,(r11+2) 801a1c0: b5 cc 70 00 add r14,r14,r12 801a1c4: b9 c0 08 00 mv r1,r14 801a1c8: f8 00 53 8c calli 802eff8 <__lshrsi3> 801a1cc: 29 70 00 58 lw r16,(r11+88) 801a1d0: b4 30 80 00 add r16,r1,r16 801a1d4: e3 ff ff d8 bi 801a134 801a1d8: b5 8c 70 00 add r14,r12,r12 801a1dc: 41 62 00 02 lbu r2,(r11+2) 801a1e0: b5 ce 70 00 add r14,r14,r14 801a1e4: b9 c0 08 00 mv r1,r14 801a1e8: f8 00 53 84 calli 802eff8 <__lshrsi3> 801a1ec: 29 70 00 58 lw r16,(r11+88) 801a1f0: b4 30 80 00 add r16,r1,r16 801a1f4: e3 ff ff d0 bi 801a134 } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = (uint16_t )(CT_LE_W(in_val)); 801a1f8: 22 23 ff ff andi r3,r17,0xffff * @param[in] value is the value to be swapped * @return the value after being endian swapped */ static inline uint16_t CPU_swap_u16(uint16_t v) { return v << 8 | v >> 8; 801a1fc: 00 61 00 01 srui r1,r3,1 801a200: b4 63 18 00 add r3,r3,r3 801a204: 00 21 00 01 srui r1,r1,1 801a208: b4 63 18 00 add r3,r3,r3 801a20c: 00 21 00 01 srui r1,r1,1 801a210: b4 63 18 00 add r3,r3,r3 801a214: 00 21 00 01 srui r1,r1,1 801a218: b4 63 18 00 add r3,r3,r3 801a21c: 00 21 00 01 srui r1,r1,1 801a220: b4 63 18 00 add r3,r3,r3 801a224: 00 21 00 01 srui r1,r1,1 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 801a228: 2b 82 00 28 lw r2,(sp+40) 801a22c: 00 21 00 01 srui r1,r1,1 801a230: b4 63 18 00 add r3,r3,r3 801a234: 00 21 00 01 srui r1,r1,1 801a238: b4 63 18 00 add r3,r3,r3 801a23c: b4 63 18 00 add r3,r3,r3 801a240: b8 61 18 00 or r3,r3,r1 801a244: b4 4e 70 00 add r14,r2,r14 801a248: 0d c3 00 00 sh (r14+0),r3 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 801a24c: 34 01 00 01 mvi r1,1 801a250: 31 61 00 88 sb (r11+136),r1 (uint16_t )(CT_LE_W(in_val)); fat_buf_mark_modified(fs_info); break; 801a254: e3 ff ff cd bi 801a188 return rc; switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 801a258: 21 8c 00 01 andi r12,r12,0x1 801a25c: 45 80 00 55 be r12,r0,801a3b0 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 801a260: 2b 81 00 28 lw r1,(sp+40) switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; 801a264: b6 31 88 00 add r17,r17,r17 801a268: b6 31 88 00 add r17,r17,r17 *(sec_buf + ofs) &= 0x0F; 801a26c: b4 2e 08 00 add r1,r1,r14 801a270: 40 22 00 00 lbu r2,(r1+0) switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; 801a274: b6 31 88 00 add r17,r17,r17 801a278: b6 31 88 00 add r17,r17,r17 *(sec_buf + ofs) &= 0x0F; 801a27c: 20 42 00 0f andi r2,r2,0xf 801a280: 30 22 00 00 sb (r1+0),r2 *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 801a284: 2b 81 00 28 lw r1,(sp+40) switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; 801a288: 22 31 ff ff andi r17,r17,0xffff *(sec_buf + ofs) &= 0x0F; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 801a28c: 22 22 ff f0 andi r2,r17,0xfff0 801a290: b4 2e 08 00 add r1,r1,r14 801a294: 40 23 00 00 lbu r3,(r1+0) 801a298: b8 62 10 00 or r2,r3,r2 801a29c: 30 22 00 00 sb (r1+0),r2 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 801a2a0: 2d 61 00 00 lhu r1,(r11+0) 801a2a4: 31 6f 00 88 sb (r11+136),r15 801a2a8: 34 21 ff ff addi r1,r1,-1 801a2ac: 44 2e 00 62 be r1,r14,801a434 <== NEVER TAKEN } else { *(sec_buf + ofs + 1) &= 0x00; *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 801a2b0: 02 21 00 01 srui r1,r17,1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 801a2b4: 2b 82 00 28 lw r2,(sp+40) *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 801a2b8: 00 21 00 01 srui r1,r1,1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 801a2bc: 35 ce 00 01 addi r14,r14,1 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 801a2c0: 00 21 00 01 srui r1,r1,1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 801a2c4: b4 4e 10 00 add r2,r2,r14 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 801a2c8: 00 21 00 01 srui r1,r1,1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 801a2cc: 30 40 00 00 sb (r2+0),r0 *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 801a2d0: 00 21 00 01 srui r1,r1,1 801a2d4: 2b 82 00 28 lw r2,(sp+40) 801a2d8: 00 21 00 01 srui r1,r1,1 801a2dc: b4 4e 70 00 add r14,r2,r14 801a2e0: 00 21 00 01 srui r1,r1,1 801a2e4: 41 c2 00 00 lbu r2,(r14+0) 801a2e8: 00 21 00 01 srui r1,r1,1 801a2ec: b8 41 08 00 or r1,r2,r1 801a2f0: 31 c1 00 00 sb (r14+0),r1 801a2f4: e3 ff ff a5 bi 801a188 (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)); 801a2f8: 78 01 08 03 mvhi r1,0x803 801a2fc: 38 21 03 04 ori r1,r1,0x304 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 801a300: 2b 83 00 28 lw r3,(sp+40) (uint16_t )(CT_LE_W(in_val)); fat_buf_mark_modified(fs_info); break; case FAT_FAT32: fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK)); 801a304: 28 2c 00 00 lw r12,(r1+0) byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 801a308: 34 02 00 18 mvi r2,24 801a30c: 22 21 00 ff andi r1,r17,0xff *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 801a310: b4 6e 70 00 add r14,r3,r14 (uint16_t )(CT_LE_W(in_val)); fat_buf_mark_modified(fs_info); break; case FAT_FAT32: fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK)); 801a314: a2 2c 60 00 and r12,r17,r12 801a318: fb ff 9b 93 calli 8001164 <__ashlsi3> 801a31c: b8 20 78 00 mv r15,r1 uint32_t value ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; 801a320: 34 02 00 18 mvi r2,24 801a324: b9 80 08 00 mv r1,r12 801a328: f8 00 53 34 calli 802eff8 <__lshrsi3> byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 801a32c: 01 83 00 01 srui r3,r12,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 801a330: b9 e1 78 00 or r15,r15,r1 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 801a334: 00 63 00 01 srui r3,r3,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 801a338: 34 02 00 10 mvi r2,16 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 801a33c: 00 63 00 01 srui r3,r3,1 801a340: 00 63 00 01 srui r3,r3,1 801a344: 00 63 00 01 srui r3,r3,1 801a348: 00 63 00 01 srui r3,r3,1 801a34c: 00 63 00 01 srui r3,r3,1 801a350: 00 63 00 01 srui r3,r3,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 801a354: 20 61 00 ff andi r1,r3,0xff 801a358: fb ff 9b 83 calli 8001164 <__ashlsi3> 801a35c: b9 e1 78 00 or r15,r15,r1 ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; 801a360: 34 02 00 10 mvi r2,16 801a364: b9 80 08 00 mv r1,r12 801a368: f8 00 53 24 calli 802eff8 <__lshrsi3> 801a36c: 20 22 00 ff andi r2,r1,0xff byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 801a370: b4 42 10 00 add r2,r2,r2 801a374: b4 42 10 00 add r2,r2,r2 801a378: b4 42 10 00 add r2,r2,r2 801a37c: b4 42 10 00 add r2,r2,r2 801a380: b4 42 10 00 add r2,r2,r2 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 801a384: 29 c1 00 00 lw r1,(r14+0) 801a388: b4 42 10 00 add r2,r2,r2 801a38c: b4 42 10 00 add r2,r2,r2 801a390: b4 42 10 00 add r2,r2,r2 801a394: 20 21 00 f0 andi r1,r1,0xf0 801a398: b9 e2 10 00 or r2,r15,r2 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 801a39c: b8 41 10 00 or r2,r2,r1 801a3a0: 59 c2 00 00 sw (r14+0),r2 801a3a4: 34 01 00 01 mvi r1,1 801a3a8: 31 61 00 88 sb (r11+136),r1 fat_buf_mark_modified(fs_info); break; 801a3ac: e3 ff ff 77 bi 801a188 } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 801a3b0: 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; 801a3b4: 22 31 0f ff andi r17,r17,0xfff *(sec_buf + ofs) &= 0x00; 801a3b8: b4 2e 08 00 add r1,r1,r14 801a3bc: 30 20 00 00 sb (r1+0),r0 *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 801a3c0: 2b 81 00 28 lw r1,(sp+40) 801a3c4: b4 2e 08 00 add r1,r1,r14 801a3c8: 40 22 00 00 lbu r2,(r1+0) 801a3cc: b8 51 10 00 or r2,r2,r17 801a3d0: 30 22 00 00 sb (r1+0),r2 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 801a3d4: 2d 61 00 00 lhu r1,(r11+0) 801a3d8: 31 6f 00 88 sb (r11+136),r15 801a3dc: 34 21 ff ff addi r1,r1,-1 801a3e0: 44 2e 00 2c be r1,r14,801a490 <== NEVER TAKEN fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 801a3e4: 2b 81 00 28 lw r1,(sp+40) *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 801a3e8: 02 31 00 01 srui r17,r17,1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 801a3ec: 35 ce 00 01 addi r14,r14,1 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 801a3f0: 02 31 00 01 srui r17,r17,1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 801a3f4: b4 2e 08 00 add r1,r1,r14 801a3f8: 40 22 00 00 lbu r2,(r1+0) *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 801a3fc: 02 31 00 01 srui r17,r17,1 801a400: 02 31 00 01 srui r17,r17,1 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 801a404: 20 42 00 f0 andi r2,r2,0xf0 801a408: 30 22 00 00 sb (r1+0),r2 *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 801a40c: 02 31 00 01 srui r17,r17,1 801a410: 2b 81 00 28 lw r1,(sp+40) 801a414: 02 31 00 01 srui r17,r17,1 801a418: b4 2e 70 00 add r14,r1,r14 801a41c: 02 31 00 01 srui r17,r17,1 801a420: 41 c1 00 00 lbu r1,(r14+0) 801a424: 02 31 00 01 srui r17,r17,1 801a428: b8 31 88 00 or r17,r1,r17 801a42c: 31 d1 00 00 sb (r14+0),r17 801a430: e3 ff ff 56 bi 801a188 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 801a434: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 801a438: 36 02 00 01 addi r2,r16,1 <== NOT EXECUTED 801a43c: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 801a440: 37 84 00 28 addi r4,sp,40 <== NOT EXECUTED 801a444: fb ff da 6b calli 8010df0 <== NOT EXECUTED 801a448: b8 20 68 00 mv r13,r1 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 801a44c: 5c 20 ff 4f bne r1,r0,801a188 <== NOT EXECUTED return rc; *sec_buf &= 0x00; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 801a450: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; *sec_buf &= 0x00; 801a454: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 801a458: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 801a45c: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; *sec_buf &= 0x00; 801a460: 30 20 00 00 sb (r1+0),r0 <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 801a464: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 801a468: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED 801a46c: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 801a470: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 801a474: 40 22 00 00 lbu r2,(r1+0) <== NOT EXECUTED 801a478: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 801a47c: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 801a480: ba 22 88 00 or r17,r17,r2 <== NOT EXECUTED 801a484: 30 31 00 00 sb (r1+0),r17 <== NOT EXECUTED 801a488: 31 6f 00 88 sb (r11+136),r15 <== NOT EXECUTED 801a48c: e3 ff ff 3f bi 801a188 <== NOT EXECUTED fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 801a490: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 801a494: 36 02 00 01 addi r2,r16,1 <== NOT EXECUTED 801a498: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 801a49c: 37 84 00 28 addi r4,sp,40 <== NOT EXECUTED 801a4a0: fb ff da 54 calli 8010df0 <== NOT EXECUTED 801a4a4: b8 20 68 00 mv r13,r1 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 801a4a8: 5c 20 ff 38 bne r1,r0,801a188 <== NOT EXECUTED return rc; *sec_buf &= 0xF0; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 801a4ac: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; *sec_buf &= 0xF0; 801a4b0: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 801a4b4: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 801a4b8: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; *sec_buf &= 0xF0; 801a4bc: 40 22 00 00 lbu r2,(r1+0) <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 801a4c0: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; *sec_buf &= 0xF0; 801a4c4: 20 42 00 f0 andi r2,r2,0xf0 <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 801a4c8: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; *sec_buf &= 0xF0; 801a4cc: 30 22 00 00 sb (r1+0),r2 <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 801a4d0: 2b 81 00 28 lw r1,(sp+40) <== NOT EXECUTED 801a4d4: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 801a4d8: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 801a4dc: 40 22 00 00 lbu r2,(r1+0) <== NOT EXECUTED 801a4e0: 02 31 00 01 srui r17,r17,1 <== NOT EXECUTED 801a4e4: ba 22 88 00 or r17,r17,r2 <== NOT EXECUTED 801a4e8: 30 31 00 00 sb (r1+0),r17 <== NOT EXECUTED 801a4ec: 31 6f 00 88 sb (r11+136),r15 <== NOT EXECUTED 801a4f0: e3 ff ff 26 bi 801a188 <== NOT EXECUTED =============================================================================== 080120b0 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 80120b0: 37 9c ff e8 addi sp,sp,-24 80120b4: 5b 8b 00 18 sw (sp+24),r11 80120b8: 5b 8c 00 14 sw (sp+20),r12 80120bc: 5b 8d 00 10 sw (sp+16),r13 80120c0: 5b 8e 00 0c sw (sp+12),r14 80120c4: 5b 8f 00 08 sw (sp+8),r15 80120c8: 5b 9d 00 04 sw (sp+4),ra 80120cc: b8 20 58 00 mv r11,r1 int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 80120d0: fb ff ff 7a calli 8011eb8 80120d4: b8 20 70 00 mv r14,r1 if ( rc != RC_OK ) 80120d8: 5c 20 00 2e bne r1,r0,8012190 <== NEVER TAKEN rc = -1; 80120dc: 34 0d 00 00 mvi r13,0 for (i = 0; i < FAT_HASH_SIZE; i++) 80120e0: 34 0f 00 18 mvi r15,24 { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; 80120e4: 29 6c 00 6c lw r12,(r11+108) 80120e8: b5 8d 60 00 add r12,r12,r13 while ( (node = rtems_chain_get(the_chain)) != NULL ) 80120ec: e0 00 00 02 bi 80120f4 free(node); 80120f0: fb ff c3 d6 calli 8003048 */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 80120f4: b9 80 08 00 mv r1,r12 80120f8: fb ff d1 98 calli 8006758 <_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 ) 80120fc: 5c 20 ff fd bne r1,r0,80120f0 8012100: 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++) 8012104: 5d af ff f8 bne r13,r15,80120e4 8012108: 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++) 801210c: 34 0f 00 18 mvi r15,24 { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; 8012110: 29 6c 00 70 lw r12,(r11+112) 8012114: b5 8d 60 00 add r12,r12,r13 while ( (node = rtems_chain_get(the_chain)) != NULL ) 8012118: e0 00 00 02 bi 8012120 free(node); 801211c: fb ff c3 cb calli 8003048 <== NOT EXECUTED 8012120: b9 80 08 00 mv r1,r12 8012124: fb ff d1 8d calli 8006758 <_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 ) 8012128: 5c 20 ff fd bne r1,r0,801211c <== NEVER TAKEN 801212c: 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++) 8012130: 5d af ff f8 bne r13,r15,8012110 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); 8012134: 29 61 00 6c lw r1,(r11+108) 8012138: fb ff c3 c4 calli 8003048 free(fs_info->rhash); 801213c: 29 61 00 70 lw r1,(r11+112) 8012140: fb ff c3 c2 calli 8003048 free(fs_info->uino); 8012144: 29 61 00 74 lw r1,(r11+116) 8012148: fb ff c3 c0 calli 8003048 free(fs_info->sec_buf); 801214c: 29 61 00 90 lw r1,(r11+144) 8012150: fb ff c3 be calli 8003048 close(fs_info->vol.fd); 8012154: 29 61 00 60 lw r1,(r11+96) 8012158: fb ff c3 8d calli 8002f8c if (rc) 801215c: 45 c0 00 04 be r14,r0,801216c <== ALWAYS TAKEN errno = EIO; 8012160: f8 00 29 a5 calli 801c7f4 <__errno> <== NOT EXECUTED 8012164: 34 02 00 05 mvi r2,5 <== NOT EXECUTED 8012168: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED return rc; } 801216c: b9 c0 08 00 mv r1,r14 8012170: 2b 9d 00 04 lw ra,(sp+4) 8012174: 2b 8b 00 18 lw r11,(sp+24) 8012178: 2b 8c 00 14 lw r12,(sp+20) 801217c: 2b 8d 00 10 lw r13,(sp+16) 8012180: 2b 8e 00 0c lw r14,(sp+12) 8012184: 2b 8f 00 08 lw r15,(sp+8) 8012188: 37 9c 00 18 addi sp,sp,24 801218c: c3 a0 00 00 ret int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); if ( rc != RC_OK ) rc = -1; 8012190: 34 0e ff ff mvi r14,-1 <== NOT EXECUTED 8012194: e3 ff ff d2 bi 80120dc <== NOT EXECUTED =============================================================================== 08011eb8 : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 8011eb8: 37 9c ff e8 addi sp,sp,-24 8011ebc: 5b 8b 00 14 sw (sp+20),r11 8011ec0: 5b 8c 00 10 sw (sp+16),r12 8011ec4: 5b 8d 00 0c sw (sp+12),r13 8011ec8: 5b 8e 00 08 sw (sp+8),r14 8011ecc: 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) 8011ed0: 40 22 00 0e lbu r2,(r1+14) return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 8011ed4: 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) 8011ed8: 34 01 00 04 mvi r1,4 8011edc: 44 41 00 0f be r2,r1,8011f18 FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET, sizeof(le_free_count), &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) 8011ee0: 34 0c 00 00 mvi r12,0 rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; fat_buf_release(fs_info); 8011ee4: b9 60 08 00 mv r1,r11 8011ee8: fb ff fb 47 calli 8010c04 if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 8011eec: 29 61 00 64 lw r1,(r11+100) 8011ef0: fb ff f3 16 calli 800eb48 8011ef4: 5c 20 00 6d bne r1,r0,80120a8 <== NEVER TAKEN rc = -1; return rc; } 8011ef8: b9 80 08 00 mv r1,r12 8011efc: 2b 9d 00 04 lw ra,(sp+4) 8011f00: 2b 8b 00 14 lw r11,(sp+20) 8011f04: 2b 8c 00 10 lw r12,(sp+16) 8011f08: 2b 8d 00 0c lw r13,(sp+12) 8011f0c: 2b 8e 00 08 lw r14,(sp+8) 8011f10: 37 9c 00 18 addi sp,sp,24 8011f14: c3 a0 00 00 ret { ssize_t ret1 = 0, ret2 = 0; if (fs_info->vol.type == FAT_FAT32) { uint32_t free_count = fs_info->vol.free_cls; 8011f18: 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) 8011f1c: 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; 8011f20: 29 6c 00 4c lw r12,(r11+76) if (free_count != fs_info->vol.free_cls_in_fs_info) 8011f24: 34 0e 00 00 mvi r14,0 8011f28: 45 a1 00 2d be r13,r1,8011fdc <== ALWAYS TAKEN byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8011f2c: 34 02 00 18 mvi r2,24 <== NOT EXECUTED 8011f30: 21 a1 00 ff andi r1,r13,0xff <== NOT EXECUTED 8011f34: fb ff bc 8c calli 8001164 <__ashlsi3> <== NOT EXECUTED 8011f38: b8 20 70 00 mv r14,r1 <== NOT EXECUTED uint32_t value ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; 8011f3c: 34 02 00 18 mvi r2,24 <== NOT EXECUTED 8011f40: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8011f44: f8 00 74 2d calli 802eff8 <__lshrsi3> <== NOT EXECUTED byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8011f48: 01 a4 00 01 srui r4,r13,1 <== NOT EXECUTED byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8011f4c: b9 c1 70 00 or r14,r14,r1 <== NOT EXECUTED { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8011f50: 00 84 00 01 srui r4,r4,1 <== NOT EXECUTED byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8011f54: 34 02 00 10 mvi r2,16 <== NOT EXECUTED { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8011f58: 00 84 00 01 srui r4,r4,1 <== NOT EXECUTED 8011f5c: 00 84 00 01 srui r4,r4,1 <== NOT EXECUTED 8011f60: 00 84 00 01 srui r4,r4,1 <== NOT EXECUTED 8011f64: 00 84 00 01 srui r4,r4,1 <== NOT EXECUTED 8011f68: 00 84 00 01 srui r4,r4,1 <== NOT EXECUTED 8011f6c: 00 84 00 01 srui r4,r4,1 <== NOT EXECUTED byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8011f70: 20 81 00 ff andi r1,r4,0xff <== NOT EXECUTED 8011f74: fb ff bc 7c calli 8001164 <__ashlsi3> <== NOT EXECUTED 8011f78: b9 c1 70 00 or r14,r14,r1 <== NOT EXECUTED ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; 8011f7c: 34 02 00 10 mvi r2,16 <== NOT EXECUTED 8011f80: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8011f84: f8 00 74 1d calli 802eff8 <__lshrsi3> <== NOT EXECUTED 8011f88: 20 23 00 ff andi r3,r1,0xff <== NOT EXECUTED byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8011f8c: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED 8011f90: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED 8011f94: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED 8011f98: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED 8011f9c: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED 8011fa0: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED { uint32_t le_free_count = CT_LE_L(free_count); fs_info->vol.free_cls_in_fs_info = free_count; ret1 = fat_sector_write(fs_info, 8011fa4: 2d 62 00 40 lhu r2,(r11+64) <== NOT EXECUTED 8011fa8: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED 8011fac: b4 63 18 00 add r3,r3,r3 <== NOT EXECUTED 8011fb0: b9 c3 30 00 or r6,r14,r3 <== NOT EXECUTED 8011fb4: 34 04 00 04 mvi r4,4 <== NOT EXECUTED 8011fb8: 34 03 01 e8 mvi r3,488 <== NOT EXECUTED 8011fbc: 37 85 00 18 addi r5,sp,24 <== NOT EXECUTED if (free_count != fs_info->vol.free_cls_in_fs_info) { uint32_t le_free_count = CT_LE_L(free_count); fs_info->vol.free_cls_in_fs_info = free_count; 8011fc0: 59 6d 00 48 sw (r11+72),r13 <== NOT EXECUTED ret1 = fat_sector_write(fs_info, 8011fc4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED uint32_t free_count = fs_info->vol.free_cls; uint32_t next_free = fs_info->vol.next_cl; if (free_count != fs_info->vol.free_cls_in_fs_info) { uint32_t le_free_count = CT_LE_L(free_count); 8011fc8: 5b 86 00 18 sw (sp+24),r6 <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; ret1 = fat_sector_write(fs_info, 8011fcc: fb ff fb ff calli 8010fc8 <== NOT EXECUTED 8011fd0: 34 02 00 1f mvi r2,31 <== NOT EXECUTED 8011fd4: f8 00 74 09 calli 802eff8 <__lshrsi3> <== NOT EXECUTED 8011fd8: 20 2e 00 ff andi r14,r1,0xff <== NOT EXECUTED FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET, sizeof(le_free_count), &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) 8011fdc: 29 62 00 50 lw r2,(r11+80) 8011fe0: 34 01 00 00 mvi r1,0 8011fe4: 45 82 00 2d be r12,r2,8012098 <== NEVER TAKEN 8011fe8: 34 02 00 18 mvi r2,24 8011fec: 21 81 00 ff andi r1,r12,0xff 8011ff0: fb ff bc 5d calli 8001164 <__ashlsi3> 8011ff4: b8 20 68 00 mv r13,r1 uint32_t value ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; 8011ff8: 34 02 00 18 mvi r2,24 8011ffc: b9 80 08 00 mv r1,r12 8012000: f8 00 73 fe calli 802eff8 <__lshrsi3> byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8012004: 01 84 00 01 srui r4,r12,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8012008: b9 a1 68 00 or r13,r13,r1 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 801200c: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8012010: 34 02 00 10 mvi r2,16 { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; byte2 = (value >> 8) & 0xff; 8012014: 00 84 00 01 srui r4,r4,1 8012018: 00 84 00 01 srui r4,r4,1 801201c: 00 84 00 01 srui r4,r4,1 8012020: 00 84 00 01 srui r4,r4,1 8012024: 00 84 00 01 srui r4,r4,1 8012028: 00 84 00 01 srui r4,r4,1 byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 801202c: 20 81 00 ff andi r1,r4,0xff 8012030: fb ff bc 4d calli 8001164 <__ashlsi3> 8012034: b9 a1 68 00 or r13,r13,r1 ) { uint32_t byte1, byte2, byte3, byte4, swapped; byte4 = (value >> 24) & 0xff; byte3 = (value >> 16) & 0xff; 8012038: 34 02 00 10 mvi r2,16 801203c: b9 80 08 00 mv r1,r12 8012040: f8 00 73 ee calli 802eff8 <__lshrsi3> 8012044: 20 23 00 ff andi r3,r1,0xff byte2 = (value >> 8) & 0xff; byte1 = value & 0xff; swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4; 8012048: b4 63 18 00 add r3,r3,r3 801204c: b4 63 18 00 add r3,r3,r3 8012050: b4 63 18 00 add r3,r3,r3 8012054: b4 63 18 00 add r3,r3,r3 8012058: b4 63 18 00 add r3,r3,r3 801205c: b4 63 18 00 add r3,r3,r3 { uint32_t le_next_free = CT_LE_L(next_free); fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 8012060: 2d 62 00 40 lhu r2,(r11+64) 8012064: b4 63 18 00 add r3,r3,r3 8012068: b4 63 18 00 add r3,r3,r3 801206c: b9 a3 30 00 or r6,r13,r3 8012070: 34 04 00 04 mvi r4,4 8012074: 34 03 01 ec mvi r3,492 8012078: 37 85 00 18 addi r5,sp,24 if (next_free != fs_info->vol.next_cl_in_fs_info) { uint32_t le_next_free = CT_LE_L(next_free); fs_info->vol.next_cl_in_fs_info = next_free; 801207c: 59 6c 00 50 sw (r11+80),r12 ret2 = fat_sector_write(fs_info, 8012080: b9 60 08 00 mv r1,r11 &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) { uint32_t le_next_free = CT_LE_L(next_free); 8012084: 5b 86 00 18 sw (sp+24),r6 fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 8012088: fb ff fb d0 calli 8010fc8 801208c: 34 02 00 1f mvi r2,31 8012090: f8 00 73 da calli 802eff8 <__lshrsi3> 8012094: 20 21 00 ff andi r1,r1,0xff sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 8012098: b8 2e 08 00 or r1,r1,r14 801209c: 44 20 ff 91 be r1,r0,8011ee0 { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 80120a0: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 80120a4: e3 ff ff 90 bi 8011ee4 <== NOT EXECUTED fat_buf_release(fs_info); if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) rc = -1; 80120a8: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 80120ac: e3 ff ff 93 bi 8011ef8 <== NOT EXECUTED =============================================================================== 08037d48 : /** * compatible with SVr4, 4.4BSD and X/OPEN - Change Directory */ int fchdir( int fd ) { 8037d48: 37 9c ff 90 addi sp,sp,-112 8037d4c: 5b 8b 00 10 sw (sp+16),r11 8037d50: 5b 8c 00 0c sw (sp+12),r12 8037d54: 5b 8d 00 08 sw (sp+8),r13 8037d58: 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 ); 8037d5c: 78 02 08 06 mvhi r2,0x806 8037d60: 38 42 b0 10 ori r2,r2,0xb010 8037d64: 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; 8037d68: 5b 80 00 20 sw (sp+32),r0 st.st_uid = 0; 8037d6c: 0f 80 00 26 sh (sp+38),r0 st.st_gid = 0; 8037d70: 0f 80 00 28 sh (sp+40),r0 rtems_libio_check_fd( fd ); 8037d74: 54 41 00 06 bgu r2,r1,8037d8c iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); 8037d78: f8 00 16 a9 calli 803d81c <__errno> 8037d7c: 34 02 00 09 mvi r2,9 8037d80: 58 22 00 00 sw (r1+0),r2 8037d84: 34 0c ff ff mvi r12,-1 8037d88: e0 00 00 1f bi 8037e04 st.st_mode = 0; st.st_uid = 0; st.st_gid = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); 8037d8c: b4 21 58 00 add r11,r1,r1 8037d90: b5 61 58 00 add r11,r11,r1 8037d94: 78 02 08 06 mvhi r2,0x806 8037d98: b5 6b 58 00 add r11,r11,r11 8037d9c: b5 6b 58 00 add r11,r11,r11 8037da0: 38 42 ef 60 ori r2,r2,0xef60 8037da4: c9 61 08 00 sub r1,r11,r1 8037da8: 28 4b 00 00 lw r11,(r2+0) 8037dac: b4 21 08 00 add r1,r1,r1 8037db0: b4 21 08 00 add r1,r1,r1 8037db4: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open( iop ); 8037db8: 29 61 00 08 lw r1,(r11+8) 8037dbc: 20 21 01 00 andi r1,r1,0x100 8037dc0: 44 20 ff ee be r1,r0,8037d78 if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } 8037dc4: 29 61 00 20 lw r1,(r11+32) rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, &st ); 8037dc8: 35 6d 00 0c addi r13,r11,12 const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->lock_h)( mt_entry ); 8037dcc: 28 22 00 0c lw r2,(r1+12) 8037dd0: 28 42 00 00 lw r2,(r2+0) 8037dd4: d8 40 00 00 call r2 8037dd8: 29 63 00 1c lw r3,(r11+28) 8037ddc: b9 a0 08 00 mv r1,r13 8037de0: 37 82 00 14 addi r2,sp,20 8037de4: 28 63 00 18 lw r3,(r3+24) 8037de8: d8 60 00 00 call r3 8037dec: b8 20 60 00 mv r12,r1 if ( rv == 0 ) { 8037df0: 44 20 00 0c be r1,r0,8037e20 <== ALWAYS TAKEN if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } 8037df4: 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 ); 8037df8: 28 22 00 0c lw r2,(r1+12) 8037dfc: 28 42 00 04 lw r2,(r2+4) 8037e00: d8 40 00 00 call r2 8037e04: b9 80 08 00 mv r1,r12 8037e08: 2b 9d 00 04 lw ra,(sp+4) 8037e0c: 2b 8b 00 10 lw r11,(sp+16) 8037e10: 2b 8c 00 0c lw r12,(sp+12) 8037e14: 2b 8d 00 08 lw r13,(sp+8) 8037e18: 37 9c 00 70 addi sp,sp,112 8037e1c: c3 a0 00 00 ret rtems_libio_check_is_open( iop ); rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, &st ); if ( rv == 0 ) { bool access_ok = rtems_filesystem_check_access( 8037e20: 2b 82 00 20 lw r2,(sp+32) 8037e24: 2f 83 00 26 lhu r3,(sp+38) 8037e28: 2f 84 00 28 lhu r4,(sp+40) 8037e2c: 34 01 00 01 mvi r1,1 8037e30: fb ff 4f 43 calli 800bb3c st.st_mode, st.st_uid, st.st_gid ); if ( access_ok ) { 8037e34: 44 2c 00 14 be r1,r12,8037e84 rtems_filesystem_location_clone( &loc, &iop->pathinfo ); 8037e38: 37 8c 00 5c addi r12,sp,92 8037e3c: b9 a0 10 00 mv r2,r13 8037e40: b9 80 08 00 mv r1,r12 8037e44: fb ff 4d 3b calli 800b330 if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); } return rv; } 8037e48: 29 62 00 20 lw r2,(r11+32) 8037e4c: 28 43 00 0c lw r3,(r2+12) 8037e50: b8 40 08 00 mv r1,r2 8037e54: 28 62 00 04 lw r2,(r3+4) 8037e58: d8 40 00 00 call r2 } } rtems_filesystem_instance_unlock( &iop->pathinfo ); if ( rv == 0 ) { rv = rtems_filesystem_chdir( &loc ); 8037e5c: b9 80 08 00 mv r1,r12 8037e60: fb ff b4 e5 calli 80251f4 8037e64: b8 20 60 00 mv r12,r1 } return rv; } 8037e68: b9 80 08 00 mv r1,r12 8037e6c: 2b 9d 00 04 lw ra,(sp+4) 8037e70: 2b 8b 00 10 lw r11,(sp+16) 8037e74: 2b 8c 00 0c lw r12,(sp+12) 8037e78: 2b 8d 00 08 lw r13,(sp+8) 8037e7c: 37 9c 00 70 addi sp,sp,112 8037e80: c3 a0 00 00 ret ); if ( access_ok ) { rtems_filesystem_location_clone( &loc, &iop->pathinfo ); } else { errno = EACCES; 8037e84: f8 00 16 66 calli 803d81c <__errno> 8037e88: 34 02 00 0d mvi r2,13 8037e8c: 58 22 00 00 sw (r1+0),r2 rv = -1; 8037e90: 34 0c ff ff mvi r12,-1 8037e94: e3 ff ff d8 bi 8037df4 =============================================================================== 08025854 : /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 8025854: 37 9c ff f0 addi sp,sp,-16 8025858: 5b 8b 00 0c sw (sp+12),r11 802585c: 5b 8c 00 08 sw (sp+8),r12 8025860: 5b 9d 00 04 sw (sp+4),ra int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8025864: 78 03 08 06 mvhi r3,0x806 8025868: 38 63 b0 10 ori r3,r3,0xb010 802586c: 28 63 00 00 lw r3,(r3+0) 8025870: 54 61 00 06 bgu r3,r1,8025888 <== NEVER TAKEN iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 8025874: f8 00 5f ea calli 803d81c <__errno> 8025878: 34 02 00 09 mvi r2,9 802587c: 58 22 00 00 sw (r1+0),r2 8025880: 34 0c ff ff mvi r12,-1 8025884: e0 00 00 21 bi 8025908 { int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); 8025888: b4 21 58 00 add r11,r1,r1 802588c: b5 61 58 00 add r11,r11,r1 8025890: 78 03 08 06 mvhi r3,0x806 8025894: b5 6b 58 00 add r11,r11,r11 8025898: b5 6b 58 00 add r11,r11,r11 802589c: 38 63 ef 60 ori r3,r3,0xef60 80258a0: c9 61 08 00 sub r1,r11,r1 80258a4: 28 6b 00 00 lw r11,(r3+0) 80258a8: b4 21 08 00 add r1,r1,r1 80258ac: b4 21 08 00 add r1,r1,r1 80258b0: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open(iop); 80258b4: 29 61 00 08 lw r1,(r11+8) 80258b8: 20 21 01 00 andi r1,r1,0x100 80258bc: 44 20 ff ee be r1,r0,8025874 <== NEVER TAKEN if (iop->pathinfo.mt_entry->writeable) { 80258c0: 29 61 00 20 lw r1,(r11+32) 80258c4: 40 23 00 29 lbu r3,(r1+41) 80258c8: 44 60 00 16 be r3,r0,8025920 <== 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 ); 80258cc: 28 23 00 0c lw r3,(r1+12) 80258d0: 28 63 00 00 lw r3,(r3+0) 80258d4: 5b 82 00 10 sw (sp+16),r2 80258d8: d8 60 00 00 call r3 rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); 80258dc: 29 63 00 20 lw r3,(r11+32) 80258e0: 2b 82 00 10 lw r2,(sp+16) 80258e4: 35 61 00 0c addi r1,r11,12 80258e8: 28 63 00 0c lw r3,(r3+12) 80258ec: 28 63 00 20 lw r3,(r3+32) 80258f0: d8 60 00 00 call r3 80258f4: b8 20 60 00 mv r12,r1 errno = EROFS; rv = -1; } return rv; } 80258f8: 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 ); 80258fc: 28 22 00 0c lw r2,(r1+12) 8025900: 28 42 00 04 lw r2,(r2+4) 8025904: d8 40 00 00 call r2 8025908: b9 80 08 00 mv r1,r12 802590c: 2b 9d 00 04 lw ra,(sp+4) 8025910: 2b 8b 00 0c lw r11,(sp+12) 8025914: 2b 8c 00 08 lw r12,(sp+8) 8025918: 37 9c 00 10 addi sp,sp,16 802591c: c3 a0 00 00 ret if (iop->pathinfo.mt_entry->writeable) { rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 8025920: f8 00 5f bf calli 803d81c <__errno> <== NOT EXECUTED 8025924: 34 02 00 1e mvi r2,30 <== NOT EXECUTED rv = -1; 8025928: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED if (iop->pathinfo.mt_entry->writeable) { rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 802592c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; } return rv; } 8025930: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8025934: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8025938: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED 802593c: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED 8025940: 37 9c 00 10 addi sp,sp,16 <== NOT EXECUTED 8025944: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08025948 : /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 8025948: 37 9c ff f0 addi sp,sp,-16 802594c: 5b 8b 00 10 sw (sp+16),r11 8025950: 5b 8c 00 0c sw (sp+12),r12 8025954: 5b 8d 00 08 sw (sp+8),r13 8025958: 5b 9d 00 04 sw (sp+4),ra int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 802595c: 78 04 08 06 mvhi r4,0x806 8025960: 38 84 b0 10 ori r4,r4,0xb010 8025964: 28 84 00 00 lw r4,(r4+0) /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 8025968: 20 4d ff ff andi r13,r2,0xffff 802596c: 20 6c ff ff andi r12,r3,0xffff int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8025970: 54 81 00 06 bgu r4,r1,8025988 iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 8025974: f8 00 5f aa calli 803d81c <__errno> 8025978: 34 02 00 09 mvi r2,9 802597c: 58 22 00 00 sw (r1+0),r2 8025980: 34 0c ff ff mvi r12,-1 8025984: e0 00 00 21 bi 8025a08 { int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); 8025988: b4 21 58 00 add r11,r1,r1 802598c: b5 61 58 00 add r11,r11,r1 8025990: 78 04 08 06 mvhi r4,0x806 8025994: b5 6b 58 00 add r11,r11,r11 8025998: b5 6b 58 00 add r11,r11,r11 802599c: 38 84 ef 60 ori r4,r4,0xef60 80259a0: c9 61 08 00 sub r1,r11,r1 80259a4: 28 8b 00 00 lw r11,(r4+0) 80259a8: b4 21 08 00 add r1,r1,r1 80259ac: b4 21 08 00 add r1,r1,r1 80259b0: b5 61 58 00 add r11,r11,r1 rtems_libio_check_is_open(iop); 80259b4: 29 61 00 08 lw r1,(r11+8) 80259b8: 20 21 01 00 andi r1,r1,0x100 80259bc: 44 20 ff ee be r1,r0,8025974 if (iop->pathinfo.mt_entry->writeable) { 80259c0: 29 61 00 20 lw r1,(r11+32) 80259c4: 40 24 00 29 lbu r4,(r1+41) 80259c8: 44 80 00 17 be r4,r0,8025a24 <== 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 ); 80259cc: 28 22 00 0c lw r2,(r1+12) 80259d0: 28 42 00 00 lw r2,(r2+0) 80259d4: d8 40 00 00 call r2 rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( 80259d8: 29 63 00 20 lw r3,(r11+32) 80259dc: b9 a0 10 00 mv r2,r13 80259e0: 35 61 00 0c addi r1,r11,12 80259e4: 28 64 00 0c lw r4,(r3+12) 80259e8: b9 80 18 00 mv r3,r12 80259ec: 28 84 00 24 lw r4,(r4+36) 80259f0: d8 80 00 00 call r4 80259f4: b8 20 60 00 mv r12,r1 errno = EROFS; rv = -1; } return rv; } 80259f8: 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 ); 80259fc: 28 22 00 0c lw r2,(r1+12) 8025a00: 28 42 00 04 lw r2,(r2+4) 8025a04: d8 40 00 00 call r2 8025a08: b9 80 08 00 mv r1,r12 8025a0c: 2b 9d 00 04 lw ra,(sp+4) 8025a10: 2b 8b 00 10 lw r11,(sp+16) 8025a14: 2b 8c 00 0c lw r12,(sp+12) 8025a18: 2b 8d 00 08 lw r13,(sp+8) 8025a1c: 37 9c 00 10 addi sp,sp,16 8025a20: c3 a0 00 00 ret owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 8025a24: f8 00 5f 7e calli 803d81c <__errno> <== NOT EXECUTED 8025a28: 34 02 00 1e mvi r2,30 <== NOT EXECUTED rv = -1; 8025a2c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 8025a30: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; } return rv; } 8025a34: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8025a38: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8025a3c: 2b 8b 00 10 lw r11,(sp+16) <== NOT EXECUTED 8025a40: 2b 8c 00 0c lw r12,(sp+12) <== NOT EXECUTED 8025a44: 2b 8d 00 08 lw r13,(sp+8) <== NOT EXECUTED 8025a48: 37 9c 00 10 addi sp,sp,16 <== NOT EXECUTED 8025a4c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08037110 : int fcntl( int fd, int cmd, ... ) { 8037110: 37 9c ff c8 addi sp,sp,-56 8037114: 5b 8b 00 1c sw (sp+28),r11 8037118: 5b 8c 00 18 sw (sp+24),r12 803711c: 5b 8d 00 14 sw (sp+20),r13 8037120: 5b 8e 00 10 sw (sp+16),r14 8037124: 5b 8f 00 0c sw (sp+12),r15 8037128: 5b 90 00 08 sw (sp+8),r16 803712c: 5b 9d 00 04 sw (sp+4),ra int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8037130: 78 09 08 03 mvhi r9,0x803 8037134: 39 29 e0 14 ori r9,r9,0xe014 8037138: 29 29 00 00 lw r9,(r9+0) int fcntl( int fd, int cmd, ... ) { 803713c: 5b 84 00 28 sw (sp+40),r4 8037140: 5b 82 00 20 sw (sp+32),r2 8037144: 5b 83 00 24 sw (sp+36),r3 8037148: 5b 85 00 2c sw (sp+44),r5 803714c: 5b 86 00 30 sw (sp+48),r6 8037150: 5b 87 00 34 sw (sp+52),r7 8037154: 5b 88 00 38 sw (sp+56),r8 8037158: b8 40 58 00 mv r11,r2 int ret; va_list ap; va_start( ap, cmd ); 803715c: 37 84 00 24 addi r4,sp,36 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 8037160: 55 21 00 06 bgu r9,r1,8037178 iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 8037164: fb ff b1 f8 calli 8023944 <__errno> 8037168: 34 02 00 09 mvi r2,9 803716c: 58 22 00 00 sw (r1+0),r2 8037170: 34 0d ff ff mvi r13,-1 8037174: e0 00 00 1c bi 80371e4 int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); 8037178: b4 21 60 00 add r12,r1,r1 803717c: b5 81 60 00 add r12,r12,r1 8037180: 78 0e 08 04 mvhi r14,0x804 8037184: b5 8c 60 00 add r12,r12,r12 8037188: b5 8c 60 00 add r12,r12,r12 803718c: 39 ce e9 8c ori r14,r14,0xe98c 8037190: c9 81 08 00 sub r1,r12,r1 8037194: 29 cc 00 00 lw r12,(r14+0) 8037198: b4 21 08 00 add r1,r1,r1 803719c: b4 21 08 00 add r1,r1,r1 80371a0: b5 81 60 00 add r12,r12,r1 rtems_libio_check_is_open(iop); 80371a4: 29 81 00 08 lw r1,(r12+8) 80371a8: 20 22 01 00 andi r2,r1,0x100 80371ac: 44 40 ff ee be r2,r0,8037164 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 80371b0: 34 02 00 09 mvi r2,9 80371b4: 55 62 00 74 bgu r11,r2,8037384 80371b8: 78 03 08 03 mvhi r3,0x803 80371bc: b5 6b 10 00 add r2,r11,r11 80371c0: 38 63 d5 c0 ori r3,r3,0xd5c0 80371c4: b4 42 10 00 add r2,r2,r2 80371c8: b4 62 10 00 add r2,r3,r2 80371cc: 28 42 00 00 lw r2,(r2+0) 80371d0: c0 40 00 00 b r2 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 80371d4: fb ff b1 dc calli 8023944 <__errno> 80371d8: 34 02 00 86 mvi r2,134 80371dc: 58 22 00 00 sw (r1+0),r2 if (ret >= 0) { int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); if (err) { errno = err; ret = -1; 80371e0: 34 0d ff ff mvi r13,-1 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 80371e4: b9 a0 08 00 mv r1,r13 80371e8: 2b 9d 00 04 lw ra,(sp+4) 80371ec: 2b 8b 00 1c lw r11,(sp+28) 80371f0: 2b 8c 00 18 lw r12,(sp+24) 80371f4: 2b 8d 00 14 lw r13,(sp+20) 80371f8: 2b 8e 00 10 lw r14,(sp+16) 80371fc: 2b 8f 00 0c lw r15,(sp+12) 8037200: 2b 90 00 08 lw r16,(sp+8) 8037204: 37 9c 00 38 addi sp,sp,56 8037208: c3 a0 00 00 ret case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 803720c: 28 81 00 00 lw r1,(r4+0) { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 8037210: 34 0d 00 00 mvi r13,0 case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 8037214: fb ff 3f 81 calli 8007018 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 8037218: 29 83 00 08 lw r3,(r12+8) 803721c: 34 02 fd fe mvi r2,-514 8037220: 20 21 02 01 andi r1,r1,0x201 8037224: a0 43 10 00 and r2,r2,r3 8037228: b8 22 08 00 or r1,r1,r2 803722c: 59 81 00 08 sw (r12+8),r1 * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 8037230: 29 83 00 1c lw r3,(r12+28) 8037234: b9 60 10 00 mv r2,r11 8037238: b9 80 08 00 mv r1,r12 803723c: 28 63 00 28 lw r3,(r3+40) 8037240: d8 60 00 00 call r3 8037244: b8 20 58 00 mv r11,r1 if (err) { 8037248: 44 20 ff e7 be r1,r0,80371e4 <== ALWAYS TAKEN errno = err; 803724c: fb ff b1 be calli 8023944 <__errno> <== NOT EXECUTED 8037250: 58 2b 00 00 sw (r1+0),r11 <== NOT EXECUTED 8037254: e3 ff ff e3 bi 80371e0 <== NOT EXECUTED else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 8037258: fb ff 3f 86 calli 8007070 803725c: b8 20 68 00 mv r13,r1 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 8037260: 48 0d ff e1 bg r0,r13,80371e4 <== NEVER TAKEN 8037264: e3 ff ff f3 bi 8037230 * 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 ) ) 8037268: 28 82 00 00 lw r2,(r4+0) 803726c: 44 40 00 4a be r2,r0,8037394 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 8037270: 38 21 08 00 ori r1,r1,0x800 8037274: 59 81 00 08 sw (r12+8),r1 { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 8037278: 34 0d 00 00 mvi r13,0 803727c: e3 ff ff ed bi 8037230 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); 8037280: 20 2d 08 00 andi r13,r1,0x800 8037284: 7d ad 00 00 cmpnei r13,r13,0 8037288: e3 ff ff ea bi 8037230 /* * FIXME: We ignore the start value fd2 for the file descriptor search. This * is not POSIX conform. */ rtems_libio_t *diop = rtems_libio_allocate(); 803728c: fb ff 3f 8e calli 80070c4 8037290: b8 20 78 00 mv r15,r1 if (diop != NULL) { 8037294: 44 20 ff d3 be r1,r0,80371e0 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 8037298: 29 81 00 08 lw r1,(r12+8) oflag &= ~O_CREAT; 803729c: 34 0d fd ff mvi r13,-513 * is not POSIX conform. */ rtems_libio_t *diop = rtems_libio_allocate(); if (diop != NULL) { int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 80372a0: fb ff 3f 74 calli 8007070 oflag &= ~O_CREAT; 80372a4: a0 2d 68 00 and r13,r1,r13 diop->flags |= rtems_libio_fcntl_flags( oflag ); 80372a8: b9 a0 08 00 mv r1,r13 80372ac: 29 f0 00 08 lw r16,(r15+8) 80372b0: fb ff 3f 5a calli 8007018 int cmd, int arg ) { return fcntl( fd, cmd, arg ); } 80372b4: 29 82 00 20 lw r2,(r12+32) if (diop != NULL) { int oflag = rtems_libio_to_fcntl_flags( iop->flags ); oflag &= ~O_CREAT; diop->flags |= rtems_libio_fcntl_flags( oflag ); 80372b8: b8 30 08 00 or r1,r1,r16 80372bc: 59 e1 00 08 sw (r15+8),r1 const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->lock_h)( mt_entry ); 80372c0: 28 43 00 0c lw r3,(r2+12) 80372c4: b8 40 08 00 mv r1,r2 80372c8: 28 62 00 00 lw r2,(r3+0) 80372cc: d8 40 00 00 call r2 rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); 80372d0: 35 82 00 0c addi r2,r12,12 80372d4: 35 e1 00 0c addi r1,r15,12 80372d8: fb ff 7b eb calli 8016284 int cmd, int arg ) { return fcntl( fd, cmd, arg ); } 80372dc: 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 ); 80372e0: 28 22 00 0c lw r2,(r1+12) 80372e4: 28 42 00 04 lw r2,(r2+4) 80372e8: 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 ); 80372ec: 29 e3 00 1c lw r3,(r15+28) 80372f0: b9 e0 08 00 mv r1,r15 80372f4: 34 02 00 00 mvi r2,0 80372f8: 28 65 00 00 lw r5,(r3+0) 80372fc: 34 04 00 00 mvi r4,0 8037300: b9 a0 18 00 mv r3,r13 8037304: d8 a0 00 00 call r5 8037308: b8 20 68 00 mv r13,r1 if ( rv == 0 ) { 803730c: 5c 20 00 27 bne r1,r0,80373a8 <== NEVER TAKEN rv = diop - rtems_libio_iops; 8037310: 29 c1 00 00 lw r1,(r14+0) 8037314: 34 02 00 0f mvi r2,15 8037318: c9 e1 78 00 sub r15,r15,r1 803731c: 15 ef 00 01 sri r15,r15,1 8037320: 15 ef 00 01 sri r15,r15,1 8037324: b5 ef 08 00 add r1,r15,r15 8037328: b4 21 08 00 add r1,r1,r1 803732c: b4 21 08 00 add r1,r1,r1 8037330: b4 21 08 00 add r1,r1,r1 8037334: b4 21 08 00 add r1,r1,r1 8037338: b4 21 18 00 add r3,r1,r1 803733c: b4 63 18 00 add r3,r3,r3 8037340: b4 63 18 00 add r3,r3,r3 8037344: b4 63 18 00 add r3,r3,r3 8037348: b4 63 18 00 add r3,r3,r3 803734c: c8 61 08 00 sub r1,r3,r1 8037350: b4 2f 08 00 add r1,r1,r15 8037354: b4 21 20 00 add r4,r1,r1 8037358: b4 84 20 00 add r4,r4,r4 803735c: b4 84 20 00 add r4,r4,r4 8037360: b4 24 68 00 add r13,r1,r4 8037364: b5 ad 68 00 add r13,r13,r13 8037368: b5 ad 68 00 add r13,r13,r13 803736c: b9 a0 08 00 mv r1,r13 8037370: fb ff fe 89 calli 8036d94 <__ashlsi3> 8037374: c9 af 68 00 sub r13,r13,r15 8037378: c9 a1 68 00 sub r13,r13,r1 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 803737c: 48 0d ff 9a bg r0,r13,80371e4 <== NEVER TAKEN 8037380: e3 ff ff ac bi 8037230 errno = ENOTSUP; ret = -1; break; default: errno = EINVAL; 8037384: fb ff b1 70 calli 8023944 <__errno> 8037388: 34 02 00 16 mvi r2,22 803738c: 58 22 00 00 sw (r1+0),r2 8037390: e3 ff ff 94 bi 80371e0 */ if ( va_arg( ap, int ) ) iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 8037394: 34 02 f7 ff mvi r2,-2049 8037398: a0 22 08 00 and r1,r1,r2 803739c: 59 81 00 08 sw (r12+8),r1 { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 80373a0: 34 0d 00 00 mvi r13,0 80373a4: e3 ff ff a3 bi 8037230 */ rv = (*diop->pathinfo.handlers->open_h)( diop, NULL, oflag, 0 ); if ( rv == 0 ) { rv = diop - rtems_libio_iops; } else { rtems_libio_free( diop ); 80373a8: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 80373ac: fb ff 3f 6a calli 8007154 <== NOT EXECUTED /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 80373b0: 48 0d ff 8d bg r0,r13,80371e4 <== NOT EXECUTED 80373b4: e3 ff ff 9f bi 8037230 <== NOT EXECUTED =============================================================================== 0800ab18 : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 800ab18: 37 9c ff d8 addi sp,sp,-40 800ab1c: 5b 8b 00 20 sw (sp+32),r11 800ab20: 5b 8c 00 1c sw (sp+28),r12 800ab24: 5b 8d 00 18 sw (sp+24),r13 800ab28: 5b 8e 00 14 sw (sp+20),r14 800ab2c: 5b 8f 00 10 sw (sp+16),r15 800ab30: 5b 90 00 0c sw (sp+12),r16 800ab34: 5b 91 00 08 sw (sp+8),r17 800ab38: 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) { 800ab3c: 78 0b 08 02 mvhi r11,0x802 800ab40: 39 6b 57 a8 ori r11,r11,0x57a8 800ab44: 29 6c 00 00 lw r12,(r11+0) int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { 800ab48: b8 20 70 00 mv r14,r1 800ab4c: b8 40 68 00 mv r13,r2 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { 800ab50: 45 80 00 2c be r12,r0,800ac00 rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); 800ab54: b9 80 08 00 mv r1,r12 800ab58: 34 02 00 00 mvi r2,0 800ab5c: 34 03 00 00 mvi r3,0 800ab60: fb ff ea c6 calli 8005678 } if (sc == RTEMS_SUCCESSFUL) { 800ab64: 34 0c ff f4 mvi r12,-12 800ab68: 5c 20 00 1b bne r1,r0,800abd4 <== NEVER TAKEN err = pipe_lock(); if (err) return err; pipe = *pipep; 800ab6c: 29 cb 00 00 lw r11,(r14+0) if (pipe == NULL) { 800ab70: 45 61 00 80 be r11,r1,800ad70 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 800ab74: 29 61 00 28 lw r1,(r11+40) 800ab78: 34 02 00 00 mvi r2,0 800ab7c: 34 03 00 00 mvi r3,0 800ab80: fb ff ea be calli 8005678 800ab84: 7c 21 00 00 cmpnei r1,r1,0 err = -EINTR; if (*pipep == NULL) { 800ab88: 29 c2 00 00 lw r2,(r14+0) err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) 800ab8c: c8 01 60 00 sub r12,r0,r1 800ab90: 34 03 ff fc mvi r3,-4 800ab94: a1 83 60 00 and r12,r12,r3 err = -EINTR; if (*pipep == NULL) { 800ab98: 44 40 00 cb be r2,r0,800aec4 else *pipep = pipe; } out: pipe_unlock(); 800ab9c: fb ff ff 89 calli 800a9c0 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) 800aba0: 5d 80 00 0d bne r12,r0,800abd4 <== NEVER TAKEN return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { 800aba4: 29 a1 00 08 lw r1,(r13+8) 800aba8: 34 02 00 04 mvi r2,4 int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; 800abac: 29 cb 00 00 lw r11,(r14+0) switch (LIBIO_ACCMODE(iop)) { 800abb0: 20 21 00 06 andi r1,r1,0x6 800abb4: 44 22 00 1f be r1,r2,800ac30 800abb8: 34 02 00 06 mvi r2,6 800abbc: 44 22 00 5b be r1,r2,800ad28 800abc0: 34 02 00 02 mvi r2,2 800abc4: 44 22 00 3c be r1,r2,800acb4 <== ALWAYS TAKEN if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); break; } PIPE_UNLOCK(pipe); 800abc8: 29 61 00 28 lw r1,(r11+40) return 0; 800abcc: 34 0c 00 00 mvi r12,0 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); break; } PIPE_UNLOCK(pipe); 800abd0: fb ff eb 06 calli 80057e8 return 0; out_error: pipe_release(pipep, iop); return err; } 800abd4: b9 80 08 00 mv r1,r12 800abd8: 2b 9d 00 04 lw ra,(sp+4) 800abdc: 2b 8b 00 20 lw r11,(sp+32) 800abe0: 2b 8c 00 1c lw r12,(sp+28) 800abe4: 2b 8d 00 18 lw r13,(sp+24) 800abe8: 2b 8e 00 14 lw r14,(sp+20) 800abec: 2b 8f 00 10 lw r15,(sp+16) 800abf0: 2b 90 00 0c lw r16,(sp+12) 800abf4: 2b 91 00 08 lw r17,(sp+8) 800abf8: 37 9c 00 28 addi sp,sp,40 800abfc: c3 a0 00 00 ret */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 800ac00: 78 0f 08 02 mvhi r15,0x802 800ac04: 39 ef 58 24 ori r15,r15,0x5824 800ac08: 29 e1 00 00 lw r1,(r15+0) 800ac0c: 34 02 00 00 mvi r2,0 800ac10: 34 03 00 00 mvi r3,0 800ac14: fb ff ea 99 calli 8005678 rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { 800ac18: 29 61 00 00 lw r1,(r11+0) 800ac1c: 44 2c 00 ae be r1,r12,800aed4 <== ALWAYS TAKEN } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 800ac20: 29 e1 00 00 lw r1,(r15+0) <== NOT EXECUTED 800ac24: fb ff ea f1 calli 80057e8 <== NOT EXECUTED 800ac28: 29 6c 00 00 lw r12,(r11+0) <== NOT EXECUTED 800ac2c: e3 ff ff ca bi 800ab54 <== NOT EXECUTED } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 800ac30: 29 63 00 24 lw r3,(r11+36) if (pipe->Writers ++ == 0) 800ac34: 29 61 00 14 lw r1,(r11+20) } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 800ac38: 34 63 00 01 addi r3,r3,1 if (pipe->Writers ++ == 0) 800ac3c: 34 22 00 01 addi r2,r1,1 } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; 800ac40: 59 63 00 24 sw (r11+36),r3 if (pipe->Writers ++ == 0) 800ac44: 59 62 00 14 sw (r11+20),r2 800ac48: 44 20 00 ba be r1,r0,800af30 <== ALWAYS TAKEN PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { 800ac4c: 29 61 00 10 lw r1,(r11+16) 800ac50: 5c 20 ff de bne r1,r0,800abc8 800ac54: 29 a2 00 08 lw r2,(r13+8) 800ac58: 20 42 00 01 andi r2,r2,0x1 800ac5c: 5c 41 00 c5 bne r2,r1,800af70 err = -ENXIO; goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; 800ac60: 29 6f 00 20 lw r15,(r11+32) 800ac64: e0 00 00 06 bi 800ac7c err = -EINTR; do { PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) goto out_error; if (! PIPE_LOCK(pipe)) 800ac68: 29 61 00 28 lw r1,(r11+40) 800ac6c: fb ff ea 83 calli 8005678 800ac70: 5c 2c 00 0c bne r1,r12,800aca0 <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->readerCounter); 800ac74: 29 61 00 20 lw r1,(r11+32) 800ac78: 5c 2f ff d4 bne r1,r15,800abc8 <== ALWAYS TAKEN if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); 800ac7c: 29 61 00 28 lw r1,(r11+40) 800ac80: fb ff ea da calli 80057e8 if (! PIPE_WRITEWAIT(pipe)) 800ac84: 29 61 00 30 lw r1,(r11+48) 800ac88: 34 02 00 00 mvi r2,0 800ac8c: f8 00 07 e3 calli 800cc18 800ac90: b8 20 60 00 mv r12,r1 goto out_error; if (! PIPE_LOCK(pipe)) 800ac94: 34 02 00 00 mvi r2,0 800ac98: 34 03 00 00 mvi r3,0 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) 800ac9c: 44 20 ff f3 be r1,r0,800ac68 <== ALWAYS TAKEN goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; 800aca0: 34 0c ff fc mvi r12,-4 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); 800aca4: b9 c0 08 00 mv r1,r14 800aca8: b9 a0 10 00 mv r2,r13 800acac: fb ff ff 4e calli 800a9e4 return err; 800acb0: e3 ff ff c9 bi 800abd4 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; 800acb4: 29 63 00 20 lw r3,(r11+32) if (pipe->Readers ++ == 0) 800acb8: 29 61 00 10 lw r1,(r11+16) return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; 800acbc: 34 63 00 01 addi r3,r3,1 if (pipe->Readers ++ == 0) 800acc0: 34 22 00 01 addi r2,r1,1 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; 800acc4: 59 63 00 20 sw (r11+32),r3 if (pipe->Readers ++ == 0) 800acc8: 59 62 00 10 sw (r11+16),r2 800accc: 44 20 00 91 be r1,r0,800af10 <== ALWAYS TAKEN PIPE_WAKEUPWRITERS(pipe); if (pipe->Writers == 0) { 800acd0: 29 61 00 14 lw r1,(r11+20) 800acd4: 5c 20 ff bd bne r1,r0,800abc8 /* Not an error */ if (LIBIO_NODELAY(iop)) 800acd8: 29 a2 00 08 lw r2,(r13+8) 800acdc: 20 42 00 01 andi r2,r2,0x1 800ace0: 5c 41 ff ba bne r2,r1,800abc8 break; prevCounter = pipe->writerCounter; 800ace4: 29 6f 00 24 lw r15,(r11+36) 800ace8: e0 00 00 06 bi 800ad00 /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) goto out_error; if (! PIPE_LOCK(pipe)) 800acec: 29 61 00 28 lw r1,(r11+40) 800acf0: fb ff ea 62 calli 8005678 800acf4: 5c 2c ff eb bne r1,r12,800aca0 <== NEVER TAKEN goto out_error; } while (prevCounter == pipe->writerCounter); 800acf8: 29 61 00 24 lw r1,(r11+36) 800acfc: 5c 2f ff b3 bne r1,r15,800abc8 <== ALWAYS TAKEN prevCounter = pipe->writerCounter; err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); 800ad00: 29 61 00 28 lw r1,(r11+40) 800ad04: fb ff ea b9 calli 80057e8 if (! PIPE_READWAIT(pipe)) 800ad08: 29 61 00 2c lw r1,(r11+44) 800ad0c: 34 02 00 00 mvi r2,0 800ad10: f8 00 07 c2 calli 800cc18 800ad14: b8 20 60 00 mv r12,r1 goto out_error; if (! PIPE_LOCK(pipe)) 800ad18: 34 02 00 00 mvi r2,0 800ad1c: 34 03 00 00 mvi r3,0 prevCounter = pipe->writerCounter; err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) 800ad20: 44 20 ff f3 be r1,r0,800acec <== ALWAYS TAKEN 800ad24: e3 ff ff df bi 800aca0 <== NOT EXECUTED } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 800ad28: 29 63 00 20 lw r3,(r11+32) if (pipe->Readers ++ == 0) 800ad2c: 29 61 00 10 lw r1,(r11+16) } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 800ad30: 34 63 00 01 addi r3,r3,1 if (pipe->Readers ++ == 0) 800ad34: 34 22 00 01 addi r2,r1,1 } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; 800ad38: 59 63 00 20 sw (r11+32),r3 if (pipe->Readers ++ == 0) 800ad3c: 59 62 00 10 sw (r11+16),r2 800ad40: 44 20 00 78 be r1,r0,800af20 <== ALWAYS TAKEN PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; 800ad44: 29 63 00 24 lw r3,(r11+36) if (pipe->Writers ++ == 0) 800ad48: 29 61 00 14 lw r1,(r11+20) case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; 800ad4c: 34 63 00 01 addi r3,r3,1 if (pipe->Writers ++ == 0) 800ad50: 34 22 00 01 addi r2,r1,1 case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; 800ad54: 59 63 00 24 sw (r11+36),r3 if (pipe->Writers ++ == 0) 800ad58: 59 62 00 14 sw (r11+20),r2 800ad5c: 5c 20 ff 9b bne r1,r0,800abc8 <== NEVER TAKEN PIPE_WAKEUPREADERS(pipe); 800ad60: 29 61 00 2c lw r1,(r11+44) 800ad64: 37 82 00 28 addi r2,sp,40 800ad68: f8 00 07 8b calli 800cb94 800ad6c: e3 ff ff 97 bi 800abc8 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); 800ad70: 34 01 00 34 mvi r1,52 800ad74: fb ff e0 5a calli 8002edc 800ad78: b8 20 58 00 mv r11,r1 800ad7c: b8 20 88 00 mv r17,r1 if (pipe == NULL) 800ad80: 44 20 00 88 be r1,r0,800afa0 return err; memset(pipe, 0, sizeof(pipe_control_t)); 800ad84: 58 20 00 00 sw (r1+0),r0 800ad88: 58 20 00 08 sw (r1+8),r0 800ad8c: 58 20 00 0c sw (r1+12),r0 800ad90: 58 20 00 10 sw (r1+16),r0 800ad94: 58 20 00 14 sw (r1+20),r0 800ad98: 58 20 00 18 sw (r1+24),r0 800ad9c: 58 20 00 1c sw (r1+28),r0 800ada0: 58 20 00 20 sw (r1+32),r0 800ada4: 58 20 00 24 sw (r1+36),r0 800ada8: 58 20 00 28 sw (r1+40),r0 800adac: 58 20 00 2c sw (r1+44),r0 800adb0: 58 20 00 30 sw (r1+48),r0 pipe->Size = PIPE_BUF; 800adb4: 34 01 02 00 mvi r1,512 800adb8: 59 61 00 04 sw (r11+4),r1 pipe->Buffer = malloc(pipe->Size); 800adbc: fb ff e0 48 calli 8002edc 800adc0: 59 61 00 00 sw (r11+0),r1 if (! pipe->Buffer) 800adc4: 44 20 00 75 be r1,r0,800af98 <== NEVER TAKEN goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), 800adc8: 78 0c 08 02 mvhi r12,0x802 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 800adcc: 78 05 08 02 mvhi r5,0x802 800add0: 38 a5 34 04 ori r5,r5,0x3404 rtems_build_name ('P', 'I', 'r', c), 800add4: 39 8c 51 b0 ori r12,r12,0x51b0 800add8: 41 84 00 00 lbu r4,(r12+0) if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( 800addc: 28 a1 00 00 lw r1,(r5+0) 800ade0: 34 02 00 00 mvi r2,0 800ade4: 34 03 00 00 mvi r3,0 800ade8: b8 81 08 00 or r1,r4,r1 800adec: 35 64 00 2c addi r4,r11,44 800adf0: f8 00 06 f2 calli 800c9b8 800adf4: b8 20 78 00 mv r15,r1 800adf8: 5c 20 00 66 bne r1,r0,800af90 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 800adfc: 78 05 08 02 mvhi r5,0x802 800ae00: 38 a5 34 08 ori r5,r5,0x3408 rtems_build_name ('P', 'I', 'w', c), 800ae04: 41 84 00 00 lbu r4,(r12+0) if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( 800ae08: 28 a1 00 00 lw r1,(r5+0) 800ae0c: 34 02 00 00 mvi r2,0 800ae10: 34 03 00 00 mvi r3,0 800ae14: b8 81 08 00 or r1,r4,r1 800ae18: 35 64 00 30 addi r4,r11,48 800ae1c: f8 00 06 e7 calli 800c9b8 800ae20: b8 20 80 00 mv r16,r1 800ae24: 5c 2f 00 59 bne r1,r15,800af88 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 800ae28: 78 05 08 02 mvhi r5,0x802 800ae2c: 38 a5 34 0c ori r5,r5,0x340c rtems_build_name ('P', 'I', 's', c), 1, 800ae30: 41 84 00 00 lbu r4,(r12+0) if (rtems_barrier_create( rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( 800ae34: 28 a1 00 00 lw r1,(r5+0) 800ae38: 34 02 00 01 mvi r2,1 800ae3c: 34 03 00 10 mvi r3,16 800ae40: b8 81 08 00 or r1,r4,r1 800ae44: 35 65 00 28 addi r5,r11,40 800ae48: 34 04 00 00 mvi r4,0 800ae4c: fb ff e9 87 calli 8005468 800ae50: 5c 30 00 4c bne r1,r16,800af80 Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) _Objects_Get( &_Barrier_Information, id, location ); 800ae54: 29 62 00 2c lw r2,(r11+44) 800ae58: 78 0f 08 02 mvhi r15,0x802 800ae5c: 39 ef 61 c8 ori r15,r15,0x61c8 /* 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 800ae60: 37 91 00 24 addi r17,sp,36 800ae64: ba 20 18 00 mv r3,r17 800ae68: b9 e0 08 00 mv r1,r15 800ae6c: fb ff f1 3f calli 8007368 <_Objects_Get> |= STATES_INTERRUPTIBLE_BY_SIGNAL; 800ae70: 28 22 00 4c lw r2,(r1+76) 800ae74: 78 10 10 00 mvhi r16,0x1000 800ae78: b8 50 10 00 or r2,r2,r16 800ae7c: 58 22 00 4c sw (r1+76),r2 _Thread_Enable_dispatch(); 800ae80: fb ff f5 08 calli 80082a0 <_Thread_Enable_dispatch> 800ae84: 29 62 00 30 lw r2,(r11+48) 800ae88: ba 20 18 00 mv r3,r17 800ae8c: b9 e0 08 00 mv r1,r15 800ae90: fb ff f1 36 calli 8007368 <_Objects_Get> _Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; 800ae94: 28 22 00 4c lw r2,(r1+76) 800ae98: b8 50 80 00 or r16,r2,r16 800ae9c: 58 30 00 4c sw (r1+76),r16 _Thread_Enable_dispatch(); 800aea0: fb ff f5 00 calli 80082a0 <_Thread_Enable_dispatch> #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') 800aea4: 41 81 00 00 lbu r1,(r12+0) 800aea8: 34 22 00 01 addi r2,r1,1 800aeac: 31 82 00 00 sb (r12+0),r2 800aeb0: 34 02 00 7a mvi r2,122 800aeb4: 5c 22 ff 30 bne r1,r2,800ab74 c = 'a'; 800aeb8: 34 01 00 61 mvi r1,97 800aebc: 31 81 00 00 sb (r12+0),r1 800aec0: e3 ff ff 2d bi 800ab74 if (! PIPE_LOCK(pipe)) err = -EINTR; if (*pipep == NULL) { if (err) 800aec4: 5d 82 00 1f bne r12,r2,800af40 <== NEVER TAKEN pipe_free(pipe); else *pipep = pipe; 800aec8: 59 cb 00 00 sw (r14+0),r11 } out: pipe_unlock(); 800aecc: fb ff fe bd calli 800a9c0 800aed0: e3 ff ff 35 bi 800aba4 if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { sc = rtems_semaphore_create( 800aed4: 78 02 08 02 mvhi r2,0x802 800aed8: 38 42 34 00 ori r2,r2,0x3400 800aedc: 28 41 00 00 lw r1,(r2+0) 800aee0: 34 03 00 54 mvi r3,84 800aee4: 34 02 00 01 mvi r2,1 800aee8: 34 04 00 00 mvi r4,0 800aeec: b9 60 28 00 mv r5,r11 800aef0: fb ff e9 5e calli 8005468 800aef4: b8 20 80 00 mv r16,r1 800aef8: 29 e1 00 00 lw r1,(r15+0) } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 800aefc: 34 0c ff f4 mvi r12,-12 800af00: fb ff ea 3a calli 80057e8 800af04: 5e 00 ff 34 bne r16,r0,800abd4 800af08: 29 6c 00 00 lw r12,(r11+0) 800af0c: e3 ff ff 12 bi 800ab54 switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); 800af10: 29 61 00 30 lw r1,(r11+48) 800af14: 37 82 00 28 addi r2,sp,40 800af18: f8 00 07 1f calli 800cb94 800af1c: e3 ff ff 6d bi 800acd0 break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); 800af20: 29 61 00 30 lw r1,(r11+48) 800af24: 37 82 00 28 addi r2,sp,40 800af28: f8 00 07 1b calli 800cb94 800af2c: e3 ff ff 86 bi 800ad44 case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); 800af30: 29 61 00 2c lw r1,(r11+44) 800af34: 37 82 00 28 addi r2,sp,40 800af38: f8 00 07 17 calli 800cb94 800af3c: e3 ff ff 44 bi 800ac4c /* Called with pipe_semaphore held. */ static inline void pipe_free( pipe_control_t *pipe ) { rtems_barrier_delete(pipe->readBarrier); 800af40: 29 61 00 2c lw r1,(r11+44) <== NOT EXECUTED 800af44: f8 00 06 e0 calli 800cac4 <== NOT EXECUTED rtems_barrier_delete(pipe->writeBarrier); 800af48: 29 61 00 30 lw r1,(r11+48) <== NOT EXECUTED 800af4c: f8 00 06 de calli 800cac4 <== NOT EXECUTED rtems_semaphore_delete(pipe->Semaphore); 800af50: 29 61 00 28 lw r1,(r11+40) <== NOT EXECUTED 800af54: f8 00 08 12 calli 800cf9c <== NOT EXECUTED free(pipe->Buffer); 800af58: 29 61 00 00 lw r1,(r11+0) <== NOT EXECUTED 800af5c: fb ff de 7b calli 8002948 <== NOT EXECUTED free(pipe); 800af60: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800af64: fb ff de 79 calli 8002948 <== NOT EXECUTED else *pipep = pipe; } out: pipe_unlock(); 800af68: fb ff fe 96 calli 800a9c0 <== NOT EXECUTED 800af6c: e3 ff ff 1a bi 800abd4 <== NOT EXECUTED if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); 800af70: 29 61 00 28 lw r1,(r11+40) err = -ENXIO; 800af74: 34 0c ff fa mvi r12,-6 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); 800af78: fb ff ea 1c calli 80057e8 err = -ENXIO; goto out_error; 800af7c: e3 ff ff 4a bi 800aca4 if (c ++ == 'z') c = 'a'; return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); 800af80: 29 61 00 30 lw r1,(r11+48) 800af84: f8 00 06 d0 calli 800cac4 err_wbar: rtems_barrier_delete(pipe->readBarrier); 800af88: 2a 21 00 2c lw r1,(r17+44) 800af8c: f8 00 06 ce calli 800cac4 err_rbar: free(pipe->Buffer); 800af90: 2a 21 00 00 lw r1,(r17+0) 800af94: fb ff de 6d calli 8002948 err_buf: free(pipe); 800af98: ba 20 08 00 mv r1,r17 800af9c: fb ff de 6b calli 8002948 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { 800afa0: 34 0c ff f4 mvi r12,-12 else *pipep = pipe; } out: pipe_unlock(); 800afa4: fb ff fe 87 calli 800a9c0 800afa8: e3 ff ff 0b bi 800abd4 =============================================================================== 08009058 : */ long fpathconf( int fd, int name ) { 8009058: 37 9c ff fc addi sp,sp,-4 800905c: 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); 8009060: 78 03 08 01 mvhi r3,0x801 8009064: 38 63 40 04 ori r3,r3,0x4004 8009068: 28 63 00 00 lw r3,(r3+0) 800906c: 54 61 00 06 bgu r3,r1,8009084 iop = rtems_libio_iop(fd); rtems_libio_check_is_open(iop); 8009070: f8 00 0c 4a calli 800c198 <__errno> 8009074: 34 02 00 09 mvi r2,9 8009078: 58 22 00 00 sw (r1+0),r2 800907c: 34 01 ff ff mvi r1,-1 8009080: e0 00 00 1b bi 80090ec long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); iop = rtems_libio_iop(fd); 8009084: b4 21 18 00 add r3,r1,r1 8009088: b4 61 18 00 add r3,r3,r1 800908c: 78 04 08 01 mvhi r4,0x801 8009090: b4 63 18 00 add r3,r3,r3 8009094: b4 63 18 00 add r3,r3,r3 8009098: 38 84 47 b8 ori r4,r4,0x47b8 800909c: c8 61 08 00 sub r1,r3,r1 80090a0: 28 83 00 00 lw r3,(r4+0) 80090a4: b4 21 08 00 add r1,r1,r1 80090a8: b4 21 08 00 add r1,r1,r1 80090ac: b4 61 08 00 add r1,r3,r1 rtems_libio_check_is_open(iop); 80090b0: 28 23 00 08 lw r3,(r1+8) 80090b4: 20 63 01 00 andi r3,r3,0x100 80090b8: 44 60 ff ee be r3,r0,8009070 <== NEVER TAKEN /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; 80090bc: 28 21 00 20 lw r1,(r1+32) switch ( name ) { 80090c0: 34 03 00 0b mvi r3,11 /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; 80090c4: 28 21 00 2c lw r1,(r1+44) switch ( name ) { 80090c8: 54 43 00 22 bgu r2,r3,8009150 80090cc: 78 03 08 01 mvhi r3,0x801 80090d0: b4 42 10 00 add r2,r2,r2 80090d4: 38 63 36 68 ori r3,r3,0x3668 80090d8: b4 42 10 00 add r2,r2,r2 80090dc: b4 62 10 00 add r2,r3,r2 80090e0: 28 42 00 00 lw r2,(r2+0) 80090e4: c0 40 00 00 b r2 break; case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; break; case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 80090e8: 28 21 00 24 lw r1,(r1+36) rtems_set_errno_and_return_minus_one( EINVAL ); break; } return return_value; } 80090ec: 2b 9d 00 04 lw ra,(sp+4) 80090f0: 37 9c 00 04 addi sp,sp,4 80090f4: c3 a0 00 00 ret break; case _PC_VDISABLE: return_value = the_limits->posix_vdisable; break; case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 80090f8: 28 21 00 18 lw r1,(r1+24) break; 80090fc: e3 ff ff fc bi 80090ec break; case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; break; case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 8009100: 28 21 00 2c lw r1,(r1+44) break; 8009104: e3 ff ff fa bi 80090ec break; case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; break; case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 8009108: 28 21 00 20 lw r1,(r1+32) break; 800910c: e3 ff ff f8 bi 80090ec break; case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; break; case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 8009110: 28 21 00 1c lw r1,(r1+28) break; 8009114: e3 ff ff f6 bi 80090ec break; case _PC_PATH_MAX: return_value = the_limits->path_max; break; case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 8009118: 28 21 00 14 lw r1,(r1+20) break; 800911c: e3 ff ff f4 bi 80090ec break; case _PC_NAME_MAX: return_value = the_limits->name_max; break; case _PC_PATH_MAX: return_value = the_limits->path_max; 8009120: 28 21 00 10 lw r1,(r1+16) break; 8009124: e3 ff ff f2 bi 80090ec break; case _PC_MAX_INPUT: return_value = the_limits->max_input; break; case _PC_NAME_MAX: return_value = the_limits->name_max; 8009128: 28 21 00 0c lw r1,(r1+12) break; 800912c: e3 ff ff f0 bi 80090ec break; case _PC_MAX_CANON: return_value = the_limits->max_canon; break; case _PC_MAX_INPUT: return_value = the_limits->max_input; 8009130: 28 21 00 08 lw r1,(r1+8) break; 8009134: e3 ff ff ee bi 80090ec switch ( name ) { case _PC_LINK_MAX: return_value = the_limits->link_max; break; case _PC_MAX_CANON: return_value = the_limits->max_canon; 8009138: 28 21 00 04 lw r1,(r1+4) break; 800913c: e3 ff ff ec bi 80090ec the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { case _PC_LINK_MAX: return_value = the_limits->link_max; 8009140: 28 21 00 00 lw r1,(r1+0) break; 8009144: e3 ff ff ea bi 80090ec break; case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; break; case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 8009148: 28 21 00 28 lw r1,(r1+40) break; 800914c: e3 ff ff e8 bi 80090ec default: rtems_set_errno_and_return_minus_one( EINVAL ); 8009150: f8 00 0c 12 calli 800c198 <__errno> 8009154: 34 02 00 16 mvi r2,22 8009158: 58 22 00 00 sw (r1+0),r2 800915c: 34 01 ff ff mvi r1,-1 8009160: e3 ff ff e3 bi 80090ec =============================================================================== 08001628 : #include void free( void *ptr ) { 8001628: 37 9c ff f4 addi sp,sp,-12 800162c: 5b 8b 00 0c sw (sp+12),r11 8001630: 5b 8c 00 08 sw (sp+8),r12 8001634: 5b 9d 00 04 sw (sp+4),ra MSBUMP(free_calls, 1); 8001638: 78 03 08 02 mvhi r3,0x802 800163c: 38 63 08 28 ori r3,r3,0x828 8001640: 28 62 00 0c lw r2,(r3+12) #include void free( void *ptr ) { 8001644: b8 20 58 00 mv r11,r1 MSBUMP(free_calls, 1); 8001648: 34 41 00 01 addi r1,r2,1 800164c: 58 61 00 0c sw (r3+12),r1 if ( !ptr ) 8001650: 45 60 00 1a be r11,r0,80016b8 return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 8001654: 78 01 08 02 mvhi r1,0x802 8001658: 38 21 0d d8 ori r1,r1,0xdd8 800165c: 28 22 00 00 lw r2,(r1+0) 8001660: 34 01 00 03 mvi r1,3 8001664: 44 41 00 1a be r2,r1,80016cc <== ALWAYS TAKEN } /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 8001668: 78 01 08 02 mvhi r1,0x802 800166c: 38 21 07 4c ori r1,r1,0x74c 8001670: 28 21 00 00 lw r1,(r1+0) 8001674: 44 20 00 04 be r1,r0,8001684 (*rtems_malloc_statistics_helpers->at_free)(ptr); 8001678: 28 22 00 08 lw r2,(r1+8) 800167c: b9 60 08 00 mv r1,r11 8001680: d8 40 00 00 call r2 if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { 8001684: 78 0c 08 02 mvhi r12,0x802 8001688: 39 8c 00 54 ori r12,r12,0x54 800168c: 29 81 00 00 lw r1,(r12+0) 8001690: b9 60 10 00 mv r2,r11 8001694: f8 00 12 32 calli 8005f5c <_Protected_heap_Free> 8001698: 5c 20 00 08 bne r1,r0,80016b8 printk( "Program heap: free of bad pointer %p -- range %p - %p \n", ptr, RTEMS_Malloc_Heap->area_begin, 800169c: 29 82 00 00 lw r2,(r12+0) */ if ( rtems_malloc_statistics_helpers ) (*rtems_malloc_statistics_helpers->at_free)(ptr); if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) { printk( "Program heap: free of bad pointer %p -- range %p - %p \n", 80016a0: 78 01 08 01 mvhi r1,0x801 80016a4: 38 21 d9 5c ori r1,r1,0xd95c 80016a8: 28 43 00 18 lw r3,(r2+24) 80016ac: 28 44 00 1c lw r4,(r2+28) 80016b0: b9 60 10 00 mv r2,r11 80016b4: f8 00 04 14 calli 8002704 RTEMS_Malloc_Heap->area_begin, RTEMS_Malloc_Heap->area_end ); } } 80016b8: 2b 9d 00 04 lw ra,(sp+4) 80016bc: 2b 8b 00 0c lw r11,(sp+12) 80016c0: 2b 8c 00 08 lw r12,(sp+8) 80016c4: 37 9c 00 0c addi sp,sp,12 80016c8: c3 a0 00 00 ret /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && !malloc_is_system_state_OK() ) { 80016cc: f8 00 00 7a calli 80018b4 return; /* * Do not attempt to free memory if in a critical section or ISR. */ if ( _System_state_Is_up(_System_state_Get()) && 80016d0: 5c 20 ff e6 bne r1,r0,8001668 !malloc_is_system_state_OK() ) { malloc_deferred_free(ptr); 80016d4: b9 60 08 00 mv r1,r11 80016d8: f8 00 00 8f calli 8001914 return; 80016dc: e3 ff ff f7 bi 80016b8 =============================================================================== 0801c270 : int fstat( int fd, struct stat *sbuf ) { 801c270: 37 9c ff f4 addi sp,sp,-12 801c274: 5b 8b 00 0c sw (sp+12),r11 801c278: 5b 8c 00 08 sw (sp+8),r12 801c27c: 5b 9d 00 04 sw (sp+4),ra 801c280: b8 40 58 00 mv r11,r2 rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 801c284: 44 40 00 26 be r2,r0,801c31c <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EFAULT ); /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 801c288: 78 03 08 02 mvhi r3,0x802 801c28c: 38 63 00 10 ori r3,r3,0x10 801c290: 28 62 00 00 lw r2,(r3+0) 801c294: 50 22 00 1d bgeu r1,r2,801c308 801c298: b4 21 60 00 add r12,r1,r1 801c29c: b5 81 60 00 add r12,r12,r1 801c2a0: 78 02 08 02 mvhi r2,0x802 801c2a4: b5 8c 60 00 add r12,r12,r12 801c2a8: b5 8c 60 00 add r12,r12,r12 801c2ac: 38 42 08 1c ori r2,r2,0x81c 801c2b0: c9 81 08 00 sub r1,r12,r1 801c2b4: 28 4c 00 00 lw r12,(r2+0) 801c2b8: b4 21 08 00 add r1,r1,r1 801c2bc: b4 21 08 00 add r1,r1,r1 801c2c0: b5 81 60 00 add r12,r12,r1 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 801c2c4: 29 81 00 08 lw r1,(r12+8) 801c2c8: 20 21 01 00 andi r1,r1,0x100 801c2cc: 44 20 00 0f be r1,r0,801c308 /* * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); 801c2d0: 34 02 00 00 mvi r2,0 801c2d4: 34 03 00 48 mvi r3,72 801c2d8: b9 60 08 00 mv r1,r11 801c2dc: fb ff c7 21 calli 800df60 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 801c2e0: 29 83 00 1c lw r3,(r12+28) 801c2e4: 35 81 00 0c addi r1,r12,12 801c2e8: b9 60 10 00 mv r2,r11 801c2ec: 28 63 00 18 lw r3,(r3+24) 801c2f0: d8 60 00 00 call r3 } 801c2f4: 2b 9d 00 04 lw ra,(sp+4) 801c2f8: 2b 8b 00 0c lw r11,(sp+12) 801c2fc: 2b 8c 00 08 lw r12,(sp+8) 801c300: 37 9c 00 0c addi sp,sp,12 801c304: c3 a0 00 00 ret /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 801c308: fb ff c3 db calli 800d274 <__errno> 801c30c: 34 02 00 09 mvi r2,9 801c310: 58 22 00 00 sw (r1+0),r2 801c314: 34 01 ff ff mvi r1,-1 801c318: e3 ff ff f7 bi 801c2f4 /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) rtems_set_errno_and_return_minus_one( EFAULT ); 801c31c: fb ff c3 d6 calli 800d274 <__errno> <== NOT EXECUTED 801c320: 34 02 00 0e mvi r2,14 <== NOT EXECUTED 801c324: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 801c328: 34 01 ff ff mvi r1,-1 <== NOT EXECUTED 801c32c: e3 ff ff f2 bi 801c2f4 <== NOT EXECUTED =============================================================================== 08008f54 : #include #include int ftruncate( int fd, off_t length ) { 8008f54: 37 9c ff fc addi sp,sp,-4 8008f58: 5b 9d 00 04 sw (sp+4),ra int rv = 0; if ( length >= 0 ) { 8008f5c: 48 02 00 20 bg r0,r2,8008fdc rtems_libio_t *iop; rtems_libio_check_fd( fd ); 8008f60: 78 03 08 02 mvhi r3,0x802 8008f64: 38 63 00 10 ori r3,r3,0x10 8008f68: 28 63 00 00 lw r3,(r3+0) 8008f6c: 54 61 00 06 bgu r3,r1,8008f84 iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); 8008f70: f8 00 10 c1 calli 800d274 <__errno> 8008f74: 34 02 00 09 mvi r2,9 8008f78: 58 22 00 00 sw (r1+0),r2 8008f7c: 34 01 ff ff mvi r1,-1 8008f80: e0 00 00 14 bi 8008fd0 if ( length >= 0 ) { rtems_libio_t *iop; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); 8008f84: b4 21 18 00 add r3,r1,r1 8008f88: b4 61 18 00 add r3,r3,r1 8008f8c: 78 04 08 02 mvhi r4,0x802 8008f90: b4 63 18 00 add r3,r3,r3 8008f94: 38 84 08 1c ori r4,r4,0x81c 8008f98: b4 63 18 00 add r3,r3,r3 8008f9c: c8 61 08 00 sub r1,r3,r1 8008fa0: 28 83 00 00 lw r3,(r4+0) 8008fa4: b4 21 08 00 add r1,r1,r1 8008fa8: b4 21 08 00 add r1,r1,r1 8008fac: b4 61 08 00 add r1,r3,r1 rtems_libio_check_is_open( iop ); 8008fb0: 28 23 00 08 lw r3,(r1+8) 8008fb4: 20 64 01 00 andi r4,r3,0x100 8008fb8: 44 80 ff ee be r4,r0,8008f70 <== NEVER TAKEN rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); 8008fbc: 20 63 00 04 andi r3,r3,0x4 8008fc0: 44 60 00 07 be r3,r0,8008fdc rv = (*iop->pathinfo.handlers->ftruncate_h)( iop, length ); 8008fc4: 28 23 00 1c lw r3,(r1+28) 8008fc8: 28 63 00 1c lw r3,(r3+28) 8008fcc: d8 60 00 00 call r3 errno = EINVAL; rv = -1; } return rv; } 8008fd0: 2b 9d 00 04 lw ra,(sp+4) 8008fd4: 37 9c 00 04 addi sp,sp,4 8008fd8: c3 a0 00 00 ret rtems_libio_check_is_open( iop ); rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); rv = (*iop->pathinfo.handlers->ftruncate_h)( iop, length ); } else { errno = EINVAL; 8008fdc: f8 00 10 a6 calli 800d274 <__errno> 8008fe0: 34 02 00 16 mvi r2,22 8008fe4: 58 22 00 00 sw (r1+0),r2 rv = -1; 8008fe8: 34 01 ff ff mvi r1,-1 } return rv; } 8008fec: 2b 9d 00 04 lw ra,(sp+4) 8008ff0: 37 9c 00 04 addi sp,sp,4 8008ff4: c3 a0 00 00 ret =============================================================================== 080012fc : rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major < disktab_size && disktab != NULL) { 80012fc: 78 04 08 01 mvhi r4,0x801 8001300: 38 84 a7 54 ori r4,r4,0xa754 8001304: 28 85 00 00 lw r5,(r4+0) return dd; } } return NULL; 8001308: 34 04 00 00 mvi r4,0 rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major < disktab_size && disktab != NULL) { 800130c: 50 25 00 05 bgeu r1,r5,8001320 <== NEVER TAKEN 8001310: 78 05 08 01 mvhi r5,0x801 8001314: 38 a5 a7 50 ori r5,r5,0xa750 8001318: 28 a5 00 00 lw r5,(r5+0) 800131c: 5c a0 00 03 bne r5,r0,8001328 <== ALWAYS TAKEN return dd; } } return NULL; } 8001320: b8 80 08 00 mv r1,r4 8001324: c3 a0 00 00 ret rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major < disktab_size && disktab != NULL) { rtems_disk_device_table *dtab = disktab + major; 8001328: b4 21 08 00 add r1,r1,r1 800132c: b4 21 08 00 add r1,r1,r1 8001330: b4 21 08 00 add r1,r1,r1 8001334: b4 a1 08 00 add r1,r5,r1 if (minor < dtab->size && dtab->minor != NULL) { 8001338: 28 25 00 04 lw r5,(r1+4) 800133c: 50 45 ff f9 bgeu r2,r5,8001320 <== NEVER TAKEN 8001340: 28 21 00 00 lw r1,(r1+0) 8001344: 44 20 ff f7 be r1,r0,8001320 <== NEVER TAKEN rtems_disk_device *dd = dtab->minor [minor]; 8001348: b4 42 10 00 add r2,r2,r2 800134c: b4 42 10 00 add r2,r2,r2 8001350: b4 22 08 00 add r1,r1,r2 8001354: 28 24 00 00 lw r4,(r1+0) if (dd != NULL && !lookup_only) { 8001358: 44 80 ff f2 be r4,r0,8001320 800135c: 5c 60 ff f1 bne r3,r0,8001320 if (!dd->deleted) { 8001360: 40 81 00 40 lbu r1,(r4+64) 8001364: 5c 23 00 05 bne r1,r3,8001378 ++dd->uses; 8001368: 28 81 00 14 lw r1,(r4+20) 800136c: 34 21 00 01 addi r1,r1,1 8001370: 58 81 00 14 sw (r4+20),r1 8001374: e3 ff ff eb bi 8001320 } else { dd = NULL; 8001378: 34 04 00 00 mvi r4,0 800137c: e3 ff ff e9 bi 8001320 =============================================================================== 08003140 : */ static rtems_status_code get_sector(int fd, uint32_t sector_num, rtems_sector_data_t **sector) { 8003140: 37 9c ff ec addi sp,sp,-20 8003144: 5b 8b 00 14 sw (sp+20),r11 8003148: 5b 8c 00 10 sw (sp+16),r12 800314c: 5b 8d 00 0c sw (sp+12),r13 8003150: 5b 8e 00 08 sw (sp+8),r14 8003154: 5b 9d 00 04 sw (sp+4),ra off_t off; off_t new_off; if (sector == NULL) { return RTEMS_INTERNAL_ERROR; 8003158: 34 04 00 19 mvi r4,25 */ static rtems_status_code get_sector(int fd, uint32_t sector_num, rtems_sector_data_t **sector) { 800315c: b8 60 60 00 mv r12,r3 8003160: b8 20 68 00 mv r13,r1 8003164: b8 40 70 00 mv r14,r2 rtems_sector_data_t *s; ssize_t n; off_t off; off_t new_off; if (sector == NULL) 8003168: 44 60 00 0b be r3,r0,8003194 <== NEVER TAKEN { return RTEMS_INTERNAL_ERROR; } off = sector_num * RTEMS_IDE_SECTOR_SIZE; 800316c: b8 40 08 00 mv r1,r2 8003170: 34 02 00 09 mvi r2,9 8003174: f8 00 8c 95 calli 80263c8 <__ashlsi3> 8003178: b8 20 58 00 mv r11,r1 new_off = lseek(fd, off, SEEK_SET); 800317c: b9 60 10 00 mv r2,r11 8003180: b9 a0 08 00 mv r1,r13 8003184: 34 03 00 00 mvi r3,0 8003188: f8 00 05 b5 calli 800485c if (new_off != off) { return RTEMS_IO_ERROR; 800318c: 34 04 00 1b mvi r4,27 return RTEMS_INTERNAL_ERROR; } off = sector_num * RTEMS_IDE_SECTOR_SIZE; new_off = lseek(fd, off, SEEK_SET); if (new_off != off) { 8003190: 44 2b 00 09 be r1,r11,80031b4 <== ALWAYS TAKEN s->sector_num = sector_num; *sector = s; return RTEMS_SUCCESSFUL; } 8003194: b8 80 08 00 mv r1,r4 8003198: 2b 9d 00 04 lw ra,(sp+4) 800319c: 2b 8b 00 14 lw r11,(sp+20) 80031a0: 2b 8c 00 10 lw r12,(sp+16) 80031a4: 2b 8d 00 0c lw r13,(sp+12) 80031a8: 2b 8e 00 08 lw r14,(sp+8) 80031ac: 37 9c 00 14 addi sp,sp,20 80031b0: c3 a0 00 00 ret new_off = lseek(fd, off, SEEK_SET); if (new_off != off) { return RTEMS_IO_ERROR; } s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE); 80031b4: 34 01 02 04 mvi r1,516 80031b8: f8 00 06 30 calli 8004a78 80031bc: b8 20 58 00 mv r11,r1 if (s == NULL) { return RTEMS_NO_MEMORY; 80031c0: 34 04 00 1a mvi r4,26 if (new_off != off) { return RTEMS_IO_ERROR; } s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE); if (s == NULL) 80031c4: 44 20 ff f4 be r1,r0,8003194 <== NEVER TAKEN { return RTEMS_NO_MEMORY; } n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); 80031c8: 35 62 00 04 addi r2,r11,4 80031cc: b9 a0 08 00 mv r1,r13 80031d0: 34 03 02 00 mvi r3,512 80031d4: f8 00 09 41 calli 80056d8 if (n != RTEMS_IDE_SECTOR_SIZE) 80031d8: 34 02 02 00 mvi r2,512 80031dc: 44 22 00 0c be r1,r2,800320c <== ALWAYS TAKEN { free(s); 80031e0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 80031e4: f8 00 04 31 calli 80042a8 <== NOT EXECUTED return RTEMS_IO_ERROR; 80031e8: 34 04 00 1b mvi r4,27 <== NOT EXECUTED s->sector_num = sector_num; *sector = s; return RTEMS_SUCCESSFUL; } 80031ec: b8 80 08 00 mv r1,r4 <== NOT EXECUTED 80031f0: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 80031f4: 2b 8b 00 14 lw r11,(sp+20) <== NOT EXECUTED 80031f8: 2b 8c 00 10 lw r12,(sp+16) <== NOT EXECUTED 80031fc: 2b 8d 00 0c lw r13,(sp+12) <== NOT EXECUTED 8003200: 2b 8e 00 08 lw r14,(sp+8) <== NOT EXECUTED 8003204: 37 9c 00 14 addi sp,sp,20 <== NOT EXECUTED 8003208: c3 a0 00 00 ret <== NOT EXECUTED { free(s); return RTEMS_IO_ERROR; } s->sector_num = sector_num; 800320c: 59 6e 00 00 sw (r11+0),r14 *sector = s; 8003210: 59 8b 00 00 sw (r12+0),r11 return RTEMS_SUCCESSFUL; 8003214: 34 04 00 00 mvi r4,0 8003218: e3 ff ff df bi 8003194 =============================================================================== 080373f8 : int getdents( int dd_fd, char *dd_buf, int dd_len ) { 80373f8: 37 9c ff f0 addi sp,sp,-16 80373fc: 5b 8b 00 10 sw (sp+16),r11 8037400: 5b 8c 00 0c sw (sp+12),r12 8037404: 5b 8d 00 08 sw (sp+8),r13 8037408: 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 ); 803740c: 78 04 08 03 mvhi r4,0x803 8037410: 38 84 e0 14 ori r4,r4,0xe014 8037414: 28 84 00 00 lw r4,(r4+0) int getdents( int dd_fd, char *dd_buf, int dd_len ) { 8037418: b8 40 68 00 mv r13,r2 803741c: 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 ); 8037420: 34 0b 00 00 mvi r11,0 8037424: 50 24 00 0c bgeu r1,r4,8037454 <== NEVER TAKEN 8037428: b4 21 58 00 add r11,r1,r1 803742c: b5 61 58 00 add r11,r11,r1 8037430: 78 04 08 04 mvhi r4,0x804 8037434: b5 6b 58 00 add r11,r11,r11 8037438: b5 6b 58 00 add r11,r11,r11 803743c: 38 84 e9 8c ori r4,r4,0xe98c 8037440: c9 61 08 00 sub r1,r11,r1 8037444: 28 8b 00 00 lw r11,(r4+0) 8037448: b4 21 08 00 add r1,r1,r1 803744c: b4 21 08 00 add r1,r1,r1 8037450: b5 61 58 00 add r11,r11,r1 /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); 8037454: 35 61 00 0c addi r1,r11,12 8037458: fb ff 47 f1 calli 800941c if ( type != RTEMS_FILESYSTEM_DIRECTORY ) 803745c: 5c 20 00 0d bne r1,r0,8037490 /* * 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 ); 8037460: 29 63 00 1c lw r3,(r11+28) 8037464: b9 60 08 00 mv r1,r11 8037468: b9 a0 10 00 mv r2,r13 803746c: 28 64 00 08 lw r4,(r3+8) 8037470: b9 80 18 00 mv r3,r12 8037474: d8 80 00 00 call r4 } 8037478: 2b 9d 00 04 lw ra,(sp+4) 803747c: 2b 8b 00 10 lw r11,(sp+16) 8037480: 2b 8c 00 0c lw r12,(sp+12) 8037484: 2b 8d 00 08 lw r13,(sp+8) 8037488: 37 9c 00 10 addi sp,sp,16 803748c: c3 a0 00 00 ret /* * Make sure we are working on a directory */ type = rtems_filesystem_node_type( &iop->pathinfo ); if ( type != RTEMS_FILESYSTEM_DIRECTORY ) rtems_set_errno_and_return_minus_one( ENOTDIR ); 8037490: fb ff b1 2d calli 8023944 <__errno> 8037494: 34 02 00 14 mvi r2,20 8037498: 58 22 00 00 sw (r1+0),r2 803749c: 34 01 ff ff mvi r1,-1 80374a0: e3 ff ff f6 bi 8037478 =============================================================================== 0800c340 : ssize_t imfs_dir_read( rtems_libio_t *iop, void *buffer, size_t count ) { 800c340: 37 9c fe c0 addi sp,sp,-320 800c344: 5b 8b 00 34 sw (sp+52),r11 800c348: 5b 8c 00 30 sw (sp+48),r12 800c34c: 5b 8d 00 2c sw (sp+44),r13 800c350: 5b 8e 00 28 sw (sp+40),r14 800c354: 5b 8f 00 24 sw (sp+36),r15 800c358: 5b 90 00 20 sw (sp+32),r16 800c35c: 5b 91 00 1c sw (sp+28),r17 800c360: 5b 92 00 18 sw (sp+24),r18 800c364: 5b 93 00 14 sw (sp+20),r19 800c368: 5b 94 00 10 sw (sp+16),r20 800c36c: 5b 95 00 0c sw (sp+12),r21 800c370: 5b 96 00 08 sw (sp+8),r22 800c374: 5b 9d 00 04 sw (sp+4),ra 800c378: b8 20 68 00 mv r13,r1 } rtems_filesystem_instance_unlock( &iop->pathinfo ); return bytes_transferred; } 800c37c: 28 21 00 20 lw r1,(r1+32) ssize_t imfs_dir_read( rtems_libio_t *iop, void *buffer, size_t count ) { 800c380: b8 40 98 00 mv r19,r2 800c384: b8 60 58 00 mv r11,r3 const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->lock_h)( mt_entry ); 800c388: 28 22 00 0c lw r2,(r1+12) the_jnode = (IMFS_jnode_t *)iop->pathinfo.node_access; the_chain = &the_jnode->info.directory.Entries; /* Move to the first of the desired directory entries */ bytes_transferred = 0; 800c38c: 34 0e 00 00 mvi r14,0 800c390: 28 42 00 00 lw r2,(r2+0) 800c394: d8 40 00 00 call r2 first_entry = iop->offset; /* protect against using sizes that are not exact multiples of the */ /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); 800c398: b9 60 08 00 mv r1,r11 800c39c: 34 02 01 0c mvi r2,268 800c3a0: f8 00 3f 1a calli 801c008 <__udivsi3> 800c3a4: b4 21 20 00 add r4,r1,r1 800c3a8: b4 84 20 00 add r4,r4,r4 800c3ac: b4 84 18 00 add r3,r4,r4 800c3b0: b4 63 18 00 add r3,r3,r3 800c3b4: b4 63 18 00 add r3,r3,r3 800c3b8: b4 63 18 00 add r3,r3,r3 800c3bc: b4 83 80 00 add r16,r4,r3 the_chain = &the_jnode->info.directory.Entries; /* Move to the first of the desired directory entries */ bytes_transferred = 0; first_entry = iop->offset; 800c3c0: 29 af 00 04 lw r15,(r13+4) /* protect against using sizes that are not exact multiples of the */ /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); 800c3c4: ca 01 80 00 sub r16,r16,r1 int last_entry; struct dirent tmp_dirent; rtems_filesystem_instance_lock( &iop->pathinfo ); the_jnode = (IMFS_jnode_t *)iop->pathinfo.node_access; 800c3c8: 29 b1 00 14 lw r17,(r13+20) bytes_transferred = 0; first_entry = iop->offset; /* protect against using sizes that are not exact multiples of the */ /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); 800c3cc: b6 10 80 00 add r16,r16,r16 800c3d0: b6 10 80 00 add r16,r16,r16 800c3d4: b6 0f 80 00 add r16,r16,r15 } rtems_filesystem_instance_unlock( &iop->pathinfo ); return bytes_transferred; } 800c3d8: 2a 2c 00 50 lw r12,(r17+80) /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); /* The directory was not empty so try to move to the desired entry in chain*/ for ( 800c3dc: 4c 10 00 1f bge r0,r16,800c458 <== NEVER TAKEN RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 800c3e0: 36 31 00 54 addi r17,r17,84 current_entry = 0, the_node = rtems_chain_first( the_chain ); current_entry < last_entry && !rtems_chain_is_tail( the_chain, the_node ); 800c3e4: 45 91 00 1d be r12,r17,800c458 800c3e8: 34 0b 00 00 mvi r11,0 the_node = rtems_chain_next( the_node ) ) { if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; tmp_dirent.d_reclen = sizeof( struct dirent ); 800c3ec: 34 16 01 0c mvi r22,268 the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; tmp_dirent.d_namlen = strlen( the_jnode->name ); strcpy( tmp_dirent.d_name, the_jnode->name ); 800c3f0: 37 95 00 38 addi r21,sp,56 800c3f4: 37 94 00 44 addi r20,sp,68 current_entry < last_entry && !rtems_chain_is_tail( the_chain, the_node ); current_entry += sizeof( struct dirent ), the_node = rtems_chain_next( the_node ) ) { if( current_entry >= first_entry ) { 800c3f8: 49 eb 00 14 bg r15,r11,800c448 /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; tmp_dirent.d_reclen = sizeof( struct dirent ); the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; 800c3fc: 29 82 00 38 lw r2,(r12+56) tmp_dirent.d_namlen = strlen( the_jnode->name ); 800c400: 35 92 00 0c addi r18,r12,12 800c404: ba 40 08 00 mv r1,r18 if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; tmp_dirent.d_reclen = sizeof( struct dirent ); the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; 800c408: 5b 82 00 38 sw (sp+56),r2 current_entry += sizeof( struct dirent ), the_node = rtems_chain_next( the_node ) ) { if( current_entry >= first_entry ) { /* Move the entry to the return buffer */ tmp_dirent.d_off = current_entry; 800c40c: 5b 8b 00 3c sw (sp+60),r11 tmp_dirent.d_reclen = sizeof( struct dirent ); 800c410: 0f 96 00 40 sh (sp+64),r22 the_jnode = (IMFS_jnode_t *) the_node; tmp_dirent.d_ino = the_jnode->st_ino; tmp_dirent.d_namlen = strlen( the_jnode->name ); 800c414: f8 00 09 dd calli 800eb88 800c418: 0f 81 00 42 sh (sp+66),r1 strcpy( tmp_dirent.d_name, the_jnode->name ); 800c41c: ba 40 10 00 mv r2,r18 800c420: ba 80 08 00 mv r1,r20 800c424: f8 00 08 90 calli 800e664 memcpy( 800c428: b6 6e 08 00 add r1,r19,r14 800c42c: 34 03 01 0c mvi r3,268 800c430: ba a0 10 00 mv r2,r21 800c434: f8 00 06 8a calli 800de5c buffer + bytes_transferred, (void *)&tmp_dirent, sizeof( struct dirent ) ); iop->offset += sizeof( struct dirent ); 800c438: 29 a3 00 04 lw r3,(r13+4) bytes_transferred += sizeof( struct dirent ); 800c43c: 35 ce 01 0c addi r14,r14,268 memcpy( buffer + bytes_transferred, (void *)&tmp_dirent, sizeof( struct dirent ) ); iop->offset += sizeof( struct dirent ); 800c440: 34 63 01 0c addi r3,r3,268 800c444: 59 a3 00 04 sw (r13+4),r3 #include "imfs.h" #include #include ssize_t imfs_dir_read( 800c448: 35 6b 01 0c addi r11,r11,268 } rtems_filesystem_instance_unlock( &iop->pathinfo ); return bytes_transferred; } 800c44c: 29 8c 00 00 lw r12,(r12+0) /* -dirent- size. These could result in unexpected results */ last_entry = first_entry + (count / sizeof( struct dirent )) * sizeof( struct dirent ); /* The directory was not empty so try to move to the desired entry in chain*/ for ( 800c450: 4d 70 00 02 bge r11,r16,800c458 current_entry = 0, the_node = rtems_chain_first( the_chain ); current_entry < last_entry && !rtems_chain_is_tail( the_chain, the_node ); 800c454: 5d 91 ff e9 bne r12,r17,800c3f8 } rtems_filesystem_instance_unlock( &iop->pathinfo ); return bytes_transferred; } 800c458: 29 a1 00 20 lw r1,(r13+32) const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->unlock_h)( mt_entry ); 800c45c: 28 22 00 0c lw r2,(r1+12) 800c460: 28 42 00 04 lw r2,(r2+4) 800c464: d8 40 00 00 call r2 800c468: b9 c0 08 00 mv r1,r14 800c46c: 2b 9d 00 04 lw ra,(sp+4) 800c470: 2b 8b 00 34 lw r11,(sp+52) 800c474: 2b 8c 00 30 lw r12,(sp+48) 800c478: 2b 8d 00 2c lw r13,(sp+44) 800c47c: 2b 8e 00 28 lw r14,(sp+40) 800c480: 2b 8f 00 24 lw r15,(sp+36) 800c484: 2b 90 00 20 lw r16,(sp+32) 800c488: 2b 91 00 1c lw r17,(sp+28) 800c48c: 2b 92 00 18 lw r18,(sp+24) 800c490: 2b 93 00 14 lw r19,(sp+20) 800c494: 2b 94 00 10 lw r20,(sp+16) 800c498: 2b 95 00 0c lw r21,(sp+12) 800c49c: 2b 96 00 08 lw r22,(sp+8) 800c4a0: 37 9c 01 40 addi sp,sp,320 800c4a4: c3 a0 00 00 ret =============================================================================== 08026114 : /** * Initialize useable but dummy databases */ void init_etc_passwd_group(void) { 8026114: 37 9c ff ec addi sp,sp,-20 8026118: 5b 8b 00 14 sw (sp+20),r11 802611c: 5b 8c 00 10 sw (sp+16),r12 8026120: 5b 8d 00 0c sw (sp+12),r13 8026124: 5b 8e 00 08 sw (sp+8),r14 8026128: 5b 9d 00 04 sw (sp+4),ra FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) 802612c: 78 03 08 06 mvhi r3,0x806 8026130: 38 63 ec 50 ori r3,r3,0xec50 8026134: 40 6d 00 00 lbu r13,(r3+0) 8026138: 45 a0 00 08 be r13,r0,8026158 fprintf( fp, "root:x:0:root\n" "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); } } 802613c: 2b 9d 00 04 lw ra,(sp+4) 8026140: 2b 8b 00 14 lw r11,(sp+20) 8026144: 2b 8c 00 10 lw r12,(sp+16) 8026148: 2b 8d 00 0c lw r13,(sp+12) 802614c: 2b 8e 00 08 lw r14,(sp+8) 8026150: 37 9c 00 14 addi sp,sp,20 8026154: c3 a0 00 00 ret FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; 8026158: 34 04 00 01 mvi r4,1 mkdir("/etc", 0777); 802615c: 78 01 08 06 mvhi r1,0x806 8026160: 34 02 01 ff mvi r2,511 FILE *fp; static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; 8026164: 30 64 00 00 sb (r3+0),r4 mkdir("/etc", 0777); 8026168: 38 21 4c a4 ori r1,r1,0x4ca4 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 802616c: 78 0c 08 06 mvhi r12,0x806 8026170: 78 0b 08 06 mvhi r11,0x806 static char etc_passwd_initted = 0; if (etc_passwd_initted) return; etc_passwd_initted = 1; mkdir("/etc", 0777); 8026174: fb ff 6d 27 calli 8001610 /* * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { 8026178: 39 8c 4c ac ori r12,r12,0x4cac 802617c: 39 6b 3c a8 ori r11,r11,0x3ca8 8026180: b9 80 08 00 mv r1,r12 8026184: b9 60 10 00 mv r2,r11 8026188: f8 00 60 ea calli 803e530 802618c: b8 20 70 00 mv r14,r1 8026190: 44 2d 00 20 be r1,r13,8026210 } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 8026194: f8 00 5d fa calli 803d97c } /* * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { 8026198: 78 0c 08 06 mvhi r12,0x806 802619c: 39 8c 4d 20 ori r12,r12,0x4d20 80261a0: b9 60 10 00 mv r2,r11 80261a4: b9 80 08 00 mv r1,r12 80261a8: f8 00 60 e2 calli 803e530 80261ac: b8 20 58 00 mv r11,r1 80261b0: 44 20 00 09 be r1,r0,80261d4 } else if ((fp = fopen("/etc/group", "w")) != NULL) { fprintf( fp, "root:x:0:root\n" "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 80261b4: f8 00 5d f2 calli 803d97c } } 80261b8: 2b 9d 00 04 lw ra,(sp+4) 80261bc: 2b 8b 00 14 lw r11,(sp+20) 80261c0: 2b 8c 00 10 lw r12,(sp+16) 80261c4: 2b 8d 00 0c lw r13,(sp+12) 80261c8: 2b 8e 00 08 lw r14,(sp+8) 80261cc: 37 9c 00 14 addi sp,sp,20 80261d0: c3 a0 00 00 ret * Initialize /etc/group */ if ((fp = fopen("/etc/group", "r")) != NULL) { fclose(fp); } else if ((fp = fopen("/etc/group", "w")) != NULL) { 80261d4: 78 02 08 05 mvhi r2,0x805 80261d8: b9 80 08 00 mv r1,r12 80261dc: 38 42 fe d0 ori r2,r2,0xfed0 80261e0: f8 00 60 d4 calli 803e530 80261e4: b8 20 60 00 mv r12,r1 80261e8: 44 2b ff d5 be r1,r11,802613c <== NEVER TAKEN fprintf( fp, "root:x:0:root\n" 80261ec: 78 01 08 06 mvhi r1,0x806 80261f0: 34 02 00 01 mvi r2,1 80261f4: 34 03 00 2a mvi r3,42 80261f8: b9 80 20 00 mv r4,r12 80261fc: 38 21 4d 2c ori r1,r1,0x4d2c 8026200: f8 00 66 06 calli 803fa18 "rtems:x:1:rtems\n" "tty:x:2:tty\n" ); fclose(fp); 8026204: b9 80 08 00 mv r1,r12 8026208: f8 00 5d dd calli 803d97c 802620c: e3 ff ff eb bi 80261b8 * Initialize /etc/passwd */ if ((fp = fopen("/etc/passwd", "r")) != NULL) { fclose(fp); } else if ((fp = fopen("/etc/passwd", "w")) != NULL) { 8026210: 78 02 08 05 mvhi r2,0x805 8026214: b9 80 08 00 mv r1,r12 8026218: 38 42 fe d0 ori r2,r2,0xfed0 802621c: f8 00 60 c5 calli 803e530 8026220: b8 20 60 00 mv r12,r1 8026224: 44 2e ff dd be r1,r14,8026198 <== NEVER TAKEN fprintf(fp, "root:*:0:0:root::/:/bin/sh\n" 8026228: 78 01 08 06 mvhi r1,0x806 802622c: 38 21 4c b8 ori r1,r1,0x4cb8 8026230: 34 02 00 01 mvi r2,1 8026234: 34 03 00 66 mvi r3,102 8026238: b9 80 20 00 mv r4,r12 802623c: f8 00 65 f7 calli 803fa18 "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" "tty:!:2:2:tty owner::/:/bin/false\n" ); fclose(fp); 8026240: b9 80 08 00 mv r1,r12 8026244: e3 ff ff d4 bi 8026194 =============================================================================== 0800557c : /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 800557c: 37 9c ff f4 addi sp,sp,-12 8005580: 5b 8b 00 0c sw (sp+12),r11 8005584: 5b 8c 00 08 sw (sp+8),r12 8005588: 5b 9d 00 04 sw (sp+4),ra 800558c: b8 40 60 00 mv r12,r2 if (tty->termios.c_iflag & ISTRIP) 8005590: 28 42 00 30 lw r2,(r2+48) /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 8005594: b8 20 58 00 mv r11,r1 if (tty->termios.c_iflag & ISTRIP) 8005598: 20 41 00 20 andi r1,r2,0x20 800559c: 44 20 00 02 be r1,r0,80055a4 <== ALWAYS TAKEN c &= 0x7f; 80055a0: 21 6b 00 7f andi r11,r11,0x7f <== NOT EXECUTED if (tty->termios.c_iflag & IUCLC) 80055a4: 20 41 02 00 andi r1,r2,0x200 80055a8: 44 20 00 0b be r1,r0,80055d4 c = tolower (c); 80055ac: 78 01 08 02 mvhi r1,0x802 80055b0: 38 21 82 e0 ori r1,r1,0x82e0 80055b4: 28 23 00 00 lw r3,(r1+0) 80055b8: b9 60 08 00 mv r1,r11 80055bc: b4 6b 58 00 add r11,r3,r11 80055c0: 41 64 00 01 lbu r4,(r11+1) 80055c4: 34 03 00 01 mvi r3,1 80055c8: 20 84 00 03 andi r4,r4,0x3 80055cc: 44 83 00 40 be r4,r3,80056cc 80055d0: 20 2b 00 ff andi r11,r1,0xff if (c == '\r') { 80055d4: 34 01 00 0d mvi r1,13 80055d8: 45 61 00 19 be r11,r1,800563c if (tty->termios.c_iflag & IGNCR) return 0; if (tty->termios.c_iflag & ICRNL) c = '\n'; } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 80055dc: 34 01 00 0a mvi r1,10 80055e0: 45 61 00 37 be r11,r1,80056bc c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 80055e4: 5d 60 00 1c bne r11,r0,8005654 <== ALWAYS TAKEN } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 80055e8: 78 01 08 02 mvhi r1,0x802 80055ec: 38 21 81 40 ori r1,r1,0x8140 80055f0: 28 23 00 00 lw r3,(r1+0) 80055f4: 29 82 00 20 lw r2,(r12+32) if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; 80055f8: 34 01 00 00 mvi r1,0 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 80055fc: 34 63 ff ff addi r3,r3,-1 8005600: 50 43 00 0a bgeu r2,r3,8005628 <== NEVER TAKEN if (tty->termios.c_lflag & ECHO) 8005604: 29 81 00 3c lw r1,(r12+60) 8005608: 20 21 00 08 andi r1,r1,0x8 800560c: 5c 20 00 32 bne r1,r0,80056d4 <== ALWAYS TAKEN echo (c, tty); tty->cbuf[tty->ccount++] = c; 8005610: 29 84 00 1c lw r4,(r12+28) 8005614: 34 43 00 01 addi r3,r2,1 } return 0; 8005618: 34 01 00 00 mvi r1,0 * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; 800561c: b4 82 10 00 add r2,r4,r2 8005620: 30 4b 00 00 sb (r2+0),r11 8005624: 59 83 00 20 sw (r12+32),r3 } return 0; } 8005628: 2b 9d 00 04 lw ra,(sp+4) 800562c: 2b 8b 00 0c lw r11,(sp+12) 8005630: 2b 8c 00 08 lw r12,(sp+8) 8005634: 37 9c 00 0c addi sp,sp,12 8005638: c3 a0 00 00 ret if (tty->termios.c_iflag & IUCLC) c = tolower (c); if (c == '\r') { if (tty->termios.c_iflag & IGNCR) 800563c: 20 43 00 80 andi r3,r2,0x80 return 0; 8005640: 34 01 00 00 mvi r1,0 if (tty->termios.c_iflag & IUCLC) c = tolower (c); if (c == '\r') { if (tty->termios.c_iflag & IGNCR) 8005644: 5c 60 ff f9 bne r3,r0,8005628 <== NEVER TAKEN return 0; if (tty->termios.c_iflag & ICRNL) 8005648: 20 42 01 00 andi r2,r2,0x100 800564c: 44 43 00 02 be r2,r3,8005654 <== NEVER TAKEN c = '\n'; 8005650: 34 0b 00 0a mvi r11,10 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 8005654: 29 82 00 3c lw r2,(r12+60) 8005658: 20 41 00 02 andi r1,r2,0x2 800565c: 44 20 ff e3 be r1,r0,80055e8 if (c == tty->termios.c_cc[VERASE]) { 8005660: 41 81 00 43 lbu r1,(r12+67) 8005664: 44 2b 00 37 be r1,r11,8005740 erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { 8005668: 41 81 00 44 lbu r1,(r12+68) 800566c: 44 2b 00 23 be r1,r11,80056f8 erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { 8005670: 41 83 00 45 lbu r3,(r12+69) return 1; 8005674: 34 01 00 01 mvi r1,1 } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { 8005678: 44 6b ff ec be r3,r11,8005628 <== NEVER TAKEN return 1; } else if (c == '\n') { 800567c: 34 01 00 0a mvi r1,10 8005680: 45 61 00 23 be r11,r1,800570c if (tty->termios.c_lflag & (ECHO | ECHONL)) echo (c, tty); tty->cbuf[tty->ccount++] = c; return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 8005684: 41 81 00 4c lbu r1,(r12+76) 8005688: 44 2b 00 03 be r1,r11,8005694 <== NEVER TAKEN 800568c: 41 81 00 51 lbu r1,(r12+81) 8005690: 5c 2b ff d6 bne r1,r11,80055e8 <== ALWAYS TAKEN (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 8005694: 20 42 00 08 andi r2,r2,0x8 <== NOT EXECUTED 8005698: 5c 40 00 14 bne r2,r0,80056e8 <== NOT EXECUTED echo (c, tty); tty->cbuf[tty->ccount++] = c; 800569c: 29 83 00 20 lw r3,(r12+32) <== NOT EXECUTED 80056a0: 29 84 00 1c lw r4,(r12+28) <== NOT EXECUTED return 1; 80056a4: 34 01 00 01 mvi r1,1 <== NOT EXECUTED return 1; } else if ((c == tty->termios.c_cc[VEOL]) || (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; 80056a8: 34 62 00 01 addi r2,r3,1 <== NOT EXECUTED 80056ac: b4 83 18 00 add r3,r4,r3 <== NOT EXECUTED 80056b0: 30 6b 00 00 sb (r3+0),r11 <== NOT EXECUTED 80056b4: 59 82 00 20 sw (r12+32),r2 <== NOT EXECUTED return 1; 80056b8: e3 ff ff dc bi 8005628 <== NOT EXECUTED if (c == '\r') { if (tty->termios.c_iflag & IGNCR) return 0; if (tty->termios.c_iflag & ICRNL) c = '\n'; } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 80056bc: 20 42 00 40 andi r2,r2,0x40 80056c0: 44 40 ff e5 be r2,r0,8005654 <== ALWAYS TAKEN c = '\r'; 80056c4: 34 0b 00 0d mvi r11,13 <== NOT EXECUTED 80056c8: e3 ff ff e3 bi 8005654 <== NOT EXECUTED { if (tty->termios.c_iflag & ISTRIP) c &= 0x7f; if (tty->termios.c_iflag & IUCLC) c = tolower (c); 80056cc: 34 21 00 20 addi r1,r1,32 80056d0: e3 ff ff c0 bi 80055d0 /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); 80056d4: b9 80 10 00 mv r2,r12 80056d8: b9 60 08 00 mv r1,r11 80056dc: fb ff fe f7 calli 80052b8 80056e0: 29 82 00 20 lw r2,(r12+32) 80056e4: e3 ff ff cb bi 8005610 tty->cbuf[tty->ccount++] = c; return 1; } else if ((c == tty->termios.c_cc[VEOL]) || (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) echo (c, tty); 80056e8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 80056ec: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 80056f0: fb ff fe f2 calli 80052b8 <== NOT EXECUTED 80056f4: e3 ff ff ea bi 800569c <== NOT EXECUTED if (c == tty->termios.c_cc[VERASE]) { erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); 80056f8: b9 80 08 00 mv r1,r12 80056fc: 34 02 00 01 mvi r2,1 8005700: fb ff ff 16 calli 8005358 return 0; 8005704: 34 01 00 00 mvi r1,0 8005708: e3 ff ff c8 bi 8005628 } else if (c == tty->termios.c_cc[VEOF]) { return 1; } else if (c == '\n') { if (tty->termios.c_lflag & (ECHO | ECHONL)) 800570c: 20 42 00 48 andi r2,r2,0x48 8005710: 44 40 00 03 be r2,r0,800571c <== NEVER TAKEN echo (c, tty); 8005714: b9 80 10 00 mv r2,r12 8005718: fb ff fe e8 calli 80052b8 tty->cbuf[tty->ccount++] = c; 800571c: 29 82 00 20 lw r2,(r12+32) 8005720: 29 83 00 1c lw r3,(r12+28) 8005724: 34 41 00 01 addi r1,r2,1 8005728: b4 62 10 00 add r2,r3,r2 800572c: 34 03 00 0a mvi r3,10 8005730: 30 43 00 00 sb (r2+0),r3 8005734: 59 81 00 20 sw (r12+32),r1 return 1; 8005738: 34 01 00 01 mvi r1,1 800573c: e3 ff ff bb bi 8005628 c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { if (c == tty->termios.c_cc[VERASE]) { erase (tty, 0); 8005740: b9 80 08 00 mv r1,r12 8005744: 34 02 00 00 mvi r2,0 8005748: fb ff ff 04 calli 8005358 return 0; 800574c: 34 01 00 00 mvi r1,0 8005750: e3 ff ff b6 bi 8005628 =============================================================================== 0801c764 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 801c764: 37 9c ff d8 addi sp,sp,-40 801c768: 5b 8b 00 1c sw (sp+28),r11 801c76c: 5b 8c 00 18 sw (sp+24),r12 801c770: 5b 8d 00 14 sw (sp+20),r13 801c774: 5b 8e 00 10 sw (sp+16),r14 801c778: 5b 8f 00 0c sw (sp+12),r15 801c77c: 5b 90 00 08 sw (sp+8),r16 801c780: 5b 9d 00 04 sw (sp+4),ra 801c784: b8 20 58 00 mv r11,r1 801c788: b8 40 60 00 mv r12,r2 801c78c: b8 60 70 00 mv r14,r3 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 801c790: fb ff fe f0 calli 801c350 801c794: 5c 2b 00 a8 bne r1,r11,801ca34 rtems_set_errno_and_return_minus_one( ESRCH ); /* * Validate the signal passed. */ if ( !sig ) 801c798: 45 80 00 04 be r12,r0,801c7a8 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 801c79c: 35 82 ff ff addi r2,r12,-1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 801c7a0: 34 01 00 1f mvi r1,31 801c7a4: 50 22 00 0e bgeu r1,r2,801c7dc rtems_set_errno_and_return_minus_one( EINVAL ); 801c7a8: fb ff c2 b3 calli 800d274 <__errno> 801c7ac: 34 02 00 16 mvi r2,22 801c7b0: 58 22 00 00 sw (r1+0),r2 801c7b4: 34 01 ff ff mvi r1,-1 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 801c7b8: 2b 9d 00 04 lw ra,(sp+4) 801c7bc: 2b 8b 00 1c lw r11,(sp+28) 801c7c0: 2b 8c 00 18 lw r12,(sp+24) 801c7c4: 2b 8d 00 14 lw r13,(sp+20) 801c7c8: 2b 8e 00 10 lw r14,(sp+16) 801c7cc: 2b 8f 00 0c lw r15,(sp+12) 801c7d0: 2b 90 00 08 lw r16,(sp+8) 801c7d4: 37 9c 00 28 addi sp,sp,40 801c7d8: c3 a0 00 00 ret 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 ) 801c7dc: b5 8c 80 00 add r16,r12,r12 801c7e0: b6 0c 08 00 add r1,r16,r12 801c7e4: 78 0d 08 02 mvhi r13,0x802 801c7e8: b4 21 08 00 add r1,r1,r1 801c7ec: 39 ad 0e 68 ori r13,r13,0xe68 801c7f0: b4 21 08 00 add r1,r1,r1 801c7f4: b5 a1 08 00 add r1,r13,r1 801c7f8: 28 23 00 08 lw r3,(r1+8) 801c7fc: 34 0f 00 01 mvi r15,1 return 0; 801c800: 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 ) 801c804: 44 6f ff ed be r3,r15,801c7b8 /* * 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 ) ) 801c808: 65 83 00 04 cmpei r3,r12,4 801c80c: 65 81 00 08 cmpei r1,r12,8 801c810: b8 61 08 00 or r1,r3,r1 801c814: 5c 20 00 42 bne r1,r0,801c91c 801c818: 34 01 00 0b mvi r1,11 801c81c: 45 81 00 40 be r12,r1,801c91c static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 801c820: 34 01 00 01 mvi r1,1 801c824: fb ff fd 1f calli 801bca0 <__ashlsi3> /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 801c828: 5b 8c 00 20 sw (sp+32),r12 siginfo->si_code = SI_USER; 801c82c: 5b 8f 00 24 sw (sp+36),r15 801c830: b8 20 58 00 mv r11,r1 if ( !value ) { 801c834: 45 c0 00 3e be r14,r0,801c92c siginfo->si_value.sival_int = 0; } else { siginfo->si_value = *value; 801c838: 29 c1 00 00 lw r1,(r14+0) 801c83c: 5b 81 00 28 sw (sp+40),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; 801c840: 78 01 08 02 mvhi r1,0x802 801c844: 38 21 09 58 ori r1,r1,0x958 801c848: 28 22 00 00 lw r2,(r1+0) ++level; 801c84c: 34 42 00 01 addi r2,r2,1 _Thread_Dispatch_disable_level = level; 801c850: 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 ); 801c854: 78 01 08 02 mvhi r1,0x802 801c858: 38 21 01 bc ori r1,r1,0x1bc 801c85c: fb ff 9f b8 calli 800473c <_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; 801c860: 78 01 08 02 mvhi r1,0x802 801c864: 38 21 0d e0 ori r1,r1,0xde0 801c868: 28 21 00 10 lw r1,(r1+16) api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 801c86c: 28 22 01 1c lw r2,(r1+284) 801c870: 28 42 00 d0 lw r2,(r2+208) 801c874: a4 40 10 00 not r2,r2 801c878: a1 62 10 00 and r2,r11,r2 801c87c: 5c 40 00 18 bne r2,r0,801c8dc } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 801c880: 78 01 08 02 mvhi r1,0x802 801c884: 38 21 0f f4 ori r1,r1,0xff4 801c888: 28 23 00 00 lw r3,(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 ); 801c88c: 78 04 08 02 mvhi r4,0x802 801c890: 38 84 0f f8 ori r4,r4,0xff8 801c894: 44 64 00 28 be r3,r4,801c934 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 801c898: 28 62 00 30 lw r2,(r3+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; 801c89c: b8 60 08 00 mv r1,r3 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 801c8a0: 28 65 01 1c lw r5,(r3+284) #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 801c8a4: a1 62 10 00 and r2,r11,r2 801c8a8: 44 40 00 09 be r2,r0,801c8cc 801c8ac: e0 00 00 0c bi 801c8dc 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 ) { 801c8b0: 28 63 00 00 lw r3,(r3+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 ); 801c8b4: 44 64 00 20 be r3,r4,801c934 <== ALWAYS TAKEN #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 801c8b8: 28 62 00 30 lw r2,(r3+48) <== NOT EXECUTED for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 801c8bc: 28 65 01 1c lw r5,(r3+284) <== NOT EXECUTED 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; 801c8c0: b8 60 08 00 mv r1,r3 <== NOT EXECUTED #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 801c8c4: a1 62 10 00 and r2,r11,r2 <== NOT EXECUTED 801c8c8: 5c 40 00 05 bne r2,r0,801c8dc <== NOT EXECUTED /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 801c8cc: 28 a5 00 d0 lw r5,(r5+208) 801c8d0: a4 a0 28 00 not r5,r5 801c8d4: a1 65 28 00 and r5,r11,r5 801c8d8: 44 a2 ff f6 be r5,r2,801c8b0 /* * 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 ) ) { 801c8dc: b9 80 10 00 mv r2,r12 801c8e0: 37 83 00 20 addi r3,sp,32 801c8e4: f8 00 00 6a calli 801ca8c <_POSIX_signals_Unblock_thread> 801c8e8: 5c 20 00 0a bne r1,r0,801c910 /* * 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 ); 801c8ec: b9 60 08 00 mv r1,r11 801c8f0: f8 00 00 5c calli 801ca60 <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 801c8f4: b6 0c 60 00 add r12,r16,r12 801c8f8: b5 8c 08 00 add r1,r12,r12 801c8fc: b4 21 08 00 add r1,r1,r1 801c900: b5 a1 68 00 add r13,r13,r1 801c904: 29 a2 00 00 lw r2,(r13+0) 801c908: 34 01 00 02 mvi r1,2 801c90c: 44 41 00 38 be r2,r1,801c9ec _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 801c910: fb ff a8 c9 calli 8006c34 <_Thread_Enable_dispatch> return 0; 801c914: 34 01 00 00 mvi r1,0 801c918: e3 ff ff a8 bi 801c7b8 * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) return pthread_kill( pthread_self(), sig ); 801c91c: f8 00 01 0b calli 801cd48 801c920: b9 80 10 00 mv r2,r12 801c924: f8 00 00 bd calli 801cc18 801c928: e3 ff ff a4 bi 801c7b8 */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; if ( !value ) { siginfo->si_value.sival_int = 0; 801c92c: 5b 80 00 28 sw (sp+40),r0 801c930: e3 ff ff c4 bi 801c840 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 801c934: 78 01 08 02 mvhi r1,0x802 801c938: 38 21 00 d8 ori r1,r1,0xd8 801c93c: 40 26 00 00 lbu r6,(r1+0) */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 801c940: 78 01 08 02 mvhi r1,0x802 801c944: 38 21 08 f4 ori r1,r1,0x8f4 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 801c948: 78 08 08 02 mvhi r8,0x802 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 801c94c: 34 2a 00 10 addi r10,r1,16 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 801c950: 34 c6 00 01 addi r6,r6,1 801c954: 39 08 08 fc ori r8,r8,0x8fc * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 801c958: 34 01 00 00 mvi r1,0 */ RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal ( States_Control the_states ) { return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL); 801c95c: 78 0f 10 00 mvhi r15,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 ] ) 801c960: 29 02 00 00 lw r2,(r8+0) 801c964: 44 40 00 1e be r2,r0,801c9dc <== NEVER TAKEN continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 801c968: 28 42 00 04 lw r2,(r2+4) */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 801c96c: 2c 47 00 10 lhu r7,(r2+16) object_table = the_info->local_table; 801c970: 28 44 00 1c lw r4,(r2+28) for ( index = 1 ; index <= maximum ; index++ ) { 801c974: 44 e0 00 1a be r7,r0,801c9dc 801c978: 34 03 00 01 mvi r3,1 the_thread = (Thread_Control *) object_table[ index ]; 801c97c: 28 82 00 04 lw r2,(r4+4) if ( !the_thread ) 801c980: 44 40 00 14 be r2,r0,801c9d0 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 801c984: 28 45 00 14 lw r5,(r2+20) 801c988: 54 a6 00 12 bgu r5,r6,801c9d0 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 801c98c: 28 49 01 1c lw r9,(r2+284) 801c990: 29 29 00 d0 lw r9,(r9+208) 801c994: a5 20 48 00 not r9,r9 801c998: a1 69 48 00 and r9,r11,r9 801c99c: 45 20 00 0d be r9,r0,801c9d0 * * 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 ) { 801c9a0: 54 c5 00 0a bgu r6,r5,801c9c8 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { 801c9a4: 44 20 00 0b be r1,r0,801c9d0 <== NEVER TAKEN 801c9a8: 28 29 00 10 lw r9,(r1+16) 801c9ac: 45 20 00 09 be r9,r0,801c9d0 <== NEVER TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 801c9b0: 28 4e 00 10 lw r14,(r2+16) 801c9b4: 45 c0 00 05 be r14,r0,801c9c8 801c9b8: a1 2f 48 00 and r9,r9,r15 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 801c9bc: 5d 20 00 05 bne r9,r0,801c9d0 801c9c0: a1 cf 70 00 and r14,r14,r15 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 801c9c4: 45 c9 00 03 be r14,r9,801c9d0 */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 801c9c8: b8 a0 30 00 mv r6,r5 801c9cc: b8 40 08 00 mv r1,r2 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 801c9d0: 34 63 00 01 addi r3,r3,1 801c9d4: 34 84 00 04 addi r4,r4,4 801c9d8: 50 e3 ff e9 bgeu r7,r3,801c97c 801c9dc: 35 08 00 04 addi r8,r8,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++) { 801c9e0: 5d 0a ff e0 bne r8,r10,801c960 } } } } if ( interested ) { 801c9e4: 5c 20 ff be bne r1,r0,801c8dc 801c9e8: e3 ff ff c1 bi 801c8ec _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); 801c9ec: 78 01 08 02 mvhi r1,0x802 801c9f0: 38 21 0f e8 ori r1,r1,0xfe8 801c9f4: fb ff 9f ce calli 800492c <_Chain_Get> 801c9f8: b8 20 10 00 mv r2,r1 if ( !psiginfo ) { 801c9fc: 44 20 00 13 be r1,r0,801ca48 _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 801ca00: 2b 83 00 20 lw r3,(sp+32) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 801ca04: b5 8c 60 00 add r12,r12,r12 801ca08: 78 01 08 02 mvhi r1,0x802 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 801ca0c: 58 43 00 08 sw (r2+8),r3 801ca10: 2b 83 00 24 lw r3,(sp+36) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 801ca14: b5 8c 60 00 add r12,r12,r12 801ca18: 38 21 10 60 ori r1,r1,0x1060 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 801ca1c: 58 43 00 0c sw (r2+12),r3 801ca20: 2b 83 00 28 lw r3,(sp+40) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 801ca24: b5 81 08 00 add r1,r12,r1 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 801ca28: 58 43 00 10 sw (r2+16),r3 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 801ca2c: fb ff 9f b4 calli 80048fc <_Chain_Append> 801ca30: e3 ff ff b8 bi 801c910 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); 801ca34: fb ff c2 10 calli 800d274 <__errno> 801ca38: 34 02 00 03 mvi r2,3 801ca3c: 58 22 00 00 sw (r1+0),r2 801ca40: 34 01 ff ff mvi r1,-1 801ca44: e3 ff ff 5d bi 801c7b8 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { _Thread_Enable_dispatch(); 801ca48: fb ff a8 7b calli 8006c34 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 801ca4c: fb ff c2 0a calli 800d274 <__errno> 801ca50: 34 02 00 0b mvi r2,11 801ca54: 58 22 00 00 sw (r1+0),r2 801ca58: 34 01 ff ff mvi r1,-1 801ca5c: e3 ff ff 57 bi 801c7b8 =============================================================================== 08001fe0 : extern void _wrapup_reent(struct _reent *); extern void _reclaim_reent(struct _reent *); void libc_wrapup(void) { 8001fe0: 37 9c ff f4 addi sp,sp,-12 8001fe4: 5b 8b 00 0c sw (sp+12),r11 8001fe8: 5b 8c 00 08 sw (sp+8),r12 8001fec: 5b 9d 00 04 sw (sp+4),ra /* * In case RTEMS is already down, don't do this. It could be * dangerous. */ if (!_System_state_Is_up(_System_state_Get())) 8001ff0: 78 01 08 02 mvhi r1,0x802 8001ff4: 38 21 0d d8 ori r1,r1,0xdd8 8001ff8: 28 22 00 00 lw r2,(r1+0) 8001ffc: 34 01 00 03 mvi r1,3 8002000: 44 41 00 06 be r2,r1,8002018 <== ALWAYS TAKEN */ fclose (stdin); fclose (stdout); fclose (stderr); } 8002004: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8002008: 2b 8b 00 0c lw r11,(sp+12) <== NOT EXECUTED 800200c: 2b 8c 00 08 lw r12,(sp+8) <== NOT EXECUTED 8002010: 37 9c 00 0c addi sp,sp,12 <== NOT EXECUTED 8002014: c3 a0 00 00 ret <== NOT EXECUTED /* * This was already done if the user called exit() directly . _wrapup_reent(0); */ if (_REENT != _global_impure_ptr) { 8002018: 78 0b 08 02 mvhi r11,0x802 800201c: 78 01 08 01 mvhi r1,0x801 8002020: 39 6b 02 70 ori r11,r11,0x270 8002024: 38 21 e0 a0 ori r1,r1,0xe0a0 8002028: 29 62 00 00 lw r2,(r11+0) 800202c: 28 2c 00 00 lw r12,(r1+0) 8002030: 44 4c 00 04 be r2,r12,8002040 _wrapup_reent(_global_impure_ptr); 8002034: b9 80 08 00 mv r1,r12 8002038: f8 00 30 a4 calli 800e2c8 <_wrapup_reent> /* Don't reclaim this one, just in case we do printfs * on the way out to ROM. */ _reclaim_reent(&libc_global_reent); #endif _REENT = _global_impure_ptr; 800203c: 59 6c 00 00 sw (r11+0),r12 * * Should this be changed to do *all* file streams? * _fwalk (_REENT, fclose); */ fclose (stdin); 8002040: 29 81 00 04 lw r1,(r12+4) 8002044: f8 00 2c e4 calli 800d3d4 fclose (stdout); 8002048: 29 61 00 00 lw r1,(r11+0) 800204c: 28 21 00 08 lw r1,(r1+8) 8002050: f8 00 2c e1 calli 800d3d4 fclose (stderr); 8002054: 29 61 00 00 lw r1,(r11+0) 8002058: 28 21 00 0c lw r1,(r1+12) 800205c: f8 00 2c de calli 800d3d4 } 8002060: 2b 9d 00 04 lw ra,(sp+4) 8002064: 2b 8b 00 0c lw r11,(sp+12) 8002068: 2b 8c 00 08 lw r12,(sp+8) 800206c: 37 9c 00 0c addi sp,sp,12 8002070: c3 a0 00 00 ret =============================================================================== 08001a30 : #include "malloc_p.h" void *malloc( size_t size ) { 8001a30: 37 9c ff f0 addi sp,sp,-16 8001a34: 5b 8b 00 10 sw (sp+16),r11 8001a38: 5b 8c 00 0c sw (sp+12),r12 8001a3c: 5b 8d 00 08 sw (sp+8),r13 8001a40: 5b 9d 00 04 sw (sp+4),ra void *return_this; MSBUMP(malloc_calls, 1); 8001a44: 78 03 08 02 mvhi r3,0x802 8001a48: 38 63 08 28 ori r3,r3,0x828 8001a4c: 28 62 00 04 lw r2,(r3+4) #include "malloc_p.h" void *malloc( size_t size ) { 8001a50: b8 20 60 00 mv r12,r1 /* * Validate the parameters */ if ( !size ) return (void *) 0; 8001a54: 34 0b 00 00 mvi r11,0 size_t size ) { void *return_this; MSBUMP(malloc_calls, 1); 8001a58: 34 41 00 01 addi r1,r2,1 8001a5c: 58 61 00 04 sw (r3+4),r1 /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 8001a60: fb ff ff 9f calli 80018dc /* * Validate the parameters */ if ( !size ) 8001a64: 45 80 00 1d be r12,r0,8001ad8 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 8001a68: 78 01 08 02 mvhi r1,0x802 8001a6c: 38 21 0d d8 ori r1,r1,0xdd8 8001a70: 28 22 00 00 lw r2,(r1+0) 8001a74: 34 01 00 03 mvi r1,3 8001a78: 44 41 00 2b be r2,r1,8001b24 RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 8001a7c: 78 0d 08 02 mvhi r13,0x802 8001a80: 39 ad 00 54 ori r13,r13,0x54 8001a84: 29 a1 00 00 lw r1,(r13+0) 8001a88: b9 80 10 00 mv r2,r12 8001a8c: 34 03 00 00 mvi r3,0 8001a90: 34 04 00 00 mvi r4,0 8001a94: f8 00 11 18 calli 8005ef4 <_Protected_heap_Allocate_aligned_with_boundary> 8001a98: b8 20 58 00 mv r11,r1 * If this fails then return a NULL pointer. */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { 8001a9c: 44 20 00 16 be r1,r0,8001af4 } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) 8001aa0: 78 01 08 02 mvhi r1,0x802 8001aa4: 38 21 07 50 ori r1,r1,0x750 8001aa8: 28 23 00 00 lw r3,(r1+0) 8001aac: 44 60 00 04 be r3,r0,8001abc (*rtems_malloc_dirty_helper)( return_this, size ); 8001ab0: b9 60 08 00 mv r1,r11 8001ab4: b9 80 10 00 mv r2,r12 8001ab8: d8 60 00 00 call r3 /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 8001abc: 78 01 08 02 mvhi r1,0x802 8001ac0: 38 21 07 4c ori r1,r1,0x74c 8001ac4: 28 21 00 00 lw r1,(r1+0) 8001ac8: 44 20 00 04 be r1,r0,8001ad8 (*rtems_malloc_statistics_helpers->at_malloc)(return_this); 8001acc: 28 22 00 04 lw r2,(r1+4) 8001ad0: b9 60 08 00 mv r1,r11 8001ad4: d8 40 00 00 call r2 return return_this; } 8001ad8: b9 60 08 00 mv r1,r11 8001adc: 2b 9d 00 04 lw ra,(sp+4) 8001ae0: 2b 8b 00 10 lw r11,(sp+16) 8001ae4: 2b 8c 00 0c lw r12,(sp+12) 8001ae8: 2b 8d 00 08 lw r13,(sp+8) 8001aec: 37 9c 00 10 addi sp,sp,16 8001af0: c3 a0 00 00 ret */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 8001af4: 78 01 08 01 mvhi r1,0x801 8001af8: 38 21 d2 68 ori r1,r1,0xd268 8001afc: 28 23 00 00 lw r3,(r1+0) 8001b00: 29 a1 00 00 lw r1,(r13+0) 8001b04: b9 80 10 00 mv r2,r12 8001b08: d8 60 00 00 call r3 8001b0c: b8 20 58 00 mv r11,r1 if ( !return_this ) { 8001b10: 5c 20 ff e4 bne r1,r0,8001aa0 <== NEVER TAKEN errno = ENOMEM; 8001b14: f8 00 2d d8 calli 800d274 <__errno> 8001b18: 34 02 00 0c mvi r2,12 8001b1c: 58 22 00 00 sw (r1+0),r2 return (void *) 0; 8001b20: e3 ff ff ee bi 8001ad8 /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && !malloc_is_system_state_OK() ) 8001b24: fb ff ff 64 calli 80018b4 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 8001b28: 5c 20 ff d5 bne r1,r0,8001a7c <== ALWAYS TAKEN 8001b2c: e3 ff ff eb bi 8001ad8 <== NOT EXECUTED =============================================================================== 0800ba28 : */ static void memfile_free_blocks_in_table( block_p **block_table, int entries ) { 800ba28: 37 9c ff ec addi sp,sp,-20 800ba2c: 5b 8b 00 14 sw (sp+20),r11 800ba30: 5b 8c 00 10 sw (sp+16),r12 800ba34: 5b 8d 00 0c sw (sp+12),r13 800ba38: 5b 8e 00 08 sw (sp+8),r14 800ba3c: 5b 9d 00 04 sw (sp+4),ra 800ba40: b8 20 70 00 mv r14,r1 800ba44: b8 40 68 00 mv r13,r2 IMFS_assert( block_table ); /* * Now go through all the slots in the table and free the memory. */ b = *block_table; 800ba48: 28 2b 00 00 lw r11,(r1+0) for ( i=0 ; i<== NEVER TAKEN 800ba50: 34 0c 00 00 mvi r12,0 if ( b[i] ) { 800ba54: 29 63 00 00 lw r3,(r11+0) /* * Now go through all the slots in the table and free the memory. */ b = *block_table; for ( i=0 ; i memfile_free_block( b[i] ); 800ba64: fb ff ff e6 calli 800b9fc b[i] = 0; 800ba68: 59 60 00 00 sw (r11+0),r0 /* * Now go through all the slots in the table and free the memory. */ b = *block_table; for ( i=0 ; i 800ba74: 29 cb 00 00 lw r11,(r14+0) /* * Now that all the blocks in the block table are free, we can * free the block table itself. */ memfile_free_block( *block_table ); 800ba78: b9 60 08 00 mv r1,r11 800ba7c: fb ff ff e0 calli 800b9fc *block_table = 0; 800ba80: 59 c0 00 00 sw (r14+0),r0 } 800ba84: 2b 9d 00 04 lw ra,(sp+4) 800ba88: 2b 8b 00 14 lw r11,(sp+20) 800ba8c: 2b 8c 00 10 lw r12,(sp+16) 800ba90: 2b 8d 00 0c lw r13,(sp+12) 800ba94: 2b 8e 00 08 lw r14,(sp+8) 800ba98: 37 9c 00 14 addi sp,sp,20 800ba9c: c3 a0 00 00 ret =============================================================================== 0800c034 : rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { 800c034: 37 9c ff fc addi sp,sp,-4 800c038: 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) 800c03c: 28 23 00 08 lw r3,(r1+8) mode_t mode ) { IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; 800c040: 28 22 00 14 lw r2,(r1+20) if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; 800c044: 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) 800c048: 20 63 00 04 andi r3,r3,0x4 800c04c: 44 60 00 05 be r3,r0,800c060 800c050: 28 43 00 4c lw r3,(r2+76) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { 800c054: 28 64 00 00 lw r4,(r3+0) 800c058: 34 03 00 05 mvi r3,5 800c05c: 44 83 00 04 be r4,r3,800c06c <== NEVER TAKEN && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; } 800c060: 2b 9d 00 04 lw ra,(sp+4) 800c064: 37 9c 00 04 addi sp,sp,4 800c068: c3 a0 00 00 ret /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { uint32_t count = the_jnode->info.linearfile.size; 800c06c: 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; 800c070: 78 05 08 01 mvhi r5,0x801 <== NOT EXECUTED 800c074: 38 a5 dd 48 ori r5,r5,0xdd48 <== 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; 800c078: 28 43 00 54 lw r3,(r2+84) <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; 800c07c: 58 45 00 4c sw (r2+76),r5 <== NOT EXECUTED the_jnode->info.file.size = 0; 800c080: 58 40 00 50 sw (r2+80),r0 <== NOT EXECUTED the_jnode->info.file.indirect = 0; 800c084: 58 40 00 54 sw (r2+84),r0 <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; 800c088: 58 40 00 58 sw (r2+88),r0 <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; 800c08c: 58 40 00 5c sw (r2+92),r0 <== NOT EXECUTED if ((count != 0) 800c090: 44 80 ff f4 be r4,r0,800c060 <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) 800c094: b8 40 08 00 mv r1,r2 <== NOT EXECUTED 800c098: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 800c09c: fb ff ff 61 calli 800be20 <== NOT EXECUTED return -1; } return 0; 800c0a0: 64 21 ff ff cmpei r1,r1,-1 <== NOT EXECUTED 800c0a4: c8 01 08 00 sub r1,r0,r1 <== NOT EXECUTED 800c0a8: e3 ff ff ee bi 800c060 <== NOT EXECUTED =============================================================================== 08001c6c : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8001c6c: 37 9c ff 7c addi sp,sp,-132 8001c70: 5b 8b 00 34 sw (sp+52),r11 8001c74: 5b 8c 00 30 sw (sp+48),r12 8001c78: 5b 8d 00 2c sw (sp+44),r13 8001c7c: 5b 8e 00 28 sw (sp+40),r14 8001c80: 5b 8f 00 24 sw (sp+36),r15 8001c84: 5b 90 00 20 sw (sp+32),r16 8001c88: 5b 91 00 1c sw (sp+28),r17 8001c8c: 5b 92 00 18 sw (sp+24),r18 8001c90: 5b 93 00 14 sw (sp+20),r19 8001c94: 5b 94 00 10 sw (sp+16),r20 8001c98: 5b 95 00 0c sw (sp+12),r21 8001c9c: 5b 96 00 08 sw (sp+8),r22 8001ca0: 5b 9d 00 04 sw (sp+4),ra 8001ca4: b8 20 78 00 mv r15,r1 int rv = 0; if ( 8001ca8: 34 01 00 01 mvi r1,1 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8001cac: b8 80 a0 00 mv r20,r4 8001cb0: b8 40 68 00 mv r13,r2 8001cb4: b8 60 80 00 mv r16,r3 8001cb8: b8 a0 b0 00 mv r22,r5 int rv = 0; if ( 8001cbc: 54 81 00 96 bgu r4,r1,8001f14 options == RTEMS_FILESYSTEM_READ_ONLY || options == RTEMS_FILESYSTEM_READ_WRITE ) { rtems_filesystem_fsmount_me_t fsmount_me_h = 8001cc0: b8 60 08 00 mv r1,r3 8001cc4: f8 00 1d 90 calli 8009304 8001cc8: b8 20 a8 00 mv r21,r1 rtems_filesystem_get_mount_handler( filesystemtype ); if ( fsmount_me_h != NULL ) { 8001ccc: 44 20 00 92 be r1,r0,8001f14 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 8001cd0: 78 0e 08 01 mvhi r14,0x801 8001cd4: 34 12 00 02 mvi r18,2 8001cd8: 39 ce d9 9c ori r14,r14,0xd99c 8001cdc: 45 a0 00 05 be r13,r0,8001cf0 } return rv; } int mount( 8001ce0: b9 a0 08 00 mv r1,r13 8001ce4: f8 00 33 a9 calli 800eb88 8001ce8: 34 32 00 01 addi r18,r1,1 8001cec: b9 a0 70 00 mv r14,r13 const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; 8001cf0: ba 00 08 00 mv r1,r16 8001cf4: f8 00 33 a5 calli 800eb88 8001cf8: 34 2c 00 01 addi r12,r1,1 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 8001cfc: 34 11 00 00 mvi r17,0 8001d00: 45 e0 00 04 be r15,r0,8001d10 8001d04: b9 e0 08 00 mv r1,r15 8001d08: f8 00 33 a0 calli 800eb88 8001d0c: 34 31 00 01 addi r17,r1,1 size_t target_size = strlen( target ) + 1; size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size 8001d10: 36 43 00 64 addi r3,r18,100 8001d14: b4 6c 18 00 add r3,r3,r12 + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 8001d18: 34 01 00 01 mvi r1,1 8001d1c: b4 71 10 00 add r2,r3,r17 8001d20: fb ff fd 77 calli 80012fc 8001d24: b8 20 58 00 mv r11,r1 if ( mt_entry != NULL ) { 8001d28: 44 20 00 75 be r1,r0,8001efc <== NEVER TAKEN rtems_filesystem_global_location_t *mt_fs_root = (rtems_filesystem_global_location_t *) ((char *) mt_entry + sizeof( *mt_entry )); char *str = (char *) mt_fs_root + sizeof( *mt_fs_root ); 8001d2c: 34 33 00 64 addi r19,r1,100 memcpy( str, filesystemtype, filesystemtype_size ); 8001d30: ba 00 10 00 mv r2,r16 8001d34: b9 80 18 00 mv r3,r12 8001d38: ba 60 08 00 mv r1,r19 8001d3c: f8 00 30 48 calli 800de5c mt_entry->type = str; 8001d40: 59 73 00 34 sw (r11+52),r19 + filesystemtype_size + source_size + target_size + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); if ( mt_entry != NULL ) { rtems_filesystem_global_location_t *mt_fs_root = 8001d44: 35 70 00 40 addi r16,r11,64 ((char *) mt_entry + sizeof( *mt_entry )); char *str = (char *) mt_fs_root + sizeof( *mt_fs_root ); memcpy( str, filesystemtype, filesystemtype_size ); mt_entry->type = str; str += filesystemtype_size; 8001d48: b6 6c 60 00 add r12,r19,r12 if ( source_or_null != NULL ) { 8001d4c: 45 e0 00 07 be r15,r0,8001d68 memcpy( str, source_or_null, source_size ); 8001d50: b9 80 08 00 mv r1,r12 8001d54: b9 e0 10 00 mv r2,r15 8001d58: ba 20 18 00 mv r3,r17 8001d5c: f8 00 30 40 calli 800de5c mt_entry->dev = str; 8001d60: 59 6c 00 38 sw (r11+56),r12 str += source_size; 8001d64: b5 91 60 00 add r12,r12,r17 } memcpy( str, target, target_size ); 8001d68: b9 c0 10 00 mv r2,r14 8001d6c: ba 40 18 00 mv r3,r18 8001d70: b9 80 08 00 mv r1,r12 8001d74: f8 00 30 3a calli 800de5c mt_entry->target = str; str += target_size; mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; 8001d78: 78 03 08 01 mvhi r3,0x801 8001d7c: 38 63 d9 a0 ori r3,r3,0xd9a0 memcpy( str, target, target_size ); mt_entry->target = str; str += target_size; mt_entry->mounted = true; 8001d80: 34 01 00 01 mvi r1,1 mt_entry->dev = str; str += source_size; } memcpy( str, target, target_size ); mt_entry->target = str; 8001d84: 59 6c 00 30 sw (r11+48),r12 str += target_size; mt_entry->mounted = true; 8001d88: 31 61 00 28 sb (r11+40),r1 mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; 8001d8c: 59 63 00 2c sw (r11+44),r3 memcpy( str, target, target_size ); mt_entry->target = str; str += target_size; mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; 8001d90: 59 70 00 24 sw (r11+36),r16 mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; mt_fs_root->location.mt_entry = mt_entry; mt_fs_root->reference_count = 1; 8001d94: 34 05 00 01 mvi r5,1 void *starting_address, size_t number_nodes, size_t node_size ) { _Chain_Initialize( the_chain, starting_address, number_nodes, node_size ); 8001d98: 35 61 00 14 addi r1,r11,20 8001d9c: ba 00 10 00 mv r2,r16 8001da0: 34 03 00 01 mvi r3,1 8001da4: 34 04 00 24 mvi r4,36 8001da8: 5a 05 00 18 sw (r16+24),r5 mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; mt_fs_root->location.mt_entry = mt_entry; 8001dac: 5a 0b 00 14 sw (r16+20),r11 8001db0: f8 00 0a f0 calli 8004970 <_Chain_Initialize> ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; rv = (*fsmount_me_h)( mt_entry, data ); 8001db4: b9 60 08 00 mv r1,r11 filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 8001db8: 31 74 00 29 sb (r11+41),r20 rv = (*fsmount_me_h)( mt_entry, data ); 8001dbc: ba c0 10 00 mv r2,r22 8001dc0: da a0 00 00 call r21 8001dc4: b8 20 60 00 mv r12,r1 if ( rv == 0 ) { 8001dc8: 5c 20 00 18 bne r1,r0,8001e28 if ( target != NULL ) { 8001dcc: 45 a1 00 5a be r13,r1,8001f34 int rv = 0; rtems_filesystem_eval_path_context_t ctx; int eval_flags = RTEMS_FS_PERMS_RWX | RTEMS_FS_FOLLOW_LINK; rtems_filesystem_location_info_t *currentloc = rtems_filesystem_eval_path_start( &ctx, target, eval_flags ); 8001dd0: 37 8e 00 38 addi r14,sp,56 { int rv = 0; rtems_filesystem_eval_path_context_t ctx; int eval_flags = RTEMS_FS_PERMS_RWX | RTEMS_FS_FOLLOW_LINK; rtems_filesystem_location_info_t *currentloc = 8001dd4: b9 a0 10 00 mv r2,r13 8001dd8: 34 03 00 1f mvi r3,31 8001ddc: b9 c0 08 00 mv r1,r14 8001de0: f8 00 03 6a calli 8002b88 static inline bool rtems_filesystem_location_is_instance_root( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 8001de4: 28 22 00 14 lw r2,(r1+20) return (*mt_entry->ops->are_nodes_equal_h)( 8001de8: 28 43 00 0c lw r3,(r2+12) 8001dec: 28 42 00 24 lw r2,(r2+36) 8001df0: 28 63 00 10 lw r3,(r3+16) 8001df4: d8 60 00 00 call r3 8001df8: b8 20 78 00 mv r15,r1 rtems_filesystem_eval_path_start( &ctx, target, eval_flags ); if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { 8001dfc: 44 20 00 1d be r1,r0,8001e70 rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); 8001e00: b9 c0 08 00 mv r1,r14 8001e04: 34 02 00 10 mvi r2,16 8001e08: f8 00 02 77 calli 80027e4 rv = -1; 8001e0c: 34 0c ff ff mvi r12,-1 } rtems_filesystem_eval_path_cleanup( &ctx ); 8001e10: b9 c0 08 00 mv r1,r14 8001e14: f8 00 03 b4 calli 8002ce4 } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { (*mt_entry->ops->fsunmount_me_h)( mt_entry ); 8001e18: 29 62 00 0c lw r2,(r11+12) 8001e1c: b9 60 08 00 mv r1,r11 8001e20: 28 42 00 3c lw r2,(r2+60) 8001e24: d8 40 00 00 call r2 } } if ( rv != 0 ) { free( mt_entry ); 8001e28: b9 60 08 00 mv r1,r11 8001e2c: fb ff fd ff calli 8001628 errno = EINVAL; rv = -1; } return rv; } 8001e30: b9 80 08 00 mv r1,r12 8001e34: 2b 9d 00 04 lw ra,(sp+4) 8001e38: 2b 8b 00 34 lw r11,(sp+52) 8001e3c: 2b 8c 00 30 lw r12,(sp+48) 8001e40: 2b 8d 00 2c lw r13,(sp+44) 8001e44: 2b 8e 00 28 lw r14,(sp+40) 8001e48: 2b 8f 00 24 lw r15,(sp+36) 8001e4c: 2b 90 00 20 lw r16,(sp+32) 8001e50: 2b 91 00 1c lw r17,(sp+28) 8001e54: 2b 92 00 18 lw r18,(sp+24) 8001e58: 2b 93 00 14 lw r19,(sp+20) 8001e5c: 2b 94 00 10 lw r20,(sp+16) 8001e60: 2b 95 00 0c lw r21,(sp+12) 8001e64: 2b 96 00 08 lw r22,(sp+8) 8001e68: 37 9c 00 84 addi sp,sp,132 8001e6c: c3 a0 00 00 ret if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { rtems_filesystem_location_info_t targetloc; rtems_filesystem_global_location_t *mt_point_node; rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc ); 8001e70: 37 8c 00 70 addi r12,sp,112 static inline void rtems_filesystem_eval_path_extract_currentloc( rtems_filesystem_eval_path_context_t *ctx, rtems_filesystem_location_info_t *get ) { rtems_filesystem_location_copy_and_detach( 8001e74: 37 82 00 50 addi r2,sp,80 8001e78: b9 80 08 00 mv r1,r12 8001e7c: f8 00 04 c4 calli 800318c mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc ); 8001e80: b9 80 08 00 mv r1,r12 8001e84: f8 00 05 89 calli 80034a8 mt_entry->mt_point_node = mt_point_node; rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 8001e88: 28 22 00 14 lw r2,(r1+20) if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { rtems_filesystem_location_info_t targetloc; rtems_filesystem_global_location_t *mt_point_node; rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc ); mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc ); 8001e8c: b8 20 68 00 mv r13,r1 mt_entry->mt_point_node = mt_point_node; 8001e90: 59 61 00 20 sw (r11+32),r1 rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 8001e94: 28 42 00 0c lw r2,(r2+12) 8001e98: b9 60 08 00 mv r1,r11 8001e9c: 28 42 00 30 lw r2,(r2+48) 8001ea0: d8 40 00 00 call r2 8001ea4: b8 20 60 00 mv r12,r1 if ( rv == 0 ) { 8001ea8: 5c 2f 00 20 bne r1,r15,8001f28 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 8001eac: 78 0d 08 02 mvhi r13,0x802 8001eb0: 39 ad 08 24 ori r13,r13,0x824 8001eb4: 29 a1 00 00 lw r1,(r13+0) 8001eb8: 34 02 00 00 mvi r2,0 8001ebc: 34 03 00 00 mvi r3,0 8001ec0: f8 00 07 67 calli 8003c5c Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 8001ec4: 78 02 08 02 mvhi r2,0x802 8001ec8: 38 42 00 f4 ori r2,r2,0xf4 8001ecc: 28 44 00 08 lw r4,(r2+8) the_node->next = tail; 8001ed0: 78 03 08 02 mvhi r3,0x802 8001ed4: 38 63 00 f8 ori r3,r3,0xf8 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 8001ed8: 29 a1 00 00 lw r1,(r13+0) 8001edc: 59 63 00 00 sw (r11+0),r3 tail->previous = the_node; old_last->next = the_node; 8001ee0: 58 8b 00 00 sw (r4+0),r11 { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 8001ee4: 58 4b 00 08 sw (r2+8),r11 old_last->next = the_node; the_node->previous = old_last; 8001ee8: 59 64 00 04 sw (r11+4),r4 8001eec: f8 00 07 b8 calli 8003dcc } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 8001ef0: b9 c0 08 00 mv r1,r14 8001ef4: f8 00 03 7c calli 8002ce4 8001ef8: e3 ff ff ce bi 8001e30 mt_fs_root, 1, sizeof(*mt_fs_root) ); } else { free( mt_entry ); 8001efc: fb ff fd cb calli 8001628 <== NOT EXECUTED if ( rv != 0 ) { free( mt_entry ); } } else { errno = ENOMEM; 8001f00: f8 00 2c dd calli 800d274 <__errno> <== NOT EXECUTED 8001f04: 34 02 00 0c mvi r2,12 <== NOT EXECUTED 8001f08: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED rv = -1; 8001f0c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8001f10: e3 ff ff c8 bi 8001e30 <== NOT EXECUTED } else { errno = EINVAL; rv = -1; } } else { errno = EINVAL; 8001f14: f8 00 2c d8 calli 800d274 <__errno> 8001f18: 34 02 00 16 mvi r2,22 8001f1c: 58 22 00 00 sw (r1+0),r2 rv = -1; 8001f20: 34 0c ff ff mvi r12,-1 8001f24: e3 ff ff c3 bi 8001e30 &rtems_filesystem_mount_table, &mt_entry->mt_node ); rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); 8001f28: b9 a0 08 00 mv r1,r13 8001f2c: f8 00 04 fb calli 8003318 8001f30: e3 ff ff b8 bi 8001e10 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 8001f34: 78 0d 08 02 mvhi r13,0x802 8001f38: 39 ad 08 24 ori r13,r13,0x824 8001f3c: 29 a1 00 00 lw r1,(r13+0) 8001f40: 34 02 00 00 mvi r2,0 8001f44: 34 03 00 00 mvi r3,0 8001f48: f8 00 07 45 calli 8003c5c errno = EINVAL; rv = -1; } return rv; } 8001f4c: 78 02 08 02 mvhi r2,0x802 8001f50: 38 42 00 f4 ori r2,r2,0xf4 ) { int rv = 0; rtems_filesystem_mt_lock(); if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { 8001f54: 28 43 00 00 lw r3,(r2+0) 8001f58: 78 01 08 02 mvhi r1,0x802 8001f5c: 38 21 00 f8 ori r1,r1,0xf8 8001f60: 44 61 00 08 be r3,r1,8001f80 <== ALWAYS TAKEN rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); } else { errno = EINVAL; 8001f64: f8 00 2c c4 calli 800d274 <__errno> <== NOT EXECUTED 8001f68: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8001f6c: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 8001f70: 29 a1 00 00 lw r1,(r13+0) <== NOT EXECUTED 8001f74: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8001f78: f8 00 07 95 calli 8003dcc <== NOT EXECUTED 8001f7c: e3 ff ff a7 bi 8001e18 <== NOT EXECUTED Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 8001f80: 28 44 00 08 lw r4,(r2+8) 8001f84: 29 a1 00 00 lw r1,(r13+0) the_node->next = tail; 8001f88: 59 63 00 00 sw (r11+0),r3 tail->previous = the_node; old_last->next = the_node; 8001f8c: 58 8b 00 00 sw (r4+0),r11 the_node->previous = old_last; 8001f90: 59 64 00 04 sw (r11+4),r4 { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 8001f94: 58 4b 00 08 sw (r2+8),r11 } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); 8001f98: 35 6d 00 24 addi r13,r11,36 8001f9c: f8 00 07 8c calli 8003dcc rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = 8001fa0: b9 a0 08 00 mv r1,r13 8001fa4: f8 00 05 08 calli 80033c4 8001fa8: b8 20 70 00 mv r14,r1 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 8001fac: 78 0b 08 02 mvhi r11,0x802 rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = 8001fb0: b9 a0 08 00 mv r1,r13 8001fb4: f8 00 05 04 calli 80033c4 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 8001fb8: 39 6b 01 90 ori r11,r11,0x190 rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = 8001fbc: b8 20 68 00 mv r13,r1 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 8001fc0: 29 61 00 00 lw r1,(r11+0) 8001fc4: b9 c0 10 00 mv r2,r14 8001fc8: 34 21 00 04 addi r1,r1,4 8001fcc: f8 00 04 f0 calli 800338c &rtems_filesystem_root, new_fs_root ); rtems_filesystem_global_location_assign( 8001fd0: 29 61 00 00 lw r1,(r11+0) 8001fd4: b9 a0 10 00 mv r2,r13 8001fd8: f8 00 04 ed calli 800338c 8001fdc: e3 ff ff 95 bi 8001e30 =============================================================================== 08007620 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 8007620: 37 9c ff e8 addi sp,sp,-24 8007624: 5b 8b 00 18 sw (sp+24),r11 8007628: 5b 8c 00 14 sw (sp+20),r12 800762c: 5b 8d 00 10 sw (sp+16),r13 8007630: 5b 8e 00 0c sw (sp+12),r14 8007634: 5b 8f 00 08 sw (sp+8),r15 8007638: 5b 9d 00 04 sw (sp+4),ra 800763c: b8 40 58 00 mv r11,r2 8007640: b8 20 78 00 mv r15,r1 8007644: b8 60 70 00 mv r14,r3 8007648: b8 80 68 00 mv r13,r4 800764c: b8 a0 60 00 mv r12,r5 int rv = -1; if (target != NULL) { 8007650: 44 40 00 1b be r2,r0,80076bc rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); 8007654: b8 40 08 00 mv r1,r2 8007658: 34 02 01 ff mvi r2,511 800765c: f8 00 03 67 calli 80083f8 if (rv == 0) { 8007660: 44 20 00 09 be r1,r0,8007684 <== ALWAYS TAKEN } else { errno = EINVAL; } return rv; } 8007664: 2b 9d 00 04 lw ra,(sp+4) 8007668: 2b 8b 00 18 lw r11,(sp+24) 800766c: 2b 8c 00 14 lw r12,(sp+20) 8007670: 2b 8d 00 10 lw r13,(sp+16) 8007674: 2b 8e 00 0c lw r14,(sp+12) 8007678: 2b 8f 00 08 lw r15,(sp+8) 800767c: 37 9c 00 18 addi sp,sp,24 8007680: c3 a0 00 00 ret int rv = -1; if (target != NULL) { rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO); if (rv == 0) { rv = mount( 8007684: b9 e0 08 00 mv r1,r15 8007688: b9 60 10 00 mv r2,r11 800768c: b9 c0 18 00 mv r3,r14 8007690: b9 a0 20 00 mv r4,r13 8007694: b9 80 28 00 mv r5,r12 8007698: f8 00 00 0e calli 80076d0 } else { errno = EINVAL; } return rv; } 800769c: 2b 9d 00 04 lw ra,(sp+4) 80076a0: 2b 8b 00 18 lw r11,(sp+24) 80076a4: 2b 8c 00 14 lw r12,(sp+20) 80076a8: 2b 8d 00 10 lw r13,(sp+16) 80076ac: 2b 8e 00 0c lw r14,(sp+12) 80076b0: 2b 8f 00 08 lw r15,(sp+8) 80076b4: 37 9c 00 18 addi sp,sp,24 80076b8: c3 a0 00 00 ret options, data ); } } else { errno = EINVAL; 80076bc: f8 00 70 a2 calli 8023944 <__errno> 80076c0: 34 02 00 16 mvi r2,22 80076c4: 58 22 00 00 sw (r1+0),r2 const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { int rv = -1; 80076c8: 34 01 ff ff mvi r1,-1 80076cc: e3 ff ff e6 bi 8007664 =============================================================================== 08004374 : int oflag, ... /* mode_t mode, */ /* struct mq_attr attr */ ) { 8004374: 37 9c ff b0 addi sp,sp,-80 8004378: 5b 8b 00 24 sw (sp+36),r11 800437c: 5b 8c 00 20 sw (sp+32),r12 8004380: 5b 8d 00 1c sw (sp+28),r13 8004384: 5b 8e 00 18 sw (sp+24),r14 8004388: 5b 8f 00 14 sw (sp+20),r15 800438c: 5b 90 00 10 sw (sp+16),r16 8004390: 5b 91 00 0c sw (sp+12),r17 8004394: 5b 92 00 08 sw (sp+8),r18 8004398: 5b 9d 00 04 sw (sp+4),ra * * 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; 800439c: 78 09 08 02 mvhi r9,0x802 80043a0: 39 29 53 28 ori r9,r9,0x5328 80043a4: 29 2a 00 00 lw r10,(r9+0) 80043a8: b8 20 88 00 mv r17,r1 80043ac: 5b 82 00 38 sw (sp+56),r2 ++level; 80043b0: 35 4a 00 01 addi r10,r10,1 80043b4: 5b 83 00 3c sw (sp+60),r3 80043b8: 5b 84 00 40 sw (sp+64),r4 80043bc: 5b 85 00 44 sw (sp+68),r5 80043c0: 5b 86 00 48 sw (sp+72),r6 80043c4: 5b 87 00 4c sw (sp+76),r7 80043c8: 5b 88 00 50 sw (sp+80),r8 80043cc: b8 40 70 00 mv r14,r2 _Thread_Dispatch_disable_level = level; 80043d0: 59 2a 00 00 sw (r9+0),r10 Objects_Locations location; size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 80043d4: 20 50 02 00 andi r16,r2,0x200 /* struct mq_attr attr */ ) { va_list arg; mode_t mode; struct mq_attr *attr = NULL; 80043d8: 34 12 00 00 mvi r18,0 Objects_Locations location; size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 80043dc: 5e 00 00 3c bne r16,r0,80044cc RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd * _POSIX_Message_queue_Allocate_fd( void ) { return (POSIX_Message_queue_Control_fd *) _Objects_Allocate( &_POSIX_Message_queue_Information_fds ); 80043e0: 78 0c 08 02 mvhi r12,0x802 80043e4: 39 8c 57 70 ori r12,r12,0x5770 80043e8: b9 80 08 00 mv r1,r12 80043ec: f8 00 0c df calli 8007768 <_Objects_Allocate> 80043f0: b8 20 58 00 mv r11,r1 attr = va_arg( arg, struct mq_attr * ); va_end(arg); } the_mq_fd = _POSIX_Message_queue_Allocate_fd(); if ( !the_mq_fd ) { 80043f4: 44 20 00 3d be r1,r0,80044e8 <== NEVER TAKEN const char *name, Objects_Id *id, size_t *len ) { return _POSIX_Name_to_id( &_POSIX_Message_queue_Information, name, id, len ); 80043f8: 78 0d 08 02 mvhi r13,0x802 80043fc: 39 ad 55 e4 ori r13,r13,0x55e4 _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENFILE ); } the_mq_fd->oflag = oflag; 8004400: 58 2e 00 14 sw (r1+20),r14 8004404: ba 20 10 00 mv r2,r17 8004408: b9 a0 08 00 mv r1,r13 800440c: 37 83 00 34 addi r3,sp,52 8004410: 37 84 00 28 addi r4,sp,40 8004414: f8 00 01 78 calli 80049f4 <_POSIX_Name_to_id> 8004418: b8 20 78 00 mv r15,r1 * If the name to id translation worked, then the message queue exists * and we can just return a pointer to the id. Otherwise we may * need to check to see if this is a "message queue does not exist" * or some other miscellaneous error on the name. */ if ( status ) { 800441c: 5c 20 00 22 bne r1,r0,80044a4 } else { /* name -> ID translation succeeded */ /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 8004420: 21 ce 0a 00 andi r14,r14,0xa00 8004424: 34 01 0a 00 mvi r1,2560 8004428: 45 c1 00 36 be r14,r1,8004500 Objects_Id id, Objects_Locations *location ) { return (POSIX_Message_queue_Control *) _Objects_Get( &_POSIX_Message_queue_Information, id, location ); 800442c: 2b 82 00 34 lw r2,(sp+52) 8004430: 37 83 00 2c addi r3,sp,44 8004434: b9 a0 08 00 mv r1,r13 8004438: f8 00 0e 50 calli 8007d78 <_Objects_Get> /* * In this case we need to do an ID->pointer conversion to * check the mode. */ the_mq = _POSIX_Message_queue_Get( the_mq_id, &location ); the_mq->open_count += 1; 800443c: 28 24 00 18 lw r4,(r1+24) Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 8004440: 2d 62 00 0a lhu r2,(r11+10) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8004444: 29 83 00 1c lw r3,(r12+28) 8004448: 34 84 00 01 addi r4,r4,1 800444c: b4 42 10 00 add r2,r2,r2 8004450: 58 24 00 18 sw (r1+24),r4 8004454: b4 42 10 00 add r2,r2,r2 /* * In this case we need to do an ID->pointer conversion to * check the mode. */ the_mq = _POSIX_Message_queue_Get( the_mq_id, &location ); 8004458: 5b 81 00 30 sw (sp+48),r1 the_mq->open_count += 1; the_mq_fd->Queue = the_mq; 800445c: 59 61 00 10 sw (r11+16),r1 8004460: b4 62 10 00 add r2,r3,r2 8004464: 58 4b 00 00 sw (r2+0),r11 the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 8004468: 59 60 00 0c sw (r11+12),r0 _Objects_Open_string( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object, NULL ); _Thread_Enable_dispatch(); 800446c: f8 00 12 58 calli 8008dcc <_Thread_Enable_dispatch> _Thread_Enable_dispatch(); 8004470: f8 00 12 57 calli 8008dcc <_Thread_Enable_dispatch> return (mqd_t)the_mq_fd->Object.id; 8004474: 29 61 00 08 lw r1,(r11+8) ); _Thread_Enable_dispatch(); return (mqd_t) the_mq_fd->Object.id; } 8004478: 2b 9d 00 04 lw ra,(sp+4) 800447c: 2b 8b 00 24 lw r11,(sp+36) 8004480: 2b 8c 00 20 lw r12,(sp+32) 8004484: 2b 8d 00 1c lw r13,(sp+28) 8004488: 2b 8e 00 18 lw r14,(sp+24) 800448c: 2b 8f 00 14 lw r15,(sp+20) 8004490: 2b 90 00 10 lw r16,(sp+16) 8004494: 2b 91 00 0c lw r17,(sp+12) 8004498: 2b 92 00 08 lw r18,(sp+8) 800449c: 37 9c 00 50 addi sp,sp,80 80044a0: c3 a0 00 00 ret if ( status ) { /* * Unless provided a valid name that did not already exist * and we are willing to create then it is an error. */ if ( !( status == ENOENT && (oflag & O_CREAT) ) ) { 80044a4: 34 01 00 02 mvi r1,2 80044a8: 45 e1 00 1f be r15,r1,8004524 RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd ( POSIX_Message_queue_Control_fd *the_mq_fd ) { _Objects_Free( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object ); 80044ac: b9 80 08 00 mv r1,r12 80044b0: b9 60 10 00 mv r2,r11 80044b4: f8 00 0d b8 calli 8007b94 <_Objects_Free> _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 80044b8: f8 00 12 45 calli 8008dcc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, mqd_t ); 80044bc: f8 00 2c bf calli 800f7b8 <__errno> 80044c0: 58 2f 00 00 sw (r1+0),r15 80044c4: 34 01 ff ff mvi r1,-1 80044c8: e3 ff ff ec bi 8004478 RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd * _POSIX_Message_queue_Allocate_fd( void ) { return (POSIX_Message_queue_Control_fd *) _Objects_Allocate( &_POSIX_Message_queue_Information_fds ); 80044cc: 78 0c 08 02 mvhi r12,0x802 80044d0: 39 8c 57 70 ori r12,r12,0x5770 80044d4: b9 80 08 00 mv r1,r12 _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); mode = va_arg( arg, mode_t ); attr = va_arg( arg, struct mq_attr * ); 80044d8: 2b 92 00 40 lw r18,(sp+64) 80044dc: f8 00 0c a3 calli 8007768 <_Objects_Allocate> 80044e0: b8 20 58 00 mv r11,r1 va_end(arg); } the_mq_fd = _POSIX_Message_queue_Allocate_fd(); if ( !the_mq_fd ) { 80044e4: 5c 20 ff c5 bne r1,r0,80043f8 _Thread_Enable_dispatch(); 80044e8: f8 00 12 39 calli 8008dcc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENFILE ); 80044ec: f8 00 2c b3 calli 800f7b8 <__errno> 80044f0: 34 02 00 17 mvi r2,23 80044f4: 58 22 00 00 sw (r1+0),r2 80044f8: 34 01 ff ff mvi r1,-1 80044fc: e3 ff ff df bi 8004478 RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd ( POSIX_Message_queue_Control_fd *the_mq_fd ) { _Objects_Free( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object ); 8004500: b9 60 10 00 mv r2,r11 8004504: b9 80 08 00 mv r1,r12 8004508: f8 00 0d a3 calli 8007b94 <_Objects_Free> /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 800450c: f8 00 12 30 calli 8008dcc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( EEXIST, mqd_t ); 8004510: f8 00 2c aa calli 800f7b8 <__errno> 8004514: 34 02 00 11 mvi r2,17 8004518: 58 22 00 00 sw (r1+0),r2 800451c: 34 01 ff ff mvi r1,-1 8004520: e3 ff ff d6 bi 8004478 if ( status ) { /* * Unless provided a valid name that did not already exist * and we are willing to create then it is an error. */ if ( !( status == ENOENT && (oflag & O_CREAT) ) ) { 8004524: 46 00 ff e2 be r16,r0,80044ac /* * At this point, the message queue does not exist and everything has been * checked. We should go ahead and create a message queue. */ status = _POSIX_Message_queue_Create_support( 8004528: 2b 82 00 28 lw r2,(sp+40) 800452c: ba 20 08 00 mv r1,r17 8004530: 34 03 00 01 mvi r3,1 8004534: ba 40 20 00 mv r4,r18 8004538: 37 85 00 30 addi r5,sp,48 800453c: f8 00 1e 18 calli 800bd9c <_POSIX_Message_queue_Create_support> ); /* * errno was set by Create_support, so don't set it again. */ if ( status == -1 ) { 8004540: 34 02 ff ff mvi r2,-1 8004544: 44 22 00 0d be r1,r2,8004578 Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 8004548: 2d 61 00 0a lhu r1,(r11+10) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 800454c: 29 82 00 1c lw r2,(r12+28) _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); return (mqd_t) -1; } the_mq_fd->Queue = the_mq; 8004550: 2b 83 00 30 lw r3,(sp+48) 8004554: b4 21 08 00 add r1,r1,r1 8004558: b4 21 08 00 add r1,r1,r1 800455c: b4 41 08 00 add r1,r2,r1 8004560: 59 63 00 10 sw (r11+16),r3 8004564: 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; 8004568: 59 60 00 0c sw (r11+12),r0 &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object, NULL ); _Thread_Enable_dispatch(); 800456c: f8 00 12 18 calli 8008dcc <_Thread_Enable_dispatch> return (mqd_t) the_mq_fd->Object.id; 8004570: 29 61 00 08 lw r1,(r11+8) 8004574: e3 ff ff c1 bi 8004478 8004578: b9 80 08 00 mv r1,r12 800457c: b9 60 10 00 mv r2,r11 8004580: f8 00 0d 85 calli 8007b94 <_Objects_Free> /* * errno was set by Create_support, so don't set it again. */ if ( status == -1 ) { _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 8004584: f8 00 12 12 calli 8008dcc <_Thread_Enable_dispatch> return (mqd_t) -1; 8004588: 34 01 ff ff mvi r1,-1 800458c: e3 ff ff bb bi 8004478 =============================================================================== 08016ea8 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 8016ea8: 37 9c ff 24 addi sp,sp,-220 8016eac: 5b 8b 00 44 sw (sp+68),r11 8016eb0: 5b 8c 00 40 sw (sp+64),r12 8016eb4: 5b 8d 00 3c sw (sp+60),r13 8016eb8: 5b 8e 00 38 sw (sp+56),r14 8016ebc: 5b 8f 00 34 sw (sp+52),r15 8016ec0: 5b 90 00 30 sw (sp+48),r16 8016ec4: 5b 91 00 2c sw (sp+44),r17 8016ec8: 5b 92 00 28 sw (sp+40),r18 8016ecc: 5b 93 00 24 sw (sp+36),r19 8016ed0: 5b 94 00 20 sw (sp+32),r20 8016ed4: 5b 95 00 1c sw (sp+28),r21 8016ed8: 5b 96 00 18 sw (sp+24),r22 8016edc: 5b 97 00 14 sw (sp+20),r23 8016ee0: 5b 98 00 10 sw (sp+16),r24 8016ee4: 5b 99 00 0c sw (sp+12),r25 8016ee8: 5b 9b 00 08 sw (sp+8),fp 8016eec: 5b 9d 00 04 sw (sp+4),ra int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; 8016ef0: 28 27 00 14 lw r7,(r1+20) uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 8016ef4: 37 8b 00 a8 addi r11,sp,168 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 8016ef8: 37 92 00 48 addi r18,sp,72 mode_t mode, const fat_file_fd_t *link_fd) { int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; 8016efc: 28 f5 00 08 lw r21,(r7+8) msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 8016f00: b8 20 98 00 mv r19,r1 fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; dir_pos->sname.ofs = 0; dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 8016f04: 34 0d ff ff mvi r13,-1 8016f08: b8 40 a0 00 mv r20,r2 8016f0c: b8 60 78 00 mv r15,r3 uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 8016f10: ba 40 08 00 mv r1,r18 8016f14: 34 03 00 40 mvi r3,64 8016f18: 34 02 00 00 mvi r2,0 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 8016f1c: 59 60 00 04 sw (r11+4),r0 8016f20: 59 60 00 08 sw (r11+8),r0 8016f24: 59 60 00 0c sw (r11+12),r0 8016f28: 59 60 00 10 sw (r11+16),r0 8016f2c: 59 60 00 14 sw (r11+20),r0 8016f30: 59 60 00 18 sw (r11+24),r0 8016f34: 59 60 00 1c sw (r11+28),r0 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 8016f38: b8 80 70 00 mv r14,r4 8016f3c: 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; 8016f40: 2a 76 00 08 lw r22,(r19+8) fat_file_fd_t *fat_fd = NULL; 8016f44: 5b 80 00 d8 sw (sp+216),r0 time_t time_ret = 0; uint16_t time_val = 0; 8016f48: 0f 80 00 de sh (sp+222),r0 uint16_t date = 0; 8016f4c: 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; 8016f50: 5b 80 00 c8 sw (sp+200),r0 dir_pos->sname.ofs = 0; 8016f54: 5b 80 00 cc sw (sp+204),r0 dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 8016f58: 5b 8d 00 d0 sw (sp+208),r13 dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 8016f5c: 5b 8d 00 d4 sw (sp+212),r13 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 8016f60: 5b 80 00 a8 sw (sp+168),r0 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 8016f64: f8 00 19 b3 calli 801d630 if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 8016f68: 34 03 01 04 mvi r3,260 8016f6c: 4c 6e 00 06 bge r3,r14,8016f84 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(ENAMETOOLONG); 8016f70: f8 00 16 21 calli 801c7f4 <__errno> <== NOT EXECUTED 8016f74: 34 02 00 5b mvi r2,91 <== NOT EXECUTED 8016f78: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8016f7c: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED 8016f80: e0 00 00 0c bi 8016fb0 <== NOT EXECUTED } name_type = msdos_long_to_short (name, name_len, 8016f84: b9 e0 08 00 mv r1,r15 8016f88: b9 c0 10 00 mv r2,r14 8016f8c: b9 60 18 00 mv r3,r11 8016f90: 34 04 00 0b mvi r4,11 8016f94: f8 00 02 1d calli 8017808 8016f98: b8 20 80 00 mv r16,r1 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 8016f9c: 5c 20 00 19 bne r1,r0,8017000 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one(EINVAL); 8016fa0: f8 00 16 15 calli 801c7f4 <__errno> <== NOT EXECUTED 8016fa4: 34 02 00 16 mvi r2,22 <== NOT EXECUTED 8016fa8: 58 22 00 00 sw (r1+0),r2 <== NOT EXECUTED 8016fac: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED err: /* mark the used 32bytes structure on the disk as free */ msdos_set_first_char4file_name(parent_loc->mt_entry, &dir_pos, 0xE5); return rc; } 8016fb0: b9 80 08 00 mv r1,r12 8016fb4: 2b 9d 00 04 lw ra,(sp+4) 8016fb8: 2b 8b 00 44 lw r11,(sp+68) 8016fbc: 2b 8c 00 40 lw r12,(sp+64) 8016fc0: 2b 8d 00 3c lw r13,(sp+60) 8016fc4: 2b 8e 00 38 lw r14,(sp+56) 8016fc8: 2b 8f 00 34 lw r15,(sp+52) 8016fcc: 2b 90 00 30 lw r16,(sp+48) 8016fd0: 2b 91 00 2c lw r17,(sp+44) 8016fd4: 2b 92 00 28 lw r18,(sp+40) 8016fd8: 2b 93 00 24 lw r19,(sp+36) 8016fdc: 2b 94 00 20 lw r20,(sp+32) 8016fe0: 2b 95 00 1c lw r21,(sp+28) 8016fe4: 2b 96 00 18 lw r22,(sp+24) 8016fe8: 2b 97 00 14 lw r23,(sp+20) 8016fec: 2b 98 00 10 lw r24,(sp+16) 8016ff0: 2b 99 00 0c lw r25,(sp+12) 8016ff4: 2b 9b 00 08 lw fp,(sp+8) 8016ff8: 37 9c 00 dc addi sp,sp,220 8016ffc: c3 a0 00 00 ret /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; /* set up last write date and time */ time_ret = time(NULL); 8017000: 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; 8017004: 33 80 00 b4 sb (sp+180),r0 /* set up last write date and time */ time_ret = time(NULL); 8017008: f8 00 27 ae calli 8020ec0